diff --git a/annotation-service/pom.xml b/annotation-service/pom.xml index 47d35f3bb..09052208a 100644 --- a/annotation-service/pom.xml +++ b/annotation-service/pom.xml @@ -180,6 +180,19 @@ + + cite-dev + + + cite-maven + CITE Maven Repository + https://crepo.cite.gr/repository/cite-maven/ + + + + true + + \ No newline at end of file diff --git a/dmp-backend/core/pom.xml b/dmp-backend/core/pom.xml index 711c9c8de..4039a7e1e 100644 --- a/dmp-backend/core/pom.xml +++ b/dmp-backend/core/pom.xml @@ -82,23 +82,9 @@ gr.cite keycloak-api - 1.0.0 - - - gr.cite - data-tools - 2.1.2 + 2.2.0 - - org.eclipse.angus - jakarta.mail - - - commons-beanutils - commons-beanutils - 1.9.4 - diff --git a/dmp-backend/core/src/main/java/eu/eudat/configurations/locale/LocaleConfiguration.java b/dmp-backend/core/src/main/java/eu/eudat/commons/locale/LocaleConfiguration.java similarity index 93% rename from dmp-backend/core/src/main/java/eu/eudat/configurations/locale/LocaleConfiguration.java rename to dmp-backend/core/src/main/java/eu/eudat/commons/locale/LocaleConfiguration.java index 0b95b2650..8bd9d2fae 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/configurations/locale/LocaleConfiguration.java +++ b/dmp-backend/core/src/main/java/eu/eudat/commons/locale/LocaleConfiguration.java @@ -1,4 +1,4 @@ -package eu.eudat.configurations.locale; +package eu.eudat.commons.locale; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.context.properties.EnableConfigurationProperties; diff --git a/dmp-backend/core/src/main/java/eu/eudat/configurations/locale/LocaleProperties.java b/dmp-backend/core/src/main/java/eu/eudat/commons/locale/LocaleProperties.java similarity index 93% rename from dmp-backend/core/src/main/java/eu/eudat/configurations/locale/LocaleProperties.java rename to dmp-backend/core/src/main/java/eu/eudat/commons/locale/LocaleProperties.java index 64f7d163e..96d74543c 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/configurations/locale/LocaleProperties.java +++ b/dmp-backend/core/src/main/java/eu/eudat/commons/locale/LocaleProperties.java @@ -1,4 +1,4 @@ -package eu.eudat.configurations.locale; +package eu.eudat.commons.locale; import org.springframework.boot.context.properties.ConfigurationProperties; diff --git a/dmp-backend/core/src/main/java/eu/eudat/configurations/notification/NotificationConfiguration.java b/dmp-backend/core/src/main/java/eu/eudat/commons/notification/NotificationConfiguration.java similarity index 92% rename from dmp-backend/core/src/main/java/eu/eudat/configurations/notification/NotificationConfiguration.java rename to dmp-backend/core/src/main/java/eu/eudat/commons/notification/NotificationConfiguration.java index 044fdc5ac..b3fd04968 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/configurations/notification/NotificationConfiguration.java +++ b/dmp-backend/core/src/main/java/eu/eudat/commons/notification/NotificationConfiguration.java @@ -1,4 +1,4 @@ -package eu.eudat.configurations.notification; +package eu.eudat.commons.notification; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.context.properties.EnableConfigurationProperties; diff --git a/dmp-backend/core/src/main/java/eu/eudat/configurations/notification/NotificationProperties.java b/dmp-backend/core/src/main/java/eu/eudat/commons/notification/NotificationProperties.java similarity index 98% rename from dmp-backend/core/src/main/java/eu/eudat/configurations/notification/NotificationProperties.java rename to dmp-backend/core/src/main/java/eu/eudat/commons/notification/NotificationProperties.java index dab91cb2d..b9eea6162 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/configurations/notification/NotificationProperties.java +++ b/dmp-backend/core/src/main/java/eu/eudat/commons/notification/NotificationProperties.java @@ -1,4 +1,4 @@ -package eu.eudat.configurations.notification; +package eu.eudat.commons.notification; import org.springframework.boot.context.properties.ConfigurationProperties; diff --git a/dmp-backend/core/src/main/java/eu/eudat/configurations/transformer/TransformerConfiguration.java b/dmp-backend/core/src/main/java/eu/eudat/configurations/transformer/TransformerConfiguration.java deleted file mode 100644 index bdf666a01..000000000 --- a/dmp-backend/core/src/main/java/eu/eudat/configurations/transformer/TransformerConfiguration.java +++ /dev/null @@ -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 { -} diff --git a/dmp-backend/core/src/main/java/eu/eudat/configurations/db/NamingStrategyProperties.java b/dmp-backend/core/src/main/java/eu/eudat/data/namingstrategy/NamingStrategyProperties.java similarity index 92% rename from dmp-backend/core/src/main/java/eu/eudat/configurations/db/NamingStrategyProperties.java rename to dmp-backend/core/src/main/java/eu/eudat/data/namingstrategy/NamingStrategyProperties.java index d13980dbb..2886f6bc0 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/configurations/db/NamingStrategyProperties.java +++ b/dmp-backend/core/src/main/java/eu/eudat/data/namingstrategy/NamingStrategyProperties.java @@ -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.bind.ConstructorBinding; diff --git a/dmp-backend/core/src/main/java/eu/eudat/configurations/db/PrefixPhysicalNamingStrategy.java b/dmp-backend/core/src/main/java/eu/eudat/data/namingstrategy/PrefixPhysicalNamingStrategy.java similarity index 97% rename from dmp-backend/core/src/main/java/eu/eudat/configurations/db/PrefixPhysicalNamingStrategy.java rename to dmp-backend/core/src/main/java/eu/eudat/data/namingstrategy/PrefixPhysicalNamingStrategy.java index 140062448..81b8548e0 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/configurations/db/PrefixPhysicalNamingStrategy.java +++ b/dmp-backend/core/src/main/java/eu/eudat/data/namingstrategy/PrefixPhysicalNamingStrategy.java @@ -1,4 +1,4 @@ -package eu.eudat.configurations.db; +package eu.eudat.data.namingstrategy; import eu.eudat.convention.ConventionService; import org.hibernate.boot.model.naming.Identifier; diff --git a/dmp-backend/core/src/main/java/eu/eudat/elastic/query/DescriptionElasticQuery.java b/dmp-backend/core/src/main/java/eu/eudat/elastic/query/DescriptionElasticQuery.java index 4fb97c821..8acffedbb 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/elastic/query/DescriptionElasticQuery.java +++ b/dmp-backend/core/src/main/java/eu/eudat/elastic/query/DescriptionElasticQuery.java @@ -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.QueryBuilders; import eu.eudat.authorization.AuthorizationFlags; -import eu.eudat.authorization.Permission; import eu.eudat.commons.enums.DescriptionStatus; import eu.eudat.commons.enums.DmpAccessType; import eu.eudat.commons.enums.DmpStatus; -import eu.eudat.commons.enums.IsActive; import eu.eudat.commons.scope.user.UserScope; -import eu.eudat.configurations.elastic.AppElasticProperties; -import eu.eudat.data.DescriptionEntity; +import eu.eudat.service.elastic.AppElasticProperties; import eu.eudat.elastic.data.DescriptionElasticEntity; import eu.eudat.elastic.data.DmpElasticEntity; 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 gr.cite.commons.web.authz.service.AuthorizationService; import gr.cite.tools.data.query.FieldResolver; @@ -35,7 +29,6 @@ import org.springframework.stereotype.Component; import java.io.IOException; import java.time.Instant; import java.util.*; -import java.util.stream.Collectors; @Component //Like in C# make it Transient diff --git a/dmp-backend/core/src/main/java/eu/eudat/elastic/query/DmpElasticQuery.java b/dmp-backend/core/src/main/java/eu/eudat/elastic/query/DmpElasticQuery.java index ab136be94..cf38581d3 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/elastic/query/DmpElasticQuery.java +++ b/dmp-backend/core/src/main/java/eu/eudat/elastic/query/DmpElasticQuery.java @@ -6,15 +6,10 @@ import eu.eudat.authorization.Permission; import eu.eudat.commons.enums.DmpAccessType; import eu.eudat.commons.enums.DmpStatus; import eu.eudat.commons.enums.DmpVersionStatus; -import eu.eudat.commons.enums.IsActive; import eu.eudat.commons.scope.user.UserScope; -import eu.eudat.configurations.elastic.AppElasticProperties; -import eu.eudat.data.DmpEntity; -import eu.eudat.elastic.data.DescriptionElasticEntity; +import eu.eudat.service.elastic.AppElasticProperties; import eu.eudat.elastic.data.DmpElasticEntity; 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 gr.cite.commons.web.authz.service.AuthorizationService; 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.mapper.FieldBasedMapper; 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.config.BeanDefinition; import org.springframework.context.annotation.Scope; diff --git a/dmp-backend/core/src/main/java/eu/eudat/service/contactsupport/ContactSupportServiceImpl.java b/dmp-backend/core/src/main/java/eu/eudat/service/contactsupport/ContactSupportServiceImpl.java index 358945be6..dc4944acd 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/service/contactsupport/ContactSupportServiceImpl.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/contactsupport/ContactSupportServiceImpl.java @@ -6,7 +6,7 @@ import eu.eudat.commons.enums.ContactInfoType; import eu.eudat.commons.enums.notification.NotificationContactType; import eu.eudat.commons.scope.user.UserScope; 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.integrationevent.outbox.notification.NotifyIntegrationEvent; import eu.eudat.integrationevent.outbox.notification.NotifyIntegrationEventHandler; diff --git a/dmp-backend/core/src/main/java/eu/eudat/configurations/deposit/DepositCacheOptions.java b/dmp-backend/core/src/main/java/eu/eudat/service/deposit/DepositCacheOptions.java similarity index 87% rename from dmp-backend/core/src/main/java/eu/eudat/configurations/deposit/DepositCacheOptions.java rename to dmp-backend/core/src/main/java/eu/eudat/service/deposit/DepositCacheOptions.java index 6b673806f..7c20baa1b 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/configurations/deposit/DepositCacheOptions.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/deposit/DepositCacheOptions.java @@ -1,4 +1,4 @@ -package eu.eudat.configurations.deposit; +package eu.eudat.service.deposit; import gr.cite.tools.cache.CacheOptions; import org.springframework.boot.context.properties.ConfigurationProperties; diff --git a/dmp-backend/core/src/main/java/eu/eudat/configurations/deposit/DepositConfiguration.java b/dmp-backend/core/src/main/java/eu/eudat/service/deposit/DepositConfiguration.java similarity index 87% rename from dmp-backend/core/src/main/java/eu/eudat/configurations/deposit/DepositConfiguration.java rename to dmp-backend/core/src/main/java/eu/eudat/service/deposit/DepositConfiguration.java index 804107ac8..603374d5a 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/configurations/deposit/DepositConfiguration.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/deposit/DepositConfiguration.java @@ -1,4 +1,4 @@ -package eu.eudat.configurations.deposit; +package eu.eudat.service.deposit; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Configuration; diff --git a/dmp-backend/core/src/main/java/eu/eudat/configurations/deposit/DepositProperties.java b/dmp-backend/core/src/main/java/eu/eudat/service/deposit/DepositProperties.java similarity index 98% rename from dmp-backend/core/src/main/java/eu/eudat/configurations/deposit/DepositProperties.java rename to dmp-backend/core/src/main/java/eu/eudat/service/deposit/DepositProperties.java index ea695791f..df8380189 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/configurations/deposit/DepositProperties.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/deposit/DepositProperties.java @@ -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.bind.ConstructorBinding; diff --git a/dmp-backend/core/src/main/java/eu/eudat/service/deposit/DepositServiceImpl.java b/dmp-backend/core/src/main/java/eu/eudat/service/deposit/DepositServiceImpl.java index 14a8ac5cb..6f16bd3ad 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/service/deposit/DepositServiceImpl.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/deposit/DepositServiceImpl.java @@ -7,8 +7,6 @@ import eu.eudat.commonmodels.models.FileEnvelopeModel; import eu.eudat.commonmodels.models.dmp.DmpModel; import eu.eudat.commons.enums.StorageType; 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.depositinterface.repository.DepositClient; import eu.eudat.depositinterface.repository.DepositConfiguration; diff --git a/dmp-backend/core/src/main/java/eu/eudat/service/description/DescriptionServiceImpl.java b/dmp-backend/core/src/main/java/eu/eudat/service/description/DescriptionServiceImpl.java index 3ca3616ff..a7ed63e7f 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/service/description/DescriptionServiceImpl.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/description/DescriptionServiceImpl.java @@ -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.notification.*; 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.data.*; import eu.eudat.errorcode.ErrorThesaurusProperties; diff --git a/dmp-backend/core/src/main/java/eu/eudat/service/descriptiontemplate/DescriptionTemplateServiceImpl.java b/dmp-backend/core/src/main/java/eu/eudat/service/descriptiontemplate/DescriptionTemplateServiceImpl.java index dc343040c..acaf185c2 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/service/descriptiontemplate/DescriptionTemplateServiceImpl.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/descriptiontemplate/DescriptionTemplateServiceImpl.java @@ -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.importexport.*; 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.data.*; import eu.eudat.errorcode.ErrorThesaurusProperties; @@ -51,6 +51,7 @@ import gr.cite.tools.logging.MapLogEntry; import gr.cite.tools.validation.ValidatorFactory; import jakarta.persistence.EntityManager; import jakarta.xml.bind.JAXBException; +import org.apache.commons.lang3.NotImplementedException; import org.jetbrains.annotations.NotNull; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -61,7 +62,6 @@ import org.springframework.stereotype.Service; import org.xml.sax.SAXException; import javax.management.InvalidApplicationException; -import javax.ws.rs.NotSupportedException; import javax.xml.parsers.ParserConfigurationException; import javax.xml.transform.TransformerException; import java.io.IOException; @@ -405,7 +405,7 @@ public class DescriptionTemplateServiceImpl implements DescriptionTemplateServic if (FieldType.isTextType(fieldType)) { if (FieldType.UPLOAD.equals(fieldType) && !this.conventionService.isNullOrEmpty(persist.getTextValue())){ - throw new NotSupportedException("Upload not supported"); + throw new NotImplementedException("Upload not supported"); } else { data.setTextValue(persist.getTextValue()); } diff --git a/dmp-backend/core/src/main/java/eu/eudat/service/dmp/DmpServiceImpl.java b/dmp-backend/core/src/main/java/eu/eudat/service/dmp/DmpServiceImpl.java index c5734e065..7be2dc957 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/service/dmp/DmpServiceImpl.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/dmp/DmpServiceImpl.java @@ -18,7 +18,7 @@ import eu.eudat.commons.types.dmpreference.DmpReferenceDataEntity; import eu.eudat.commons.types.notification.*; import eu.eudat.commons.types.reference.DefinitionEntity; 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.data.*; import eu.eudat.errorcode.ErrorThesaurusProperties; diff --git a/dmp-backend/core/src/main/java/eu/eudat/configurations/elastic/AppElasticConfiguration.java b/dmp-backend/core/src/main/java/eu/eudat/service/elastic/AppElasticConfiguration.java similarity index 93% rename from dmp-backend/core/src/main/java/eu/eudat/configurations/elastic/AppElasticConfiguration.java rename to dmp-backend/core/src/main/java/eu/eudat/service/elastic/AppElasticConfiguration.java index cb1785a28..9a867ef9b 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/configurations/elastic/AppElasticConfiguration.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/elastic/AppElasticConfiguration.java @@ -1,4 +1,4 @@ -package eu.eudat.configurations.elastic; +package eu.eudat.service.elastic; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.context.properties.EnableConfigurationProperties; diff --git a/dmp-backend/core/src/main/java/eu/eudat/configurations/elastic/AppElasticProperties.java b/dmp-backend/core/src/main/java/eu/eudat/service/elastic/AppElasticProperties.java similarity index 96% rename from dmp-backend/core/src/main/java/eu/eudat/configurations/elastic/AppElasticProperties.java rename to dmp-backend/core/src/main/java/eu/eudat/service/elastic/AppElasticProperties.java index 7900411fd..eff7fa19f 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/configurations/elastic/AppElasticProperties.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/elastic/AppElasticProperties.java @@ -1,4 +1,4 @@ -package eu.eudat.configurations.elastic; +package eu.eudat.service.elastic; import org.springframework.boot.context.properties.ConfigurationProperties; diff --git a/dmp-backend/core/src/main/java/eu/eudat/service/elastic/ElasticServiceImpl.java b/dmp-backend/core/src/main/java/eu/eudat/service/elastic/ElasticServiceImpl.java index b7c6be0d0..0621511e5 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/service/elastic/ElasticServiceImpl.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/elastic/ElasticServiceImpl.java @@ -6,7 +6,6 @@ import co.elastic.clients.elasticsearch._types.mapping.TypeMapping; import co.elastic.clients.elasticsearch.indices.*; import eu.eudat.authorization.Permission; import eu.eudat.commons.enums.IsActive; -import eu.eudat.configurations.elastic.AppElasticProperties; import eu.eudat.data.DescriptionEntity; import eu.eudat.data.DmpEntity; import eu.eudat.elastic.data.DescriptionElasticEntity; diff --git a/dmp-backend/core/src/main/java/eu/eudat/configurations/keycloak/KeycloakAuthorityProperties.java b/dmp-backend/core/src/main/java/eu/eudat/service/keycloak/KeycloakAuthorityProperties.java similarity index 91% rename from dmp-backend/core/src/main/java/eu/eudat/configurations/keycloak/KeycloakAuthorityProperties.java rename to dmp-backend/core/src/main/java/eu/eudat/service/keycloak/KeycloakAuthorityProperties.java index 059af27d4..3c8cd8bb1 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/configurations/keycloak/KeycloakAuthorityProperties.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/keycloak/KeycloakAuthorityProperties.java @@ -1,4 +1,4 @@ -package eu.eudat.configurations.keycloak; +package eu.eudat.service.keycloak; import org.springframework.boot.context.properties.bind.ConstructorBinding; diff --git a/dmp-backend/core/src/main/java/eu/eudat/configurations/keycloak/KeycloakResourcesConfiguration.java b/dmp-backend/core/src/main/java/eu/eudat/service/keycloak/KeycloakResourcesConfiguration.java similarity index 87% rename from dmp-backend/core/src/main/java/eu/eudat/configurations/keycloak/KeycloakResourcesConfiguration.java rename to dmp-backend/core/src/main/java/eu/eudat/service/keycloak/KeycloakResourcesConfiguration.java index a2373b158..d74493419 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/configurations/keycloak/KeycloakResourcesConfiguration.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/keycloak/KeycloakResourcesConfiguration.java @@ -1,12 +1,9 @@ -package eu.eudat.configurations.keycloak; +package eu.eudat.service.keycloak; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Configuration; -import java.util.ArrayList; -import java.util.List; - @Configuration @EnableConfigurationProperties(KeycloakResourcesProperties.class) public class KeycloakResourcesConfiguration { diff --git a/dmp-backend/core/src/main/java/eu/eudat/configurations/keycloak/KeycloakResourcesProperties.java b/dmp-backend/core/src/main/java/eu/eudat/service/keycloak/KeycloakResourcesProperties.java similarity index 95% rename from dmp-backend/core/src/main/java/eu/eudat/configurations/keycloak/KeycloakResourcesProperties.java rename to dmp-backend/core/src/main/java/eu/eudat/service/keycloak/KeycloakResourcesProperties.java index 623a660d0..bf5aaa4a5 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/configurations/keycloak/KeycloakResourcesProperties.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/keycloak/KeycloakResourcesProperties.java @@ -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.context.properties.ConfigurationProperties; diff --git a/dmp-backend/core/src/main/java/eu/eudat/service/keycloak/KeycloakServiceImpl.java b/dmp-backend/core/src/main/java/eu/eudat/service/keycloak/KeycloakServiceImpl.java index fbea431fc..1ae69554f 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/service/keycloak/KeycloakServiceImpl.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/keycloak/KeycloakServiceImpl.java @@ -1,8 +1,5 @@ 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.tools.logging.LoggerService; import org.jetbrains.annotations.NotNull; @@ -12,10 +9,7 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import java.util.UUID; +import java.util.*; @Service public class KeycloakServiceImpl implements KeycloakService { @@ -61,7 +55,7 @@ public class KeycloakServiceImpl implements KeycloakService { if (clientId == null) clientId = clientConfiguration.getProperties().getClientId(); UserRepresentation user = api.users().findUserById(subjectId.toString()); - user.getClientRoles().computeIfAbsent(clientId, k -> Lists.newArrayList()); + user.getClientRoles().computeIfAbsent(clientId, k -> new ArrayList<>()); Set clientRoles = new HashSet<>(Set.copyOf(user.getClientRoles().get(clientId))); clientRoles.add(role.name()); user.getClientRoles().get(clientId).clear(); @@ -73,7 +67,7 @@ public class KeycloakServiceImpl implements KeycloakService { public void removeClientRoleFromUser(UUID subjectId, String clientId, KeycloakRole role) { if (clientId == null) clientId = clientConfiguration.getProperties().getClientId(); UserRepresentation user = api.users().findUserById(subjectId.toString()); - user.getClientRoles().computeIfAbsent(clientId, k -> Lists.newArrayList()); + user.getClientRoles().computeIfAbsent(clientId, k -> new ArrayList<>()); Set clientRoles = new HashSet<>(Set.copyOf(user.getClientRoles().get(clientId))); clientRoles.remove(role.name()); user.getClientRoles().get(clientId).clear(); diff --git a/dmp-backend/core/src/main/java/eu/eudat/configurations/lock/LockConfiguration.java b/dmp-backend/core/src/main/java/eu/eudat/service/lock/LockConfiguration.java similarity index 93% rename from dmp-backend/core/src/main/java/eu/eudat/configurations/lock/LockConfiguration.java rename to dmp-backend/core/src/main/java/eu/eudat/service/lock/LockConfiguration.java index 48b6aa40c..1ba7484cf 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/configurations/lock/LockConfiguration.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/lock/LockConfiguration.java @@ -1,4 +1,4 @@ -package eu.eudat.configurations.lock; +package eu.eudat.service.lock; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.context.properties.EnableConfigurationProperties; diff --git a/dmp-backend/core/src/main/java/eu/eudat/configurations/lock/LockProperties.java b/dmp-backend/core/src/main/java/eu/eudat/service/lock/LockProperties.java similarity index 89% rename from dmp-backend/core/src/main/java/eu/eudat/configurations/lock/LockProperties.java rename to dmp-backend/core/src/main/java/eu/eudat/service/lock/LockProperties.java index 314df9964..dcc3ce6e2 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/configurations/lock/LockProperties.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/lock/LockProperties.java @@ -1,4 +1,4 @@ -package eu.eudat.configurations.lock; +package eu.eudat.service.lock; import org.springframework.boot.context.properties.ConfigurationProperties; diff --git a/dmp-backend/core/src/main/java/eu/eudat/service/lock/LockServiceImpl.java b/dmp-backend/core/src/main/java/eu/eudat/service/lock/LockServiceImpl.java index 80595dbc8..98ca5bdc9 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/service/lock/LockServiceImpl.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/lock/LockServiceImpl.java @@ -6,7 +6,6 @@ import eu.eudat.authorization.Permission; import eu.eudat.authorization.authorizationcontentresolver.AuthorizationContentResolver; import eu.eudat.commons.enums.LockTargetType; import eu.eudat.commons.scope.user.UserScope; -import eu.eudat.configurations.lock.LockProperties; import eu.eudat.convention.ConventionService; import eu.eudat.data.LockEntity; import eu.eudat.errorcode.ErrorThesaurusProperties; diff --git a/dmp-backend/core/src/main/java/eu/eudat/configurations/tenant/TenantConfiguration.java b/dmp-backend/core/src/main/java/eu/eudat/service/tenant/TenantConfiguration.java similarity index 93% rename from dmp-backend/core/src/main/java/eu/eudat/configurations/tenant/TenantConfiguration.java rename to dmp-backend/core/src/main/java/eu/eudat/service/tenant/TenantConfiguration.java index e91e3367a..e24a062bf 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/configurations/tenant/TenantConfiguration.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/tenant/TenantConfiguration.java @@ -1,4 +1,4 @@ -package eu.eudat.configurations.tenant; +package eu.eudat.service.tenant; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.context.properties.EnableConfigurationProperties; diff --git a/dmp-backend/core/src/main/java/eu/eudat/configurations/tenant/TenantProperties.java b/dmp-backend/core/src/main/java/eu/eudat/service/tenant/TenantProperties.java similarity index 94% rename from dmp-backend/core/src/main/java/eu/eudat/configurations/tenant/TenantProperties.java rename to dmp-backend/core/src/main/java/eu/eudat/service/tenant/TenantProperties.java index a64b51a6c..e5f35de77 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/configurations/tenant/TenantProperties.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/tenant/TenantProperties.java @@ -1,4 +1,4 @@ -package eu.eudat.configurations.tenant; +package eu.eudat.service.tenant; import org.springframework.boot.context.properties.ConfigurationProperties; diff --git a/dmp-backend/core/src/main/java/eu/eudat/service/tenant/TenantServiceImpl.java b/dmp-backend/core/src/main/java/eu/eudat/service/tenant/TenantServiceImpl.java index 393495331..a3277f4ba 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/service/tenant/TenantServiceImpl.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/tenant/TenantServiceImpl.java @@ -5,7 +5,6 @@ import eu.eudat.authorization.Permission; import eu.eudat.commons.XmlHandlingService; import eu.eudat.commons.enums.IsActive; import eu.eudat.commons.types.tenant.*; -import eu.eudat.configurations.tenant.TenantProperties; import eu.eudat.convention.ConventionService; import eu.eudat.data.TenantEntity; import eu.eudat.errorcode.ErrorThesaurusProperties; diff --git a/dmp-backend/core/src/main/java/eu/eudat/configurations/transformer/TransformerCacheOptions.java b/dmp-backend/core/src/main/java/eu/eudat/service/transformer/FileTransformerCacheOptions.java similarity index 62% rename from dmp-backend/core/src/main/java/eu/eudat/configurations/transformer/TransformerCacheOptions.java rename to dmp-backend/core/src/main/java/eu/eudat/service/transformer/FileTransformerCacheOptions.java index a7a1508d6..32ec50d5c 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/configurations/transformer/TransformerCacheOptions.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/transformer/FileTransformerCacheOptions.java @@ -1,8 +1,8 @@ -package eu.eudat.configurations.transformer; +package eu.eudat.service.transformer; import gr.cite.tools.cache.CacheOptions; import org.springframework.boot.context.properties.ConfigurationProperties; @ConfigurationProperties(prefix = "cache.transformer") -public class TransformerCacheOptions extends CacheOptions { +public class FileTransformerCacheOptions extends CacheOptions { } diff --git a/dmp-backend/core/src/main/java/eu/eudat/service/transformer/FileTransformerConfiguration.java b/dmp-backend/core/src/main/java/eu/eudat/service/transformer/FileTransformerConfiguration.java new file mode 100644 index 000000000..a1883020d --- /dev/null +++ b/dmp-backend/core/src/main/java/eu/eudat/service/transformer/FileTransformerConfiguration.java @@ -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 { +} diff --git a/dmp-backend/core/src/main/java/eu/eudat/service/transformer/FileTransformerConfigurationCache.java b/dmp-backend/core/src/main/java/eu/eudat/service/transformer/FileTransformerConfigurationCache.java index 6158cc438..357f4b67b 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/service/transformer/FileTransformerConfigurationCache.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/transformer/FileTransformerConfigurationCache.java @@ -1,19 +1,15 @@ package eu.eudat.service.transformer; -import eu.eudat.configurations.deposit.DepositCacheOptions; -import eu.eudat.configurations.transformer.TransformerCacheOptions; import eu.eudat.model.file.TransformerCacheModel; import gr.cite.tools.cache.CacheService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; -import java.util.List; - @Component public class FileTransformerConfigurationCache extends CacheService { @Autowired - public FileTransformerConfigurationCache(TransformerCacheOptions options) { + public FileTransformerConfigurationCache(FileTransformerCacheOptions options) { super(options); } diff --git a/dmp-backend/core/src/main/java/eu/eudat/configurations/transformer/TransformerProperties.java b/dmp-backend/core/src/main/java/eu/eudat/service/transformer/FileTransformerProperties.java similarity index 91% rename from dmp-backend/core/src/main/java/eu/eudat/configurations/transformer/TransformerProperties.java rename to dmp-backend/core/src/main/java/eu/eudat/service/transformer/FileTransformerProperties.java index 9fa417aa3..0ce22241e 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/configurations/transformer/TransformerProperties.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/transformer/FileTransformerProperties.java @@ -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.bind.ConstructorBinding; @@ -6,12 +6,12 @@ import org.springframework.boot.context.properties.bind.ConstructorBinding; import java.util.List; @ConfigurationProperties(prefix = "transformer") -public class TransformerProperties { +public class FileTransformerProperties { private final List sources; @ConstructorBinding - public TransformerProperties(List sources) { + public FileTransformerProperties(List sources) { this.sources = sources; } diff --git a/dmp-backend/core/src/main/java/eu/eudat/service/transformer/FileTransformerServiceImpl.java b/dmp-backend/core/src/main/java/eu/eudat/service/transformer/FileTransformerServiceImpl.java index 88143c9b6..5b98098a5 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/service/transformer/FileTransformerServiceImpl.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/transformer/FileTransformerServiceImpl.java @@ -6,9 +6,7 @@ import eu.eudat.commonmodels.models.FileEnvelopeModel; import eu.eudat.commonmodels.models.description.DescriptionModel; import eu.eudat.commonmodels.models.dmp.DmpModel; import eu.eudat.commons.enums.StorageType; -import eu.eudat.configurations.transformer.TransformerProperties; import eu.eudat.file.transformer.interfaces.FileTransformerConfiguration; -import eu.eudat.file.transformer.models.misc.FileFormat; import eu.eudat.model.Description; import eu.eudat.model.Dmp; import eu.eudat.model.builder.commonmodels.description.DescriptionCommonModelBuilder; @@ -43,7 +41,7 @@ import java.util.*; public class FileTransformerServiceImpl implements FileTransformerService { private static final Logger logger = LoggerFactory.getLogger(FileTransformerServiceImpl.class); - private final TransformerProperties transformerProperties; + private final FileTransformerProperties fileTransformerProperties; private final Map clients; private final TokenExchangeCacheService tokenExchangeCacheService; private final FileTransformerConfigurationCache fileTransformerConfigurationCache; @@ -54,9 +52,9 @@ public class FileTransformerServiceImpl implements FileTransformerService { private final MessageSource messageSource; @Autowired - public FileTransformerServiceImpl(TransformerProperties transformerProperties, TokenExchangeCacheService tokenExchangeCacheService, FileTransformerConfigurationCache fileTransformerConfigurationCache, AuthorizationService authorizationService, - QueryFactory queryFactory, BuilderFactory builderFactory, StorageFileService storageFileService, MessageSource messageSource) { - this.transformerProperties = transformerProperties; + public FileTransformerServiceImpl(FileTransformerProperties fileTransformerProperties, TokenExchangeCacheService tokenExchangeCacheService, FileTransformerConfigurationCache fileTransformerConfigurationCache, AuthorizationService authorizationService, + QueryFactory queryFactory, BuilderFactory builderFactory, StorageFileService storageFileService, MessageSource messageSource) { + this.fileTransformerProperties = fileTransformerProperties; this.tokenExchangeCacheService = tokenExchangeCacheService; this.fileTransformerConfigurationCache = fileTransformerConfigurationCache; this.authorizationService = authorizationService; @@ -71,7 +69,7 @@ public class FileTransformerServiceImpl implements FileTransformerService { if (this.clients.containsKey(repoId)) return this.clients.get(repoId); //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) { String host = URI.create(source.getUrl()).getHost(); 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) { List configurations = new ArrayList<>(); //GK: So much for lazy loading - List repositories = transformerProperties.getSources().stream().map(depositSource -> getRepository(depositSource.getTransformerId())).toList(); + List repositories = fileTransformerProperties.getSources().stream().map(depositSource -> getRepository(depositSource.getTransformerId())).toList(); repositories = new ArrayList<>(repositories); repositories.forEach((client) -> { diff --git a/dmp-backend/core/src/main/java/eu/eudat/service/user/UserServiceImpl.java b/dmp-backend/core/src/main/java/eu/eudat/service/user/UserServiceImpl.java index ce9a20cc7..ffa1e71b8 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/service/user/UserServiceImpl.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/user/UserServiceImpl.java @@ -17,7 +17,7 @@ import eu.eudat.commons.types.actionconfirmation.RemoveCredentialRequestEntity; import eu.eudat.commons.types.notification.*; import eu.eudat.commons.types.user.AdditionalInfoEntity; 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.data.*; import eu.eudat.errorcode.ErrorThesaurusProperties; diff --git a/dmp-backend/core/src/main/java/eu/eudat/service/visibility/VisibilityServiceImpl.java b/dmp-backend/core/src/main/java/eu/eudat/service/visibility/VisibilityServiceImpl.java index 615ac4096..d4c8a4a33 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/service/visibility/VisibilityServiceImpl.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/visibility/VisibilityServiceImpl.java @@ -3,8 +3,8 @@ package eu.eudat.service.visibility; import eu.eudat.commons.types.description.PropertyDefinitionEntity; import eu.eudat.commons.types.descriptiontemplate.*; import eu.eudat.model.persist.descriptionproperties.PropertyDefinitionPersist; +import org.apache.commons.lang3.NotImplementedException; -import javax.ws.rs.NotSupportedException; import java.util.*; 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; if (eu.eudat.commons.enums.FieldType.isTextType(fieldType) && field.getTextValue() != null && !field.getTextValue().isBlank()) { 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 { 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.isExternalIdentifierType(fieldType) && field.getExternalIdentifier() != null) { - throw new NotSupportedException("External identifier rule not supported"); + throw new NotImplementedException("External identifier rule not supported"); } } return false; diff --git a/dmp-backend/pom.xml b/dmp-backend/pom.xml index b3bf79193..5be3370ea 100644 --- a/dmp-backend/pom.xml +++ b/dmp-backend/pom.xml @@ -10,7 +10,7 @@ org.springframework.boot spring-boot-starter-parent - 3.2.1 + 3.2.4 @@ -94,6 +94,13 @@ elasticsearch-rest-high-level-client 7.17.19 + + + org.elasticsearch.client + transport + 7.6.0 + + org.hibernate.orm hibernate-core @@ -133,12 +140,7 @@ com.fasterxml.jackson.datatype jackson-datatype-jsr310 - 2.13.3 - - - - com.fasterxml.jackson.module - jackson-module-jaxb-annotations + 2.17.0 @@ -150,94 +152,25 @@ org.apache.commons commons-lang3 - 3.5 + 3.14.0 - - org.jsoup - jsoup - 1.15.3 - - - - fr.opensagres.xdocreport - org.apache.poi.xwpf.converter.pdf - 1.0.6 - - - - fr.opensagres.xdocreport - org.apache.poi.xwpf.converter.core - 1.0.6 - - - - - commons-io - commons-io - 2.1 - + - - org.elasticsearch.client - transport - 7.6.0 - - - - - javax.xml.bind - jaxb-api - 2.3.1 - - - - - org.glassfish.jaxb - jaxb-core - 4.0.3 - - - - - org.glassfish.jaxb - jaxb-runtime - 4.0.3 - - - - - - jakarta.annotation - jakarta.annotation-api - - - - - jakarta.validation - jakarta.validation-api - - - - jakarta.persistence - jakarta.persistence-api - 3.1.0 - - @@ -279,16 +212,7 @@ io.micrometer micrometer-core - - org.springframework.boot - spring-boot-starter-validation - - - gr.cite - oidc-authn - 2.2.1 - gr.cite data-tools @@ -297,17 +221,12 @@ gr.cite exceptions - 2.1.0 + 2.2.0 gr.cite logging - 2.1.0 - - - gr.cite - validation - 3.0.3 + 2.2.0 gr.cite @@ -315,11 +234,6 @@ 2.2.0 - - gr.cite - oidc-authz - 2.1.0 - gr.cite elastic @@ -329,19 +243,9 @@ gr.cite keycloak-api - 1.0.0 + 2.2.0 - - gr.cite - queue-inbox - 2.1.1 - - - gr.cite - queue-outbox - 2.1.1 - gr.cite diff --git a/dmp-backend/web/pom.xml b/dmp-backend/web/pom.xml index 481d5ba04..fbeddca5c 100644 --- a/dmp-backend/web/pom.xml +++ b/dmp-backend/web/pom.xml @@ -21,21 +21,12 @@ core ${revision} - - gr.cite.opendmp - repositorydepositbase - 2.0.2 - org.springframework.boot spring-boot-starter-web - - org.springframework.boot - spring-boot-starter-mail - org.springframework.boot spring-boot-starter-webflux @@ -68,12 +59,6 @@ --> - - com.github.ben-manes.caffeine - caffeine - 3.1.5 - - io.swagger swagger-annotations @@ -124,67 +109,6 @@ spring-boot-starter-tomcat - - org.opensaml - opensaml-core - ${opensaml.version} - compile - - - org.opensaml - opensaml-saml-api - ${opensaml.version} - compile - - - org.opensaml - opensaml-saml-impl - ${opensaml.version} - compile - - - org.opensaml - opensaml-soap-api - ${opensaml.version} - compile - - - org.opensaml - opensaml-xmlsec-api - ${opensaml.version} - - - org.opensaml - opensaml-security-api - ${opensaml.version} - - - org.opensaml - opensaml-security-impl - ${opensaml.version} - - - org.opensaml - opensaml-profile-api - ${opensaml.version} - - - org.opensaml - xmltooling - 1.4.4 - - - jakarta.xml.soap - jakarta.xml.soap-api - 3.0.0 - - - com.sun.xml.messaging.saaj - saaj-impl - 3.0.0-M2 - - - gr.cite @@ -194,12 +118,7 @@ gr.cite exceptions-web - 1.0.0 - - - gr.cite.opendmp - file-transformer-base - 0.0.10 + 2.2.0 @@ -269,7 +188,6 @@ eu.eudat.EuDatApplication - 4.0.1 21 21 21 diff --git a/dmp-backend/web/src/main/java/eu/eudat/interceptors/UserInterceptor.java b/dmp-backend/web/src/main/java/eu/eudat/interceptors/UserInterceptor.java index c5d377581..dd1696511 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/interceptors/UserInterceptor.java +++ b/dmp-backend/web/src/main/java/eu/eudat/interceptors/UserInterceptor.java @@ -9,7 +9,7 @@ import eu.eudat.commons.lock.LockByKeyManager; import eu.eudat.commons.scope.user.UserScope; import eu.eudat.commons.types.user.AdditionalInfoEntity; 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.UserCredentialEntity; import eu.eudat.data.UserEntity; diff --git a/dmp-backend/web/src/main/resources/config/db.yml b/dmp-backend/web/src/main/resources/config/db.yml index fcc2c426e..be3c5fb52 100644 --- a/dmp-backend/web/src/main/resources/config/db.yml +++ b/dmp-backend/web/src/main/resources/config/db.yml @@ -16,7 +16,7 @@ spring: dialect: org.hibernate.dialect.PostgreSQLDialect hibernate: naming: - physical-strategy: eu.eudat.configurations.db.PrefixPhysicalNamingStrategy + physical-strategy: eu.eudat.data.namingstrategy.PrefixPhysicalNamingStrategy implicit-strategy: org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy datasource: url: ${DB_URL:} diff --git a/dmp-frontend/src/app/ui/admin/description-template/editor/components/composite-field/description-template-editor-composite-field.component.html b/dmp-frontend/src/app/ui/admin/description-template/editor/components/composite-field/description-template-editor-composite-field.component.html index b2a04c4f3..fddc460a8 100644 --- a/dmp-frontend/src/app/ui/admin/description-template/editor/components/composite-field/description-template-editor-composite-field.component.html +++ b/dmp-frontend/src/app/ui/admin/description-template/editor/components/composite-field/description-template-editor-composite-field.component.html @@ -98,7 +98,7 @@
- +
diff --git a/dmp-frontend/src/app/ui/admin/description-template/editor/components/composite-field/description-template-editor-composite-field.component.ts b/dmp-frontend/src/app/ui/admin/description-template/editor/components/composite-field/description-template-editor-composite-field.component.ts index 7b7cd9267..63c5d8906 100644 --- a/dmp-frontend/src/app/ui/admin/description-template/editor/components/composite-field/description-template-editor-composite-field.component.ts +++ b/dmp-frontend/src/app/ui/admin/description-template/editor/components/composite-field/description-template-editor-composite-field.component.ts @@ -79,6 +79,7 @@ export class DescriptionTemplateEditorCompositeFieldComponent extends BaseCompon public enumUtils: EnumUtils, public datasetProfileService: DescriptionTemplateService, private configurationService: ConfigurationService, + public visibilityRulesService: VisibilityRulesService ) { super(); } @@ -289,6 +290,7 @@ export class DescriptionTemplateEditorCompositeFieldComponent extends BaseCompon this.previewPropertiesFormGroup = descriptionEditorModel.properties.fieldSets.get(fieldSet.id).buildForm() as UntypedFormGroup; this.previewFieldSet = fieldSet; + this.visibilityRulesService.setContext(mockDescription.descriptionTemplate.definition, this.previewPropertiesFormGroup); // this.previewSubject$.next(section); } @@ -561,10 +563,6 @@ export class DescriptionTemplateEditorCompositeFieldComponent extends BaseCompon break; } - case DescriptionTemplateFieldType.INTERNAL_ENTRIES_DMPS: { - //TODO: refactor - break; - } case DescriptionTemplateFieldType.INTERNAL_ENTRIES_DMPS: case DescriptionTemplateFieldType.INTERNAL_ENTRIES_DESCRIPTIONS: { const data: DescriptionTemplateLabelAndMultiplicityData = { diff --git a/dmp-frontend/src/app/ui/admin/description-template/editor/components/default-value/description-template-editor-default-value.component.html b/dmp-frontend/src/app/ui/admin/description-template/editor/components/default-value/description-template-editor-default-value.component.html index f44fa5a1f..13dd0f1dc 100644 --- a/dmp-frontend/src/app/ui/admin/description-template/editor/components/default-value/description-template-editor-default-value.component.html +++ b/dmp-frontend/src/app/ui/admin/description-template/editor/components/default-value/description-template-editor-default-value.component.html @@ -27,10 +27,10 @@ {{'GENERAL.VALIDATION.REQUIRED' | translate}} - + {{placeHolder}} - + {{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.FORM.FIELD.DEFAULT-VALUES.NONE' | translate }} {{opt.get('label').value}} diff --git a/dmp-frontend/src/app/ui/admin/description-template/editor/components/field/description-template-editor-field.component.ts b/dmp-frontend/src/app/ui/admin/description-template/editor/components/field/description-template-editor-field.component.ts index e2586572f..2cbb44a9d 100644 --- a/dmp-frontend/src/app/ui/admin/description-template/editor/components/field/description-template-editor-field.component.ts +++ b/dmp-frontend/src/app/ui/admin/description-template/editor/components/field/description-template-editor-field.component.ts @@ -161,10 +161,6 @@ export class DescriptionTemplateEditorFieldComponent extends BaseComponent imple break; } - case DescriptionTemplateFieldType.INTERNAL_ENTRIES_DMPS: { - //TODO: refactor - break; - } case DescriptionTemplateFieldType.INTERNAL_ENTRIES_DMPS: case DescriptionTemplateFieldType.INTERNAL_ENTRIES_DESCRIPTIONS:{ const data: DescriptionTemplateLabelAndMultiplicityData = { diff --git a/dmp-frontend/src/app/ui/admin/description-template/editor/components/final-preview/final-preview.component.html b/dmp-frontend/src/app/ui/admin/description-template/editor/components/final-preview/final-preview.component.html index be1d8a544..ec44fbce4 100644 --- a/dmp-frontend/src/app/ui/admin/description-template/editor/components/final-preview/final-preview.component.html +++ b/dmp-frontend/src/app/ui/admin/description-template/editor/components/final-preview/final-preview.component.html @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/dmp-frontend/src/app/ui/admin/description-template/editor/components/final-preview/final-preview.component.ts b/dmp-frontend/src/app/ui/admin/description-template/editor/components/final-preview/final-preview.component.ts index 299c36886..dfd1b102c 100644 --- a/dmp-frontend/src/app/ui/admin/description-template/editor/components/final-preview/final-preview.component.ts +++ b/dmp-frontend/src/app/ui/admin/description-template/editor/components/final-preview/final-preview.component.ts @@ -21,13 +21,20 @@ export class FinalPreviewComponent implements OnInit { @Input() descriptionTemplatePersist: DescriptionTemplatePersist; descriptionTemplate: DescriptionTemplate; - previewPropertiesFormGroup - @Input() formGroup = null; + previewPropertiesFormGroup: UntypedFormGroup; constructor(public visibilityRulesService: VisibilityRulesService) { } + ngOnInit(): void { + this.generatePreviewForm(); + } + + ngOnChanges(changes: SimpleChanges) { + if(changes['descriptionTemplatePersist']) this.generatePreviewForm(); + } + private generatePreviewForm() { this.descriptionTemplate = this.buildDescriptionTemplate(this.descriptionTemplatePersist); @@ -132,12 +139,4 @@ export class FinalPreviewComponent implements OnInit { return convertedField; } - ngOnInit(): void { - this.generatePreviewForm(); - } - - // ngOnChanges(changes: SimpleChanges) { - // if(changes['descriptionTemplatePersist']) this.generatePreviewForm(); - // } - } diff --git a/dmp-frontend/src/app/ui/admin/description-template/editor/components/visibility-rule/description-template-editor-visibility-rule.component.html b/dmp-frontend/src/app/ui/admin/description-template/editor/components/visibility-rule/description-template-editor-visibility-rule.component.html index 1565b3ffd..193137eee 100644 --- a/dmp-frontend/src/app/ui/admin/description-template/editor/components/visibility-rule/description-template-editor-visibility-rule.component.html +++ b/dmp-frontend/src/app/ui/admin/description-template/editor/components/visibility-rule/description-template-editor-visibility-rule.component.html @@ -3,6 +3,7 @@ + diff --git a/dmp-frontend/src/app/ui/admin/description-template/editor/components/visibility-rule/description-template-editor-visibility-rule.component.ts b/dmp-frontend/src/app/ui/admin/description-template/editor/components/visibility-rule/description-template-editor-visibility-rule.component.ts index 89a1ed900..a8858a03f 100644 --- a/dmp-frontend/src/app/ui/admin/description-template/editor/components/visibility-rule/description-template-editor-visibility-rule.component.ts +++ b/dmp-frontend/src/app/ui/admin/description-template/editor/components/visibility-rule/description-template-editor-visibility-rule.component.ts @@ -43,12 +43,12 @@ export class DescriptionTemplateEditorRuleComponent implements OnInit { return type == DescriptionTemplateFieldType.FREE_TEXT || type == DescriptionTemplateFieldType.CHECK_BOX || type == DescriptionTemplateFieldType.TEXT_AREA || type == DescriptionTemplateFieldType.RICH_TEXT_AREA || type == DescriptionTemplateFieldType.BOOLEAN_DECISION || type == DescriptionTemplateFieldType.RADIO_BOX || - type == DescriptionTemplateFieldType.CURRENCY || type == DescriptionTemplateFieldType.SELECT; + type == DescriptionTemplateFieldType.CURRENCY; } isTextListType(type: DescriptionTemplateFieldType){ 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){ diff --git a/dmp-frontend/src/app/ui/admin/description-template/editor/description-template-editor.component.html b/dmp-frontend/src/app/ui/admin/description-template/editor/description-template-editor.component.html index 3350341c6..abd722118 100644 --- a/dmp-frontend/src/app/ui/admin/description-template/editor/description-template-editor.component.html +++ b/dmp-frontend/src/app/ui/admin/description-template/editor/description-template-editor.component.html @@ -268,7 +268,7 @@
- +
diff --git a/dmp-frontend/src/app/ui/admin/description-template/editor/description-template-editor.component.ts b/dmp-frontend/src/app/ui/admin/description-template/editor/description-template-editor.component.ts index a4aaf654f..276639b3a 100644 --- a/dmp-frontend/src/app/ui/admin/description-template/editor/description-template-editor.component.ts +++ b/dmp-frontend/src/app/ui/admin/description-template/editor/description-template-editor.component.ts @@ -78,6 +78,7 @@ export class DescriptionTemplateEditorComponent extends BaseEditor { - // 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 = this.datasetWizardModel.buildForm().get('datasetProfileDefinition'); - // }); + this.finalPreviewDescriptionTemplatePersist = this.formGroup.getRawValue(); } // diff --git a/dmp-frontend/src/app/ui/description/editor/description-form/components/form-section/form-section.component.html b/dmp-frontend/src/app/ui/description/editor/description-form/components/form-section/form-section.component.html index 97ac3dbac..b1bed6675 100644 --- a/dmp-frontend/src/app/ui/description/editor/description-form/components/form-section/form-section.component.html +++ b/dmp-frontend/src/app/ui/description/editor/description-form/components/form-section/form-section.component.html @@ -3,7 +3,7 @@ -
{{path}}.section {{section.title}}
+
{{path}}.section {{section.title}}
{{path}} {{section.title}}