|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.nucleus.logging.VariableArgumentApplicationLoggingImpl atg.nucleus.GenericService atg.commerce.catalog.CatalogTools atg.commerce.catalog.custom.CustomCatalogTools
public class CustomCatalogTools
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.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 |
---|
public static final java.lang.String CLASS_VERSION
Constructor Detail |
---|
public CustomCatalogTools()
Method Detail |
---|
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 catalogs
RepositoryException
public RepositoryItem[] getCatalogsThatIncludeCatalogInRootSubCatalogs(RepositoryItem pCatalog, Repository pRepository) throws RepositoryException
pCatalog
- - the catalog used to query catalogspRepository
- - the repository containing the catalog items
RepositoryException
public RepositoryItem[] getCategoriesWithCatalogAsSubCatalog(RepositoryItem pCatalog, Repository pRepository) throws RepositoryException
pCatalog
- - the catalog used to query categoriespRepository
- - the repository containing the category items
RepositoryException
public RepositoryItem[] getParentCategories(RepositoryItem pCategory, Repository pCatalogRepository) throws RepositoryException
pCategory
- - the category to get parents forpCatalogRepository
- - The repository where the catalog resides
RepositoryException
public RepositoryItem[] getCatalogsWithCategoryAsRoot(RepositoryItem pCategory, Repository pCatalogRepository) throws RepositoryException
pCategory
- - the categorypCatalogRepository
- - The repository where the catalog resides.if null, defaults
to pCategory's repository
RepositoryException
public java.util.LinkedList getAncestors(RepositoryItem pItem)
getAncestors
in class CatalogTools
pItem
- The category or product we are getting the ancestors for
public 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 pCatalog
RepositoryException
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 product
RepositoryException
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 repository
RepositoryException
public java.util.Collection getCategoriesWithIndirectPathToCategory(RepositoryItem pCategory) throws RepositoryException
pCategory
- - category to process
RepositoryException
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 far
RepositoryException
public java.util.Collection getCategoriesWithIndirectPathToCatalog(RepositoryItem pCatalog) throws RepositoryException
pCatalog
- - catalog to process
RepositoryException
public java.util.Collection computeRecursedRootSubCatalogs(RepositoryItem pCatalog) throws RepositoryException
pCatalog
- - catalog to process
RepositoryException
public java.util.Collection getCategoriesContainingThisCatalog(RepositoryItem pCatalog, Repository pCatalogRepository) throws RepositoryException
pCatalog
- - catalog to search forpCatalogRepository
- - the Catalog's repository
RepositoryException
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 category
RepositoryException
public void setState(java.lang.String pState) throws RepositoryException
pState
- The state of different Catalog Service
RepositoryException
public void setState(java.util.Collection pCatalogIds, java.lang.String pState) throws RepositoryException
pCatalogIds
- The collections of catalogspState
- The state of different Catalog Service
RepositoryException
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 items
public RepositoryItem getCatalogForSite() throws RepositoryException
RepositoryException
public RepositoryItem getCatalogForSite(RepositoryItem pSite) throws RepositoryException
pSite
- Site to obtain the catalog from
RepositoryException
public RepositoryItem determineCatalog(RepositoryItem pProfile, RepositoryItem pSite) throws RepositoryException
pProfile
- Profile to get the catalog forpSite
- Site to get the catalog from
RepositoryException
public RepositoryItem determineCatalog(atg.commerce.util.ContextValueRetrieverArguments pArguments) throws RepositoryException
pContext
- an object containing properties, such as site and profile, needed to determine what catalog to use
RepositoryException
public RepositoryItem[] getCatalogs(java.lang.String[] pCatalogIds) throws RepositoryException
pCatalogIds
is empty, returns all catalog items.
pCatalogIds
- array of catalog Ids
RepositoryException
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 items
public 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 parentpCatalog
- used as the context to lookup the parent category via the derived property
RepositoryException
- 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 membership
RepositoryException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |