Difference between revisions of "ZCS 6.0:Zimlet Developers Guide:Examples:Panel Item Drag Source Details"

(ZCS 6.0: Zimlet Developer Guide:Examples:Panel Item Drag Source Details)
 
(5 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{| cellspacing="0" cellpadding="5" style="border: 1px solid rgb(153, 153, 170); margin: 0pt 0.5em 0.5em 0pt; float: none; background-color: rgb(249, 249, 255);"
+
{{BC|Community Sandbox}}
 +
__FORCETOC__
 +
<div class="col-md-12 ibox-content">
 +
=ZCS 6.0: Zimlet Developer Guide:Examples:Panel Item Drag Source Details=
 +
{{KB|{{Unsupported}}|{{ZCS 7.0}}|{{ZCS 6.0}}|}}
 +
{{WIP}}{| cellspacing="0" cellpadding="5" style="border: 1px solid rgb(153, 153, 170); margin: 0pt 0.5em 0.5em 0pt; float: none; background-color: rgb(249, 249, 255);"
 
|[[Image:zdg-6-menu-icon-zimbra.jpg|20px]]
 
|[[Image:zdg-6-menu-icon-zimbra.jpg|20px]]
 
|[[ZCS 6.0:Zimlet Developers Guide:Introduction|Introduction]]
 
|[[ZCS 6.0:Zimlet Developers Guide:Introduction|Introduction]]
Line 15: Line 20:
 
|[[ZCS 6.0:Zimlet Developers Guide:Example Zimlets|Example Zimlets]]
 
|[[ZCS 6.0:Zimlet Developers Guide:Example Zimlets|Example Zimlets]]
 
|}
 
|}
 
 
== Description ==
 
== Description ==
  
Line 50: Line 54:
 
var subject= msg.subject; // {String}
 
var subject= msg.subject; // {String}
 
var tags = msg.tags; // {Array}
 
var tags = msg.tags; // {Array}
var messageid = msg.messageid; // {String}
+
var messageid = msg.messageId; // {String}
  
 
var fromAddresses = msg.getAddresses(AjxEmailAddress.FROM);
 
var fromAddresses = msg.getAddresses(AjxEmailAddress.FROM);
Line 90: Line 94:
 
{| cellspacing="0" cellpadding="5" border="1"
 
{| cellspacing="0" cellpadding="5" border="1"
 
|Zimlet Package
 
|Zimlet Package
|[http://files.zimbra.com/docs/zimlet/zcs/6.0/examples/com_zimbra_example_paneldragsourcedetails/com_zimbra_example_paneldragsourcedetails.zip com_zimbra_example_paneldragsourcedetails.zip]
+
|[https://github.com/Zimbra-Community/zimlets-foss/raw/master/Zimlet/src/zimlet/com_zimbra_example_paneldragsourcedetails.zip com_zimbra_example_paneldragsourcedetails.zip]
 
|}
 
|}
  
Line 103: Line 107:
  
  
{{Article Footer|Zimbra Collaboration Suite 6.0|02/01/2010}}
+
{{Article Footer|Zimbra Collaboration Server 7.0|02/01/2010}}
  
  
 
[[Category:Developers]]
 
[[Category:Developers]]
 
[[Category:Zimlets]]
 
[[Category:Zimlets]]
 +
[[Category:ZCS 7.0]]
 
[[Category:ZCS 6.0]]
 
[[Category:ZCS 6.0]]

Latest revision as of 11:58, 3 November 2020

ZCS 6.0: Zimlet Developer Guide:Examples:Panel Item Drag Source Details

   KB 3404        Last updated on 2020-11-3  




0.00
(0 votes)
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 Zdg-6-menu-icon-checkbox.jpg Example Zimlets

Description

This zimlet will display in the Zimlet panel. It registered to accept drag-n-drop items of types: appointment, contact, conversation, mail messages, tasks and briefcase items. When items of those types are dropped on the panel item, the Zimlet Handler Object com_zimbra_example_paneldragsourcedetails_HandlerObject.prototype.doDrop(obj) is called and the handler can process the dropped obj. This zimlet shows how to do basic processing and retrieval of common properties of each of the drop item objects.

Definition File

<zimlet name="com_zimbra_example_paneldragsourcedetails" version="1.0" description="Demos panel zimlet that accepts drag source objects">
  <include>com_zimbra_example_paneldragsourcedetails.js</include>
  <handlerObject>com_zimbra_example_paneldragsourcedetails_HandlerObject</handlerObject>
  <zimletPanelItem label="Drag Source Details">
    <toolTipText>Drag-and-drop an object</toolTipText>
    <dragSource type="ZmAppt" />
    <dragSource type="ZmContact" />
    <dragSource type="ZmConv" />
    <dragSource type="ZmMailMsg" />
    <dragSource type="ZmTask" />
    <dragSource type="ZmBriefcaseItem" />
  </zimletPanelItem>
</zimlet>


Handler Object

Here is a code snippet for retrieving basic properties of a mail message:

	var msg = obj.srcObj; // {ZmMailMsg}
			
	var unread = msg.isUnread; // {Boolean}
	var hasattach = msg.hasAttach; // {Boolean}
	var subject= msg.subject; // {String}
	var tags = msg.tags; // {Array}
	var messageid = msg.messageId; // {String}

	var fromAddresses = msg.getAddresses(AjxEmailAddress.FROM);	
	if (fromAddresses) {
		var fromArray = fromAddresses.getArray();

		for (var i=0; i< fromArray.length; i++) {
			var addr = fromArray[i];
			var address = addr.getAddress(); // {String}
			var name = addr.getName(); // {String}
			var typestr = addr.getTypeAsString(); // {String}
			var displayName = addr.getDispName(); // {String}
		}
	}
			
	var toAddresses = msg.getAddresses(AjxEmailAddress.TO);
	var ccAddresses = msg.getAddresses(AjxEmailAddress.CC);

This code shows getting a few properties from the contact object:

	var contact = obj; // {ZmContact}
			
	var fn = contact.firstName; // {String}
	var ln = contact.lastName; // {String}
	var email = contact.email; // {String}
	var homePhone = contact.homePhone; // {String}
	var otherPhone = contact.otherPhone; // {String}
	var workPhone = contact.workPhone; // {String}

	var email = contact.email; // {String}
	var email2 = contact.email2; // {String}
	var email3 = contact.email3; // {String}

Download

Zimlet Package com_zimbra_example_paneldragsourcedetails.zip


Useful Links


Verified Against: Zimbra Collaboration Server 7.0 Date Created: 02/01/2010
Article ID: https://wiki.zimbra.com/index.php?title=ZCS_6.0:Zimlet_Developers_Guide:Examples:Panel_Item_Drag_Source_Details Date Modified: 2020-11-03



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