Freebusy

82 views
Skip to first unread message

chip

unread,
Aug 25, 2011, 6:06:25 PM8/25/11
to RiCal
I am attempting to add a freebusy property to a calendar. I've done my
best to try to understand the implementation by looking at the
documentation and spec files, but I'm having difficulty nonetheless.
What am I doing wrong?

dtstart =
DateTime.parse("2010-10-10T00:00:00.000Z").to_ri_cal_property_value
dtend =
DateTime.parse("2010-10-20T00:00:00.000Z").to_ri_cal_property_value
period = RiCal::PropertyValue::Period.new(nil, :value =>
"#{dtstart.value}/#{dtend.value}")

cal = RiCal.Calendar do |cal|
cal.freebusy do |freebusy|
freebusy.add_freebusy period
end
end

Here is my trace: https://gist.github.com/a123f660281bb2323cde

I've confirmed my period is not null
ruby-1.9.2-p290 :030 > period.duration
=> :+P10D

I can only assume I'm calling add_freebusy on the wrong object in some
way.

Thanks!

chip

unread,
Sep 9, 2011, 6:20:03 PM9/9/11
to RiCal
Ah, I should have used ".freebusy_property".

Karmen Blake

unread,
Oct 20, 2011, 7:28:27 PM10/20/11
to rica...@googlegroups.com
I'm going to piggy back on this thread. Hope that is ok. :)

I assume, the freebusy capability is the route to take when you want to set the 'show as' to either free or busy.
I've been trying to set that value on an event. That bombs.
I go to set it on the cal object, although it does not crash, I don't think I'm setting it correctly because
the events are still set to busy when the file is generated.

Any suggestions?

Example code,

    RiCal.Calendar do
      freebusy do
        freebusy = 'free'
      end
      reqs = get_requests
      reqs.each do |req|
        event do
          dtstart     req.start_at.to_date
          dtend       req.end_at.advance(days: 1).to_date
        end
      end
    end

Rick DeNatale

unread,
Oct 21, 2011, 2:59:15 PM10/21/11
to rica...@googlegroups.com
Freebusy has nothing directly to do with Events.


They are used for meeting scheduling, the use case is an organizer trying to find an event time which works for multiple attendees, this is accomplished using 'calendars' containing VFREEBUSY components (other calendar components are VEVENTs, VTODOs, VJOURNALs,  VTIMEZONEs  and VALARMS.

VFREEBUSY components are used in three ways:

1) Ask individuals for times that they will be free or busy during a particular period.
2) For those individuals (or more likely their calendar applications) to reply to those requests and
3) To publish when an individual is free or busy.  

VFREEBUSYs of type 1 and 2 are transported using mechanisms defined by other RFCs such as http://tools.ietf.org/html/rfc2446, or CALDAV http://en.wikipedia.org/wiki/CalDAV, which are outside of the scope of RiCal

Various calendar applications allow the production of a free busy calendar (usage type #3 above), or produce automatic replies of type 2 to requests of type 1 of this type based on the contents of one or more other calendars.  Some of these applications allow you to mark whether an event on your calendar is considered free/busy time, and whether or not the details are visible to others using various criterial  I suspect that this is what you mean "to set the 'show as' to either free or busy". The Icalendar format specified by RFC2445 (and now RFC 5545) do not have the concept of marking events as free or busy.

If you are writing a calendar application, you'd need to keep those choices as side data.



--
You received this message because you are subscribed to the Google Groups "RiCal" group.
To view this discussion on the web visit https://groups.google.com/d/msg/rical_gem/-/OJaM-ZI5em8J.

To post to this group, send email to rica...@googlegroups.com.
To unsubscribe from this group, send email to rical_gem+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rical_gem?hl=en.



--
Rick DeNatale

Blog: http://talklikeaduck.denhaven2.com/
Github: http://github.com/rubyredrick
Twitter: @RickDeNatale
WWR: http://www.workingwithrails.com/person/9021-rick-denatale
LinkedIn: http://www.linkedin.com/in/rickdenatale

Karmen Blake

unread,
Oct 27, 2011, 4:31:48 PM10/27/11
to rica...@googlegroups.com
I appreciate the response. Thanks for the details.
The scenario is that I am generating a *.ics file for a user to download events into their iCal app.
The events are set to all day (by me) and 'busy' (somehow, or just the default). Thus it blocks calendar from other events, unfortunately. 
Too bad the 'busy' value could not be set to 'free'. 

Maybe an alternative is to have the user download events into a new calendar so that it does not conflict with another calendar.

Thanks again.


Karmen Blake

unread,
Oct 27, 2011, 4:43:34 PM10/27/11
to rica...@googlegroups.com
Found the solution:

for an event, I set the transp property to either OPAQUE for busy or TRANSPARENT for free.
whew...

:)
Reply all
Reply to author
Forward
0 new messages