Results 1 to 9 of 9

Thread: Zimbra ActionScript Library Release

  1. #1
    fernandoflorez is offline Project Contributor
    Join Date
    Sep 2006
    Posts
    252
    Rep Power
    8

    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!

  2. #2
    derekmckee is offline Starter Member
    Join Date
    May 2009
    Posts
    1
    Rep Power
    5

    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...

  3. #3
    fernandoflorez is offline Project Contributor
    Join Date
    Sep 2006
    Posts
    252
    Rep Power
    8

    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!

  4. #4
    fernandoflorez is offline Project Contributor
    Join Date
    Sep 2006
    Posts
    252
    Rep Power
    8

    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!

  5. #5
    fernandoflorez is offline Project Contributor
    Join Date
    Sep 2006
    Posts
    252
    Rep Power
    8

    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!

  6. #6
    Michael REMY is offline Loyal Member
    Join Date
    Jun 2009
    Posts
    93
    Rep Power
    5

    Default ok

    Hi again Fernando !


    Where shall we download your solution ?

    i would be very glad to try it !

    Does it run under flex4 ?

  7. #7
    fernandoflorez is offline Project Contributor
    Join Date
    Sep 2006
    Posts
    252
    Rep Power
    8

    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!

  8. #8
    bruder is offline Starter Member
    Join Date
    Oct 2010
    Posts
    2
    Rep Power
    4

    Default

    Hi Fernando,

    I was wondering if there is an update with the actionscript library?

  9. #9
    motik is offline Junior Member
    Join Date
    Aug 2011
    Posts
    9
    Rep Power
    3

    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.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. /tmp filling
    By Nutz in forum Administrators
    Replies: 8
    Last Post: 02-22-2008, 02:00 AM
  2. Big Fubar on 5 FOSS GA Upgrade
    By uxbod in forum Administrators
    Replies: 24
    Last Post: 01-21-2008, 03:37 AM
  3. Cleanup after many upgrades
    By tobru in forum Installation
    Replies: 1
    Last Post: 12-23-2007, 09:21 AM
  4. [SOLVED] Error Installing Zimbra on RHEL 5
    By harris7139 in forum Installation
    Replies: 10
    Last Post: 09-25-2007, 11:39 AM
  5. Zimbra shutdowns every n hours.
    By Andrewb in forum Administrators
    Replies: 13
    Last Post: 08-14-2007, 08:55 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •