atg.projects.store.catalog
Class StoreCatalogTools

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.commerce.catalog.CatalogTools
              extended by atg.commerce.catalog.custom.CustomCatalogTools
                  extended by atg.projects.store.catalog.StoreCatalogTools
All Implemented Interfaces:
atg.commerce.catalog.CMSConstants, atg.dms.registry.MessageTyper, atg.naming.NameContextBindingListener, atg.naming.NameContextElement, atg.naming.NameResolver, atg.nucleus.AdminableService, atg.nucleus.logging.ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, atg.nucleus.logging.VariableArgumentApplicationLogging, atg.nucleus.naming.ComponentNameResolver, atg.nucleus.Service, atg.nucleus.ServiceListener, java.util.EventListener
Direct Known Subclasses:
InternationalizedStoreCatalogTools

public class StoreCatalogTools
extends atg.commerce.catalog.custom.CustomCatalogTools

The extensions to ootb CatalogTools. At the time of its writing, all it contained were the ids of the Store catalog and the corresponding repository items.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string.
 
Fields inherited from class atg.commerce.catalog.CatalogTools
DEFAULT_CATEGORY_ITEM_TYPE, DEFAULT_PRODUCT_ITEM_TYPE, DEFAULT_SKU_ITEM_TYPE
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.commerce.catalog.CMSConstants
AGS_GENANCESTORS, AGS_GENANCESTORS_FOR_CATEGORY, AGS_GENANCESTORS_FOR_PRODUCT, AGS_GENCATALOGS, AGS_GENCATALOGS_FOR_CATEGORY, AGS_GENCATALOGS_FOR_PRODUCT, AGS_GENCATALOGS_FOR_SKU, AGS_GENPARENTCATS, AGS_GENPROPERTIES, AGS_GENPROPERTIES_FOR_CATEGORY, AGS_GENPROPERTIES_FOR_PRODUCT, ANCESTORS_GENERATED, CATALOGS_UPDATED, CATALOGS_VERIFIED, CATEGORIES_VERIFIED, CUS_INVALID_PARENT_BRANCH, CUS_NAME_ALREADY_IN_USE, CUS_UNABLE_TO_GET_WS, CUS_UPDATECATALOGS, CUS_USING_CHECKED_IN_WS, CUS_VM_NOT_SET, CUS_WS_NOT_CREATED, CUS_WS_NOT_CREATED_INVALID_PARENT_BRANCH, CUS_WS_REQUIRED, CVS_VERIFYCATALOGS, CVS_VERIFYCATEGORIES, CVS_VERIFYPRODUCTS, CVS_VERIFYSKUS, DEFAULT_CATALOG_FOLDER_ITEM_TYPE, DEFAULT_CATALOG_ITEM_TYPE, DEFAULT_MAP_SIZE, GENERATED_ANCESTORS_MAP, INFOS_GENERATED, IS_ANCESTORS_GENERATED_MAP, LEVEL_DEBUG, LEVEL_ERROR, LEVEL_INFO, LEVEL_WARNING, MY_RESOURCE_NAME, NO_PATH, NOT_GENERATOR, sResourceBundle, TYPE_ANCESTOR, TYPE_CATALOGMAINTENANCE, TYPE_CUSTOM_MIGRATION, TYPE_MIGRATION, TYPE_UPDATE, TYPE_VERIFY, VALID_PATH
 
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
StoreCatalogTools()
           
 
Method Summary
 atg.repository.RepositoryItem findSku(java.util.Collection pSkus, java.lang.String pWoodFinish)
          Finds the sku with the matching wood finish.
 atg.repository.RepositoryItem findSku(java.util.Collection pSkus, java.lang.String pColor, java.lang.String pSize)
          Finds the sku with the matching color and size.
 atg.repository.RepositoryItem getCatalog(java.lang.String pCatalogId)
          Get the catalog with the given id.
 java.util.List getPossibleColors(java.util.Collection pSkus)
          Returns a list of possible colors for a collection of skus.
 java.util.Map getPossibleColorSwatches(java.util.Collection pSkus)
          Creates a map of color names to swatch items.
 java.util.List getPossibleSizes(java.util.Collection pSkus)
          Returns the list of possible sizes for a given collection of skus.
 java.util.List getPossibleValuesForSkus(java.util.Collection pSkus, java.lang.String pPropertyName)
          Returns the list of possible values for a given collection of skus.
 java.util.Map<java.lang.String,atg.repository.RepositoryItem> getPossibleWoodColorSwatches(java.util.Collection<atg.repository.RepositoryItem> pSkus)
          Creates a map of possible color swatches mapped by SKU's woodFinish Valid for furniture-sku only!
 java.util.Collection getProductChildSkus(atg.repository.RepositoryItem pProduct)
          Returns a product's child skus.
 java.util.Map getPropertyToFilterMap()
          Getter-method for propertyToFilterMap field.
 java.util.LinkedHashMap getPropertyToLabelMap()
          Getter-method for propertyToLabelMap field.
 java.lang.String getRootNavigationCategoryId()
           
 java.lang.String[] getSizeSortOrder()
           
 java.util.List<java.lang.String> getSortedSizes(java.util.Collection<atg.repository.RepositoryItem> pSkus)
          Obtains a list of sizes used by SKUs specified.
 void setPropertyToFilterMap(java.util.Map pPropertyToFilterMap)
          Setter-method for propertyToFilterMap field.
 void setPropertyToLabelMap(java.util.LinkedHashMap pPropertyToLabelMap)
          Setter-method for propertyToLabelMap field.
 void setRootNavigationCategoryId(java.lang.String pRootNavigationCategoryId)
           
 void setSizeSortOrder(java.lang.String[] pSizeSortOrder)
           
 java.util.List sortColors(java.util.List pColors)
          Sorts a list of colors.
 java.util.List sortSizes(java.util.List pSizes)
          Sorts sizes accoring to the configured template.
 java.util.List sortStrings(java.util.List pStrings, java.lang.String[] pSortOrder)
          Sorts the collection of strings relative to their ordinal position in the sort order array.
 java.util.List sortWoodFinishes(java.util.List pWoodFinishes)
          Sorts a list of wood finishes.
 
