URIs and URLs
Posted in Technical by JarrettV on 3/18/2009 12:01:00 AM - CSTAtomSite creates IDs that conform to the 'tag' URI scheme as specified in RFC 4151.
tag:{workspace},{date}:{collection},{entryPath}
The workspace is a domain that the user owns, or the email address of the user if they do not have a domain. The date is used to identify the scope in time. The collection signifies a grouping of entries in a workspace. The entry path is a comma separated listing of the entry location in an optional thread.
| Examples | |
|---|---|
| Blog Collection | tag:atomsite.net,2008:blog |
| About Entry in Info Collection | tag:atomsite.net,2008:info,About |
| Blog Post on Multi-user Site | tag:kristin.jvance.com,2008-08-08:blog,MyBlogPost |
| Comment to Blog Post | tag:atomsite.net,2008-08-08:blog,MyBlogPost,1 |
| Response to a Comment | tag:atomsite.net,2008-08-08:blog,MyBlogPost,1,1 |
- The date in a collection id has no meaning (other than that specified in RFC 4151)
- An optional full date is used for an entry id. When no date is specified it uses the date of the collection.
- Multiple workspaces may exist on the same domain by using a sub-domain in the id.
- Annotation id is prefixed with its parent's id. A comma separates entries in a thread. This makes up the entry path.
These examples show permanent ID's given to resources. The location of these resources may change over time. The AtomSite AtomPub Service is the base endpoint for atom representations of the resources. I've listed some examples of REST friendly URLs below:
| Examples | ||
|---|---|---|
| GET | Service Document | https://atomsite.net/service.atomsvc |
| GET, POST | Collection | https://atomsite.net/blog.atom |
| GET | Categories Document | https://atomsite.net/blog/tags.atomcat |
| GET, PUT, DELETE | Entry | https://atomsite.net/info/About.atom |
| GET, PUT, DELETE | Annotation | https://atomsite.net/blog/2008/08/08/MyBlogPost/1.atom |
| GET, PUT, DELETE | Image | https://atomsite.net/media/2008/08/08/MyImage.media |
| GET, PUT, DELETE | Media Link Entry | https://atomsite.net/media/2008/08/08/MyImage.atom |
| POST | Entry Annotation | https://atomsite.net/info/About.atom |
- The resource verbs are specified by the Atom Publishing Protocol.
-
Collections do not have an extension. - Posting to an entry creates an annotation.*
- An entry may have a collection of annotation entries.*
- All media have a ".media" extension regardless of content type.
The above URLs are all secured resources that require the proper authentication and authorization to perform any of the actions (verbs). URLs for non-secure resources such as feeds, media, and web pages are exposed such as:
| Examples | |
|---|---|
| Feed | http://atomsite.net/blog/feed.atom |
| Collection Page | http://atomsite.net/blog.xhtml |
| Index Listing | http://atomsite.net/blog/index.xhtml |
| Entry (w/ annotations) | http://atomsite.net/info/About.xhtml |
| Annotations Feed | http://atomsite.net/info/About/annotations.atom |
| Image | http://atomsite.net/media/2008/08/08/MyImage.media |
- The words "feed", "annotations", and "index" are restricted from being entry names.
- A collection can also have an annotation feed. Annotation feeds contain all descendant annotations.