Uploaded image for project: 'Stanbol (Retired)'
  1. Stanbol (Retired)
  2. STANBOL-784 Use Multipart serialization of ContentItem in Contenthub while content creation
  3. STANBOL-785

Change REST service consuming multipart data with the one taking ContentItem parameter directly

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • contenthub-0.10.0
    • Contenthub
    • 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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            meric MeriƧ Taze
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: