Browse Source

no message

dmp-editor
Ioannis Kalyvas 3 years ago
parent
commit
e0c302e67e
  1. 1
      .gitignore
  2. 46
      dmp-backend/data/src/main/java/eu/eudat/data/converters/DateToUTCConverter.java
  3. 49
      dmp-backend/data/src/main/java/eu/eudat/data/dao/criteria/DatasetPublicCriteria.java
  4. 1
      dmp-backend/data/src/main/java/eu/eudat/data/dao/databaselayer/context/DatabaseContext.java
  5. 2
      dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/ContentDaoImpl.java
  6. 2
      dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DMPDaoImpl.java
  7. 2
      dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DMPProfileDaoImpl.java
  8. 2
      dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DataRepositoryDaoImpl.java
  9. 2
      dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DatasetDaoImpl.java
  10. 2
      dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DatasetExternalDatasetDaoImpl.java
  11. 2
      dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DatasetProfileDaoImpl.java
  12. 2
      dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DatasetServiceDaoImpl.java
  13. 2
      dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/ExternalDatasetDaoImpl.java
  14. 2
      dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/InvitationDaoImpl.java
  15. 2
      dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/OrganisationDaoImpl.java
  16. 2
      dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/ProjectDaoImpl.java
  17. 2
      dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/RegistryDaoImpl.java
  18. 2
      dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/ResearcherDaoImpl.java
  19. 2
      dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/ServiceDaoImpl.java
  20. 2
      dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/UserDmpDaoImpl.java
  21. 2
      dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/UserInfoDaoImpl.java
  22. 2
      dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/UserRoleDaoImpl.java
  23. 7
      dmp-backend/data/src/main/java/eu/eudat/data/entities/Content.java
  24. 12
      dmp-backend/data/src/main/java/eu/eudat/data/entities/Credential.java
  25. 13
      dmp-backend/data/src/main/java/eu/eudat/data/entities/DMP.java
  26. 10
      dmp-backend/data/src/main/java/eu/eudat/data/entities/DMPProfile.java
  27. 7
      dmp-backend/data/src/main/java/eu/eudat/data/entities/DataRepository.java
  28. 11
      dmp-backend/data/src/main/java/eu/eudat/data/entities/Dataset.java
  29. 8
      dmp-backend/data/src/main/java/eu/eudat/data/entities/DatasetDataRepository.java
  30. 8
      dmp-backend/data/src/main/java/eu/eudat/data/entities/DatasetExternalDataset.java
  31. 10
      dmp-backend/data/src/main/java/eu/eudat/data/entities/DatasetProfile.java
  32. 7
      dmp-backend/data/src/main/java/eu/eudat/data/entities/DatasetService.java
  33. 10
      dmp-backend/data/src/main/java/eu/eudat/data/entities/ExternalDataset.java
  34. 7
      dmp-backend/data/src/main/java/eu/eudat/data/entities/Invitation.java
  35. 10
      dmp-backend/data/src/main/java/eu/eudat/data/entities/Organisation.java
  36. 20
      dmp-backend/data/src/main/java/eu/eudat/data/entities/Project.java
  37. 10
      dmp-backend/data/src/main/java/eu/eudat/data/entities/Registry.java
  38. 10
      dmp-backend/data/src/main/java/eu/eudat/data/entities/Researcher.java
  39. 11
      dmp-backend/data/src/main/java/eu/eudat/data/entities/Service.java
  40. 7
      dmp-backend/data/src/main/java/eu/eudat/data/entities/UserDMP.java
  41. 14
      dmp-backend/data/src/main/java/eu/eudat/data/entities/UserInfo.java
  42. 7
      dmp-backend/data/src/main/java/eu/eudat/data/entities/UserRole.java
  43. 10
      dmp-backend/data/src/main/java/eu/eudat/data/entities/UserToken.java
  44. 10
      dmp-backend/data/src/main/java/eu/eudat/data/query/items/item/project/ProjectCriteriaRequest.java
  45. 38
      dmp-backend/data/src/main/java/eu/eudat/data/query/items/table/dataset/DatasetPublicTableRequest.java
  46. 119
      dmp-backend/queryable/src/main/java/eu/eudat/queryable/jpa/hibernatequeryablelist/QueryableHibernateList.java
  47. 5
      dmp-backend/queryable/src/main/java/eu/eudat/queryable/queryableentity/DataEntity.java
  48. 2
      dmp-backend/web/src/main/java/eu/eudat/EuDatApplication.java
  49. 28
      dmp-backend/web/src/main/java/eu/eudat/configurations/DevelDatabaseConfiguration.java
  50. 28
      dmp-backend/web/src/main/java/eu/eudat/configurations/ExecutorServiceConfig.java
  51. 19
      dmp-backend/web/src/main/java/eu/eudat/controllers/Admin.java
  52. 10
      dmp-backend/web/src/main/java/eu/eudat/controllers/BaseController.java
  53. 10
      dmp-backend/web/src/main/java/eu/eudat/controllers/Datasets.java
  54. 6
      dmp-backend/web/src/main/java/eu/eudat/controllers/Projects.java
  55. 27
      dmp-backend/web/src/main/java/eu/eudat/logic/handlers/PrincipalArgumentResolver.java
  56. 2
      dmp-backend/web/src/main/java/eu/eudat/logic/managers/DataManagementPlanManager.java
  57. 20
      dmp-backend/web/src/main/java/eu/eudat/logic/managers/DatasetManager.java
  58. 1
      dmp-backend/web/src/main/java/eu/eudat/logic/managers/ProjectManager.java
  59. 17
      dmp-backend/web/src/main/java/eu/eudat/models/data/listingmodels/DataManagementPlanListingModel.java
  60. 17
      dmp-backend/web/src/main/java/eu/eudat/models/data/listingmodels/DatasetListingModel.java
  61. 37
      dmp-backend/web/src/main/java/eu/eudat/models/data/project/ProjectListingModel.java
  62. 25
      dmp-backend/web/src/main/resources/application.properties
  63. 1
      dmp-frontend/Dockerfile
  64. 4
      dmp-frontend/nginx-custom.conf
  65. 1
      dmp-frontend/src/app/app.module.ts
  66. 129
      dmp-frontend/src/app/dataset-profile-form/compositefield-form/compositefield-form.component.html
  67. 6
      dmp-frontend/src/app/dataset-profile-form/compositefield-form/compositefield-form.component.ts
  68. 99
      dmp-frontend/src/app/dataset-profile-form/dataset-profile.module.ts
  69. 142
      dmp-frontend/src/app/dataset-profile-form/field-form/field-form.component.html
  70. 122
      dmp-frontend/src/app/dataset-profile-form/form/form.component.html
  71. 2
      dmp-frontend/src/app/dataset-profile-form/form/form.component.scss
  72. 27
      dmp-frontend/src/app/dataset-profile-form/form/form.component.ts
  73. 17
      dmp-frontend/src/app/dataset-profile-form/page-form/page-component.html
  74. 3
      dmp-frontend/src/app/dataset-profile-form/page-form/page-component.scss
  75. 4
      dmp-frontend/src/app/dataset-profile-form/page-form/page-component.ts
  76. 2
      dmp-frontend/src/app/dataset-profile-form/previewer/dataset-profile-previewer.component.html
  77. 0
      dmp-frontend/src/app/dataset-profile-form/previewer/dataset-profile-previewer.component.scss
  78. 36
      dmp-frontend/src/app/dataset-profile-form/previewer/dataset-profile-previewer.component.ts
  79. 42
      dmp-frontend/src/app/dataset-profile-form/rule-component/rule.component.html
  80. 3
      dmp-frontend/src/app/dataset-profile-form/rule-component/rule.component.scss
  81. 68
      dmp-frontend/src/app/dataset-profile-form/section-form/section-form.component.html
  82. 4
      dmp-frontend/src/app/dataset-profile-form/section-form/section-form.component.scss
  83. 7
      dmp-frontend/src/app/dataset-profile-form/section-form/section-form.component.ts
  84. 4
      dmp-frontend/src/app/datasets-admin-listing/dataset-admin-listing.component.html
  85. 181
      dmp-frontend/src/app/datasets/dataset-public/dataset-public-listing.component.html
  86. 20
      dmp-frontend/src/app/datasets/dataset-public/dataset-public-listing.component.ts
  87. 18
      dmp-frontend/src/app/datasets/listing/dataset-listing.component.html
  88. 10
      dmp-frontend/src/app/datasets/listing/dataset-listing.component.ts
  89. 7
      dmp-frontend/src/app/dmp-profiles/dmp-profile-editor/dmp-profile-editor.component.ts
  90. 5
      dmp-frontend/src/app/dmps/listing/dmp-listing.component.ts
  91. 4
      dmp-frontend/src/app/form/dynamic-form.module.ts
  92. 7
      dmp-frontend/src/app/models/data-managemnt-plans/DataManagementPlanListingModel.ts
  93. 4
      dmp-frontend/src/app/models/datasetProfileAdmin/DatasetProfileModelAdmin.ts
  94. 56
      dmp-frontend/src/app/models/datasets/DatasetListingModel.ts
  95. 5
      dmp-frontend/src/app/models/datasets/DatasetWizardModel.ts
  96. 8
      dmp-frontend/src/app/models/facet-search/FacetSearchCriteriaModel.ts
  97. 6
      dmp-frontend/src/app/models/projects/ProjectListingModel.ts
  98. 5
      dmp-frontend/src/app/projects/listing/project-listing.component.ts
  99. 39
      dmp-frontend/src/app/services/dataset/dataset.service.ts
  100. 4
      dmp-frontend/src/app/services/datasetProfileAdmin/datasetProfileAfmin.service.ts

