Cosmo Feed Service: Tickets
The feed service provides an Atom collection that exposes a user's tickets as Atom entries. These preferences may be manipulated using APP.
Representation
Tickets are represented in XHTML using the
"Tickets" microformat.
When a client sends a representation of a ticket to the server, the client may omit all Atom entry elements other than content, since the representation contains all information needed to create or update the ticket.
Listing Tickets
A collection's
ticket feed may be returned by sending a
GET request to the the URI following the template
/atom/collection/{uid}/tickets.
The response includes an Atom feed document containing a
ticket entry for each of the collection's tickets ordered with the most recently modified ticket first. The content-type of the response is
application/atom+xml. The response does not include an a
ETag header since the feed does not represent an actual object stored in the server.
The feed's metadata elements are populated as such:
- title:
Tickets on {collection name}
- updated: the current point in time
- author: username and Atom entry point URI of the creator of the ticket
- self link: URI with rel
self that can be used to retrieve the tickets feed
Each entry's metadata elements are populated as follows:
- title: ticket's key
- updated: ticket's last modified timestamp
- edited: ticket's last modified timestamp
- published: ticket's created timestamp
- self link: URI with rel
self that can be used to retrieve the ticket entry
- edit link: URI with rel
edit that can be used to upload changes to the ticket
The content of a ticket entry is as described in
Representation.
Response Status Codes
- 200: Success
- 500: Unknown server error
Examples
<<< REQUEST >>>
GET /chandler/atom/collection/a6d66ca0-4137-11dd-922c-eabdddb3c61e/tickets HTTP/1.1
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
<<< RESPONSE >>>
HTTP/1.1 200 OK
Content-Type: application/atom+xml
<?xml version='1.0' encoding='UTF-8'?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:base="http://localhost:80
80/chandler/atom/">
<id>urn:uuid:a6d66ca0-4137-11dd-922c-eabdddb3c61e</id>
<title type="text">Tickets on foo</title>
<updated>2008-06-23T15:19:49.593Z</updated>
<generator uri="http://cosmo.osafoundation.org/" version="0.16-SNAPSHOT">Chandler Server</generator>
<author>
<name>randy</name>
<uri>user/randy</uri>
</author>
<link rel="self" type="application/atom+xml" href="collection/a6d66ca0-4137-11dd-922c-eabdddb3c61e/tickets" />
<entry xmlns:app="http://www.w3.org/2007/app">
<id>urn:uuid:ac01aaa0</id>
<title type="text">ac01aaa0</title>
<updated>2008-06-23T15:18:45.000Z</updated>
<app:edited>2008-06-23T15:18:45.000Z</app:edited>
<published>2008-06-23T15:18:45.000Z</published>
<link rel="self" type="application/atom+xml" href="collection/a6d66ca0-4137-11dd-922c-eabdddb3c61e/ticket/ac01aaa0"/>
<link rel="edit" type="application/atom+xml" href="collection/a6d66ca0-4137-11dd-922c-eabdddb3c61e/ticket/ac01aaa0"/>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<div class="ticket">Key:
<span class="key">ac01aaa0</span>Type:
<span class="type" title="read-only">read-only</span>Timeout:
<span class="timeout" title="Infinite">Infinite</span>
</div>
</div>
</content>
</entry>
<entry xmlns:app="http://www.w3.org/2007/app">
<id>urn:uuid:ac03f490</id>
<title type="text">ac03f490</title>
<updated>2008-06-23T15:18:46.000Z</updated>
<app:edited>2008-06-23T15:18:46.000Z</app:edited>
<published>2008-06-23T15:18:46.000Z</published>
<link rel="self" type="application/atom+xml" href="collection/a6d66ca0-4137-11dd-922c-eabdddb3c61e/ticket/ac03f490"/>
<link rel="edit" type="application/atom+xml" href="collection/a6d66ca0-4137-11dd-922c-eabdddb3c61e/ticket/ac03f490"/>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<div class="ticket">Key:
<span class="key">ac03f490</span>Type:
<span class="type" title="read-write">read-write</span>Timeout:
<span class="timeout" title="Infinite">Infinite</span>
</div>
</div>
</content>
</entry>
</feed>
Retrieving a Ticket
A
ticket entry may be returned by sending a
GET request to the
self URI found in the preference's entry within the user's preferences feed.
The response includes an Atom entry document. The content-type of the response is
application/atom+xml. The response includes
ETag and
Last-Modified headers to allow for caching of the entry document.
The entry's meta-data elements are populated as in the tickets feed with the addition of:
- author: username and Atom entry point URI of the ticket author
Response Status Codes
- 200: Success
- 500: Unknown server error
Examples
<<< REQUEST >>>
GET /chandler/atom/collection/a6d66ca0-4137-11dd-922c-eabdddb3c61e/ticket/ac03f490 HTTP/1.1
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
<<< RESPONSE >>>
HTTP/1.1 200 OK
ETag: "kxVwryOzfSSBTd0LdkpoyYrNCB8="
Last-Modified: Mon, 09 Jul 2007 23:28:01 GMT
Content-Type: application/atom+xml
<?xml version='1.0' encoding='UTF-8'?>
<entry xmlns:app="http://www.w3.org/2007/app" xmlns="http://www.w3.org/2005/Atom" xml:base="http://localhost:8080/chandl
er/atom/">
<id>urn:uuid:ac03f490</id>
<title type="text">ac03f490</title>
<updated>2008-06-23T15:18:46.000Z</updated>
<app:edited>2008-06-23T15:18:46.000Z</app:edited>
<published>2008-06-23T15:18:46.000Z</published>
<author>
<name>randy</name>
<uri>user/randy</uri>
</author>
<link rel="self" type="application/atom+xml" href="collection/a6d66ca0-4137-11dd-922c-eabdddb3c61e/ticket/ac03f490" />
<link rel="edit" type="application/atom+xml" href="collection/a6d66ca0-4137-11dd-922c-eabdddb3c61e/ticket/ac03f490" />
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<div class="ticket">Key:
<span class="key">ac03f490</span>Type:
<span class="type" title="read-write">read-write</span>Timeout:
<span class="timeout" title="Infinite">Infinite</span>
</div>
</div>
</content>
</entry>
Creating a Ticket
A ticket may be created by sending a
POST request containing an Atom entry to the tickets collection's URI. The content type of the request must be
application/atom+xml, and the content length must be greater than 0. The content of the entry must be an XHTML representation of the ticket. The Atom entry metadata is not stored.
The response to a creation request includes an Atom entry document describing the newly created ticket. The content-type of the response is
application/atom+xml. The response includes
ETag and
Last-Modified headers to allow for caching of the entry document. The request also includes matching
Location and
Content-Location headers, which tells the client that the representation enclosed in the entry document is a complete representation of the ticket.
The entry's metadata elements are populated as per ticket retrieval.
Response Status Codes
- 201: The ticket was successfully created
- 409: The collection already has a ticket with the given key
- 411: The request
Content-Length header was not provided or was not greater than 0
- 415: The request
Content-Type header was not provided or was not application/atom+xml
- 400: The request content could not be parsed, did not represent an Atom entry or contained an invalid representation
- 500: Unknown server error
Examples
<<< REQUEST >>>
POST /chandler/atom/collection/a6d66ca0-4137-11dd-922c-eabdddb3c61e/tickets HTTP/1.1
Content-Type: application/atom+xml
Content-Length: xxx
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
<?xml version='1.0' encoding='UTF-8'?>
<entry xmlns="http://www.w3.org/2005/Atom">
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<div class="ticket">Key:
<span class="key">ac03f490</span>Type:
<span class="type" title="read-write">read-write</span>Timeout:
<span class="timeout" title="Infinite">Infinite</span>
</div>
</div>
</content>
</entry>
<<< RESPONSE >>>
HTTP/1.1 201 Created
ETag: "TpukUDukSLLf8UtNUczUcpSFJAs="
Last-Modified: Tue, 10 Jul 2007 18:17:44 GMT
Content-Location: http://example.org/chandler/atom/collection/a6d66ca0-4137-11dd-922c-eabdddb3c61e/ticket/ac03f490
Location: http://example.org/chandler/atom/collection/a6d66ca0-4137-11dd-922c-eabdddb3c61e/ticket/ac03f490
Content-Type: application/atom+xml
<?xml version='1.0' encoding='UTF-8'?>
<entry xmlns:app="http://www.w3.org/2007/app" xmlns="http://www.w3.org/2005/Atom" xml:base="http://localhost:8080/chandler/atom/">
<id>urn:uuid:ac03f490</id>
<title type="text">ac03f490</title>
<updated>2008-06-23T15:33:18.109Z</updated>
<app:edited>2008-06-23T15:33:18.109Z</app:edited>
<published>2008-06-23T15:33:18.109Z</published>
<author>
<name>randy</name>
<uri>user/randy</uri>
</author>
<link rel="self" type="application/atom+xml" href="collection/a6d66ca0-4137-11dd-922c-eabdddb3c61e/ticket/ac03f490" />
<link rel="edit" type="application/atom+xml" href="collection/a6d66ca0-4137-11dd-922c-eabdddb3c61e/ticket/ac03f490" />
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<div class="ticket">Key:
<span class="key">ac03f490</span>Type:
<span class="type" title="read-write">read-write</span>Timeout:
<span class="timeout" title="Infinite">Infinite</span>
</div>
</div>
</content>
</entry>
Modifying a Ticket
At this time, tickets cannot be modified.
Deleting a Ticket
A ticket may be deleted by sending a
DELETE request to the
edit URI found in the ticket's entry within the tickets feed.
The response does not include any content.
Response Status Codes
- 204: Success
- 500: Unknown server error
Examples
<<< REQUEST >>>
DELETE /chandler/atom/collection/a6d66ca0-4137-11dd-922c-eabdddb3c61e/ticket/ac03f490 HTTP/1.1
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
<<< RESPONSE >>>
HTTP/1.1 204 No Content
--
RandyLetness - 23 Jun 2008