Git Product home page Git Product logo

dspace-rest's Introduction

A Read Only RESTful API for DSpace

This forks, refactors and backports the original DSpace REST API

For the most part, features have been fixed or cleanly removed.

Please note that allowing use of some of the end points retained from the original design may be unwise.

End Points

Covered Well By Integration Tests
GETPUTPOSTDELETE
items
bitstream
collections
communities
search
harvest
Light Or No Integration Tests
GETPUTPOSTDELETE
users
groups
stats

PostgreSQL only.

First time, run create_integration_test_db.sh.

Then mvn -DskipTests=false

A fork of DSpace 1.5.2

In particular, to ItemIterator add

public void skip() throws SQLException {
    if (itemRows.hasNext())
    {
        itemRows.next();
    }
}

(to support pagination).

  • Problem — rich data slow to produce and consume
  • Cause — no fine control over richness of data
  • Solution — fetch groups
  • Implementation — optional fetch parameter
Supported Fetch Groups
lightdisplayexample
items/items/5.json?fetch=display
search [items]/search.json?query=search.resourcetype:2&fetch=light
communities/communities/25.json?fetch=light
collections/x/items/collections/1/items.json?fetch=light
  • Problem — too much data using too many resources to produce and consume
  • Cause — inefficient and absent pagination code
  • Solution — push pagination into data access and pagination more end points
Supported Pagination
pageperpagesortexample
search [items]/search.json?query=search.resourcetype:2&_page=2&_perpage=20
collections/x/items/collections/1/items.json?_page=2

Hard coded limit (10000) for the maximum number of items that can be rendered to JSON.

Known Limitations

  • Binder does not stream. Given adequate memory for the required concurrent volume, this shouldn't be an issue. Switching to a streaming binder probably requires replacing Sakai.
  • Entity bus obscures design. Dropping Sakai would allow simplification.
  • Refactoring incomplete. Still difficult to work with the code base.
  • Each new fetch group requires at least one new class. Moving away from Sakai would allow more flexible binding.
  • Sorting needs to be supported in DSpace. This would mean either substantial changes to core DSpace or switching to a more flexible data access standard (for example JPA).
  • Fetch group and pagination added on an ad hoc basis. Code will need to be added for unsupported areas.
  • No support for writing. Those needing write support might route GET here and PUT, DELETE and POST to the original code. Note when reading and writing are mixed in the same security domain, care MUST be taken to limit vulnerability to scripts uploaded as repository content.
  • Allowing access to some end points may not be sensible in production. Given a reasonable volume of repository data, allowing (unpaginated) access may effective deny service. Those willing to break compatibility should consider preventing unsafe calls.
  • Areas of the original specification are not particularly RESTful. Those willing to break compatibility should consider adding RESTful linking and pagination.
  • Exception handling has been improved but more work remains.
  • Some regression tests rely on database order, and may be fragile.
  • Repackaging incomplete. This is a logical fork, and packaging should reflect this.
  • Build script not yet updated. This is a logical fork, and maven packaging should reflect this.
  • This module builds against a fork of DSpace 1.5.2.
    • A multi-module project would allow support for multiple versions.
    • Some changes need to be fed back into core or a public fork created.
  • The hard limit:
    • is applied only to items, and
    • is not configurable.
  • Cache header support poor. Ideally DSpace would expose a feed allowing upstream caches to be invalidated when data changes.

dspace-rest's People

Contributors

asehra avatar ottenhoff avatar workmad3 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dspace-rest's Issues

SearchResultsInfoEntity compilation failure

[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure
/dspace-1_8_x/dspace-rest-hedtek/src/main/java/org/dspace/rest/providers/SearchProvider.java:[99,15] cannot find symbol
symbol : constructor SearchResultsInfoEntity(int,java.util.List<java.lang.Integer>,java.util.List<java.lang.String>,java.util.List<java.lang.Integer>)
location: class org.dspace.rest.entities.SearchResultsInfoEntity

Avoid forking DSpace API

Modifying ItemIterator.java to add a skip() method seems unnecessary and increases the difficulty for deployers of this code.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.