01: /* Copyright 2005 The JA-SIG Collaborative. All rights reserved.
02: * See license distributed with this file and
03: * available online at http://www.uportal.org/license.html
04: */
05:
06: package org.jasig.portal.layout.dlm.providers;
07:
08: import org.jasig.portal.layout.dlm.Evaluator;
09:
10: /**
11: * Creates a group membership evaluator. This class inherits from
12: * IPersonEvaluatorFactory. Subclassing IPersonEvaluatorFactory gives us all
13: * benefits of its configuration language structure. The side affect of course
14: * is then that our group evaluator must be configured with that language
15: * structure. The definitions of the specific, non-element-containing evaluators
16: * must conform to the following element structure:
17: *
18: * <pre>
19: *
20: * < attribute mode="required"
21: * name="required"
22: * value="optional"/ >
23: *
24: * </pre>
25: *
26: * Therefore, the form selected for our group membership evaluator
27: * configurations is:
28: *
29: * <pre>
30: *
31: * < attribute mode="memberOf" name="Students"/ >
32: *
33: * </pre>
34: *
35: * Case is important for both mode and name. The value attribute is not used in
36: * configuration of these group membership evaluators.
37: *
38: * @see org.jasig.portal.layout.dlm.providers.PersonEvaluatorFactory#getAttributeEvaluator(java.lang.String,
39: * java.lang.String, java.lang.String)
40: * @author mboyd@sungardsct.com
41: * @version $Revision: 35711 $ $Date: 2005-05-02 22:55:35 -0700 (Mon, 02 May 2005) $
42: * @since uPortal 2.5
43: */
44: public class GroupMembershipEvaluatorFactory extends
45: PersonEvaluatorFactory {
46: /**
47: * Returns an instance of an evaluator specific to this factory and the
48: * passed in values. Name should be a well known group name. Case is
49: * important. The mode should be "memberOf" for now. Other modes may be
50: * added in the future like, "deepMemberOf".
51: */
52: public Evaluator getAttributeEvaluator(String name, String mode,
53: String value) {
54: return new GroupMembershipEvaluator(mode, name);
55: }
56: }
|