Blog Series and PrayogShala

PrayogShala (New Blog)

I have some important news to share, I will contiuning some of the blog series (started here) at another blog. As announced yesterday, I have launched the new blog today.

Currently, there are two posts. One of the them, continues the series I started here with the following blogs;

Hope you will like this change. Also, I have changed the look of this blog as you would notice. Hoping I will continue to provide quality content on both blogs and interested readers may read more about the new blog.

Stay tuned..

Hyperlink Navigation Renaissance | #2

Last year, I had written a blog on Hyperlink Navigation Renaissance, here’s brief overview;

After lot of discussion on OpenIDE mailing lists, exploring Developer FAQ’s, exerting my wrist, flexing fingers and what not? Finally, hit the deck hard! Yeah, Hyperlink Navigation in NetBeans got smarter! Especially, for HTML documents.

That time, I had developed a plug in, which I have started to discuss about more these days. Yes, its Revamped Hyperlink Navigation and here are list of blogs discussing about it;

These blogs basically describe the history of this plug in, pointers to available resources at Kenai and how do I use SVN for managing the plug in source code from CLI, as well as from NetBeans IDE.

Now, I would like to tell you that there has been many changes since and I thought community would be interested to see the updates in the tutorial, I wrote last year. Have a look at this wiki for updates, rather than the entry at NetBeans Zone (If you want to, then see the comments for updates).

Changes done..

I have got rid of overloaded setPosition methods, instead there would be one method from now onwards. While, some of the methods were renamed and some are no longer parameterized. This has reduced lot of redundant code and now, the code looks really neat. Making use of various editor features to cut-short long line of codes has helped.

Also, I removed the parameterized constructor, instead introduced a public method to pass necessary parameters from HyperlinkProvider implementation. This was done so as to possibly introduce an interface, which the module would depend on, while its implementation is available in another module. Yes, I am trying to make use of Lookup API to achieve same result.

Only issues I have, that currently one module can only depend on another user-defined module within a suite project. However, module I created is standalone one and its not possible to depend on another module, AFAIK. If you know of ways to do so, let me know or join this project to work towards achieving this.

NetBeans 6.7 and Manage Platforms..

All of this was possible due to a feature I recently discovered in NetBeans 6.7 IDE, which was there in previous releases as well. However, I never really explored it. By the way, NetBeans 6.7 FCS is released. Check out the new, super cool homepage of NetBeans DOT org.

NetBeans 6.7 FCS released!

Stay tuned..

#3 | Geertjan Blogs and Kenai

Dec, 2008

Nearly 6 months back,I had published 2nd part of the blog series, I started to share what I learnt while creating a project type. However, I couldn’t continue as I got busy with my internship commitments and engineering studies. I thought I would see many blogs after that from community side. I got few nods as well, but I am disappointed with them as they didn’t deliver.

May, 2009

I saw Geertjan wrote mini-blog-series (May, 2009) with code and hints on how to get started creating project type. That was really cool. Finally, it looked like my prayers were heard. Have a look at them;

  1. @AntBasedProjectRegistration
  2. @NodeFactory.Registration
  3. Build Project Command for Ant Based Project Types

Geertjan made use of NetBeans 6.7 daily builds for creating the prototype explained above. So, why not get started with these blogs?

June, 2009

I will soon continue with my exploration stopped long time back and will continue to post my learning in the coming months. Also, I have written a post in discussion forums to begin creating a project type.

Other News
Get to know more about my NetBeans plugins at Kenai and I also shared some tips and Tricks based on NetBeans Platform.

Come on, get started and share what you explore. Stay tuned for more..

SVN using CLI and NetBeans

Recent exploration in the world of FOSS has helped me adopt SVN more easily than ever before. In this post, I will share some of my learnings about working with SVN using CLI and NetBeans.

Basically, I am going to map every possible command that were used on Command Line Interface (CLI), during past 2 weeks to the functionalities provided by Subversion Support in the NetBeans IDE (6.0+).

NetBeans IDE 6.7 RC2 (Click to enlarge)

Using 6.7 RC2 for demonstration,

After making project and their respective copies in the SVN repository of my plug in at Kenai. I forgot to update the /trunk after I had fixed a bug that was affecting plugin’s version v1.0, which was fixed for version v1.1. Actually, I had earlier made a tag by copying the sources from “/tags/release60_base/plugin-code-base” to “/tags/release60_fixes/plugin-code-base”.

I started fixing the code in the tagged repository before renaming/moving the repos to “/branches/release60_fixes/plugin-code-base”. Then, I realized that I had not merged the changes to the /trunk, which was required. So, we will see in the rest of this blog, how to do the merge using CLI and NetBeans IDE.

Using Command Line Interface

Now, I need the working copy of the code kept at /trunk, so I have to do a checkout, first.

svn checkout URL

You can learn more about the checkout from the book of Version Control with Subversion. I have substituted URL with in the above, as well as the following command(s).

Now, having read the common use-cases of Merging Whole Branch to Another in the book, I decided to give it a try using CLI. So, I did the following;

svn log --stop-on-copy URL

Here’s what the book states;

The log subcommand will normally show every change ever made to the branch, including tracing back through the copy which created the branch. So normally, you’ll see history from the trunk as well. The --stop-on-copy will halt log output as soon as svn log detects that its target was copied or renamed.

Now, this presents the required textual information, and I found out that copy was made in revision r25 and last commit was made in revision r32. Now, we know where the changes took place since making the copy of trunk in r25. As per the book, I used the following command to do the merge;

svn merge -r 25:32 URL

Firstly, change the directory to the working copy and if we use svn merge, it assumes that current directory is the working copy. So, it will apply changes that happened between r25-r32 to the working copy. It may happen that there might be some conflicts, which you can resolve from command line. Now, use the following to see the status and detect any conflicts of the working copy after merging has been done;

svn status

The console output shows only modifications (denoted by M), addition (denoted by A)/deletion (denoted by D) or conflicts (denoted by C). If there are any conflicts, they are required to be resolved. So, please refer this guide on how to resolve the conflicts using CLI. Once they are resolved, you should commit the changes to the server (/trunk).

svn commit -m some_message

where some_message = “Merged changes r25:32 into the trunk..”

Hit Enter button to send the changes to the server. The book states,

Again, notice that the commit log message very specifically mentions the range of changes that was merged into the trunk. Always remember to do this, because it’s critical information you’ll need later on.

Using NetBeans IDE

Now, I will show you how to do the same using NetBeans IDE to increase productivity, without worrying about typing issues that may occur using CLI. Also, changing directories, retrieving logs, doing manual merge, etc.

All of these may go easily wrong.. Although, its good to know how to work using CLI. Its much better to use IDE’s for the same purpose. Thus, I have written this blog that may help you switch to NetBeans IDE for the same.


Firstly, goto Team | Subversion menu and select Checkout… This will open a wizard where you will enter the URL, username and password. Now, refer this blog on how to checkout the code and configure it, as per the requirements. Once its done, project will be opened and displayed under Projects window.

Merge Changes..

Right-click the project node and select Subversion from the context menu. Then, select Merge Changes.. from the menu as displayed here;

Merge Changes.. (Click to enlarge)

Soon, following window opens that lets you configure the way you want the merge to happen and that too, in one step! Have  a look;

Merge Revisions (Click to enlarge)

You can see various options in the form of drop-down list and browse, search buttons. I willl brief you about the same as we move ahead. Drop-down list have three options to choose from;

Type I – One Repository Folder Since its Origin

Merge Revisions Type I (Click to enlarge)

Type II – One Repository Folder

Merge Preview Type II (Click to enlarge)

Type III – Two Repository Folders

Merge Revisions Type III (Click to enlarge)

