Home

In Alfresco Share, Form service is widely used for property editing, searching, document creating, workflow task editing, etc. A Share form is a set of form fields. The form control is introduced to provide the proper way to input the value for a form field, such as controls for date and time, association, mime-type, etc. The default form control for a field with associations to a group and/or person is authority.ftl. It helps to input a user or group by searching within a whole repository. In many scenarios, navigation and searching within certain groups are needed.

To build this custom form control for members of a group, the existing webscript is needed to provide information for a group and the children need to be fixed. A member of NodeRef would be added into the output JSON. Two files need to be overridden for this purpose:

alfresco/extension/templates/webscripts/org/alfresco/repository/groups/authority.ftl
alfresco/extension/templates/webscripts/org/alfresco/repository/groups/children.get.js

The rest tasks would be creating the prototype Alfresco.GroupMember in group-member.js and use it in group-member.inc.ftl and group-member.ftl. A good idea is to build Alfresco.GroupMember to leverage the type Alfresco.ObjectFinder in object-finder.js.

Source Code Folder Structure

Once the customization is deployed, the form control could be used in any form setting like the following:

<config evaluator= »task-type » condition= »ihm:assignReviewerTask »>
<forms>
<form>
<field-visibility>

<show id= »ihm:assignee »/>

</field-visibility>
<appearance>

</field>
<field id= »ihm:assignee » label-id= »assoc.ihm_assignee »>
<control template= »/org/alfresco/components/form/controls/group-member.ftl »>
<control-param name= »startLocation »>IHM_REVIEWER</control-param>
<control-param name= »authorityType »>USER</control-param>
<control-param name= »deepSearch »>true</control-param>
</control>
</field>

</appearance>
</form>
</forms>
</config>

There are three parameters for this control:

startLocation: the root group for picking the members

authorityType: the type of the field, with three options GROUP, USER, ALL

deepSearch: indicator for searching, true to search for all children and false to search for direct children.

If these parameters are ignored, the default ones would be supplied as group root, ALL and false.

This control is a good solution for workflow task editing when one or more members of certain group are needed.

Group Member Picker

SHARE SOCIAL

 
Alfresco Developer
Specializing in software development, Johnson has been with us since October 2012, and is one of the leading Alfresco Developers on the Appnovation team. While he is skilled in a variety of languages, Johnson enjoys the complexity and flexibility of working with Java and Alfresco.Johnson entered…→ More about Johnson
Publicités

Laisser un commentaire

Choisissez une méthode de connexion pour poster votre commentaire:

Logo WordPress.com

Vous commentez à l'aide de votre compte WordPress.com. Déconnexion / Changer )

Image Twitter

Vous commentez à l'aide de votre compte Twitter. Déconnexion / Changer )

Photo Facebook

Vous commentez à l'aide de votre compte Facebook. Déconnexion / Changer )

Photo Google+

Vous commentez à l'aide de votre compte Google+. Déconnexion / Changer )

Connexion à %s