Project

General

Profile

Actions

CdmRestServices2 » History » Revision 7

« Previous | Revision 7/65 (diff) | Next »
Andreas Kohlbecker, 07/20/2009 03:22 PM


CDM REST Services 2.0

The CDM REST Services are a web based interface to resources stored in a CDM Community Server. The RESTful architecture allows accessing the various resources like Taxa, Names, References, Media, etc by stable URIs. Due to security constraints and to assure the integration of data, currently only read operations (= HTTP GET) are permitted, write operations will be available in the near future.

In contrast to the former CDM REST Services 1.0 the new architecture directly exposes domain model entities. Whereas the version 1.0 still was build using the DTO/Assembler pattern the new implementation provides direct serializations of the objects as they are stored in the CDM. Now there is no longer a difference between the data model used to store and manage CDM objects and another one used to transfer them to web based clients. Thereby it has become much easier to use the web service.

Content Negotiation

There are two ways to demand a special content type:

  1. by file extension (*.json or *.xml)

  2. by Accept HTTP request header - Accepted mime types are: application/json, text/xml

  3. Default: XML

The CDM REST Services 2.0 primarily trys using the file extension, then the Accept HTTP request header is taken into account. If wether the file extension or not the Accept HTTP request header specify valid content types the default XML will be used.

Developer Links

Classes involved in Content Negotiation:

Localization

  • Accept-Language

Character Encoding

All data is returned in UTF-8 character encoding.

The CDM REST Services architecture is functionally separated into multiple sections:

  • the API REST service which is a more-or-less one-to-one concordance between URIs and service api methods

  • the Portal REST Service which is specially taliored for the needs of dataportals.

  • .. ?

API REST service

e.g.

taxonService.get(UUID uuid)

and

GET /taxon/{uuid}

Following from that logic, the listing methods should work thus

taxonService.list(Class<? extends TaxonBase> clazz, Integer page, Integer limit, etc)

and the URI would be

GET /taxon?page=X&limit=Y&clazz=Z

Portal REST Service

Updated by Andreas Kohlbecker almost 15 years ago · 7 revisions