Search in the Documentation:

Anatomy of a module

If you used the maven archetype to create your module, you should have the following structure created on your disk.

D:\PROJECTS\DOG

	│ pom.xml
	└───src
	├───main
	│ ├───import
	│ ├───java
	│ ├───resources
	│ │ └───META-INF
	│ │ dog.tld.disabled
	│ │
	│ └───webapp
	│ ├───css
	│ ├───icons
	│ ├───img
	│ ├───javascript
	│ ├───META-INF
	│ │ │ definitions.cnd
	│ │ │ rules.drl.disabled
	│ │ │
	│ │ └───spring
	│ │ dog.xml.disabled
	│ │
	│ ├───resources
	│ │ __resourceBundleName__.properties
	│ │
	│ └───scripts
	└───site
	│ site.xml
	│
	└───apt
	index.apt

The pom.xml file allows integrating your module in your IDE as well as building the project using Maven.

It also defines module informations like the module type and the module dependencies.

 

main/import

main/import can contains xml files that will be imported into the JCR when the module is deployed

main/java

contains java classes or jars

main/resources

Contains resources for the module, like tld for tags.

main/webapp/css

contains css style sheets

main/webapp/icons

contains png files that will be used by Jahia to create icons of the different components declared in the module

main/webapp/img

contains the static images called by the views or by the CSS

main/webapp/javascript

contains the Javascript files of the module

main/webapp/META-INF

is a protected folder, it contains the definitions and the rule files. Those files could be put at the root level but for security reasons we strongly advise you to use the META-INF folder.

main/webapp/META-INF/definitions.cnd

contains the nodeType definitions

Main/webapp/mETA-INF/rules.drl.disabled

contains rules (Drools engine) for the module. File must be renamed rules.drl to be activated.

main/webapp/META-INF/spring

contains Spring Framework configuration files

main/webapp/resources

contains resource bundle files, used to set parameters and to declare multilanguage keys and values

main/webapp/scripts

 

site/apt

contains .apt files and images. Apt files are text files that can be transformed into html using the maven command mvn:site. Jahia uses this format to provide local documentation. To know more about the apt format, please read http://maven.apache.org/doxia/references/apt-format.html