Skip to content
Branch: master
Find file History
Latest commit c17c15f Jul 18, 2019
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
src Merge pull request #2442 from atmire/DS-4266-bitstream-format-crud Jul 18, 2019
README.md Add item, collection, community to rest7 Mar 2, 2017
pom.xml Merge pull request #2265 from tdonohue/one_webapp_backend_redux May 21, 2019

README.md

DSpace7 REST Webapp

This is the new REST webapp for DSpace 7 build with Spring MVC + HATEOAS with a focus on the JSON HAL format (formal specification)

This webapp uses the following technologies:

Please note that we don't use Spring Data REST but we mimic as much as possible its architecture and behaviour. We don't use Spring Data REST as we haven't a spring data layer and we want to provide clear separation between the persistence representation and the REST representation

How to contribute

Check the infomation available on the DSpace Official Wiki page for the DSpace 7 Working Group

DSpace 7 REST: Coding DSpace Objects

How to run

The only tested way right now is to run this webapp inside your IDE (Eclipse). Just create a new Tomcat 8 server and deploy the dspace-spring-rest maven module to it.

The dspace.dir is configured in the dspace-spring-rest/src/main/resources/application.properties file currently

dspace.dir = d:/install/dspace7

HAL Browser

The modified version of the HAL Browser from the Spring Data REST project is included, the index.html file is overriden locally to support the /api baseURL (see DATAREST-971)

Packages and main classes

org.dspace.app.rest.Application is the spring boot main class it initializes

  • the DSpace kernel
  • the dspaceContextListener
  • the DSpaceWebappServletFilter
  • the dspaceRequestContextFilter
  • a custom HAL RelProvider for dspace

org.dspace.app.rest.RestResourceController is the controller responsible to handle all the REST requests (so far) delegating the execution to the right repository depending on the requested resource (REST entity)

org.dspace.app.rest.model is the package where to put all the classes representing DSpace REST resource. The classes should be named with the name of the DSpace perstent class mainly exposed + the Rest suffix (i.e. ItemRest, CollectionRest, etc.)

org.dspace.app.rest.model.hateoas contains the classes specific of the HAL implementation. The most important class is org.dspace.app.rest.model.hateoas.DSpaceResource that wrap a DSpaceRest object adding the support for the links and embedded resources

org.dspace.app.rest.repository contains the implementation of the Repository Design pattern for the Rest Objects

org.dspace.app.rest.converter contains the converters from/to DSpace persistent entities (Item, Collection, etc.) to their equivalent REST object (ItemRest, CollectionRest, etc.)

You can’t perform that action at this time.