1
.gitignore

@ -33,3 +33,4 @@ final/
temp/
*.jar
*.lst
dmp-frontend/.vscode/

46
dmp-backend/data/src/main/java/eu/eudat/data/converters/DateToUTCConverter.java

@ -0,0 +1,46 @@
package eu.eudat.data.converters;
import org.springframework.format.datetime.DateFormatter;
import javax.persistence.AttributeConverter;
import javax.persistence.Converter;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;
/**
* Created by ikalyvas on 9/25/2018.
*/
@Converter
public class DateToUTCConverter implements AttributeConverter<Date, Date> {
@Override
public Date convertToDatabaseColumn(Date attribute) {
if(attribute == null) return null;
DateFormat formatterIST = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
formatterIST.setTimeZone(TimeZone.getTimeZone("UTC"));
try {
String date = formatterIST.format(attribute);
return formatterIST.parse(date);
} catch (ParseException e) {
e.printStackTrace();
}
return null;
}
@Override
public Date convertToEntityAttribute(Date dbData) {
if(dbData == null) return null;
DateFormat formatterIST = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
formatterIST.setTimeZone(TimeZone.getTimeZone("UTC"));
try {
String date = formatterIST.format(dbData);
return formatterIST.parse(date);
} catch (ParseException e) {
e.printStackTrace();
}
return null;
}
}

49
dmp-backend/data/src/main/java/eu/eudat/data/dao/criteria/DatasetPublicCriteria.java

@ -0,0 +1,49 @@
package eu.eudat.data.dao.criteria;
import eu.eudat.data.entities.Dataset;
import eu.eudat.types.project.ProjectStateType;
import java.util.List;
import java.util.UUID;
/**
* Created by ikalyvas on 10/2/2018.
*/
public class DatasetPublicCriteria extends Criteria<Dataset>{
public ProjectStateType projectStatus;
public List<UUID> projects;
public List<UUID> datasetProfile;
public List<String> dmpOrganisations;
public ProjectStateType getProjectStatus() {
return projectStatus;
}
public void setProjectStatus(ProjectStateType projectStatus) {
this.projectStatus = projectStatus;
}
public List<UUID> getProjects() {
return projects;
}
public void setProjects(List<UUID> projects) {
this.projects = projects;
}
public List<UUID> getDatasetProfile() {
return datasetProfile;
}
public void setDatasetProfile(List<UUID> datasetProfile) {
this.datasetProfile = datasetProfile;
}
public List<String> getDmpOrganisations() {
return dmpOrganisations;
}
public void setDmpOrganisations(List<String> dmpOrganisations) {
this.dmpOrganisations = dmpOrganisations;
}
}

1
dmp-backend/data/src/main/java/eu/eudat/data/dao/databaselayer/context/DatabaseContext.java

