ROUGH DRAFT
What is an Attachment?
Here's our current definition of an attachment:
- A resource that is related to another resource and adds supplemental information
- For example:
- A screen-shot attached to a Change Request
- An office document attached to a Requirement
How should attachments work?
Attachments are Resources. A Resource links to its Attachments.
- Attachment should be created via POST
- Attachment should have URI
- Resource links to its attachments
One issue: which spec will define the attachment property, Core or domains?
Use case #1: Consumer associates Attachment with Resource
The consumer does the work: creating the Attachment if necessary and adding the link to the Resource being attached to.
Consumer->Service: POST attachment to be added
Service->Consumer: gets back URI of attachment
Consumer->Resource: GET resource to be attached to
Consumer->Resource: PUT back resource with new link to attachment
Nothing new here. This is how you'd expect things to work with HTTP and RDF.
Some notes:
- Consumer may create Resource via POST (as shown above) or Consumer may use an existing Resource as the Attachment, if the Provider allows that
- Provider may require that all Attachments be created via Provider’s Creation Factory, thus disallowing using of existing Resources
- Issue: who defines propety for attachment link, Core or Domains?
Use case #2: Consumer displays Resource and list of Attachments
In addition to links to Attachments, Resources may contain:
- Property values which are links to Attachments
- Property values about the Attachments
- Property values about the Attachments links
Either Provider or Consumer may add those properties. A Consumer knows which property values are links to Attachments and how to find properties about each, so it can easily display a list of Attachments. Nothing new here either, just plain RDF
Use case #3: Consumer gets and updates an image Attachment
Consumer->Resource: GET
note left of Consumer: picks Attachment URI
Consumer->Attachment: GET on Attachment URI
Attachment->Consumer: sends back Attachment
note left of Consumer: edits Attachment image
Consumer->Attachment: PUT new image
Consumer->Resource: PUT with updated properties about Attachment
Topic revision: r1 - 02 Feb 2011 - 22:55:37 -
DaveJohnson