Methods inherited from class atg.commerce.catalog.custom.CustomCatalogTools
computeRecursedRootSubCatalogs, determineCatalog, determineCatalog, doStartService, filterCollectionByCatalog, filterCollectionByCatalogs, findCatalogItem, findCatalogItem, findCatalogItems, findCatalogItems, findCategories, findCategories, findCategories, findCategories, findCategory, findCategory, findCategory, findCategory, findProduct, findProduct, findProduct, findProduct, findProducts, findProducts, findProducts, findProducts, findSKU, findSKU, findSKU, findSKU, findSKUs, findSKUs, findSKUs, findSKUs, getAllAncestorCategories, getAncestors, getAncestors, getBaseCatalogFolderItemType, getBaseCatalogItemType, getCatalogBeanInfos, getCatalogFolderBeanInfos, getCatalogFolderItemTypes, getCatalogForSite, getCatalogForSite, getCatalogItemTypes, getCatalogProperties, getCatalogQueryBuilder, getCatalogs, getCatalogsContainingThisCatalog, getCatalogsForRepository, getCatalogsProperty, getCatalogsThatIncludeCatalogInRootSubCatalogs, getCatalogsWithCategoryAsRoot, getCategoriesContainingThisCatalog, getCategoriesContainingThisCategorysCatalog, getCategoriesInCatalog, getCategoriesWithCatalogAsSubCatalog, getCategoriesWithIndirectPathToCatalog, getCategoriesWithIndirectPathToCategory, getCategorysInfoMapProperty, getCommerceSitePropertiesManager, getContextValueRetriever, getCurrentCatalog, getDefaultCatalog, getDefaultCatalogId, getEnclosingCatalogsForCategory, getKeyFromCatalog, getParentCategories, getParentCategory, getProductsCategories, getProductsInfoMapProperty, getProfileCatalogPropertyName, getRootCategoriesForCatalog, getSkusInfoMapProperty, getStatePropertyName, getTrackState, getTransactionManager, isCatalog, isCatalogFolder, isCategoryReferenced, isReturnEmptyResults, isSaveCachedAncestors, isVerifyCatalog, removeQuerySiteConstraints, setBaseCatalogFolderItemType, setBaseCatalogItemType, setCatalogFolderItemTypes, setCatalogItemTypes, setCatalogProperties, setCatalogsProperty, setCategorysInfoMapProperty, setCommerceSitePropertiesManager, setContextValueRetriever, setDefaultCatalog, setDefaultCatalogId, setProductsInfoMapProperty, setProfileCatalogPropertyName, setReturnEmptyResults, setSaveCachedAncestors, setSkusInfoMapProperty, setState, setState, setStatePropertyName, setTrackState, setTransactionManager, setVerifyCatalog, verifyCatalog, verifyCatalog, walkUpCategoryTree
 
