Class ElasticCaseService
- java.lang.Object
-
- com.netgrif.application.engine.elastic.service.ElasticViewPermissionService
-
- com.netgrif.application.engine.elastic.service.ElasticCaseService
-
- All Implemented Interfaces:
IElasticCaseService
@Service public class ElasticCaseService extends ElasticViewPermissionService implements IElasticCaseService
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
caseIndex
protected ElasticsearchProperties
elasticsearchProperties
protected Executor
executors
protected IElasticCasePrioritySearch
iElasticCasePrioritySearch
protected IPetriNetService
petriNetService
protected ElasticCaseRepository
repository
protected org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate
template
protected IWorkflowService
workflowService
-
Constructor Summary
Constructors Constructor Description ElasticCaseService(ElasticCaseRepository repository, org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate template, Executor executors)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
buildAuthorQuery(CaseSearchRequest request, org.elasticsearch.index.query.BoolQueryBuilder query)
{ "author": { "email": "user@customer.com" } }protected void
buildCaseIdQuery(CaseSearchRequest request, org.elasticsearch.index.query.BoolQueryBuilder query)
Case with stringId "5cb07b6ff05be15f0b972c36"protected void
buildDataQuery(CaseSearchRequest request, org.elasticsearch.index.query.BoolQueryBuilder query)
Cases where "text_field" has value EXACTLY "text" AND "number_field" has value EXACTLY "125".protected void
buildFullTextQuery(CaseSearchRequest request, org.elasticsearch.index.query.BoolQueryBuilder query)
protected boolean
buildGroupQuery(CaseSearchRequest request, LoggedUser user, java.util.Locale locale, org.elasticsearch.index.query.BoolQueryBuilder query)
Cases that are instances of processes of group "5cb07b6ff05be15f0b972c36"protected void
buildPetriNetQuery(CaseSearchRequest request, LoggedUser user, org.elasticsearch.index.query.BoolQueryBuilder query)
protected org.springframework.data.elasticsearch.core.query.NativeSearchQuery
buildQuery(java.util.List<CaseSearchRequest> requests, LoggedUser user, org.springframework.data.domain.Pageable pageable, java.util.Locale locale, java.lang.Boolean isIntersection)
protected void
buildRoleQuery(CaseSearchRequest request, org.elasticsearch.index.query.BoolQueryBuilder query)
Cases with active role "5cb07b6ff05be15f0b972c36"protected org.elasticsearch.index.query.BoolQueryBuilder
buildSingleQuery(CaseSearchRequest request, LoggedUser user, java.util.Locale locale)
protected void
buildStringQuery(CaseSearchRequest request, org.elasticsearch.index.query.BoolQueryBuilder query, LoggedUser user)
protected void
buildTagsQuery(CaseSearchRequest request, org.elasticsearch.index.query.BoolQueryBuilder query)
protected void
buildTaskQuery(CaseSearchRequest request, org.elasticsearch.index.query.BoolQueryBuilder query)
Cases with tasks with import Id "nova_uloha"protected void
buildUriNodeIdQuery(CaseSearchRequest request, org.elasticsearch.index.query.BoolQueryBuilder query)
long
count(java.util.List<CaseSearchRequest> requests, LoggedUser user, java.util.Locale locale, java.lang.Boolean isIntersection)
java.lang.String
findUriNodeId(Case aCase)
void
index(ElasticCase useCase)
void
indexNow(ElasticCase useCase)
void
remove(java.lang.String caseId)
void
removeByPetriNetId(java.lang.String processId)
protected org.springframework.data.domain.Pageable
resolveUnmappedSortAttributes(org.springframework.data.domain.Pageable pageable)
org.springframework.data.domain.Page<Case>
search(java.util.List<CaseSearchRequest> requests, LoggedUser user, org.springframework.data.domain.Pageable pageable, java.util.Locale locale, java.lang.Boolean isIntersection)
void
setWorkflowService(IWorkflowService workflowService)
-
Methods inherited from class com.netgrif.application.engine.elastic.service.ElasticViewPermissionService
buildViewPermissionQuery
-
-
-
-
Field Detail
-
repository
protected ElasticCaseRepository repository
-
workflowService
protected IWorkflowService workflowService
-
caseIndex
@Value("${spring.data.elasticsearch.index.case}") protected java.lang.String caseIndex
-
template
@Autowired protected org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate template
-
executors
protected Executor executors
-
elasticsearchProperties
@Autowired protected ElasticsearchProperties elasticsearchProperties
-
petriNetService
@Autowired protected IPetriNetService petriNetService
-
iElasticCasePrioritySearch
@Autowired protected IElasticCasePrioritySearch iElasticCasePrioritySearch
-
-
Constructor Detail
-
ElasticCaseService
@Autowired public ElasticCaseService(ElasticCaseRepository repository, org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate template, Executor executors)
-
-
Method Detail
-
setWorkflowService
@Autowired @Lazy public void setWorkflowService(IWorkflowService workflowService)
-
remove
public void remove(java.lang.String caseId)
- Specified by:
remove
in interfaceIElasticCaseService
-
removeByPetriNetId
public void removeByPetriNetId(java.lang.String processId)
- Specified by:
removeByPetriNetId
in interfaceIElasticCaseService
-
index
public void index(ElasticCase useCase)
- Specified by:
index
in interfaceIElasticCaseService
-
indexNow
public void indexNow(ElasticCase useCase)
- Specified by:
indexNow
in interfaceIElasticCaseService
-
search
public org.springframework.data.domain.Page<Case> search(java.util.List<CaseSearchRequest> requests, LoggedUser user, org.springframework.data.domain.Pageable pageable, java.util.Locale locale, java.lang.Boolean isIntersection)
- Specified by:
search
in interfaceIElasticCaseService
-
count
public long count(java.util.List<CaseSearchRequest> requests, LoggedUser user, java.util.Locale locale, java.lang.Boolean isIntersection)
- Specified by:
count
in interfaceIElasticCaseService
-
findUriNodeId
public java.lang.String findUriNodeId(Case aCase)
- Specified by:
findUriNodeId
in interfaceIElasticCaseService
-
buildQuery
protected org.springframework.data.elasticsearch.core.query.NativeSearchQuery buildQuery(java.util.List<CaseSearchRequest> requests, LoggedUser user, org.springframework.data.domain.Pageable pageable, java.util.Locale locale, java.lang.Boolean isIntersection)
-
buildSingleQuery
protected org.elasticsearch.index.query.BoolQueryBuilder buildSingleQuery(CaseSearchRequest request, LoggedUser user, java.util.Locale locale)
-
buildPetriNetQuery
protected void buildPetriNetQuery(CaseSearchRequest request, LoggedUser user, org.elasticsearch.index.query.BoolQueryBuilder query)
-
buildAuthorQuery
protected void buildAuthorQuery(CaseSearchRequest request, org.elasticsearch.index.query.BoolQueryBuilder query)
{ "author": { "email": "user@customer.com" } }
Cases with author with (id 1 AND email "user@customer.com") OR (id 2)
{ "author": [{ "id": 1 "email": "user@customer.com" }, { "id": 2 } ] }
-
buildTaskQuery
protected void buildTaskQuery(CaseSearchRequest request, org.elasticsearch.index.query.BoolQueryBuilder query)
Cases with tasks with import Id "nova_uloha"{ "transition": "nova_uloha" }
Cases with tasks with import Id "nova_uloha" OR "kontrola"
{ "transition": [ "nova_uloha", "kontrola" ] }
-
buildRoleQuery
protected void buildRoleQuery(CaseSearchRequest request, org.elasticsearch.index.query.BoolQueryBuilder query)
Cases with active role "5cb07b6ff05be15f0b972c36"{ "role": "5cb07b6ff05be15f0b972c36" }
Cases with active role "5cb07b6ff05be15f0b972c36" OR "5cb07b6ff05be15f0b972c31"
{ "role" [ "5cb07b6ff05be15f0b972c36", "5cb07b6ff05be15f0b972c31" ] }
-
buildDataQuery
protected void buildDataQuery(CaseSearchRequest request, org.elasticsearch.index.query.BoolQueryBuilder query)
Cases where "text_field" has value EXACTLY "text" AND "number_field" has value EXACTLY "125".
{ "data": { "text_field": "text", "number_field": "125" } }
-
buildTagsQuery
protected void buildTagsQuery(CaseSearchRequest request, org.elasticsearch.index.query.BoolQueryBuilder query)
-
buildFullTextQuery
protected void buildFullTextQuery(CaseSearchRequest request, org.elasticsearch.index.query.BoolQueryBuilder query)
-
buildStringQuery
protected void buildStringQuery(CaseSearchRequest request, org.elasticsearch.index.query.BoolQueryBuilder query, LoggedUser user)
-
buildCaseIdQuery
protected void buildCaseIdQuery(CaseSearchRequest request, org.elasticsearch.index.query.BoolQueryBuilder query)
Case with stringId "5cb07b6ff05be15f0b972c36"{ "stringId": "5cb07b6ff05be15f0b972c36" }
Cases with stringId "5cb07b6ff05be15f0b972c36" OR "5cb07b6ff05be15f0b972c31"
{ "stringId" [ "5cb07b6ff05be15f0b972c36", "5cb07b6ff05be15f0b972c31" ] }
-
buildUriNodeIdQuery
protected void buildUriNodeIdQuery(CaseSearchRequest request, org.elasticsearch.index.query.BoolQueryBuilder query)
-
buildGroupQuery
protected boolean buildGroupQuery(CaseSearchRequest request, LoggedUser user, java.util.Locale locale, org.elasticsearch.index.query.BoolQueryBuilder query)
Cases that are instances of processes of group "5cb07b6ff05be15f0b972c36"{ "group": "5cb07b6ff05be15f0b972c36" }
Cases that are instances of processes of group "5cb07b6ff05be15f0b972c36" OR "5cb07b6ff05be15f0b972c31"
{ "group" [ "5cb07b6ff05be15f0b972c36", "5cb07b6ff05be15f0b972c31" ] }
-
resolveUnmappedSortAttributes
protected org.springframework.data.domain.Pageable resolveUnmappedSortAttributes(org.springframework.data.domain.Pageable pageable)
-
-