Details
-
Sub-task
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
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.