Compare commits
No commits in common. "dmp-refactoring" and "master" have entirely different histories.
dmp-refact
...
master
|
@ -1,4 +1,4 @@
|
||||||
FROM maven:3-eclipse-temurin-21
|
FROM maven:3.8.6-eclipse-temurin-17-focal
|
||||||
|
|
||||||
RUN apt-get update
|
RUN apt-get update
|
||||||
RUN apt-get install gpg -y
|
RUN apt-get install gpg -y
|
||||||
|
@ -9,8 +9,6 @@ ARG REVISION
|
||||||
ARG MAVEN_GPG_PASSPHRASE
|
ARG MAVEN_GPG_PASSPHRASE
|
||||||
ARG MAVEN_GPG_KEYNAME
|
ARG MAVEN_GPG_KEYNAME
|
||||||
ARG PROFILE
|
ARG PROFILE
|
||||||
ARG DEV_PROFILE_URL_DEPOSIT
|
|
||||||
ARG DEV_PROFILE_URL
|
|
||||||
ENV gpg_keyname=$MAVEN_GPG_KEYNAME
|
ENV gpg_keyname=$MAVEN_GPG_KEYNAME
|
||||||
ENV gpg_passphrase=$MAVEN_GPG_PASSPHRASE
|
ENV gpg_passphrase=$MAVEN_GPG_PASSPHRASE
|
||||||
ENV server_username=$MAVEN_ACCOUNT_USR
|
ENV server_username=$MAVEN_ACCOUNT_USR
|
||||||
|
@ -26,4 +24,4 @@ WORKDIR /build/
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
RUN mvn -Drevision=${REVISION} -DdevProfileUrlDeposit=${DEV_PROFILE_URL_DEPOSIT} -DdevProfileUrl=${DEV_PROFILE_URL} -P${PROFILE} clean deploy
|
RUN mvn -Drevision=${REVISION} -P${PROFILE} clean deploy
|
|
@ -1,37 +0,0 @@
|
||||||
FROM maven:3-eclipse-temurin-21
|
|
||||||
|
|
||||||
RUN apt-get update \
|
|
||||||
&& apt-get install gpg -y \
|
|
||||||
&& apt-get clean
|
|
||||||
|
|
||||||
ARG MAVEN_ACCOUNT_USR
|
|
||||||
ARG MAVEN_ACCOUNT_PSW
|
|
||||||
ARG REVISION
|
|
||||||
ARG MAVEN_GPG_PASSPHRASE
|
|
||||||
ARG MAVEN_GPG_KEYNAME
|
|
||||||
ARG PROFILE
|
|
||||||
ARG DEV_PROFILE_URL_DEPOSIT
|
|
||||||
ARG DEV_PROFILE_URL
|
|
||||||
ARG ORACLE_URL
|
|
||||||
ARG ORACLE_TOKEN
|
|
||||||
ENV gpg_keyname=$MAVEN_GPG_KEYNAME
|
|
||||||
ENV gpg_passphrase=$MAVEN_GPG_PASSPHRASE
|
|
||||||
ENV server_username=$MAVEN_ACCOUNT_USR
|
|
||||||
ENV server_password=$MAVEN_ACCOUNT_PSW
|
|
||||||
|
|
||||||
COPY settings.xml /root/.m2/settings.xml
|
|
||||||
COPY keypair.asc /tmp/keypair.asc
|
|
||||||
RUN if [ "$PROFILE" = "ossrh" ]; then \
|
|
||||||
gpg --batch --import /tmp/keypair.asc; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
COPY oracle.local.cite.gr.crt $JAVA_HOME/conf/security
|
|
||||||
RUN cd $JAVA_HOME/conf/security && keytool -cacerts -storepass changeit -noprompt -trustcacerts -importcert -alias oraclecert -file oracle.local.cite.gr.crt
|
|
||||||
|
|
||||||
WORKDIR /build/
|
|
||||||
|
|
||||||
COPY . .
|
|
||||||
|
|
||||||
RUN mvn -Drevision=${REVISION} -DdevProfileUrlDeposit=${DEV_PROFILE_URL_DEPOSIT} -DdevProfileUrl=${DEV_PROFILE_URL} -P${PROFILE} clean install
|
|
||||||
|
|
||||||
RUN mvn sonar:sonar -Dsonar.projectKey=OpenDMP:repository-deposit-base -Dsonar.login=${ORACLE_TOKEN} -Dsonar.host.url=${ORACLE_URL} -Dsonar.projectName='OpenDMP repository-deposit-base'
|
|
|
@ -1,2 +1,2 @@
|
||||||
The repository-deposit-base module inlcudes the RepositoryDeposit interface which represents the mechanism of depositing a plan to any
|
The repository-deposit-base module inlcudes the RepositoryDeposit interface which represents the mechanism of depositing a dmp to any
|
||||||
repository which mints a persistent digital object identifier (DOI) for each submission, which makes the stored plans easily citeable.
|
repository which mints a persistent digital object identifier (DOI) for each submission, which makes the stored dmps easily citeable.
|
71
pom.xml
71
pom.xml
|
@ -2,19 +2,20 @@
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-parent</artifactId>
|
||||||
|
<version>2.7.4</version>
|
||||||
|
<relativePath/>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<groupId>gr.cite.opendmp</groupId>
|
||||||
<groupId>org.opencdmp</groupId>
|
|
||||||
<artifactId>repositorydepositbase</artifactId>
|
<artifactId>repositorydepositbase</artifactId>
|
||||||
<version>${revision}</version>
|
<version>${revision}</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<!-- <devProfileId>${devProfileId}</devProfileId>-->
|
|
||||||
<!-- <devProfileName>${devProfileName}</devProfileName>-->
|
|
||||||
<!-- <devProfileUrl>${devProfileUrl}</devProfileUrl>-->
|
|
||||||
<!-- <devProfileUrlDeposit>${devProfileUrlDeposit}</devProfileUrlDeposit>-->
|
|
||||||
|
|
||||||
<name>OpenCDMP Repository Deposit Base</name>
|
<name>OpenDMP Repository Deposit Base</name>
|
||||||
<description>OpenCDMP Repository Deposit Base</description>
|
<description>OpenDMP Repository Deposit Base</description>
|
||||||
<url>https://code-repo.d4science.org/MaDgiK-CITE/repository-deposit-base</url>
|
<url>https://code-repo.d4science.org/MaDgiK-CITE/repository-deposit-base</url>
|
||||||
<licenses>
|
<licenses>
|
||||||
<license>
|
<license>
|
||||||
|
@ -39,34 +40,14 @@
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<revision>1.0.0-SNAPSHOT</revision>
|
<revision>1.0.0-SNAPSHOT</revision>
|
||||||
<java.version>21</java.version>
|
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.opencdmp</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>common-models</artifactId>
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
<version>0.0.19</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework</groupId>
|
|
||||||
<artifactId>spring-web</artifactId>
|
|
||||||
<version>6.1.6</version>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<build>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
|
||||||
<configuration>
|
|
||||||
<source>21</source>
|
|
||||||
<target>21</target>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
|
|
||||||
<profiles>
|
<profiles>
|
||||||
<profile>
|
<profile>
|
||||||
|
@ -152,36 +133,6 @@
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
</profile>
|
</profile>
|
||||||
<profile>
|
|
||||||
<id>dev</id>
|
|
||||||
<repositories>
|
|
||||||
<repository>
|
|
||||||
<id>dev</id>
|
|
||||||
<name>Dev Profile</name>
|
|
||||||
<url>${devProfileUrl}</url>
|
|
||||||
</repository>
|
|
||||||
</repositories>
|
|
||||||
<distributionManagement>
|
|
||||||
<repository>
|
|
||||||
<id>dev</id>
|
|
||||||
<name>Dev Profile</name>
|
|
||||||
<url>${devProfileUrlDeposit}</url>
|
|
||||||
</repository>
|
|
||||||
</distributionManagement>
|
|
||||||
</profile>
|
|
||||||
<profile>
|
|
||||||
<id>cite-dev</id>
|
|
||||||
<repositories>
|
|
||||||
<repository>
|
|
||||||
<id>cite-maven</id>
|
|
||||||
<name>CITE Maven Repository</name>
|
|
||||||
<url>https://crepo.cite.gr/repository/cite-maven/</url>
|
|
||||||
</repository>
|
|
||||||
</repositories>
|
|
||||||
<activation>
|
|
||||||
<activeByDefault>true</activeByDefault>
|
|
||||||
</activation>
|
|
||||||
</profile>
|
|
||||||
</profiles>
|
</profiles>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -5,11 +5,6 @@
|
||||||
<username>${server_username}</username>
|
<username>${server_username}</username>
|
||||||
<password>${server_password}</password>
|
<password>${server_password}</password>
|
||||||
</server>
|
</server>
|
||||||
<server>
|
|
||||||
<id>dev</id>
|
|
||||||
<username>${server_username}</username>
|
|
||||||
<password>${server_password}</password>
|
|
||||||
</server>
|
|
||||||
</servers>
|
</servers>
|
||||||
<profiles>
|
<profiles>
|
||||||
<profile>
|
<profile>
|
||||||
|
|
|
@ -0,0 +1,49 @@
|
||||||
|
package eu.eudat.depositinterface.enums;
|
||||||
|
|
||||||
|
public enum FieldType {
|
||||||
|
COMBO_BOX("combobox"),
|
||||||
|
BOOLEAN_DECISION("booleanDecision"),
|
||||||
|
RADIO_BOX("radiobox"),
|
||||||
|
INTERNAL_DMP_ENTRIES("internalDmpEntities"),
|
||||||
|
CHECK_BOX("checkBox"),
|
||||||
|
FREE_TEXT("freetext"),
|
||||||
|
TEXT_AREA("textarea"),
|
||||||
|
RICH_TEXT_AREA("richTextarea"),
|
||||||
|
UPLOAD("upload"),
|
||||||
|
TABLE("table"),
|
||||||
|
DATE_PICKER("datePicker"),
|
||||||
|
EXTERNAL_DATASETS("externalDatasets"),
|
||||||
|
DATA_REPOSITORIES("dataRepositories"),
|
||||||
|
JOURNAL_REPOSITORIES("journalRepositories"),
|
||||||
|
PUB_REPOSITORIES("pubRepositories"),
|
||||||
|
LICENSES("licenses"),
|
||||||
|
TAXONOMIES("taxonomies"),
|
||||||
|
PUBLICATIONS("publications"),
|
||||||
|
REGISTRIES("registries"),
|
||||||
|
SERVICES("services"),
|
||||||
|
TAGS("tags"),
|
||||||
|
RESEARCHERS("researchers"),
|
||||||
|
ORGANIZATIONS("organizations"),
|
||||||
|
DATASET_IDENTIFIER("datasetIdentifier"),
|
||||||
|
CURRENCY("currency"),
|
||||||
|
VALIDATION("validation");
|
||||||
|
|
||||||
|
private final String name;
|
||||||
|
|
||||||
|
FieldType(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static FieldType fromName(String name) {
|
||||||
|
for (FieldType fieldType : FieldType.values()) {
|
||||||
|
if (name.equals(fieldType.getName())) {
|
||||||
|
return fieldType;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw new IllegalArgumentException("View Style Type [" + name + "] is not valid");
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,129 @@
|
||||||
|
package eu.eudat.depositinterface.models;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
public class DMPDepositModel {
|
||||||
|
private UUID id;
|
||||||
|
private int version;
|
||||||
|
private String label;
|
||||||
|
private String description;
|
||||||
|
private boolean isPublic;
|
||||||
|
private List<DatasetDepositModel> datasets;
|
||||||
|
private Set<UserDMPDepositModel> users;
|
||||||
|
private Set<OrganisationDepositModel> organisations;
|
||||||
|
private Set<ResearcherDepositModel> researchers;
|
||||||
|
private GrantDepositModel grant;
|
||||||
|
private FileEnvelope pdfFile;
|
||||||
|
private FileEnvelope rdaJsonFile;
|
||||||
|
private File supportingFilesZip;
|
||||||
|
private String previousDOI;
|
||||||
|
private String extraProperties;
|
||||||
|
|
||||||
|
public UUID getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
public void setId(UUID id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getVersion() {
|
||||||
|
return version;
|
||||||
|
}
|
||||||
|
public void setVersion(int version) {
|
||||||
|
this.version = version;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLabel() {
|
||||||
|
return label;
|
||||||
|
}
|
||||||
|
public void setLabel(String label) {
|
||||||
|
this.label = label;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescription() {
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
public void setDescription(String description) {
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isPublic() {
|
||||||
|
return isPublic;
|
||||||
|
}
|
||||||
|
public void setPublic(boolean aPublic) {
|
||||||
|
isPublic = aPublic;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<DatasetDepositModel> getDatasets() {
|
||||||
|
return datasets;
|
||||||
|
}
|
||||||
|
public void setDatasets(List<DatasetDepositModel> datasets) {
|
||||||
|
this.datasets = datasets;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Set<UserDMPDepositModel> getUsers() {
|
||||||
|
return users;
|
||||||
|
}
|
||||||
|
public void setUsers(Set<UserDMPDepositModel> users) {
|
||||||
|
this.users = users;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Set<OrganisationDepositModel> getOrganisations() {
|
||||||
|
return organisations;
|
||||||
|
}
|
||||||
|
public void setOrganisations(Set<OrganisationDepositModel> organisations) {
|
||||||
|
this.organisations = organisations;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Set<ResearcherDepositModel> getResearchers() {
|
||||||
|
return researchers;
|
||||||
|
}
|
||||||
|
public void setResearchers(Set<ResearcherDepositModel> researchers) {
|
||||||
|
this.researchers = researchers;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GrantDepositModel getGrant() {
|
||||||
|
return grant;
|
||||||
|
}
|
||||||
|
public void setGrant(GrantDepositModel grant) {
|
||||||
|
this.grant = grant;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FileEnvelope getPdfFile() {
|
||||||
|
return pdfFile;
|
||||||
|
}
|
||||||
|
public void setPdfFile(FileEnvelope pdfFile) {
|
||||||
|
this.pdfFile = pdfFile;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FileEnvelope getRdaJsonFile() {
|
||||||
|
return rdaJsonFile;
|
||||||
|
}
|
||||||
|
public void setRdaJsonFile(FileEnvelope rdaJsonFile) {
|
||||||
|
this.rdaJsonFile = rdaJsonFile;
|
||||||
|
}
|
||||||
|
|
||||||
|
public File getSupportingFilesZip() {
|
||||||
|
return supportingFilesZip;
|
||||||
|
}
|
||||||
|
public void setSupportingFilesZip(File supportingFilesZip) {
|
||||||
|
this.supportingFilesZip = supportingFilesZip;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPreviousDOI() {
|
||||||
|
return previousDOI;
|
||||||
|
}
|
||||||
|
public void setPreviousDOI(String previousDOI) {
|
||||||
|
this.previousDOI = previousDOI;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getExtraProperties() {
|
||||||
|
return extraProperties;
|
||||||
|
}
|
||||||
|
public void setExtraProperties(String extraProperties) {
|
||||||
|
this.extraProperties = extraProperties;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,46 @@
|
||||||
|
package eu.eudat.depositinterface.models;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class DatasetDepositModel {
|
||||||
|
private String label;
|
||||||
|
private String description;
|
||||||
|
private String profileDefinition;
|
||||||
|
private String properties;
|
||||||
|
private List<DatasetFieldsDepositModel> fields;
|
||||||
|
|
||||||
|
public String getLabel() {
|
||||||
|
return label;
|
||||||
|
}
|
||||||
|
public void setLabel(String label) {
|
||||||
|
this.label = label;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescription() {
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
public void setDescription(String description) {
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getProfileDefinition() {
|
||||||
|
return profileDefinition;
|
||||||
|
}
|
||||||
|
public void setProfileDefinition(String profileDefinition) {
|
||||||
|
this.profileDefinition = profileDefinition;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getProperties() {
|
||||||
|
return properties;
|
||||||
|
}
|
||||||
|
public void setProperties(String properties) {
|
||||||
|
this.properties = properties;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<DatasetFieldsDepositModel> getFields() {
|
||||||
|
return fields;
|
||||||
|
}
|
||||||
|
public void setFields(List<DatasetFieldsDepositModel> fields) {
|
||||||
|
this.fields = fields;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,38 @@
|
||||||
|
package eu.eudat.depositinterface.models;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class DatasetFieldsDepositModel {
|
||||||
|
private String renderStyleType;
|
||||||
|
private List<String> schematics;
|
||||||
|
private Object value;
|
||||||
|
private boolean multiple;
|
||||||
|
|
||||||
|
public String getRenderStyleType() {
|
||||||
|
return renderStyleType;
|
||||||
|
}
|
||||||
|
public void setRenderStyleType(String renderStyleType) {
|
||||||
|
this.renderStyleType = renderStyleType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getSchematics() {
|
||||||
|
return schematics;
|
||||||
|
}
|
||||||
|
public void setSchematics(List<String> schematics) {
|
||||||
|
this.schematics = schematics;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object getValue() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
public void setValue(Object value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isMultiple() {
|
||||||
|
return multiple;
|
||||||
|
}
|
||||||
|
public void setMultiple(boolean multiple) {
|
||||||
|
this.multiple = multiple;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
package eu.eudat.depositinterface.models;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
|
public class FileEnvelope {
|
||||||
|
private String filename;
|
||||||
|
private File file;
|
||||||
|
|
||||||
|
public String getFilename() {
|
||||||
|
return filename;
|
||||||
|
}
|
||||||
|
public void setFilename(String filename) {
|
||||||
|
this.filename = filename;
|
||||||
|
}
|
||||||
|
|
||||||
|
public File getFile() {
|
||||||
|
return file;
|
||||||
|
}
|
||||||
|
public void setFile(File file) {
|
||||||
|
this.file = file;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
package eu.eudat.depositinterface.models;
|
||||||
|
|
||||||
|
public class FunderDepositModel {
|
||||||
|
private String label;
|
||||||
|
|
||||||
|
public String getLabel() {
|
||||||
|
return label;
|
||||||
|
}
|
||||||
|
public void setLabel(String label) {
|
||||||
|
this.label = label;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,30 @@
|
||||||
|
package eu.eudat.depositinterface.models;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
public class GrantDepositModel {
|
||||||
|
private UUID id;
|
||||||
|
private String reference;
|
||||||
|
private FunderDepositModel funder;
|
||||||
|
|
||||||
|
public UUID getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
public void setId(UUID id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getReference() {
|
||||||
|
return reference;
|
||||||
|
}
|
||||||
|
public void setReference(String reference) {
|
||||||
|
this.reference = reference;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FunderDepositModel getFunder() {
|
||||||
|
return funder;
|
||||||
|
}
|
||||||
|
public void setFunder(FunderDepositModel funder) {
|
||||||
|
this.funder = funder;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
package eu.eudat.depositinterface.models;
|
||||||
|
|
||||||
|
public class OrganisationDepositModel {
|
||||||
|
private String label;
|
||||||
|
|
||||||
|
public String getLabel() {
|
||||||
|
return label;
|
||||||
|
}
|
||||||
|
public void setLabel(String label) {
|
||||||
|
this.label = label;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
package eu.eudat.depositinterface.models;
|
||||||
|
|
||||||
|
public class ResearcherDepositModel {
|
||||||
|
private String label;
|
||||||
|
private String reference;
|
||||||
|
|
||||||
|
public String getLabel() {
|
||||||
|
return label;
|
||||||
|
}
|
||||||
|
public void setLabel(String label) {
|
||||||
|
this.label = label;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getReference() {
|
||||||
|
return reference;
|
||||||
|
}
|
||||||
|
public void setReference(String reference) {
|
||||||
|
this.reference = reference;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,47 @@
|
||||||
|
package eu.eudat.depositinterface.models;
|
||||||
|
|
||||||
|
public class UserDMPDepositModel {
|
||||||
|
|
||||||
|
public enum UserDMPRoles {
|
||||||
|
OWNER(0), USER(1);
|
||||||
|
|
||||||
|
private int value;
|
||||||
|
|
||||||
|
UserDMPRoles(int value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getValue() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static UserDMPRoles fromInteger(int value) {
|
||||||
|
switch (value) {
|
||||||
|
case 0:
|
||||||
|
return OWNER;
|
||||||
|
case 1:
|
||||||
|
return USER;
|
||||||
|
default:
|
||||||
|
throw new RuntimeException("Unsupported User Dmp Role Message Code");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private UserInfoDepositModel user;
|
||||||
|
private Integer role;
|
||||||
|
|
||||||
|
public UserInfoDepositModel getUser() {
|
||||||
|
return user;
|
||||||
|
}
|
||||||
|
public void setUser(UserInfoDepositModel user) {
|
||||||
|
this.user = user;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getRole() {
|
||||||
|
return role;
|
||||||
|
}
|
||||||
|
public void setRole(Integer role) {
|
||||||
|
this.role = role;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
package eu.eudat.depositinterface.models;
|
||||||
|
|
||||||
|
public class UserInfoDepositModel {
|
||||||
|
private String name;
|
||||||
|
private String email;
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEmail() {
|
||||||
|
return email;
|
||||||
|
}
|
||||||
|
public void setEmail(String email) {
|
||||||
|
this.email = email;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,64 +1,68 @@
|
||||||
package org.opencdmp.depositbase.repository;
|
package eu.eudat.depositinterface.repository;
|
||||||
|
|
||||||
|
import eu.eudat.depositinterface.models.DMPDepositModel;
|
||||||
|
|
||||||
import org.opencdmp.commonmodels.models.plan.PlanModel;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The RepositoryDeposit interface represents the mechanism of depositing a plan to any
|
* The RepositoryDeposit interface represents the mechanism of depositing a dmp to any
|
||||||
* repository which mints a persistent digital object identifier (DOI) for each submission,
|
* repository which mints a persistent digital object identifier (DOI) for each submission,
|
||||||
* which makes the stored plans easily citeable.
|
* which makes the stored dmps easily citeable.
|
||||||
*/
|
*/
|
||||||
public interface DepositClient {
|
public interface RepositoryDeposit {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a string representing the persistent digital object identifier (DOI) which
|
* Returns a string representing the persistent digital object identifier (DOI) which
|
||||||
* was created.
|
* was created.
|
||||||
*
|
*
|
||||||
* @param planDepositModel plan structure which is to be deposited
|
* @param repositoryId the id of the repository
|
||||||
|
* @param dmpDepositModel dmp structure which is to be deposited
|
||||||
* @param repositoryAccessToken access token needed for the authentication to the repository
|
* @param repositoryAccessToken access token needed for the authentication to the repository
|
||||||
* if this is null, another authentication mechanism is used for
|
* if this is null, another authentication mechanism is used for
|
||||||
* that repository e.g. api token which will be fetched from the
|
* that repository e.g. api token which will be fetched from the
|
||||||
* repository's configuration
|
* repository's configuration
|
||||||
* @return a string representing the persistent digital object identifier (DOI)
|
* @return a string representing the persistent digital object identifier (DOI)
|
||||||
* @throws Exception if an error occurs while trying to deposit the plan
|
* @throws Exception if an error occurs while trying to deposit the dmp
|
||||||
*/
|
*/
|
||||||
String deposit(PlanModel planDepositModel, String repositoryAccessToken) throws Exception;
|
String deposit(String repositoryId, DMPDepositModel dmpDepositModel, String repositoryAccessToken) throws Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the access token from the oauth2 flow.
|
* Returns the access token from the oauth2 flow.
|
||||||
*
|
*
|
||||||
|
* @param repositoryId the id of the repository
|
||||||
* @param code oauth2 authorization code
|
* @param code oauth2 authorization code
|
||||||
* @return the access token or null if no oauth2 protocol is not supported for that repository
|
* @return the access token or null if no oauth2 protocol is not supported for that repository
|
||||||
*/
|
*/
|
||||||
String authenticate(String code);
|
String authenticate(String repositoryId, String code);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the repository's configuration.
|
* Returns the repository's configuration.
|
||||||
*
|
*
|
||||||
* @return List of structure representing the configuration of the repository <br>
|
* @return List of structure representing the configuration of the repository <br>
|
||||||
* which includes the following fields: <br>
|
* which includes the following fields: <br>
|
||||||
* depositType - an integer representing how the plan user can deposit in the repository,
|
* depositType - an integer representing how the dmp user can deposit in the repository,
|
||||||
* 0 stands for system deposition meaning the plan is deposited using argos credentials to the
|
* 0 stands for system deposition meaning the dmp is deposited using argos credentials to the
|
||||||
* repository, 1 stands for user deposition in which the argos user specifies his/her own credentials
|
* repository, 1 stands for user deposition in which the argos user specifies his/her own credentials
|
||||||
* to the repository, 2 stands for both ways deposition if the repository allows the deposits of plans
|
* to the repository, 2 stands for both ways deposition if the repository allows the deposits of dmps
|
||||||
* to be made from both argos and users accounts<br>
|
* to be made from both argos and users accounts<br>
|
||||||
* repositoryId - unique identifier for the repository<br>
|
* repositoryId - unique identifier for the repository<br>
|
||||||
* accessToken - access token provided for the system type deposits<br>
|
* accessToken - access token provided for the system type deposits<br>
|
||||||
* repositoryUrl - repository url<br>
|
* repositoryUrl - repository url<br>
|
||||||
* repositoryAuthorizationUrl - repository's authorization url<br>
|
* repositoryAuthorizationUrl - repository's authorization url<br>
|
||||||
* repositoryRecordUrl - repository's record url, this url is used to index plans that are created<br>
|
* repositoryRecordUrl - repository's record url, this url is used to index dmps that are created<br>
|
||||||
* repositoryAccessTokenUrl - repository's access token url<br>
|
* repositoryAccessTokenUrl - repository's access token url<br>
|
||||||
* repositoryClientId - repository's client id<br>
|
* repositoryClientId - repository's client id<br>
|
||||||
* repositoryClientSecret - repository's client secret<br>
|
* repositoryClientSecret - repository's client secret<br>
|
||||||
* redirectUri - redirect uri to argos after the oauth2 flow from the repository<br>
|
* redirectUri - redirect uri to argos after the oauth2 flow from the repository<br>
|
||||||
*/
|
*/
|
||||||
DepositConfiguration getConfiguration();
|
List<RepositoryDepositConfiguration> getConfiguration();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the repository's logo if exists.
|
* Returns the repository's logo if exists.
|
||||||
*
|
*
|
||||||
|
* @param repositoryId the id of the repository
|
||||||
* @return the repository's logo in base64 form
|
* @return the repository's logo in base64 form
|
||||||
* */
|
* */
|
||||||
String getLogo();
|
String getLogo(String repositoryId);
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,10 +1,35 @@
|
||||||
package org.opencdmp.depositbase.repository;
|
package eu.eudat.depositinterface.repository;
|
||||||
|
|
||||||
import org.opencdmp.depositbase.enums.DepositType;
|
public class RepositoryDepositConfiguration {
|
||||||
|
|
||||||
public class DepositConfiguration {
|
public enum DepositType {
|
||||||
|
SystemDeposit(0), UserDeposit(1), BothWaysDeposit(2);
|
||||||
|
|
||||||
private DepositType depositType;
|
private int value;
|
||||||
|
|
||||||
|
DepositType(int value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getValue() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static DepositType fromInteger(int value) {
|
||||||
|
switch (value) {
|
||||||
|
case 0:
|
||||||
|
return SystemDeposit;
|
||||||
|
case 1:
|
||||||
|
return UserDeposit;
|
||||||
|
case 2:
|
||||||
|
return BothWaysDeposit;
|
||||||
|
default:
|
||||||
|
throw new RuntimeException("Unsupported Deposit Account Type");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private int depositType;
|
||||||
private String repositoryId;
|
private String repositoryId;
|
||||||
private String accessToken;
|
private String accessToken;
|
||||||
private String repositoryUrl;
|
private String repositoryUrl;
|
||||||
|
@ -14,13 +39,12 @@ public class DepositConfiguration {
|
||||||
private String repositoryClientId;
|
private String repositoryClientId;
|
||||||
private String repositoryClientSecret;
|
private String repositoryClientSecret;
|
||||||
private String redirectUri;
|
private String redirectUri;
|
||||||
private boolean useSharedStorage;
|
|
||||||
private boolean hasLogo;
|
private boolean hasLogo;
|
||||||
|
|
||||||
public DepositType getDepositType() {
|
public int getDepositType() {
|
||||||
return depositType;
|
return depositType;
|
||||||
}
|
}
|
||||||
public void setDepositType(DepositType depositType) {
|
public void setDepositType(int depositType) {
|
||||||
this.depositType = depositType;
|
this.depositType = depositType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,12 +117,4 @@ public class DepositConfiguration {
|
||||||
public void setHasLogo(boolean hasLogo) {
|
public void setHasLogo(boolean hasLogo) {
|
||||||
this.hasLogo = hasLogo;
|
this.hasLogo = hasLogo;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isUseSharedStorage() {
|
|
||||||
return useSharedStorage;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUseSharedStorage(boolean useSharedStorage) {
|
|
||||||
this.useSharedStorage = useSharedStorage;
|
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -1,30 +0,0 @@
|
||||||
package org.opencdmp.depositbase.enums;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonValue;
|
|
||||||
import org.opencdmp.commonmodels.enums.EnumUtils;
|
|
||||||
import org.opencdmp.commonmodels.enums.EnumValueProvider;
|
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public enum DepositType implements EnumValueProvider<Short> {
|
|
||||||
SystemDeposit((short) 0), UserDeposit((short) 1), BothWaysDeposit((short) 2);
|
|
||||||
|
|
||||||
private final Short value;
|
|
||||||
|
|
||||||
DepositType(Short value) {
|
|
||||||
this.value = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@JsonValue
|
|
||||||
public Short getValue() {
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static final Map<Short, DepositType> map = EnumUtils.getEnumValueMap(DepositType.class);
|
|
||||||
|
|
||||||
public static DepositType of(Short i) {
|
|
||||||
return map.get(i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,71 +0,0 @@
|
||||||
package org.opencdmp.depositbase.repository;
|
|
||||||
|
|
||||||
import org.opencdmp.commonmodels.models.plan.PlanModel;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The RepositoryDeposit interface represents the mechanism of depositing a plan to any
|
|
||||||
* repository which mints a persistent digital object identifier (DOI) for each submission,
|
|
||||||
* which makes the stored plans easily citeable.
|
|
||||||
*/
|
|
||||||
public interface DepositController {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a string representing the persistent digital object identifier (DOI) which
|
|
||||||
* was created.
|
|
||||||
*
|
|
||||||
* @param planDepositModel plan structure which is to be deposited
|
|
||||||
* @param authToken access token needed for the authentication to the repository
|
|
||||||
* if this is null, another authentication mechanism is used for
|
|
||||||
* that repository e.g. api token which will be fetched from the
|
|
||||||
* repository's configuration
|
|
||||||
* @return a string representing the persistent digital object identifier (DOI)
|
|
||||||
* @throws Exception if an error occurs while trying to deposit the plan
|
|
||||||
*/
|
|
||||||
@PostMapping()
|
|
||||||
String deposit(@RequestBody PlanModel planDepositModel, @RequestParam("authToken")String authToken) throws Exception;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the access token from the oauth2 flow.
|
|
||||||
*
|
|
||||||
* @param code oauth2 authorization code
|
|
||||||
* @return the access token or null if no oauth2 protocol is not supported for that repository
|
|
||||||
*/
|
|
||||||
@GetMapping("/authenticate")
|
|
||||||
String authenticate(@RequestParam("authToken") String code);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the repository's configuration.
|
|
||||||
*
|
|
||||||
* @return List of structure representing the configuration of the repository <br>
|
|
||||||
* which includes the following fields: <br>
|
|
||||||
* depositType - an integer representing how the plan user can deposit in the repository,
|
|
||||||
* 0 stands for system deposition meaning the plan is deposited using argos credentials to the
|
|
||||||
* repository, 1 stands for user deposition in which the argos user specifies his/her own credentials
|
|
||||||
* to the repository, 2 stands for both ways deposition if the repository allows the deposits of plans
|
|
||||||
* to be made from both argos and users accounts<br>
|
|
||||||
* repositoryId - unique identifier for the repository<br>
|
|
||||||
* accessToken - access token provided for the system type deposits<br>
|
|
||||||
* repositoryUrl - repository url<br>
|
|
||||||
* repositoryAuthorizationUrl - repository's authorization url<br>
|
|
||||||
* repositoryRecordUrl - repository's record url, this url is used to index plans that are created<br>
|
|
||||||
* repositoryAccessTokenUrl - repository's access token url<br>
|
|
||||||
* repositoryClientId - repository's client id<br>
|
|
||||||
* repositoryClientSecret - repository's client secret<br>
|
|
||||||
* redirectUri - redirect uri to argos after the oauth2 flow from the repository<br>
|
|
||||||
*/
|
|
||||||
@GetMapping("/configuration")
|
|
||||||
DepositConfiguration getConfiguration();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the repository's logo if exists.
|
|
||||||
*
|
|
||||||
* @return the repository's logo in base64 form
|
|
||||||
* */
|
|
||||||
@GetMapping("/logo")
|
|
||||||
String getLogo();
|
|
||||||
|
|
||||||
}
|
|
Loading…
Reference in New Issue