Results 1 to 6 of 6

Thread: Zimlet to get and parse XML file from HTTP server?

Hybrid View

  1. #1
    Join Date
    Aug 2007
    Location
    London, UK
    Posts
    297
    Rep Power
    8

    Default 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
    My Zimbra Bugs Wishlist: 16411, 24567, 35676, 36430, 37770, 41872, 43733, 44384, 46383, 47759
    And a way to associate mailto: handlers with a Zimbra Prism webapp

  2. #2
    Join Date
    Apr 2007
    Location
    Paris, France
    Posts
    367
    Rep Power
    8

    Default

    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.

  3. #3
    Join Date
    Nov 2005
    Posts
    477
    Rep Power
    10

    Default

    Quote Originally Posted by tdesorbaix View Post
    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.

  4. #4
    Join Date
    Aug 2007
    Location
    London, UK
    Posts
    297
    Rep Power
    8

    Default

    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
    My Zimbra Bugs Wishlist: 16411, 24567, 35676, 36430, 37770, 41872, 43733, 44384, 46383, 47759
    And a way to associate mailto: handlers with a Zimbra Prism webapp

  5. #5
    Join Date
    Apr 2007
    Location
    Paris, France
    Posts
    367
    Rep Power
    8

    Default

    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.

  6. #6
    Join Date
    Aug 2007
    Location
    London, UK
    Posts
    297
    Rep Power
    8

    Default

    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
    My Zimbra Bugs Wishlist: 16411, 24567, 35676, 36430, 37770, 41872, 43733, 44384, 46383, 47759
    And a way to associate mailto: handlers with a Zimbra Prism webapp

Posting Permissions

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