|
Extension Structure and Deployment |
Top Previous Next |
|
Extensions follow a common directory structure regardless of what language is used to create them. In fact, different languages can be matched inside of a single extension. The structure looks like this:
Replace with diagram
Everything for an extension goes in a single folder. It's recommended that the extension name for this folder is used, but it isn’t necessary as the Extension.xml file (described below) contains the extension name the server will use. Technically the Extension.xml file is the only thing required to create an extension, but wouldn’t be a very useful extension by itself.
The config folder is optional and is used to contain any configuration files specific to your extension. The contents of the configuration folder will be added to the classloader for this extension. A good use for the config folder is the applicationContext.xml file used for Spring or HBM files used for Hibernate.
The lib folder is optional and contains any libraries you need for your extension. In practice, these will be jars and other dependencies. They will all be added to this extension's classloader instance.
The scripts folder is optional and contains all the script files needed by the extension. These files can be in any language the server supports.
The classes folder is optional and is the equivalent to the scripts folder but for Java classes. Any compiled classes will go in this folder as it will be added directly to the classloader. |