Merge pull request 'oai-harvester-1.0.5' (#1) from oai-harvester-1.0.5 into master

This commit is contained in:
Fabio Sinibaldi 2020-12-16 15:57:52 +01:00
commit 2123bf6fd2
3 changed files with 22 additions and 15 deletions

View File

@ -2,6 +2,9 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
# Changelog for org.gcube.data-publishing.gFeed.oai-pmh
## [1.0.5] - 2020-12-15
Do not stop on single repository error
## [1.0.4] - 2020-12-15
- Dependency management
- Naming Convention

View File

@ -2,14 +2,14 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.gcube.data-publishing.gFeed</groupId>
<artifactId>gFeed-Suite</artifactId>
<version>1.0.4</version>
</parent>
<parent>
<groupId>org.gcube.data-publishing.gFeed</groupId>
<artifactId>gFeed-Suite</artifactId>
<version>1.0.4</version>
</parent>
<artifactId>oai-harvester</artifactId>
<name>oai-harvester</name>
<version>1.0.4</version>
<version>1.0.5</version>
<scm>
<connection>scm:git:${gitBaseUrl}/gFeed</connection>
@ -38,13 +38,13 @@
<groupId>org.gcube.data-publishing.gFeed</groupId>
<artifactId>collectors-plugin-framework</artifactId>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-jackson</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>

View File

@ -27,12 +27,16 @@ public class OAICollector implements DataCollector<OAIRecord> {
AccessPoint point=epr.profile().accessPoints().asCollection().iterator().next();
String baseUrl=point.address();
log.debug("Address is "+baseUrl);
OAIClient client = new OAIClient(baseUrl);
point.properties().iterator().forEachRemaining((Property p)->{
if(p.name().equals("set"))
client.getSpecifiedSets().add(p.value());
});
toReturn.addAll(client.getAll(OAIClient.DC_METADATA_PREFIX));
try {
OAIClient client = new OAIClient(baseUrl);
point.properties().iterator().forEachRemaining((Property p)->{
if(p.name().equals("set"))
client.getSpecifiedSets().add(p.value());
});
toReturn.addAll(client.getAll(OAIClient.DC_METADATA_PREFIX));
}catch(Throwable t) {
log.warn("Unable to use repository "+epr.id()+" NAME : "+epr.profile().name(),t);
}
}
return toReturn;