<< Back - Alkacon logo

OpenCms 6.0 interactive documentation:

Creating a new module

OpenCms logo - Forward >>

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 Create module button:

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


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.
  • All input fields are optional except the package name which is a mandatory field. Any of these optional fields can be changed at any time by using the Administrate entry in the context menu of a module, which will re-open the same dialog as in the screen shot. The exception are the options Export ... folder. You can not change these options later.
  • 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 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. the last part of the version number will be incremented by one when the module is exported.
  • Checking the Simple module type is very important! This option is checked by default. OpenCms 5.0 introduced this "simple type" format for modules because it is much easier to maintain than the format of previous versions ("traditional" modules). The old style "traditional" modules are not supported anymore, this checkbox is only included because the old gui is still in use.
  • Administration point and View are deprecated, use additional resources instead.
  • Export classes/ folder and Export lib/ folder will add two "export points" in the module's configuration section in the opencms-modules.xml. Using these export points, the content of the module subfolders org.opencms.mymodule/classes/ and org.opencms.mymodule/lib/ will be exported during the publishing process into the WEB-INF/classes/ folder of your web application context on the "real" file system of the server. Please don't mistake these export points with the static export configured in opencms-importexport.xml! Module export points are useful if you want to ship Java archives, classes or other resources with your module that must be loaded by the Java Classloader at runtime. If you ship such resources for the Java Classloader with your module, the OpenCms server must usually be restarted after the installation of the module.
  • Again, the options Publish event class andMaintenance class  are deprecated. The Publish event class is mapped to the new ActionClass, which is necessary for advanced module programming. See the JavaDocs of the I_CmsModuleAction interface for more information.
  • The fields Author and Email can be used to provide information about the author of the module.
  • The field Date created will be filled with the current date when the module is created, but can also be changed to any other date. Please note that the format of the date is dd.mm.yyyy .

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.

©2003-2005 Alkacon Software (http://www.alkacon.com) - The OpenCms experts