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 |
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 |
appendSearchParams(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. |
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 SearchHelper |
getSearchHelper() |
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 |
setSearchHelper(SearchHelper searchHelper) |
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 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 appendSearchParams(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 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)
protected SearchHelper getSearchHelper()
public void setSearchHelper(SearchHelper searchHelper)
Copyright © 2018 SAP SE. All Rights Reserved.