ZimletUtil

From Zimbra :: Wiki

Jump to: navigation, search


Contents

Usage

The command line tool zmzimletctl is used to deploy and manage Zimlets.

 $ /opt/zimbra/bin/zmzimletctl
 zmzimletctl: [command] [ zimlet.zip | config.xml | zimlet ]
       deploy {zimlet.zip} - install, ldapDeploy, grant ACL on default COS, then enable Zimlet
       undeploy {zimlet} - remove the Zimlet entry from the system
       install {zimlet.zip} - installs the Zimlet files on this host
       ldapDeploy {zimlet} - add the Zimlet entry to the system
       enable {zimlet} - enables the Zimlet
       disable {zimlet} - disables the Zimlet
       acl {zimlet} {cos1} grant|deny [{cos2} grant|deny...] - change the ACL for the Zimlet on a COS
       listAcls {zimlet} - list ACLs for the Zimlet
       listZimlets - show status of all the Zimlets in the system.
       getConfigTemplate {zimlet.zip} - dumps the configuration
       configure {config.xml} - installs the configuration
       listPriority - show the current Zimlet priorities (0 high, 9 low)
       setPriority {zimlet} {priority} - set Zimlet priority

ListZimlets

zmzimletctl listZimlets shows all the installed Zimlets in the system.

 $ /opt/zimbra/bin/zmzimletctl listZimlets
 Installed Zimlet files on this host:
       com_zimbra_amzn
       com_zimbra_phone
       com_zimbra_tracking
       com_zimbra_url
 Installed Zimlets in LDAP:
       com_zimbra_amzn
       com_zimbra_phone
       com_zimbra_tracking
       com_zimbra_url
 Available Zimlets in COS:
   default:
       com_zimbra_amzn
       com_zimbra_phone
       com_zimbra_tracking
       com_zimbra_url

Deployment

To deploy a Zimlet, put all the files in the zip bundle, then run zmzimletctl deploy. Because of COS and Account objects are cached by ZCS, the new Zimlet may not show up immediately to all the accounts. Simply restart tomcat in order to make the change immediate.

 $ unzip -v com_zimbra_test.zip
 Archive:  com_zimbra_test.zip
  Length   Method    Size  Ratio   Date   Time   CRC-32    Name
 --------  ------  ------- -----   ----   ----   ------    ----
      229  Defl:N      137  40%  03-13-06 14:03  11c73a48  com_zimbra_test.xml
 --------          -------  ---                            -------
      229              137  40%                            1 file
 $ /opt/zimbra/bin/zmzimletctl deploy test.zip
 [] INFO: Deploying Zimlet com_zimbra_test in LDAP.
 [] INFO: Installing Zimlet com_zimbra_test on this host.
 [] INFO: zimlet description not found: com_zimbra_test.xml
 [] INFO: Adding Zimlet com_zimbra_test to COS default
 [] INFO: Enabling Zimlet com_zimbra_test
 $ /opt/zimbra/bin/zmzimletctl listZimlets
 Installed Zimlet files on this host:
       com_zimbra_amzn
       com_zimbra_phone
       com_zimbra_test
       com_zimbra_tracking
       com_zimbra_url
 Installed Zimlets in LDAP:
       com_zimbra_amzn
       com_zimbra_phone
       com_zimbra_test
       com_zimbra_tracking
       com_zimbra_url
 Available Zimlets in COS:
   default:
       com_zimbra_amzn
       com_zimbra_phone
       com_zimbra_test
       com_zimbra_tracking
       com_zimbra_url

Undeploying a Zimlet is a site-wide change. When a Zimlet is undeployed, it is removed from all the COS, then removed from LDAP.

 $ /opt/zimbra/bin/zmzimletctl undeploy com_zimbra_test
 [] INFO: Uninstalling Zimlet com_zimbra_test from LDAP.
 [] INFO: Removing Zimlet com_zimbra_test from COS default
 $ /opt/zimbra/bin/zmzimletctl listZimlets
 Installed Zimlet files on this host:
       com_zimbra_amzn
       com_zimbra_phone
       com_zimbra_test
       com_zimbra_tracking
       com_zimbra_url
 Installed Zimlets in LDAP:
       com_zimbra_amzn
       com_zimbra_phone
       com_zimbra_tracking
       com_zimbra_url
 Available Zimlets in COS:
   default:
       com_zimbra_amzn
       com_zimbra_phone
       com_zimbra_tracking
       com_zimbra_url

Disabling

A Zimlet can be temporarily disabled in the system. The disabled Zimlets will be indicated by (diabled) next to the Zimlet name. The disabled Zimlets will not be loaded by the app. The effect of disabling Zimlets will be the same as undeploying as far as the users are concerned. In the administration perspective it may be easier to disable a Zimlet rather than undeploying. Disabled Zimlets can be re-enabled easily later on if needed compared to undeploying approach.

 $ /opt/zimbra/bin/zmzimletctl disable com_zimbra_test
 [] INFO: Disabling Zimlet com_zimbra_test
 $ /opt/zimbra/bin/zmzimletctl listZimlets
 Installed Zimlet files on this host:
       com_zimbra_amzn
       com_zimbra_phone
       com_zimbra_test
       com_zimbra_tracking
       com_zimbra_url
 Installed Zimlets in LDAP:
       com_zimbra_amzn
       com_zimbra_phone
       com_zimbra_test (disabled)
       com_zimbra_tracking
       com_zimbra_url
 Available Zimlets in COS:
   default:
       com_zimbra_amzn
       com_zimbra_phone
       com_zimbra_test
       com_zimbra_tracking
       com_zimbra_url

Configuration

In case a Zimlet needs custom configuration, the config file can be installed after the Zimlet is installed. If the zip bundle contains the config template, it can be extracted out by zmzimletctl tool.

 $ /opt/zimbra/bin/zmzimletctl getConfigTemplate com_zimbra_test.zip
 <zimletConfig name="com_zimbra_test" version="1.0">
   <global>
     <property name="url"></property>
   </global>
 </zimletConfig>

The output file can be redirected and saved to a text file, then using a text editor the configuration can be filled out for each properties. Then use the zmzimletctl tool to install the finished configuration.

 $ cat testconfig.xml
 <zimletConfig name="com_zimbra_test" version="1.0">
   <global>
     <property name="url">http://www.zimbra.com</property>
   </global>
 </zimletConfig>
 $ /opt/zimbra/bin/zmzimletctl configure testconfig.xml
 [] INFO: Installing Zimlet config for com_zimbra_test

Access Control

When a Zimlet is installed, it's immediately available to everyone in default COS. The management of Access Control List (ACL) can be done using the zmzimletctl tool.

 $ /opt/zimbra/bin/zmzimletctl listAcls com_zimbra_test
 Listing COS entries for Zimlet com_zimbra_test...
     default
 $ /opt/zimbra/bin/zmzimletctl acl com_zimbra_test test grant
 [] INFO: Adding Zimlet com_zimbra_test to COS test
 $ /opt/zimbra/bin/zmzimletctl listZimlets
 Installed Zimlet files on this host:
       com_zimbra_amzn
       com_zimbra_phone
       com_zimbra_test
       com_zimbra_tracking
       com_zimbra_url
 Installed Zimlets in LDAP:
       com_zimbra_amzn
       com_zimbra_phone
       com_zimbra_test
       com_zimbra_tracking
       com_zimbra_url
 Available Zimlets in COS:
   default:
       com_zimbra_amzn
       com_zimbra_phone
       com_zimbra_test
       com_zimbra_tracking
       com_zimbra_url
   test:
       com_zimbra_test
 $ /opt/zimbra/bin/zmzimletctl acl com_zimbra_test default deny
 [] INFO: Removing Zimlet com_zimbra_test from COS default
 $ /opt/zimbra/bin/zmzimletctl listZimlets
 Installed Zimlet files on this host:
       com_zimbra_amzn
       com_zimbra_phone
       com_zimbra_test
       com_zimbra_tracking
       com_zimbra_url
 Installed Zimlets in LDAP:
       com_zimbra_amzn
       com_zimbra_phone
       com_zimbra_test
       com_zimbra_tracking
       com_zimbra_url
 Available Zimlets in COS:
   default:
       com_zimbra_amzn
       com_zimbra_phone
       com_zimbra_tracking
       com_zimbra_url
   test:
       com_zimbra_test

Priority

When two or more Zimlets have similar match patterns, the same content object can be matched by more than one Zimlets. The Zimlet priority is used to set the precedence among the Zimlets in such cases. The lower number means higher priority, with priority 0 being the highest.

 $ /opt/zimbra/bin/zmzimletctl listPriority
 Pri	Zimlet
 0	com_zimbra_phone
 1	com_zimbra_tracking
 2	com_zimbra_url
 3	com_zimbra_amzn
 $ /opt/zimbra/bin/zmzimletctl setPriority com_zimbra_url 0
 Pri	Zimlet
 0	com_zimbra_url
 1	com_zimbra_phone
 2	com_zimbra_tracking
 3	com_zimbra_amzn
Personal tools