Distributing a custom plugin

While you can run your customized INTViewer from NetBeans, this is not a practical option once the development of your module is complete. You can run your customized INTViewer by exporting your module as a NBM plug-in, importing and installing this plug-in into INTViewer, either directly or through an update center.

In this example, we use the module that was developed in the tutorial.

Exporting your module as a plugin/NBM file

This procedure is done by the developer of the module.

  • Right-click your module name and select Create NBM.

This creates a NBM file whose location is specified in the Output window:

  • Copy in your clipboard the location after "Building jar:".

Importing your plugin file from the file system

This procedure will be used by all users of your customized INTViewer.

  • Go to the location on your disk where INTViewer is installed, and double click INTViewer.bat

Note for developers: If you have already installed INTViewer for development purposes, and to avoid conflicts, do not use the same location for INTViewer as your development installation. Install INTViewer in another location on your disk and use that distribution instead. Do not forget to copy the license.dat file to that new location. Make sure you closed all NetBeans windows and removed the .netbeans directory in C:\Documents and Settings\your login\.netbeans.

  • In INTViewer, open Tools -> Plugins
  • Verify that your module (MyModule1 in this case) is not already listed. Uninstall it if it is present by checking the checkbox next to it and then clicking the Uninstall button.
  • Click Downloaded
  • Click Add Plugins
  • Paste in File Name the path of the NBM file that was created earlier
  • Click Install
  • Follow the wizard

Running your plugin

In this example, you can verify that your plugin was correctly imported and is running by selecting Window -> traceInfo.

The "distribution" of a custom INTViewer application consists in the distribution of the regular INTViewer installer along with one of several custom NBM files to import as plugins. It is recommended that users store their NBM files in the user_nbms directory under the INTViewer installation root directory. For example, if you installed INTViewer in C:\Program Files\INT\INTViewer, the directory is C:\Program Files\INT\INTViewer\user_nbms.

Adding an Update Center

Sometimes, it is cumbersome to exchange module distributions and have each user keep track of the latest updates. If you have have an internal web site you can post files to, you can post your module distribution updates to that web site and have users automatically download the latest updates. Your web site is your "Update Center".

In this walkthrough, we assume that the address of your web site is http://myinternalwebsite.mycompany.com, and that you have a directory "myupdates" accessible from the root of that site at http://myinternalwebsite.mycompany.com/myupdates/.

  • Right-click MyModule1 and select New -> Update Center
  • Enter http://myinternalwebsite.mycompany.com/myupdates/updates.xml in the URL to Update Descriptor field, and My Company Update Center in the Display Name field
  • Click Finish

This update center has been automatically registered in the layer.xml file.

The two field entries have been saved automatically in the Bundle.properties file.

Adding a Module Suite

  • Click File -> New Project
  • In the New Project wizard select NetBeans Modules from the Categories list and Module Suite from the Projects list and click Next >
  • In the Project Name field, enter MyModuleSuite1
  • Right-click the Modules directory and select Add Existing...
  • Select mymodule1 in your NetbeansProjects folder

Creating an Updates directory

  • Right-click MyModuleSuite1 and select Create NBMs

The Output window shows where the updates directory has been created.

  • Upload the content of the updates directory to your internal web site

Once uploaded, your module should be accessible to all users from http://myinternalwebsite.mycompany.com/myupdates/mymodule1.nbm. The system file updates.xml file is used by NetBeans on startup to detect updates to that module, and all other modules in the suite.

Registering an Update Center

Once setup, you can also use your update center to let users list and install available modules. To register an update center, follow these directions:

  • Select Tools -> Plugins
  • Click Settings
  • Click Add (on the bottom right of the screen)
  • Enter My Company Update Center in the Name field
  • Enter http://myinternalwebsite.mycompany.com/myupdates/updates.xml in the URL field

After registering this update center, all modules in your suite are available in the "Available Plugins" tab.