public class CustomCatalogTools extends CatalogTools implements atg.commerce.catalog.CMSConstants
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
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
DEFAULT_CATEGORY_ITEM_TYPE, DEFAULT_PRODUCT_ITEM_TYPE, DEFAULT_SKU_ITEM_TYPE
SERVICE_INFO_KEY
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
DEFAULT_LOG_TRACE_STATUS
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
Constructor and Description |
---|
CustomCatalogTools() |
Modifier and Type | Method and Description |
---|---|
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
|
protected java.lang.String |
fromList(java.util.List<RepositoryItem> pItems)
Turns a list of repository items into a comma-separated list of repository ids.
|
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.
|
protected java.util.List<RepositoryItem> |
toList(java.lang.String pIds,
java.lang.String pItemDescName)
Takes a comma-separated list of repository ids and the item-descriptor name and returns a list of repository items
for those ids and type
|
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).
|
findCatalog, getAlternateCatalogs, getBaseCategoryItemType, getBaseMediaItemType, getBaseProductItemType, getBaseSKUItemType, getBeanInfo, getCatalog, getCatalogServiceLockName, getCatalogServiceLockTimeOut, getCategoryBeanInfos, getCategoryItemTypes, getOnlineOnlyPropertyName, getParentCategoryPropertyName, getProductBeanInfos, getProductItemTypes, getSKUBeanInfos, getSKUItemTypes, getTypeInfo, isCategory, isItemType, isOnlineOnly, isOnlineOnly, isProduct, isSku, isUseDefaultCatalog, setAlternateCatalogs, setBaseCategoryItemType, setBaseMediaItemType, setBaseProductItemType, setBaseSKUItemType, setCatalog, setCatalogServiceLockName, setCatalogServiceLockTimeOut, setCategoryItemTypes, setOnlineOnlyPropertyName, setParentCategoryPropertyName, setProductItemTypes, setSKUItemTypes, setUseDefaultCatalog
addLogListener, createAdminServlet, doStopService, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, 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, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
public static final java.lang.String CLASS_VERSION
public void setTransactionManager(javax.transaction.TransactionManager pTransactionManager)
public javax.transaction.TransactionManager getTransactionManager()
public void setStatePropertyName(java.lang.String pStatePropertyName)
public java.lang.String getStatePropertyName()
public void setProfileCatalogPropertyName(java.lang.String pProfileCatalogPropertyName)
public java.lang.String getProfileCatalogPropertyName()
public void setCategorysInfoMapProperty(java.lang.String pCategorysInfoMapProperty)
public java.lang.String getCategorysInfoMapProperty()
public void setProductsInfoMapProperty(java.lang.String pProductsInfoMapProperty)
public java.lang.String getProductsInfoMapProperty()
public void setSkusInfoMapProperty(java.lang.String pSkusInfoMapProperty)
public java.lang.String getSkusInfoMapProperty()
public void setCatalogsProperty(java.lang.String pCatalogsProperty)
public java.lang.String getCatalogsProperty()
public void setBaseCatalogItemType(java.lang.String pBaseCatalogItemType)
public java.lang.String getBaseCatalogItemType()
public void setCatalogItemTypes(java.lang.String[] pCatalogItemTypes)
public java.lang.String[] getCatalogItemTypes()
public java.util.Map getCatalogBeanInfos()
public void setBaseCatalogFolderItemType(java.lang.String pBaseCatalogFolderItemType)
public java.lang.String getBaseCatalogFolderItemType()
public void setCatalogFolderItemTypes(java.lang.String[] pCatalogFolderItemTypes)
public java.lang.String[] getCatalogFolderItemTypes()
public java.util.Map getCatalogFolderBeanInfos()
public void setCatalogProperties(CatalogProperties pCatalogProperties)
public CatalogProperties getCatalogProperties()
public void setDefaultCatalog(RepositoryItem pDefaultCatalog)
public RepositoryItem getDefaultCatalog()
public void setDefaultCatalogId(java.lang.String pDefaultCatalogId)
public java.lang.String getDefaultCatalogId()
public void setTrackState(boolean pTrackState)
public boolean getTrackState()
public boolean isReturnEmptyResults()
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.public void setReturnEmptyResults(boolean pEmptyResultReturnsAll)
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.
public void setSaveCachedAncestors(boolean pSaveCachedAncestors)
SaveCachedAncestors
public boolean isSaveCachedAncestors()
SaveCachedAncestors
public atg.commerce.multisite.CommerceSitePropertiesManager getCommerceSitePropertiesManager()
public void setCommerceSitePropertiesManager(atg.commerce.multisite.CommerceSitePropertiesManager pCommerceSitePropertiesManager)
public ContextValueRetriever getContextValueRetriever()
public void setContextValueRetriever(ContextValueRetriever pContextValueRetriever)
public boolean isVerifyCatalog()
public void setVerifyCatalog(boolean pVerifyCatalog)
pVerifyCatalog
- True if the item should be verified else false.public void doStartService() throws ServiceException
null
and the repository contains exactly one catalog item, that
item becomes the default. Otherwise, defaultCatalog remains null
.doStartService
in class CatalogTools
ServiceException
- if error occurspublic RepositoryItem[] getCatalogsForRepository(Repository pRepository, java.util.Collection pCatalogIds) throws RepositoryException
pRepository
- - the repository containing the catalog itemspCatalogIds
- - a collection of catalog ids to constrain the query for catalogsRepositoryException
public RepositoryItem[] getCatalogsThatIncludeCatalogInRootSubCatalogs(RepositoryItem pCatalog, Repository pRepository) throws RepositoryException
pCatalog
- - the catalog used to query catalogspRepository
- - the repository containing the catalog itemsRepositoryException
public RepositoryItem[] getCategoriesWithCatalogAsSubCatalog(RepositoryItem pCatalog, Repository pRepository) throws RepositoryException
pCatalog
- - the catalog used to query categoriespRepository
- - the repository containing the category itemsRepositoryException
public RepositoryItem[] getParentCategories(RepositoryItem pCategory, Repository pCatalogRepository) throws RepositoryException
pCategory
- - the category to get parents forpCatalogRepository
- - The repository where the catalog residesRepositoryException
public RepositoryItem[] getCatalogsWithCategoryAsRoot(RepositoryItem pCategory, Repository pCatalogRepository) throws RepositoryException
pCategory
- - the categorypCatalogRepository
- - The repository where the catalog resides.if null, defaults
to pCategory's repositoryRepositoryException
public java.util.LinkedList getAncestors(RepositoryItem pItem)
getAncestors
in class CatalogTools
pItem
- The category or product we are getting the ancestors forpublic java.util.LinkedList getAncestors(RepositoryItem pItem, RepositoryItem pCatalog)
pItem
- The category or product we are getting the ancestors forpCatalog
- The catalog to use as the key in the map of parent categories on each item.public RepositoryItem[] getCategoriesInCatalog(RepositoryItem pCatalog, Repository pCatalogRepository)
pCatalog
- The catalog to look inpCatalogRepository
- - the repository where the items reside. If null,
pCatalog's repository is assumed.public RepositoryItem findCatalogItem(java.lang.String pId, java.lang.String pCatalogKey) throws RepositoryException
RepositoryException
- if there was an error attempting to find the itempublic RepositoryItem findCatalogItem(java.lang.String pId) throws RepositoryException
RepositoryException
- if there was an error attempting to find the itempublic RepositoryItem[] findCatalogItems(java.lang.String[] pIds, java.lang.String pCatalogKey) throws RepositoryException
RepositoryException
- if there was an error attempting to find the itempublic RepositoryItem[] findCatalogItems(java.lang.String[] pIds) throws RepositoryException
RepositoryException
- if there was an error attempting to find the itempublic RepositoryItem findCategory(java.lang.String pId, java.lang.String pCatalogKey, boolean pVerifyCatalog) throws RepositoryException
RepositoryException
- if there was an error attempting to find the itempublic RepositoryItem findCategory(java.lang.String pId, java.lang.String pCatalogKey, RepositoryItem pCatalog) throws RepositoryException
RepositoryException
- if there was an error attempting to find the itempublic RepositoryItem findCategory(java.lang.String pId, java.lang.String pCatalogKey) throws RepositoryException
findCategory
in class CatalogTools
RepositoryException
- if there was an error attempting to find the itempublic RepositoryItem findCategory(java.lang.String pId) throws RepositoryException
findCategory
in class CatalogTools
RepositoryException
- if there was an error attempting to find the itempublic RepositoryItem[] findCategories(java.lang.String[] pIds, java.lang.String pCatalogKey, boolean pVerifyCatalog) throws RepositoryException
RepositoryException
- if there was an error attempting to find the itempublic RepositoryItem[] findCategories(java.lang.String[] pIds, java.lang.String pCatalogKey, RepositoryItem pCatalog) throws RepositoryException
RepositoryException
- if there was an error attempting to find the itempublic RepositoryItem[] findCategories(java.lang.String[] pIds, java.lang.String pCatalogKey) throws RepositoryException
findCategories
in class CatalogTools
RepositoryException
- if there was an error attempting to find the itempublic RepositoryItem[] findCategories(java.lang.String[] pIds) throws RepositoryException
findCategories
in class CatalogTools
RepositoryException
- if there was an error attempting to find the itempublic RepositoryItem findProduct(java.lang.String pId, java.lang.String pCatalogKey, boolean pVerifyCatalog) throws RepositoryException
RepositoryException
- if there was an error attempting to find the itempublic RepositoryItem findProduct(java.lang.String pId, java.lang.String pCatalogKey, RepositoryItem pCatalog) throws RepositoryException
RepositoryException
- if there was an error attempting to find the itempublic RepositoryItem findProduct(java.lang.String pId, java.lang.String pCatalogKey) throws RepositoryException
findProduct
in class CatalogTools
RepositoryException
- if there was an error attempting to find the itempublic RepositoryItem findProduct(java.lang.String pId) throws RepositoryException
findProduct
in class CatalogTools
RepositoryException
- if there was an error attempting to find the itempublic RepositoryItem[] findProducts(java.lang.String[] pIds, java.lang.String pCatalogKey, boolean pVerifyCatalog) throws RepositoryException
RepositoryException
- if there was an error attempting to find the itempublic RepositoryItem[] findProducts(java.lang.String[] pIds, java.lang.String pCatalogKey, RepositoryItem pCatalog) throws RepositoryException
RepositoryException
- if there was an error attempting to find the itempublic RepositoryItem[] findProducts(java.lang.String[] pIds, java.lang.String pCatalogKey) throws RepositoryException
findProducts
in class CatalogTools
RepositoryException
- if there was an error attempting to find the itempublic RepositoryItem[] findProducts(java.lang.String[] pIds) throws RepositoryException
findProducts
in class CatalogTools
RepositoryException
- if there was an error attempting to find the itempublic RepositoryItem findSKU(java.lang.String pId, java.lang.String pCatalogKey, boolean pVerifyCatalog) throws RepositoryException
RepositoryException
- if there was an error attempting to find the itempublic RepositoryItem findSKU(java.lang.String pId, java.lang.String pCatalogKey, RepositoryItem pCatalog) throws RepositoryException
RepositoryException
- if there was an error attempting to find the itempublic RepositoryItem findSKU(java.lang.String pId, java.lang.String pCatalogKey) throws RepositoryException
findSKU
in class CatalogTools
RepositoryException
- if there was an error attempting to find the itempublic RepositoryItem findSKU(java.lang.String pId) throws RepositoryException
findSKU
in class CatalogTools
RepositoryException
- if there was an error attempting to find the itempublic RepositoryItem[] findSKUs(java.lang.String[] pIds, java.lang.String pCatalogKey, boolean pVerifyCatalog) throws RepositoryException
RepositoryException
- if there was an error attempting to find the itemspublic RepositoryItem[] findSKUs(java.lang.String[] pIds, java.lang.String pCatalogKey, RepositoryItem pCatalog) throws RepositoryException
RepositoryException
- if there was an error attempting to find the itemspublic RepositoryItem[] findSKUs(java.lang.String[] pIds, java.lang.String pCatalogKey) throws RepositoryException
findSKUs
in class CatalogTools
RepositoryException
- if there was an error attempting to find the itemspublic RepositoryItem[] findSKUs(java.lang.String[] pIds) throws RepositoryException
findSKUs
in class CatalogTools
RepositoryException
- if there was an error attempting to find the itemspublic RepositoryItem getCurrentCatalog()
profileCatalogPropertyName
CatalogContext.setCurrentCatalog(RepositoryItem)
public boolean verifyCatalog(RepositoryItem pItem)
public boolean verifyCatalog(RepositoryItem pItem, RepositoryItem pCatalog)
public java.util.Collection getRootCategoriesForCatalog(RepositoryItem pCatalog, Repository pCatalogRepository) throws RepositoryException
RepositoryException
public java.util.Collection getCatalogsContainingThisCatalog(RepositoryItem pCatalog, Repository pCatalogRepository) throws RepositoryException
pCatalog
- The catalog whose "parents" will be returnedpCatalogRepository
- The repository containing pCatalogRepositoryException
public java.util.Collection getProductsCategories(RepositoryItem pProduct, Repository pCatalogRepository) throws RepositoryException
pProduct
- The product contained in all the returned categoriespCatalogRepository
- The repository containing the given productRepositoryException
public java.util.List getAllAncestorCategories(RepositoryItem pItem) throws RepositoryException
RepositoryException
public java.util.Collection getCategoriesContainingThisCategorysCatalog(RepositoryItem pCategory, Repository pCatalogRepository) throws RepositoryException
pCategory
- - category whose catalog to search forpCatalogRepository
- - the Catalog's repositoryRepositoryException
public java.util.Collection getCategoriesWithIndirectPathToCategory(RepositoryItem pCategory) throws RepositoryException
pCategory
- - category to processRepositoryException
public java.util.Set<RepositoryItem> getEnclosingCatalogsForCategory(RepositoryItem pCategory) throws RepositoryException
pCategory
- The catalog to find the enclosing catalogs for.RepositoryException
- If an error occurs in the underlying repository API.protected void walkUpCategoryTree(RepositoryItem pCategory, java.util.Set<RepositoryItem> pPath, java.util.Set<RepositoryItem> pEnclosingCatalogs) throws RepositoryException
pCategory
- - category repository itempPath
- - set of category's that we have already visited (to defend against looping)pEnclosingCatalogs
- - set of enclosing catalogs retrieved so farRepositoryException
public java.util.Collection getCategoriesWithIndirectPathToCatalog(RepositoryItem pCatalog) throws RepositoryException
pCatalog
- - catalog to processRepositoryException
public java.util.Collection computeRecursedRootSubCatalogs(RepositoryItem pCatalog) throws RepositoryException
pCatalog
- - catalog to processRepositoryException
public java.util.Collection getCategoriesContainingThisCatalog(RepositoryItem pCatalog, Repository pCatalogRepository) throws RepositoryException
pCatalog
- - catalog to search forpCatalogRepository
- - the Catalog's repositoryRepositoryException
public boolean isCategoryReferenced(RepositoryItem pCategory, RepositoryItem pCatalog, Repository pCatalogRepository) throws RepositoryException
pCategory
- The category to checkpCatalog
- The catalog currently referenced by category.catalogpCatalogRepository
- The repository containing the categoryRepositoryException
public void setState(java.lang.String pState) throws RepositoryException
pState
- The state of different Catalog ServiceRepositoryException
public void setState(java.util.Collection pCatalogIds, java.lang.String pState) throws RepositoryException
pCatalogIds
- The collections of catalogspState
- The state of different Catalog ServiceRepositoryException
public java.util.List filterCollectionByCatalog(RepositoryItem pCatalog, java.util.Collection pCollection)
pCollection
and
add to the resulted list items whose collection of catalogs
contains pCatalog
.pCatalog
- catalog repository itempCollection
- collection of repository itemspublic RepositoryItem getCatalogForSite() throws RepositoryException
RepositoryException
public RepositoryItem getCatalogForSite(RepositoryItem pSite) throws RepositoryException
pSite
- Site to obtain the catalog fromRepositoryException
public RepositoryItem determineCatalog(RepositoryItem pProfile, RepositoryItem pSite) throws RepositoryException
pProfile
- Profile to get the catalog forpSite
- Site to get the catalog fromRepositoryException
public RepositoryItem determineCatalog(atg.commerce.util.ContextValueRetrieverArguments pArguments) throws RepositoryException
pArguments
- an object containing properties, such as site and profile, needed to determine what catalog to useRepositoryException
public RepositoryItem[] getCatalogs(java.lang.String[] pCatalogIds) throws RepositoryException
pCatalogIds
is empty, returns all catalog items.pCatalogIds
- array of catalog IdsRepositoryException
public java.util.List filterCollectionByCatalogs(RepositoryItem[] pCatalogs, java.util.Collection pCollection)
pCollection
and
add to the resulted list items whose collection of catalogs
contains at least one catalog from pCatalogs
array.pCatalogs
- array of catalogs repository itemspCollection
- collection of repository itemspublic boolean isCatalog(java.lang.Object pObj) throws RepositoryException
RepositoryException
public boolean isCatalogFolder(java.lang.Object pObj) throws RepositoryException
RepositoryException
public QueryBuilder getCatalogQueryBuilder() throws RepositoryException
RepositoryException
public RepositoryItem getParentCategory(RepositoryItem pItem, RepositoryItem pCatalog) throws RepositoryException
pItem
- the category or product for which we want to retrieve the best category parent. If null, null is
returned.pCatalog
- used as the context to lookup the parent category via the derived propertyRepositoryException
- If an exception occurs in the underlying repository APIprotected java.lang.Object getKeyFromCatalog(java.lang.Object pCatalog) throws RepositoryException
RepositoryException
protected Query removeQuerySiteConstraints(QueryBuilder pQueryBuilder, Query pBaseQuery) throws RepositoryException
pQueryBuilder
- The QueryBuilder used to construct pBaseQuerypBaseQuery
- The Query to be adjusted to ignore site membershipRepositoryException
protected java.util.List<RepositoryItem> toList(java.lang.String pIds, java.lang.String pItemDescName) throws RepositoryException
pIds
- comma-separated list of idspItemDescName
- name of item-descriptor in product catalog repositoryRepositoryException
- If the repository API throws an exceptionprotected java.lang.String fromList(java.util.List<RepositoryItem> pItems)
pItems
- The list of items