How Zimlet Configuration Works
Before zimlets can be used, they have to be first installed. In admin console, this can be done in "Home->Configure->Zimlets" Page. The zimlets are installed in /opt/zimbra/zimlets-deployed （can be configed in zmlocalconfig). All the deployed zimlets' meta data are stored in LDAP "cn=zimlets,cn=zimbra". One of the meta data are "zimbraZimletEnabled". This is controlled by "Toggle Status" Button in Home->Configure->Zimlets Page. If this option is set "false", no matter how the zimlet is configured in other UI, users can't use it.
Once a zimlet is deployed, it's automatically "activated", and thus add to the attr zimbraZimletAvailableZimlets of default COS. You have to manually add the zimlet to zimbraZimletAvailableZimets of other COS by zmprov or editing the "available" option in "Home->Configure->Class of Service->"Some COS"->Zimlets.
zimbraZimletAvailableZimlets and zimbraZimletDomainAvailableZimlets
zimbraZimletAvailableZimlets is a mutli-value attr for COS and Account. Each item of zimbraZimletAvailableZimlets is the name of zimlet with a prefix. There are 3 prefixes:
- ! means "mandatory", that is, the zimlet will be forced as enabled in the
ZWC. User can't see zimlet in the ZWC zimlets preference, and therefore can't disable it there.
- + means "enabled", which means the zimlet is enabled initially.
- - means "disabled", which means the zimlet is disabled initially.
"enabled" and "disabled" can be overridden by the user zimlet preference in ZWC. (see below)
When creating a new account, the account's zimbraZimletAvailableZimlets' will be copied from the applied COS.
there is also a related domain attribute zimbraZimletDomainAvailabeZimlets which uses the same syntax of zimbraZimletAvailableZimlets. This attribute's priority is lower than account's zimbraZimletAvailableZimlets. Entry in it can be applied only when the corresponding entry doesn't exist in account's zimbraZimletAvailableZimlets. Initially, this attr is empty.
There are also 2 attributes zimbraPrefZimlets and zimbraPrefDisabledZimlets. These attrs are modified through ZWC zimlet preference page.
How the Zimlet config work
When a user login to ZWC, ZimletUtil.getUserZimlets will be invoked. Here is how it works:
- 1. list zimbraZimletDomainAvailableZimlets of the domain to which the current account belong, named "L1"
- 2. overwrite "L1" with zimbraZimletAvailableZimlets of the current account. Therefore, if there are any confict between domain and account zimlets(including the prefix), the config of account will be used. This will generate the list "L2"
- 3. zimbraPrefZimlets and zimbraPrefDisableZimlets are checked and merged into "L2". Here is the rule: For a zimlet,
- if it's "disabled" in L2 but exists in zimbraPrefZimlets, it will finally be "enabled";
- if it's "enabled" in L2 but exists in zimbraPrefDisableZimlets, it will finally be "disabled";
- if it doesn't exist in L2 or "mandatory", zimbraPrefZimlets & zimbraPrefDisableZimlets are ignored.
All above will generate list "L3".
- 4. All the zimlets whose zimbraZimletEnabled is false are removed from "L3",
and generated the list "L4". This "L4" is the final version list to control which zimlets are going to be loaded, what their initial status are and whether to show in ZWC zimlet preference page.
Of course, there are some detailed issues about processing ZWC zimlets or admin console extensions. TO BE DONE.