Overview

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 (very useful in a content validation workflow activity).

DocumentType

Templates are written using Groovy Templates and will require some experience with JCR API and HTML notions.

Dialogs are groovy templates that generate forms by mixing static HTML fragments and groovy calls to the components responsible for building the UI at runtime. The result is a simple but powerful syntax.

These following parameters are common and can be used for every input fields.

Parameter Type Required Description Example
jcrPath String

relative path inside the current node jcrPath=/node/exo:title
mixintype String with comma , character

List of the mixin types you want to initialize when creating the content

mixintype=mix:i18n

validate String with comma , character

List of the validators you want to apply to the input. Possible values are : name, email, number, empty, null, datetime, length OR validator classes

validate=empty

validate=empty,name

validate=org.exoplatform.webui.form.validator.StringLengthValidator

editable String

The input will be editable only if the value of this parameter is if-null and the value of this input is null or blank editable=if-null
multiValues Boolean

Show a multi values component if true. Must be used only with corresponding multi-values properties. The default value of this parameter is false multiValues=true
visible Boolean

The input is visible if this value is true visible=true

See also:

Warning

Note that mixintype can be used only in the root node field (commonly known as the name field)

Parameter Type Required Description Example
rows Number

The initial textarea's number of rows. The value is 10 by default rows=20
cols Number

The initial textarea's number of cols. The value is 30 by default cols=50

See also: Common parameters

Parameter Type Required Description Example
options String with semicolon ; character

Some options for CKEditor field: toolbar, width and height options=CompleteWCM;width:'100%';height:'200px';
Parameter Type Required Description Example
toolbar String

The pre-define toolbar for CKEditor. The value can be: Default, Basic, CompleteWCM, BasicWCM, SuperBasicWCM options=CompleteWCM
width String

The width of CKEditor. The value can be the percent of pixel options=width:'100%'
height String

The height of CKEditor. The value can be the percent of pixel options=height:'200px'

See also: Common parameters

There are 2 main cases when creating an upload form: You want to store the image as a property OR as a node.

To avoid refreshing the first tab for every action execution, we add a new private function to the template with tabs. In the template, we must insert new piece of code like the following:

Changing in every event of onclick is have to be done like this :

Finally, to display the selected tab, we will add it into the style of UITabContent class.