Methods inherited from class atg.commerce.catalog.CatalogTools
findCatalog, getAlternateCatalogs, getBaseCategoryItemType, getBaseMediaItemType, getBaseProductItemType, getBaseSKUItemType, getBeanInfo, getCatalog, getCatalogServiceLockName, getCatalogServiceLockTimeOut, getCategoryBeanInfos, getCategoryItemTypes, getParentCategoryPropertyName, getProductBeanInfos, getProductItemTypes, getSKUBeanInfos, getSKUItemTypes, getTypeInfo, isCategory, isItemType, isProduct, isUseDefaultCatalog, setAlternateCatalogs, setBaseCategoryItemType, setBaseMediaItemType, setBaseProductItemType, setBaseSKUItemType, setCatalog, setCatalogServiceLockName, setCatalogServiceLockTimeOut, setCategoryItemTypes, setParentCategoryPropertyName, setProductItemTypes, setSKUItemTypes, setUseDefaultCatalog
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStopService, getAbsoluteName, getAdminServlet, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, 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

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string.

Constructor Detail

StoreCatalogTools

public StoreCatalogTools()
Method Detail

setPropertyToLabelMap

public void setPropertyToLabelMap(java.util.LinkedHashMap pPropertyToLabelMap)
Setter-method for propertyToLabelMap field.

Parameters:
pPropertyToLabelMap - Map containing Property-to-Label pairs

getPropertyToLabelMap

public java.util.LinkedHashMap getPropertyToLabelMap()
Getter-method for propertyToLabelMap field.

Returns:
pPropertyToLabelMap Map containing Property-to-Label pairs

setPropertyToFilterMap

public void setPropertyToFilterMap(java.util.Map pPropertyToFilterMap)
Setter-method for propertyToFilterMap field.

Parameters:
pPropertyToLabelMap - Map containing Property-to-Filter pairs

getPropertyToFilterMap

public java.util.Map getPropertyToFilterMap()
Getter-method for propertyToFilterMap field.

Parameters:
pPropertyToLabelMap - Map containing Property-to-Filter pairs

getRootNavigationCategoryId

public java.lang.String getRootNavigationCategoryId()
Returns:
RootNavigationCategoryId.

setRootNavigationCategoryId

public void setRootNavigationCategoryId(java.lang.String pRootNavigationCategoryId)
Parameters:
pRootNavigationCategoryId - - new RootNavigationCategoryId.

getSizeSortOrder

public java.lang.String[] getSizeSortOrder()
Returns:
Returns the SizeSortOrder used for displaying sizes.

setSizeSortOrder

public void setSizeSortOrder(java.lang.String[] pSizeSortOrder)
Parameters:
pSizeSortOrder - The SizeSortOrder used for displaying sizes.

