partial implementation
This commit is contained in:
parent
d5b6c4e409
commit
b1580917f7
|
@ -34,7 +34,7 @@ import eu.dnetlib.app.directindex.mapping.OafMapper;
|
|||
import eu.dnetlib.app.directindex.service.DirectIndexService;
|
||||
import eu.dnetlib.app.directindex.solr.SolrIndexClient;
|
||||
import eu.dnetlib.app.directindex.solr.SolrIndexClientFactory;
|
||||
import eu.dnetlib.app.directindex.sword.model.SwordService;
|
||||
import eu.dnetlib.app.directindex.sword.model.SwordServiceDocument;
|
||||
import eu.dnetlib.app.directindex.sword.model.SwordStatusDocument;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
@ -55,7 +55,7 @@ public class SwordApiController {
|
|||
private String baseUrl;
|
||||
|
||||
@GetMapping("/")
|
||||
public SwordService getServiceDocument() {
|
||||
public SwordServiceDocument getServiceDocument() {
|
||||
// TODO
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
package eu.dnetlib.app.directindex.sword.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
public class SwordIdDescProperty {
|
||||
|
||||
@JsonProperty("@id")
|
||||
public String id;
|
||||
|
||||
public String description;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(final String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(final String description) {
|
||||
this.description = description;
|
||||
}
|
||||
}
|
|
@ -1,71 +1,80 @@
|
|||
package eu.dnetlib.app.directindex.sword.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class SwordService {
|
||||
|
||||
// @formatter:off
|
||||
@JsonProperty("id")
|
||||
public String id;
|
||||
|
||||
/*
|
||||
{
|
||||
"@context" : "https://swordapp.github.io/swordv3/swordv3.jsonld",
|
||||
@JsonProperty("dc:title")
|
||||
public String title;
|
||||
|
||||
"@id" : "http://example.com/service-document",
|
||||
"@type" : "ServiceDocument",
|
||||
@JsonProperty("dcterms:abstract")
|
||||
public String description;
|
||||
|
||||
"dc:title" : "Site Name",
|
||||
"dcterms:abstract" : "Site Description",
|
||||
public String root;
|
||||
public String parent;
|
||||
public boolean acceptDeposits;
|
||||
|
||||
"root" : "http://example.com/service-document",
|
||||
"acceptDeposits": true,
|
||||
public List<?> services;
|
||||
|
||||
"version": "http://purl.org/net/sword/3.0",
|
||||
"maxUploadSize" : 16777216000,
|
||||
"maxByReferenceSize" : 30000000000000000,
|
||||
"maxSegmentSize" : 16777216000,
|
||||
"minSegmentSize" : 1,
|
||||
"maxAssembledSize" : 30000000000000,
|
||||
"maxSegments" : 1000,
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
"accept" : ["* /*"],
|
||||
"acceptArchiveFormat" : ["application/zip"],
|
||||
"acceptPackaging" : ["*"],
|
||||
"acceptMetadata" : ["http://purl.org/net/sword/3.0/types/Metadata"],
|
||||
public void setId(final String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
"collectionPolicy" : {
|
||||
"@id" : "http://www.myorg.ac.uk/collectionpolicy",
|
||||
"description" : "...."
|
||||
},
|
||||
"treatment" : {
|
||||
"@id" : "http://www.myorg.ac.uk/treatment",
|
||||
"description" : "..."
|
||||
},
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
"staging" : "http://example.com/staging",
|
||||
"stagingMaxIdle" : 3600,
|
||||
public void setTitle(final String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
"byReferenceDeposit" : true,
|
||||
"onBehalfOf" : true,
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
"digest" : ["SHA-256", "SHA", "MD5"],
|
||||
"authentication": ["Basic", "OAuth", "Digest", "APIKey"],
|
||||
public void setDescription(final String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
"services" : [
|
||||
{
|
||||
"@id": "http://swordapp.org/deposit/43",
|
||||
public String getRoot() {
|
||||
return root;
|
||||
}
|
||||
|
||||
"dc:title" : "Deposit Service Name",
|
||||
"dcterms:abstract" : "Deposit Service Description",
|
||||
public void setRoot(final String root) {
|
||||
this.root = root;
|
||||
}
|
||||
|
||||
"root" : "http://example.com/service-document",
|
||||
"parent" : "http://example.com/service-document",
|
||||
"acceptDeposits": true,
|
||||
public String getParent() {
|
||||
return parent;
|
||||
}
|
||||
|
||||
"services" : []
|
||||
}
|
||||
]
|
||||
}
|
||||
public void setParent(final String parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
public boolean isAcceptDeposits() {
|
||||
return acceptDeposits;
|
||||
}
|
||||
|
||||
public void setAcceptDeposits(final boolean acceptDeposits) {
|
||||
this.acceptDeposits = acceptDeposits;
|
||||
}
|
||||
|
||||
public List<?> getServices() {
|
||||
return services;
|
||||
}
|
||||
|
||||
public void setServices(final List<?> services) {
|
||||
this.services = services;
|
||||
}
|
||||
|
||||
*/
|
||||
}
|
||||
|
|
|
@ -0,0 +1,309 @@
|
|||
package eu.dnetlib.app.directindex.sword.model;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class SwordServiceDocument {
|
||||
|
||||
@JsonProperty("@context")
|
||||
public final String context = "https://swordapp.github.io/swordv3/swordv3.jsonld";
|
||||
|
||||
@JsonProperty("@id")
|
||||
public String id;
|
||||
|
||||
@JsonProperty("@type")
|
||||
public final String type = "ServiceDocument";
|
||||
|
||||
@JsonProperty("dc:title")
|
||||
public String title;
|
||||
|
||||
@JsonProperty("dcterms:abstract")
|
||||
public String description;
|
||||
|
||||
public String root;
|
||||
public boolean acceptDeposits;
|
||||
public String version;
|
||||
public long maxUploadSize;
|
||||
public long maxByReferenceSize;
|
||||
public long maxSegmentSize;
|
||||
public int minSegmentSize;
|
||||
public long maxAssembledSize;
|
||||
public int maxSegments;
|
||||
public List<String> accept = Arrays.asList();
|
||||
public List<String> acceptArchiveFormat = Arrays.asList();
|
||||
public List<String> acceptPackaging = Arrays.asList();
|
||||
public List<String> acceptMetadata = Arrays.asList();
|
||||
public SwordIdDescProperty collectionPolicy;
|
||||
public SwordIdDescProperty treatment;
|
||||
public String staging;
|
||||
public int stagingMaxIdle;
|
||||
public boolean byReferenceDeposit;
|
||||
public boolean onBehalfOf;
|
||||
public final List<String> digest = Arrays.asList();
|
||||
public final List<String> authentication = Arrays.asList();
|
||||
public final List<SwordService> services = Arrays.asList();
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(final String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(final String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(final String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getRoot() {
|
||||
return root;
|
||||
}
|
||||
|
||||
public void setRoot(final String root) {
|
||||
this.root = root;
|
||||
}
|
||||
|
||||
public boolean isAcceptDeposits() {
|
||||
return acceptDeposits;
|
||||
}
|
||||
|
||||
public void setAcceptDeposits(final boolean acceptDeposits) {
|
||||
this.acceptDeposits = acceptDeposits;
|
||||
}
|
||||
|
||||
public String getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(final String version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public long getMaxUploadSize() {
|
||||
return maxUploadSize;
|
||||
}
|
||||
|
||||
public void setMaxUploadSize(final long maxUploadSize) {
|
||||
this.maxUploadSize = maxUploadSize;
|
||||
}
|
||||
|
||||
public long getMaxByReferenceSize() {
|
||||
return maxByReferenceSize;
|
||||
}
|
||||
|
||||
public void setMaxByReferenceSize(final long maxByReferenceSize) {
|
||||
this.maxByReferenceSize = maxByReferenceSize;
|
||||
}
|
||||
|
||||
public long getMaxSegmentSize() {
|
||||
return maxSegmentSize;
|
||||
}
|
||||
|
||||
public void setMaxSegmentSize(final long maxSegmentSize) {
|
||||
this.maxSegmentSize = maxSegmentSize;
|
||||
}
|
||||
|
||||
public int getMinSegmentSize() {
|
||||
return minSegmentSize;
|
||||
}
|
||||
|
||||
public void setMinSegmentSize(final int minSegmentSize) {
|
||||
this.minSegmentSize = minSegmentSize;
|
||||
}
|
||||
|
||||
public long getMaxAssembledSize() {
|
||||
return maxAssembledSize;
|
||||
}
|
||||
|
||||
public void setMaxAssembledSize(final long maxAssembledSize) {
|
||||
this.maxAssembledSize = maxAssembledSize;
|
||||
}
|
||||
|
||||
public int getMaxSegments() {
|
||||
return maxSegments;
|
||||
}
|
||||
|
||||
public void setMaxSegments(final int maxSegments) {
|
||||
this.maxSegments = maxSegments;
|
||||
}
|
||||
|
||||
public List<String> getAccept() {
|
||||
return accept;
|
||||
}
|
||||
|
||||
public void setAccept(final List<String> accept) {
|
||||
this.accept = accept;
|
||||
}
|
||||
|
||||
public List<String> getAcceptArchiveFormat() {
|
||||
return acceptArchiveFormat;
|
||||
}
|
||||
|
||||
public void setAcceptArchiveFormat(final List<String> acceptArchiveFormat) {
|
||||
this.acceptArchiveFormat = acceptArchiveFormat;
|
||||
}
|
||||
|
||||
public List<String> getAcceptPackaging() {
|
||||
return acceptPackaging;
|
||||
}
|
||||
|
||||
public void setAcceptPackaging(final List<String> acceptPackaging) {
|
||||
this.acceptPackaging = acceptPackaging;
|
||||
}
|
||||
|
||||
public List<String> getAcceptMetadata() {
|
||||
return acceptMetadata;
|
||||
}
|
||||
|
||||
public void setAcceptMetadata(final List<String> acceptMetadata) {
|
||||
this.acceptMetadata = acceptMetadata;
|
||||
}
|
||||
|
||||
public SwordIdDescProperty getCollectionPolicy() {
|
||||
return collectionPolicy;
|
||||
}
|
||||
|
||||
public void setCollectionPolicy(final SwordIdDescProperty collectionPolicy) {
|
||||
this.collectionPolicy = collectionPolicy;
|
||||
}
|
||||
|
||||
public SwordIdDescProperty getTreatment() {
|
||||
return treatment;
|
||||
}
|
||||
|
||||
public void setTreatment(final SwordIdDescProperty treatment) {
|
||||
this.treatment = treatment;
|
||||
}
|
||||
|
||||
public String getStaging() {
|
||||
return staging;
|
||||
}
|
||||
|
||||
public void setStaging(final String staging) {
|
||||
this.staging = staging;
|
||||
}
|
||||
|
||||
public int getStagingMaxIdle() {
|
||||
return stagingMaxIdle;
|
||||
}
|
||||
|
||||
public void setStagingMaxIdle(final int stagingMaxIdle) {
|
||||
this.stagingMaxIdle = stagingMaxIdle;
|
||||
}
|
||||
|
||||
public boolean isByReferenceDeposit() {
|
||||
return byReferenceDeposit;
|
||||
}
|
||||
|
||||
public void setByReferenceDeposit(final boolean byReferenceDeposit) {
|
||||
this.byReferenceDeposit = byReferenceDeposit;
|
||||
}
|
||||
|
||||
public boolean isOnBehalfOf() {
|
||||
return onBehalfOf;
|
||||
}
|
||||
|
||||
public void setOnBehalfOf(final boolean onBehalfOf) {
|
||||
this.onBehalfOf = onBehalfOf;
|
||||
}
|
||||
|
||||
public String getContext() {
|
||||
return context;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public List<String> getDigest() {
|
||||
return digest;
|
||||
}
|
||||
|
||||
public List<String> getAuthentication() {
|
||||
return authentication;
|
||||
}
|
||||
|
||||
public List<SwordService> getServices() {
|
||||
return services;
|
||||
}
|
||||
|
||||
// @formatter:off
|
||||
|
||||
/*
|
||||
{
|
||||
"@context" : "https://swordapp.github.io/swordv3/swordv3.jsonld",
|
||||
|
||||
"@id" : "http://example.com/service-document",
|
||||
"@type" : "ServiceDocument",
|
||||
|
||||
"dc:title" : "Site Name",
|
||||
"dcterms:abstract" : "Site Description",
|
||||
|
||||
"root" : "http://example.com/service-document",
|
||||
"acceptDeposits": true,
|
||||
|
||||
"version": "http://purl.org/net/sword/3.0",
|
||||
"maxUploadSize" : 16777216000,
|
||||
"maxByReferenceSize" : 30000000000000000,
|
||||
"maxSegmentSize" : 16777216000,
|
||||
"minSegmentSize" : 1,
|
||||
"maxAssembledSize" : 30000000000000,
|
||||
"maxSegments" : 1000,
|
||||
|
||||
"accept" : ["* /*"],
|
||||
"acceptArchiveFormat" : ["application/zip"],
|
||||
"acceptPackaging" : ["*"],
|
||||
"acceptMetadata" : ["http://purl.org/net/sword/3.0/types/Metadata"],
|
||||
|
||||
"collectionPolicy" : {
|
||||
"@id" : "http://www.myorg.ac.uk/collectionpolicy",
|
||||
"description" : "...."
|
||||
},
|
||||
"treatment" : {
|
||||
"@id" : "http://www.myorg.ac.uk/treatment",
|
||||
"description" : "..."
|
||||
},
|
||||
|
||||
"staging" : "http://example.com/staging",
|
||||
"stagingMaxIdle" : 3600,
|
||||
|
||||
"byReferenceDeposit" : true,
|
||||
"onBehalfOf" : true,
|
||||
|
||||
"digest" : ["SHA-256", "SHA", "MD5"],
|
||||
"authentication": ["Basic", "OAuth", "Digest", "APIKey"],
|
||||
|
||||
"services" : [
|
||||
{
|
||||
"@id": "http://swordapp.org/deposit/43",
|
||||
|
||||
"dc:title" : "Deposit Service Name",
|
||||
"dcterms:abstract" : "Deposit Service Description",
|
||||
|
||||
"root" : "http://example.com/service-document",
|
||||
"parent" : "http://example.com/service-document",
|
||||
"acceptDeposits": true,
|
||||
|
||||
"services" : []
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
*/
|
||||
}
|
Loading…
Reference in New Issue