rename to OpenCDMP

This commit is contained in:
Efstratios Giannopoulos 2024-04-26 14:51:07 +03:00
parent 6cd68483a9
commit 2a9544bad5
28 changed files with 84 additions and 85 deletions

View File

@ -3,7 +3,7 @@
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>
<parent>
<groupId>gr.cite.opendmp</groupId>
<groupId>org.opencdmp</groupId>
<artifactId>repository-deposit-parent</artifactId>
<version>${revision}</version>
<relativePath>../pom.xml</relativePath>
@ -13,8 +13,8 @@
<version>${revision}</version>
<packaging>jar</packaging>
<name>OpenDMP Repository Deposit Zenodo</name>
<description>OpenDMP Repository Deposit Zenodo</description>
<name>OpenCDMP Repository Deposit Zenodo</name>
<description>OpenCDMP Repository Deposit Zenodo</description>
<url>https://code-repo.d4science.org/MaDgiK-CITE/repository-deposit-zenodo</url>
<licenses>
<license>
@ -87,7 +87,7 @@
<configuration>
<archive>
<manifest>
<mainClass>eu.eudat.EuDatApplication</mainClass>
<mainClass>org.opencdmp.deposit.DepositApplication</mainClass>
</manifest>
</archive>
<descriptorRefs>

View File

@ -1,12 +0,0 @@
package eu.eudat.depositinterface.zenodorepository.configuration;
import eu.eudat.depositinterface.zenodorepository.configuration.funder.FunderProperties;
import eu.eudat.depositinterface.zenodorepository.configuration.identifier.IdentifierProperties;
import eu.eudat.depositinterface.zenodorepository.configuration.pid.PidProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Configuration;
@Configuration
@EnableConfigurationProperties({PidProperties.class, FunderProperties.class, IdentifierProperties.class})
public class GenericConfiguration {
}

View File

@ -0,0 +1,12 @@
package org.opencdmp.deposit.zenodorepository.configuration;
import org.opencdmp.deposit.zenodorepository.configuration.funder.FunderProperties;
import org.opencdmp.deposit.zenodorepository.configuration.identifier.IdentifierProperties;
import org.opencdmp.deposit.zenodorepository.configuration.pid.PidProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Configuration;
@Configuration
@EnableConfigurationProperties({PidProperties.class, FunderProperties.class, IdentifierProperties.class})
public class GenericConfiguration {
}

View File

@ -1,4 +1,4 @@
package eu.eudat.depositinterface.zenodorepository.configuration.funder;
package org.opencdmp.deposit.zenodorepository.configuration.funder;
import org.springframework.boot.context.properties.ConfigurationProperties;

View File

@ -1,4 +1,4 @@
package eu.eudat.depositinterface.zenodorepository.configuration.identifier;
package org.opencdmp.deposit.zenodorepository.configuration.identifier;
import org.springframework.boot.context.properties.ConfigurationProperties;

View File

@ -1,4 +1,4 @@
package eu.eudat.depositinterface.zenodorepository.configuration.pid;
package org.opencdmp.deposit.zenodorepository.configuration.pid;
import org.springframework.boot.context.properties.ConfigurationProperties;

View File

@ -1,8 +1,8 @@
package eu.eudat.depositinterface.zenodorepository.enums;
package org.opencdmp.deposit.zenodorepository.enums;
import com.fasterxml.jackson.annotation.JsonValue;
import eu.eudat.commonmodels.enums.EnumUtils;
import eu.eudat.commonmodels.enums.EnumValueProvider;
import org.opencdmp.commonmodels.enums.EnumUtils;
import org.opencdmp.commonmodels.enums.EnumValueProvider;
import java.util.Map;

View File

@ -1,4 +1,4 @@
package eu.eudat.depositinterface.zenodorepository.model;
package org.opencdmp.deposit.zenodorepository.model;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;

View File

@ -1,4 +1,4 @@
package eu.eudat.depositinterface.zenodorepository.model;
package org.opencdmp.deposit.zenodorepository.model;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;

View File

@ -1,4 +1,4 @@
package eu.eudat.depositinterface.zenodorepository.model;
package org.opencdmp.deposit.zenodorepository.model;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;

View File

@ -1,4 +1,4 @@
package eu.eudat.depositinterface.zenodorepository.model;
package org.opencdmp.deposit.zenodorepository.model;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;

View File

@ -1,9 +1,9 @@
package eu.eudat.depositinterface.zenodorepository.model;
package org.opencdmp.deposit.zenodorepository.model;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import eu.eudat.depositinterface.zenodorepository.enums.ZenodoAccessRight;
import org.opencdmp.deposit.zenodorepository.enums.ZenodoAccessRight;
import java.util.List;

View File

@ -1,4 +1,4 @@
package eu.eudat.depositinterface.zenodorepository.model;
package org.opencdmp.deposit.zenodorepository.model;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;

View File

@ -1,4 +1,4 @@
package eu.eudat.depositinterface.zenodorepository.model;
package org.opencdmp.deposit.zenodorepository.model;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;

View File

@ -1,22 +1,22 @@
package eu.eudat.depositinterface.zenodorepository.model.builder;
package org.opencdmp.deposit.zenodorepository.model.builder;
import eu.eudat.commonmodels.enums.DmpAccessType;
import eu.eudat.commonmodels.enums.DmpUserRole;
import eu.eudat.commonmodels.models.DmpUserModel;
import eu.eudat.commonmodels.models.description.*;
import eu.eudat.commonmodels.models.descriptiotemplate.DefinitionModel;
import eu.eudat.commonmodels.models.descriptiotemplate.fielddata.RadioBoxDataModel;
import eu.eudat.commonmodels.models.descriptiotemplate.fielddata.SelectDataModel;
import eu.eudat.commonmodels.models.dmp.DmpModel;
import eu.eudat.commonmodels.models.dmpreference.DmpReferenceModel;
import eu.eudat.commonmodels.models.reference.ReferenceFieldModel;
import eu.eudat.commonmodels.models.reference.ReferenceModel;
import eu.eudat.depositinterface.zenodorepository.configuration.funder.FunderProperties;
import eu.eudat.depositinterface.zenodorepository.configuration.identifier.IdentifierProperties;
import eu.eudat.depositinterface.zenodorepository.configuration.pid.PidProperties;
import eu.eudat.depositinterface.zenodorepository.enums.ZenodoAccessRight;
import eu.eudat.depositinterface.zenodorepository.model.*;
import eu.eudat.depositinterface.zenodorepository.service.zenodo.ZenodoServiceProperties;
import org.opencdmp.commonmodels.enums.DmpAccessType;
import org.opencdmp.commonmodels.enums.DmpUserRole;
import org.opencdmp.commonmodels.models.DmpUserModel;
import org.opencdmp.commonmodels.models.description.*;
import org.opencdmp.commonmodels.models.descriptiotemplate.DefinitionModel;
import org.opencdmp.commonmodels.models.descriptiotemplate.fielddata.RadioBoxDataModel;
import org.opencdmp.commonmodels.models.descriptiotemplate.fielddata.SelectDataModel;
import org.opencdmp.commonmodels.models.dmp.DmpModel;
import org.opencdmp.commonmodels.models.dmpreference.DmpReferenceModel;
import org.opencdmp.commonmodels.models.reference.ReferenceFieldModel;
import org.opencdmp.commonmodels.models.reference.ReferenceModel;
import org.opencdmp.deposit.zenodorepository.configuration.funder.FunderProperties;
import org.opencdmp.deposit.zenodorepository.configuration.identifier.IdentifierProperties;
import org.opencdmp.deposit.zenodorepository.configuration.pid.PidProperties;
import org.opencdmp.deposit.zenodorepository.enums.ZenodoAccessRight;
import org.opencdmp.deposit.zenodorepository.model.*;
import org.opencdmp.deposit.zenodorepository.service.zenodo.ZenodoServiceProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Scope;
@ -76,7 +76,7 @@ public class ZenodoBuilder {
return deposit;
}
private List<eu.eudat.commonmodels.models.descriptiotemplate.FieldModel> findSchematicValues(String relatedId, DefinitionModel definitionModel){
private List<org.opencdmp.commonmodels.models.descriptiotemplate.FieldModel> findSchematicValues(String relatedId, DefinitionModel definitionModel){
return definitionModel.getAllField().stream().filter(x-> x.getSchematics() != null && x.getSchematics().contains(relatedId)).toList();
}
@ -96,9 +96,9 @@ public class ZenodoBuilder {
return models;
}
private Set<String> extractSchematicValues(List<eu.eudat.commonmodels.models.descriptiotemplate.FieldModel> fields, PropertyDefinitionModel propertyDefinition, List<String> acceptedPidTypes) {
private Set<String> extractSchematicValues(List<org.opencdmp.commonmodels.models.descriptiotemplate.FieldModel> fields, PropertyDefinitionModel propertyDefinition, List<String> acceptedPidTypes) {
Set<String> values = new HashSet<>();
for (eu.eudat.commonmodels.models.descriptiotemplate.FieldModel field : fields) {
for (org.opencdmp.commonmodels.models.descriptiotemplate.FieldModel field : fields) {
if (field.getData() == null) continue;
List<FieldModel> valueFields = this.findValueFieldsByIds(field.getId(), propertyDefinition);
for (FieldModel valueField : valueFields) {
@ -185,7 +185,7 @@ public class ZenodoBuilder {
List<ZenodoRelator> relatedIdentifiers = new ArrayList<>();
for(DescriptionModel descriptionModel: dmp.getDescriptions()){
for(String relatedId: this.identifierProperties.getRelated()){
List<eu.eudat.commonmodels.models.descriptiotemplate.FieldModel> fields = this.findSchematicValues(relatedId, descriptionModel.getDescriptionTemplate().getDefinition());
List<org.opencdmp.commonmodels.models.descriptiotemplate.FieldModel> fields = this.findSchematicValues(relatedId, descriptionModel.getDescriptionTemplate().getDefinition());
Set<String> values = extractSchematicValues(fields, descriptionModel.getProperties(), acceptedPidTypes);
for(String value: values){
ZenodoRelator relator = new ZenodoRelator();

View File

@ -1,4 +1,4 @@
package eu.eudat.depositinterface.zenodorepository.service.storage;
package org.opencdmp.deposit.zenodorepository.service.storage;
public interface FileStorageService {
String storeFile(byte[] data);

View File

@ -1,4 +1,4 @@
package eu.eudat.depositinterface.zenodorepository.service.storage;
package org.opencdmp.deposit.zenodorepository.service.storage;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Configuration;

View File

@ -1,4 +1,4 @@
package eu.eudat.depositinterface.zenodorepository.service.storage;
package org.opencdmp.deposit.zenodorepository.service.storage;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

View File

@ -1,4 +1,4 @@
package eu.eudat.depositinterface.zenodorepository.service.storage;
package org.opencdmp.deposit.zenodorepository.service.storage;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.bind.ConstructorBinding;

View File

@ -1,7 +1,7 @@
package eu.eudat.depositinterface.zenodorepository.service.zenodo;
package org.opencdmp.deposit.zenodorepository.service.zenodo;
import eu.eudat.commonmodels.models.dmp.DmpModel;
import eu.eudat.depositinterface.repository.DepositConfiguration;
import org.opencdmp.commonmodels.models.dmp.DmpModel;
import org.opencdmp.depositbase.repository.DepositConfiguration;
public interface ZenodoDepositService {
String deposit(DmpModel dmpDepositModel, String zenodoToken) throws Exception;

View File

@ -1,12 +1,12 @@
package eu.eudat.depositinterface.zenodorepository.service.zenodo;
package org.opencdmp.deposit.zenodorepository.service.zenodo;
import com.fasterxml.jackson.databind.ObjectMapper;
import eu.eudat.commonmodels.models.FileEnvelopeModel;
import eu.eudat.commonmodels.models.dmp.DmpModel;
import eu.eudat.depositinterface.repository.DepositConfiguration;
import eu.eudat.depositinterface.zenodorepository.model.ZenodoDeposit;
import eu.eudat.depositinterface.zenodorepository.model.builder.ZenodoBuilder;
import eu.eudat.depositinterface.zenodorepository.service.storage.FileStorageService;
import org.opencdmp.commonmodels.models.FileEnvelopeModel;
import org.opencdmp.commonmodels.models.dmp.DmpModel;
import org.opencdmp.depositbase.repository.DepositConfiguration;
import org.opencdmp.deposit.zenodorepository.model.ZenodoDeposit;
import org.opencdmp.deposit.zenodorepository.model.builder.ZenodoBuilder;
import org.opencdmp.deposit.zenodorepository.service.storage.FileStorageService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -82,7 +82,7 @@ public class ZenodoDepositServiceImpl implements ZenodoDepositService {
DepositConfiguration zenodoConfig = this.zenodoServiceProperties.getDepositConfiguration();
if (zenodoConfig == null) return null;
eu.eudat.depositinterface.zenodorepository.model.ZenodoDeposit deposit = zenodoBuilder.build(dmpModel);
ZenodoDeposit deposit = zenodoBuilder.build(dmpModel);
LinkedHashMap<String, String> links;
String previousDOI = dmpModel.getPreviousDOI();

View File

@ -1,4 +1,4 @@
package eu.eudat.depositinterface.zenodorepository.service.zenodo;
package org.opencdmp.deposit.zenodorepository.service.zenodo;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Configuration;

View File

@ -1,8 +1,7 @@
package eu.eudat.depositinterface.zenodorepository.service.zenodo;
package org.opencdmp.deposit.zenodorepository.service.zenodo;
import eu.eudat.depositinterface.repository.DepositConfiguration;
import org.opencdmp.depositbase.repository.DepositConfiguration;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.bind.ConstructorBinding;
@ConfigurationProperties(prefix = "zenodo")
public class ZenodoServiceProperties {

View File

@ -8,7 +8,7 @@
<version>3.2.4</version>
</parent>
<groupId>gr.cite.opendmp</groupId>
<groupId>org.opencdmp</groupId>
<artifactId>repository-deposit-parent</artifactId>
<version>${revision}</version>
<packaging>pom</packaging>
@ -27,9 +27,9 @@
</modules>
<dependencies>
<dependency>
<groupId>gr.cite.opendmp</groupId>
<groupId>org.opencdmp</groupId>
<artifactId>repositorydepositbase</artifactId>
<version>2.0.7</version>
<version>2.0.8</version>
</dependency>
</dependencies>

View File

@ -3,7 +3,7 @@
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>
<parent>
<groupId>gr.cite.opendmp</groupId>
<groupId>org.opencdmp</groupId>
<artifactId>repository-deposit-parent</artifactId>
<version>${revision}</version>
<relativePath>../pom.xml</relativePath>
@ -41,7 +41,7 @@
<artifactId>spring-boot-starter-cache</artifactId>
</dependency>
<dependency>
<groupId>gr.cite.opendmp</groupId>
<groupId>org.opencdmp</groupId>
<artifactId>repositorydepositzenodo</artifactId>
<version>${revision}</version>
</dependency>

View File

@ -1,11 +1,11 @@
package eu.eudat.deposit;
package org.opencdmp.deposit;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication(scanBasePackages = {
"eu.eudat.deposit.*",
"eu.eudat.depositinterface.*",
"org.opencdmp.deposit.*",
"org.opencdmp.depositbase.*",
"gr.cite.tools",
"gr.cite.commons"
})

View File

@ -1,4 +1,4 @@
package eu.eudat.deposit.config;
package org.opencdmp.deposit.config;
import gr.cite.commons.web.oidc.configuration.WebSecurityProperties;
import gr.cite.commons.web.oidc.configuration.filter.ApiKeyFilter;

View File

@ -1,14 +1,14 @@
package eu.eudat.deposit.controller;
package org.opencdmp.deposit.controller;
import eu.eudat.commonmodels.models.dmp.DmpModel;
import eu.eudat.depositinterface.repository.DepositConfiguration;
import eu.eudat.depositinterface.zenodorepository.service.zenodo.ZenodoDepositService;
import org.opencdmp.commonmodels.models.dmp.DmpModel;
import org.opencdmp.depositbase.repository.DepositConfiguration;
import org.opencdmp.deposit.zenodorepository.service.zenodo.ZenodoDepositService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/api/deposit")
public class DepositController implements eu.eudat.depositinterface.repository.DepositController {
public class DepositController implements org.opencdmp.depositbase.repository.DepositController {
private final ZenodoDepositService depositClient;