grouper-users - [grouper-users] gsh scripting
Subject: Grouper Users - Open Discussion List
List archive
- From: mohan shamachar <>
- To:
- Subject: [grouper-users] gsh scripting
- Date: Fri, 19 Apr 2013 13:42:28 -0400 (EDT)
Hi Chris,
I have used the following script to clean the stems and groups. I tried a
script, in a similar fashion to remove the attributes, using a wildcard (like
folder, remove all permissions assigned to a role, etc), but I couldn't. Any
pointers?
Clean Stems/Groups:
grouperSession = GrouperSession.startRootSession();
stem = StemFinder.findByName(grouperSession, "<folder>");
for(child : stem.getChildGroups(Stem.Scope.SUB)) {
System.out.println("deleting: " + child.getName()); child.delete(); }
stemList = new ArrayList(stem.getChildStems(Stem.Scope.SUB));
Collections.sort(stemList);
Collections.reverse(stemList);
for(childStem : stemList) { System.out.println("deleting: " +
childStem.getName()); childStem.delete(); }
stem.delete();
My attempt to remove attributes in a folder.
for(theAttr :
GrouperDAOFactory.getFactory().getAttributeDef().findByStem("<folder>"))
{
// I like to iterate through the attributes or delete each.
}
similarly... an example to iterate all attributes assigned to a role...
Thank you,
mohan
- [grouper-users] gsh scripting, mohan shamachar, 04/19/2013
- RE: [grouper-users] gsh scripting, Gagné Sébastien, 04/19/2013
- RE: [grouper-users] gsh scripting, Chris Hyzer, 04/19/2013
- Re: RE: [grouper-users] gsh scripting, mohan shamachar, 04/19/2013
- RE: RE: [grouper-users] gsh scripting, Chris Hyzer, 04/19/2013
- RE: [grouper-users] gsh scripting, Gagné Sébastien, 04/19/2013
Archive powered by MHonArc 2.6.16.