public class CatalogFilterHelper
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
assignToCatalogGroupIdField(java.lang.String expressionValue)
Assign the expression value to catalog group id field.
|
static java.lang.String |
assignToProductSetIdField(java.lang.String expressionValue)
Assign the expression value to product set id field.
|
static java.lang.String |
assignToStoreIdField(java.lang.String expressionValue)
Assign the expression value to store id field.
|
static java.lang.Long[] |
checkCatalogGroupEntitlementByContract(java.lang.Long[] catalogGroupIds,
java.lang.Boolean isAdminMode,
java.lang.String contractIdsString)
This method whether the passed in array of catalog group internal identifiers is explicity included or excluded in regards to entitlement.
|
static java.lang.String |
escapeSolrCharacters(java.lang.String oldString)
Escape characters for solr query expression.
|
static com.ibm.commerce.contract.catalogfilter.CatalogFilter |
getCatalogFilterById(java.lang.Long catalogFilterId)
Get a
|
static com.ibm.commerce.contract.catalogfilter.CatalogFilter |
getCatalogFilterByIdWithAdminMode(java.lang.Long catalogFilterId)
Get a
|
static java.lang.Long |
getEligibleCatalogFilterId(java.lang.Long contractId)
Get eligible catalog filter ID for contract
|
static java.lang.Long |
getEligibleCatalogFilterId(java.lang.Long contractId,
java.lang.Long memberId)
Get eligible catalog filter ID for contract
|
static java.util.Map<java.lang.Long,java.util.Map<java.lang.Long,java.util.List<java.lang.Long>>> |
getEntitledCatalogEntryRelationMapByContract(CatalogNavigationViewType catalogNavigationView,
java.lang.String contractIdsString)
Get entitled catalog entry ralations for CatalogNavigationViewType object.
|
static java.lang.String |
getExpressionWithFieldNameAndValue(java.lang.String fieldName,
java.lang.String value)
Get expression with field name and value identified.
|
static java.lang.Long |
getParentCatgroupIdById(java.lang.Long catalogId,
java.lang.Long catgroupId)
Get parent catalog group ID by ID
|
static java.lang.String |
getSelectAllExpression()
Get "select all" expression, i.e, in Solr, it's "*:*"
|
static java.lang.String |
getSolrIndexColumnName(java.lang.Integer storeId,
java.lang.String identifier)
Return the Solr index name for the given identifier for the store.
|
static java.lang.Integer[] |
getStorePath(java.lang.Integer storeId)
Get Store Path IDs
|
static java.lang.String |
wrapInAndClause(java.util.List<? extends java.lang.Object> snippetList)
Wrap the expression snippet list in "AND" clause.
|
static java.lang.String |
wrapInClause(java.lang.String expressionSnippet)
Wrap the expression snippet in clause.
|
static java.lang.String |
wrapInNotClause(java.lang.String expressionSnippet)
Wrap the expression snippet in "NOT" clause.
|
static java.lang.String |
wrapInOrClause(java.util.List<? extends java.lang.Object> snippetList)
Wrap the expression snippet list in "OR" clause.
|
public static com.ibm.commerce.contract.catalogfilter.CatalogFilter getCatalogFilterById(java.lang.Long catalogFilterId) throws ECException
catalogFilterId
- A catalog filter ID.ECException
- ECException could be thrown if any error occurred.public static com.ibm.commerce.contract.catalogfilter.CatalogFilter getCatalogFilterByIdWithAdminMode(java.lang.Long catalogFilterId) throws ECException
catalogFilterId
- A catalog filter ID.ECException
- ECException could be thrown if any error occurred.public static java.lang.Long getParentCatgroupIdById(java.lang.Long catalogId, java.lang.Long catgroupId) throws ECException
catalogId
- The catalog IDcatgroupId
- The catalog group IDECException
- Exception could be thrown if parsing error occurred.public static java.lang.String wrapInAndClause(java.util.List<? extends java.lang.Object> snippetList)
snippetList
- The snippet list.public static java.lang.String wrapInOrClause(java.util.List<? extends java.lang.Object> snippetList)
snippetList
- The snippet list.public static java.lang.String wrapInNotClause(java.lang.String expressionSnippet)
expressionSnippet
- The expression snippet.public static java.lang.String wrapInClause(java.lang.String expressionSnippet)
expressionSnippet
- The expression snippet.public static java.lang.String assignToStoreIdField(java.lang.String expressionValue)
expressionValue
- The expression value.public static java.lang.String assignToCatalogGroupIdField(java.lang.String expressionValue)
expressionValue
- The expression value.public static java.lang.String assignToProductSetIdField(java.lang.String expressionValue)
expressionValue
- The expression valuepublic static java.lang.String getSelectAllExpression()
public static java.lang.Integer[] getStorePath(java.lang.Integer storeId)
storeId
- A store IDpublic static java.lang.Long getEligibleCatalogFilterId(java.lang.Long contractId) throws ECException
contractId
- A contract IDECException
- ECException could be thrown if any errors occurred.public static java.lang.Long getEligibleCatalogFilterId(java.lang.Long contractId, java.lang.Long memberId) throws ECException
contractId
- A contract IDmemberId
- the member IDECException
- ECException could be thrown if any errors occurred.public static java.lang.String getExpressionWithFieldNameAndValue(java.lang.String fieldName, java.lang.String value)
fieldName
- A field name.value
- The field value.public static java.lang.String escapeSolrCharacters(java.lang.String oldString)
oldString
- The old solr query expression.public static java.lang.String getSolrIndexColumnName(java.lang.Integer storeId, java.lang.String identifier) throws com.ibm.commerce.foundation.internal.common.exception.FoundationApplicationException
storeId
- storeId The store Id for the request.identifier
- The logical name of the search attribute.com.ibm.commerce.foundation.internal.common.exception.FoundationApplicationException
- if there is a problem initializing the registry due to datasource configuration or executing the SQL statement.public static java.lang.Long[] checkCatalogGroupEntitlementByContract(java.lang.Long[] catalogGroupIds, java.lang.Boolean isAdminMode, java.lang.String contractIdsString)
This method whether the passed in array of catalog group internal identifiers is explicity included or excluded in regards to entitlement.
The commandCheckCatalogGroupEntitlementCmd
will be used to determine the catalog group entitlement in a batch.catalogGroupIds
- The list of catalog groups to be checked for entitlement.isAdminMode
- A flag indicating if this is in admin mode. If not provided, a default value of false will be used.contractIdsString
- if it is not empty, then just use it to do entitlment, otherwise, use the ones in cmd contextCheckCatalogGroupEntitlementCmd
,
CatalogDataBean#isAdminMode()
public static java.util.Map<java.lang.Long,java.util.Map<java.lang.Long,java.util.List<java.lang.Long>>> getEntitledCatalogEntryRelationMapByContract(CatalogNavigationViewType catalogNavigationView, java.lang.String contractIdsString) throws DataMediatorException, ECException
The structure of the relations map should be one of the followings.
catalogNavigationView
- contractIdsString
- if it is not empty, then just use it to do entitlment, otherwise, use the ones in cmd contextDataMediatorException
- DataMediatorException could be thrown if any DB operation failed.ECException
- ECException could be thrown if get trading agreements failed.