Details
-
Improvement
-
Resolution: Fixed
-
Minor
-
None
-
None
Description
This script attribute definition appears multiple times, and should be replaced by a custom attribute definition :
<!-- The value of the "groupNameInStem" attribute is the name of the group of a change log entry. The name of the group
is returned only if the group is a child of the stem whose name is the edu.internet2.middleware.psp.baseStem property. If
the edu.internet2.middleware.psp.baseStem property is the root stem, groups under the "etc" stem are omitted. -->
<resolver:AttributeDefinition
id="groupNameInStem"
xsi:type="ad:Script">
<!-- Dependencies which return a "name" attribute whose value is the group name. -->
<resolver:Dependency ref="GroupDataConnector" />
<resolver:Dependency ref="DeleteGroupChangeLogDataConnector" />
<resolver:Dependency ref="UpdateGroupNameChangeLogDataConnector" />
<resolver:Dependency ref="UpdateGroupDescriptionChangeLogDataConnector" />
<resolver:Dependency ref="GroupAttributeAssignValueChangeLogDataConnector" />
<ad:Script><![CDATA[
// Import Shibboleth attribute provider.
importPackage(Packages.edu.internet2.middleware.shibboleth.common.attribute.provider);
// Create the attribute to be returned.
groupNameInStem = new BasicAttribute("groupNameInStem")
// Return the group name if it is a child of the base stem to be provisioned, omitting 'etc'.
if (typeof name != "undefined" && name != null ) {
// The name of the base stem to be provisioned.
var scriptBaseStem = "${edu.internet2.middleware.psp.baseStem}";
// If the base stem is the root stem, ignore groups under the 'etc' stem.
if (scriptBaseStem.length == 0) {
if (name.getValues().get(0).lastIndexOf("etc:", 0) === -1)
// Return the group name if it starts with the base stem to be provisioned.
} else {
if (name.getValues().get(0).lastIndexOf(scriptBaseStem + ":", 0) != -1)
}
}
]]></ad:Script>
</resolver:AttributeDefinition>