taT | Configure Clusters and Modules

Yesterday, someone asked on the OpenIDE mailing list, “I wonder what is the absolute minimum of modules needed to start developing an app on the platform and after that adding my own modules.”

Tom Wheeler (NetBeans Dream Team Member) gave an excellent reply, and in his detailed answer, I found something that I will blog here and it will be another taT, that would help you tweak your “NetBeans Platform Application” and “Module Suite”.

As you know NetBeans 6.5 has a new Project Template for NetBeans Modules, its known as “NetBeans Platform Application”. You might find some Developer FAQ’s on several How To’s on Branding the Application, Disabling Modules, etc. Let me show you a cool way to manipulate the “NetBeans Platform Config” file to configure the Platform clusters and modules.

Brief Overview

Assuming the concerned project is opened, so Right-click the “Project Node” in Logical View, and select “Properties”. Now, on the left of the Wizard, you select “Libraries”, and on the right, you see related options to configure “Java Platform”, “NetBeans Platform”, as well as “Platform Modules” which are inclusive of “Clusters and Modules”.

Clusters and Modules

Generally, you would uncheck those clusters which you don’t want your application to be dependent on, that also means your application would build faster.

Also, changes get reflected in your App’s “platform.properties” file. So, if you want to avoid using GUI for removing a cluster, not specific modules within that cluster, and tweak it directly in the file.

Continue reading…

Tricks

Daily builds for NetBeans 6.5 have NetBeans Platform with following clusters-

apisupport1, gsf1, harness, ide10, java2, nb6.5,
platform9, profiler3, websvccommon1

By default, your application’s “platform.properties” file stored under nbproject and displayed as “NetBeans Platform Config” in Logical View, has contents..

nbplatform.active=default

That’s the only property you have. Now, suppose I want to remove gsf1 cluster from the above list, add the following property-

enabled.clusters=\
    apisupport,\
    harness,\
    ide,\
    java,\
    nb,\
    platform,\
    profiler,\
    websvccommon

So, as you can see the properties file doesn’t show version of the clusters (ordered alphabetically always), so its version independent as well. This is what you see when you remove gsf1 cluster using “Project Properties Wizard“, and rest are meant to be enabled by the Application you are using.

Now, if I want to restore gsf1, and remove websvccommon1, then you need to just tweak it as follows-

enabled.clusters=\
    apisupport,\
    gsf,\
    harness,\
    ide,\
    java,\
    nb,\
    platform,\
    profiler

If you remove some specific modules from a particular cluster, then following properties are added into the properties file-

disabled.modules=\
    {codename.base.of.modules}
enabled.clusters=\
    apisupport,\
    gsf,\
    harness,\
    ide,\
    java,\
    nb,\
    platform,\
    profiler,\
    websvccommon

Here you would see that when I disable (Please use GUI Wizard to disable) some modules from (suppose) java2 cluster, their “Code Name Base” would be added into the disabled.modules property. Also, you are required to add enabled.clusters property, with all clusters included.

Tips to Remember

This is also applicable to Module Suite project template, and you would see same files, where you can tweak as shown above. If you remove the property-

enabled.clusters=

Then, you would see your application/suite using all the clusters bundled with NetBeans Platform.

Suppose, when you disable a module A of cluster B, always add the enabled.clusters property as well and also, include the cluster B.

disabled.modules=\
    A
enabled.clusters=\
    B,\
    C,\
    D

If you disable the cluster, all the modules within the cluster automatically gets disabled. Not, vice-versa 🙂

Also, I recommend you to use GUI Wizard to disable specific modules, whether you’re an expert/not. Reason being that you might not know what dependencies the other modules have on this module A.

Someone has rightly said, “Prevention is better than cure”

However, if you want to enable some of the modules disabled using Wizard, then of course you may use the tweaks shown above to do the trick.

This blog has been contributed to NetBeans Community Docs Program and for latest updates on this content, refer to the contribution.

Hope this helps..

Advertisements

One thought on “taT | Configure Clusters and Modules

  1. Pingback: Building Pizza with Lookup (Part 1) « N, Varun

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s