Zimbra / Zimlet:将UserProperties保存为XML

时间:2013-07-19 07:56:07

标签: javascript zimbra

我很难将用户属性保存到zimlet文件夹中的XML文件。

XML结构:

<zimlet name="ca_uoguelph_ccs_archive" version="2.0.2" label="Archive" description="Archives emails in the inbox by date.">
  <include>ca_uoguelph_ccs_archive.js</include>
  <includeCSS>ca_uoguelph_ccs_archive.css</includeCSS>
  <handlerObject>ca_uoguelph_ccs_archiveHandlerObject</handlerObject>
  <userProperties>
    <property type="string" name="archive_mainFolderId" value="" />
    <property type="string" name="archive_by_preference" value="y" />
    <property type="string" name="archive_auto_enabled" value="false" />
    <property type="string" name="archive_auto_last_run" value="" />
    <property type="string" name="archive_auto_settings" value="" />
  </userProperties>
</zimlet>

应该保存属性的函数:

CcsArchive.prototype.setArchiveFolderId = function(id) {
    if (this.getArchiveFolderId() !== id) {
        this.setUserProperty(CcsArchive.CCS_ARCHIVE_FOLDER_ID, id, true);
    }
};

//(CcsArchive.CCS_ARCHIVE_FOLDER_ID = archive_mainFolderId)

调用setUserProperty并且它不会给出任何错误,但属性不会保存到xml文件...

1 个答案:

答案 0 :(得分:0)

您是否尝试过ZDesktop或Zimbra环境? 我认为问题出在“ModifyPropertiesRequest”soap请求中: http://files.zimbra.com/docs/soap_api/8.0/soapapi-zimbra-doc/api-reference/index.html

在开发模式下,ZDesktop似乎无法正常工作。

我通常使用ZmMetaData来保存用户信息 http://files.zimbra.com/docs/zimlet/zcs/8.0.4/jsdocs/symbols/ZmMetaData.html