public class CampaignUtil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COPYRIGHT
Copyright.
|
Constructor and Description |
---|
CampaignUtil() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String[] |
getActivityViewByStoreType(java.lang.String storeType)
This method returns all activity views that a store with the given store type is allowed to access.
|
static java.lang.Integer |
getCalcodeIdByIdentifier(java.lang.String calcodeCode,
java.lang.Integer calcodeUsage,
java.lang.Integer storeId)
This method returns the calculation code ID given the code, usage and store ID.
|
static java.lang.Long[] |
getCatalogMemberIds(java.lang.Integer storeId)
This method returns all the catalog member IDs in the store path given the current store ID.
|
static java.lang.Long |
getCatentryIdByPartNumber(java.lang.String partNumber,
java.lang.Integer storeId)
This method returns the catalog entry ID given the catalog entry part number and the current
store ID.
|
static java.lang.Long |
getCatentryIdByPartNumber(java.lang.String partNumber,
java.lang.String DN)
This method returns the catalog entry ID given the catalog entry part number and the organization
distinguish name.
|
static java.lang.Long |
getCatgroupIdByIdentifier(java.lang.String identifier,
java.lang.Integer storeId)
This method returns the catalog group ID given the catalog group identifier and the current
store ID.
|
static java.lang.Long |
getCatgroupIdByIdentifier(java.lang.String identifier,
java.lang.String DN)
This method returns the catalog group ID given the catalog group identifier and the organization
distinguish name.
|
static java.lang.String |
getCatgroupIdentifierById(java.lang.Long catgroupId)
This method returns the catalog group identifier given the catalog group ID.
|
static java.util.Vector |
getChildCatgroupIdsByParentCatgroupId(java.lang.Long catgroupId,
java.util.Vector currentList)
This method returns all the child catalog groups in all levels of the given parent catalog group.
|
static java.lang.Integer |
getLanguageIdFromLocaleName(java.lang.String localeName)
The getLanguageIdFromLocaleName method takes the locale, and returns the relative language ID.
|
static java.lang.String |
getLocaleNameFromLanguageId(java.lang.String languageId)
The getLocaleNameFromLanguageId method takes the language ID, and returns the relative locale name.
|
static java.lang.String[] |
getPromotionByInitiativeId(java.lang.Integer initiativeId,
java.lang.Integer storeId)
This method gets the promotion usage, name and code that is associated with the given initiative.
|
static java.lang.String[] |
getPromotionByInitiativeRule(com.ibm.commerce.rule.Rule initiativeRule,
java.lang.Integer storeId)
This method gets the promotion usage, name and code that is associated with the given initiative rule.
|
static java.lang.Integer |
getPromotionIdByInitiativeRule(com.ibm.commerce.rule.Rule initiativeRule,
java.lang.Integer storeId)
This method parses an initiative rule and gets the ID of promotion if the displaying content of
the given initiative is a promotion.
|
static java.lang.Integer |
getStoreIdByIdentifier(java.lang.String storeIdentifier,
java.lang.String DN)
This method returns the store entity ID given the store identifier and member distinguish name.
|
static boolean |
isEmsEditable(java.lang.String storeType)
This method determines whether e-Marketing Spot is editable or not, given the current store type.
|
static boolean |
isItemsRelated(com.ibm.commerce.catalog.beans.CatalogEntryDataBean itemDataBean1,
com.ibm.commerce.catalog.beans.CatalogEntryDataBean itemDataBean2)
This method determines whether the two given items are related to the same product.
|
static boolean |
isItemsRelated(com.ibm.commerce.catalog.beans.ItemDataBean itemDataBean1,
com.ibm.commerce.catalog.beans.ItemDataBean itemDataBean2)
This method determines whether the two given items are related to the same product.
|
static boolean |
isProductItemRelated(com.ibm.commerce.catalog.beans.CatalogEntryDataBean productDataBean,
com.ibm.commerce.catalog.beans.CatalogEntryDataBean itemDataBean)
This method determines whether the given item belongs to the given product.
|
static boolean |
isProductItemRelated(com.ibm.commerce.catalog.beans.ProductDataBean productDataBean,
com.ibm.commerce.catalog.beans.ItemDataBean itemDataBean)
This method determines whether the given item belongs to the given product.
|
static boolean |
isPromotionAccessible(java.lang.String storeType)
This method determines whether campaign can access promotion or not, given the current store type.
|
static java.lang.String |
normalizeStringDate(java.lang.String stringDate)
The normalizeStringDate method takes the date in string format, and normalize it.
|
static java.lang.String |
stripBrackets(java.lang.String s)
The stripBrackets method takes the string, and removes its bracket wrapped around it.
|
static java.lang.String |
stripQuotes(java.lang.String s)
The stripQuotes method takes the string, and removes its quotes wrapped around it.
|
static java.lang.String |
stripSingleQuotes(java.lang.String s)
The stripSingleQuotes method takes the string, and removes its single quotes wrapped around it.
|
static java.lang.String |
substitute(java.lang.String message,
int arg1)
Substitutes message parameters with arguments.
|
static java.lang.String |
substitute(java.lang.String message,
int arg1,
int arg2)
Substitutes message parameters with arguments.
|
static java.lang.String |
substitute(java.lang.String message,
java.lang.Object[] arguments)
Substitutes message parameters with arguments.
|
static java.lang.String |
substitute(java.lang.String message,
java.lang.String arg1)
Substitutes message parameters with arguments.
|
static java.lang.String |
substitute(java.lang.String message,
java.lang.String arg1,
java.lang.String arg2)
Substitutes message parameters with arguments.
|
static java.math.BigDecimal |
toBigDecimal(java.lang.String value)
Converts a string value to BigDecimal.
|
static boolean |
toBoolean(java.lang.String value)
Converts a string value to boolean.
|
static java.lang.Integer |
toInteger(java.lang.String value)
Converts a string value to Ingeger.
|
static java.lang.Long |
toLong(java.lang.String value)
Converts a string value to Long.
|
static java.util.Vector |
toVector(java.lang.Object value)
Converts an object to a Vector.
|
public static final java.lang.String COPYRIGHT
public static java.lang.String[] getActivityViewByStoreType(java.lang.String storeType)
storeType
- A constant value that indicates the type of the store.public static java.lang.Integer getCalcodeIdByIdentifier(java.lang.String calcodeCode, java.lang.Integer calcodeUsage, java.lang.Integer storeId)
calcodeCode
- The string that identifies the calculation code.calcodeUsage
- The usage of the calculation code.storeId
- ID of the store which the calculation code belongs to.public static java.lang.Long[] getCatalogMemberIds(java.lang.Integer storeId)
storeId
- ID of the current store.public static java.lang.Long getCatentryIdByPartNumber(java.lang.String partNumber, java.lang.Integer storeId)
partNumber
- The part number of the catalog entry.storeId
- ID of the current store.public static java.lang.Long getCatentryIdByPartNumber(java.lang.String partNumber, java.lang.String DN)
partNumber
- The part number of the catalog entry.DN
- The distinguish name of the organization which owns the catalog entry.public static java.lang.Long getCatgroupIdByIdentifier(java.lang.String identifier, java.lang.Integer storeId)
identifier
- The identifier of the catalog group.storeId
- ID of the current store.public static java.lang.Long getCatgroupIdByIdentifier(java.lang.String identifier, java.lang.String DN)
identifier
- The identifier of the catalog group.DN
- The distinguish name of the organization which owns the catalog group.public static java.lang.String getCatgroupIdentifierById(java.lang.Long catgroupId)
catgroupId
- ID of the catalog group.public static java.util.Vector getChildCatgroupIdsByParentCatgroupId(java.lang.Long catgroupId, java.util.Vector currentList)
catgroupId
- ID of the parent catalog group.currentList
- List that holds the currently found child catalog groups.public static java.lang.Integer getLanguageIdFromLocaleName(java.lang.String localeName)
localeName
- The name of the locale.public static java.lang.String getLocaleNameFromLanguageId(java.lang.String languageId)
languageId
- The language ID.public static java.lang.String[] getPromotionByInitiativeId(java.lang.Integer initiativeId, java.lang.Integer storeId)
initiativeId
- ID of the initiative.storeId
- ID of the current store.public static java.lang.String[] getPromotionByInitiativeRule(com.ibm.commerce.rule.Rule initiativeRule, java.lang.Integer storeId)
initiativeRule
- Rule of the initiative.storeId
- ID of the current store.public static java.lang.Integer getPromotionIdByInitiativeRule(com.ibm.commerce.rule.Rule initiativeRule, java.lang.Integer storeId)
initiativeRule
- An instance of the initiative rule object.storeId
- ID of the current store.public static java.lang.Integer getStoreIdByIdentifier(java.lang.String storeIdentifier, java.lang.String DN)
storeIdentifier
- Identifier of the store.DN
- The distinguish name of the organization which owns the store.public static boolean isEmsEditable(java.lang.String storeType)
storeType
- A constant value that indicates the type of the store.public static boolean isItemsRelated(com.ibm.commerce.catalog.beans.CatalogEntryDataBean itemDataBean1, com.ibm.commerce.catalog.beans.CatalogEntryDataBean itemDataBean2)
itemDataBean1
- The first item to be evaluated, represented by CatalogEntryDataBean
.itemDataBean2
- The second item to be evaluated, represented by CatalogEntryDataBean
.public static boolean isItemsRelated(com.ibm.commerce.catalog.beans.ItemDataBean itemDataBean1, com.ibm.commerce.catalog.beans.ItemDataBean itemDataBean2)
itemDataBean1
- The first item to be evaluated, represented by ItemDataBean
.itemDataBean2
- The second item to be evaluated, represented by ItemDataBean
.public static boolean isProductItemRelated(com.ibm.commerce.catalog.beans.CatalogEntryDataBean productDataBean, com.ibm.commerce.catalog.beans.CatalogEntryDataBean itemDataBean)
productDataBean
- The product to be evaluated, represented by CatalogEntryDataBean
.itemDataBean
- The item to be evaluated, represented by CatalogEntryDataBean
.public static boolean isProductItemRelated(com.ibm.commerce.catalog.beans.ProductDataBean productDataBean, com.ibm.commerce.catalog.beans.ItemDataBean itemDataBean)
productDataBean
- The product to be evaluated, represented by ProductDataBean
.itemDataBean
- The item to be evaluated, represented by ItemDataBean
.public static boolean isPromotionAccessible(java.lang.String storeType)
storeType
- A constant value that indicates the type of the store.public static java.lang.String normalizeStringDate(java.lang.String stringDate)
stringDate
- The date string.public static java.lang.String stripBrackets(java.lang.String s)
s
- The string with brackets.public static java.lang.String stripQuotes(java.lang.String s)
s
- The string with quotes.public static java.lang.String stripSingleQuotes(java.lang.String s)
s
- The string with single quotes.public static java.lang.String substitute(java.lang.String message, int arg1)
message
- A text message with imbedded parameters.arg1
- An argument.public static java.lang.String substitute(java.lang.String message, int arg1, int arg2)
message
- A text message with imbedded parameters.arg1
- An argument.arg2
- An argument.public static java.lang.String substitute(java.lang.String message, java.lang.Object[] arguments)
message
- A text message with imbedded parameters.arguments
- An array of arguments.public static java.lang.String substitute(java.lang.String message, java.lang.String arg1)
message
- A text message with imbedded parameters.arg1
- An argument.public static java.lang.String substitute(java.lang.String message, java.lang.String arg1, java.lang.String arg2)
message
- A text message with imbedded parameters.arg1
- An argument.arg2
- An argument.public static java.math.BigDecimal toBigDecimal(java.lang.String value)
null
.public static boolean toBoolean(java.lang.String value)
true
if the string is "true"
.public static java.lang.Integer toInteger(java.lang.String value)
null
.public static java.lang.Long toLong(java.lang.String value)
null
.public static java.util.Vector toVector(java.lang.Object value)
null
.