ASL HTTP ContentAccess

From Gcube Wiki
Jump to: navigation, search

The ASL HTTP ContentAccess component is part of the HTTP Front End Framework and provides aggregated functionality for accessing gCube content. It follows the all the framework principles for data interchange formats, error handling, and context management, supporting both JSON and XML, using the common framework utilities for user authentication and HTTP error responses, supporting all authentication modes and following the suggested design patterns for scope management and session management as well as coding guidelines. The features provided are listed as follows:

retrieval of information about content

By submitting a GET request to ContentInfo servlet of the ContentAccess group of services, the client can retrieve information about the corresponding digital object. The information retrieved includes: the name, the mime type and the length and the id of the object.

{"OID":"b081dbc0-f877-11dd-8103-acc6e633ea9e","CID":"7f78c200-f877-11dd-8103-acc6e633ea9e","Name":"Cultured Aquatic Species Information Programme - Eriocheir sinensis -","MimeType":"text/uri-list","Length":142}
  • response example in XML:
<?xml version="1.0" encoding="UTF-8"?><ContentInfos><Name>Cultured Aquatic Species Information Programme - Eriocheir sinensis -</Name><ObjectId>b081dbc0-f877-11dd-8103-acc6e633ea9e</ObjectId><MimeType>text/uri-list</MimeType><Length>142</Length></ContentInfos>

retrieval of content (main document, metadata, annotations, alternative representations, parts)

A client is able to retrieve gCube content by submitting an HTTP GET request to the ContentViewer servlet of the ContentAccess set of services. Through the Content Viewer it is possible to retrieve content not only for main gCube documents but also for any other type of elements in the system, including annotations, metadata, parts and alternative representations. In case of none main documents, a supplement parameter must be added to the request, indicating the element type. The client can also optionally choose whether to save or not the content by using the "save" parameter. The content is rendered by the servlet with mime type, name and length information filled in the HTTP response.

Parameters needed: documentURI (mandatory), elementTypee (optional), scope (optional), responseType (xml/json, optional)

URL request example:

    • main document: localhost:8080/aslHttpContentAccess/ContentViewer?documentURI=cms://7f78c200-f877-11dd-8103-acc6e633ea9e/d5452ca0-f877-11dd-8103-acc6e633ea9e
    • alternative representation: localhost:8080/aslHttpContentAccess/ContentViewer?documentURI=cms://7f78c200-f877-11dd-8103-acc6e633ea9e/d5452ca0-f877-11dd-8103-acc6e633ea9e/d5843170-f877-11dd-8103-acc6e633ea9e&elementType=alternative

retrieval of thumbnails

There is the possibility to retrieve the thumbnail of a gCube document by submitting an HTTP GET request to the ThumbnailViewer servlet. The thumbnail is rendered and the content type of the object is returned in the HTTP response.

Parameters needed: documentURI, width, height, options, scope (optional), responseType (xml/json, optional)

URL request example: localhost:8080/aslHttpContentAccess/ContentViewer?documentURI=cms://7f78c200-f877-11dd-8103-acc6e633ea9e/d5452ca0-f877-11dd-8103-acc6e633ea9e&width=10&height=100&options=EQUAL