Compare commits

...

4 Commits

Author SHA1 Message Date
Alan Orth 9faf657c59
Bump version to 7.6-SNAPSHOT 2024-01-02 19:54:46 +03:00
Alan Orth 7fb78c2722
src/main/java: minor refactoring
Suggested by IntelliJ.
2024-01-02 19:34:51 +03:00
Alan Orth 6ef9f521bf
src/main/resources: fix trailing comma in JSON 2024-01-02 18:03:52 +03:00
Alan Orth 1a345de36a
pom.xml: fix missing Handle jar
It seems Handle jars are not published on Maven Central so we get
this error while packaging:

    [ERROR] Failed to execute goal on project cgspace-java-helpers: Could not resolve dependencies for project io.github.ilri.cgspace:cgspace-java-helpers:jar:7.6-SNAPSHOT: net.handle:handle:jar:9.3.0 was not found in https://repo.maven.apache.org/maven2 during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]

This is probably related to DSpace 7.x using a vanilla Handle jar
instead of the customized one.
2024-01-02 16:56:43 +03:00
8 changed files with 39 additions and 24 deletions

View File

@ -4,9 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## Unreleased
## [7.6] - 2024-01-02
### Updated
- `iso_3166-1.json` from iso-codes 4.13.0-SNAPSHOT, which [adds common names for Iran, Laos, and Syria](https://salsa.debian.org/iso-codes-team/iso-codes/-/merge_requests/32)
- DSpace 7.6 compatibility
## [6.2] - 2023-02-20
### Updated

View File

@ -5,7 +5,7 @@ DSpace curation tasks and other Java-based helpers used on the [CGSpace](https:/
- **FixJpgJpgThumbnails**: fix low-quality ".jpg.jpg" thumbnails by replacing them with their originals
- **FixLowQualityThumbnails**: remove low-quality thumbnails when PDF bitstreams are present
Tested on DSpace 6.3. Read more about the [DSpace curation system](https://wiki.lyrasis.org/display/DSDOC6x/Curation+System).
Tested on DSpace 7.6. Read more about the [DSpace curation system](https://wiki.lyrasis.org/display/DSDOC7x/Curation+System).
## Build and Install
@ -16,7 +16,7 @@ To use these curation tasks in a DSpace project add the following dependency to
<dependency>
<groupId>io.github.ilri.cgspace</groupId>
<artifactId>cgspace-java-helpers</artifactId>
<version>6.2-SNAPSHOT</version>
<version>7.6-SNAPSHOT</version>
</dependency>
```
@ -32,7 +32,7 @@ $ mvn package
Copy the resulting jar to the DSpace `lib` directory:
```console
$ cp target/cgspace-java-helpers-6.2-SNAPSHOT.jar ~/dspace/lib/
$ cp target/cgspace-java-helpers-7.6-SNAPSHOT.jar ~/dspace/lib/
```
## Configuration

15
pom.xml
View File

@ -6,7 +6,7 @@
<groupId>io.github.ilri.cgspace</groupId>
<artifactId>cgspace-java-helpers</artifactId>
<version>6.2-SNAPSHOT</version>
<version>7.6-SNAPSHOT</version>
<name>cgspace-java-helpers</name>
<url>https://github.com/ilri/cgspace-java-helpers</url>
@ -108,4 +108,17 @@
</plugins>
</pluginManagement>
</build>
<repositories>
<!-- Check Maven Central first (before other repos below) -->
<repository>
<id>maven-central</id>
<url>https://repo.maven.apache.org/maven2</url>
</repository>
<!-- For Handle Server -->
<repository>
<id>handle.net</id>
<url>https://handle.net/maven</url>
</repository>
</repositories>
</project>

View File

@ -10,14 +10,14 @@ import javax.annotation.Nullable;
public class CountriesVocabulary {
class Country {
private String name; // required
private String common_name; // optional
private String official_name; // optional
private String cgspace_name; // optional
private String numeric; // required Hmmmm need to cast this...
private String alpha_2; // required
private String alpha_3; // required
static class Country {
private final String name; // required
private final String common_name; // optional
private final String official_name; // optional
private final String cgspace_name; // optional
private final String numeric; // required Hmmmm need to cast this...
private final String alpha_2; // required
private final String alpha_3; // required
public Country(
String name,

View File

@ -24,6 +24,7 @@ import java.io.InputStreamReader;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
public class CountryCodeTagger extends AbstractCurationTask {
public class CountryCodeTaggerConfig {
@ -37,7 +38,7 @@ public class CountryCodeTagger extends AbstractCurationTask {
private final Logger log = LogManager.getLogger();
}
public class CountryCodeTaggerResult {
public static class CountryCodeTaggerResult {
private int status = Curator.CURATE_UNSET;
private String result = null;
@ -102,7 +103,7 @@ public class CountryCodeTagger extends AbstractCurationTask {
BufferedReader reader =
new BufferedReader(
new InputStreamReader(
this.getClass().getResourceAsStream(config.isocodesJsonPath)));
Objects.requireNonNull(this.getClass().getResourceAsStream(config.isocodesJsonPath))));
ISO3166CountriesVocabulary isocodesCountriesJson =
gson.fromJson(reader, ISO3166CountriesVocabulary.class);
reader.close();
@ -110,8 +111,8 @@ public class CountryCodeTagger extends AbstractCurationTask {
reader =
new BufferedReader(
new InputStreamReader(
this.getClass()
.getResourceAsStream(config.cgspaceCountriesJsonPath)));
Objects.requireNonNull(this.getClass()
.getResourceAsStream(config.cgspaceCountriesJsonPath))));
CGSpaceCountriesVocabulary cgspaceCountriesJson =
gson.fromJson(reader, CGSpaceCountriesVocabulary.class);
reader.close();

View File

@ -3,7 +3,7 @@ DSpace curation tasks used on the [CGSpace](https://cgspace.cgiar.org) instituti
- **CountryCodeTagger**: add ISO 3166-1 Alpha2 country codes to items based on their existing country metadata
Tested on DSpace 6.3. Read more about the [DSpace curation system](https://wiki.lyrasis.org/display/DSDOC5x/Curation+System).
Tested on DSpace 7.6. Read more about the [DSpace curation system](https://wiki.lyrasis.org/display/DSDOC5x/Curation+System).
## Build and Install
@ -14,7 +14,7 @@ To use these curation tasks in a DSpace project add the following dependency to
<dependency>
<groupId>io.github.ilri.cgspace</groupId>
<artifactId>cgspace-java-helpers</artifactId>
<version>6.2-SNAPSHOT</version>
<version>7.6-SNAPSHOT</version>
</dependency>
```
@ -30,7 +30,7 @@ $ mvn package
Copy the resulting jar to the DSpace `lib` directory:
```
$ cp target/cgspace-java-helpers-6.2-SNAPSHOT.jar ~/dspace/lib/
$ cp target/cgspace-java-helpers-7.6-SNAPSHOT.jar ~/dspace/lib/
```
## Configuration

View File

@ -4,7 +4,7 @@ Java-based helpers used on the [CGSpace](https://cgspace.cgiar.org) institutiona
- **FixJpgJpgThumbnails**: fix low-quality ".jpg.jpg" thumbnails by replacing them with their originals
- **FixLowQualityThumbnails**: remove low-quality thumbnails when PDF bitstreams are present
Tested on DSpace 6.3. Read more about the [DSpace curation system](https://wiki.lyrasis.org/display/DSDOC6x/Curation+System).
Tested on DSpace 7.6. Read more about the [DSpace curation system](https://wiki.lyrasis.org/display/DSDOC6x/Curation+System).
## Build and Install
@ -15,7 +15,7 @@ To use these curation tasks in a DSpace project add the following dependency to
<dependency>
<groupId>io.github.ilri.cgspace</groupId>
<artifactId>cgspace-java-helpers</artifactId>
<version>6.2-SNAPSHOT</version>
<version>7.6-SNAPSHOT</version>
</dependency>
```
@ -31,7 +31,7 @@ $ mvn package
Copy the resulting jar to the DSpace `lib` directory:
```console
$ cp target/cgspace-java-helpers-6.2-SNAPSHOT.jar ~/dspace/lib/
$ cp target/cgspace-java-helpers-7.6-SNAPSHOT.jar ~/dspace/lib/
```
## Invocation

View File

@ -39,6 +39,6 @@
"name": "Russian Federation",
"cgspace_name": "Russia",
"numeric": "643"
},
}
]
}