no message

This commit is contained in:
Ioannis Kalyvas 2018-03-21 14:11:02 +02:00
parent 063eca915d
commit f1586bfef1
57 changed files with 465 additions and 160 deletions

View File

@ -2,6 +2,16 @@ package eu.eudat.data.dao.criteria;
import eu.eudat.data.entities.DMP;
import eu.eudat.data.entities.UserInfo;
public class DatasetWizardUserDmpCriteria extends Criteria<DMP> {
private UserInfo userInfo;
public UserInfo getUserInfo() {
return userInfo;
}
public void setUserInfo(UserInfo userInfo) {
this.userInfo = userInfo;
}
}

View File

@ -0,0 +1,11 @@
package eu.eudat.data.query.definition;
import eu.eudat.queryable.QueryableList;
import eu.eudat.queryable.queryableentity.DataEntity;
/**
* Created by ikalyvas on 3/21/2018.
*/
public interface Collector<T extends DataEntity<T, K>, K> {
QueryableList<T> collect();
}

View File

@ -0,0 +1,13 @@
package eu.eudat.data.query.definition;
import eu.eudat.data.dao.criteria.Criteria;
import eu.eudat.queryable.QueryableList;
import eu.eudat.queryable.queryableentity.DataEntity;
/**
* Created by ikalyvas on 3/21/2018.
*/
public interface CriteriaQuery<C extends Criteria<T>, T extends DataEntity<T, K>, K> extends Collector<T, K> {
QueryableList<T> applyCriteria();
}

View File

@ -0,0 +1,31 @@
package eu.eudat.data.query.definition;
import eu.eudat.data.dao.criteria.Criteria;
import eu.eudat.queryable.QueryableList;
import eu.eudat.queryable.queryableentity.DataEntity;
public abstract class Query<C extends Criteria<T>, T extends DataEntity<T, K>, K> implements CriteriaQuery<C, T, K> {
private C criteria;
private QueryableList<T> query;
public QueryableList<T> getQuery() {
return query;
}
public void setQuery(QueryableList<T> query) {
this.query = query;
}
public C getCriteria() {
return criteria;
}
public void setCriteria(C criteria) {
this.criteria = criteria;
}
@Override
public QueryableList<T> collect() {
return this.applyCriteria();
}
}

View File

@ -0,0 +1,12 @@
package eu.eudat.data.query.definition;
import eu.eudat.data.dao.criteria.Criteria;
import eu.eudat.queryable.QueryableList;
import eu.eudat.queryable.queryableentity.DataEntity;
/**
* Created by ikalyvas on 3/21/2018.
*/
public interface TableCriteriaQuery<C extends Criteria<T>, T extends DataEntity<T, K>, K> extends CriteriaQuery<C, T, K> {
QueryableList<T> applyPaging(QueryableList<T> items);
}

View File

