Class PageProviderHelper
java.lang.Object
org.nuxeo.ecm.automation.core.util.PageProviderHelper
- Since:
- 10.3
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected static String
appendToPattern
(String pattern, String clause) protected static String
buildAggregatesClause
(PageProvider provider) static String
buildQueryString
(PageProvider<?> provider) static String
buildQueryStringWithAggregates
(PageProvider<?> provider) protected static String
buildQueryStringWithPageProvider
(PageProvider<?> provider, boolean useAggregates) protected static void
fillSearchDocument
(CoreSession session, DocumentModel searchDoc, Map<String, String> namedParameters) protected static String
getClauseFromBucket
(Bucket bucket, String field) static PageProvider<?>
getPageProvider
(CoreSession session, PageProviderDefinition def, Map<String, String> namedParameters, Object... queryParams) static PageProvider<?>
getPageProvider
(CoreSession session, PageProviderDefinition def, Map<String, String> namedParameters, List<String> sortBy, List<String> sortOrder, Long pageSize, Long currentPageIndex, Long currentOffset, List<String> highlights, List<String> quickFilters, Object... parameters) static PageProvider<?>
getPageProvider
(CoreSession session, PageProviderDefinition def, Map<String, String> namedParameters, List<String> sortBy, List<String> sortOrder, Long pageSize, Long currentPageIndex, Object... queryParams) static PageProvider<?>
getPageProvider
(CoreSession session, PageProviderDefinition def, Map<String, String> namedParameters, List<String> sortBy, List<String> sortOrder, Long pageSize, Long currentPageIndex, List<String> highlights, List<String> quickFilters, Object... parameters) static PageProviderDefinition
getPageProviderDefinition
(String providerName) static PageProviderDefinition
static PageProviderDefinition
getQueryAndFetchProviderDefinition
(String query, Map<String, String> properties) static PageProviderDefinition
static PageProviderDefinition
getQueryPageProviderDefinition
(String query, Map<String, String> properties) static PageProviderDefinition
getQueryPageProviderDefinition
(String query, Map<String, String> properties, boolean escapeParameters, boolean quoteParameters) protected static String
getRangeClause
(String field, BucketRange bucketRange) protected static String
getRangeDateClause
(String field, BucketRangeDate bucketRangeDate) static DocumentModel
getSearchDocumentModel
(CoreSession session, String providerName, Map<String, String> namedParameters) static DocumentModel
getSearchDocumentModel
(CoreSession session, PageProviderService pps, String providerName, Map<String, String> namedParameters) Returns asearchDocumentModel
if the givenproviderName
is not null and has a validdefinition
, or if the givennamedParameters
is not empty.protected static String
getTermClause
(String field, String key) static Object[]
resolveELParameters
(PageProviderDefinition def, Object... parameters) Resolves additional parameters that could have been defined in the contribution.
-
Field Details
-
ASC
- See Also:
-
DESC
- See Also:
-
CURRENT_USERID_PATTERN
- See Also:
-
CURRENT_REPO_PATTERN
- See Also:
-
OBJECT_MAPPER
protected static final com.fasterxml.jackson.databind.ObjectMapper OBJECT_MAPPER
-
-
Method Details
-
getQueryAndFetchProviderDefinition
-
getQueryAndFetchProviderDefinition
public static PageProviderDefinition getQueryAndFetchProviderDefinition(String query, Map<String, String> properties) -
getQueryPageProviderDefinition
-
getQueryPageProviderDefinition
public static PageProviderDefinition getQueryPageProviderDefinition(String query, Map<String, String> properties) -
getQueryPageProviderDefinition
public static PageProviderDefinition getQueryPageProviderDefinition(String query, Map<String, String> properties, boolean escapeParameters, boolean quoteParameters) - Since:
- 11.1
-
getPageProviderDefinition
-
getPageProvider
public static PageProvider<?> getPageProvider(CoreSession session, PageProviderDefinition def, Map<String, String> namedParameters, Object... queryParams) -
getPageProvider
public static PageProvider<?> getPageProvider(CoreSession session, PageProviderDefinition def, Map<String, String> namedParameters, List<String> sortBy, List<String> sortOrder, Long pageSize, Long currentPageIndex, Object... queryParams) -
getPageProvider
-
getPageProvider
public static PageProvider<?> getPageProvider(CoreSession session, PageProviderDefinition def, Map<String, String> namedParameters, List<String> sortBy, List<String> sortOrder, Long pageSize, Long currentPageIndex, Long currentOffset, List<String> highlights, List<String> quickFilters, Object... parameters) -
getSearchDocumentModel
public static DocumentModel getSearchDocumentModel(CoreSession session, String providerName, Map<String, String> namedParameters) -
getSearchDocumentModel
public static DocumentModel getSearchDocumentModel(CoreSession session, PageProviderService pps, String providerName, Map<String, String> namedParameters) Returns asearchDocumentModel
if the givenproviderName
is not null and has a validdefinition
, or if the givennamedParameters
is not empty.Definition
is valid if either it has a type or if it declares where clause.- Since:
- 11.1
-
fillSearchDocument
protected static void fillSearchDocument(CoreSession session, @NotNull DocumentModel searchDoc, @NotNull Map<String, String> namedParameters) - Since:
- 11.1
-
buildQueryString
-
buildQueryStringWithAggregates
-
buildQueryStringWithPageProvider
protected static String buildQueryStringWithPageProvider(PageProvider<?> provider, boolean useAggregates) -
buildAggregatesClause
-
getClauseFromBucket
-
getTermClause
- Since:
- 2023.18
-
getRangeClause
-
getRangeDateClause
-
appendToPattern
-
resolveELParameters
Resolves additional parameters that could have been defined in the contribution.- Parameters:
parameters
- parameters from the operation
-