Subject: Grouper Developers Forum
- From: Gagné Sébastien <>
- To: "Chris Hyzer" <>, <>
- Subject: RE: [grouper-dev] RE: Unique group extension
- Date: Mon, 2 Apr 2012 10:14:18 -0400
Here are more information, hope that helps . Thank you
How I am adding group using the UI :
- Log in the normal UI (not liteui)
- Explore : go in the stem
- “Create group” link
- Fill info
Then I get the error
While in the database I only have these 2 groups :
I tried adding a new group using the Lite UI and the hook triggered and returned to the “Add group screen”, but it seems the group was added the in database! :
New groups from the LiteUI :
Further testing confirmed that the LiteUI adds the group in the database, but triggers the veto (might be a second operation after the initial add ? Maybe an update?), while adding a group in the normal UI also triggers the veto, but does not add the group in the database.
Using the GSH, everything seems to be fine, the hook is not rejecting the first one but works for the second one with the same extension :
gsh 0% GrouperSession grouperSession = GrouperSession.startRootSession();
gsh 1% new GroupSave(grouperSession).assignName("test:someTestGrou").assignCreateParentStemsIfNotExist(true).save();
group: name='test:someTestGrou' displayName='test:someTestGrou' uuid='dba9b63d512541ff8f0529173a9b2114'
gsh 2% new GroupSave(grouperSession).assignName("test2:someTestGrou").assignCreateParentStemsIfNotExist(true).save();
// Error: unable to evaluate command: Sourced file: inline evaluation of: ``new GroupSave(grouperSession).assignName("test2:someTestGrou").assignCreateParen . . . '' : Method Invocation save
// See error log for full stacktrace
// caused by: edu.internet2.middleware.grouper.hooks.logic.HookVeto:
// veto.group.unique.extension: The group ID is already in use by a group, please use a different ID <br/><br/> [Group[name=test:someTestGrou,uuid=dba9b63d512541ff8f0529173a9b2114]]
All this leads me to think that the problem might be somewhere in the UI and that the database have nothing to do with this.
This works for me with mysql... I can try oracle a little later. So you are saying if you run this GSH, that the first one will fail and not the second one? Also, how were you adding groups, with the UI?
From: Chris Hyzer
That’s weird… cant think of why this wouldn’t still work, hooks should work the same. Can you tell me what type of DB you have and send me the hook code as well, and the configuration you use in the grouper.properties so I can try it out?
Some time ago I asked about having unique group extension. Chris replied with a very helpful group hook and all was working fine with Grouper 2.0.1. Since then I installed Grouper 2.1 and the hook doesn’t work anymore. I suspect it’s because of the hibernate update, but wanted to confirm the behaviour first before doing a new hook.
Basically, the hook executed this query ["select count(g) from Group as g where g.extensionDb = :theExtension"] and checked if it returned anything [if count>0 throw exception]
It worked before the update, but now it always fails, even with a fresh database. I checked the database and GROUPER_GROUPS contains only one entry for the sysadmingroup.
To check what was returned, I added the output of this query in the error message : "select g from Group as g where g.extensionDb = :theExtension".
I tried to add the group with the ID “UdeM:test” I got this as the query content : name=UdeM:test,uuid=22c78379869e43e28a88f4e54826bafb. I rechecked the database and there is still only one group.
Any lead on what might cause this ? Does the hooks work differently ? Does it do a temporary add in the groups before the save in the database ?
Sébastien Gagné, | Analyste en informatique
514-343-6111 x33844 | Université de Montréal,
| Pavillon Roger-Gaudry, local X-100-11
- RE: [grouper-dev] RE: Unique group extension, Gagné Sébastien, 04/02/2012
Archive powered by MHonArc 2.6.16.