[ 
https://issues.apache.org/jira/browse/STANBOL-481?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13201322#comment-13201322
 ] 

Rupert Westenthaler commented on STANBOL-481:
---------------------------------------------

Short Update:

I have written a small prototype using 

<dependency>
    <groupId>org.apache.httpcomponents</groupId>
    <artifactId>httpmime</artifactId>
</dependency>
<dependency>
    <groupId>org.apache.httpcomponents</groupId>
    <artifactId>httpclient</artifactId>
</dependency>

I do like this API much more than javax.mail, because it allows easily to 
"stream" all the data directly to the OutputStream!

that produces for the ContentItem

uri: urn:test
content type : text/html
contentPart:
   uri: urn:test:text
   content type : text/plain

metadata:
   urn:test, http://www.w3.org/1999/02/22-rdf-syntax-ns#type, urn:types:Document

the following Multipart Mime:

--OHPnQAMLYDkzNWjtO3eHRL_Gmkj3msRmPDuY
Content-Disposition: form-data; name="metadata"; filename="metadata"
Content-Type: application/rdf+xml; charset=UTF-8
Content-Transfer-Encoding: 7bit

<rdf:RDF
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
    xmlns:j.0="urn:types:" > 
  <rdf:Description rdf:about="urn:test">
    <rdf:type rdf:resource="urn:types:Document"/>
  </rdf:Description>
</rdf:RDF>

--OHPnQAMLYDkzNWjtO3eHRL_Gmkj3msRmPDuY
Content-Disposition: form-data; name="content"
Content-Type: multipart/alternate; charset=UTF-8
Content-Transfer-Encoding: 7bit

--contentParts
Content-Disposition: form-data; name="urn:test_main"
Content-Type: text/html
Content-Transfer-Encoding: binary

<html><body>Test</body></html>
--contentParts
Content-Disposition: form-data; name="run:text:text"
Content-Type: text/plain
Content-Transfer-Encoding: binary

test
--contentParts--

--OHPnQAMLYDkzNWjtO3eHRL_Gmkj3msRmPDuY--

This should be in conformance with the specification


                
> Multi ContentPart RESTful API extensions
> ----------------------------------------
>
>                 Key: STANBOL-481
>                 URL: https://issues.apache.org/jira/browse/STANBOL-481
>             Project: Stanbol
>          Issue Type: Sub-task
>          Components: Enhancer
>            Reporter: Rupert Westenthaler
>            Assignee: Rupert Westenthaler
>
> Sub-task about the implementation of the RESTful API extensions related to 
> multipart content items
> Copied form the main Issue:
> - query params:
> Optional inputWithMetadata -> expects multipart/mime with 2 sections of which 
> the first is rdf
> Optional outputWithContentParts[=<section-ordinal>] -> the result is 
> multipart (instead of rdf) containing rdf as the first section and the parts 
> in the second section, if there is more than one part this second section is 
> itself multipart, this argument might be repated to have different sections
> Optional omitMetada -> no metadate in the result, makes only sense with 
> outputContentParts argument, the result will correspond to the second section 
> of the malipart returned without this argument 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to