Skip to Content.
Sympa Menu

grouper-dev - [grouper-dev] RE: Unique group extension

Subject: Grouper Developers Forum

List archive

[grouper-dev] RE: Unique group extension


Chronological Thread 
  • From: Chris Hyzer <>
  • To: Gagné Sébastien <>, "" <>
  • Subject: [grouper-dev] RE: Unique group extension
  • Date: Sat, 31 Mar 2012 12:20:30 +0000
  • Accept-language: en-US

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?

gsh 0%     GrouperSession grouperSession = GrouperSession.startRootSession();
gsh 1%
gsh 2% new GroupSave(grouperSession).assignName("test:someTestGrou").assignCreateParentStemsIfNotExist(true).save();
group: name='test:someTestGrou' displayName='test:someTestGrou' uuid='416e55dc6ce3476e8a4488abfc752efa'
gsh 3% new GroupSave(grouperSession).assignName("test:someTestGrou2").assignCreateParentStemsIfNotExist(true).save();
group: name='test:someTestGrou2' displayName='test:someTestGrou2' uuid='181c8263e40649b2987bc2a1ed6261a4'
gsh 4% 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=416e55dc6ce3476e8a4488abfc752efa]]
gsh 5%

Thanks,
Chris


From: Chris Hyzer
Sent: Friday, March 30, 2012 11:01 AM
To: Gagné Sébastien;
Subject: RE: Unique group extension

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?

 

Thanks,

Chris

 

From: [mailto:] On Behalf Of Gagné Sébastien
Sent: Friday, March 30, 2012 10:58 AM
To:
Subject: [grouper-dev] Unique group extension

 

Hello again,

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 ?

 

Thank you

 

Sébastien Gagné,     | Analyste en informatique

514-343-6111 x3384| Université de Montréal,

                     | Pavillon Roger-Gaudry, local X-100-11

 




Archive powered by MHonArc 2.6.16.

Top of Page