Packaging and Distributing a Plug-in Module


Plug-in modules are packaged for delivery in binary format. The file extension of plug-in modules is .nbm. An NBM file is very similar to a JAR file, with only a few differences. The main differences between NBM files and JAR files are:

  • An NBM file can contain more than one JAR filemodules can package any libraries they use into their NBM file.

  • An NBM file contains metadata that can be used to display information about the module in an update center, such as the manifest contents, the license, etc.

  • An NBM file can be signed for security purposes.

The IDE uses an Ant script to create NBM files. Therefore, you do not need to worry about the exact contents of an NBM filejust let the standard Ant build script for NBM creation take care of it for you. To create an NBM file:

  1. In the Projects window, right-click the node of the module project you want to build.

  2. Choose Create NBM.

If you are developing a module suite project, you have several additional choices to make. You can upload an image that will be used as the application's splash screen. In addition, you can set the name of the executable, which is the binary that the user actually starts, and the application's title bar. You can also let the IDE create a ZIP file of your application. When the IDE creates the ZIP file, it also creates a launcher, which it includes in the ZIP file. Finally, you can let the IDE create a JNLP file so that the application can be started over the Internet.

Once you have packaged a plug-in module, you can distribute it via an Update Center. To put together an Update Center, you must create an autoupdate descriptor that provides information about the plug-in module, such as the location of the NBM file and its module dependencies. An autoupdate descriptor is an XML file with a specific structure and content.

After placing the autoupdate descriptor and the NBM files on a server, you must make the URL to the autoupdate descriptor available to your target audience.

The autoupdate descriptor can be hosted on a different server from where the NBM files are found. Use the distribution element in the autoupdate descriptor to specify the location of the NBM file.


The URL looks similar to the following:

http://www.netbeans.org/my_autoupdate_center.xml


The target audience must then register the new autoupdate center by specifying the URL to the autoupdate descriptor in the Options window, as shown in Figure 17-12.

Figure 17-12. Registering an autoupdate descriptor in the Options window


Once NetBeans IDE knows the URL to the autoupdate center, you use the Update Center wizard to access the NBM files, as shown in Figure 17-13.

Figure 17-13. Getting a plug-in module from an update center


Updates to plug-in modules can be distributed in the same way. When you have developed a new version of a plug-in module, you can make it available via your Update Center. The same approach can be used for distributing modifications and patches to rich-client applications.



NetBeans IDE Field Guide(c) Developing Desktop, Web, Enterprise, and Mobile Applications
NetBeans IDE Field Guide(c) Developing Desktop, Web, Enterprise, and Mobile Applications
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 279

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net