atg.commerce.catalog.custom
Class AncestorGeneratorService

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.AncestorGeneratorService
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

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

This CMSService performs the following service functions Available service functions: AGS_GENPROPERTIES - generate catalog, catalogs, and AncestorCategories (for catalogs, products, skus) AGS_GENCATALOGS - generate catalog and catalogs (for catalogs, products and skus) AGS_GENPARENTCATS - generate parent categories AGS_GENANCESTORS - generate ancestors (for products and skus) AGS_GENPROPERTIES_FOR_CATEGORY - only generate category and above AGS_GENPROPERTIES_FOR_PRODUCT - only generate product and above

See Also:
this.getAvailableFunctions, generateAncestors, generates the set of ancestor categories for each category and product in each catalog in the catalog repository, and updates the ancestorCategories property.

Methods generateCategoryAncestors and generateProductAncestors can be called to update the ancestors for only categories or products, respectively.

generateCatalogAndCatalogs, generates the catalog and catalogs properties for all categories, products and skus in each catalog generateCatalogParentCategoriesForProducts, generates the parent category at the catalog level. This is necessary when more than one category in a catalog has the same product as a childProduct.

Methods generateCatalogsForProducts , generateCatalogsForSkus and generateCatalogAndCatalogsForCategories can be called to update the catalogs and catalogs properties for only categories, products or skus, respectively.

This set is used in hierarchical search. You may limit this to specific catalogs by provide a Collection of catalog ids.,


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
AncestorGeneratorService()
           
 
Method Summary
protected  void close(java.sql.ResultSet pResultSet)
          Close a result set
protected  void close(atg.adapter.gsa.SQLStatement pStatement)
          Close an SQLStatement logging any SQLExceptions.
 void doStopService()
          The default implementation is to just stop our scheduled job.
protected  void generateAndExecuteRanges(RepositoryItemDescriptor pRepositoryItemDescriptor, RepositoryViewImpl pRepositoryView, java.lang.String pType)
          This method batches updates to the database in chunks.
 java.lang.String getCatalogsSQL()
          This SQL gets a list of catalogs from the skus parent products
protected  java.util.Collection<java.lang.String> getCategoriesForProduct(RepositoryItem pProduct)
          This checks the repository and the map that holds the dynamic products
 java.lang.String getDeleteCatalogsCheck()
          This method returns the sql that compares the product level catalogs with their child skus.
 java.lang.String getDeleteProductAncestorCategoriesCheck()
          This method returns the sql that compares the category level ancestor categories with their child products.
 java.lang.String getDeleteProductCatalogsCheck()
          This method returns the sql that compares the category level catalogs with their child products.
 java.lang.String getDeleteProductParentCategoriesForCatalogCheck()
          This method returns the sql that compares the category level parent categories for catalog with their child products.
 java.lang.String getDeleteProductSiteCheck()
          This method returns the SQL that compares the category level sites with their child product.
 java.lang.String getDeleteSiteCheck()
          This method returns the SQL that compares the product level sites with their child skus.
protected  java.util.List<java.lang.String> getDynamicProducts(Repository pRepository, RepositoryItem pItem)
           
protected  java.util.concurrent.ExecutorService getExecutor()
           
 java.lang.String getInsertCatalogsCheck()
          This method returns the SQL that compares the product level catalogs with their child skus.
 java.lang.String getInsertProductAncestorCategoriesCheck()
          This method returns the sql that compares the category level ancestor categories with their child products.
 java.lang.String getInsertProductCatalogsCheck()
          This method returns the SQL that compares the category level catalogs with their child products.
 java.lang.String getInsertProductParentCategoriesForCatalogCheck()
          This method returns the sql that compares the category level parent categories for catalog with their child products.
 java.lang.String getInsertProductSiteCheck()
          This method returns the sql that compares the category level sites with their child products.
 java.lang.String getInsertSiteCheck()
          This method returns the sql that compares the product level sites with their child skus.
 java.lang.String getNameToLog()
           
 int getNumberOfConcurrentUpdateThreads()
           
 int getNumberOfHoursToTimeOutThreads()
           
 java.lang.String getProductAncestorCategoriesSQL()
          This method returns the SQL that compares the category level ancestor categories with their child products.
 java.lang.String getProductCatalogsSQL()
          This SQL gets a list of catalogs from the products parent categories
 java.lang.String getProductParentCategoriesForCatalogsSQL()
          This SQL gets a list of parent categories for Catalog from the products parent category
 java.lang.String getProductSitesSQL()
          This SQL gets a list of sites from the skus parent products
 java.lang.String getServiceName()
           
 java.lang.String getSitesSQL()
          This SQL gets a list of sites from the skus parent products
