Class InternalSearchServiceImpl
java.lang.Object
ch.tocco.nice2.netui.impl.bind.entity.InternalSearchServiceImpl
- All Implemented Interfaces:
InternalSearchService
-
Nested Class Summary
Nested classes/interfaces inherited from interface ch.tocco.nice2.netui.api.bind.entity.InternalSearchService
InternalSearchService.OrderItem, InternalSearchService.Paging
-
Field Summary
Modifier and TypeFieldDescriptionprotected final DataModel
protected final FormModel
protected final LocaleResolverService
protected final org.slf4j.Logger
-
Constructor Summary
ConstructorDescriptionInternalSearchServiceImpl
(org.slf4j.Logger log, DataModel dataModel, FormModel formModel, LocaleResolverService localeService, Context context, L10N l10N, QueryBuilderFactory queryBuilderFactory) -
Method Summary
Modifier and TypeMethodDescriptionvoid
applyDefaultOrdering
(Query qu, @Nullable InternalSearchService.OrderItem[] order, String entityName, @Nullable FormIdentifier formIdentifier) Applies the given order if any (usingInternalSearchService.applyOrderItems(Query, OrderItem[], String, FormIdentifier)
, otherwise sorts by last mod if the entity supports it, otherwise by default entity sorting rule.void
applyOrderItems
(Query query, @Nullable InternalSearchService.OrderItem[] order, String entityName, @Nullable FormIdentifier formIdentifier) For convenience, iforder
isnull
this method just returns.createSearchQuery
(SearchRequest request) createSearchQueryString
(SearchRequest request) getEntityList
(String entityName, String[] pks, @Nullable InternalSearchService.OrderItem[] order, SearchService.SearchParameters searchParameters) Loads an EntityList based on a list of PKs.queryForRelation
(String entityName, RelatedToInfo relatedTo, @Nullable InternalSearchService.OrderItem[] order) void
setSearchRequestHandlers
(List<SearchRequestHandler> searchRequestHandlers)
-
Field Details
-
log
protected final org.slf4j.Logger log -
formModel
-
dataModel
-
localeService
-
-
Constructor Details
-
InternalSearchServiceImpl
public InternalSearchServiceImpl(org.slf4j.Logger log, DataModel dataModel, FormModel formModel, LocaleResolverService localeService, Context context, L10N l10N, QueryBuilderFactory queryBuilderFactory)
-
-
Method Details
-
createSearchQueryString
public String createSearchQueryString(SearchRequest request) throws RpcExecutionException, PersistException - Specified by:
createSearchQueryString
in interfaceInternalSearchService
- Throws:
RpcExecutionException
PersistException
-
createSearchQuery
public Query createSearchQuery(SearchRequest request) throws RpcExecutionException, PersistException - Specified by:
createSearchQuery
in interfaceInternalSearchService
- Throws:
RpcExecutionException
PersistException
-
setSearchRequestHandlers
-
applyDefaultOrdering
public void applyDefaultOrdering(Query qu, @Nullable @Nullable InternalSearchService.OrderItem[] order, String entityName, @Nullable @Nullable FormIdentifier formIdentifier) throws PersistException Description copied from interface:InternalSearchService
Applies the given order if any (usingInternalSearchService.applyOrderItems(Query, OrderItem[], String, FormIdentifier)
, otherwise sorts by last mod if the entity supports it, otherwise by default entity sorting rule.- Specified by:
applyDefaultOrdering
in interfaceInternalSearchService
- Throws:
PersistException
-
getEntityList
public EntityListResult getEntityList(String entityName, String[] pks, @Nullable @Nullable InternalSearchService.OrderItem[] order, SearchService.SearchParameters searchParameters) Description copied from interface:InternalSearchService
Loads an EntityList based on a list of PKs.- Specified by:
getEntityList
in interfaceInternalSearchService
- Parameters:
pks
- May be empty.- Returns:
- The entities are ordered the same way as the pks.
-
queryForRelation
public RelationQuery queryForRelation(String entityName, RelatedToInfo relatedTo, @Nullable @Nullable InternalSearchService.OrderItem[] order) throws PersistException - Specified by:
queryForRelation
in interfaceInternalSearchService
- Throws:
PersistException
-
applyOrderItems
public void applyOrderItems(Query query, @Nullable @Nullable InternalSearchService.OrderItem[] order, String entityName, @Nullable @Nullable FormIdentifier formIdentifier) throws PersistException Description copied from interface:InternalSearchService
For convenience, iforder
isnull
this method just returns. If not, the order items are applied to the query.- Specified by:
applyOrderItems
in interfaceInternalSearchService
- Throws:
PersistException
-