| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectatg.nucleus.logging.VariableArgumentApplicationLoggingImpl
atg.nucleus.GenericService
atg.commerce.catalog.CatalogTools
public class CatalogTools
This class represents a series of helper methods and properties that are used in the management of accessing the product catalog.
 One can configure this component to define a mapping from a key to a set of alternate
 catalogs.  This is particularly useful for internationalization.  
 For example: CatalogTools.properties
 
 $class=atg.commerce.catalog.CatalogTools
 catalog=ProductCatalog
 baseProductItemType=product
 baseCategoryItemType=category
 baseSKUItemType=sku
 baseMediaItemType=media
 productItemTypes=product
 categoryItemTypes=category
 SKUItemTypes=sku
 alternateCatalogs=\
      en_US=/atg/commerce/catalog/ProductCatalog
      fr_FR=/atg/commerce/catalog/FrenchProductCatalog
      ja_JP=/atg/commerce/catalog/JapaneseProductCatalog
      de_DE=/atg/commerce/catalog/GermanProductCatalog
 
 useDefaultCatalog=true
 
 
 The behavior of the findProduct(), findCategory(), and findSku() methods can be
 modified with use of the useDefaultCatalog property. If
 useDefaultCatalog is false and an alternate catalog repository cannot be found
 that matches the pCatalogKey parameter, then no repository is searched and null will
 be returned.
| Field Summary | |
|---|---|
| static java.lang.String | CLASS_VERSIONClass version string | 
| static java.lang.String | DEFAULT_CATEGORY_ITEM_TYPEThe name of the item descriptor which represents the base definition of all categories | 
| static java.lang.String | DEFAULT_PRODUCT_ITEM_TYPEThe name of the item descriptor which represents the base definition of all products | 
| static java.lang.String | DEFAULT_SKU_ITEM_TYPEThe name of the item descriptor which represents the base definition of all SKUs | 
| Fields inherited from class atg.nucleus.GenericService | 
|---|
| SERVICE_INFO_KEY | 
| Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging | 
|---|
| DEFAULT_LOG_TRACE_STATUS | 
| Fields inherited from interface atg.nucleus.logging.ApplicationLogging | 
|---|
| DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS | 
| Constructor Summary | |
|---|---|
| CatalogTools()Constructs an instanceof CatalogTools | |
| Method Summary | |
|---|---|
|  void | doStartService()This is called after a Service has been created, placed into the naming hierarchy, and initialized with its configured property values. | 
|  Repository | findCatalog(java.lang.String pCatalogKey)Finds the catalog in the alternateCatalogs that is identified by catalogKey. | 
|  RepositoryItem[] | findCategories(java.lang.String[] pIds)With the given id return an object which represents the category | 
|  RepositoryItem[] | findCategories(java.lang.String[] pIds,
               java.lang.String pCatalogKey)With the given id return an object which represents the category | 
|  RepositoryItem | findCategory(java.lang.String pId)With the given id return an object which represents the category | 
|  RepositoryItem | findCategory(java.lang.String pId,
             java.lang.String pCatalogKey)With the given id return an object which represents the category | 
|  RepositoryItem | findProduct(java.lang.String pId)With the given id return an object which represents the product | 
|  RepositoryItem | findProduct(java.lang.String pId,
            java.lang.String pCatalogKey)With the given id return an object which represents the product | 
|  RepositoryItem[] | findProducts(java.lang.String[] pIds)With the given id return an object which represents the product | 
|  RepositoryItem[] | findProducts(java.lang.String[] pIds,
             java.lang.String pCatalogKey)With the given id return an object which represents the product | 
|  RepositoryItem | findSKU(java.lang.String pId)With the given id return an object which represents the sku | 
|  RepositoryItem | findSKU(java.lang.String pId,
        java.lang.String pCatalogKey)With the given id return an object which represents the sku | 
|  RepositoryItem[] | findSKUs(java.lang.String[] pIds)With the given ids return an array of objects which represent the skus | 
|  RepositoryItem[] | findSKUs(java.lang.String[] pIds,
         java.lang.String pCatalogKey)With the given ids return an array of objects which represent the skus | 
|  ServiceMap | getAlternateCatalogs()Returns property AlternateCatalogs | 
|  java.util.LinkedList | getAncestors(RepositoryItem pItem)This method gets the parentCategory property of the repository item passed in, and gets the parentCategory's parentCategory and so forth until there is no more parent. | 
|  java.lang.String | getBaseCategoryItemType()Returns property BaseCategoryItemType | 
|  java.lang.String | getBaseMediaItemType()Returns property baseMediaItemType | 
|  java.lang.String | getBaseProductItemType()Returns property BaseProductItemType | 
|  java.lang.String | getBaseSKUItemType()Returns property BaseSKUItemType | 
|  DynamicBeanInfo | getBeanInfo(java.lang.String pJMSType,
            java.lang.Class pMessageClass)Returns the DynamicBeanInfo associated with a JMS message type and optional message object class. | 
|  Repository | getCatalog()Returns property Catalog | 
|  java.lang.String | getCatalogServiceLockName()Returns property CatalogServiceLockName | 
|  long | getCatalogServiceLockTimeOut()Get the maximum time we wait for a lock, in milliseconds. | 
|  java.util.Map | getCategoryBeanInfos()Returns property CategoryBeanInfos | 
|  java.lang.String[] | getCategoryItemTypes()Returns property CategoryItemTypes | 
|  java.lang.String | getOnlineOnlyPropertyName() | 
|  java.lang.String | getParentCategoryPropertyName()Return the parentCategoryPropertyName property. | 
|  java.util.Map | getProductBeanInfos()Returns property ProductBeanInfos | 
|  java.lang.String[] | getProductItemTypes()Returns property ProductItemTypes | 
|  java.util.Map | getSKUBeanInfos()Returns property SKUBeanInfos | 
|  java.lang.String[] | getSKUItemTypes()Returns property SKUItemTypes | 
|  CatalogTypeInfo | getTypeInfo()Return a serializable instance of CatalogTypeInfo that summarizes metadata usable in a client context | 
|  boolean | isCategory(java.lang.Object pObj)Determines if the object provided is a category repository item | 
| protected  boolean | isItemType(java.lang.Object pObj,
           java.lang.String pItemType)Determines if the given object is an instance of the given catalog repository item-descriptor. | 
|  boolean | isOnlineOnly(java.util.Collection<RepositoryItem> pItems)Determines whether are not the provided items are only available online | 
|  boolean | isOnlineOnly(RepositoryItem pProduct,
             RepositoryItem pSku)Determines whether or not the provided sku/product combo is only available online | 
|  boolean | isProduct(java.lang.Object pObj)Determines if the object provided is a product repository item | 
|  boolean | isSku(java.lang.Object pObj)Determines if the object provided is a SKU repository item | 
|  boolean | isUseDefaultCatalog()Returns property useDefaultCatalog | 
|  void | setAlternateCatalogs(ServiceMap pAlternateCatalogs)Sets property AlternateCatalogs | 
|  void | setBaseCategoryItemType(java.lang.String pBaseCategoryItemType)Sets property BaseCategoryItemType | 
|  void | setBaseMediaItemType(java.lang.String pBaseMediaItemType) | 
|  void | setBaseProductItemType(java.lang.String pBaseProductItemType)Sets property BaseProductItemType | 
|  void | setBaseSKUItemType(java.lang.String pBaseSKUItemType)Sets property BaseSKUItemType | 
|  void | setCatalog(Repository pCatalog)Sets property Catalog | 
|  void | setCatalogServiceLockName(java.lang.String pCatalogServiceLockName) | 
|  void | setCatalogServiceLockTimeOut(long pCatalogServiceLockTimeOut)Set the maximum time we wait for a lock, in milliseconds. | 
|  void | setCategoryItemTypes(java.lang.String[] pCategoryItemTypes)Sets property CategoryItemTypes | 
|  void | setOnlineOnlyPropertyName(java.lang.String pOnlineOnlyPropertyName) | 
|  void | setParentCategoryPropertyName(java.lang.String pParentCategoryPropertyName)Set the parentCategoryPropertyName property. | 
|  void | setProductItemTypes(java.lang.String[] pProductItemTypes)Set property ProductItemTypes | 
|  void | setSKUItemTypes(java.lang.String[] pSKUItemTypes)Sets property SKUItemTypes | 
|  void | setUseDefaultCatalog(boolean pUseDefaultCatalog)Sets property useDefaultCatalog. | 
| Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl | 
|---|
| vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
public static java.lang.String CLASS_VERSION
public static final java.lang.String DEFAULT_PRODUCT_ITEM_TYPE
public static final java.lang.String DEFAULT_CATEGORY_ITEM_TYPE
public static final java.lang.String DEFAULT_SKU_ITEM_TYPE
| Constructor Detail | 
|---|
public CatalogTools()
| Method Detail | 
|---|
public CatalogTypeInfo getTypeInfo()
public void setCatalogServiceLockName(java.lang.String pCatalogServiceLockName)
public java.lang.String getCatalogServiceLockName()
public void setCatalogServiceLockTimeOut(long pCatalogServiceLockTimeOut)
public long getCatalogServiceLockTimeOut()
public void setBaseProductItemType(java.lang.String pBaseProductItemType)
public java.lang.String getBaseProductItemType()
public void setParentCategoryPropertyName(java.lang.String pParentCategoryPropertyName)
public java.lang.String getParentCategoryPropertyName()
public java.lang.String getOnlineOnlyPropertyName()
public void setOnlineOnlyPropertyName(java.lang.String pOnlineOnlyPropertyName)
pOnlineOnlyPropertyName - the onlineOnlyPropertyName to setpublic void setProductItemTypes(java.lang.String[] pProductItemTypes)
public java.lang.String[] getProductItemTypes()
public java.util.Map getProductBeanInfos()
public void setBaseCategoryItemType(java.lang.String pBaseCategoryItemType)
public java.lang.String getBaseCategoryItemType()
public void setCategoryItemTypes(java.lang.String[] pCategoryItemTypes)
public java.lang.String[] getCategoryItemTypes()
public java.util.Map getCategoryBeanInfos()
public void setBaseSKUItemType(java.lang.String pBaseSKUItemType)
public java.lang.String getBaseSKUItemType()
public void setSKUItemTypes(java.lang.String[] pSKUItemTypes)
public java.lang.String[] getSKUItemTypes()
public java.util.Map getSKUBeanInfos()
public void setCatalog(Repository pCatalog)
public Repository getCatalog()
public void setAlternateCatalogs(ServiceMap pAlternateCatalogs)
public ServiceMap getAlternateCatalogs()
public void setUseDefaultCatalog(boolean pUseDefaultCatalog)
public boolean isUseDefaultCatalog()
public void setBaseMediaItemType(java.lang.String pBaseMediaItemType)
public java.lang.String getBaseMediaItemType()
public void doStartService()
                    throws ServiceException