protected  atg.commerce.catalog.custom.AncestorGeneratorService.GSATableAndColumnNames getTableAndColumnNames()
           
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 shadowBean)
          This method sets all the properties calculated by this service the are pulled up from the bottom of the tree.
protected  boolean isShutDownInProcess()
           
 boolean isUpdateCatalogsProperty()
          Returns the value of the UpdateCatalogsProperty property
 boolean isUpdateSitesProperty()
          Returns the value of the UpdateSitesProperty property
 boolean preService(Repository pRepository, java.util.Collection pCatalogIds, java.util.List pServiceFunctions)
          Method called prior to start of maintenance
 void setCatalogSQL(java.lang.String pCatalogSQL)
           
 void setDeleteCatalogsCheck(java.lang.String pDeleteCatalogsCheck)
           
 void setDeleteProductAncestorCategoriesCheck(java.lang.String pDeleteProductAncestorCategoriesCheck)
           
 void setDeleteProductParentCategoriesForCatalogCheck(java.lang.String pDeleteProductParentCategoriesForCatalogCheck)
           
 void setDeleteProductSiteCheck(java.lang.String pDeleteProductSiteCheck)
           
 void setDeleteSiteCheck(java.lang.String pDeleteSiteCheck)
           
protected  void setExecutor(java.util.concurrent.ExecutorService pExecutorService)
           
 void setInsertCatalogsCheck(java.lang.String pInsertCatalogsCheck)
           
 void setInsertProductAncestorCategoriesCheck(java.lang.String pInsertProductAncestorCategoriesCheck)
           
 void setInsertProductCatalogsCheck(java.lang.String pInsertProductCatalogsCheck)
           
 void setInsertProductParentCategoriesForCatalogCheck(java.lang.String pInsertProductParentCategoriesForCatalogCheck)
           
 void setInsertProductSiteCheck(java.lang.String pInsertProductSiteCheck)
           
 void setInsertSiteCheck(java.lang.String pInsertSiteCheck)
           
 void setNumberOfConcurrentUpdateThreads(int pNumberOfConcurrentUpdateThreads)
           
 void setNumberOfHoursToTimeOutThreads(int pNumberOfHoursToTimeOutThreads)
           
 void setParentCategoriesForCatalogSQL(java.lang.String pParentCategoriesForCatalogSQL)
           
 void setProductAncestorCategoriesSQL(java.lang.String pProductAncestorCategoriesSQL)
           
 void setProductCatalogSQL(java.lang.String pProductCatalogSQL)
           
 void setProductDeleteCatalogsCheck(java.lang.String pDeleteProductCatalogsCheck)
           
 void setProductSitesSQL(java.lang.String pProductSitesSQL)
           
protected  void setShutDownInProcess(boolean pShutDownInProcess)
           
 void setSitesSQL(java.lang.String pSitesSQL)
           
protected  void setTableAndColumnNames(atg.commerce.catalog.custom.AncestorGeneratorService.GSATableAndColumnNames pTableAndColumnNames)
           
 void setUpdateCatalogsProperty(boolean pUpdateCatalogsProperty)
          Sets property UpdateCatalogsProperty
 void setUpdateSitesProperty(boolean pUpdateSitesProperty)
          Sets property UpdateSitesProperty
protected  void updateCatalog()
          The main method does some basic setup and logging, calls processTree and then does some cleanup.
protected  void updateProducts()
           
protected  void updateSkus()
           
 
Methods inherited from class atg.commerce.catalog.custom.TreeWalkUpdateService
buildParentCategoriesForCatalog, getCatalogIds, getCatalogProperties, getCatalogTools, getCategoryLeafNodeArray, getCompletedItems, getDatabaseProductName, getDynamicChildrenList, 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, updateProductsViaBatch, updateRepository, updateRepositoryItem, 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, 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, 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

AncestorGeneratorService

public AncestorGeneratorService()
Method Detail

getServiceName

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

getNameToLog

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

isUpdateSitesProperty

public boolean isUpdateSitesProperty()
Returns the value of the UpdateSitesProperty property


setUpdateSitesProperty

public void setUpdateSitesProperty(boolean pUpdateSitesProperty)
Sets property UpdateSitesProperty


isUpdateCatalogsProperty

