Implemented builder and query for DMP entity, refactored services package
This commit is contained in:
parent
3ad7441bb5
commit
c338a93d71
|
@ -87,6 +87,18 @@ public class DMPEntity {
|
|||
|
||||
public static final String _isActive = "isActive";
|
||||
|
||||
@Column(name = "\"FinalizedAt\"")
|
||||
@Convert(converter = DateToUTCConverter.class)
|
||||
private Instant finalizedAt;
|
||||
|
||||
public static final String _finalizedAt = "finalizedAt";
|
||||
|
||||
@Column(name = "\"PublishedAt\"")
|
||||
@Convert(converter = DateToUTCConverter.class)
|
||||
private Instant publishedAt;
|
||||
|
||||
public static final String _publishedAt = "publishedAt";
|
||||
|
||||
//TODO: (thgiannos) Handle using the DMPEntity builder
|
||||
// @OneToMany(mappedBy = "dmp", fetch = FetchType.LAZY)
|
||||
// private Set<Dataset> dataset;
|
||||
|
@ -96,6 +108,8 @@ public class DMPEntity {
|
|||
//TODO: (thgiannos) Previously 'Grant'
|
||||
private UUID grant;
|
||||
|
||||
public static final String _grant = "grant";
|
||||
|
||||
//TODO: (thgiannos) Handle using the DMPEntity builder
|
||||
// @OneToMany(fetch = FetchType.LAZY, mappedBy = "dmp")
|
||||
// private Set<DMPDatasetProfile> associatedDmps;
|
||||
|
@ -105,11 +119,15 @@ public class DMPEntity {
|
|||
//TODO: (thgiannos) Previously 'DMPProfile'
|
||||
private UUID profile;
|
||||
|
||||
public static final String _profile = "profile";
|
||||
|
||||
// @ManyToOne(fetch = FetchType.LAZY)
|
||||
// @JoinColumn(name = "\"Creator\"")
|
||||
//TODO: (thgiannos) Previously 'UserInfo'
|
||||
private UUID creator;
|
||||
|
||||
public static final String _creator = "creator";
|
||||
|
||||
//TODO: (thgiannos) Handle using the DMPEntity builder
|
||||
// @OneToMany(mappedBy = "entityId", fetch = FetchType.LAZY)
|
||||
// private Set<EntityDoiEntity> dois;
|
||||
|
@ -119,6 +137,8 @@ public class DMPEntity {
|
|||
//TODO: (thgiannos) Previously 'Project'
|
||||
private UUID project;
|
||||
|
||||
public static final String _project = "project";
|
||||
|
||||
// TODO: (thgiannos) Implement join entity
|
||||
// @OneToMany(fetch = FetchType.LAZY)
|
||||
// @JoinTable(name = "\"DMPOrganisation\"",
|
||||
|
@ -138,14 +158,6 @@ public class DMPEntity {
|
|||
//TODO: (thgiannos) Handle using the DMPEntity builder
|
||||
// private Set<UserDMP> users;
|
||||
|
||||
// @Column(name = "\"FinalizedAt\"")
|
||||
// @Convert(converter = DateToUTCConverter.class)
|
||||
// private Date finalizedAt;
|
||||
//
|
||||
// @Column(name = "\"PublishedAt\"")
|
||||
// @Convert(converter = DateToUTCConverter.class)
|
||||
// private Date publishedAt;
|
||||
|
||||
public UUID getId() {
|
||||
return id;
|
||||
}
|
||||
|
@ -210,11 +222,11 @@ public class DMPEntity {
|
|||
this.description = description;
|
||||
}
|
||||
|
||||
public boolean getPublic() {
|
||||
public boolean getIsPublic() {
|
||||
return isPublic;
|
||||
}
|
||||
|
||||
public void setPublic(boolean aPublic) {
|
||||
public void setIsPublic(boolean aPublic) {
|
||||
isPublic = aPublic;
|
||||
}
|
||||
|
||||
|
@ -250,6 +262,22 @@ public class DMPEntity {
|
|||
this.isActive = isActive;
|
||||
}
|
||||
|
||||
public Instant getFinalizedAt() {
|
||||
return finalizedAt;
|
||||
}
|
||||
|
||||
public void setFinalizedAt(Instant finalizedAt) {
|
||||
this.finalizedAt = finalizedAt;
|
||||
}
|
||||
|
||||
public Instant getPublishedAt() {
|
||||
return publishedAt;
|
||||
}
|
||||
|
||||
public void setPublishedAt(Instant publishedAt) {
|
||||
this.publishedAt = publishedAt;
|
||||
}
|
||||
|
||||
public UUID getGrant() {
|
||||
return grant;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,250 @@
|
|||
package eu.eudat.model;
|
||||
|
||||
import eu.eudat.commons.enums.DMPStatus;
|
||||
import eu.eudat.commons.enums.IsActive;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.UUID;
|
||||
|
||||
public class DMP {
|
||||
|
||||
private UUID id;
|
||||
|
||||
public static final String _id = "id";
|
||||
|
||||
private String label;
|
||||
|
||||
public static final String _label = "label";
|
||||
|
||||
private Integer version;
|
||||
|
||||
public static final String _version = "version";
|
||||
|
||||
private DMPStatus status;
|
||||
|
||||
public static final String _status = "status";
|
||||
|
||||
private String properties;
|
||||
|
||||
public static final String _properties = "properties";
|
||||
|
||||
private String dmpProperties;
|
||||
|
||||
public static final String _dmpProperties = "dmpProperties";
|
||||
|
||||
private UUID groupId;
|
||||
|
||||
public static final String _groupId = "groupId";
|
||||
|
||||
private String description;
|
||||
|
||||
public static final String _description = "description";
|
||||
|
||||
private boolean isPublic;
|
||||
|
||||
public static final String _isPublic = "isPublic";
|
||||
|
||||
private String extraProperties;
|
||||
|
||||
public static final String _extraProperties = "extraProperties";
|
||||
|
||||
private Instant createdAt;
|
||||
|
||||
public static final String _createdAt = "createdAt";
|
||||
|
||||
private Instant updatedAt;
|
||||
|
||||
public static final String _updatedAt = "updatedAt";
|
||||
|
||||
private IsActive isActive;
|
||||
|
||||
public static final String _isActive = "isActive";
|
||||
|
||||
private Instant finalizedAt;
|
||||
|
||||
public static final String _finalizedAt = "finalizedAt";
|
||||
|
||||
private Instant publishedAt;
|
||||
|
||||
public static final String _publishedAt = "publishedAt";
|
||||
|
||||
private UUID grant;
|
||||
|
||||
public static final String _grant = "grant";
|
||||
|
||||
private UUID profile;
|
||||
|
||||
public static final String _profile = "profile";
|
||||
|
||||
private UUID creator;
|
||||
|
||||
public static final String _creator = "creator";
|
||||
|
||||
private UUID project;
|
||||
|
||||
public static final String _project = "project";
|
||||
|
||||
public final static String _hash = "hash";
|
||||
|
||||
private String hash;
|
||||
|
||||
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 Integer getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(Integer version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public DMPStatus getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(DMPStatus status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getProperties() {
|
||||
return properties;
|
||||
}
|
||||
|
||||
public void setProperties(String properties) {
|
||||
this.properties = properties;
|
||||
}
|
||||
|
||||
public String getDmpProperties() {
|
||||
return dmpProperties;
|
||||
}
|
||||
|
||||
public void setDmpProperties(String dmpProperties) {
|
||||
this.dmpProperties = dmpProperties;
|
||||
}
|
||||
|
||||
public UUID getGroupId() {
|
||||
return groupId;
|
||||
}
|
||||
|
||||
public void setGroupId(UUID groupId) {
|
||||
this.groupId = groupId;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public boolean getIsPublic() {
|
||||
return isPublic;
|
||||
}
|
||||
|
||||
public void setIsPublic(boolean aPublic) {
|
||||
isPublic = aPublic;
|
||||
}
|
||||
|
||||
public String getExtraProperties() {
|
||||
return extraProperties;
|
||||
}
|
||||
|
||||
public void setExtraProperties(String extraProperties) {
|
||||
this.extraProperties = extraProperties;
|
||||
}
|
||||
|
||||
public Instant getCreatedAt() {
|
||||
return createdAt;
|
||||
}
|
||||
|
||||
public void setCreatedAt(Instant createdAt) {
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public Instant getUpdatedAt() {
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
public void setUpdatedAt(Instant updatedAt) {
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
|
||||
public IsActive getIsActive() {
|
||||
return isActive;
|
||||
}
|
||||
|
||||
public void setIsActive(IsActive isActive) {
|
||||
this.isActive = isActive;
|
||||
}
|
||||
|
||||
public Instant getFinalizedAt() {
|
||||
return finalizedAt;
|
||||
}
|
||||
|
||||
public void setFinalizedAt(Instant finalizedAt) {
|
||||
this.finalizedAt = finalizedAt;
|
||||
}
|
||||
|
||||
public Instant getPublishedAt() {
|
||||
return publishedAt;
|
||||
}
|
||||
|
||||
public void setPublishedAt(Instant publishedAt) {
|
||||
this.publishedAt = publishedAt;
|
||||
}
|
||||
|
||||
public UUID getGrant() {
|
||||
return grant;
|
||||
}
|
||||
|
||||
public void setGrant(UUID grant) {
|
||||
this.grant = grant;
|
||||
}
|
||||
|
||||
public UUID getProfile() {
|
||||
return profile;
|
||||
}
|
||||
|
||||
public void setProfile(UUID profile) {
|
||||
this.profile = profile;
|
||||
}
|
||||
|
||||
public UUID getCreator() {
|
||||
return creator;
|
||||
}
|
||||
|
||||
public void setCreator(UUID creator) {
|
||||
this.creator = creator;
|
||||
}
|
||||
|
||||
public UUID getProject() {
|
||||
return project;
|
||||
}
|
||||
|
||||
public void setProject(UUID project) {
|
||||
this.project = project;
|
||||
}
|
||||
|
||||
public String getHash() {
|
||||
return hash;
|
||||
}
|
||||
|
||||
public void setHash(String hash) {
|
||||
this.hash = hash;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,66 @@
|
|||
package eu.eudat.model.builder;
|
||||
|
||||
public class DMPBuilder {
|
||||
import eu.eudat.authorization.AuthorizationFlags;
|
||||
import eu.eudat.convention.ConventionService;
|
||||
import eu.eudat.data.DMPEntity;
|
||||
import eu.eudat.model.DMP;
|
||||
import gr.cite.tools.exception.MyApplicationException;
|
||||
import gr.cite.tools.fieldset.FieldSet;
|
||||
import gr.cite.tools.logging.DataLogEntry;
|
||||
import gr.cite.tools.logging.LoggerService;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@Component
|
||||
@Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE)
|
||||
public class DMPBuilder extends BaseBuilder<DMP, DMPEntity> {
|
||||
|
||||
private EnumSet<AuthorizationFlags> authorize = EnumSet.of(AuthorizationFlags.None);
|
||||
|
||||
@Autowired
|
||||
public DMPBuilder(ConventionService conventionService) {
|
||||
super(conventionService, new LoggerService(LoggerFactory.getLogger(DMPBuilder.class)));
|
||||
}
|
||||
|
||||
public DMPBuilder authorize(EnumSet<AuthorizationFlags> values) {
|
||||
this.authorize = values;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DMP> build(FieldSet fields, List<DMPEntity> data) throws MyApplicationException {
|
||||
this.logger.debug("building for {} items requesting {} fields", Optional.ofNullable(data).map(List::size).orElse(0), Optional.ofNullable(fields).map(FieldSet::getFields).map(Set::size).orElse(0));
|
||||
this.logger.trace(new DataLogEntry("requested fields", fields));
|
||||
if (fields == null || data == null || fields.isEmpty())
|
||||
return new ArrayList<>();
|
||||
List<DMP> models = new ArrayList<>();
|
||||
for (DMPEntity d : data) {
|
||||
DMP m = new DMP();
|
||||
if (fields.hasField(this.asIndexer(DMP._id))) m.setId(d.getId());
|
||||
if (fields.hasField(this.asIndexer(DMP._label))) m.setLabel(d.getLabel());
|
||||
if (fields.hasField(this.asIndexer(DMP._version))) m.setVersion(d.getVersion());
|
||||
if (fields.hasField(this.asIndexer(DMP._status))) m.setStatus(d.getStatus());
|
||||
if (fields.hasField(this.asIndexer(DMP._properties))) m.setProperties(d.getProperties());
|
||||
if (fields.hasField(this.asIndexer(DMP._dmpProperties))) m.setDmpProperties(d.getDmpProperties());
|
||||
if (fields.hasField(this.asIndexer(DMP._groupId))) m.setGroupId(d.getGroupId());
|
||||
if (fields.hasField(this.asIndexer(DMP._description))) m.setDescription(d.getDescription());
|
||||
if (fields.hasField(this.asIndexer(DMP._isPublic))) m.setIsPublic(d.getIsPublic());
|
||||
if (fields.hasField(this.asIndexer(DMP._extraProperties))) m.setExtraProperties(d.getExtraProperties());
|
||||
if (fields.hasField(this.asIndexer(DMP._createdAt))) m.setCreatedAt(d.getCreatedAt());
|
||||
if (fields.hasField(this.asIndexer(DMP._updatedAt))) m.setUpdatedAt(d.getUpdatedAt());
|
||||
if (fields.hasField(this.asIndexer(DMP._isActive))) m.setIsActive(d.getIsActive());
|
||||
if (fields.hasField(this.asIndexer(DMP._finalizedAt))) m.setFinalizedAt(d.getFinalizedAt());
|
||||
if (fields.hasField(this.asIndexer(DMP._publishedAt))) m.setPublishedAt(d.getPublishedAt());
|
||||
if (fields.hasField(this.asIndexer(DMP._hash))) m.setHash(this.hashValue(d.getUpdatedAt()));
|
||||
models.add(m);
|
||||
}
|
||||
this.logger.debug("build {} items", Optional.of(models).map(List::size).orElse(0));
|
||||
return models;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,208 @@
|
|||
package eu.eudat.query;
|
||||
|
||||
public class DMPQueryV2 {
|
||||
import eu.eudat.authorization.AuthorizationFlags;
|
||||
import eu.eudat.commons.enums.DMPStatus;
|
||||
import eu.eudat.commons.enums.IsActive;
|
||||
import eu.eudat.commons.scope.user.UserScope;
|
||||
import eu.eudat.data.DMPEntity;
|
||||
import eu.eudat.model.DMP;
|
||||
import gr.cite.commons.web.authz.service.AuthorizationService;
|
||||
import gr.cite.tools.data.query.FieldResolver;
|
||||
import gr.cite.tools.data.query.QueryBase;
|
||||
import gr.cite.tools.data.query.QueryContext;
|
||||
import jakarta.persistence.Tuple;
|
||||
import jakarta.persistence.criteria.CriteriaBuilder;
|
||||
import jakarta.persistence.criteria.Predicate;
|
||||
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.*;
|
||||
|
||||
@Component
|
||||
@Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE)
|
||||
public class DMPQueryV2 extends QueryBase<DMPEntity> {
|
||||
|
||||
private String like;
|
||||
|
||||
private Collection<UUID> ids;
|
||||
|
||||
private Collection<IsActive> isActives;
|
||||
|
||||
private Collection<DMPStatus> statuses;
|
||||
|
||||
private Collection<UUID> excludedIds;
|
||||
|
||||
private EnumSet<AuthorizationFlags> authorize = EnumSet.of(AuthorizationFlags.None);
|
||||
|
||||
private final UserScope userScope;
|
||||
|
||||
private final AuthorizationService authService;
|
||||
|
||||
public DMPQueryV2(UserScope userScope, AuthorizationService authService) {
|
||||
this.userScope = userScope;
|
||||
this.authService = authService;
|
||||
}
|
||||
|
||||
public DMPQueryV2 like(String value) {
|
||||
this.like = value;
|
||||
return this;
|
||||
}
|
||||
|
||||
public DMPQueryV2 ids(UUID value) {
|
||||
this.ids = List.of(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public DMPQueryV2 ids(UUID... value) {
|
||||
this.ids = Arrays.asList(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public DMPQueryV2 ids(Collection<UUID> values) {
|
||||
this.ids = values;
|
||||
return this;
|
||||
}
|
||||
|
||||
public DMPQueryV2 isActive(IsActive value) {
|
||||
this.isActives = List.of(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public DMPQueryV2 isActive(IsActive... value) {
|
||||
this.isActives = Arrays.asList(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public DMPQueryV2 isActive(Collection<IsActive> values) {
|
||||
this.isActives = values;
|
||||
return this;
|
||||
}
|
||||
|
||||
public DMPQueryV2 statuses(DMPStatus value) {
|
||||
this.statuses = List.of(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public DMPQueryV2 statuses(DMPStatus... value) {
|
||||
this.statuses = Arrays.asList(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public DMPQueryV2 statuses(Collection<DMPStatus> values) {
|
||||
this.statuses = values;
|
||||
return this;
|
||||
}
|
||||
|
||||
public DMPQueryV2 excludedIds(Collection<UUID> values) {
|
||||
this.excludedIds = values;
|
||||
return this;
|
||||
}
|
||||
|
||||
public DMPQueryV2 excludedIds(UUID value) {
|
||||
this.excludedIds = List.of(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public DMPQueryV2 excludedIds(UUID... value) {
|
||||
this.excludedIds = Arrays.asList(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public DMPQueryV2 authorize(EnumSet<AuthorizationFlags> values) {
|
||||
this.authorize = values;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Boolean isFalseQuery() {
|
||||
return this.isEmpty(this.ids) || this.isEmpty(this.isActives) || this.isEmpty(this.excludedIds) || this.isEmpty(this.statuses);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class<DMPEntity> entityClass() {
|
||||
return DMPEntity.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected <X, Y> Predicate applyFilters(QueryContext<X, Y> queryContext) {
|
||||
List<Predicate> predicates = new ArrayList<>();
|
||||
if (this.ids != null) {
|
||||
CriteriaBuilder.In<UUID> inClause = queryContext.CriteriaBuilder.in(queryContext.Root.get(DMPEntity._id));
|
||||
for (UUID item : this.ids)
|
||||
inClause.value(item);
|
||||
predicates.add(inClause);
|
||||
}
|
||||
if (this.like != null && !this.like.isEmpty()) {
|
||||
predicates.add(queryContext.CriteriaBuilder.like(queryContext.Root.get(DMPEntity._label), this.like));
|
||||
}
|
||||
if (this.isActives != null) {
|
||||
CriteriaBuilder.In<IsActive> inClause = queryContext.CriteriaBuilder.in(queryContext.Root.get(DMPEntity._isActive));
|
||||
for (IsActive item : this.isActives)
|
||||
inClause.value(item);
|
||||
predicates.add(inClause);
|
||||
}
|
||||
|
||||
if (this.statuses != null) {
|
||||
CriteriaBuilder.In<DMPStatus> inClause = queryContext.CriteriaBuilder.in(queryContext.Root.get(DMPEntity._status));
|
||||
for (DMPStatus item : this.statuses)
|
||||
inClause.value(item);
|
||||
predicates.add(inClause);
|
||||
}
|
||||
if (this.excludedIds != null) {
|
||||
CriteriaBuilder.In<UUID> notInClause = queryContext.CriteriaBuilder.in(queryContext.Root.get(DMPEntity._id));
|
||||
for (UUID item : this.excludedIds)
|
||||
notInClause.value(item);
|
||||
predicates.add(notInClause.not());
|
||||
}
|
||||
if (!predicates.isEmpty()) {
|
||||
Predicate[] predicatesArray = predicates.toArray(new Predicate[0]);
|
||||
return queryContext.CriteriaBuilder.and(predicatesArray);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String fieldNameOf(FieldResolver item) {
|
||||
if (item.match(DMP._id)) return DMPEntity._id;
|
||||
else if (item.match(DMP._label)) return DMPEntity._label;
|
||||
else if (item.match(DMP._version)) return DMPEntity._version;
|
||||
else if (item.match(DMP._status)) return DMPEntity._status;
|
||||
else if (item.match(DMP._properties)) return DMPEntity._properties;
|
||||
else if (item.match(DMP._dmpProperties)) return DMPEntity._dmpProperties;
|
||||
else if (item.match(DMP._groupId)) return DMPEntity._groupId;
|
||||
else if (item.match(DMP._description)) return DMPEntity._description;
|
||||
else if (item.match(DMP._isPublic)) return DMPEntity._isPublic;
|
||||
else if (item.match(DMP._extraProperties)) return DMPEntity._extraProperties;
|
||||
else if (item.match(DMP._createdAt)) return DMPEntity._createdAt;
|
||||
else if (item.match(DMP._updatedAt)) return DMPEntity._updatedAt;
|
||||
else if (item.match(DMP._isActive)) return DMPEntity._isActive;
|
||||
else if (item.match(DMP._finalizedAt)) return DMPEntity._finalizedAt;
|
||||
else if (item.match(DMP._publishedAt)) return DMPEntity._publishedAt;
|
||||
else return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected DMPEntity convert(Tuple tuple, Set<String> columns) {
|
||||
DMPEntity item = new DMPEntity();
|
||||
item.setId(QueryBase.convertSafe(tuple, columns, DMPEntity._id, UUID.class));
|
||||
item.setLabel(QueryBase.convertSafe(tuple, columns, DMPEntity._label, String.class));
|
||||
item.setVersion(QueryBase.convertSafe(tuple, columns, DMPEntity._version, Integer.class));
|
||||
item.setStatus(QueryBase.convertSafe(tuple, columns, DMPEntity._status, DMPStatus.class));
|
||||
item.setProperties(QueryBase.convertSafe(tuple, columns, DMPEntity._properties, String.class));
|
||||
item.setDmpProperties(QueryBase.convertSafe(tuple, columns, DMPEntity._dmpProperties, String.class));
|
||||
item.setGroupId(QueryBase.convertSafe(tuple, columns, DMPEntity._groupId, UUID.class));
|
||||
item.setDescription(QueryBase.convertSafe(tuple, columns, DMPEntity._description, String.class));
|
||||
item.setIsPublic(QueryBase.convertSafe(tuple, columns, DMPEntity._isPublic, Boolean.class));
|
||||
item.setExtraProperties(QueryBase.convertSafe(tuple, columns, DMPEntity._extraProperties, String.class));
|
||||
item.setCreatedAt(QueryBase.convertSafe(tuple, columns, DMPEntity._createdAt, Instant.class));
|
||||
item.setUpdatedAt(QueryBase.convertSafe(tuple, columns, DMPEntity._updatedAt, Instant.class));
|
||||
item.setIsActive(QueryBase.convertSafe(tuple, columns, DMPEntity._isActive, IsActive.class));
|
||||
item.setFinalizedAt(QueryBase.convertSafe(tuple, columns, DMPEntity._finalizedAt, Instant.class));
|
||||
item.setPublishedAt(QueryBase.convertSafe(tuple, columns, DMPEntity._publishedAt, Instant.class));
|
||||
return item;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package eu.eudat.service;
|
||||
package eu.eudat.service.descriptiontemplatetype;
|
||||
|
||||
import eu.eudat.model.DescriptionTemplateType;
|
||||
import eu.eudat.model.persist.DescriptionTemplateTypePersist;
|
|
@ -1,4 +1,4 @@
|
|||
package eu.eudat.service;
|
||||
package eu.eudat.service.descriptiontemplatetype;
|
||||
|
||||
import eu.eudat.authorization.AuthorizationFlags;
|
||||
import eu.eudat.authorization.Permission;
|
||||
|
@ -31,7 +31,6 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.context.MessageSource;
|
||||
import org.springframework.context.i18n.LocaleContextHolder;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.context.annotation.RequestScope;
|
||||
|
||||
import javax.management.InvalidApplicationException;
|
||||
import java.time.Instant;
|
|
@ -1,4 +1,4 @@
|
|||
package eu.eudat.service;
|
||||
package eu.eudat.service.dmp;
|
||||
|
||||
public interface DMPService {
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package eu.eudat.service;
|
||||
package eu.eudat.service.dmp;
|
||||
|
||||
public class DMPServiceImpl implements DMPService {
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package eu.eudat.service;
|
||||
package eu.eudat.service.entitydoi;
|
||||
|
||||
import eu.eudat.model.DescriptionTemplateType;
|
||||
import eu.eudat.model.EntityDoi;
|
|
@ -1,4 +1,4 @@
|
|||
package eu.eudat.service;
|
||||
package eu.eudat.service.entitydoi;
|
||||
|
||||
import eu.eudat.authorization.AuthorizationFlags;
|
||||
import eu.eudat.authorization.Permission;
|
||||
|
@ -6,20 +6,14 @@ import eu.eudat.commons.JsonHandlingService;
|
|||
import eu.eudat.commons.enums.EntityType;
|
||||
import eu.eudat.commons.enums.IsActive;
|
||||
import eu.eudat.convention.ConventionService;
|
||||
import eu.eudat.data.DescriptionTemplateTypeEntity;
|
||||
import eu.eudat.data.EntityDoiEntity;
|
||||
import eu.eudat.data.old.DMP;
|
||||
import eu.eudat.errorcode.ErrorThesaurusProperties;
|
||||
import eu.eudat.event.DescriptionTemplateTypeTouchedEvent;
|
||||
import eu.eudat.event.EntityDoiTouchedEvent;
|
||||
import eu.eudat.event.EventBroker;
|
||||
import eu.eudat.model.DescriptionTemplateType;
|
||||
import eu.eudat.model.EntityDoi;
|
||||
import eu.eudat.model.builder.DescriptionTemplateTypeBuilder;
|
||||
import eu.eudat.model.builder.EntityDoiBuilder;
|
||||
import eu.eudat.model.deleter.DescriptionTemplateTypeDeleter;
|
||||
import eu.eudat.model.deleter.EntityDoiDeleter;
|
||||
import eu.eudat.model.persist.DescriptionTemplateTypePersist;
|
||||
import eu.eudat.model.persist.EntityDoiPersist;
|
||||
import gr.cite.commons.web.authz.service.AuthorizationService;
|
||||
import gr.cite.tools.data.builder.BuilderFactory;
|
||||
|
@ -38,14 +32,11 @@ import org.slf4j.LoggerFactory;
|
|||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.MessageSource;
|
||||
import org.springframework.context.i18n.LocaleContextHolder;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.management.InvalidApplicationException;
|
||||
import java.time.Instant;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
@Service
|
|
@ -19,7 +19,7 @@ import eu.eudat.models.data.datasetprofile.DatasetProfileListingModel;
|
|||
import eu.eudat.models.data.helpers.common.DataTableData;
|
||||
import eu.eudat.models.data.helpers.responses.ResponseItem;
|
||||
import eu.eudat.models.data.user.composite.PagedDatasetProfile;
|
||||
import eu.eudat.service.DescriptionTemplateTypeService;
|
||||
import eu.eudat.service.descriptiontemplatetype.DescriptionTemplateTypeService;
|
||||
import eu.eudat.types.ApiMessageCode;
|
||||
import eu.eudat.types.MetricNames;
|
||||
import gr.cite.commons.web.authz.service.AuthorizationService;
|
||||
|
@ -37,9 +37,6 @@ import java.io.IOException;
|
|||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import static eu.eudat.types.Authorities.ADMIN;
|
||||
import static eu.eudat.types.Authorities.DATASET_PROFILE_MANAGER;
|
||||
|
||||
@RestController
|
||||
@CrossOrigin
|
||||
@RequestMapping(value = {"/api/admin/"})
|
||||
|
|
|
@ -10,7 +10,7 @@ import eu.eudat.model.persist.DescriptionTemplateTypePersist;
|
|||
import eu.eudat.model.result.QueryResult;
|
||||
import eu.eudat.query.DescriptionTemplateTypeQuery;
|
||||
import eu.eudat.query.lookup.DescriptionTemplateTypeLookup;
|
||||
import eu.eudat.service.DescriptionTemplateTypeService;
|
||||
import eu.eudat.service.descriptiontemplatetype.DescriptionTemplateTypeService;
|
||||
import gr.cite.tools.auditing.AuditService;
|
||||
import gr.cite.tools.data.builder.BuilderFactory;
|
||||
import gr.cite.tools.data.censor.CensorFactory;
|
||||
|
|
|
@ -11,7 +11,7 @@ import eu.eudat.model.persist.EntityDoiPersist;
|
|||
import eu.eudat.model.result.QueryResult;
|
||||
import eu.eudat.query.EntityDoiQuery;
|
||||
import eu.eudat.query.lookup.EntityDoiLookup;
|
||||
import eu.eudat.service.EntityDoiService;
|
||||
import eu.eudat.service.entitydoi.EntityDoiService;
|
||||
import gr.cite.tools.auditing.AuditService;
|
||||
import gr.cite.tools.data.builder.BuilderFactory;
|
||||
import gr.cite.tools.data.censor.CensorFactory;
|
||||
|
|
|
@ -11,7 +11,7 @@ import eu.eudat.models.data.admin.composite.DatasetProfile;
|
|||
import eu.eudat.logic.services.ApiContext;
|
||||
import eu.eudat.logic.utilities.builders.ModelBuilder;
|
||||
import eu.eudat.commons.types.xml.XmlBuilder;
|
||||
import eu.eudat.service.DescriptionTemplateTypeService;
|
||||
import eu.eudat.service.descriptiontemplatetype.DescriptionTemplateTypeService;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ import eu.eudat.models.data.helpers.common.DataTableData;
|
|||
import eu.eudat.models.data.listingmodels.UserInfoListingModel;
|
||||
import eu.eudat.models.data.mail.SimpleMail;
|
||||
import eu.eudat.queryable.QueryableList;
|
||||
import eu.eudat.service.DescriptionTemplateTypeService;
|
||||
import eu.eudat.service.descriptiontemplatetype.DescriptionTemplateTypeService;
|
||||
import eu.eudat.types.MetricNames;
|
||||
import gr.cite.commons.web.authz.service.AuthorizationService;
|
||||
import org.slf4j.Logger;
|
||||
|
|
Loading…
Reference in New Issue