public class DefaultFlexibleCMSItemSearchService extends java.lang.Object implements CMSItemSearchService
CMSItemSearchService implementation that performs partial
matching of the mask param on both UID and NAME fields, and exact matching on type and additional parameter fields| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CATALOG_VERSION_QUERY_PARAM |
static java.lang.String |
COLON |
static java.lang.String |
COMMA |
static java.lang.String |
EXCLUDED_TYPES_QUERY_PARAM |
static java.lang.String |
ITEM_SEARCH_PARAM_CHECK |
static java.lang.String |
MASK_CHECK |
static java.lang.String |
MASK_QUERY_PARAM |
static java.lang.String |
ORDER_BY |
static java.lang.String |
QUERY |
| Constructor and Description |
|---|
DefaultFlexibleCMSItemSearchService() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
appendItemSearchParams(CMSItemSearchData cmsItemSearchData,
java.lang.StringBuilder queryBuilder,
java.util.Map<java.lang.String,java.lang.Object> queryParameters)
Append the item search data to the query builder
|
protected void |
appendSort(java.lang.String sortNameAndDirection,
java.lang.StringBuilder queryBuilder,
java.lang.String typeCode)
Append the
ORDER BY clause to the query builder |
protected void |
appendTypeExclusions(java.lang.String typeCode,
java.lang.StringBuilder queryBuilder,
java.util.Map<java.lang.String,java.lang.Object> queryParameters)
Append the type codes to be excluded from the query to the query builder
|
protected java.lang.String |
buildSortStatement(java.lang.String typeCode,
Sort sort)
Create the
String representation of the sort parameter and direction by formatting the sort parameter by
applying the syntax required by the Flexible Search query. |
protected java.util.List<Sort> |
convertSort(java.lang.String sort)
Converts the String sort param into a list of
Sort objects. |
protected Sort |
convertSortBlock(java.lang.String sortBlock)
Convert a sort block, i.e.
|
SearchResult<CMSItemModel> |
findCMSItems(CMSItemSearchData cmsItemSearchData,
PageableData pageableData)
Paged Search for CMSItems
|
protected CatalogVersionService |
getCatalogVersionService() |
protected java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
getCmsItemSearchTypeBlacklistMap() |
protected SortStatementFormatter |
getDefaultSortStatementFormatter() |
protected FlexibleSearchAttributeValueConverter |
getFlexibleSearchAttributeValueConverter() |
protected FlexibleSearchService |
getFlexibleSearchService() |
protected java.util.List<SortStatementFormatter> |
getSortStatementFormatters() |
protected TypeService |
getTypeService() |
void |
setCatalogVersionService(CatalogVersionService catalogVersionService) |
void |
setCmsItemSearchTypeBlacklistMap(java.util.Map<java.lang.String,java.util.List<java.lang.String>> cmsItemSearchTypeBlacklistMap) |
void |
setDefaultSortStatementFormatter(SortStatementFormatter defaultSortStatementFormatter) |
void |
setFlexibleSearchAttributeValueConverter(FlexibleSearchAttributeValueConverter flexibleSearchAttributeValueConverter) |
void |
setFlexibleSearchService(FlexibleSearchService flexibleSearchService) |
void |
setSortStatementFormatters(java.util.List<SortStatementFormatter> sortStatementFormatters) |
void |
setTypeService(TypeService typeService) |
public static final java.lang.String QUERY
public static final java.lang.String MASK_CHECK
public static final java.lang.String ITEM_SEARCH_PARAM_CHECK
public static final java.lang.String CATALOG_VERSION_QUERY_PARAM
public static final java.lang.String MASK_QUERY_PARAM
public static final java.lang.String EXCLUDED_TYPES_QUERY_PARAM
public static final java.lang.String ORDER_BY
public static final java.lang.String COLON
public static final java.lang.String COMMA
public SearchResult<CMSItemModel> findCMSItems(CMSItemSearchData cmsItemSearchData, PageableData pageableData)
CMSItemSearchServicefindCMSItems in interface CMSItemSearchServicecmsItemSearchData - All the required and optional search params, excluding pagingpageableData - Paging search paramsprotected void appendTypeExclusions(java.lang.String typeCode,
java.lang.StringBuilder queryBuilder,
java.util.Map<java.lang.String,java.lang.Object> queryParameters)
typeCode - the typeCode which may have a list of blacklisted types definedqueryBuilder - the query builder for the query statementqueryParameters - map of key-value pairs of query parameter fields and Object valuesprotected void appendItemSearchParams(CMSItemSearchData cmsItemSearchData, java.lang.StringBuilder queryBuilder, java.util.Map<java.lang.String,java.lang.Object> queryParameters)
cmsItemSearchData - all the required and optional search params, excluding paging informationqueryBuilder - the query builder for the query statementqueryParameters - map of key-value pairs of query parameter fields and Object valuesprotected void appendSort(java.lang.String sortNameAndDirection,
java.lang.StringBuilder queryBuilder,
java.lang.String typeCode)
ORDER BY clause to the query buildersortNameAndDirection - string containing the field name to be sorted and the sort orderqueryBuilder - the query builder for the query statementprotected java.lang.String buildSortStatement(java.lang.String typeCode,
Sort sort)
String representation of the sort parameter and direction by formatting the sort parameter by
applying the syntax required by the Flexible Search query. This uses a custom SortStatementFormatter to
format the sort parameter value if applicable, otherwise the default formatter is used instead.typeCode - the typecode/itemtype value of the cms items to be retrievedsort - the Sort object containing the parameter to be sorted and the sort directionString representation of the formatted sort parameter and directionprotected java.util.List<Sort> convertSort(java.lang.String sort)
Sort objects. The input, if not empty, should be already
validated with the following format: {param}:{direction} Multiple sort parameters are allowed if the blocks are
separated by comma.sort - - the sort parameter received from the requestprotected Sort convertSortBlock(java.lang.String sortBlock)
Sort object. When a sort direction is invalid or is
not provided, the sort direction is defaulted to SortDirection.ASC.sortBlock - a colon delimited String containing the sort field name and sorting directionSort objectprotected CatalogVersionService getCatalogVersionService()
public void setCatalogVersionService(CatalogVersionService catalogVersionService)
protected FlexibleSearchService getFlexibleSearchService()
public void setFlexibleSearchService(FlexibleSearchService flexibleSearchService)
protected FlexibleSearchAttributeValueConverter getFlexibleSearchAttributeValueConverter()
public void setFlexibleSearchAttributeValueConverter(FlexibleSearchAttributeValueConverter flexibleSearchAttributeValueConverter)
protected TypeService getTypeService()
public void setTypeService(TypeService typeService)
protected java.util.List<SortStatementFormatter> getSortStatementFormatters()
public void setSortStatementFormatters(java.util.List<SortStatementFormatter> sortStatementFormatters)
protected SortStatementFormatter getDefaultSortStatementFormatter()
public void setDefaultSortStatementFormatter(SortStatementFormatter defaultSortStatementFormatter)
protected java.util.Map<java.lang.String,java.util.List<java.lang.String>> getCmsItemSearchTypeBlacklistMap()
public void setCmsItemSearchTypeBlacklistMap(java.util.Map<java.lang.String,java.util.List<java.lang.String>> cmsItemSearchTypeBlacklistMap)
Copyright © 2018 SAP SE. All Rights Reserved.