Even more fixes for RDA import
This commit is contained in:
parent
644976be29
commit
4d91f0c7af
|
@ -7,15 +7,8 @@ import java.util.Date;
|
|||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import com.fasterxml.jackson.annotation.JsonAnyGetter;
|
||||
import com.fasterxml.jackson.annotation.JsonAnySetter;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
|
||||
import com.fasterxml.jackson.annotation.*;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -24,6 +17,7 @@ import com.fasterxml.jackson.annotation.JsonValue;
|
|||
*
|
||||
*
|
||||
*/
|
||||
@JsonIgnoreProperties(value = { "schema" })
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@JsonPropertyOrder({
|
||||
"contact",
|
||||
|
|
|
@ -160,7 +160,7 @@ public class DatasetRDAMapper {
|
|||
}
|
||||
|
||||
List<JsonNode> languageNodes = JsonSearcher.findNodes(datasetDescriptionObj, "rdaProperty", "dataset.language");
|
||||
if (!languageNodes.isEmpty()) {
|
||||
if (!languageNodes.isEmpty() && rda.getLanguage() != null) {
|
||||
properties.put(languageNodes.get(0).get("id").asText(), rda.getLanguage().value());
|
||||
}
|
||||
|
||||
|
|
|
@ -145,22 +145,33 @@ public class DistributionRDAMapper {
|
|||
properties.put(distributionNode.get("id").asText(), rda.getAvailableUntil());
|
||||
break;
|
||||
case DOWNLOAD_URL:
|
||||
properties.put(distributionNode.get("id").asText(), rda.getDownloadUrl().toString());
|
||||
if (rda.getDownloadUrl() != null) {
|
||||
properties.put(distributionNode.get("id").asText(), rda.getDownloadUrl().toString());
|
||||
}
|
||||
break;
|
||||
case DATA_ACCESS:
|
||||
properties.put(distributionNode.get("id").asText(), rda.getDataAccess().value());
|
||||
break;
|
||||
case BYTE_SIZE:
|
||||
properties.put(distributionNode.get("id").asText(), rda.getByteSize().toString());
|
||||
if (rda.getByteSize() != null) {
|
||||
properties.put(distributionNode.get("id").asText(), rda.getByteSize().toString());
|
||||
}
|
||||
break;
|
||||
case FORMAT:
|
||||
properties.put(distributionNode.get("id").asText(), rda.getFormat().get(0));
|
||||
if (rda.getFormat() != null && !rda.getFormat().isEmpty()) {
|
||||
properties.put(distributionNode.get("id").asText(), rda.getFormat().get(0));
|
||||
}
|
||||
break;
|
||||
case LICENSE:
|
||||
properties.putAll(LicenseRDAMapper.toProperties(rda.getLicense().get(0), root));
|
||||
if (rda.getLicense() != null && !rda.getLicense().isEmpty()) {
|
||||
properties.putAll(LicenseRDAMapper.toProperties(rda.getLicense().get(0), root));
|
||||
}
|
||||
break;
|
||||
case HOST:
|
||||
properties.putAll(HostRDAMapper.toProperties(rda.getHost()));
|
||||
if (rda.getHost() != null) {
|
||||
properties.putAll(HostRDAMapper.toProperties(rda.getHost()));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -72,7 +72,9 @@ public class LicenseRDAMapper {
|
|||
if (licenseNode.get("rdaProperty").asText().endsWith(licenceProperty.getName())) {
|
||||
switch (licenceProperty) {
|
||||
case LICENSE_REF:
|
||||
properties.put(licenseNode.get("id").asText(), rda.getLicenseRef().toString());
|
||||
if (rda.getLicenseRef() != null) {
|
||||
properties.put(licenseNode.get("id").asText(), rda.getLicenseRef().toString());
|
||||
}
|
||||
break;
|
||||
case START_DATE:
|
||||
properties.put(licenseNode.get("id").asText(), rda.getStartDate());
|
||||
|
|
Loading…
Reference in New Issue