Plugins
 
Section 8.5: Plugins
RAMADDA has a plugin facility that enables one to add new kinds of entry types, new content views, etc. In the RAMADDA home directory there is a "plugins" sub-directory. When RAMADDA starts up it loads all of the files in the plugins directory. When you install a new plugin you need to restart RAMADDA.

The plugins can be built from source or are available at the Geode Systems RAMADDA site. To install a plugin just download the file and copy it to the RAMADDA home directory plugins directory. There are a core set of plugins that are released in the allplugins.jar file. This file can get installed during installation or can be installed later. Once the allplugins.jar is installed any new versions of RAMADDA will automatically update this plugin.

How plugins work

RAMADDA determines what to do with a plugin file by looking at its file name. If the file is a .zip file RAMADDA will unzip the files in the zip file and load each one as a plugin. If the file is a jar file it will crack open the jar file and look at each contained file. It handles the files in the following way:
  • .properties
    Any ".properties" files are loaded as system properties.
  • .pack
    RAMADDA supports multiple language translations. Any plugin file that ends with ".pack" (e.g., sp.pack) is loaded as a language pack. See an example.pack file at the Github site. There is documentation in the file.
  • template.html
    Any file that ends with "template.html" is treated as an html page template. More documentation is available here.
  • htdocs
    If you have an "htdocs/somename" directory in your .jar plugin file then HTML content in that directory can be served up by RAMADDA. If you have a file "htdocs/somename/index.html" then RAMADDA will include a link to that file from the main Help page. RAMADDA will extract the page title from the index.html file. This is how this user guide is distributed. This allows you to include documentation within your plugin.
  • .class
    Any .class file is loaded via a classloader. Some classes are special in that RAMADDA needs to know about them and instantiate them. This includes any harvesters, User authenticators, page decorators, etc. You need to define the full class paths for these classes in a file that ends with "classes.txt", e.g.:
    org.ramadda.plugins.ldap.LDAPAdminHandler
    org.ramadda.plugins.ldap.LDAPUserAuthenticator
    
    • If the class is an instanceof a org.ramadda.repository.auth.UserAuthenticator then the class is instantiated and it is used to handle user login and authentication.
    • If the class is an instanceof org.ramadda.repository.AdminHandler then the class is instantiated. You can use this to add new apis into the repository and to add admin configuration options.
  • api.xml
    If the file ends with "api.xml" then it defines new web application apis.
  • types.xml
    If the file ends with "types.xml" it defines new repository entry types.
  • outputhandlers.xml
    If the file ends with "outputhandlers.xml" it defines new output handlers.
  • metadata.xml
    If the file ends with "metadata.xml" it defines new metadata types.
  • .py
    If the file ends with ".py" then it defines new jython routines that are loaded into any jython interpreter (e.g., used by the repository script entry type).
  • .sql
    If the file ends with ".sql" then the file is evaluated at startup to define new database schemas.

Adding map layers

You can integrate map layers from external Web Map Servers (WMS) through the plugin mechanism. The file chinamaps.properties.txt has an example. Remove the ".txt" suffix and copy the properties file to your RAMADDA plugin directory. The file has instructions on how to specify the WMS layers.