ZimletDevSetup

Revision as of 19:32, 10 March 2009 by Rrao (talk | contribs)

Zimlet Development Via Zimbra Desktop


Zimbra Desktop Configuration


1. Download Zimbra Desktop http://www.Zimbra.com/products/desktop_download.html

2. Install Zimbra desktop to C:\zdesktop or some easy to reach location.

3. Configure your Zimbra Desktop with a dummy/test gmail or yahoo account.

(PS: Steps 4 & 5 can be skipped once Zimbra Desktop goes RC2(build 1513) or later, currently it is RC1(build 1482)

4. Configure Zimbra Desktop to permit Zimlets

Open localconfig.xml in <installDirectory>\conf\localconfig.xml

And replace..

 <key name="zdesktop_installation_key">
   <value>[CURRENT_VALUE]</value>
 </key>


 with..
 <key name="zdesktop_installation_key">
   <value>[CURRENT_VALUE]</value>
 </key>
 <key name="Zimbra_ldap_password">
   <value>[CURRENT_VALUE]</value>
 </key>

.. [CURRENT_VALUE] is whatever key Zimbra Desktop generated and should be same for both "zdesktop_installation_key" and "Zimbra_ldap_password"


5. Restart Zimbra Desktop (Right click on system tray icon and click ShutDown Service, and then start Zimbra Desktop again)




Deploying and undeploying Production-level Zimlets


PS: only production level Zimlets that are ready-to-go. For Zimlet development, see "DEVELOPMENT HACKS or TIPS" section below



On Windows:


There are two ways to deploy or undeploy a zimlet in Zimbra Desktop.

  1. Manual installation
  2. Using "Zimlet Installer.hta"

1. Deploying Zimlets manually

  1. CD to 'zdesktop' folder (the following command is relative to zdesktop)
  2. java -cp jetty\lib\log4j-1.2.8.jar;jetty\common\lib\commons-httpclient-3.0.jar;jetty\common\lib\mail.jar;jetty\common\lib\commons-logging.jar;jetty\common\lib\commons-codec-1.3.jar;jetty\common\lib\json.jar;jetty\common\lib\dom4j-1.5.jar;jetty\common\lib\zimbracommon.jar;jetty\webapps\service\WEB-INF\lib\zimbrastore.jar -Dzimbra.config=conf\localconfig.xml com.zimbra.cs.zimlet.ZimletUtil deploy C:\path\to\zimletZipfile\com_Zimbra_hello.zip
  3. Shutdown Zimbra Service
  4. Start Zimbra Desktop again


2. Deploying Zimlets via "Zimlet Installer.hta":

  1. keep Zimbra Desktop should be running
  2. Open Zimlet Installer.hta and browse to the Zimlet zip file
  3. Hit Deploy


Notes:

  1. When Zimlet is deployed, it gets registered in ldap and also the Zimlet files are unzipped and copied to <zdesktop>\jetty\webapps\service\Zimlet folder.
  2. This will deploy the Zimlet and restarts Zimbra Desktop Service
  3. You should see Zimlet after the restart.
  4. All Production Zimlets needs to be *deployed* and needs a restart. While developing a Zimlet however we will use _dev folder which

would over-come this.

1. UnDeploying Zimlets manually

  1. CD to 'zdesktop' folder (the following command is relative to zdesktop)
  2. java -cp jetty\lib\log4j-1.2.8.jar;jetty\common\lib\commons-httpclient-3.0.jar;jetty\common\lib\mail.jar;jetty\common\lib\commons-logging.jar;jetty\common\lib\commons-codec-1.3.jar;jetty\common\lib\json.jar;jetty\common\lib\dom4j-1.5.jar;jetty\common\lib\zimbracommon.jar;jetty\webapps\service\WEB-INF\lib\zimbrastore.jar -Dzimbra.config=conf\localconfig.xml com.zimbra.cs.zimlet.ZimletUtil undeploy C:\path\to\zimletZipfile\com_Zimbra_hello.zip
  3. Shutdown Zimbra Service
  4. Start Zimbra Desktop again


Undeploying Zimlets via "Zimlet Installer.hta":

  1. keep Zimbra Desktop should be running
  2. Open Zimlet Installer.hta and enter Zimlet's handler name like: com_Zimbra_test (without .zip) in the undeploy field
  3. Hit UnDeploy
    1. this will UnDeploy the Zimlet and restarts Zimbra Desktop Service
    2. You should see Zimlet go away after the restart.



Notes:

  1. There is a server bug that causes undeployer not to delete Zimlet files in <zdesktop>\jetty\webapps\service\Zimlet folder. It wont hurt, but you can manually delete it if need be.



On MacOSX:


You will have to run java command to install and uninstall..

Deploy Zimlets

  1. CD to zdesktop install folder
  2. Run the following java command...

java -cp <required jar files> -DZimbra.config=conf/localconfig.xml com.Zimbra.cs.Zimlet.ZimletUtil deploy <PATH to Zimlet.zip file>/com_Zimbra_hello.zip

example: java -cp jetty/lib/log4j-1.2.8.jar:jetty/common/lib/commons-httpclient-3.0.jar:jetty/common/lib/mail.jar:jetty/common/lib/commons-logging.jar:jetty/common/lib/commons-codec-1.3.jar:jetty/common/lib/json.jar:jetty/common/lib/dom4j-1.5.jar:jetty/common/lib/Zimbracommon.jar:jetty/webapps/service/WEB-INF/lib/Zimbrastore.jar -DZimbra.config=conf/localconfig.xml com.Zimbra.cs.Zimlet.ZimletUtil deploy ~/Y/Zimlets/com_Zimbra_hello.zip

  1. Shutdown Zimbra Desktop Service and Start it


Notes:

  1. When Zimlet is deployed, it gets registered in ldap and also the Zimlet files are unzipped and copied to <zdesktop>\jetty\webapps\service\Zimlet.


Undeploy Zimlet: 1. CD to zdesktop install folder

2. java -cp <required jar files> -DZimbra.config=conf/localconfig.xml com.Zimbra.cs.Zimlet.ZimletUtil undeploy <JUST-THE-Zimlet-HANDLER-NAME-WITHOUT-DOTZIP> java -cp jetty/lib/log4j-1.2.8.jar:jetty/common/lib/commons-httpclient-3.0.jar:jetty/common/lib/mail.jar:jetty/common/lib/commons-logging.jar:jetty/common/lib/commons-codec-1.3.jar:jetty/common/lib/json.jar:jetty/common/lib/dom4j-1.5.jar:jetty/common/lib/Zimbracommon.jar:jetty/webapps/service/WEB-INF/lib/Zimbrastore.jar -DZimbra.config=conf/localconfig.xml com.Zimbra.cs.Zimlet.ZimletUtil undeploy com_Zimbra_hello Note: For undeploying just use the Zimlet-handler-name (not the path and also dont include .zip)

3. Shutdown Zimbra Desktop Service and start it PS: There is a server bug that causes undeployer not to delete Zimlet files in <zdesktop>\jetty\webapps\service\Zimlet folder. It wont hurt, but you can manually delete it if need be.


Zimlet Development by manually building ZCS Environment

  • You'll need ZCS 3.0 or later, either Network or Open Source Edition.
  • JDK 5
  • Eclipse or other editors you are familiar with.
  • Apache Ant for building example Zimlets bundled with ZCS source code. You can use the existing build.xml and just add your own zimlet for easy building and deployment.
  • zip / unzip utility. Most Linux distributions come with /usr/bin/zip and /usr/bin/unzip. Windows XP has a built-in support for zip, but you can also use open source zip utilities like 7-Zip.


Verified Against: ZCS 5.0 Date Created: 3/10/2009
Article ID: https://wiki.zimbra.com/index.php?title=ZimletDevSetup Date Modified: 2009-03-10



Try Zimbra

Try Zimbra Collaboration with a 60-day free trial.
Get it now »

Want to get involved?

You can contribute in the Community, Wiki, Code, or development of Zimlets.
Find out more. »

Looking for a Video?

Visit our YouTube channel to get the latest webinars, technology news, product overviews, and so much more.
Go to the YouTube channel »

Jump to: navigation, search