getCatalog

public atg.repository.RepositoryItem getCatalog(java.lang.String pCatalogId)
                                         throws atg.repository.RepositoryException
Get the catalog with the given id.

Parameters:
pCatalogId - - catalog id
Returns:
the catalog with the given id
Throws:
atg.repository.RepositoryException - if error occurs

getPossibleColors

public java.util.List getPossibleColors(java.util.Collection pSkus)
Returns a list of possible colors for a collection of skus.

Parameters:
pSkus - collection of skus
Returns:
a list of possible colors

getPossibleColorSwatches

public java.util.Map getPossibleColorSwatches(java.util.Collection pSkus)
Creates a map of color names to swatch items.

Parameters:
pSkus - - sku collection
Returns:
Map of color names to swatch media items

getPossibleWoodColorSwatches

public java.util.Map<java.lang.String,atg.repository.RepositoryItem> getPossibleWoodColorSwatches(java.util.Collection<atg.repository.RepositoryItem> pSkus)
Creates a map of possible color swatches mapped by SKU's woodFinish Valid for furniture-sku only!

Parameters:
pSkus -
Returns:

getPossibleSizes

public java.util.List getPossibleSizes(java.util.Collection pSkus)
Returns the list of possible sizes for a given collection of skus.

Parameters:
pSkus - collection of skus
Returns:
list of colors

getSortedSizes

public java.util.List<java.lang.String> getSortedSizes(java.util.Collection<atg.repository.RepositoryItem> pSkus)
Obtains a list of sizes used by SKUs specified. This list will be sorted in correspondence to the getSizeSortOrder() property.

Parameters:
pSkus - collection of SKUs sizes should be taken from.
Returns:
a List of sizes.
See Also:
getSizeSortOrder()

getPossibleValuesForSkus

public java.util.List getPossibleValuesForSkus(java.util.Collection pSkus,
                                               java.lang.String pPropertyName)
Returns the list of possible values for a given collection of skus.

Parameters:
pSkus - collection of skus
pPropertyName - the property name of the sku to use.
Returns:
Collection of values

findSku

public atg.repository.RepositoryItem findSku(java.util.Collection pSkus,
                                             java.lang.String pColor,
                                             java.lang.String pSize)
Finds the sku with the matching color and size.

Parameters:
pSkus - collection of skus
pColor - - color name
pSize - - size name
Returns:
the matching child sku

findSku

public atg.repository.RepositoryItem findSku(java.util.Collection pSkus,
                                             java.lang.String pWoodFinish)
Finds the sku with the matching wood finish.

Parameters:
pSkus - collection of skus
pWoodFinish - - wood finish name
Returns:
the matching child sku

getProductChildSkus

public java.util.Collection getProductChildSkus(atg.repository.RepositoryItem pProduct)
Returns a product's child skus.

Parameters:
pProduct - - product
Returns:
Collection of skus

sortColors

public java.util.List sortColors(java.util.List pColors)
Sorts a list of colors.

Parameters:
pColors - - list of pColors
Returns:
the sorted list of colors.

sortWoodFinishes

public java.util.List sortWoodFinishes(java.util.List pWoodFinishes)
Sorts a list of wood finishes.

Parameters:
pWoodFinishes - - list of wood finishes
Returns:
the sorted list of wood finishes.

sortSizes

public java.util.List sortSizes(java.util.List pSizes)
Sorts sizes accoring to the configured template.

Parameters:
pSizes - - list of sizes
Returns:
List of sorted sizes
See Also:
getSizeSortOrder()

sortStrings

public java.util.List sortStrings(java.util.List pStrings,
                                  java.lang.String[] pSortOrder)
Sorts the collection of strings relative to their ordinal position in the sort order array.

Parameters:
pStrings - a collection of strings to sort
pSortOrder - the string array of possible values and their relative order.
Returns:
List of sorted Strings