@ -1,9 +1,14 @@
package eu.eudat.models.helpers.requests;
package eu.eudat.data.query.definition;
import eu.eudat.models.helpers.common.ColumnOrderings;
import eu.eudat.models.helpers.common.SelectionFields;
public abstract class TableRequest<T> extends RequestItem<T> {
import eu.eudat.data.dao.criteria.Criteria;
import eu.eudat.data.query.definition.helpers.ColumnOrderings;
import eu.eudat.data.query.definition.helpers.SelectionFields;
import eu.eudat.queryable.QueryableList;
import eu.eudat.queryable.queryableentity.DataEntity;
public abstract class TableQuery<C extends Criteria<T>, T extends DataEntity<T, K>, K> extends Query<C, T, K> implements TableCriteriaQuery<C, T, K> {
private ColumnOrderings orderings;
private SelectionFields selection;
private Integer length;
@ -40,4 +45,9 @@ public abstract class TableRequest<T> extends RequestItem<T> {
public void setSelection(SelectionFields selection) {
this.selection = selection;
}
@Override
public QueryableList<T> collect() {
return this.applyPaging(super.collect());
}
}

View File

@ -1,4 +1,4 @@
package eu.eudat.models.helpers.common;
package eu.eudat.data.query.definition.helpers;
import java.util.LinkedList;
import java.util.List;

View File

@ -1,4 +1,4 @@
package eu.eudat.models.helpers.common;
package eu.eudat.data.query.definition.helpers;
public class Ordering {

View File

@ -1,4 +1,4 @@
package eu.eudat.models.helpers.common;
package eu.eudat.data.query.definition.helpers;
public class SelectionFields {

View File

@ -0,0 +1,20 @@
package eu.eudat.data.query.items.item.dataset;
import eu.eudat.data.dao.criteria.DatasetWizardUserDmpCriteria;
import eu.eudat.data.entities.DMP;
import eu.eudat.data.query.definition.Query;
import eu.eudat.queryable.QueryableList;
import java.util.UUID;
public class DatasetWizardAutocompleteRequest extends Query<DatasetWizardUserDmpCriteria, DMP, UUID> {
@Override
public QueryableList<DMP> applyCriteria() {
QueryableList<DMP> query = this.getQuery().where((builder, root) -> builder.or(builder.equal(root.get("creator"), this.getCriteria().getUserInfo()), builder.isMember(this.getCriteria().getUserInfo(), root.get("users"))));
if (this.getCriteria().getLike() != null && !this.getCriteria().getLike().isEmpty()) {
query.where((builder, root) -> builder.like(root.get("label"), "%" + this.getCriteria().getLike() + "%"));
}
return query;
}
}

View File

@ -0,0 +1,18 @@
package eu.eudat.data.query.items.item.datasetprofile;
import eu.eudat.data.dao.criteria.DatasetProfileCriteria;
import eu.eudat.data.entities.DatasetProfile;
import eu.eudat.data.query.definition.Query;
import eu.eudat.queryable.QueryableList;
import java.util.UUID;
public class DatasetProfileAutocompleteRequest extends Query<DatasetProfileCriteria,DatasetProfile,UUID> {
@Override
public QueryableList<DatasetProfile> applyCriteria() {
QueryableList<DatasetProfile> query = this.getQuery();
if (this.getCriteria().getLike() != null && !this.getCriteria().getLike().isEmpty())
query.where((builder, root) -> builder.like(root.get("label"), "%" + this.getCriteria().getLike() + "%"));
return query;
}
}

View File

@ -0,0 +1,15 @@
package eu.eudat.data.query.items.item.datasetprofile;
import eu.eudat.data.dao.criteria.DatasetProfileWizardCriteria;
import eu.eudat.data.entities.DatasetProfile;
import eu.eudat.data.query.definition.Query;
import eu.eudat.queryable.QueryableList;
import java.util.UUID;
public class DatasetProfileWizardAutocompleteRequest extends Query<DatasetProfileWizardCriteria,DatasetProfile,UUID> {
@Override
public QueryableList<DatasetProfile> applyCriteria() {
return null;
}
}

View File

@ -0,0 +1,33 @@
package eu.eudat.data.query.items.item.dmp;
import eu.eudat.data.dao.criteria.DataManagementPlanCriteria;
import eu.eudat.data.entities.DMP;
import eu.eudat.data.query.definition.Query;
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;
public class DataManagementPlanCriteriaRequest extends Query<DataManagementPlanCriteria, DMP, UUID> {
@Override
public QueryableList<DMP> applyCriteria() {
QueryableList<DMP> query = this.getQuery();
if (this.getCriteria().getLike() != null && !this.getCriteria().getLike().isEmpty())
query.where((builder, root) -> builder.like(root.get("label"), "%" + this.getCriteria().getLike() + "%"));
if (this.getCriteria().getPeriodEnd() != null)
query.where((builder, root) -> builder.lessThan(root.get("created"), this.getCriteria().getPeriodEnd()));
if (this.getCriteria().getPeriodStart() != null)
query.where((builder, root) -> builder.greaterThan(root.get("created"), this.getCriteria().getPeriodStart()));
if (this.getCriteria().getProjects() != null && !this.getCriteria().getProjects().isEmpty())
query.where(((builder, root) -> root.get("project").in(this.getCriteria().getProjects())));
if (!this.getCriteria().getAllVersions())
query.initSubQuery(String.class).where((builder, root) -> builder.equal(root.get("version"), query.<String>subQueryMax((builder1, externalRoot, nestedRoot) -> builder1.equal(externalRoot.get("groupId"), nestedRoot.get("groupId")), Arrays.asList(new SelectionField(FieldSelectionType.FIELD, "version")), String.class)));
if (this.getCriteria().getGroupIds() != null && !this.getCriteria().getGroupIds().isEmpty())
query.where((builder, root) -> root.get("groupId").in(this.getCriteria().getGroupIds()));
query.where((builder, root) -> builder.notEqual(root.get("status"), DMP.DMPStatus.DELETED.getValue()));
return query;
}
}

View File

@ -0,0 +1,25 @@
package eu.eudat.data.query.items.item.project;
import eu.eudat.data.dao.criteria.ProjectCriteria;
import eu.eudat.data.entities.Project;
import eu.eudat.data.query.definition.Query;
import eu.eudat.queryable.QueryableList;
import java.util.UUID;
public class ProjectCriteriaRequest extends Query<ProjectCriteria,Project,UUID> {
@Override
public QueryableList<Project> applyCriteria() {
QueryableList<Project> query = this.getQuery();
if (this.getCriteria().getLike() != null && !this.getCriteria().getLike().isEmpty())
query.where((builder, root) -> builder.like(root.get("label"), "%" + this.getCriteria().getLike() + "%"));
if (this.getCriteria().getPeriodEnd() != null)
query.where((builder, root) -> builder.lessThan(root.get("enddate"), this.getCriteria().getPeriodEnd()));
if (this.getCriteria().getPeriodStart() != null)
query.where((builder, root) -> builder.greaterThan(root.get("startdate"), this.getCriteria().getPeriodStart()));
if (this.getCriteria().getReference() != null)
query.where((builder, root) -> builder.equal(root.get("reference"), this.getCriteria().getReference()));
query.where((builder, root) -> builder.notEqual(root.get("status"), Project.Status.DELETED.getValue()));
return query;
}
}

View File

@ -0,0 +1,23 @@
package eu.eudat.data.query.items.item.researcher;
import eu.eudat.data.dao.criteria.ResearcherCriteria;
import eu.eudat.data.entities.Researcher;
import eu.eudat.data.query.definition.Query;
import eu.eudat.queryable.QueryableList;
import java.util.UUID;
/**
* Created by ikalyvas on 3/6/2018.
*/
public class ResearcherCriteriaRequest extends Query<ResearcherCriteria,Researcher,UUID> {
@Override
public QueryableList<Researcher> applyCriteria() {
QueryableList<Researcher> query = this.getQuery();
if (this.getCriteria().getLike() != null)
query.where((builder, root) -> builder.equal(root.get("reference"), this.getCriteria().getLike()));
if (this.getCriteria().getName() != null)
query.where((builder, root) -> builder.equal(root.get("label"), this.getCriteria().getName()));
return query;
}
}

View File

@ -0,0 +1,23 @@
package eu.eudat.data.query.items.item.userinfo;
import eu.eudat.data.dao.criteria.UserInfoCriteria;
import eu.eudat.data.entities.UserInfo;
import eu.eudat.data.query.definition.Query;
import eu.eudat.queryable.QueryableList;
import java.util.UUID;
public class UserInfoRequestItem extends Query<UserInfoCriteria, UserInfo, UUID> {
@Override
public QueryableList<UserInfo> applyCriteria() {
QueryableList<UserInfo> users = this.getQuery();
if (this.getCriteria().getAppRoles() != null && !this.getCriteria().getAppRoles().isEmpty())
users.where((builder, root) -> root.join("userRoles").get("role").in(this.getCriteria().getAppRoles()));
if (this.getCriteria().getLike() != null)
users.where((builder, root) -> builder.or(builder.like(root.get("name"), "%" + this.getCriteria().getLike() + "%"), builder.like(root.get("email"), "%" + this.getCriteria().getLike() + "%")));
if (this.getCriteria().getEmail() != null)
users.where((builder, root) -> builder.equal(root.get("email"), this.getCriteria().getEmail()));
return users;
}
}

View File

@ -0,0 +1,36 @@
package eu.eudat.data.query.items.table.dataset;
import eu.eudat.data.dao.criteria.DatasetCriteria;
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;
public class DatasetTableRequest extends TableQuery<DatasetCriteria, eu.eudat.data.entities.Dataset,UUID> {
@Override
public QueryableList<Dataset> applyCriteria() {
QueryableList<Dataset> query = this.getQuery();
if (this.getCriteria().getLike() != null && !this.getCriteria().getLike().isEmpty())
query.where((builder, root) -> builder.like(root.get("label"), "%" + this.getCriteria().getLike() + "%"));
if (this.getCriteria().getStatus() != null)
query.where((builder, root) -> builder.equal(root.get("status"), this.getCriteria().getStatus()));
if (this.getCriteria().getPeriodEnd() != null)
query.where((builder, root) -> builder.lessThan(root.get("created"), this.getCriteria().getPeriodEnd()));
if (this.getCriteria().getPeriodStart() != null)
query.where((builder, root) -> builder.greaterThan(root.get("created"), this.getCriteria().getPeriodStart()));
if (!this.getCriteria().getAllVersions())
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().getDmpIds() != null && !this.getCriteria().getDmpIds().isEmpty())
query.where((builder, root) -> root.get("dmp").get("id").in(this.getCriteria().getDmpIds()));
return query;
}
@Override
public QueryableList<Dataset> applyPaging(QueryableList<Dataset> items) {
return null;
}
}

View File

@ -0,0 +1,23 @@
package eu.eudat.data.query.items.table.datasetprofile;
import eu.eudat.data.dao.criteria.DatasetProfileCriteria;
import eu.eudat.data.entities.DatasetProfile;
import eu.eudat.data.query.definition.TableQuery;
import eu.eudat.queryable.QueryableList;
import java.util.UUID;
public class DatasetProfileTableRequestItem extends TableQuery<DatasetProfileCriteria, DatasetProfile, UUID> {
@Override
public QueryableList<DatasetProfile> applyCriteria() {
QueryableList<DatasetProfile> query = this.getQuery();
if (this.getCriteria().getLike() != null && !this.getCriteria().getLike().isEmpty())
query.where((builder, root) -> builder.like(root.get("label"), "%" + this.getCriteria().getLike() + "%"));
return query;
}
@Override
public QueryableList<DatasetProfile> applyPaging(QueryableList<DatasetProfile> items) {
return null;
}
}

View File

@ -0,0 +1,38 @@
package eu.eudat.data.query.items.table.dmp;
import eu.eudat.data.dao.criteria.DataManagementPlanCriteria;
import eu.eudat.data.entities.DMP;
import eu.eudat.data.query.definition.Query;
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;
public class DataManagementPlanTableRequest extends TableQuery<DataManagementPlanCriteria,DMP,UUID> {
@Override
public QueryableList<DMP> applyCriteria() {
return null;
}
@Override
public QueryableList<DMP> applyPaging(QueryableList<DMP> items) {
QueryableList<DMP> query = this.getQuery();
if (this.getCriteria().getLike() != null && !this.getCriteria().getLike().isEmpty())
query.where((builder, root) -> builder.like(root.get("label"), "%" + this.getCriteria().getLike() + "%"));
if (this.getCriteria().getPeriodEnd() != null)
query.where((builder, root) -> builder.lessThan(root.get("created"), this.getCriteria().getPeriodEnd()));
if (this.getCriteria().getPeriodStart() != null)
query.where((builder, root) -> builder.greaterThan(root.get("created"), this.getCriteria().getPeriodStart()));
if (this.getCriteria().getProjects() != null && !this.getCriteria().getProjects().isEmpty())
query.where(((builder, root) -> root.get("project").in(this.getCriteria().getProjects())));
if (!this.getCriteria().getAllVersions())
query.initSubQuery(String.class).where((builder, root) -> builder.equal(root.get("version"), query.<String>subQueryMax((builder1, externalRoot, nestedRoot) -> builder1.equal(externalRoot.get("groupId"), nestedRoot.get("groupId")), Arrays.asList(new SelectionField(FieldSelectionType.FIELD, "version")), String.class)));
if (this.getCriteria().getGroupIds() != null && !this.getCriteria().getGroupIds().isEmpty())
query.where((builder, root) -> root.get("groupId").in(this.getCriteria().getGroupIds()));
query.where((builder, root) -> builder.notEqual(root.get("status"), DMP.DMPStatus.DELETED.getValue()));
return query;
}
}

View File

@ -0,0 +1,24 @@
package eu.eudat.data.query.items.table.externaldataset;
import eu.eudat.data.dao.criteria.ExternalDatasetCriteria;
import eu.eudat.data.entities.ExternalDataset;
import eu.eudat.data.query.definition.Query;
import eu.eudat.data.query.definition.TableQuery;
import eu.eudat.queryable.QueryableList;
import java.util.UUID;
public class ExternalDatasetTableRequest extends TableQuery<ExternalDatasetCriteria,ExternalDataset,UUID> {
@Override
public QueryableList<ExternalDataset> applyCriteria() {
QueryableList<ExternalDataset> query = this.getQuery();
if (this.getCriteria().getLike() != null && !this.getCriteria().getLike().isEmpty())
query.where((builder, root) -> builder.like(root.get("label"), "%" + this.getCriteria().getLike() + "%"));
return query;
}
@Override
public QueryableList<ExternalDataset> applyPaging(QueryableList<ExternalDataset> items) {
return null;
}
}

View File

@ -0,0 +1,31 @@
package eu.eudat.data.query.items.table.project;
import eu.eudat.data.dao.criteria.ProjectCriteria;
import eu.eudat.data.entities.Project;
import eu.eudat.data.query.definition.Query;
import eu.eudat.data.query.definition.TableQuery;
import eu.eudat.queryable.QueryableList;
import java.util.UUID;
public class ProjectTableRequest extends TableQuery<ProjectCriteria,Project,UUID> {
@Override
public QueryableList<Project> applyCriteria() {
QueryableList<Project> query = this.getQuery();
if (this.getCriteria().getLike() != null && !this.getCriteria().getLike().isEmpty())
query.where((builder, root) -> builder.like(root.get("label"), "%" + this.getCriteria().getLike() + "%"));
if (this.getCriteria().getPeriodEnd() != null)
query.where((builder, root) -> builder.lessThan(root.get("enddate"), this.getCriteria().getPeriodEnd()));
if (this.getCriteria().getPeriodStart() != null)
query.where((builder, root) -> builder.greaterThan(root.get("startdate"), this.getCriteria().getPeriodStart()));
if (this.getCriteria().getReference() != null)
query.where((builder, root) -> builder.equal(root.get("reference"), this.getCriteria().getReference()));
query.where((builder, root) -> builder.notEqual(root.get("status"), Project.Status.DELETED.getValue()));
return query;
}
@Override
public QueryableList<Project> applyPaging(QueryableList<Project> items) {
return null;
}
}

View File

@ -0,0 +1,29 @@
package eu.eudat.data.query.items.table.userinfo;
import eu.eudat.data.dao.criteria.UserInfoCriteria;
import eu.eudat.data.entities.UserInfo;
import eu.eudat.data.query.definition.TableQuery;
import eu.eudat.queryable.QueryableList;
import java.util.UUID;
public class UserInfoTableRequestItem extends TableQuery<UserInfoCriteria, UserInfo, UUID> {
@Override
public QueryableList<UserInfo> applyCriteria() {
QueryableList<UserInfo> users = this.getQuery();
if (this.getCriteria().getAppRoles() != null && !this.getCriteria().getAppRoles().isEmpty())
users.where((builder, root) -> root.join("userRoles").get("role").in(this.getCriteria().getAppRoles()));
if (this.getCriteria().getLike() != null)
users.where((builder, root) -> builder.or(builder.like(root.get("name"), "%" + this.getCriteria().getLike() + "%"), builder.like(root.get("email"), "%" + this.getCriteria().getLike() + "%")));
if (this.getCriteria().getEmail() != null)
users.where((builder, root) -> builder.equal(root.get("email"), this.getCriteria().getEmail()));
return users;
}
@Override
public QueryableList<UserInfo> applyPaging(QueryableList<UserInfo> items) {
return null;
}
}

View File

@ -5,8 +5,8 @@ import eu.eudat.data.entities.DMP;
import eu.eudat.exceptions.datamanagementplan.DMPWithDatasetsException;
import eu.eudat.managers.DataManagementPlanManager;
import eu.eudat.models.dmp.DataManagementPlan;
import eu.eudat.models.dmp.DataManagementPlanCriteriaRequest;
import eu.eudat.models.dmp.DataManagementPlanTableRequest;
import eu.eudat.data.query.items.item.dmp.DataManagementPlanCriteriaRequest;
import eu.eudat.data.query.items.table.dmp.DataManagementPlanTableRequest;
import eu.eudat.models.helpers.common.DataTableData;
import eu.eudat.models.helpers.responses.ResponseItem;
import eu.eudat.models.listingmodels.DataManagementPlanListingModel;

View File

@ -2,9 +2,9 @@ package eu.eudat.controllers;
import eu.eudat.managers.DatasetProfileManager;
import eu.eudat.models.datasetprofile.DatasetProfileAutocompleteItem;
import eu.eudat.models.datasetprofile.DatasetProfileAutocompleteRequest;
import eu.eudat.data.query.items.item.datasetprofile.DatasetProfileAutocompleteRequest;
import eu.eudat.models.datasetprofile.DatasetProfileListingModel;
import eu.eudat.models.datasetprofile.DatasetProfileTableRequestItem;
import eu.eudat.data.query.items.table.datasetprofile.DatasetProfileTableRequestItem;
import eu.eudat.models.helpers.common.DataTableData;
import eu.eudat.models.helpers.responses.ResponseItem;
import eu.eudat.services.ApiContext;

View File

@ -5,8 +5,8 @@ import eu.eudat.data.entities.Dataset;
import eu.eudat.managers.DatasetManager;
import eu.eudat.managers.DatasetWizardManager;
import eu.eudat.models.datasetwizard.DataManagentPlanListingModel;
import eu.eudat.models.datasetwizard.DatasetProfileWizardAutocompleteRequest;
import eu.eudat.models.datasetwizard.DatasetWizardAutocompleteRequest;
import eu.eudat.data.query.items.item.datasetprofile.DatasetProfileWizardAutocompleteRequest;
import eu.eudat.data.query.items.item.dataset.DatasetWizardAutocompleteRequest;
import eu.eudat.models.datasetwizard.DatasetWizardModel;
import eu.eudat.models.dmp.AssociatedProfile;
import eu.eudat.models.helpers.responses.ResponseItem;

View File

@ -2,7 +2,7 @@ package eu.eudat.controllers;
import eu.eudat.data.entities.Dataset;
import eu.eudat.managers.DatasetManager;
import eu.eudat.models.dataset.DatasetTableRequest;
import eu.eudat.data.query.items.table.dataset.DatasetTableRequest;
import eu.eudat.models.helpers.common.DataTableData;
import eu.eudat.models.helpers.responses.ResponseItem;
import eu.eudat.models.listingmodels.DatasetListingModel;

View File

@ -2,7 +2,7 @@ package eu.eudat.controllers;
import eu.eudat.managers.ExternalDatasetManager;
import eu.eudat.models.externaldataset.ExternalDatasetListingModel;
import eu.eudat.models.externaldataset.ExternalDatasetTableRequest;
import eu.eudat.data.query.items.table.externaldataset.ExternalDatasetTableRequest;
import eu.eudat.models.helpers.common.DataTableData;
import eu.eudat.models.helpers.responses.ResponseItem;
import eu.eudat.models.security.Principal;

View File

@ -5,9 +5,9 @@ import eu.eudat.managers.ProjectManager;
import eu.eudat.models.external.ProjectsExternalSourcesModel;
import eu.eudat.models.helpers.common.DataTableData;
import eu.eudat.models.helpers.responses.ResponseItem;
import eu.eudat.models.project.ProjectCriteriaRequest;
import eu.eudat.data.query.items.item.project.ProjectCriteriaRequest;
import eu.eudat.models.project.ProjectListingModel;
import eu.eudat.models.project.ProjectTableRequest;
import eu.eudat.data.query.items.table.project.ProjectTableRequest;
import eu.eudat.models.security.Principal;
import eu.eudat.proxy.config.exceptions.HugeResultSet;
import eu.eudat.proxy.config.exceptions.NoURLFound;

View File

@ -5,7 +5,7 @@ import eu.eudat.managers.ResearcherManager;
import eu.eudat.models.dmp.Researcher;
import eu.eudat.models.external.ResearchersExternalSourcesModel;
import eu.eudat.models.helpers.responses.ResponseItem;
import eu.eudat.models.researcher.ResearcherCriteriaRequest;
import eu.eudat.data.query.items.item.researcher.ResearcherCriteriaRequest;
import eu.eudat.models.security.Principal;
import eu.eudat.proxy.config.exceptions.HugeResultSet;
import eu.eudat.proxy.config.exceptions.NoURLFound;

View File

@ -6,7 +6,7 @@ import eu.eudat.models.helpers.responses.ResponseItem;
import eu.eudat.models.invitation.Invitation;
import eu.eudat.models.security.Principal;
import eu.eudat.models.userinfo.UserInfoInvitationModel;
import eu.eudat.models.userinfo.UserInfoRequestItem;
import eu.eudat.data.query.items.item.userinfo.UserInfoRequestItem;
import eu.eudat.services.ApiContext;
import eu.eudat.types.ApiMessageCode;
import org.springframework.beans.factory.annotation.Autowired;

View File

@ -4,7 +4,7 @@ import eu.eudat.managers.UserManager;
import eu.eudat.models.helpers.common.DataTableData;
import eu.eudat.models.helpers.responses.ResponseItem;
import eu.eudat.models.security.Principal;
import eu.eudat.models.userinfo.UserInfoTableRequestItem;
import eu.eudat.data.query.items.table.userinfo.UserInfoTableRequestItem;
import eu.eudat.models.userinfo.UserListingModel;
import eu.eudat.security.claims.ClaimedAuthorities;
import eu.eudat.services.ApiContext;

View File

@ -10,9 +10,9 @@ import eu.eudat.data.dao.criteria.OrganisationCriteria;
import eu.eudat.data.dao.criteria.ProjectCriteria;
import eu.eudat.data.dao.criteria.ResearcherCriteria;
import eu.eudat.models.dmp.DataManagementPlan;
import eu.eudat.models.dmp.DataManagementPlanCriteriaRequest;
import eu.eudat.data.query.items.item.dmp.DataManagementPlanCriteriaRequest;
import eu.eudat.models.dmp.DataManagementPlanNewVersionModel;
import eu.eudat.models.dmp.DataManagementPlanTableRequest;
import eu.eudat.data.query.items.table.dmp.DataManagementPlanTableRequest;
import eu.eudat.models.helpers.common.DataTableData;
import eu.eudat.models.listingmodels.DataManagementPlanListingModel;
import eu.eudat.models.listingmodels.DatasetListingModel;

View File

@ -11,7 +11,7 @@ import eu.eudat.data.dao.criteria.DataRepositoryCriteria;
import eu.eudat.data.dao.criteria.ExternalDatasetCriteria;
import eu.eudat.data.dao.criteria.RegistryCriteria;
import eu.eudat.data.dao.criteria.ServiceCriteria;
import eu.eudat.models.dataset.DatasetTableRequest;
import eu.eudat.data.query.items.table.dataset.DatasetTableRequest;
import eu.eudat.models.datasetwizard.DatasetWizardModel;
import eu.eudat.models.helpers.common.DataTableData;
import eu.eudat.models.listingmodels.DatasetListingModel;

View File

@ -5,9 +5,9 @@ import eu.eudat.data.dao.entities.DatasetProfileDao;
import eu.eudat.data.entities.DatasetProfile;
import eu.eudat.models.entities.xmlmodels.datasetprofiledefinition.Field;
import eu.eudat.models.datasetprofile.DatasetProfileAutocompleteItem;
import eu.eudat.models.datasetprofile.DatasetProfileAutocompleteRequest;
import eu.eudat.data.query.items.item.datasetprofile.DatasetProfileAutocompleteRequest;
import eu.eudat.models.datasetprofile.DatasetProfileListingModel;
import eu.eudat.models.datasetprofile.DatasetProfileTableRequestItem;
import eu.eudat.data.query.items.table.datasetprofile.DatasetProfileTableRequestItem;
import eu.eudat.models.helpers.common.DataTableData;
import eu.eudat.queryable.QueryableList;
import eu.eudat.services.ApiContext;

View File

@ -5,8 +5,8 @@ import eu.eudat.data.dao.entities.DMPDao;
import eu.eudat.data.entities.DMP;
import eu.eudat.data.entities.UserInfo;
import eu.eudat.models.datasetwizard.DataManagentPlanListingModel;
import eu.eudat.models.datasetwizard.DatasetProfileWizardAutocompleteRequest;
import eu.eudat.models.datasetwizard.DatasetWizardAutocompleteRequest;
import eu.eudat.data.query.items.item.datasetprofile.DatasetProfileWizardAutocompleteRequest;
import eu.eudat.data.query.items.item.dataset.DatasetWizardAutocompleteRequest;
import eu.eudat.models.dmp.AssociatedProfile;
import eu.eudat.models.dmp.DataManagementPlan;
import eu.eudat.models.security.Principal;

View File

@ -6,7 +6,7 @@ import eu.eudat.data.dao.entities.ExternalDatasetDao;
import eu.eudat.data.entities.ExternalDataset;
import eu.eudat.data.dao.criteria.ExternalDatasetCriteria;
import eu.eudat.models.externaldataset.ExternalDatasetListingModel;
import eu.eudat.models.externaldataset.ExternalDatasetTableRequest;
import eu.eudat.data.query.items.table.externaldataset.ExternalDatasetTableRequest;
import eu.eudat.models.helpers.common.DataTableData;
import eu.eudat.proxy.config.exceptions.HugeResultSet;
import eu.eudat.proxy.config.exceptions.NoURLFound;

View File

@ -6,7 +6,7 @@ import eu.eudat.exceptions.security.UnauthorisedException;
import eu.eudat.models.invitation.Invitation;
import eu.eudat.models.security.Principal;
import eu.eudat.models.userinfo.UserInfoInvitationModel;
import eu.eudat.models.userinfo.UserInfoRequestItem;
import eu.eudat.data.query.items.item.userinfo.UserInfoRequestItem;
import eu.eudat.queryable.QueryableList;
import eu.eudat.services.ApiContext;

View File

@ -1,8 +1,8 @@
package eu.eudat.managers;
import eu.eudat.models.helpers.common.ColumnOrderings;
import eu.eudat.models.helpers.common.Ordering;
import eu.eudat.models.helpers.requests.TableRequest;
import eu.eudat.data.query.definition.TableQuery;
import eu.eudat.data.query.definition.helpers.ColumnOrderings;
import eu.eudat.data.query.definition.helpers.Ordering;
import eu.eudat.queryable.QueryableList;
import eu.eudat.queryable.queryableentity.DataEntity;
@ -11,7 +11,7 @@ import java.util.Collection;
public class PaginationManager {
public static <T extends DataEntity> QueryableList<T> applyPaging(QueryableList<T> items, TableRequest tableRequest) throws Exception {
public static <T extends DataEntity> QueryableList<T> applyPaging(QueryableList<T> items, TableQuery tableRequest) throws Exception {
if (tableRequest.getOrderings() != null) applyOrder(items, tableRequest);
if (tableRequest.getLength() != null) items.take(tableRequest.getLength());
if (tableRequest.getOffset() != null) items.skip(tableRequest.getOffset());
@ -20,7 +20,7 @@ public class PaginationManager {
return items;
}
public static <T extends DataEntity> void applyOrder(QueryableList<T> items, TableRequest tableRequest) throws Exception {
public static <T extends DataEntity> void applyOrder(QueryableList<T> items, TableQuery tableRequest) throws Exception {
ColumnOrderings columnOrderings = tableRequest.getOrderings();
for (Ordering ordering : columnOrderings.getFieldOrderings()) {
if (ordering.getOrderByType() == Ordering.OrderByType.ASC)

View File

@ -14,9 +14,9 @@ import eu.eudat.models.external.ProjectsExternalSourcesModel;
import eu.eudat.models.files.ContentFile;
import eu.eudat.models.helpers.common.DataTableData;
import eu.eudat.models.project.Project;
import eu.eudat.models.project.ProjectCriteriaRequest;
import eu.eudat.data.query.items.item.project.ProjectCriteriaRequest;
import eu.eudat.models.project.ProjectListingModel;
import eu.eudat.models.project.ProjectTableRequest;
import eu.eudat.data.query.items.table.project.ProjectTableRequest;
import eu.eudat.models.security.Principal;
import eu.eudat.proxy.config.exceptions.HugeResultSet;
import eu.eudat.proxy.config.exceptions.NoURLFound;

View File

@ -4,7 +4,7 @@ import eu.eudat.builders.model.models.ResearcherBuilder;
import eu.eudat.data.entities.Researcher;
import eu.eudat.models.external.ExternalSourcesItemModel;
import eu.eudat.models.external.ResearchersExternalSourcesModel;
import eu.eudat.models.researcher.ResearcherCriteriaRequest;
import eu.eudat.data.query.items.item.researcher.ResearcherCriteriaRequest;
import eu.eudat.proxy.config.exceptions.HugeResultSet;
import eu.eudat.proxy.config.exceptions.NoURLFound;
import eu.eudat.proxy.fetching.RemoteFetcher;

View File

@ -7,7 +7,7 @@ import eu.eudat.exceptions.security.UnauthorisedException;
import eu.eudat.models.helpers.common.DataTableData;
import eu.eudat.models.login.Credentials;
import eu.eudat.models.security.Principal;
import eu.eudat.models.userinfo.UserInfoTableRequestItem;
import eu.eudat.data.query.items.table.userinfo.UserInfoTableRequestItem;
import eu.eudat.models.userinfo.UserListingModel;
import eu.eudat.queryable.QueryableList;
import eu.eudat.services.ApiContext;

View File

@ -1,8 +0,0 @@
package eu.eudat.models.dataset;
import eu.eudat.data.dao.criteria.DatasetCriteria;
import eu.eudat.models.helpers.requests.TableRequest;
public class DatasetTableRequest extends TableRequest<DatasetCriteria> {
}

View File

@ -1,8 +0,0 @@
package eu.eudat.models.datasetprofile;
import eu.eudat.data.dao.criteria.DatasetProfileCriteria;
import eu.eudat.models.helpers.requests.RequestItem;
public class DatasetProfileAutocompleteRequest extends RequestItem<DatasetProfileCriteria> {
}

View File

@ -1,8 +0,0 @@
package eu.eudat.models.datasetprofile;
import eu.eudat.data.dao.criteria.DatasetProfileCriteria;
import eu.eudat.models.helpers.requests.TableRequest;
public class DatasetProfileTableRequestItem extends TableRequest<DatasetProfileCriteria> {
}

View File

@ -1,8 +0,0 @@
package eu.eudat.models.datasetwizard;
import eu.eudat.data.dao.criteria.DatasetProfileWizardCriteria;
import eu.eudat.models.helpers.requests.RequestItem;
public class DatasetProfileWizardAutocompleteRequest extends RequestItem<DatasetProfileWizardCriteria> {
}

View File

@ -1,8 +0,0 @@
package eu.eudat.models.datasetwizard;
import eu.eudat.data.dao.criteria.DatasetWizardUserDmpCriteria;
import eu.eudat.models.helpers.requests.RequestItem;
public class DatasetWizardAutocompleteRequest extends RequestItem<DatasetWizardUserDmpCriteria> {
}

View File

@ -1,8 +0,0 @@
package eu.eudat.models.dmp;
import eu.eudat.data.dao.criteria.DataManagementPlanCriteria;
import eu.eudat.models.helpers.requests.RequestItem;
public class DataManagementPlanCriteriaRequest extends RequestItem<DataManagementPlanCriteria> {
}

View File

@ -1,8 +0,0 @@
package eu.eudat.models.dmp;
import eu.eudat.data.dao.criteria.DataManagementPlanCriteria;
import eu.eudat.models.helpers.requests.TableRequest;
public class DataManagementPlanTableRequest extends TableRequest<DataManagementPlanCriteria> {
}

View File

@ -1,8 +0,0 @@
package eu.eudat.models.externaldataset;
import eu.eudat.data.dao.criteria.ExternalDatasetCriteria;
import eu.eudat.models.helpers.requests.TableRequest;
public class ExternalDatasetTableRequest extends TableRequest<ExternalDatasetCriteria> {
}

View File

@ -1,14 +0,0 @@
package eu.eudat.models.helpers.requests;
public abstract class RequestItem<T> {
private T criteria;
public T getCriteria() {
return criteria;
}
public void setCriteria(T criteria) {
this.criteria = criteria;
}
}

View File

@ -1,8 +0,0 @@
package eu.eudat.models.project;
import eu.eudat.data.dao.criteria.ProjectCriteria;
import eu.eudat.models.helpers.requests.RequestItem;
public class ProjectCriteriaRequest extends RequestItem<ProjectCriteria> {
}

View File

@ -1,7 +0,0 @@
package eu.eudat.models.project;
import eu.eudat.data.dao.criteria.ProjectCriteria;
import eu.eudat.models.helpers.requests.TableRequest;
public class ProjectTableRequest extends TableRequest<ProjectCriteria> {
}

View File

@ -1,10 +0,0 @@
package eu.eudat.models.researcher;
import eu.eudat.data.dao.criteria.ResearcherCriteria;
import eu.eudat.models.helpers.requests.RequestItem;
/**
* Created by ikalyvas on 3/6/2018.
*/
public class ResearcherCriteriaRequest extends RequestItem<ResearcherCriteria> {
}

View File

@ -1,8 +0,0 @@
package eu.eudat.models.userinfo;
import eu.eudat.data.dao.criteria.UserInfoCriteria;
import eu.eudat.models.helpers.requests.RequestItem;
public class UserInfoRequestItem extends RequestItem<UserInfoCriteria> {
}

View File

@ -1,9 +0,0 @@
package eu.eudat.models.userinfo;
import eu.eudat.data.dao.criteria.UserInfoCriteria;
import eu.eudat.models.helpers.requests.TableRequest;
public class UserInfoTableRequestItem extends TableRequest<UserInfoCriteria> {
}

View File

@ -1,6 +1,6 @@
package eu.eudat.validators;
import eu.eudat.models.dmp.DataManagementPlanTableRequest;
import eu.eudat.data.query.items.table.dmp.DataManagementPlanTableRequest;
import org.springframework.stereotype.Component;
import org.springframework.validation.Errors;
import org.springframework.validation.Validator;

View File

@ -1,6 +1,6 @@
package eu.eudat.validators;
import eu.eudat.models.project.ProjectTableRequest;
import eu.eudat.data.query.items.table.project.ProjectTableRequest;
import org.springframework.stereotype.Component;
import org.springframework.validation.Errors;
import org.springframework.validation.Validator;