Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Developers

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-14-2009, 10:31 PM
Project Contributor
 
Posts: 252
Default Zimbra ActionScript Library Release

Hello guys,

So here is the first public release of the Zimbra ActionScript library.

It has the ability to create, edit, remove, etc. folders, tags, emails, conversations and searches.

Be sure to check it out and let me know what you think!

Zimbra Mail ActionScript Library | funciton communications - blog

Thanks!
Reply With Quote
  #2 (permalink)  
Old 05-26-2009, 04:30 PM
Starter Member
 
Posts: 1
Default Do you have any unit tests / examples to get me started ?

Fernando,
I recently came across your Zimbra Mail actionscript library and it seems just perfect for my needs (implement functionality in flex instead of Zimlets). Do you have any unit tests / examples to get me started ?

cheers...
Reply With Quote
  #3 (permalink)  
Old 05-26-2009, 10:06 PM
Project Contributor
 
Posts: 252
Default

I'll upload the unit tests on the weekend.

It's very simple to use actually, for example:

Code:
import inca.api.Zimbra;
import inca.api.events.

var zimbra:Zimbra = new Zimbra();
zimbra.secureConnection = true; //https
zimbra.server = "mail.domain.com";
zimbra.username = "username@domain.com";
zimbra.password = "XXX";
zimbra.addEventListener(ZimbraEvent.LOGGED_IN, onLoggedIn, false, 0, true);
function onLoggedIn(e:ZimbraEvent):void{
trace ("LOGGED IN!");
}
zimbra.login();
Thats the basic thing. Now, lets try an "inbox" search.

Change the "onLoggedIn" event handler:

Code:
function onLoggedIn(e:ZimbraEvent):void{
(e.target as Zimbra).addEventListener(ZimbraSearchEvent.COMPLETE, onSearchComplete, false, 0, true);
(e.target as Zimbra).search("in:inbox");
}

function onSearchComplete(e:ZimbraSearchEvent):void{
// get all email returned by the search
trace ((e.data as ZimbraSearchResponse).collection);
}
I'll post a new example tomorrow.

Thanks for using it

Cheers!
Reply With Quote
  #4 (permalink)  
Old 05-31-2009, 06:25 PM
Project Contributor
 
Posts: 252
Default

Here is another example i wrote quickly for Adobe Air:

Code:
<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication 
	xmlns:mx="http://www.adobe.com/2006/mxml" 
	layout="absolute"
	applicationComplete="init();">
	
	<mx:Script>
		<![CDATA[
			
			import inca.api.Zimbra;
			import inca.api.events.*;
			import inca.api.models.*;
			
			private var $__zimbra:Zimbra = new Zimbra();
			private var $__zimbraMessage:ZimbraMessage;
			
			private function init():void{
				$__zimbra.server = "mail.domain.com";
				$__zimbra.username = "user@domain.com";
				$__zimbra.password = "myPassword";
				$__zimbra.addEventListener(ZimbraEvent.LOGGED_IN, onLoggedIn, false, 0, true);
				
				$__zimbra.login();
			}
			
			private function onLoggedIn(e:ZimbraEvent):void{
				(e.target as Zimbra).addEventListener(ZimbraSearchEvent.COMPLETE, onSearchComplete);
				
				(e.target as Zimbra).search("in:inbox", Zimbra.LIST_TYPE_MESSAGE, 1);
			}
			
			private function onSearchComplete(e:ZimbraSearchEvent):void{
				var messages:Array = (e.data as ZimbraSearchResponse).collection;
				
				$__zimbraMessage = $__zimbra.getMessage(messages[0].id);
				$__zimbraMessage.addEventListener(ZimbraEvent.MESSAGE_LOADED, onMessageLoaded);
			}
			
			private function onMessageLoaded(e:Event):void{
				var msg:ZimbraMessage = (e.target as ZimbraMessage);
				
				trace ("subject:", msg.subject, "\nmessage:", msg.content);
			}
			
			
		]]>
	</mx:Script>
	
</mx:WindowedApplication>
I didn't include try..catch blocks so if your search returns zero messages an error will be thrown.

Oh! BTW, i updated the library today to fix a bug on the folder listing.

Hope to have some free time this week to release the calendar part of the library.

Cheers!
Reply With Quote
  #5 (permalink)  
Old 05-31-2009, 10:55 PM
Project Contributor
 
Posts: 252
Default

I would love to see if you guys like how the library is implemented.

Do you guys think it would be a good idea to translate it to maybe javascript?

It is very lightweight compared to Zimbra's.

Cheers!
Reply With Quote
  #6 (permalink)  
Old 04-26-2010, 06:55 AM
Loyal Member
 
Posts: 92
Default ok

Hi again Fernando !


Where shall we download your solution ?

i would be very glad to try it !

Does it run under flex4 ?
Reply With Quote
  #7 (permalink)  
Old 05-02-2010, 10:37 PM
Project Contributor
 
Posts: 252
Default

Hi Michael,

I lost my github account sometime ago and i haven't had the chance to upload it somewhere else.

I'm currently working on updating it with the new zimbra api changes and make it compatible with flash builder.

Will keep you updated via these forums.

Cheers!
Reply With Quote
  #8 (permalink)  
Old 10-03-2010, 03:05 AM
Starter Member
 
Posts: 2
Default

Hi Fernando,

I was wondering if there is an update with the actionscript library?
Reply With Quote
  #9 (permalink)  
Old 08-06-2011, 05:54 AM
Junior Member
 
Posts: 9
Default

The link seems to be broken.
Is there gonna be update soon ?
__________________
Release 7.1.1_GA_3196.RHEL5_64_20110527011124 CentOS5_64 FOSS edition.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.