Compare commits

...

11 Commits

156 changed files with 663 additions and 2065 deletions

View File

@ -11,7 +11,6 @@ import eu.eudat.types.grant.GrantStateType;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import schemasMicrosoftComOfficeOffice.LeftDocument;
import javax.persistence.criteria.JoinType; import javax.persistence.criteria.JoinType;
import java.util.Date; import java.util.Date;

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>2.5.2</version> <version>2.6.3</version>
</parent> </parent>
<modules> <modules>
@ -27,41 +27,34 @@
<java.version>1.8</java.version> <java.version>1.8</java.version>
<dmp-backend-commons.version>0.0.1-SNAPSHOT</dmp-backend-commons.version> <dmp-backend-commons.version>0.0.1-SNAPSHOT</dmp-backend-commons.version>
<org.springframework.version>5.3.8</org.springframework.version> <org.springframework.version>5.3.14</org.springframework.version>
<!-- <org.springframeweu.eudat.logic.securityrity.version>3.2.10.RELEASE</org.springframeweu.eudat.logic.securityrity.version> --> <!-- <org.springframeweu.eudat.logic.securityrity.version>3.2.10.RELEASE</org.springframeweu.eudat.logic.securityrity.version> -->
<org.springframework.security.version>5.3.10.RELEASE</org.springframework.security.version> <org.springframework.security.version>5.3.10.RELEASE</org.springframework.security.version>
<!--<com.sun.jersey.version>1.19.1</com.sun.jersey.version>--> <!--<com.sun.jersey.version>1.19.1</com.sun.jersey.version>-->
<!-- <!--
<org.apache.tomcat.tomcat-jdbc.version>7.0.35</org.apache.tomcat.tomcat-jdbc.version> <org.apache.tomcat.tomcat-jdbc.version>7.0.35</org.apache.tomcat.tomcat-jdbc.version>
--> -->
<!--<com.fasterxml.jackson>2.9.0</com.fasterxml.jackson>--> <com.fasterxml.jackson.version>2.13.1</com.fasterxml.jackson.version>
<hibernate.version>5.5.3.Final</hibernate.version> <hibernate.version>5.6.3.Final</hibernate.version>
<commons-codec.version>1.9</commons-codec.version> <commons-codec.version>1.9</commons-codec.version>
<org.junit.version>4.11</org.junit.version> <org.junit.version>4.11</org.junit.version>
<log4j.version>1.2.17</log4j.version> <log4j.version>1.2.17</log4j.version>
<log4j2.version>2.15.0</log4j2.version> <log4j2.version>2.17.0</log4j2.version>
<slf4j.version>1.7.12</slf4j.version> <slf4j.version>1.7.12</slf4j.version>
<!--<jetty.version>11.0.5 <!--<jetty.version>11.0.5
</jetty.version>--> <!-- Adapt this to a version found on http://repo.maven.apache.org/maven2/org/eclipse/jetty/jetty-maven-plugin/ --> </jetty.version>--> <!-- Adapt this to a version found on http://repo.maven.apache.org/maven2/org/eclipse/jetty/jetty-maven-plugin/ -->
<logback.version>1.2.3</logback.version> <logback.version>1.2.10</logback.version>
<!-- <javax.inject.version>1</javax.inject.version>--> <!-- <javax.inject.version>1</javax.inject.version>-->
<!--<javax.servlet.servlet-api.version>3.0.1</javax.servlet.servlet-api.version>--> <!--<javax.servlet.servlet-api.version>3.0.1</javax.servlet.servlet-api.version>-->
<org.apache.poi.version>5.0.0</org.apache.poi.version>
<xml.version>3.0.1</xml.version>
<elasticsearch.version>7.7.0</elasticsearch.version>
</properties> </properties>
<dependencies> <dependencies>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20160810</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId> <artifactId>spring-boot-starter-data-jpa</artifactId>
@ -71,122 +64,70 @@
<dependency> <dependency>
<groupId>org.elasticsearch</groupId> <groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId> <artifactId>elasticsearch</artifactId>
<version>7.7.0</version> <version>${elasticsearch.version}</version>
<exclusions>
<exclusion>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore-nio</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.12</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore-nio</artifactId>
<version>4.4.13</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>4.4.13</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.elasticsearch.client</groupId> <groupId>org.elasticsearch.client</groupId>
<artifactId>elasticsearch-rest-high-level-client</artifactId> <artifactId>elasticsearch-rest-high-level-client</artifactId>
<version>7.6.0</version> <version>${elasticsearch.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>${hibernate.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-c3p0</artifactId>
<version>${hibernate.version}</version>
</dependency> </dependency>
<!-- https://mvnrepository.com/artifact/com.google.api-client/google-api-client --> <!-- https://mvnrepository.com/artifact/com.google.api-client/google-api-client -->
<dependency> <dependency>
<groupId>com.google.api-client</groupId> <groupId>com.google.api-client</groupId>
<artifactId>google-api-client</artifactId> <artifactId>google-api-client</artifactId>
<version>1.23.0</version> <version>1.33.0</version>
</dependency> </dependency>
<!-- https://mvnrepository.com/artifact/com.jayway.jsonpath/json-path --> <!-- https://mvnrepository.com/artifact/com.jayway.jsonpath/json-path -->
<dependency> <dependency>
<groupId>com.jayway.jsonpath</groupId> <groupId>com.jayway.jsonpath</groupId>
<artifactId>json-path</artifactId> <artifactId>json-path</artifactId>
<version>2.4.0</version> <version>2.6.0</version>
</dependency> </dependency>
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.dataformat/jackson-dataformat-xml -->
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-xml</artifactId>
<version>2.12.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackeu.eudat.corecore/jackeu.eudat.corecore --> <!-- https://mvnrepository.com/artifact/com.fasterxml.jackeu.eudat.corecore/jackeu.eudat.corecore -->
<dependency> <dependency>
<groupId>com.fasterxml.jackson.core</groupId> <groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId> <artifactId>jackson-core</artifactId>
<version>2.12.3</version> <version>${com.fasterxml.jackson.version}</version>
</dependency> </dependency>
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackeu.eudat.corecore/jackson-databind --> <!-- https://mvnrepository.com/artifact/com.fasterxml.jackeu.eudat.corecore/jackson-databind -->
<dependency> <dependency>
<groupId>com.fasterxml.jackson.core</groupId> <groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId> <artifactId>jackson-databind</artifactId>
<version>2.12.3</version> <version>${com.fasterxml.jackson.version}</version>
</dependency> </dependency>
<!-- g/a spring --> <dependency>
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackeu.eudat.corecore/jackson-databind --> <groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>${com.fasterxml.jackson.version}</version>
</dependency>
<!-- Various libs --> <!-- Various libs -->
<dependency> <dependency>
<groupId>org.apache.commons</groupId> <groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId> <artifactId>commons-lang3</artifactId>
<version>3.5</version>
</dependency> </dependency>
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi --> <!-- https://mvnrepository.com/artifact/org.apache.poi/poi -->
<dependency> <dependency>
<groupId>org.apache.poi</groupId> <groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId> <artifactId>poi-ooxml</artifactId>
<version>4.0.0</version> <version>${org.apache.poi.version}</version>
</dependency> </dependency>
<!--<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-full</artifactId>
<version>${org.apache.poi.version}</version>
</dependency>-->
<dependency> <dependency>
<groupId>org.apache.poi</groupId> <groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId> <artifactId>poi</artifactId>
<version>4.0.0</version> <version>${org.apache.poi.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.xmlgraphics/fop -->
<dependency>
<groupId>org.apache.xmlgraphics</groupId>
<artifactId>fop</artifactId>
<version>2.3</version>
</dependency> </dependency>
<dependency> <dependency>
@ -194,75 +135,37 @@
<artifactId>jsoup</artifactId> <artifactId>jsoup</artifactId>
<version>1.14.3</version> <version>1.14.3</version>
</dependency> </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>fr.opensagres.xdocreport</groupId>
<artifactId>fr.opensagres.xdocreport.itext.extension</artifactId>
<version>2.0.1</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.1</version>
</dependency>
<!--<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-jpamodelgen</artifactId>
</dependency>-->
<dependency> <dependency>
<groupId>org.elasticsearch.client</groupId> <groupId>org.elasticsearch.client</groupId>
<artifactId>transport</artifactId> <artifactId>transport</artifactId>
<version>7.6.0</version> <version>${elasticsearch.version}</version>
</dependency> </dependency>
<!--<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-to-slf4j</artifactId>
<version>2.8.2</version>
</dependency>-->
<!-- https://mvnrepository.com/artifact/javax.xml.bind/jaxb-api -->
<dependency> <dependency>
<groupId>javax.xml.bind</groupId> <groupId>jakarta.xml.bind</groupId>
<artifactId>jaxb-api</artifactId> <artifactId>jakarta.xml.bind-api</artifactId>
<version>2.3.1</version> <version>${xml.version}</version>
</dependency>
<dependency>
<groupId>jakarta.activation</groupId>
<artifactId>jakarta.activation-api</artifactId>
<version>2.0.1</version>
</dependency> </dependency>
<!-- https://mvnrepository.com/artifact/org.glassfish.jaxb/jaxb-core --> <!-- https://mvnrepository.com/artifact/org.glassfish.jaxb/jaxb-core -->
<dependency> <dependency>
<groupId>org.glassfish.jaxb</groupId> <groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-core</artifactId> <artifactId>jaxb-core</artifactId>
<version>2.3.0</version> <version>${xml.version}</version>
</dependency> </dependency>
<!-- https://mvnrepository.com/artifact/org.glassfish.jaxb/jaxb-runtime --> <!-- https://mvnrepository.com/artifact/org.glassfish.jaxb/jaxb-runtime -->
<dependency> <dependency>
<groupId>org.glassfish.jaxb</groupId> <groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId> <artifactId>jaxb-runtime</artifactId>
<version>2.3.1</version> <version>${xml.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.annotation/javax.annotation-api -->
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>1.3.1</version>
</dependency> </dependency>
<!-- https://mvnrepository.com/artifact/javax.validation/validation-api --> <!-- https://mvnrepository.com/artifact/javax.validation/validation-api -->
@ -272,37 +175,11 @@
<version>2.0.1.Final</version> <version>2.0.1.Final</version>
</dependency> </dependency>
<!-- The client -->
<dependency>
<groupId>io.prometheus</groupId>
<artifactId>simpleclient</artifactId>
<version>0.11.0</version>
</dependency>
<!-- Hotspot JVM metrics-->
<dependency>
<groupId>io.prometheus</groupId>
<artifactId>simpleclient_hotspot</artifactId>
<version>0.11.0</version>
</dependency>
<!-- Exposition HTTPServer-->
<dependency>
<groupId>io.prometheus</groupId>
<artifactId>simpleclient_httpserver</artifactId>
<version>0.11.0</version>
</dependency>
<!-- Pushgateway exposition-->
<dependency>
<groupId>io.prometheus</groupId>
<artifactId>simpleclient_pushgateway</artifactId>
<version>0.11.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/io.micrometer/micrometer-registry-prometheus --> <!-- https://mvnrepository.com/artifact/io.micrometer/micrometer-registry-prometheus -->
<dependency> <dependency>
<groupId>io.micrometer</groupId> <groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId> <artifactId>micrometer-registry-prometheus</artifactId>
<version>1.7.1</version> <version>1.8.1</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>

View File

@ -43,35 +43,11 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId> <artifactId>spring-boot-starter-mail</artifactId>
</dependency> </dependency>
<!-- https://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple -->
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.12.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework/spring-context -->
<!--<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>5.3.8</version>
</dependency>-->
<!-- guava eu.eudat.cache -->
<!-- <dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>30.1.1-jre</version>
</dependency>-->
<!-- https://mvnrepository.com/artifact/org.springframework/spring-context-support -->
<dependency> <dependency>
<groupId>com.github.ben-manes.caffeine</groupId> <groupId>com.github.ben-manes.caffeine</groupId>
<artifactId>caffeine</artifactId> <artifactId>caffeine</artifactId>
<version>2.9.0</version> <version>2.9.3</version>
</dependency> </dependency>
@ -80,14 +56,14 @@
<dependency> <dependency>
<groupId>org.junit.jupiter</groupId> <groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId> <artifactId>junit-jupiter-api</artifactId>
<version>5.7.2</version> <version>5.8.2</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.postgresql</groupId> <groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId> <artifactId>postgresql</artifactId>
<version>42.2.22</version> <version>42.3.1</version>
</dependency> </dependency>
<dependency> <dependency>
@ -116,21 +92,11 @@
<artifactId>spring-social-twitter</artifactId> <artifactId>spring-social-twitter</artifactId>
<version>1.1.2.RELEASE</version> <version>1.1.2.RELEASE</version>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</dependency>
</dependencies> </dependencies>
<build> <build>
<finalName>${project.artifactId}-${project.version}</finalName> <finalName>${project.artifactId}-${project.version}</finalName>
<resources> <resources>
<resource>
<directory>src/main/ui-resources</directory>
<excludes>
<exclude>node_modules/**</exclude>
</excludes>
</resource>
<resource> <resource>
<directory>src/main/resources</directory> <directory>src/main/resources</directory>

View File

@ -7,7 +7,6 @@ import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.context.annotation.*; import org.springframework.context.annotation.*;
import org.springframework.core.env.Environment; import org.springframework.core.env.Environment;
import org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor; import org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor;
import org.springframework.jdbc.datasource.DriverManagerDataSource;
import org.springframework.orm.jpa.JpaTransactionManager; import org.springframework.orm.jpa.JpaTransactionManager;
import org.springframework.orm.jpa.JpaVendorAdapter; import org.springframework.orm.jpa.JpaVendorAdapter;
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
@ -67,7 +66,7 @@ public class DevelDatabaseConfiguration {
private Properties additionalProperties() { private Properties additionalProperties() {
Properties properties = new Properties(); Properties properties = new Properties();
properties.setProperty("hibernate.dialect", "org.hibernate.dialect.PostgreSQL92Dialect"); properties.setProperty("hibernate.dialect", "org.hibernate.dialect.PostgreSQL92Dialect");
properties.setProperty("hibernate.show_sql", "true"); properties.setProperty("hibernate.show_sql", "false");
properties.setProperty("hibernate.temp.use_jdbc_metadata_defaults", "false"); properties.setProperty("hibernate.temp.use_jdbc_metadata_defaults", "false");
return properties; return properties;
} }

View File

@ -1,30 +0,0 @@
package eu.eudat.configurations;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.Module;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.databind.module.SimpleModule;
import eu.eudat.criteria.entities.Criteria;
import eu.eudat.criteria.serialzier.CriteriaSerializer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.ArrayList;
@Configuration
public class JacksonConfiguration {
@Bean
public ObjectMapper buildObjectMapper() {
ArrayList<Module> modules = new ArrayList<>();
SimpleModule criteriaSerializerModule = new SimpleModule();
criteriaSerializerModule.addDeserializer(Criteria.class, new CriteriaSerializer());
modules.add(criteriaSerializerModule);
return new ObjectMapper()
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
.registerModules(modules);
}
}

View File

@ -10,8 +10,8 @@ import org.springframework.context.annotation.Profile;
import org.springframework.core.env.Environment; import org.springframework.core.env.Environment;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.xml.bind.JAXBContext; import jakarta.xml.bind.JAXBContext;
import javax.xml.bind.Unmarshaller; import jakarta.xml.bind.Unmarshaller;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.net.URL; import java.net.URL;

View File

@ -10,8 +10,8 @@ import org.springframework.context.annotation.Profile;
import org.springframework.core.env.Environment; import org.springframework.core.env.Environment;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.xml.bind.JAXBContext; import jakarta.xml.bind.JAXBContext;
import javax.xml.bind.Unmarshaller; import jakarta.xml.bind.Unmarshaller;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.net.URL; import java.net.URL;

View File

@ -1,8 +1,8 @@
package eu.eudat.configurations.dynamicfunder.entities; package eu.eudat.configurations.dynamicfunder.entities;
import javax.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper; import jakarta.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement; import jakarta.xml.bind.annotation.XmlRootElement;
import java.util.List; import java.util.List;
@XmlRootElement @XmlRootElement

View File

@ -1,6 +1,6 @@
package eu.eudat.configurations.dynamicfunder.entities; package eu.eudat.configurations.dynamicfunder.entities;
import javax.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlElement;
public class Dependency { public class Dependency {
private String id; private String id;

View File

@ -1,6 +1,6 @@
package eu.eudat.configurations.dynamicfunder.entities; package eu.eudat.configurations.dynamicfunder.entities;
import javax.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlElement;
public class Language { public class Language {
private String key; private String key;

View File

@ -2,8 +2,8 @@ package eu.eudat.configurations.dynamicfunder.entities;
import eu.eudat.logic.proxy.config.UrlConfiguration; import eu.eudat.logic.proxy.config.UrlConfiguration;
import javax.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper; import jakarta.xml.bind.annotation.XmlElementWrapper;
import java.util.List; import java.util.List;
public class MainProperty { public class MainProperty {

View File

@ -1,8 +1,8 @@
package eu.eudat.configurations.dynamicfunder.entities; package eu.eudat.configurations.dynamicfunder.entities;
import javax.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper; import jakarta.xml.bind.annotation.XmlElementWrapper;
import java.util.List; import java.util.List;
public class Property { public class Property {

View File

@ -11,8 +11,8 @@ import org.springframework.context.annotation.Profile;
import org.springframework.core.env.Environment; import org.springframework.core.env.Environment;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.xml.bind.JAXBContext; import jakarta.xml.bind.JAXBContext;
import javax.xml.bind.Unmarshaller; import jakarta.xml.bind.Unmarshaller;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.net.URL; import java.net.URL;

View File

@ -11,8 +11,8 @@ import org.springframework.context.annotation.Profile;
import org.springframework.core.env.Environment; import org.springframework.core.env.Environment;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.xml.bind.JAXBContext; import jakarta.xml.bind.JAXBContext;
import javax.xml.bind.Unmarshaller; import jakarta.xml.bind.Unmarshaller;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.net.URL; import java.net.URL;

View File

@ -1,8 +1,8 @@
package eu.eudat.configurations.dynamicgrant.entities; package eu.eudat.configurations.dynamicgrant.entities;
import javax.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper; import jakarta.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement; import jakarta.xml.bind.annotation.XmlRootElement;
import java.util.List; import java.util.List;
/** /**

View File

@ -1,6 +1,6 @@
package eu.eudat.configurations.dynamicgrant.entities; package eu.eudat.configurations.dynamicgrant.entities;
import javax.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlElement;
/** /**
* Created by ikalyvas on 3/23/2018. * Created by ikalyvas on 3/23/2018.

View File

@ -1,6 +1,6 @@
package eu.eudat.configurations.dynamicgrant.entities; package eu.eudat.configurations.dynamicgrant.entities;
import javax.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlElement;
/** /**
* Created by ikalyvas on 3/28/2018. * Created by ikalyvas on 3/28/2018.

View File

@ -2,8 +2,8 @@ package eu.eudat.configurations.dynamicgrant.entities;
import eu.eudat.logic.proxy.config.UrlConfiguration; import eu.eudat.logic.proxy.config.UrlConfiguration;
import javax.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper; import jakarta.xml.bind.annotation.XmlElementWrapper;
import java.util.List; import java.util.List;
/** /**

View File

@ -1,7 +1,7 @@
package eu.eudat.configurations.dynamicgrant.entities; package eu.eudat.configurations.dynamicgrant.entities;
import javax.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper; import jakarta.xml.bind.annotation.XmlElementWrapper;
import java.util.List; import java.util.List;
/** /**

View File

@ -11,8 +11,8 @@ import org.springframework.context.annotation.Profile;
import org.springframework.core.env.Environment; import org.springframework.core.env.Environment;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.xml.bind.JAXBContext; import jakarta.xml.bind.JAXBContext;
import javax.xml.bind.Unmarshaller; import jakarta.xml.bind.Unmarshaller;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.net.URL; import java.net.URL;

View File

@ -11,8 +11,8 @@ import org.springframework.context.annotation.Profile;
import org.springframework.core.env.Environment; import org.springframework.core.env.Environment;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.xml.bind.JAXBContext; import jakarta.xml.bind.JAXBContext;
import javax.xml.bind.Unmarshaller; import jakarta.xml.bind.Unmarshaller;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.net.URL; import java.net.URL;

View File

@ -1,9 +1,9 @@
package eu.eudat.configurations.dynamicproject.entities; package eu.eudat.configurations.dynamicproject.entities;
import javax.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper; import jakarta.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement; import jakarta.xml.bind.annotation.XmlRootElement;
import java.util.List; import java.util.List;
@XmlRootElement @XmlRootElement

View File

@ -1,6 +1,6 @@
package eu.eudat.configurations.dynamicproject.entities; package eu.eudat.configurations.dynamicproject.entities;
import javax.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlElement;
public class Dependency { public class Dependency {
private String id; private String id;

View File

@ -1,6 +1,6 @@
package eu.eudat.configurations.dynamicproject.entities; package eu.eudat.configurations.dynamicproject.entities;
import javax.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlElement;
public class Language { public class Language {
private String key; private String key;

View File

@ -2,8 +2,8 @@ package eu.eudat.configurations.dynamicproject.entities;
import eu.eudat.logic.proxy.config.UrlConfiguration; import eu.eudat.logic.proxy.config.UrlConfiguration;
import javax.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper; import jakarta.xml.bind.annotation.XmlElementWrapper;
import java.util.List; import java.util.List;
public class MainProperty { public class MainProperty {

View File

@ -1,8 +1,8 @@
package eu.eudat.configurations.dynamicproject.entities; package eu.eudat.configurations.dynamicproject.entities;
import javax.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper; import jakarta.xml.bind.annotation.XmlElementWrapper;
import java.util.List; import java.util.List;
public class Property { public class Property {

View File

@ -9,9 +9,7 @@ import eu.eudat.models.data.components.commons.datafield.AutoCompleteData;
import eu.eudat.models.data.externaldataset.ExternalAutocompleteFieldModel; import eu.eudat.models.data.externaldataset.ExternalAutocompleteFieldModel;
import eu.eudat.models.data.helpers.common.AutoCompleteLookupItem; import eu.eudat.models.data.helpers.common.AutoCompleteLookupItem;
import eu.eudat.models.data.helpers.responses.ResponseItem; import eu.eudat.models.data.helpers.responses.ResponseItem;
import eu.eudat.models.data.properties.PropertiesModel;
import eu.eudat.models.data.security.Principal; import eu.eudat.models.data.security.Principal;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
@ -19,9 +17,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.xml.xpath.XPathExpressionException; import javax.xml.xpath.XPathExpressionException;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.UUID; import java.util.UUID;
import static eu.eudat.types.Authorities.ADMIN; import static eu.eudat.types.Authorities.ADMIN;

View File

@ -14,7 +14,7 @@ import org.springframework.http.ResponseEntity;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.xml.bind.JAXBException; import jakarta.xml.bind.JAXBException;
import java.io.IOException; import java.io.IOException;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;
@ -52,7 +52,6 @@ public class UserInvitationController extends BaseController {
public @ResponseBody public @ResponseBody
// ResponseEntity<ResponseItem<List<UserInfoInvitationModel>>> getUsers(Principal principal) throws IllegalAccessException, InstantiationException { // ResponseEntity<ResponseItem<List<UserInfoInvitationModel>>> getUsers(Principal principal) throws IllegalAccessException, InstantiationException {
ResponseEntity<ResponseItem<List<UserInfoInvitationModel>>> getUsers(Principal principal, @RequestBody UserInfoRequestItem userInfoRequestItem) throws IllegalAccessException, InstantiationException { ResponseEntity<ResponseItem<List<UserInfoInvitationModel>>> getUsers(Principal principal, @RequestBody UserInfoRequestItem userInfoRequestItem) throws IllegalAccessException, InstantiationException {
System.out.println(userInfoRequestItem.getCriteria().getLike());
// List<UserInfoInvitationModel> users = invitationsManager.getUsers(principal); // List<UserInfoInvitationModel> users = invitationsManager.getUsers(principal);
List<UserInfoInvitationModel> users = invitationsManager.getUsersWithCriteria(principal, userInfoRequestItem); List<UserInfoInvitationModel> users = invitationsManager.getUsersWithCriteria(principal, userInfoRequestItem);
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<List<UserInfoInvitationModel>>().status(ApiMessageCode.SUCCESS_MESSAGE).payload(users)); return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<List<UserInfoInvitationModel>>().status(ApiMessageCode.SUCCESS_MESSAGE).payload(users));

View File

@ -1,7 +1,6 @@
package eu.eudat.logic.managers; package eu.eudat.logic.managers;
import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import eu.eudat.configurations.dynamicgrant.DynamicGrantConfiguration; import eu.eudat.configurations.dynamicgrant.DynamicGrantConfiguration;
import eu.eudat.configurations.dynamicgrant.entities.Property; import eu.eudat.configurations.dynamicgrant.entities.Property;
@ -61,10 +60,12 @@ import eu.eudat.models.data.userinfo.UserListingModel;
import eu.eudat.queryable.QueryableList; import eu.eudat.queryable.QueryableList;
import eu.eudat.types.Authorities; import eu.eudat.types.Authorities;
import eu.eudat.types.MetricNames; import eu.eudat.types.MetricNames;
import jakarta.xml.bind.JAXBContext;
import jakarta.xml.bind.JAXBException;
import jakarta.xml.bind.Unmarshaller;
import org.apache.poi.xwpf.usermodel.XWPFDocument; import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.apache.poi.xwpf.usermodel.XWPFParagraph; import org.apache.poi.xwpf.usermodel.XWPFParagraph;
import org.apache.poi.xwpf.usermodel.XWPFRun; import org.apache.poi.xwpf.usermodel.XWPFRun;
import org.json.JSONObject;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -80,9 +81,6 @@ import org.w3c.dom.Document;
import org.w3c.dom.Element; import org.w3c.dom.Element;
import javax.transaction.Transactional; import javax.transaction.Transactional;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
import java.io.*; import java.io.*;
import java.math.BigInteger; import java.math.BigInteger;
import java.nio.file.Files; import java.nio.file.Files;
@ -299,15 +297,21 @@ public class DataManagementPlanManager {
.filter(dataset -> !dataset.getStatus().equals(Dataset.Status.DELETED) && !dataset.getStatus().equals(Dataset.Status.CANCELED)) .filter(dataset -> !dataset.getStatus().equals(Dataset.Status.DELETED) && !dataset.getStatus().equals(Dataset.Status.CANCELED))
.forEach(dataset -> { .forEach(dataset -> {
dataManagementPlan.getDatasets().stream().filter(datasetWizardModel -> datasetWizardModel.getId().equals(dataset.getId())).forEach(datasetWizardModel -> { dataManagementPlan.getDatasets().stream().filter(datasetWizardModel -> datasetWizardModel.getId().equals(dataset.getId())).forEach(datasetWizardModel -> {
DatasetWizardModel wizardModel = datasetManager.getSingle(datasetWizardModel.getId().toString(), principal); DatasetWizardModel wizardModel;
try {
wizardModel = datasetManager.getSingle(datasetWizardModel.getId().toString(), principal);
datasetWizardModel.setDatasetProfileDefinition(wizardModel.getDatasetProfileDefinition()); datasetWizardModel.setDatasetProfileDefinition(wizardModel.getDatasetProfileDefinition());
datasetWizardModel.setTags(wizardModel.getTags()); datasetWizardModel.setTags(wizardModel.getTags());
} catch (JsonProcessingException e) {
logger.error(e.getLocalizedMessage(), e);
}
}); });
}); });
if (isPublic) { if (isPublic) {
dataManagementPlan.setDatasets(dataManagementPlan.getDatasets().stream().filter(dataset -> dataset.getStatus() == Dataset.Status.FINALISED.getValue()).collect(Collectors.toList())); dataManagementPlan.setDatasets(dataManagementPlan.getDatasets().stream().filter(dataset -> dataset.getStatus() == Dataset.Status.FINALISED.getValue()).collect(Collectors.toList()));
} }
Map dmpProperties = dataManagementPlanEntity.getDmpProperties() != null ? new org.json.JSONObject(dataManagementPlanEntity.getDmpProperties()).toMap() : null; Map dmpProperties = dataManagementPlanEntity.getDmpProperties() != null ? apiContext.getObjectMapper().readValue(dataManagementPlanEntity.getDmpProperties(), HashMap.class) : null;
if (dmpProperties != null && dataManagementPlan.getDynamicFields() != null) if (dmpProperties != null && dataManagementPlan.getDynamicFields() != null)
dataManagementPlan.getDynamicFields().forEach(item -> { dataManagementPlan.getDynamicFields().forEach(item -> {
@ -1305,10 +1309,11 @@ public class DataManagementPlanManager {
datasetDescriptionRun.setBold(true); datasetDescriptionRun.setBold(true);
datasetDescriptionRun.setFontSize(12); datasetDescriptionRun.setFontSize(12);
PagedDatasetProfile pagedDatasetProfile = datasetManager.getPagedProfile(dataset, datasetEntity); PagedDatasetProfile pagedDatasetProfile = null;
try {
pagedDatasetProfile = datasetManager.getPagedProfile(dataset, datasetEntity);
visibilityRuleService.setProperties(properties); visibilityRuleService.setProperties(properties);
visibilityRuleService.buildVisibilityContext(pagedDatasetProfile.getRules()); visibilityRuleService.buildVisibilityContext(pagedDatasetProfile.getRules());
try {
wordBuilder.build(document, pagedDatasetProfile, visibilityRuleService); wordBuilder.build(document, pagedDatasetProfile, visibilityRuleService);
} catch (IOException e) { } catch (IOException e) {
logger.error(e.getMessage(), e); logger.error(e.getMessage(), e);
@ -1456,8 +1461,7 @@ public class DataManagementPlanManager {
DatasetWizardModel datasetWizardModel = new DatasetWizardModel(); DatasetWizardModel datasetWizardModel = new DatasetWizardModel();
Map<String, Object> properties = new HashMap<>(); Map<String, Object> properties = new HashMap<>();
if (dataset.getProperties() != null) { if (dataset.getProperties() != null) {
JSONObject jobject = new JSONObject(dataset.getProperties()); properties = apiContext.getObjectMapper().readValue(dataset.getProperties(), HashMap.class);
properties = jobject.toMap();
} }
PagedDatasetProfile pagedDatasetProfile = datasetManager.getPagedProfile(datasetWizardModel, dataset); PagedDatasetProfile pagedDatasetProfile = datasetManager.getPagedProfile(datasetWizardModel, dataset);
visibilityRuleService.setProperties(properties); visibilityRuleService.setProperties(properties);
@ -2017,7 +2021,7 @@ public class DataManagementPlanManager {
headers.setAccept(Collections.singletonList(MediaType.APPLICATION_JSON)); headers.setAccept(Collections.singletonList(MediaType.APPLICATION_JSON));
headers.setContentType(MediaType.APPLICATION_JSON); headers.setContentType(MediaType.APPLICATION_JSON);
String createData = null; String createData = null;
Map<String, Object> extraProperties = dmp.getExtraProperties() != null ? new org.json.JSONObject(dmp.getExtraProperties()).toMap() : new HashMap<>(); Map<String, Object> extraProperties = dmp.getExtraProperties() != null ? apiContext.getObjectMapper().readValue(dmp.getExtraProperties(), HashMap.class) : new HashMap<>();
StringBuilder dataBuilder = new StringBuilder(); StringBuilder dataBuilder = new StringBuilder();
dataBuilder.append("{\n \"metadata\": {\n"); dataBuilder.append("{\n \"metadata\": {\n");
dataBuilder.append( " \"title\": \"").append(dmp.getLabel()).append("\",\n"); dataBuilder.append( " \"title\": \"").append(dmp.getLabel()).append("\",\n");

View File

@ -1,7 +1,7 @@
package eu.eudat.logic.managers; package eu.eudat.logic.managers;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import eu.eudat.data.dao.criteria.*; import eu.eudat.data.dao.criteria.*;
import eu.eudat.data.dao.entities.DataRepositoryDao; import eu.eudat.data.dao.entities.DataRepositoryDao;
import eu.eudat.data.dao.entities.DatasetDao; import eu.eudat.data.dao.entities.DatasetDao;
@ -49,22 +49,22 @@ import eu.eudat.models.data.user.composite.PagedDatasetProfile;
import eu.eudat.queryable.QueryableList; import eu.eudat.queryable.QueryableList;
import eu.eudat.types.Authorities; import eu.eudat.types.Authorities;
import eu.eudat.types.MetricNames; import eu.eudat.types.MetricNames;
import org.apache.commons.io.IOUtils; import jakarta.xml.bind.JAXBContext;
import jakarta.xml.bind.JAXBException;
import jakarta.xml.bind.Unmarshaller;
import org.apache.poi.xwpf.extractor.XWPFWordExtractor; import org.apache.poi.xwpf.extractor.XWPFWordExtractor;
import org.apache.poi.xwpf.usermodel.XWPFDocument; import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.apache.poi.xwpf.usermodel.XWPFParagraph; import org.apache.poi.xwpf.usermodel.XWPFParagraph;
import org.apache.poi.xwpf.usermodel.XWPFRun; import org.apache.poi.xwpf.usermodel.XWPFRun;
import org.json.JSONArray;
import org.json.JSONObject;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment; import org.springframework.core.env.Environment;
import org.springframework.core.io.FileSystemResource; import org.springframework.http.HttpHeaders;
import org.springframework.http.*; import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import org.w3c.dom.Document; import org.w3c.dom.Document;
import org.w3c.dom.Element; import org.w3c.dom.Element;
@ -75,9 +75,6 @@ import javax.activation.MimetypesFileTypeMap;
import javax.persistence.criteria.Join; import javax.persistence.criteria.Join;
import javax.persistence.criteria.JoinType; import javax.persistence.criteria.JoinType;
import javax.transaction.Transactional; import javax.transaction.Transactional;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.xpath.XPath; import javax.xml.xpath.XPath;
@ -91,8 +88,6 @@ import java.time.temporal.ChronoUnit;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream; import java.util.stream.Stream;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
@Component @Component
public class DatasetManager { public class DatasetManager {
@ -279,7 +274,7 @@ public class DatasetManager {
return dataTable; return dataTable;
} }
public DatasetWizardModel getSingle(String id, Principal principal) { public DatasetWizardModel getSingle(String id, Principal principal) throws JsonProcessingException {
DatasetWizardModel dataset = new DatasetWizardModel(); DatasetWizardModel dataset = new DatasetWizardModel();
eu.eudat.data.entities.Dataset datasetEntity = databaseRepository.getDatasetDao().find(UUID.fromString(id), HintedModelFactory.getHint(DatasetWizardModel.class)); eu.eudat.data.entities.Dataset datasetEntity = databaseRepository.getDatasetDao().find(UUID.fromString(id), HintedModelFactory.getHint(DatasetWizardModel.class));
if (datasetEntity.getDmp().getUsers() if (datasetEntity.getDmp().getUsers()
@ -380,12 +375,11 @@ public class DatasetManager {
return databaseRepository.getDatasetDao().find(id); return databaseRepository.getDatasetDao().find(id);
} }
public PagedDatasetProfile getPagedProfile(DatasetWizardModel dataset, eu.eudat.data.entities.Dataset datasetEntity) { public PagedDatasetProfile getPagedProfile(DatasetWizardModel dataset, eu.eudat.data.entities.Dataset datasetEntity) throws JsonProcessingException {
eu.eudat.models.data.user.composite.DatasetProfile datasetprofile = userManager.generateDatasetProfileModel(datasetEntity.getProfile()); eu.eudat.models.data.user.composite.DatasetProfile datasetprofile = userManager.generateDatasetProfileModel(datasetEntity.getProfile());
datasetprofile.setStatus(dataset.getStatus()); datasetprofile.setStatus(dataset.getStatus());
if (datasetEntity.getProperties() != null) { if (datasetEntity.getProperties() != null) {
JSONObject jObject = new JSONObject(datasetEntity.getProperties()); Map<String, Object> properties = apiContext.getObjectMapper().readValue(datasetEntity.getProperties(), HashMap.class);
Map<String, Object> properties = jObject.toMap();
datasetprofile.fromJsonObject(properties); datasetprofile.fromJsonObject(properties);
} }
PagedDatasetProfile pagedDatasetProfile = new PagedDatasetProfile(); PagedDatasetProfile pagedDatasetProfile = new PagedDatasetProfile();
@ -451,8 +445,7 @@ public class DatasetManager {
Map<String, Object> properties = new HashMap<>(); Map<String, Object> properties = new HashMap<>();
if (datasetEntity.getProperties() != null) { if (datasetEntity.getProperties() != null) {
JSONObject jObject = new JSONObject(datasetEntity.getProperties()); properties = apiContext.getObjectMapper().readValue(datasetEntity.getProperties(), HashMap.class);
properties = jObject.toMap();
} }
wordBuilder.addParagraphContent("Dataset Description", document, ParagraphStyle.HEADER2, BigInteger.ZERO); wordBuilder.addParagraphContent("Dataset Description", document, ParagraphStyle.HEADER2, BigInteger.ZERO);
@ -484,8 +477,7 @@ public class DatasetManager {
Map<String, Object> properties = new HashMap<>(); Map<String, Object> properties = new HashMap<>();
if (dataset.getDatasetProfileDefinition() != null) { if (dataset.getDatasetProfileDefinition() != null) {
JSONObject jObject = new JSONObject(propertiesModelToString(dataset.getDatasetProfileDefinition())); properties = apiContext.getObjectMapper().readValue(propertiesModelToString(dataset.getDatasetProfileDefinition()), HashMap.class);
properties = jObject.toMap();
} }
wordBuilder.addParagraphContent("Dataset Description", document, ParagraphStyle.HEADER2, BigInteger.ZERO); wordBuilder.addParagraphContent("Dataset Description", document, ParagraphStyle.HEADER2, BigInteger.ZERO);
@ -542,8 +534,7 @@ public class DatasetManager {
throw new UnauthorisedException(); throw new UnauthorisedException();
Map<String, Object> properties = new HashMap<>(); Map<String, Object> properties = new HashMap<>();
if (datasetEntity.getProperties() != null) { if (datasetEntity.getProperties() != null) {
JSONObject jobject = new JSONObject(datasetEntity.getProperties()); properties = apiContext.getObjectMapper().readValue(datasetEntity.getProperties(), HashMap.class);
properties = jobject.toMap();
} }
PagedDatasetProfile pagedDatasetProfile = getPagedProfile(dataset, datasetEntity); PagedDatasetProfile pagedDatasetProfile = getPagedProfile(dataset, datasetEntity);
visibilityRuleService.setProperties(properties); visibilityRuleService.setProperties(properties);
@ -656,9 +647,9 @@ public class DatasetManager {
nodeList = (NodeList) xPath.compile(expression).evaluate(xmlDocument, XPathConstants.NODESET); nodeList = (NodeList) xPath.compile(expression).evaluate(xmlDocument, XPathConstants.NODESET);
JSONObject obj = new JSONObject(dataset.getProperties()); Map<String, Object> obj = apiContext.getObjectMapper().readValue(dataset.getProperties(), HashMap.class);
VisibilityRuleService visibilityRuleService = this.apiContext.getUtilitiesService().getVisibilityRuleService(); VisibilityRuleService visibilityRuleService = this.apiContext.getUtilitiesService().getVisibilityRuleService();
visibilityRuleService.setProperties(obj.toMap()); visibilityRuleService.setProperties(obj);
dataset.setProfile(profile); dataset.setProfile(profile);
PagedDatasetProfile pagedDatasetProfile = this.getPagedProfile(new DatasetWizardModel(), dataset); PagedDatasetProfile pagedDatasetProfile = this.getPagedProfile(new DatasetWizardModel(), dataset);
@ -666,7 +657,7 @@ public class DatasetManager {
for (String validator : datasetProfileValidators) { for (String validator : datasetProfileValidators) {
if ((obj.has(validator) && (obj.getString(validator) == null || obj.getString(validator).trim().isEmpty())) && isElementVisible(nodeList, validator, visibilityRuleService)) { if ((obj.containsKey(validator) && (obj.get(validator) == null || obj.get(validator).toString().trim().isEmpty())) && isElementVisible(nodeList, validator, visibilityRuleService)) {
throw new Exception("Field value of " + validator + " must be filled."); throw new Exception("Field value of " + validator + " must be filled.");
} }
} }
@ -695,11 +686,10 @@ public class DatasetManager {
} }
} }
private String propertiesModelToString(PagedDatasetProfile pagedDatasetProfile) { private String propertiesModelToString(PagedDatasetProfile pagedDatasetProfile) throws JsonProcessingException {
Map<String, Object> values = new LinkedHashMap<>(); Map<String, Object> values = new LinkedHashMap<>();
pagedDatasetProfile.toMap(values); pagedDatasetProfile.toMap(values);
JSONObject jobject = new JSONObject(values); return apiContext.getObjectMapper().writeValueAsString(values);
return jobject.toString();
} }
public void updateTags(Dataset datasetEntity, List<Tag> tags) throws Exception { public void updateTags(Dataset datasetEntity, List<Tag> tags) throws Exception {
@ -908,12 +898,9 @@ public class DatasetManager {
))))) )))))
.collect(Collectors.toMap(DatasetImportField::getId, DatasetImportField::getValue)); .collect(Collectors.toMap(DatasetImportField::getId, DatasetImportField::getValue));
// Transforms map into json file.
JSONObject jsonDatasetProperties = new JSONObject(importMap);
// Creates the entity data set to save. // Creates the entity data set to save.
eu.eudat.data.entities.Dataset entity = new Dataset(); eu.eudat.data.entities.Dataset entity = new Dataset();
entity.setProperties(jsonDatasetProperties.toString()); entity.setProperties(apiContext.getObjectMapper().writeValueAsString(importMap));
entity.setLabel(importFile.getOriginalFilename()); entity.setLabel(importFile.getOriginalFilename());
DMP dmp = new DMP(); DMP dmp = new DMP();
dmp.setId(UUID.fromString(dmpId)); dmp.setId(UUID.fromString(dmpId));
@ -942,7 +929,7 @@ public class DatasetManager {
// TODO: When tags functionality return. // TODO: When tags functionality return.
} }
public DatasetWizardModel datasetUpdateProfile(String id) { public DatasetWizardModel datasetUpdateProfile(String id) throws JsonProcessingException {
DatasetWizardModel dataset = new DatasetWizardModel(); DatasetWizardModel dataset = new DatasetWizardModel();
eu.eudat.data.entities.Dataset datasetEntity = databaseRepository.getDatasetDao().find(UUID.fromString(id), HintedModelFactory.getHint(DatasetWizardModel.class)); eu.eudat.data.entities.Dataset datasetEntity = databaseRepository.getDatasetDao().find(UUID.fromString(id), HintedModelFactory.getHint(DatasetWizardModel.class));
eu.eudat.elastic.entities.Dataset datasetElastic; eu.eudat.elastic.entities.Dataset datasetElastic;
@ -982,12 +969,11 @@ public class DatasetManager {
return dataset; return dataset;
} }
public PagedDatasetProfile getLatestDatasetProfile(Dataset datasetEntity, DatasetProfile profile) { public PagedDatasetProfile getLatestDatasetProfile(Dataset datasetEntity, DatasetProfile profile) throws JsonProcessingException {
eu.eudat.models.data.user.composite.DatasetProfile datasetprofile = userManager.generateDatasetProfileModel(profile); eu.eudat.models.data.user.composite.DatasetProfile datasetprofile = userManager.generateDatasetProfileModel(profile);
datasetprofile.setStatus(datasetEntity.getStatus()); datasetprofile.setStatus(datasetEntity.getStatus());
if (datasetEntity.getProperties() != null) { if (datasetEntity.getProperties() != null) {
JSONObject jobject = new JSONObject(datasetEntity.getProperties()); Map<String, Object> properties = apiContext.getObjectMapper().readValue(datasetEntity.getProperties(), HashMap.class);
Map<String, Object> properties = jobject.toMap();
datasetprofile.fromJsonObject(properties); datasetprofile.fromJsonObject(properties);
} }
PagedDatasetProfile pagedDatasetProfile = new PagedDatasetProfile(); PagedDatasetProfile pagedDatasetProfile = new PagedDatasetProfile();
@ -1039,9 +1025,8 @@ public class DatasetManager {
public void getTagsFromProfile(DatasetWizardModel wizardModel, Dataset dataset) throws IOException { public void getTagsFromProfile(DatasetWizardModel wizardModel, Dataset dataset) throws IOException {
dataset.setProfile(apiContext.getOperationsContext().getDatabaseRepository().getDatasetProfileDao().find(dataset.getProfile().getId())); dataset.setProfile(apiContext.getOperationsContext().getDatabaseRepository().getDatasetProfileDao().find(dataset.getProfile().getId()));
wizardModel.setDatasetProfileDefinition(this.getPagedProfile(wizardModel, dataset)); wizardModel.setDatasetProfileDefinition(this.getPagedProfile(wizardModel, dataset));
ObjectMapper mapper = new ObjectMapper(); String json = apiContext.getObjectMapper().writeValueAsString(wizardModel.getDatasetProfileDefinition());
String json = mapper.writeValueAsString(wizardModel.getDatasetProfileDefinition()); JsonNode propertiesJson = apiContext.getObjectMapper().readTree(json);
JsonNode propertiesJson = mapper.readTree(json);
DatasetCriteria criteria = new DatasetCriteria(); DatasetCriteria criteria = new DatasetCriteria();
criteria.setHasTags(true); criteria.setHasTags(true);
List<Tag> tags = apiContext.getOperationsContext().getElasticRepository().getDatasetRepository().query(criteria).stream().map(eu.eudat.elastic.entities.Dataset::getTags).flatMap(Collection::stream).filter(StreamDistinctBy.distinctByKey(Tag::getId)).collect(Collectors.toList()); List<Tag> tags = apiContext.getOperationsContext().getElasticRepository().getDatasetRepository().query(criteria).stream().map(eu.eudat.elastic.entities.Dataset::getTags).flatMap(Collection::stream).filter(StreamDistinctBy.distinctByKey(Tag::getId)).collect(Collectors.toList());
@ -1053,11 +1038,20 @@ public class DatasetManager {
JsonNode value = node.get("value"); JsonNode value = node.get("value");
if (!value.toString().equals("\"\"")) { if (!value.toString().equals("\"\"")) {
String stringValue = value.toString().replaceAll("=", ":"); String stringValue = value.toString().replaceAll("=", ":");
JSONArray values = new JSONArray(stringValue); List<Map<String, Object>> values = null;
try {
values = apiContext.getObjectMapper().readValue(stringValue, LinkedList.class);
} catch (JsonProcessingException e) {
logger.error(e.getLocalizedMessage(), e);
}
if (values != null) {
values.iterator().forEachRemaining(element -> { values.iterator().forEachRemaining(element -> {
Map<String, Object> data = ((JSONObject) element).toMap(); Map<String, Object> data = element;
this.addTag(tags, wizardModel.getTags(), data.get("id").toString(), data.get("name").toString()); this.addTag(tags, wizardModel.getTags(), data.get("id").toString(), data.get("name").toString());
}); });
} else {
this.addTag(tags, wizardModel.getTags(), "", value.asText());
}
} }
}); });
} }

View File

@ -60,9 +60,8 @@ public class ExternalDatasetManager {
List<Map<String, String>> remoteRepos = remoteFetcher.getDatasets(externalUrlCriteria, type); List<Map<String, String>> remoteRepos = remoteFetcher.getDatasets(externalUrlCriteria, type);
// Parse items from external sources to listing models. // Parse items from external sources to listing models.
ObjectMapper mapper = new ObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
List<ExternalDatasetListingModel> externalDatasetModels = remoteRepos.stream() List<ExternalDatasetListingModel> externalDatasetModels = remoteRepos.stream()
.map(item -> mapper.convertValue(item, ExternalDatasetListingModel.class)) .map(item -> apiContext.getObjectMapper().convertValue(item, ExternalDatasetListingModel.class))
.collect(Collectors.toCollection(LinkedList::new)); .collect(Collectors.toCollection(LinkedList::new));
// Merge fetched and local. // Merge fetched and local.

View File

@ -15,9 +15,9 @@ import eu.eudat.queryable.QueryableList;
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 javax.xml.bind.JAXBContext; import jakarta.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException; import jakarta.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller; import jakarta.xml.bind.Unmarshaller;
import java.io.IOException; import java.io.IOException;
import java.io.StringReader; import java.io.StringReader;
import java.util.*; import java.util.*;

View File

@ -40,8 +40,7 @@ public class LicenseManager {
List<LicenseModel> licenseModels = new LinkedList<>(); List<LicenseModel> licenseModels = new LinkedList<>();
ObjectMapper mapper = new ObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); licenseModels.addAll(remoteRepos.stream().map(item -> apiContext.getObjectMapper().convertValue(item, LicenseModel.class)).collect(Collectors.toList()));
licenseModels.addAll(remoteRepos.stream().map(item -> mapper.convertValue(item, LicenseModel.class)).collect(Collectors.toList()));
licenseModels = licenseModels.stream().filter(licenseModel -> licenseModel.getName().toLowerCase().contains(query.toLowerCase())).collect(Collectors.toList()); licenseModels = licenseModels.stream().filter(licenseModel -> licenseModel.getName().toLowerCase().contains(query.toLowerCase())).collect(Collectors.toList());
return licenseModels; return licenseModels;
} }

View File

@ -51,7 +51,7 @@ public class NotificationManager {
notification.setNotifiedAt(new Date()); notification.setNotifiedAt(new Date());
notification.setUpdatedAt(new Date()); notification.setUpdatedAt(new Date());
try { try {
Map<String, String> data = new ObjectMapper().readValue(notification.getData(), HashMap.class); Map<String, String> data = apiContext.getObjectMapper().readValue(notification.getData(), HashMap.class);
UserInfo userInfo = this.apiContext.getOperationsContext().getDatabaseRepository().getUserInfoDao().find(UUID.fromString(data.get("userId"))); UserInfo userInfo = this.apiContext.getOperationsContext().getDatabaseRepository().getUserInfoDao().find(UUID.fromString(data.get("userId")));
String subjectTemplate = ""; String subjectTemplate = "";
String contentTemplate = ""; String contentTemplate = "";

View File

@ -46,8 +46,7 @@ public class ServiceManager {
List<Service> serviceList = (this.apiContext.getOperationsContext().getDatabaseRepository().getServiceDao().getWithCriteria(criteria)).toList(); List<Service> serviceList = (this.apiContext.getOperationsContext().getDatabaseRepository().getServiceDao().getWithCriteria(criteria)).toList();
serviceModels = serviceList.stream().map(item -> new ServiceModel().fromDataModel(item)).collect(Collectors.toList()); serviceModels = serviceList.stream().map(item -> new ServiceModel().fromDataModel(item)).collect(Collectors.toList());
} }
ObjectMapper mapper = new ObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); serviceModels.addAll(remoteRepos.stream().map(item -> apiContext.getObjectMapper().convertValue(item, ServiceModel.class)).collect(Collectors.toList()));
serviceModels.addAll(remoteRepos.stream().map(item -> mapper.convertValue(item, ServiceModel.class)).collect(Collectors.toList()));
return serviceModels; return serviceModels;
} }

View File

@ -33,7 +33,6 @@ import eu.eudat.models.data.userinfo.UserProfile;
import eu.eudat.queryable.QueryableList; import eu.eudat.queryable.QueryableList;
import eu.eudat.types.Authorities; import eu.eudat.types.Authorities;
import org.json.JSONObject;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -133,7 +132,7 @@ public class UserManager {
userInfo.setName(settings.entrySet().stream().filter(entry -> entry.getKey().equals("name")).filter(Objects::nonNull).map(entry -> entry.getValue().toString()).findFirst().orElse(userInfo.getName())); userInfo.setName(settings.entrySet().stream().filter(entry -> entry.getKey().equals("name")).filter(Objects::nonNull).map(entry -> entry.getValue().toString()).findFirst().orElse(userInfo.getName()));
settings.remove("name"); settings.remove("name");
result.putAll(settings); result.putAll(settings);
userInfo.setAdditionalinfo(new JSONObject(result).toString()); userInfo.setAdditionalinfo(new ObjectMapper().writeValueAsString(result));
apiContext.getOperationsContext().getDatabaseRepository().getUserInfoDao() apiContext.getOperationsContext().getDatabaseRepository().getUserInfoDao()
.createOrUpdate(userInfo); .createOrUpdate(userInfo);
} }

View File

@ -1,6 +1,6 @@
package eu.eudat.logic.proxy.config; package eu.eudat.logic.proxy.config;
import javax.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlElement;
/** /**
* Created by ikalyvas on 6/29/2018. * Created by ikalyvas on 6/29/2018.

View File

@ -1,6 +1,6 @@
package eu.eudat.logic.proxy.config; package eu.eudat.logic.proxy.config;
import javax.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlElement;
public class DataSearchConfiguration { public class DataSearchConfiguration {
private String type; private String type;

View File

@ -1,7 +1,7 @@
package eu.eudat.logic.proxy.config; package eu.eudat.logic.proxy.config;
import javax.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper; import jakarta.xml.bind.annotation.XmlElementWrapper;
import java.util.List; import java.util.List;
/** /**

View File

@ -4,10 +4,10 @@ package eu.eudat.logic.proxy.config;
import eu.eudat.logic.proxy.config.entities.*; import eu.eudat.logic.proxy.config.entities.*;
import eu.eudat.logic.proxy.config.prefilling.PrefillingConfigMapAdapter; import eu.eudat.logic.proxy.config.prefilling.PrefillingConfigMapAdapter;
import javax.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper; import jakarta.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement; import jakarta.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import java.io.Serializable; import java.io.Serializable;
import java.util.Map; import java.util.Map;

View File

@ -1,7 +1,7 @@
package eu.eudat.logic.proxy.config; package eu.eudat.logic.proxy.config;
import javax.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlElement;
public class UrlConfiguration { public class UrlConfiguration {

View File

@ -1,9 +1,10 @@
package eu.eudat.logic.proxy.config.configloaders; package eu.eudat.logic.proxy.config.configloaders;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import eu.eudat.logic.proxy.config.ExternalUrls; import eu.eudat.logic.proxy.config.ExternalUrls;
import eu.eudat.logic.security.customproviders.ConfigurableProvider.entities.ConfigurableProviders; import eu.eudat.logic.security.customproviders.ConfigurableProvider.entities.ConfigurableProviders;
import jakarta.xml.bind.JAXBContext;
import jakarta.xml.bind.Unmarshaller;
import org.apache.poi.xwpf.usermodel.XWPFDocument; import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -15,8 +16,6 @@ import org.w3c.dom.Node;
import org.w3c.dom.NodeList; import org.w3c.dom.NodeList;
import org.xml.sax.SAXException; import org.xml.sax.SAXException;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.Unmarshaller;
import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.ParserConfigurationException;
@ -106,7 +105,7 @@ public class DefaultConfigLoader implements ConfigLoader {
InputStream is = null; InputStream is = null;
try { try {
is = getStreamFromPath(filePath); is = getStreamFromPath(filePath);
ObjectMapper mapper = new ObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); ObjectMapper mapper = new ObjectMapper();
this.configurableProviders = mapper.readValue(is, ConfigurableProviders.class); this.configurableProviders = mapper.readValue(is, ConfigurableProviders.class);
} catch (IOException | NullPointerException e) { } catch (IOException | NullPointerException e) {
logger.error(e.getMessage(), e); logger.error(e.getMessage(), e);

View File

@ -15,8 +15,8 @@ import org.w3c.dom.Node;
import org.w3c.dom.NodeList; import org.w3c.dom.NodeList;
import org.xml.sax.SAXException; import org.xml.sax.SAXException;
import javax.xml.bind.JAXBContext; import jakarta.xml.bind.JAXBContext;
import javax.xml.bind.Unmarshaller; import jakarta.xml.bind.Unmarshaller;
import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.ParserConfigurationException;

View File

@ -3,8 +3,8 @@ package eu.eudat.logic.proxy.config.entities;
import eu.eudat.logic.proxy.config.FetchStrategy; import eu.eudat.logic.proxy.config.FetchStrategy;
import eu.eudat.logic.proxy.config.UrlConfiguration; import eu.eudat.logic.proxy.config.UrlConfiguration;
import javax.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper; import jakarta.xml.bind.annotation.XmlElementWrapper;
import java.util.List; import java.util.List;

View File

@ -1,7 +1,7 @@
package eu.eudat.logic.proxy.config.entities; package eu.eudat.logic.proxy.config.entities;
import javax.xml.bind.annotation.XmlAttribute; import jakarta.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement; import jakarta.xml.bind.annotation.XmlRootElement;
@XmlRootElement(name = "mapping") @XmlRootElement(name = "mapping")
public class DefaultPrefillingMapping implements PrefillingMapping{ public class DefaultPrefillingMapping implements PrefillingMapping{

View File

@ -3,8 +3,8 @@ package eu.eudat.logic.proxy.config.entities;
import eu.eudat.logic.proxy.config.FetchStrategy; import eu.eudat.logic.proxy.config.FetchStrategy;
import eu.eudat.logic.proxy.config.UrlConfiguration; import eu.eudat.logic.proxy.config.UrlConfiguration;
import javax.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper; import jakarta.xml.bind.annotation.XmlElementWrapper;
import java.util.List; import java.util.List;
public class FunderUrls extends GenericUrls{ public class FunderUrls extends GenericUrls{

View File

@ -3,8 +3,8 @@ package eu.eudat.logic.proxy.config.entities;
import eu.eudat.logic.proxy.config.FetchStrategy; import eu.eudat.logic.proxy.config.FetchStrategy;
import eu.eudat.logic.proxy.config.UrlConfiguration; import eu.eudat.logic.proxy.config.UrlConfiguration;
import javax.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper; import jakarta.xml.bind.annotation.XmlElementWrapper;
import java.util.List; import java.util.List;

View File

@ -3,8 +3,8 @@ package eu.eudat.logic.proxy.config.entities;
import eu.eudat.logic.proxy.config.FetchStrategy; import eu.eudat.logic.proxy.config.FetchStrategy;
import eu.eudat.logic.proxy.config.UrlConfiguration; import eu.eudat.logic.proxy.config.UrlConfiguration;
import javax.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper; import jakarta.xml.bind.annotation.XmlElementWrapper;
import java.util.List; import java.util.List;

View File

@ -3,8 +3,8 @@ package eu.eudat.logic.proxy.config.entities;
import eu.eudat.logic.proxy.config.FetchStrategy; import eu.eudat.logic.proxy.config.FetchStrategy;
import eu.eudat.logic.proxy.config.UrlConfiguration; import eu.eudat.logic.proxy.config.UrlConfiguration;
import javax.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper; import jakarta.xml.bind.annotation.XmlElementWrapper;
import java.util.List; import java.util.List;
public class OrganisationUrls extends GenericUrls{ public class OrganisationUrls extends GenericUrls{

View File

@ -1,7 +1,7 @@
package eu.eudat.logic.proxy.config.entities; package eu.eudat.logic.proxy.config.entities;
import javax.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement; import jakarta.xml.bind.annotation.XmlRootElement;
@XmlRootElement(name = "config") @XmlRootElement(name = "config")
public class PrefillingConfig { public class PrefillingConfig {

View File

@ -1,7 +1,7 @@
package eu.eudat.logic.proxy.config.entities; package eu.eudat.logic.proxy.config.entities;
import javax.xml.bind.annotation.XmlAttribute; import jakarta.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement; import jakarta.xml.bind.annotation.XmlRootElement;
@XmlRootElement(name = "fixedMapping") @XmlRootElement(name = "fixedMapping")
public class PrefillingFixedMapping implements PrefillingMapping{ public class PrefillingFixedMapping implements PrefillingMapping{

View File

@ -1,7 +1,7 @@
package eu.eudat.logic.proxy.config.entities; package eu.eudat.logic.proxy.config.entities;
import javax.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper; import jakarta.xml.bind.annotation.XmlElementWrapper;
import java.util.List; import java.util.List;
public class PrefillingGet{ public class PrefillingGet{
@ -23,7 +23,7 @@ public class PrefillingGet{
} }
@XmlElement(name = "mapping") @XmlElement(name = "mapping")
@XmlElementWrapper @XmlElementWrapper(name = "mappings")
public void setMappings(List<DefaultPrefillingMapping> mappings) { public void setMappings(List<DefaultPrefillingMapping> mappings) {
this.mappings = mappings; this.mappings = mappings;
} }
@ -33,7 +33,7 @@ public class PrefillingGet{
} }
@XmlElement(name = "fixedMapping") @XmlElement(name = "fixedMapping")
@XmlElementWrapper @XmlElementWrapper (name = "fixedMappings")
public void setFixedMappings(List<PrefillingFixedMapping> fixedMappings) { public void setFixedMappings(List<PrefillingFixedMapping> fixedMappings) {
this.fixedMappings = fixedMappings; this.fixedMappings = fixedMappings;
} }

View File

@ -1,7 +1,5 @@
package eu.eudat.logic.proxy.config.entities; package eu.eudat.logic.proxy.config.entities;
import javax.xml.bind.annotation.XmlAttribute;
public interface PrefillingMapping { public interface PrefillingMapping {
String getTarget(); String getTarget();

View File

@ -3,7 +3,7 @@ package eu.eudat.logic.proxy.config.entities;
import eu.eudat.logic.proxy.config.FetchStrategy; import eu.eudat.logic.proxy.config.FetchStrategy;
import eu.eudat.logic.proxy.config.UrlConfiguration; import eu.eudat.logic.proxy.config.UrlConfiguration;
import javax.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlElement;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;

View File

@ -3,8 +3,8 @@ package eu.eudat.logic.proxy.config.entities;
import eu.eudat.logic.proxy.config.FetchStrategy; import eu.eudat.logic.proxy.config.FetchStrategy;
import eu.eudat.logic.proxy.config.UrlConfiguration; import eu.eudat.logic.proxy.config.UrlConfiguration;
import javax.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper; import jakarta.xml.bind.annotation.XmlElementWrapper;
import java.util.List; import java.util.List;
public class ProjectUrls extends GenericUrls{ public class ProjectUrls extends GenericUrls{

View File

@ -3,8 +3,8 @@ package eu.eudat.logic.proxy.config.entities;
import eu.eudat.logic.proxy.config.FetchStrategy; import eu.eudat.logic.proxy.config.FetchStrategy;
import eu.eudat.logic.proxy.config.UrlConfiguration; import eu.eudat.logic.proxy.config.UrlConfiguration;
import javax.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper; import jakarta.xml.bind.annotation.XmlElementWrapper;
import java.util.List; import java.util.List;
public class RegistryUrls extends GenericUrls{ public class RegistryUrls extends GenericUrls{

View File

@ -3,8 +3,8 @@ package eu.eudat.logic.proxy.config.entities;
import eu.eudat.logic.proxy.config.FetchStrategy; import eu.eudat.logic.proxy.config.FetchStrategy;
import eu.eudat.logic.proxy.config.UrlConfiguration; import eu.eudat.logic.proxy.config.UrlConfiguration;
import javax.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper; import jakarta.xml.bind.annotation.XmlElementWrapper;
import java.util.List; import java.util.List;
public class RepositoryUrls extends GenericUrls{ public class RepositoryUrls extends GenericUrls{

View File

@ -3,8 +3,8 @@ package eu.eudat.logic.proxy.config.entities;
import eu.eudat.logic.proxy.config.FetchStrategy; import eu.eudat.logic.proxy.config.FetchStrategy;
import eu.eudat.logic.proxy.config.UrlConfiguration; import eu.eudat.logic.proxy.config.UrlConfiguration;
import javax.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper; import jakarta.xml.bind.annotation.XmlElementWrapper;
import java.util.List; import java.util.List;
public class ResearcherUrls extends GenericUrls{ public class ResearcherUrls extends GenericUrls{

View File

@ -3,8 +3,8 @@ package eu.eudat.logic.proxy.config.entities;
import eu.eudat.logic.proxy.config.FetchStrategy; import eu.eudat.logic.proxy.config.FetchStrategy;
import eu.eudat.logic.proxy.config.UrlConfiguration; import eu.eudat.logic.proxy.config.UrlConfiguration;
import javax.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper; import jakarta.xml.bind.annotation.XmlElementWrapper;
import java.util.List; import java.util.List;
public class ServiceUrls extends GenericUrls{ public class ServiceUrls extends GenericUrls{

View File

@ -3,8 +3,8 @@ package eu.eudat.logic.proxy.config.entities;
import eu.eudat.logic.proxy.config.FetchStrategy; import eu.eudat.logic.proxy.config.FetchStrategy;
import eu.eudat.logic.proxy.config.UrlConfiguration; import eu.eudat.logic.proxy.config.UrlConfiguration;
import javax.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper; import jakarta.xml.bind.annotation.XmlElementWrapper;
import java.util.List; import java.util.List;
/** /**

View File

@ -2,8 +2,8 @@ package eu.eudat.logic.proxy.config.entities;
import java.util.List; import java.util.List;
import javax.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper; import jakarta.xml.bind.annotation.XmlElementWrapper;
import eu.eudat.logic.proxy.config.FetchStrategy; import eu.eudat.logic.proxy.config.FetchStrategy;
import eu.eudat.logic.proxy.config.UrlConfiguration; import eu.eudat.logic.proxy.config.UrlConfiguration;

View File

@ -3,9 +3,9 @@ package eu.eudat.logic.proxy.config.prefilling;
import eu.eudat.logic.proxy.config.entities.PrefillingConfig; import eu.eudat.logic.proxy.config.entities.PrefillingConfig;
import org.w3c.dom.Element; import org.w3c.dom.Element;
import javax.xml.bind.JAXBContext; import jakarta.xml.bind.JAXBContext;
import javax.xml.bind.Unmarshaller; import jakarta.xml.bind.Unmarshaller;
import javax.xml.bind.annotation.adapters.XmlAdapter; import jakarta.xml.bind.annotation.adapters.XmlAdapter;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
@ -23,7 +23,6 @@ public class PrefillingConfigMapAdapter extends XmlAdapter<Object, Map<String, P
String id = element.getChildNodes().item(i).getAttributes().getNamedItem("id").getNodeValue(); String id = element.getChildNodes().item(i).getAttributes().getNamedItem("id").getNodeValue();
PrefillingConfig prefillingConfig = (PrefillingConfig) jaxbUnmarshaller.unmarshal(element.getChildNodes().item(i)); PrefillingConfig prefillingConfig = (PrefillingConfig) jaxbUnmarshaller.unmarshal(element.getChildNodes().item(i));
prefillingConfig = configMap.put(id, prefillingConfig); prefillingConfig = configMap.put(id, prefillingConfig);
System.out.println(prefillingConfig);
} }
return configMap; return configMap;
} }

View File

@ -3,17 +3,25 @@ package eu.eudat.logic.proxy.fetching;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import eu.eudat.logic.proxy.fetching.entities.Config; import eu.eudat.logic.proxy.fetching.entities.Config;
import eu.eudat.logic.proxy.fetching.entities.ConfigSingle; import eu.eudat.logic.proxy.fetching.entities.ConfigSingle;
import eu.eudat.logic.services.ApiContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable; import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import javax.xml.bind.JAXBContext; import jakarta.xml.bind.JAXBContext;
import javax.xml.bind.Unmarshaller; import jakarta.xml.bind.Unmarshaller;
import java.io.InputStream; import java.io.InputStream;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.util.*; import java.util.*;
@Component @Component
public class LocalFetcher { public class LocalFetcher {
private final ApiContext apiContext;
@Autowired
public LocalFetcher(ApiContext apiContext) {
this.apiContext = apiContext;
}
@Cacheable("currencies") @Cacheable("currencies")
public List<Map<String, String>> retrieveCurrency() throws Exception { public List<Map<String, String>> retrieveCurrency() throws Exception {
@ -45,7 +53,6 @@ public class LocalFetcher {
String camelCaseGetter =configSingle.getParseField() != null && !configSingle.getParseField().isEmpty() ? "get" + configSingle.getParseField().substring(0, 1).toUpperCase() + configSingle.getParseField().substring(1) : ""; String camelCaseGetter =configSingle.getParseField() != null && !configSingle.getParseField().isEmpty() ? "get" + configSingle.getParseField().substring(0, 1).toUpperCase() + configSingle.getParseField().substring(1) : "";
reader = aClass.getMethod(camelCaseGetter); reader = aClass.getMethod(camelCaseGetter);
} }
ObjectMapper objectMapper = new ObjectMapper();
List<Map<String, String>> values = new ArrayList<>(); List<Map<String, String>> values = new ArrayList<>();
int max = 1; int max = 1;
if (reader != null) { if (reader != null) {
@ -66,7 +73,7 @@ public class LocalFetcher {
} else { } else {
value = object; value = object;
} }
Map<String, String> map = objectMapper.convertValue(value, Map.class); Map<String, String> map = apiContext.getObjectMapper().convertValue(value, Map.class);
result.add(new HashMap<>()); result.add(new HashMap<>());
result.get(result.size() - 1).put("name", map.get(configSingle.getName())); result.get(result.size() - 1).put("name", map.get(configSingle.getName()));
result.get(result.size() - 1).put("value", map.get(configSingle.getValue())); result.get(result.size() - 1).put("value", map.get(configSingle.getValue()));

View File

@ -14,6 +14,7 @@ import eu.eudat.logic.proxy.config.entities.GenericUrls;
import eu.eudat.logic.proxy.config.exceptions.HugeResultSet; import eu.eudat.logic.proxy.config.exceptions.HugeResultSet;
import eu.eudat.logic.proxy.config.exceptions.NoURLFound; import eu.eudat.logic.proxy.config.exceptions.NoURLFound;
import eu.eudat.logic.proxy.fetching.entities.Results; import eu.eudat.logic.proxy.fetching.entities.Results;
import eu.eudat.logic.services.ApiContext;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -22,8 +23,8 @@ import org.springframework.http.*;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
import javax.xml.bind.JAXBContext; import jakarta.xml.bind.JAXBContext;
import javax.xml.bind.Unmarshaller; import jakarta.xml.bind.Unmarshaller;
import java.io.File; import java.io.File;
import java.io.StringReader; import java.io.StringReader;
import java.lang.reflect.Method; import java.lang.reflect.Method;
@ -34,8 +35,9 @@ import java.util.stream.Collectors;
@Service @Service
public class RemoteFetcher { public class RemoteFetcher {
private static final Logger logger = LoggerFactory.getLogger(RemoteFetcher.class); private static final Logger logger = LoggerFactory.getLogger(RemoteFetcher.class);
private final static ObjectMapper mapper = new ObjectMapper();
private ConfigLoader configLoader; private final ConfigLoader configLoader;
@Autowired @Autowired
public RemoteFetcher(ConfigLoader configLoader) { public RemoteFetcher(ConfigLoader configLoader) {
@ -294,7 +296,7 @@ public class RemoteFetcher {
headers.setAccept(Collections.singletonList(MediaType.valueOf(contentType))); headers.setAccept(Collections.singletonList(MediaType.valueOf(contentType)));
headers.setContentType(MediaType.valueOf(contentType)); headers.setContentType(MediaType.valueOf(contentType));
} }
JsonNode jsonBody = new ObjectMapper().readTree(requestBody); JsonNode jsonBody = mapper.readTree(requestBody);
entity = new HttpEntity<>(jsonBody, headers); entity = new HttpEntity<>(jsonBody, headers);
response = restTemplate.exchange(urlString, HttpMethod.resolve(requestType), entity, String.class); response = restTemplate.exchange(urlString, HttpMethod.resolve(requestType), entity, String.class);
@ -325,7 +327,6 @@ public class RemoteFetcher {
String camelCaseGetter = jsonDataPath.getParseField() != null && !jsonDataPath.getParseField().isEmpty() ? "get" + jsonDataPath.getParseField().substring(0, 1).toUpperCase() + jsonDataPath.getParseField().substring(1) : ""; String camelCaseGetter = jsonDataPath.getParseField() != null && !jsonDataPath.getParseField().isEmpty() ? "get" + jsonDataPath.getParseField().substring(0, 1).toUpperCase() + jsonDataPath.getParseField().substring(1) : "";
reader = aClass.getMethod(camelCaseGetter); reader = aClass.getMethod(camelCaseGetter);
} }
ObjectMapper objectMapper = new ObjectMapper();
List<Map<String, String>> values = new ArrayList<>(); List<Map<String, String>> values = new ArrayList<>();
int max = 1; int max = 1;
if (reader != null) { if (reader != null) {
@ -346,7 +347,7 @@ public class RemoteFetcher {
} else { } else {
value = data; value = data;
} }
Map<String, String> map = objectMapper.convertValue(value, Map.class); Map<String, String> map = mapper.convertValue(value, Map.class);
if (jsonDataPath.getMergedFields() != null && !jsonDataPath.getMergedFields().isEmpty() && jsonDataPath.getMergedFieldName() != null && !jsonDataPath.getMergedFieldName().isEmpty()) { if (jsonDataPath.getMergedFields() != null && !jsonDataPath.getMergedFields().isEmpty() && jsonDataPath.getMergedFieldName() != null && !jsonDataPath.getMergedFieldName().isEmpty()) {
Map<String, String> finalMap = new HashMap<>(); Map<String, String> finalMap = new HashMap<>();
for (Map.Entry<String, String> entry : map.entrySet()) { for (Map.Entry<String, String> entry : map.entrySet()) {
@ -385,7 +386,6 @@ public class RemoteFetcher {
List<Map<String, String>> internalResults; List<Map<String, String>> internalResults;
try { try {
String filePath = Paths.get(path).toUri().toURL().toString(); String filePath = Paths.get(path).toUri().toURL().toString();
ObjectMapper mapper = new ObjectMapper();
internalResults = mapper.readValue(new File(filePath), new TypeReference<List<Map<String, String>>>(){}); internalResults = mapper.readValue(new File(filePath), new TypeReference<List<Map<String, String>>>(){});
return searchListMap(internalResults, query); return searchListMap(internalResults, query);
} catch (Exception e) { } catch (Exception e) {

View File

@ -1,8 +1,8 @@
package eu.eudat.logic.proxy.fetching.entities; package eu.eudat.logic.proxy.fetching.entities;
import javax.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper; import jakarta.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement; import jakarta.xml.bind.annotation.XmlRootElement;
import java.util.List; import java.util.List;
@XmlRootElement(name = "fetchConfig") @XmlRootElement(name = "fetchConfig")

View File

@ -1,7 +1,7 @@
package eu.eudat.logic.proxy.fetching.entities; package eu.eudat.logic.proxy.fetching.entities;
import javax.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement; import jakarta.xml.bind.annotation.XmlRootElement;
@XmlRootElement(name = "config") @XmlRootElement(name = "config")
public class ConfigSingle { public class ConfigSingle {

View File

@ -1,8 +1,8 @@
package eu.eudat.logic.proxy.fetching.entities; package eu.eudat.logic.proxy.fetching.entities;
import javax.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper; import jakarta.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement; import jakarta.xml.bind.annotation.XmlRootElement;
import java.util.List; import java.util.List;
@XmlRootElement(name = "ISO_4217") @XmlRootElement(name = "ISO_4217")

View File

@ -1,7 +1,7 @@
package eu.eudat.logic.proxy.fetching.entities; package eu.eudat.logic.proxy.fetching.entities;
import javax.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement; import jakarta.xml.bind.annotation.XmlRootElement;
@XmlRootElement(name = "CcyNtry") @XmlRootElement(name = "CcyNtry")
public class CurrencySingleModel { public class CurrencySingleModel {

View File

@ -1,7 +1,7 @@
package eu.eudat.logic.security.customproviders.B2Access; package eu.eudat.logic.security.customproviders.B2Access;
import com.google.api.client.repackaged.org.apache.commons.codec.binary.Base64;
import eu.eudat.logic.security.validators.b2access.helpers.B2AccessResponseToken; import eu.eudat.logic.security.validators.b2access.helpers.B2AccessResponseToken;
import org.apache.commons.codec.binary.Base64;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment; import org.springframework.core.env.Environment;
import org.springframework.http.HttpEntity; import org.springframework.http.HttpEntity;

View File

@ -1,8 +1,11 @@
package eu.eudat.logic.security.customproviders.ConfigurableProvider.entities; package eu.eudat.logic.security.customproviders.ConfigurableProvider.entities;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@JsonIgnoreProperties(ignoreUnknown = true)
public class ConfigurableProviders { public class ConfigurableProviders {
private List<ConfigurableProvider> providers = new ArrayList<>(); private List<ConfigurableProvider> providers = new ArrayList<>();

View File

@ -5,7 +5,7 @@ import com.google.api.client.googleapis.auth.oauth2.GoogleIdToken.Payload;
import com.google.api.client.googleapis.auth.oauth2.GoogleIdTokenVerifier; import com.google.api.client.googleapis.auth.oauth2.GoogleIdTokenVerifier;
import com.google.api.client.http.HttpTransport; import com.google.api.client.http.HttpTransport;
import com.google.api.client.http.javanet.NetHttpTransport; import com.google.api.client.http.javanet.NetHttpTransport;
import com.google.api.client.json.jackson2.JacksonFactory; import com.google.api.client.json.gson.GsonFactory;
import eu.eudat.logic.security.validators.TokenValidator; import eu.eudat.logic.security.validators.TokenValidator;
import eu.eudat.logic.security.validators.TokenValidatorFactoryImpl; import eu.eudat.logic.security.validators.TokenValidatorFactoryImpl;
import eu.eudat.logic.services.operations.authentication.AuthenticationService; import eu.eudat.logic.services.operations.authentication.AuthenticationService;
@ -29,7 +29,7 @@ public class GoogleTokenValidator implements TokenValidator {
@Autowired @Autowired
public GoogleTokenValidator(Environment environment, AuthenticationService nonVerifiedUserAuthenticationService) { public GoogleTokenValidator(Environment environment, AuthenticationService nonVerifiedUserAuthenticationService) {
this.nonVerifiedUserAuthenticationService = nonVerifiedUserAuthenticationService; this.nonVerifiedUserAuthenticationService = nonVerifiedUserAuthenticationService;
verifier = new GoogleIdTokenVerifier.Builder(transport, JacksonFactory.getDefaultInstance()) verifier = new GoogleIdTokenVerifier.Builder(transport, new GsonFactory())
.setAudience(Collections.singletonList(environment.getProperty("google.login.clientId"))) .setAudience(Collections.singletonList(environment.getProperty("google.login.clientId")))
.build(); .build();
} }

View File

@ -1,5 +1,6 @@
package eu.eudat.logic.services; package eu.eudat.logic.services;
import com.fasterxml.jackson.databind.ObjectMapper;
import eu.eudat.logic.services.helpers.HelpersService; import eu.eudat.logic.services.helpers.HelpersService;
import eu.eudat.logic.services.operations.OperationsContext; import eu.eudat.logic.services.operations.OperationsContext;
import eu.eudat.logic.services.utilities.UtilitiesService; import eu.eudat.logic.services.utilities.UtilitiesService;
@ -11,4 +12,6 @@ public interface ApiContext {
OperationsContext getOperationsContext(); OperationsContext getOperationsContext();
UtilitiesService getUtilitiesService(); UtilitiesService getUtilitiesService();
ObjectMapper getObjectMapper();
} }

View File

@ -1,5 +1,6 @@
package eu.eudat.logic.services; package eu.eudat.logic.services;
import com.fasterxml.jackson.databind.ObjectMapper;
import eu.eudat.logic.services.helpers.HelpersService; import eu.eudat.logic.services.helpers.HelpersService;
import eu.eudat.logic.services.operations.OperationsContext; import eu.eudat.logic.services.operations.OperationsContext;
import eu.eudat.logic.services.utilities.UtilitiesService; import eu.eudat.logic.services.utilities.UtilitiesService;
@ -9,6 +10,7 @@ import org.springframework.stereotype.Service;
@Service("apiContext") @Service("apiContext")
public class ApiContextImpl implements ApiContext { public class ApiContextImpl implements ApiContext {
private static final ObjectMapper mapper = new ObjectMapper();
private OperationsContext operationsContext; private OperationsContext operationsContext;
private HelpersService helpersService; private HelpersService helpersService;
@ -35,4 +37,9 @@ public class ApiContextImpl implements ApiContext {
public UtilitiesService getUtilitiesService() { public UtilitiesService getUtilitiesService() {
return utilitiesService; return utilitiesService;
} }
@Override
public ObjectMapper getObjectMapper() {
return mapper;
}
} }

View File

@ -1,5 +1,6 @@
package eu.eudat.logic.services.operations.authentication; package eu.eudat.logic.services.operations.authentication;
import com.fasterxml.jackson.core.JsonProcessingException;
import eu.eudat.data.entities.Credential; import eu.eudat.data.entities.Credential;
import eu.eudat.data.entities.UserInfo; import eu.eudat.data.entities.UserInfo;
import eu.eudat.data.entities.UserRole; import eu.eudat.data.entities.UserRole;
@ -14,7 +15,6 @@ import eu.eudat.models.data.login.Credentials;
import eu.eudat.models.data.loginprovider.LoginProviderUser; import eu.eudat.models.data.loginprovider.LoginProviderUser;
import eu.eudat.models.data.security.Principal; import eu.eudat.models.data.security.Principal;
import eu.eudat.types.Authorities; import eu.eudat.types.Authorities;
import org.json.JSONObject;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.core.env.Environment; import org.springframework.core.env.Environment;
@ -164,8 +164,10 @@ public abstract class AbstractAuthenticationService implements AuthenticationSer
apiContext.getOperationsContext().getDatabaseRepository().getUserRoleDao().createOrUpdate(role); apiContext.getOperationsContext().getDatabaseRepository().getUserRoleDao().createOrUpdate(role);
} else { } else {
Map<String, Object> additionalInfo = userInfo.getAdditionalinfo() != null ? Map<String, Object> additionalInfo = null;
new JSONObject(userInfo.getAdditionalinfo()).toMap() : new HashMap<>(); try {
additionalInfo = userInfo.getAdditionalinfo() != null ?
apiContext.getObjectMapper().readValue(userInfo.getAdditionalinfo(), HashMap.class) : new HashMap<>();
if (profile.getAvatarUrl() != null && !profile.getAvatarUrl().isEmpty() && !profile.getAvatarUrl().equals("null")) { if (profile.getAvatarUrl() != null && !profile.getAvatarUrl().isEmpty() && !profile.getAvatarUrl().equals("null")) {
additionalInfo.put("avatarUrl", profile.getAvatarUrl()); additionalInfo.put("avatarUrl", profile.getAvatarUrl());
} }
@ -182,7 +184,11 @@ public abstract class AbstractAuthenticationService implements AuthenticationSer
additionalInfo.put("zenodoEmail", profile.getEmail()); additionalInfo.put("zenodoEmail", profile.getEmail());
} }
userInfo.setLastloggedin(new Date()); userInfo.setLastloggedin(new Date());
userInfo.setAdditionalinfo(new JSONObject(additionalInfo).toString()); userInfo.setAdditionalinfo(apiContext.getObjectMapper().writeValueAsString(additionalInfo));
} catch (JsonProcessingException e) {
logger.error(e.getLocalizedMessage(), e);
}
Set<Credential> credentials = userInfo.getCredentials(); Set<Credential> credentials = userInfo.getCredentials();
if (credentials.contains(credential)) { if (credentials.contains(credential)) {
Credential oldCredential = credentials.stream().filter(item -> credential.getProvider().equals(item.getProvider())).findFirst().get(); Credential oldCredential = credentials.stream().filter(item -> credential.getProvider().equals(item.getProvider())).findFirst().get();

View File

@ -30,49 +30,49 @@ public class NonVerifiedUserEmailAuthenticationService extends AbstractAuthentic
if (user == null) return null; if (user == null) return null;
String avatarUrl; String avatarUrl;
try { try {
avatarUrl = user.getAdditionalinfo() != null ? new ObjectMapper().readTree(user.getAdditionalinfo()).get("avatarUrl").asText() : ""; avatarUrl = user.getAdditionalinfo() != null ? apiContext.getObjectMapper().readTree(user.getAdditionalinfo()).get("avatarUrl").asText() : "";
} catch (Exception e) { } catch (Exception e) {
avatarUrl = ""; avatarUrl = "";
} }
String zenodoToken; String zenodoToken;
try { try {
zenodoToken = user.getAdditionalinfo() != null ? new ObjectMapper().readTree(user.getAdditionalinfo()).get("zenodoToken").asText() : ""; zenodoToken = user.getAdditionalinfo() != null ? apiContext.getObjectMapper().readTree(user.getAdditionalinfo()).get("zenodoToken").asText() : "";
} catch (Exception e) { } catch (Exception e) {
zenodoToken = ""; zenodoToken = "";
} }
Instant zenodoDuration; Instant zenodoDuration;
try { try {
zenodoDuration = user.getAdditionalinfo() != null ? Instant.ofEpochMilli(new ObjectMapper().readTree(user.getAdditionalinfo()).get("expirationDate").asLong()) : Instant.now(); zenodoDuration = user.getAdditionalinfo() != null ? Instant.ofEpochMilli(apiContext.getObjectMapper().readTree(user.getAdditionalinfo()).get("expirationDate").asLong()) : Instant.now();
} catch (Exception e) { } catch (Exception e) {
zenodoDuration = Instant.now(); zenodoDuration = Instant.now();
} }
String zenodoEmail; String zenodoEmail;
try { try {
zenodoEmail = user.getAdditionalinfo() != null ? new ObjectMapper().readTree(user.getAdditionalinfo()).get("zenodoEmail").asText() : ""; zenodoEmail = user.getAdditionalinfo() != null ? apiContext.getObjectMapper().readTree(user.getAdditionalinfo()).get("zenodoEmail").asText() : "";
} catch (Exception e) { } catch (Exception e) {
zenodoEmail = ""; zenodoEmail = "";
} }
String zenodoRefresh; String zenodoRefresh;
try { try {
zenodoRefresh = user.getAdditionalinfo() != null ? new ObjectMapper().readTree(user.getAdditionalinfo()).get("zenodoRefresh").asText() : ""; zenodoRefresh = user.getAdditionalinfo() != null ? apiContext.getObjectMapper().readTree(user.getAdditionalinfo()).get("zenodoRefresh").asText() : "";
} catch (Exception e) { } catch (Exception e) {
zenodoRefresh = ""; zenodoRefresh = "";
} }
String culture; String culture;
try { try {
culture = user.getAdditionalinfo() != null ? new ObjectMapper().readTree(user.getAdditionalinfo()).get("culture").get("name").asText() : ""; culture = user.getAdditionalinfo() != null ? apiContext.getObjectMapper().readTree(user.getAdditionalinfo()).get("culture").get("name").asText() : "";
} catch (Exception e) { } catch (Exception e) {
culture = ""; culture = "";
} }
String language; String language;
try { try {
language = user.getAdditionalinfo() != null ? new ObjectMapper().readTree(user.getAdditionalinfo()).get("language").get("value").asText() : ""; language = user.getAdditionalinfo() != null ? apiContext.getObjectMapper().readTree(user.getAdditionalinfo()).get("language").get("value").asText() : "";
} catch (Exception e) { } catch (Exception e) {
language = ""; language = "";
} }
String timezone; String timezone;
try { try {
timezone = user.getAdditionalinfo() != null ? new ObjectMapper().readTree(user.getAdditionalinfo()).get("timezone").asText() : ""; timezone = user.getAdditionalinfo() != null ? apiContext.getObjectMapper().readTree(user.getAdditionalinfo()).get("timezone").asText() : "";
} catch (Exception e) { } catch (Exception e) {
timezone = ""; timezone = "";
} }

View File

@ -1,27 +1,21 @@
package eu.eudat.logic.services.operations.authentication; package eu.eudat.logic.services.operations.authentication;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import eu.eudat.data.entities.Credential;
import eu.eudat.data.entities.UserInfo; import eu.eudat.data.entities.UserInfo;
import eu.eudat.data.entities.UserRole; import eu.eudat.data.entities.UserRole;
import eu.eudat.data.entities.UserToken; import eu.eudat.data.entities.UserToken;
import eu.eudat.exceptions.security.NullEmailException; import eu.eudat.exceptions.security.NullEmailException;
import eu.eudat.logic.builders.entity.CredentialBuilder;
import eu.eudat.logic.builders.entity.UserInfoBuilder;
import eu.eudat.logic.builders.entity.UserTokenBuilder;
import eu.eudat.logic.builders.model.models.PrincipalBuilder; import eu.eudat.logic.builders.model.models.PrincipalBuilder;
import eu.eudat.logic.security.validators.TokenValidatorFactoryImpl;
import eu.eudat.logic.services.ApiContext; import eu.eudat.logic.services.ApiContext;
import eu.eudat.models.data.login.Credentials;
import eu.eudat.models.data.loginprovider.LoginProviderUser;
import eu.eudat.models.data.security.Principal; import eu.eudat.models.data.security.Principal;
import eu.eudat.types.Authorities; import eu.eudat.types.Authorities;
import org.json.JSONObject;
import org.springframework.core.env.Environment; import org.springframework.core.env.Environment;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.time.Instant; import java.time.Instant;
import java.util.*; import java.util.Date;
import java.util.HashSet;
import java.util.List;
@Service("verifiedUserAuthenticationService") @Service("verifiedUserAuthenticationService")
@ -39,49 +33,49 @@ public class VerifiedUserAuthenticationService extends AbstractAuthenticationSer
if (user.getEmail() == null) throw new NullEmailException(); if (user.getEmail() == null) throw new NullEmailException();
String avatarUrl; String avatarUrl;
try { try {
avatarUrl = user.getAdditionalinfo() != null ? new ObjectMapper().readTree(user.getAdditionalinfo()).get("avatarUrl").asText() : ""; avatarUrl = user.getAdditionalinfo() != null ? apiContext.getObjectMapper().readTree(user.getAdditionalinfo()).get("avatarUrl").asText() : "";
} catch (Exception e) { } catch (Exception e) {
avatarUrl = ""; avatarUrl = "";
} }
String zenodoToken; String zenodoToken;
try { try {
zenodoToken = user.getAdditionalinfo() != null ? new ObjectMapper().readTree(user.getAdditionalinfo()).get("zenodoToken").asText() : ""; zenodoToken = user.getAdditionalinfo() != null ? apiContext.getObjectMapper().readTree(user.getAdditionalinfo()).get("zenodoToken").asText() : "";
} catch (Exception e) { } catch (Exception e) {
zenodoToken = ""; zenodoToken = "";
} }
Instant zenodoDuration; Instant zenodoDuration;
try { try {
zenodoDuration = user.getAdditionalinfo() != null ? Instant.ofEpochMilli(new ObjectMapper().readTree(user.getAdditionalinfo()).get("expirationDate").asLong()) : Instant.now(); zenodoDuration = user.getAdditionalinfo() != null ? Instant.ofEpochMilli(apiContext.getObjectMapper().readTree(user.getAdditionalinfo()).get("expirationDate").asLong()) : Instant.now();
} catch (Exception e) { } catch (Exception e) {
zenodoDuration = Instant.now(); zenodoDuration = Instant.now();
} }
String zenodoEmail; String zenodoEmail;
try { try {
zenodoEmail = user.getAdditionalinfo() != null ? new ObjectMapper().readTree(user.getAdditionalinfo()).get("zenodoEmail").asText() : ""; zenodoEmail = user.getAdditionalinfo() != null ? apiContext.getObjectMapper().readTree(user.getAdditionalinfo()).get("zenodoEmail").asText() : "";
} catch (Exception e) { } catch (Exception e) {
zenodoEmail = ""; zenodoEmail = "";
} }
String zenodoRefresh; String zenodoRefresh;
try { try {
zenodoRefresh = user.getAdditionalinfo() != null ? new ObjectMapper().readTree(user.getAdditionalinfo()).get("zenodoRefresh").asText() : ""; zenodoRefresh = user.getAdditionalinfo() != null ? apiContext.getObjectMapper().readTree(user.getAdditionalinfo()).get("zenodoRefresh").asText() : "";
} catch (Exception e) { } catch (Exception e) {
zenodoRefresh = ""; zenodoRefresh = "";
} }
String culture; String culture;
try { try {
culture = user.getAdditionalinfo() != null ? new ObjectMapper().readTree(user.getAdditionalinfo()).get("culture").get("name").asText() : ""; culture = user.getAdditionalinfo() != null ? apiContext.getObjectMapper().readTree(user.getAdditionalinfo()).get("culture").get("name").asText() : "";
} catch (Exception e) { } catch (Exception e) {
culture = ""; culture = "";
} }
String language; String language;
try { try {
language = user.getAdditionalinfo() != null ? new ObjectMapper().readTree(user.getAdditionalinfo()).get("language").get("value").asText() : ""; language = user.getAdditionalinfo() != null ? apiContext.getObjectMapper().readTree(user.getAdditionalinfo()).get("language").get("value").asText() : "";
} catch (Exception e) { } catch (Exception e) {
language = ""; language = "";
} }
String timezone; String timezone;
try { try {
timezone = user.getAdditionalinfo() != null ? new ObjectMapper().readTree(user.getAdditionalinfo()).get("timezone").asText() : ""; timezone = user.getAdditionalinfo() != null ? apiContext.getObjectMapper().readTree(user.getAdditionalinfo()).get("timezone").asText() : "";
} catch (Exception e) { } catch (Exception e) {
timezone = ""; timezone = "";
} }

View File

@ -8,6 +8,7 @@ import eu.eudat.models.data.mail.SimpleMail;
import eu.eudat.models.data.security.Principal; import eu.eudat.models.data.security.Principal;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment; import org.springframework.core.env.Environment;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -20,11 +21,11 @@ import java.util.concurrent.CompletableFuture;
@Service("ConfirmationEmailService") @Service("ConfirmationEmailService")
public class ConfirmationEmailServiceImpl implements ConfirmationEmailService { public class ConfirmationEmailServiceImpl implements ConfirmationEmailService {
private static final Logger logger = LoggerFactory.getLogger(ConfirmationEmailServiceImpl.class); private static final Logger logger = LoggerFactory.getLogger(ConfirmationEmailServiceImpl.class);
//private Logger logger; private static final ObjectMapper mapper = new ObjectMapper();
private Environment environment; private final Environment environment;
public ConfirmationEmailServiceImpl(/*Logger logger,*/ Environment environment) { @Autowired
// this.logger = logger; public ConfirmationEmailServiceImpl(Environment environment) {
this.environment = environment; this.environment = environment;
} }
@ -118,7 +119,7 @@ public class ConfirmationEmailServiceImpl implements ConfirmationEmailService {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("userId", principal.getId()); map.put("userId", principal.getId());
map.put("provider", provider.toString()); map.put("provider", provider.toString());
confirmationEmail.setData(new ObjectMapper().writeValueAsString(map)); confirmationEmail.setData(mapper.writeValueAsString(map));
} catch (JsonProcessingException e) { } catch (JsonProcessingException e) {
logger.error(e.getMessage(), e); logger.error(e.getMessage(), e);
} }

View File

@ -15,8 +15,8 @@ import org.springframework.core.env.Environment;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.mail.MessagingException; import javax.mail.MessagingException;
import javax.xml.bind.JAXBContext; import jakarta.xml.bind.JAXBContext;
import javax.xml.bind.Marshaller; import jakarta.xml.bind.Marshaller;
import java.io.StringWriter; import java.io.StringWriter;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;

View File

@ -212,7 +212,6 @@ public class HtmlToWorldBuilder implements NodeVisitor {
f.setAscii("Symbol"); f.setAscii("Symbol");
f.setHAnsi("Symbol"); f.setHAnsi("Symbol");
f.setCs("Symbol"); f.setCs("Symbol");
f.setHint(STHint.DEFAULT);
} else { } else {
ctLvl.addNewLvlText().setVal("%1."); ctLvl.addNewLvlText().setVal("%1.");
} }

View File

@ -1,7 +1,6 @@
package eu.eudat.logic.utilities.documents.xml; package eu.eudat.logic.utilities.documents.xml;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.exc.MismatchedInputException;
import eu.eudat.logic.services.forms.VisibilityRuleService; import eu.eudat.logic.services.forms.VisibilityRuleService;
import eu.eudat.logic.utilities.builders.XmlBuilder; import eu.eudat.logic.utilities.builders.XmlBuilder;
import eu.eudat.models.data.components.commons.datafield.ExternalDatasetsData; import eu.eudat.models.data.components.commons.datafield.ExternalDatasetsData;
@ -10,8 +9,6 @@ import eu.eudat.models.data.user.components.datasetprofile.FieldSet;
import eu.eudat.models.data.user.components.datasetprofile.Section; import eu.eudat.models.data.user.components.datasetprofile.Section;
import eu.eudat.models.data.user.composite.DatasetProfilePage; import eu.eudat.models.data.user.composite.DatasetProfilePage;
import eu.eudat.models.data.user.composite.PagedDatasetProfile; import eu.eudat.models.data.user.composite.PagedDatasetProfile;
import org.json.JSONArray;
import org.json.JSONException;
import org.springframework.core.env.Environment; import org.springframework.core.env.Environment;
import org.w3c.dom.Document; import org.w3c.dom.Document;
import org.w3c.dom.Element; import org.w3c.dom.Element;

View File

@ -3,9 +3,9 @@ import eu.eudat.logic.utilities.documents.xml.datasetProfileXml.datasetProfileMo
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import javax.xml.bind.JAXBContext; import jakarta.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException; import jakarta.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller; import jakarta.xml.bind.Unmarshaller;
import java.io.*; import java.io.*;
public class ImportXmlBuilderDatasetProfile { public class ImportXmlBuilderDatasetProfile {

View File

@ -1,9 +1,9 @@
package eu.eudat.logic.utilities.documents.xml.datasetProfileXml.datasetProfileModel; package eu.eudat.logic.utilities.documents.xml.datasetProfileXml.datasetProfileModel;
import javax.xml.bind.annotation.XmlAttribute; import jakarta.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement; import jakarta.xml.bind.annotation.XmlRootElement;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;

View File

@ -2,9 +2,9 @@ package eu.eudat.logic.utilities.documents.xml.datasetProfileXml.datasetProfileM
import eu.eudat.logic.utilities.documents.xml.datasetProfileXml.datasetProfileModel.Fields.Fields; import eu.eudat.logic.utilities.documents.xml.datasetProfileXml.datasetProfileModel.Fields.Fields;
import javax.xml.bind.annotation.XmlAttribute; import jakarta.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement; import jakarta.xml.bind.annotation.XmlRootElement;
@XmlRootElement(name = "field-Set") @XmlRootElement(name = "field-Set")
public class FieldSet { public class FieldSet {

View File

@ -1,7 +1,7 @@
package eu.eudat.logic.utilities.documents.xml.datasetProfileXml.datasetProfileModel; package eu.eudat.logic.utilities.documents.xml.datasetProfileXml.datasetProfileModel;
import javax.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement; import jakarta.xml.bind.annotation.XmlRootElement;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;

View File

@ -1,7 +1,7 @@
package eu.eudat.logic.utilities.documents.xml.datasetProfileXml.datasetProfileModel.Fields; package eu.eudat.logic.utilities.documents.xml.datasetProfileXml.datasetProfileModel.Fields;
import javax.xml.bind.annotation.XmlAttribute; import jakarta.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement; import jakarta.xml.bind.annotation.XmlRootElement;
@XmlRootElement(name = "defaultValue") @XmlRootElement(name = "defaultValue")
public class DefaultValue { public class DefaultValue {

View File

@ -4,9 +4,9 @@ import eu.eudat.logic.utilities.builders.ModelBuilder;
import eu.eudat.models.data.components.commons.datafield.FieldData; import eu.eudat.models.data.components.commons.datafield.FieldData;
import org.w3c.dom.Element; import org.w3c.dom.Element;
import javax.xml.bind.annotation.XmlAttribute; import jakarta.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement; import jakarta.xml.bind.annotation.XmlRootElement;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;

View File

@ -1,7 +1,7 @@
package eu.eudat.logic.utilities.documents.xml.datasetProfileXml.datasetProfileModel.Fields; package eu.eudat.logic.utilities.documents.xml.datasetProfileXml.datasetProfileModel.Fields;
import javax.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement; import jakarta.xml.bind.annotation.XmlRootElement;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;

View File

@ -1,8 +1,8 @@
package eu.eudat.logic.utilities.documents.xml.datasetProfileXml.datasetProfileModel.Fields; package eu.eudat.logic.utilities.documents.xml.datasetProfileXml.datasetProfileModel.Fields;
import javax.xml.bind.annotation.XmlAttribute; import jakarta.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement; import jakarta.xml.bind.annotation.XmlRootElement;
@XmlRootElement(name = "rule") @XmlRootElement(name = "rule")
public class Rule{ public class Rule{

View File

@ -1,7 +1,7 @@
package eu.eudat.logic.utilities.documents.xml.datasetProfileXml.datasetProfileModel.Fields; package eu.eudat.logic.utilities.documents.xml.datasetProfileXml.datasetProfileModel.Fields;
import javax.xml.bind.annotation.XmlAttribute; import jakarta.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement; import jakarta.xml.bind.annotation.XmlRootElement;
@XmlRootElement(name = "validation") @XmlRootElement(name = "validation")
public class Validation { public class Validation {

View File

@ -1,8 +1,8 @@
package eu.eudat.logic.utilities.documents.xml.datasetProfileXml.datasetProfileModel.Fields; package eu.eudat.logic.utilities.documents.xml.datasetProfileXml.datasetProfileModel.Fields;
import javax.xml.bind.annotation.XmlAttribute; import jakarta.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement; import jakarta.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlValue; import jakarta.xml.bind.annotation.XmlValue;
@XmlRootElement(name = "value") @XmlRootElement(name = "value")
public class Value { public class Value {

View File

@ -1,8 +1,8 @@
package eu.eudat.logic.utilities.documents.xml.datasetProfileXml.datasetProfileModel.Fields; package eu.eudat.logic.utilities.documents.xml.datasetProfileXml.datasetProfileModel.Fields;
import javax.xml.bind.annotation.XmlAttribute; import jakarta.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement; import jakarta.xml.bind.annotation.XmlRootElement;
@XmlRootElement(name = "viewStyle") @XmlRootElement(name = "viewStyle")
public class ViewStyle { public class ViewStyle {

View File

@ -1,8 +1,8 @@
package eu.eudat.logic.utilities.documents.xml.datasetProfileXml.datasetProfileModel.Fields; package eu.eudat.logic.utilities.documents.xml.datasetProfileXml.datasetProfileModel.Fields;
import javax.xml.bind.annotation.XmlAttribute; import jakarta.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement; import jakarta.xml.bind.annotation.XmlRootElement;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;

View File

@ -1,7 +1,7 @@
package eu.eudat.logic.utilities.documents.xml.datasetProfileXml.datasetProfileModel.Fields; package eu.eudat.logic.utilities.documents.xml.datasetProfileXml.datasetProfileModel.Fields;
import javax.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement; import jakarta.xml.bind.annotation.XmlRootElement;
@XmlRootElement(name = "validations") @XmlRootElement(name = "validations")
public class validations { public class validations {

View File

@ -1,7 +1,7 @@
package eu.eudat.logic.utilities.documents.xml.datasetProfileXml.datasetProfileModel; package eu.eudat.logic.utilities.documents.xml.datasetProfileXml.datasetProfileModel;
import javax.xml.bind.annotation.XmlAttribute; import jakarta.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement; import jakarta.xml.bind.annotation.XmlRootElement;
@XmlRootElement(name = "multiplicity") @XmlRootElement(name = "multiplicity")

View File

@ -1,8 +1,8 @@
package eu.eudat.logic.utilities.documents.xml.datasetProfileXml.datasetProfileModel; package eu.eudat.logic.utilities.documents.xml.datasetProfileXml.datasetProfileModel;
import javax.xml.bind.annotation.XmlAttribute; import jakarta.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement; import jakarta.xml.bind.annotation.XmlRootElement;
import java.util.List; import java.util.List;
@XmlRootElement(name = "page") @XmlRootElement(name = "page")

View File

@ -1,8 +1,8 @@
package eu.eudat.logic.utilities.documents.xml.datasetProfileXml.datasetProfileModel; package eu.eudat.logic.utilities.documents.xml.datasetProfileXml.datasetProfileModel;
import javax.xml.bind.annotation.XmlAttribute; import jakarta.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement; import jakarta.xml.bind.annotation.XmlRootElement;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;

View File

@ -1,9 +1,9 @@
package eu.eudat.logic.utilities.documents.xml.datasetProfileXml.datasetProfileModel; package eu.eudat.logic.utilities.documents.xml.datasetProfileXml.datasetProfileModel;
import javax.xml.bind.annotation.XmlAttribute; import jakarta.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement; import jakarta.xml.bind.annotation.XmlRootElement;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;

View File

@ -4,9 +4,9 @@ import eu.eudat.logic.utilities.documents.xml.dmpXml.dmpProfileModel.DmpProfile;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import javax.xml.bind.JAXBContext; import jakarta.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException; import jakarta.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller; import jakarta.xml.bind.Unmarshaller;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;

View File

@ -1,7 +1,7 @@
package eu.eudat.logic.utilities.documents.xml.dmpXml.dmpProfileModel; package eu.eudat.logic.utilities.documents.xml.dmpXml.dmpProfileModel;
import javax.xml.bind.annotation.XmlAttribute; import jakarta.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement; import jakarta.xml.bind.annotation.XmlRootElement;
@XmlRootElement(name = "datatype") @XmlRootElement(name = "datatype")
public class DMPProfileFieldDataType { public class DMPProfileFieldDataType {

View File

@ -1,8 +1,8 @@
package eu.eudat.logic.utilities.documents.xml.dmpXml.dmpProfileModel; package eu.eudat.logic.utilities.documents.xml.dmpXml.dmpProfileModel;
import javax.xml.bind.annotation.XmlAttribute; import jakarta.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement; import jakarta.xml.bind.annotation.XmlRootElement;
@XmlRootElement(name = "type") @XmlRootElement(name = "type")
public class DMPProfileType { public class DMPProfileType {

Some files were not shown because too many files have changed in this diff Show More