You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stanbol.apache.org by "Suat Gonul (JIRA)" <ji...@apache.org> on 2012/12/13 16:12:13 UTC

[jira] [Updated] (STANBOL-785) Change REST service consuming multipart data with the one taking ContentItem parameter directly

     [ https://issues.apache.org/jira/browse/STANBOL-785?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Suat Gonul updated STANBOL-785:
-------------------------------

    Description: 
Since Multipart serialization of ContentItems accepts multipart form data, the existing service should be adapted so that it would take the ContentItem directly in the deserialized form. This service can be used in the following ways:

    a) Create ContentItem without any metadata or additional part

        curl -i -F "content=I live in Paris.;type=text/plain" \
              "http://localhost:8080/contenthub/contenthub/store"


    b) Create ContentItem with only metadata

        curl -i -F "metadata=@metadata.rdf;type=application/rdf+xml" \
                 -F "content=I live in Paris.;type=text/plain" \
              "http://localhost:8080/contenthub/contenthub/store"


    c) Create ContentItem with both metadata and addition content part

        curl -i -F "metadata=@metadata.rdf;type=application/rdf+xml" \
                 -F "content=@contentFile;type=text/plain" \
                 -F "additionalPart=@additionalPart.rdf;type=application/rdf+xml" \
              "http://localhost:8080/contenthub/contenthub/store"

    d) To specify a custom URI for the ContentItem to be created the "uri" parameter can be added as in the following curl command:

        curl -i -F "content=@contentFile;type=text/plain" \
                 -F "additionalPart=@additionalPart.rdf;type=application/rdf+xml" \
              "http://localhost:8080/contenthub/contenthub/store?uri=custom_contentitem_uri"

Side note: When a content item is created in the Contenthub, it is first enhanced through the Enhancer using the specified engine chain. However, if there is already a "metadata" part within the parsed ContentItem, it is not re-enhanced again.

  was:
Since Multipart serialization of ContentItems accepts multipart form data, the existing service should be adapted so that it would take the ContentItem directly in the deserialized form. This service can be used in the following ways:

    a) Create ContentItem without any metadata or additional part

        curl -i -F "content=I live in Paris.;type=text/plain" \
              "http://localhost:8080/contenthub/contenthub/store"


    b) Create ContentItem with only metadata

        curl -i -F "metadata=@metadata.rdf;type=application/rdf+xml" \
                 -F "content=I live in Paris.;type=text/plain" \
              "http://localhost:8080/contenthub/contenthub/store"


    c) Create ContentItem with both metadata and addition content part

        curl -i -F "metadata=@metadata.rdf;type=application/rdf+xml" \
                 -F "content=@contentFile;type=text/plain" \
                 -F "additionalPart=@additionalPart.rdf;type=application/rdf+xml" \
              "http://localhost:8080/contenthub/contenthub/store"

    d) To specify a custom URI for the ContentItem to be created the "uri" parameter can be added as in the following curl command:

        curl -i -F "content=@contentFile;type=text/plain" \
                 -F "additionalPart=@additionalPart.rdf;type=application/rdf+xml" \
              "http://localhost:8080/contenthub/contenthub/store?uri=custom_contentitem_uri"    

    
> Change REST service consuming multipart data with the one taking ContentItem parameter directly
> -----------------------------------------------------------------------------------------------
>
>                 Key: STANBOL-785
>                 URL: https://issues.apache.org/jira/browse/STANBOL-785
>             Project: Stanbol
>          Issue Type: Sub-task
>          Components: Contenthub
>            Reporter: Meric Taze
>             Fix For: contenthub-0.10.0
>
>
> Since Multipart serialization of ContentItems accepts multipart form data, the existing service should be adapted so that it would take the ContentItem directly in the deserialized form. This service can be used in the following ways:
>     a) Create ContentItem without any metadata or additional part
>         curl -i -F "content=I live in Paris.;type=text/plain" \
>               "http://localhost:8080/contenthub/contenthub/store"
>     b) Create ContentItem with only metadata
>         curl -i -F "metadata=@metadata.rdf;type=application/rdf+xml" \
>                  -F "content=I live in Paris.;type=text/plain" \
>               "http://localhost:8080/contenthub/contenthub/store"
>     c) Create ContentItem with both metadata and addition content part
>         curl -i -F "metadata=@metadata.rdf;type=application/rdf+xml" \
>                  -F "content=@contentFile;type=text/plain" \
>                  -F "additionalPart=@additionalPart.rdf;type=application/rdf+xml" \
>               "http://localhost:8080/contenthub/contenthub/store"
>     d) To specify a custom URI for the ContentItem to be created the "uri" parameter can be added as in the following curl command:
>         curl -i -F "content=@contentFile;type=text/plain" \
>                  -F "additionalPart=@additionalPart.rdf;type=application/rdf+xml" \
>               "http://localhost:8080/contenthub/contenthub/store?uri=custom_contentitem_uri"
> Side note: When a content item is created in the Contenthub, it is first enhanced through the Enhancer using the specified engine chain. However, if there is already a "metadata" part within the parsed ContentItem, it is not re-enhanced again.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira