Harnessing the Power of Alfresco Data Lists for Cascading Value Assistance

One of the most common Alfresco customization requests that we receive from our clients is for a way to allow metadata constraint lists to be managed by business users, rather than by IT.  TSG has developed an Alfresco Module Package (AMP) that allows picklist values to be managed using the data list functionality in Alfresco Share.  See our previous post on Alfresco Data List-Driven Value Assistance for more information on this module.

This post will focus on recent enhancements to the Data List-Driven Value Assistance module to allow for cascading constraint lists.

Constraint lists have always been available in Alfresco content modeling to allow for users to input metadata using dropdown lists, rather than freeform text fields.  Until the Data List-Driven Value Assistance module came about, the only way to add/remove/change the options in the dropdown list was to update the content model XML file, deploy, and restart Alfresco.

Another common problem is that many implementations require cascading value assistance.  In other words, the available values in one dropdown list depend on what the user selects in another dropdown list.  I’ll illustrate this cascading concept with an example:

I have metadata fields, Level 1 and Level 2.

ScreenHunter_18 Dec. 16 13.57

 

Level 1 contains options “1” and “2”.

ScreenHunter_20 Dec. 16 13.59

 

When I select option “1” for Level 1, the options for Level 2 are “Red” and “Orange”.

ScreenHunter_21 Dec. 16 14.04

If I change Level 1 to “2”, the options for Level 2 change to “Yellow” and “Green”.  This is cascading value assistance.

ScreenHunter_22 Dec. 16 14.05

Alfresco Share currently does not support this cascading concept.  To satisfy this common requirement, we’ve extended the Data List-Driven Value Assistance module to allow multiple cascading metadata fields to be driven from a single Alfresco Share data list.  Installing and configuring cascading value assistance is similar to the original non-cascading implementation and requires the following:

  1. Install Cascading Value Assistance AMP packages into the Alfresco and Share web applications.
  2. Create a data list in Alfresco Share that will drive the dropdown options. The module provides data list types for non-cascading, 2-level, 3-level, 4-level, and 5-level cascading fields.  The model can easily be extended if more than 5 levels are needed.
    ScreenHunter_23 Dec. 16 14.20
  3. Populate the data list with the options that should be displayed in your dropdown fields.
    ScreenHunter_24 Dec. 16 14.35
  4. Update the metadata forms in the Alfresco Share configuration to use the special dynamic controls. Each control is configured with the name of the data list that the values will come from, the cascade level, and the other properties that it depends on.
    ScreenHunter_26 Dec. 16 14.40

Because the data lists can be easily updated in Alfresco Share, there is no need for IT involvement or server restarts to update the constraints.  This is a huge win for business scenarios that have constraints that change frequently.  Also, because Alfresco Share has robust role-based security already built in, the value assistance data lists can be easily secured to only allow access to the appropriate users.  Typically we see our clients create a separate site for “Alfresco Administration” and grant access to the proper individuals.