...
Example Configuration
Code Block | ||||
---|---|---|---|---|
| ||||
<ScriptletAttributeDefinition id="urn:mace:dir:attribute-def:eduPersonAffiliation"> <DataConnectorDependency requires="directory"/> <Scriptlet><![CDATA[ Attributes attributes = dependencies.getConnectorResolution("directory"); Attribute affiliation = attributes.get("eduPersonAffiliation"); if (affiliation.size() > 0) { resolverAttribute.addValue("affiliate"); } ]]></Scriptlet> </ScriptletAttributeDefinition> |
...
For the definition of common-lib-terms, refer to http://middleware.internet2.edu/urn-mace/urn-mace-dir-entitlement.html.
Code Block | ||||
---|---|---|---|---|
| ||||
<ScriptletAttributeDefinition id="urn:mace:dir:attribute-def:eduPersonEntitlement"> <DataConnectorDependency requires="directory"/> <AttributeDependency requires="urn:mace:dir:attribute-def:eduPersonAffiliation" /> <Scriptlet><![CDATA[ Attributes attributes = dependencies.getConnectorResolution("directory"); Attribute entitlement = attributes.get("eduPersonEntitlement"); // add values from directory for (int i = 0; entitlement != null && i < entitlement.size(); i++) { resolverAttribute.addValue(entitlement.get(i)); } // add common-lib-terms for staff and student Attribute attribute = attributes.get("eduPersonAffiliation"); if (attribute.contains("staff") || attribute.contains("student")) { resolverAttribute.addValue("urn:mace:dir:entitlement:common-lib-terms"); } ]]> </Scriptlet> </ScriptletAttributeDefinition> |
...