Web Client Model Configuration Guide 1.2

Document created by resplin Employee on Jun 6, 2015
Version 1Show Document
  • View in full screen mode

Obsolete Pages{{Obsolete}}

The official documentation is at: http://docs.alfresco.com



Web Client Customization


Note


The following documentation is applicable for the releases between 1.2RC2 and 1.2.1.

For the latest version refer to Displaying Custom Metadata and for previous releases refer to the old configuration guide.


Introduction


This page describes how to configure the Web Client for use with custom Types and Aspects. To define your own custom Types and Aspects, refer to the Data Dictionary Guide.

All the configuration mentioned in this page is available in the sample web client config file. If you are using a bundle simply rename web-client-config-custom.xml.sample to web-client-config-custom.xml and uncomment the appropriate sections at the bottom of the file. This file can be found in /tomcat/shared/classes/alfresco/extension if you are using the Tomcat bundle or /jboss/server/default/conf/alfresco/extension if you are using the JBoss bundle.

After making any changes to web-client-config-custom.xml just re-start the app server to see the change take effect.


Customising the 'Add Aspect' Rule Action


Alfresco supports a Rule for applying an aspect to Content when it's introduced to a folder.  Within the rule definition UI, the user chooses which aspect to apply from a drop-down list.

To add the 'ImageClassification' aspect that was defined in the Data Dictionary Guide, the following line is introduced...



   <config evaluator='string-compare' condition='Action Wizards'>
      <aspects>
         <aspect name='my:imageClassification'
                 [displayLabel='Image Classification']
                 [displayLabelId='image_classification']/>
         ...

There are three options for specifying the displayLabel to display for each aspect (the same applies for the other items you can configure i.e. types, transformers). If no displayLabel is given it is retrieved from the data dictionary. To override the data dictionary title directly specify a 'displayLabel' attribute or to override using a localized string, specify the lookup key via the 'displayLabelId' attribute.


Viewing Aspect Properties in the Web Client Properties Page


The content of the Web Client properties page is data driven. Configuration allows the list of visible properties (and their order) to be specified on an Aspect by Aspect basis (and also Content Type basis).

To add the 'ImageClassification' aspect that was defined in the Data Dictionary Guide to the list of properties shown for a node with the aspect applied, the following XML is introduced...



   <config evaluator='aspect-name' condition='my:imageClassification'>
      <property-sheet>
         <show-property name='my:width'/>
         <show-property name='my:height'/>
         <show-property name='my:resolution'/>
      </property-sheet>
   </config>

There are 3 options for specifying the display label. If nothing is specified (as in the example above) the display label will be taken from the data dictionary title for the property. To override the display label directly specify  a 'displayLabel' attribute or to override using a localized string, specify the lookup key via the 'displayLabelId' attribute.

When the Properties page is displayed for a content object, the object is introspected and its aspects determined. A lookup in the configuration files is then made to retrieve all the <property-sheet> elements defined for the aspects applied to the object. It is not necessary to define a <property-sheet> for every aspect.

A list of properties to display for the object is then formulated from all the matching <property-sheet> definitions. Properties are displayed in the order they are defined in the configuration file.


Editing Aspect Properties in the Web Client Properties Page


Properties defined to display as explained in the previous section will automatically appear when editing properties of a node. To stop a property from appearing in the edit properties screen add the showInEditMode attribute with a value of false. For example to hide the resolution property on the image classification aspect the configuration would be as follows:



   <config evaluator='aspect-name' condition='my:imageClassification'>
      <property-sheet>
         <show-property name='my:width'/>
         <show-property name='my:height'/>
         <show-property name='my:resolution' showInEditMode='false' />
      </property-sheet>
   </config>

Content Type Properties in the Web Client


The viewing and editing of content type properties may be configured in exactly the same manner as Aspect properties.  The only difference is in the xml configuration; specify 'node-type' instead of 'aspect-name'.

For example, to add the 'SOP' type that was defined in the Data Dictionary Guide, the following XML is introduced...



   <config evaluator='node-type' condition='my:sop'>
      <property-sheet>
         <show-property name='name' showInEditMode='false' />
         <show-property name='mimetype' displayLabelId='mimetype'
                        converter='org.alfresco.faces.MimeTypeConverter'
                        showInEditMode='false' />
         <show-property name='title' showInEditMode='false' />
         <show-property name='description' showInEditMode='false' />
         <show-property name='size' displayLabelId='size'
                        converter='org.alfresco.faces.ByteSizeConverter'
                        showInEditMode='false' />
         <show-property name='my:publishedDate' />
         <show-association name='my:signOff' />
         <show-property name='my:authorisedBy' />
         <show-child-association name='my:processSteps' />
      </property-sheet>
   </config>

Creating Custom Content Types in the Web Client


When content is added via the 'Add Content' wizard a drop down list gives the user the choice of what type to create the content as. This list is configurable so custom types can be added easily.

Again, using the custom 'SOP' content type defined in the Data Dictionary Guide, the following XML can be added...



   <config evaluator='string-compare' condition='Custom Content Types'>
      <content-types>
         <type name='my:sop' [displayLabel='SOP'] [displayLabelId='sop'] />
      </content-types>
   </config>

There are 3 options for specifying the display label. If nothing is specified the display label will be taken from the data dictionary title for the type. To override the display label directly specify  a 'displayLabel' attribute or to override using a localized string, specify the lookup key via the 'displayLabelId' attribute.


Creating Custom Space Types in the Web Client


When spaces are created via the 'Advanced Space Wizard' a list of space types are displayed. This list is configurable so custom types can be added easily.

For example if there was a custom space type to represent a wiki the XML to configure this may look like the following...



   <config evaluator='string-compare' condition='Custom Folder Types'>
      <folder-types>
         <type name='my:wikiSpace' [icon='/images/icons/wikiSpace_large.gif']
               [descriptionMsgId='wikispace_desc'] [description='Inline description of a wiki space']
               [displayLabel='Wiki Space'] [displayLabelId='wikispace'] />
      </folder-types>
   </config>

The icon attribute, if supplied, indicates which icon to use in the Advanced Space Wizard space type selection panel. If it omitted a default space icon will be used.

The description attributes indicates what should be inserted into the description panel of the Advanced Space Wizard space type page. The 'description' attribute allows an inline description to be supplied whereas 'descriptionMsgId' allows a lookup key for a localised string to be specified.

There are 3 options for specifying the display label. If nothing is specified the display label will be taken from the data dictionary title for the type. To override the display label directly specify  a 'displayLabel' attribute or to override using a localized string, specify the lookup key via the 'displayLabelId' attribute.


Associations in the Web Client


The viewing and editing of associations and child associations for types and aspects can be configured in the same manner as properties.

To display an association on a type or aspect add the following XML snippet to the property-sheet element.



   <show-association name='my:signOff'/>

To display a child association on a type or aspect add the following XML snippet to the property-sheet element.



   <show-child-association name='my:processSteps'/>

The same rules for viewing/editing properties and the displayLabel applies to associations and child associations. The showInEditMode attribute will hide the association from the edit page and the absence or presence of any displayLabel/displayLabelId will determine what label is used.


Advanced Property Sheet Configuration


A full reference guide to all the options available for property sheet configuration can be found here.

Attachments

    Outcomes