Hello friends,
I am new to zimbra and want to create my own zimlet.
I need a list of existing folders in the account where it runs
then I'll give in html format on a dialog window.
I already learned to make the dialog with the example of SimpleDialog
but I do not know how to bring a list of existing folders, especially custom folders
thanks
How I can get a list of folders?
How I can get a list of folders?
hello I accomplished my goal in 2 ways,
I show them what I did, this is the first script,
var soapDoc = AjxSoapDoc.create("getFolderRequest", "urn:zimbraMail");
var folderNode = soapDoc.set("folder");
folderNode.setAttribute("l", appCtxt.getFolderTree().root.id);
var command = new ZmCsfeCommand();
var top = command.invoke({soapDoc: soapDoc, noAuthToken: true}).Body.GetFolderResponse.folder[0];
var folders = top.folder;
alert(folders.toSource(), '
');
it seems that only shows me the default folders, but does not display the custom folders me what I need in the end.
So I found another way, it is faster and elegant, even I would have liked to use the other way, or to know why not work with custom folders.
second way to get the folders
if (!this._chooseFolderDialog) {
AjxDispatcher.require("Extras");
this._chooseFolderDialog = new ZmChooseFolderDialog(appCtxt.getShell());
}
this._chooseFolderDialog.reset();
this._chooseFolderDialog.registerCallback(DwtDialog.OK_BUTTON, this._chooseFolderOkBtnListener, this, this._chooseFolderDialog);
// This doesn't show trash and spam folder
var omitParam = {};
omitParam[ZmFolder.ID_TRASH] = true;
omitParam[ZmFolder.ID_SPAM] = true;
var params = {
treeIds: [ZmOrganizer.FOLDER],
title: ZmMsg.chooseFolder,
overviewId: this.toString(),
description: ZmMsg.chooseFolder,
skipReadOnly: false,
hideNewButton: true,
appName: ZmApp.MAIL,
omit: omitParam
};
this._chooseFolderDialog.popup(params);
It is a shame that this media forum left a little disappointed as the new, hopefully cheated my notes or better.
Thank you
I show them what I did, this is the first script,
var soapDoc = AjxSoapDoc.create("getFolderRequest", "urn:zimbraMail");
var folderNode = soapDoc.set("folder");
folderNode.setAttribute("l", appCtxt.getFolderTree().root.id);
var command = new ZmCsfeCommand();
var top = command.invoke({soapDoc: soapDoc, noAuthToken: true}).Body.GetFolderResponse.folder[0];
var folders = top.folder;
alert(folders.toSource(), '
');
it seems that only shows me the default folders, but does not display the custom folders me what I need in the end.
So I found another way, it is faster and elegant, even I would have liked to use the other way, or to know why not work with custom folders.
second way to get the folders
if (!this._chooseFolderDialog) {
AjxDispatcher.require("Extras");
this._chooseFolderDialog = new ZmChooseFolderDialog(appCtxt.getShell());
}
this._chooseFolderDialog.reset();
this._chooseFolderDialog.registerCallback(DwtDialog.OK_BUTTON, this._chooseFolderOkBtnListener, this, this._chooseFolderDialog);
// This doesn't show trash and spam folder
var omitParam = {};
omitParam[ZmFolder.ID_TRASH] = true;
omitParam[ZmFolder.ID_SPAM] = true;
var params = {
treeIds: [ZmOrganizer.FOLDER],
title: ZmMsg.chooseFolder,
overviewId: this.toString(),
description: ZmMsg.chooseFolder,
skipReadOnly: false,
hideNewButton: true,
appName: ZmApp.MAIL,
omit: omitParam
};
this._chooseFolderDialog.popup(params);
It is a shame that this media forum left a little disappointed as the new, hopefully cheated my notes or better.
Thank you