Changes between Version 32 and Version 33 of VirtualCollectionRegistry
- Timestamp:
- 12/10/15 14:18:07 (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
VirtualCollectionRegistry
v32 v33 102 102 103 103 The package ''eu.clarin.cmdi.virtualcollectionregistry.rest'' defines a RESTful web service by means of JAX-RS annotations. It uses [[https://jersey.java.net/ Jersey]] as an implementation and depends on a number of Jersey extensions, primarily injection of beans. Four classes define the following '''(sub)resources''': 104 * /virtualcollections(class ''!VirtualCollectionsResource'') allows listing (GET) of published collections and POSTing of new collections105 * /virtualcollections/{id}(class ''!VirtualCollectionResource'') is a subresource that allows GETting, PUTting and DELETEing individual collections106 * /my-virtualcollections(class ''!MyVirtualCollectionsResource'') only allows retrieval (GET) the list of private and published collections owned by the authenticated user107 * /(class ''!BaseResource'') is a dummy resource that renders an informative HTML page (if content negotiation allows) about the service104 * [http://clarin.ids-mannheim.de/vcr/service/virtualcollections /virtualcollections] (class ''!VirtualCollectionsResource'') allows listing (GET) of published collections and POSTing of new collections 105 * [http://clarin.ids-mannheim.de/vcr/service/virtualcollections/1001.xml /virtualcollections/{id}] (class ''!VirtualCollectionResource'') is a subresource that allows GETting, PUTting and DELETEing individual collections 106 * [http://clarin.ids-mannheim.de/vcr/service/my-virtualcollections /my-virtualcollections] (class ''!MyVirtualCollectionsResource'') only allows retrieval (GET) the list of private and published collections owned by the authenticated user 107 * [http://clarin.ids-mannheim.de/vcr/service/ /] (class ''!BaseResource'') is a dummy resource that renders an informative HTML page (if content negotiation allows) about the service 108 108 109 109 Two ''!BodyWriter'' classes are implemented and registered, taking care of the '''rendering''' of !VirtualCollection object as CMDI or XML/JSON respectively, by means of different methods of the (injected) ''!VirtualCollectionMarshaller'' service. This way, a single method in ''!VirtualCollectionResource'' can handle these various serialisation options (depending on the HTTP Accept header in the client request). An additional method handles requests accepting HTML by returning a redirect ('see other') response pointing to the collection details page of the Wicket UI. 110 111 A specific format can be requested, overriding any content negotiation, by appending the format identifier to the URL, e.g. [http://clarin.ids-mannheim.de/vcr/service/virtualcollections/1001.xml virtualcollections/1001.xml]. 110 112 111 113 The '''CMDI output''' is generated by marshalling instances of the classes generated by the JAX-B Maven plugin at build time (XJC), based on the [http://catalog.clarin.eu/ds/ComponentRegistry/rest/registry/profiles/clarin.eu:cr1:p_1404130561238/xsd VirtualCollection profile schema], a copy of which is included in the sources.