RFC 

 TOC 
Network Working Group D.M. Royer 
INTERNET DRAFT INET-Consulting 
<draft-royer-cap-sort-02>  4 October 2003 
Category: Informational  
Expires: 4 April 2004  


CAP (Calendar Access Protocol) sorting extension.
draft-royer-cap-sort-02

Status of this Memo

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 Notice

Copyright (C) The Internet Society (2003). All Rights Reserved.

Abstract

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.


 RFC 

 TOC 

Table of Contents


 TOC 

1Introduction

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.

Examples:


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


 TOC 

2MINIMUM-SORT value

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.

2.1Ordering of Numeric Results

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

2.2Ordering of Date/Date-Time Results

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.


 TOC 

3LOCALE-SORT value

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.


 TOC 

4LOCALE parameter

Parameter Name: LOCALE

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.


 TOC 

5SORT parameter

Parameter Name: SORT

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.


 TOC 

6CAP-SORT property

Property Name: CAP-SORT

Purpose: This property defines the calendar scale used for the calendar information specified in the iCalendar object.

Value Type: TEXT

Property Parameters: Non-standard property parameters can be specified on this property.

Conformance: Property can be specified in an iCalendar object.

Description:

Format Definition: The property is defined by the following notation:


cap-sort      = "CAP-SORT" capsortparam ":" capsortvalue CRLF

capsortparam  = *(";" xparam)

capsortvalue  = sorttype *("," sorttype)


 TOC 

7ORDERBY Extension

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


 TOC 

Author's Address

 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
 

 TOC 

A.  Bibliography


[CAP]     Royer, D., Babics, G., Hill, P. Mansour, S. "Calendar
          Access Protocol (CAP)", work in progress,
          draft-ietf-calsch-cap-12.txt.


 TOC 

Full Copyright Statement

Acknowledgement