Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Add REST configuration and deployment

...

Another thing to note is that there are Query Parameters that you can tack on to the end of an endpoint to do extra things. The most commonly used one in this API is "?expand". Instead of every API call defaulting to giving you every possible piece of information about it, it only gives a most commonly used set by default and gives the more "expensive" information when you deliberately request it. Each endpoint will provide a list of available expands in the output, but for getting started, you can start with ?expand=all, to make the endpoint provide all of its information (parent objects, metadata, child objects). You can include multiple expands, such as: ?expand=collections,subCommunities .

Communities

Communities in DSpace are used for organization and hierarchy, and are containers that hold sub-Communities and Collections. (ex: Department of Engineering)

...

There was no central ProviderRegistry that you have to declare your path. Your free to use @annotations to get your code to respond to requests. There are helpful parameter helpers to extract parameters into Java variables.

Configuration for DSpace REST

You can configure if you want the DSpace REST to count views to a Community, Collection, Item or Bitstream as a Usage Event in the DSpace Statistics engines. Typically, when an object is viewed in a DSpace UI, that counts as a view or download, so that you can measure usage. If you would like views facilitated by the REST API to count, then configure the "stats" config to be true. To disable REST view's from counting in statistics, then set "stats" to false. 
In: dspace-source/dspace/config/modules/rest.cfg
# record stats in DSpace statistics module
stats = true
Recording of statistics for view of items or download of bitstreams (set stats = true in rest.cfg to enable stats recording) http://localhost:8080/rest/items/:ID?userIP=ip&userAgent=userAgent&xforwarderfor=xforwarderfor If no parameters are given the details of httprequest sender are used in statistics. This enables tools to record the details of their user rather than themselves.

Deploying the DSpace REST API in your Servlet Container

The dspace-rest module is automatically configured to compile and build with DSpace 4.0, so a mvn+ant process will create the webapp. To make it work in your environment, you would just need to add a context entry for it in your servlet container. For example, in tomcat, one might alter tomcat_home/conf/server.xml and add:

<Context path="/rest" docBase="/dspace/webapps/rest" allowLinking="true"/>

Additional Information

Additional information can be found in the README for dspace-rest, and in the GitHub Pull Request for DSpace REST (Jersey).

...