Merge branch 'dmp-refactoring' of https://code-repo.d4science.org/MaDgiK-CITE/argos into dmp-refactoring

This commit is contained in:
Sofia Papacharalampous 2024-04-01 12:14:27 +03:00
commit 72c9137d8b
54 changed files with 107 additions and 381 deletions

View File

@ -180,6 +180,19 @@
</property> </property>
</activation> </activation>
</profile> </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>

View File

@ -82,23 +82,9 @@
<dependency> <dependency>
<groupId>gr.cite</groupId> <groupId>gr.cite</groupId>
<artifactId>keycloak-api</artifactId> <artifactId>keycloak-api</artifactId>
<version>1.0.0</version> <version>2.2.0</version>
</dependency>
<dependency>
<groupId>gr.cite</groupId>
<artifactId>data-tools</artifactId>
<version>2.1.2</version>
</dependency> </dependency>
<dependency>
<groupId>org.eclipse.angus</groupId>
<artifactId>jakarta.mail</artifactId>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.9.4</version>
</dependency>
</dependencies> </dependencies>
<build> <build>

View File

@ -1,4 +1,4 @@
package eu.eudat.configurations.locale; package eu.eudat.commons.locale;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties;

View File

@ -1,4 +1,4 @@
package eu.eudat.configurations.locale; package eu.eudat.commons.locale;
import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.ConfigurationProperties;

View File

@ -1,4 +1,4 @@
package eu.eudat.configurations.notification; package eu.eudat.commons.notification;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties;

View File

@ -1,4 +1,4 @@
package eu.eudat.configurations.notification; package eu.eudat.commons.notification;
import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.ConfigurationProperties;

View File

@ -1,9 +0,0 @@
package eu.eudat.configurations.transformer;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Configuration;
@Configuration
@EnableConfigurationProperties({TransformerProperties.class, TransformerCacheOptions.class})
public class TransformerConfiguration {
}

View File

@ -1,4 +1,4 @@
package eu.eudat.configurations.db; package eu.eudat.data.namingstrategy;
import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.bind.ConstructorBinding; import org.springframework.boot.context.properties.bind.ConstructorBinding;

View File

@ -1,4 +1,4 @@
package eu.eudat.configurations.db; package eu.eudat.data.namingstrategy;
import eu.eudat.convention.ConventionService; import eu.eudat.convention.ConventionService;
import org.hibernate.boot.model.naming.Identifier; import org.hibernate.boot.model.naming.Identifier;

View File

@ -2,20 +2,14 @@ package eu.eudat.elastic.query;
import co.elastic.clients.elasticsearch._types.query_dsl.Query; import co.elastic.clients.elasticsearch._types.query_dsl.Query;
import co.elastic.clients.elasticsearch._types.query_dsl.QueryBuilders; import co.elastic.clients.elasticsearch._types.query_dsl.QueryBuilders;
import eu.eudat.authorization.AuthorizationFlags; import eu.eudat.authorization.AuthorizationFlags;
import eu.eudat.authorization.Permission;
import eu.eudat.commons.enums.DescriptionStatus; import eu.eudat.commons.enums.DescriptionStatus;
import eu.eudat.commons.enums.DmpAccessType; import eu.eudat.commons.enums.DmpAccessType;
import eu.eudat.commons.enums.DmpStatus; import eu.eudat.commons.enums.DmpStatus;
import eu.eudat.commons.enums.IsActive;
import eu.eudat.commons.scope.user.UserScope; import eu.eudat.commons.scope.user.UserScope;
import eu.eudat.configurations.elastic.AppElasticProperties; import eu.eudat.service.elastic.AppElasticProperties;
import eu.eudat.data.DescriptionEntity;
import eu.eudat.elastic.data.DescriptionElasticEntity; import eu.eudat.elastic.data.DescriptionElasticEntity;
import eu.eudat.elastic.data.DmpElasticEntity; import eu.eudat.elastic.data.DmpElasticEntity;
import eu.eudat.elastic.data.nested.NestedDmpElasticEntity; import eu.eudat.elastic.data.nested.NestedDmpElasticEntity;
import eu.eudat.query.DescriptionQuery;
import eu.eudat.query.DmpDescriptionTemplateQuery;
import eu.eudat.query.DmpQuery;
import eu.eudat.service.elastic.ElasticService; import eu.eudat.service.elastic.ElasticService;
import gr.cite.commons.web.authz.service.AuthorizationService; import gr.cite.commons.web.authz.service.AuthorizationService;
import gr.cite.tools.data.query.FieldResolver; import gr.cite.tools.data.query.FieldResolver;
@ -35,7 +29,6 @@ import org.springframework.stereotype.Component;
import java.io.IOException; import java.io.IOException;
import java.time.Instant; import java.time.Instant;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
@Component @Component
//Like in C# make it Transient //Like in C# make it Transient

View File

@ -6,15 +6,10 @@ import eu.eudat.authorization.Permission;
import eu.eudat.commons.enums.DmpAccessType; import eu.eudat.commons.enums.DmpAccessType;
import eu.eudat.commons.enums.DmpStatus; import eu.eudat.commons.enums.DmpStatus;
import eu.eudat.commons.enums.DmpVersionStatus; import eu.eudat.commons.enums.DmpVersionStatus;
import eu.eudat.commons.enums.IsActive;
import eu.eudat.commons.scope.user.UserScope; import eu.eudat.commons.scope.user.UserScope;
import eu.eudat.configurations.elastic.AppElasticProperties; import eu.eudat.service.elastic.AppElasticProperties;
import eu.eudat.data.DmpEntity;
import eu.eudat.elastic.data.DescriptionElasticEntity;
import eu.eudat.elastic.data.DmpElasticEntity; import eu.eudat.elastic.data.DmpElasticEntity;
import eu.eudat.elastic.data.nested.NestedDescriptionElasticEntity; import eu.eudat.elastic.data.nested.NestedDescriptionElasticEntity;
import eu.eudat.query.DmpQuery;
import eu.eudat.query.utils.QueryUtilsService;
import eu.eudat.service.elastic.ElasticService; import eu.eudat.service.elastic.ElasticService;
import gr.cite.commons.web.authz.service.AuthorizationService; import gr.cite.commons.web.authz.service.AuthorizationService;
import gr.cite.tools.data.query.FieldResolver; import gr.cite.tools.data.query.FieldResolver;
@ -22,8 +17,6 @@ import gr.cite.tools.data.query.QueryFactory;
import gr.cite.tools.elastic.configuration.ElasticProperties; import gr.cite.tools.elastic.configuration.ElasticProperties;
import gr.cite.tools.elastic.mapper.FieldBasedMapper; import gr.cite.tools.elastic.mapper.FieldBasedMapper;
import gr.cite.tools.elastic.query.*; import gr.cite.tools.elastic.query.*;
import jakarta.persistence.criteria.Predicate;
import org.elasticsearch.index.query.QueryBuilder;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.Scope; import org.springframework.context.annotation.Scope;

View File

