Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

Div
stylefont-weight:bold;font-size:1.2em;
Media Service Home

The Media Service offers a RESTful API to perform CRUD (create, read, update, and delete) operations on media related information. When possible, these operations follow the Common model for CollectionSpace REST services.

...

Derivative terms and the properties of these terms will eventually be part of the CollectionSpace configuration mechanism -as of v1.5, this configuration does not yet exist. Terms and their properties will be specific to the media type. For example, for image media a term set definition might look something like:

Image Terms = {'thumbnail' = 64 x 64, 'small' = 128 x 128, 'medium' = 256 x 256 }
Code Block

Wiki Markup
{multi-excerpt:name=current-derivative-terms}
{note}
As of the v1.7 release, only the following image-related derivative terms exist:
* 'Thumbnail' (a JPEG-format derivative, 64 x 64 pixels)
* 'Medium' (a JPEG-format derivative, 256 x 256 pixels)
* 'OriginalJpeg' (a JPEG-format derivative, with the same pixel resolution as the original image)
* 'Original' (the original, full-sized image, in its native format; e.g. JPEG, PNG, TIFF, etc.)
{note}
{multi-excerpt}

...

1. Create a new media record -with optional URI to media bits (document/file).

POST to "/media?blobUri=" with MIME=application/xml
Code Block

Notes: Returns the csid of a newly created media record as part of the URL in the 'location' header of the response. If the POST payload includes a 'blobUri' query parameter that is set to a valid and accessible URI, then the Media service will attempt to create a corresponding blob record using that URI and will relate it to the newly created media record. See the following link for more details: /wiki/spaces/DOC/pages/2930127799

...

2. Create a new media record AND a blob record

POST to "/media" with MIME=multipart/form-data
Code Block

Notes: This creates both a media record and a blob record and also relates the two.

3. Create a new blob record and relate to an existing media record - Option #1

POST to "/media/{csid}/blob" with MIME=multipart/form-data
Code Block

Notes: Returns the csid of the blob record. In addition, this operation has the side-effect of relating the existing media record (with csid) to the newly created blob record.

4. Create a new blob record and relate to an existing media record - Option #2 - URI Source.

POST to "/media/{csid}/blob?blobUri=" with MIME=application/xml
Code Block

Notes: Returns the csid of the blob record. Use the query parameter 'blobUri' to set a URI path to the blob file/document. This operation also has the side-effect of relating the media record with csid to the newly created blob record.

...

1. Get an existing media record.

GET to "/media/{csid}"
Code Block

Notes: Returns the media record corresponding to passed in csid. Also, if there is a related blob record, it returns a set of URL's -pointing to the original media data and any derivatives.

2. Get an existing blob record from the Media service.

GET to "/media/{csid}/blob"
Code Block

Notes: Returns the blob record corresponding to the media record's csid. Also, it returns a set of URL's -pointing to the original media data and any existing derivatives.

3. Get an existing blob's data content (actual bits) from the Media service.

Code Block
GET to "/media/{csid}/blob/content"

Notes: Returns the blob data content corresponding to the media record's csid

4. Get the blob content's raw metadata.

GET to "/media/{csid}/blob/content/metadata"
Code Block

Notes: Returns the full set of raw metadata that exists for the blob's content -for example, EXIF metadata for images.

5. Get an existing blob's derivatives.

GET to "/media/{csid}/blob/derivatives"
Code Block

Notes: Returns a list of a blob derivatives corresponding to the blob record's csid -each existing derivative will be uniquely identified with a derivative term -see the description of derivative terms at the top of this page. The result payload will also include a URL to each derivative's data bits.

6. Get a specific derivative from an existing blob's derivatives.

GET to "/media/{csid}/blob/derivatives/{derivative_term}"
Code Block

Notes: Returns what is essentially a "blob record" for the specified blob derivative. Initially, the derivative term will be one of a small set of controlled terms -i.e., 'thumbnail', 'small', 'medium', etc. Derivative terms will be defined in a CollectionSpace configuration file.

7. Get a specific derivative's content from an existing blob's derivatives.

GET to "/media/{csid}/blob/derivatives/{derivative_term}/content"
Code Block

Notes: Returns the derivative's content data.

8. Get a specific derivative content's raw metadata.

Code Block
GET to "/media/{csid}/blob/derivatives/{derivative_term}/content/metadata"

Notes: Returns the full set of raw metadata that exists for the derivative's content.

...

1. Update an existing media record.

PUT to "/media/{csid}" with MIME=application/xml
Code Block

Notes: Returns the csid of the schema record.

2. Update an existing schema record AND blob record - Option #1

Code Block
PUT to "/media/{csid}/blob" with MIME=application/xml

Notes: The payload must include a 'blobUri' parameter that is set to a valid and accessible URI.

...

3. Update an existing media record and blob record - Option #2

PUT to "/media/{csid}/blob" with MIME=multipart/form-data
Code Block

Notes: This update will create a new blob record from the embedded file/document include in the POST request. It will relate the new blob record to the media record that has an ID equal to csid. Any existing relationship that the media record has with another blob will be lost.

...