Difference between revisions of "ZimletWritingTip"
|Line 30:||Line 30:|
Firefox has a browser extension named
Firefox has a browser extension named http://www.getfirebug.com/ which is phenomenal.
Revision as of 08:01, 17 August 2009
Update(Use Zimbra Desktop for Zimlet Development)
Yahoo! Zimbra Desktop is a quicker & better alternative for Zimlet development. Please see Zimlet Development via Zimbra Desktop for more tips and hacks.
Use _dev directory to cut down Zimlet development cycle
Typical software development involves the cycle fix -> build -> test -> fix ... It can be particularly cumbersome because Zimlets need to be deployed to the system in order to be tested. You might fix a typo in the xml, then need to deploy, possibly restart tomcat, then reload the browser to see the change.
There is a Zimlet dev directory to address this issue. It is a special location /opt/zimbra/tomcat/webapps/service/zimlet/_dev directory (replace /opt/zimbra/tomcat with your own Tomcat install directory). The Zimlets stored in the dev directory is read each time it's needed. For example, you can test the Hello World Zimlet by doing the following
$ mkdir -p /opt/zimbra/tomcat/webapps/service/zimlet/_dev/com_zimbra_hello $ cp com_zimbra_hello.xml /opt/zimbra/tomcat/webapps/service/zimlet/_dev/com_zimbra_hello
ZCS 5.x Note: Since Tomcat has been replaced with Jetty, the directories are at /opt/zimbra/mailboxd/webapps/service...... instead of /opt/zimbra/tomcat... (Thanks tdesorbaix)
Then simply reload the browser to load the new Zimlet in dev directory. Now you don't need to go through formal Zimlet lifecycle management of deploying and undeploying in order to test your new Zimlets. Each time you edit the contents in _dev directory, just reload the browser. When you are ready to deploy to the all the users, you can then create a zip bundle and deploy on the machines.
This feature is not supposed to be used on the production machines. Because the Zimlets in dev directory is read often it creates a lot of disk activity. Use dev directory only on your development box. Do not create dev directory on the production machines.
For even faster creation / testing this can be done on the Zimbra Desktop as well
The Zimbra Desktop is almost a complete clone of the Zimbra server. While there are no admin pages to add zimlets or command line tools to do so, the _dev feature works there as well
in the /Users/USERNAME/zimbra/zdesktop/jetty/webapps/service/zimlet/
directory create a _dev directory and place your dev zimlets there as described above.
While I would NOT recommend this as a substitute for real deployment testing, it is very convenient if you want to do development on your laptop while riding on a train or if you don't feel like uploading to the server to test it works pretty well.
I have tested this with the Hello World zimlet as well as the contact cleaner.
Firefox has a browser extension named Firebug which is phenomenal.