Zimlet Developers Guide:Zimlet Definition File Reference

From Zimbra :: Wiki

Jump to: navigation, search
Zdg-6-menu-icon-zimbra.jpg Introduction Zdg-6-menu-icon-green-flag.png Getting Started Zdg-6-menu-icon-terminal.png Dev Environment Setup Zdg-6-menu-icon-gear.png Developing Zimlets Zdg-6-menu-icon-advanced.jpg Advanced Concepts Zdg-6-menu-icon-library.jpg
API Specifications
Zimlet Definition File Reference
Zimlet Configuration File Reference
Zimlet JavaScript API Reference
Zimbra REST API Reference
Zdg-6-menu-icon-checkbox.jpg Example Zimlets


Developer Article

Article Information

This article applies to the following ZCS versions.
  ZCS 8.0 Article  ZCS 8.0
  ZCS 7.0 Article  ZCS 7.0
  ZCS 6.0 Article  ZCS 6.0

This document provides a reference for the elements in the Zimlet Definition File.

Contents

Elements

<zimlet>

The <zimlet> element is the enclosing element in the Definition File. The <zimlet> element has the following attributes:

Attribute Required / Optional Range of Values Default Value Description
name Required A valid zimlet name N/A The name attribute is the zimlet's name and is a required attribute. This must be the same name as is used to prefix the Zimlet ZIP Package. The zimlet name is required to be unique within a deployment.
version Required A valid zimlet version N/A This required attribute specifies the zimlet’s version number. For example, version=”1.0”
description Required A valid zimlet description N/A This attribute provides a short description used in mouse-overs and dialogs


The following table describes the elements you can define within a <zimlet> element.

Order Element Required / Optional Description
1 summary Optional (0 or 1 allowed) The summary element contains text describing the zimlet in more detail. See <summary> for more information.
2 include Optional (0 or * allowed) JavaScript files to be included with the zimlet. See <include> for more information.
2 includeCSS Optional (0 or * allowed) CSS files to be included with the zimlet. See <includeCSS> for more information.
2 resource Optional (0 or * allowed) Resource files to be included with the zimlet. See <resource> for more information.
3 handlerObject Optional (0 or 1 allowed) Designates the JavaScript handler object for the zimlet. See <handlerObject> for more information.
4 serverExtension Optional (0 or 1 allowed) Designates the JavaScript server extension for the zimlet. See <serverExtension> for more information.
5 contentObject Optional (0 or 1 allowed) Designates how content objects are handled by the zimlet. See <contentObject> for more information.
6 zimletPanelItem Optional (0 or 1 allowed) Designates the zimlet panel items and actions. See <zimletPanelItem> for more information.
7 portlet Optional (0 or 1 allowed) Defines the portlet. See <portlet> for more information.
8 userProperties Optional (0 or 1 allowed) Defines user properties to store with the zimlet. See <userProperties> for more information.

<summary>

The summary element contains text describing the zimlet in more detail. For example, this element can also contain zimlet limitations or a list of current functionality:

Example:

<summary>This Zimlet will provide map information for street addresses Note: Currently maps are not scrollable or clickable.</summary>

<include>

