Chapter 5. Working with Content

Document types
WCM templates
DocumentType
The Dialog Syntax
Interceptors
Hidden fields
Non value field, nodetype or mixintype creation
Hidden field with default value
Non editable and visible if not null fields
WYSIWYG widget
Simple selectbox widget
Taxonomies

Each document type is represented by a node type in the JCR. Therefore, to create a new document type, you have to add a new node type. There are two ways to do this: through XML configuration files, or through the administration portlet.

To learn how to use the administration portlet, refer to the Admin Guide, found here:

(!) need link to admin guide

Otherwise, you can create a new document type by configuring the file /WEB-INF/conf/wcm-extension/wcm/nodetypes-configuration.xml in your extension.

(!) Comment from Philippe: this part should go in the JCR part in the architecture primer.

By defining a supertype, you can reuse other node types and extend them with more properties (just like inheritance in Object Oriented Programming).

The templates are applied to a NodeType or a metadata MixinType. Two kinds of templates exist :

From the ECM admin portlet, Manage Template lists existing NodeTypes that have been associated to Dialog and/or View templates. These templates can be attached to permissions (in the usual membership:group form), so that a specific one is displayed according to the rights of the user (which can be useful in a content validation workflow activity).

By placing interceptors in your template, you will be able to execute a groovy script just before and just after the node-save. Pre node-save interceptors are mostly used to validate input values and their overall meaning while the post node-save interceptor can be used to do some manipulation or reference for the newly created node such as binding it with a forum discussion or wiki space.

To place interceptors, use the following fragment :

Interceptor groovy scripts are managed in the 'Manage Script' section in the ECM admin portlet. They must implement the CmsScript interface. Pre node-save are passed input values within the context :

Whereas post node-save one are passed the path of the saved node in the context:

A taxonomy is a particular classification arranged in a hierarchical structure. Taxonomy trees in eXo Platform will help organize your content into categories.

When you create a new taxonomy tree, you add a preconfigured exo:action (exo:scriptAction or exo:businessProcessAction) to the root node of the taxonomy tree. This action is triggered when a new document is added anywhere in the taxonomy tree. The default action moves the document to the physical storage location and replaces the document in the taxonomy tree by a symlink of type exo:taxonomyLink that points to it. The physical storage location is defined by a workspace name, a path and the current date and time. As with adding document types, taxonomy trees can be managed either through the Administration portlet, or by adding XML files.

To configure taxonomy trees by adding configuration files in the /webapp/WEB-INF/conf/acme-portal/wcm/taxonomy/ directory, create a new file called $taxonomyName-taxonomies-configuration.xml. For example, if the name of your taxonomy tree is acme, the file should be named acme-taxonomies-configuration.xml.

You can view the file here: $PLFHOME/samples/acme-website/webapp/src/main/webapp/WEB-INF/conf/acme-portal/wcm/taxonomy/acme-taxonomies-configuration.xml

As you can see, the value-params allow you to define the repository, workspace, name of the tree and its JCR path. You can then configure permissions for each group of users in the portal, as well as the triggered action when a new document is added to the taxonomy tree. Finally, you can describe the structure and names of the categories inside your taxonomy tree.