Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

If your REST API is publicly accessible, deploy the reports with anonymous access and consider providing an authorization token for access to the report calls.

Code Block
titleConfigure Authorization for REST Reports
# Enable/disable authorization for the reporting tools.
# By default, the DSpace REST API will only return communities/collections/items that are accessible to a particular user.
# If the REST API has been deployed in a protected manner, the reporting tools can be configured to bypass authorization checks.
# This will allow all items/collections/communities to be returned to the report user.
# Set the rest-reporting-authenticate option to false to bypass authorization
rest-reporting-authenticate = false

Configure the REST Reports that can be requested by name

Code Block
# Configure the report pages that can be requested by name
# Create a map of named reports that are available to a report tool user
# Each map entry should be prefixed with rest-report-url 
#   The map key is a name for a report
#   The map value is a URL to a report page
# A list of available reports will be available with the call /rest/reports.
# If a request is sent to /rest/reports/[report key], the request will be re-directed to the specified URL
# 
# This project currently contains 2 sample reports.  Eventually, additional reports could be introduced through this mechanism.
rest-report-url.collections = ../static/rest/index.html
rest-report-url.item-query = ../static/rest/query.html

Configure the database-specific format for a regex expression

Code Block
# The REST Report Tools may pass a regular expression test to the database.  
# The following configuration setting will construct a SQL regular expression test appropriate to your database engine
rest-regex-clause = text_value ~ ?

Configure the sets of filters of interest to your repository managers

Code Block
# A filter contains a set of tests that will be applied to an item to determine its inclusion in a particular report.
# Private items and withdrawn items are frequently excluded from DSpace reports.
# Additional filters can be configured to examine other item properties.
# For instance, items containing an image bitstream often have different requirements from a item containing a PDF.
# The DSpace REST reports come with a variety of filters that examine item properties, item bitstream properties, 
# and item authorization policies.  The existing filters can be used as an example to construct institution specific filters
# that will test conformity to a set of institutional policies.
# plugin.sequence.org.dspace.rest.filter points to a list of classes that contain available filters.  
# Each class must implement the ItemFilterList interface.
#   ItemFilterDefs:     Filters that examine simple item and bitstream type properties
#   ItemFilterDefsMisc: Filters that examine bitstream mime types and dependencies between bitstreams
#   ItemFilterDefsMeta: Filters that examine metadata properties
#   ItemFilterDefsPerm: Filters that examine item and bitstream authorization policies
plugin.sequence.org.dspace.rest.filter.ItemFilterList = \
        org.dspace.rest.filter.ItemFilterDefs,\
        org.dspace.rest.filter.ItemFilterDefsMisc,\
        org.dspace.rest.filter.ItemFilterDefsPerm

#     org.dspace.rest.filter.ItemFilterDefsMeta,\

Other filter configuration settings

The configuration file contains other settings that will control the behavior of the filters that you have enabled.

Enabling Sort-able Report Tables

 *

  1. Install sortable.js http://www.kryogenix.org/code/browser/sorttable/

...

  1. Add to /dspace/modules/rest/src/main/webapp/static/reports

...

  1. Include sortable.js in index.html and query.html

    Code Block
    languagexml
    titleUncomment the following in index.html and query.html
    <!-- <script src="sorttable.js"></script> -->
  2. Enable sortable in the report code in restCollReport.js and restQueryReport.js

    Code Block
    languagejs
    titleCHANGE
    var CollReport = function() {
        Report.call(this);
        //If sortable.js is included, uncomment the following
        //this.hasSorttable = function(){return true;}
    
    var QueryReport = function() {
        Report.call(this);
        //If sortable.js is included, uncomment the following
        //this.hasSorttable = function(){return true;}
    Code Block
    languagejs
    titleCHANGE TO
    var CollReport = function() {
        Report.call(this);
        //If sortable.js is included, uncomment the following
        this.hasSorttable = function(){return true;}
    
    var QueryReport = function() {
        Report.call(this);
        //If sortable.js is included, uncomment the following
        this.hasSorttable = function(){return true;}

 

Installing in DSpace 5

This feature is not a part of the DSpace 5 code base.See

  1. Install https://github.com/DSpace/DSpace/pull/1062

    1. This code also exists at https://github.com/Georgetown-University-Libraries/DSpace/tree/rest-reports-for-5_x

  2. Change the following code into restCollReport.js and restQuery.js to pull the correct id for each DSpace Object

...

  1. Code Block
    languagejs
    titleChange the following in restCollReport.js and restQuery.js

...

  1. var CollReport = function() {

...

  1. 
    Report.call(this);

...

  1. 
    var QueryReport = function() {

...

  1. 
    Report.call(this);
    Code Block
    languagejs
    titleChange TO
    var CollReport = function() {

...

  1. 
    Report.call(this);

...

  1. 
    this.getId = function(obj) {

...

  1. return obj.id;}

...

  1. 
    var QueryReport = function() {

...

  1. 
    Report.call(this);

...

  1. 
    this.getId = function(obj) {

...

  1. return obj.id;}

...