no message
This commit is contained in:
commit
ca19d29ab7
|
@ -0,0 +1,5 @@
|
||||||
|
FROM openjdk:8-jdk-alpine
|
||||||
|
VOLUME /tmp
|
||||||
|
ARG JAR_FILE
|
||||||
|
ADD ${JAR_FILE} app.jar
|
||||||
|
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
|
|
@ -14,6 +14,7 @@
|
||||||
<properties>
|
<properties>
|
||||||
<project.http.version>1.19.0</project.http.version>
|
<project.http.version>1.19.0</project.http.version>
|
||||||
<project.oauth.version>1.19.0</project.oauth.version>
|
<project.oauth.version>1.19.0</project.oauth.version>
|
||||||
|
<project.version>0.2.0</project.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>4.3.8.RELEASE</org.springframework.version>
|
<org.springframework.version>4.3.8.RELEASE</org.springframework.version>
|
||||||
|
@ -34,10 +35,9 @@
|
||||||
<logback.version>1.1.1</logback.version>
|
<logback.version>1.1.1</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>
|
||||||
<!-- <jcloverslf4j.version>1.7.6</jcloverslf4j.version> -->
|
<docker.image.prefix>ikalyvas</docker.image.prefix>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -189,6 +189,7 @@
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
<finalName>${project.artifactId}-${project.version}</finalName>
|
||||||
<resources>
|
<resources>
|
||||||
<resource>
|
<resource>
|
||||||
<directory>src/main/ui-resources</directory>
|
<directory>src/main/ui-resources</directory>
|
||||||
|
@ -206,8 +207,22 @@
|
||||||
<target>1.8</target>
|
<target>1.8</target>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>com.spotify</groupId>
|
||||||
|
<artifactId>dockerfile-maven-plugin</artifactId>
|
||||||
|
<version>1.3.6</version>
|
||||||
|
<configuration>
|
||||||
|
<repository>${docker.image.prefix}/${project.artifactId}</repository>
|
||||||
|
<buildArgs>
|
||||||
|
<JAR_FILE>target/${project.build.finalName}.jar</JAR_FILE>
|
||||||
|
</buildArgs>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
<finalName>${project.artifactId}</finalName>
|
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
<profiles>
|
<profiles>
|
||||||
|
|
|
@ -1,16 +1,11 @@
|
||||||
package eu.eudat;
|
package eu.eudat;
|
||||||
|
|
||||||
import eu.eudat.handlers.PrincipalArgumentResolver;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||||
import org.springframework.boot.web.support.SpringBootServletInitializer;
|
import org.springframework.boot.web.support.SpringBootServletInitializer;
|
||||||
import org.springframework.scheduling.annotation.EnableAsync;
|
|
||||||
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
public class EuDatApplication extends SpringBootServletInitializer {
|
public class EuDatApplication extends SpringBootServletInitializer {
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
package eu.eudat.builders;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by ikalyvas on 2/15/2018.
|
||||||
|
*/
|
||||||
|
public abstract class Builder<T> {
|
||||||
|
public abstract T build();
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
package eu.eudat.builders;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by ikalyvas on 2/15/2018.
|
||||||
|
*/
|
||||||
|
public interface BuilderFactory {
|
||||||
|
<T extends Builder> T getBuilder(Class<T> tClass);
|
||||||
|
}
|
|
@ -0,0 +1,30 @@
|
||||||
|
package eu.eudat.builders;
|
||||||
|
|
||||||
|
import eu.eudat.builders.entity.*;
|
||||||
|
import eu.eudat.builders.model.criteria.DataRepositoryCriteriaBuilder;
|
||||||
|
import eu.eudat.builders.model.criteria.RegistryCriteriaBuilder;
|
||||||
|
import eu.eudat.builders.model.models.DataTableDataBuilder;
|
||||||
|
import eu.eudat.builders.model.models.PrincipalBuilder;
|
||||||
|
import eu.eudat.builders.model.models.ProjectBuilder;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by ikalyvas on 2/15/2018.
|
||||||
|
*/
|
||||||
|
@Service("builderFactory")
|
||||||
|
public class BuilderFactoryImpl implements BuilderFactory {
|
||||||
|
|
||||||
|
public <T extends Builder> T getBuilder(Class<T> tClass) {
|
||||||
|
if (tClass.equals(CredentialBuilder.class)) return (T) new CredentialBuilder();
|
||||||
|
if (tClass.equals(DataRepositoryCriteriaBuilder.class)) return (T) new DataRepositoryCriteriaBuilder();
|
||||||
|
if (tClass.equals(DatasetProfileBuilder.class)) return (T) new DatasetProfileBuilder();
|
||||||
|
if (tClass.equals(DataTableDataBuilder.class)) return (T) new DataTableDataBuilder<>();
|
||||||
|
if (tClass.equals(PrincipalBuilder.class)) return (T) new PrincipalBuilder();
|
||||||
|
if (tClass.equals(ProjectBuilder.class)) return (T) new ProjectBuilder();
|
||||||
|
if (tClass.equals(RegistryCriteriaBuilder.class)) return (T) new RegistryCriteriaBuilder();
|
||||||
|
if (tClass.equals(UserInfoBuilder.class)) return (T) new UserInfoBuilder();
|
||||||
|
if (tClass.equals(UserRoleBuilder.class)) return (T) new UserRoleBuilder();
|
||||||
|
if (tClass.equals(UserTokenBuilder.class)) return (T) new UserTokenBuilder();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,83 @@
|
||||||
|
package eu.eudat.builders.entity;
|
||||||
|
|
||||||
|
import eu.eudat.builders.Builder;
|
||||||
|
import eu.eudat.entities.Credential;
|
||||||
|
import eu.eudat.entities.UserInfo;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by ikalyvas on 2/15/2018.
|
||||||
|
*/
|
||||||
|
public class CredentialBuilder extends Builder<Credential> {
|
||||||
|
|
||||||
|
private UUID id;
|
||||||
|
|
||||||
|
private UserInfo userInfo;
|
||||||
|
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
private Integer provider;
|
||||||
|
|
||||||
|
private String publicValue;
|
||||||
|
|
||||||
|
private String secret;
|
||||||
|
|
||||||
|
private Date creationTime;
|
||||||
|
|
||||||
|
private Date lastUpdateTime;
|
||||||
|
|
||||||
|
public CredentialBuilder id(UUID id) {
|
||||||
|
this.id = id;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CredentialBuilder userInfo(UserInfo userInfo) {
|
||||||
|
this.userInfo = userInfo;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CredentialBuilder status(Integer status) {
|
||||||
|
this.status = status;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CredentialBuilder provider(Integer provider) {
|
||||||
|
this.provider = provider;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CredentialBuilder publicValue(String publicValue) {
|
||||||
|
this.publicValue = publicValue;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CredentialBuilder secret(String secret) {
|
||||||
|
this.secret = secret;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CredentialBuilder creationTime(Date creationTime) {
|
||||||
|
this.creationTime = creationTime;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CredentialBuilder lastUpdateTime(Date lastUpdateTime) {
|
||||||
|
this.lastUpdateTime = lastUpdateTime;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Credential build() {
|
||||||
|
Credential credential = new Credential();
|
||||||
|
credential.setStatus(status);
|
||||||
|
credential.setLastUpdateTime(lastUpdateTime);
|
||||||
|
credential.setCreationTime(creationTime);
|
||||||
|
credential.setProvider(provider);
|
||||||
|
credential.setSecret(secret);
|
||||||
|
credential.setPublicValue(publicValue);
|
||||||
|
credential.setUserInfo(userInfo);
|
||||||
|
credential.setId(id);
|
||||||
|
return credential;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,85 @@
|
||||||
|
package eu.eudat.builders.entity;
|
||||||
|
|
||||||
|
import eu.eudat.builders.Builder;
|
||||||
|
import eu.eudat.entities.Dataset;
|
||||||
|
import eu.eudat.entities.DatasetProfile;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by ikalyvas on 2/15/2018.
|
||||||
|
*/
|
||||||
|
public class DatasetProfileBuilder extends Builder<DatasetProfile> {
|
||||||
|
|
||||||
|
private UUID id;
|
||||||
|
|
||||||
|
private String label;
|
||||||
|
|
||||||
|
private Set<Dataset> dataset;
|
||||||
|
|
||||||
|
private String definition;
|
||||||
|
|
||||||
|
private Short status;
|
||||||
|
|
||||||
|
private Date created;
|
||||||
|
|
||||||
|
private Date modified = new Date();
|
||||||
|
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
public DatasetProfileBuilder id(UUID id) {
|
||||||
|
this.id = id;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DatasetProfileBuilder label(String label) {
|
||||||
|
this.label = label;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DatasetProfileBuilder dataset(Set<Dataset> dataset) {
|
||||||
|
this.dataset = dataset;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DatasetProfileBuilder definition(String definition) {
|
||||||
|
this.definition = definition;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DatasetProfileBuilder status(Short status) {
|
||||||
|
this.status = status;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DatasetProfileBuilder created(Date created) {
|
||||||
|
this.created = created;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DatasetProfileBuilder modified(Date modified) {
|
||||||
|
this.modified = modified;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DatasetProfileBuilder description(String description) {
|
||||||
|
this.description = description;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DatasetProfile build() {
|
||||||
|
DatasetProfile datasetProfile = new DatasetProfile();
|
||||||
|
datasetProfile.setCreated(created);
|
||||||
|
datasetProfile.setStatus(status);
|
||||||
|
datasetProfile.setId(id);
|
||||||
|
datasetProfile.setDataset(dataset);
|
||||||
|
datasetProfile.setDefinition(definition);
|
||||||
|
datasetProfile.setDescription(description);
|
||||||
|
datasetProfile.setModified(modified);
|
||||||
|
datasetProfile.setLabel(label);
|
||||||
|
return datasetProfile;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,120 @@
|
||||||
|
package eu.eudat.builders.entity;
|
||||||
|
|
||||||
|
import eu.eudat.builders.Builder;
|
||||||
|
import eu.eudat.entities.Credential;
|
||||||
|
import eu.eudat.entities.DMP;
|
||||||
|
import eu.eudat.entities.UserInfo;
|
||||||
|
import eu.eudat.entities.UserRole;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by ikalyvas on 2/15/2018.
|
||||||
|
*/
|
||||||
|
public class UserInfoBuilder extends Builder<UserInfo> {
|
||||||
|
|
||||||
|
private UUID id;
|
||||||
|
|
||||||
|
private String email = null;
|
||||||
|
|
||||||
|
private Short authorization_level; //0 admin, 1 user
|
||||||
|
|
||||||
|
private Short usertype; // 0 internal, 1 external
|
||||||
|
|
||||||
|
private Boolean verified_email = null;
|
||||||
|
|
||||||
|
private String name = null;
|
||||||
|
|
||||||
|
private Date created = null;
|
||||||
|
|
||||||
|
private Date lastloggedin = null;
|
||||||
|
|
||||||
|
private String additionalinfo;
|
||||||
|
|
||||||
|
private Set<DMP> dmps;
|
||||||
|
|
||||||
|
private Set<Credential> credentials = new HashSet<>();
|
||||||
|
|
||||||
|
private Set<UserRole> userRoles = new HashSet<>();
|
||||||
|
|
||||||
|
public UserInfoBuilder id(UUID id) {
|
||||||
|
this.id = id;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public UserInfoBuilder email(String email) {
|
||||||
|
this.email = email;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public UserInfoBuilder authorization_level(Short authorization_level) {
|
||||||
|
this.authorization_level = authorization_level;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public UserInfoBuilder usertype(Short usertype) {
|
||||||
|
this.usertype = usertype;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public UserInfoBuilder verified_email(Boolean verified_email) {
|
||||||
|
this.verified_email = verified_email;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public UserInfoBuilder name(String name) {
|
||||||
|
this.name = name;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public UserInfoBuilder created(Date created) {
|
||||||
|
this.created = created;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public UserInfoBuilder lastloggedin(Date lastloggedin) {
|
||||||
|
this.lastloggedin = lastloggedin;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public UserInfoBuilder additionalinfo(String additionalinfo) {
|
||||||
|
this.additionalinfo = additionalinfo;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public UserInfoBuilder dmps(Set<DMP> dmps) {
|
||||||
|
this.dmps = dmps;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public UserInfoBuilder credentials(Set<Credential> credentials) {
|
||||||
|
this.credentials = credentials;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public UserInfoBuilder userRoles(Set<UserRole> userRoles) {
|
||||||
|
this.userRoles = userRoles;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public UserInfo build() {
|
||||||
|
UserInfo userInfo = new UserInfo();
|
||||||
|
userInfo.setId(id);
|
||||||
|
userInfo.setUsertype(usertype);
|
||||||
|
userInfo.setAuthorization_level(authorization_level);
|
||||||
|
userInfo.setLastloggedin(lastloggedin);
|
||||||
|
userInfo.setCreated(created);
|
||||||
|
userInfo.setEmail(email);
|
||||||
|
userInfo.setName(name);
|
||||||
|
userInfo.setAdditionalinfo(additionalinfo);
|
||||||
|
userInfo.setUserRoles(userRoles);
|
||||||
|
userInfo.setCredentials(credentials);
|
||||||
|
userInfo.setDmps(dmps);
|
||||||
|
userInfo.setVerified_email(verified_email);
|
||||||
|
return userInfo;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,43 @@
|
||||||
|
package eu.eudat.builders.entity;
|
||||||
|
|
||||||
|
import eu.eudat.builders.Builder;
|
||||||
|
import eu.eudat.entities.UserInfo;
|
||||||
|
import eu.eudat.entities.UserRole;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by ikalyvas on 2/15/2018.
|
||||||
|
*/
|
||||||
|
public class UserRoleBuilder extends Builder<UserRole> {
|
||||||
|
|
||||||
|
private UUID id;
|
||||||
|
|
||||||
|
private int role;
|
||||||
|
|
||||||
|
private UserInfo userInfo;
|
||||||
|
|
||||||
|
public UserRoleBuilder id(UUID id) {
|
||||||
|
this.id = id;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public UserRoleBuilder role(int role) {
|
||||||
|
this.role = role;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public UserRoleBuilder userInfo(UserInfo userInfo) {
|
||||||
|
this.userInfo = userInfo;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public UserRole build() {
|
||||||
|
UserRole userRole = new UserRole();
|
||||||
|
userRole.setUserInfo(userInfo);
|
||||||
|
userRole.setRole(role);
|
||||||
|
userRole.setId(id);
|
||||||
|
return userRole;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,52 @@
|
||||||
|
package eu.eudat.builders.entity;
|
||||||
|
|
||||||
|
import eu.eudat.builders.Builder;
|
||||||
|
import eu.eudat.entities.UserInfo;
|
||||||
|
import eu.eudat.entities.UserToken;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by ikalyvas on 2/15/2018.
|
||||||
|
*/
|
||||||
|
public class UserTokenBuilder extends Builder<UserToken> {
|
||||||
|
|
||||||
|
private UUID token;
|
||||||
|
|
||||||
|
private UserInfo user;
|
||||||
|
|
||||||
|
private Date issuedAt;
|
||||||
|
|
||||||
|
private Date expiresAt;
|
||||||
|
|
||||||
|
public UserTokenBuilder token(UUID token) {
|
||||||
|
this.token = token;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public UserTokenBuilder user(UserInfo user) {
|
||||||
|
this.user = user;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public UserTokenBuilder issuedAt(Date issuedAt) {
|
||||||
|
this.issuedAt = issuedAt;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public UserTokenBuilder expiresAt(Date expiresAt) {
|
||||||
|
this.expiresAt = expiresAt;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public UserToken build() {
|
||||||
|
UserToken userToken = new UserToken();
|
||||||
|
userToken.setExpiresAt(expiresAt);
|
||||||
|
userToken.setToken(token);
|
||||||
|
userToken.setUser(user);
|
||||||
|
userToken.setIssuedAt(issuedAt);
|
||||||
|
return userToken;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,23 @@
|
||||||
|
package eu.eudat.builders.model.criteria;
|
||||||
|
|
||||||
|
import eu.eudat.builders.Builder;
|
||||||
|
import eu.eudat.models.criteria.DataRepositoryCriteria;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by ikalyvas on 2/15/2018.
|
||||||
|
*/
|
||||||
|
public class DataRepositoryCriteriaBuilder extends Builder<DataRepositoryCriteria> {
|
||||||
|
private String like;
|
||||||
|
|
||||||
|
public DataRepositoryCriteriaBuilder like(String like) {
|
||||||
|
this.like = like;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DataRepositoryCriteria build() {
|
||||||
|
DataRepositoryCriteria dataRepositoryCriteria = new DataRepositoryCriteria();
|
||||||
|
dataRepositoryCriteria.setLike(like);
|
||||||
|
return dataRepositoryCriteria;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,23 @@
|
||||||
|
package eu.eudat.builders.model.criteria;
|
||||||
|
|
||||||
|
import eu.eudat.builders.Builder;
|
||||||
|
import eu.eudat.models.criteria.ExternalDatasetCriteria;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by ikalyvas on 2/15/2018.
|
||||||
|
*/
|
||||||
|
public class ExternalDatasetCriteriaBuilder extends Builder<ExternalDatasetCriteria> {
|
||||||
|
private String like;
|
||||||
|
|
||||||
|
public ExternalDatasetCriteriaBuilder like(String like) {
|
||||||
|
this.like = like;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ExternalDatasetCriteria build() {
|
||||||
|
ExternalDatasetCriteria externalDatasetCriteria = new ExternalDatasetCriteria();
|
||||||
|
externalDatasetCriteria.setLike(like);
|
||||||
|
return externalDatasetCriteria;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,23 @@
|
||||||
|
package eu.eudat.builders.model.criteria;
|
||||||
|
|
||||||
|
import eu.eudat.builders.Builder;
|
||||||
|
import eu.eudat.models.criteria.RegistryCriteria;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by ikalyvas on 2/15/2018.
|
||||||
|
*/
|
||||||
|
public class RegistryCriteriaBuilder extends Builder<RegistryCriteria> {
|
||||||
|
private String like;
|
||||||
|
|
||||||
|
public RegistryCriteriaBuilder like(String like) {
|
||||||
|
this.like = like;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public RegistryCriteria build() {
|
||||||
|
RegistryCriteria registryCriteria = new RegistryCriteria();
|
||||||
|
registryCriteria.setLike(like);
|
||||||
|
return registryCriteria;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,23 @@
|
||||||
|
package eu.eudat.builders.model.criteria;
|
||||||
|
|
||||||
|
import eu.eudat.builders.Builder;
|
||||||
|
import eu.eudat.models.criteria.ServiceCriteria;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by ikalyvas on 2/15/2018.
|
||||||
|
*/
|
||||||
|
public class ServiceCriteriaBuilder extends Builder<ServiceCriteria> {
|
||||||
|
private String like;
|
||||||
|
|
||||||
|
public ServiceCriteriaBuilder setLike(String like) {
|
||||||
|
this.like = like;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ServiceCriteria build() {
|
||||||
|
ServiceCriteria serviceCriteria = new ServiceCriteria();
|
||||||
|
serviceCriteria.setLike(like);
|
||||||
|
return serviceCriteria;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,33 @@
|
||||||
|
package eu.eudat.builders.model.models;
|
||||||
|
|
||||||
|
import eu.eudat.builders.Builder;
|
||||||
|
import eu.eudat.models.helpers.common.DataTableData;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by ikalyvas on 2/15/2018.
|
||||||
|
*/
|
||||||
|
public class DataTableDataBuilder<T> extends Builder<DataTableData<T>> {
|
||||||
|
|
||||||
|
private Long totalCount;
|
||||||
|
private List<T> data;
|
||||||
|
|
||||||
|
public DataTableDataBuilder<T> totalCount(Long totalCount) {
|
||||||
|
this.totalCount = totalCount;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DataTableDataBuilder<T> data(List<T> data) {
|
||||||
|
this.data = data;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DataTableData<T> build() {
|
||||||
|
DataTableData<T> dataTableData = new DataTableData<>();
|
||||||
|
dataTableData.setTotalCount(totalCount);
|
||||||
|
dataTableData.setData(data);
|
||||||
|
return dataTableData;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,57 @@
|
||||||
|
package eu.eudat.builders.model.models;
|
||||||
|
|
||||||
|
import eu.eudat.builders.Builder;
|
||||||
|
import eu.eudat.models.security.Principal;
|
||||||
|
import eu.eudat.types.Authorities;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by ikalyvas on 2/15/2018.
|
||||||
|
*/
|
||||||
|
public class PrincipalBuilder extends Builder<Principal> {
|
||||||
|
|
||||||
|
private UUID id;
|
||||||
|
private UUID token;
|
||||||
|
private String name;
|
||||||
|
private Date expiresAt;
|
||||||
|
private Set<Authorities> authorities;
|
||||||
|
|
||||||
|
public PrincipalBuilder id(UUID id) {
|
||||||
|
this.id = id;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PrincipalBuilder token(UUID token) {
|
||||||
|
this.token = token;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PrincipalBuilder name(String name) {
|
||||||
|
this.name = name;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PrincipalBuilder expiresAt(Date expiresAt) {
|
||||||
|
this.expiresAt = expiresAt;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PrincipalBuilder authorities(Set<Authorities> authorities) {
|
||||||
|
this.authorities = authorities;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Principal build() {
|
||||||
|
Principal principal = new Principal();
|
||||||
|
principal.setAuthorities(authorities);
|
||||||
|
principal.setName(name);
|
||||||
|
principal.setExpiresAt(expiresAt);
|
||||||
|
principal.setToken(token);
|
||||||
|
principal.setId(id);
|
||||||
|
return principal;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,134 @@
|
||||||
|
package eu.eudat.builders.model.models;
|
||||||
|
|
||||||
|
import eu.eudat.builders.Builder;
|
||||||
|
import eu.eudat.entities.UserInfo;
|
||||||
|
import eu.eudat.models.dmp.DataManagementPlan;
|
||||||
|
import eu.eudat.models.project.Project;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by ikalyvas on 2/15/2018.
|
||||||
|
*/
|
||||||
|
public class ProjectBuilder extends Builder<Project> {
|
||||||
|
|
||||||
|
private UUID id;
|
||||||
|
|
||||||
|
private List<DataManagementPlan> dmps;
|
||||||
|
|
||||||
|
private String label;
|
||||||
|
|
||||||
|
private String abbreviation;
|
||||||
|
|
||||||
|
private String reference;
|
||||||
|
|
||||||
|
private String uri;
|
||||||
|
|
||||||
|
private String definition;
|
||||||
|
|
||||||
|
private Date startDate;
|
||||||
|
|
||||||
|
private Date endDate;
|
||||||
|
|
||||||
|
private eu.eudat.entities.Project.Status status;
|
||||||
|
|
||||||
|
private UserInfo creationUser;
|
||||||
|
|
||||||
|
private Date created;
|
||||||
|
|
||||||
|
private Date modified;
|
||||||
|
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
public ProjectBuilder id(UUID id) {
|
||||||
|
this.id = id;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ProjectBuilder dmps(List<DataManagementPlan> dmps) {
|
||||||
|
this.dmps = dmps;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ProjectBuilder label(String label) {
|
||||||
|
this.label = label;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ProjectBuilder abbreviation(String abbreviation) {
|
||||||
|
this.abbreviation = abbreviation;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ProjectBuilder reference(String reference) {
|
||||||
|
this.reference = reference;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ProjectBuilder uri(String uri) {
|
||||||
|
this.uri = uri;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ProjectBuilder definition(String definition) {
|
||||||
|
this.definition = definition;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ProjectBuilder startDate(Date startDate) {
|
||||||
|
this.startDate = startDate;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ProjectBuilder endDate(Date endDate) {
|
||||||
|
this.endDate = endDate;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ProjectBuilder status(eu.eudat.entities.Project.Status status) {
|
||||||
|
this.status = status;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ProjectBuilder creationUser(UserInfo creationUser) {
|
||||||
|
this.creationUser = creationUser;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ProjectBuilder created(Date created) {
|
||||||
|
this.created = created;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ProjectBuilder modified(Date modified) {
|
||||||
|
this.modified = modified;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ProjectBuilder description(String description) {
|
||||||
|
this.description = description;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Project build() {
|
||||||
|
Project project = new Project();
|
||||||
|
project.setStatus(status.getValue());
|
||||||
|
project.setAbbreviation(abbreviation);
|
||||||
|
project.setCreated(created);
|
||||||
|
project.setCreationUser(creationUser);
|
||||||
|
project.setDefinition(definition);
|
||||||
|
project.setDescription(description);
|
||||||
|
project.setDmps(dmps);
|
||||||
|
project.setEndDate(endDate);
|
||||||
|
project.setId(id);
|
||||||
|
project.setLabel(label);
|
||||||
|
project.setModified(modified);
|
||||||
|
project.setReference(reference);
|
||||||
|
project.setCreationUser(creationUser);
|
||||||
|
project.setStartDate(startDate);
|
||||||
|
return project;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,43 +1,41 @@
|
||||||
package eu.eudat.cache;
|
package eu.eudat.cache;
|
||||||
|
|
||||||
|
|
||||||
|
import com.google.common.cache.CacheBuilder;
|
||||||
|
import org.springframework.cache.CacheManager;
|
||||||
|
import org.springframework.cache.annotation.EnableCaching;
|
||||||
|
import org.springframework.cache.guava.GuavaCache;
|
||||||
|
import org.springframework.cache.support.SimpleCacheManager;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import org.springframework.cache.CacheManager;
|
|
||||||
import org.springframework.cache.annotation.EnableCaching;
|
|
||||||
import org.springframework.cache.support.SimpleCacheManager;
|
|
||||||
import org.springframework.context.annotation.Bean;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
import org.springframework.cache.guava.GuavaCache;
|
|
||||||
|
|
||||||
import com.google.common.cache.CacheBuilder;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
@EnableCaching
|
@EnableCaching
|
||||||
public class ResponsesCache {
|
public class ResponsesCache {
|
||||||
|
|
||||||
public static long HOW_MANY = 30;
|
public static long HOW_MANY = 30;
|
||||||
public static TimeUnit TIME_UNIT = TimeUnit.MINUTES;
|
public static TimeUnit TIME_UNIT = TimeUnit.MINUTES;
|
||||||
|
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public CacheManager cacheManager() {
|
public CacheManager cacheManager() {
|
||||||
System.out.print("Loading ResponsesCache...");
|
System.out.print("Loading ResponsesCache...");
|
||||||
SimpleCacheManager simpleCacheManager = new SimpleCacheManager();
|
SimpleCacheManager simpleCacheManager = new SimpleCacheManager();
|
||||||
List<GuavaCache> caches = new ArrayList<GuavaCache>();
|
List<GuavaCache> caches = new ArrayList<GuavaCache>();
|
||||||
caches.add(new GuavaCache("repositories", CacheBuilder.newBuilder().expireAfterAccess(HOW_MANY, TIME_UNIT).build()));
|
caches.add(new GuavaCache("repositories", CacheBuilder.newBuilder().expireAfterAccess(HOW_MANY, TIME_UNIT).build()));
|
||||||
caches.add(new GuavaCache("projects", CacheBuilder.newBuilder().expireAfterAccess(HOW_MANY, TIME_UNIT).build()));
|
caches.add(new GuavaCache("projects", CacheBuilder.newBuilder().expireAfterAccess(HOW_MANY, TIME_UNIT).build()));
|
||||||
caches.add(new GuavaCache("organisations", CacheBuilder.newBuilder().expireAfterAccess(HOW_MANY, TIME_UNIT).build()));
|
caches.add(new GuavaCache("organisations", CacheBuilder.newBuilder().expireAfterAccess(HOW_MANY, TIME_UNIT).build()));
|
||||||
caches.add(new GuavaCache("registries", CacheBuilder.newBuilder().expireAfterAccess(HOW_MANY, TIME_UNIT).build()));
|
caches.add(new GuavaCache("registries", CacheBuilder.newBuilder().expireAfterAccess(HOW_MANY, TIME_UNIT).build()));
|
||||||
caches.add(new GuavaCache("services", CacheBuilder.newBuilder().expireAfterAccess(HOW_MANY, TIME_UNIT).build()));
|
caches.add(new GuavaCache("services", CacheBuilder.newBuilder().expireAfterAccess(HOW_MANY, TIME_UNIT).build()));
|
||||||
caches.add(new GuavaCache("researchers", CacheBuilder.newBuilder().expireAfterAccess(HOW_MANY, TIME_UNIT).build()));
|
caches.add(new GuavaCache("researchers", CacheBuilder.newBuilder().expireAfterAccess(HOW_MANY, TIME_UNIT).build()));
|
||||||
simpleCacheManager.setCaches(caches);
|
simpleCacheManager.setCaches(caches);
|
||||||
System.out.println("OK");
|
System.out.println("OK");
|
||||||
return simpleCacheManager;
|
return simpleCacheManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,7 @@ import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
|
||||||
import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter;
|
import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter;
|
||||||
import org.springframework.transaction.PlatformTransactionManager;
|
import org.springframework.transaction.PlatformTransactionManager;
|
||||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||||
|
|
||||||
import javax.persistence.EntityManagerFactory;
|
import javax.persistence.EntityManagerFactory;
|
||||||
import javax.sql.DataSource;
|
import javax.sql.DataSource;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
@ -67,7 +68,7 @@ public class DevelDatabaseConfiguration {
|
||||||
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", "true");
|
||||||
properties.setProperty("hibernate.temp.use_jdbc_metadata_defaults","false");
|
properties.setProperty("hibernate.temp.use_jdbc_metadata_defaults", "false");
|
||||||
return properties;
|
return properties;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -70,7 +70,7 @@ public class ProductionDatabaseConfiguration {
|
||||||
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", "true");
|
||||||
properties.setProperty("hibernate.temp.use_jdbc_metadata_defaults","false");
|
properties.setProperty("hibernate.temp.use_jdbc_metadata_defaults", "false");
|
||||||
return properties;
|
return properties;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -3,14 +3,9 @@ package eu.eudat.configurations;
|
||||||
import eu.eudat.handlers.PrincipalArgumentResolver;
|
import eu.eudat.handlers.PrincipalArgumentResolver;
|
||||||
import eu.eudat.services.AuthenticationService;
|
import eu.eudat.services.AuthenticationService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer;
|
|
||||||
import org.springframework.boot.web.servlet.ErrorPage;
|
|
||||||
import org.springframework.context.annotation.Bean;
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.http.HttpStatus;
|
|
||||||
import org.springframework.scheduling.annotation.EnableAsync;
|
import org.springframework.scheduling.annotation.EnableAsync;
|
||||||
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
|
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
|
||||||
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
|
|
||||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -21,6 +16,7 @@ public class WebMVCConfiguration extends WebMvcConfigurerAdapter {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
AuthenticationService authenticationService;
|
AuthenticationService authenticationService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
|
public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
|
||||||
argumentResolvers.add(new PrincipalArgumentResolver(this.authenticationService));
|
argumentResolvers.add(new PrincipalArgumentResolver(this.authenticationService));
|
||||||
|
|
|
@ -1,32 +1,20 @@
|
||||||
package eu.eudat.controllers;
|
package eu.eudat.controllers;
|
||||||
|
|
||||||
import java.util.UUID;
|
import eu.eudat.managers.AdminManager;
|
||||||
|
import eu.eudat.models.admin.composite.DatasetProfile;
|
||||||
import eu.eudat.dao.entities.*;
|
|
||||||
import eu.eudat.managers.DashBoardManager;
|
|
||||||
import eu.eudat.models.dashboard.DashBoardStatistics;
|
|
||||||
import eu.eudat.models.helpers.responses.ResponseItem;
|
import eu.eudat.models.helpers.responses.ResponseItem;
|
||||||
import eu.eudat.models.security.Principal;
|
import eu.eudat.models.security.Principal;
|
||||||
import eu.eudat.security.claims.ClaimedAuthorities;
|
import eu.eudat.security.claims.ClaimedAuthorities;
|
||||||
import eu.eudat.services.ApiContext;
|
import eu.eudat.services.ApiContext;
|
||||||
import eu.eudat.types.ApiMessageCode;
|
import eu.eudat.types.ApiMessageCode;
|
||||||
import eu.eudat.types.Authorities;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.context.ApplicationContext;
|
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import eu.eudat.managers.AdminManager;
|
|
||||||
import eu.eudat.models.admin.composite.DatasetProfile;
|
|
||||||
|
|
||||||
import javax.transaction.Transactional;
|
import javax.transaction.Transactional;
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
import static eu.eudat.types.Authorities.ADMIN;
|
import static eu.eudat.types.Authorities.ADMIN;
|
||||||
|
|
||||||
|
@ -44,7 +32,7 @@ public class Admin extends BaseController {
|
||||||
@RequestMapping(method = RequestMethod.POST, value = {"/admin/addDmp"}, consumes = "application/json", produces = "application/json")
|
@RequestMapping(method = RequestMethod.POST, value = {"/admin/addDmp"}, consumes = "application/json", produces = "application/json")
|
||||||
public ResponseEntity<Object> addDmp(@Valid @RequestBody DatasetProfile profile, @ClaimedAuthorities(claims = {ADMIN}) Principal principal) {
|
public ResponseEntity<Object> addDmp(@Valid @RequestBody DatasetProfile profile, @ClaimedAuthorities(claims = {ADMIN}) Principal principal) {
|
||||||
try {
|
try {
|
||||||
eu.eudat.entities.DatasetProfile modelDefinition = AdminManager.generateViewStyleDefinition(profile);
|
eu.eudat.entities.DatasetProfile modelDefinition = AdminManager.generateViewStyleDefinition(profile, getApiContext());
|
||||||
this.getApiContext().getDatabaseRepository().getDatasetProfileDao().createOrUpdate(modelDefinition);
|
this.getApiContext().getDatabaseRepository().getDatasetProfileDao().createOrUpdate(modelDefinition);
|
||||||
return ResponseEntity.status(HttpStatus.OK).body(modelDefinition.getId());
|
return ResponseEntity.status(HttpStatus.OK).body(modelDefinition.getId());
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
|
@ -57,7 +45,7 @@ public class Admin extends BaseController {
|
||||||
@RequestMapping(method = RequestMethod.POST, value = {"/admin/addDmp/{id}"}, consumes = "application/json", produces = "application/json")
|
@RequestMapping(method = RequestMethod.POST, value = {"/admin/addDmp/{id}"}, consumes = "application/json", produces = "application/json")
|
||||||
public ResponseEntity<ResponseItem<UUID>> updateDmp(@PathVariable String id, @RequestBody DatasetProfile profile, @ClaimedAuthorities(claims = {ADMIN}) Principal principal) {
|
public ResponseEntity<ResponseItem<UUID>> updateDmp(@PathVariable String id, @RequestBody DatasetProfile profile, @ClaimedAuthorities(claims = {ADMIN}) Principal principal) {
|
||||||
try {
|
try {
|
||||||
eu.eudat.entities.DatasetProfile modelDefinition = AdminManager.generateViewStyleDefinition(profile);
|
eu.eudat.entities.DatasetProfile modelDefinition = AdminManager.generateViewStyleDefinition(profile, getApiContext());
|
||||||
|
|
||||||
eu.eudat.entities.DatasetProfile datasetprofile = this.getApiContext().getDatabaseRepository().getDatasetProfileDao().find(UUID.fromString(id));
|
eu.eudat.entities.DatasetProfile datasetprofile = this.getApiContext().getDatabaseRepository().getDatasetProfileDao().find(UUID.fromString(id));
|
||||||
datasetprofile.setDefinition(modelDefinition.getDefinition());
|
datasetprofile.setDefinition(modelDefinition.getDefinition());
|
||||||
|
|
|
@ -5,8 +5,6 @@ import eu.eudat.validators.DataManagementPlanTableRequestValidator;
|
||||||
import eu.eudat.validators.DatasetProfileValidator;
|
import eu.eudat.validators.DatasetProfileValidator;
|
||||||
import eu.eudat.validators.ProjectModelValidator;
|
import eu.eudat.validators.ProjectModelValidator;
|
||||||
import eu.eudat.validators.ProjectTableRequestValidator;
|
import eu.eudat.validators.ProjectTableRequestValidator;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.context.ApplicationContext;
|
|
||||||
import org.springframework.web.bind.WebDataBinder;
|
import org.springframework.web.bind.WebDataBinder;
|
||||||
import org.springframework.web.bind.annotation.InitBinder;
|
import org.springframework.web.bind.annotation.InitBinder;
|
||||||
|
|
||||||
|
@ -19,16 +17,20 @@ public abstract class BaseController {
|
||||||
return apiContext;
|
return apiContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
public BaseController(ApiContext apiContext){
|
public BaseController(ApiContext apiContext) {
|
||||||
this.apiContext = apiContext;
|
this.apiContext = apiContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
@InitBinder()
|
@InitBinder()
|
||||||
protected void initBinder(WebDataBinder binder) {
|
protected void initBinder(WebDataBinder binder) {
|
||||||
if (binder.getTarget() != null && DataManagementPlanTableRequestValidator.supportsType((binder.getTarget().getClass()))) binder.addValidators(this.apiContext.getApplicationContext().getBean("dataManagementPlanTableRequestValidator",DataManagementPlanTableRequestValidator.class));
|
if (binder.getTarget() != null && DataManagementPlanTableRequestValidator.supportsType((binder.getTarget().getClass())))
|
||||||
if (binder.getTarget() != null && ProjectTableRequestValidator.supportsType((binder.getTarget().getClass()))) binder.addValidators(this.apiContext.getApplicationContext().getBean("projectTableRequestValidator",ProjectTableRequestValidator.class));
|
binder.addValidators(this.apiContext.getApplicationContext().getBean("dataManagementPlanTableRequestValidator", DataManagementPlanTableRequestValidator.class));
|
||||||
if (binder.getTarget() != null && DatasetProfileValidator.supportsType((binder.getTarget().getClass()))) binder.addValidators(this.apiContext.getApplicationContext().getBean("datasetProfileValidator",DatasetProfileValidator.class));
|
if (binder.getTarget() != null && ProjectTableRequestValidator.supportsType((binder.getTarget().getClass())))
|
||||||
if (binder.getTarget() != null && ProjectModelValidator.supportsType((binder.getTarget().getClass()))) binder.addValidators(this.apiContext.getApplicationContext().getBean("projectModelValidator",ProjectModelValidator.class));
|
binder.addValidators(this.apiContext.getApplicationContext().getBean("projectTableRequestValidator", ProjectTableRequestValidator.class));
|
||||||
|
if (binder.getTarget() != null && DatasetProfileValidator.supportsType((binder.getTarget().getClass())))
|
||||||
|
binder.addValidators(this.apiContext.getApplicationContext().getBean("datasetProfileValidator", DatasetProfileValidator.class));
|
||||||
|
if (binder.getTarget() != null && ProjectModelValidator.supportsType((binder.getTarget().getClass())))
|
||||||
|
binder.addValidators(this.apiContext.getApplicationContext().getBean("projectModelValidator", ProjectModelValidator.class));
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,17 +1,14 @@
|
||||||
package eu.eudat.controllers;
|
package eu.eudat.controllers;
|
||||||
|
|
||||||
|
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
import javax.validation.Valid;
|
|
||||||
|
|
||||||
import eu.eudat.entities.DMP;
|
import eu.eudat.entities.DMP;
|
||||||
import eu.eudat.exceptions.datamanagementplan.DMPWithDatasetsException;
|
import eu.eudat.exceptions.datamanagementplan.DMPWithDatasetsException;
|
||||||
|
import eu.eudat.managers.DataManagementPlanManager;
|
||||||
import eu.eudat.models.dmp.DataManagementPlan;
|
import eu.eudat.models.dmp.DataManagementPlan;
|
||||||
import eu.eudat.models.dmp.DataManagementPlanCriteriaRequest;
|
import eu.eudat.models.dmp.DataManagementPlanCriteriaRequest;
|
||||||
import eu.eudat.models.dmp.DataManagementPlanTableRequest;
|
import eu.eudat.models.dmp.DataManagementPlanTableRequest;
|
||||||
import eu.eudat.models.helpers.common.DataTableData;
|
import eu.eudat.models.helpers.common.DataTableData;
|
||||||
import eu.eudat.models.helpers.responses.*;
|
import eu.eudat.models.helpers.responses.ResponseItem;
|
||||||
import eu.eudat.models.listingmodels.DataManagementPlanListingModel;
|
import eu.eudat.models.listingmodels.DataManagementPlanListingModel;
|
||||||
import eu.eudat.models.security.Principal;
|
import eu.eudat.models.security.Principal;
|
||||||
import eu.eudat.services.ApiContext;
|
import eu.eudat.services.ApiContext;
|
||||||
|
@ -19,11 +16,12 @@ import eu.eudat.types.ApiMessageCode;
|
||||||
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;
|
||||||
import org.springframework.scheduling.annotation.Async;
|
|
||||||
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 eu.eudat.managers.DataManagementPlanManager;
|
import javax.validation.Valid;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
|
@ -73,8 +71,6 @@ public class DMPs extends BaseController {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new ResponseItem<DMP>().status(ApiMessageCode.DEFAULT_ERROR_MESSAGE).message(ex.getMessage()));
|
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new ResponseItem<DMP>().status(ApiMessageCode.DEFAULT_ERROR_MESSAGE).message(ex.getMessage()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(method = RequestMethod.POST, value = {"/dmps/new/{id}"}, consumes = "application/json", produces = "application/json")
|
@RequestMapping(method = RequestMethod.POST, value = {"/dmps/new/{id}"}, consumes = "application/json", produces = "application/json")
|
||||||
|
@ -121,9 +117,9 @@ public class DMPs extends BaseController {
|
||||||
try {
|
try {
|
||||||
DataManagementPlanManager.delete(this.getApiContext(), id);
|
DataManagementPlanManager.delete(this.getApiContext(), id);
|
||||||
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<DMP>().status(ApiMessageCode.SUCCESS_MESSAGE).message("Successfully Deleted Dataset"));
|
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<DMP>().status(ApiMessageCode.SUCCESS_MESSAGE).message("Successfully Deleted Dataset"));
|
||||||
} catch (DMPWithDatasetsException ex){
|
} catch (DMPWithDatasetsException ex) {
|
||||||
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new ResponseItem<DMP>().status(ApiMessageCode.ERROR_MESSAGE).message(ex.getMessage()));
|
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new ResponseItem<DMP>().status(ApiMessageCode.ERROR_MESSAGE).message(ex.getMessage()));
|
||||||
}catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new ResponseItem<DMP>().status(ApiMessageCode.DEFAULT_ERROR_MESSAGE).message(ex.getMessage()));
|
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new ResponseItem<DMP>().status(ApiMessageCode.DEFAULT_ERROR_MESSAGE).message(ex.getMessage()));
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
package eu.eudat.controllers;
|
package eu.eudat.controllers;
|
||||||
|
|
||||||
|
import eu.eudat.managers.DashBoardManager;
|
||||||
|
import eu.eudat.models.dashboard.DashBoardStatistics;
|
||||||
import eu.eudat.models.helpers.responses.ResponseItem;
|
import eu.eudat.models.helpers.responses.ResponseItem;
|
||||||
import eu.eudat.models.security.Principal;
|
import eu.eudat.models.security.Principal;
|
||||||
import eu.eudat.services.ApiContext;
|
import eu.eudat.services.ApiContext;
|
||||||
|
@ -12,45 +14,37 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import eu.eudat.dao.entities.DMPDao;
|
|
||||||
import eu.eudat.dao.entities.DatasetDao;
|
|
||||||
import eu.eudat.dao.entities.ProjectDao;
|
|
||||||
import eu.eudat.managers.DashBoardManager;
|
|
||||||
import eu.eudat.models.dashboard.DashBoardStatistics;
|
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@CrossOrigin
|
@CrossOrigin
|
||||||
@RequestMapping(value = {"/api"})
|
@RequestMapping(value = {"/api"})
|
||||||
public class DashBoardController extends BaseController{
|
public class DashBoardController extends BaseController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public DashBoardController(ApiContext apiContext) {
|
public DashBoardController(ApiContext apiContext) {
|
||||||
super(apiContext);
|
super(apiContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(method = RequestMethod.GET, value = { "/dashboard/getStatistics" }, produces="application/json")
|
@RequestMapping(method = RequestMethod.GET, value = {"/dashboard/getStatistics"}, produces = "application/json")
|
||||||
public ResponseEntity<ResponseItem<DashBoardStatistics>> getStatistics(){
|
public ResponseEntity<ResponseItem<DashBoardStatistics>> getStatistics() {
|
||||||
try {
|
try {
|
||||||
DashBoardStatistics statistics = new DashBoardManager().getStatistics(this.getApiContext().getDatabaseRepository().getDatasetDao(), this.getApiContext().getDatabaseRepository().getDmpDao()
|
DashBoardStatistics statistics = new DashBoardManager().getStatistics(this.getApiContext().getDatabaseRepository().getDatasetDao(), this.getApiContext().getDatabaseRepository().getDmpDao()
|
||||||
, this.getApiContext().getDatabaseRepository().getProjectDao());
|
, this.getApiContext().getDatabaseRepository().getProjectDao());
|
||||||
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<DashBoardStatistics>().status(ApiMessageCode.NO_MESSAGE).payload(statistics));
|
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<DashBoardStatistics>().status(ApiMessageCode.NO_MESSAGE).payload(statistics));
|
||||||
}
|
} catch (Exception ex) {
|
||||||
catch(Exception ex) {
|
ex.printStackTrace();
|
||||||
ex.printStackTrace();
|
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new ResponseItem<DashBoardStatistics>().status(ApiMessageCode.DEFAULT_ERROR_MESSAGE).message(ex.getMessage()));
|
||||||
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new ResponseItem<DashBoardStatistics>().status(ApiMessageCode.DEFAULT_ERROR_MESSAGE).message(ex.getMessage()));
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@RequestMapping(method = RequestMethod.GET, value = { "/dashboard/me/getStatistics" }, produces="application/json")
|
@RequestMapping(method = RequestMethod.GET, value = {"/dashboard/me/getStatistics"}, produces = "application/json")
|
||||||
public ResponseEntity<ResponseItem<DashBoardStatistics>> getStatistics(Principal principal){
|
public ResponseEntity<ResponseItem<DashBoardStatistics>> getStatistics(Principal principal) {
|
||||||
try {
|
try {
|
||||||
DashBoardStatistics statistics = new DashBoardManager().getMeStatistics(this.getApiContext().getDatabaseRepository().getDatasetDao(), this.getApiContext().getDatabaseRepository().getDmpDao()
|
DashBoardStatistics statistics = new DashBoardManager().getMeStatistics(this.getApiContext().getDatabaseRepository().getDatasetDao(), this.getApiContext().getDatabaseRepository().getDmpDao()
|
||||||
, this.getApiContext().getDatabaseRepository().getProjectDao(),principal);
|
, this.getApiContext().getDatabaseRepository().getProjectDao(), principal);
|
||||||
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<DashBoardStatistics>().status(ApiMessageCode.NO_MESSAGE).payload(statistics));
|
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<DashBoardStatistics>().status(ApiMessageCode.NO_MESSAGE).payload(statistics));
|
||||||
}
|
} catch (Exception ex) {
|
||||||
catch(Exception ex) {
|
ex.printStackTrace();
|
||||||
ex.printStackTrace();
|
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new ResponseItem<DashBoardStatistics>().status(ApiMessageCode.DEFAULT_ERROR_MESSAGE).message(ex.getMessage()));
|
||||||
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new ResponseItem<DashBoardStatistics>().status(ApiMessageCode.DEFAULT_ERROR_MESSAGE).message(ex.getMessage()));
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,48 +1,41 @@
|
||||||
package eu.eudat.controllers;
|
package eu.eudat.controllers;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import eu.eudat.models.helpers.responses.ResponseItem;
|
import eu.eudat.models.helpers.responses.ResponseItem;
|
||||||
|
import eu.eudat.proxy.config.exceptions.HugeResultSet;
|
||||||
|
import eu.eudat.proxy.config.exceptions.NoURLFound;
|
||||||
import eu.eudat.services.ApiContext;
|
import eu.eudat.services.ApiContext;
|
||||||
import eu.eudat.types.ApiMessageCode;
|
import eu.eudat.types.ApiMessageCode;
|
||||||
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;
|
||||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import eu.eudat.proxy.config.exceptions.HugeResultSet;
|
import java.util.List;
|
||||||
import eu.eudat.proxy.config.exceptions.NoURLFound;
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@CrossOrigin
|
@CrossOrigin
|
||||||
@RequestMapping(value = {"/api"})
|
@RequestMapping(value = {"/api"})
|
||||||
public class DataRepositories extends BaseController{
|
public class DataRepositories extends BaseController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public DataRepositories(ApiContext apiContext) {
|
public DataRepositories(ApiContext apiContext) {
|
||||||
super(apiContext);
|
super(apiContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequestMapping(method = RequestMethod.GET, value = {"/external/datarepos"}, produces = "application/json")
|
||||||
|
public @ResponseBody
|
||||||
|
ResponseEntity<ResponseItem<List<Map<String, String>>>> listExternalDataRepositories(@RequestParam(value = "query", required = false) String query) {
|
||||||
|
try {
|
||||||
|
List<Map<String, String>> remoteRepos = this.getApiContext().getRemoteFetcher().getRepositories(query);
|
||||||
|
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<List<Map<String, String>>>().status(ApiMessageCode.NO_MESSAGE).payload(remoteRepos));
|
||||||
|
} catch (NoURLFound ex) {
|
||||||
|
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new ResponseItem<List<Map<String, String>>>().status(ApiMessageCode.ERROR_MESSAGE).message(ex.getMessage()).payload(null));
|
||||||
|
} catch (HugeResultSet ex) {
|
||||||
|
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new ResponseItem<List<Map<String, String>>>().status(ApiMessageCode.ERROR_MESSAGE).message(ex.getMessage()).payload(null));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@RequestMapping(method = RequestMethod.GET, value = { "/external/datarepos" }, produces="application/json")
|
|
||||||
public @ResponseBody ResponseEntity<ResponseItem<List<Map<String,String>>>> listExternalDataRepositories(@RequestParam(value="query", required=false) String query ){
|
|
||||||
try {
|
|
||||||
List<Map<String,String>> remoteRepos = this.getApiContext().getRemoteFetcher().getRepositories(query);
|
|
||||||
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<List<Map<String,String>>>().status(ApiMessageCode.NO_MESSAGE).payload(remoteRepos));
|
|
||||||
}
|
|
||||||
catch(NoURLFound ex) {
|
|
||||||
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new ResponseItem<List<Map<String,String>>>().status(ApiMessageCode.ERROR_MESSAGE).message(ex.getMessage()).payload(null));
|
|
||||||
}
|
|
||||||
catch(HugeResultSet ex) {
|
|
||||||
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new ResponseItem<List<Map<String,String>>>().status(ApiMessageCode.ERROR_MESSAGE).message(ex.getMessage()).payload(null));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,10 @@
|
||||||
package eu.eudat.controllers;
|
package eu.eudat.controllers;
|
||||||
|
|
||||||
import java.net.HttpURLConnection;
|
import eu.eudat.managers.UserManager;
|
||||||
import java.net.URL;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
import eu.eudat.models.components.commons.datafield.AutoCompleteData;
|
import eu.eudat.models.components.commons.datafield.AutoCompleteData;
|
||||||
|
import eu.eudat.models.helpers.common.AutoCompleteLookupItem;
|
||||||
import eu.eudat.models.helpers.responses.ResponseItem;
|
import eu.eudat.models.helpers.responses.ResponseItem;
|
||||||
import eu.eudat.models.user.composite.DatasetProfile;
|
import eu.eudat.models.properties.PropertiesModel;
|
||||||
import eu.eudat.models.user.composite.PagedDatasetProfile;
|
import eu.eudat.models.user.composite.PagedDatasetProfile;
|
||||||
import eu.eudat.services.ApiContext;
|
import eu.eudat.services.ApiContext;
|
||||||
import eu.eudat.types.ApiMessageCode;
|
import eu.eudat.types.ApiMessageCode;
|
||||||
|
@ -17,16 +13,13 @@ 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;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import eu.eudat.managers.UserManager;
|
import java.net.HttpURLConnection;
|
||||||
import eu.eudat.models.helpers.common.AutoCompleteLookupItem;
|
import java.net.URL;
|
||||||
import eu.eudat.models.properties.PropertiesModel;
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@CrossOrigin
|
@CrossOrigin
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
package eu.eudat.controllers;
|
package eu.eudat.controllers;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import eu.eudat.managers.DatasetProfileManager;
|
import eu.eudat.managers.DatasetProfileManager;
|
||||||
import eu.eudat.models.datasetprofile.DatasetProfileAutocompleteItem;
|
import eu.eudat.models.datasetprofile.DatasetProfileAutocompleteItem;
|
||||||
import eu.eudat.models.datasetprofile.DatasetProfileAutocompleteRequest;
|
import eu.eudat.models.datasetprofile.DatasetProfileAutocompleteRequest;
|
||||||
|
@ -14,12 +12,9 @@ import eu.eudat.types.ApiMessageCode;
|
||||||
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;
|
||||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import java.util.List;
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
|
@ -47,7 +42,7 @@ public class DatasetProfiles extends BaseController {
|
||||||
public @ResponseBody
|
public @ResponseBody
|
||||||
ResponseEntity<ResponseItem<DataTableData<DatasetProfileListingModel>>> getPaged(@RequestBody DatasetProfileTableRequestItem datasetProfileTableRequestItem) {
|
ResponseEntity<ResponseItem<DataTableData<DatasetProfileListingModel>>> getPaged(@RequestBody DatasetProfileTableRequestItem datasetProfileTableRequestItem) {
|
||||||
try {
|
try {
|
||||||
DataTableData<DatasetProfileListingModel> datasetProfileTableData = DatasetProfileManager.getPaged(this.getApiContext().getDatabaseRepository().getDatasetProfileDao(), datasetProfileTableRequestItem);
|
DataTableData<DatasetProfileListingModel> datasetProfileTableData = DatasetProfileManager.getPaged(this.getApiContext(), datasetProfileTableRequestItem);
|
||||||
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<DataTableData<DatasetProfileListingModel>>().status(ApiMessageCode.NO_MESSAGE).payload(datasetProfileTableData));
|
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<DataTableData<DatasetProfileListingModel>>().status(ApiMessageCode.NO_MESSAGE).payload(datasetProfileTableData));
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new ResponseItem<DataTableData<DatasetProfileListingModel>>().status(ApiMessageCode.DEFAULT_ERROR_MESSAGE));
|
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new ResponseItem<DataTableData<DatasetProfileListingModel>>().status(ApiMessageCode.DEFAULT_ERROR_MESSAGE));
|
||||||
|
|
|
@ -1,13 +1,10 @@
|
||||||
package eu.eudat.controllers;
|
package eu.eudat.controllers;
|
||||||
|
|
||||||
import java.util.Locale;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
import eu.eudat.entities.Dataset;
|
import eu.eudat.entities.Dataset;
|
||||||
import eu.eudat.managers.DatasetManager;
|
import eu.eudat.managers.DatasetManager;
|
||||||
import eu.eudat.models.dataset.DatasetTableRequest;
|
import eu.eudat.models.dataset.DatasetTableRequest;
|
||||||
import eu.eudat.models.helpers.common.DataTableData;
|
import eu.eudat.models.helpers.common.DataTableData;
|
||||||
import eu.eudat.models.helpers.responses.*;
|
import eu.eudat.models.helpers.responses.ResponseItem;
|
||||||
import eu.eudat.models.listingmodels.DatasetListingModel;
|
import eu.eudat.models.listingmodels.DatasetListingModel;
|
||||||
import eu.eudat.models.security.Principal;
|
import eu.eudat.models.security.Principal;
|
||||||
import eu.eudat.services.ApiContext;
|
import eu.eudat.services.ApiContext;
|
||||||
|
@ -16,13 +13,10 @@ 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;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import java.util.Locale;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import java.util.UUID;
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
|
|
|
@ -20,7 +20,7 @@ import java.util.UUID;
|
||||||
@RestController
|
@RestController
|
||||||
@CrossOrigin
|
@CrossOrigin
|
||||||
@RequestMapping(value = {"/api"})
|
@RequestMapping(value = {"/api"})
|
||||||
public class ExternalDatasets extends BaseController{
|
public class ExternalDatasets extends BaseController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public ExternalDatasets(ApiContext apiContext) {
|
public ExternalDatasets(ApiContext apiContext) {
|
||||||
|
@ -28,9 +28,10 @@ public class ExternalDatasets extends BaseController{
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(method = RequestMethod.POST, value = {"/externaldatasets/getPaged"}, consumes = "application/json", produces = "application/json")
|
@RequestMapping(method = RequestMethod.POST, value = {"/externaldatasets/getPaged"}, consumes = "application/json", produces = "application/json")
|
||||||
public @ResponseBody ResponseEntity<ResponseItem<DataTableData<ExternalDatasetListingModel>>> getPaged(@RequestBody ExternalDatasetTableRequest datasetTableRequest, Principal principal) {
|
public @ResponseBody
|
||||||
|
ResponseEntity<ResponseItem<DataTableData<ExternalDatasetListingModel>>> getPaged(@RequestBody ExternalDatasetTableRequest datasetTableRequest, Principal principal) {
|
||||||
try {
|
try {
|
||||||
DataTableData<ExternalDatasetListingModel> dataTable = new ExternalDatasetManager().getPaged(this.getApiContext().getDatabaseRepository().getExternalDatasetDao(), datasetTableRequest);
|
DataTableData<ExternalDatasetListingModel> dataTable = new ExternalDatasetManager().getPaged(this.getApiContext(), datasetTableRequest);
|
||||||
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<DataTableData<ExternalDatasetListingModel>>().status(ApiMessageCode.NO_MESSAGE).payload(dataTable));
|
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<DataTableData<ExternalDatasetListingModel>>().status(ApiMessageCode.NO_MESSAGE).payload(dataTable));
|
||||||
|
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
|
@ -40,9 +41,10 @@ public class ExternalDatasets extends BaseController{
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(method = RequestMethod.GET, value = {"/external/datasets"}, produces = "application/json")
|
@RequestMapping(method = RequestMethod.GET, value = {"/external/datasets"}, produces = "application/json")
|
||||||
public @ResponseBody ResponseEntity<ResponseItem<List<ExternalDatasetListingModel>>> getWithExternal(@RequestParam(value = "query", required = false) String query, Principal principal) {
|
public @ResponseBody
|
||||||
|
ResponseEntity<ResponseItem<List<ExternalDatasetListingModel>>> getWithExternal(@RequestParam(value = "query", required = false) String query, Principal principal) {
|
||||||
try {
|
try {
|
||||||
List<ExternalDatasetListingModel> dataTable = new ExternalDatasetManager().getWithExternal(this.getApiContext().getDatabaseRepository().getExternalDatasetDao(), query, this.getApiContext().getRemoteFetcher());
|
List<ExternalDatasetListingModel> dataTable = new ExternalDatasetManager().getWithExternal(this.getApiContext(), query, this.getApiContext().getRemoteFetcher());
|
||||||
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<List<ExternalDatasetListingModel>>().payload(dataTable).status(ApiMessageCode.NO_MESSAGE));
|
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<List<ExternalDatasetListingModel>>().payload(dataTable).status(ApiMessageCode.NO_MESSAGE));
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
|
@ -51,10 +53,11 @@ public class ExternalDatasets extends BaseController{
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(method = RequestMethod.POST, value = {"/externaldatasets/getSingle/{id}"}, consumes = "application/json", produces = "application/json")
|
@RequestMapping(method = RequestMethod.POST, value = {"/externaldatasets/getSingle/{id}"}, consumes = "application/json", produces = "application/json")
|
||||||
public @ResponseBody ResponseItem<ExternalDatasetListingModel> getWithExternal(@PathVariable UUID id, Principal principal) {
|
public @ResponseBody
|
||||||
|
ResponseItem<ExternalDatasetListingModel> getWithExternal(@PathVariable UUID id, Principal principal) {
|
||||||
try {
|
try {
|
||||||
ExternalDatasetListingModel externalDatasetModel = new ExternalDatasetManager().getSingle(this.getApiContext().getDatabaseRepository().getExternalDatasetDao(), id);
|
ExternalDatasetListingModel externalDatasetModel = new ExternalDatasetManager().getSingle(this.getApiContext().getDatabaseRepository().getExternalDatasetDao(), id);
|
||||||
return new ResponseItem<ExternalDatasetListingModel>().payload(externalDatasetModel ).status(ApiMessageCode.NO_MESSAGE);
|
return new ResponseItem<ExternalDatasetListingModel>().payload(externalDatasetModel).status(ApiMessageCode.NO_MESSAGE);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
return new ResponseItem<ExternalDatasetListingModel>().status(ApiMessageCode.DEFAULT_ERROR_MESSAGE).message(ex.getMessage());
|
return new ResponseItem<ExternalDatasetListingModel>().status(ApiMessageCode.DEFAULT_ERROR_MESSAGE).message(ex.getMessage());
|
||||||
|
|
|
@ -2,8 +2,8 @@ package eu.eudat.controllers;
|
||||||
|
|
||||||
import eu.eudat.exceptions.security.UnauthorisedException;
|
import eu.eudat.exceptions.security.UnauthorisedException;
|
||||||
import eu.eudat.managers.UserManager;
|
import eu.eudat.managers.UserManager;
|
||||||
import eu.eudat.models.login.Credentials;
|
|
||||||
import eu.eudat.models.helpers.responses.ResponseItem;
|
import eu.eudat.models.helpers.responses.ResponseItem;
|
||||||
|
import eu.eudat.models.login.Credentials;
|
||||||
import eu.eudat.models.login.LoginInfo;
|
import eu.eudat.models.login.LoginInfo;
|
||||||
import eu.eudat.models.security.Principal;
|
import eu.eudat.models.security.Principal;
|
||||||
import eu.eudat.security.CustomAuthenticationProvider;
|
import eu.eudat.security.CustomAuthenticationProvider;
|
||||||
|
|
|
@ -1,52 +1,45 @@
|
||||||
package eu.eudat.controllers;
|
package eu.eudat.controllers;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import eu.eudat.models.external.OrganisationsExternalSourcesModel;
|
import eu.eudat.models.external.OrganisationsExternalSourcesModel;
|
||||||
import eu.eudat.models.helpers.responses.ResponseItem;
|
import eu.eudat.models.helpers.responses.ResponseItem;
|
||||||
|
import eu.eudat.proxy.config.exceptions.HugeResultSet;
|
||||||
|
import eu.eudat.proxy.config.exceptions.NoURLFound;
|
||||||
import eu.eudat.services.ApiContext;
|
import eu.eudat.services.ApiContext;
|
||||||
import eu.eudat.types.ApiMessageCode;
|
import eu.eudat.types.ApiMessageCode;
|
||||||
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;
|
||||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import eu.eudat.proxy.config.exceptions.HugeResultSet;
|
import java.util.List;
|
||||||
import eu.eudat.proxy.config.exceptions.NoURLFound;
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@CrossOrigin
|
@CrossOrigin
|
||||||
@RequestMapping(value = {"/api"})
|
@RequestMapping(value = {"/api"})
|
||||||
public class Organisations extends BaseController{
|
public class Organisations extends BaseController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public Organisations(ApiContext apiContext) {
|
public Organisations(ApiContext apiContext) {
|
||||||
super(apiContext);
|
super(apiContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(method = RequestMethod.GET, value = { "/external/organisations" }, produces="application/json")
|
@RequestMapping(method = RequestMethod.GET, value = {"/external/organisations"}, produces = "application/json")
|
||||||
public @ResponseBody ResponseEntity<ResponseItem<OrganisationsExternalSourcesModel>> listExternalOrganisations(@RequestParam(value="query", required=false) String query ){
|
public @ResponseBody
|
||||||
try {
|
ResponseEntity<ResponseItem<OrganisationsExternalSourcesModel>> listExternalOrganisations(@RequestParam(value = "query", required = false) String query) {
|
||||||
List<Map<String,String>> remoteRepos = this.getApiContext().getRemoteFetcher().getOrganisations(query);
|
try {
|
||||||
OrganisationsExternalSourcesModel projectsExternalSourcesModel = new OrganisationsExternalSourcesModel().fromExternalItem(remoteRepos);
|
List<Map<String, String>> remoteRepos = this.getApiContext().getRemoteFetcher().getOrganisations(query);
|
||||||
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<OrganisationsExternalSourcesModel>().payload(projectsExternalSourcesModel).status(ApiMessageCode.SUCCESS_MESSAGE));
|
OrganisationsExternalSourcesModel projectsExternalSourcesModel = new OrganisationsExternalSourcesModel().fromExternalItem(remoteRepos);
|
||||||
}
|
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<OrganisationsExternalSourcesModel>().payload(projectsExternalSourcesModel).status(ApiMessageCode.SUCCESS_MESSAGE));
|
||||||
catch(NoURLFound ex) {
|
} catch (NoURLFound ex) {
|
||||||
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new ResponseItem<OrganisationsExternalSourcesModel>().status(ApiMessageCode.ERROR_MESSAGE).message("External Url Not Found"));
|
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new ResponseItem<OrganisationsExternalSourcesModel>().status(ApiMessageCode.ERROR_MESSAGE).message("External Url Not Found"));
|
||||||
}
|
} catch (HugeResultSet ex) {
|
||||||
catch(HugeResultSet ex) {
|
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new ResponseItem<OrganisationsExternalSourcesModel>().status(ApiMessageCode.ERROR_MESSAGE).message("Huge Result Set"));
|
||||||
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new ResponseItem<OrganisationsExternalSourcesModel>().status(ApiMessageCode.ERROR_MESSAGE).message("Huge Result Set"));
|
} catch (Exception ex) {
|
||||||
}catch (Exception ex){
|
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new ResponseItem<OrganisationsExternalSourcesModel>().status(ApiMessageCode.ERROR_MESSAGE).message(ex.getMessage()));
|
||||||
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new ResponseItem<OrganisationsExternalSourcesModel>().status(ApiMessageCode.ERROR_MESSAGE).message(ex.getMessage()));
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,41 +1,27 @@
|
||||||
package eu.eudat.controllers;
|
package eu.eudat.controllers;
|
||||||
|
|
||||||
import java.util.List;
|
import eu.eudat.entities.Project;
|
||||||
import java.util.Map;
|
import eu.eudat.managers.ProjectManager;
|
||||||
|
|
||||||
import javax.transaction.Transactional;
|
|
||||||
import javax.validation.Valid;
|
|
||||||
|
|
||||||
import eu.eudat.models.external.ProjectsExternalSourcesModel;
|
import eu.eudat.models.external.ProjectsExternalSourcesModel;
|
||||||
import eu.eudat.models.helpers.responses.*;
|
import eu.eudat.models.helpers.common.DataTableData;
|
||||||
|
import eu.eudat.models.helpers.responses.ResponseItem;
|
||||||
import eu.eudat.models.project.ProjectCriteriaRequest;
|
import eu.eudat.models.project.ProjectCriteriaRequest;
|
||||||
import eu.eudat.models.project.ProjectListingModel;
|
import eu.eudat.models.project.ProjectListingModel;
|
||||||
|
import eu.eudat.models.project.ProjectTableRequest;
|
||||||
import eu.eudat.models.security.Principal;
|
import eu.eudat.models.security.Principal;
|
||||||
import eu.eudat.security.claims.ClaimedAuthorities;
|
import eu.eudat.proxy.config.exceptions.HugeResultSet;
|
||||||
|
import eu.eudat.proxy.config.exceptions.NoURLFound;
|
||||||
import eu.eudat.services.ApiContext;
|
import eu.eudat.services.ApiContext;
|
||||||
import eu.eudat.types.ApiMessageCode;
|
import eu.eudat.types.ApiMessageCode;
|
||||||
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;
|
||||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import eu.eudat.entities.Project;
|
import javax.transaction.Transactional;
|
||||||
|
import javax.validation.Valid;
|
||||||
import eu.eudat.managers.ProjectManager;
|
import java.util.List;
|
||||||
import eu.eudat.models.helpers.common.DataTableData;
|
import java.util.Map;
|
||||||
import eu.eudat.models.project.ProjectTableRequest;
|
|
||||||
import eu.eudat.proxy.config.exceptions.HugeResultSet;
|
|
||||||
import eu.eudat.proxy.config.exceptions.NoURLFound;
|
|
||||||
|
|
||||||
import static eu.eudat.types.Authorities.ADMIN;
|
|
||||||
import static eu.eudat.types.Authorities.USER;
|
|
||||||
|
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
|
@ -104,7 +90,7 @@ public class Projects extends BaseController {
|
||||||
public @ResponseBody
|
public @ResponseBody
|
||||||
ResponseEntity<ResponseItem<List<eu.eudat.models.project.Project>>> getWithExternal(@RequestBody ProjectCriteriaRequest projectCriteria, Principal principal) {
|
ResponseEntity<ResponseItem<List<eu.eudat.models.project.Project>>> getWithExternal(@RequestBody ProjectCriteriaRequest projectCriteria, Principal principal) {
|
||||||
try {
|
try {
|
||||||
List<eu.eudat.models.project.Project> dataTable = new ProjectManager().getCriteriaWithExternal(this.getApiContext().getDatabaseRepository().getProjectDao(), projectCriteria, this.getApiContext().getRemoteFetcher());
|
List<eu.eudat.models.project.Project> dataTable = new ProjectManager().getCriteriaWithExternal(this.getApiContext(), projectCriteria, this.getApiContext().getRemoteFetcher());
|
||||||
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<List<eu.eudat.models.project.Project>>().payload(dataTable).status(ApiMessageCode.NO_MESSAGE));
|
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<List<eu.eudat.models.project.Project>>().payload(dataTable).status(ApiMessageCode.NO_MESSAGE));
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
|
|
|
@ -1,55 +1,48 @@
|
||||||
package eu.eudat.controllers;
|
package eu.eudat.controllers;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import eu.eudat.models.external.RegistriesExternalSourcesModel;
|
import eu.eudat.models.external.RegistriesExternalSourcesModel;
|
||||||
import eu.eudat.models.helpers.responses.ResponseItem;
|
import eu.eudat.models.helpers.responses.ResponseItem;
|
||||||
|
import eu.eudat.proxy.config.exceptions.HugeResultSet;
|
||||||
|
import eu.eudat.proxy.config.exceptions.NoURLFound;
|
||||||
import eu.eudat.services.ApiContext;
|
import eu.eudat.services.ApiContext;
|
||||||
import eu.eudat.types.ApiMessageCode;
|
import eu.eudat.types.ApiMessageCode;
|
||||||
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;
|
||||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import eu.eudat.proxy.config.exceptions.HugeResultSet;
|
import java.util.List;
|
||||||
import eu.eudat.proxy.config.exceptions.NoURLFound;
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@CrossOrigin
|
@CrossOrigin
|
||||||
@RequestMapping(value = {"/api"})
|
@RequestMapping(value = {"/api"})
|
||||||
public class Registries extends BaseController{
|
public class Registries extends BaseController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public Registries(ApiContext apiContext) {
|
public Registries(ApiContext apiContext) {
|
||||||
super(apiContext);
|
super(apiContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequestMapping(method = RequestMethod.GET, value = {"/external/registries"}, produces = "application/json")
|
||||||
|
public @ResponseBody
|
||||||
|
ResponseEntity<ResponseItem<RegistriesExternalSourcesModel>> listExternalRegistries(@RequestParam(value = "query", required = false) String query) {
|
||||||
|
try {
|
||||||
|
List<Map<String, String>> remoteRepos = this.getApiContext().getRemoteFetcher().getRegistries(query);
|
||||||
|
RegistriesExternalSourcesModel registriesExternalSourcesModel = new RegistriesExternalSourcesModel().fromExternalItem(remoteRepos);
|
||||||
|
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<RegistriesExternalSourcesModel>().payload(registriesExternalSourcesModel).status(ApiMessageCode.NO_MESSAGE));
|
||||||
|
} catch (NoURLFound ex) {
|
||||||
|
ex.printStackTrace();
|
||||||
|
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new ResponseItem<RegistriesExternalSourcesModel>().status(ApiMessageCode.ERROR_MESSAGE).message("External Url Not Found"));
|
||||||
|
} catch (HugeResultSet ex) {
|
||||||
|
ex.printStackTrace();
|
||||||
|
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new ResponseItem<RegistriesExternalSourcesModel>().status(ApiMessageCode.ERROR_MESSAGE).message("Huge Result Set"));
|
||||||
|
} catch (Exception ex) {
|
||||||
|
ex.printStackTrace();
|
||||||
|
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new ResponseItem<RegistriesExternalSourcesModel>().status(ApiMessageCode.ERROR_MESSAGE).message(ex.getMessage()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@RequestMapping(method = RequestMethod.GET, value = { "/external/registries" }, produces="application/json")
|
|
||||||
public @ResponseBody ResponseEntity<ResponseItem<RegistriesExternalSourcesModel>> listExternalRegistries(@RequestParam(value="query", required=false) String query ){
|
|
||||||
try {
|
|
||||||
List<Map<String,String>> remoteRepos = this.getApiContext().getRemoteFetcher().getRegistries(query);
|
|
||||||
RegistriesExternalSourcesModel registriesExternalSourcesModel = new RegistriesExternalSourcesModel().fromExternalItem(remoteRepos);
|
|
||||||
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<RegistriesExternalSourcesModel>().payload(registriesExternalSourcesModel).status(ApiMessageCode.NO_MESSAGE));
|
|
||||||
}
|
|
||||||
catch(NoURLFound ex) {
|
|
||||||
ex.printStackTrace();
|
|
||||||
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new ResponseItem<RegistriesExternalSourcesModel>().status(ApiMessageCode.ERROR_MESSAGE).message("External Url Not Found"));
|
|
||||||
}
|
|
||||||
catch(HugeResultSet ex) {
|
|
||||||
ex.printStackTrace();
|
|
||||||
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new ResponseItem<RegistriesExternalSourcesModel>().status(ApiMessageCode.ERROR_MESSAGE).message("Huge Result Set"));
|
|
||||||
}catch (Exception ex){
|
|
||||||
ex.printStackTrace();
|
|
||||||
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new ResponseItem<RegistriesExternalSourcesModel>().status(ApiMessageCode.ERROR_MESSAGE).message(ex.getMessage()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,13 @@
|
||||||
package eu.eudat.controllers;
|
package eu.eudat.controllers;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import eu.eudat.exceptions.security.UnauthorisedException;
|
import eu.eudat.exceptions.security.UnauthorisedException;
|
||||||
import eu.eudat.managers.ResearcherManager;
|
import eu.eudat.managers.ResearcherManager;
|
||||||
import eu.eudat.models.dmp.Researcher;
|
import eu.eudat.models.dmp.Researcher;
|
||||||
import eu.eudat.models.external.ResearchersExternalSourcesModel;
|
import eu.eudat.models.external.ResearchersExternalSourcesModel;
|
||||||
import eu.eudat.models.helpers.responses.ResponseItem;
|
import eu.eudat.models.helpers.responses.ResponseItem;
|
||||||
import eu.eudat.models.security.Principal;
|
import eu.eudat.models.security.Principal;
|
||||||
|
import eu.eudat.proxy.config.exceptions.HugeResultSet;
|
||||||
|
import eu.eudat.proxy.config.exceptions.NoURLFound;
|
||||||
import eu.eudat.services.ApiContext;
|
import eu.eudat.services.ApiContext;
|
||||||
import eu.eudat.types.ApiMessageCode;
|
import eu.eudat.types.ApiMessageCode;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
@ -17,53 +16,52 @@ 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 eu.eudat.proxy.config.exceptions.HugeResultSet;
|
import java.util.List;
|
||||||
import eu.eudat.proxy.config.exceptions.NoURLFound;
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@CrossOrigin
|
@CrossOrigin
|
||||||
@RequestMapping(value = {"/api"})
|
@RequestMapping(value = {"/api"})
|
||||||
|
|
||||||
public class Researchers extends BaseController{
|
public class Researchers extends BaseController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public Researchers(ApiContext apiContext) {
|
public Researchers(ApiContext apiContext) {
|
||||||
super(apiContext);
|
super(apiContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(method = RequestMethod.GET, value = { "/external/researchers" }, produces="application/json")
|
@RequestMapping(method = RequestMethod.GET, value = {"/external/researchers"}, produces = "application/json")
|
||||||
public @ResponseBody ResponseEntity<ResponseItem<ResearchersExternalSourcesModel>> listExternalResearchers(@RequestParam(value="query", required=false) String query ){
|
public @ResponseBody
|
||||||
try {
|
ResponseEntity<ResponseItem<ResearchersExternalSourcesModel>> listExternalResearchers(@RequestParam(value = "query", required = false) String query) {
|
||||||
List<Map<String,String>> remoteRepos = this.getApiContext().getRemoteFetcher().getResearchers(query);
|
try {
|
||||||
ResearchersExternalSourcesModel researchersExternalSourcesModel = new ResearchersExternalSourcesModel().fromExternalItem(remoteRepos);
|
List<Map<String, String>> remoteRepos = this.getApiContext().getRemoteFetcher().getResearchers(query);
|
||||||
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<ResearchersExternalSourcesModel>().payload(researchersExternalSourcesModel).status(ApiMessageCode.NO_MESSAGE));
|
ResearchersExternalSourcesModel researchersExternalSourcesModel = new ResearchersExternalSourcesModel().fromExternalItem(remoteRepos);
|
||||||
}
|
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<ResearchersExternalSourcesModel>().payload(researchersExternalSourcesModel).status(ApiMessageCode.NO_MESSAGE));
|
||||||
catch(NoURLFound ex) {
|
} catch (NoURLFound ex) {
|
||||||
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new ResponseItem<ResearchersExternalSourcesModel>().status(ApiMessageCode.ERROR_MESSAGE).message("External Url Not Found"));
|
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new ResponseItem<ResearchersExternalSourcesModel>().status(ApiMessageCode.ERROR_MESSAGE).message("External Url Not Found"));
|
||||||
}
|
} catch (HugeResultSet ex) {
|
||||||
catch(HugeResultSet ex) {
|
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new ResponseItem<ResearchersExternalSourcesModel>().status(ApiMessageCode.ERROR_MESSAGE).message("Huge Result Set"));
|
||||||
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new ResponseItem<ResearchersExternalSourcesModel>().status(ApiMessageCode.ERROR_MESSAGE).message("Huge Result Set"));
|
} catch (Exception ex) {
|
||||||
}catch (Exception ex){
|
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new ResponseItem<ResearchersExternalSourcesModel>().status(ApiMessageCode.ERROR_MESSAGE).message(ex.getMessage()));
|
||||||
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new ResponseItem<ResearchersExternalSourcesModel>().status(ApiMessageCode.ERROR_MESSAGE).message(ex.getMessage()));
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@RequestMapping(method = RequestMethod.POST, value = { "/researchers/create" }, consumes = "application/json",produces="application/json")
|
@RequestMapping(method = RequestMethod.POST, value = {"/researchers/create"}, consumes = "application/json", produces = "application/json")
|
||||||
public @ResponseBody ResponseEntity<ResponseItem<Researcher>> create(@RequestBody eu.eudat.models.researcher.Researcher researcher, Principal principal) {
|
public @ResponseBody
|
||||||
try {
|
ResponseEntity<ResponseItem<Researcher>> create(@RequestBody eu.eudat.models.researcher.Researcher researcher, Principal principal) {
|
||||||
ResearcherManager.create(this.getApiContext(),researcher);
|
try {
|
||||||
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<Researcher>().status(ApiMessageCode.SUCCESS_MESSAGE));
|
ResearcherManager.create(this.getApiContext(), researcher);
|
||||||
}catch (UnauthorisedException e){
|
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<Researcher>().status(ApiMessageCode.SUCCESS_MESSAGE));
|
||||||
e.printStackTrace();
|
} catch (UnauthorisedException e) {
|
||||||
throw e;
|
e.printStackTrace();
|
||||||
}
|
throw e;
|
||||||
catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new ResponseItem<Researcher>().status(ApiMessageCode.SUCCESS_MESSAGE).message(e.getMessage()));
|
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new ResponseItem<Researcher>().status(ApiMessageCode.SUCCESS_MESSAGE).message(e.getMessage()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,52 +1,45 @@
|
||||||
package eu.eudat.controllers;
|
package eu.eudat.controllers;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import eu.eudat.models.external.ServiceExternalSourcesModel;
|
import eu.eudat.models.external.ServiceExternalSourcesModel;
|
||||||
import eu.eudat.models.helpers.responses.ResponseItem;
|
import eu.eudat.models.helpers.responses.ResponseItem;
|
||||||
|
import eu.eudat.proxy.config.exceptions.HugeResultSet;
|
||||||
|
import eu.eudat.proxy.config.exceptions.NoURLFound;
|
||||||
import eu.eudat.services.ApiContext;
|
import eu.eudat.services.ApiContext;
|
||||||
import eu.eudat.types.ApiMessageCode;
|
import eu.eudat.types.ApiMessageCode;
|
||||||
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;
|
||||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import eu.eudat.proxy.config.exceptions.HugeResultSet;
|
import java.util.List;
|
||||||
import eu.eudat.proxy.config.exceptions.NoURLFound;
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@CrossOrigin
|
@CrossOrigin
|
||||||
@RequestMapping(value = {"/api"})
|
@RequestMapping(value = {"/api"})
|
||||||
public class Services extends BaseController{
|
public class Services extends BaseController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public Services(ApiContext apiContext) {
|
public Services(ApiContext apiContext) {
|
||||||
super(apiContext);
|
super(apiContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(method = RequestMethod.GET, value = { "/external/services" }, produces="application/json")
|
@RequestMapping(method = RequestMethod.GET, value = {"/external/services"}, produces = "application/json")
|
||||||
public @ResponseBody ResponseEntity<ResponseItem<ServiceExternalSourcesModel>> listExternalServices(@RequestParam(value="query", required=false) String query ){
|
public @ResponseBody
|
||||||
try {
|
ResponseEntity<ResponseItem<ServiceExternalSourcesModel>> listExternalServices(@RequestParam(value = "query", required = false) String query) {
|
||||||
List<Map<String,String>> remoteRepos = this.getApiContext().getRemoteFetcher().getServices(query);
|
try {
|
||||||
ServiceExternalSourcesModel serviceExternalSourcesModel = new ServiceExternalSourcesModel().fromExternalItem(remoteRepos);
|
List<Map<String, String>> remoteRepos = this.getApiContext().getRemoteFetcher().getServices(query);
|
||||||
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<ServiceExternalSourcesModel>().payload(serviceExternalSourcesModel).status(ApiMessageCode.NO_MESSAGE));
|
ServiceExternalSourcesModel serviceExternalSourcesModel = new ServiceExternalSourcesModel().fromExternalItem(remoteRepos);
|
||||||
}
|
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<ServiceExternalSourcesModel>().payload(serviceExternalSourcesModel).status(ApiMessageCode.NO_MESSAGE));
|
||||||
catch(NoURLFound ex) {
|
} catch (NoURLFound ex) {
|
||||||
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new ResponseItem<ServiceExternalSourcesModel>().status(ApiMessageCode.ERROR_MESSAGE).message("External Url Not Found"));
|
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new ResponseItem<ServiceExternalSourcesModel>().status(ApiMessageCode.ERROR_MESSAGE).message("External Url Not Found"));
|
||||||
}
|
} catch (HugeResultSet ex) {
|
||||||
catch(HugeResultSet ex) {
|
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new ResponseItem<ServiceExternalSourcesModel>().status(ApiMessageCode.ERROR_MESSAGE).message("Huge Result Set"));
|
||||||
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new ResponseItem<ServiceExternalSourcesModel>().status(ApiMessageCode.ERROR_MESSAGE).message("Huge Result Set"));
|
} catch (Exception ex) {
|
||||||
}catch (Exception ex){
|
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new ResponseItem<ServiceExternalSourcesModel>().status(ApiMessageCode.ERROR_MESSAGE).message(ex.getMessage()));
|
||||||
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new ResponseItem<ServiceExternalSourcesModel>().status(ApiMessageCode.ERROR_MESSAGE).message(ex.getMessage()));
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ import java.util.UUID;
|
||||||
@RequestMapping("api/invite/")
|
@RequestMapping("api/invite/")
|
||||||
@RestController
|
@RestController
|
||||||
@CrossOrigin
|
@CrossOrigin
|
||||||
public class UserInvitationController extends BaseController{
|
public class UserInvitationController extends BaseController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public UserInvitationController(ApiContext apiContext) {
|
public UserInvitationController(ApiContext apiContext) {
|
||||||
|
@ -30,10 +30,11 @@ public class UserInvitationController extends BaseController{
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@RequestMapping(method = RequestMethod.POST, value = { "/users" }, consumes = "application/json", produces="application/json")
|
@RequestMapping(method = RequestMethod.POST, value = {"/users"}, consumes = "application/json", produces = "application/json")
|
||||||
public @ResponseBody ResponseEntity<ResponseItem<Invitation>> users(@RequestBody Invitation invitation, Principal principal) {
|
public @ResponseBody
|
||||||
|
ResponseEntity<ResponseItem<Invitation>> users(@RequestBody Invitation invitation, Principal principal) {
|
||||||
try {
|
try {
|
||||||
InvitationsManager.inviteUsers(this.getApiContext(),invitation,principal);
|
InvitationsManager.inviteUsers(this.getApiContext(), invitation, principal);
|
||||||
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<Invitation>().status(ApiMessageCode.SUCCESS_MESSAGE).message("Users have beeen invited"));
|
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<Invitation>().status(ApiMessageCode.SUCCESS_MESSAGE).message("Users have beeen invited"));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
@ -42,25 +43,26 @@ public class UserInvitationController extends BaseController{
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@RequestMapping(method = RequestMethod.GET, value = { "/exchange/{invitationID}" }, produces="application/json")
|
@RequestMapping(method = RequestMethod.GET, value = {"/exchange/{invitationID}"}, produces = "application/json")
|
||||||
public @ResponseBody ResponseEntity<ResponseItem<UUID>> exchange(@PathVariable UUID invitationID, Principal principal) {
|
public @ResponseBody
|
||||||
|
ResponseEntity<ResponseItem<UUID>> exchange(@PathVariable UUID invitationID, Principal principal) {
|
||||||
try {
|
try {
|
||||||
UUID dmpId = InvitationsManager.assignUserAcceptedInvitation(this.getApiContext(),invitationID,principal);
|
UUID dmpId = InvitationsManager.assignUserAcceptedInvitation(this.getApiContext(), invitationID, principal);
|
||||||
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<UUID>().status(ApiMessageCode.SUCCESS_MESSAGE).payload(dmpId));
|
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<UUID>().status(ApiMessageCode.SUCCESS_MESSAGE).payload(dmpId));
|
||||||
}catch (UnauthorisedException e){
|
} catch (UnauthorisedException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
throw e;
|
throw e;
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new ResponseItem<UUID>().status(ApiMessageCode.SUCCESS_MESSAGE).message(e.getMessage()));
|
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new ResponseItem<UUID>().status(ApiMessageCode.SUCCESS_MESSAGE).message(e.getMessage()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(method = RequestMethod.POST, value = { "/getUsers" }, consumes = "application/json", produces="application/json")
|
@RequestMapping(method = RequestMethod.POST, value = {"/getUsers"}, consumes = "application/json", produces = "application/json")
|
||||||
public @ResponseBody ResponseEntity<ResponseItem<List<UserInfoInvitationModel>>> getUsers(@RequestBody UserInfoRequestItem userInfoRequestItem) {
|
public @ResponseBody
|
||||||
|
ResponseEntity<ResponseItem<List<UserInfoInvitationModel>>> getUsers(@RequestBody UserInfoRequestItem userInfoRequestItem) {
|
||||||
try {
|
try {
|
||||||
List<UserInfoInvitationModel> users = InvitationsManager.getUsers(this.getApiContext(),userInfoRequestItem);
|
List<UserInfoInvitationModel> users = InvitationsManager.getUsers(this.getApiContext(), 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));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|
|
@ -1,11 +1,8 @@
|
||||||
package eu.eudat.controllers;
|
package eu.eudat.controllers;
|
||||||
|
|
||||||
import eu.eudat.managers.ProjectManager;
|
|
||||||
import eu.eudat.managers.UserManager;
|
import eu.eudat.managers.UserManager;
|
||||||
import eu.eudat.models.helpers.common.DataTableData;
|
import eu.eudat.models.helpers.common.DataTableData;
|
||||||
import eu.eudat.models.helpers.responses.ResponseItem;
|
import eu.eudat.models.helpers.responses.ResponseItem;
|
||||||
import eu.eudat.models.project.ProjectListingModel;
|
|
||||||
import eu.eudat.models.project.ProjectTableRequest;
|
|
||||||
import eu.eudat.models.security.Principal;
|
import eu.eudat.models.security.Principal;
|
||||||
import eu.eudat.models.userinfo.UserInfoTableRequestItem;
|
import eu.eudat.models.userinfo.UserInfoTableRequestItem;
|
||||||
import eu.eudat.models.userinfo.UserListingModel;
|
import eu.eudat.models.userinfo.UserListingModel;
|
||||||
|
@ -21,7 +18,6 @@ import org.springframework.web.bind.annotation.*;
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
|
|
||||||
import static eu.eudat.types.Authorities.ADMIN;
|
import static eu.eudat.types.Authorities.ADMIN;
|
||||||
import static eu.eudat.types.Authorities.USER;
|
|
||||||
|
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
|
@ -38,7 +34,7 @@ public class Users extends BaseController {
|
||||||
public @ResponseBody
|
public @ResponseBody
|
||||||
ResponseEntity<ResponseItem<DataTableData<UserListingModel>>> getPaged(@Valid @RequestBody UserInfoTableRequestItem userInfoTableRequestItem, @ClaimedAuthorities(claims = {ADMIN}) Principal principal) {
|
ResponseEntity<ResponseItem<DataTableData<UserListingModel>>> getPaged(@Valid @RequestBody UserInfoTableRequestItem userInfoTableRequestItem, @ClaimedAuthorities(claims = {ADMIN}) Principal principal) {
|
||||||
try {
|
try {
|
||||||
DataTableData<UserListingModel> dataTable = UserManager.getPaged(this.getApiContext().getDatabaseRepository().getUserInfoDao(), userInfoTableRequestItem);
|
DataTableData<UserListingModel> dataTable = UserManager.getPaged(this.getApiContext(), userInfoTableRequestItem);
|
||||||
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<DataTableData<UserListingModel>>().payload(dataTable).status(ApiMessageCode.NO_MESSAGE));
|
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<DataTableData<UserListingModel>>().payload(dataTable).status(ApiMessageCode.NO_MESSAGE));
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
|
|
|
@ -40,7 +40,7 @@ public class ControllerErrorHandler {
|
||||||
private ValidationErrorContext processFieldErrors(List<FieldError> fieldErrors) {
|
private ValidationErrorContext processFieldErrors(List<FieldError> fieldErrors) {
|
||||||
ValidationErrorContext dto = new ValidationErrorContext();
|
ValidationErrorContext dto = new ValidationErrorContext();
|
||||||
|
|
||||||
for (FieldError fieldError: fieldErrors) {
|
for (FieldError fieldError : fieldErrors) {
|
||||||
String localizedErrorMessage = resolveLocalizedErrorMessage(fieldError);
|
String localizedErrorMessage = resolveLocalizedErrorMessage(fieldError);
|
||||||
dto.addFieldError(fieldError.getField(), localizedErrorMessage);
|
dto.addFieldError(fieldError.getField(), localizedErrorMessage);
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,7 @@ public class ControllerErrorHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
private String resolveLocalizedErrorMessage(FieldError fieldError) {
|
private String resolveLocalizedErrorMessage(FieldError fieldError) {
|
||||||
Locale currentLocale = LocaleContextHolder.getLocale();
|
Locale currentLocale = LocaleContextHolder.getLocale();
|
||||||
String localizedErrorMessage = messageSource.getMessage(fieldError, currentLocale);
|
String localizedErrorMessage = messageSource.getMessage(fieldError, currentLocale);
|
||||||
|
|
||||||
if (localizedErrorMessage.equals(fieldError.getDefaultMessage())) {
|
if (localizedErrorMessage.equals(fieldError.getDefaultMessage())) {
|
||||||
|
|
|
@ -7,12 +7,9 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import javax.persistence.*;
|
import javax.persistence.EntityManager;
|
||||||
import javax.persistence.criteria.CriteriaBuilder;
|
import javax.persistence.EntityManagerFactory;
|
||||||
import javax.persistence.criteria.CriteriaQuery;
|
import javax.persistence.PersistenceContext;
|
||||||
import javax.persistence.criteria.Root;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
|
|
||||||
@Repository("databaseCtx")
|
@Repository("databaseCtx")
|
||||||
|
@ -35,11 +32,11 @@ public class DatabaseContext<T extends DataEntity<T>> {
|
||||||
EntityManager entityManager = this.entityManager;
|
EntityManager entityManager = this.entityManager;
|
||||||
if (item.getKeys()[0] != null) {
|
if (item.getKeys()[0] != null) {
|
||||||
T oldItem = entityManager.find(type, item.getKeys()[0]);
|
T oldItem = entityManager.find(type, item.getKeys()[0]);
|
||||||
if(oldItem!=null) {
|
if (oldItem != null) {
|
||||||
oldItem.update(item);
|
oldItem.update(item);
|
||||||
entityManager.merge(oldItem);
|
entityManager.merge(oldItem);
|
||||||
return oldItem;
|
return oldItem;
|
||||||
}else {
|
} else {
|
||||||
entityManager.persist(item);
|
entityManager.persist(item);
|
||||||
}
|
}
|
||||||
} else entityManager.persist(item);
|
} else entityManager.persist(item);
|
||||||
|
@ -51,7 +48,7 @@ public class DatabaseContext<T extends DataEntity<T>> {
|
||||||
return ((Number) entityManager.createQuery("select count(e) from " + entityClass.getSimpleName() + " e").getSingleResult()).longValue();
|
return ((Number) entityManager.createQuery("select count(e) from " + entityClass.getSimpleName() + " e").getSingleResult()).longValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void delete(T item){
|
public void delete(T item) {
|
||||||
this.entityManager.remove(item);
|
this.entityManager.remove(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,10 +6,8 @@ import eu.eudat.entities.DataEntity;
|
||||||
import eu.eudat.queryable.QueryableList;
|
import eu.eudat.queryable.QueryableList;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
|
|
||||||
@Service("databaseService")
|
@Service("databaseService")
|
||||||
|
@ -26,19 +24,19 @@ public class DatabaseService<T extends DataEntity<T>> {
|
||||||
return this.databaseCtx.getQueryable(tClass);
|
return this.databaseCtx.getQueryable(tClass);
|
||||||
}
|
}
|
||||||
|
|
||||||
public QueryableList<T> getQueryable(Set<String> hints,Class<T> tClass) {
|
public QueryableList<T> getQueryable(Set<String> hints, Class<T> tClass) {
|
||||||
return this.databaseCtx.getQueryable(tClass).setHints(hints);
|
return this.databaseCtx.getQueryable(tClass).setHints(hints);
|
||||||
}
|
}
|
||||||
|
|
||||||
public T createOrUpdate(T item,Class<T> tClass) {
|
public T createOrUpdate(T item, Class<T> tClass) {
|
||||||
return this.databaseCtx.createOrUpdate(item, tClass);
|
return this.databaseCtx.createOrUpdate(item, tClass);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long count(Class<T> tClass){
|
public Long count(Class<T> tClass) {
|
||||||
return this.databaseCtx.count(tClass);
|
return this.databaseCtx.count(tClass);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void delete(T item){
|
public void delete(T item) {
|
||||||
this.databaseCtx.delete(item);
|
this.databaseCtx.delete(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
package eu.eudat.dao.entities;
|
package eu.eudat.dao.entities;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
import eu.eudat.dao.DatabaseAccessLayer;
|
import eu.eudat.dao.DatabaseAccessLayer;
|
||||||
import eu.eudat.entities.DMP;
|
import eu.eudat.entities.DMP;
|
||||||
import eu.eudat.entities.UserInfo;
|
import eu.eudat.entities.UserInfo;
|
||||||
|
@ -9,13 +7,15 @@ import eu.eudat.models.criteria.DataManagementPlanCriteria;
|
||||||
import eu.eudat.models.datasetwizard.DatasetWizardAutocompleteRequest;
|
import eu.eudat.models.datasetwizard.DatasetWizardAutocompleteRequest;
|
||||||
import eu.eudat.queryable.QueryableList;
|
import eu.eudat.queryable.QueryableList;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
public interface DMPDao extends DatabaseAccessLayer<DMP, UUID> {
|
public interface DMPDao extends DatabaseAccessLayer<DMP, UUID> {
|
||||||
|
|
||||||
QueryableList<DMP> getWithCriteria(DataManagementPlanCriteria criteria);
|
QueryableList<DMP> getWithCriteria(DataManagementPlanCriteria criteria);
|
||||||
|
|
||||||
QueryableList<DMP> getUserDmps(DatasetWizardAutocompleteRequest datasetWizardAutocompleteRequest, UserInfo userInfo);
|
QueryableList<DMP> getUserDmps(DatasetWizardAutocompleteRequest datasetWizardAutocompleteRequest, UserInfo userInfo);
|
||||||
|
|
||||||
QueryableList<DMP> getAuthenticated(QueryableList<DMP> query,UserInfo principal);
|
QueryableList<DMP> getAuthenticated(QueryableList<DMP> query, UserInfo principal);
|
||||||
|
|
||||||
Long count();
|
Long count();
|
||||||
}
|
}
|
|
@ -1,24 +1,20 @@
|
||||||
package eu.eudat.dao.entities;
|
package eu.eudat.dao.entities;
|
||||||
|
|
||||||
import java.lang.reflect.Array;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
import eu.eudat.dao.DatabaseAccess;
|
import eu.eudat.dao.DatabaseAccess;
|
||||||
import eu.eudat.dao.databaselayer.service.DatabaseService;
|
import eu.eudat.dao.databaselayer.service.DatabaseService;
|
||||||
import eu.eudat.entities.Dataset;
|
import eu.eudat.entities.DMP;
|
||||||
import eu.eudat.entities.DatasetProfile;
|
|
||||||
import eu.eudat.entities.UserInfo;
|
import eu.eudat.entities.UserInfo;
|
||||||
import eu.eudat.models.criteria.DataManagementPlanCriteria;
|
import eu.eudat.models.criteria.DataManagementPlanCriteria;
|
||||||
import eu.eudat.models.datasetwizard.DatasetWizardAutocompleteRequest;
|
import eu.eudat.models.datasetwizard.DatasetWizardAutocompleteRequest;
|
||||||
import eu.eudat.queryable.QueryableList;
|
import eu.eudat.queryable.QueryableList;
|
||||||
|
|
||||||
import eu.eudat.entities.DMP;
|
|
||||||
import eu.eudat.queryable.types.FieldSelectionType;
|
import eu.eudat.queryable.types.FieldSelectionType;
|
||||||
import eu.eudat.queryable.types.SelectionField;
|
import eu.eudat.queryable.types.SelectionField;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
@Component("dMPDao")
|
@Component("dMPDao")
|
||||||
public class DMPDaoImpl extends DatabaseAccess<DMP> implements DMPDao {
|
public class DMPDaoImpl extends DatabaseAccess<DMP> implements DMPDao {
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
package eu.eudat.dao.entities;
|
package eu.eudat.dao.entities;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
import eu.eudat.dao.DatabaseAccessLayer;
|
import eu.eudat.dao.DatabaseAccessLayer;
|
||||||
import eu.eudat.entities.DataRepository;
|
import eu.eudat.entities.DataRepository;
|
||||||
import eu.eudat.models.criteria.DataRepositoryCriteria;
|
import eu.eudat.models.criteria.DataRepositoryCriteria;
|
||||||
import eu.eudat.queryable.QueryableList;
|
import eu.eudat.queryable.QueryableList;
|
||||||
|
|
||||||
public interface DataRepositoryDao extends DatabaseAccessLayer<DataRepository,UUID> {
|
import java.util.UUID;
|
||||||
QueryableList<DataRepository> getWithCriteria(DataRepositoryCriteria criteria);
|
|
||||||
|
public interface DataRepositoryDao extends DatabaseAccessLayer<DataRepository, UUID> {
|
||||||
|
QueryableList<DataRepository> getWithCriteria(DataRepositoryCriteria criteria);
|
||||||
}
|
}
|
|
@ -1,16 +1,15 @@
|
||||||
package eu.eudat.dao.entities;
|
package eu.eudat.dao.entities;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
import eu.eudat.dao.DatabaseAccess;
|
import eu.eudat.dao.DatabaseAccess;
|
||||||
import eu.eudat.dao.databaselayer.service.DatabaseService;
|
import eu.eudat.dao.databaselayer.service.DatabaseService;
|
||||||
|
import eu.eudat.entities.DataRepository;
|
||||||
import eu.eudat.models.criteria.DataRepositoryCriteria;
|
import eu.eudat.models.criteria.DataRepositoryCriteria;
|
||||||
import eu.eudat.queryable.QueryableList;
|
import eu.eudat.queryable.QueryableList;
|
||||||
|
|
||||||
import eu.eudat.entities.DataRepository;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
@Component("dataRepositoryDao")
|
@Component("dataRepositoryDao")
|
||||||
public class DataRepositoryDaoImpl extends DatabaseAccess<DataRepository> implements DataRepositoryDao {
|
public class DataRepositoryDaoImpl extends DatabaseAccess<DataRepository> implements DataRepositoryDao {
|
||||||
|
|
||||||
|
|
|
@ -1,25 +1,23 @@
|
||||||
package eu.eudat.dao.entities;
|
package eu.eudat.dao.entities;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import java.util.concurrent.CompletableFuture;
|
|
||||||
|
|
||||||
import eu.eudat.dao.DatabaseAccessLayer;
|
import eu.eudat.dao.DatabaseAccessLayer;
|
||||||
import eu.eudat.entities.DataRepository;
|
|
||||||
import eu.eudat.entities.Dataset;
|
import eu.eudat.entities.Dataset;
|
||||||
import eu.eudat.entities.UserInfo;
|
import eu.eudat.entities.UserInfo;
|
||||||
import eu.eudat.models.criteria.DatasetCriteria;
|
import eu.eudat.models.criteria.DatasetCriteria;
|
||||||
import eu.eudat.queryable.QueryableList;
|
import eu.eudat.queryable.QueryableList;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
public interface DatasetDao extends DatabaseAccessLayer<Dataset,UUID> {
|
import java.util.UUID;
|
||||||
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
|
||||||
QueryableList<Dataset> getWithCriteria(DatasetCriteria criteria);
|
public interface DatasetDao extends DatabaseAccessLayer<Dataset, UUID> {
|
||||||
|
|
||||||
QueryableList<Dataset> getAuthenticated(QueryableList<Dataset> query, UserInfo principal);
|
QueryableList<Dataset> getWithCriteria(DatasetCriteria criteria);
|
||||||
|
|
||||||
CompletableFuture<Dataset> createOrUpdateAsync(Dataset item);
|
QueryableList<Dataset> getAuthenticated(QueryableList<Dataset> query, UserInfo principal);
|
||||||
|
|
||||||
Dataset find(UUID id,String hint);
|
CompletableFuture<Dataset> createOrUpdateAsync(Dataset item);
|
||||||
|
|
||||||
Long count();
|
Dataset find(UUID id, String hint);
|
||||||
|
|
||||||
|
Long count();
|
||||||
}
|
}
|
|
@ -1,21 +1,18 @@
|
||||||
package eu.eudat.dao.entities;
|
package eu.eudat.dao.entities;
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.UUID;
|
|
||||||
import java.util.concurrent.CompletableFuture;
|
|
||||||
|
|
||||||
import eu.eudat.dao.DatabaseAccess;
|
import eu.eudat.dao.DatabaseAccess;
|
||||||
import eu.eudat.dao.databaselayer.service.DatabaseService;
|
import eu.eudat.dao.databaselayer.service.DatabaseService;
|
||||||
import eu.eudat.entities.DataRepository;
|
|
||||||
import eu.eudat.entities.Dataset;
|
import eu.eudat.entities.Dataset;
|
||||||
import eu.eudat.entities.UserInfo;
|
import eu.eudat.entities.UserInfo;
|
||||||
import eu.eudat.models.criteria.DatasetCriteria;
|
import eu.eudat.models.criteria.DatasetCriteria;
|
||||||
import eu.eudat.queryable.QueryableList;
|
import eu.eudat.queryable.QueryableList;
|
||||||
import eu.eudat.queryable.types.FieldSelectionType;
|
import eu.eudat.queryable.types.FieldSelectionType;
|
||||||
import eu.eudat.queryable.types.SelectionField;
|
import eu.eudat.queryable.types.SelectionField;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.UUID;
|
||||||
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
|
||||||
@Component("datasetDao")
|
@Component("datasetDao")
|
||||||
public class DatasetDaoImpl extends DatabaseAccess<Dataset> implements DatasetDao {
|
public class DatasetDaoImpl extends DatabaseAccess<Dataset> implements DatasetDao {
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
package eu.eudat.dao.entities;
|
package eu.eudat.dao.entities;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
import eu.eudat.dao.DatabaseAccessLayer;
|
import eu.eudat.dao.DatabaseAccessLayer;
|
||||||
import eu.eudat.entities.DatasetProfile;
|
import eu.eudat.entities.DatasetProfile;
|
||||||
import eu.eudat.models.criteria.DatasetProfileCriteria;
|
import eu.eudat.models.criteria.DatasetProfileCriteria;
|
||||||
import eu.eudat.queryable.QueryableList;
|
import eu.eudat.queryable.QueryableList;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
public interface DatasetProfileDao extends DatabaseAccessLayer<DatasetProfile, UUID> {
|
public interface DatasetProfileDao extends DatabaseAccessLayer<DatasetProfile, UUID> {
|
||||||
|
|
||||||
QueryableList<DatasetProfile> getWithCriteria(DatasetProfileCriteria criteria);
|
QueryableList<DatasetProfile> getWithCriteria(DatasetProfileCriteria criteria);
|
||||||
|
|
|
@ -1,53 +1,53 @@
|
||||||
package eu.eudat.dao.entities;
|
package eu.eudat.dao.entities;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
import eu.eudat.dao.DatabaseAccess;
|
import eu.eudat.dao.DatabaseAccess;
|
||||||
import eu.eudat.dao.databaselayer.service.DatabaseService;
|
import eu.eudat.dao.databaselayer.service.DatabaseService;
|
||||||
import eu.eudat.entities.Dataset;
|
|
||||||
import eu.eudat.entities.DatasetProfile;
|
import eu.eudat.entities.DatasetProfile;
|
||||||
import eu.eudat.models.criteria.DatasetProfileCriteria;
|
import eu.eudat.models.criteria.DatasetProfileCriteria;
|
||||||
import eu.eudat.queryable.QueryableList;
|
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 java.util.UUID;
|
||||||
|
|
||||||
@Component("datasetProfileDao")
|
@Component("datasetProfileDao")
|
||||||
public class DatasetProfileDaoImpl extends DatabaseAccess<DatasetProfile> implements DatasetProfileDao {
|
public class DatasetProfileDaoImpl extends DatabaseAccess<DatasetProfile> implements DatasetProfileDao {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public DatasetProfileDaoImpl(DatabaseService<DatasetProfile> databaseService) {
|
public DatasetProfileDaoImpl(DatabaseService<DatasetProfile> databaseService) {
|
||||||
this.setDatabaseService(databaseService);
|
this.setDatabaseService(databaseService);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public QueryableList<DatasetProfile> getWithCriteria(DatasetProfileCriteria criteria) {
|
public QueryableList<DatasetProfile> getWithCriteria(DatasetProfileCriteria criteria) {
|
||||||
QueryableList<DatasetProfile> query = getDatabaseService().getQueryable(DatasetProfile.class);
|
QueryableList<DatasetProfile> query = getDatabaseService().getQueryable(DatasetProfile.class);
|
||||||
if(criteria.getLike()!=null&&!criteria.getLike().isEmpty())query.where((builder, root) -> builder.like(root.get("label"),"%"+criteria.getLike()+"%"));
|
if (criteria.getLike() != null && !criteria.getLike().isEmpty())
|
||||||
return query;
|
query.where((builder, root) -> builder.like(root.get("label"), "%" + criteria.getLike() + "%"));
|
||||||
}
|
return query;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DatasetProfile createOrUpdate(DatasetProfile item) {
|
public DatasetProfile createOrUpdate(DatasetProfile item) {
|
||||||
return this.getDatabaseService().createOrUpdate(item,DatasetProfile.class);
|
return this.getDatabaseService().createOrUpdate(item, DatasetProfile.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DatasetProfile find(UUID id) {
|
public DatasetProfile find(UUID id) {
|
||||||
return getDatabaseService().getQueryable(DatasetProfile.class).where((builder, root) -> builder.equal(root.get("id"),id)).getSingle();
|
return getDatabaseService().getQueryable(DatasetProfile.class).where((builder, root) -> builder.equal(root.get("id"), id)).getSingle();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public QueryableList<DatasetProfile> getAll() {
|
public QueryableList<DatasetProfile> getAll() {
|
||||||
return getDatabaseService().getQueryable(DatasetProfile.class);
|
return getDatabaseService().getQueryable(DatasetProfile.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void delete(DatasetProfile item) {
|
public void delete(DatasetProfile item) {
|
||||||
this.getDatabaseService().delete(item);
|
this.getDatabaseService().delete(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public QueryableList<DatasetProfile> asQueryable() {
|
public QueryableList<DatasetProfile> asQueryable() {
|
||||||
return this.getDatabaseService().getQueryable(DatasetProfile.class);
|
return this.getDatabaseService().getQueryable(DatasetProfile.class);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,8 @@
|
||||||
package eu.eudat.dao.entities;
|
package eu.eudat.dao.entities;
|
||||||
|
|
||||||
import eu.eudat.dao.DatabaseAccessLayer;
|
import eu.eudat.dao.DatabaseAccessLayer;
|
||||||
import eu.eudat.entities.DMP;
|
|
||||||
import eu.eudat.entities.ExternalDataset;
|
import eu.eudat.entities.ExternalDataset;
|
||||||
import eu.eudat.entities.Invitation;
|
|
||||||
import eu.eudat.models.criteria.ExternalDatasetCriteria;
|
import eu.eudat.models.criteria.ExternalDatasetCriteria;
|
||||||
import eu.eudat.models.criteria.InvitationCriteria;
|
|
||||||
import eu.eudat.queryable.QueryableList;
|
import eu.eudat.queryable.QueryableList;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
package eu.eudat.dao.entities;
|
package eu.eudat.dao.entities;
|
||||||
|
|
||||||
import eu.eudat.dao.DatabaseAccess;
|
import eu.eudat.dao.DatabaseAccess;
|
||||||
import eu.eudat.dao.databaselayer.service.DatabaseService;
|
import eu.eudat.dao.databaselayer.service.DatabaseService;
|
||||||
import eu.eudat.entities.DatasetProfile;
|
|
||||||
import eu.eudat.entities.ExternalDataset;
|
import eu.eudat.entities.ExternalDataset;
|
||||||
import eu.eudat.entities.Project;
|
|
||||||
import eu.eudat.models.criteria.ExternalDatasetCriteria;
|
import eu.eudat.models.criteria.ExternalDatasetCriteria;
|
||||||
import eu.eudat.queryable.QueryableList;
|
import eu.eudat.queryable.QueryableList;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
@ -23,18 +22,19 @@ public class ExternalDatasetDaoImpl extends DatabaseAccess<ExternalDataset> impl
|
||||||
@Override
|
@Override
|
||||||
public QueryableList<ExternalDataset> getWithCriteria(ExternalDatasetCriteria criteria) {
|
public QueryableList<ExternalDataset> getWithCriteria(ExternalDatasetCriteria criteria) {
|
||||||
QueryableList<ExternalDataset> query = this.getDatabaseService().getQueryable(ExternalDataset.class);
|
QueryableList<ExternalDataset> query = this.getDatabaseService().getQueryable(ExternalDataset.class);
|
||||||
if (criteria.getLike() != null && !criteria.getLike().isEmpty()) query.where((builder, root) -> builder.like(root.get("label"), "%" + criteria.getLike() + "%"));
|
if (criteria.getLike() != null && !criteria.getLike().isEmpty())
|
||||||
|
query.where((builder, root) -> builder.like(root.get("label"), "%" + criteria.getLike() + "%"));
|
||||||
return query;
|
return query;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ExternalDataset createOrUpdate(ExternalDataset item) {
|
public ExternalDataset createOrUpdate(ExternalDataset item) {
|
||||||
return this.getDatabaseService().createOrUpdate(item,ExternalDataset.class);
|
return this.getDatabaseService().createOrUpdate(item, ExternalDataset.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ExternalDataset find(UUID id) {
|
public ExternalDataset find(UUID id) {
|
||||||
return this.getDatabaseService().getQueryable(ExternalDataset.class).where((builder, root) -> builder.equal(root.get("id"),id)).getSingle();
|
return this.getDatabaseService().getQueryable(ExternalDataset.class).where((builder, root) -> builder.equal(root.get("id"), id)).getSingle();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,10 +1,7 @@
|
||||||
package eu.eudat.dao.entities;
|
package eu.eudat.dao.entities;
|
||||||
|
|
||||||
import eu.eudat.dao.DatabaseAccessLayer;
|
import eu.eudat.dao.DatabaseAccessLayer;
|
||||||
import eu.eudat.entities.Dataset;
|
|
||||||
import eu.eudat.entities.ExternalDataset;
|
|
||||||
import eu.eudat.entities.Invitation;
|
import eu.eudat.entities.Invitation;
|
||||||
import eu.eudat.models.criteria.DatasetCriteria;
|
|
||||||
import eu.eudat.models.criteria.InvitationCriteria;
|
import eu.eudat.models.criteria.InvitationCriteria;
|
||||||
import eu.eudat.queryable.QueryableList;
|
import eu.eudat.queryable.QueryableList;
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,6 @@ package eu.eudat.dao.entities;
|
||||||
|
|
||||||
import eu.eudat.dao.DatabaseAccess;
|
import eu.eudat.dao.DatabaseAccess;
|
||||||
import eu.eudat.dao.databaselayer.service.DatabaseService;
|
import eu.eudat.dao.databaselayer.service.DatabaseService;
|
||||||
import eu.eudat.entities.DMP;
|
|
||||||
import eu.eudat.entities.ExternalDataset;
|
|
||||||
import eu.eudat.entities.Invitation;
|
import eu.eudat.entities.Invitation;
|
||||||
import eu.eudat.models.criteria.InvitationCriteria;
|
import eu.eudat.models.criteria.InvitationCriteria;
|
||||||
import eu.eudat.queryable.QueryableList;
|
import eu.eudat.queryable.QueryableList;
|
||||||
|
|
|
@ -1,15 +1,14 @@
|
||||||
package eu.eudat.dao.entities;
|
package eu.eudat.dao.entities;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
import eu.eudat.dao.DatabaseAccessLayer;
|
import eu.eudat.dao.DatabaseAccessLayer;
|
||||||
import eu.eudat.entities.Invitation;
|
|
||||||
import eu.eudat.entities.Organisation;
|
import eu.eudat.entities.Organisation;
|
||||||
import eu.eudat.models.criteria.OrganisationCriteria;
|
import eu.eudat.models.criteria.OrganisationCriteria;
|
||||||
import eu.eudat.queryable.QueryableList;
|
import eu.eudat.queryable.QueryableList;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
public interface OrganisationDao extends DatabaseAccessLayer<Organisation, UUID> {
|
public interface OrganisationDao extends DatabaseAccessLayer<Organisation, UUID> {
|
||||||
|
|
||||||
QueryableList<Organisation> getWithCriteria(OrganisationCriteria criteria);
|
QueryableList<Organisation> getWithCriteria(OrganisationCriteria criteria);
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,17 +1,15 @@
|
||||||
package eu.eudat.dao.entities;
|
package eu.eudat.dao.entities;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
import eu.eudat.dao.DatabaseAccess;
|
import eu.eudat.dao.DatabaseAccess;
|
||||||
import eu.eudat.dao.databaselayer.service.DatabaseService;
|
import eu.eudat.dao.databaselayer.service.DatabaseService;
|
||||||
import eu.eudat.entities.Invitation;
|
import eu.eudat.entities.Organisation;
|
||||||
import eu.eudat.models.criteria.OrganisationCriteria;
|
import eu.eudat.models.criteria.OrganisationCriteria;
|
||||||
import eu.eudat.queryable.QueryableList;
|
import eu.eudat.queryable.QueryableList;
|
||||||
|
|
||||||
import eu.eudat.entities.Organisation;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
@Component("organisationDao")
|
@Component("organisationDao")
|
||||||
public class OrganisationDaoImpl extends DatabaseAccess<Organisation> implements OrganisationDao {
|
public class OrganisationDaoImpl extends DatabaseAccess<Organisation> implements OrganisationDao {
|
||||||
|
|
||||||
|
@ -30,7 +28,7 @@ public class OrganisationDaoImpl extends DatabaseAccess<Organisation> implements
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Organisation createOrUpdate(Organisation item) {
|
public Organisation createOrUpdate(Organisation item) {
|
||||||
return this.getDatabaseService().createOrUpdate(item,Organisation.class);
|
return this.getDatabaseService().createOrUpdate(item, Organisation.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,20 +1,18 @@
|
||||||
package eu.eudat.dao.entities;
|
package eu.eudat.dao.entities;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
import eu.eudat.dao.DatabaseAccessLayer;
|
import eu.eudat.dao.DatabaseAccessLayer;
|
||||||
import eu.eudat.entities.Dataset;
|
|
||||||
import eu.eudat.entities.Organisation;
|
|
||||||
import eu.eudat.entities.Project;
|
import eu.eudat.entities.Project;
|
||||||
import eu.eudat.entities.UserInfo;
|
import eu.eudat.entities.UserInfo;
|
||||||
import eu.eudat.models.criteria.ProjectCriteria;
|
import eu.eudat.models.criteria.ProjectCriteria;
|
||||||
import eu.eudat.queryable.QueryableList;
|
import eu.eudat.queryable.QueryableList;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
public interface ProjectDao extends DatabaseAccessLayer<Project, UUID> {
|
public interface ProjectDao extends DatabaseAccessLayer<Project, UUID> {
|
||||||
|
|
||||||
QueryableList<Project> getWithCriteria(ProjectCriteria criteria);
|
QueryableList<Project> getWithCriteria(ProjectCriteria criteria);
|
||||||
|
|
||||||
QueryableList<Project> getAuthenticated(QueryableList<Project> query, UserInfo principal);
|
QueryableList<Project> getAuthenticated(QueryableList<Project> query, UserInfo principal);
|
||||||
|
|
||||||
Long count();
|
Long count();
|
||||||
}
|
}
|
|
@ -1,16 +1,16 @@
|
||||||
package eu.eudat.dao.entities;
|
package eu.eudat.dao.entities;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
import eu.eudat.dao.DatabaseAccess;
|
import eu.eudat.dao.DatabaseAccess;
|
||||||
import eu.eudat.dao.databaselayer.service.DatabaseService;
|
import eu.eudat.dao.databaselayer.service.DatabaseService;
|
||||||
import eu.eudat.entities.*;
|
import eu.eudat.entities.Project;
|
||||||
|
import eu.eudat.entities.UserInfo;
|
||||||
import eu.eudat.models.criteria.ProjectCriteria;
|
import eu.eudat.models.criteria.ProjectCriteria;
|
||||||
import eu.eudat.queryable.QueryableList;
|
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 java.util.UUID;
|
||||||
|
|
||||||
@Component("projectDao")
|
@Component("projectDao")
|
||||||
public class ProjectDaoImpl extends DatabaseAccess<Project> implements ProjectDao {
|
public class ProjectDaoImpl extends DatabaseAccess<Project> implements ProjectDao {
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,14 @@
|
||||||
package eu.eudat.dao.entities;
|
package eu.eudat.dao.entities;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
import eu.eudat.dao.DatabaseAccessLayer;
|
import eu.eudat.dao.DatabaseAccessLayer;
|
||||||
import eu.eudat.entities.Project;
|
|
||||||
import eu.eudat.entities.Registry;
|
import eu.eudat.entities.Registry;
|
||||||
import eu.eudat.models.criteria.RegistryCriteria;
|
import eu.eudat.models.criteria.RegistryCriteria;
|
||||||
import eu.eudat.queryable.QueryableList;
|
import eu.eudat.queryable.QueryableList;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
public interface RegistryDao extends DatabaseAccessLayer<Registry, UUID> {
|
public interface RegistryDao extends DatabaseAccessLayer<Registry, UUID> {
|
||||||
|
|
||||||
QueryableList<Registry> getWithCriteria(RegistryCriteria criteria);
|
QueryableList<Registry> getWithCriteria(RegistryCriteria criteria);
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,49 +1,48 @@
|
||||||
package eu.eudat.dao.entities;
|
package eu.eudat.dao.entities;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
import eu.eudat.dao.DatabaseAccess;
|
import eu.eudat.dao.DatabaseAccess;
|
||||||
import eu.eudat.dao.databaselayer.service.DatabaseService;
|
import eu.eudat.dao.databaselayer.service.DatabaseService;
|
||||||
import eu.eudat.entities.Organisation;
|
import eu.eudat.entities.Registry;
|
||||||
import eu.eudat.models.criteria.RegistryCriteria;
|
import eu.eudat.models.criteria.RegistryCriteria;
|
||||||
import eu.eudat.queryable.QueryableList;
|
import eu.eudat.queryable.QueryableList;
|
||||||
|
|
||||||
import eu.eudat.entities.Registry;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
@Component("registryDao")
|
@Component("registryDao")
|
||||||
public class RegistryDaoImpl extends DatabaseAccess<Registry> implements RegistryDao {
|
public class RegistryDaoImpl extends DatabaseAccess<Registry> implements RegistryDao {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public RegistryDaoImpl(DatabaseService<Registry> databaseService) {
|
public RegistryDaoImpl(DatabaseService<Registry> databaseService) {
|
||||||
this.setDatabaseService(databaseService);
|
this.setDatabaseService(databaseService);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public QueryableList<Registry> getWithCriteria(RegistryCriteria criteria) {
|
public QueryableList<Registry> getWithCriteria(RegistryCriteria criteria) {
|
||||||
QueryableList<Registry> query = this.getDatabaseService().getQueryable(Registry.class);
|
QueryableList<Registry> query = this.getDatabaseService().getQueryable(Registry.class);
|
||||||
if(criteria.getLike()!=null) query.where((builder, root) -> builder.equal(root.get("reference"),criteria.getLike()));
|
if (criteria.getLike() != null)
|
||||||
return query;
|
query.where((builder, root) -> builder.equal(root.get("reference"), criteria.getLike()));
|
||||||
}
|
return query;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Registry createOrUpdate(Registry item) {
|
public Registry createOrUpdate(Registry item) {
|
||||||
return this.getDatabaseService().createOrUpdate(item,Registry.class);
|
return this.getDatabaseService().createOrUpdate(item, Registry.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Registry find(UUID id) {
|
public Registry find(UUID id) {
|
||||||
return this.getDatabaseService().getQueryable(Registry.class).where((builder, root) -> builder.equal(root.get("id"),id)).getSingle();
|
return this.getDatabaseService().getQueryable(Registry.class).where((builder, root) -> builder.equal(root.get("id"), id)).getSingle();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void delete(Registry item) {
|
public void delete(Registry item) {
|
||||||
this.getDatabaseService().delete(item);
|
this.getDatabaseService().delete(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public QueryableList<Registry> asQueryable() {
|
public QueryableList<Registry> asQueryable() {
|
||||||
return this.getDatabaseService().getQueryable(Registry.class);
|
return this.getDatabaseService().getQueryable(Registry.class);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,15 +1,14 @@
|
||||||
package eu.eudat.dao.entities;
|
package eu.eudat.dao.entities;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
import eu.eudat.dao.DatabaseAccessLayer;
|
import eu.eudat.dao.DatabaseAccessLayer;
|
||||||
import eu.eudat.entities.Registry;
|
|
||||||
import eu.eudat.entities.Researcher;
|
import eu.eudat.entities.Researcher;
|
||||||
import eu.eudat.models.criteria.ResearcherCriteria;
|
import eu.eudat.models.criteria.ResearcherCriteria;
|
||||||
import eu.eudat.queryable.QueryableList;
|
import eu.eudat.queryable.QueryableList;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
public interface ResearcherDao extends DatabaseAccessLayer<Researcher, UUID> {
|
public interface ResearcherDao extends DatabaseAccessLayer<Researcher, UUID> {
|
||||||
|
|
||||||
QueryableList<Researcher> getWithCriteria(ResearcherCriteria criteria);
|
QueryableList<Researcher> getWithCriteria(ResearcherCriteria criteria);
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,49 +1,48 @@
|
||||||
package eu.eudat.dao.entities;
|
package eu.eudat.dao.entities;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
import eu.eudat.dao.DatabaseAccess;
|
import eu.eudat.dao.DatabaseAccess;
|
||||||
import eu.eudat.dao.databaselayer.service.DatabaseService;
|
import eu.eudat.dao.databaselayer.service.DatabaseService;
|
||||||
import eu.eudat.entities.Organisation;
|
import eu.eudat.entities.Researcher;
|
||||||
import eu.eudat.models.criteria.ResearcherCriteria;
|
import eu.eudat.models.criteria.ResearcherCriteria;
|
||||||
import eu.eudat.queryable.QueryableList;
|
import eu.eudat.queryable.QueryableList;
|
||||||
|
|
||||||
import eu.eudat.entities.Researcher;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
@Component("researcherDao")
|
@Component("researcherDao")
|
||||||
public class ResearcherDaoImpl extends DatabaseAccess<Researcher> implements ResearcherDao {
|
public class ResearcherDaoImpl extends DatabaseAccess<Researcher> implements ResearcherDao {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public ResearcherDaoImpl(DatabaseService<Researcher> databaseService) {
|
public ResearcherDaoImpl(DatabaseService<Researcher> databaseService) {
|
||||||
this.setDatabaseService(databaseService);
|
this.setDatabaseService(databaseService);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public QueryableList<Researcher> getWithCriteria(ResearcherCriteria criteria) {
|
public QueryableList<Researcher> getWithCriteria(ResearcherCriteria criteria) {
|
||||||
QueryableList<Researcher> query = this.getDatabaseService().getQueryable(Researcher.class);
|
QueryableList<Researcher> query = this.getDatabaseService().getQueryable(Researcher.class);
|
||||||
if(criteria.getLike()!=null) query.where((builder, root) -> builder.equal(root.get("reference"),criteria.getLike()));
|
if (criteria.getLike() != null)
|
||||||
return query;
|
query.where((builder, root) -> builder.equal(root.get("reference"), criteria.getLike()));
|
||||||
}
|
return query;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Researcher createOrUpdate(Researcher item) {
|
public Researcher createOrUpdate(Researcher item) {
|
||||||
return this.getDatabaseService().createOrUpdate(item,Researcher.class);
|
return this.getDatabaseService().createOrUpdate(item, Researcher.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Researcher find(UUID id) {
|
public Researcher find(UUID id) {
|
||||||
return this.getDatabaseService().getQueryable(Researcher.class).where((builder, root) -> builder.equal(root.get("id"),id)).getSingle();
|
return this.getDatabaseService().getQueryable(Researcher.class).where((builder, root) -> builder.equal(root.get("id"), id)).getSingle();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void delete(Researcher item) {
|
public void delete(Researcher item) {
|
||||||
this.getDatabaseService().delete(item);
|
this.getDatabaseService().delete(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public QueryableList<Researcher> asQueryable() {
|
public QueryableList<Researcher> asQueryable() {
|
||||||
return this.getDatabaseService().getQueryable(Researcher.class);
|
return this.getDatabaseService().getQueryable(Researcher.class);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,15 +1,14 @@
|
||||||
package eu.eudat.dao.entities;
|
package eu.eudat.dao.entities;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
import eu.eudat.dao.DatabaseAccessLayer;
|
import eu.eudat.dao.DatabaseAccessLayer;
|
||||||
import eu.eudat.entities.Researcher;
|
|
||||||
import eu.eudat.entities.Service;
|
import eu.eudat.entities.Service;
|
||||||
import eu.eudat.models.criteria.ServiceCriteria;
|
import eu.eudat.models.criteria.ServiceCriteria;
|
||||||
import eu.eudat.queryable.QueryableList;
|
import eu.eudat.queryable.QueryableList;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
public interface ServiceDao extends DatabaseAccessLayer<Service, UUID> {
|
public interface ServiceDao extends DatabaseAccessLayer<Service, UUID> {
|
||||||
|
|
||||||
QueryableList<Service> getWithCriteria(ServiceCriteria criteria);
|
QueryableList<Service> getWithCriteria(ServiceCriteria criteria);
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,49 +1,48 @@
|
||||||
package eu.eudat.dao.entities;
|
package eu.eudat.dao.entities;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
import eu.eudat.dao.DatabaseAccess;
|
import eu.eudat.dao.DatabaseAccess;
|
||||||
import eu.eudat.dao.databaselayer.service.DatabaseService;
|
import eu.eudat.dao.databaselayer.service.DatabaseService;
|
||||||
import eu.eudat.entities.Organisation;
|
import eu.eudat.entities.Service;
|
||||||
import eu.eudat.models.criteria.ServiceCriteria;
|
import eu.eudat.models.criteria.ServiceCriteria;
|
||||||
import eu.eudat.queryable.QueryableList;
|
import eu.eudat.queryable.QueryableList;
|
||||||
|
|
||||||
import eu.eudat.entities.Service;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
@Component("serviceDao")
|
@Component("serviceDao")
|
||||||
public class ServiceDaoImpl extends DatabaseAccess<Service> implements ServiceDao {
|
public class ServiceDaoImpl extends DatabaseAccess<Service> implements ServiceDao {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public ServiceDaoImpl(DatabaseService<Service> databaseService) {
|
public ServiceDaoImpl(DatabaseService<Service> databaseService) {
|
||||||
this.setDatabaseService(databaseService);
|
this.setDatabaseService(databaseService);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public QueryableList<Service> getWithCriteria(ServiceCriteria criteria) {
|
public QueryableList<Service> getWithCriteria(ServiceCriteria criteria) {
|
||||||
QueryableList<Service> query = this.getDatabaseService().getQueryable(Service.class);
|
QueryableList<Service> query = this.getDatabaseService().getQueryable(Service.class);
|
||||||
if(criteria.getLike()!=null) query.where((builder, root) -> builder.equal(root.get("reference"),criteria.getLike()));
|
if (criteria.getLike() != null)
|
||||||
return query;
|
query.where((builder, root) -> builder.equal(root.get("reference"), criteria.getLike()));
|
||||||
}
|
return query;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Service createOrUpdate(Service item) {
|
public Service createOrUpdate(Service item) {
|
||||||
return this.getDatabaseService().createOrUpdate(item,Service.class);
|
return this.getDatabaseService().createOrUpdate(item, Service.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Service find(UUID id) {
|
public Service find(UUID id) {
|
||||||
return this.getDatabaseService().getQueryable(Service.class).where((builder, root) -> builder.equal(root.get("id"),id)).getSingle();
|
return this.getDatabaseService().getQueryable(Service.class).where((builder, root) -> builder.equal(root.get("id"), id)).getSingle();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void delete(Service item) {
|
public void delete(Service item) {
|
||||||
this.getDatabaseService().delete(item);
|
this.getDatabaseService().delete(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public QueryableList<Service> asQueryable() {
|
public QueryableList<Service> asQueryable() {
|
||||||
return this.getDatabaseService().getQueryable(Service.class);
|
return this.getDatabaseService().getQueryable(Service.class);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package eu.eudat.dao.entities;
|
package eu.eudat.dao.entities;
|
||||||
|
|
||||||
import eu.eudat.dao.DatabaseAccessLayer;
|
import eu.eudat.dao.DatabaseAccessLayer;
|
||||||
import eu.eudat.entities.Service;
|
|
||||||
import eu.eudat.entities.UserDMP;
|
import eu.eudat.entities.UserDMP;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
package eu.eudat.dao.entities;
|
package eu.eudat.dao.entities;
|
||||||
|
|
||||||
import eu.eudat.dao.DatabaseAccess;
|
import eu.eudat.dao.DatabaseAccess;
|
||||||
import eu.eudat.dao.DatabaseAccessLayer;
|
|
||||||
import eu.eudat.dao.databaselayer.service.DatabaseService;
|
import eu.eudat.dao.databaselayer.service.DatabaseService;
|
||||||
import eu.eudat.entities.Service;
|
|
||||||
import eu.eudat.entities.UserDMP;
|
import eu.eudat.entities.UserDMP;
|
||||||
import eu.eudat.queryable.QueryableList;
|
import eu.eudat.queryable.QueryableList;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
|
@ -1,15 +1,14 @@
|
||||||
package eu.eudat.dao.entities;
|
package eu.eudat.dao.entities;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
import eu.eudat.dao.DatabaseAccessLayer;
|
import eu.eudat.dao.DatabaseAccessLayer;
|
||||||
import eu.eudat.entities.Service;
|
|
||||||
import eu.eudat.entities.UserInfo;
|
import eu.eudat.entities.UserInfo;
|
||||||
import eu.eudat.models.criteria.UserInfoCriteria;
|
import eu.eudat.models.criteria.UserInfoCriteria;
|
||||||
import eu.eudat.queryable.QueryableList;
|
import eu.eudat.queryable.QueryableList;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
public interface UserInfoDao extends DatabaseAccessLayer<UserInfo, UUID> {
|
public interface UserInfoDao extends DatabaseAccessLayer<UserInfo, UUID> {
|
||||||
|
|
||||||
QueryableList<UserInfo> getWithCriteria(UserInfoCriteria criteria);
|
QueryableList<UserInfo> getWithCriteria(UserInfoCriteria criteria);
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,17 +1,15 @@
|
||||||
package eu.eudat.dao.entities;
|
package eu.eudat.dao.entities;
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
import eu.eudat.dao.DatabaseAccess;
|
import eu.eudat.dao.DatabaseAccess;
|
||||||
import eu.eudat.dao.databaselayer.service.DatabaseService;
|
import eu.eudat.dao.databaselayer.service.DatabaseService;
|
||||||
import eu.eudat.entities.Organisation;
|
|
||||||
import eu.eudat.entities.UserInfo;
|
import eu.eudat.entities.UserInfo;
|
||||||
import eu.eudat.models.criteria.UserInfoCriteria;
|
import eu.eudat.models.criteria.UserInfoCriteria;
|
||||||
import eu.eudat.queryable.QueryableList;
|
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 java.util.UUID;
|
||||||
|
|
||||||
@Component("userInfoDao")
|
@Component("userInfoDao")
|
||||||
public class UserInfoDaoImpl extends DatabaseAccess<UserInfo> implements UserInfoDao {
|
public class UserInfoDaoImpl extends DatabaseAccess<UserInfo> implements UserInfoDao {
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package eu.eudat.dao.entities;
|
package eu.eudat.dao.entities;
|
||||||
|
|
||||||
import eu.eudat.dao.DatabaseAccess;
|
import eu.eudat.dao.DatabaseAccess;
|
||||||
import eu.eudat.dao.DatabaseAccessLayer;
|
|
||||||
import eu.eudat.dao.databaselayer.service.DatabaseService;
|
import eu.eudat.dao.databaselayer.service.DatabaseService;
|
||||||
import eu.eudat.entities.UserInfo;
|
import eu.eudat.entities.UserInfo;
|
||||||
import eu.eudat.entities.UserRole;
|
import eu.eudat.entities.UserRole;
|
||||||
|
|
|
@ -2,13 +2,12 @@ package eu.eudat.dao.entities.security;
|
||||||
|
|
||||||
import eu.eudat.dao.DatabaseAccessLayer;
|
import eu.eudat.dao.DatabaseAccessLayer;
|
||||||
import eu.eudat.entities.Credential;
|
import eu.eudat.entities.Credential;
|
||||||
import eu.eudat.entities.Dataset;
|
|
||||||
import eu.eudat.models.login.Credentials;
|
import eu.eudat.models.login.Credentials;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
|
||||||
public interface CredentialDao extends DatabaseAccessLayer<Credential,UUID> {
|
public interface CredentialDao extends DatabaseAccessLayer<Credential, UUID> {
|
||||||
|
|
||||||
Credential getLoggedInCredentials(Credentials credentials);
|
Credential getLoggedInCredentials(Credentials credentials);
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,6 @@ package eu.eudat.dao.entities.security;
|
||||||
import eu.eudat.dao.DatabaseAccess;
|
import eu.eudat.dao.DatabaseAccess;
|
||||||
import eu.eudat.dao.databaselayer.service.DatabaseService;
|
import eu.eudat.dao.databaselayer.service.DatabaseService;
|
||||||
import eu.eudat.entities.Credential;
|
import eu.eudat.entities.Credential;
|
||||||
import eu.eudat.entities.UserInfo;
|
|
||||||
import eu.eudat.models.login.Credentials;
|
import eu.eudat.models.login.Credentials;
|
||||||
import eu.eudat.queryable.QueryableList;
|
import eu.eudat.queryable.QueryableList;
|
||||||
import eu.eudat.security.validators.TokenValidatorFactoryImpl;
|
import eu.eudat.security.validators.TokenValidatorFactoryImpl;
|
||||||
|
|
|
@ -1,13 +1,12 @@
|
||||||
package eu.eudat.dao.entities.security;
|
package eu.eudat.dao.entities.security;
|
||||||
|
|
||||||
import eu.eudat.dao.DatabaseAccessLayer;
|
import eu.eudat.dao.DatabaseAccessLayer;
|
||||||
import eu.eudat.entities.Credential;
|
|
||||||
import eu.eudat.entities.UserToken;
|
import eu.eudat.entities.UserToken;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
|
||||||
public interface UserTokenDao extends DatabaseAccessLayer<UserToken,UUID> {
|
public interface UserTokenDao extends DatabaseAccessLayer<UserToken, UUID> {
|
||||||
|
|
||||||
UserToken createOrUpdate(UserToken item);
|
UserToken createOrUpdate(UserToken item);
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
package eu.eudat.entities;
|
package eu.eudat.entities;
|
||||||
|
|
||||||
import org.hibernate.annotations.GenericGenerator;
|
|
||||||
|
|
||||||
import javax.persistence.*;
|
import javax.persistence.*;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
|
@ -1,17 +1,12 @@
|
||||||
package eu.eudat.entities;
|
package eu.eudat.entities;
|
||||||
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
import javax.persistence.*;
|
|
||||||
|
|
||||||
import eu.eudat.types.Authorities;
|
|
||||||
import org.hibernate.annotations.GenericGenerator;
|
import org.hibernate.annotations.GenericGenerator;
|
||||||
import org.hibernate.annotations.Type;
|
import org.hibernate.annotations.Type;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIdentityInfo;
|
import javax.persistence.*;
|
||||||
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
|
import java.io.Serializable;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
|
@ -279,7 +274,7 @@ public class DMP implements Serializable, DataEntity<DMP> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(DMP entity) {
|
public void update(DMP entity) {
|
||||||
this.associatedDmps = entity.associatedDmps ;
|
this.associatedDmps = entity.associatedDmps;
|
||||||
this.label = entity.getLabel();
|
this.label = entity.getLabel();
|
||||||
this.status = entity.getStatus();
|
this.status = entity.getStatus();
|
||||||
this.created = entity.created;
|
this.created = entity.created;
|
||||||
|
|
|
@ -1,71 +1,63 @@
|
||||||
package eu.eudat.entities;
|
package eu.eudat.entities;
|
||||||
|
|
||||||
|
|
||||||
|
import org.hibernate.annotations.GenericGenerator;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import javax.persistence.Column;
|
|
||||||
import javax.persistence.Entity;
|
|
||||||
import javax.persistence.GeneratedValue;
|
|
||||||
import javax.persistence.Id;
|
|
||||||
import javax.persistence.Table;
|
|
||||||
|
|
||||||
import org.hibernate.annotations.GenericGenerator;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIdentityInfo;
|
|
||||||
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
|
|
||||||
|
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name="\"DMPOrganisation\"")
|
@Table(name = "\"DMPOrganisation\"")
|
||||||
public class DMPOrganisation implements Serializable {
|
public class DMPOrganisation implements Serializable {
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue
|
@GeneratedValue
|
||||||
@GenericGenerator(name = "uuid2", strategy = "uuid2")
|
@GenericGenerator(name = "uuid2", strategy = "uuid2")
|
||||||
@Column(name = "\"ID\"", updatable = false, nullable = false, columnDefinition = "BINARY(16)")
|
@Column(name = "\"ID\"", updatable = false, nullable = false, columnDefinition = "BINARY(16)")
|
||||||
private UUID id;
|
private UUID id;
|
||||||
|
|
||||||
@Column(name = "\"DMP\"")
|
@Column(name = "\"DMP\"")
|
||||||
private UUID dmp;
|
private UUID dmp;
|
||||||
|
|
||||||
@Column(name = "\"Organisation\"")
|
@Column(name = "\"Organisation\"")
|
||||||
private UUID organisation;
|
private UUID organisation;
|
||||||
|
|
||||||
@Column(name = "\"Role\"")
|
|
||||||
private Integer role;
|
|
||||||
|
|
||||||
public UUID getId() {
|
@Column(name = "\"Role\"")
|
||||||
return id;
|
private Integer role;
|
||||||
}
|
|
||||||
|
|
||||||
public void setId(UUID id) {
|
public UUID getId() {
|
||||||
this.id = id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public UUID getDmp() {
|
public void setId(UUID id) {
|
||||||
return dmp;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDmp(UUID dmp) {
|
public UUID getDmp() {
|
||||||
this.dmp = dmp;
|
return dmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
public UUID getOrganisation() {
|
public void setDmp(UUID dmp) {
|
||||||
return organisation;
|
this.dmp = dmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setOrganisation(UUID organisation) {
|
public UUID getOrganisation() {
|
||||||
this.organisation = organisation;
|
return organisation;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getRole() {
|
public void setOrganisation(UUID organisation) {
|
||||||
return role;
|
this.organisation = organisation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Integer getRole() {
|
||||||
|
return role;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRole(Integer role) {
|
||||||
|
this.role = role;
|
||||||
|
}
|
||||||
|
|
||||||
public void setRole(Integer role) {
|
|
||||||
this.role = role;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,121 +1,110 @@
|
||||||
package eu.eudat.entities;
|
package eu.eudat.entities;
|
||||||
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
import javax.persistence.Column;
|
|
||||||
import javax.persistence.Entity;
|
|
||||||
import javax.persistence.FetchType;
|
|
||||||
import javax.persistence.GeneratedValue;
|
|
||||||
import javax.persistence.Id;
|
|
||||||
import javax.persistence.OneToMany;
|
|
||||||
import javax.persistence.Table;
|
|
||||||
|
|
||||||
import org.hibernate.annotations.GenericGenerator;
|
import org.hibernate.annotations.GenericGenerator;
|
||||||
import org.hibernate.annotations.Type;
|
import org.hibernate.annotations.Type;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIdentityInfo;
|
import javax.persistence.*;
|
||||||
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
|
import java.util.Date;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name="\"DMPProfile\"")
|
@Table(name = "\"DMPProfile\"")
|
||||||
public class DMPProfile {
|
public class DMPProfile {
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue
|
@GeneratedValue
|
||||||
@GenericGenerator(name = "uuid2", strategy = "uuid2")
|
@GenericGenerator(name = "uuid2", strategy = "uuid2")
|
||||||
@Column(name = "\"ID\"", updatable = false, nullable = false, columnDefinition = "BINARY(16)")
|
@Column(name = "\"ID\"", updatable = false, nullable = false, columnDefinition = "BINARY(16)")
|
||||||
private UUID id;
|
private UUID id;
|
||||||
|
|
||||||
|
|
||||||
@OneToMany(fetch = FetchType.LAZY, mappedBy = "profile")
|
@OneToMany(fetch = FetchType.LAZY, mappedBy = "profile")
|
||||||
private Set<DMP> dmps;
|
private Set<DMP> dmps;
|
||||||
|
|
||||||
|
|
||||||
@Column(name = "\"Label\"")
|
@Column(name = "\"Label\"")
|
||||||
private String label;
|
private String label;
|
||||||
|
|
||||||
@Type(type="eu.eudat.typedefinition.XMLType")
|
|
||||||
@Column(name = "\"Definition\"", columnDefinition = "xml", nullable = true)
|
|
||||||
private String definition;
|
|
||||||
|
|
||||||
|
@Type(type = "eu.eudat.typedefinition.XMLType")
|
||||||
@Column(name = "\"Status\"", nullable = false)
|
@Column(name = "\"Definition\"", columnDefinition = "xml", nullable = true)
|
||||||
private Short status;
|
private String definition;
|
||||||
|
|
||||||
|
|
||||||
@Column(name = "\"Created\"")
|
|
||||||
private Date created = null;
|
|
||||||
|
|
||||||
@Column(name = "\"Modified\"")
|
|
||||||
private Date modified = new Date();
|
|
||||||
|
|
||||||
|
|
||||||
public Short getStatus() {
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void setStatus(Short status) {
|
@Column(name = "\"Status\"", nullable = false)
|
||||||
this.status = status;
|
private Short status;
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public Date getCreated() {
|
@Column(name = "\"Created\"")
|
||||||
return created;
|
private Date created = null;
|
||||||
}
|
|
||||||
|
@Column(name = "\"Modified\"")
|
||||||
|
private Date modified = new Date();
|
||||||
|
|
||||||
|
|
||||||
public void setCreated(Date created) {
|
public Short getStatus() {
|
||||||
this.created = created;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public Date getModified() {
|
public void setStatus(Short status) {
|
||||||
return modified;
|
this.status = status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void setModified(Date modified) {
|
public Date getCreated() {
|
||||||
this.modified = modified;
|
return created;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public UUID getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setId(UUID id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getLabel() {
|
public void setCreated(Date created) {
|
||||||
return label;
|
this.created = created;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setLabel(String label) {
|
|
||||||
this.label = label;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDefinition() {
|
public Date getModified() {
|
||||||
return definition;
|
return modified;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDefinition(String definition) {
|
|
||||||
this.definition = definition;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Set<DMP> getDmps() {
|
public void setModified(Date modified) {
|
||||||
return dmps;
|
this.modified = modified;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public UUID getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(UUID id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLabel() {
|
||||||
|
return label;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLabel(String label) {
|
||||||
|
this.label = label;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDefinition() {
|
||||||
|
return definition;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDefinition(String definition) {
|
||||||
|
this.definition = definition;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Set<DMP> getDmps() {
|
||||||
|
return dmps;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDmps(Set<DMP> dmps) {
|
||||||
|
this.dmps = dmps;
|
||||||
|
}
|
||||||
|
|
||||||
public void setDmps(Set<DMP> dmps) {
|
|
||||||
this.dmps = dmps;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,74 +1,65 @@
|
||||||
package eu.eudat.entities;
|
package eu.eudat.entities;
|
||||||
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
import javax.persistence.Column;
|
|
||||||
import javax.persistence.Entity;
|
|
||||||
import javax.persistence.GeneratedValue;
|
|
||||||
import javax.persistence.Id;
|
|
||||||
import javax.persistence.Table;
|
|
||||||
|
|
||||||
import org.hibernate.annotations.GenericGenerator;
|
import org.hibernate.annotations.GenericGenerator;
|
||||||
import org.hibernate.annotations.Type;
|
import org.hibernate.annotations.Type;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIdentityInfo;
|
import javax.persistence.*;
|
||||||
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name="\"DMPResearcher\"")
|
@Table(name = "\"DMPResearcher\"")
|
||||||
public class DMPResearcher {
|
public class DMPResearcher {
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue
|
@GeneratedValue
|
||||||
@GenericGenerator(name = "uuid2", strategy = "uuid2")
|
@GenericGenerator(name = "uuid2", strategy = "uuid2")
|
||||||
@Column(name = "\"ID\"", updatable = false, nullable = false, columnDefinition = "BINARY(16)")
|
@Column(name = "\"ID\"", updatable = false, nullable = false, columnDefinition = "BINARY(16)")
|
||||||
private UUID id;
|
private UUID id;
|
||||||
|
|
||||||
@Type(type="org.hibernate.type.PostgresUUIDType")
|
@Type(type = "org.hibernate.type.PostgresUUIDType")
|
||||||
@Column(name = "\"DMP\"")
|
@Column(name = "\"DMP\"")
|
||||||
private UUID dmp;
|
private UUID dmp;
|
||||||
|
|
||||||
@Type(type="org.hibernate.type.PostgresUUIDType")
|
@Type(type = "org.hibernate.type.PostgresUUIDType")
|
||||||
@Column(name = "\"Researcher\"")
|
@Column(name = "\"Researcher\"")
|
||||||
private UUID researcher;
|
private UUID researcher;
|
||||||
|
|
||||||
@Column(name = "\"Role\"")
|
|
||||||
private Integer role;
|
|
||||||
|
|
||||||
public UUID getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setId(UUID id) {
|
@Column(name = "\"Role\"")
|
||||||
this.id = id;
|
private Integer role;
|
||||||
}
|
|
||||||
|
|
||||||
public UUID getDmp() {
|
public UUID getId() {
|
||||||
return dmp;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDmp(UUID dmp) {
|
public void setId(UUID id) {
|
||||||
this.dmp = dmp;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public UUID getResearcher() {
|
public UUID getDmp() {
|
||||||
return researcher;
|
return dmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setResearcher(UUID researcher) {
|
public void setDmp(UUID dmp) {
|
||||||
this.researcher = researcher;
|
this.dmp = dmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getRole() {
|
public UUID getResearcher() {
|
||||||
return role;
|
return researcher;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setResearcher(UUID researcher) {
|
||||||
|
this.researcher = researcher;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getRole() {
|
||||||
|
return role;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRole(Integer role) {
|
||||||
|
this.role = role;
|
||||||
|
}
|
||||||
|
|
||||||
public void setRole(Integer role) {
|
|
||||||
this.role = role;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,5 @@
|
||||||
package eu.eudat.entities;
|
package eu.eudat.entities;
|
||||||
|
|
||||||
import javax.persistence.Tuple;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
public interface DataEntity<T> {
|
public interface DataEntity<T> {
|
||||||
void update(T entity);
|
void update(T entity);
|
||||||
|
|
||||||
|
|
|
@ -1,167 +1,153 @@
|
||||||
package eu.eudat.entities;
|
package eu.eudat.entities;
|
||||||
|
|
||||||
|
|
||||||
|
import org.hibernate.annotations.GenericGenerator;
|
||||||
|
import org.hibernate.annotations.Type;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import javax.persistence.Column;
|
|
||||||
import javax.persistence.Entity;
|
|
||||||
import javax.persistence.FetchType;
|
|
||||||
import javax.persistence.GeneratedValue;
|
|
||||||
import javax.persistence.Id;
|
|
||||||
import javax.persistence.JoinColumn;
|
|
||||||
import javax.persistence.JoinTable;
|
|
||||||
import javax.persistence.OneToMany;
|
|
||||||
import javax.persistence.Table;
|
|
||||||
|
|
||||||
import org.hibernate.annotations.GenericGenerator;
|
|
||||||
import org.hibernate.annotations.Type;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIdentityInfo;
|
|
||||||
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
|
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name="\"DataRepository\"")
|
@Table(name = "\"DataRepository\"")
|
||||||
public class DataRepository implements Serializable,DataEntity<DataRepository> {
|
public class DataRepository implements Serializable, DataEntity<DataRepository> {
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue
|
@GeneratedValue
|
||||||
@GenericGenerator(name = "uuid2", strategy = "uuid2")
|
@GenericGenerator(name = "uuid2", strategy = "uuid2")
|
||||||
@Column(name = "\"ID\"", updatable = false, nullable = false, columnDefinition = "BINARY(16)")
|
@Column(name = "\"ID\"", updatable = false, nullable = false, columnDefinition = "BINARY(16)")
|
||||||
private UUID id;
|
private UUID id;
|
||||||
|
|
||||||
@Column(name = "\"Label\"")
|
|
||||||
private String label;
|
|
||||||
|
|
||||||
@Column(name = "\"Abbreviation\"")
|
|
||||||
private String abbreviation;
|
|
||||||
|
|
||||||
@Column(name = "\"Reference\"", nullable = false)
|
@Column(name = "\"Label\"")
|
||||||
private String reference;
|
private String label;
|
||||||
|
|
||||||
@Column(name = "\"Uri\"")
|
|
||||||
private String uri;
|
|
||||||
|
|
||||||
@Type(type="eu.eudat.typedefinition.XMLType")
|
|
||||||
@Column(name = "\"Definition\"", columnDefinition = "xml", nullable = true)
|
|
||||||
private String definition;
|
|
||||||
|
|
||||||
|
@Column(name = "\"Abbreviation\"")
|
||||||
|
private String abbreviation;
|
||||||
@OneToMany(fetch = FetchType.LAZY)
|
|
||||||
@JoinTable(name="\"DatasetDataRepository\"",
|
@Column(name = "\"Reference\"", nullable = false)
|
||||||
joinColumns={@JoinColumn(name="\"DataRepository\"", referencedColumnName="\"ID\"")},
|
private String reference;
|
||||||
inverseJoinColumns={@JoinColumn(name="\"Dataset\"", referencedColumnName="\"ID\"")}
|
|
||||||
)
|
@Column(name = "\"Uri\"")
|
||||||
|
private String uri;
|
||||||
|
|
||||||
|
@Type(type = "eu.eudat.typedefinition.XMLType")
|
||||||
|
@Column(name = "\"Definition\"", columnDefinition = "xml", nullable = true)
|
||||||
|
private String definition;
|
||||||
|
|
||||||
|
|
||||||
|
@OneToMany(fetch = FetchType.LAZY)
|
||||||
|
@JoinTable(name = "\"DatasetDataRepository\"",
|
||||||
|
joinColumns = {@JoinColumn(name = "\"DataRepository\"", referencedColumnName = "\"ID\"")},
|
||||||
|
inverseJoinColumns = {@JoinColumn(name = "\"Dataset\"", referencedColumnName = "\"ID\"")}
|
||||||
|
)
|
||||||
private Set<Dataset> datasets;
|
private Set<Dataset> datasets;
|
||||||
|
|
||||||
|
|
||||||
@Column(name = "\"Status\"", nullable = false)
|
|
||||||
private Short status;
|
|
||||||
|
|
||||||
@Column(name = "\"Created\"")
|
|
||||||
private Date created = null;
|
|
||||||
|
|
||||||
@Column(name = "\"Modified\"")
|
|
||||||
private Date modified = new Date();
|
|
||||||
|
|
||||||
|
|
||||||
public Short getStatus() {
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void setStatus(Short status) {
|
@Column(name = "\"Status\"", nullable = false)
|
||||||
this.status = status;
|
private Short status;
|
||||||
}
|
|
||||||
|
@Column(name = "\"Created\"")
|
||||||
|
private Date created = null;
|
||||||
|
|
||||||
|
@Column(name = "\"Modified\"")
|
||||||
|
private Date modified = new Date();
|
||||||
|
|
||||||
|
|
||||||
public Date getCreated() {
|
public Short getStatus() {
|
||||||
return created;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void setCreated(Date created) {
|
public void setStatus(Short status) {
|
||||||
this.created = created;
|
this.status = status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public Date getModified() {
|
public Date getCreated() {
|
||||||
return modified;
|
return created;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void setModified(Date modified) {
|
public void setCreated(Date created) {
|
||||||
this.modified = modified;
|
this.created = created;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public UUID getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setId(UUID id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getLabel() {
|
public Date getModified() {
|
||||||
return label;
|
return modified;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setLabel(String label) {
|
|
||||||
this.label = label;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getAbbreviation() {
|
public void setModified(Date modified) {
|
||||||
return abbreviation;
|
this.modified = modified;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAbbreviation(String abbreviation) {
|
|
||||||
this.abbreviation = abbreviation;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getReference() {
|
public UUID getId() {
|
||||||
return reference;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setReference(String reference) {
|
public void setId(UUID id) {
|
||||||
this.reference = reference;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getUri() {
|
public String getLabel() {
|
||||||
return uri;
|
return label;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUri(String uri) {
|
public void setLabel(String label) {
|
||||||
this.uri = uri;
|
this.label = label;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDefinition() {
|
public String getAbbreviation() {
|
||||||
return definition;
|
return abbreviation;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDefinition(String definition) {
|
public void setAbbreviation(String abbreviation) {
|
||||||
this.definition = definition;
|
this.abbreviation = abbreviation;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Set<Dataset> getDatasets() {
|
public String getReference() {
|
||||||
return datasets;
|
return reference;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDatasets(Set<Dataset> datasets) {
|
public void setReference(String reference) {
|
||||||
this.datasets = datasets;
|
this.reference = reference;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public String getUri() {
|
||||||
public void update(DataRepository entity) {
|
return uri;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
public void setUri(String uri) {
|
||||||
|
this.uri = uri;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
public String getDefinition() {
|
||||||
public Object[] getKeys() {
|
return definition;
|
||||||
return new UUID[]{this.id == null ? null : this.id};
|
}
|
||||||
}
|
|
||||||
|
public void setDefinition(String definition) {
|
||||||
|
this.definition = definition;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Set<Dataset> getDatasets() {
|
||||||
|
return datasets;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDatasets(Set<Dataset> datasets) {
|
||||||
|
this.datasets = datasets;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void update(DataRepository entity) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object[] getKeys() {
|
||||||
|
return new UUID[]{this.id == null ? null : this.id};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,18 +1,11 @@
|
||||||
package eu.eudat.entities;
|
package eu.eudat.entities;
|
||||||
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
import javax.persistence.*;
|
|
||||||
|
|
||||||
import eu.eudat.models.project.*;
|
|
||||||
import eu.eudat.models.project.Project;
|
|
||||||
import org.hibernate.annotations.GenericGenerator;
|
import org.hibernate.annotations.GenericGenerator;
|
||||||
import org.hibernate.annotations.Type;
|
import org.hibernate.annotations.Type;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIdentityInfo;
|
import javax.persistence.*;
|
||||||
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
|
import java.util.*;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "\"Dataset\"")
|
@Table(name = "\"Dataset\"")
|
||||||
|
|
|
@ -7,9 +7,8 @@ import javax.persistence.*;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name="\"DatasetExternalDataset\"")
|
@Table(name = "\"DatasetExternalDataset\"")
|
||||||
public class DatasetExternalDataset {
|
public class DatasetExternalDataset {
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
|
@ -19,16 +18,16 @@ public class DatasetExternalDataset {
|
||||||
private UUID id;
|
private UUID id;
|
||||||
|
|
||||||
|
|
||||||
@Type(type="org.hibernate.type.PostgresUUIDType") //DEPWARN dependency to Hibernate and PostgreSQL
|
@Type(type = "org.hibernate.type.PostgresUUIDType") //DEPWARN dependency to Hibernate and PostgreSQL
|
||||||
@Column(name = "\"Dataset\"", nullable = false)
|
@Column(name = "\"Dataset\"", nullable = false)
|
||||||
private UUID dataset;
|
private UUID dataset;
|
||||||
|
|
||||||
@Type(type="org.hibernate.type.PostgresUUIDType") //DEPWARN dependency to Hibernate and PostgreSQL
|
@Type(type = "org.hibernate.type.PostgresUUIDType") //DEPWARN dependency to Hibernate and PostgreSQL
|
||||||
@Column(name = "\"ExternalDataset\"", nullable = false)
|
@Column(name = "\"ExternalDataset\"", nullable = false)
|
||||||
private UUID externalDataset;
|
private UUID externalDataset;
|
||||||
|
|
||||||
@Column(name = "\"Role\"")
|
@Column(name = "\"Role\"")
|
||||||
private Integer role;
|
private Integer role;
|
||||||
|
|
||||||
public UUID getId() {
|
public UUID getId() {
|
||||||
return id;
|
return id;
|
||||||
|
|
|
@ -1,153 +1,138 @@
|
||||||
package eu.eudat.entities;
|
package eu.eudat.entities;
|
||||||
|
|
||||||
|
|
||||||
|
import org.hibernate.annotations.GenericGenerator;
|
||||||
|
import org.hibernate.annotations.Type;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import javax.persistence.Column;
|
|
||||||
import javax.persistence.Entity;
|
|
||||||
import javax.persistence.FetchType;
|
|
||||||
import javax.persistence.GeneratedValue;
|
|
||||||
import javax.persistence.Id;
|
|
||||||
import javax.persistence.JoinColumn;
|
|
||||||
import javax.persistence.OneToMany;
|
|
||||||
import javax.persistence.OneToOne;
|
|
||||||
import javax.persistence.Table;
|
|
||||||
|
|
||||||
import org.hibernate.annotations.GenericGenerator;
|
|
||||||
import org.hibernate.annotations.Type;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIdentityInfo;
|
|
||||||
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
|
|
||||||
|
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name="\"DatasetProfile\"")
|
@Table(name = "\"DatasetProfile\"")
|
||||||
public class DatasetProfile implements Serializable,DataEntity<DatasetProfile> {
|
public class DatasetProfile implements Serializable, DataEntity<DatasetProfile> {
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue
|
@GeneratedValue
|
||||||
@GenericGenerator(name = "uuid2", strategy = "uuid2")
|
@GenericGenerator(name = "uuid2", strategy = "uuid2")
|
||||||
@Column(name = "\"ID\"", updatable = false, nullable = false, columnDefinition = "BINARY(16)")
|
@Column(name = "\"ID\"", updatable = false, nullable = false, columnDefinition = "BINARY(16)")
|
||||||
private UUID id;
|
private UUID id;
|
||||||
|
|
||||||
@Column(name = "\"Label\"")
|
|
||||||
private String label;
|
|
||||||
|
|
||||||
@OneToMany(fetch = FetchType.LAZY, mappedBy = "profile")
|
|
||||||
private Set<Dataset> dataset;
|
|
||||||
|
|
||||||
@Type(type="eu.eudat.typedefinition.XMLType")
|
@Column(name = "\"Label\"")
|
||||||
@Column(name = "\"Definition\"", columnDefinition = "xml", nullable = false)
|
private String label;
|
||||||
private String definition;
|
|
||||||
|
|
||||||
|
@OneToMany(fetch = FetchType.LAZY, mappedBy = "profile")
|
||||||
@Column(name = "\"Status\"", nullable = false)
|
private Set<Dataset> dataset;
|
||||||
private Short status;
|
|
||||||
|
@Type(type = "eu.eudat.typedefinition.XMLType")
|
||||||
|
@Column(name = "\"Definition\"", columnDefinition = "xml", nullable = false)
|
||||||
@Column(name = "\"Created\"")
|
private String definition;
|
||||||
private Date created;
|
|
||||||
|
|
||||||
@Column(name = "\"Modified\"")
|
|
||||||
private Date modified = new Date();
|
|
||||||
|
|
||||||
@Column(name = "\"Description\"")
|
|
||||||
private String description;
|
|
||||||
|
|
||||||
|
|
||||||
public String getDescription() {
|
|
||||||
return description;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void setDescription(String description) {
|
@Column(name = "\"Status\"", nullable = false)
|
||||||
this.description = description;
|
private Short status;
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public Short getStatus() {
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void setStatus(Short status) {
|
@Column(name = "\"Created\"")
|
||||||
this.status = status;
|
private Date created;
|
||||||
}
|
|
||||||
|
@Column(name = "\"Modified\"")
|
||||||
|
private Date modified = new Date();
|
||||||
|
|
||||||
|
@Column(name = "\"Description\"")
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
|
||||||
public Date getCreated() {
|
public String getDescription() {
|
||||||
return created;
|
return description;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void setCreated(Date created) {
|
public void setDescription(String description) {
|
||||||
this.created = created;
|
this.description = description;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public Date getModified() {
|
public Short getStatus() {
|
||||||
return modified;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void setModified(Date modified) {
|
public void setStatus(Short status) {
|
||||||
this.modified = modified;
|
this.status = status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public UUID getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setId(UUID id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getLabel() {
|
|
||||||
return label;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLabel(String label) {
|
|
||||||
this.label = label;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
public Date getCreated() {
|
||||||
public String getDefinition() {
|
return created;
|
||||||
return definition;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public void setDefinition(String definition) {
|
|
||||||
this.definition = definition;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
public void setCreated(Date created) {
|
||||||
public Set<Dataset> getDataset() {
|
this.created = created;
|
||||||
return dataset;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public void setDataset(Set<Dataset> dataset) {
|
|
||||||
this.dataset = dataset;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "DatasetProfileListingModel [id=" + id + ", label=" + label + ", dataset=" + dataset + ", definition=" + definition + "]";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
public Date getModified() {
|
||||||
public void update(DatasetProfile entity) {
|
return modified;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
public void setModified(Date modified) {
|
||||||
public Object[] getKeys() {
|
this.modified = modified;
|
||||||
return new UUID[]{this.id == null ? null : this.id};
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
public UUID getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(UUID id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLabel() {
|
||||||
|
return label;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLabel(String label) {
|
||||||
|
this.label = label;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getDefinition() {
|
||||||
|
return definition;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDefinition(String definition) {
|
||||||
|
this.definition = definition;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public Set<Dataset> getDataset() {
|
||||||
|
return dataset;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDataset(Set<Dataset> dataset) {
|
||||||
|
this.dataset = dataset;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "DatasetProfileListingModel [id=" + id + ", label=" + label + ", dataset=" + dataset + ", definition=" + definition + "]";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void update(DatasetProfile entity) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object[] getKeys() {
|
||||||
|
return new UUID[]{this.id == null ? null : this.id};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,68 +1,57 @@
|
||||||
package eu.eudat.entities;
|
package eu.eudat.entities;
|
||||||
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
import javax.persistence.Column;
|
|
||||||
import javax.persistence.Entity;
|
|
||||||
import javax.persistence.FetchType;
|
|
||||||
import javax.persistence.GeneratedValue;
|
|
||||||
import javax.persistence.Id;
|
|
||||||
import javax.persistence.OneToOne;
|
|
||||||
import javax.persistence.Table;
|
|
||||||
|
|
||||||
import org.hibernate.annotations.GenericGenerator;
|
import org.hibernate.annotations.GenericGenerator;
|
||||||
import org.hibernate.annotations.Type;
|
import org.hibernate.annotations.Type;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIdentityInfo;
|
import javax.persistence.*;
|
||||||
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
|
import java.io.Serializable;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name="\"DatasetProfileRuleset\"")
|
@Table(name = "\"DatasetProfileRuleset\"")
|
||||||
public class DatasetProfileRuleset implements Serializable {
|
public class DatasetProfileRuleset implements Serializable {
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue
|
@GeneratedValue
|
||||||
@GenericGenerator(name = "uuid2", strategy = "uuid2")
|
@GenericGenerator(name = "uuid2", strategy = "uuid2")
|
||||||
@Column(name = "\"ID\"", updatable = false, nullable = false, columnDefinition = "BINARY(16)")
|
@Column(name = "\"ID\"", updatable = false, nullable = false, columnDefinition = "BINARY(16)")
|
||||||
private UUID id;
|
private UUID id;
|
||||||
|
|
||||||
|
|
||||||
@Column(name = "\"Label\"")
|
|
||||||
private String label;
|
|
||||||
|
|
||||||
@Type(type="eu.eudat.typedefinition.XMLType")
|
@Column(name = "\"Label\"")
|
||||||
@Column(name = "\"Definition\"", columnDefinition = "xml", nullable = false)
|
private String label;
|
||||||
private String definition;
|
|
||||||
|
|
||||||
public UUID getId() {
|
@Type(type = "eu.eudat.typedefinition.XMLType")
|
||||||
return id;
|
@Column(name = "\"Definition\"", columnDefinition = "xml", nullable = false)
|
||||||
}
|
private String definition;
|
||||||
|
|
||||||
public void setId(UUID id) {
|
public UUID getId() {
|
||||||
this.id = id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getLabel() {
|
public void setId(UUID id) {
|
||||||
return label;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setLabel(String label) {
|
public String getLabel() {
|
||||||
this.label = label;
|
return label;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDefinition() {
|
public void setLabel(String label) {
|
||||||
|
this.label = label;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDefinition() {
|
||||||
// return XML.toJSONObject(definition).toString(); //return definition as json
|
// return XML.toJSONObject(definition).toString(); //return definition as json
|
||||||
return definition;
|
return definition;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDefinition(String definition) {
|
public void setDefinition(String definition) {
|
||||||
// this.definition = XML.toString(definition); //if definition is in json
|
// this.definition = XML.toString(definition); //if definition is in json
|
||||||
this.definition = definition;
|
this.definition = definition;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,69 +1,57 @@
|
||||||
package eu.eudat.entities;
|
package eu.eudat.entities;
|
||||||
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
import javax.persistence.Column;
|
|
||||||
import javax.persistence.Entity;
|
|
||||||
import javax.persistence.FetchType;
|
|
||||||
import javax.persistence.GeneratedValue;
|
|
||||||
import javax.persistence.Id;
|
|
||||||
import javax.persistence.OneToOne;
|
|
||||||
import javax.persistence.Table;
|
|
||||||
|
|
||||||
import org.hibernate.annotations.GenericGenerator;
|
import org.hibernate.annotations.GenericGenerator;
|
||||||
import org.hibernate.annotations.Type;
|
import org.hibernate.annotations.Type;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIdentityInfo;
|
import javax.persistence.*;
|
||||||
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name="\"DatasetProfileViewstyle\"")
|
@Table(name = "\"DatasetProfileViewstyle\"")
|
||||||
public class DatasetProfileViewstyle {
|
public class DatasetProfileViewstyle {
|
||||||
|
|
||||||
|
|
||||||
|
@Id
|
||||||
@Id
|
@GeneratedValue
|
||||||
@GeneratedValue
|
|
||||||
@GenericGenerator(name = "uuid2", strategy = "uuid2")
|
@GenericGenerator(name = "uuid2", strategy = "uuid2")
|
||||||
@Column(name = "\"ID\"", updatable = false, nullable = false, columnDefinition = "BINARY(16)")
|
@Column(name = "\"ID\"", updatable = false, nullable = false, columnDefinition = "BINARY(16)")
|
||||||
private UUID id;
|
private UUID id;
|
||||||
|
|
||||||
|
|
||||||
@Column(name = "\"Label\"")
|
|
||||||
private String label;
|
|
||||||
|
|
||||||
@Type(type="eu.eudat.typedefinition.XMLType")
|
@Column(name = "\"Label\"")
|
||||||
@Column(name = "\"Definition\"", columnDefinition = "xml", nullable = false)
|
private String label;
|
||||||
private String definition;
|
|
||||||
|
|
||||||
public UUID getId() {
|
@Type(type = "eu.eudat.typedefinition.XMLType")
|
||||||
return id;
|
@Column(name = "\"Definition\"", columnDefinition = "xml", nullable = false)
|
||||||
}
|
private String definition;
|
||||||
|
|
||||||
public void setId(UUID id) {
|
public UUID getId() {
|
||||||
this.id = id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getLabel() {
|
public void setId(UUID id) {
|
||||||
return label;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setLabel(String label) {
|
public String getLabel() {
|
||||||
this.label = label;
|
return label;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDefinition() {
|
public void setLabel(String label) {
|
||||||
|
this.label = label;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDefinition() {
|
||||||
// return XML.toJSONObject(definition).toString(); //return definition as json
|
// return XML.toJSONObject(definition).toString(); //return definition as json
|
||||||
return definition;
|
return definition;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDefinition(String definition) {
|
public void setDefinition(String definition) {
|
||||||
// this.definition = XML.toString(definition); //if definition is in json
|
// this.definition = XML.toString(definition); //if definition is in json
|
||||||
this.definition = definition;
|
this.definition = definition;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,75 +1,67 @@
|
||||||
package eu.eudat.entities;
|
package eu.eudat.entities;
|
||||||
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
import javax.persistence.Column;
|
|
||||||
import javax.persistence.Entity;
|
|
||||||
import javax.persistence.GeneratedValue;
|
|
||||||
import javax.persistence.Id;
|
|
||||||
import javax.persistence.Table;
|
|
||||||
|
|
||||||
import org.hibernate.annotations.GenericGenerator;
|
import org.hibernate.annotations.GenericGenerator;
|
||||||
import org.hibernate.annotations.Type;
|
import org.hibernate.annotations.Type;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIdentityInfo;
|
import javax.persistence.*;
|
||||||
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
|
import java.io.Serializable;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name="\"DatasetRegistry\"")
|
@Table(name = "\"DatasetRegistry\"")
|
||||||
public class DatasetRegistry implements Serializable {
|
public class DatasetRegistry implements Serializable {
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue
|
@GeneratedValue
|
||||||
@GenericGenerator(name = "uuid2", strategy = "uuid2")
|
@GenericGenerator(name = "uuid2", strategy = "uuid2")
|
||||||
@Column(name = "\"ID\"", updatable = false, nullable = false, columnDefinition = "BINARY(16)")
|
@Column(name = "\"ID\"", updatable = false, nullable = false, columnDefinition = "BINARY(16)")
|
||||||
private UUID id;
|
private UUID id;
|
||||||
|
|
||||||
|
|
||||||
@Type(type="org.hibernate.type.PostgresUUIDType") //DEPWARN dependency to Hibernate and PostgreSQL
|
|
||||||
@Column(name = "\"Dataset\"", nullable = false)
|
|
||||||
private UUID dataset;
|
|
||||||
|
|
||||||
@Type(type="org.hibernate.type.PostgresUUIDType") //DEPWARN dependency to Hibernate and PostgreSQL
|
|
||||||
@Column(name = "\"Registry\"", nullable = false)
|
|
||||||
private UUID registry;
|
|
||||||
|
|
||||||
@Column(name = "\"Role\"")
|
|
||||||
private Integer role;
|
|
||||||
|
|
||||||
public UUID getId() {
|
@Type(type = "org.hibernate.type.PostgresUUIDType") //DEPWARN dependency to Hibernate and PostgreSQL
|
||||||
return id;
|
@Column(name = "\"Dataset\"", nullable = false)
|
||||||
}
|
private UUID dataset;
|
||||||
|
|
||||||
public void setId(UUID id) {
|
@Type(type = "org.hibernate.type.PostgresUUIDType") //DEPWARN dependency to Hibernate and PostgreSQL
|
||||||
this.id = id;
|
@Column(name = "\"Registry\"", nullable = false)
|
||||||
}
|
private UUID registry;
|
||||||
|
|
||||||
public UUID getDataset() {
|
@Column(name = "\"Role\"")
|
||||||
return dataset;
|
private Integer role;
|
||||||
}
|
|
||||||
|
|
||||||
public void setDataset(UUID dataset) {
|
public UUID getId() {
|
||||||
this.dataset = dataset;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public UUID getRegistry() {
|
public void setId(UUID id) {
|
||||||
return registry;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRegistry(UUID registry) {
|
public UUID getDataset() {
|
||||||
this.registry = registry;
|
return dataset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setDataset(UUID dataset) {
|
||||||
|
this.dataset = dataset;
|
||||||
|
}
|
||||||
|
|
||||||
|
public UUID getRegistry() {
|
||||||
|
return registry;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRegistry(UUID registry) {
|
||||||
|
this.registry = registry;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getRole() {
|
||||||
|
return role;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRole(Integer role) {
|
||||||
|
this.role = role;
|
||||||
|
}
|
||||||
|
|
||||||
public Integer getRole() {
|
|
||||||
return role;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRole(Integer role) {
|
|
||||||
this.role = role;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,75 +1,67 @@
|
||||||
package eu.eudat.entities;
|
package eu.eudat.entities;
|
||||||
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
import javax.persistence.Column;
|
|
||||||
import javax.persistence.Entity;
|
|
||||||
import javax.persistence.GeneratedValue;
|
|
||||||
import javax.persistence.Id;
|
|
||||||
import javax.persistence.Table;
|
|
||||||
|
|
||||||
import org.hibernate.annotations.GenericGenerator;
|
import org.hibernate.annotations.GenericGenerator;
|
||||||
import org.hibernate.annotations.Type;
|
import org.hibernate.annotations.Type;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIdentityInfo;
|
import javax.persistence.*;
|
||||||
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
|
import java.io.Serializable;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name="\"DatasetService\"")
|
@Table(name = "\"DatasetService\"")
|
||||||
public class DatasetService implements Serializable {
|
public class DatasetService implements Serializable {
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue
|
@GeneratedValue
|
||||||
@GenericGenerator(name = "uuid2", strategy = "uuid2")
|
@GenericGenerator(name = "uuid2", strategy = "uuid2")
|
||||||
@Column(name = "\"ID\"", updatable = false, nullable = false, columnDefinition = "BINARY(16)")
|
@Column(name = "\"ID\"", updatable = false, nullable = false, columnDefinition = "BINARY(16)")
|
||||||
private UUID id;
|
private UUID id;
|
||||||
|
|
||||||
|
|
||||||
@Type(type="org.hibernate.type.PostgresUUIDType") //DEPWARN dependency to Hibernate and PostgreSQL
|
|
||||||
@Column(name = "\"Dataset\"", nullable = false)
|
|
||||||
private UUID dataset;
|
|
||||||
|
|
||||||
@Type(type="org.hibernate.type.PostgresUUIDType") //DEPWARN dependency to Hibernate and PostgreSQL
|
|
||||||
@Column(name = "\"Service\"", nullable = false)
|
|
||||||
private UUID service;
|
|
||||||
|
|
||||||
@Column(name = "\"Role\"")
|
|
||||||
private Integer role;
|
|
||||||
|
|
||||||
public UUID getId() {
|
@Type(type = "org.hibernate.type.PostgresUUIDType") //DEPWARN dependency to Hibernate and PostgreSQL
|
||||||
return id;
|
@Column(name = "\"Dataset\"", nullable = false)
|
||||||
}
|
private UUID dataset;
|
||||||
|
|
||||||
public void setId(UUID id) {
|
@Type(type = "org.hibernate.type.PostgresUUIDType") //DEPWARN dependency to Hibernate and PostgreSQL
|
||||||
this.id = id;
|
@Column(name = "\"Service\"", nullable = false)
|
||||||
}
|
private UUID service;
|
||||||
|
|
||||||
public UUID getDataset() {
|
@Column(name = "\"Role\"")
|
||||||
return dataset;
|
private Integer role;
|
||||||
}
|
|
||||||
|
|
||||||
public void setDataset(UUID dataset) {
|
public UUID getId() {
|
||||||
this.dataset = dataset;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public UUID getService() {
|
public void setId(UUID id) {
|
||||||
return service;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setService(UUID service) {
|
public UUID getDataset() {
|
||||||
this.service = service;
|
return dataset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setDataset(UUID dataset) {
|
||||||
|
this.dataset = dataset;
|
||||||
|
}
|
||||||
|
|
||||||
|
public UUID getService() {
|
||||||
|
return service;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setService(UUID service) {
|
||||||
|
this.service = service;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getRole() {
|
||||||
|
return role;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRole(Integer role) {
|
||||||
|
this.role = role;
|
||||||
|
}
|
||||||
|
|
||||||
public Integer getRole() {
|
|
||||||
return role;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRole(Integer role) {
|
|
||||||
this.role = role;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
package eu.eudat.entities;
|
package eu.eudat.entities;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIdentityInfo;
|
|
||||||
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
|
|
||||||
import org.hibernate.annotations.GenericGenerator;
|
import org.hibernate.annotations.GenericGenerator;
|
||||||
|
|
||||||
import javax.persistence.*;
|
import javax.persistence.*;
|
||||||
|
@ -11,8 +9,8 @@ import java.util.UUID;
|
||||||
|
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name="\"ExternalDataset\"")
|
@Table(name = "\"ExternalDataset\"")
|
||||||
public class ExternalDataset implements DataEntity<ExternalDataset>{
|
public class ExternalDataset implements DataEntity<ExternalDataset> {
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue
|
@GeneratedValue
|
||||||
|
@ -36,9 +34,9 @@ public class ExternalDataset implements DataEntity<ExternalDataset>{
|
||||||
private Date modified;
|
private Date modified;
|
||||||
|
|
||||||
@OneToMany(fetch = FetchType.LAZY)
|
@OneToMany(fetch = FetchType.LAZY)
|
||||||
@JoinTable(name="\"DatasetExternalDataset\"",
|
@JoinTable(name = "\"DatasetExternalDataset\"",
|
||||||
joinColumns={@JoinColumn(name="\"ExternalDataset\"", referencedColumnName="\"Id\"")},
|
joinColumns = {@JoinColumn(name = "\"ExternalDataset\"", referencedColumnName = "\"Id\"")},
|
||||||
inverseJoinColumns={@JoinColumn(name="\"Dataset\"", referencedColumnName="\"ID\"")}
|
inverseJoinColumns = {@JoinColumn(name = "\"Dataset\"", referencedColumnName = "\"ID\"")}
|
||||||
)
|
)
|
||||||
private Set<Dataset> datasets;
|
private Set<Dataset> datasets;
|
||||||
|
|
||||||
|
|
|
@ -4,13 +4,12 @@ import org.hibernate.annotations.GenericGenerator;
|
||||||
import org.hibernate.annotations.Type;
|
import org.hibernate.annotations.Type;
|
||||||
|
|
||||||
import javax.persistence.*;
|
import javax.persistence.*;
|
||||||
import java.util.Date;
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name="\"Invitation\"")
|
@Table(name = "\"Invitation\"")
|
||||||
public class Invitation implements DataEntity<Invitation>{
|
public class Invitation implements DataEntity<Invitation> {
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue
|
@GeneratedValue
|
||||||
|
@ -35,7 +34,7 @@ public class Invitation implements DataEntity<Invitation>{
|
||||||
@Column(name = "\"AcceptedInvitation\"", nullable = false)
|
@Column(name = "\"AcceptedInvitation\"", nullable = false)
|
||||||
private boolean acceptedInvitation;
|
private boolean acceptedInvitation;
|
||||||
|
|
||||||
@Type(type="eu.eudat.typedefinition.XMLType")
|
@Type(type = "eu.eudat.typedefinition.XMLType")
|
||||||
@Column(name = "\"Properties\"", columnDefinition = "xml", nullable = true)
|
@Column(name = "\"Properties\"", columnDefinition = "xml", nullable = true)
|
||||||
private String properties;
|
private String properties;
|
||||||
|
|
||||||
|
|
|
@ -1,170 +1,157 @@
|
||||||
package eu.eudat.entities;
|
package eu.eudat.entities;
|
||||||
|
|
||||||
|
|
||||||
|
import org.hibernate.annotations.GenericGenerator;
|
||||||
|
import org.hibernate.annotations.Type;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import javax.persistence.Column;
|
|
||||||
import javax.persistence.Entity;
|
|
||||||
import javax.persistence.FetchType;
|
|
||||||
import javax.persistence.GeneratedValue;
|
|
||||||
import javax.persistence.Id;
|
|
||||||
import javax.persistence.JoinColumn;
|
|
||||||
import javax.persistence.JoinTable;
|
|
||||||
import javax.persistence.OneToMany;
|
|
||||||
import javax.persistence.Table;
|
|
||||||
|
|
||||||
import org.hibernate.annotations.GenericGenerator;
|
|
||||||
import org.hibernate.annotations.Type;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIdentityInfo;
|
|
||||||
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
|
|
||||||
|
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name="\"Organisation\"")
|
@Table(name = "\"Organisation\"")
|
||||||
public class Organisation implements Serializable,DataEntity<Organisation> {
|
public class Organisation implements Serializable, DataEntity<Organisation> {
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue
|
@GeneratedValue
|
||||||
@GenericGenerator(name = "uuid2", strategy = "uuid2")
|
@GenericGenerator(name = "uuid2", strategy = "uuid2")
|
||||||
@Column(name = "\"ID\"", updatable = false, nullable = false, columnDefinition = "BINARY(16)")
|
@Column(name = "\"ID\"", updatable = false, nullable = false, columnDefinition = "BINARY(16)")
|
||||||
private UUID id;
|
private UUID id;
|
||||||
|
|
||||||
@Column(name = "\"Label\"")
|
|
||||||
private String label;
|
|
||||||
|
|
||||||
@Column(name = "\"Abbreviation\"")
|
|
||||||
private String abbreviation;
|
|
||||||
|
|
||||||
@Type(type="eu.eudat.typedefinition.XMLType")
|
@Column(name = "\"Label\"")
|
||||||
@Column(name = "\"Reference\"", columnDefinition = "xml", nullable = true)
|
private String label;
|
||||||
private String reference;
|
|
||||||
|
|
||||||
@Column(name = "\"Uri\"")
|
|
||||||
private String uri;
|
|
||||||
|
|
||||||
@Type(type="eu.eudat.typedefinition.XMLType")
|
|
||||||
@Column(name = "\"Definition\"", columnDefinition = "xml", nullable = true)
|
|
||||||
private String definition;
|
|
||||||
|
|
||||||
|
@Column(name = "\"Abbreviation\"")
|
||||||
@OneToMany(fetch = FetchType.LAZY)
|
private String abbreviation;
|
||||||
@JoinTable(name="\"DMPOrganisation\"",
|
|
||||||
joinColumns={@JoinColumn(name="\"Organisation\"", referencedColumnName="\"ID\"")},
|
@Type(type = "eu.eudat.typedefinition.XMLType")
|
||||||
inverseJoinColumns={@JoinColumn(name="\"DMP\"", referencedColumnName="\"ID\"")}
|
@Column(name = "\"Reference\"", columnDefinition = "xml", nullable = true)
|
||||||
)
|
private String reference;
|
||||||
|
|
||||||
|
@Column(name = "\"Uri\"")
|
||||||
|
private String uri;
|
||||||
|
|
||||||
|
@Type(type = "eu.eudat.typedefinition.XMLType")
|
||||||
|
@Column(name = "\"Definition\"", columnDefinition = "xml", nullable = true)
|
||||||
|
private String definition;
|
||||||
|
|
||||||
|
|
||||||
|
@OneToMany(fetch = FetchType.LAZY)
|
||||||
|
@JoinTable(name = "\"DMPOrganisation\"",
|
||||||
|
joinColumns = {@JoinColumn(name = "\"Organisation\"", referencedColumnName = "\"ID\"")},
|
||||||
|
inverseJoinColumns = {@JoinColumn(name = "\"DMP\"", referencedColumnName = "\"ID\"")}
|
||||||
|
)
|
||||||
private Set<DMP> dMPs;
|
private Set<DMP> dMPs;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Column(name = "\"Status\"", nullable = false)
|
|
||||||
private Short status;
|
|
||||||
|
|
||||||
|
|
||||||
@Column(name = "\"Created\"")
|
|
||||||
private Date created = null;
|
|
||||||
|
|
||||||
@Column(name = "\"Modified\"")
|
|
||||||
private Date modified = new Date();
|
|
||||||
|
|
||||||
|
|
||||||
public Short getStatus() {
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void setStatus(Short status) {
|
@Column(name = "\"Status\"", nullable = false)
|
||||||
this.status = status;
|
private Short status;
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public Date getCreated() {
|
@Column(name = "\"Created\"")
|
||||||
return created;
|
private Date created = null;
|
||||||
}
|
|
||||||
|
@Column(name = "\"Modified\"")
|
||||||
|
private Date modified = new Date();
|
||||||
|
|
||||||
|
|
||||||
public void setCreated(Date created) {
|
public Short getStatus() {
|
||||||
this.created = created;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public Date getModified() {
|
public void setStatus(Short status) {
|
||||||
return modified;
|
this.status = status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void setModified(Date modified) {
|
public Date getCreated() {
|
||||||
this.modified = modified;
|
return created;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public UUID getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setId(UUID id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getLabel() {
|
|
||||||
return label;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLabel(String label) {
|
|
||||||
this.label = label;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getAbbreviation() {
|
|
||||||
return abbreviation;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAbbreviation(String abbreviation) {
|
|
||||||
this.abbreviation = abbreviation;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getReference() {
|
|
||||||
return reference;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setReference(String reference) {
|
|
||||||
this.reference = reference;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getUri() {
|
|
||||||
return uri;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUri(String uri) {
|
|
||||||
this.uri = uri;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDefinition() {
|
|
||||||
return definition;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDefinition(String definition) {
|
|
||||||
this.definition = definition;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Set<DMP> getdMPs() {
|
|
||||||
return dMPs;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setdMPs(Set<DMP> dMPs) {
|
|
||||||
this.dMPs = dMPs;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
public void setCreated(Date created) {
|
||||||
public void update(Organisation entity) {
|
this.created = created;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
public Date getModified() {
|
||||||
public Object[] getKeys() {
|
return modified;
|
||||||
return new UUID[]{this.id == null ? null : this.id};
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
public void setModified(Date modified) {
|
||||||
|
this.modified = modified;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public UUID getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(UUID id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLabel() {
|
||||||
|
return label;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLabel(String label) {
|
||||||
|
this.label = label;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAbbreviation() {
|
||||||
|
return abbreviation;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAbbreviation(String abbreviation) {
|
||||||
|
this.abbreviation = abbreviation;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getReference() {
|
||||||
|
return reference;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setReference(String reference) {
|
||||||
|
this.reference = reference;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUri() {
|
||||||
|
return uri;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUri(String uri) {
|
||||||
|
this.uri = uri;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDefinition() {
|
||||||
|
return definition;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDefinition(String definition) {
|
||||||
|
this.definition = definition;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Set<DMP> getdMPs() {
|
||||||
|
return dMPs;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setdMPs(Set<DMP> dMPs) {
|
||||||
|
this.dMPs = dMPs;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void update(Organisation entity) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object[] getKeys() {
|
||||||
|
return new UUID[]{this.id == null ? null : this.id};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,267 +1,254 @@
|
||||||
package eu.eudat.entities;
|
package eu.eudat.entities;
|
||||||
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import com.fasterxml.jackson.databind.SerializationFeature;
|
||||||
|
import org.hibernate.annotations.GenericGenerator;
|
||||||
|
import org.hibernate.annotations.Type;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import javax.persistence.Column;
|
|
||||||
import javax.persistence.Entity;
|
|
||||||
import javax.persistence.FetchType;
|
|
||||||
import javax.persistence.GeneratedValue;
|
|
||||||
import javax.persistence.Id;
|
|
||||||
import javax.persistence.JoinColumn;
|
|
||||||
import javax.persistence.ManyToOne;
|
|
||||||
import javax.persistence.OneToMany;
|
|
||||||
import javax.persistence.Table;
|
|
||||||
|
|
||||||
import org.hibernate.annotations.GenericGenerator;
|
|
||||||
import org.hibernate.annotations.Type;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIdentityInfo;
|
|
||||||
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
|
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
||||||
import com.fasterxml.jackson.databind.SerializationFeature;
|
|
||||||
|
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name="\"Project\"")
|
@Table(name = "\"Project\"")
|
||||||
public class Project implements DataEntity<Project> {
|
public class Project implements DataEntity<Project> {
|
||||||
|
|
||||||
public enum Status {
|
public enum Status {
|
||||||
ACTIVE((short) 1), INACTIVE((short) 0), DELETED((short) 99);
|
ACTIVE((short) 1), INACTIVE((short) 0), DELETED((short) 99);
|
||||||
|
|
||||||
private short value;
|
private short value;
|
||||||
|
|
||||||
private Status(short value) {
|
private Status(short value) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public short getValue() {
|
public short getValue() {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Status fromInteger(int value) {
|
public static Status fromInteger(int value) {
|
||||||
switch (value) {
|
switch (value) {
|
||||||
case 0:
|
case 0:
|
||||||
return INACTIVE;
|
return INACTIVE;
|
||||||
case 1:
|
case 1:
|
||||||
return ACTIVE;
|
return ACTIVE;
|
||||||
case 99:
|
case 99:
|
||||||
return DELETED;
|
return DELETED;
|
||||||
default:
|
default:
|
||||||
throw new RuntimeException("Unsupported Project Status");
|
throw new RuntimeException("Unsupported Project Status");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue
|
@GeneratedValue
|
||||||
@GenericGenerator(name = "uuid2", strategy = "uuid2")
|
@GenericGenerator(name = "uuid2", strategy = "uuid2")
|
||||||
@Column(name = "\"ID\"", updatable = false, nullable = false, columnDefinition = "BINARY(16)")
|
@Column(name = "\"ID\"", updatable = false, nullable = false, columnDefinition = "BINARY(16)")
|
||||||
private UUID id;
|
private UUID id;
|
||||||
|
|
||||||
|
|
||||||
@OneToMany(mappedBy = "project")
|
@OneToMany(mappedBy = "project")
|
||||||
private Set<DMP> dmps;
|
private Set<DMP> dmps;
|
||||||
|
|
||||||
|
|
||||||
@Column(name = "\"Label\"")
|
@Column(name = "\"Label\"")
|
||||||
private String label;
|
private String label;
|
||||||
|
|
||||||
@Column(name = "\"Abbreviation\"")
|
@Column(name = "\"Abbreviation\"")
|
||||||
private String abbreviation;
|
private String abbreviation;
|
||||||
|
|
||||||
|
@Type(type = "eu.eudat.typedefinition.XMLType")
|
||||||
|
@Column(name = "\"Reference\"", columnDefinition = "xml", nullable = true)
|
||||||
|
private String reference;
|
||||||
|
|
||||||
|
@Column(name = "\"Uri\"")
|
||||||
|
private String uri;
|
||||||
|
|
||||||
|
@Type(type = "eu.eudat.typedefinition.XMLType")
|
||||||
|
@Column(name = "\"Definition\"", columnDefinition = "xml", nullable = true)
|
||||||
|
private String definition;
|
||||||
|
|
||||||
|
|
||||||
|
@Column(name = "\"StartDate\"", nullable = false)
|
||||||
|
private Date startdate = null;
|
||||||
|
|
||||||
|
@Column(name = "\"EndDate\"", nullable = false)
|
||||||
|
private Date enddate = null;
|
||||||
|
|
||||||
|
|
||||||
|
@Column(name = "\"Status\"", nullable = false)
|
||||||
|
private Short status;
|
||||||
|
|
||||||
|
|
||||||
@Type(type="eu.eudat.typedefinition.XMLType")
|
|
||||||
@Column(name = "\"Reference\"", columnDefinition = "xml", nullable = true)
|
|
||||||
private String reference;
|
|
||||||
|
|
||||||
@Column(name = "\"Uri\"")
|
|
||||||
private String uri;
|
|
||||||
|
|
||||||
@Type(type="eu.eudat.typedefinition.XMLType")
|
|
||||||
@Column(name = "\"Definition\"", columnDefinition = "xml", nullable = true)
|
|
||||||
private String definition;
|
|
||||||
|
|
||||||
|
|
||||||
@Column(name = "\"StartDate\"", nullable = false)
|
|
||||||
private Date startdate = null;
|
|
||||||
|
|
||||||
@Column(name = "\"EndDate\"", nullable = false)
|
|
||||||
private Date enddate = null;
|
|
||||||
|
|
||||||
|
|
||||||
@Column(name = "\"Status\"", nullable = false)
|
|
||||||
private Short status;
|
|
||||||
|
|
||||||
|
|
||||||
@ManyToOne(fetch = FetchType.LAZY)
|
@ManyToOne(fetch = FetchType.LAZY)
|
||||||
@JoinColumn(name = "\"CreationUser\"", nullable = true)
|
@JoinColumn(name = "\"CreationUser\"", nullable = true)
|
||||||
private UserInfo creationUser;
|
private UserInfo creationUser;
|
||||||
|
|
||||||
|
|
||||||
@Column(name = "\"Created\"")
|
|
||||||
private Date created = null;
|
|
||||||
|
|
||||||
@Column(name = "\"Modified\"")
|
|
||||||
private Date modified = new Date();
|
|
||||||
|
|
||||||
@Column(name = "\"Description\"")
|
|
||||||
private String description;
|
|
||||||
|
|
||||||
|
|
||||||
public String getDescription() {
|
|
||||||
return description;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void setDescription(String description) {
|
@Column(name = "\"Created\"")
|
||||||
this.description = description;
|
private Date created = null;
|
||||||
}
|
|
||||||
|
@Column(name = "\"Modified\"")
|
||||||
|
private Date modified = new Date();
|
||||||
|
|
||||||
|
@Column(name = "\"Description\"")
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
|
||||||
public Short getStatus() {
|
public String getDescription() {
|
||||||
return status;
|
return description;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void setStatus(Short status) {
|
public void setDescription(String description) {
|
||||||
this.status = status;
|
this.description = description;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public Date getCreated() {
|
public Short getStatus() {
|
||||||
return created;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void setCreated(Date created) {
|
public void setStatus(Short status) {
|
||||||
this.created = created;
|
this.status = status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public Date getModified() {
|
public Date getCreated() {
|
||||||
return modified;
|
return created;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void setModified(Date modified) {
|
public void setCreated(Date created) {
|
||||||
this.modified = modified;
|
this.created = created;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public Date getStartdate() {
|
|
||||||
return startdate;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void setStartdate(Date startdate) {
|
public Date getModified() {
|
||||||
this.startdate = startdate;
|
return modified;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public Date getEnddate() {
|
public void setModified(Date modified) {
|
||||||
return enddate;
|
this.modified = modified;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void setEnddate(Date enddate) {
|
public Date getStartdate() {
|
||||||
this.enddate = enddate;
|
return startdate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public UUID getId() {
|
public void setStartdate(Date startdate) {
|
||||||
return id;
|
this.startdate = startdate;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setId(UUID id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getLabel() {
|
|
||||||
return label;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLabel(String label) {
|
|
||||||
this.label = label;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getAbbreviation() {
|
|
||||||
return abbreviation;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAbbreviation(String abbreviation) {
|
|
||||||
this.abbreviation = abbreviation;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getReference() {
|
|
||||||
return reference;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setReference(String reference) {
|
|
||||||
this.reference = reference;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getUri() {
|
|
||||||
return uri;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUri(String uri) {
|
|
||||||
this.uri = uri;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDefinition() {
|
|
||||||
return definition;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDefinition(String definition) {
|
|
||||||
this.definition = definition;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public Set<DMP> getDmps() {
|
public Date getEnddate() {
|
||||||
return dmps;
|
return enddate;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDmps(Set<DMP> dmps) {
|
|
||||||
this.dmps = dmps;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public UserInfo getCreationUser() {
|
public void setEnddate(Date enddate) {
|
||||||
return creationUser;
|
this.enddate = enddate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void setCreationUser(UserInfo creationUser) {
|
public UUID getId() {
|
||||||
this.creationUser = creationUser;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setId(UUID id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLabel() {
|
||||||
|
return label;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLabel(String label) {
|
||||||
|
this.label = label;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAbbreviation() {
|
||||||
|
return abbreviation;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAbbreviation(String abbreviation) {
|
||||||
|
this.abbreviation = abbreviation;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getReference() {
|
||||||
|
return reference;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setReference(String reference) {
|
||||||
|
this.reference = reference;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUri() {
|
||||||
|
return uri;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUri(String uri) {
|
||||||
|
this.uri = uri;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDefinition() {
|
||||||
|
return definition;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDefinition(String definition) {
|
||||||
|
this.definition = definition;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public String toString() {
|
public Set<DMP> getDmps() {
|
||||||
try {
|
return dmps;
|
||||||
return new ObjectMapper().enable(SerializationFeature.INDENT_OUTPUT).writeValueAsString(this).replace("\"", """);
|
}
|
||||||
} catch (JsonProcessingException e) {
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
public void setDmps(Set<DMP> dmps) {
|
||||||
public void update(Project entity) {
|
this.dmps = dmps;
|
||||||
this.description = entity.getDescription();
|
}
|
||||||
this.label = entity.getLabel();
|
|
||||||
this.abbreviation = entity.getAbbreviation();
|
|
||||||
this.created = entity.getCreated();
|
|
||||||
this.definition = entity.getDefinition();
|
|
||||||
this.dmps = entity.getDmps();
|
|
||||||
this.enddate = entity.getEnddate();
|
|
||||||
//this.creationUser = entity.getCreationUser(); //TODO
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Object[] getKeys() {
|
public UserInfo getCreationUser() {
|
||||||
return new UUID[]{this.id == null ? null : this.id};
|
return creationUser;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setCreationUser(UserInfo creationUser) {
|
||||||
|
this.creationUser = creationUser;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String toString() {
|
||||||
|
try {
|
||||||
|
return new ObjectMapper().enable(SerializationFeature.INDENT_OUTPUT).writeValueAsString(this).replace("\"", """);
|
||||||
|
} catch (JsonProcessingException e) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void update(Project entity) {
|
||||||
|
this.description = entity.getDescription();
|
||||||
|
this.label = entity.getLabel();
|
||||||
|
this.abbreviation = entity.getAbbreviation();
|
||||||
|
this.created = entity.getCreated();
|
||||||
|
this.definition = entity.getDefinition();
|
||||||
|
this.dmps = entity.getDmps();
|
||||||
|
this.enddate = entity.getEnddate();
|
||||||
|
//this.creationUser = entity.getCreationUser(); //TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object[] getKeys() {
|
||||||
|
return new UUID[]{this.id == null ? null : this.id};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,169 +1,155 @@
|
||||||
package eu.eudat.entities;
|
package eu.eudat.entities;
|
||||||
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
import javax.persistence.Column;
|
|
||||||
import javax.persistence.Entity;
|
|
||||||
import javax.persistence.FetchType;
|
|
||||||
import javax.persistence.GeneratedValue;
|
|
||||||
import javax.persistence.Id;
|
|
||||||
import javax.persistence.JoinColumn;
|
|
||||||
import javax.persistence.JoinTable;
|
|
||||||
import javax.persistence.OneToMany;
|
|
||||||
import javax.persistence.Table;
|
|
||||||
|
|
||||||
import org.hibernate.annotations.GenericGenerator;
|
import org.hibernate.annotations.GenericGenerator;
|
||||||
import org.hibernate.annotations.Type;
|
import org.hibernate.annotations.Type;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIdentityInfo;
|
import javax.persistence.*;
|
||||||
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
|
import java.util.Date;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name="\"Registry\"")
|
@Table(name = "\"Registry\"")
|
||||||
public class Registry implements DataEntity<Registry> {
|
public class Registry implements DataEntity<Registry> {
|
||||||
|
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue
|
@GeneratedValue
|
||||||
@GenericGenerator(name = "uuid2", strategy = "uuid2")
|
@GenericGenerator(name = "uuid2", strategy = "uuid2")
|
||||||
@Column(name = "\"ID\"", updatable = false, nullable = false, columnDefinition = "BINARY(16)")
|
@Column(name = "\"ID\"", updatable = false, nullable = false, columnDefinition = "BINARY(16)")
|
||||||
private UUID id;
|
private UUID id;
|
||||||
|
|
||||||
@Column(name = "\"Label\"")
|
|
||||||
private String label;
|
|
||||||
|
|
||||||
@Column(name = "\"Abbreviation\"")
|
|
||||||
private String abbreviation;
|
|
||||||
|
|
||||||
@Column(name = "\"Reference\"", nullable = true)
|
@Column(name = "\"Label\"")
|
||||||
private String reference;
|
private String label;
|
||||||
|
|
||||||
@Column(name = "\"Uri\"")
|
|
||||||
private String uri;
|
|
||||||
|
|
||||||
@Type(type="eu.eudat.typedefinition.XMLType")
|
|
||||||
@Column(name = "\"Definition\"", columnDefinition = "xml", nullable = true)
|
|
||||||
private String definition;
|
|
||||||
|
|
||||||
|
@Column(name = "\"Abbreviation\"")
|
||||||
@OneToMany(fetch = FetchType.LAZY)
|
private String abbreviation;
|
||||||
@JoinTable(name="\"DatasetRegistry\"",
|
|
||||||
joinColumns={@JoinColumn(name="\"Registry\"", referencedColumnName="\"ID\"")},
|
@Column(name = "\"Reference\"", nullable = true)
|
||||||
inverseJoinColumns={@JoinColumn(name="\"Dataset\"", referencedColumnName="\"ID\"")}
|
private String reference;
|
||||||
)
|
|
||||||
|
@Column(name = "\"Uri\"")
|
||||||
|
private String uri;
|
||||||
|
|
||||||
|
@Type(type = "eu.eudat.typedefinition.XMLType")
|
||||||
|
@Column(name = "\"Definition\"", columnDefinition = "xml", nullable = true)
|
||||||
|
private String definition;
|
||||||
|
|
||||||
|
|
||||||
|
@OneToMany(fetch = FetchType.LAZY)
|
||||||
|
@JoinTable(name = "\"DatasetRegistry\"",
|
||||||
|
joinColumns = {@JoinColumn(name = "\"Registry\"", referencedColumnName = "\"ID\"")},
|
||||||
|
inverseJoinColumns = {@JoinColumn(name = "\"Dataset\"", referencedColumnName = "\"ID\"")}
|
||||||
|
)
|
||||||
private Set<Dataset> datasets;
|
private Set<Dataset> datasets;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Column(name = "\"Status\"", nullable = false)
|
|
||||||
private Short status;
|
|
||||||
|
|
||||||
|
|
||||||
@Column(name = "\"Created\"")
|
|
||||||
private Date created = null;
|
|
||||||
|
|
||||||
@Column(name = "\"Modified\"")
|
|
||||||
private Date modified = new Date();
|
|
||||||
|
|
||||||
|
|
||||||
public Short getStatus() {
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void setStatus(Short status) {
|
@Column(name = "\"Status\"", nullable = false)
|
||||||
this.status = status;
|
private Short status;
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public Date getCreated() {
|
@Column(name = "\"Created\"")
|
||||||
return created;
|
private Date created = null;
|
||||||
}
|
|
||||||
|
@Column(name = "\"Modified\"")
|
||||||
|
private Date modified = new Date();
|
||||||
|
|
||||||
|
|
||||||
public void setCreated(Date created) {
|
public Short getStatus() {
|
||||||
this.created = created;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public Date getModified() {
|
public void setStatus(Short status) {
|
||||||
return modified;
|
this.status = status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void setModified(Date modified) {
|
public Date getCreated() {
|
||||||
this.modified = modified;
|
return created;
|
||||||
}
|
}
|
||||||
|
|
||||||
public UUID getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setId(UUID id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getLabel() {
|
|
||||||
return label;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLabel(String label) {
|
|
||||||
this.label = label;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getAbbreviation() {
|
|
||||||
return abbreviation;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAbbreviation(String abbreviation) {
|
|
||||||
this.abbreviation = abbreviation;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getReference() {
|
|
||||||
return reference;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setReference(String reference) {
|
|
||||||
this.reference = reference;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getUri() {
|
|
||||||
return uri;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUri(String uri) {
|
|
||||||
this.uri = uri;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDefinition() {
|
|
||||||
return definition;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDefinition(String definition) {
|
|
||||||
this.definition = definition;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Set<Dataset> getDatasets() {
|
|
||||||
return datasets;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDatasets(Set<Dataset> datasets) {
|
|
||||||
this.datasets = datasets;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
public void setCreated(Date created) {
|
||||||
public void update(Registry entity) {
|
this.created = created;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
public Date getModified() {
|
||||||
public Object[] getKeys() {
|
return modified;
|
||||||
return new UUID[]{this.id == null ? null : this.id};
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
public void setModified(Date modified) {
|
||||||
|
this.modified = modified;
|
||||||
|
}
|
||||||
|
|
||||||
|
public UUID getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(UUID id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLabel() {
|
||||||
|
return label;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLabel(String label) {
|
||||||
|
this.label = label;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAbbreviation() {
|
||||||
|
return abbreviation;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAbbreviation(String abbreviation) {
|
||||||
|
this.abbreviation = abbreviation;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getReference() {
|
||||||
|
return reference;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setReference(String reference) {
|
||||||
|
this.reference = reference;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUri() {
|
||||||
|
return uri;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUri(String uri) {
|
||||||
|
this.uri = uri;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDefinition() {
|
||||||
|
return definition;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDefinition(String definition) {
|
||||||
|
this.definition = definition;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Set<Dataset> getDatasets() {
|
||||||
|
return datasets;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDatasets(Set<Dataset> datasets) {
|
||||||
|
this.datasets = datasets;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void update(Registry entity) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object[] getKeys() {
|
||||||
|
return new UUID[]{this.id == null ? null : this.id};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,169 +1,156 @@
|
||||||
package eu.eudat.entities;
|
package eu.eudat.entities;
|
||||||
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
import javax.persistence.Column;
|
|
||||||
import javax.persistence.Entity;
|
|
||||||
import javax.persistence.FetchType;
|
|
||||||
import javax.persistence.GeneratedValue;
|
|
||||||
import javax.persistence.Id;
|
|
||||||
import javax.persistence.JoinColumn;
|
|
||||||
import javax.persistence.JoinTable;
|
|
||||||
import javax.persistence.OneToMany;
|
|
||||||
import javax.persistence.Table;
|
|
||||||
|
|
||||||
import org.hibernate.annotations.GenericGenerator;
|
import org.hibernate.annotations.GenericGenerator;
|
||||||
import org.hibernate.annotations.Type;
|
import org.hibernate.annotations.Type;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIdentityInfo;
|
import javax.persistence.*;
|
||||||
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
|
import java.util.Date;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name="\"Researcher\"")
|
@Table(name = "\"Researcher\"")
|
||||||
public class Researcher implements DataEntity<Researcher> {
|
public class Researcher implements DataEntity<Researcher> {
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue
|
@GeneratedValue
|
||||||
@GenericGenerator(name = "uuid2", strategy = "uuid2")
|
@GenericGenerator(name = "uuid2", strategy = "uuid2")
|
||||||
@Column(name = "\"ID\"", updatable = false, nullable = false, columnDefinition = "BINARY(16)")
|
@Column(name = "\"ID\"", updatable = false, nullable = false, columnDefinition = "BINARY(16)")
|
||||||
private UUID id;
|
private UUID id;
|
||||||
|
|
||||||
@Column(name = "\"Label\"")
|
|
||||||
private String label;
|
|
||||||
|
|
||||||
@Column(name = "\"Uri\"")
|
|
||||||
private String uri;
|
|
||||||
|
|
||||||
@Column(name = "\"PrimaryEmail\"")
|
@Column(name = "\"Label\"")
|
||||||
private String primaryEmail;
|
private String label;
|
||||||
|
|
||||||
@Type(type="eu.eudat.typedefinition.XMLType")
|
|
||||||
@Column(name = "\"Definition\"", columnDefinition = "xml", nullable = true)
|
|
||||||
private String definition;
|
|
||||||
|
|
||||||
@Type(type="eu.eudat.typedefinition.XMLType")
|
|
||||||
@Column(name = "\"Reference\"", columnDefinition = "xml", nullable = true)
|
|
||||||
private String reference;
|
|
||||||
|
|
||||||
|
@Column(name = "\"Uri\"")
|
||||||
@OneToMany(fetch = FetchType.LAZY)
|
private String uri;
|
||||||
@JoinTable(name="\"DMPResearcher\"",
|
|
||||||
joinColumns={@JoinColumn(name="\"Researcher\"", referencedColumnName="\"ID\"")},
|
@Column(name = "\"PrimaryEmail\"")
|
||||||
inverseJoinColumns={@JoinColumn(name="\"DMP\"", referencedColumnName="\"ID\"")}
|
private String primaryEmail;
|
||||||
)
|
|
||||||
|
@Type(type = "eu.eudat.typedefinition.XMLType")
|
||||||
|
@Column(name = "\"Definition\"", columnDefinition = "xml", nullable = true)
|
||||||
|
private String definition;
|
||||||
|
|
||||||
|
@Type(type = "eu.eudat.typedefinition.XMLType")
|
||||||
|
@Column(name = "\"Reference\"", columnDefinition = "xml", nullable = true)
|
||||||
|
private String reference;
|
||||||
|
|
||||||
|
|
||||||
|
@OneToMany(fetch = FetchType.LAZY)
|
||||||
|
@JoinTable(name = "\"DMPResearcher\"",
|
||||||
|
joinColumns = {@JoinColumn(name = "\"Researcher\"", referencedColumnName = "\"ID\"")},
|
||||||
|
inverseJoinColumns = {@JoinColumn(name = "\"DMP\"", referencedColumnName = "\"ID\"")}
|
||||||
|
)
|
||||||
private Set<DMP> dMPs;
|
private Set<DMP> dMPs;
|
||||||
|
|
||||||
|
|
||||||
@Column(name = "\"Status\"", nullable = false)
|
|
||||||
private Short status;
|
|
||||||
|
|
||||||
|
|
||||||
@Column(name = "\"Created\"")
|
|
||||||
private Date created = null;
|
|
||||||
|
|
||||||
@Column(name = "\"Modified\"")
|
|
||||||
private Date modified = new Date();
|
|
||||||
|
|
||||||
|
|
||||||
public Short getStatus() {
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void setStatus(Short status) {
|
@Column(name = "\"Status\"", nullable = false)
|
||||||
this.status = status;
|
private Short status;
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public Date getCreated() {
|
@Column(name = "\"Created\"")
|
||||||
return created;
|
private Date created = null;
|
||||||
}
|
|
||||||
|
@Column(name = "\"Modified\"")
|
||||||
|
private Date modified = new Date();
|
||||||
|
|
||||||
|
|
||||||
public void setCreated(Date created) {
|
public Short getStatus() {
|
||||||
this.created = created;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public Date getModified() {
|
public void setStatus(Short status) {
|
||||||
return modified;
|
this.status = status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void setModified(Date modified) {
|
public Date getCreated() {
|
||||||
this.modified = modified;
|
return created;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public UUID getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setId(UUID id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getLabel() {
|
|
||||||
return label;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLabel(String label) {
|
|
||||||
this.label = label;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getPrimaryEmail() {
|
|
||||||
return primaryEmail;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPrimaryEmail(String primaryEmail) {
|
|
||||||
this.primaryEmail = primaryEmail;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getReference() {
|
|
||||||
return reference;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setReference(String reference) {
|
|
||||||
this.reference = reference;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getUri() {
|
|
||||||
return uri;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUri(String uri) {
|
|
||||||
this.uri = uri;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDefinition() {
|
|
||||||
return definition;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDefinition(String definition) {
|
|
||||||
this.definition = definition;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Set<DMP> getdMPs() {
|
|
||||||
return dMPs;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setdMPs(Set<DMP> dMPs) {
|
|
||||||
this.dMPs = dMPs;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
public void setCreated(Date created) {
|
||||||
public void update(Researcher entity) {
|
this.created = created;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
public Date getModified() {
|
||||||
public Object[] getKeys() {
|
return modified;
|
||||||
return new UUID[]{this.id == null ? null : this.id};
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
public void setModified(Date modified) {
|
||||||
|
this.modified = modified;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public UUID getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(UUID id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLabel() {
|
||||||
|
return label;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLabel(String label) {
|
||||||
|
this.label = label;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPrimaryEmail() {
|
||||||
|
return primaryEmail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPrimaryEmail(String primaryEmail) {
|
||||||
|
this.primaryEmail = primaryEmail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getReference() {
|
||||||
|
return reference;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setReference(String reference) {
|
||||||
|
this.reference = reference;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUri() {
|
||||||
|
return uri;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUri(String uri) {
|
||||||
|
this.uri = uri;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDefinition() {
|
||||||
|
return definition;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDefinition(String definition) {
|
||||||
|
this.definition = definition;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Set<DMP> getdMPs() {
|
||||||
|
return dMPs;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setdMPs(Set<DMP> dMPs) {
|
||||||
|
this.dMPs = dMPs;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void update(Researcher entity) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object[] getKeys() {
|
||||||
|
return new UUID[]{this.id == null ? null : this.id};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,169 +1,156 @@
|
||||||
package eu.eudat.entities;
|
package eu.eudat.entities;
|
||||||
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
import javax.persistence.Column;
|
|
||||||
import javax.persistence.Entity;
|
|
||||||
import javax.persistence.FetchType;
|
|
||||||
import javax.persistence.GeneratedValue;
|
|
||||||
import javax.persistence.Id;
|
|
||||||
import javax.persistence.JoinColumn;
|
|
||||||
import javax.persistence.JoinTable;
|
|
||||||
import javax.persistence.OneToMany;
|
|
||||||
import javax.persistence.Table;
|
|
||||||
|
|
||||||
import org.hibernate.annotations.GenericGenerator;
|
import org.hibernate.annotations.GenericGenerator;
|
||||||
import org.hibernate.annotations.Type;
|
import org.hibernate.annotations.Type;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIdentityInfo;
|
import javax.persistence.*;
|
||||||
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
|
import java.util.Date;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name="\"Service\"")
|
@Table(name = "\"Service\"")
|
||||||
public class Service implements DataEntity<Service> {
|
public class Service implements DataEntity<Service> {
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue
|
@GeneratedValue
|
||||||
@GenericGenerator(name = "uuid2", strategy = "uuid2")
|
@GenericGenerator(name = "uuid2", strategy = "uuid2")
|
||||||
@Column(name = "\"ID\"", updatable = false, nullable = false, columnDefinition = "BINARY(16)")
|
@Column(name = "\"ID\"", updatable = false, nullable = false, columnDefinition = "BINARY(16)")
|
||||||
private UUID id;
|
private UUID id;
|
||||||
|
|
||||||
|
|
||||||
@Column(name = "\"Label\"")
|
|
||||||
private String label;
|
|
||||||
|
|
||||||
@Column(name = "\"Abbreviation\"")
|
|
||||||
private String abbreviation;
|
|
||||||
|
|
||||||
@Column(name = "\"Reference\"", nullable = true)
|
|
||||||
private String reference;
|
|
||||||
|
|
||||||
@Column(name = "\"Uri\"")
|
|
||||||
private String uri;
|
|
||||||
|
|
||||||
@Type(type="eu.eudat.typedefinition.XMLType")
|
|
||||||
@Column(name = "\"Definition\"", columnDefinition = "xml", nullable = false)
|
|
||||||
private String definition;
|
|
||||||
|
|
||||||
|
@Column(name = "\"Label\"")
|
||||||
@OneToMany(fetch = FetchType.LAZY)
|
private String label;
|
||||||
@JoinTable(name="\"DatasetService\"",
|
|
||||||
joinColumns={@JoinColumn(name="\"Service\"", referencedColumnName="\"ID\"")},
|
@Column(name = "\"Abbreviation\"")
|
||||||
inverseJoinColumns={@JoinColumn(name="\"Dataset\"", referencedColumnName="\"ID\"")}
|
private String abbreviation;
|
||||||
)
|
|
||||||
|
@Column(name = "\"Reference\"", nullable = true)
|
||||||
|
private String reference;
|
||||||
|
|
||||||
|
@Column(name = "\"Uri\"")
|
||||||
|
private String uri;
|
||||||
|
|
||||||
|
@Type(type = "eu.eudat.typedefinition.XMLType")
|
||||||
|
@Column(name = "\"Definition\"", columnDefinition = "xml", nullable = false)
|
||||||
|
private String definition;
|
||||||
|
|
||||||
|
|
||||||
|
@OneToMany(fetch = FetchType.LAZY)
|
||||||
|
@JoinTable(name = "\"DatasetService\"",
|
||||||
|
joinColumns = {@JoinColumn(name = "\"Service\"", referencedColumnName = "\"ID\"")},
|
||||||
|
inverseJoinColumns = {@JoinColumn(name = "\"Dataset\"", referencedColumnName = "\"ID\"")}
|
||||||
|
)
|
||||||
private Set<Dataset> datasets;
|
private Set<Dataset> datasets;
|
||||||
|
|
||||||
|
|
||||||
@Column(name = "\"Status\"", nullable = false)
|
|
||||||
private Short status;
|
|
||||||
|
|
||||||
|
|
||||||
@Column(name = "\"Created\"")
|
|
||||||
private Date created = null;
|
|
||||||
|
|
||||||
@Column(name = "\"Modified\"")
|
|
||||||
private Date modified = new Date();
|
|
||||||
|
|
||||||
|
|
||||||
public Short getStatus() {
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void setStatus(Short status) {
|
@Column(name = "\"Status\"", nullable = false)
|
||||||
this.status = status;
|
private Short status;
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public Date getCreated() {
|
@Column(name = "\"Created\"")
|
||||||
return created;
|
private Date created = null;
|
||||||
}
|
|
||||||
|
@Column(name = "\"Modified\"")
|
||||||
|
private Date modified = new Date();
|
||||||
|
|
||||||
|
|
||||||
public void setCreated(Date created) {
|
public Short getStatus() {
|
||||||
this.created = created;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public Date getModified() {
|
public void setStatus(Short status) {
|
||||||
return modified;
|
this.status = status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void setModified(Date modified) {
|
public Date getCreated() {
|
||||||
this.modified = modified;
|
return created;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public UUID getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setId(UUID id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getLabel() {
|
|
||||||
return label;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLabel(String label) {
|
|
||||||
this.label = label;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getAbbreviation() {
|
|
||||||
return abbreviation;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAbbreviation(String abbreviation) {
|
|
||||||
this.abbreviation = abbreviation;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getReference() {
|
|
||||||
return reference;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setReference(String reference) {
|
|
||||||
this.reference = reference;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getUri() {
|
|
||||||
return uri;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUri(String uri) {
|
|
||||||
this.uri = uri;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDefinition() {
|
|
||||||
return definition;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDefinition(String definition) {
|
|
||||||
this.definition = definition;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Set<Dataset> getDatasets() {
|
|
||||||
return datasets;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDatasets(Set<Dataset> datasets) {
|
|
||||||
this.datasets = datasets;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
public void setCreated(Date created) {
|
||||||
public void update(Service entity) {
|
this.created = created;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
public Date getModified() {
|
||||||
public Object[] getKeys() {
|
return modified;
|
||||||
return new UUID[]{this.id == null ? null : this.id};
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
public void setModified(Date modified) {
|
||||||
|
this.modified = modified;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public UUID getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(UUID id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLabel() {
|
||||||
|
return label;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLabel(String label) {
|
||||||
|
this.label = label;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAbbreviation() {
|
||||||
|
return abbreviation;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAbbreviation(String abbreviation) {
|
||||||
|
this.abbreviation = abbreviation;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getReference() {
|
||||||
|
return reference;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setReference(String reference) {
|
||||||
|
this.reference = reference;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUri() {
|
||||||
|
return uri;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUri(String uri) {
|
||||||
|
this.uri = uri;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDefinition() {
|
||||||
|
return definition;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDefinition(String definition) {
|
||||||
|
this.definition = definition;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Set<Dataset> getDatasets() {
|
||||||
|
return datasets;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDatasets(Set<Dataset> datasets) {
|
||||||
|
this.datasets = datasets;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void update(Service entity) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object[] getKeys() {
|
||||||
|
return new UUID[]{this.id == null ? null : this.id};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,23 +1,16 @@
|
||||||
package eu.eudat.entities;
|
package eu.eudat.entities;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import org.hibernate.annotations.GenericGenerator;
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
import javax.persistence.*;
|
import javax.persistence.*;
|
||||||
|
import java.util.UUID;
|
||||||
import eu.eudat.types.ApiMessageCode;
|
|
||||||
import org.hibernate.annotations.GenericGenerator;
|
|
||||||
import org.hibernate.annotations.Type;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIdentityInfo;
|
|
||||||
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
|
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "\"UserDMP\"")
|
@Table(name = "\"UserDMP\"")
|
||||||
public class UserDMP implements DataEntity<UserDMP> {
|
public class UserDMP implements DataEntity<UserDMP> {
|
||||||
|
|
||||||
public enum UserDMPRoles {
|
public enum UserDMPRoles {
|
||||||
OWNER(0) , USER(1);
|
OWNER(0), USER(1);
|
||||||
|
|
||||||
private Integer value;
|
private Integer value;
|
||||||
|
|
||||||
|
@ -49,11 +42,11 @@ public class UserDMP implements DataEntity<UserDMP> {
|
||||||
private UUID id;
|
private UUID id;
|
||||||
|
|
||||||
@OneToOne(fetch = FetchType.LAZY)
|
@OneToOne(fetch = FetchType.LAZY)
|
||||||
@JoinColumn(name="usr")
|
@JoinColumn(name = "usr")
|
||||||
private UserInfo user;
|
private UserInfo user;
|
||||||
|
|
||||||
@OneToOne(fetch = FetchType.LAZY)
|
@OneToOne(fetch = FetchType.LAZY)
|
||||||
@JoinColumn(name="dmp")
|
@JoinColumn(name = "dmp")
|
||||||
private DMP dmp;
|
private DMP dmp;
|
||||||
|
|
||||||
@Column(name = "role")
|
@Column(name = "role")
|
||||||
|
|
|
@ -1,184 +1,179 @@
|
||||||
package eu.eudat.entities;
|
package eu.eudat.entities;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import org.hibernate.annotations.GenericGenerator;
|
||||||
|
import org.hibernate.annotations.Type;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import javax.persistence.*;
|
|
||||||
|
|
||||||
import org.hibernate.annotations.GenericGenerator;
|
|
||||||
import org.hibernate.annotations.Type;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIdentityInfo;
|
|
||||||
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
|
|
||||||
|
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name="\"UserInfo\"")
|
@Table(name = "\"UserInfo\"")
|
||||||
@NamedEntityGraphs({
|
@NamedEntityGraphs({
|
||||||
@NamedEntityGraph(
|
@NamedEntityGraph(
|
||||||
name = "userInfo",
|
name = "userInfo",
|
||||||
attributeNodes = {@NamedAttributeNode("userRoles"), @NamedAttributeNode("credentials")})
|
attributeNodes = {@NamedAttributeNode("userRoles"), @NamedAttributeNode("credentials")})
|
||||||
})
|
})
|
||||||
public class UserInfo implements DataEntity<UserInfo>{
|
public class UserInfo implements DataEntity<UserInfo> {
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue
|
@GeneratedValue
|
||||||
@GenericGenerator(name = "uuid2", strategy = "uuid2")
|
@GenericGenerator(name = "uuid2", strategy = "uuid2")
|
||||||
@Column(name = "id", updatable = false, nullable = false, columnDefinition = "BINARY(16)")
|
@Column(name = "id", updatable = false, nullable = false, columnDefinition = "BINARY(16)")
|
||||||
private UUID id;
|
private UUID id;
|
||||||
|
|
||||||
|
|
||||||
@Column(name = "email", nullable = false)
|
|
||||||
private String email = null;
|
|
||||||
|
|
||||||
@Column(name = "authorization_level", nullable = false)
|
|
||||||
private Short authorization_level; //0 admin, 1 user
|
|
||||||
|
|
||||||
@Column(name = "usertype", nullable = false)
|
|
||||||
private Short usertype; // 0 internal, 1 external
|
|
||||||
|
|
||||||
@Column(name = "verified_email", nullable = true)
|
|
||||||
private Boolean verified_email = null;
|
|
||||||
|
|
||||||
@Column(name = "name", nullable = true)
|
|
||||||
private String name = null;
|
|
||||||
|
|
||||||
|
|
||||||
@Column(name = "created", nullable = false)
|
|
||||||
private Date created = null;
|
|
||||||
|
|
||||||
|
|
||||||
@Column(name = "lastloggedin", nullable = true)
|
|
||||||
private Date lastloggedin = null;
|
|
||||||
|
|
||||||
|
|
||||||
@Type(type="eu.eudat.typedefinition.XMLType")
|
|
||||||
@Column(name = "additionalinfo", columnDefinition = "xml", nullable = true)
|
|
||||||
private String additionalinfo;
|
|
||||||
|
|
||||||
@OneToMany(fetch = FetchType.LAZY)
|
@Column(name = "email", nullable = false)
|
||||||
@JoinTable(name="\"UserDMP\"",
|
private String email = null;
|
||||||
joinColumns={@JoinColumn(name="usr", referencedColumnName="id")},
|
|
||||||
inverseJoinColumns={@JoinColumn(name="dmp", referencedColumnName="\"ID\"")}
|
@Column(name = "authorization_level", nullable = false)
|
||||||
)
|
private Short authorization_level; //0 admin, 1 user
|
||||||
|
|
||||||
|
@Column(name = "usertype", nullable = false)
|
||||||
|
private Short usertype; // 0 internal, 1 external
|
||||||
|
|
||||||
|
@Column(name = "verified_email", nullable = true)
|
||||||
|
private Boolean verified_email = null;
|
||||||
|
|
||||||
|
@Column(name = "name", nullable = true)
|
||||||
|
private String name = null;
|
||||||
|
|
||||||
|
|
||||||
|
@Column(name = "created", nullable = false)
|
||||||
|
private Date created = null;
|
||||||
|
|
||||||
|
|
||||||
|
@Column(name = "lastloggedin", nullable = true)
|
||||||
|
private Date lastloggedin = null;
|
||||||
|
|
||||||
|
|
||||||
|
@Type(type = "eu.eudat.typedefinition.XMLType")
|
||||||
|
@Column(name = "additionalinfo", columnDefinition = "xml", nullable = true)
|
||||||
|
private String additionalinfo;
|
||||||
|
|
||||||
|
@OneToMany(fetch = FetchType.LAZY)
|
||||||
|
@JoinTable(name = "\"UserDMP\"",
|
||||||
|
joinColumns = {@JoinColumn(name = "usr", referencedColumnName = "id")},
|
||||||
|
inverseJoinColumns = {@JoinColumn(name = "dmp", referencedColumnName = "\"ID\"")}
|
||||||
|
)
|
||||||
private Set<DMP> dmps;
|
private Set<DMP> dmps;
|
||||||
|
|
||||||
@OneToMany(mappedBy="userInfo",fetch = FetchType.LAZY)
|
@OneToMany(mappedBy = "userInfo", fetch = FetchType.LAZY)
|
||||||
private Set<Credential> credentials = new HashSet<>();
|
private Set<Credential> credentials = new HashSet<>();
|
||||||
|
|
||||||
@OneToMany(mappedBy="userInfo",fetch = FetchType.LAZY)
|
@OneToMany(mappedBy = "userInfo", fetch = FetchType.LAZY)
|
||||||
private Set<UserRole> userRoles = new HashSet<>();
|
private Set<UserRole> userRoles = new HashSet<>();
|
||||||
|
|
||||||
public Set<DMP> getDmps() {
|
|
||||||
return dmps;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDmps(Set<DMP> dmps) {
|
public Set<DMP> getDmps() {
|
||||||
this.dmps = dmps;
|
return dmps;
|
||||||
}
|
}
|
||||||
|
|
||||||
public UUID getId() {
|
public void setDmps(Set<DMP> dmps) {
|
||||||
return id;
|
this.dmps = dmps;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setId(UUID id) {
|
public UUID getId() {
|
||||||
this.id = id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Date getCreated() {
|
public void setId(UUID id) {
|
||||||
return created;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCreated(Date created) {
|
public Date getCreated() {
|
||||||
this.created = created;
|
return created;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Date getLastloggedin() {
|
public void setCreated(Date created) {
|
||||||
return lastloggedin;
|
this.created = created;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setLastloggedin(Date lastloggedin) {
|
public Date getLastloggedin() {
|
||||||
this.lastloggedin = lastloggedin;
|
return lastloggedin;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getEmail() {
|
public void setLastloggedin(Date lastloggedin) {
|
||||||
return email;
|
this.lastloggedin = lastloggedin;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setEmail(String email) {
|
public String getEmail() {
|
||||||
this.email = email;
|
return email;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Short getAuthorization_level() {
|
public void setEmail(String email) {
|
||||||
return authorization_level;
|
this.email = email;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAuthorization_level(Short authorization_level) {
|
public Short getAuthorization_level() {
|
||||||
this.authorization_level = authorization_level;
|
return authorization_level;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Short getUsertype() {
|
public void setAuthorization_level(Short authorization_level) {
|
||||||
return usertype;
|
this.authorization_level = authorization_level;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUsertype(Short usertype) {
|
public Short getUsertype() {
|
||||||
this.usertype = usertype;
|
return usertype;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Boolean getVerified_email() {
|
public void setUsertype(Short usertype) {
|
||||||
return verified_email;
|
this.usertype = usertype;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setVerified_email(Boolean verified_email) {
|
public Boolean getVerified_email() {
|
||||||
this.verified_email = verified_email;
|
return verified_email;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName() {
|
public void setVerified_email(Boolean verified_email) {
|
||||||
return name;
|
this.verified_email = verified_email;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setName(String name) {
|
public String getName() {
|
||||||
this.name = name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getAdditionalinfo() {
|
public void setName(String name) {
|
||||||
return additionalinfo;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAdditionalinfo(String additionalinfo) {
|
public String getAdditionalinfo() {
|
||||||
this.additionalinfo = additionalinfo;
|
return additionalinfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Set<Credential> getCredentials() {
|
public void setAdditionalinfo(String additionalinfo) {
|
||||||
return credentials;
|
this.additionalinfo = additionalinfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCredentials(Set<Credential> credentials) {
|
public Set<Credential> getCredentials() {
|
||||||
this.credentials = credentials;
|
return credentials;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Set<UserRole> getUserRoles() {
|
public void setCredentials(Set<Credential> credentials) {
|
||||||
return userRoles;
|
this.credentials = credentials;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUserRoles(Set<UserRole> userRoles) {
|
public Set<UserRole> getUserRoles() {
|
||||||
this.userRoles = userRoles;
|
return userRoles;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public void setUserRoles(Set<UserRole> userRoles) {
|
||||||
public void update(UserInfo entity) {
|
this.userRoles = userRoles;
|
||||||
this.name = entity.getName();
|
}
|
||||||
this.email = entity.getEmail();
|
|
||||||
this.additionalinfo = entity.getAdditionalinfo();
|
|
||||||
this.lastloggedin = entity.getLastloggedin();
|
|
||||||
this.userRoles = entity.getUserRoles();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object[] getKeys() {
|
public void update(UserInfo entity) {
|
||||||
return new UUID[]{this.id == null ? null : this.id};
|
this.name = entity.getName();
|
||||||
}
|
this.email = entity.getEmail();
|
||||||
|
this.additionalinfo = entity.getAdditionalinfo();
|
||||||
|
this.lastloggedin = entity.getLastloggedin();
|
||||||
|
this.userRoles = entity.getUserRoles();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object[] getKeys() {
|
||||||
|
return new UUID[]{this.id == null ? null : this.id};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,6 @@ package eu.eudat.entities;
|
||||||
import org.hibernate.annotations.GenericGenerator;
|
import org.hibernate.annotations.GenericGenerator;
|
||||||
|
|
||||||
import javax.persistence.*;
|
import javax.persistence.*;
|
||||||
import java.util.Date;
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -6,8 +6,8 @@ import java.util.UUID;
|
||||||
|
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name="\"UserToken\"")
|
@Table(name = "\"UserToken\"")
|
||||||
public class UserToken implements DataEntity<UserToken>{
|
public class UserToken implements DataEntity<UserToken> {
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@Column(name = "\"Token\"", updatable = false, nullable = false, columnDefinition = "BINARY(16)")
|
@Column(name = "\"Token\"", updatable = false, nullable = false, columnDefinition = "BINARY(16)")
|
||||||
|
|
|
@ -2,6 +2,6 @@ package eu.eudat.entities.xmlmodels.datasetprofiledefinition;
|
||||||
|
|
||||||
import eu.eudat.utilities.DatabaseDefinition;
|
import eu.eudat.utilities.DatabaseDefinition;
|
||||||
|
|
||||||
public interface DatabaseViewStyleDefinition extends DatabaseDefinition{
|
public interface DatabaseViewStyleDefinition extends DatabaseDefinition {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,147 +1,155 @@
|
||||||
package eu.eudat.entities.xmlmodels.datasetprofiledefinition;
|
package eu.eudat.entities.xmlmodels.datasetprofiledefinition;
|
||||||
|
|
||||||
import eu.eudat.models.components.commons.DefaultValue;
|
import eu.eudat.models.components.commons.DefaultValue;
|
||||||
import org.w3c.dom.Document;
|
|
||||||
import org.w3c.dom.Element;
|
|
||||||
import eu.eudat.models.components.commons.ViewStyle;
|
import eu.eudat.models.components.commons.ViewStyle;
|
||||||
import eu.eudat.models.components.commons.Visibility;
|
import eu.eudat.models.components.commons.Visibility;
|
||||||
import eu.eudat.models.components.commons.datafield.FieldData;
|
import eu.eudat.models.components.commons.datafield.FieldData;
|
||||||
import eu.eudat.utilities.XmlSerializable;
|
import eu.eudat.utilities.XmlSerializable;
|
||||||
import eu.eudat.utilities.builders.ModelBuilder;
|
import eu.eudat.utilities.builders.ModelBuilder;
|
||||||
import eu.eudat.utilities.builders.XmlBuilder;
|
import eu.eudat.utilities.builders.XmlBuilder;
|
||||||
|
import org.w3c.dom.Document;
|
||||||
|
import org.w3c.dom.Element;
|
||||||
import org.w3c.dom.Node;
|
import org.w3c.dom.Node;
|
||||||
import org.w3c.dom.NodeList;
|
import org.w3c.dom.NodeList;
|
||||||
|
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class Field implements DatabaseViewStyleDefinition,XmlSerializable<Field>{
|
public class Field implements DatabaseViewStyleDefinition, XmlSerializable<Field> {
|
||||||
private String id;
|
private String id;
|
||||||
private int ordinal;
|
private int ordinal;
|
||||||
private ViewStyle viewStyle;
|
private ViewStyle viewStyle;
|
||||||
private DefaultValue defaultValue;
|
private DefaultValue defaultValue;
|
||||||
private Visibility visible;
|
private Visibility visible;
|
||||||
private FieldData data;
|
private FieldData data;
|
||||||
private List<eu.eudat.models.admin.components.datasetprofile.Field.ValidationType> validations;
|
private List<eu.eudat.models.admin.components.datasetprofile.Field.ValidationType> validations;
|
||||||
|
|
||||||
public String getId() {
|
public String getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
public void setId(String id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
public int getOrdinal() {
|
|
||||||
return ordinal;
|
|
||||||
}
|
|
||||||
public void setOrdinal(int ordinal) {
|
|
||||||
this.ordinal = ordinal;
|
|
||||||
}
|
|
||||||
public ViewStyle getViewStyle() {
|
|
||||||
return viewStyle;
|
|
||||||
}
|
|
||||||
public void setViewStyle(ViewStyle viewStyle) {
|
|
||||||
this.viewStyle = viewStyle;
|
|
||||||
}
|
|
||||||
|
|
||||||
public FieldData getData() {
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
public void setData(FieldData data) {
|
|
||||||
this.data = data;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DefaultValue getDefaultValue() {
|
public void setId(String id) {
|
||||||
return defaultValue;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDefaultValue(DefaultValue defaultValue) {
|
public int getOrdinal() {
|
||||||
this.defaultValue = defaultValue;
|
return ordinal;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Visibility getVisible() {
|
public void setOrdinal(int ordinal) {
|
||||||
return visible;
|
this.ordinal = ordinal;
|
||||||
}
|
}
|
||||||
public void setVisible(Visibility visible) {
|
|
||||||
this.visible = visible;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<eu.eudat.models.admin.components.datasetprofile.Field.ValidationType> getValidations() {
|
public ViewStyle getViewStyle() {
|
||||||
return validations;
|
return viewStyle;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setValidations(List<eu.eudat.models.admin.components.datasetprofile.Field.ValidationType> validations) {
|
public void setViewStyle(ViewStyle viewStyle) {
|
||||||
this.validations = validations;
|
this.viewStyle = viewStyle;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public FieldData getData() {
|
||||||
public Element toXml(Document doc) {
|
return data;
|
||||||
Element rootElement = doc.createElement("field");
|
}
|
||||||
rootElement.setAttribute("id", this.id);
|
|
||||||
rootElement.setAttribute("ordinal", ""+this.ordinal);
|
|
||||||
|
|
||||||
Element viewStyle = doc.createElement("viewStyle");
|
public void setData(FieldData data) {
|
||||||
viewStyle.setAttribute("renderstyle", this.viewStyle.getRenderStyle());
|
this.data = data;
|
||||||
viewStyle.setAttribute("cssClass", this.viewStyle.getCssClass());
|
}
|
||||||
|
|
||||||
Element visibility = this.visible.toXml(doc);
|
public DefaultValue getDefaultValue() {
|
||||||
|
return defaultValue;
|
||||||
|
}
|
||||||
|
|
||||||
Element defaultValue = doc.createElement("defaultValue");
|
public void setDefaultValue(DefaultValue defaultValue) {
|
||||||
defaultValue.setAttribute("type",this.defaultValue.getType());
|
this.defaultValue = defaultValue;
|
||||||
defaultValue.setAttribute("value",this.defaultValue.getValue());
|
}
|
||||||
|
|
||||||
Element validations = doc.createElement("validations");
|
public Visibility getVisible() {
|
||||||
for(eu.eudat.models.admin.components.datasetprofile.Field.ValidationType validationType: this.validations){
|
return visible;
|
||||||
Element validation = doc.createElement("validation");
|
}
|
||||||
validation.setAttribute("type",""+validationType.getValue());
|
|
||||||
validations.appendChild(validation);
|
|
||||||
}
|
|
||||||
|
|
||||||
rootElement.appendChild(validations);
|
public void setVisible(Visibility visible) {
|
||||||
rootElement.appendChild(defaultValue);
|
this.visible = visible;
|
||||||
rootElement.appendChild(visibility);
|
}
|
||||||
rootElement.appendChild(viewStyle);
|
|
||||||
if(this.data!=null)rootElement.appendChild(this.data.toXml(doc));
|
|
||||||
return rootElement;
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public Field fromXml(Element element) {
|
|
||||||
this.id = element.getAttribute("id");
|
|
||||||
this.ordinal = Integer.parseInt(element.getAttribute("ordinal"));
|
|
||||||
|
|
||||||
this.viewStyle = new ViewStyle();
|
public List<eu.eudat.models.admin.components.datasetprofile.Field.ValidationType> getValidations() {
|
||||||
Element viewStyle = (Element)XmlBuilder.getNodeFromListByTagName(element.getChildNodes(), "viewStyle");
|
return validations;
|
||||||
|
}
|
||||||
|
|
||||||
this.viewStyle.setRenderStyle(viewStyle.getAttribute("renderstyle"));
|
public void setValidations(List<eu.eudat.models.admin.components.datasetprofile.Field.ValidationType> validations) {
|
||||||
this.viewStyle.setCssClass(viewStyle.getAttribute("cssClass"));
|
this.validations = validations;
|
||||||
|
}
|
||||||
|
|
||||||
Element visibility = (Element)XmlBuilder.getNodeFromListByTagName(element.getChildNodes(), "visible");
|
@Override
|
||||||
|
public Element toXml(Document doc) {
|
||||||
|
Element rootElement = doc.createElement("field");
|
||||||
|
rootElement.setAttribute("id", this.id);
|
||||||
|
rootElement.setAttribute("ordinal", "" + this.ordinal);
|
||||||
|
|
||||||
this.visible = new Visibility().fromXml(visibility);
|
Element viewStyle = doc.createElement("viewStyle");
|
||||||
|
viewStyle.setAttribute("renderstyle", this.viewStyle.getRenderStyle());
|
||||||
|
viewStyle.setAttribute("cssClass", this.viewStyle.getCssClass());
|
||||||
|
|
||||||
Element dataElement = (Element)XmlBuilder.getNodeFromListByTagName(element.getChildNodes(), "data");
|
Element visibility = this.visible.toXml(doc);
|
||||||
|
|
||||||
Element defaultValue = (Element)XmlBuilder.getNodeFromListByTagName(element.getChildNodes(), "defaultValue");
|
Element defaultValue = doc.createElement("defaultValue");
|
||||||
|
defaultValue.setAttribute("type", this.defaultValue.getType());
|
||||||
|
defaultValue.setAttribute("value", this.defaultValue.getValue());
|
||||||
|
|
||||||
this.defaultValue = new DefaultValue();
|
Element validations = doc.createElement("validations");
|
||||||
this.defaultValue.setType(defaultValue.getAttribute("type"));
|
for (eu.eudat.models.admin.components.datasetprofile.Field.ValidationType validationType : this.validations) {
|
||||||
this.defaultValue.setValue(defaultValue.getAttribute("value"));
|
Element validation = doc.createElement("validation");
|
||||||
this.data = new ModelBuilder().toFieldData(null, this.viewStyle.getRenderStyle(),dataElement);
|
validation.setAttribute("type", "" + validationType.getValue());
|
||||||
if(this.data!=null)this.data.fromXml(dataElement);
|
validations.appendChild(validation);
|
||||||
|
}
|
||||||
|
|
||||||
this.validations = new LinkedList<>();
|
rootElement.appendChild(validations);
|
||||||
Element validations = (Element)XmlBuilder.getNodeFromListByTagName(element.getChildNodes(), "validations");
|
rootElement.appendChild(defaultValue);
|
||||||
if(validations!=null){
|
rootElement.appendChild(visibility);
|
||||||
NodeList validationElements = validations.getChildNodes();
|
rootElement.appendChild(viewStyle);
|
||||||
for (int temp = 0; temp < validationElements.getLength(); temp++) {
|
if (this.data != null) rootElement.appendChild(this.data.toXml(doc));
|
||||||
Node validationElement = validationElements.item(temp);
|
return rootElement;
|
||||||
if (validationElement.getNodeType() == Node.ELEMENT_NODE) {
|
}
|
||||||
int enumValue = Integer.parseInt(((Element)validationElement).getAttribute("type"));
|
|
||||||
eu.eudat.models.admin.components.datasetprofile.Field.ValidationType validationType = eu.eudat.models.admin.components.datasetprofile.Field.ValidationType.fromInteger(enumValue);
|
@Override
|
||||||
this.validations.add(validationType);
|
public Field fromXml(Element element) {
|
||||||
}
|
this.id = element.getAttribute("id");
|
||||||
}
|
this.ordinal = Integer.parseInt(element.getAttribute("ordinal"));
|
||||||
}
|
|
||||||
return this;
|
this.viewStyle = new ViewStyle();
|
||||||
}
|
Element viewStyle = (Element) XmlBuilder.getNodeFromListByTagName(element.getChildNodes(), "viewStyle");
|
||||||
|
|
||||||
|
this.viewStyle.setRenderStyle(viewStyle.getAttribute("renderstyle"));
|
||||||
|
this.viewStyle.setCssClass(viewStyle.getAttribute("cssClass"));
|
||||||
|
|
||||||
|
Element visibility = (Element) XmlBuilder.getNodeFromListByTagName(element.getChildNodes(), "visible");
|
||||||
|
|
||||||
|
this.visible = new Visibility().fromXml(visibility);
|
||||||
|
|
||||||
|
Element dataElement = (Element) XmlBuilder.getNodeFromListByTagName(element.getChildNodes(), "data");
|
||||||
|
|
||||||
|
Element defaultValue = (Element) XmlBuilder.getNodeFromListByTagName(element.getChildNodes(), "defaultValue");
|
||||||
|
|
||||||
|
this.defaultValue = new DefaultValue();
|
||||||
|
this.defaultValue.setType(defaultValue.getAttribute("type"));
|
||||||
|
this.defaultValue.setValue(defaultValue.getAttribute("value"));
|
||||||
|
this.data = new ModelBuilder().toFieldData(null, this.viewStyle.getRenderStyle(), dataElement);
|
||||||
|
if (this.data != null) this.data.fromXml(dataElement);
|
||||||
|
|
||||||
|
this.validations = new LinkedList<>();
|
||||||
|
Element validations = (Element) XmlBuilder.getNodeFromListByTagName(element.getChildNodes(), "validations");
|
||||||
|
if (validations != null) {
|
||||||
|
NodeList validationElements = validations.getChildNodes();
|
||||||
|
for (int temp = 0; temp < validationElements.getLength(); temp++) {
|
||||||
|
Node validationElement = validationElements.item(temp);
|
||||||
|
if (validationElement.getNodeType() == Node.ELEMENT_NODE) {
|
||||||
|
int enumValue = Integer.parseInt(((Element) validationElement).getAttribute("type"));
|
||||||
|
eu.eudat.models.admin.components.datasetprofile.Field.ValidationType validationType = eu.eudat.models.admin.components.datasetprofile.Field.ValidationType.fromInteger(enumValue);
|
||||||
|
this.validations.add(validationType);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,169 +1,168 @@
|
||||||
package eu.eudat.entities.xmlmodels.datasetprofiledefinition;
|
package eu.eudat.entities.xmlmodels.datasetprofiledefinition;
|
||||||
|
|
||||||
import java.util.LinkedList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import eu.eudat.models.components.commons.Multiplicity;
|
import eu.eudat.models.components.commons.Multiplicity;
|
||||||
|
import eu.eudat.utilities.XmlSerializable;
|
||||||
|
import eu.eudat.utilities.builders.XmlBuilder;
|
||||||
import org.w3c.dom.Document;
|
import org.w3c.dom.Document;
|
||||||
import org.w3c.dom.Element;
|
import org.w3c.dom.Element;
|
||||||
import org.w3c.dom.Node;
|
import org.w3c.dom.Node;
|
||||||
import org.w3c.dom.NodeList;
|
import org.w3c.dom.NodeList;
|
||||||
|
|
||||||
import eu.eudat.utilities.XmlSerializable;
|
import java.util.LinkedList;
|
||||||
import eu.eudat.utilities.builders.XmlBuilder;
|
import java.util.List;
|
||||||
|
|
||||||
public class FieldSet implements DatabaseViewStyleDefinition,XmlSerializable<FieldSet>{
|
public class FieldSet implements DatabaseViewStyleDefinition, XmlSerializable<FieldSet> {
|
||||||
private String id;
|
private String id;
|
||||||
private int ordinal;
|
private int ordinal;
|
||||||
private List<Field> fields;
|
private List<Field> fields;
|
||||||
private String title;
|
private String title;
|
||||||
private String description;
|
private String description;
|
||||||
private String extendedDescription;
|
private String extendedDescription;
|
||||||
private Multiplicity multiplicity;
|
private Multiplicity multiplicity;
|
||||||
private boolean hasCommentField;
|
private boolean hasCommentField;
|
||||||
private String commentFieldValue;
|
private String commentFieldValue;
|
||||||
public List<Field> getFields() {
|
|
||||||
return fields;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setFields(List<Field> fields) {
|
public List<Field> getFields() {
|
||||||
this.fields = fields;
|
return fields;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getId() {
|
public void setFields(List<Field> fields) {
|
||||||
return id;
|
this.fields = fields;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setId(String id) {
|
public String getId() {
|
||||||
this.id = id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getOrdinal() {
|
public void setId(String id) {
|
||||||
return ordinal;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setOrdinal(int ordinal) {
|
public int getOrdinal() {
|
||||||
this.ordinal = ordinal;
|
return ordinal;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getTitle() {
|
public void setOrdinal(int ordinal) {
|
||||||
return title;
|
this.ordinal = ordinal;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTitle(String title) {
|
public String getTitle() {
|
||||||
this.title = title;
|
return title;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDescription() {
|
public void setTitle(String title) {
|
||||||
return description;
|
this.title = title;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDescription(String description) {
|
public String getDescription() {
|
||||||
this.description = description;
|
return description;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getExtendedDescription() {
|
public void setDescription(String description) {
|
||||||
return extendedDescription;
|
this.description = description;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setExtendedDescription(String extendedDescription) {
|
public String getExtendedDescription() {
|
||||||
this.extendedDescription = extendedDescription;
|
return extendedDescription;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Multiplicity getMultiplicity() {
|
public void setExtendedDescription(String extendedDescription) {
|
||||||
return multiplicity;
|
this.extendedDescription = extendedDescription;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setMultiplicity(Multiplicity multiplicity) {
|
public Multiplicity getMultiplicity() {
|
||||||
this.multiplicity = multiplicity;
|
return multiplicity;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean getHasCommentField() {
|
public void setMultiplicity(Multiplicity multiplicity) {
|
||||||
return hasCommentField;
|
this.multiplicity = multiplicity;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setHasCommentField(boolean hasCommentField) {
|
public boolean getHasCommentField() {
|
||||||
this.hasCommentField = hasCommentField;
|
return hasCommentField;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCommentFieldValue() {
|
public void setHasCommentField(boolean hasCommentField) {
|
||||||
return commentFieldValue;
|
this.hasCommentField = hasCommentField;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCommentFieldValue(String commentFieldValue) {
|
public String getCommentFieldValue() {
|
||||||
this.commentFieldValue = commentFieldValue;
|
return commentFieldValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public void setCommentFieldValue(String commentFieldValue) {
|
||||||
public Element toXml(Document doc) {
|
this.commentFieldValue = commentFieldValue;
|
||||||
Element fieldSet = doc.createElement("fieldSet");
|
}
|
||||||
fieldSet.setAttribute("id", this.id);
|
|
||||||
fieldSet.setAttribute("ordinal", ""+this.ordinal);
|
|
||||||
Element title = doc.createElement("title");
|
|
||||||
title.setTextContent(this.title);
|
|
||||||
|
|
||||||
Element description = doc.createElement("description");
|
@Override
|
||||||
description.setTextContent(this.description);
|
public Element toXml(Document doc) {
|
||||||
|
Element fieldSet = doc.createElement("fieldSet");
|
||||||
|
fieldSet.setAttribute("id", this.id);
|
||||||
|
fieldSet.setAttribute("ordinal", "" + this.ordinal);
|
||||||
|
Element title = doc.createElement("title");
|
||||||
|
title.setTextContent(this.title);
|
||||||
|
|
||||||
Element extendedDescription = doc.createElement("extendedDescription");
|
Element description = doc.createElement("description");
|
||||||
extendedDescription.setTextContent(this.extendedDescription);
|
description.setTextContent(this.description);
|
||||||
|
|
||||||
Element multiplicity = doc.createElement("multiplicity");
|
Element extendedDescription = doc.createElement("extendedDescription");
|
||||||
multiplicity.setAttribute("min", ""+this.multiplicity.getMin());
|
extendedDescription.setTextContent(this.extendedDescription);
|
||||||
multiplicity.setAttribute("max", ""+this.multiplicity.getMax());
|
|
||||||
|
|
||||||
Element commentField = doc.createElement("commentField");
|
Element multiplicity = doc.createElement("multiplicity");
|
||||||
commentField.setAttribute("hasCommentField",""+this.hasCommentField);
|
multiplicity.setAttribute("min", "" + this.multiplicity.getMin());
|
||||||
commentField.setAttribute("commentFieldValue",this.commentFieldValue);
|
multiplicity.setAttribute("max", "" + this.multiplicity.getMax());
|
||||||
|
|
||||||
|
Element commentField = doc.createElement("commentField");
|
||||||
|
commentField.setAttribute("hasCommentField", "" + this.hasCommentField);
|
||||||
|
commentField.setAttribute("commentFieldValue", this.commentFieldValue);
|
||||||
|
|
||||||
|
|
||||||
|
Element fieldsElement = doc.createElement("fields");
|
||||||
|
for (Field field : fields) {
|
||||||
|
fieldsElement.appendChild(field.toXml(doc));
|
||||||
|
}
|
||||||
|
fieldSet.appendChild(commentField);
|
||||||
|
fieldSet.appendChild(fieldsElement);
|
||||||
|
fieldSet.appendChild(multiplicity);
|
||||||
|
fieldSet.appendChild(title);
|
||||||
|
fieldSet.appendChild(description);
|
||||||
|
fieldSet.appendChild(extendedDescription);
|
||||||
|
return fieldSet;
|
||||||
|
}
|
||||||
|
|
||||||
Element fieldsElement = doc.createElement("fields");
|
@Override
|
||||||
for(Field field : fields){
|
public FieldSet fromXml(Element element) {
|
||||||
fieldsElement.appendChild(field.toXml(doc));
|
this.id = element.getAttribute("id");
|
||||||
}
|
this.ordinal = Integer.parseInt(element.getAttribute("ordinal"));
|
||||||
fieldSet.appendChild(commentField);
|
this.fields = new LinkedList();
|
||||||
fieldSet.appendChild(fieldsElement);
|
Element title = (Element) XmlBuilder.getNodeFromListByTagName(element.getChildNodes(), "title");
|
||||||
fieldSet.appendChild(multiplicity);
|
this.title = title.getTextContent();
|
||||||
fieldSet.appendChild(title);
|
Element description = (Element) XmlBuilder.getNodeFromListByTagName(element.getChildNodes(), "description");
|
||||||
fieldSet.appendChild(description);
|
this.description = description.getTextContent();
|
||||||
fieldSet.appendChild(extendedDescription);
|
Element extendedDescription = (Element) XmlBuilder.getNodeFromListByTagName(element.getChildNodes(), "extendedDescription");
|
||||||
return fieldSet;
|
this.extendedDescription = extendedDescription.getTextContent();
|
||||||
}
|
Element commentField = (Element) XmlBuilder.getNodeFromListByTagName(element.getChildNodes(), "commentField");
|
||||||
|
this.hasCommentField = Boolean.parseBoolean(commentField.getAttribute("hasCommentField"));
|
||||||
|
this.commentFieldValue = commentField.getAttribute("commentFieldValue");
|
||||||
|
Element fields = (Element) XmlBuilder.getNodeFromListByTagName(element.getChildNodes(), "fields");
|
||||||
|
|
||||||
@Override
|
if (fields != null) {
|
||||||
public FieldSet fromXml(Element element) {
|
NodeList fieldElements = fields.getChildNodes();
|
||||||
this.id = element.getAttribute("id");
|
for (int temp = 0; temp < fieldElements.getLength(); temp++) {
|
||||||
this.ordinal = Integer.parseInt(element.getAttribute("ordinal"));
|
Node fieldElement = fieldElements.item(temp);
|
||||||
this.fields = new LinkedList();
|
if (fieldElement.getNodeType() == Node.ELEMENT_NODE) {
|
||||||
Element title = (Element)XmlBuilder.getNodeFromListByTagName(element.getChildNodes(), "title");
|
this.fields.add(new Field().fromXml((Element) fieldElement));
|
||||||
this.title = title.getTextContent();
|
}
|
||||||
Element description = (Element)XmlBuilder.getNodeFromListByTagName(element.getChildNodes(), "description");
|
}
|
||||||
this.description = description.getTextContent();
|
}
|
||||||
Element extendedDescription = (Element)XmlBuilder.getNodeFromListByTagName(element.getChildNodes(), "extendedDescription");
|
|
||||||
this.extendedDescription = extendedDescription.getTextContent();
|
|
||||||
Element commentField = (Element)XmlBuilder.getNodeFromListByTagName(element.getChildNodes(), "commentField");
|
|
||||||
this.hasCommentField = Boolean.parseBoolean(commentField.getAttribute("hasCommentField"));
|
|
||||||
this.commentFieldValue = commentField.getAttribute("commentFieldValue");
|
|
||||||
Element fields = (Element)XmlBuilder.getNodeFromListByTagName(element.getChildNodes(), "fields");
|
|
||||||
|
|
||||||
if(fields!=null){
|
this.multiplicity = new Multiplicity();
|
||||||
NodeList fieldElements = fields.getChildNodes();
|
Element multiplicity = (Element) XmlBuilder.getNodeFromListByTagName(element.getChildNodes(), "multiplicity");
|
||||||
for (int temp = 0; temp < fieldElements.getLength(); temp++) {
|
|
||||||
Node fieldElement = fieldElements.item(temp);
|
|
||||||
if (fieldElement.getNodeType() == Node.ELEMENT_NODE) {
|
|
||||||
this.fields.add(new Field().fromXml((Element)fieldElement));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this.multiplicity = new Multiplicity();
|
this.multiplicity.setMin(Integer.parseInt(multiplicity.getAttribute("min")));
|
||||||
Element multiplicity = (Element)XmlBuilder.getNodeFromListByTagName(element.getChildNodes(), "multiplicity");
|
this.multiplicity.setMax(Integer.parseInt(multiplicity.getAttribute("max")));
|
||||||
|
|
||||||
this.multiplicity.setMin(Integer.parseInt(multiplicity.getAttribute("min")));
|
return this;
|
||||||
this.multiplicity.setMax(Integer.parseInt(multiplicity.getAttribute("max")));
|
}
|
||||||
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue