McIDAS-V supports a plugin architecture that allows for the easy extension and addition of functionality. A plugin is most commonly a Java Jar file that contains a set of resource files (e.g., color tables) and/or Java class files. The plugins are stored on a local directory or could be loaded form a web site. McIDAS-V processes the plugin Jar file at run time loading in the contained resources and code.
To make these into a plugin, e.g., myplugin.jar, simply jar the the files (you need to get a Java SDK for this):
jar -cvf myplugin.jar colortables.xml default.py
Now this plugin can be distributed to others and loaded into their McIDAS-V environment.
So, you might ask how does McIDAS-V recognize these files in the plugin and treat them appropriately? McIDAS-V loads in a set of resources (e.g., color tables, Python libraries). Each resource type is identified by a regular expression as shown in the resource list. In our example above the file name colortables.xml matches the pattern for color table xml resources.
Now, what happens if you have some file whose name does not match a pattern? Say, you have a color table xml file called myspecialtables.xml that you want to include in a bundle. In that case you can add a .rbi file, as described here, that defines this file as a resource:
This acts as a table of contents for the plugin. Make sure that the location is not relative. Note: Jar files can contain directory trees. e.g., /tables/myspecialtables.xml. In this case just have the location point to:<?xml version="1.0" encoding="ISO-8859-1"?> <resourcebundle> <resources name="idv.resource.colortables"> <resource location="/myspecialtables.xml"/> </resources> </resourcebundle>
... <resource location="/tables/myspecialtables.xml"/> ...
/edu/ucar/app/Test.class
For a single class file this is not necessarily required but if there are multiple class files that have interdependency among themselves then you will get into trouble if you don't follow this structure.
Now, what this code does can be anything and is best left up to the developer's guide.