2024-04-26 12:50:56 +02:00
|
|
|
package org.opencdmp.query.lookup;
|
2023-12-05 15:05:37 +01:00
|
|
|
|
|
|
|
import gr.cite.tools.data.query.Lookup;
|
|
|
|
import gr.cite.tools.data.query.QueryFactory;
|
2024-04-30 11:54:26 +02:00
|
|
|
import org.opencdmp.commons.enums.DmpUserRole;
|
|
|
|
import org.opencdmp.commons.enums.IsActive;
|
|
|
|
import org.opencdmp.elastic.query.NestedCollaboratorElasticQuery;
|
|
|
|
import org.opencdmp.query.DmpUserQuery;
|
2023-12-05 15:05:37 +01:00
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.UUID;
|
|
|
|
|
|
|
|
public class DmpUserLookup extends Lookup {
|
|
|
|
|
|
|
|
|
|
|
|
private List<UUID> ids;
|
|
|
|
|
|
|
|
private List<UUID> dmpIds;
|
|
|
|
private List<UUID> userIds;
|
2024-02-21 11:46:24 +01:00
|
|
|
private List<UUID> sectionIds;
|
2023-12-05 15:05:37 +01:00
|
|
|
|
|
|
|
private List<IsActive> isActive;
|
|
|
|
private List<DmpUserRole> userRoles;
|
|
|
|
|
|
|
|
public List<UUID> getIds() {
|
2024-04-30 11:54:26 +02:00
|
|
|
return this.ids;
|
2023-12-05 15:05:37 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public void setIds(List<UUID> ids) {
|
|
|
|
this.ids = ids;
|
|
|
|
}
|
|
|
|
|
|
|
|
public List<UUID> getDmpIds() {
|
2024-04-30 11:54:26 +02:00
|
|
|
return this.dmpIds;
|
2023-12-05 15:05:37 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public void setDmpIds(List<UUID> dmpIds) {
|
|
|
|
this.dmpIds = dmpIds;
|
|
|
|
}
|
|
|
|
|
|
|
|
public List<UUID> getUserIds() {
|
2024-04-30 11:54:26 +02:00
|
|
|
return this.userIds;
|
2023-12-05 15:05:37 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public void setUserIds(List<UUID> userIds) {
|
|
|
|
this.userIds = userIds;
|
|
|
|
}
|
|
|
|
|
2024-02-21 11:46:24 +01:00
|
|
|
public List<UUID> getSectionIds() {
|
2024-04-30 11:54:26 +02:00
|
|
|
return this.sectionIds;
|
2024-02-21 11:46:24 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public void setSectionIds(List<UUID> sectionIds) {
|
|
|
|
this.sectionIds = sectionIds;
|
|
|
|
}
|
|
|
|
|
2023-12-05 15:05:37 +01:00
|
|
|
public List<IsActive> getIsActive() {
|
2024-04-30 11:54:26 +02:00
|
|
|
return this.isActive;
|
2023-12-05 15:05:37 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public void setIsActive(List<IsActive> isActive) {
|
|
|
|
this.isActive = isActive;
|
|
|
|
}
|
|
|
|
|
|
|
|
public List<DmpUserRole> getUserRoles() {
|
2024-04-30 11:54:26 +02:00
|
|
|
return this.userRoles;
|
2023-12-05 15:05:37 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public void setUserRoles(List<DmpUserRole> userRoles) {
|
|
|
|
this.userRoles = userRoles;
|
|
|
|
}
|
|
|
|
|
|
|
|
public DmpUserQuery enrich(QueryFactory queryFactory) {
|
|
|
|
DmpUserQuery query = queryFactory.query(DmpUserQuery.class);
|
|
|
|
if (this.ids != null) query.ids(this.ids);
|
|
|
|
if (this.dmpIds != null) query.dmpIds(this.dmpIds);
|
|
|
|
if (this.userIds != null) query.userIds(this.userIds);
|
|
|
|
if (this.userRoles != null) query.userRoles(this.userRoles);
|
2024-02-21 11:46:24 +01:00
|
|
|
if (this.sectionIds != null) query.sectionIds(this.sectionIds);
|
2023-12-05 15:05:37 +01:00
|
|
|
if (this.isActive != null) query.isActives(this.isActive);
|
|
|
|
|
|
|
|
this.enrichCommon(query);
|
|
|
|
|
|
|
|
return query;
|
|
|
|
}
|
|
|
|
|
2024-05-03 14:00:44 +02:00
|
|
|
public NestedCollaboratorElasticQuery enrichElasticInner(QueryFactory queryFactory) {
|
2023-12-05 15:05:37 +01:00
|
|
|
NestedCollaboratorElasticQuery query = queryFactory.query(NestedCollaboratorElasticQuery.class);
|
|
|
|
if (this.ids != null) query.ids(this.ids);
|
2024-04-30 11:54:26 +02:00
|
|
|
if (this.userIds != null) query.userIds(this.userIds);
|
2023-12-05 15:05:37 +01:00
|
|
|
if (this.userRoles != null) query.userRoles(this.userRoles);
|
2024-05-03 14:00:44 +02:00
|
|
|
if (this.sectionIds != null) throw new UnsupportedOperationException("");
|
2023-12-05 15:05:37 +01:00
|
|
|
|
|
|
|
this.enrichCommon(query);
|
|
|
|
|
|
|
|
return query;
|
|
|
|
}
|
|
|
|
}
|