GenericService
doStartService in class GenericServiceServiceException - if the Service had a problem starting up
public boolean isSku(java.lang.Object pObj)
              throws RepositoryException
RepositoryException
public boolean isProduct(java.lang.Object pObj)
                  throws RepositoryException
RepositoryException
public boolean isCategory(java.lang.Object pObj)
                   throws RepositoryException
RepositoryException
protected boolean isItemType(java.lang.Object pObj,
                             java.lang.String pItemType)
                      throws RepositoryException
pObj - The object to test.pItemType - The name of the item descriptor to test against.
RepositoryException - If an error occurs getting the item-descriptor associated with the given item type.
public boolean isOnlineOnly(RepositoryItem pProduct,
                            RepositoryItem pSku)
                     throws RepositoryException
pProduct - The productpSku - The sku
RepositoryException
public boolean isOnlineOnly(java.util.Collection<RepositoryItem> pItems)
                     throws RepositoryException
pItems - The items
RepositoryExceptionpublic Repository findCatalog(java.lang.String pCatalogKey)
public java.util.LinkedList getAncestors(RepositoryItem pItem)
pItem - The product or category item to get the ancestry from.
PropertyNotFoundException - If the given item does not have a parentCategoryPropertyName property.
public RepositoryItem findCategory(java.lang.String pId,
                                   java.lang.String pCatalogKey)
                            throws RepositoryException
RepositoryException - if there was an error attempting to find the item
public RepositoryItem findCategory(java.lang.String pId)
                            throws RepositoryException
RepositoryException - if there was an error attempting to find the item
public RepositoryItem[] findCategories(java.lang.String[] pIds,
                                       java.lang.String pCatalogKey)
                                throws RepositoryException
RepositoryException - if there was an error attempting to find the item
public RepositoryItem[] findCategories(java.lang.String[] pIds)
                                throws RepositoryException
RepositoryException - if there was an error attempting to find the item
public RepositoryItem findProduct(java.lang.String pId,
                                  java.lang.String pCatalogKey)
                           throws RepositoryException
RepositoryException - if there was an error attempting to find the item
public RepositoryItem findProduct(java.lang.String pId)
                           throws RepositoryException
RepositoryException - if there was an error attempting to find the item
public RepositoryItem[] findProducts(java.lang.String[] pIds,
                                     java.lang.String pCatalogKey)
                              throws RepositoryException
RepositoryException - if there was an error attempting to find the item
public RepositoryItem[] findProducts(java.lang.String[] pIds)
                              throws RepositoryException
RepositoryException - if there was an error attempting to find the item
public RepositoryItem findSKU(java.lang.String pId,
                              java.lang.String pCatalogKey)
                       throws RepositoryException
RepositoryException - if there was an error attempting to find the item
public RepositoryItem findSKU(java.lang.String pId)
                       throws RepositoryException
RepositoryException - if there was an error attempting to find the item
public RepositoryItem[] findSKUs(java.lang.String[] pIds,
                                 java.lang.String pCatalogKey)
                          throws RepositoryException
RepositoryException - if there was an error attempting to find the items
public RepositoryItem[] findSKUs(java.lang.String[] pIds)
                          throws RepositoryException
RepositoryException - if there was an error attempting to find the items
public DynamicBeanInfo getBeanInfo(java.lang.String pJMSType,
                                   java.lang.Class pMessageClass)
getBeanInfo in interface MessageTyperpJMSType - the JMS message type, which is requiredpMessageClass - an optional class which will be used at
 runtime for an object message.| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||