So, I selected Type II because I want to merge changes from single repository folder (/branches/release60_fixes) which is other than the working copy, synchronized with (/trunk). This preview is shown within the same window and can be viewed by scrolling down the same window.

Browse.. will let you choose the repository folder to merge from. We will choose /branches/release60_fixes/ahrefhyperlink.revamped (This folder might change in future, you may expand /branches as shown in the figure to observe changes taken place) for merge. Have a look;

Browse Repository Folders (Click to enlarge)

At the beginning of this entry, I mentioned that one can find out that changes between which versions have to be merged in the working copy. To do that, one has to make use of svn log. In this case, one would just click the Search.. button and following window pop-up!

Log changes (Click to enlarge)

Clicking List will list all the changes that have occurred since the date entered in the shown field. As you can see tag was made in r25 and last code update took place in r32. So, we will first choose the revision #25 for Starting Revision and #32 as Ending Revision, one-by-one. See the following figure;

Merge Revisions (Click to enlarge)

This works same as the  svn merge command used earlier. Click Merge button to commence the merge operation. Once the merging is finished, one can see whether there are any conflicts or not.

Conflicts may occur, when the HEAD revision of the /trunk repository is not in sync with the other repository, when sources were first copied from /trunk. See the following figure, I got two file conflicts;

Merge Conflicts Part 1 (Click to enlarge)

For resolving conflicts, you may refer this guide written by Sun Technical Writers. Once conflicts are resolved, you must now commit the sources with this message as recommended earlier, “Merged changes r25:32 into the trunk”. That’s all for the day. Hope this helps you get started effectively.

Reference Guide

NetBeans Plugins at Kenai | #2

This post will focus on work flow of my plug in Revamped Hyperlink Navigation (RHN). Without much ado, lets get started..

Getting Started

Firstly, you need to access the existing sources available for plug in, published in Update Center for NetBeans 6.0 and then, I will use NetBeans 6.5 as the development software for demonstration. So, run NetBeans IDE (bundled with either Java SE, Java or All technologies).

NetBeans 6.5 boots with a b'day stamp on splash screen!

Checkout Sources..

Open Versioning | SVN menu and select Checkout… from sub-menu. Checkout Wizard opens.. Now, enter Repository URL as and click “Next >.

You might be prompted by the NetBeans to accept certificate, click on Accept Temporarily and continue.. Now, click on the Browse button to select the Repository Folder needed to be checkout. Select /rhn_v11/ahrefhyperlink.revamped and specify your Local Folder. Also, select the checkbox with label as Scan for NetBeans Projects after checkout and click Finish. NetBeans will prompt you to open project AhrefHyperlink (Revamped). Click Open Project and NetBeans will open the project for you. Now, right-click the project node and select Properties.

Reference Guide

Manage Platforms…

Now, goto Libraries and you will notice that NetBeans Platform selected for project is the default build provided by the NetBeans 6.5 IDE, and similarly for Java Platform. So, you need to configure the project to be built against NetBeans 6.0. Therefore, refer this tips and Tricks to learn how to “Manage Platforms…“. Also, choose JDK 1.5 for Java Platform (JDK 1.6 should also work fine).

See Module in Action..

Once you are done with it, click OK to save project properties. Now, Clean and Build the project and Run to see this module in action. If success, the NetBeans 6.0 splash screen pops up and soon, NetBeans 6.0 instance is running with the plug in, installed. Try out the cases specified in the tutorial and then, try out some new one’s from your side. Observe where it works and where it doesn’t.

If you find any issues/bugs, kindly file it using JIRA Issue Tracker used for this project and select component nbm-hyperlink. Soon, I will write wikis so as to help you understand how to file issues for this project. Fixed sources are stored under /nbplugins/branches as /release60_fixes/ahrefhyperlink.revamped (Links updated).

Unstable code is placed under /nbplugins/trunk and you may see what new developments take place there.

Stay tuned for more!