RFC7265 Jcal
RFC7265 Jcal
RFC7265 Jcal
Kewisch
Request for Comments: 7265 Mozilla
Category: Standards Track C. Daboo
ISSN: 2070-1721 Apple, Inc.
M. Douglass
RPI
May 2014
Abstract
Copyright Notice
Copyright (c) 2014 IETF Trust and the persons identified as the
document authors. All rights reserved.
Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3
2. Conventions Used in This Document . . . . . . . . . . . . . . 4
3. Converting from iCalendar to jCal . . . . . . . . . . . . . . 4
3.1. Pre-processing . . . . . . . . . . . . . . . . . . . . . 4
3.2. iCalendar Stream and Objects (RFC 5545, Section 3.4) . . 5
3.3. Components (RFC 5545, Section 3.6) . . . . . . . . . . . 6
3.4. Properties (RFC 5545, Sections 3.7 and 3.8) . . . . . . . 6
3.4.1. Special Cases for Properties . . . . . . . . . . . . 8
3.4.1.1. GEO Property (RFC 5545, Section 3.8.1.6) . . . . 8
3.4.1.2. REQUEST-STATUS Property (RFC 5545, Section
3.8.8.3) . . . . . . . . . . . . . . . . . . . . 8
3.5. Parameters (RFC 5545, Section 3.2) . . . . . . . . . . . 9
3.5.1. VALUE Parameter . . . . . . . . . . . . . . . . . . . 10
3.5.2. Multi-value Parameters . . . . . . . . . . . . . . . 11
3.6. Values (RFC 5545, Section 3.3) . . . . . . . . . . . . . 11
3.6.1. Binary (RFC 5545, Section 3.3.1) . . . . . . . . . . 12
3.6.2. Boolean (RFC 5545, Section 3.3.2) . . . . . . . . . 12
3.6.3. Calendar User Address (RFC 5545, Section 3.3.3) . . . 12
3.6.4. Date (RFC 5545, Section 3.3.4) . . . . . . . . . . . 12
3.6.5. Date-Time (RFC 5545, Section 3.3.5) . . . . . . . . . 13
3.6.6. Duration (RFC 5545, Section 3.3.6) . . . . . . . . . 13
3.6.7. Float (RFC 5545, Section 3.3.7) . . . . . . . . . . . 14
3.6.8. Integer (RFC 5545, Section 3.3.8) . . . . . . . . . . 14
3.6.9. Period of Time (RFC 5545, Section 3.3.9) . . . . . . 14
3.6.10. Recurrence Rule (RFC 5545, Section 3.3.10) . . . . . 15
3.6.11. Text (RFC 5545, Section 3.3.11) . . . . . . . . . . . 16
3.6.12. Time (RFC 5545, Section 3.3.12) . . . . . . . . . . . 16
3.6.13. URI (RFC 5545, Section 3.3.13) . . . . . . . . . . . 17
3.6.14. UTC Offset (RFC 5545, Section 3.3.14) . . . . . . . . 17
3.7. Extensions . . . . . . . . . . . . . . . . . . . . . . . 17
4. Converting from jCal into iCalendar . . . . . . . . . . . . . 17
5. Handling Unrecognized Properties or Parameters . . . . . . . 18
5.1. Converting iCalendar into jCal . . . . . . . . . . . . . 18
5.2. Converting jCal into iCalendar . . . . . . . . . . . . . 19
5.3. Examples . . . . . . . . . . . . . . . . . . . . . . . . 19
6. Security Considerations . . . . . . . . . . . . . . . . . . . 20
7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 21
7.1. UNKNOWN iCalendar Value Data Type . . . . . . . . . . . . 22
8. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 23
9. References . . . . . . . . . . . . . . . . . . . . . . . . . 23
9.1. Normative References . . . . . . . . . . . . . . . . . . 23
9.2. Informative References . . . . . . . . . . . . . . . . . 24
1. Introduction
The key design considerations are essentially the same as those for
[RFC6321], that is:
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in [RFC2119]. The
underlying format used for jCal is JSON. Consequently, the terms
"object" and "array" as well as the four primitive types (strings,
numbers, booleans, and null) are to be interpreted as described in
Section 1 of [RFC7159].
3.1. Pre-processing
Example:
["vcalendar",
[ /* Add jCal properties in place of this comment */ ],
[ /* Add jCal components in place of this comment */ ]
]
Example:
["vevent",
[ /* Add jCal properties in place of this comment */ ],
[ /* Add jCal components in place of this comment */ ]
]
The remaining elements of the array are used for one or more values
of the property. For single-valued properties, the array has exactly
four elements; for multi-valued properties, as described in
Section 3.1.2 of [RFC5545], each value is another element, and there
can be any number of additional elements.
Example:
["vevent",
[
["summary", {}, "text", "Meeting with Fred"],
["categories", {}, "text", "Meetings", "Work"]
...
],
[ /* sub-components */ ]
]
Example
["vevent",
[
["geo", {}, "float", [ 37.386013, -122.082932 ] ]
...
],
...
]
When converting from jCal to iCalendar, the two or three values MUST
be converted using a semicolon as the separator character.
iCalendar Example:
BEGIN:VEVENT
...
REQUEST-STATUS:2.0;Success
REQUEST-STATUS:3.7;Invalid calendar user;ATTENDEE:
mailto:jsmith@example.com
...
END:VEVENT
jCal Example:
["vevent":
[
["request-status", {}, "text", ["2.0", "Success"] ],
["request-status", {}, "text",
[
"3.7",
"Invalid calendar user",
"ATTENDEE:mailto:jsmith@example.org"
]
],
...
],
...
]
Example:
["vevent":
[
["attendee",
{
"partstat": "ACCEPTED",
"rsvp": "TRUE",
"role": "REQ-PARTICIPANT"
},
"cal-address",
"mailto:jsmith@example.org"
],
["summary", {}, "text", "Meeting"],
...
],
...
]
Example 1:
["attendee",
{
"delegated-to": ["mailto:jdoe@example.org",
"mailto:jqpublic@example.org"]
},
"cal-address",
"mailto:jsmith@example.org"
]
Example 2:
["attendee",
{
"delegated-to": "mailto:jdoe@example.org"
},
"cal-address",
"mailto:jsmith@example.org"
]
Example:
Example:
Example:
ABNF Schema:
Example:
ABNF Schema:
Examples:
Example:
Example:
Examples:
Example:
["freebusy",
{ "fbtype": "FREE" },
"period",
["1997-03-08T16:00:00Z", "P1D"]
]
* The value of the "freq" and "wkst" rule parts MUST be a string
as specified in [RFC5545], with case preserved.
* The following rule parts can have one or more numeric values:
"bysecond", "byminute", "byhour", "bymonthday", "byyearday",
"byweekno", "bymonth", and "bysetpos". If a rule part contains
multiple values, an array of numbers MUST be used for that rule
part. Single-valued rule parts can be represented by either
using a single number value, omitting the array completely, or
using an array with one number element. A jCal parser MUST be
able to understand both data types.
* Similarly, the "byday" rule part can have one or more string
values. If it contains multiple values, an array of strings
MUST be used. As before, a single-valued rule part can be
represented using either a single string value or an array with
one string element, both of which a jCal parser MUST be able to
understand.
Example 1:
["rrule",
{},
"recur",
{
"freq": "YEARLY",
"count": 5,
"byday": [ "-1SU", "2MO" ],
"bymonth": 10
}
]
Example 2:
["rrule",
{},
"recur",
{
"freq": "MONTHLY",
"interval": 2,
"bymonthday": [ 1, 15, -1 ],
"until": "2013-10-01"
}
]
Example:
ABNF Schema:
Example:
Example:
Example:
3.7. Extensions
Any property that does not include a "VALUE" property parameter and
whose default value type is not known, MUST be converted to a
primitive JSON string. The content of that string is the unprocessed
value text. Also, value type MUST be set to "unknown".
o If the value type specified in jCal matches the default value type
in iCalendar, the VALUE parameter MAY be omitted.
5.3. Examples
iCalendar:
X-COMPLAINT-DEADLINE:20110512T120000Z
jCal:
The following is an example of how to cope with jCal data where the
parser was unable to identify the type. Note how the "unknown" value
type is not added to the iCalendar data and escaping, aside from
standard JSON string escaping, is not processed.
jCal:
iCalendar:
X-COFFEE-DATA:Stenophylla;Guinea\,Africa
jCal:
iCalendar:
PERCENT-COMPLETE:95
iCalendar:
DTSTART;X-SLACK=30.3;VALUE=DATE:20110512
jCal:
6. Security Considerations
The use of JSON as a format does have its own inherent security risks
as discussed in Section 12 of [RFC7159]. Even though JSON is
considered a safe subset of JavaScript, it should be kept in mind
that a flaw in the parser processing JSON could still impose a
threat, which doesn’t arise with conventional iCalendar data.
With this in mind, a parser for JSON data should be used for jCal
that is aware of the security implications. For example, the use of
JavaScript’s eval() function is considered an unacceptable security
risk, as described in Section 12 of [RFC7159]. A native parser with
full awareness of the JSON format should be preferred.
7. IANA Considerations
This document defines a MIME media type for use with iCalendar in
JSON data. This media type SHOULD be used for the transfer of
calendaring data in JSON.
Additional information:
IANA has added the following entry to the iCalendar Data Types
registry:
IANA has made the "Status" column for this entry in the registry say,
"Reserved - Do not use" and has made the "Reference" column refer to
Section 5 of this document.
8. Acknowledgments
The authors would like to thank the following for their valuable
contributions: William Gill, Erwin Rehme, Dave Thewlis, Simon
Perreault, Michael Angstadt, Peter Saint-Andre, Bert Greevenbosch,
and Javier Godoy. This specification originated from the work of the
XML-JSON technical committee of the Calendaring and Scheduling
Consortium.
9. References
[ISO.8601.2004]
International Organization for Standardization, "Data
elements and interchange formats -- Information
interchange -- Representation of dates and times", ISO
8601, December 2004,
<http://www.iso.org/iso/catalogue_detail?csnumber=40874>.
[RFC6321] Daboo, C., Douglass, M., and S. Lees, "xCal: The XML
Format for iCalendar", RFC 6321, August 2011.
[calconnect-artifacts]
The Calendaring and Scheduling Consortium, "Code Artifacts
and Schemas", <http://www.calconnect.org/artifacts.shtml>.
components-array = begin-array
[ component *(value-separator component) ]
end-array
; Property values depend on the type-name. Aside from the value types
; mentioned here, extensions may make use of other JSON value types.
; The non-terminal symbol structured-prop-value covers the special
; cases for GEO and REQUEST-STATUS.
property-value = simple-prop-value / structured-prop-value
simple-prop-value = string / number / true / false
structured-prop-value =
begin-array
[ structured-element *(value-separator structured-element) ]
end-array
structured-element = simple-prop-value
Appendix B. Examples
B.1. Example 1
BEGIN:VCALENDAR
CALSCALE:GREGORIAN
PRODID:-//Example Inc.//Example Calendar//EN
VERSION:2.0
BEGIN:VEVENT
DTSTAMP:20080205T191224Z
DTSTART:20081006
SUMMARY:Planning meeting
UID:4088E990AD89CB3DBB484909
END:VEVENT
END:VCALENDAR
["vcalendar",
[
["calscale", {}, "text", "GREGORIAN"],
["prodid", {}, "text", "-//Example Inc.//Example Calendar//EN"],
["version", {}, "text", "2.0"]
],
[
["vevent",
[
["dtstamp", {}, "date-time", "2008-02-05T19:12:24Z"],
["dtstart", {}, "date", "2008-10-06"],
["summary", {}, "text", "Planning meeting"],
["uid", {}, "text", "4088E990AD89CB3DBB484909"]
],
[]
]
]
]
B.2. Example 2
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Example Corp.//Example Client//EN
BEGIN:VTIMEZONE
LAST-MODIFIED:20040110T032845Z
TZID:US/Eastern
BEGIN:DAYLIGHT
DTSTART:20000404T020000
RRULE:FREQ=YEARLY;BYDAY=1SU;BYMONTH=4
TZNAME:EDT
TZOFFSETFROM:-0500
TZOFFSETTO:-0400
END:DAYLIGHT
BEGIN:STANDARD
DTSTART:20001026T020000
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
TZNAME:EST
TZOFFSETFROM:-0400
TZOFFSETTO:-0500
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
DTSTAMP:20060206T001121Z
DTSTART;TZID=US/Eastern:20060102T120000
DURATION:PT1H
RRULE:FREQ=DAILY;COUNT=5
RDATE;TZID=US/Eastern;VALUE=PERIOD:20060102T150000/PT2H
SUMMARY:Event #2
DESCRIPTION:We are having a meeting all this week at 12 pm fo
r one hour\, with an additional meeting on the first day 2 h
ours long.\nPlease bring your own lunch for the 12 pm meetin
gs.
UID:00959BC664CA650E933C892C@example.com
END:VEVENT
BEGIN:VEVENT
DTSTAMP:20060206T001121Z
DTSTART;TZID=US/Eastern:20060104T140000
DURATION:PT1H
RECURRENCE-ID;TZID=US/Eastern:20060104T120000
SUMMARY:Event #2 bis
UID:00959BC664CA650E933C892C@example.com
END:VEVENT
END:VCALENDAR
["vcalendar",
[
["prodid", {}, "text", "-//Example Corp.//Example Client//EN"],
["version", {}, "text", "2.0"]
],
[
["vtimezone",
[
["last-modified", {}, "date-time", "2004-01-10T03:28:45Z"],
["tzid", {}, "text", "US/Eastern"]
],
[
["daylight",
[
["dtstart", {}, "date-time", "2000-04-04T02:00:00"],
["rrule",
{},
"recur",
{
"freq": "YEARLY",
"byday": "1SU",
"bymonth": 4
}
],
["tzname", {}, "text", "EDT"],
["tzoffsetfrom", {}, "utc-offset", "-05:00"],
["tzoffsetto", {}, "utc-offset", "-04:00"]
],
[]
],
["standard",
[
["dtstart", {}, "date-time", "2000-10-26T02:00:00"],
["rrule",
{},
"recur",
{
"freq": "YEARLY",
"byday": "1SU",
"bymonth": 10
}
],
["tzname", {}, "text", "EST"],
["tzoffsetfrom", {}, "utc-offset", "-04:00"],
["tzoffsetto", {}, "utc-offset", "-05:00"]
],
[]
]
]
],
["vevent",
[
["dtstamp", {}, "date-time", "2006-02-06T00:11:21Z"],
["dtstart",
{ "tzid": "US/Eastern" },
"date-time",
"2006-01-02T12:00:00"
],
["duration", {}, "duration", "PT1H"],
["rrule", {}, "recur", { "freq": "DAILY", "count": 5 } ],
["rdate",
{ "tzid": "US/Eastern" },
"period",
"2006-01-02T15:00:00/PT2H"
],
["summary", {}, "text", "Event #2"],
["description",
{},
"text",
// Note that comments and string concatenation are not
// allowed per the JSON specification and is used here only
// to avoid long lines.
"We are having a meeting all this week at 12 pm for one " +
"hour, with an additional meeting on the first day 2 " +
"hours long.\nPlease bring your own lunch for the 12 pm " +
"meetings."
],
["uid", {}, "text", "00959BC664CA650E933C892C@example.com"]
],
[]
],
["vevent",
[
["dtstamp", {}, "date-time", "2006-02-06T00:11:21Z"],
["dtstart",
{ "tzid": "US/Eastern" },
"date-time",
"2006-01-02T14:00:00"
],
["duration", {}, "duration", "PT1H"],
["recurrence-id",
{ "tzid": "US/Eastern" },
"date-time",
"2006-01-04T12:00:00"
],
["summary", {}, "text", "Event #2"],
["uid", {}, "text", "00959BC664CA650E933C892C@example.com"]
],
[]
]
]
]
Authors’ Addresses
Philipp Kewisch
Mozilla Corporation
650 Castro Street, Suite 300
Mountain View, CA 94041
USA
EMail: mozilla@kewis.ch
URI: http://www.mozilla.org/
Cyrus Daboo
Apple Inc.
1 Infinite Loop
Cupertino, CA 95014
USA
EMail: cyrus@daboo.name
URI: http://www.apple.com/
Mike Douglass
Rensselaer Polytechnic Institute
110 8th Street
Troy, NY 12180
USA
EMail: douglm@rpi.edu
URI: http://www.rpi.edu/