Skip to Content.
Sympa Menu

grouper-users - RE: [grouper-users] gsh scripting

Subject: Grouper Users - Open Discussion List

List archive

RE: [grouper-users] gsh scripting


Chronological Thread 
  • From: Gagné Sébastien <>
  • To: "mohan shamachar" <>, <>
  • Subject: RE: [grouper-users] gsh scripting
  • Date: Fri, 19 Apr 2013 13:46:26 -0400
  • Authentication-results: sfpop-ironport01.merit.edu; dkim=neutral (message not signed) header.i=none

For stems, use the "obliterateStem" GSH command :
https://spaces.internet2.edu/display/Grouper/GrouperShell+(gsh)

For the attributes I'm not sure how you would do it, maybe obliterateStem
will remove them. If you don't have too many you could do it using the lite
ui.


-----Message d'origine-----
De :


[mailto:]
De la part de mohan shamachar
Envoyé : 19 avril 2013 13:42
À :

Objet : [grouper-users] gsh scripting

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



Archive powered by MHonArc 2.6.16.

Top of Page