atg.commerce.catalog.custom
Class CustomCatalogTools

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
All Implemented Interfaces:
atg.commerce.catalog.CMSConstants, MessageTyper, NameContextBindingListener, NameContextElement, NameResolver, AdminableService, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, java.util.EventListener

public class CustomCatalogTools
extends CatalogTools
implements atg.commerce.catalog.CMSConstants

This class is an extension of atg.commerce.catalog.CatalogTools that modifies the behavior so it works with custom catalogs. For example, findSku will only return a result if the result is accessible throug the current users catalogs.

All of the configuration is the same with some additional properties:

 $class=atg.commerce.catalog.custom.CustomCatalogTools

 transactionManager=/atg/dynamo/transaction/TransactionManager
 profileCatalogPropertyName=catalog

 categorysInfosMapProperty=categoryInfos
 productsInfosMapProperty=productInfos
 skusInfosMapProperty=skuInfos

 catalogsProperty=catalogs

 baseCatalogItemType=catalog
 catalogItemTypes=catalog

 catalogProperties=/atg/commerce/catalog/custom/CatalogProperties

 trackState=true
 


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
CustomCatalogTools()
           
 
Method Summary
 java.util.Collection computeRecursedRootSubCatalogs(RepositoryItem pCatalog)
          method to compute the rootSubCatalog ancestor tree for a catalog
 RepositoryItem determineCatalog(atg.commerce.util.ContextValueRetrieverArguments pArguments)
          Determines the appropriate catalog to get based on properties stored in an arguments object.
 RepositoryItem determineCatalog(RepositoryItem pProfile, RepositoryItem pSite)
          Determines the appropriate catalog to get based on profile and site.
 void doStartService()
          This method tries to set the defaultCatalog property.
 java.util.List filterCollectionByCatalog(RepositoryItem pCatalog, java.util.Collection pCollection)
          Filter collection by catalog.
 java.util.List filterCollectionByCatalogs(RepositoryItem[] pCatalogs, java.util.Collection pCollection)
          Filter collection by catalogs.
 RepositoryItem findCatalogItem(java.lang.String pId)
          With the given id return an object which represents the catalog
 RepositoryItem findCatalogItem(java.lang.String pId, java.lang.String pCatalogKey)
          With the given id return an object which represents the catalog It is important not to confuse this with the "findCatalog" method.
 RepositoryItem[] findCatalogItems(java.lang.String[] pIds)
          With the given id return an object which represents the catalog
 RepositoryItem[] findCatalogItems(java.lang.String[] pIds, java.lang.String pCatalogKey)
          With the given id return an object which represents the catalog
 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[] findCategories(java.lang.String[] pIds, java.lang.String pCatalogKey, boolean pVerifyCatalog)
          With the given id return an object which represents the category
 RepositoryItem[] findCategories(java.lang.String[] pIds, java.lang.String pCatalogKey, RepositoryItem pCatalog)
          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 The item is only returned if it is in the current users catalog
 RepositoryItem findCategory(java.lang.String pId, java.lang.String pCatalogKey, boolean pVerifyCatalog)
          With the given id return an object which represents the category The item is only returned if it is in the current users catalog
 RepositoryItem findCategory(java.lang.String pId, java.lang.String pCatalogKey, RepositoryItem pCatalog)
          With the given id return an object which represents the category The item is only returned if it is in the current users catalog
 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 findProduct(java.lang.String pId, java.lang.String pCatalogKey, boolean pVerifyCatalog)
          With the given id return an object which represents the product
 RepositoryItem findProduct(java.lang.String pId, java.lang.String pCatalogKey, RepositoryItem pCatalog)
          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[] findProducts(java.lang.String[] pIds, java.lang.String pCatalogKey, boolean pVerifyCatalog)
          With the given id return an object which represents the product
 RepositoryItem[] findProducts(java.lang.String[] pIds, java.lang.String pCatalogKey, RepositoryItem pCatalog)
          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 findSKU(java.lang.String pId, java.lang.String pCatalogKey, boolean pVerifyCatalog)
          With the given id return an object which represents the sku
 RepositoryItem findSKU(java.lang.String pId, java.lang.String pCatalogKey, RepositoryItem pCatalog)
          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
 RepositoryItem[] findSKUs(java.lang.String[] pIds, java.lang.String pCatalogKey, boolean pVerifyCatalog)
          With the given ids return an array of objects which represent the skus
 RepositoryItem[] findSKUs(java.lang.String[] pIds, java.lang.String pCatalogKey, RepositoryItem pCatalog)
          With the given ids return an array of objects which represent the skus
 java.util.List getAllAncestorCategories(RepositoryItem pItem)
           
 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.util.LinkedList getAncestors(RepositoryItem pItem, RepositoryItem pCatalog)
          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 getBaseCatalogFolderItemType()
          Returns property BaseCatalogItemType
 java.lang.String getBaseCatalogItemType()
          Returns property BaseCatalogItemType
 java.util.Map getCatalogBeanInfos()
          Returns property CatalogBeanInfos
 java.util.Map getCatalogFolderBeanInfos()
          Returns property CatalogBeanInfos
 java.lang.String[] getCatalogFolderItemTypes()
          Returns property CatalogItemTypes
 RepositoryItem getCatalogForSite()
          Get the catalog for the current site
 RepositoryItem getCatalogForSite(RepositoryItem pSite)
          Get the catalog for the given site
 java.lang.String[] getCatalogItemTypes()
          Returns property CatalogItemTypes
 CatalogProperties getCatalogProperties()
          A class that stores the names of various items and properties in the repository
 QueryBuilder getCatalogQueryBuilder()
          Returns a QueryBuilder that can be used to query for catalog items.
 RepositoryItem[] getCatalogs(java.lang.String[] pCatalogIds)
          Returns an array of catalogs repository items.
 java.util.Collection getCatalogsContainingThisCatalog(RepositoryItem pCatalog, Repository pCatalogRepository)
          This method will return all the catalogs that contain the given catalog as a sub catalog.
 RepositoryItem[] getCatalogsForRepository(Repository pRepository, java.util.Collection pCatalogIds)
          Returns an array of catalog items for the given repository.
 java.lang.String getCatalogsProperty()
          The name of the property in category, product, or sku that contains the list of catalogs that have the item in it The default is "catalogs"
 RepositoryItem[] getCatalogsThatIncludeCatalogInRootSubCatalogs(RepositoryItem pCatalog, Repository pRepository)
          returns an array of catalog items that have the given catalog in their rootSubCatalogs property
 RepositoryItem[] getCatalogsWithCategoryAsRoot(RepositoryItem pCategory, Repository pCatalogRepository)
          Get the catalogs whose rootCategories contains this category
 java.util.Collection getCategoriesContainingThisCatalog(RepositoryItem pCatalog, Repository pCatalogRepository)
          Generate the immediate categories that can navigate to this catalog.
 java.util.Collection getCategoriesContainingThisCategorysCatalog(RepositoryItem pCategory, Repository pCatalogRepository)
          Generate the immediate categories that can navigate to this category's catalog There are two ways this can happen 1.
 RepositoryItem[] getCategoriesInCatalog(RepositoryItem pCatalog, Repository pCatalogRepository)
          Deprecated. The category.catalog property is no longer used now that a category can belong to more than one catalog.
 RepositoryItem[] getCategoriesWithCatalogAsSubCatalog(RepositoryItem pCatalog, Repository pRepository)
          returns an array of categories items that have the given catalog in their subCatalogs property
 java.util.Collection getCategoriesWithIndirectPathToCatalog(RepositoryItem pCatalog)
          gets categories that contain the catalog as a subCatalog, or any of the rootSubCatalogs as a subCatalog.
 java.util.Collection getCategoriesWithIndirectPathToCategory(RepositoryItem pCategory)
          gets categories that contain the current category's catalog as a subCatalog, or any of the rootSubCatalogs as a subCatalog.
 java.lang.String getCategorysInfoMapProperty()
          The name of the map property in category that maps catalogs to categoryInfos The default is "categoryInfos"
 atg.commerce.multisite.CommerceSitePropertiesManager getCommerceSitePropertiesManager()
          Set value of the CommerceSitePropertiesManager
 ContextValueRetriever getContextValueRetriever()
          Set value of the ContextValueRetriever
 RepositoryItem getCurrentCatalog()
          Get the catalog from the thread if specified as a thread local variable.
 RepositoryItem getDefaultCatalog()
          Gets the default catalog as a RepositoryItem
 java.lang.String getDefaultCatalogId()
          Gets the default catalog Id
 java.util.Set<RepositoryItem> getEnclosingCatalogsForCategory(RepositoryItem pCategory)
          Gets all of the "closest" catalogs to a category.
