[ 
https://issues.apache.org/jira/browse/TUSCANY-2567?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12635477#action_12635477
 ] 

Dan Becker commented on TUSCANY-2567:
-------------------------------------

I've been investigating this JIRA, and I would like to solicit comments from 
Tuscany users.

The Atom Publishing Protocol has a section on 9.3 Media Resources and Media 
Link Entries (http://tools.ietf.org/html/rfc5023#section-9.6). I think this 
section describes an area of the Atom Publishing Protocol that is entirely left 
up to the Tuscany implementer at this point. Following this section in the APP 
reference, I think this JIRA can be used to implement posting and putting of 
media entries.

1) The first step is to support the POST and PUT scenarios described in the 
APP. For example, user posts media:
       POST /edit/ HTTP/1.1
       Host: media.example.org
       Content-Type: image/png
       Slug: The Beach
       Authorization: Basic ZGFmZnk6c2VjZXJldA==
       Content-Length: nnn

       ...binary data...
Tuscany responds with proper media links. Note that the media is stored in a 
different location than the media information which is stored in the Atom feed.
       HTTP/1.1 201 Created
       Date: Fri, 7 Oct 2005 17:17:11 GMT
       Content-Length: nnn
       Content-Type: application/atom+xml;type=entry;charset="utf-8"
       Location: http://example.org/media/edit/the_beach.atom

       <?xml version="1.0"?>
       <entry xmlns="http://www.w3.org/2005/Atom";>
         <title>The Beach</title>
         <id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id>
         <updated>2005-10-07T17:17:08Z</updated>
         <author><name>Daffy</name></author>
         <summary type="text" />
         <content type="image/png"
            src="http://media.example.org/the_beach.png"/>
         <link rel="edit-media"
            href="http://media.example.org/edit/the_beach.png"; />
         <link rel="edit"
            href="http://example.org/media/edit/the_beach.atom"; />
       </entry>

The existing binding-atom-abdera has a proposed interface for this 
conversation, so I think this first scenario is to implement this interface, 
and also provide a working example of its use.

2) The next scenario is similar to the first, except in this case we are 
supporting PUT and the update of an existing media resource. 
      PUT /edit/the_beach.png HTTP/1.1
       Host: media.example.org
       Content-Type: image/png
       Authorization: Basic ZGFmZnk6c2VjZXJldA==
       Content-Length: nnn

       ...binary data...
Tuscany responds with "successful edit" and status code 200.
       HTTP/1.1 200 Ok
       Date: Fri, 8 Oct 2006 17:17:11 GMT

3) The final part of my investigation is regarding the "ability to stream 
content" part of the requirement statement for this JIRA. I take that to mean 
there will be Tuscany helper APIs and classes to deal with the content of these 
requests. For example, the postMedia and putMedia APIs in the Tuscany 
binding-atom-abdera module contains the following methods:
    Entry postMedia(String title, String slug, String contentType, InputStream 
media);
    void putMedia(String id, String contentType, InputStream media) throws 
NotFoundException;
I think there would be a helper class to take the InputStream and load it 
asynchronously, perhaps notifying the caller with its completion.

Please let me know if there are other ideas that I have omitted, or 
nice-to-have items that I have not mentioned. Comments are appreciated.









> Support for streaming postMedia  and putMedia in Atom binding
> -------------------------------------------------------------
>
>                 Key: TUSCANY-2567
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-2567
>             Project: Tuscany
>          Issue Type: New Feature
>         Environment: All
>            Reporter: Dan Becker
>             Fix For: Java-SCA-Next
>
>
> - support for postMedia and putMedia, including the ability to stream that 
> content in the target application component 
> One of the requested enhancements to the Atom binding

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to