public boolean isUpdateCatalogsProperty()
Returns the value of the UpdateCatalogsProperty property


setUpdateCatalogsProperty

public void setUpdateCatalogsProperty(boolean pUpdateCatalogsProperty)
Sets property UpdateCatalogsProperty


getNumberOfConcurrentUpdateThreads

public int getNumberOfConcurrentUpdateThreads()

setNumberOfConcurrentUpdateThreads

public void setNumberOfConcurrentUpdateThreads(int pNumberOfConcurrentUpdateThreads)

getNumberOfHoursToTimeOutThreads

public int getNumberOfHoursToTimeOutThreads()

setNumberOfHoursToTimeOutThreads

public void setNumberOfHoursToTimeOutThreads(int pNumberOfHoursToTimeOutThreads)

setExecutor

protected void setExecutor(java.util.concurrent.ExecutorService pExecutorService)

getExecutor

protected java.util.concurrent.ExecutorService getExecutor()

setShutDownInProcess

protected void setShutDownInProcess(boolean pShutDownInProcess)

isShutDownInProcess

protected boolean isShutDownInProcess()

setProductDeleteCatalogsCheck

public void setProductDeleteCatalogsCheck(java.lang.String pDeleteProductCatalogsCheck)

setTableAndColumnNames

protected void setTableAndColumnNames(atg.commerce.catalog.custom.AncestorGeneratorService.GSATableAndColumnNames pTableAndColumnNames)

getTableAndColumnNames

protected atg.commerce.catalog.custom.AncestorGeneratorService.GSATableAndColumnNames getTableAndColumnNames()

getDeleteProductCatalogsCheck

public java.lang.String getDeleteProductCatalogsCheck()
                                               throws RepositoryException
This method returns the sql that compares the category level catalogs with their child products. If the product has eny extra catalogs then they are flagged for delete further down in the code

Returns:
the sql to check if any product catalogs need to be removed
Throws:
RepositoryException

setDeleteCatalogsCheck

public void setDeleteCatalogsCheck(java.lang.String pDeleteCatalogsCheck)

getDeleteCatalogsCheck

public java.lang.String getDeleteCatalogsCheck()
                                        throws RepositoryException
This method returns the sql that compares the product level catalogs with their child skus. If the sku has eny extra catalogs then they are flagged for delete further down in the code

Returns:
the SQL to check if any sku catalogs need to be removed
Throws:
RepositoryException

setInsertProductCatalogsCheck

public void setInsertProductCatalogsCheck(java.lang.String pInsertProductCatalogsCheck)

getInsertProductCatalogsCheck

public java.lang.String getInsertProductCatalogsCheck()
                                               throws RepositoryException
This method returns the SQL that compares the category level catalogs with their child products. If the product is missing any catalogs then they are flagged for addition further down in the code.

Returns:
the SQL used to determine if any catalogs need to be added to the sku
Throws:
RepositoryException

setInsertCatalogsCheck

public void setInsertCatalogsCheck(java.lang.String pInsertCatalogsCheck)

getInsertCatalogsCheck

public java.lang.String getInsertCatalogsCheck()
                                        throws RepositoryException
This method returns the SQL that compares the product level catalogs with their child skus. If the sku is missing any catalogs then they are flagged for addition further down in the code.

Returns:
the sql used to determine if any catalogs need to be added to the sku
Throws:
RepositoryException

setDeleteProductSiteCheck

public void setDeleteProductSiteCheck(java.lang.String pDeleteProductSiteCheck)

getDeleteProductSiteCheck

public java.lang.String getDeleteProductSiteCheck()
                                           throws RepositoryException
This method returns the SQL that compares the category level sites with their child product. If the product has any extra sites then they are flagged for delete further down in the code

Returns:
the SQL used to check and see if any sites need to be removed from a group of skus
Throws:
RepositoryException

setDeleteSiteCheck

public void setDeleteSiteCheck(java.lang.String pDeleteSiteCheck)

getDeleteSiteCheck

public java.lang.String getDeleteSiteCheck()
                                    throws RepositoryException
This method returns the SQL that compares the product level sites with their child skus. If the sku has any extra sites then they are flagged for delete further down in the code

Returns:
the sql used to check and see if any sites need to be removed from a group of skus
Throws:
RepositoryException

setInsertProductSiteCheck

public void setInsertProductSiteCheck(java.lang.String pInsertProductSiteCheck)

getInsertProductSiteCheck

public java.lang.String getInsertProductSiteCheck()
                                           throws RepositoryException
