Class PageProviderHelper
- java.lang.Object
-
- org.nuxeo.ecm.automation.core.util.PageProviderHelper
-
public class PageProviderHelper extends Object
- Since:
- 10.3
-
-
Field Summary
Fields Modifier and Type Field Description static String
ASC
static String
CURRENT_REPO_PATTERN
static String
CURRENT_USERID_PATTERN
static String
DESC
protected static com.fasterxml.jackson.databind.ObjectMapper
OBJECT_MAPPER
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected 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
getQueryAndFetchProviderDefinition(String query)
static PageProviderDefinition
getQueryAndFetchProviderDefinition(String query, Map<String,String> properties)
static PageProviderDefinition
getQueryPageProviderDefinition(String query)
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 Detail
-
ASC
public static final String ASC
- See Also:
- Constant Field Values
-
DESC
public static final String DESC
- See Also:
- Constant Field Values
-
CURRENT_USERID_PATTERN
public static final String CURRENT_USERID_PATTERN
- See Also:
- Constant Field Values
-
CURRENT_REPO_PATTERN
public static final String CURRENT_REPO_PATTERN
- See Also:
- Constant Field Values
-
OBJECT_MAPPER
protected static final com.fasterxml.jackson.databind.ObjectMapper OBJECT_MAPPER
-
-
Method Detail
-
getQueryAndFetchProviderDefinition
public static PageProviderDefinition getQueryAndFetchProviderDefinition(String query)
-
getQueryAndFetchProviderDefinition
public static PageProviderDefinition getQueryAndFetchProviderDefinition(String query, Map<String,String> properties)
-
getQueryPageProviderDefinition
public static PageProviderDefinition getQueryPageProviderDefinition(String query)
-
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
public static PageProviderDefinition getPageProviderDefinition(String providerName)
-
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
public 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)
-
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
public static String buildQueryString(PageProvider<?> provider)
-
buildQueryStringWithAggregates
public static String buildQueryStringWithAggregates(PageProvider<?> provider)
-
buildQueryStringWithPageProvider
protected static String buildQueryStringWithPageProvider(PageProvider<?> provider, boolean useAggregates)
-
buildAggregatesClause
protected static String buildAggregatesClause(PageProvider provider)
-
getRangeClause
protected static String getRangeClause(String field, BucketRange bucketRange)
-
getRangeDateClause
protected static String getRangeDateClause(String field, BucketRangeDate bucketRangeDate)
-
resolveELParameters
public static Object[] resolveELParameters(PageProviderDefinition def, Object... parameters)
Resolves additional parameters that could have been defined in the contribution.- Parameters:
parameters
- parameters from the operation
-
-