Class RestSearchServiceImpl
java.lang.Object
ch.tocco.nice2.rest.entity.impl.search.RestSearchServiceImpl
- All Implemented Interfaces:
RestSearchService
-
Constructor Summary
ConstructorDescriptionRestSearchServiceImpl
(DataModel dataModel, SearchService searchService, TextResources textResources, PersistenceService persistenceService, PathResolver pathResolver, EntityBeanFactory entityBeanFactory) -
Method Summary
Modifier and TypeMethodDescriptionbuildCountRequestFromBean
(String modelName, EntitySearchBean searchBean) build a SearchRequest from a search bean to count entitiesbuildCountRequestFromUri
(String modelName, jakarta.ws.rs.core.UriInfo uriInfo) build a SearchRequest from arguments passed to the URI to count entitiesbuildSearchRequestFromBean
(String modelName, EntitySearchBean searchBean, @Nullable Set<String> allowedPaths) build a SearchRequest from a search bean to search entitiesbuildSearchRequestFromUri
(String modelName, jakarta.ws.rs.core.UriInfo uriInfo, @Nullable Set<String> allowedPaths) build a SearchRequest from arguments passed to the URI to search for entitiescreateCollectionBean
(SearchResult searchResult, jakarta.ws.rs.core.UriBuilder uriBuilder) executeCountRequest
(SearchRequest searchRequest) execute a countexecuteSearchRequest
(SearchRequest searchRequest) execute a search but don't wrap result in bean yetexecuteSearchRequest
(SearchRequest searchRequest, jakarta.ws.rs.core.UriBuilder uriBuilder) execute a searchexecuteSearchRequestWithSelectors
(SearchRequest searchRequest, jakarta.ws.rs.core.UriBuilder uriBuilder) execute a path search request with selector supportgetPagination
(jakarta.ws.rs.core.UriInfo uriInfo) get pagination from uri info (offset and limit)void
setDisableLimitCheck
(boolean disableLimitCheck) void
setMaxLimit
(Integer maxLimit) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface ch.tocco.nice2.rest.entity.spi.search.RestSearchService
buildSearchRequestFromBean, buildSearchRequestFromUri
-
Constructor Details
-
RestSearchServiceImpl
public RestSearchServiceImpl(DataModel dataModel, SearchService searchService, TextResources textResources, PersistenceService persistenceService, PathResolver pathResolver, EntityBeanFactory entityBeanFactory)
-
-
Method Details
-
buildSearchRequestFromUri
public SearchRequest.Builder buildSearchRequestFromUri(String modelName, jakarta.ws.rs.core.UriInfo uriInfo, @Nullable @Nullable Set<String> allowedPaths) Description copied from interface:RestSearchService
build a SearchRequest from arguments passed to the URI to search for entities- Specified by:
buildSearchRequestFromUri
in interfaceRestSearchService
- Parameters:
modelName
- the model to build the request foruriInfo
- the uri infoallowedPaths
- a set of paths, if this set is passed (e.g. != null) only paths in this set will be added- Returns:
- a builder prefilled with the passed arguments
-
buildCountRequestFromUri
public SearchRequest.Builder buildCountRequestFromUri(String modelName, jakarta.ws.rs.core.UriInfo uriInfo) Description copied from interface:RestSearchService
build a SearchRequest from arguments passed to the URI to count entities- Specified by:
buildCountRequestFromUri
in interfaceRestSearchService
- Parameters:
modelName
- the model to build the request foruriInfo
- the uri info- Returns:
- a builder prefilled with the passed arguments
-
buildSearchRequestFromBean
public SearchRequest.Builder buildSearchRequestFromBean(String modelName, EntitySearchBean searchBean, @Nullable @Nullable Set<String> allowedPaths) Description copied from interface:RestSearchService
build a SearchRequest from a search bean to search entities- Specified by:
buildSearchRequestFromBean
in interfaceRestSearchService
- Parameters:
modelName
- the model to build the request forsearchBean
- the search beanallowedPaths
- a set of paths, if this set is passed (e.g. != null) only paths in this set will be added- Returns:
- a builder prefilled with the passed arguments
-
buildCountRequestFromBean
public SearchRequest.Builder buildCountRequestFromBean(String modelName, EntitySearchBean searchBean) Description copied from interface:RestSearchService
build a SearchRequest from a search bean to count entities- Specified by:
buildCountRequestFromBean
in interfaceRestSearchService
- Parameters:
modelName
- the model to build the request forsearchBean
- the search bean- Returns:
- a builder prefilled with the passed arguments
-
executeSearchRequest
Description copied from interface:RestSearchService
execute a search but don't wrap result in bean yet- Specified by:
executeSearchRequest
in interfaceRestSearchService
- Parameters:
searchRequest
- the search request- Returns:
- the search result
-
executeSearchRequest
public CollectionBean executeSearchRequest(SearchRequest searchRequest, jakarta.ws.rs.core.UriBuilder uriBuilder) Description copied from interface:RestSearchService
execute a search- Specified by:
executeSearchRequest
in interfaceRestSearchService
- Parameters:
searchRequest
- the search requesturiBuilder
- the uri builder used for paging- Returns:
- the collection bean filled with the result
-
executeSearchRequestWithSelectors
public CollectionBean executeSearchRequestWithSelectors(SearchRequest searchRequest, jakarta.ws.rs.core.UriBuilder uriBuilder) Description copied from interface:RestSearchService
execute a path search request with selector support- Specified by:
executeSearchRequestWithSelectors
in interfaceRestSearchService
- Parameters:
searchRequest
- the search requesturiBuilder
- the uri builder used for paging- Returns:
- the collection bean filled with the result
-
createCollectionBean
public CollectionBean createCollectionBean(SearchResult searchResult, jakarta.ws.rs.core.UriBuilder uriBuilder) - Specified by:
createCollectionBean
in interfaceRestSearchService
-
executeCountRequest
Description copied from interface:RestSearchService
execute a count- Specified by:
executeCountRequest
in interfaceRestSearchService
- Parameters:
searchRequest
- the count request- Returns:
- the count bean filled with the result
-
getPagination
Description copied from interface:RestSearchService
get pagination from uri info (offset and limit)- Specified by:
getPagination
in interfaceRestSearchService
- Parameters:
uriInfo
- the uri info- Returns:
- the pagination with the given offset and limit (or with the defaults)
-
setMaxLimit
-
setDisableLimitCheck
@Value("${rest.paging.disableLimitCheck}") public void setDisableLimitCheck(boolean disableLimitCheck)
-