Skip to Content.
Sympa Menu

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

Subject: Grouper Developers Forum

List archive

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


Chronological Thread 
  • From: Thomas BIZOUERNE <>
  • To:
  • Subject: [grouper-dev] Problem with our Group Hook since Grouper 1.5.2
  • Date: Wed, 23 Jun 2010 10:09:44 -0400 (EDT)

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.



Archive powered by MHonArc 2.6.16.

Top of Page