Versions Compared

Key

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

DLM functionality and fragments are currently defined in a file called, dlm.xml. It is located in the properties directory. The default dlm.xml file for 2.5.0 is shown below. Although no DTD or schema is currently used two top level elements are supported by the DLM code: dlm:property and dlm:fragment.

Code Block
xml
xml
borderStylesolid
titledlm.xmlborderStylesolid
<managedLayoutFragments xmlns:dlm="http://org.jasig.portal.layout.dlm.config">

  <dlm:property name='defaultLayoutOwner' value='fragmentTemplate'/>
  <!--  <dlm:property name='layoutDecorator' value='someClass'/> -->
  
  <!-- 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='org.jasig.portal.layout.dlm.RDBMDistributedLayoutStore.fragment_cache_refresh' value="5"/>

  <dlm:fragment name='Entertainment' ownerID='ent-lo' precedence='100'>
	 <dlm:audience evaluatorFactory='org.jasig.portal.layout.dlm.providers.PersonEvaluatorFactory'>
	  <paren mode="NOT">
       <attribute name="username" mode='equals' value='guest'/>
 	  </paren>
	 </dlm:audience>
  </dlm:fragment>

  <dlm:fragment name='News' ownerID='news-lo' precedence='80'>
   <!--  <dlm:role>Students</dlm:role> -->
   <dlm:audience evaluatorFactory='org.jasig.portal.layout.dlm.providers.GroupMembershipEvaluatorFactory'>
     <paren mode="AND">     
       <attribute mode='memberOf' name='Students'/>
       <paren mode="NOT">
	       <attribute mode='memberOf' name='Faculty'/>
       </paren>
     </paren>
   </dlm:audience>
 </dlm:fragment>
  
</managedLayoutFragments>

...

The <dlm:fragment> element defines a single fragment to be pushed into the layouts of a set of users. This element has four possible attributes as outlined in the following table. It also can contain from one to many nested audience elements. See dlm:audience below.

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.

...