Eric Pugh
2007-Mar-30 14:57 UTC
[iCalendar-devel] Handling start and duration but no end for Events
Hi all, I''ve got an event that looks like: BEGIN:VEVENT DTSTART;TZID=US/Eastern:20070402T140000 SUMMARY:Call Robert UID:A11B2175-8082-4839-B253-74D1A6CACBA9 SEQUENCE:4 DTSTAMP:20070329T150439Z DESCRIPTION:Call to find out about bringing in Window guys...... \n\n4 34-962-7950 DURATION:PT1H BEGIN:VALARM ACTION:AUDIO TRIGGER:-PT15M X-WR-ALARMUID:76466515-A5C5-41C1-AECF-BF8C8BF972E0 X-ICF-AUTOALARM:TRUE ATTACH;VALUE=URI:Basso END:VALARM END:VEVENT It has a start time, but no end time. However, it does have a duration of PT1H. My app is failing cause I have no end time. Should the iCalendar parser handle the fact that the end time isn''t definined, and supply it based on the start time + duration? Or is this the responsibility of the user of the parser??? I''m asking more from an understanding point of view? Seeing if I should patch icalendar parser or deal with it in my code. Eric ------------------------------------------------------- Principal OpenSource Connections Site: http://www.opensourceconnections.com Blog: http://blog.opensourceconnections.com Cell: 1-434-466-1467
Rob Kaufman
2007-Apr-02 17:39 UTC
[iCalendar-devel] Handling start and duration but no end for Events
According to the icalendar spec, you must specify EITHER duration or end, so it would make a lot of since for setting duration to implicitly set end in the parser and vis-versa. You are correct that the parser does not currently handle the case where there is no end. Rob Kaufman On 3/30/07, Eric Pugh <epugh at opensourceconnections.com> wrote:> Hi all, > > I''ve got an event that looks like: > > BEGIN:VEVENT > DTSTART;TZID=US/Eastern:20070402T140000 > SUMMARY:Call Robert > UID:A11B2175-8082-4839-B253-74D1A6CACBA9 > SEQUENCE:4 > DTSTAMP:20070329T150439Z > DESCRIPTION:Call to find out about bringing in Window guys...... \n\n4 > 34-962-7950 > DURATION:PT1H > BEGIN:VALARM > ACTION:AUDIO > TRIGGER:-PT15M > X-WR-ALARMUID:76466515-A5C5-41C1-AECF-BF8C8BF972E0 > X-ICF-AUTOALARM:TRUE > ATTACH;VALUE=URI:Basso > END:VALARM > END:VEVENT > > It has a start time, but no end time. However, it does have a > duration of PT1H. My app is failing cause I have no end time. > Should the iCalendar parser handle the fact that the end time isn''t > definined, and supply it based on the start time + duration? Or is > this the responsibility of the user of the parser??? > > I''m asking more from an understanding point of view? Seeing if I > should patch icalendar parser or deal with it in my code. > > Eric > > > ------------------------------------------------------- > Principal > OpenSource Connections > Site: http://www.opensourceconnections.com > Blog: http://blog.opensourceconnections.com > Cell: 1-434-466-1467 > > > > > _______________________________________________ > icalendar-devel mailing list > icalendar-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/icalendar-devel >
Eric Pugh
2007-Apr-02 18:53 UTC
[iCalendar-devel] Handling start and duration but no end for Events
I''ve been going over this in my mind... If you assume that the iCalendar tool is purely a "parser" then maybe it works the way you would expect, returning nil for the end, instead of figuring it out. Because that is what the "parsed" data says. However, if you think there should be some handholding from the parser, or that you have two layers, the low level data and higher level user objects, then the higher level user objects should handle this then! I think I may just add a layer to my app that adds those sorts of higher level "convenience" methods. argh... Eric Pugh On Apr 2, 2007, at 1:39 PM, Rob Kaufman wrote:> According to the icalendar spec, you must specify EITHER duration or > end, so it would make a lot of since for setting duration to > implicitly set end in the parser and vis-versa. You are correct that > the parser does not currently handle the case where there is no end. > > Rob Kaufman > > On 3/30/07, Eric Pugh <epugh at opensourceconnections.com> wrote: >> Hi all, >> >> I''ve got an event that looks like: >> >> BEGIN:VEVENT >> DTSTART;TZID=US/Eastern:20070402T140000 >> SUMMARY:Call Robert >> UID:A11B2175-8082-4839-B253-74D1A6CACBA9 >> SEQUENCE:4 >> DTSTAMP:20070329T150439Z >> DESCRIPTION:Call to find out about bringing in Window guys...... >> \n\n4 >> 34-962-7950 >> DURATION:PT1H >> BEGIN:VALARM >> ACTION:AUDIO >> TRIGGER:-PT15M >> X-WR-ALARMUID:76466515-A5C5-41C1-AECF-BF8C8BF972E0 >> X-ICF-AUTOALARM:TRUE >> ATTACH;VALUE=URI:Basso >> END:VALARM >> END:VEVENT >> >> It has a start time, but no end time. However, it does have a >> duration of PT1H. My app is failing cause I have no end time. >> Should the iCalendar parser handle the fact that the end time isn''t >> definined, and supply it based on the start time + duration? Or is >> this the responsibility of the user of the parser??? >> >> I''m asking more from an understanding point of view? Seeing if I >> should patch icalendar parser or deal with it in my code. >> >> Eric >> >> >> ------------------------------------------------------- >> Principal >> OpenSource Connections >> Site: http://www.opensourceconnections.com >> Blog: http://blog.opensourceconnections.com >> Cell: 1-434-466-1467 >> >> >> >> >> _______________________________________________ >> icalendar-devel mailing list >> icalendar-devel at rubyforge.org >> http://rubyforge.org/mailman/listinfo/icalendar-devel >> > _______________________________________________ > icalendar-devel mailing list > icalendar-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/icalendar-devel------------------------------------------------------- Principal OpenSource Connections Site: http://www.opensourceconnections.com Blog: http://blog.opensourceconnections.com Cell: 1-434-466-1467
Larry Karnowski
2007-Apr-02 19:10 UTC
[iCalendar-devel] Handling start and duration but no end for Events
Eric, Could you incorporate both into the parser with a "lenient" flag? I can see both uses, but I would think the "happy path" of leniency would suit most users better. Larry On 4/2/07, Eric Pugh <epugh at opensourceconnections.com> wrote:> I''ve been going over this in my mind... If you assume that the > iCalendar tool is purely a "parser" then maybe it works the way you > would expect, returning nil for the end, instead of figuring it out. > Because that is what the "parsed" data says. However, if you think > there should be some handholding from the parser, or that you have > two layers, the low level data and higher level user objects, then > the higher level user objects should handle this then! > > I think I may just add a layer to my app that adds those sorts of > higher level "convenience" methods. argh... > > Eric Pugh > > > > > On Apr 2, 2007, at 1:39 PM, Rob Kaufman wrote: > > > According to the icalendar spec, you must specify EITHER duration or > > end, so it would make a lot of since for setting duration to > > implicitly set end in the parser and vis-versa. You are correct that > > the parser does not currently handle the case where there is no end. > > > > Rob Kaufman > > > > On 3/30/07, Eric Pugh <epugh at opensourceconnections.com> wrote: > >> Hi all, > >> > >> I''ve got an event that looks like: > >> > >> BEGIN:VEVENT > >> DTSTART;TZID=US/Eastern:20070402T140000 > >> SUMMARY:Call Robert > >> UID:A11B2175-8082-4839-B253-74D1A6CACBA9 > >> SEQUENCE:4 > >> DTSTAMP:20070329T150439Z > >> DESCRIPTION:Call to find out about bringing in Window guys...... > >> \n\n4 > >> 34-962-7950 > >> DURATION:PT1H > >> BEGIN:VALARM > >> ACTION:AUDIO > >> TRIGGER:-PT15M > >> X-WR-ALARMUID:76466515-A5C5-41C1-AECF-BF8C8BF972E0 > >> X-ICF-AUTOALARM:TRUE > >> ATTACH;VALUE=URI:Basso > >> END:VALARM > >> END:VEVENT > >> > >> It has a start time, but no end time. However, it does have a > >> duration of PT1H. My app is failing cause I have no end time. > >> Should the iCalendar parser handle the fact that the end time isn''t > >> definined, and supply it based on the start time + duration? Or is > >> this the responsibility of the user of the parser??? > >> > >> I''m asking more from an understanding point of view? Seeing if I > >> should patch icalendar parser or deal with it in my code. > >> > >> Eric > >> > >> > >> ------------------------------------------------------- > >> Principal > >> OpenSource Connections > >> Site: http://www.opensourceconnections.com > >> Blog: http://blog.opensourceconnections.com > >> Cell: 1-434-466-1467 > >> > >> > >> > >> > >> _______________________________________________ > >> icalendar-devel mailing list > >> icalendar-devel at rubyforge.org > >> http://rubyforge.org/mailman/listinfo/icalendar-devel > >> > > _______________________________________________ > > icalendar-devel mailing list > > icalendar-devel at rubyforge.org > > http://rubyforge.org/mailman/listinfo/icalendar-devel > > ------------------------------------------------------- > Principal > OpenSource Connections > Site: http://www.opensourceconnections.com > Blog: http://blog.opensourceconnections.com > Cell: 1-434-466-1467 > > > > > _______________________________________________ > icalendar-devel mailing list > icalendar-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/icalendar-devel >
Eric Pugh
2007-Apr-03 19:17 UTC
[iCalendar-devel] Handling start and duration but no end for Events
I don''t have commit privileges on the underlying icalendar project, so right now I am trying to not change anything there, I''ll probably be playing around with layering on other stuff... If you are interested, monitor novo.rubyforge.org, and look at "sync_gcal.rb" script.. It''s all a bit icky, unorganized, but I''m learning a lot out of this project. I do like the "lenient" idea! I discoved in "parser.rb" that the developer didn''t know how to parse duration which is in an odd standard formation. However, turns out the the Vpim::Calendar project can handle it! gem install vpim and run this unit test: # Test that Vpim library will do the duration conversion we need! def test_vpim_library result = Vpim::Icalendar.decode_duration(''PT1H'') assert_equal 3600, result result = Vpim::Icalendar.decode_duration(''PT2H10M'') assert_equal 7800, result end I''ll try and use this, and then layer in populating the end method.... ERic On Apr 2, 2007, at 3:10 PM, Larry Karnowski wrote:> Eric, > Could you incorporate both into the parser with a "lenient" flag? I > can see both uses, but I would think the "happy path" of leniency > would suit most users better. > > Larry > > On 4/2/07, Eric Pugh <epugh at opensourceconnections.com> wrote: >> I''ve been going over this in my mind... If you assume that the >> iCalendar tool is purely a "parser" then maybe it works the way you >> would expect, returning nil for the end, instead of figuring it out. >> Because that is what the "parsed" data says. However, if you think >> there should be some handholding from the parser, or that you have >> two layers, the low level data and higher level user objects, then >> the higher level user objects should handle this then! >> >> I think I may just add a layer to my app that adds those sorts of >> higher level "convenience" methods. argh... >> >> Eric Pugh >> >> >> >> >> On Apr 2, 2007, at 1:39 PM, Rob Kaufman wrote: >> >>> According to the icalendar spec, you must specify EITHER duration or >>> end, so it would make a lot of since for setting duration to >>> implicitly set end in the parser and vis-versa. You are correct >>> that >>> the parser does not currently handle the case where there is no end. >>> >>> Rob Kaufman >>> >>> On 3/30/07, Eric Pugh <epugh at opensourceconnections.com> wrote: >>>> Hi all, >>>> >>>> I''ve got an event that looks like: >>>> >>>> BEGIN:VEVENT >>>> DTSTART;TZID=US/Eastern:20070402T140000 >>>> SUMMARY:Call Robert >>>> UID:A11B2175-8082-4839-B253-74D1A6CACBA9 >>>> SEQUENCE:4 >>>> DTSTAMP:20070329T150439Z >>>> DESCRIPTION:Call to find out about bringing in Window guys...... >>>> \n\n4 >>>> 34-962-7950 >>>> DURATION:PT1H >>>> BEGIN:VALARM >>>> ACTION:AUDIO >>>> TRIGGER:-PT15M >>>> X-WR-ALARMUID:76466515-A5C5-41C1-AECF-BF8C8BF972E0 >>>> X-ICF-AUTOALARM:TRUE >>>> ATTACH;VALUE=URI:Basso >>>> END:VALARM >>>> END:VEVENT >>>> >>>> It has a start time, but no end time. However, it does have a >>>> duration of PT1H. My app is failing cause I have no end time. >>>> Should the iCalendar parser handle the fact that the end time isn''t >>>> definined, and supply it based on the start time + duration? Or is >>>> this the responsibility of the user of the parser??? >>>> >>>> I''m asking more from an understanding point of view? Seeing if I >>>> should patch icalendar parser or deal with it in my code. >>>> >>>> Eric >>>> >>>> >>>> ------------------------------------------------------- >>>> Principal >>>> OpenSource Connections >>>> Site: http://www.opensourceconnections.com >>>> Blog: http://blog.opensourceconnections.com >>>> Cell: 1-434-466-1467 >>>> >>>> >>>> >>>> >>>> _______________________________________________ >>>> icalendar-devel mailing list >>>> icalendar-devel at rubyforge.org >>>> http://rubyforge.org/mailman/listinfo/icalendar-devel >>>> >>> _______________________________________________ >>> icalendar-devel mailing list >>> icalendar-devel at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/icalendar-devel >> >> ------------------------------------------------------- >> Principal >> OpenSource Connections >> Site: http://www.opensourceconnections.com >> Blog: http://blog.opensourceconnections.com >> Cell: 1-434-466-1467 >> >> >> >> >> _______________________________________________ >> icalendar-devel mailing list >> icalendar-devel at rubyforge.org >> http://rubyforge.org/mailman/listinfo/icalendar-devel >> > _______________________________________________ > icalendar-devel mailing list > icalendar-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/icalendar-devel------------------------------------------------------- Principal OpenSource Connections Site: http://www.opensourceconnections.com Blog: http://blog.opensourceconnections.com Cell: 1-434-466-1467
Jeff Rose
2007-Apr-03 23:22 UTC
[iCalendar-devel] Handling start and duration but no end for Events
Eric Pugh wrote:> I don''t have commit privileges on the underlying icalendar project, > so right now I am trying to not change anything there, I''ll probably > be playing around with layering on other stuff...Please feel free to propose changes to the library and/or submit patches to the list. I''m using git for the repository, so I can give out the URL so people can grab the latest source and patch locally if you are interested in doing that.> I discoved in "parser.rb" that the developer didn''t know how to parse > duration which is in an odd standard formation.What do you mean odd formation? If you can post an example of a calendar that breaks the parser I''d like to fix any problems.>> On 4/2/07, Eric Pugh <epugh at opensourceconnections.com> wrote: >>> I''ve been going over this in my mind... If you assume that the >>> iCalendar tool is purely a "parser" then maybe it works the way you >>> would expect, returning nil for the end, instead of figuring it out. >>> Because that is what the "parsed" data says. However, if you think >>> there should be some handholding from the parser, or that you have >>> two layers, the low level data and higher level user objects, then >>> the higher level user objects should handle this then!You are very correct, but my hope is that we can add helpful bits and pieces like this over time to make it easier to use. It ends up being mostly policy decisions about how things should work, but we should be able to come to consensus on what is reasonable for most of these cases.>>>>> It has a start time, but no end time. However, it does have a >>>>> duration of PT1H. My app is failing cause I have no end time. >>>>> Should the iCalendar parser handle the fact that the end time isn''t >>>>> definined, and supply it based on the start time + duration? Or is >>>>> this the responsibility of the user of the parser???In this type of situation, what do you guys think about having the library compute whichever property is missing (dtend or duration), and then when writing out just always write the end time? If it seemed necessary maybe there could be an option for writing duration instead... -Jeff