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: Chris Hyzer <>
  • To: Gagné Sébastien <>, mohan shamachar <>, "" <>
  • Subject: RE: [grouper-users] gsh scripting
  • Date: Fri, 19 Apr 2013 18:00:24 +0000
  • Accept-language: en-US
  • Authentication-results: sfpop-ironport05.merit.edu; dkim=neutral (message not signed) header.i=none

Note, there is a bug in 2.1.3- where deleting AttributeDefs that have groups
assigned to privileges will delete memberships which it shouldnt... so if
you are in prod, watch out.

https://bugs.internet2.edu/jira/browse/GRP-880

Thanks,
Chris



-----Original Message-----
From:


[mailto:]
On Behalf Of Gagné Sébastien
Sent: Friday, April 19, 2013 1:46 PM
To: mohan shamachar;

Subject: RE: [grouper-users] gsh scripting

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