Using XML Layers for Module Installation

As described in the Modules API, you can use an XML filesystem layer as part of the installation system for your module; the contents of the layer will be automatically included in the system file system only when your module is installed. The API Support includes support for creating and manipulating XML layers to make it easier for you.

First, there is a template for an XML layer in the Modules API section.

Second, the special tag OpenIDE-Module-Layer is recognized in module manifests and will display the layer currently set for a module, if any. In the Explorer, just Copy your new layer and Paste to the Layer category underneath the manifest node.

Third and most interestingly, XML files in general which correspond to the DTD for layers are marked with a special    icon. They may be opened as XML text and edited. The node in the Explorer for the layer displays underneath it the files that it will install, in their natural structure. This way you can test that all resources you mention are available, that various file attributes such as template are recognized as you expect, and so on. To correct something, just edit the file and save it - you will see the results immediately in the Explorer.

If there is some sort of parse error in the XML file, the layer node will show a red X to indicate the error, and the details will be printed to a tab in the Output Window. When you correct the error, the mark will go away and you should again see the current set of installed files.

If you use the following special attributes recognized by the system file system, the layer node will mimic their effect for you in advance: SystemFileSystem.localizingBundle, of string type and pointing to a bundle file (by resource name, e.g. org.netbeans.modules.foo.Bundle) which has keys (named according to file paths, e.g. Templates/Other/foo.qqq) giving localized display names for files; and SystemFileSystem.icon and SystemFileSystem.icon32, of URL type and pointing to icon images to be used in place of the default icons for the files.


Back to Contents