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 03-26-2007, 09:39 AM
New Member
 
Posts: 3
Default Retreiving free/busy data for a given timeframe

I'm working on an application that uses Zimbra's freebusy.ifb service to retrieve a list of times that should be blocked out. However, by default this only returns events which occur today. I need to retrieve the free/busy data for a given number of days (roughly a week).

I spent a few minutes digging around the Zimbra source code and found that the time-range value may be passed in as a GET variable, but I am unsure of how to format the value. As far as I can tell, it wants a date range specified by two ISO8601 date/time strings but I don't know how to delimit them or what order to place them in the string.

So far, I've figured this much out:

Code:
http://zimbra.example.com/service/pubcal/freebusy.ifb?acct=foo@example.com&time-range=<date>
I need an example of proper formatting of the time-range dates. Thanks in advance.

--
Jeremy Grosser
Developer
poky.com
jeremy@poky.com
Reply With Quote
  #2 (permalink)  
Old 03-26-2007, 03:09 PM
Zimbra Employee
 
Posts: 515
Default

actually it looks like it wants unix time (note that it's *milliseconds* instead of seconds):

from PublicICalServlet.java:
Code:
        long now = new Date().getTime();
from java.util Class Date:

Quote:
getTime()
Returns the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this Date object.
and it looks like the parameters you want for the request are "s" and "e" (for start and end):

Code:
        String acctName = req.getParameter("acct");
        String startStr = req.getParameter("s");
        String endStr = req.getParameter("e");
__________________
Search the Forums - Bugzilla - Wiki - Downloads

Last edited by bobby; 03-26-2007 at 03:15 PM..
Reply With Quote
  #3 (permalink)  
Old 03-27-2007, 06:56 AM
New Member
 
Posts: 3
Default

's' and 'e' appear to be the correct variable names, but I don't think it's parsing the date correctly. I send the current unix timestamp returned by mktime() as 's' and add (86400 * days) to get the value of 'e'. However, when Zimbra's response comes back, the DTSTART and DTEND values are at the beginning of the epoch (January 1, 1970).

This leads me to believe that I'm still sending the date incorrectly. I tried sending it in ISO8601 format and all I get back are some rather nasty looking Java errors so I think we're on the right track trying to send a unix time integer.
Reply With Quote
  #4 (permalink)  
Old 03-27-2007, 06:58 AM
New Member
 
Posts: 3
Default

As soon as I pushed that last post, I found the problem. According to your previous post, Java expects the timestamp to be in milliseconds, not seconds. Thanks for the help. Everything appears to be working now.
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.