This method returns the sql that compares the category level sites with their child products. If the product is missing any sites then they are flagged for addition further down in the code.

Returns:
the sql used to check and see if any sites need to be added within a group of skus
Throws:
RepositoryException

setInsertSiteCheck

public void setInsertSiteCheck(java.lang.String pInsertSiteCheck)

getInsertSiteCheck

public java.lang.String getInsertSiteCheck()
                                    throws RepositoryException
This method returns the sql that compares the product level sites with their child skus. If the sku is missing any sites then they are flagged for addition further down in the code.

Returns:
the SQL used to check and see if any sites need to be added within a group of skus
Throws:
RepositoryException

setSitesSQL

public void setSitesSQL(java.lang.String pSitesSQL)

getSitesSQL

public java.lang.String getSitesSQL()
                             throws RepositoryException
This SQL gets a list of sites from the skus parent products

Returns:
the sql to get the list of sites for a sku from the skus parent products
Throws:
RepositoryException

setProductSitesSQL

public void setProductSitesSQL(java.lang.String pProductSitesSQL)

getProductSitesSQL

public java.lang.String getProductSitesSQL()
                                    throws RepositoryException
This SQL gets a list of sites from the skus parent products

Returns:
the sql to get the list of sites for a sku from the skus parent products
Throws:
RepositoryException

setProductAncestorCategoriesSQL

public void setProductAncestorCategoriesSQL(java.lang.String pProductAncestorCategoriesSQL)

getProductAncestorCategoriesSQL

public java.lang.String getProductAncestorCategoriesSQL()
                                                 throws RepositoryException
This method returns the SQL that compares the category level ancestor categories with their child products. If the product has any extra ancestor categories then they are flagged for delete further down in the code.

Returns:
the SQL used to check and see if any sites need to be added within a group of skus
Throws:
RepositoryException

setCatalogSQL

public void setCatalogSQL(java.lang.String pCatalogSQL)

getCatalogsSQL

public java.lang.String getCatalogsSQL()
                                throws RepositoryException
This SQL gets a list of catalogs from the skus parent products

Returns:
the sql to get the list of catalogs for a sku from the skus parent products
Throws:
RepositoryException

setProductCatalogSQL

public void setProductCatalogSQL(java.lang.String pProductCatalogSQL)

getProductCatalogsSQL

public java.lang.String getProductCatalogsSQL()
                                       throws RepositoryException
This SQL gets a list of catalogs from the products parent categories

Returns:
the sql to get the list of catalogs for a product from the products parent categories
Throws:
RepositoryException

setParentCategoriesForCatalogSQL

public void setParentCategoriesForCatalogSQL(java.lang.String pParentCategoriesForCatalogSQL)

getProductParentCategoriesForCatalogsSQL

public java.lang.String getProductParentCategoriesForCatalogsSQL()
                                                          throws RepositoryException
This SQL gets a list of parent categories for Catalog from the products parent category

Returns:
the sql to get the list of catalogs for a sku from the skus parent products
Throws:
RepositoryException

setDeleteProductAncestorCategoriesCheck

public void setDeleteProductAncestorCategoriesCheck(java.lang.String pDeleteProductAncestorCategoriesCheck)

getDeleteProductAncestorCategoriesCheck

public java.lang.String getDeleteProductAncestorCategoriesCheck()
                                                         throws RepositoryException
This method returns the sql that compares the category level ancestor categories with their child products. If the product has any extra ancestor categories then they are flagged for delete further down in the code.

Returns:
the sql used to check and see if any sites need to be added within a group of skus
Throws:
RepositoryException

setInsertProductAncestorCategoriesCheck

public void setInsertProductAncestorCategoriesCheck(java.lang.String pInsertProductAncestorCategoriesCheck)

getInsertProductAncestorCategoriesCheck

public java.lang.String getInsertProductAncestorCategoriesCheck()
                                                         throws RepositoryException
This method returns the sql that compares the category level ancestor categories with their child products. If the product is missing any ancestor categories then they are flagged for insert further down in the code.

Returns:
the SQL used to check and see if any sites need to be added within a group of skus
Throws:
RepositoryException

setDeleteProductParentCategoriesForCatalogCheck

public void setDeleteProductParentCategoriesForCatalogCheck(java.lang.String pDeleteProductParentCategoriesForCatalogCheck)

getDeleteProductParentCategoriesForCatalogCheck

public java.lang.String getDeleteProductParentCategoriesForCatalogCheck()
                                                                 throws RepositoryException
