ZimletDevSetup: Difference between revisions
No edit summary |
No edit summary |
||
Line 57: | Line 57: | ||
'''1. Deploying Zimlets manually''' | '''1. Deploying Zimlets manually''' | ||
# CD to 'zdesktop' folder (the following command is relative to zdesktop) | # CD to 'zdesktop' folder (the following command is relative to zdesktop) | ||
# 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 | # 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''' | |||
<pre> | |||
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 | |||
</pre> | |||
# Shutdown Zimbra Service | # Shutdown Zimbra Service | ||
# Start Zimbra Desktop again | # Start Zimbra Desktop again | ||
Line 77: | Line 81: | ||
'''1. UnDeploying Zimlets manually''' | '''1. UnDeploying Zimlets manually''' | ||
# CD to 'zdesktop' folder (the following command is relative to zdesktop) | # CD to 'zdesktop' folder (the following command is relative to zdesktop) | ||
# 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 | # Run the following command. | ||
java -cp <required jar files> -DZimbra.config=conf/localconfig.xml com.Zimbra.cs.Zimlet.ZimletUtil undeploy <JUST-THE-Zimlet-HANDLER-NAME-WITHOUT-DOTZIP> | |||
<pre>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 | |||
</pre> | |||
# Shutdown Zimbra Service | # Shutdown Zimbra Service | ||
# Start Zimbra Desktop again | # Start Zimbra Desktop again | ||
Line 105: | Line 112: | ||
# CD to zdesktop install folder | # CD to zdesktop install folder | ||
# Run the following java command... | # 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 | 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 | |||
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 | |||
# Shutdown Zimbra Desktop Service and Start it | # Shutdown Zimbra Desktop Service and Start it |
Revision as of 19:49, 10 March 2009
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.
- Manual installation
- Using "Zimlet Installer.hta"
1. Deploying Zimlets manually
- CD to 'zdesktop' folder (the following command is relative to zdesktop)
- 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
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
- Shutdown Zimbra Service
- Start Zimbra Desktop again
2. Deploying Zimlets via "Zimlet Installer.hta":
- keep Zimbra Desktop should be running
- Open Zimlet Installer.hta and browse to the Zimlet zip file
- Hit Deploy
Notes:
- 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.
- This will deploy the Zimlet and restarts Zimbra Desktop Service
- You should see Zimlet after the restart.
- 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
- CD to 'zdesktop' folder (the following command is relative to zdesktop)
- Run the following command.
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 C:\path\to\zimletZipfile\com_Zimbra_hello.zip
- Shutdown Zimbra Service
- Start Zimbra Desktop again
Undeploying Zimlets via "Zimlet Installer.hta":
- keep Zimbra Desktop should be running
- Open Zimlet Installer.hta and enter Zimlet's handler name like: com_Zimbra_test (without .zip) in the undeploy field
- Hit UnDeploy
- this will UnDeploy the Zimlet and restarts Zimbra Desktop Service
- You should see Zimlet go away after the restart.
Notes:
- 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
- CD to zdesktop install folder
- 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
- Shutdown Zimbra Desktop Service and Start it
Notes:
- 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.