atg.commerce.catalog.custom
Class CatalogUpdateService

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.service.scheduler.SchedulableService
              extended by atg.service.scheduler.SingletonSchedulableService
                  extended by atg.commerce.catalog.CMSService
                      extended by atg.commerce.catalog.custom.TreeWalkUpdateService
                          extended by atg.commerce.catalog.custom.CatalogUpdateService
All Implemented Interfaces:
atg.commerce.catalog.CMSConstants, atg.naming.AbsoluteNameable, NameContextBindingListener, NameContextElement, atg.naming.NameContextParentable, NameResolver, AdminableService, atg.nucleus.Configured, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, Schedulable, java.util.EventListener
Direct Known Subclasses:
CatalogMigrationService

public class CatalogUpdateService
extends atg.commerce.catalog.custom.TreeWalkUpdateService

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 If this component is to be used on a versioned repository, the publishingWorkflowAutomator property must be set so that the CA workflow and projects will be used.

See Also:
CatalogCompletionService

Nested Class Summary
 
Nested classes/interfaces inherited from class atg.commerce.catalog.custom.TreeWalkUpdateService
atg.commerce.catalog.custom.TreeWalkUpdateService.ShadowBean, atg.commerce.catalog.custom.TreeWalkUpdateService.ShadowMapKey, atg.commerce.catalog.custom.TreeWalkUpdateService.UpdateRange, atg.commerce.catalog.custom.TreeWalkUpdateService.UpdateRangeViaGSA
 
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.commerce.catalog.custom.TreeWalkUpdateService
GENERIC_LOOP, PROCESS_NAME_PREFIX
 
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_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
CatalogUpdateService()
           
 
Method Summary
 java.lang.String getNameToLog()
           
 java.lang.String getProjectActivityID()
          Deprecated. @see #getPublishingWorkflowAutomator
 atg.epub.PublishingWorkflowSession getPublishingWorkflowAutomator()
          Gets the publishing workflow automator used to manage projects when service is run on publishing.
 java.lang.String getServiceName()
           
 boolean getStartWorkflowSession()
          Returns true if a new workflow session is created when this service is run.
protected  void goingDownUpdateItem(RepositoryItem pParentItem, RepositoryItem pCurrentItem, atg.commerce.catalog.custom.TreeWalkUpdateService.ShadowBean pShadowBean)
          This method sets all the properties calculated by this service that are pulled down from the top of the tree.
protected  void goingUpUpdateItem(RepositoryItem pParentItem, RepositoryItem pCurrentItem, atg.commerce.catalog.custom.TreeWalkUpdateService.ShadowBean pShadowBean)
          This method sets all the properties calculated by this service the are pulled up from the bottom of the tree.
 void setProjectActivityID(java.lang.String pProjectActivityID)
          Deprecated. @see #setPublishingWorkflowAutomator
 void setPublishingWorkflowAutomator(atg.epub.PublishingWorkflowSession pPublishingWorkflowAutomator)
          Sets the publishing workflow automator used to manage projects when service is run on publishing.
 void setStartWorkflowSession(boolean pStartWorkflowSession)
          Sets if a new workflow session is created when this service is run.
protected  void updateCatalog()
          The main method does some basic setup and logging, calls processTree and then does some cleanup.
protected  void updateCatalog(java.util.Collection<RepositoryItem> pItemsToProcess)
          Just dropped the passed in items and run the entire catalog
 
Methods inherited from class atg.commerce.catalog.custom.TreeWalkUpdateService
buildParentCategoriesForCatalog, getCatalogIds, getCatalogProperties, getCatalogTools, getCategoryLeafNodeArray, getCompletedItems, getDatabaseProductName, getDynamicChildrenList, getDynamicProducts, getDynamicProductsMap, getMaxItemsPerTransaction, getProcessName, getProjectWorkflow, getRangeQueryRows, getRepository, getServiceFunctions, getSizeOfBatch, isCatalogFoundInTreeStep, isComputeSubCatalogs, isIncludeDynamicChildren, performService, processTree, processTreeItems, recurseTreeAndGetCategories, setCatalogFoundInTreeStep, setCatalogIds, setCatalogProperties, setCatalogTools, setCompletedItems, setComputeSubCatalogs, setDatabaseProductName, setDynamicProductsMap, setIncludeDynamicChildren, setMaxItemsPerTransaction, setProjectWorkflow, setPropertyValueAddAll, setRangeQueryRows, setRepository, setServiceFunctions, setSizeOfBatch, stringIt, stringIt, subProcessTree, treeStep, updateDynamicChildren, updateProducts, updateProductsViaBatch, updateRepository, updateRepositoryItem, updateSkus, updateSkusViaBatch
 
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, getJobId, getJobName, getSchedule, getScheduler, getThreadMethod, getThreadMethodString, isTransactional, setJobDescription, setJobName, setSchedule, setScheduler, setThreadMethod, setThreadMethodString, setTransactional, startScheduledJob, stopScheduledJob
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logError, logError, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, 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

CatalogUpdateService

public CatalogUpdateService()
Method Detail

getNameToLog

public java.lang.String getNameToLog()
Overrides:
getNameToLog in class atg.commerce.catalog.custom.TreeWalkUpdateService

getServiceName

public java.lang.String getServiceName()
Specified by:
getServiceName in class atg.commerce.catalog.CMSService

getProjectActivityID

public java.lang.String getProjectActivityID()
Deprecated. @see #getPublishingWorkflowAutomator

Returns:
null

setProjectActivityID

public void setProjectActivityID(java.lang.String pProjectActivityID)
Deprecated. @see #setPublishingWorkflowAutomator

Parameters:
pProjectActivityID - does nothing

getPublishingWorkflowAutomator

public atg.epub.PublishingWorkflowSession getPublishingWorkflowAutomator()
Gets the publishing workflow automator used to manage projects when service is run on publishing.

Returns:
The PublishingWorkflowAutomator for this service.

setPublishingWorkflowAutomator

public void setPublishingWorkflowAutomator(atg.epub.PublishingWorkflowSession pPublishingWorkflowAutomator)
Sets the publishing workflow automator used to manage projects when service is run on publishing.

Parameters:
pPublishingWorkflowAutomator - The PublishingWorkflowAutomator for this service.

getStartWorkflowSession

public boolean getStartWorkflowSession()
Returns true if a new workflow session is created when this service is run.

Returns:
True if a workflow session should be created (default).

setStartWorkflowSession

public void setStartWorkflowSession(boolean pStartWorkflowSession)
Sets if a new workflow session is created when this service is run. If set to not create a workflow, then this service must be run in the context of a project.

Parameters:
pStartWorkflowSession - False if a workflow session should not be created. Default is true.

updateCatalog

protected void updateCatalog(java.util.Collection<RepositoryItem> pItemsToProcess)
Just dropped the passed in items and run the entire catalog


updateCatalog

protected void updateCatalog()
The main method does some basic setup and logging, calls processTree and then does some cleanup. When running in versioned environment, in addition to the above functionality, it creates a project using configured workflow and make the associated workspace current development line before making any changes to the catalog.

Specified by:
updateCatalog in class atg.commerce.catalog.custom.TreeWalkUpdateService

goingDownUpdateItem

protected void goingDownUpdateItem(RepositoryItem pParentItem,
                                   RepositoryItem pCurrentItem,
                                   atg.commerce.catalog.custom.TreeWalkUpdateService.ShadowBean pShadowBean)
                            throws RepositoryException
This method sets all the properties calculated by this service that are pulled down from the top of the tree. Most of the attributes that are updated are pulled down from the top. Since this method can be called passing catalogs, categories or folders we need to check what the parent item and child items are. Since all 3 item types (catalog, category and folder) all update site we do not need to check the type to do the update. Catalog attributes being updated are: DirectAncestorCatalogsAndSelf, IndirectAncestorCatalogs, AncestorCategories, Sites Category attributes being updated are: ComputedCatalogs, ParentCatalog, AncestorCategories, Sites Folder attributes being updated are: Sites

Specified by:
goingDownUpdateItem in class atg.commerce.catalog.custom.TreeWalkUpdateService
Parameters:
pParentItem - the parent item is the item that the data will be pulled from
pCurrentItem - the current item is the item that will be updated with data from the pParentItem.
Throws:
RepositoryException - the repository exception

goingUpUpdateItem

protected void goingUpUpdateItem(RepositoryItem pParentItem,
                                 RepositoryItem pCurrentItem,
                                 atg.commerce.catalog.custom.TreeWalkUpdateService.ShadowBean pShadowBean)
                          throws RepositoryException
This method sets all the properties calculated by this service the are pulled up from the bottom of the tree. Currently the only value pulled up is the AllRootCategories. This is the first category while walking down each branch.

Specified by:
goingUpUpdateItem in class atg.commerce.catalog.custom.TreeWalkUpdateService
Parameters:
pParentItem - the parent item that will be updated.
pCurrentItem - the current item is used to pull the data from for the pParentItem update.
Throws:
RepositoryException - the repository exception