This method returns the sql that compares the category level parent categories for catalog with their child products. If the product has any extra parent categories for catalog then they are flagged for delete further down in the code.

Returns:
the sql used to check and see if any sites need to be added within a group of skus
Throws:
RepositoryException

setInsertProductParentCategoriesForCatalogCheck

public void setInsertProductParentCategoriesForCatalogCheck(java.lang.String pInsertProductParentCategoriesForCatalogCheck)

getInsertProductParentCategoriesForCatalogCheck

public java.lang.String getInsertProductParentCategoriesForCatalogCheck()
                                                                 throws RepositoryException
This method returns the sql that compares the category level parent categories for catalog with their child products. If the product needs any extra parent categories for catalog then they are flagged for insert further down in the code.

Returns:
the SQL used to check and see if any sites need to be added within a group of skus
Throws:
RepositoryException

preService

public boolean preService(Repository pRepository,
                          java.util.Collection pCatalogIds,
                          java.util.List pServiceFunctions)
Method called prior to start of maintenance

Overrides:
preService in class atg.commerce.catalog.CMSService
Parameters:
pRepository - the catalogs repository
pCatalogIds - the catalog item ids. note this is only relevant for custom catalog services
pServiceFunctions - the service functions to perform
Returns:
boolean - return true if maintenance should continue return false to prevent maintenance

doStopService

public void doStopService()
                   throws ServiceException
Description copied from class: SchedulableService
The default implementation is to just stop our scheduled job. Subclasses should override this to perform any extra cleanup they may require.

Overrides:
doStopService in class SchedulableService
Throws:
ServiceException - if an error occurred during the operation

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 we need to check what the parent item and child items are. Attributes being updated are: category.directAncestorCatalogsAndSelf category.indirectAncestorCatalogs category.computedCatalogs category.ancestorCategories category.parentCategoriesForCatalog category.sites product.computedCatalogs product.parentCategoriesForCatalog product.sites sku.computedCatalogs sku.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.
pShadowBean -
Throws:
RepositoryException - the repository exception

getCategoriesForProduct

protected java.util.Collection<java.lang.String> getCategoriesForProduct(RepositoryItem pProduct)
                                                                  throws RepositoryException
This checks the repository and the map that holds the dynamic products

Parameters:
pProduct -
Returns:
Throws:
RepositoryException

updateProducts

protected void updateProducts()
                       throws RepositoryException,
                              TransactionDemarcationException
Overrides:
updateProducts in class atg.commerce.catalog.custom.TreeWalkUpdateService
Throws:
RepositoryException
TransactionDemarcationException

generateAndExecuteRanges

protected void generateAndExecuteRanges(RepositoryItemDescriptor pRepositoryItemDescriptor,
                                        RepositoryViewImpl pRepositoryView,
                                        java.lang.String pType)
                                 throws RepositoryException,
                                        TransactionDemarcationException
This method batches updates to the database in chunks. This takes care of 2 different issues. The first is memory usage and the second is performance

Parameters:
pRepositoryItemDescriptor -
pRepositoryView -
pType -
Throws:
RepositoryException
TransactionDemarcationException

close

protected void close(java.sql.ResultSet pResultSet)
Close a result set

Parameters:
pResultSet -

close

protected final void close(atg.adapter.gsa.SQLStatement pStatement)
Close an SQLStatement logging any SQLExceptions. It is okay to pass a null here.

Parameters:
pStatement - statement to close, may be null

updateSkus

protected void updateSkus()
                   throws RepositoryException,
                          TransactionDemarcationException
Overrides:
updateSkus in class atg.commerce.catalog.custom.TreeWalkUpdateService
Throws:
TransactionDemarcationException
RepositoryException

getDynamicProducts

protected java.util.List<java.lang.String> getDynamicProducts(Repository pRepository,
                                                              RepositoryItem pItem)
                                                       throws RepositoryException
Overrides:
getDynamicProducts in class atg.commerce.catalog.custom.TreeWalkUpdateService
Parameters:
pRepository -
pItem -
Returns:
Throws:
RepositoryException

goingUpUpdateItem

protected void goingUpUpdateItem(RepositoryItem pParentItem,
                                 RepositoryItem pCurrentItem,
                                 atg.commerce.catalog.custom.TreeWalkUpdateService.ShadowBean shadowBean)
                          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. For the AGS we do not need to update anything on the way up.

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.
shadowBean -
Throws:
RepositoryException - the repository exception