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