...
- Install sortable.js http://www.kryogenix.org/code/browser/sorttable/
- Add to /dspace/modules/rest/src/main/webapp/static/reports
Include sortable.js in index.html and query.html
Code Block |
---|
language | xml |
---|
title | Uncomment the following in index.html and query.html |
---|
|
<!-- <script src="sorttable.js"></script> --> |
Enable sortable in the report code in restCollReport.js and restQueryReport.js
Code Block |
---|
|
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 |
---|
|
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;} |
Troubleshooting
The report tools allow a user to export query results as a CSV file that can be input with the Bulk Metadata Update tool.
If your repository has *unintentionally* tagged metadata fields with language codes, you may need want to normalize the language values in use.
Code Block |
---|
title | Inconsistent use of language code |
---|
|
id,collection,subject[en],subject[en_us],subject[en_US]
111-222-333,123456789/1,cat,,
111-222-333,123456789/2,,dog,
111-222-333,123456789/3,,,bird |
Normalized View
Code Block |
---|
title | Inconsistent use of language code |
---|
|
id,collection,subject[en]
111-222-333,123456789/1,cat
111-222-333,123456789/2,dog
111-222-333,123456789/3,bird |
The following SQL might be helpful in this instance.
Code Block |
---|
title | Sample SQL to Normalize Language - Use with Caution |
---|
|
update metadatavalue set text_lang='en'
where text_lang is null and dspace_object_id in (select uuid from item);
update metadatavalue set text_lang='en'
where text_lang in ('','en_US', 'en-US','en_us')
and dspace_object_id in (select uuid from item); |
Installing in DSpace 5
This feature is not a part of the DSpace 5 code base. Please see the following notes to enable a DSpace 5 compatible version of these reports.
...