Network Working Group | D.M. Royer |
INTERNET DRAFT | INET-Consulting |
<draft-royer-cap-sort-02> | 4 October 2003 |
Category: Informational | |
Expires: 4 April 2004 |
This document is an Internet-Draft and is in full conformance with all provisions of Section 10 of RFC2026. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF), its areas, and its working groups. Note that other groups may also distribute working documents as Internet-Drafts. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress".
The list of current Internet-Drafts can be accessed at http://www.ietf.org/ietf/1id-abstracts.txt.
The list of Internet-Draft Shadow Directories can be accessed at http://www.ietf.org/shadow.html.
This Internet-Draft will expire on 4 April 2004.
Copyright (C) The Internet Society (2003). All Rights Reserved.
Small devices may not have sufficient memory to store and then sort query results from a CAP server. This memo suggests an expendable CAP CAPABILITY extension called "CAP-SORT" and a new parameters "SORT" and "LOCALE". This memo specifies an optional minimum sort order and and locale sort extension. These extensions will only effect CUA's that have specifically requested these extensions be used in the session or for specific queries.
The reader should be familiar with the CAP protocol prior to reading this memo.
This is an extension to the CAP "GET-CAPABILITY" command result set. A CS that supports this extension supplies the "CAP-SORT" property in its "GET-CAPABILITY" reply supplying the versions of sorting the CS supports.
If the CUA wishes to have the results sorted it must return to the CS a valid "CAP-SORT" property value.
(1) Supply the "CAP-SORT" property as one of the values returned by the CUA in its "GET-CAPABILITY" reply to the CS. The contents of the "CAP-SORT" sent by the CUA must be from the set supplied to it from the CS "GET-CAPABILITY" command reply "CAP-SORT" property value.
(2) Supply the "SORT" parameter to a "QUERY" property using one of the values returned in the "CAP-SORT" properly supplied by the CS.
This memo defines two sort capabilities called "MINIMUM-SORT" and "LOCALE-SORT". The "MINIMUM-SORT" and "LOCALE-SORT" values can be used in the "CAP-SORT" property and in the "SORT" parameter as values.
CAP-SORT:MINIMUM-SORT,LOCALE-SORT QUERY;SORT="LOCALE-SORT":SELECT SUMMARY FROM VEVENT QUERY;SORT="LOCALE-SORT";LOCALE="fr_FR":SELECT SUMMARY FROM VEVENT QUERY;SORT="LOCALE-SORT":SELECT DESCRIPTION,SUMMARY FROM VEVENT
If the CS supplies "MINIMUM-SORT" as one of its values it returns in a "CAP-SORT" property value and the CUA sends "MINIMUM-SORT" as one of its values in a "CAP-SORT" property value or in a "SORT" parameter value then it is defined to cause the CS to perform sorting as defined in this section.
If supplied as described above to a "QUERY" property, then the query results will be sorted as defined the three sections that follow.
Sorting will take place in the order the columns are supplied in the QUERY command. The CS MUST sort at least the first column. The CS MAY sort additional columns.
Float and integer values MUST BE sorted by their numeric value. This means the result of a sort on an integer value type will be:
1, 2, 100, 1000 and not 1, 100, 1000, 2 This means the result of a sort on an float value type will be: 1.1, 2.23, 100.332, 1000.12 and not 1.1, 100.332, 1000.12, 2.23
Date and date time values will be sorted by their equivalent value in UTC. No matter what the returned time zone in the result set returns. This is so that if multiple components are returned each in a unique time zone, the results will be sorted in UTC. This does not mean the values MUST BE converted to UTC in the data returned to the CUA. It means the CS must do the sort in UTC.
If the cap-cols is only "*" and nothing else and the result set has a DTSTART, then:
If EXPAND=FALSE sorting will be by the "DTSTART" property value ascending as if it were in UTC.
If EXPAND=TRUE sorting will be by the "RECURRENCE-ID" property value ascending as if it were in UTC.
If one or more "DTSTART" or "RECURRENCE-ID" property values in multiple components have exactly the same value, the order for those matching components is unspecified.
If the selected component(s) do not contain a "DTSTART" property or a "RECURRENCE-ID" property, then the order is unspecified.
If an instance does not have a "RECURRENCE-ID" property and the query compares "RECURRENCE-ID" properties (comparing a RECURRENCE-ID to the date or date/time of a single instance object), then the CS MUST compare the "DTSTART" property value as if it were a "RECURRENCE-ID" even for single instance objects that do not contain a "RECURRENCE- ID" property.
A component with a DATE and no TIME value is returned before objects with both a DATE and TIME value when the dates of those two (or more) objects are the same, sorted by date.
If the CS supplies "LOCALE-SORT" as one of its values it returned in a "CAP-SORT" property value and the CUA sends "LOCALE-SORT" as one of its values in a "CAP-SORT" property value or in a "SORT" parameter value then it is defined to cause the CS to perform sorting as defined in this section.
Values are sorted according to the locale sorting order as specified in the command. Or the value set by the latest "SET-LOCALE" CAP command, Or the value of the "DEFAULT-LOCALE" property if supplied by the CUA in its "GET-CAPABILITY" reply to the CS. Or the calendar locale if known and in that order. Or the CS locale if the calendar does not have any locale set. And the locale to use for the sort is determined in that order.
If supplied as described above to a "QUERY" property, then the locale to be used in sorting.
Purpose: To specify the locale to be used.
Format Definition: The property parameter is defined by the following notation:
; paramtext is defined in RFC2445 ; localeparam = "LOCALE" "=" paramtext
Description: Defined the locale to be used.
If the "LOCALE" parameter value supplied in the "QUERY" property must be from the set supplied by the CS in the "DEFAULT-LOCALE" property sent to the CUA by the CS in its "GET-CAPABILITY" command reply.
Purpose: To specify the type of SORT to be used.
Format Definition: The property parameter is defined by the following notation:
; paramtext is defined in RFC2445 ; sortparam = "SORT" "=" sorttype ; One or more of these values may be supplied but ; not more than once. sorttype = "MINIMUM-SORT" / "LOCALE-SORT" / x-sort / iana-sort x-sort = ; A param-value as defined in RFC 2445 ; that starts with "x-" or "X-". iana-sort = ; Any sort method defined by IANA.
Description: Define the sort method to be used. The value supplied MUST BE from the set supplied by the CS in the "CAP-SORT" property value in the CSs "GET-CAPABILITY" reply.
If supplied as described above, then the sort method to be used in sorting is the value of the "SORT" parameter.
Purpose: This property defines the calendar scale used for the calendar information specified in the iCalendar object.
Property Parameters: Non-standard property parameters can be specified on this property.
Conformance: Property can be specified in an iCalendar object.
Format Definition: The property is defined by the following notation:
cap-sort = "CAP-SORT" capsortparam ":" capsortvalue CRLF capsortparam = *(";" xparam) capsortvalue = sorttype *("," sorttype)
This extends the 'cal-query' ABNF defiend in [CAP] to include the specifying the sort order of the results:
cal-query = "SELECT" SP cap-val SP "FROM" SP comp-name SP "WHERE" SP cap-expr *orderby / "SELECT" SP cap-cols SP "FROM" SP comp-name *orderby orderby = "ORDER-BY" order-val order-val = cap-cols / param / ( order-val "," order-val)
Each element of the 'order-val' used must have an exact match to an entry in the 'cap-val' element. That is you can only order by elements that have been selected. Example:
QUERY;SORT="LOCALE-SORT":SELECT DESCRIPTION,SUMMARY FROM VEVENT ORDER-BY SUMMARY QUERY;SORT="LOCALE-SORT":SELECT VEVENT FROM VAGENDA ORDER-BY SUMMARY
Doug Royer | |
http://INET-Consulting.com | |
1795 W. Broadway #266 | |
Idaho Falls, Idaho 83402 | |
US | |
Phone: | 208-520-4044 |
Fax: | 866-594-8574 |
EMail: | Doug@Royer.com |
URI: | http://Royer.com/People/Doug |
[CAP] Royer, D., Babics, G., Hill, P. Mansour, S. "Calendar Access Protocol (CAP)", work in progress, draft-ietf-calsch-cap-12.txt.
Copyright (C) The Internet Society (2003). All Rights Reserved.
This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself may not be modified in any way, such as by removing the copyright notice or references to the Internet Society or other Internet organizations, except as needed for the purpose of developing Internet standards in which case the procedures for copyrights defined in the Internet Standards process must be followed, or as required to translate it into languages other than English.
The limited permissions granted above are perpetual and will not be revoked by the Internet Society or its successors or assigns.
This document and the information contained herein is provided on an "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
Funding for the RFC editor function is currently provided by the Internet Society.