diff --git a/src/site/apt/module-system.apt b/src/site/apt/module-system.apt index 3d0af26fd..08e54455d 100644 --- a/src/site/apt/module-system.apt +++ b/src/site/apt/module-system.apt @@ -18,21 +18,21 @@ The module system of LibreCCM technologies. The module system is build around the classes in the - {{{file:///home/jensp/pwi/libreccm/ccm/ccm_ng/target/staging/ccm-core/apidocs/index.html?org/libreccm/modules/package-summary.html}org.libreccm.modules}} package. + {{{./ccm-core/apidocs/index.html?org/libreccm/modules/package-summary.html}org.libreccm.modules}} package. When the LibreCCM application is started by the Application Server two things will happen. First the - {{{file:///home/jensp/pwi/libreccm/ccm/ccm_ng/target/staging/ccm-core/apidocs/index.html?org/libreccm/modules/CcmIntegrator.html}CcmIntegrator}} + {{{./ccm-core/apidocs/index.html?org/libreccm/modules/CcmIntegrator.html}CcmIntegrator}} is executed. The integrator checks for new or updated modules and executes DB migrations if necessary. We are using the - {{{http://www.flyway.org}Flyway}} framework for this. We have + {{{http://www.flywaydb.org}Flyway}} framework for this. We have to execute these migrations before the Application Server starts the JPA Persistence Unit and the JPA provider validates the database structure. Unfortunately the JPA specification does not provide a hook for doing such things. Therefore we have to use a Hibernate specific API for that. Secondly the - {{{file:///home/jensp/pwi/libreccm/ccm/ccm_ng/target/staging/ccm-core/apidocs/index.html?org/libreccm/modules/CcmModuleContextListener.html}CcmModuleContextListener}} + {{{./ccm-core/apidocs/index.html?org/libreccm/modules/CcmModuleContextListener.html}CcmModuleContextListener}} is called when the <<>> is initialised. The <<>> is an ordinary <<>>. We use the new annotations (<<<@WebListener>>>) to register the listener. diff --git a/src/site/apt/module-system/anatomy.apt b/src/site/apt/module-system/anatomy.apt index 7172fee6a..0d048efbe 100644 --- a/src/site/apt/module-system/anatomy.apt +++ b/src/site/apt/module-system/anatomy.apt @@ -8,4 +8,91 @@ Anatomy of a LibreCCM module - Lorem ipsum dolor \ No newline at end of file + A LibreCCM module contains of several files which are used by the module + system to locate the module and to install and run the module. If you use + the <<>> archetype for creating module all these files are + already in place. Some of the files need to be customising of course. + + Each module must contain a class which implements the + {{{../ccm-core/apidocs/index.html?org/libreccm/modules/CcmModule.html}CcmModule}} + interface. The {{{../ccm-core/apidocs/index.html?org/libreccm/modules/ModuleManager.html}ModuleManager}} + and other classes of the module system use the <<>> to locate + the available modules. Therefore for each implementation there must be + a file <<>> + (in the Maven sources this file is located at + <<>>)which contains + a line with the implementation. + + Additionally there must be a module info + file which contains informations about the module. This file is found in + the <<>> directory (<<>> in + the sources). The name of the file is the fully qualified name or the + class implementing the <<>> interface, followed by the + <<<.properties>>> extension. For example if the module class is + <<>> the module info file is + <<>>. The file itself + contains four properties: + + * groupId + + * artifactId + + * version + + * build.date + + [] + + The first three properties are equal to the properties in the <<>> + of the module. It is not necessary to maintain the file manually. Instead + Maven can put the correct values in. The module info file should like this: + +-------------------------------------------------------------------------------- +groupId=${project.groupId} +artifactId=${project.artifactId} +version=${project.version} +build.date=${timestamp} +-------------------------------------------------------------------------------- + + In the <<>> of the module resource filtering must be enabled: + +-------------------------------------------------------------------------------- + + ... + + ... + + + src/main/resources + true + + + ... + + ... + +-------------------------------------------------------------------------------- + + Also the build timestamp property needs to be set: + +-------------------------------------------------------------------------------- + + ... + + ... + ${maven.build.timestamp} + yyyy-MM-dd'T'HH:mm:ss'Z'Z + + ... + +-------------------------------------------------------------------------------- + + The DB migrations for a module must be located in + <<>>. Please note that hyphens in the + artifact id are replaced with underscores because hyphens are not allowed + in the names of Java packages. Migrations can either be written + in SQL or in Java. In most cases SQL should be sufficient. For each + supported database there is subdirectory/subpackage named for the database + management systems supported by LibreCCM. At the moment this will be + <<

>>, <<>> and <<>>. If you used the archetype to create + the module project empty files for the initial migration are already there. \ No newline at end of file