...
Anchor | ||||
---|---|---|---|---|
|
Audiences Defined
Coming soon....The <dlm:audience> has one required attribute: evaluatorFactory. The contents of the element are completely defined by the class declared in the evaluatorFactory attribute. For example, in the sample dlm.xml file above the "All Users" fragment has an audience tag that declares the AllUserEvaluatorFactory for determining its audience, the users to whom the fragment will be pushed. This factory supports not configuration and hence the audience tag is empty.
Attribute | Description |
---|---|
evaluatorFactory | Required. A fully qualified name of a class that implements the IEvaluatorFactory interface. |
The EvaluatorFactory interface is as shown below. It is passed an org.w3c.dom.Node node 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 | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
package campuspipeline.uportal.dlm;
import org.w3c.dom.Node;
public interface EvaluatorFactory
{
public Evaluator getEvaluator( Node audience )
throws Exception;
}
|
The Evaluator interface is as shown below. It is passed an IPerson object and returns true or false. This is the mechanism used to determine if a fragment is supposed to be pushed to a specific user at log-in time. Nto
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.
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
package campuspipeline.uportal.dlm;
import org.jasig.portal.security.IPerson;
public interface Evaluator
{
public boolean isApplicable( IPerson person );
}
|