Curation tasks and helper scripts for the CGSpace institutional repository.
Go to file
Alan Orth e158e4bc98
CountryCodeTagger.java: Refactor adding of alpha2 codes
We can append the codes we will add to a List of Strings and then
actually apply them later in one addMetadata call, and update the
item with one item.update() call. This reduces identical code and
is more efficient.

Note that when testing this on a collection with thousands of items
I realized that it is really important to limit both the cache size
as well as set the database transaction model to be per object/item
or else you will crash due to Java heap issues. For example:

    $ ~/dspace/bin/dspace curate -t countrycodetagger -i 10568/3 -r - -l 500 -s object

See: https://wiki.lyrasis.org/display/DSPACE/Curation+Task+Cookbook
2020-08-02 18:33:32 +03:00
.idea Use gson 2.2.1 2020-08-01 20:21:25 +03:00
src/main CountryCodeTagger.java: Refactor adding of alpha2 codes 2020-08-02 18:33:32 +03:00
.gitignore Add .gitignore 2020-07-31 22:01:05 +03:00
COPYING Initial commit 2020-07-31 21:40:15 +03:00
README.md README.md: Add TODOs 2020-08-02 15:53:37 +03:00
dspace-curation-tasks.iml Use gson 2.2.1 2020-08-01 20:21:25 +03:00
pom.xml Use gson 2.2.1 2020-08-01 20:21:25 +03:00

README.md

DSpace Curation Tasks

Metadata curation tasks used on the CGSpace institutional repository:

  • CountryCodeTagger: tag items with appropriate country codes based on their existing country metadata

Tested on DSpace 5.8. Read more about the DSpace curation system.

Notes

This project was initially created according to the Maven Getting Started Guide:

$ mvn -B archetype:generate -DgroupId=org.cgiar.cgspace.ctasks -DartifactId=dspace-curation-tasks -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=1.4

Todo

  • Integrate with main DSpace build
  • Make sure this doesn't work on items in the workflow
  • Port to DSpace 6
    • Remember to bump Gson version!
  • Check for existence of metadata field before trying to add metadata
  • Add tests

License

This work is licensed under the GPLv3.

This repository contains data from the Debian iso-codes project project, which is licensed under the GNU Lesser General Public License v2.1.