@ -4,6 +4,7 @@ import eu.eudat.queryable.QueryableList;
import eu.eudat.queryable.jpa.hibernatequeryablelist.QueryableHibernateList;
import eu.eudat.queryable.queryableentity.DataEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

2
dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/ContentDaoImpl.java

@ -5,6 +5,7 @@ import eu.eudat.data.dao.databaselayer.service.DatabaseService;
import eu.eudat.data.entities.Content;
import eu.eudat.queryable.QueryableList;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import java.util.UUID;
@ -27,6 +28,7 @@ public class ContentDaoImpl extends DatabaseAccess<Content> implements ContentDa
}
@Override
@Async
public CompletableFuture<Content> createOrUpdateAsync(Content item) {
return CompletableFuture.supplyAsync(() -> this.createOrUpdate(item));
}

2
dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DMPDaoImpl.java

@ -10,6 +10,7 @@ import eu.eudat.queryable.QueryableList;
import eu.eudat.queryable.types.FieldSelectionType;
import eu.eudat.queryable.types.SelectionField;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import java.util.Arrays;
@ -78,6 +79,7 @@ public class DMPDaoImpl extends DatabaseAccess<DMP> implements DMPDao {
return this.getDatabaseService().getQueryable(DMP.class);
}
@Async
@Override
public CompletableFuture<DMP> createOrUpdateAsync(DMP item) {
return CompletableFuture.supplyAsync(() -> this.createOrUpdate(item));

2
dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DMPProfileDaoImpl.java

@ -6,6 +6,7 @@ import eu.eudat.data.dao.databaselayer.service.DatabaseService;
import eu.eudat.data.entities.DMPProfile;
import eu.eudat.queryable.QueryableList;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import java.util.UUID;
@ -22,6 +23,7 @@ public class DMPProfileDaoImpl extends DatabaseAccess<DMPProfile> implements DMP
super(databaseService);
}
@Async
@Override
public CompletableFuture<DMPProfile> createOrUpdateAsync(DMPProfile item) {
return CompletableFuture.supplyAsync(() -> this.createOrUpdate(item));

2
dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DataRepositoryDaoImpl.java

@ -6,6 +6,7 @@ import eu.eudat.data.dao.databaselayer.service.DatabaseService;
import eu.eudat.data.entities.DataRepository;
import eu.eudat.queryable.QueryableList;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import java.util.UUID;
@ -38,6 +39,7 @@ public class DataRepositoryDaoImpl extends DatabaseAccess<DataRepository> implem
}
@Override
@Async
public CompletableFuture<DataRepository> createOrUpdateAsync(DataRepository item) {
return CompletableFuture.supplyAsync(() -> this.createOrUpdate(item));
}

2
dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DatasetDaoImpl.java

@ -9,6 +9,7 @@ import eu.eudat.queryable.QueryableList;
import eu.eudat.queryable.types.FieldSelectionType;
import eu.eudat.queryable.types.SelectionField;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import java.util.Arrays;
@ -76,6 +77,7 @@ public class DatasetDaoImpl extends DatabaseAccess<Dataset> implements DatasetDa
return this.getDatabaseService().getQueryable(Dataset.class);
}
@Async
public CompletableFuture<Dataset> createOrUpdateAsync(Dataset item) {
return CompletableFuture.supplyAsync(() -> this.createOrUpdate(item));
}

2
dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DatasetExternalDatasetDaoImpl.java

@ -6,6 +6,7 @@ import eu.eudat.data.entities.DatasetExternalDataset;
import eu.eudat.data.entities.DatasetProfile;
import eu.eudat.queryable.QueryableList;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import java.util.UUID;
@ -33,6 +34,7 @@ public class DatasetExternalDatasetDaoImpl extends DatabaseAccess<DatasetExterna
}
@Override
@Async
public DatasetExternalDataset find(UUID id) {
return getDatabaseService().getQueryable(DatasetExternalDataset.class).where((builder, root) -> builder.equal(root.get("id"), id)).getSingle();
}

2
dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DatasetProfileDaoImpl.java

@ -6,6 +6,7 @@ import eu.eudat.data.dao.databaselayer.service.DatabaseService;
import eu.eudat.data.entities.DatasetProfile;
import eu.eudat.queryable.QueryableList;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import java.util.UUID;
@ -52,6 +53,7 @@ public class DatasetProfileDaoImpl extends DatabaseAccess<DatasetProfile> implem
return this.getDatabaseService().getQueryable(DatasetProfile.class);
}
@Async
@Override
public CompletableFuture<DatasetProfile> createOrUpdateAsync(DatasetProfile item) {
return CompletableFuture.supplyAsync(() -> this.createOrUpdate(item));

2
dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DatasetServiceDaoImpl.java

@ -7,6 +7,7 @@ import eu.eudat.data.entities.DatasetProfile;
import eu.eudat.data.entities.DatasetService;
import eu.eudat.queryable.QueryableList;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import java.util.UUID;
@ -28,6 +29,7 @@ public class DatasetServiceDaoImpl extends DatabaseAccess<DatasetService> implem
return this.getDatabaseService().createOrUpdate(item, DatasetService.class);
}
@Async
@Override
public CompletableFuture<DatasetService> createOrUpdateAsync(DatasetService item) {
return CompletableFuture.supplyAsync(() -> this.createOrUpdate(item));

2
dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/ExternalDatasetDaoImpl.java

@ -6,6 +6,7 @@ import eu.eudat.data.dao.databaselayer.service.DatabaseService;
import eu.eudat.data.entities.ExternalDataset;
import eu.eudat.queryable.QueryableList;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import java.util.UUID;
@ -48,6 +49,7 @@ public class ExternalDatasetDaoImpl extends DatabaseAccess<ExternalDataset> impl
return this.getDatabaseService().getQueryable(ExternalDataset.class);
}
@Async
@Override
public CompletableFuture<ExternalDataset> createOrUpdateAsync(ExternalDataset item) {
return CompletableFuture.supplyAsync(() -> this.createOrUpdate(item));

2
dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/InvitationDaoImpl.java

@ -6,6 +6,7 @@ import eu.eudat.data.dao.databaselayer.service.DatabaseService;
import eu.eudat.data.entities.Invitation;
import eu.eudat.queryable.QueryableList;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import java.util.UUID;
@ -45,6 +46,7 @@ public class InvitationDaoImpl extends DatabaseAccess<Invitation> implements Inv
return this.getDatabaseService().getQueryable(Invitation.class);
}
@Async
@Override
public CompletableFuture<Invitation> createOrUpdateAsync(Invitation item) {
return CompletableFuture.supplyAsync(() -> this.createOrUpdate(item));

2
dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/OrganisationDaoImpl.java

@ -6,6 +6,7 @@ import eu.eudat.data.dao.databaselayer.service.DatabaseService;
import eu.eudat.data.entities.Organisation;
import eu.eudat.queryable.QueryableList;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import java.util.UUID;
@ -47,6 +48,7 @@ public class OrganisationDaoImpl extends DatabaseAccess<Organisation> implements
return this.getDatabaseService().getQueryable(Organisation.class);
}
@Async
@Override
public CompletableFuture<Organisation> createOrUpdateAsync(Organisation item) {
return CompletableFuture.supplyAsync(() -> this.createOrUpdate(item));

2
dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/ProjectDaoImpl.java

@ -8,6 +8,7 @@ import eu.eudat.data.entities.UserInfo;
import eu.eudat.queryable.QueryableList;
import eu.eudat.types.project.ProjectStateType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import javax.persistence.criteria.JoinType;
@ -71,6 +72,7 @@ public class ProjectDaoImpl extends DatabaseAccess<Project> implements ProjectDa
return query;
}
@Async
@Override
public CompletableFuture<Project> createOrUpdateAsync(Project item) {
return CompletableFuture.supplyAsync(() -> this.createOrUpdate(item));

2
dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/RegistryDaoImpl.java

@ -6,6 +6,7 @@ import eu.eudat.data.dao.databaselayer.service.DatabaseService;
import eu.eudat.data.entities.Registry;
import eu.eudat.queryable.QueryableList;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import java.util.UUID;
@ -47,6 +48,7 @@ public class RegistryDaoImpl extends DatabaseAccess<Registry> implements Registr
return this.getDatabaseService().getQueryable(Registry.class);
}
@Async
@Override
public CompletableFuture<Registry> createOrUpdateAsync(Registry item) {
return CompletableFuture.supplyAsync(() -> this.createOrUpdate(item));

2
dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/ResearcherDaoImpl.java

@ -6,6 +6,7 @@ import eu.eudat.data.dao.databaselayer.service.DatabaseService;
import eu.eudat.data.entities.Researcher;
import eu.eudat.queryable.QueryableList;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import java.util.UUID;
@ -49,6 +50,7 @@ public class ResearcherDaoImpl extends DatabaseAccess<Researcher> implements Res
return this.getDatabaseService().getQueryable(Researcher.class);
}
@Async
@Override
public CompletableFuture<Researcher> createOrUpdateAsync(Researcher item) {
return CompletableFuture.supplyAsync(() -> this.createOrUpdate(item));

2
dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/ServiceDaoImpl.java

@ -6,6 +6,7 @@ import eu.eudat.data.dao.databaselayer.service.DatabaseService;
import eu.eudat.data.entities.Service;
import eu.eudat.queryable.QueryableList;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import java.util.UUID;
@ -47,6 +48,7 @@ public class ServiceDaoImpl extends DatabaseAccess<Service> implements ServiceDa
return this.getDatabaseService().getQueryable(Service.class);
}
@Async
@Override
public CompletableFuture<Service> createOrUpdateAsync(Service item) {
return CompletableFuture.supplyAsync(() -> this.createOrUpdate(item));

2
dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/UserDmpDaoImpl.java

@ -5,6 +5,7 @@ import eu.eudat.data.dao.databaselayer.service.DatabaseService;
import eu.eudat.data.entities.UserDMP;
import eu.eudat.queryable.QueryableList;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import java.util.UUID;
@ -41,6 +42,7 @@ public class UserDmpDaoImpl extends DatabaseAccess<UserDMP> implements UserDmpDa
return this.getDatabaseService().getQueryable(UserDMP.class);
}
@Async
@Override
public CompletableFuture<UserDMP> createOrUpdateAsync(UserDMP item) {
return CompletableFuture.supplyAsync(() -> this.createOrUpdate(item));

2
dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/UserInfoDaoImpl.java

@ -6,6 +6,7 @@ import eu.eudat.data.dao.databaselayer.service.DatabaseService;
import eu.eudat.data.entities.UserInfo;
import eu.eudat.queryable.QueryableList;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import java.util.UUID;
@ -51,6 +52,7 @@ public class UserInfoDaoImpl extends DatabaseAccess<UserInfo> implements UserInf
return this.getDatabaseService().getQueryable(UserInfo.class);
}
@Async
@Override
public CompletableFuture<UserInfo> createOrUpdateAsync(UserInfo item) {
return CompletableFuture.supplyAsync(() -> this.createOrUpdate(item));

2
dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/UserRoleDaoImpl.java

@ -7,6 +7,7 @@ import eu.eudat.data.entities.UserInfo;
import eu.eudat.data.entities.UserRole;
import eu.eudat.queryable.QueryableList;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import java.util.List;
@ -57,6 +58,7 @@ public class UserRoleDaoImpl extends DatabaseAccess<UserRole> implements UserRol
return this.getDatabaseService().getQueryable(UserRole.class);
}
@Async
@Override
public CompletableFuture<UserRole> createOrUpdateAsync(UserRole item) {
return CompletableFuture.supplyAsync(() -> this.createOrUpdate(item));

7
dmp-backend/data/src/main/java/eu/eudat/data/entities/Content.java

@ -4,6 +4,7 @@ import eu.eudat.queryable.queryableentity.DataEntity;
import org.hibernate.annotations.GenericGenerator;
import javax.persistence.*;
import java.util.List;
import java.util.UUID;
/**
@ -143,4 +144,10 @@ public class Content implements DataEntity<Content, UUID> {
public UUID getKeys() {
return this.id;
}
@Override
public Content buildFromTuple(List<Tuple> tuple, String base) {
this.id = UUID.fromString((String) tuple.get(0).get(base.isEmpty() ? base + "." + "id" : "id"));
return this;
}
}

12
dmp-backend/data/src/main/java/eu/eudat/data/entities/Credential.java

@ -1,9 +1,11 @@
package eu.eudat.data.entities;
import eu.eudat.data.converters.DateToUTCConverter;
import eu.eudat.queryable.queryableentity.DataEntity;
import javax.persistence.*;
import java.util.Date;
import java.util.List;
import java.util.UUID;
@ -33,9 +35,13 @@ public class Credential implements DataEntity<Credential,UUID> {
private String publicValue;
@Column(name = "\"Secret\"", nullable = false)
private String secret;
@Column(name = "\"CreationTime\"", nullable = false)
@Convert(converter = DateToUTCConverter.class)
private Date creationTime;
@Column(name = "\"LastUpdateTime\"", nullable = false)
@Convert(converter = DateToUTCConverter.class)
private Date lastUpdateTime;
@Column(name = "\"ExternalId\"", nullable = false)
@ -140,4 +146,10 @@ public class Credential implements DataEntity<Credential,UUID> {
public UUID getKeys() {
return this.id;
}
@Override
public Credential buildFromTuple(List<Tuple> tuple, String base) {
this.id = UUID.fromString((String) tuple.get(0).get(base.isEmpty() ? base + "." + "id" : "id"));
return this;
}
}

13
dmp-backend/data/src/main/java/eu/eudat/data/entities/DMP.java

@ -1,12 +1,14 @@
package eu.eudat.data.entities;
import eu.eudat.data.converters.DateToUTCConverter;
import eu.eudat.queryable.queryableentity.DataEntity;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Type;
import javax.persistence.*;
import java.util.*;
import java.util.stream.Collectors;
@Entity
@ -15,7 +17,7 @@ import java.util.*;
@NamedEntityGraph(
name = "dataManagementPlanListingModel",
attributeNodes = {@NamedAttributeNode("organisations"), @NamedAttributeNode("researchers"),
@NamedAttributeNode("project"),@NamedAttributeNode("users"), @NamedAttributeNode("creator"), @NamedAttributeNode("profile"), @NamedAttributeNode("dataset")}
@NamedAttributeNode("project"), @NamedAttributeNode("users"), @NamedAttributeNode("creator"), @NamedAttributeNode("profile"), @NamedAttributeNode("dataset")}
),
@NamedEntityGraph(
name = "fullyDetailed",
@ -132,9 +134,11 @@ public class DMP implements DataEntity<DMP, UUID> {
private String dmpProperties;
@Column(name = "\"Created\"")
@Convert(converter = DateToUTCConverter.class)
private Date created = null;
@Column(name = "\"Modified\"")
@Convert(converter = DateToUTCConverter.class)
private Date modified = new Date();
@ -319,4 +323,11 @@ public class DMP implements DataEntity<DMP, UUID> {
return this.id;
}
@Override
public DMP buildFromTuple(List<Tuple> tuple, String base) {
this.id = tuple.get(0).get(base.isEmpty() ? "id" : base + "." + "id", UUID.class);
this.dataset = tuple.stream().map(x -> new Dataset().buildFromTuple(tuple, base.isEmpty() ? "dataset" : base + "." + "dataset")).collect(Collectors.toSet());
this.creator = tuple.stream().map(x -> new UserInfo().buildFromTuple(tuple, base.isEmpty() ? "creator" : base + "." + "creator")).collect(Collectors.toList()).get(0);
return this;
}
}

10
dmp-backend/data/src/main/java/eu/eudat/data/entities/DMPProfile.java

@ -1,12 +1,14 @@
package eu.eudat.data.entities;
import eu.eudat.data.converters.DateToUTCConverter;
import eu.eudat.queryable.queryableentity.DataEntity;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Type;
import javax.persistence.*;
import java.util.Date;
import java.util.List;
import java.util.Set;
import java.util.UUID;
@ -39,9 +41,11 @@ public class DMPProfile implements DataEntity<DMPProfile, UUID> {
@Column(name = "\"Created\"")
@Convert(converter = DateToUTCConverter.class)
private Date created = null;
@Column(name = "\"Modified\"")
@Convert(converter = DateToUTCConverter.class)
private Date modified = new Date();
public int getStatus() {
@ -111,4 +115,10 @@ public class DMPProfile implements DataEntity<DMPProfile, UUID> {
public UUID getKeys() {
return this.id;
}
@Override
public DMPProfile buildFromTuple(List<Tuple> tuple, String base) {
this.id = UUID.fromString((String) tuple.get(0).get(base.isEmpty() ? base + "." + "id" : "id"));
return this;
}
}

7
dmp-backend/data/src/main/java/eu/eudat/data/entities/DataRepository.java

@ -8,6 +8,7 @@ import org.hibernate.annotations.Type;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.util.Set;
import java.util.UUID;
@ -145,4 +146,10 @@ public class DataRepository implements Serializable, DataEntity<DataRepository,U
public UUID getKeys() {
return this.id;
}
@Override
public DataRepository buildFromTuple(List<Tuple> tuple, String base) {
this.id = UUID.fromString((String) tuple.get(0).get(base.isEmpty() ? base + "." + "id" : "id"));
return this;
}
}

11
dmp-backend/data/src/main/java/eu/eudat/data/entities/Dataset.java

@ -1,6 +1,7 @@
package eu.eudat.data.entities;
import eu.eudat.data.converters.DateToUTCConverter;
import eu.eudat.queryable.queryableentity.DataEntity;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Type;
@ -17,7 +18,7 @@ import java.util.stream.Collectors;
attributeNodes = {@NamedAttributeNode("services"), @NamedAttributeNode(value = "datasetDataRepositories", subgraph = "datasetDataRepositories"), @NamedAttributeNode("datasetExternalDatasets"), @NamedAttributeNode("registries"),
@NamedAttributeNode(value = "dmp", subgraph = "dmp"), @NamedAttributeNode("profile"), @NamedAttributeNode("creator")},
subgraphs = {
@NamedSubgraph(name = "dmp", attributeNodes = {@NamedAttributeNode("creator"), @NamedAttributeNode("users")}),
@NamedSubgraph(name = "dmp", attributeNodes = {@NamedAttributeNode("creator"), @NamedAttributeNode("users"), @NamedAttributeNode("project"),@NamedAttributeNode("organisations")}),
@NamedSubgraph(name = "datasetDataRepositories", attributeNodes = {@NamedAttributeNode("dataRepository")})
}),
@ -126,9 +127,11 @@ public class Dataset implements DataEntity<Dataset, UUID> {
private boolean isPublic;
@Column(name = "\"Created\"")
@Convert(converter = DateToUTCConverter.class)
private Date created = null;
@Column(name = "\"Modified\"")
@Convert(converter = DateToUTCConverter.class)
private Date modified = new Date();
@ManyToOne(fetch = FetchType.LAZY)
@ -328,4 +331,10 @@ public class Dataset implements DataEntity<Dataset, UUID> {
public UUID getKeys() {
return this.id;
}
@Override
public Dataset buildFromTuple(List<Tuple> tuple, String base) {
this.id = (UUID) tuple.get(0).get(base.isEmpty() ? base + "." + "id" : "id");
return this;
}
}

8
dmp-backend/data/src/main/java/eu/eudat/data/entities/DatasetDataRepository.java

@ -5,6 +5,7 @@ import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Type;
import javax.persistence.*;
import java.util.List;
import java.util.UUID;
/**
@ -32,7 +33,6 @@ public class DatasetDataRepository implements DataEntity<DatasetDataRepository,U
@Column(name = "\"Role\"")
private Integer role;
@Column(name = "\"Data\"")
private String data;
@ -87,4 +87,10 @@ public class DatasetDataRepository implements DataEntity<DatasetDataRepository,U
public UUID getKeys() {
return this.id;
}
@Override
public DatasetDataRepository buildFromTuple(List<Tuple> tuple, String base) {
this.id = UUID.fromString((String) tuple.get(0).get(base.isEmpty() ? base + "." + "id" : "id"));
return this;
}
}

8
dmp-backend/data/src/main/java/eu/eudat/data/entities/DatasetExternalDataset.java

@ -5,6 +5,7 @@ import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Type;
import javax.persistence.*;
import java.util.List;
import java.util.UUID;
@ -18,7 +19,6 @@ public class DatasetExternalDataset implements DataEntity<DatasetExternalDataset
@Column(name = "\"Id\"", updatable = false, nullable = false, columnDefinition = "BINARY(16)")
private UUID id;
@ManyToOne
@JoinColumn(name = "\"Dataset\"", nullable = false)
private Dataset dataset;
@ -85,4 +85,10 @@ public class DatasetExternalDataset implements DataEntity<DatasetExternalDataset
public UUID getKeys() {
return this.id;
}
@Override
public DatasetExternalDataset buildFromTuple(List<Tuple> tuple, String base) {
this.id = UUID.fromString((String) tuple.get(0).get(base.isEmpty() ? base + "." + "id" : "id"));
return this;
}
}

10
dmp-backend/data/src/main/java/eu/eudat/data/entities/DatasetProfile.java

@ -1,12 +1,14 @@
package eu.eudat.data.entities;
import eu.eudat.data.converters.DateToUTCConverter;
import eu.eudat.queryable.queryableentity.DataEntity;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Type;
import javax.persistence.*;
import java.util.Date;
import java.util.List;
import java.util.Set;
import java.util.UUID;
@ -37,9 +39,11 @@ public class DatasetProfile implements DataEntity<DatasetProfile,UUID> {
@Column(name = "\"Created\"")
@Convert(converter = DateToUTCConverter.class)
private Date created;
@Column(name = "\"Modified\"")
@Convert(converter = DateToUTCConverter.class)
private Date modified = new Date();
@Column(name = "\"Description\"")
@ -135,4 +139,10 @@ public class DatasetProfile implements DataEntity<DatasetProfile,UUID> {
public UUID getKeys() {
return this.id;
}
@Override
public DatasetProfile buildFromTuple(List<Tuple> tuple, String base) {
this.id = UUID.fromString((String) tuple.get(0).get(base.isEmpty() ? base + "." + "id" : "id"));
return this;
}
}

7
dmp-backend/data/src/main/java/eu/eudat/data/entities/DatasetService.java

@ -7,6 +7,7 @@ import org.hibernate.annotations.Type;
import javax.persistence.*;
import java.io.Serializable;
import java.util.List;
import java.util.UUID;
@ -87,4 +88,10 @@ public class DatasetService implements DataEntity<DatasetService, UUID> {
public UUID getKeys() {
return this.id;
}
@Override
public DatasetService buildFromTuple(List<Tuple> tuple, String base) {
this.id = UUID.fromString((String) tuple.get(0).get(base.isEmpty() ? base + "." + "id" : "id"));
return this;
}
}

10
dmp-backend/data/src/main/java/eu/eudat/data/entities/ExternalDataset.java

@ -1,10 +1,12 @@
package eu.eudat.data.entities;
import eu.eudat.data.converters.DateToUTCConverter;
import eu.eudat.queryable.queryableentity.DataEntity;
import org.hibernate.annotations.GenericGenerator;
import javax.persistence.*;
import java.util.Date;
import java.util.List;
import java.util.Set;
import java.util.UUID;
@ -27,9 +29,11 @@ public class ExternalDataset implements DataEntity<ExternalDataset,UUID> {
private String reference;
@Column(name = "\"Created\"", nullable = false)
@Convert(converter = DateToUTCConverter.class)
private Date created;
@Column(name = "\"Modified\"", nullable = false)
@Convert(converter = DateToUTCConverter.class)
private Date modified;
@OneToMany(mappedBy = "externalDataset", cascade = CascadeType.ALL, orphanRemoval = true)
@ -102,4 +106,10 @@ public class ExternalDataset implements DataEntity<ExternalDataset,UUID> {
public UUID getKeys() {
return this.id;
}
@Override
public ExternalDataset buildFromTuple(List<Tuple> tuple, String base) {
this.id = UUID.fromString((String) tuple.get(0).get(base.isEmpty() ? base + "." + "id" : "id"));
return this;
}
}

7
dmp-backend/data/src/main/java/eu/eudat/data/entities/Invitation.java

@ -5,6 +5,7 @@ import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Type;
import javax.persistence.*;
import java.util.List;
import java.util.UUID;
@ -104,4 +105,10 @@ public class Invitation implements DataEntity<Invitation,UUID> {
public UUID getKeys() {
return this.id;
}
@Override
public Invitation buildFromTuple(List<Tuple> tuple, String base) {
this.id = UUID.fromString((String) tuple.get(0).get(base.isEmpty() ? base + "." + "id" : "id"));
return this;
}
}

10
dmp-backend/data/src/main/java/eu/eudat/data/entities/Organisation.java

@ -1,6 +1,7 @@
package eu.eudat.data.entities;
import eu.eudat.data.converters.DateToUTCConverter;
import eu.eudat.queryable.queryableentity.DataEntity;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Type;
@ -8,6 +9,7 @@ import org.hibernate.annotations.Type;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.util.Set;
import java.util.UUID;
@ -53,9 +55,11 @@ public class Organisation implements Serializable, DataEntity<Organisation,UUID>
@Column(name = "\"Created\"")
@Convert(converter = DateToUTCConverter.class)
private Date created = null;
@Column(name = "\"Modified\"")
@Convert(converter = DateToUTCConverter.class)
private Date modified = new Date();
@ -155,4 +159,10 @@ public class Organisation implements Serializable, DataEntity<Organisation,UUID>
public UUID getKeys() {
return this.id;
}
@Override
public Organisation buildFromTuple(List<Tuple> tuple, String base) {
this.id = UUID.fromString((String) tuple.get(0).get(base.isEmpty() ? base + "." + "id" : "id"));
return this;
}
}

20
dmp-backend/data/src/main/java/eu/eudat/data/entities/Project.java

@ -1,14 +1,17 @@
package eu.eudat.data.entities;
import eu.eudat.data.converters.DateToUTCConverter;
import eu.eudat.queryable.queryableentity.DataEntity;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Type;
import javax.persistence.*;
import java.util.Date;
import java.util.List;
import java.util.Set;
import java.util.UUID;
import java.util.stream.Collectors;
@Entity
@ -109,9 +112,11 @@ public class Project implements DataEntity<Project, UUID> {
@Column(name = "\"StartDate\"", nullable = false)
@Convert(converter = DateToUTCConverter.class)
private Date startdate = null;
@Column(name = "\"EndDate\"", nullable = false)
@Convert(converter = DateToUTCConverter.class)
private Date enddate = null;
@ -140,6 +145,13 @@ public class Project implements DataEntity<Project, UUID> {
@JoinColumn(name = "\"Content\"")
private Content content;
public Project() {
}
public Project(Project project) {
this.id = project.getId();
}
public String getDescription() {
return description;
}
@ -285,11 +297,17 @@ public class Project implements DataEntity<Project, UUID> {
this.enddate = entity.getEnddate();
this.modified = new Date();
if (entity.getContent() != null) this.content = entity.getContent();
//this.creationUser = entity.getCreationUser(); //TODO
}
@Override
public UUID getKeys() {
return this.id;
}
@Override
public Project buildFromTuple(List<Tuple> tuple, String base) {
this.id = (UUID) tuple.get(0).get(base.isEmpty() ? "id" : base + "." + "id" );
this.dmps = tuple.stream().map(x-> new DMP().buildFromTuple(tuple,"dmps")).collect(Collectors.toSet());
return this;
}
}

10
dmp-backend/data/src/main/java/eu/eudat/data/entities/Registry.java

@ -1,12 +1,14 @@
package eu.eudat.data.entities;
import eu.eudat.data.converters.DateToUTCConverter;
import eu.eudat.queryable.queryableentity.DataEntity;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Type;
import javax.persistence.*;
import java.util.Date;
import java.util.List;
import java.util.Set;
import java.util.UUID;
@ -50,9 +52,11 @@ public class Registry implements DataEntity<Registry,UUID> {
@Column(name = "\"Created\"")
@Convert(converter = DateToUTCConverter.class)
private Date created = null;
@Column(name = "\"Modified\"")
@Convert(converter = DateToUTCConverter.class)
private Date modified = new Date();
@ -151,4 +155,10 @@ public class Registry implements DataEntity<Registry,UUID> {
public UUID getKeys() {
return this.id;
}
@Override
public Registry buildFromTuple(List<Tuple> tuple, String base) {
this.id = UUID.fromString((String) tuple.get(0).get(base.isEmpty() ? base + "." + "id" : "id"));
return this;
}
}

10
dmp-backend/data/src/main/java/eu/eudat/data/entities/Researcher.java

@ -1,12 +1,14 @@
package eu.eudat.data.entities;
import eu.eudat.data.converters.DateToUTCConverter;
import eu.eudat.queryable.queryableentity.DataEntity;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Type;
import javax.persistence.*;
import java.util.Date;
import java.util.List;
import java.util.Set;
import java.util.UUID;
@ -52,9 +54,11 @@ public class Researcher implements DataEntity<Researcher,UUID> {
@Column(name = "\"Created\"")
@Convert(converter = DateToUTCConverter.class)
private Date created = null;
@Column(name = "\"Modified\"")
@Convert(converter = DateToUTCConverter.class)
private Date modified = new Date();
@ -154,4 +158,10 @@ public class Researcher implements DataEntity<Researcher,UUID> {
public UUID getKeys() {
return this.id;
}
@Override
public Researcher buildFromTuple(List<Tuple> tuple, String base) {
this.id = UUID.fromString((String) tuple.get(0).get(base.isEmpty() ? base + "." + "id" : "id"));
return this;
}
}

11
dmp-backend/data/src/main/java/eu/eudat/data/entities/Service.java

@ -1,12 +1,13 @@
package eu.eudat.data.entities;
import eu.eudat.data.converters.DateToUTCConverter;
import eu.eudat.queryable.queryableentity.DataEntity;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Type;
import javax.persistence.*;
import java.util.Date;
import java.util.List;
import java.util.Set;
import java.util.UUID;
@ -46,9 +47,11 @@ public class Service implements DataEntity<Service, UUID> {
@Column(name = "\"Created\"")
@Convert(converter = DateToUTCConverter.class)
private Date created = null;
@Column(name = "\"Modified\"")
@Convert(converter = DateToUTCConverter.class)
private Date modified = new Date();
@ -147,4 +150,10 @@ public class Service implements DataEntity<Service, UUID> {
public UUID getKeys() {
return this.id;
}
@Override
public Service buildFromTuple(List<Tuple> tuple, String base) {
this.id = UUID.fromString((String) tuple.get(0).get(base.isEmpty() ? base + "." + "id" : "id"));
return this;
}
}

7
dmp-backend/data/src/main/java/eu/eudat/data/entities/UserDMP.java

@ -4,6 +4,7 @@ import eu.eudat.queryable.queryableentity.DataEntity;
import org.hibernate.annotations.GenericGenerator;
import javax.persistence.*;
import java.util.List;
import java.util.UUID;
@Entity
@ -94,4 +95,10 @@ public class UserDMP implements DataEntity<UserDMP, UUID> {
public UUID getKeys() {
return this.id;
}
@Override
public UserDMP buildFromTuple(List<Tuple> tuple, String base) {
this.id = UUID.fromString((String) tuple.get(0).get(base.isEmpty() ? base + "." + "id" : "id"));
return this;
}
}

14
dmp-backend/data/src/main/java/eu/eudat/data/entities/UserInfo.java

@ -1,14 +1,12 @@
package eu.eudat.data.entities;
import eu.eudat.data.converters.DateToUTCConverter;
import eu.eudat.queryable.queryableentity.DataEntity;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Type;
import javax.persistence.*;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
import java.util.*;
@Entity
@ -44,10 +42,12 @@ public class UserInfo implements DataEntity<UserInfo, UUID> {
@Column(name = "created", nullable = false)
@Convert(converter = DateToUTCConverter.class)
private Date created = null;
@Column(name = "lastloggedin", nullable = true)
@Convert(converter = DateToUTCConverter.class)
private Date lastloggedin = null;
@ -177,4 +177,10 @@ public class UserInfo implements DataEntity<UserInfo, UUID> {
public UUID getKeys() {
return this.id;
}
@Override
public UserInfo buildFromTuple(List<Tuple> tuple, String base) {
this.id = (UUID) tuple.get(0).get(base.isEmpty() ? "id" : base + "." + "id" );
return this;
}
}

7
dmp-backend/data/src/main/java/eu/eudat/data/entities/UserRole.java

@ -4,6 +4,7 @@ import eu.eudat.queryable.queryableentity.DataEntity;
import org.hibernate.annotations.GenericGenerator;
import javax.persistence.*;
import java.util.List;
import java.util.UUID;
@ -57,4 +58,10 @@ public class UserRole implements DataEntity<UserRole, UUID> {
public UUID getKeys() {
return this.id;
}
@Override
public UserRole buildFromTuple(List<Tuple> tuple, String base) {
this.id = UUID.fromString((String) tuple.get(0).get(base.isEmpty() ? base + "." + "id" : "id"));
return this;
}
}

10
dmp-backend/data/src/main/java/eu/eudat/data/entities/UserToken.java

@ -1,9 +1,11 @@
package eu.eudat.data.entities;
import eu.eudat.data.converters.DateToUTCConverter;
import eu.eudat.queryable.queryableentity.DataEntity;
import javax.persistence.*;
import java.util.Date;
import java.util.List;
import java.util.UUID;
@ -20,10 +22,12 @@ public class UserToken implements DataEntity<UserToken, UUID> {
private UserInfo user;
@Column(name = "\"IssuedAt\"", nullable = false)
@Convert(converter = DateToUTCConverter.class)
private Date issuedAt = null;
@Column(name = "\"ExpiresAt\"", nullable = false)
@Convert(converter = DateToUTCConverter.class)
private Date expiresAt = null;
public UUID getToken() {
@ -67,4 +71,10 @@ public class UserToken implements DataEntity<UserToken, UUID> {
public UUID getKeys() {
return this.token;
}
@Override
public UserToken buildFromTuple(List<Tuple> tuple, String base) {
this.token = UUID.fromString((String) tuple.get(0).get(base.isEmpty() ? base + "." + "token" : "token"));
return this;
}
}

10
dmp-backend/data/src/main/java/eu/eudat/data/query/items/item/project/ProjectCriteriaRequest.java

@ -8,6 +8,16 @@ import eu.eudat.queryable.QueryableList;
import java.util.UUID;
public class ProjectCriteriaRequest extends Query<ProjectCriteria,Project> {
private Integer length;
public Integer getLength() {
return length;
}
public void setLength(Integer length) {
this.length = length;
}
private ProjectCriteriaRequest() {
}

38
dmp-backend/data/src/main/java/eu/eudat/data/query/items/table/dataset/DatasetPublicTableRequest.java

@ -0,0 +1,38 @@
package eu.eudat.data.query.items.table.dataset;
import eu.eudat.data.dao.criteria.DatasetPublicCriteria;
import eu.eudat.data.entities.Dataset;
import eu.eudat.data.query.definition.TableQuery;
import eu.eudat.queryable.QueryableList;
import eu.eudat.queryable.types.FieldSelectionType;
import eu.eudat.queryable.types.SelectionField;
import java.util.Arrays;
import java.util.UUID;
/**
* Created by ikalyvas on 10/2/2018.
*/
public class DatasetPublicTableRequest extends TableQuery<DatasetPublicCriteria, Dataset, UUID> {
@Override
public QueryableList<Dataset> applyCriteria() {
QueryableList<Dataset> query = this.getQuery();
query.initSubQuery(String.class).where((builder, root) -> builder.equal(root.get("dmp").get("version"),
query.<String>subQueryMax((builder1, externalRoot, nestedRoot) -> builder1.equal(externalRoot.get("dmp").get("groupId"), nestedRoot.get("dmp").get("groupId")),
Arrays.asList(new SelectionField(FieldSelectionType.COMPOSITE_FIELD, "dmp:version")), String.class)));
if (this.getCriteria().projects != null && !this.getCriteria().projects.isEmpty())
query.where(((builder, root) -> root.get("dmp").get("project").get("id").in(this.getCriteria().projects)));
if (this.getCriteria().projectStatus != null) query
.where(((builder, root) -> builder.equal(root.get("dmp").get("project").get("status"), this.getCriteria().projectStatus.getValue())));
if (this.getCriteria().datasetProfile != null && !this.getCriteria().datasetProfile.isEmpty()) query
.where(((builder, root) -> root.get("profile").get("id").in(this.getCriteria().datasetProfile)));
if(this.getCriteria().dmpOrganisations != null && !this.getCriteria().dmpOrganisations.isEmpty())query
.where(((builder, root) -> root.join("dmp").join("organisations").get("reference").in(this.getCriteria().dmpOrganisations)));
return query;
}
@Override
public QueryableList<Dataset> applyPaging(QueryableList<Dataset> items) {
return null;