@ -6,7 +6,7 @@ import eu.eudat.commons.enums.ContactInfoType;
import eu.eudat.commons.enums.notification.NotificationContactType; import eu.eudat.commons.enums.notification.NotificationContactType;
import eu.eudat.commons.scope.user.UserScope; import eu.eudat.commons.scope.user.UserScope;
import eu.eudat.commons.types.notification.*; import eu.eudat.commons.types.notification.*;
import eu.eudat.configurations.notification.NotificationProperties; import eu.eudat.commons.notification.NotificationProperties;
import eu.eudat.data.UserContactInfoEntity; import eu.eudat.data.UserContactInfoEntity;
import eu.eudat.integrationevent.outbox.notification.NotifyIntegrationEvent; import eu.eudat.integrationevent.outbox.notification.NotifyIntegrationEvent;
import eu.eudat.integrationevent.outbox.notification.NotifyIntegrationEventHandler; import eu.eudat.integrationevent.outbox.notification.NotifyIntegrationEventHandler;

View File

@ -1,4 +1,4 @@
package eu.eudat.configurations.deposit; package eu.eudat.service.deposit;
import gr.cite.tools.cache.CacheOptions; import gr.cite.tools.cache.CacheOptions;
import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.ConfigurationProperties;

View File

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

View File

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

View File

@ -7,8 +7,6 @@ import eu.eudat.commonmodels.models.FileEnvelopeModel;
import eu.eudat.commonmodels.models.dmp.DmpModel; import eu.eudat.commonmodels.models.dmp.DmpModel;
import eu.eudat.commons.enums.StorageType; import eu.eudat.commons.enums.StorageType;
import eu.eudat.commons.scope.user.UserScope; import eu.eudat.commons.scope.user.UserScope;
import eu.eudat.configurations.deposit.DepositProperties;
import eu.eudat.convention.ConventionService;
import eu.eudat.data.DmpEntity; import eu.eudat.data.DmpEntity;
import eu.eudat.depositinterface.repository.DepositClient; import eu.eudat.depositinterface.repository.DepositClient;
import eu.eudat.depositinterface.repository.DepositConfiguration; import eu.eudat.depositinterface.repository.DepositConfiguration;

View File

@ -16,7 +16,7 @@ import eu.eudat.commons.types.descriptiontemplate.fielddata.ReferenceTypeDataEnt
import eu.eudat.commons.types.descriptiontemplate.fielddata.UploadDataEntity; import eu.eudat.commons.types.descriptiontemplate.fielddata.UploadDataEntity;
import eu.eudat.commons.types.notification.*; import eu.eudat.commons.types.notification.*;
import eu.eudat.commons.types.reference.DefinitionEntity; import eu.eudat.commons.types.reference.DefinitionEntity;
import eu.eudat.configurations.notification.NotificationProperties; import eu.eudat.commons.notification.NotificationProperties;
import eu.eudat.convention.ConventionService; import eu.eudat.convention.ConventionService;
import eu.eudat.data.*; import eu.eudat.data.*;
import eu.eudat.errorcode.ErrorThesaurusProperties; import eu.eudat.errorcode.ErrorThesaurusProperties;

View File

@ -14,7 +14,7 @@ import eu.eudat.commons.types.descriptiontemplate.fielddata.BaseFieldDataEntity;
import eu.eudat.commons.types.descriptiontemplate.fielddata.ReferenceTypeDataEntity; import eu.eudat.commons.types.descriptiontemplate.fielddata.ReferenceTypeDataEntity;
import eu.eudat.commons.types.descriptiontemplate.importexport.*; import eu.eudat.commons.types.descriptiontemplate.importexport.*;
import eu.eudat.commons.types.notification.*; import eu.eudat.commons.types.notification.*;
import eu.eudat.configurations.notification.NotificationProperties; import eu.eudat.commons.notification.NotificationProperties;
import eu.eudat.convention.ConventionService; import eu.eudat.convention.ConventionService;
import eu.eudat.data.*; import eu.eudat.data.*;
import eu.eudat.errorcode.ErrorThesaurusProperties; import eu.eudat.errorcode.ErrorThesaurusProperties;
@ -51,6 +51,7 @@ import gr.cite.tools.logging.MapLogEntry;
import gr.cite.tools.validation.ValidatorFactory; import gr.cite.tools.validation.ValidatorFactory;
import jakarta.persistence.EntityManager; import jakarta.persistence.EntityManager;
import jakarta.xml.bind.JAXBException; import jakarta.xml.bind.JAXBException;
import org.apache.commons.lang3.NotImplementedException;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -61,7 +62,6 @@ import org.springframework.stereotype.Service;
import org.xml.sax.SAXException; import org.xml.sax.SAXException;
import javax.management.InvalidApplicationException; import javax.management.InvalidApplicationException;
import javax.ws.rs.NotSupportedException;
import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerException;
import java.io.IOException; import java.io.IOException;
@ -405,7 +405,7 @@ public class DescriptionTemplateServiceImpl implements DescriptionTemplateServic
if (FieldType.isTextType(fieldType)) { if (FieldType.isTextType(fieldType)) {
if (FieldType.UPLOAD.equals(fieldType) && !this.conventionService.isNullOrEmpty(persist.getTextValue())){ if (FieldType.UPLOAD.equals(fieldType) && !this.conventionService.isNullOrEmpty(persist.getTextValue())){
throw new NotSupportedException("Upload not supported"); throw new NotImplementedException("Upload not supported");
} else { } else {
data.setTextValue(persist.getTextValue()); data.setTextValue(persist.getTextValue());
} }

View File

@ -18,7 +18,7 @@ import eu.eudat.commons.types.dmpreference.DmpReferenceDataEntity;
import eu.eudat.commons.types.notification.*; import eu.eudat.commons.types.notification.*;
import eu.eudat.commons.types.reference.DefinitionEntity; import eu.eudat.commons.types.reference.DefinitionEntity;
import eu.eudat.commons.types.reference.FieldEntity; import eu.eudat.commons.types.reference.FieldEntity;
import eu.eudat.configurations.notification.NotificationProperties; import eu.eudat.commons.notification.NotificationProperties;
import eu.eudat.convention.ConventionService; import eu.eudat.convention.ConventionService;
import eu.eudat.data.*; import eu.eudat.data.*;
import eu.eudat.errorcode.ErrorThesaurusProperties; import eu.eudat.errorcode.ErrorThesaurusProperties;

View File

@ -1,4 +1,4 @@
package eu.eudat.configurations.elastic; package eu.eudat.service.elastic;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties;

View File

@ -1,4 +1,4 @@
package eu.eudat.configurations.elastic; package eu.eudat.service.elastic;
import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.ConfigurationProperties;

View File

@ -6,7 +6,6 @@ import co.elastic.clients.elasticsearch._types.mapping.TypeMapping;
import co.elastic.clients.elasticsearch.indices.*; import co.elastic.clients.elasticsearch.indices.*;
import eu.eudat.authorization.Permission; import eu.eudat.authorization.Permission;
import eu.eudat.commons.enums.IsActive; import eu.eudat.commons.enums.IsActive;
import eu.eudat.configurations.elastic.AppElasticProperties;
import eu.eudat.data.DescriptionEntity; import eu.eudat.data.DescriptionEntity;
import eu.eudat.data.DmpEntity; import eu.eudat.data.DmpEntity;
import eu.eudat.elastic.data.DescriptionElasticEntity; import eu.eudat.elastic.data.DescriptionElasticEntity;

View File

@ -1,4 +1,4 @@
package eu.eudat.configurations.keycloak; package eu.eudat.service.keycloak;
import org.springframework.boot.context.properties.bind.ConstructorBinding; import org.springframework.boot.context.properties.bind.ConstructorBinding;

View File

@ -1,12 +1,9 @@
package eu.eudat.configurations.keycloak; package eu.eudat.service.keycloak;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import java.util.ArrayList;
import java.util.List;
@Configuration @Configuration
@EnableConfigurationProperties(KeycloakResourcesProperties.class) @EnableConfigurationProperties(KeycloakResourcesProperties.class)
public class KeycloakResourcesConfiguration { public class KeycloakResourcesConfiguration {

View File

@ -1,4 +1,4 @@
package eu.eudat.configurations.keycloak; package eu.eudat.service.keycloak;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.ConfigurationProperties;

View File

@ -1,8 +1,5 @@
package eu.eudat.service.keycloak; package eu.eudat.service.keycloak;
import com.google.common.collect.Lists;
import eu.eudat.configurations.keycloak.KeycloakAuthorityProperties;
import eu.eudat.configurations.keycloak.KeycloakResourcesConfiguration;
import gr.cite.commons.web.keycloak.api.configuration.KeycloakClientConfiguration; import gr.cite.commons.web.keycloak.api.configuration.KeycloakClientConfiguration;
import gr.cite.tools.logging.LoggerService; import gr.cite.tools.logging.LoggerService;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
@ -12,10 +9,7 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.HashSet; import java.util.*;
import java.util.List;
import java.util.Set;
import java.util.UUID;
@Service @Service
public class KeycloakServiceImpl implements KeycloakService { public class KeycloakServiceImpl implements KeycloakService {
@ -61,7 +55,7 @@ public class KeycloakServiceImpl implements KeycloakService {
if (clientId == null) if (clientId == null)
clientId = clientConfiguration.getProperties().getClientId(); clientId = clientConfiguration.getProperties().getClientId();
UserRepresentation user = api.users().findUserById(subjectId.toString()); UserRepresentation user = api.users().findUserById(subjectId.toString());
user.getClientRoles().computeIfAbsent(clientId, k -> Lists.newArrayList()); user.getClientRoles().computeIfAbsent(clientId, k -> new ArrayList<>());
Set<String> clientRoles = new HashSet<>(Set.copyOf(user.getClientRoles().get(clientId))); Set<String> clientRoles = new HashSet<>(Set.copyOf(user.getClientRoles().get(clientId)));
clientRoles.add(role.name()); clientRoles.add(role.name());
user.getClientRoles().get(clientId).clear(); user.getClientRoles().get(clientId).clear();
@ -73,7 +67,7 @@ public class KeycloakServiceImpl implements KeycloakService {
public void removeClientRoleFromUser(UUID subjectId, String clientId, KeycloakRole role) { public void removeClientRoleFromUser(UUID subjectId, String clientId, KeycloakRole role) {
if (clientId == null) clientId = clientConfiguration.getProperties().getClientId(); if (clientId == null) clientId = clientConfiguration.getProperties().getClientId();
UserRepresentation user = api.users().findUserById(subjectId.toString()); UserRepresentation user = api.users().findUserById(subjectId.toString());
user.getClientRoles().computeIfAbsent(clientId, k -> Lists.newArrayList()); user.getClientRoles().computeIfAbsent(clientId, k -> new ArrayList<>());
Set<String> clientRoles = new HashSet<>(Set.copyOf(user.getClientRoles().get(clientId))); Set<String> clientRoles = new HashSet<>(Set.copyOf(user.getClientRoles().get(clientId)));
clientRoles.remove(role.name()); clientRoles.remove(role.name());
user.getClientRoles().get(clientId).clear(); user.getClientRoles().get(clientId).clear();

View File

@ -1,4 +1,4 @@
package eu.eudat.configurations.lock; package eu.eudat.service.lock;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties;

View File

@ -1,4 +1,4 @@
package eu.eudat.configurations.lock; package eu.eudat.service.lock;
import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.ConfigurationProperties;

View File

@ -6,7 +6,6 @@ import eu.eudat.authorization.Permission;
import eu.eudat.authorization.authorizationcontentresolver.AuthorizationContentResolver; import eu.eudat.authorization.authorizationcontentresolver.AuthorizationContentResolver;
import eu.eudat.commons.enums.LockTargetType; import eu.eudat.commons.enums.LockTargetType;
import eu.eudat.commons.scope.user.UserScope; import eu.eudat.commons.scope.user.UserScope;
import eu.eudat.configurations.lock.LockProperties;
import eu.eudat.convention.ConventionService; import eu.eudat.convention.ConventionService;
import eu.eudat.data.LockEntity; import eu.eudat.data.LockEntity;
import eu.eudat.errorcode.ErrorThesaurusProperties; import eu.eudat.errorcode.ErrorThesaurusProperties;

View File

@ -1,4 +1,4 @@
package eu.eudat.configurations.tenant; package eu.eudat.service.tenant;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties;

View File

@ -1,4 +1,4 @@
package eu.eudat.configurations.tenant; package eu.eudat.service.tenant;
import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.ConfigurationProperties;

View File

@ -5,7 +5,6 @@ import eu.eudat.authorization.Permission;
import eu.eudat.commons.XmlHandlingService; import eu.eudat.commons.XmlHandlingService;
import eu.eudat.commons.enums.IsActive; import eu.eudat.commons.enums.IsActive;
import eu.eudat.commons.types.tenant.*; import eu.eudat.commons.types.tenant.*;
import eu.eudat.configurations.tenant.TenantProperties;
import eu.eudat.convention.ConventionService; import eu.eudat.convention.ConventionService;
import eu.eudat.data.TenantEntity; import eu.eudat.data.TenantEntity;
import eu.eudat.errorcode.ErrorThesaurusProperties; import eu.eudat.errorcode.ErrorThesaurusProperties;

View File

@ -1,8 +1,8 @@
package eu.eudat.configurations.transformer; package eu.eudat.service.transformer;
import gr.cite.tools.cache.CacheOptions; import gr.cite.tools.cache.CacheOptions;
import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.ConfigurationProperties;
@ConfigurationProperties(prefix = "cache.transformer") @ConfigurationProperties(prefix = "cache.transformer")
public class TransformerCacheOptions extends CacheOptions { public class FileTransformerCacheOptions extends CacheOptions {
} }

View File

@ -0,0 +1,9 @@
package eu.eudat.service.transformer;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Configuration;
@Configuration
@EnableConfigurationProperties({FileTransformerProperties.class, FileTransformerCacheOptions.class})
public class FileTransformerConfiguration {
}

View File

@ -1,19 +1,15 @@
package eu.eudat.service.transformer; package eu.eudat.service.transformer;
import eu.eudat.configurations.deposit.DepositCacheOptions;
import eu.eudat.configurations.transformer.TransformerCacheOptions;
import eu.eudat.model.file.TransformerCacheModel; import eu.eudat.model.file.TransformerCacheModel;
import gr.cite.tools.cache.CacheService; import gr.cite.tools.cache.CacheService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.List;
@Component @Component
public class FileTransformerConfigurationCache extends CacheService<TransformerCacheModel> { public class FileTransformerConfigurationCache extends CacheService<TransformerCacheModel> {
@Autowired @Autowired
public FileTransformerConfigurationCache(TransformerCacheOptions options) { public FileTransformerConfigurationCache(FileTransformerCacheOptions options) {
super(options); super(options);
} }

View File

@ -1,4 +1,4 @@
package eu.eudat.configurations.transformer; package eu.eudat.service.transformer;
import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.bind.ConstructorBinding; import org.springframework.boot.context.properties.bind.ConstructorBinding;
@ -6,12 +6,12 @@ import org.springframework.boot.context.properties.bind.ConstructorBinding;
import java.util.List; import java.util.List;
@ConfigurationProperties(prefix = "transformer") @ConfigurationProperties(prefix = "transformer")
public class TransformerProperties { public class FileTransformerProperties {
private final List<TransformerSource> sources; private final List<TransformerSource> sources;
@ConstructorBinding @ConstructorBinding
public TransformerProperties(List<TransformerSource> sources) { public FileTransformerProperties(List<TransformerSource> sources) {
this.sources = sources; this.sources = sources;
} }

View File

@ -6,9 +6,7 @@ import eu.eudat.commonmodels.models.FileEnvelopeModel;
import eu.eudat.commonmodels.models.description.DescriptionModel; import eu.eudat.commonmodels.models.description.DescriptionModel;
import eu.eudat.commonmodels.models.dmp.DmpModel; import eu.eudat.commonmodels.models.dmp.DmpModel;
import eu.eudat.commons.enums.StorageType; import eu.eudat.commons.enums.StorageType;
import eu.eudat.configurations.transformer.TransformerProperties;
import eu.eudat.file.transformer.interfaces.FileTransformerConfiguration; import eu.eudat.file.transformer.interfaces.FileTransformerConfiguration;
import eu.eudat.file.transformer.models.misc.FileFormat;
import eu.eudat.model.Description; import eu.eudat.model.Description;
import eu.eudat.model.Dmp; import eu.eudat.model.Dmp;
import eu.eudat.model.builder.commonmodels.description.DescriptionCommonModelBuilder; import eu.eudat.model.builder.commonmodels.description.DescriptionCommonModelBuilder;
@ -43,7 +41,7 @@ import java.util.*;
public class FileTransformerServiceImpl implements FileTransformerService { public class FileTransformerServiceImpl implements FileTransformerService {
private static final Logger logger = LoggerFactory.getLogger(FileTransformerServiceImpl.class); private static final Logger logger = LoggerFactory.getLogger(FileTransformerServiceImpl.class);
private final TransformerProperties transformerProperties; private final FileTransformerProperties fileTransformerProperties;
private final Map<String, TransformerRepository> clients; private final Map<String, TransformerRepository> clients;
private final TokenExchangeCacheService tokenExchangeCacheService; private final TokenExchangeCacheService tokenExchangeCacheService;
private final FileTransformerConfigurationCache fileTransformerConfigurationCache; private final FileTransformerConfigurationCache fileTransformerConfigurationCache;
@ -54,9 +52,9 @@ public class FileTransformerServiceImpl implements FileTransformerService {
private final MessageSource messageSource; private final MessageSource messageSource;
@Autowired @Autowired
public FileTransformerServiceImpl(TransformerProperties transformerProperties, TokenExchangeCacheService tokenExchangeCacheService, FileTransformerConfigurationCache fileTransformerConfigurationCache, AuthorizationService authorizationService, public FileTransformerServiceImpl(FileTransformerProperties fileTransformerProperties, TokenExchangeCacheService tokenExchangeCacheService, FileTransformerConfigurationCache fileTransformerConfigurationCache, AuthorizationService authorizationService,
QueryFactory queryFactory, BuilderFactory builderFactory, StorageFileService storageFileService, MessageSource messageSource) { QueryFactory queryFactory, BuilderFactory builderFactory, StorageFileService storageFileService, MessageSource messageSource) {
this.transformerProperties = transformerProperties; this.fileTransformerProperties = fileTransformerProperties;
this.tokenExchangeCacheService = tokenExchangeCacheService; this.tokenExchangeCacheService = tokenExchangeCacheService;
this.fileTransformerConfigurationCache = fileTransformerConfigurationCache; this.fileTransformerConfigurationCache = fileTransformerConfigurationCache;
this.authorizationService = authorizationService; this.authorizationService = authorizationService;
@ -71,7 +69,7 @@ public class FileTransformerServiceImpl implements FileTransformerService {
if (this.clients.containsKey(repoId)) return this.clients.get(repoId); if (this.clients.containsKey(repoId)) return this.clients.get(repoId);
//GK: It's register time //GK: It's register time
TransformerProperties.TransformerSource source = transformerProperties.getSources().stream().filter(depositSource -> depositSource.getTransformerId().equals(repoId)).findFirst().orElse(null); FileTransformerProperties.TransformerSource source = fileTransformerProperties.getSources().stream().filter(depositSource -> depositSource.getTransformerId().equals(repoId)).findFirst().orElse(null);
if (source != null) { if (source != null) {
String host = URI.create(source.getUrl()).getHost(); String host = URI.create(source.getUrl()).getHost();
TokenExchangeModel tokenExchangeModel = new TokenExchangeModel(host + "_" + source.getClientId(), source.getIssuerUrl(), source.getClientId(), source.getClientSecret(), source.getScope()); TokenExchangeModel tokenExchangeModel = new TokenExchangeModel(host + "_" + source.getClientId(), source.getIssuerUrl(), source.getClientId(), source.getClientSecret(), source.getScope());
@ -105,7 +103,7 @@ public class FileTransformerServiceImpl implements FileTransformerService {
if (configs == null) { if (configs == null) {
List<FileTransformerConfiguration> configurations = new ArrayList<>(); List<FileTransformerConfiguration> configurations = new ArrayList<>();
//GK: So much for lazy loading //GK: So much for lazy loading
List<TransformerRepository> repositories = transformerProperties.getSources().stream().map(depositSource -> getRepository(depositSource.getTransformerId())).toList(); List<TransformerRepository> repositories = fileTransformerProperties.getSources().stream().map(depositSource -> getRepository(depositSource.getTransformerId())).toList();
repositories = new ArrayList<>(repositories); repositories = new ArrayList<>(repositories);
repositories.forEach((client) -> { repositories.forEach((client) -> {

View File

@ -17,7 +17,7 @@ import eu.eudat.commons.types.actionconfirmation.RemoveCredentialRequestEntity;
import eu.eudat.commons.types.notification.*; import eu.eudat.commons.types.notification.*;
import eu.eudat.commons.types.user.AdditionalInfoEntity; import eu.eudat.commons.types.user.AdditionalInfoEntity;
import eu.eudat.commons.types.usercredential.UserCredentialDataEntity; import eu.eudat.commons.types.usercredential.UserCredentialDataEntity;
import eu.eudat.configurations.notification.NotificationProperties; import eu.eudat.commons.notification.NotificationProperties;
import eu.eudat.convention.ConventionService; import eu.eudat.convention.ConventionService;
import eu.eudat.data.*; import eu.eudat.data.*;
import eu.eudat.errorcode.ErrorThesaurusProperties; import eu.eudat.errorcode.ErrorThesaurusProperties;

View File

@ -3,8 +3,8 @@ package eu.eudat.service.visibility;
import eu.eudat.commons.types.description.PropertyDefinitionEntity; import eu.eudat.commons.types.description.PropertyDefinitionEntity;
import eu.eudat.commons.types.descriptiontemplate.*; import eu.eudat.commons.types.descriptiontemplate.*;
import eu.eudat.model.persist.descriptionproperties.PropertyDefinitionPersist; import eu.eudat.model.persist.descriptionproperties.PropertyDefinitionPersist;
import org.apache.commons.lang3.NotImplementedException;
import javax.ws.rs.NotSupportedException;
import java.util.*; import java.util.*;
public class VisibilityServiceImpl implements VisibilityService { public class VisibilityServiceImpl implements VisibilityService {
@ -349,7 +349,7 @@ public class VisibilityServiceImpl implements VisibilityService {
eu.eudat.commons.enums.FieldType fieldType = rule.getFieldEntity() != null && rule.getFieldEntity().getData() != null ? rule.getFieldEntity().getData().getFieldType() : eu.eudat.commons.enums.FieldType.FREE_TEXT; eu.eudat.commons.enums.FieldType fieldType = rule.getFieldEntity() != null && rule.getFieldEntity().getData() != null ? rule.getFieldEntity().getData().getFieldType() : eu.eudat.commons.enums.FieldType.FREE_TEXT;
if (eu.eudat.commons.enums.FieldType.isTextType(fieldType) && field.getTextValue() != null && !field.getTextValue().isBlank()) { if (eu.eudat.commons.enums.FieldType.isTextType(fieldType) && field.getTextValue() != null && !field.getTextValue().isBlank()) {
if (eu.eudat.commons.enums.FieldType.UPLOAD.equals(fieldType)){ if (eu.eudat.commons.enums.FieldType.UPLOAD.equals(fieldType)){
throw new NotSupportedException("Upload file rule not supported"); throw new NotImplementedException("Upload file rule not supported");
} else { } else {
return field.getTextValue().equals(rule.getTextValue()); return field.getTextValue().equals(rule.getTextValue());
} }
@ -364,7 +364,7 @@ public class VisibilityServiceImpl implements VisibilityService {
} }
else if (eu.eudat.commons.enums.FieldType.isDateType(fieldType) && field.getDateValue() != null) return field.getDateValue().equals(rule.getDateValue()); else if (eu.eudat.commons.enums.FieldType.isDateType(fieldType) && field.getDateValue() != null) return field.getDateValue().equals(rule.getDateValue());
else if (eu.eudat.commons.enums.FieldType.isExternalIdentifierType(fieldType) && field.getExternalIdentifier() != null) { else if (eu.eudat.commons.enums.FieldType.isExternalIdentifierType(fieldType) && field.getExternalIdentifier() != null) {
throw new NotSupportedException("External identifier rule not supported"); throw new NotImplementedException("External identifier rule not supported");
} }
} }
return false; return false;

View File

@ -10,7 +10,7 @@
<parent> <parent>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId> <artifactId>spring-boot-starter-parent</artifactId>
<version>3.2.1</version> <version>3.2.4</version>
</parent> </parent>
<modules> <modules>
@ -94,6 +94,13 @@
<artifactId>elasticsearch-rest-high-level-client</artifactId> <artifactId>elasticsearch-rest-high-level-client</artifactId>
<version>7.17.19</version> <version>7.17.19</version>
</dependency> </dependency>
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>transport</artifactId>
<version>7.6.0</version>
</dependency>
<dependency> <dependency>
<groupId>org.hibernate.orm</groupId> <groupId>org.hibernate.orm</groupId>
<artifactId>hibernate-core</artifactId> <artifactId>hibernate-core</artifactId>
@ -133,12 +140,7 @@
<dependency> <dependency>
<groupId>com.fasterxml.jackson.datatype</groupId> <groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId> <artifactId>jackson-datatype-jsr310</artifactId>
<version>2.13.3</version> <version>2.17.0</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.module</groupId>
<artifactId>jackson-module-jaxb-annotations</artifactId>
</dependency> </dependency>
<!-- g/a spring --> <!-- g/a spring -->
@ -150,94 +152,25 @@
<dependency> <dependency>
<groupId>org.apache.commons</groupId> <groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId> <artifactId>commons-lang3</artifactId>
<version>3.5</version> <version>3.14.0</version>
</dependency> </dependency>
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi --> <!-- https://mvnrepository.com/artifact/org.apache.poi/poi -->
<!-- https://mvnrepository.com/artifact/org.apache.xmlgraphics/fop --> <!-- https://mvnrepository.com/artifact/org.apache.xmlgraphics/fop -->
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.15.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/fr.opensagres.xdocreport/org.apache.poi.xwpf.converter.pdf -->
<dependency>
<groupId>fr.opensagres.xdocreport</groupId>
<artifactId>org.apache.poi.xwpf.converter.pdf</artifactId>
<version>1.0.6</version>
</dependency>
<!-- https://mvnrepository.com/artifact/fr.opensagres.xdocreport/org.apache.poi.xwpf.convereu.eudat.corecore -->
<dependency>
<groupId>fr.opensagres.xdocreport</groupId>
<artifactId>org.apache.poi.xwpf.converter.core</artifactId>
<version>1.0.6</version>
</dependency>
<!-- https://mvnrepository.com/artifact/fr.opensagres.xdocreport/fr.opensagres.xdocreport.itext.extension -->
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.1</version>
</dependency>
<!--<dependency> <!--<dependency>
<groupId>org.hibernate</groupId> <groupId>org.hibernate</groupId>
<artifactId>hibernate-jpamodelgen</artifactId> <artifactId>hibernate-jpamodelgen</artifactId>
</dependency>--> </dependency>-->
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>transport</artifactId>
<version>7.6.0</version>
</dependency>
<!--<dependency> <!--<dependency>
<groupId>org.apache.logging.log4j</groupId> <groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-to-slf4j</artifactId> <artifactId>log4j-to-slf4j</artifactId>
<version>2.8.2</version> <version>2.8.2</version>
</dependency>--> </dependency>-->
<!-- https://mvnrepository.com/artifact/jakarta.xml.bind/jaxb-api -->
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.glassfish.jaxb/jaxb-core -->
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-core</artifactId>
<version>4.0.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.glassfish.jaxb/jaxb-runtime -->
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>4.0.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/jakarta.annotation/jakarta.annotation-api -->
<dependency>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/jakarta.validation/validation-api -->
<dependency>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
</dependency>
<dependency>
<groupId>jakarta.persistence</groupId>
<artifactId>jakarta.persistence-api</artifactId>
<version>3.1.0</version>
</dependency>
<!-- &lt;!&ndash; The client &ndash;&gt;--> <!-- &lt;!&ndash; The client &ndash;&gt;-->
<!-- <dependency>--> <!-- <dependency>-->
@ -279,16 +212,7 @@
<groupId>io.micrometer</groupId> <groupId>io.micrometer</groupId>
<artifactId>micrometer-core</artifactId> <artifactId>micrometer-core</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<!--CITE DEPENDENCIES--> <!--CITE DEPENDENCIES-->
<dependency>
<groupId>gr.cite</groupId>
<artifactId>oidc-authn</artifactId>
<version>2.2.1</version>
</dependency>
<dependency> <dependency>
<groupId>gr.cite</groupId> <groupId>gr.cite</groupId>
<artifactId>data-tools</artifactId> <artifactId>data-tools</artifactId>
@ -297,17 +221,12 @@
<dependency> <dependency>
<groupId>gr.cite</groupId> <groupId>gr.cite</groupId>
<artifactId>exceptions</artifactId> <artifactId>exceptions</artifactId>
<version>2.1.0</version> <version>2.2.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>gr.cite</groupId> <groupId>gr.cite</groupId>
<artifactId>logging</artifactId> <artifactId>logging</artifactId>
<version>2.1.0</version> <version>2.2.0</version>
</dependency>
<dependency>
<groupId>gr.cite</groupId>
<artifactId>validation</artifactId>
<version>3.0.3</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>gr.cite</groupId> <groupId>gr.cite</groupId>
@ -315,11 +234,6 @@
<version>2.2.0</version> <version>2.2.0</version>
</dependency> </dependency>
<dependency>
<groupId>gr.cite</groupId>
<artifactId>oidc-authz</artifactId>
<version>2.1.0</version>
</dependency>
<dependency> <dependency>
<groupId>gr.cite</groupId> <groupId>gr.cite</groupId>
<artifactId>elastic</artifactId> <artifactId>elastic</artifactId>
@ -329,19 +243,9 @@
<dependency> <dependency>
<groupId>gr.cite</groupId> <groupId>gr.cite</groupId>
<artifactId>keycloak-api</artifactId> <artifactId>keycloak-api</artifactId>
<version>1.0.0</version> <version>2.2.0</version>
</dependency> </dependency>
<dependency>
<groupId>gr.cite</groupId>
<artifactId>queue-inbox</artifactId>
<version>2.1.1</version>
</dependency>
<dependency>
<groupId>gr.cite</groupId>
<artifactId>queue-outbox</artifactId>
<version>2.1.1</version>
</dependency>
<dependency> <dependency>
<groupId>gr.cite</groupId> <groupId>gr.cite</groupId>

View File

@ -21,21 +21,12 @@
<artifactId>core</artifactId> <artifactId>core</artifactId>
<version>${revision}</version> <version>${revision}</version>
</dependency> </dependency>
<dependency>
<groupId>gr.cite.opendmp</groupId>
<artifactId>repositorydepositbase</artifactId>
<version>2.0.2</version>
</dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId> <artifactId>spring-boot-starter-web</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
</dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webflux</artifactId> <artifactId>spring-boot-starter-webflux</artifactId>
@ -68,12 +59,6 @@
</dependency>--> </dependency>-->
<!-- https://mvnrepository.com/artifact/org.springframework/spring-context-support --> <!-- https://mvnrepository.com/artifact/org.springframework/spring-context-support -->
<dependency>
<groupId>com.github.ben-manes.caffeine</groupId>
<artifactId>caffeine</artifactId>
<version>3.1.5</version>
</dependency>
<dependency> <dependency>
<groupId>io.swagger</groupId> <groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId> <artifactId>swagger-annotations</artifactId>
@ -124,67 +109,6 @@
<artifactId>spring-boot-starter-tomcat</artifactId> <artifactId>spring-boot-starter-tomcat</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.opensaml</groupId>
<artifactId>opensaml-core</artifactId>
<version>${opensaml.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.opensaml</groupId>
<artifactId>opensaml-saml-api</artifactId>
<version>${opensaml.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.opensaml</groupId>
<artifactId>opensaml-saml-impl</artifactId>
<version>${opensaml.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.opensaml</groupId>
<artifactId>opensaml-soap-api</artifactId>
<version>${opensaml.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.opensaml</groupId>
<artifactId>opensaml-xmlsec-api</artifactId>
<version>${opensaml.version}</version>
</dependency>
<dependency>
<groupId>org.opensaml</groupId>
<artifactId>opensaml-security-api</artifactId>
<version>${opensaml.version}</version>
</dependency>
<dependency>
<groupId>org.opensaml</groupId>
<artifactId>opensaml-security-impl</artifactId>
<version>${opensaml.version}</version>
</dependency>
<dependency>
<groupId>org.opensaml</groupId>
<artifactId>opensaml-profile-api</artifactId>
<version>${opensaml.version}</version>
</dependency>
<dependency>
<groupId>org.opensaml</groupId>
<artifactId>xmltooling</artifactId>
<version>1.4.4</version>
</dependency>
<dependency>
<groupId>jakarta.xml.soap</groupId>
<artifactId>jakarta.xml.soap-api</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>com.sun.xml.messaging.saaj</groupId>
<artifactId>saaj-impl</artifactId>
<version>3.0.0-M2</version>
</dependency>
<!--CITE DEPENDENCIES--> <!--CITE DEPENDENCIES-->
<dependency> <dependency>
<groupId>gr.cite</groupId> <groupId>gr.cite</groupId>
@ -194,12 +118,7 @@
<dependency> <dependency>
<groupId>gr.cite</groupId> <groupId>gr.cite</groupId>
<artifactId>exceptions-web</artifactId> <artifactId>exceptions-web</artifactId>
<version>1.0.0</version> <version>2.2.0</version>
</dependency>
<dependency>
<groupId>gr.cite.opendmp</groupId>
<artifactId>file-transformer-base</artifactId>
<version>0.0.10</version>
</dependency> </dependency>
</dependencies> </dependencies>
@ -269,7 +188,6 @@
<properties> <properties>
<start-class>eu.eudat.EuDatApplication</start-class> <start-class>eu.eudat.EuDatApplication</start-class>
<opensaml.version>4.0.1</opensaml.version>
<maven.compiler.release>21</maven.compiler.release> <maven.compiler.release>21</maven.compiler.release>
<maven.compiler.source>21</maven.compiler.source> <maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target> <maven.compiler.target>21</maven.compiler.target>

View File

@ -9,7 +9,7 @@ import eu.eudat.commons.lock.LockByKeyManager;
import eu.eudat.commons.scope.user.UserScope; import eu.eudat.commons.scope.user.UserScope;
import eu.eudat.commons.types.user.AdditionalInfoEntity; import eu.eudat.commons.types.user.AdditionalInfoEntity;
import eu.eudat.commons.types.usercredential.UserCredentialDataEntity; import eu.eudat.commons.types.usercredential.UserCredentialDataEntity;
import eu.eudat.configurations.locale.LocaleProperties; import eu.eudat.commons.locale.LocaleProperties;
import eu.eudat.data.UserContactInfoEntity; import eu.eudat.data.UserContactInfoEntity;
import eu.eudat.data.UserCredentialEntity; import eu.eudat.data.UserCredentialEntity;
import eu.eudat.data.UserEntity; import eu.eudat.data.UserEntity;

View File

@ -16,7 +16,7 @@ spring:
dialect: org.hibernate.dialect.PostgreSQLDialect dialect: org.hibernate.dialect.PostgreSQLDialect
hibernate: hibernate:
naming: naming:
physical-strategy: eu.eudat.configurations.db.PrefixPhysicalNamingStrategy physical-strategy: eu.eudat.data.namingstrategy.PrefixPhysicalNamingStrategy
implicit-strategy: org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy implicit-strategy: org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy
datasource: datasource:
url: ${DB_URL:} url: ${DB_URL:}

View File

@ -98,7 +98,7 @@
<div [id]="'preview_container'+ form.get('id').value" class="w-100" style="margin-right: -15px; margin-left: -15px;"> <div [id]="'preview_container'+ form.get('id').value" class="w-100" style="margin-right: -15px; margin-left: -15px;">
<div *ngIf="previewFieldSet && showPreview && firstField?.get('data')?.get('fieldType')?.value" class="row" [@fade-in-fast]> <div *ngIf="previewFieldSet && showPreview && firstField?.get('data')?.get('fieldType')?.value" class="row" [@fade-in-fast]>
<div class="col"> <div class="col">
<app-description-form-field-set class="w-100" [propertiesFormGroup]="previewPropertiesFormGroup" [fieldSet]="previewFieldSet"></app-description-form-field-set> <app-description-form-field-set class="w-100" [propertiesFormGroup]="previewPropertiesFormGroup" [fieldSet]="previewFieldSet" [visibilityRulesService]="visibilityRulesService"></app-description-form-field-set>
</div> </div>
</div> </div>
</div> </div>

View File

@ -79,6 +79,7 @@ export class DescriptionTemplateEditorCompositeFieldComponent extends BaseCompon
public enumUtils: EnumUtils, public enumUtils: EnumUtils,
public datasetProfileService: DescriptionTemplateService, public datasetProfileService: DescriptionTemplateService,
private configurationService: ConfigurationService, private configurationService: ConfigurationService,
public visibilityRulesService: VisibilityRulesService
) { ) {
super(); super();
} }
@ -289,6 +290,7 @@ export class DescriptionTemplateEditorCompositeFieldComponent extends BaseCompon
this.previewPropertiesFormGroup = descriptionEditorModel.properties.fieldSets.get(fieldSet.id).buildForm() as UntypedFormGroup; this.previewPropertiesFormGroup = descriptionEditorModel.properties.fieldSets.get(fieldSet.id).buildForm() as UntypedFormGroup;
this.previewFieldSet = fieldSet; this.previewFieldSet = fieldSet;
this.visibilityRulesService.setContext(mockDescription.descriptionTemplate.definition, this.previewPropertiesFormGroup);
// this.previewSubject$.next(section); // this.previewSubject$.next(section);
} }
@ -561,10 +563,6 @@ export class DescriptionTemplateEditorCompositeFieldComponent extends BaseCompon
break; break;
} }
case DescriptionTemplateFieldType.INTERNAL_ENTRIES_DMPS: {
//TODO: refactor
break;
}
case DescriptionTemplateFieldType.INTERNAL_ENTRIES_DMPS: case DescriptionTemplateFieldType.INTERNAL_ENTRIES_DMPS:
case DescriptionTemplateFieldType.INTERNAL_ENTRIES_DESCRIPTIONS: { case DescriptionTemplateFieldType.INTERNAL_ENTRIES_DESCRIPTIONS: {
const data: DescriptionTemplateLabelAndMultiplicityData = { const data: DescriptionTemplateLabelAndMultiplicityData = {

View File

@ -27,10 +27,10 @@
<mat-error *ngIf="form.hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error> <mat-error *ngIf="form.hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</mat-form-field> </mat-form-field>
<!-- ComboBox --> <!-- SELECT -->
<mat-form-field class="col-md-12" *ngIf="fieldType === descriptionTemplateFieldTypeEnum.SELECT"> <mat-form-field class="col-md-12" *ngIf="fieldType === descriptionTemplateFieldTypeEnum.SELECT">
<mat-label>{{placeHolder}}</mat-label> <mat-label>{{placeHolder}}</mat-label>
<mat-select [formControl]="form" [placeholder]="placeHolder"> <mat-select multiple [formControl]="form" [placeholder]="placeHolder">
<mat-option [value]="null">{{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.FORM.FIELD.DEFAULT-VALUES.NONE' | translate }}</mat-option> <mat-option [value]="null">{{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.FORM.FIELD.DEFAULT-VALUES.NONE' | translate }}</mat-option>
<mat-option *ngFor="let opt of formArrayOptions['controls']" [value]="opt.get('value').value">{{opt.get('label').value}}</mat-option> <mat-option *ngFor="let opt of formArrayOptions['controls']" [value]="opt.get('value').value">{{opt.get('label').value}}</mat-option>
</mat-select> </mat-select>

View File

@ -161,10 +161,6 @@ export class DescriptionTemplateEditorFieldComponent extends BaseComponent imple
break; break;
} }
case DescriptionTemplateFieldType.INTERNAL_ENTRIES_DMPS: {
//TODO: refactor
break;
}
case DescriptionTemplateFieldType.INTERNAL_ENTRIES_DMPS: case DescriptionTemplateFieldType.INTERNAL_ENTRIES_DMPS:
case DescriptionTemplateFieldType.INTERNAL_ENTRIES_DESCRIPTIONS:{ case DescriptionTemplateFieldType.INTERNAL_ENTRIES_DESCRIPTIONS:{
const data: DescriptionTemplateLabelAndMultiplicityData = { const data: DescriptionTemplateLabelAndMultiplicityData = {

View File

@ -1 +1 @@
<app-description-form *ngIf="formGroup" [propertiesFormGroup]="previewPropertiesFormGroup" [descriptionTemplate]="descriptionTemplate" [visibilityRulesService]="visibilityRulesService"></app-description-form> <app-description-form *ngIf="previewPropertiesFormGroup" [propertiesFormGroup]="previewPropertiesFormGroup" [descriptionTemplate]="descriptionTemplate" [visibilityRulesService]="visibilityRulesService"></app-description-form>

View File

@ -21,13 +21,20 @@ export class FinalPreviewComponent implements OnInit {
@Input() descriptionTemplatePersist: DescriptionTemplatePersist; @Input() descriptionTemplatePersist: DescriptionTemplatePersist;
descriptionTemplate: DescriptionTemplate; descriptionTemplate: DescriptionTemplate;
previewPropertiesFormGroup previewPropertiesFormGroup: UntypedFormGroup;
@Input() formGroup = null;
constructor(public visibilityRulesService: VisibilityRulesService) { constructor(public visibilityRulesService: VisibilityRulesService) {
} }
ngOnInit(): void {
this.generatePreviewForm();
}
ngOnChanges(changes: SimpleChanges) {
if(changes['descriptionTemplatePersist']) this.generatePreviewForm();
}
private generatePreviewForm() { private generatePreviewForm() {
this.descriptionTemplate = this.buildDescriptionTemplate(this.descriptionTemplatePersist); this.descriptionTemplate = this.buildDescriptionTemplate(this.descriptionTemplatePersist);
@ -132,12 +139,4 @@ export class FinalPreviewComponent implements OnInit {
return convertedField; return convertedField;
} }
ngOnInit(): void {
this.generatePreviewForm();
}
// ngOnChanges(changes: SimpleChanges) {
// if(changes['descriptionTemplatePersist']) this.generatePreviewForm();
// }
} }

View File

@ -3,6 +3,7 @@
<app-description-template-editor-default-value-component *ngIf="isTextType(fieldTypeForCheck)" class="col align-self-center" [fieldType]="fieldTypeForCheck" [form]="ruleFormGroup.get('textValue')" [formArrayOptions]="formArrayOptionsForCheck" placeHolder="{{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.FORM.RULE.FIELDS.RULE-IF'| translate}}" required="true"></app-description-template-editor-default-value-component> <app-description-template-editor-default-value-component *ngIf="isTextType(fieldTypeForCheck)" class="col align-self-center" [fieldType]="fieldTypeForCheck" [form]="ruleFormGroup.get('textValue')" [formArrayOptions]="formArrayOptionsForCheck" placeHolder="{{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.FORM.RULE.FIELDS.RULE-IF'| translate}}" required="true"></app-description-template-editor-default-value-component>
<app-description-template-editor-default-value-component *ngIf="isDateType(fieldTypeForCheck)" class="col align-self-center" [fieldType]="fieldTypeForCheck" [form]="ruleFormGroup.get('dateValue')" [formArrayOptions]="formArrayOptionsForCheck" placeHolder="{{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.FORM.RULE.FIELDS.RULE-IF'| translate}}" required="true"></app-description-template-editor-default-value-component> <app-description-template-editor-default-value-component *ngIf="isDateType(fieldTypeForCheck)" class="col align-self-center" [fieldType]="fieldTypeForCheck" [form]="ruleFormGroup.get('dateValue')" [formArrayOptions]="formArrayOptionsForCheck" placeHolder="{{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.FORM.RULE.FIELDS.RULE-IF'| translate}}" required="true"></app-description-template-editor-default-value-component>
<app-description-template-editor-default-value-component *ngIf="isTextListType(fieldTypeForCheck)" class="col align-self-center" [fieldType]="fieldTypeForCheck" [form]="ruleFormGroup.get('textListValue')" [formArrayOptions]="formArrayOptionsForCheck" placeHolder="{{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.FORM.RULE.FIELDS.RULE-IF'| translate}}" required="true"></app-description-template-editor-default-value-component>
<!-- SELECTION --> <!-- SELECTION -->
<mat-form-field class="col align-self-center"> <mat-form-field class="col align-self-center">

View File

@ -43,12 +43,12 @@ export class DescriptionTemplateEditorRuleComponent implements OnInit {
return type == DescriptionTemplateFieldType.FREE_TEXT || type == DescriptionTemplateFieldType.CHECK_BOX || return type == DescriptionTemplateFieldType.FREE_TEXT || type == DescriptionTemplateFieldType.CHECK_BOX ||
type == DescriptionTemplateFieldType.TEXT_AREA || type == DescriptionTemplateFieldType.RICH_TEXT_AREA || type == DescriptionTemplateFieldType.TEXT_AREA || type == DescriptionTemplateFieldType.RICH_TEXT_AREA ||
type == DescriptionTemplateFieldType.BOOLEAN_DECISION || type == DescriptionTemplateFieldType.RADIO_BOX || type == DescriptionTemplateFieldType.BOOLEAN_DECISION || type == DescriptionTemplateFieldType.RADIO_BOX ||
type == DescriptionTemplateFieldType.CURRENCY || type == DescriptionTemplateFieldType.SELECT; type == DescriptionTemplateFieldType.CURRENCY;
} }
isTextListType(type: DescriptionTemplateFieldType){ isTextListType(type: DescriptionTemplateFieldType){
return type == DescriptionTemplateFieldType.TAGS || type == DescriptionTemplateFieldType.INTERNAL_ENTRIES_DMPS || return type == DescriptionTemplateFieldType.TAGS || type == DescriptionTemplateFieldType.INTERNAL_ENTRIES_DMPS ||
type == DescriptionTemplateFieldType.INTERNAL_ENTRIES_DESCRIPTIONS; type == DescriptionTemplateFieldType.INTERNAL_ENTRIES_DESCRIPTIONS || type == DescriptionTemplateFieldType.SELECT;
} }
isDateType(type: DescriptionTemplateFieldType){ isDateType(type: DescriptionTemplateFieldType){

View File

@ -268,7 +268,7 @@
<div class="col-9"> <div class="col-9">
<div class="col"> <div class="col">
<div class="col-12"> <div class="col-12">
<app-final-preview-component [formGroup]="formGroup" [visibilityRules]="visibilityRules" [descriptionTemplatePersist]="formGroup.getRawValue()"> <app-final-preview-component [descriptionTemplatePersist]="finalPreviewDescriptionTemplatePersist">
</app-final-preview-component> </app-final-preview-component>
</div> </div>

View File

@ -78,6 +78,7 @@ export class DescriptionTemplateEditorComponent extends BaseEditor<DescriptionTe
//Preview //Preview
previewFieldSet: DescriptionTemplate = null; previewFieldSet: DescriptionTemplate = null;
previewPropertiesFormGroup: UntypedFormGroup = null; previewPropertiesFormGroup: UntypedFormGroup = null;
finalPreviewDescriptionTemplatePersist: DescriptionTemplatePersist;
protected get canDelete(): boolean { protected get canDelete(): boolean {
return !this.isDeleted && !this.isNew && this.hasPermission(this.authService.permissionEnum.DeleteDescriptionTemplate); return !this.isDeleted && !this.isNew && this.hasPermission(this.authService.permissionEnum.DeleteDescriptionTemplate);
@ -391,63 +392,7 @@ export class DescriptionTemplateEditorComponent extends BaseEditor<DescriptionTe
// //
// //
generatePreviewForm() { generatePreviewForm() {
// const formValue: DescriptionTemplatePersist = this.formGroup.getRawValue(); this.finalPreviewDescriptionTemplatePersist = this.formGroup.getRawValue();
// const fields: DescriptionTemplateField[] = formValue.fields.map(editorField => {
// return {
// id: editorField.id,
// ordinal: editorField.ordinal,
// numbering: '',
// schematics: editorField.schematics,
// defaultValue: editorField.defaultValue,
// visibilityRules: editorField.visibilityRules,
// validations: editorField.validations,
// includeInExport: editorField.includeInExport,
// data: editorField.data
// }
// });
// const fieldSet: DescriptionTemplateFieldSet = {
// id: formValue.id,
// ordinal: formValue.ordinal,
// numbering: '',
// title: formValue.title,
// description: formValue.description,
// extendedDescription: formValue.extendedDescription,
// additionalInformation: formValue.additionalInformation,
// multiplicity: {
// max: formValue.multiplicity.max, min: formValue.multiplicity.min,
// placeholder: formValue.multiplicity.placeholder, tableView: formValue.multiplicity.tableView
// },
// hasCommentField: formValue.hasCommentField,
// fields: fields
// }
// const mockDescription: Description = {
// descriptionTemplate: {
// definition: {
// pages: [
// {
// sections: [{
// fieldSets: [fieldSet]
// }]
// }
// ]
// }
// }
// }
// const descriptionEditorModel = new DescriptionEditorModel().fromModel(mockDescription, mockDescription.descriptionTemplate);
// this.previewPropertiesFormGroup = descriptionEditorModel.properties.fieldSets.get(fieldSet.id).buildForm() as UntypedFormGroup;
// this.previewFieldSet = fieldSet;
// let data = this.form.getRawValue();
// this.datasetProfileService.preview(data).subscribe(x => {
// this.datasetWizardModel = new DatasetWizardEditorModel().fromModel({
// datasetProfileDefinition: x
// });
// this.updateVisibilityRules();
// this.formGroup = <FormGroup>this.datasetWizardModel.buildForm().get('datasetProfileDefinition');
// });
} }
// //

View File

@ -3,7 +3,7 @@
<mat-expansion-panel class="row expansion-panel toc-section-header" [id]="path" [(expanded)]="panelExpanded"> <mat-expansion-panel class="row expansion-panel toc-section-header" [id]="path" [(expanded)]="panelExpanded">
<mat-expansion-panel-header> <mat-expansion-panel-header>
<mat-panel-title> <mat-panel-title>
<h6 class='panel-title' *ngIf="section?.sections?.length > 0">{{path}}.section {{section.title}}</h6> <h6 class='panel-title' *ngIf="section?.sections?.length >= 0">{{path}}.section {{section.title}}</h6>
<h6 class='panel-title' *ngIf="section?.fieldSets?.length > 0">{{path}} {{section.title}}</h6> <h6 class='panel-title' *ngIf="section?.fieldSets?.length > 0">{{path}} {{section.title}}</h6>
</mat-panel-title> </mat-panel-title>
</mat-expansion-panel-header> </mat-expansion-panel-header>