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: Chris Hyzer <>
  • To: Thomas BIZOUERNE <>, "" <>
  • Subject: RE: [grouper-dev] Problem with our Group Hook since Grouper 1.5.2
  • Date: Fri, 25 Jun 2010 17:52:19 -0400
  • Accept-language: en-US
  • Acceptlanguage: en-US

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.

Thanks,
Chris

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


[mailto:]
On Behalf Of Thomas BIZOUERNE
Sent: Wednesday, June 23, 2010 10:10 AM
To:

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 :
https://lists.internet2.edu/sympa/arc/grouper-dev/2009-02/msg00031.html

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 :
group.dbVersionDifferentFields().contains(ourCustomAttributeField)
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,
modifyTime]
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
anymore.

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,

Regards,

Thomas, GIP RECIA.

Attachment: GroupHookDbVersion.java
Description: GroupHookDbVersion.java

Attachment: GroupHooksDbVersionTest.java
Description: GroupHooksDbVersionTest.java




Archive powered by MHonArc 2.6.16.

Top of Page