Results 1 to 5 of 5

Thread: Admin API Hook for easy integration with other services

Hybrid View

  1. #1
    Join Date
    Sep 2005
    Posts
    95
    Rep Power
    10

    Default Admin API Hook for easy integration with other services

    Hi Zimbra folks,

    As you can see there are some threads about integrating Zimbra with other services such as Samba (http://www.zimbra.com/forums/showthr...newpost&t=310). I think what we (the users) really want is to use Zimbra Administrator Console to manage all of our services, not just use Zimbra-MTA as the authentication backend. It'd be pretty cool if I could, i.e, create a user in Zimbra Administrator Console, tick the Samba checkbox, some other Samba-specific options appear, just tick, tick and tick...after that not only my user has access to Zimbra but he is also joined into my Samba domain using only one account.

    Of course, Zimbra itself and you guys as Zimbra's main developers dont need to know anything about Samba or such service, we can code for ourselves but we need your help. It'd be great if you allow us to register our hooks into the Admin API, i.e, when creating a user, after calling all Zimbra's specific method, a chain of hooks into "creating user" action is also executed. In this case, we dont need to break Zimbra existing code (and busy patching when you guys release a new version), we just write we need as seperate code (and contribute back to the community as, i.e, Zimbra Extensions :-)).

    What do you think?

    -g

  2. #2
    Join Date
    Aug 2005
    Location
    San Mateo, CA
    Posts
    4,789
    Rep Power
    19

    Default

    Sounds like a good idea. You can do this today by doing your provisioning via the command line of the SOAP api's. In this way you could simply have an add user script that does the zimbra account creation but also optionally provisions the user for your specific environment. Of course it's not via the GUI but it will get the job done. We are adding extensions to the server already so folks can plug-in additional code when the SOAP api's are not enough. We'll take a look at what can be done with the admin UI to allow this type of workflow.

  3. #3
    Join Date
    Sep 2005
    Posts
    95
    Rep Power
    10

    Default

    Hi Kevin,

    Thx for your info about Zimbra already has extension (as far as I know the only extension of M1 is ClamScanner but when I ran "fgrep -r ClamScanner /ZimbraServer/src/java/com/zimbra" it returned nothing).

    The deeper I dive into Zimbra code, the clearer that implementing the API hook idea is just an ease (only in the server side, I still can not figure out how to do with the ajax client). The reason why it's easy to implement API hook is all the hookable points are already well defined. I can see that all the classes in com.zimbra.service.account, com.zimbra.service.admin, com.zimbra.service.mail are hookable points. So if I want to hook into ChangePassword hookpoint (i.e, to change Samba password too), I just modified its class. Of course, that's absolutely not the way I want to do to hook into Zimbra. I dont want to modify Zimbra code. What I want is I write my extension, put it into /opt/zimbra/lib/ext and done. Zimbra will automatically load my extension (this feature is already available), register my hooks, and call them if needed. As you can see, we need two things:

    - a place to store the mapping between hookpoint and hookclass + hookmethod. This is metadata, so the embedded mysql is the best choice. We need a table named hooks which has 3 columns: hookpoint, hookclass, hookmethod. For example, if I want Zimbra to execute com.zimbra.extension.Samba.ChangePassword whenever com.zimbra.cs.service.account.ChangePassword is called, the value of each column is:

    hookpoint: com.zimbra.cs.service.account.ChangePassword
    hookclass: com.zimbra.extension.Samba
    hookmethod: ChangePassword

    This table is populated when we load extensions. The init() method of each extension will insert (if not already available) their hooks into this table.

    - a way to call these hooks automatically in Zimbra. I think this is not hard to do. In the handle() method of each class (or in their super class, com.zimbra.soap.DocumentHandler), before generating and returning the response, we place a callback function to execute all hooks. What should we pass to this call? The classname (for example, com.zimbra.cs.service.account.ChangePassword) and the request object. The classname is used to lookup (from DbHookPool) all registerd hooks of that particular hookpoint. The request object is used by the hookclass/hookmethod to do their business.

    What do you think?

    That's it. Sorry for my broken english, if there is any unclear point, please drop me a line.

    -g

  4. #4
    Join Date
    Aug 2005
    Location
    San Mateo, CA
    Posts
    4,789
    Rep Power
    19

    Default

    Thanks for the details. Yes; we understand your need and will be looking at this in the future. We are also working on a easy way to add extensions to the AJAX client so keep your eye out for more details on that.

  5. #5
    Join Date
    Nov 2008
    Posts
    2
    Rep Power
    7

    Lightbulb Hooks (as in Subversion)

    Don't Zimbra have something like SVN's super simple hook feature:
    Version Control with Subversion

    It's just pure genius, and every server app should have it!

    ??

Similar Threads

  1. Domain admin soap api access
    By mrfileio in forum Administrators
    Replies: 0
    Last Post: 06-11-2007, 09:07 PM
  2. integration with existing services?
    By pyperdown in forum Administrators
    Replies: 4
    Last Post: 12-20-2005, 12:31 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •