public class CustomerTagMgr extends BaseMgr implements CustomerTagMgrIf
Modifier and Type | Field and Description |
---|---|
protected static org.apache.commons.logging.Log |
log
the log
|
templateBaseDir
Constructor and Description |
---|
CustomerTagMgr(KKEngIf eng)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addToCustomerTag(int customerId,
java.lang.String tagName,
int tagValue)
Look at addToCustomerTag(String sessionId, String tagName, int tagValue)
|
void |
addToCustomerTag(int customerId,
java.lang.String tagName,
int tagValue,
int attempt)
Look at addToCustomerTag(String sessionId, String tagName, int tagValue)
|
void |
addToCustomerTag(java.lang.String sessionId,
java.lang.String tagName,
int tagValue)
This method is used for customer tags where the value is of type
com.konakart.app.CustomerTag.MULTI_INT_TYPE or
MULTI_INT_PLUS_TIME_TYPE . |
void |
addToCustomerTagForGuest(int customerId,
java.lang.String tagName,
int tagValue)
Look at addToCustomerTag(String sessionId, String tagName, int tagValue)
|
protected void |
checkNegativeCustId(int customerId)
Utility method used to check that the customer id is negative.
|
void |
deleteCustomerTag(int customerId,
java.lang.String tagName)
Look at deleteCustomerTag(String sessionId, String tagName)
|
void |
deleteCustomerTag(java.lang.String sessionId,
java.lang.String tagName)
This method deletes the customer tag referenced by the parameter
tagName and for
the customer referenced by the sessionId . |
void |
deleteCustomerTagForGuest(int customerId,
java.lang.String tagName)
Look at deleteCustomerTag(String sessionId, String tagName)
|
boolean |
evaluateExpression(int customerId,
int expressionId,
java.lang.String expressionName)
Look at evaluateExpression(String sessionId, int expressionId, String expressionName)
|
boolean |
evaluateExpression(java.lang.String sessionId,
int expressionId,
java.lang.String expressionName)
An expression object is retrieved from the database and evaluated for the customer referenced
by the
sessionId . |
boolean |
evaluateExpressionForGuest(int customerId,
int expressionId,
java.lang.String expressionName)
Look at evaluateExpression(String sessionId, int expressionId, String expressionName)
|
CustomerTag |
getCustomerTag(int customerId,
java.lang.String tagName,
boolean getValue)
Look at getCustomerTag(String sessionId, String tagName)
|
CustomerTagIf |
getCustomerTag(java.lang.String sessionId,
java.lang.String tagName)
A CustomerTag object referenced by the parameter
tagName is returned. |
CustomerTagIf |
getCustomerTagForGuest(int customerId,
java.lang.String tagName)
Look at getCustomerTag(String sessionId, String tagName)
|
CustomerTagIf[] |
getCustomerTags(int customerId)
Look at getCustomerTags(String sessionId)
|
CustomerTagIf[] |
getCustomerTags(java.lang.String sessionId)
This method fetches all of the customer tags for the customer referenced by the
sessionId .An empty array is returned if no tags exist. |
CustomerTagIf[] |
getCustomerTagsForGuest(int customerId)
Look at getCustomerTags(String sessionId)
|
java.lang.String |
getCustomerTagValue(int customerId,
java.lang.String tagName)
Look at getCustomerTagValue(String sessionId, String tagName)
|
java.lang.String |
getCustomerTagValue(java.lang.String sessionId,
java.lang.String tagName)
A string is returned containing the value of the customer tag referenced by the parameter
tagName and for the customer referenced by the sessionId . |
java.lang.String |
getCustomerTagValueForGuest(int customerId,
java.lang.String tagName)
Look at getCustomerTagValue(String sessionId, String tagName)
|
ExpressionIf |
getExpression(int customerId,
int expressionId,
java.lang.String expressionName)
Look at getExpression(String sessionId, int expressionId, String expressionName)
|
ExpressionIf |
getExpression(java.lang.String sessionId,
int expressionId,
java.lang.String expressionName)
An Expression object, fully populated with an array of Expression Variables is returned.
|
ExpressionIf |
getExpressionForGuest(int customerId,
int expressionId,
java.lang.String expressionName)
Look at getExpression(String sessionId, int expressionId, String expressionName)
|
void |
insertCustomerTag(int customerId,
CustomerTagIf tag,
boolean ignoreSetByAPI)
Look at insertCustomerTag(String sessionId, CustomerTagIf tag)
|
void |
insertCustomerTag(java.lang.String sessionId,
CustomerTagIf tag)
Assigns a customer tag to the customer referenced by the
sessionId . |
void |
insertCustomerTagForGuest(int customerId,
CustomerTagIf tag)
Look at insertCustomerTag(String sessionId, CustomerTagIf tag)
|
protected void |
setExpressionCriteriaWithStandardAttributes(KKCriteria c)
Common code to avoid duplication which sets up the standard attributes for Expressions on the
criteria object
|
protected void |
setExpressionVariableCriteriaWithStandardAttributes(KKCriteria c,
int customerId,
boolean getValue)
Common code to avoid duplication which sets up the standard attributes for Expression
Variables on the criteria object
|
protected void |
setTagCriteriaWithStandardAttributes(KKCriteria c,
int customerId,
boolean getValue)
Common code to avoid duplication which sets up the standard attributes for Tags on the
criteria object
|
protected void |
updateNumVariables(int ExpressionId,
int numVariables)
Update the number of variables attribute for the Expression
|
acquireLock, addInsertAttr, addInsertAttr, addStringRuleConstraint, addStringRuleConstraint, checkRequired, escapeHTML, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, getAdminEngMgr, getBasketMgr, getBillingMgr, getBookableProductMgr, getCacheMgr, getCatMgr, getConfigMgr, getCookieMgr, getCurrMgr, getCustMgr, getCustomerIdFromSession, getCustomerStatsMgr, getCustomerTagMgr, getEmailMgr, getEng, getEventMgr, getExportMgr, getHTMLEscaper, getKonaKartConfig, getKonaKartConfig, getKonaKartConfig, getLangMgr, getManuMgr, getMiscItemMgr, getMiscPriceMgr, getMode, getModeString, getMqMgr, getMultiStoreMgr, getNewCriteria, getNewCriteria, getOrderIntegrationMgr, getOrderMgr, getOrderTotalMgr, getPaymentMgr, getProdMgr, getProductsToCategoresCriteria, getPromMgr, getPunchOutMgr, getRewardPointMgr, getSecMgr, getShippingMgr, getSolrMgr, getStoreId, getStoreMgr, getStoreTime, getSuggestionMgr, getTaxMgr, getTemplate, getTemplateRoot, getVelocityContextMgr, getWishListMgr, init, insertKKEvent, insertKKEvent, isBusiness, isBusinessOrEnterprise, isClassPresent, isCommunity, isDeadlockException, isEnterprise, isMultiStoreShareCategories, isMultiStoreShareCustomers, isMultiStoreShareCustomersOrProducts, isMultiStoreSharedDb, isMultiStoreShareProducts, isMultiVendor, isUnix, manageThrowable, releaseLock, updateStaticVariablesNow
public CustomerTagMgr(KKEngIf eng) throws java.lang.Exception
eng
- the engjava.lang.Exception
- an unexpected exceptionpublic boolean evaluateExpression(java.lang.String sessionId, int expressionId, java.lang.String expressionName) throws java.lang.Exception
sessionId
. If the expressionName
parameter is not set to
null, then the Expression is searched for by name. Otherwise it is searched for by the id
contained in the expressionId
parameter.evaluateExpression
in interface CustomerTagMgrIf
sessionId
- the sessionIdexpressionId
- the expressionIdexpressionName
- the expressionNamejava.lang.Exception
- an unexpected exceptionpublic boolean evaluateExpressionForGuest(int customerId, int expressionId, java.lang.String expressionName) throws java.lang.Exception
evaluateExpressionForGuest
in interface CustomerTagMgrIf
customerId
- the customerIdexpressionId
- the expressionIdexpressionName
- the expressionNamejava.lang.Exception
- an unexpected exceptionpublic boolean evaluateExpression(int customerId, int expressionId, java.lang.String expressionName) throws java.lang.Exception
evaluateExpression
in interface CustomerTagMgrIf
customerId
- the customerIdexpressionId
- the expressionIdexpressionName
- the expressionNamejava.lang.Exception
- an unexpected exceptionpublic ExpressionIf getExpression(java.lang.String sessionId, int expressionId, java.lang.String expressionName) throws java.lang.Exception
expressionName
parameter is not set to null, then the Expression is searched
for by name. Otherwise it is searched for by the id contained in the
expressionId
parameter. If the sessionId
parameter is null we get
the expression variables without any customer tag values. Otherwise the expression variables
will be populated with the customer tag values for the customer referenced by
sessionId
. othergetExpression
in interface CustomerTagMgrIf
sessionId
- the sessionIdexpressionId
- the expressionIdexpressionName
- the expressionNamejava.lang.Exception
- an unexpected exceptionpublic ExpressionIf getExpressionForGuest(int customerId, int expressionId, java.lang.String expressionName) throws java.lang.Exception
getExpressionForGuest
in interface CustomerTagMgrIf
customerId
- the customerIdexpressionId
- the expressionIdexpressionName
- the expressionNamejava.lang.Exception
- an unexpected exceptionpublic ExpressionIf getExpression(int customerId, int expressionId, java.lang.String expressionName) throws java.lang.Exception
getExpression
in interface CustomerTagMgrIf
customerId
- the customerIdexpressionId
- the expressionIdexpressionName
- the expressionNamejava.lang.Exception
- an unexpected exceptionprotected void updateNumVariables(int ExpressionId, int numVariables) throws org.apache.torque.TorqueException, com.konakart.app.KKException
ExpressionId
- the ExpressionIdnumVariables
- the numVariablesorg.apache.torque.TorqueException
- an unexpected exception in Torque (the database layer)com.konakart.app.KKException
- an unexpected KKException exceptionpublic void insertCustomerTag(java.lang.String sessionId, CustomerTagIf tag) throws java.lang.Exception
sessionId
. If a tag
already exists with this name, then the value is replaced with the new value. The compulsory
tag fields are:
Note that a customer tag with name tag.getName()
must exist in the database
since it is used to validate tag.getValue()
.
insertCustomerTag
in interface CustomerTagMgrIf
sessionId
- the sessionIdtag
- the tagjava.lang.Exception
- an unexpected exceptionpublic void insertCustomerTagForGuest(int customerId, CustomerTagIf tag) throws java.lang.Exception
insertCustomerTagForGuest
in interface CustomerTagMgrIf
customerId
- the customerIdtag
- the tagjava.lang.Exception
- an unexpected exceptionpublic void insertCustomerTag(int customerId, CustomerTagIf tag, boolean ignoreSetByAPI) throws java.lang.Exception
insertCustomerTag
in interface CustomerTagMgrIf
customerId
- the customerIdtag
- the tagignoreSetByAPI
- Allows you to set the value directly from the manager even if the SetByAPI flag
for the tag is falsejava.lang.Exception
- an unexpected exceptionpublic void addToCustomerTag(java.lang.String sessionId, java.lang.String tagName, int tagValue) throws java.lang.Exception
com.konakart.app.CustomerTag.MULTI_INT_TYPE
or
MULTI_INT_PLUS_TIME_TYPE
. This customer tag type is used to store a series of
integers and is useful for cases where you want to store information such as the last 5
product ids that a customer looked at.
If the customer tag doesn't yet exist for the customer referenced by the
sessionId
, then a new customer tag is added with the value in the
tagValue
parameter. Otherwise the new value is added. When the number of
integers stored reaches the maximum value defined for the customer tag, then the new value is
added and the oldest value is removed.
In the case of MULTI_INT_PLUS_TIME_TYPE
tags, the timestamp component is added
on the server so does not need to be specified.
addToCustomerTag
in interface CustomerTagMgrIf
sessionId
- the sessionIdtagName
- the tagNametagValue
- the tagValuejava.lang.Exception
- an unexpected exceptionpublic void addToCustomerTagForGuest(int customerId, java.lang.String tagName, int tagValue) throws java.lang.Exception
addToCustomerTagForGuest
in interface CustomerTagMgrIf
customerId
- the customerIdtagName
- the tagNametagValue
- the tagValuejava.lang.Exception
- an unexpected exceptionpublic void addToCustomerTag(int customerId, java.lang.String tagName, int tagValue) throws java.lang.Exception
addToCustomerTag
in interface CustomerTagMgrIf
customerId
- the customerIdtagName
- the tagNametagValue
- the tagValuejava.lang.Exception
- an unexpected exceptionpublic void addToCustomerTag(int customerId, java.lang.String tagName, int tagValue, int attempt) throws java.lang.Exception
customerId
- the customerIdtagName
- the tagNametagValue
- the tagValueattempt
- the attemptjava.lang.Exception
- an unexpected exceptionpublic CustomerTagIf getCustomerTag(java.lang.String sessionId, java.lang.String tagName) throws java.lang.Exception
tagName
is returned. The value
attribute of the tag is populated for the customer referenced by the sessionId
.
If sessionId
is set to null, then a customer tag object with a null value is
returned. The CustomerTag object contains utility methods to convert the tag string into its
original type (i.e. Date, boolean, int etc.).getCustomerTag
in interface CustomerTagMgrIf
sessionId
- the sessionIdtagName
- the tagNamejava.lang.Exception
- an unexpected exceptionpublic CustomerTagIf getCustomerTagForGuest(int customerId, java.lang.String tagName) throws java.lang.Exception
getCustomerTagForGuest
in interface CustomerTagMgrIf
customerId
- the customerIdtagName
- the tagNamejava.lang.Exception
- an unexpected exceptionpublic CustomerTag getCustomerTag(int customerId, java.lang.String tagName, boolean getValue) throws java.lang.Exception
getCustomerTag
in interface CustomerTagMgrIf
customerId
- the customerIdtagName
- the tagNamegetValue
- When true, we attempt to get the value of the tagjava.lang.Exception
- an unexpected exceptionpublic java.lang.String getCustomerTagValue(java.lang.String sessionId, java.lang.String tagName) throws java.lang.Exception
tagName
and for the customer referenced by the sessionId
. This
method is faster than the getCustomerTag
method, but the actual CustomerTag
object isn't available to convert the String into a more usable form such as boolean or date.getCustomerTagValue
in interface CustomerTagMgrIf
sessionId
- the sessionIdtagName
- the tagNamejava.lang.Exception
- an unexpected exceptionpublic java.lang.String getCustomerTagValueForGuest(int customerId, java.lang.String tagName) throws java.lang.Exception
getCustomerTagValueForGuest
in interface CustomerTagMgrIf
customerId
- the customerIdtagName
- the tagNamejava.lang.Exception
- an unexpected exceptionpublic java.lang.String getCustomerTagValue(int customerId, java.lang.String tagName) throws java.lang.Exception
getCustomerTagValue
in interface CustomerTagMgrIf
customerId
- the customerIdtagName
- the tagNamejava.lang.Exception
- an unexpected exceptionpublic void deleteCustomerTag(java.lang.String sessionId, java.lang.String tagName) throws java.lang.Exception
tagName
and for
the customer referenced by the sessionId
.deleteCustomerTag
in interface CustomerTagMgrIf
sessionId
- the sessionIdtagName
- the tagNamejava.lang.Exception
- an unexpected exceptionpublic void deleteCustomerTagForGuest(int customerId, java.lang.String tagName) throws java.lang.Exception
deleteCustomerTagForGuest
in interface CustomerTagMgrIf
customerId
- the customerIdtagName
- the tagNamejava.lang.Exception
- an unexpected exceptionpublic void deleteCustomerTag(int customerId, java.lang.String tagName) throws java.lang.Exception
customerId
- the customerIdtagName
- the tagNamejava.lang.Exception
- an unexpected exceptionpublic CustomerTagIf[] getCustomerTags(java.lang.String sessionId) throws java.lang.Exception
sessionId
.getCustomerTags
in interface CustomerTagMgrIf
sessionId
- the sessionIdjava.lang.Exception
- an unexpected exceptionpublic CustomerTagIf[] getCustomerTagsForGuest(int customerId) throws java.lang.Exception
getCustomerTagsForGuest
in interface CustomerTagMgrIf
customerId
- the customerIdjava.lang.Exception
- an unexpected exceptionpublic CustomerTagIf[] getCustomerTags(int customerId) throws java.lang.Exception
getCustomerTags
in interface CustomerTagMgrIf
customerId
- the customerIdjava.lang.Exception
- an unexpected exceptionprotected void setTagCriteriaWithStandardAttributes(KKCriteria c, int customerId, boolean getValue)
c
- criteria objectcustomerId
- customer IdgetValue
- when true join with customer to tag table to get valueprotected void setExpressionCriteriaWithStandardAttributes(KKCriteria c)
c
- criteria objectprotected void setExpressionVariableCriteriaWithStandardAttributes(KKCriteria c, int customerId, boolean getValue) throws com.konakart.app.KKException
c
- criteria objectcustomerId
- customer IdgetValue
- when true join with customer to tag table to get valuecom.konakart.app.KKException
- an unexpected KKException exceptionprotected void checkNegativeCustId(int customerId) throws com.konakart.app.KKException
customerId
- the customerIdcom.konakart.app.KKException
- an unexpected KKException exceptionCopyright © 2018 DS Data Systems UK Ltd.