Results 1 to 9 of 9

Thread: Modifying the Mail button bar

  1. #1
    Join Date
    Mar 2006
    Posts
    21
    Rep Power
    9

    Default Modifying the Mail button bar

    This is a continuation of my questions from the Zimlet forum. The question I have is the best way to modify the mail button bar. In this case, I'd like to add a button between send and contacts. It seems that ZmZimbraMail.js drives the content of the bar but I have quite a bit more reading to go before I understand all the moving parts.

    I'm also concerned how difficult it would be to keep my modified version in sync with updates since I'm guessing this file would change with any upgrades. Any strategy at this point to support user modification in this way that is friendly for updates or am I blazing a new, lonely trail? Thanks!

    Cheers,
    Marty

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

    Default

    Quote Originally Posted by mghaught
    I'm also concerned how difficult it would be to keep my modified version in sync with updates since I'm guessing this file would change with any upgrades. Any strategy at this point to support user modification in this way that is friendly for updates or am I blazing a new, lonely trail? Thanks!
    If you take this route it's best to work off the source so you can build a production build. Editing that file will make the change but you need to compress/zip it for real production use. All the JS files get put together at build time so editing that file doesn't mean it gets delivered to the clients.
    Looking for new beta users -> Co-Founder of Acompli. Previously worked at Zimbra (and Yahoo! & VMware) since 2005.

  3. #3
    Join Date
    Feb 2006
    Location
    Auckland, New Zealand
    Posts
    54
    Rep Power
    9

    Default If I might butt in...

    I think what Marty is asking is the following: (which also concerns what I am about to do also)
    If you make a change to some Zimbra source - be it client UI based, or back end based - are there any procedures or mechanisms that should be followed so that when a new version of Zimbra is released, reapplying the custom changes that you have made is straight forward.

    I'm thinking the answer to this is currently to follow best programming practices. (Unless there are already some extensible hooks within the code that can call out to external modules - which would be nice). If you are modifying core Zimbra source code, make your changes as small as possible and isolate your code preferably into a separate file/module.

    Then everytime there is a new release, reapply manually, build your own release. In time I'm guessing that Zimbra will come with a framework to hook in external UI changes and external event hooks such as used in Outlook custom forms - although the deployment of those is clunky and every now and then just plain doesn't work .. plus the Exchange Event Sink mechanism that I have referred to in another post.

    My 2c, Chris

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

    Default

    Quote Originally Posted by kiwicmc
    If you make a change to some Zimbra source - be it client UI based, or back end based - are there any procedures or mechanisms that should be followed so that when a new version of Zimbra is released, reapplying the custom changes that you have made is straight forward.
    For some customizations to the web UI or extensions we have Zimlets. This will grow to cover deeper integrations as the ones you've proposed. This will be the supported way to run a Zimbra build but still have custom extensions. This is also the place to add custom server side indexing. Zimlet's expose either a Regex or Java interface to extend the indexing.

    We also have an extension framework on the server that has a couple *hooks*. These over time will grow to include all the major processing points where you can filter or plug in additional functionality.
    Looking for new beta users -> Co-Founder of Acompli. Previously worked at Zimbra (and Yahoo! & VMware) since 2005.

  5. #5
    Join Date
    Mar 2006
    Posts
    21
    Rep Power
    9

    Default

    Thanks, Chris. That is essentially what I'm after. Being able to drop in a zimlet that adds a button to the ComposeController, for instance. I wasn't sure if any of this was planned or even operational thus the reason my question. I can see I may be a bit early in needing this feature but I'm glad to see that you all have a game plan. For now, I'll hope to minimize my touches in the source code to make my prototype work.

    Cheers,
    Marty

  6. #6
    Join Date
    Nov 2005
    Posts
    55
    Rep Power
    9

    Default Any updates on this?

    THis was posted back in March and left with the request. Since we are now moving towards 3.2 what facilities are available to modify the button bar using Zimlets or other mechanism that will persist better between upgrades?

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

    Default

    It is supported in 3.2

    The code will look like:

    Code:
        // Add the Salesforce Button to the Compose Page
        this._composerCtrl = this._appCtxt.getApp(ZmZimbraMail.MAIL_APP).getComposeController();
        this._composerCtrl._sforce = this;
        this._toolbar = this._composerCtrl._toolbar;
    
        // Add button to toolbar
        ZmMsg.sforceAdd = "Send & Add";
        ZmMsg.sforceTooltip = "Send and add to Salesforce.";
        var op = {textKey: "sforceAdd", tooltipKey: "sforceTooltip", image: "SFORCE-panelIcon"};
        var opDesc = ZmOperation.defineOperation(null, op);
        ZmOperation.addOperation(this._toolbar, opDesc.id, this._toolbar._buttons, 1);
        this._toolbar.addSelectionListener(opDesc.id, new AjxListener(this._composerCtrl, this._sendAddSForce));
    See the full example here:

    http://svn.sourceforge.net/viewvc/zi...zimbra_sforce/
    Looking for new beta users -> Co-Founder of Acompli. Previously worked at Zimbra (and Yahoo! & VMware) since 2005.

  8. #8
    Join Date
    Oct 2005
    Location
    Emeryville, CA US
    Posts
    22
    Rep Power
    9

    Default

    It looks like you may also need to initialize the toolbar:

    Code:
    ...
        // Add the Salesforce Button to the Compose Page
        this._composerCtrl = this._appCtxt.getApp(ZmZimbraMail.MAIL_APP).getComposeController();
        this._composerCtrl._sforce = this;
        // initialize the compose controller's toolbar
        this._composerCtrl._initializeToolBar();
        this._toolbar = this._composerCtrl._toolbar;
    ...

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

    Default

    Yep thanks. This is due to an optimization we made not to pre-create the composer on login. I've made the fix it's in SVN.
    Looking for new beta users -> Co-Founder of Acompli. Previously worked at Zimbra (and Yahoo! & VMware) since 2005.

Similar Threads

  1. Problems with port 25
    By yogiman in forum Installation
    Replies: 57
    Last Post: 06-13-2011, 01:55 PM
  2. Replies: 7
    Last Post: 02-03-2011, 06:01 AM
  3. fresh install down may be due to tomcat
    By gon in forum Installation
    Replies: 10
    Last Post: 07-25-2007, 08:09 AM
  4. DynDNS and Zimbra
    By afterwego in forum Installation
    Replies: 30
    Last Post: 04-01-2007, 03:34 PM
  5. receiveing mail
    By maybethistime in forum Administrators
    Replies: 15
    Last Post: 12-09-2005, 03:55 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
  •