CREATE-1 In this example we attempt to create a calendar component in several places. We assume that we are connected to the CS cal.example.com. # The client asks to send data and the server responds with 2.0.1 # indicating that it is ready to receive. The client then sends the data, # terminated by a line containing a single ".". The data is considered # an atomic block from the perspective of the protocol. C: 10 SENDDATA S: 10 2.0.1 C: CONTENT-TYPE: text/calendar;method=CREATE;component=VCOMMAND C: Content-Transfer-Encoding:7bit C: # All data is encapsulated in a VCALENDAR # Version 2.1 includes CAP extensions. C: BEGIN:VCALENDAR C: VERSION:2.1 C: BEGIN:VCOMMAND C: METHOD:CREATE;VCALENDAR;cap://cal.example.com/,relcal4,://bobo.ex.com/,relcal5,cap://cal.example.com/relcal8,relcal9 # The details of the command are described in a VCOMMAND component. # The "METHOD" describes the command: # "CREATE" indicates that the command is used to create something # "VCALENDAR" indicates what is being created # The rest of the line is the list of containers in which things # will be created. # # "cap://cal.example.com/" specifies a CS, indicating we want to create a # root-level calendar in this CS. # # "relcal4" specifies a calendar on the CS to which we are currently # connected (cal.example.com) # # "://bobo.ex.com/" specifies a CS, again a toplevel calendar. The # scheme value is not specified. The default scheme for CAP is "cap" # # "relcal5" is a RelativeCalUID on cal.example.com # # "cap://cal.example.com/relcal8" fully specifies a calendar on the server # to which we are connected. (This is equivalent to just "relcal8".) # # "relcal9" is a RelativeCalUID on cal.example.com C: BEGIN:VCALENDAR C: RELCALUID:relcalz # This is the calendar which we want to create. For this calendar # we are specifying the RelativeCalUID "relcalz". This will cause # problems later because several of the containers are on the same # calendar server and RelativeCalUIDs MUST be unique on a given CS. C: NAME:CHARSET=us-ascii;LANGUAGE=EN-us:Bill's Soccer Team # This is readable name which a user assigns to their calendar, not to be # confused with the RELCALUID. C: OWNER:capcar:bill C: OWNER:capcar:mary C: CALMASTER:mailto:bill@example.com # The owners of the calendar. The CALMASTER is a person to contact. C: PREFERRED-TZID:US_PST # The preferred tzid is simply a timezone that is applicable to the # calendar. It is for information purposes only. C: BEGIN:VCAR C: CARID:12345 C: GRANT;CN="Bill Jones":principal=capcar:bill;action=ALL;object=all C: GRANT;cn="Mary Jones":principal=capcar:mary;action=read;object=all C: END:VCAR # This calendar is created with Some access rights. C: END:VCALENDAR C: END:VCOMMAND C: END:VCALENDAR C: . # The "." on a single line indicates the termination of the data. # We receive a response for each item in the value list of the METHOD # property. The responses include the full CALID of the target (expanded # if necessary), and, if the creation was successful, the full CALID of the # newly created calendar. # # Responses need not be received in the same order as specified in the # METHOD property. S: 10 6.0 cap://cal.example.com/ # We don't have permission to create a calendar in this container. S: 10 2.0 cap://cal.example.com/relcal4 cap://cal.example.com/relcalz # Success! The container and newly created CalID are returned. S: 10 3.1.4 cap://bobo.ex.com/ # The creation of the calendar on this remote server is not supported S: 10 6.2 cap://cal.example.com/relcal5 # Security failure (authenticated user does not have the access rights # to create a calendar in cap://cal.example.com/relcal5 ) S: 10 3.1.5 cap://cal.example.com/relcal8 # The parent container doesn't exist S: 10 7.0 cap://cal.example.com/relcal9 # A calendar with the selected name already exists. It was just created # under relcal4. See EXAMPLE-1a for an alternative approach.