DSpace/DSpace — pull request #323 by peterdietz (2013-10-07 21:57:44+00:00)
Title: [DS-1657] DSpace REST API built in JERSEY

I have built a REST-API for DSpace, built using JAX-RS1 (JERSEY).

[DS-1657 Request for Official DSpace REST API](https://jira.duraspace.org/browse/DS-1657)

* It is READ-ONLY
* Respects DSpace Authorization
* Only lists or shows objects that anonymous user has READ access to.
* Hides hidden metadata from Items, i.e. provenance
* Should support either DB

It has support for endpoints:
* / - Index of Endpoints
* /communities - Community (list and specific)
* /collections - Collection (list and specific)
* /items - Item (specific)
* /items - Bitstream (specific, and specific retrieve)
* /handle - Handles (can look up a handle to see the internal ID)

It gives responses in JSON, XML, and for a rare-few HTML. (Set your Accept header accordingly)
In testing I have had: ```Accept: application/xml;q=0.5,application/json;q=0.6```, and tweaked preferences to get different response.

## Whats missing?
* Pagination
* Access /community/handle/{prefix}/{suffix}
* Search
* root-level Item list
* root-level Bitstream list
* Expand is not complete for Item / Bitstream
* Going from an object to its Parent is not consistently implemented
* No way to login or authenticate as a specified user
* Can't recursively view every sub-sub-resource of a resource, you can see its direct children.

## What are the surprises?
* If you don't have READ access to an object it does not show up in list
* Looking up a handle does not give you EVERYTHING about that object, but gives you some data, and link to get more data.
* Every object has a "link", a very weak attempt at HATEOS, you can always just to children/parent objects
* Items have metadata array, that has field key and field value.
* I have for some reason touched a few core dspace-api classes to add some sugar. This is certainly unnecessary, I felt as though they might be the place to put them.
* Item metadata is using the deprecated DCValue[], which I saw no alternative to.
* The link to an object type is using a pluralizer of that type, i.e. item -> items.

This is all in [dspace-source]/dspace-rest.

As this is still code that is being improved from time-to-time, feel free to review, give feedback, or fix it yourself.