Class AttributeAssignToStemSave
java.lang.Object
edu.internet2.middleware.grouper.attr.assign.AttributeAssignToStemSave
Use this class to add/edit/delete attribute def names on folders.
Sample call
import edu.internet2.middleware.grouper.attr.assign.*; AttributeAssignToStemSave attributeAssignToStemSave = new AttributeAssignToStemSave().assignAttributeDefName(attributeDefName).assignStem(stem); AttributeAssign attributeAssign = attributeAssignToStemSave.save(); System.out.println(attributeAssignToStemSave.getSaveResultType()); // DELETE, INSERT, NO_CHANGE, or UPDATE
Sample call to remove attribute def name from a folder
import edu.internet2.middleware.grouper.attr.assign.*; new AttributeAssignToStemSave().assignAttributeDefName(attributeDefName).assignStem(stem).assignSaveMode(SaveMode.DELETE).save();
Sample call to assign attribute and metadata with values. Note, this example doesnt make sense since this attribute is assignable to groups, but this is how to do it.
import edu.internet2.middleware.grouper.attr.assign.*; AttributeAssign attributeAssign = new AttributeAssignToStemSave(). assignNameOfAttributeDefName("etc:attribute:abacJexlScript:grouperJexlScriptMarker"). assignStemName("test:isc:astt:chris:testJexl2").save(); attributeAssign.getAttributeValueDelegate().assignValueString( "etc:attribute:abacJexlScript:grouperJexlScriptJexlScript", "${entity.memberOf('test:testGroup') && !entity.memberOf('test:testGroup1')}");
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionassignAttributeDefName
(AttributeDefName theAttributeDefName) attribute def name to add/update/delete from folderassignNameOfAttributeDefName
(String theNameOfAttributeDefName) attribute def name to add/update/delete from folderassignRunAsRoot
(boolean runAsRoot) set this to true to run as a root sessionassignSaveMode
(SaveMode theSaveMode) assign save modeassignStem
(Stem theStem) assign a stemassignStemId
(String theStemId) stem id to add to, mutually exclusive with stem name and stemassignStemName
(String theStemName) stem name to add to, mutually exclusive with stem id and stemget the save result type after the save callstatic void
save()
add, edit or delete an attribute def name from folder
-
Constructor Details
-
AttributeAssignToStemSave
public AttributeAssignToStemSave()
-
-
Method Details
-
assignRunAsRoot
set this to true to run as a root session- Parameters:
runAsRoot
-- Returns:
-
main
- Parameters:
args
-
-
assignAttributeDefName
attribute def name to add/update/delete from folder- Parameters:
theAttributeDefName
-- Returns:
- this for chaining
-
assignNameOfAttributeDefName
attribute def name to add/update/delete from folder- Parameters:
theNameOfAttributeDefName
-- Returns:
-
assignStem
assign a stem- Parameters:
theStem
-- Returns:
- this for chaining
-
assignStemId
stem id to add to, mutually exclusive with stem name and stem- Parameters:
theStemId
-- Returns:
- this for chaining
-
assignStemName
stem name to add to, mutually exclusive with stem id and stem- Parameters:
theStemName
-- Returns:
- this for chaining
-
assignSaveMode
assign save mode- Parameters:
theSaveMode
-- Returns:
- this for chaining
-
getSaveResultType
get the save result type after the save call- Returns:
- save type
-
save
add, edit or delete an attribute def name from folder
- Returns:
- the attribute assign that was updated or created or deleted
- Throws:
InsufficientPrivilegeException
GroupNotFoundException
-