Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

This page is related to the Aggregated Layout Management Convergence 2.x effort that will be added to 3.x.

Properties Defined dlm:property tag explained.
Fragments Defined dlm:fragment tag explained.
Roles Defined dlm:role tag explained.
Audiences Defined dlm:audience tag explained.

Code Block
xml
titledlm.xml
borderStylesolid
titledlm.xml
<managedLayoutFragments xmlns:dlm="http://www.campuspipeline.com/uportal/dlm">

  <dlm:property name='defaultLayoutOwner' value='fragmentTemplate'/>
  <dlm:property name='layoutDecorator' value='com.pipeline.uportal.dlm.provider.CpLayoutDecorator'/>
  <dlm:property name='campuspipeline.uportal.dlm.debug' value="false"/>
  
  <!-- Controls clearing of dlm fragment cache.  This allows changes  made to layout
  owners to be reflected once the cache has been updated.  Specified in minutes. -->
  
  <dlm:property name='campuspipeline.uportal.dlm.fragment_cache_refresh' value="60"/>

  <dlm:fragment name='Faculty' ownerID='faculty-lo' precedence='50'>
   <dlm:role>faculty</dlm:role>
   <dlm:audience evaluatorFactory='com.pipeline.uportal.dlm.provider.CPPersonEvaluatorFactory'>
     <attribute name='role' mode='equals' value='faculty'/>
   </dlm:audience>
  </dlm:fragment>

  <dlm:fragment name='All Users' ownerID='allusers-lo' precedence='100'>
   <dlm:audience evaluatorFactory='campuspipeline.uportal.dlm.provider.AllUsersEvaluatorFactory'/>
  </dlm:fragment>

  <dlm:fragment name='Students' ownerID='student-lo' precedence='100'>
   <dlm:role>student</dlm:role>
   <dlm:audience evaluatorFactory='com.pipeline.uportal.dlm.provider.CPPersonEvaluatorFactory'>
     <paren mode="AND">     
       <attribute name='role' mode='equals' value='student'/>
       <paren mode="NOT">
         <attribute name='role' mode='equals' value='faculty'/>
       </paren>
     </paren>
   </dlm:audience>
 </dlm:fragment>
  
  <dlm:fragment name='Employee' ownerID='employee-lo' precedence='30'>
   <dlm:role>employee</dlm:role>
   <dlm:audience evaluatorFactory='com.pipeline.uportal.dlm.provider.CPPersonEvaluatorFactory'>
     <attribute name='role' mode='equals' value='employee'/>
   </dlm:audience>
  </dlm:fragment>

</managedLayoutFragments>

...

The <dlm:fragment> element has four possible attributes, one or more nested <dlm:role> elements (see Roles Defined), and zero to many nested <dlm:audience> elements or comments. The audience elements indicate to whom the fragment will go. See Audiences Defined for more detail.

Attribute

Description

name

A required unique name by which this fragment is known

ownerID

The required login id of the user who owns the distributed layout and hence can edit the layout. There was no UI created three years ago when this ALM approach was constructed. For speed the layout of a regular account was used to specify the fragment. So each fragment must have a corresonding account created solely for defining what that fragment entails. This also means that the smallest fragment that can be created is a tab. With a fragment specific creation UI such a restriction will be removed.

precedence

A required positive, decimal number or zero. Negative numbers are not allowed. This number is used to indicate the ordering of layouts for a user during their layout construction sequence. When a user logs in the system asks each distributed layout if it is applicable to that user. (See Audiences Defined below.) Those that answer yes are placed in a layout construction sequence in order of precedence, the higher the number the higher the precedence and the earlier the layout will be merged into the user's viewed or constructed layout. Layouts merged in prior to other layouts have higher precedence and hence can restrict actions taken by layouts merged in later enforcing such things as position for their elements. A user's personal layout fragment, that portion representing changes made to incorporated layouts, has a precedence of zero. If two or more layouts have the same value then their precedence is determined by their order in this file. Those at the top have higer precedence than those appearing later.

defaultLayoutOwner

This is an optional attribute. If included then it identifies the default user whose layout is copied for this fragments layout when the fragment owner first logs in. If not included it defaults to the value of the only defined property element of the same name declared in this file. If neither is defined then the default is the user indicated by the org.jasig.portal.services.Authentication.defaultTemplateUserName property in portal.properties.

...

The EvaluatorFactory interface is as shown below. It is passed an org.w3c.dom.Node object representing the audience node in the dlm.xml file and can be used by the factory to configure and return an object implementing the Evaluator interface. The object returned can be contructed in some manner appropriate for any configuration information declared within the audience tag.

Code Block
title
java
EvaluatorFactory.java
borderStylesolid
titleEvaluatorFactory.java

package campuspipeline.uportal.dlm;

import org.w3c.dom.Node;

public interface EvaluatorFactory
{
    public Evaluator getEvaluator( Node audience )
    throws Exception;
}

...

All fragments in the above sample dlm.xml file use a CPPersonEvaluatorFactory, a trivial subclass of the real workhorse IPersonEvaluatorFactory. This factory defines a boolean syntax for configuration that allows evaluation of a role attribute that is multivalued and represents a user's group membership. See Sungard SCT ALM IPersonEvaluatorFactory for information on configuration syntax supported by this evaluator factory and the classes used to implement that syntax.

Code Block
title
java
Evaluator.java
borderStylesolid
titleEvaluator.java
package campuspipeline.uportal.dlm;

import org.jasig.portal.security.IPerson;

public interface Evaluator
{
    public boolean isApplicable( IPerson person );
}