...
- Let's now dissect the "Student" fragment below to get an idea of how this works. The name of the fragment is Student and the fragment is owned by the user account student-lo. What we want to do is push this fragment to our Students group and to do this we define our audience using the GroupMembershipEvaluatorFactory . GroupMembershipEvaluatorFactory evaluates group memberships and with the <paren> and <attribute> directives we specify the group we wish to target. So we will interpret the syntax below as find everyone who is a memberOf the Students group and push this fragment to them.
Code Block xml xml <dlm:fragment name='Student' ownerID='student-lo' precedence='50'> <dlm:audience evaluatorFactory='org.jasig.portal.layout.dlm.providers.GroupMembershipEvaluatorFactory'> <paren mode="OR"> <attribute mode='memberOf' name='Students'/> </paren> </dlm:audience> </dlm:fragment>
- What if we want to push the fragment to more than one group? What if we wanted to push the fragment to Students OR Faculty? We can do this by using the <paren> directive's mode attributes OR, NOT, or AND.
- Here are some examples of using <paren> and <attribute> together to target specific groups:
Code Block xml xml <!-- Push this fragment to anyone who is a member of the Students OR Faculty group --> <dlm:audience evaluatorFactory='org.jasig.portal.layout.dlm.providers.GroupMembershipEvaluatorFactory'> <paren mode="OR"> <attribute mode='memberOf' name='Students'/> <attribute mode='memberOf' name='Faculty'/> </paren> </dlm:audience>
Code Block xml xml <!-- Push this fragment to members of the Students group who are NOT also members of the Faculty group --> <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>
- So as you can see from the above examples there is some flexibility to targeting specific groups of interest.
- Here are some examples of using <paren> and <attribute> together to target specific groups:
...
- Let's imagine that we want to setup a fragment named "Library". This library fragment will contain all information about library services that we wish to send out to Faculty groups but NOT Staff groups. Here's what we would do:
- Define our new fragment as follows in the dlm.xml file
Code Block | ||||
---|---|---|---|---|
| ||||
<dlm:fragment name='Library' ownerID='library-lo' precedence='40'> <dlm:audience evaluatorFactory='org.jasig.portal.layout.dlm.providers.GroupMembershipEvaluatorFactory'> <paren mode="OR"> <attribute mode='memberOf' name='Faculty'/> <paren mode="NOT"> <attribute mode='memberOf' name='Staff'/> </paren> </paren> </dlm:audience> </dlm:fragment> |
...