public class TagUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COPYRIGHT
IBM copyright notice field.
|
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
findCategoryId(java.lang.Long catEntryId,
javax.servlet.http.HttpServletRequest request,
CommandContext ctx)
Returns the categoryId associated with a product.
|
static java.lang.String |
generateDelimiters(int delimCount)
Generate the Delimiter '-_-' for the extraParams in the cmCreateOrderTag and cmCreateShopAction9Tag
|
static AddressAccessBean |
getAddressObject(java.lang.Long userId)
Returns the AddressAccessBean that corresponds to the user
|
static java.lang.String |
getCampaignNameForEmailPromotion(java.lang.String emailPromotionId)
Returns the email campaign name using marketing services
|
static java.util.LinkedList |
getCatalogHierarchy(CommandContext cc,
java.lang.Long catEntryId)
Given a catalog entry ID, this method traverses up the catalog tree searching for all of the entry's parent
categories.
|
static java.lang.Long |
getCategoryID(CommandContext cc,
java.lang.Long catEntryId)
Given a catalog entry ID, this method traverses up the catalog tree searching for the entry's parent
category.
|
static java.util.ArrayList<java.lang.Long> |
getCategoryIDs(CommandContext cc,
java.lang.Long catEntryId)
Returns a list of categoryIds to which the catentry is associated in a catalog
|
static java.util.ArrayList |
getContentNameList(java.lang.String emsName,
java.lang.String storeId,
java.lang.String catalogId)
Return the content name list of the activities scheduled in the eMarketingSpot
|
static java.lang.String |
getEmailCampaignName(java.lang.String emailPromoId)
This method returns the campaign name for the Email activity
|
static java.lang.String |
getEmailPromoName(java.lang.String emailPromotionId)
This method returns the emailPromo Name
|
static java.lang.String |
getEmailPromotionName(java.lang.String emailPromotionId)
Returns the email promotion name using marketing services
|
static java.lang.String |
getEmailTemplateName(java.lang.String emailPromotionId)
This method returns the email template name
|
static MarketingSpotDataType |
getMarketingSpotData(java.lang.String emsName,
java.lang.String storeId,
java.lang.String catalogId)
Returns the MarketingSpotDataType object from the emarketing spot name using the
marketing runtime services
|
static java.lang.Long |
getMasterCategoryId(CommandContext cc,
java.lang.Long catEntryId)
Return the master category id of the catalog entry based on the master catalog of the store
A product could belong to a master catalog and different sales catalogs.
|
static java.util.LinkedList |
getOrganizationHierarchy(CommandContext cc,
java.lang.Long accountId)
Given a organization member ID, this method traverses up the organization tree to produce
a list of all of the entry's ancestors.
|
static java.math.BigDecimal |
getTaxComponent(CatalogEntryDataBean catentryDB,
CommandContext ctx)
Retrieves the tax amount applicable for the input catalog entry
|
static boolean |
isEmpty(java.lang.String string)
Checks whether the input string is null or is blank
|
static boolean |
isUncle(CommandContext cc,
java.lang.Long catEntryId)
Given a catalog entry ID, this method traverses up the catalog tree one level to see whether or not a product is
an uncle.
|
static java.lang.Long |
min(java.lang.Long x,
java.lang.Long y)
Given two numbers, return the smallest
|
static java.lang.String[] |
parseParms(java.lang.String parms,
java.lang.Object obj)
Given a comma-separated list of parameters, this method splits it up and returns and array of parameters.
|
static java.util.Vector |
processPackage(java.util.Map params,
boolean fromCart)
Iterates over the items in the kit and returns a vector that contain details about
items in the kit.
|
static java.lang.String |
runMethod(java.lang.Object obj,
java.lang.String methodName)
Convenience method to run any other method in a given object.
|
static java.lang.String |
stringListToDelimitedString(java.util.List list,
java.lang.String delimiter)
Given a
List of String objects, return a single
String with all the elements separated by the delimiter. |
public static final java.lang.String COPYRIGHT
public static java.util.LinkedList getCatalogHierarchy(CommandContext cc, java.lang.Long catEntryId)
cc
- CommandContext
of the current requestcatEntryId
- catalog entry ID of the productString
description names of the category hierarchy of the product. The list
starts with the top category and ends with the subcategory that is the direct parent the product. For example,
the list for a White, Comfy Couch would be Living Room->Furniture->Couchespublic static java.lang.Long getCategoryID(CommandContext cc, java.lang.Long catEntryId)
cc
- CommandContext
of the current requestcatEntryId
- catalog entry ID of the productpublic static java.util.ArrayList<java.lang.Long> getCategoryIDs(CommandContext cc, java.lang.Long catEntryId)
cc
- The command context objectcatEntryId
- The catalog entry Idpublic static boolean isUncle(CommandContext cc, java.lang.Long catEntryId)
a / \ b c / \ d eproduct b is an uncle, but product d and e are not.
cc
- CommandContext
of the current requestcatEntryId
- catalog entry ID of the productpublic static java.util.LinkedList getOrganizationHierarchy(CommandContext cc, java.lang.Long accountId)
cc
- CommandContext
of the current requestaccountId
- account ID of the contractString
description names of the organization hierarchy of the product. The list
starts with the organization directly beneath "Root Organization" and ends with the organization given.public static java.lang.Long getMasterCategoryId(CommandContext cc, java.lang.Long catEntryId)
Catalog Type(Catalog ID) | Category Name(Category ID) |
Master Catalog(10101) | Coffee Makers(10125) |
Sales Catalog(10151) | Coffee and Espresso Makers(10128) |
cc
- CommandContext
of the current requestcatEntryId
- catalog entry ID of the productpublic static java.lang.Long min(java.lang.Long x, java.lang.Long y)
x
- First number valuey
- Second number valuex
or y
public static java.lang.String stringListToDelimitedString(java.util.List list, java.lang.String delimiter)
List
of String
objects, return a single
String
with all the elements separated by the delimiter. Useful in combination
with getCatalogHierarchy
.list
- ordered or unordered List
of Stringsdelimiter
- string used to split up elements in the listString
in the format "listElement1<delimiter>listElement2<delimiter>...<delimiter>listElementN"public static java.lang.String runMethod(java.lang.Object obj, java.lang.String methodName)
obj
- the object to execute the method onmethodName
- the method to execute. This method must take no arguments and the parentheses dropped. For example,
use "getValue
", not "getValue()
".toString()
on the result of the method callpublic static java.lang.String getEmailPromoName(java.lang.String emailPromotionId)
emailPromotionId
- The email activity id
of the Email Activitypublic static java.lang.String getEmailTemplateName(java.lang.String emailPromotionId)
emailPromotionId
- The email activity id
of the Email Activitypublic static java.lang.String getEmailCampaignName(java.lang.String emailPromoId)
emailPromoId
- The email activity id
of the Email Activitypublic static java.lang.String[] parseParms(java.lang.String parms, java.lang.Object obj)
obj
. The toString()
method will be called on this result and returned as part of the parameter list.parms
- comma-separated list of parametersobj
- the object to execute methods delimited by $ on. If null
, delimited $ strings will be ignored and returned without modification.String
with each literal and dynamic parameterspublic static MarketingSpotDataType getMarketingSpotData(java.lang.String emsName, java.lang.String storeId, java.lang.String catalogId) throws java.lang.Exception
emsName
- The eMarketing spot namestoreId
- The store identifiercatalogId
- The catalog identifierjava.lang.Exception
public static java.lang.String getEmailPromotionName(java.lang.String emailPromotionId) throws java.lang.Exception
emailPromotionId
- The email promotion Idjava.lang.Exception
public static java.lang.String getCampaignNameForEmailPromotion(java.lang.String emailPromotionId) throws java.lang.Exception
emailPromotionId
- The email promotion Idjava.lang.Exception
public static java.util.ArrayList getContentNameList(java.lang.String emsName, java.lang.String storeId, java.lang.String catalogId) throws java.lang.Exception
emsName
- The eMarketingSpotNamestoreId
- The store identifiercatalogId
- The catalog identifierjava.lang.Exception
public static java.lang.String findCategoryId(java.lang.Long catEntryId, javax.servlet.http.HttpServletRequest request, CommandContext ctx)
catEntryId
- The catalog entry Id of the productrequest
- The HttpServletRequest
object associated with the requestctx
- The CommandContext
associated with the requestpublic static java.math.BigDecimal getTaxComponent(CatalogEntryDataBean catentryDB, CommandContext ctx) throws java.lang.Exception
catentryDB
- The catalog entry databean whose tax details need to be retrievedctx
- The command context instancejava.lang.Exception
- on any Exceptionpublic static java.lang.String generateDelimiters(int delimCount)
delimCount
- number of delimiters to be addedpublic static boolean isEmpty(java.lang.String string)
string
- The input stringpublic static java.util.Vector processPackage(java.util.Map params, boolean fromCart) throws java.lang.Exception
params
- A set of parameters used to process the kitfromCart
- Whether the function has been invoked from the shopping cart pagejava.lang.Exception
public static AddressAccessBean getAddressObject(java.lang.Long userId)
userId
- The user identifier of the user whose address needs to be
located