Skip to Content.
Sympa Menu

grouper-dev - Re: [grouper-dev] Problem with our Group Hook since Grouper 1.5.2

Subject: Grouper Developers Forum

List archive

Re: [grouper-dev] Problem with our Group Hook since Grouper 1.5.2

Chronological Thread 
  • From: Thomas BIZOUERNE <>
  • To: Chris Hyzer <>
  • Cc: "" <>
  • Subject: Re: [grouper-dev] Problem with our Group Hook since Grouper 1.5.2
  • Date: Tue, 29 Jun 2010 15:38:47 +0200
  • Domainkey-signature: a=rsa-sha1; c=nofws;; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=XIgc9A6yyLQ+x5dqd54sKjtfAAJDB9hpSxxl78XV1T2YIs+oTG8JTQASB7O6i4183S F+GhGjrjg1I3VlcVPy6aiD9R1h6pGwN360SeOv1WE5PEwuZBh3sDSiuDbT8aC5WEWqr5 FxAcHuppZSiCJjVXQ0fwvQxozkevJG3M/YLcM=

First, thank you for your answer,

I must tell you that i'm quite lost, that's why my explanations are not as clear as they could be. 

I think the better I can do is send you our hook classes, and try to explain what I understand (and what i don't)
You must know that Arnaud developped 2 Hooks :

(and a HookInstaller class... but there is no problem with that one i think)

You can find the too classes here :

and here :

Since my first mail, i succeed to resolve one part of the problem. Indeed, something was wrong in our grouper database, and grouper wasn't able to fill our "rule" attribute when trying to create a "dynamic" group. (I saw in my debugger that the save of the attribute failed with a message like : can't find attribute "rule"... or something like that).
I succeed to delete then create again a "rule" attribute associated with the type "dynamic".

So, now, that part is working : I mean when I create a group with the type "dynamic", it seams that all in grouper tables is OK :
here is what i see in grouper_attributes_v :
esco:Etablissements:CLAUDE DE FRANCE_0410017W:groupes_locaux:dg17 | ESCO:Etablissements:CLAUDE DE FRANCE_0410017W:Groupes Locaux:dg17 | rule           | AND(ESCOUAI=0410017W,sn=pol*)  | dynamic         | 9b6cedbbfca34667b2051d71257fe518 | 4028b9b42983256a0129837e09250007 | f49b5c12961c463887049c80accd6fc5 | b42291f2640e4af4bb158a46ae133b13 | 97d1e089a4f9467aaca24cdac447062a |

(I see that my group is "dynamic" and has an attribute called rule, filled with "AND(ESCOUAI=0410017W,sn=pol*)", that is what I want)

To come back to the hook classes :
I will try to describe you what I see when I create a group using our personnal "grouper UI" (ESCOGrouper), which uses grouper-ws.

I can see in my debugger that, when I create a dynamic group, the ESCOGroupHooks is triggered.
The first time In the method groupPreUpdate(), the group isn't detected to be "dynamic"... but I think it's normal because, if i'm not mistaken, a group isn't created in one step.
Then, i see that the method "groupPostCommitInsert()" is called...
Then, the ESCOAttributeHooks is triggered (method attributePreInsert() is called)
Then, we are back in ESCOGroupHooks, in the groupPreUpdate() method :
At this time, the test "isDynamicGroup" is OK, but I can't understand WHY "isDefinitionUpdate()" is always FALSE.
If I understand Arnaud's work, "isDefinitionUpdate()" must return TRUE if the attribute "attribute__rule" has changed. (and we saw that the attribute has really been inserted in grouper...). 
The code behind isDefinitionUpdate(), is, as you can see on the SVN : "group.dbVersionDifferentFields.contains("attribute__rule")", and it always return FALSE.
At this time, if I read in the debugger the value of "group.dbVersionDifferentFields", I only see "[ModifyTime]".

I hope you will understand what could be wrong with all that, because I don't know grouper enough to point out what is normal, and what is not :( 

Thank you again for you help, i'm really stuck. It's a bit complex.

(I'm sorry I didn't send you a test case because i'm not familiar with them)


2010/6/25 Chris Hyzer <>
Sorry for the delay.  Lets figure this out.

The test case I added for Arnaud in 09 still works in 1.5.3 and 1.6.3.  Is there a way to get a simple hook test case of what you want to do and send it to me and explain what is going on?  I assume if it works with 1.5.3 that it will work with 1.5.2... :)  Want me to try on 1.5.2?

I modified the test case I have and attached it.

As you can see, I add a type to the group, and update the extension, and in the hook it prints out the types, and it prints it out correctly...

2010-06-25 17:47:43,178: [main] DEBUG GroupHookDbVersion.groupPreUpdate(144) - type for group: edu:anotherExt2: base, test1,

Anyways, send me more info and we will get it working.


-----Original Message-----
From: [mailto:] On Behalf Of Thomas BIZOUERNE
Sent: Wednesday, June 23, 2010 10:10 AM
Subject: [grouper-dev] Problem with our Group Hook since Grouper 1.5.2

Hi everyone,

With grouper 1.4.2, we were using (at GIP RECIA, France) the hook mechanism to
do some custom operations on a particular type of group (a custom group type
called 'dynamic'). It was working pretty well, but since grouper 1.5.2, it
isn't working anymore.

That work was done by Arnaud DEMAN, who already posted on grouper-dev list and
succeed to get the hook working with Chris precious advices.
You can find the discussion here :

Today, i'm trying to make the hook work again with grouper 1.5.2 but i'm
pretty "new" to grouper and i don't really understand what is grouper way of
doing when a new group is created.

I will try to explain you my problem :

With grouper 1.4.2, we had a Group hook.
The method groupPreUpdate() was used to make some custom operations if the
group was of a certain type (our custom 'dynamic' type).

The problem is that since grouper 1.5.2, the group retrieved from the
preUpdateBean is no more 'dynamic' (our custom type) ! the "types" list only
contains "base" type.
I also pointed out that the problem is the same in :
  - groupPreInsert()
  - groupPostInsert()
  - groupPreUpdate()
  - groupPostUpdate()

The only moment when i can see two types ("base" and "dynamic") in the list is
in the groupPostCommitInsert() method.

That is one thing...

Seeing that, i tried to move our business code in the groupPostCommitInsert()
method, but then, another problem appeared.
Indeed, the other conditional test failed, (it tests if the custom attribute
related to our custom group type has been updated)
The test consists in a code like :
That test is always false by now and I don't know grouper enough to know why.
I tested in other methods :
in groupPreUpdate() : group.dbVersionDifferentFields() = [description,
in groupPostCommitInsert : group.dbVersionDifferentFields() = []
I don't understand why I never see that my custom attribute is added...

Another thing I can tell you is that, when i create a group of my custom type,
I can see in the database that, before reaching the "groupPostCommitInsert()",
the group isn't really in the DB.
When the groupPostCommitInsert() method is reached, I can see in the database
(grouper_groups_types_v view) that my newly created group is of the right type
: 'dynamic'. (and that the group is present is grouper_groups)

I Hope I am enough clear for you to understand what is wrong, and how I can
correct Arnaud's good work, in order to make it work with grouper 1.5.2.

I saw on the discussion that Chris told Arnaud that some changes were coming
on hooks with grouper 1.5.2. I think this is the reason why it's not working

I will continue to investigate while waiting for your answer,

please, fell free to ask me questions if some point is not clear.

Thank you,


Thomas, GIP RECIA.

Archive powered by MHonArc 2.6.16.

Top of Page