| 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.
|  | 
10-13-2011, 04:53 AM
| | | Zimlet to get and parse XML file from HTTP server? Hi everyone
I'm desinging a Zimlet to integrate with our intranet.
I've got a blank Zimlet running in a new tab but wondering if anyone has any pointers for the next stage?
Basically I'm looking to get an XML file from an HTTP server on our intranet, then parse this XML into a table of data within the zimlet.
It would be ideal if I could have the XML re-downloaded and parsed every 30 seconds as well.
Is something like this possible?
What functions should I be looking at in order to achieve something like this?
Cheers, B | 
10-13-2011, 07:36 AM
| | Zimlet Guru & Moderator | |
Posts: 288
| | Hi,
It should be possible.
I think you can use "AjxXmlDoc" to load/parse your xml file, and use "setInterval" to do it every 30 second. | 
10-16-2011, 01:42 PM
| | Zimlet Guru & Moderator | |
Posts: 467
| | Quote:
Originally Posted by tdesorbaix Hi,
It should be possible.
I think you can use "AjxXmlDoc" to load/parse your xml file, and use "setInterval" to do it every 30 second. | You also have a option to do a couple of different toolkits as well. Anything that you can include via JS can be used. | 
11-02-2011, 01:50 AM
| | | Thanks for all the info on this!
I'm relatively new to JS apart from building stuff in jQuery and other HTML form validation stuff.
What are the toolkits you can use? Do you mean full libraries like jQuery/prototype?
Also, should I output the data in JSON rather than XML? Would that be easier for the Zimlet to parse?
Cheers, B | 
11-02-2011, 02:43 AM
| | Zimlet Guru & Moderator | |
Posts: 288
| | Quote: |
Anything that you can include via JS can be used.
| So yes, you can include a library like jQuery in your zimlet.
Zimbra API can manage both XML and JSON output.
JSON is better/easier if you can make a response with this format. | 
11-02-2011, 05:49 AM
| | | Very cool!
Yes I'm designing the output so can easily output in JSON rather than XML.
For this, would I need an external library, or would I be able to do this using regular JS and the zimlet API?
I'm looking to loop through the JSON response and output a table and buttons based on the data contained within the response.
This Zimlet will be running as a separate "applet" tab within Zimbra.
When I output HTML elements using a Zimlet, will it be styled according to Zimbra's stylesheet?
Apologies for all the questions. Just trying to get it clear in my head as to what I need to get started.
Cheers, B | | Thread Tools | Search this Thread | | | | | Display Modes | Linear Mode | | Why Join? Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.  |