Data models and forms


This document introduces the setting and the administration of data models and forms for the beCPG software. It is intended to beCPG administrators. A video presents the creation of models and forms.

1. Modification du modèle de données (manuellement)

It’s possible to enrich the beCPG model by adding :

  • Properties: text values, integers, data lists etc...
  • Associations: association to an object type ;
  • Objects types: a compound of several properties/associations ;
  • Aspects: group of properties and/or associations which can be added to a type of object. This allows the re utilisation of a group of properties, common to many object types, for example a group of properties « Saleable products ».

This necessitates knowledge of XML and knowledge of content modelisation.


The modification of the data model necessitates the modification of 3 files :

  1. [installLocation>/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/module/becpg-{$client}-core/model/{$client}Model.xml]{style="text-align:left;"} to modify the data model (addition of properties, associations) ;
  2. [installLocation>/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/module/becpg-{$client}-core/model/{$client}]{style="text-align:left;"} to define the properties wordings ;
  3. [installLocation>/tomcat/webapps/share/WEB-INF/classes/alfresco/{$client}-form-config.xml]{style="text-align:left;"} to define the formatting of edition and consultation forms.

Where {$client}, is the name of the client.

The modified files [Model.xml]{style="$client;"} et []{style="$client;"} can be copied and pasted in the repertory [installLocation>/tomcat/shared/classes/alfresco/extension/]{style="text-align:left;"} to facilitate the identification of the modified files. The naming convention is the following :

  • ext-{$client}Model.xml
  • ext-{$client}

The modified file [-form-config.xml]{style="$client;"} can be copied and pasted in the repertory [installLocation>/tomcat/shared/classes/alfresco/web-extension]{style="text-align:left;"} to facilitate it’s identification. The naming convention is the following :\ ext-{$client}-form-config.xml

In order to take into account the modifications, the application must be restarted by typing : sudo service alfresco restart

Setting of a property

Properties types are :

  • d:date
  • d:text
  • d:content
  • d:int
  • d:long
  • d:any
  • d:float
  • d:datetime
  • d:double
  • d:boolean
  • d:category
  • d:noderef
  • d:path

A property is defined by :

<code class="xml">
  <property name="...">
    <type>Type de données</type>
    <mandatory>obligatoire ou non</mandatory>
    <multiple>Valeur multiple ou non</multiple>
    <default>Valeur par défaut</default>
       <constraint ref="ID" />

Example :

<code class="xml">
<property name="bcpg:productType">
    <constraint ref="bcpg:systemProductType" />

Setting of a constraint

Constraints are defined in the section of the file {$client}Model.xml.

Here are some examples of constraints :

  • Regular expression :
<code class="xml">
<constraint name="test:regex1" type="REGEX">
       <parameter name="expression"><value>[A-Z]*</value></parameter>
       <parameter name="requiresMatch"><value>false</value></parameter>
  • Length Min/Max
<code class="xml">
<constraint name="test:stringLength1" type="LENGTH">
        <parameter name="minLength"><value>0</value></parameter>
        <parameter name="maxLength"><value>256</value></parameter>
  • Number Min/Max
<code class="xml">
<constraint name="test:minMax1" type="MINMAX">
        <parameter name="minValue"><value>0</value></parameter>
        <parameter name="maxValue"><value>256</value></parameter>
  • Data lists
<code class="xml">
<constraint name="test:list1" type="LIST">
        <parameter name="allowedValues">
        <parameter name="caseSensitive"><value>true</value></parameter>

More details :


An aspect is a group of properties or associations which can be applied to a type. An aspect can be mandatory or not.

<code class="xml">
    <aspect name="cm:auditable">
            <property name="cm:created">
            <property name="cm:creator">
            <property name="cm:modified">
            <property name="cm:modifier">
            <property name="cm:accessed">

The addition of a mandatory aspect to a type is done in the section :


Example :

<code class="xml">
<type name="XXX">

Where ZZZ is the mandatory aspect defined on the type XXX.

2. Form configuration


The logs file is situated in the following repertory of the server: /var/log/alfresco/alfresco.log

Consultation, edition, creation and search forms

Forms are defined in the file :


« Forms » refer to:

  • Creation form ;
  • Edition form ;
  • Consultation form ;
  • Search form ;
  • Bulk edition form

A form is defined by :

The form type :

  • Creation
<code class="xml">
<config evaluator="model-type" condition="bcpg:finishedProduct">
    <form id="create">
  • Edition
<code class="xml">
<config evaluator="node-type" condition="bcpg:finishedProduct">

* Recherche

<code class="xml">
<config evaluator="model-type" condition="bcpg:product">
      <form id="search"/>
  • Bulk edition
<code class="xml">
<config evaluator="model-type" condition="bcpg:product">
     <form id="bulk-edit"/>
  • Object type
<code class="xml">
<config evaluator="node-type" condition="bcpg:finishedProduct">
  • Fields displayed in the section
<code class="xml">
<show id="bcpg:legalName" />
  • The formatting in the section
<code class="xml">
<field id="bcpg:meatCharacts" set="charact">
    <control template="/fr/becpg/components/form/controls/textarea.ftl" >
        <control-param name="rows">4</control-param>

Where :

« set » defines the « fields » gathering; « template » defines the « Freemarker » template used to display the field. If nothing has been defined, the system takes the template by default; « control-param » defines a parameter of the « Freemarker » template.

More details :

3. Configuration files publication

Files update

To take in account the modification, we need to import the updated files.

  1. Import the model file {$client}Model.xml in the folder Repository>Data dictionnary>Model.

  2. Import the form file {$client}-form-config.xml in the folder Repository>Data dictionnary>Configurations.

Model refresh and publication

  1. To publish the model, it's possible to:
  2. activate the model by clicking on "Edit the properties" and tick the "Model active" box.
  3. with the designer, select the relevant model in the top left menu. The model and form content is displayed on the left pannel. Click the on the "Publish" button.

  4. Reload the model form the Administration beCPG.

Form refresh and publication

  1. The publication and reload of forms are depending on beCPG version:

  2. Before version 4.0 : in the admin tools, click on reload forms button.

  3. Since version 4.0 : click on More -> Publish, or publish from the designer (as presented in point 3)

Data models (designer)

The beCPG models designer allows the creation of data models and forms. It’s accessible from the upper band with the administrator role.

The designer is composed of 3 panels :

  • The left panel displays a tree representative of the model and a tree representative of the forms ;
  • The central panel displays the edition forms for forms and models ;
  • The right panel displays a pallette for grouping and control.

The choice of the file to display the model and the form is done thanks to the drop down menu in the tool bar of the left panel.

The models tree allows the creation of types, aspects, properties and constraints by positionning on the tree and pressing the button « New child ». The choice of the element type to be created is asked and eventually, the choice of the model type too.

Once the model has been created or modified, at the model root, press « Publish ».

Notes :

  • Every mandatory field has to be filled,
  • A type can be deleted if neither of the elements in the repository or in the bin has it ;
  • A property can only be modified by overloading the type or the aspect.

The creation of a form is done by dragging and dropping a type to the forms tree or thanks to the « New child » button. The association between controls and fields or fields grouping is done by drag and drop from the pallet to the area corresponding in the central panel.

In order to publish a form, hover over the forms tree root and press « Publish ».

The overview is done by selecting, in the models tree, a type and by pressing « Overview ». The type should be published. The form with the « Create » identifier associated to the type should be published.

For more information:

results matching ""

    No results matching ""