Results 1 to 2 of 2

Thread: Customized MailDocumentHandlers

  1. #1
    Join Date
    Sep 2008
    Posts
    4
    Rep Power
    7

    Default Customized MailDocumentHandlers

    Hi,

    I've been working on a pet project that revolves around performing server-side monitoring of a user's message-related actions (ie reading, deleting, moving, etc). *edit* I should mention this is for ZCS, FRANKLIN build 5.09

    The approach I've been taking is to first load a custom extension and add my mail service to the SoapServlet, which then *should* be going about registering the custom MailDocumentHandlers as handlers with the dispatcher. However I see no indication in the logs that the service and my handlers are actually being registered.

    I couldn't find much documentation covering this type of work, but I've tried to follow the admin service's lead.
    Essentially this is how it's set up to go now:

    MonitoringExtension.java
    Code:
    public void init() throws ServiceException {
    SoapServlet.addService("MonitoringService", new MonitoringService());
    }
    MonitoringService.java
    Code:
    public class MonitoringService implements DocumentService {
      public void registerHandlers(DocumentDispatcher dispatcher) {
        dispatcher.registerHandler(MailConstants.GET_MSG_REQUEST, new MonitoredGetMsg());
        dispatcher.registerHandler(MailConstants.CONV_ACTION_REQUEST, new MonitoredConvAction());
      }
    }


    I had also tried leveraging the zclient classes and events, but that did not work either.


    Now.. I can achieve the desired effect by hacking away at the com.zimbra.cs.service.mail.{GetConv, ConvAction, GetMsg} classes directly and recompiling the zimbraserver, but I'd much rather be able to implement this as a portable extension.

    I get the feeling I may be missing some pieces of the puzzle... or maybe this isn't possible through an extension.
    Anyone out there got any suggestions?

  2. #2
    Join Date
    Sep 2008
    Posts
    4
    Rep Power
    7

    Default

    Well I've taken a bit of a different approach this time..
    I'm now adding my own custom Session as a listener to the mailboxes, and then parsing what I need from notifyPendingChanges() whenever it gets called

    the following still seems like a bit of a kludge, but it works
    Code:
    public void init() throws ServiceException {
       for (String accountID : MailboxManager.getInstance().getAccountIds()){
          Mailbox mbox = MailboxManager.getInstance().getMailboxByAccountId(accountID);
    		
          Session s = new MonitoringSession(mbox.getAccountId());
          s.register();
       }
    }
    Last edited by fuzzydunlop; 09-30-2008 at 12:29 AM.

Similar Threads

  1. Customized Zimlet not working
    By palchuri in forum Zimlets
    Replies: 0
    Last Post: 04-05-2007, 12:28 PM
  2. Extending Zimbra for Customized Application
    By Jack Gauvreau in forum Developers
    Replies: 15
    Last Post: 10-16-2006, 07:52 AM

Posting Permissions

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