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
FieldsModifier and TypeFieldDescriptionprotected final DataModelprotected final FormModelprotected final LocaleResolverServiceprotected final org.slf4j.Logger -
Constructor Summary
ConstructorsConstructorDescriptionInternalSearchServiceImpl(org.slf4j.Logger log, DataModel dataModel, FormModel formModel, LocaleResolverService localeService, Context context, L10N l10N, QueryBuilderFactory queryBuilderFactory) -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyDefaultOrdering(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.voidapplyOrderItems(Query query, @Nullable InternalSearchService.OrderItem[] order, String entityName, @Nullable FormIdentifier formIdentifier) For convenience, iforderisnullthis 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) voidsetSearchRequestHandlers(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:
createSearchQueryStringin interfaceInternalSearchService- Throws:
RpcExecutionExceptionPersistException
-
createSearchQuery
public Query createSearchQuery(SearchRequest request) throws RpcExecutionException, PersistException - Specified by:
createSearchQueryin interfaceInternalSearchService- Throws:
RpcExecutionExceptionPersistException
-
setSearchRequestHandlers
-
applyDefaultOrdering
public void applyDefaultOrdering(Query qu, @Nullable @Nullable InternalSearchService.OrderItem[] order, String entityName, @Nullable @Nullable FormIdentifier formIdentifier) throws PersistException Description copied from interface:InternalSearchServiceApplies 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:
applyDefaultOrderingin interfaceInternalSearchService- Throws:
PersistException
-
getEntityList
public EntityListResult getEntityList(String entityName, String[] pks, @Nullable @Nullable InternalSearchService.OrderItem[] order, SearchService.SearchParameters searchParameters) Description copied from interface:InternalSearchServiceLoads an EntityList based on a list of PKs.- Specified by:
getEntityListin 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:
queryForRelationin 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:InternalSearchServiceFor convenience, iforderisnullthis method just returns. If not, the order items are applied to the query.- Specified by:
applyOrderItemsin interfaceInternalSearchService- Throws:
PersistException
-