Changes between Version 9 and Version 10 of VirtualCollectionRegistry


Ignore:
Timestamp:
08/25/14 14:06:41 (10 years ago)
Author:
Twan Goosen
Comment:

REST service

Legend:

Unmodified
Added
Removed
Modified
  • VirtualCollectionRegistry

    v9 v10  
    6060The ''!DataStore'' is primarily used in the '''service''' implemented by the ''!VirtualCollectionRegistry'' class, which provides high level CRUD methods, using the ''!VirtualCollection'' model class for the representation of individual collections. These methods are used by the REST service, OAI provider and Wicket application classes to access and manipulate the stored collections.
    6161
    62 The '''Spring framework''' is used to define '''beans''' for singleton service objects, which are injected into various components throughout the application. The [source:/VirtualCollectionRegistry/trunk/VirtualCollectionRegistry/src/main/webapp/WEB-INF/applicationContext.xml applicationContext.xml] file bootstraps the bean definition, while most beans are discovered en constructed by means of 'component scanning'. For example, a singleton bean for ''!DataStore'' exists because it is annotated ''@Repository''. The instance is made available in the ''!VirtualCollectionRegistry'' and''Application'' (for the Wicket UI) instances because both are managed by Spring too (annotated with ''@Service'' and ''@Component'' respectively) and contain a ''!DataStore'' field annotated with ''@Autowired''.
     62The '''Spring framework''' is used to define '''beans''' for singleton service objects, which are injected into various components throughout the application. The [source:/VirtualCollectionRegistry/trunk/VirtualCollectionRegistry/src/main/webapp/WEB-INF/applicationContext.xml applicationContext.xml] file bootstraps the bean definition, while most beans are discovered en constructed by means of 'component scanning'. For example, a singleton bean for ''!DataStore'' exists because it is annotated ''@Repository''. The instance is made available in the ''!VirtualCollectionRegistry'' and ''Application'' (for the Wicket UI) instances because both are managed by Spring too (annotated with ''@Service'' and ''@Component'' respectively) and contain a ''!DataStore'' field annotated with ''@Autowired''.
     63
     64A number of core services for marshalling, validation, etcetera can be found in ''eu.clarin.cmdi.virtualcollectionregistry.service'' package (generally interfaces with implementations in the .impl subpackage).
     65
     66{{{#!comment
     67Query language
     68}}}
    6369
    6470More info:
     
    6975==== JAX-RS REST service ====
    7076
    71 Jersey
     77The package ''eu.clarin.cmdi.virtualcollectionregistry.rest'' defines a RESTful web service by means of JAX-RS annotations. It uses Jersey as an implementation and depends on a number of Jersey extensions, primarily injection of beans. Four classes define the following (sub)resources:
     78* /virtualcollections (class ''!VirtualCollectionsResource'') allows listing (GET) of published collections and POSTing of new collections
     79 * /virtualcollections/{id} (class ''!VirtualCollectionResource'') is a subresource that allows GETting, PUTting and DELETEing individual collections
     80* /my-virtualcollections (class ''!MyVirtualCollectionsResource'') only allows retrieval (GET) the list of private and published collections owned by the authenticated user
     81* / (class ''!BaseResource'') is a dummy resource that renders an informative HTML page (if content negotiation allows) about the service
     82
     83Two ''!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 rendering 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.
     84
     85More info:
     86* [https://jersey.java.net/documentation/latest/jaxrs-resources.html JAX-RS resources documentation from Jersey]
     87* [https://jersey.java.net/documentation/latest/message-body-workers.html information on custom body providers from Jersey]
    7288
    7389==== Wicket application (UI) ====