How to create a new OpenCms module

The administration of modules is done under the Administration view. Change to the Administration view and then choose the item Module Management. In the next screen a list with the modules that are already installed is shown.

In this view new modules can be created. To do so, make sure you are not in the Online project. Press the  New Module button:

The creation of a new module is done with the help of a dialog:

 

Description of the input fields in detail
  • Please note that you have to be within an offline project that contains the root-folder to be able to start the creation of a module with a folder structure.
  • All input fields are optional except the package name and the module version which are mandatory fields. Any of these optional fields can be changed at any time by clicking on the Edit icon of a module in the module list, which will re-open the same dialog as in the screen shot. The exception are the options of Module folders. You can not create these folders later.

Module information

  • Package name determines a unique name of the module. It has to be a name that follows the Java naming conventions for package names. For example, your module could be called org.opencms.mymodule. This name has to be selected during the creation of the module and can't be changed afterwards. Your module might contain Java classes. The package name of your module and the package name of your Java classes have to be exactly the same. Thus, your classes for the above example should reside in the package org.opencms.mymodule.
  • The Module name can be freely chosen and should be a descriptive name for the module.
  • The Module description can be freely chosen and should describe the module features in short.
  • The Module version is the version number of the module (as a float). You should increase the version number of your module when you release new or updated versions. Version number can be separated into 4 parts (e.g. 1.2.3.4) the last part of the version number will be incremented by one when the module is exported or changed.
  • The Module group can be used to group modules which belong together. The module list can be sorted by the module group value.
  • The Action class determines the Java class (including the package name) that is called on module initialization or modification. See the JavaDocs of the I_CmsModuleAction interface for more information.

Module creator

  • The Author name and Author email field can be used to provide information about the author of the module.

Module folders

  • If checked, the option Create Modulefolder creates a module folder in the VFS folder /system/modules/ of OpenCms. The module folder is the package name of the new module, e.g. org.opencms.mymodule/.
  • The following checkboxes activate the creation of module subfolders, e.g. for storing templates or JSP elements in you module.

After you have filled out all fields carefully, finish the module creation dialog by clicking Ok. To add further configuration settings to your module, such as module dependencies or module properties, please refer to the section Administrating a module for further documentation, because these settings are not configured during module creation.