Results 1 to 4 of 4

Thread: Zimbra 8 Changes that may affect Zimlets

Hybrid View

  1. #1
    Join Date
    Aug 2012
    Posts
    14
    Rep Power
    3

    Default Zimbra 8 Changes that may affect Zimlets

    Hi,
    I wanted to drop a note on some changes we did in Zimbra 8 that may affect Zimlet development. While, we didn't make any major changes to the Zimlet API, we did make some changes around views.

    * View Type
    A view type is the general type of view, such as "TV" or "CLV2", identified by the ZmId.VIEW_* constants. If the type of view supports session views, it is used as a base for the view ID.

    GET: [controller].getDefaultViewType()

    GET: [controller].getCurrentViewType()
    SET: [controller].setCurrentViewType(type)

    appCtxt.getCurrentViewType()

    Now that view type is available, you should not need to use indexOf to see if a view is (for example) a compose view. The old way:
    if (appCtxt.getCurrentViewId().indexOf("COMPOSE") >= 0) …

    Instead, look at the view type:
    if (appCtxt.getCurrentViewType() == ZmId.VIEW_COMPOSE) …

    Also note the use of the ZmId constant rather than the string literal. Please use those constants, including the ones for other things such as item types, organizer types, and operations. That mostly applies to zimlet code.


    * View ID
    For views that do not support sessions, the view ID is the same as the view type, for example, "LOADING" or "ACCT". If the view supports sessions, the view ID is made up of the view type and the session ID.

    GET: [controller].getCurrentViewId()
    SET: [controller].setCurrentViewId(viewId)

    appCtxt.getCurrentViewId()

    * View
    The view is the object that is being displayed, usually some form of DwtComposite such as DwtListView. Many top-level views are compound views, such as ZmDoublePaneView or ZmContactSplitView, which comprise a list view and an item view.

    GET: [controller].getCurrentView()
    If you want the list view from a view that may or may not be compound, use:

    GET: [controller].getListView()

    * Deprecated
    VAR: [controller].sessionId
    VAR: [controller].viewId
    VAR: [controller]._currentView
    GET: [controller]._getViewType()
    GET: [controller]._defaultView()

    For example in Z7 it was common do to the following:
    com_zimbra_example_toolbarhook_HandlerObject.proto type.initializeToolbar = function(app, toolbar, controller, viewId) {
    if (viewId == ZmId.VIEW_CONVLIST || viewId == ZmId.VIEW_TRAD) {
    ...
    }
    }

    In Z8 this would look like:
    com_zimbra_example_toolbarhook_HandlerObject.proto type.initializeToolbar = function(app, toolbar, controller, viewId) {
    var viewType = appCtxt.getViewTypeFromId(viewId);
    if(viewType == ZmId.VIEW_CONVLIST || viewType == ZmId.VIEW_TRAD) {
    ....
    }
    }

    Thanks,
    Jeff

  2. #2
    Join Date
    Nov 2012
    Posts
    4
    Rep Power
    3

    Default

    Thnks for sharing. Nice post. Found the same thing.

  3. #3
    Join Date
    Aug 2013
    Posts
    1
    Rep Power
    2

    Default what's file should i change?

    Quote Originally Posted by jwagner View Post
    Hi,
    I wanted to drop a note on some changes we did in Zimbra 8 that may affect Zimlet development. While, we didn't make any major changes to the Zimlet API, we did make some changes around views.

    * View Type
    A view type is the general type of view, such as "TV" or "CLV2", identified by the ZmId.VIEW_* constants. If the type of view supports session views, it is used as a base for the view ID.

    GET: [controller].getDefaultViewType()

    GET: [controller].getCurrentViewType()
    SET: [controller].setCurrentViewType(type)

    appCtxt.getCurrentViewType()

    Now that view type is available, you should not need to use indexOf to see if a view is (for example) a compose view. The old way:
    if (appCtxt.getCurrentViewId().indexOf("COMPOSE") >= 0) …

    Instead, look at the view type:
    if (appCtxt.getCurrentViewType() == ZmId.VIEW_COMPOSE) …

    Also note the use of the ZmId constant rather than the string literal. Please use those constants, including the ones for other things such as item types, organizer types, and operations. That mostly applies to zimlet code.


    * View ID
    For views that do not support sessions, the view ID is the same as the view type, for example, "LOADING" or "ACCT". If the view supports sessions, the view ID is made up of the view type and the session ID.

    GET: [controller].getCurrentViewId()
    SET: [controller].setCurrentViewId(viewId)

    appCtxt.getCurrentViewId()

    * View
    The view is the object that is being displayed, usually some form of DwtComposite such as DwtListView. Many top-level views are compound views, such as ZmDoublePaneView or ZmContactSplitView, which comprise a list view and an item view.

    GET: [controller].getCurrentView()
    If you want the list view from a view that may or may not be compound, use:

    GET: [controller].getListView()

    * Deprecated
    VAR: [controller].sessionId
    VAR: [controller].viewId
    VAR: [controller]._currentView
    GET: [controller]._getViewType()
    GET: [controller]._defaultView()

    For example in Z7 it was common do to the following:
    com_zimbra_example_toolbarhook_HandlerObject.proto type.initializeToolbar = function(app, toolbar, controller, viewId) {
    if (viewId == ZmId.VIEW_CONVLIST || viewId == ZmId.VIEW_TRAD) {
    ...
    }
    }

    In Z8 this would look like:
    com_zimbra_example_toolbarhook_HandlerObject.proto type.initializeToolbar = function(app, toolbar, controller, viewId) {
    var viewType = appCtxt.getViewTypeFromId(viewId);
    if(viewType == ZmId.VIEW_CONVLIST || viewType == ZmId.VIEW_TRAD) {
    ....
    }
    }

    Thanks,
    Jeff
    Hai jeff, thanks for your sharing
    I got problem after i upgrade zimbra, the client console cannot running in AJAX mode. Menu tab not running n some buttons not running too. I cant resolve this.
    If I use this sharing, what file should i change???

    Please
    Attached Images Attached Images

  4. #4
    Join Date
    Aug 2013
    Posts
    31
    Rep Power
    2

    Default

    Hello All,

    I have also some problems with some libraries that were present in Zimbra Desktop 7.2.4 and that I can't find anymore:

    for example these java classes:

    com.zimbra.common.auth.ZAuthToken;
    com.zimbra.common.service.ServiceException;
    com.zimbra.common.util.ByteUtil;
    com.zimbra.cs.account.Provisioning.AccountBy;
    com.zimbra.cs.zclient.ZEmailAddress;
    com.zimbra.cs.zclient.ZMailbox;
    com.zimbra.cs.zclient.ZMailbox.Options;
    com.zimbra.cs.zclient.ZMessage;
    com.zimbra.cs.zclient.ZMessage.ZMimePart;

    where I can find them in Zimbra 8 Open Source edition?

    Thanks
    Roberto

Similar Threads

  1. Replies: 5
    Last Post: 12-08-2010, 11:08 AM
  2. How will Hotmail update affect Zimbra connectivity
    By ZenMasta in forum General Questions
    Replies: 0
    Last Post: 05-18-2010, 04:53 PM
  3. zimbra update affect ldap setup...?
    By NoDoze in forum Administrators
    Replies: 0
    Last Post: 08-18-2009, 01:00 PM
  4. How does this perl packaging bug affect Z?
    By Baylink in forum Developers
    Replies: 1
    Last Post: 08-29-2008, 02:43 PM
  5. How will this affect existing server
    By lledynot in forum Installation
    Replies: 1
    Last Post: 09-17-2005, 01:34 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
  •