The intent/meaning of EXPAND and its usefullness

[email protected]
Newsgroups gmane.ietf.calendar
Message-ID <OF6218EAC1.CF04CEFD-ON85256DF9.00659AA8-85256DF9.006CB2AC@notesdev.ibm.com>
Ok, I know Im going to be out of touch soon but I wanted to ask in the 
interest of getting some WG discussion to resolve my confusion.

A while back I asked a question about the usefulness of EXPAND at all 
(Subject "EXPAND property: All instances?" back on 31-Oct-2003).  There 
was no technical discussion of it so Ill try again given the recent other 
thread on DTSTART/RECURRENCE-ID/EXPAND.

In CAP-12-e is defined:

8.16 EXPAND property

   Property Name: EXPAND

   Purpose: This property is to notify the CS if it should or should not
   expand any component with recurrence rules into multiple instances in
   a query reply.

[Snip, snip]

   Description: If a CUA wishes to see all of the instances of a
   recurring component the CUA sets EXPAND=TRUE in the "VQUERY"
   component. If not specified, the default is FALSE. Note that if the
   CS has its "RECUR-EXPAND" CS property value set to false then the
   "EXPAND" property will be ignored and the result will be as if the
   "EXPAND" value was set to false.

and in Section 6.1.1.15 Query by Date-Time range is also written:

          This works only for CSs that have the "RECUR-EXPAND"
   property value set to "TRUE" in the "GET-CAPABILITY" exchange.

So, my take on this is:

1: If a CS does not support expanding recurrence rules then it would send 
RECUR-EXPAND:FALSE when asked.
2: If RECUR-EXPAND is FALSE then:
        A) EXPAND on a QUERY is ignored and
        B) a CUA will be unable to query for entries using a date-time 
range (even if its not repeating )

This raises some questions which Id like to get some WG concensus on (and 
perhaps clarification in CAP too).  These include:

1: If a CS does not support recurrence rules then why would that preclude 
the use of RDATEs?  The CS does not have to evaluate any rules to 
correctly roll out the repeating set.

2: Why does the lack of recurrence rule support in the CS preclude dong 
date-time range searches for non-repeating entries ("Give me all the 
VEVENTs for tomorrow") or for those specified in RDATEs?  Date-time range 
searching is something nearly all CS need to have in order to function 
well at all.  Otherwise its usability would be somewhat questionable.

3: What real use is the EXPAND property in actual practice?  This question 
has 2 parts behind it:

        3A: The 1st line of the Description says to set EXPAND:TRUE if the 
CUA wants all instances of a recurring component.  Why not just use a 
simple QUERY like:

           BEGIN:VQUERY
           QUERY:SELECT * FROM VEVENT
           WHERE UID = 'uid123'
             AND STATE() = 'BOOKED'
           END:VQUERY

        which should cause the CS to return all instances of UID:uid123 in 
that calendar?

        3B: If there were multiple instances of a recurring component that 
match a date-time range query , wont the CS return both matching instances 
without EXPAND?  For example, I have a semi-weekly W & F Project Leaders 
meeting that repeats all year.  As such if my CUA were to use a date-time 
range query like:

           BEGIN:VQUERY
           EXPAND:TRUE
           QUERY:SELECT * FROM VEVENT
           WHERE DTSTART >= '20031208T050000Z'
           AND DTEND <= '20031213T045959Z'
           AND STATE() = 'BOOKED'
           END:VQUERY

to get all my booked entries for this week (Im in EST which is -5 from GMT 
hence the odd looking times) then I would expect the CS to return to me 
something like:

   BEGIN:VCALENDAR
   PRODID:-//someProdID
   VERSION:2.0
   BEGIN:VEVENT
   ORGANIZER:[email protected]
   ATTENDEE;MEMBER="Dev Project Leads";PARTSTAT=ACCEPTED:[email protected]
   DTSTART:20031210T140000Z
   DTEND:20031210T143000Z
   SUMMARY:Semiweekly PL Meeting
   RECURRENCE-ID:20031210T163000Z
   SEQUENCE:4
   UID:12345
   END:VEVENT
   PRODID:-//someProdID
   VERSION:2.0
   BEGIN:VEVENT
   ORGANIZER:[email protected]
   ATTENDEE;MEMBER="Dev Project Leads";PARTSTAT=ACCEPTED:[email protected]
   DTSTART:20031212T150000Z
   DTEND:20031212T153000Z
   SUMMARY:Semiweekly PL Meeting
   RECURRENCE-ID:20031212T163000Z
   SEQUENCE:6
   UID:12345
   END:VEVENT
   END:VCALENDAR

where the CS returns the data for the 2 repeat instances that occur this 
week.  There should be no need for an EXPAND:TRUE since the CS should 
return all entries (repeating instances or not) that match the search 
criteria without the CUA saying "Give me ALL instances of any repeating 
instances.". 

So I have to question either the usefullness of EXPAND or the way it is 
described in relation to the acutal intent of it.   As I mull over making 
sure the questions are accurate and clear I think I figured out what the 
intent may have been but just not well phrased. 
Could it be that the intent was to tell the CS "If Im getting all 
repeating instances of a particular component, I prefer to get back 
explicit, unwound individual VEVENTs instead of the base defintion 
followed by any changed instances."?  That is, for my question 3A, there 
are 2 possible ways to return the data:

1: The base set defintion and then all changed instances like:

   BEGIN:VCALENDAR
   PRODID:-//someProdID
   VERSION:2.0
   BEGIN:VEVENT
   ORGANIZER:[email protected]
   ATTENDEE;MEMBER="Dev Project Leads
";PARTSTAT=NEEDS-ACTION:[email protected]
   DTSTART:20030106T160000Z
   DTEND:20030106T163000Z
   SUMMARY:Semiweekly PL Meeting
   RRULE:FREQ=WEEKLY;UNTIL=20031231T235959Z;BYDAY=WE,FR
   SEQUENCE:0
   UID:12345
   END:VEVENT
... [Assorted instances that differ from their 'base' content including:]
   BEGIN:VEVENT
   ORGANIZER:[email protected]
   ATTENDEE;MEMBER="Dev Project Leads";PARTSTAT=ACCEPTED:[email protected]
   DTSTART:20031210T140000Z
   DTEND:20031210T143000Z
   SUMMARY:Semiweekly PL Meeting
   RECURRENCE-ID:20031210T163000Z
   SEQUENCE:4
   UID:12345
   END:VEVENT
...
   END:VCALENDAR

so that the CUA can unwind the RRULE and replaces those changed instances 
w/the ones it finds afterwards OR

2: All the instances rolled out as individual VEVENTs. 

As I try to compare the usefullness of both ideas one thought comes to 
mind as being a problem with #2 above.  If the repeating entry repeats 
infinitely, EXPAND:TRUE will cause the CS to unwind the instances 
indefinitely.  This is not goodness and something we should address in CAP 
(an implementation issue, security issue, or the like).  In any case, is 
anyone able to answer the questions I have regarding EXPAND:TRUE (or 
confirm my epiphany)?

Bruce
PS: Note to CAP editor(s): The Description text should read "EXPAND:TRUE" 
(in dquotes) not "EXPAND=TRUE" (no dquotes) and the multiple "false" 
should be "FALSE". 
===========================================================================
Bruce Kahn                                INet: 
[email protected]
Messaging & Collaboration                 Phone: 978.399.6496
IBM Software Group                         FAX: and nothing but the FAX...
Standard disclaimers apply, even where prohibited by law...
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.