protected  java.lang.Object getKeyFromCatalog(java.lang.Object pCatalog)
          Get the key into the map for the given catalog The key is just the id.
 RepositoryItem[] getParentCategories(RepositoryItem pCategory, Repository pCatalogRepository)
          Get the categories whose childCategories contains this category
 RepositoryItem getParentCategory(RepositoryItem pItem, RepositoryItem pCatalog)
          Helper method used to select the preferred parent for a given category or product.
 java.util.Collection getProductsCategories(RepositoryItem pProduct, Repository pCatalogRepository)
          This method will return a list of the categories that the given product appears in.
 java.lang.String getProductsInfoMapProperty()
          The name of the map property in product that maps catalogs to productInfos The default is "productInfos"
 java.lang.String getProfileCatalogPropertyName()
          The name of the property in the profile that stores the current users catalog.
 java.util.Collection getRootCategoriesForCatalog(RepositoryItem pCatalog, Repository pCatalogRepository)
          Return the list of all root categories for a catalog (including all root categories of the rootSubCatalogs
 java.lang.String getSkusInfoMapProperty()
          The name of the map property in sku that maps catalogs to skuInfos The default is "skuInfos"
 java.lang.String getStatePropertyName()
          The name of the property in the catalog that tracks the status of differnent catalog maintenance services.
 boolean getTrackState()
          A boolean value that the user can specify whether to track the state of catalog maintenance service
 javax.transaction.TransactionManager getTransactionManager()
          The beginning and ending of transactions are handled by the transaction manager.
 boolean isCatalog(java.lang.Object pObj)
          Determines if the object provided is a catalog repository item
 boolean isCatalogFolder(java.lang.Object pObj)
          Determines if the object provided is a catalog folder repository item
 boolean isCategoryReferenced(RepositoryItem pCategory, RepositoryItem pCatalog, Repository pCatalogRepository)
          This method will check if the given category is included in any catalogs 'rootCategories' list or in any categories 'childCategories' list.
 boolean isReturnEmptyResults()
          Query whether findCategories, findProducts, and findSkus should return empty results if none of the target ids appears in the user's catalog, or whether they should return the complete set of products or categories for the id's in question.
 boolean isSaveCachedAncestors()
          Retrieve value of SaveCachedAncestors
 boolean isVerifyCatalog()
          Gets if find methods should verify the item found belongs to the current catalog.
protected  Query removeQuerySiteConstraints(QueryBuilder pQueryBuilder, Query pBaseQuery)
          Adjust a query so that it will execute without filtering for site membership.
 void setBaseCatalogFolderItemType(java.lang.String pBaseCatalogFolderItemType)
          Sets property BaseCatalogFolderItemType
 void setBaseCatalogItemType(java.lang.String pBaseCatalogItemType)
          Sets property BaseCatalogItemType
 void setCatalogFolderItemTypes(java.lang.String[] pCatalogFolderItemTypes)
          Set property CatalogItemTypes
 void setCatalogItemTypes(java.lang.String[] pCatalogItemTypes)
          Set property CatalogItemTypes
 void setCatalogProperties(CatalogProperties pCatalogProperties)
           
 void setCatalogsProperty(java.lang.String pCatalogsProperty)
           
 void setCategorysInfoMapProperty(java.lang.String pCategorysInfoMapProperty)
           
 void setCommerceSitePropertiesManager(atg.commerce.multisite.CommerceSitePropertiesManager pCommerceSitePropertiesManager)
          Retrieve the value of the CommerceSitePropertiesManager
 void setContextValueRetriever(ContextValueRetriever pContextValueRetriever)
          Retrieve the value of the ContextValueRetriever
 void setDefaultCatalog(RepositoryItem pDefaultCatalog)
           
 void setDefaultCatalogId(java.lang.String pDefaultCatalogId)
           
 void setProductsInfoMapProperty(java.lang.String pProductsInfoMapProperty)
           
 void setProfileCatalogPropertyName(java.lang.String pProfileCatalogPropertyName)
           
 void setReturnEmptyResults(boolean pEmptyResultReturnsAll)
          Specify whether findCategories, findProducts, and findSkus should return empty results if none of the target ids appears in the user's catalog, or whether they should return the complete set of products or categories for the id's in question.
 void setSaveCachedAncestors(boolean pSaveCachedAncestors)
          Set value of SaveCachedAncestors
 void setSkusInfoMapProperty(java.lang.String pSkusInfoMapProperty)
           
 void setState(java.util.Collection pCatalogIds, java.lang.String pState)
          This method will set the status for the specified catalogs.
 void setState(java.lang.String pState)
          This method will set the status for all the existing catalogs.
 void setStatePropertyName(java.lang.String pStatePropertyName)
           
 void setTrackState(boolean pTrackState)
           
 void setTransactionManager(javax.transaction.TransactionManager pTransactionManager)
           
 void setVerifyCatalog(boolean pVerifyCatalog)
          Sets if find methods should verify the item found belongs to the current catalog.
 boolean verifyCatalog(RepositoryItem pItem)
          This method returns true if the given catalog appears in the given items "catalogs" list.
 boolean verifyCatalog(RepositoryItem pItem, RepositoryItem pCatalog)
          This method returns true if the given catalog appears in the given items "catalogs" list.
protected  void walkUpCategoryTree(RepositoryItem pCategory, java.util.Set<RepositoryItem> pPath, java.util.Set<RepositoryItem> pEnclosingCatalogs)
          Look initially for direct parent catalog(s).
 
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 final java.lang.String CLASS_VERSION
Class version string

See Also:
Constant Field Values
Constructor Detail

CustomCatalogTools

public CustomCatalogTools()
Method Detail

setTransactionManager

public void setTransactionManager(javax.transaction.TransactionManager pTransactionManager)

getTransactionManager

public javax.transaction.TransactionManager getTransactionManager()
The beginning and ending of transactions are handled by the transaction manager.


setStatePropertyName

public void setStatePropertyName(java.lang.String pStatePropertyName)

getStatePropertyName

public java.lang.String getStatePropertyName()
The name of the property in the catalog that tracks the status of differnent catalog maintenance services. The default is "status"


setProfileCatalogPropertyName

public void setProfileCatalogPropertyName(java.lang.String pProfileCatalogPropertyName)

getProfileCatalogPropertyName

public java.lang.String getProfileCatalogPropertyName()
The name of the property in the profile that stores the current users catalog. The default is "catalog"


setCategorysInfoMapProperty

public void setCategorysInfoMapProperty(java.lang.String pCategorysInfoMapProperty)

getCategorysInfoMapProperty

public java.lang.String getCategorysInfoMapProperty()
The name of the map property in category that maps catalogs to categoryInfos The default is "categoryInfos"


setProductsInfoMapProperty

public void setProductsInfoMapProperty(java.lang.String pProductsInfoMapProperty)

getProductsInfoMapProperty

public java.lang.String getProductsInfoMapProperty()
The name of the map property in product that maps catalogs to productInfos The default is "productInfos"


setSkusInfoMapProperty

public void setSkusInfoMapProperty(java.lang.String pSkusInfoMapProperty)

getSkusInfoMapProperty

public java.lang.String getSkusInfoMapProperty()
The name of the map property in sku that maps catalogs to skuInfos The default is "skuInfos"


setCatalogsProperty

public void setCatalogsProperty(java.lang.String pCatalogsProperty)

getCatalogsProperty

public java.lang.String getCatalogsProperty()
The name of the property in category, product, or sku that contains the list of catalogs that have the item in it The default is "catalogs"


setBaseCatalogItemType

public void setBaseCatalogItemType(java.lang.String pBaseCatalogItemType)
Sets property BaseCatalogItemType


getBaseCatalogItemType

public java.lang.String getBaseCatalogItemType()
Returns property BaseCatalogItemType


setCatalogItemTypes

public void setCatalogItemTypes(java.lang.String[] pCatalogItemTypes)
Set property CatalogItemTypes


getCatalogItemTypes

public java.lang.String[] getCatalogItemTypes()
Returns property CatalogItemTypes


getCatalogBeanInfos

public java.util.Map getCatalogBeanInfos()
Returns property CatalogBeanInfos


setBaseCatalogFolderItemType

public void setBaseCatalogFolderItemType(java.lang.String pBaseCatalogFolderItemType)
Sets property BaseCatalogFolderItemType


getBaseCatalogFolderItemType

public java.lang.String getBaseCatalogFolderItemType()
Returns property BaseCatalogItemType


setCatalogFolderItemTypes

public void setCatalogFolderItemTypes(java.lang.String[] pCatalogFolderItemTypes)
Set property CatalogItemTypes


getCatalogFolderItemTypes

public java.lang.String[] getCatalogFolderItemTypes()
Returns property CatalogItemTypes


getCatalogFolderBeanInfos

public java.util.Map getCatalogFolderBeanInfos()
Returns property CatalogBeanInfos


setCatalogProperties

public void setCatalogProperties(CatalogProperties pCatalogProperties)

getCatalogProperties

public CatalogProperties getCatalogProperties()
A class that stores the names of various items and properties in the repository


setDefaultCatalog

public void setDefaultCatalog(RepositoryItem pDefaultCatalog)

getDefaultCatalog

public RepositoryItem getDefaultCatalog()
Gets the default catalog as a RepositoryItem


setDefaultCatalogId

public void setDefaultCatalogId(java.lang.String pDefaultCatalogId)

getDefaultCatalogId

public java.lang.String getDefaultCatalogId()
Gets the default catalog Id


setTrackState

public void setTrackState(boolean pTrackState)

getTrackState

public boolean getTrackState()
A boolean value that the user can specify whether to track the state of catalog maintenance service


isReturnEmptyResults

public boolean isReturnEmptyResults()
Query whether findCategories, findProducts, and findSkus should return empty results if none of the target ids appears in the user's catalog, or whether they should return the complete set of products or categories for the id's in question. The default is to return empty results if appropriate.


setReturnEmptyResults

public void setReturnEmptyResults(boolean pEmptyResultReturnsAll)
Specify whether findCategories, findProducts, and findSkus should return empty results if none of the target ids appears in the user's catalog, or whether they should return the complete set of products or categories for the id's in question.

The correct behavior is to return empty results, but prior to ATG 7.0 the code did not implement this behavior. Instead, it returned the unfiltered set of categories or products obtained by calling super.findCategories or super.findProducts. This bug was fixed for ATG 7.0

In the unlikely event that application code depends on the old behavior, setting returnEmptyResults to false in the custom catalog tools configuration will restore that behavior.


setSaveCachedAncestors

public void setSaveCachedAncestors(boolean pSaveCachedAncestors)
Set value of SaveCachedAncestors


isSaveCachedAncestors

public boolean isSaveCachedAncestors()
Retrieve value of SaveCachedAncestors


getCommerceSitePropertiesManager

public atg.commerce.multisite.CommerceSitePropertiesManager getCommerceSitePropertiesManager()
Set value of the CommerceSitePropertiesManager


setCommerceSitePropertiesManager

public void setCommerceSitePropertiesManager(atg.commerce.multisite.CommerceSitePropertiesManager pCommerceSitePropertiesManager)
Retrieve the value of the CommerceSitePropertiesManager


getContextValueRetriever

public ContextValueRetriever getContextValueRetriever()
Set value of the ContextValueRetriever


setContextValueRetriever

public void setContextValueRetriever(ContextValueRetriever pContextValueRetriever)
Retrieve the value of the ContextValueRetriever


isVerifyCatalog

public boolean isVerifyCatalog()
Gets if find methods should verify the item found belongs to the current catalog.

Returns:
True if the catalog membership should be verified else false

setVerifyCatalog

public void setVerifyCatalog(boolean pVerifyCatalog)
Sets if find methods should verify the item found belongs to the current catalog.

Parameters:
pVerifyCatalog - True if the item should be verified else false.

doStartService

public void doStartService()
                    throws ServiceException
This method tries to set the defaultCatalog property. If defaultCatalogId is configured in the properties file, that ID is used. If defaultCatalogId is null and the repository contains exactly one catalog item, that item becomes the default. Otherwise, defaultCatalog remains null.

Overrides:
doStartService in class CatalogTools
Throws:
ServiceException - if error occurs

getCatalogsForRepository

public RepositoryItem[] getCatalogsForRepository(Repository pRepository,
                                                 java.util.Collection pCatalogIds)
                                          throws RepositoryException
Returns an array of catalog items for the given repository. If pCatalogs is null, all catalog items are returned. Catalogs are returned without regard to site membership.

Parameters:
pRepository - - the repository containing the catalog items
pCatalogIds - - a collection of catalog ids to constrain the query for catalogs
Returns:
RepositoryItem[] - array of catalog items
Throws:
RepositoryException

getCatalogsThatIncludeCatalogInRootSubCatalogs

public RepositoryItem[] getCatalogsThatIncludeCatalogInRootSubCatalogs(RepositoryItem pCatalog,
                                                                       Repository pRepository)
                                                                throws RepositoryException
returns an array of catalog items that have the given catalog in their rootSubCatalogs property

Parameters:
pCatalog - - the catalog used to query catalogs
pRepository - - the repository containing the catalog items
Returns:
RepositoryItem[] - array of catalog items
Throws:
RepositoryException

getCategoriesWithCatalogAsSubCatalog

public RepositoryItem[] getCategoriesWithCatalogAsSubCatalog(RepositoryItem pCatalog,
                                                             Repository pRepository)
                                                      throws RepositoryException
returns an array of categories items that have the given catalog in their subCatalogs property

Parameters:
pCatalog - - the catalog used to query categories
pRepository - - the repository containing the category items
Returns:
RepositoryItem[] - array of category items
Throws:
RepositoryException

getParentCategories

public RepositoryItem[] getParentCategories(RepositoryItem pCategory,
                                            Repository pCatalogRepository)
                                     throws RepositoryException
Get the categories whose childCategories contains this category

Parameters:
pCategory - - the category to get parents for
pCatalogRepository - - The repository where the catalog resides
Returns:
RepositoryItem[] - array of categorys that have the incoming category as a child
Throws:
RepositoryException

getCatalogsWithCategoryAsRoot

public RepositoryItem[] getCatalogsWithCategoryAsRoot(RepositoryItem pCategory,
                                                      Repository pCatalogRepository)
                                               throws RepositoryException
Get the catalogs whose rootCategories contains this category

Parameters:
pCategory - - the category
pCatalogRepository - - The repository where the catalog resides.if null, defaults to pCategory's repository
Returns:
RepositoryItem[] - array of catalogs that have the incoming category as a root
Throws:
RepositoryException

getAncestors

public 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. A item has no more parent when the property represented by the parentCategoryPropertyName property of this component either does not exist on the item or returns null. Then it returns a LinkedList of repository items. It obtains the name of the parentCategory property name from the parentCategoryPropertyName property. If your implementation of the catalog uses another name for the parentCategory property the parentCategoryPropertyName property should be changed. If the catalog containing this item is a sub catalog of the current catalog, the path from the "parent catalog" to the current catalog is included.

Overrides:
getAncestors in class CatalogTools
Parameters:
pItem - The category or product we are getting the ancestors for
Returns:
A LinkedList of category items.

getAncestors

public java.util.LinkedList getAncestors(RepositoryItem pItem,
                                         RepositoryItem pCatalog)
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. A item has no more parent when the property represented by the parentCategoryPropertyName property of this component either does not exist on the item or returns null. Then it returns a LinkedList of repository items. It obtains the name of the parentCategory property name from the parentCategoryPropertyName property. If your implementation of the catalog uses another name for the parentCategory property the parentCategoryPropertyName property should be changed. If the catalog containing this item is a sub catalog of the current catalog, the path from the "parent catalog" to the current catalog is included.

Parameters:
pItem - The category or product we are getting the ancestors for
pCatalog - The catalog to use as the key in the map of parent categories on each item.
Returns:
A LinkedList of category items.

getCategoriesInCatalog

public RepositoryItem[] getCategoriesInCatalog(RepositoryItem pCatalog,
                                               Repository pCatalogRepository)
Deprecated. The category.catalog property is no longer used now that a category can belong to more than one catalog.

Get categories whose catalogs property contains the given catalog

Parameters:
pCatalog - The catalog to look in
pCatalogRepository - - the repository where the items reside. If null, pCatalog's repository is assumed.
Returns:
an array of category RepositoryItems in pCatalog

findCatalogItem

public RepositoryItem findCatalogItem(java.lang.String pId,
                                      java.lang.String pCatalogKey)
                               throws RepositoryException
With the given id return an object which represents the catalog It is important not to confuse this with the "findCatalog" method. That method returns a catalog repository. This method returns a catalog RepositoryItem. This mehod is only relevant when using custom catalogs.

Throws:
RepositoryException - if there was an error attempting to find the item

findCatalogItem

public RepositoryItem findCatalogItem(java.lang.String pId)
                               throws RepositoryException
With the given id return an object which represents the catalog

Throws:
RepositoryException - if there was an error attempting to find the item

findCatalogItems

public RepositoryItem[] findCatalogItems(java.lang.String[] pIds,
                                         java.lang.String pCatalogKey)
                                  throws RepositoryException
With the given id return an object which represents the catalog

Throws:
RepositoryException - if there was an error attempting to find the item

findCatalogItems

public RepositoryItem[] findCatalogItems(java.lang.String[] pIds)
                                  throws RepositoryException
With the given id return an object which represents the catalog

Throws:
RepositoryException - if there was an error attempting to find the item

findCategory

public RepositoryItem findCategory(java.lang.String pId,
                                   java.lang.String pCatalogKey,
                                   boolean pVerifyCatalog)
                            throws RepositoryException
With the given id return an object which represents the category The item is only returned if it is in the current users catalog

Throws:
RepositoryException - if there was an error attempting to find the item

findCategory

public RepositoryItem findCategory(java.lang.String pId,
                                   java.lang.String pCatalogKey,
                                   RepositoryItem pCatalog)
                            throws RepositoryException
With the given id return an object which represents the category The item is only returned if it is in the current users catalog

Throws:
RepositoryException - if there was an error attempting to find the item

findCategory

public RepositoryItem findCategory(java.lang.String pId,
                                   java.lang.String pCatalogKey)
                            throws RepositoryException
With the given id return an object which represents the category The item is only returned if it is in the current users catalog

Overrides:
findCategory in class CatalogTools
Throws:
RepositoryException - if there was an error attempting to find the item

findCategory

public RepositoryItem findCategory(java.lang.String pId)
                            throws RepositoryException
With the given id return an object which represents the category

Overrides:
findCategory in class CatalogTools
Throws:
RepositoryException - if there was an error attempting to find the item

findCategories

public RepositoryItem[] findCategories(java.lang.String[] pIds,
                                       java.lang.String pCatalogKey,
                                       boolean pVerifyCatalog)
                                throws RepositoryException
With the given id return an object which represents the category

Throws:
RepositoryException - if there was an error attempting to find the item

findCategories

public RepositoryItem[] findCategories(java.lang.String[] pIds,
                                       java.lang.String pCatalogKey,
                                       RepositoryItem pCatalog)
                                throws RepositoryException
With the given id return an object which represents the category

Throws:
RepositoryException - if there was an error attempting to find the item

findCategories

public RepositoryItem[] findCategories(java.lang.String[] pIds,
                                       java.lang.String pCatalogKey)
                                throws RepositoryException
With the given id return an object which represents the category

Overrides:
findCategories in class CatalogTools
Throws:
RepositoryException - if there was an error attempting to find the item

findCategories

public RepositoryItem[] findCategories(java.lang.String[] pIds)
                                throws RepositoryException
With the given id return an object which represents the category

Overrides:
findCategories in class CatalogTools
Throws:
RepositoryException - if there was an error attempting to find the item

findProduct

public RepositoryItem findProduct(java.lang.String pId,
                                  java.lang.String pCatalogKey,
                                  boolean pVerifyCatalog)
                           throws RepositoryException
With the given id return an object which represents the product

Throws:
RepositoryException - if there was an error attempting to find the item

findProduct

public RepositoryItem findProduct(java.lang.String pId,
                                  java.lang.String pCatalogKey,
                                  RepositoryItem pCatalog)
                           throws RepositoryException
With the given id return an object which represents the product

Throws:
RepositoryException - if there was an error attempting to find the item

findProduct

public RepositoryItem findProduct(java.lang.String pId,
                                  java.lang.String pCatalogKey)
                           throws RepositoryException
With the given id return an object which represents the product

Overrides:
findProduct in class CatalogTools
Throws:
RepositoryException - if there was an error attempting to find the item

findProduct

public RepositoryItem findProduct(java.lang.String pId)
                           throws RepositoryException
With the given id return an object which represents the product

Overrides:
findProduct in class CatalogTools
Throws:
RepositoryException - if there was an error attempting to find the item

findProducts

public RepositoryItem[] findProducts(java.lang.String[] pIds,
                                     java.lang.String pCatalogKey,
                                     boolean pVerifyCatalog)
                              throws RepositoryException
With the given id return an object which represents the product

Throws:
RepositoryException - if there was an error attempting to find the item

findProducts

public RepositoryItem[] findProducts(java.lang.String[] pIds,
                                     java.lang.String pCatalogKey,
                                     RepositoryItem pCatalog)
                              throws RepositoryException
With the given id return an object which represents the product

Throws:
RepositoryException - if there was an error attempting to find the item

findProducts

public RepositoryItem[] findProducts(java.lang.String[] pIds,
                                     java.lang.String pCatalogKey)
                              throws RepositoryException
With the given id return an object which represents the product

Overrides:
findProducts in class CatalogTools
Throws:
RepositoryException - if there was an error attempting to find the item

findProducts

public RepositoryItem[] findProducts(java.lang.String[] pIds)
                              throws RepositoryException
With the given id return an object which represents the product

Overrides:
findProducts in class CatalogTools
Throws:
RepositoryException - if there was an error attempting to find the item

findSKU

public RepositoryItem findSKU(java.lang.String pId,
                              java.lang.String pCatalogKey,
                              boolean pVerifyCatalog)
                       throws RepositoryException
With the given id return an object which represents the sku

Throws:
RepositoryException - if there was an error attempting to find the item

findSKU

public RepositoryItem findSKU(java.lang.String pId,
                              java.lang.String pCatalogKey,
                              RepositoryItem pCatalog)
                       throws RepositoryException
With the given id return an object which represents the sku

Throws:
RepositoryException - if there was an error attempting to find the item

findSKU

public RepositoryItem findSKU(java.lang.String pId,
                              java.lang.String pCatalogKey)
                       throws RepositoryException
With the given id return an object which represents the sku

Overrides:
findSKU in class CatalogTools
Throws:
RepositoryException - if there was an error attempting to find the item

findSKU

public RepositoryItem findSKU(java.lang.String pId)
                       throws RepositoryException
With the given id return an object which represents the sku

Overrides:
findSKU in class CatalogTools
Throws:
RepositoryException - if there was an error attempting to find the item

findSKUs

public RepositoryItem[] findSKUs(java.lang.String[] pIds,
                                 java.lang.String pCatalogKey,
                                 boolean pVerifyCatalog)
                          throws RepositoryException
With the given ids return an array of objects which represent the skus

Throws:
RepositoryException - if there was an error attempting to find the items

findSKUs

public RepositoryItem[] findSKUs(java.lang.String[] pIds,
                                 java.lang.String pCatalogKey,
                                 RepositoryItem pCatalog)
                          throws RepositoryException
With the given ids return an array of objects which represent the skus

Throws:
RepositoryException - if there was an error attempting to find the items

findSKUs

public RepositoryItem[] findSKUs(java.lang.String[] pIds,
                                 java.lang.String pCatalogKey)
                          throws RepositoryException
With the given ids return an array of objects which represent the skus

Overrides:
findSKUs in class CatalogTools
Throws:
RepositoryException - if there was an error attempting to find the items

findSKUs

public RepositoryItem[] findSKUs(java.lang.String[] pIds)
                          throws RepositoryException
With the given ids return an array of objects which represent the skus

Overrides:
findSKUs in class CatalogTools
Throws:
RepositoryException - if there was an error attempting to find the items

getCurrentCatalog

public RepositoryItem getCurrentCatalog()
Get the catalog from the thread if specified as a thread local variable. Otherwise, get the catalog from the current user profile. The property used is profileCatalogPropertyName

See Also:
CatalogContext.setCurrentCatalog(RepositoryItem)

verifyCatalog

public boolean verifyCatalog(RepositoryItem pItem)
This method returns true if the given catalog appears in the given items "catalogs" list. Otherwise it returns false. The catalog used is the catalog stored in the profile.


verifyCatalog

public boolean verifyCatalog(RepositoryItem pItem,
                             RepositoryItem pCatalog)
This method returns true if the given catalog appears in the given items "catalogs" list. Otherwise it returns false


getRootCategoriesForCatalog

public java.util.Collection getRootCategoriesForCatalog(RepositoryItem pCatalog,
                                                        Repository pCatalogRepository)
                                                 throws RepositoryException
Return the list of all root categories for a catalog (including all root categories of the rootSubCatalogs

Throws:
RepositoryException

getCatalogsContainingThisCatalog

public java.util.Collection getCatalogsContainingThisCatalog(RepositoryItem pCatalog,
                                                             Repository pCatalogRepository)
                                                      throws RepositoryException
This method will return all the catalogs that contain the given catalog as a sub catalog.

Parameters:
pCatalog - The catalog whose "parents" will be returned
pCatalogRepository - The repository containing pCatalog
Throws:
RepositoryException

getProductsCategories

public java.util.Collection getProductsCategories(RepositoryItem pProduct,
                                                  Repository pCatalogRepository)
                                           throws RepositoryException
This method will return a list of the categories that the given product appears in. It does this by querying for all categories whose "fixedChildProducts" contains the given product.

Parameters:
pProduct - The product contained in all the returned categories
pCatalogRepository - The repository containing the given product
Throws:
RepositoryException

getAllAncestorCategories

public java.util.List getAllAncestorCategories(RepositoryItem pItem)
                                        throws RepositoryException
Throws:
RepositoryException

getCategoriesContainingThisCategorysCatalog

public java.util.Collection getCategoriesContainingThisCategorysCatalog(RepositoryItem pCategory,
                                                                        Repository pCatalogRepository)
                                                                 throws RepositoryException
Generate the immediate categories that can navigate to this category's catalog There are two ways this can happen 1. A category can have thisCategory.catalog in it's subCatalogs 2. A category can have a catalog in it's subcatalogs that contains thisCategory.catalog as a rootSubCatalog

Parameters:
pCategory - - category whose catalog to search for
pCatalogRepository - - the Catalog's repository
Returns:
Collection - all the categories that either contain this category's catalog as a subCatalog or contain a subCatalog that has this category's catalog as a rootSubCatalog
Throws:
RepositoryException

getCategoriesWithIndirectPathToCategory

public java.util.Collection getCategoriesWithIndirectPathToCategory(RepositoryItem pCategory)
                                                             throws RepositoryException
gets categories that contain the current category's catalog as a subCatalog, or any of the rootSubCatalogs as a subCatalog. Note it only does immediate categories, not the entire ancestor tree for each immediate category

Parameters:
pCategory - - category to process
Returns:
Collection - immediate (indirect)categories that have a path to this category.
Throws:
RepositoryException

getEnclosingCatalogsForCategory

public java.util.Set<RepositoryItem> getEnclosingCatalogsForCategory(RepositoryItem pCategory)
                                                              throws RepositoryException
Gets all of the "closest" catalogs to a category. These are all catalogs that can be reached from the given category without an intervening catalog.

Parameters:
pCategory - The catalog to find the enclosing catalogs for.
Returns:
A Set of catalog RepositoryItem object
Throws:
RepositoryException - If an error occurs in the underlying repository API.

walkUpCategoryTree

protected void walkUpCategoryTree(RepositoryItem pCategory,
                                  java.util.Set<RepositoryItem> pPath,
                                  java.util.Set<RepositoryItem> pEnclosingCatalogs)
                           throws RepositoryException
Look initially for direct parent catalog(s). If the are any then add to pEnclosingCatalogs. Then look for parent categories. If there are any then recursively walk up those and repeat the process.

Parameters:
pCategory - - category repository item
pPath - - set of category's that we have already visited (to defend against looping)
pEnclosingCatalogs - - set of enclosing catalogs retrieved so far
Throws:
RepositoryException

getCategoriesWithIndirectPathToCatalog

public java.util.Collection getCategoriesWithIndirectPathToCatalog(RepositoryItem pCatalog)
                                                            throws RepositoryException
gets categories that contain the catalog as a subCatalog, or any of the rootSubCatalogs as a subCatalog. Note it only does immediate categories, not the entire ancestor tree for each

Parameters:
pCatalog - - catalog to process
Returns:
Collection - immediate (indirect)categories that have a path to this catalog
Throws:
RepositoryException

computeRecursedRootSubCatalogs

public java.util.Collection computeRecursedRootSubCatalogs(RepositoryItem pCatalog)
                                                    throws RepositoryException
method to compute the rootSubCatalog ancestor tree for a catalog

Parameters:
pCatalog - - catalog to process
Returns:
Collection - the rootSubCatalog tree
Throws:
RepositoryException

getCategoriesContainingThisCatalog

public java.util.Collection getCategoriesContainingThisCatalog(RepositoryItem pCatalog,
                                                               Repository pCatalogRepository)
                                                        throws RepositoryException
Generate the immediate categories that can navigate to this catalog. Only one level up is generated (i.e. immediate) There are two ways this can happen 1. A category can have thisCatalog in it's subCatalogs 2. A category can have a catalog in it's subcatalogs that contains thisCatalog as a rootSubCatalog

Parameters:
pCatalog - - catalog to search for
pCatalogRepository - - the Catalog's repository
Returns:
Collection - all the categories that either contain this catalog as a subCatalog or contain a subCatalog that has this catalog as a rootSubCatalog
Throws:
RepositoryException

isCategoryReferenced

public boolean isCategoryReferenced(RepositoryItem pCategory,
                                    RepositoryItem pCatalog,
                                    Repository pCatalogRepository)
                             throws RepositoryException
This method will check if the given category is included in any catalogs 'rootCategories' list or in any categories 'childCategories' list. In this implementation we only check the given catalog's rootCategories list. This is okay since we are assuming that CatalogVerificationService.verifyCategories has run

Parameters:
pCategory - The category to check
pCatalog - The catalog currently referenced by category.catalog
pCatalogRepository - The repository containing the category
Returns:
true if the category is referenced, false if it is not
Throws:
RepositoryException

setState

public void setState(java.lang.String pState)
              throws RepositoryException
This method will set the status for all the existing catalogs. This method will be used to track the status of CatalogMaintenanceService.

Parameters:
pState - The state of different Catalog Service
Throws:
RepositoryException

setState

public void setState(java.util.Collection pCatalogIds,
                     java.lang.String pState)
              throws RepositoryException
This method will set the status for the specified catalogs. This method will be used to track the status of CatalogMaintenanceService.

Parameters:
pCatalogIds - The collections of catalogs
pState - The state of different Catalog Service
Throws:
RepositoryException

filterCollectionByCatalog

public java.util.List filterCollectionByCatalog(RepositoryItem pCatalog,
                                                java.util.Collection pCollection)
Filter collection by catalog. Iterates over pCollection and add to the resulted list items whose collection of catalogs contains pCatalog.

Parameters:
pCatalog - catalog repository item
pCollection - collection of repository items
Returns:
filtered list of repository items

getCatalogForSite

public RepositoryItem getCatalogForSite()
                                 throws RepositoryException
Get the catalog for the current site

Returns:
Catalog for the current site
Throws:
RepositoryException

getCatalogForSite

public RepositoryItem getCatalogForSite(RepositoryItem pSite)
                                 throws RepositoryException
Get the catalog for the given site

Parameters:
pSite - Site to obtain the catalog from
Returns:
Catalog for the given site
Throws:
RepositoryException

determineCatalog

public RepositoryItem determineCatalog(RepositoryItem pProfile,
                                       RepositoryItem pSite)
                                throws RepositoryException
Determines the appropriate catalog to get based on profile and site. The determination is made by the configured ContextValueRetriever component.

Parameters:
pProfile - Profile to get the catalog for
pSite - Site to get the catalog from
Returns:
The proper catalog to use for the given parameters
Throws:
RepositoryException

determineCatalog

public RepositoryItem determineCatalog(atg.commerce.util.ContextValueRetrieverArguments pArguments)
                                throws RepositoryException
Determines the appropriate catalog to get based on properties stored in an arguments object. The determination is made by the configured ContextValueRetriever component.

Parameters:
pContext - an object containing properties, such as site and profile, needed to determine what catalog to use
Returns:
The proper catalog to use for the given context
Throws:
RepositoryException

getCatalogs

public RepositoryItem[] getCatalogs(java.lang.String[] pCatalogIds)
                             throws RepositoryException
Returns an array of catalogs repository items. If pCatalogIds is empty, returns all catalog items.

Parameters:
pCatalogIds - array of catalog Ids
Returns:
an array of catalogs repository items
Throws:
RepositoryException

filterCollectionByCatalogs

public java.util.List filterCollectionByCatalogs(RepositoryItem[] pCatalogs,
                                                 java.util.Collection pCollection)
Filter collection by catalogs. Iterates over pCollection and add to the resulted list items whose collection of catalogs contains at least one catalog from pCatalogs array.

Parameters:
pCatalogs - array of catalogs repository items
pCollection - collection of repository items
Returns:
filtered list of repository items

isCatalog

public boolean isCatalog(java.lang.Object pObj)
                  throws RepositoryException
Determines if the object provided is a catalog repository item

Returns:
true if object is a catalog repository item
Throws:
RepositoryException

isCatalogFolder

public boolean isCatalogFolder(java.lang.Object pObj)
                        throws RepositoryException
Determines if the object provided is a catalog folder repository item

Returns:
true if object is a catalog folder repository item
Throws:
RepositoryException

getCatalogQueryBuilder

public QueryBuilder getCatalogQueryBuilder()
                                    throws RepositoryException
Returns a QueryBuilder that can be used to query for catalog items.

Returns:
a QueryBuilder for catalog items
Throws:
RepositoryException

getParentCategory

public RepositoryItem getParentCategory(RepositoryItem pItem,
                                        RepositoryItem pCatalog)
                                 throws RepositoryException
Helper method used to select the preferred parent for a given category or product. This is done by setting the given catalog as the current catalog context and then delegating to the item's parentCategory property. If there was already a current catalog context it is restored before returning.

Parameters:
pItem - the category or product for which we want to retrieve the best category parent
pCatalog - used as the context to lookup the parent category via the derived property
Returns:
The preferred parent category for the supplied pItem
Throws:
RepositoryException - If an exception occurs in the underlying repository API

getKeyFromCatalog

protected java.lang.Object getKeyFromCatalog(java.lang.Object pCatalog)
                                      throws RepositoryException
Get the key into the map for the given catalog The key is just the id. If the property CATALOG_KEY_PROPERTY is not found and the catalog is a repository item, then the repositoryId is returned.

Throws:
RepositoryException

removeQuerySiteConstraints

protected Query removeQuerySiteConstraints(QueryBuilder pQueryBuilder,
                                           Query pBaseQuery)
                                    throws RepositoryException
Adjust a query so that it will execute without filtering for site membership.

Parameters:
pQueryBuilder - The QueryBuilder used to construct pBaseQuery
pBaseQuery - The Query to be adjusted to ignore site membership
Returns:
Adjusted query
Throws:
RepositoryException