ZCS 6.0:Zimlet Developers Guide:Examples:HTTP GET and POST
Introduction | Getting Started | Dev Environment Setup | Developing Zimlets | Advanced Concepts | API Specifications | Example Zimlets |
Description
This zimlet shows how to create and use internationalizable resource properties. In the Zimlet Definition File, the zimlet accesses resource properties using the ${msg}
syntax.
Definition File
<zimlet name="com_zimbra_example_httpgetpost" version="1.0" description="An example zimlet using HTTP GET and POST."> <include>com_zimbra_example_httpgetpost.js</include> <handlerObject>com_zimbra_example_httpgetpost_HandlerObject</handlerObject> <zimletPanelItem label="Zimlet Example (HTTP GET and POST)" icon="zimbraIcon"> <toolTipText>Right click to display the menu</toolTipText> <contextMenu> <menuItem label="HTTP GET" id="CALL_VIA_HTTP_GET" /> <menuItem label="HTTP POST" id="CALL_VIA_HTTP_POST" /> </contextMenu> </zimletPanelItem> </zimlet>
Handler Object
/** * Displays the zimlet jsp page. * */ com_zimbra_example_httpgetpost_HandlerObject.prototype._executeHttpGet = function() { var jspUrl = this.getResource("jspfile.jsp"); var response = AjxRpc.invoke(null, jspUrl, null, null, true); if (response.success == true) { appCtxt.getAppController().setStatusMsg(response.text); } }; /** * Displays the zimlet jsp page. * */ com_zimbra_example_httpgetpost_HandlerObject.prototype._executeHttpPost = function() { var jspUrl = this.getResource("jspfile.jsp"); var response = AjxRpc.invoke(null, jspUrl, null, null, false); if (response.success == true) { appCtxt.getAppController().setStatusMsg(response.text); } };
Download
Zimlet Package | com_zimbra_example_httpgetpost.zip |