|
|||||||||
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.service.scheduler.SchedulableService atg.service.scheduler.SingletonSchedulableService atg.commerce.catalog.CMSService atg.commerce.catalog.custom.CatalogUpdateService
public class CatalogUpdateService
This service batch-computes the properties that are usually maintained
by CatalogCompletionService
. This can be used either as
a migration tool, or if you want to disable CatalogCompletionService
for performance reasons, and then batch-compute the properties with
this service. Properties computed by this service:
catalog.directAncestorCatalogsAndSelf
catalog.allRootCategories
catalog.indirectAncestorCatalogs
catalog.ancestorCategories
category.parentCategory
category.parentCatalog
CatalogCompletionService
Nested Class Summary |
---|
Nested classes/interfaces inherited from class atg.commerce.catalog.CMSService |
---|
atg.commerce.catalog.CMSService.BookkeepingForThread |
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string |
Fields inherited from class atg.service.scheduler.SchedulableService |
---|
mJobId |
Fields inherited from class atg.nucleus.GenericService |
---|
SERVICE_INFO_KEY |
Fields inherited from interface atg.commerce.catalog.CMSConstants |
---|
AGS_GENANCESTORS, AGS_GENCATALOGS, AGS_GENPARENTCATS, ANCESTORS_GENERATED, CATALOGS_UPDATED, CATALOGS_VERIFIED, CATEGORIES_VERIFIED, CUS_UPDATECATALOGS, CVS_VERIFYCATALOGS, CVS_VERIFYCATEGORIES, CVS_VERIFYPRODUCTS, CVS_VERIFYSKUS, DEFAULT_CATALOG_ITEM_TYPE, DEFAULT_MAP_SIZE, GENERATED_ANCESTORS, INFOS_GENERATED, IS_ANCESTORS_GENERATED, 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 | |
---|---|
CatalogUpdateService()
|
Method Summary | |
---|---|
void |
catalogTreeStep(Repository pCatalogRepository,
MutableRepositoryItem pBaseItem,
MutableRepositoryItem pCurrentItem,
MutableRepositoryItem pPreviousItem,
boolean pDirect,
java.util.Map pCompletedItems)
This is a recursive method that traverses up the catalog tree, starting with a baseItem, and visiting all its parent categories and catalogs, compiling all the incrementally-computed properties |
void |
categoryTreeStep(Repository pCatalogRepository,
MutableRepositoryItem pBaseItem,
MutableRepositoryItem pCurrentItem,
MutableRepositoryItem pPreviousItem,
boolean pDirect,
java.util.Map pCompletedItems)
This is a recursive method that traverses up the catalog tree, starting with a baseItem, and visiting all its parent categories and catalogs, compiling all the incrementally-computed properties |
void |
clearProperties(Repository pCatalogRepository)
This method sets all the properties calculated by this service in all catalog and category items to null |
CatalogProperties |
getCatalogProperties()
A helper class that holds commonly accessed reposority property and item names |
CustomCatalogTools |
getCatalogTools()
Returns property catalogTools |
int |
getMaxItemsPerTransaction()
Returns property maxItemsPerTransaction |
java.lang.String |
getServiceName()
|
boolean |
isComputeSubCatalogs()
Returns property computeSubCatalogs |
boolean |
performService(Repository pRepository,
java.util.Collection pCatalogIds,
java.util.List pServiceFunctions)
Performs this services functions. |
void |
setCatalogProperties(CatalogProperties pCatalogProperties)
|
void |
setCatalogTools(CustomCatalogTools pCatalogTools)
Sets property catalogTools |
void |
setCompletedCatalogs(java.util.Map pCompletedCatalogs)
Sets the catalogs that have been used as a starting point for a catalog tree walk |
void |
setComputeSubCatalogs(boolean pComputeSubCatalogs)
Sets boolean indicating if the subCatalogs property of the catalog item should be computed. |
void |
setMaxItemsPerTransaction(int pMaxItemsPerTransaction)
Sets the maximum number of repository items that will be handled within a single transaction |
protected java.lang.String |
stringIt(java.util.Collection pObject)
|
protected java.lang.String |
stringIt(java.lang.Object[] pObject)
|
void |
updateCatalog(Repository pCatalogRepository)
The main method iterates through all the catalogs, sets the "directAncestorCatalogsAndSelf" property of the catalog to itself, calls the recursive "catalogTreeStep" method, which starts a walk up the catalog tree, and then adds the catalog to the "completed" list |
Methods inherited from class atg.commerce.catalog.CMSService |
---|
addErrorMessage, addInfoMessage, addWarningMessage, clearBookkeepingForThread, clearMessages, createCMSMessage, doScheduledTask, doService, getAvailableFunctions, getBookkeepingForThread, getCurrentMessages, getErrorMessages, getFunctionsToPerformByDefault, getInfoMessages, getServiceLock, getTotalNumberOfErrorMessages, getTotalNumberOfInfoMessages, getTotalNumberOfMessages, getTotalNumberOfWarningMessages, getTransactionManager, getWarningMessages, hasFunction, isSaveMessages, logDebug, logError, logInfo, logWarning, performService, postService, preService, removeServiceLock, setAvailableFunctions, setFunctionsToPerformByDefault, setSaveMessages, setTransactionManager |
Methods inherited from class atg.service.scheduler.SingletonSchedulableService |
---|
acquireLock, getClientLockManager, getLockName, getLockTimeOut, performScheduledTask, releaseLock, setClientLockManager, setLockName, setLockTimeOut |
Methods inherited from class atg.service.scheduler.SchedulableService |
---|
doStartService, doStopService, getJobDescription, getJobName, getSchedule, getScheduler, getThreadMethod, isTransactional, setJobDescription, setJobName, setSchedule, setScheduler, setThreadMethod, setTransactional, startScheduledJob, stopScheduledJob |
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 CatalogUpdateService()
Method Detail |
---|
public void setCatalogTools(CustomCatalogTools pCatalogTools)
public CustomCatalogTools getCatalogTools()
public void setCatalogProperties(CatalogProperties pCatalogProperties)
public CatalogProperties getCatalogProperties()
public void setCompletedCatalogs(java.util.Map pCompletedCatalogs)
public void setComputeSubCatalogs(boolean pComputeSubCatalogs)
public boolean isComputeSubCatalogs()
public void setMaxItemsPerTransaction(int pMaxItemsPerTransaction)
public int getMaxItemsPerTransaction()
public java.lang.String getServiceName()
getServiceName
in class atg.commerce.catalog.CMSService
public boolean performService(Repository pRepository, java.util.Collection pCatalogIds, java.util.List pServiceFunctions)
performService
in class atg.commerce.catalog.CMSService
pRepository
- - Not used. Repository is defined in catalogRepositoryPropertypCatalogIds
- - Not used. Entire repository is always processedpServiceFunctions
- - a list of strings that identify service functions. used to
conditionally executed specific functions of a service
public void updateCatalog(Repository pCatalogRepository) throws CatalogLoopException
CatalogLoopException
- if there is a catalog that is an ancestor of itselfpublic void catalogTreeStep(Repository pCatalogRepository, MutableRepositoryItem pBaseItem, MutableRepositoryItem pCurrentItem, MutableRepositoryItem pPreviousItem, boolean pDirect, java.util.Map pCompletedItems) throws RepositoryException, TransactionDemarcationException, CatalogLoopException
pBaseItem
- - The repository item that was the starting point of the current walk up
the catalog tree.pCurrentItem
- - The repository item that represents the current point of the tree walkpPreviousItem
- - The repository item that represents the most recent point of the tree walkpDirect
- - Boolean indicating if, to this point in the tree walk, we have seen only
directly-connect catalog items (i.e., we have not reached a category item yet)pCompletedItems
- - A map of all repository items that we have already seen on this tree walk,
this is used to check for loops in the structure.
RepositoryException
TransactionDemarcationException
CatalogLoopException
public void categoryTreeStep(Repository pCatalogRepository, MutableRepositoryItem pBaseItem, MutableRepositoryItem pCurrentItem, MutableRepositoryItem pPreviousItem, boolean pDirect, java.util.Map pCompletedItems) throws RepositoryException, TransactionDemarcationException, CatalogLoopException
pBaseItem
- - The repository item that was the starting point of the current walk up
the catalog tree.pCurrentItem
- - The repository item that represents the current point of the tree walkpPreviousItem
- - The repository item that represents the most recent point of the tree walkpDirect
- - Boolean indicating if, to this point in the tree walk, we have seen only
directly-connect catalog items (i.e., we have not reached a category item yet)pCompletedItems
- - A map of all repository items that we have already seen on this tree walk,
this is used to check for loops in the structure.
RepositoryException
TransactionDemarcationException
CatalogLoopException
public void clearProperties(Repository pCatalogRepository)
protected java.lang.String stringIt(java.util.Collection pObject)
stringIt
in class atg.commerce.catalog.CMSService
protected java.lang.String stringIt(java.lang.Object[] pObject)
stringIt
in class atg.commerce.catalog.CMSService
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |