Skip to Content.
Sympa Menu

grouper-users - RE: [grouper-users] Hooks: Switching on and off?

Subject: Grouper Users - Open Discussion List

List archive

RE: [grouper-users] Hooks: Switching on and off?


Chronological Thread 
  • From: Chris Hyzer <>
  • To: "" <>, Grouper Users Mailing List <>
  • Subject: RE: [grouper-users] Hooks: Switching on and off?
  • Date: Thu, 26 Feb 2009 11:11:59 -0500
  • Accept-language: en-US
  • Acceptlanguage: en-US

You maintenance idea is a good one of disabling a certain hook, importing,
enabling the hook again.

Globally turning off all hooks or for certain stems is a little chaotic,
since how do you know you want ALL hooks off, and not just some. So we don’t
have that feature in Grouper.

Some other suggestions:

1. Your hook can decide if it needs to act... it could see if the gid
attribute is there, and if so, don’t reset it. Or is there a reason this
wont work?

2. Your hook could easily read a custom Boolean property in the
grouper.properties which would tell it whether or not to act

3. Your hook could easily read a string property in the grouper.properties
which tells it if certain stems prefixes are excluded

4. If you are doing the import via Java, you could set a threadlocal in your
hook which tells it not to act, then unset when done

Let me know if you want to do any of those, I could send you some code
snippets to make it easy

Regards,
Chris

> -----Original Message-----
> From: Dr. Loris Bennett
> [mailto:]
> Sent: Thursday, February 26, 2009 4:29 AM
> To: Grouper Users Mailing List
> Subject: [grouper-users] Hooks: Switching on and off?
>
> Hi,
>
> I want to add a unix-like group ID to each group when it is save. With
> Chris' help I have implemented a hook to add custom a custom type with
> an attribute 'GID' which is filled with a value from a database
> sequence.
>
> I now have the problem that, as an initial step, I want import a set of
> existing groups which already have GIDs. At the moment I can just
> configure out the hook, import the groups and then activate the hook
> again.
>
> However, for the general case I wondered whether there is or should be
> a
> mechanism for switching of hooks, say for a given subtree or for groups
> with a given value of an attribute.
>
> But then again perhaps operations which require hooks to be switched
> off
> should just be done within a maintenance window.
>
> Thoughts?
>
> Loris
> --
> Dr. Loris Bennett (Mr.)
> Freie Universität Berlin
> ZEDAT - Zentraleinrichtung für Datenverarbeitung / Computer Center
> Compute & Media Service
> Fabeckstr. 32, Room 221
> D-14195 Berlin
> Tel ++49 30 838 51024
> Fax ++49 30 838 56721
> Email
>
> Web www.zedat.fu-berlin.de




Archive powered by MHonArc 2.6.16.

Top of Page