A zimlet implementation may require JavaScript code to be loaded by the web client. For such cases, the <include> element is provided. The content of this element provides a reference to the additional JavaScript files that are to be loaded. These files may be internal, that is specified by a relative URL (e.g. foo.js) or external, that is specified by an absolute URL (e.g. http://api.google.com/maps.js). If multiple <include> elements are provided, loading order is maintained, with the top include being loaded first).

Example:

<include>http://api.google.com/maps.js</include>  
<include>gmaps.js</include>

<includeCSS>

A zimlet implementation may require CSS styles to be loaded by the web client. For such cases, the <includeCSS> element is provided. The content of this element provides a reference to the additional CSS file that is to be loaded. This file may be internal, that is specified by a relative URL (e.g. foo.css) or external, that is specified by an absolute URL (e.g. http://my.server.com/styles.css). Any CSS file included with a <includeCSS> element is automatically loaded.

Note: It is recommended that any CSS class in these files be prefixed with (or include) the zimlet name to avoid collisions with other CSS classes or zimlets.

Example:

<includeCSS>http://my.server.com/styles.css</includeCSS>  
<includeCSS>styles.css</includeCSS>   

<resource>

A zimlet implementation may require additional resources (such as images, binaries, etc). For such cases, the <resource> element is provided. The content of this element provides a reference to the additional resource that is to be loaded. This file may be internal that is specified by a relative URL (e.g. image.gif) or external, that is specified by an absolute URL (e.g. http://api.google.com/maps.jgif). Resources are not automatically loaded. They can be accessed with the fully qualified URL via the Zimlet Handler Object getResource() method.

Example:

<resource>http://api.google.com/maps.jgif</resource>
<resource>image.gif</resource>

<handlerObject>

The <handlerObject> element designates the JavaScript object constructor to call in the zimlet JavaScript file at zimlet initialization time. The handlerObject element may be omitted if the zimlet does not implement custom JavaScript code.

Example:

<handlerObject>com_zimbra_myzimletHandlerObject</handlerObject>

<serverExtension>

The <serverExtension> element describes how a content object is indexed on the server. Content, such as email message bodies, calendar appointment notes, and contact fields, that contains one or more zimlet content objects may be searched for using the query language "has" clause. For example, if a zimlet defines phone numbers as a content object, then to search for content containing phone numbers, a <serverExtension> element would be specified that defines phone numbers, and would enable searching for content containing phone numbers via the "has:phone" clause.

Attribute Required / Optional Range of Values Default Value Description
hasKeyword Required A valid keyword N/A This attribute specifies the keyword that will be used with the query language "has" clause (e.g. "has:address" or "has:id").
regex Optional A valid regular expression N/A This attribute specifies a regular expression that defines the zimlet content object. The format of this regular expression must follow the Java Development Kit (JDK) regular expression grammar. This attribute is mutually exclusive with the extensionClass attribute.
extensionClass Optional An extension class N/A If the content object matching rules cannot be expressed by a regular expression, then the extensionClass attribute may be specified. This attribute specifies a Java class that extends the com.zimbra.cs.zimlet.ZimletHandler interface. This class file must be part of the Zimlet bundle.

Example:

<serverExtension hasKeyword="tracking" extensionClass="com.zimbra.cs.zimlet.handler.TrackingHandler"/>

<contentObject>

A content object is an object that is recognized by a zimlet in a body of content, such as an email message body, the notes of an appointment, or fields in a contact. Examples of content objects are: Phone numbers, URLs, purchase order numbers, package tracking numbers, etc. The <contentObject> element defines the content object that a zimlet recognizes and how the user interacts with the object. If a zimlet does not expose a content object then this element may be omitted.

The following table describes the elements you can define within a <contentObject> element.

Order Element Required / Optional Description
1 matchOn Optional (0 or 1 allowed) Specifies the rules for the matching content objects. See <matchOn> for more information.
2 onClick Optional (0 or 1 allowed) Defines behavior for a single-click action. See <onClick> for more information.
3 toolTip Optional (0 or 1 allowed) The tool tip displayed when hovering over the object. See <toolTip> for more information.
4 contextMenu Optional (0 or 1 allowed) Defines the menu items created on right-click of the object. See <contextMenu> for more information.

The <contentObject> element has the following attributes:

Attribute Required / Optional Range of Values Default Value Description
type Optional A zimlet content object type N/A The attribute allows you to designate the type of content object.

Example:

<contentObject type="mytype">
    <matchOn>
        <regex attrs="ig">lab|user|remodel|zimbra</regex> <!-- matches lab or user or remodel or zimbra -->
    </matchOn>
    <toolTip>Hello World! Tool Tip</toolTip>
</contentObject>

<contextMenu>

The <contextMenu> element specifies the context menu items and their corresponding actions. A context menu is displayed when the user right clicks the mouse over a content object or a panel item (depending on whether being used in a <contentObject> or <zimletPanelItem>).

The following table describes the elements you can define within a <contextMenu> element.

Order Element Required / Optional Description
1 menuItem Required (1 or more allowed) Designated the menu items and actions for the context menu. See <menuItem> for more information.

Example:

<contextMenu>
    <menuItem label="Test menu 1.0" id="TEST_MENU_SOME_ID1" />
    <menuItem label="Test menu 2.0" id="TEST_MENU_SOME_ID2" />
    <menuItem label="Test menu 3.0" id="TEST_MENU_SOME_ID3" />
</contextMenu>

<portlet>

Using this element enables the zimlet to appear as a portlet on the Zimbra portal interface.

The following table describes the elements you can define within a <portlet> element.

Order Element Required / Optional Description
1 portletProperties Optional (0 or more allowed) Defines portlet properties. See <portletProperties> for more information.

Example:

  <portlet>
    <portletProperties>
       <property type="string" name="url" label="URL" value="about:blank"/>
       <property type="number" name="refresh" label="Refresh (ms)" />
    </portletProperties>
  </portlet>

<zimletPanelItem>

Using a zimlet panel item enables the zimlet to appear in the Zimbra Client "Zimlets" overview panel (found in the lower-right section of the client interface).

Zdg-6-panel-zimlets.png

The user may interact with a zimlet panel item by clicking, double clicking, right-clicking for a context menu, as well as by dragging-and-dropping various objects (such as contacts, conversations and mail messages) onto the panel item. The panel item definition specifies the type of objects that the Zimlet supports as well the actions to be performed when those object drag-and-drop occurs.

Do not include this element if you do not wish to expose a panel item for the Zimlet.

The <zimletPanelItem> element has the following attributes:

Attribute Required / Optional Range of Values Default Value Description
label Required A valid panel label N/A The label will be displayed as the text label for the panel item.
icon Optional The panel icon N/A The CSS class of the icon to be displayed as the panel item icon.

The following table describes the elements you can define within a <zimletPanelItem> element.

Order Element Required / Optional Description
1 toolTipText Optional (1 and only 1 allowed) The tool tip text to be displayed. See <toolTipText> for more information.
2 dragSource Optional (0 or more allowed) Specifies the drag source. See <dragSource> for more information.
3 onClick Optional (0 or 1 allowed) Defines behavior on single-click action. See <onClick> for more information.
4 onDoubleClick Optional (0 or 1 allowed) Defines behavior on double-click action. See <onDoubleClick> for more information.
5 contextMenu Optional (0 or 1 allowed) Designates the menu items and actions. See <contextMenu> for more information.

Example:

<zimletPanelItem label="Test Panel Item">
    <contextMenu>
        <menuItem label="Test menu 1.0" id="TEST_MENU_SOME_ID1" />
        <menuItem label="Test menu 2.0" id="TEST_MENU_SOME_ID2" />
        <menuItem label="Test menu 3.0" id="TEST_MENU_SOME_ID3" />
    </contextMenu>
</zimletPanelItem>

<param>

The <param> element is used to define parameters. The content of the element is the value of the parameter.

The <param> element has the following attributes:

Attribute Required / Optional Range of Values Default Value Description
name Required A attribute name N/A Specifies the parameter name

Example:

<actionUrl method="get" target="http://www.mapquest.com">
    <param name="address">passing an address value for the address parameter</param>
</actionUrl>

<menuItem>

A <menuItem> element describes an entry in the context menu. See <contextMenu> for more information.

For a menu line-break, use an empty <menuItem /> element.

The <menuItem> element has the following attributes:

Attribute Required / Optional Range of Values Default Value Description
id Optional The item id N/A A unique identifier for the menu item. If this attribute is omitted, use an empty <menuItem /> element for a line-break.
label Optional The item label N/A This is the text that will be displayed for the menu item in the context menu.
icon Optional The item icon N/A The url of the icon to be displayed for the menu item.
disabledIcon Optional The item icon N/A The url of the icon to be displayed when this menu item is disabled.

Note: the only way to enable or disable a menu item is via the Zimlet Handler Object JavaScript methods.

The following table describes the elements you can define within a <menuItem> element.

Order Element Required / Optional Description
1 menuItem Optional (0 and more allowed) Nested menu items to create multi-level menus.
2 canvas Optional (0 and 1 allowed) The visual canvas to use for the menu item. See <canvas> for more information.
3 actionUrl Optional (0 and 1 allowed) The url to load on the click event. If this element is omitted, the Zimlet framework will call the Zimlet Handler Object class menuItemSelected() method. See <actionUrl> for more information.

Example:

<contextMenu>
    <menuItem label="Test menu 1.0" id="TEST_MENU_SOME_ID1">
        <canvas type="window" width="300" height="300" />
        <actionUrl method="get" target="http://www.yahoo.com" />
    </menuItem>
</contextMenu>

<toolTip>

When a user hovers the mouse over a content object, a tool tip may be popped up. The <toolTip> element controls the behavior of this tool tip.

The <toolTip> element has the following attributes:

Attribute Required / Optional Range of Values Default Value Description
sticky Optional true, false false If set to "true", then the tool tip becomes a sticky tool tip. Such a tool tip behaves as a standard tool tip (i.e. will be dismissed on the appropriate amount of mouse motion) unless the user clicks within the tool tip content. When clicking in the tool tip content, the tip will remain "popped up" requiring the user to explicitly dismiss it. Sticky tool tips are a hybrid between dialogs and standard tool tips, and are useful when the user is able to interact with the content of the tool tip. For example, to zoom into the map of an address. If the sticky attribute is set to "false", then the tool tip behaves as a traditional tool tip and will be dismissed when the user moves their mouse.
width Optional A valid tool tip width N/A The width (in pixels) of the tool tip content. If this attribute is omitted, then the Zimlet framework will automatically size the tool tip.
height Optional A valid tool tip height N/A The height (in pixels) of the tool tip content. If this attribute is omitted, then the Zimlet framework will automatically size the content


The <toolTip> element can contain the tool tip text directly and it may also contain the following elements:

Order Element Required / Optional Description
1 actionUrl Optional (0 and 1 allowed) Specifies the url to be loaded in the tool tip. If this element is omitted, then the Zimlet framework will call the Zimlet Handler Object class toolTipPoppedUp() method. If the tool tip is a "sticky" tool tip, then when it is dismissed the Zimlet Handler Object class toolTipPoppedDown() method will be called. See <actionUrl> for more information.

Example:

<toolTip sticky=”true” width=”100” height=”200”>
    <actionUrl method=”get” target=”http://maps.google.com”>
        <param name=””>${src.objectContent}</param>
    </actionUrl>
</toolTip>

Example:

<toolTip sticky=”true” width=”100” height=”200”>
This is the tool tip.
</toolTip>

<matchOn>

Much like the <serverExtension> element specifies the rules that must be applied to match a content object for server side indexing, the <matchOn element specifies the rules for the matching content objects on the client. There are two mechanisms that may be used to define these rules:

  1. The first is with the <regex> element. The content of this element specifies a regular expression that defines the Zimlet’s content object. The format of this regular expression must follow the JavaScript regular expression grammar. The attrs attribute can be used to set any RegEx attributes.
  2. If the content object matching rules cannot be expressed by a regular expression, then the Zimlet server extension extensionClass match method may be overridden to provide the matching rules. See <serverExtension> for more information.

The following table describes the elements you can define within a <matchOn> element.

Order Element Required / Optional Description
1 matchOn Required (1 and only 1 allowed) The regular expression. See <regex> for more information.

Example:

<matchOn>
    <regex attrs=”ig”>1[zZ]\\s?\\w{3}\\s?\\w{3}\\s?\\</regex>
</matchOn>

<regex>

The regular expression. The expression must follow the JavaScript regular expression grammar

http://www.learn-javascript-tutorial.com/RegularExpressions.cfm

The <regex> element has the following attributes:

Attribute Required / Optional Range of Values Default Value Description
attrs Optional Regex attributes N/A The attrs attribute can be used to set any RegEx attributes.

<onClick>

The <onClick> element defines the behavior for the single-click action (i.e. when a user clicks on the zimlet with the left mouse button once).

The following table describes the elements you can define within a <onClick> element.

Order Element Required / Optional Description
1 canvas Optional (0 and 1 allowed) The visual canvas to use for the url action. See <canvas> for more information.
2 actionUrl Optional (0 and 1 allowed) The url to load on the click event. See <actionUrl> for more information.

Example:

When the user clicks on the zimlet content object, a new browser window of 300x300 pixel dimension is opened. The browser is loaded with the content of the URL specified in the <actionUrl> element:

<onClick>
    <canvas type="window" width="300" height="300" />
    <actionUrl method="get"  target="http://maps.google.com" />
</onClick>

<onDoubleClick>

The <onDoubleClick> element defines the behavior for the double-click action (i.e. when a user clicks on the zimlet with the left mouse button twice).

The following table describes the elements you can define within a <onDoubleClick> element.

Order Element Required / Optional Description
1 canvas Optional (0 and 1 allowed) The visual canvas to use for the url action. See <canvas> for more information.
2 actionUrl Optional (0 and 1 allowed) The url to load on the click event. See <actionUrl> for more information.

Example:

When the user double-clicks on the zimlet content object, a new browser window of 300x300 pixel dimension is opened. The browser is loaded with the content of the URL specified in the <actionUrl> element:

<onDoubleClick>
    <canvas type="window" width="300" height="300" />
    <actionUrl method="get" target="http://maps.google.com" />
</onDoubleClick>

<canvas>

Certain actions may result in content (e.g. driving directions or an html form) being presented to the user. In those cases, the <canvas> element describes the visual element where the content will be rendered.

The <canvas> element has the following attributes:

Attribute Required / Optional Range of Values Default Value Description
type Required none, dialog, tooltip, window N/A Specifies the type of canvas.
  • none - There is no visual element for this action.
  • dialog - The visual will be a dialog.
  • tooltip – The visual will be a tool tip.
  • window - A new browser window will be created.
width Optional The canvas width N/A The width in pixels of the visual canvas. This attribute is ignored if the visual type is "none". If this attribute is omitted, then the Zimlet framework will automatically size the content.
height Optional The canvas height N/A The height in pixels of the visual canvas. This attribute is ignored if the visual type is "none". If this attribute is omitted, then the Zimlet framework will automatically size the content.
props Optional The canvas window properties toolbar=yes, location=yes, status=yes, menubar=yes, scrollbars=yes, resizable=yes Properties to send to the canvas when type="window". These are the properties passed to the JavaScript window.open() method. By setting this attribute, you are overriding these properties.
title Optional The canvas dialog title N/A The title of the canvas when type="dialog".

Example:

<menuItem label="First Context Menu Item - Go to Yahoo!" icon="Search" id="SOME_ID1">
    <canvas type="window" width="800" height="600" />
    <actionUrl target="http://www.yahoo.com" method="get" />
</menuItem>

<dragSource>

The <dragSource> element specifies a drag source for the zimlet panel item. A drag source consists of a Zimbra object type (e.g. a conversation, a contact, or a mail message) and the action to be performed when a object of that type is dropped on the panel item.

The <dragSource> element has the following attributes:

Attribute Required / Optional Range of Values Default Value Description
type Required ZmAppt, ZmConv, ZmContact, ZmFolder, ZmMailMsg, ZmNotebook, ZmTask N/A Specifies the drag source type.

The following table describes the elements you can define within a <dragSource> element.

Order Element Required / Optional Description
1 canvas Optional (0 and 1 allowed) The visual canvas to use for the url action. See <canvas> for more information.
2 actionUrl Optional (0 and 1 allowed) The url to load on the click event. If this element is omitted, then the Zimlet framework will call the Zimlet Handler Object class doDrag() method. See <actionUrl> for more information.

Example:

<zimletPanelItem label="Test Panel with Drag Source">
    <dragSource type="ZmAppt" />
    <dragSource type="ZmContact" />
</zimletPanelItem>

<actionUrl>

The <actionUrl> element describes a URL that is called based on a given action. Examples of actions are clicking on a content object or dropping a contact onto a Zimlet panel item.

The <actionUrl> element has the following attributes:

Attribute Required / Optional Range of Values Default Value Description
method Optional get, post get Specifies the HTTP method to use (GET or POST).
target Required The target URL N/A Specifies the target URL. This may be either an absolute URL or a relative URL.
xslt Optional The XSTL style sheet N/A Specifies the XSLT style sheet file name. This file must be part of the Zimlet bundle. If present,the XSLT style sheet is applied to the result of the target URL. The output of applying the style sheet must be an HTML element, such as a <div>.
paramStart Optional The param start character ? This attribute specifies the character to use when appending parameters to a GET URL.
paramJoin Optional The param join character & This attribute specifies the character to use when appending additional parameters to a GET URL.

The following table describes the elements you can define within an <actionUrl> element.

Order Element Required / Optional Description
1 param Optional (0 or more allowed) Specifies parameters that are to be passed to the target URL. See <param> for more information.

Example:

<actionUrl target="http://www.yahoo.com" method="get" />

Example:

<actionUrl target="http://www.yahoo.com" method="get">
    <param name="someparamtopass">myvalue</param>
</actionUrl>

<toolTipText>

Defines the tool tip text to be displayed when a user hovers the mouse over the zimlet.

Example:

<toolTipText>Drag and drop a contact</toolTipText>  

Example (using a message property from the i18n resource messages.

<toolTipText>${msg.panelTooltipText}</toolTipText>    

<portletProperties>

Portlet properties enable zimlets to store properties with the zimlet.

The following table describes the elements you can define within a <portletProperties> element.

Order Element Required / Optional Description
1 property Required (1 or more allowed) Defines the portlet property. See <property> for more information.

Example:

  <portlet>
    <portletProperties>
      <property type="string" name="url" label="URL" value="about:blank"/>
      <property type="number" name="refresh" label="Refresh (ms)" />
    </portletProperties>
  </portlet>

<userProperties>

User properties enable zimlets to store user state/properties with the zimlet. If a zimlet defines user properties and the zimlet has a <zimbraPanelItem>, a property editor dialog is presented when the panel item is double-clicked.

The property editor dialog is constructed by the Zimlet Handler Object createPropertyEditor(). The default implementation of this method will "auto-create" a default property editor. Override createPropertyEditor() in order to provide a custom editor dialog.

The following table describes the elements you can define within a <userProperties> element.

Order Element Required / Optional Description
1 property Required (1 or more allowed) Defines the user property. See <property> for more information.

Example:

<userProperties>
    <property type="string" label="Your username" name="my_test_username" />
    <property type="password" label="Your password" name="my_test_password" />
    <property type="number" label="Your ID number" name="my_test_id_num" />
    <property type="date" label="Delivery Date" name="my_test_delivery_date" />
    <property type="boolean" label="Priority?" name="my_test_priority" />
    <property type="enum" label="Shapes" name="my_test_shapes">
        <item label="Square" value="square"/>
        <item label="Circle" value="circle"/>
        <item label="Rectangle" value="rectangle"/>
    </property>
</userProperties>

<property>

Defines the user property. The Zimlet Handler Object may access a property value with the getUserPropertyInfo() method.

The Zimlet Definition File may access a property value by enclosing the property name with "${}", and scoping it with "prop".

For example, to access a property name "my_test_username", one would specify ${prop.my_test_username}. Here is an example of using the property as a parameter to an action url:

<menuItem label="Test menu 2.0" id="TEST_MENU_SOME_ID2">
    <actionUrl method="get" target="http://finance.yahoo.com">
        <param name="whatismyparam">${prop.my_test_username}</param>
    </actionUrl>
</menuItem>

The following table describes the elements you can define within a <property> element.

Order Element Required / Optional Description
1 item Optional (0 or more allowed) The items used in the property (depending on property type). See below for more information on property type. See <item> for more information on the element.

The <property> element has the following attributes:

Attribute Required / Optional Range of Values Default Value Description
type Required password, enum, boolean, number, date, string string The type of property.
name Required A valid name N/A The variable name of the user property.
label Optional A valid label The value of the name attribute. The "pretty name" of the user property to be displayed in the Property Editor.
visible Optional true, false true If the property should be displayed in the Property editor. This attribute is used only if the default Property Editor is being used.
value Optional A default value N/A The pre-populated "default" value of the property to be displayed in the Property Editor property field.
readonly Optional true, false false The property should be read only.
required Optional true, false false The property should be required.

Based on the property attribute "type", the different attributes are used. The following sections describe those element attributes.

<property> attributes for type "string"

The <property> element uses the following attributes when type="string":

Attribute Required / Optional Range of Values Default Value Description
minLength Optional The minimum length N/A Defines the minimum string length for this property.
maxLength Optional The maximum length N/A Defines the maximum string length for this property.
rows Optional The number of lines N/A By defining this attribute, a text area input field is used and this attribute defines the number of lines displayed in the text area.

Example:

<property type="string" name="home_currency" minLength="3" maxLength="3" label="Home Currency"/>

<property> attributes for type "password"

The <property> element uses the following attributes when type="password":

Attribute Required / Optional Range of Values Default Value Description
minLength Optional The minimum length N/A Defines the minimum string length for this property.
maxLength Optional The maximum length N/A Defines the maximum string length for this property.

Example:

<property type="password" name="passwd" minLength="4" maxLength="255" label="Password" />

<property> attributes for type "number"

The <property> element uses the following attributes when type="number":

Attribute Required / Optional Range of Values Default Value Description
minValue Optional The minimum value N/A Defines the minimum value for this property.
maxValue Optional The maximum value N/A Defines the maximum value for this property.

Example:

<property type="number" name="WebExMax" label="Max # Of Meetings" />

<property> attributes for type "date"

Dates are represented internally as milliseconds since the epoc. No additional element attributes are used. The Property Editor dialog will present a date selector widget.

Example:

<property type="date" label="Delivery Date" name="my_test_delivery_date" />

<property> attributes for type "boolean"

The Boolean type represents a "true" or "false" value. This is presented to the user as a check button widget. No additional attributes are used.

Example:

<property type="boolean" label="Priority?" name="my_test_priority" />

<property> attributes for type "enum"

The enum type represents a set of choices. This may be presented to the user as a drop-down select box with a list of the valid choices or a set of radio buttons.

Properties of type="enum" expect 1 or more <item> elements. See <property> and <item> for more information.

Example:

<property type="enum" name="chart_type" label="Ex-rate chart" value="H_2_O">
    <item label="Home currency to other" value="H_2_O"/>
    <item label="Other to home currency" value="O_2_H"/>
</property>

<item>

The <item> element has the following attributes:

Attribute Required / Optional Range of Values Default Value Description
label Required The item label N/A The user interface label for the item.
value Required The item value N/A The value for the item.


Verified Against: Zimbra Collaboration Server 7.0 Date Created: 12/22/2009
Article ID: http://wiki.zimbra.com/index.php?title=Zimlet_Developers_Guide:Zimlet_Definition_File_Reference Date Modified: 04/11/2014
Personal tools