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

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-27-2010, 01:05 PM
Starter Member
 
Posts: 2
Default need help writing first zimlet

Hey folks, I've been tasked with writing up a zimlet but I'm struggling a bit on one part as JavaScript isn't my strong suit.

The zimlet is to recognize items in an email, and allow the user to hover over the item to get more information. The information would come from an intranet site on another server.

I used the com_zimbra_example_customtooltip zimlet as my base and modified the regex to detect what I needed. And I have the php script on my other server that can take the information and use it to query the database.

Where I'm having trouble is, I don't have a clue how to make the AJAX call to pass the value from the email to the php page and then use the value that's returned from it.

Any help would be great (sample scripts would be marvelous).

Thanks.
Reply With Quote
  #2 (permalink)  
Old 06-01-2010, 01:13 AM
Zimlet Guru & Moderator
 
Posts: 288
Default

You can do AJAX calls with AjxRpc.

Example of a GET request (take care to add the domain of the php page to the proxy allowed domains) :

Code:
params = "?param="+ information;
//Setting the URL
url = ZmZimletBase.PROXY + AjxStringUtil.urlComponentEncode(urlPhpPage + params);
//the AJAX call.
var response = AjxRpc.invoke(null, url , null, null, true);
Reply With Quote
  #3 (permalink)  
Old 06-03-2010, 01:19 PM
Starter Member
 
Posts: 2
Default

Thanks tdesorbaix. That seems to be working, but I'm getting hung up on the allowed domains. I'm working out of _dev and it doesn't appear to see the config_template.xml file where I'm allowing the domain. And when I try to deploy zimlets it's giving me an error (using ZD1) so I'm trying to figure that step out now.

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