Merge branch 'Development' of code-repo.d4science.org:MaDgiK-CITE/argos into Development
This commit is contained in:
commit
9f1c0352ea
|
@ -25,5 +25,10 @@
|
|||
<artifactId>elastic</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.swagger</groupId>
|
||||
<artifactId>swagger-annotations</artifactId>
|
||||
<version>1.5.20</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -1,9 +1,9 @@
|
|||
package eu.eudat.data.dao.criteria;
|
||||
|
||||
|
||||
import eu.eudat.queryable.queryableentity.DataEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
public abstract class Criteria<T> {
|
||||
@ApiModelProperty(value = "like", name = "like", dataType = "String", allowEmptyValue = true, example = "\"\"")
|
||||
private String like;
|
||||
|
||||
public String getLike() {
|
||||
|
|
|
@ -3,12 +3,14 @@ package eu.eudat.data.query.definition;
|
|||
import eu.eudat.data.dao.criteria.Criteria;
|
||||
import eu.eudat.queryable.QueryableList;
|
||||
import eu.eudat.queryable.queryableentity.DataEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public abstract class Query<C extends Criteria<T>, T extends DataEntity> implements CriteriaQuery<C, T> {
|
||||
private static final Logger logger = LoggerFactory.getLogger(Query.class);
|
||||
private C criteria;
|
||||
@ApiModelProperty(value = "query", name = "query", dataType = "String", hidden = true)
|
||||
private QueryableList<T> query;
|
||||
|
||||
public static class QueryBuilder<C extends Criteria<T>, T extends DataEntity, Q extends Query<C, T>> {
|
||||
|
|
|
@ -6,12 +6,16 @@ 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;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
|
||||
public abstract class TableQuery<C extends Criteria<T>, T extends DataEntity<T, K>, K> extends Query<C, T> implements TableCriteriaQuery<C, T> {
|
||||
private ColumnOrderings orderings;
|
||||
@ApiModelProperty(hidden = true)
|
||||
private SelectionFields selection;
|
||||
@ApiModelProperty(value = "length", name = "length", dataType = "Integer", example = "2")
|
||||
private Integer length;
|
||||
@ApiModelProperty(value = "offset", name = "offset", dataType = "Integer", example = "0")
|
||||
private Integer offset;
|
||||
|
||||
public Integer getLength() {
|
||||
|
|
|
@ -1,11 +1,14 @@
|
|||
package eu.eudat.data.query.definition.helpers;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class ColumnOrderings {
|
||||
|
||||
@ApiModelProperty(value = "fields", name = "fields", dataType = "List<String>", example = "[]")
|
||||
private List<String> fields;
|
||||
|
||||
public List<String> getFields() {
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
package eu.eudat.data.query.definition.helpers;
|
||||
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
public class SelectionFields {
|
||||
|
||||
@ApiModelProperty(value = "fields", name = "fields", dataType = "String[]", example = "[]")
|
||||
private String[] fields;
|
||||
|
||||
public String[] getFields() {
|
||||
|
|
|
@ -3,6 +3,7 @@ package eu.eudat.publicapi.criteria.dataset;
|
|||
import eu.eudat.data.dao.criteria.Criteria;
|
||||
import eu.eudat.data.entities.Dataset;
|
||||
import eu.eudat.elastic.entities.Tag;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
@ -10,15 +11,25 @@ import java.util.UUID;
|
|||
|
||||
|
||||
public class DatasetPublicCriteria extends Criteria<Dataset> {
|
||||
@ApiModelProperty(value = "periodStart", name = "periodStart", dataType = "Date", example = "2022-01-01T13:19:42.210Z")
|
||||
private Date periodStart;
|
||||
@ApiModelProperty(value = "periodEnd", name = "periodEnd", dataType = "Date", example = "2022-12-31T13:19:42.210Z")
|
||||
private Date periodEnd;
|
||||
@ApiModelProperty(value = "grants", name = "grants", dataType = "List<UUID>", example = "[]")
|
||||
private List<UUID> grants;
|
||||
@ApiModelProperty(value = "collaborators", name = "collaborators", dataType = "List<UUID>", example = "[]")
|
||||
private List<UUID> collaborators;
|
||||
@ApiModelProperty(value = "datasetTemplates", name = "datasetTemplates", dataType = "List<UUID>", example = "[]")
|
||||
private List<UUID> datasetTemplates;
|
||||
@ApiModelProperty(value = "dmpOrganisations", name = "dmpOrganisations", dataType = "List<String>", example = "[]")
|
||||
private List<String> dmpOrganisations;
|
||||
@ApiModelProperty(value = "tags", name = "tags", dataType = "List<Tag>", example = "[]")
|
||||
private List<Tag> tags;
|
||||
@ApiModelProperty(value = "dmpIds", name = "dmpIds", dataType = "List<UUID>", example = "[]")
|
||||
private List<UUID> dmpIds;
|
||||
@ApiModelProperty(value = "groupIds", name = "groupIds", dataType = "List<UUID>", example = "[]")
|
||||
private List<UUID> groupIds;
|
||||
@ApiModelProperty(value = "allVersions", name = "allVersions", dataType = "Boolean", example = "false")
|
||||
private boolean allVersions;
|
||||
|
||||
public Date getPeriodStart() {
|
||||
|
|
|
@ -2,20 +2,30 @@ package eu.eudat.publicapi.criteria.dmp;
|
|||
|
||||
import eu.eudat.data.dao.criteria.Criteria;
|
||||
import eu.eudat.data.entities.DMP;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
public class DataManagementPlanPublicCriteria extends Criteria<DMP> {
|
||||
@ApiModelProperty(value = "periodStart", name = "periodStart", dataType = "Date", example = "2022-01-01T13:19:42.210Z")
|
||||
private Date periodStart;
|
||||
@ApiModelProperty(value = "periodEnd", name = "periodEnd", dataType = "Date", example = "2022-12-31T13:19:42.210Z")
|
||||
private Date periodEnd;
|
||||
@ApiModelProperty(value = "grants", name = "grants", dataType = "List<UUID>", example = "[]")
|
||||
private List<UUID> grants;
|
||||
@ApiModelProperty(value = "funders", name = "funders", dataType = "List<UUID>", example = "[]")
|
||||
private List<UUID> funders;
|
||||
@ApiModelProperty(value = "datasetTemplates", name = "datasetTemplates", dataType = "List<UUID>", example = "[]")
|
||||
private List<UUID> datasetTemplates;
|
||||
@ApiModelProperty(value = "dmpOrganisations", name = "dmpOrganisations", dataType = "List<String>", example = "[]")
|
||||
private List<String> dmpOrganisations;
|
||||
@ApiModelProperty(value = "collaborators", name = "collaborators", dataType = "List<UUID>", example = "[]")
|
||||
private List<UUID> collaborators;
|
||||
@ApiModelProperty(value = "allVersions", name = "allVersions", dataType = "Boolean", example = "false")
|
||||
private boolean allVersions;
|
||||
@ApiModelProperty(value = "groupIds", name = "groupIds", dataType = "List<UUID>", example = "[]")
|
||||
private List<UUID> groupIds;
|
||||
|
||||
public Date getPeriodStart() {
|
||||
|
|
|
@ -227,7 +227,7 @@ export class DraftsComponent extends BaseComponent implements OnInit {
|
|||
|
||||
isUserOwner(activity: DatasetListingModel): boolean {
|
||||
const principal: Principal = this.authentication.current();
|
||||
if (principal) return principal.id === activity.users.find(x => x.role === Role.Owner).id;
|
||||
if (principal) return !!activity.users.find(x => (x.role === Role.Owner) && (principal.id === x.id));
|
||||
}
|
||||
|
||||
onCallbackSuccess(id?: String): void {
|
||||
|
|
|
@ -186,7 +186,7 @@ export class RecentEditedActivityComponent extends BaseComponent implements OnIn
|
|||
|
||||
isUserOwner(activity: DmpListingModel): boolean {
|
||||
const principal: Principal = this.authentication.current();
|
||||
if (principal) return principal.id === activity.users.find(x => x.role === Role.Owner).id;
|
||||
if (principal) return !!activity.users.find(x => (x.role === Role.Owner) && (principal.id === x.id));
|
||||
}
|
||||
|
||||
editClicked(dmp: DmpListingModel) {
|
||||
|
|
|
@ -163,7 +163,7 @@ export class RecentEditedDatasetActivityComponent extends BaseComponent implemen
|
|||
|
||||
isUserOwner(activity: DatasetListingModel): boolean {
|
||||
const principal: Principal = this.authentication.current();
|
||||
if (principal) return principal.id === activity.users.find(x => x.role === Role.Owner).id;
|
||||
if (principal) return !!activity.users.find(x => (x.role === Role.Owner) && (principal.id === x.id));
|
||||
}
|
||||
|
||||
goToOverview(id: string): string[] {
|
||||
|
|
|
@ -165,7 +165,7 @@ export class RecentEditedDmpActivityComponent extends BaseComponent implements O
|
|||
|
||||
isUserOwner(activity: DmpListingModel): boolean {
|
||||
const principal: Principal = this.authentication.current();
|
||||
if (principal) return principal.id === activity.users.find(x => x.role === Role.Owner).id;
|
||||
if (principal) return !!activity.users.find(x => (x.role === Role.Owner) && (principal.id === x.id));
|
||||
}
|
||||
|
||||
editClicked(dmp: DmpListingModel) {
|
||||
|
|
|
@ -74,7 +74,7 @@ export class DatasetListingItemComponent extends BaseComponent implements OnInit
|
|||
setIsUserOwner() {
|
||||
if (this.dataset) {
|
||||
const principal: Principal = this.authentication.current();
|
||||
if (principal) this.isUserOwner = principal.id === this.dataset.users.find(x => x.role === Role.Owner).id;
|
||||
if (principal) this.isUserOwner = !!this.dataset.users.find(x => (x.role === Role.Owner) && (principal.id === x.id));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -210,7 +210,11 @@ export class DmpCloneComponent extends BaseComponent implements OnInit {
|
|||
setIsUserOwner() {
|
||||
if (this.dmp) {
|
||||
const principal: Principal = this.authentication.current();
|
||||
this.isUserOwner = principal.id === this.dmp.users.find(x => x.role === Role.Owner).id;
|
||||
if (principal) {
|
||||
this.isUserOwner = !!this.dmp.users.find(x => (x.role === Role.Owner) && (principal.id === x.id));
|
||||
} else {
|
||||
this.isUserOwner = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -367,6 +367,6 @@ export class DmpListingItemComponent extends BaseComponent implements OnInit {
|
|||
|
||||
isUserOwner(activity: DmpListingModel): boolean {
|
||||
const principal: Principal = this.authentication.current();
|
||||
if (principal) return principal.id === activity.users.find(x => x.role === Role.Owner).id;
|
||||
if (principal) return !!activity.users.find(x => (x.role === Role.Owner) && (principal.id === x.id));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue