|
|||||||||
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.TreeWalkUpdateService atg.commerce.catalog.custom.AncestorGeneratorService
public class AncestorGeneratorService
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
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.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 |
---|
public static final java.lang.String CLASS_VERSION
Constructor Detail |
---|
public AncestorGeneratorService()
Method Detail |
---|
public java.lang.String getServiceName()
getServiceName
in class atg.commerce.catalog.CMSService
public java.lang.String getNameToLog()
getNameToLog
in class atg.commerce.catalog.custom.TreeWalkUpdateService
public boolean isUpdateSitesProperty()
public void setUpdateSitesProperty(boolean pUpdateSitesProperty)
public boolean isUpdateCatalogsProperty()
public void setUpdateCatalogsProperty(boolean pUpdateCatalogsProperty)
public int getNumberOfConcurrentUpdateThreads()
public void setNumberOfConcurrentUpdateThreads(int pNumberOfConcurrentUpdateThreads)
public int getNumberOfHoursToTimeOutThreads()
public void setNumberOfHoursToTimeOutThreads(int pNumberOfHoursToTimeOutThreads)
protected void setExecutor(java.util.concurrent.ExecutorService pExecutorService)
protected java.util.concurrent.ExecutorService getExecutor()
protected void setShutDownInProcess(boolean pShutDownInProcess)
protected boolean isShutDownInProcess()
public void setProductDeleteCatalogsCheck(java.lang.String pDeleteProductCatalogsCheck)
protected void setTableAndColumnNames(atg.commerce.catalog.custom.AncestorGeneratorService.GSATableAndColumnNames pTableAndColumnNames)
protected atg.commerce.catalog.custom.AncestorGeneratorService.GSATableAndColumnNames getTableAndColumnNames()
public java.lang.String getDeleteProductCatalogsCheck() throws RepositoryException
RepositoryException
public void setDeleteCatalogsCheck(java.lang.String pDeleteCatalogsCheck)
public java.lang.String getDeleteCatalogsCheck() throws RepositoryException
RepositoryException
public void setInsertProductCatalogsCheck(java.lang.String pInsertProductCatalogsCheck)
public java.lang.String getInsertProductCatalogsCheck() throws RepositoryException
RepositoryException
public void setInsertCatalogsCheck(java.lang.String pInsertCatalogsCheck)
public java.lang.String getInsertCatalogsCheck() throws RepositoryException
RepositoryException
public void setDeleteProductSiteCheck(java.lang.String pDeleteProductSiteCheck)
public java.lang.String getDeleteProductSiteCheck() throws RepositoryException
RepositoryException
public void setDeleteSiteCheck(java.lang.String pDeleteSiteCheck)
public java.lang.String getDeleteSiteCheck() throws RepositoryException
RepositoryException
public void setInsertProductSiteCheck(java.lang.String pInsertProductSiteCheck)
public java.lang.String getInsertProductSiteCheck() throws RepositoryException
RepositoryException
public void setInsertSiteCheck(java.lang.String pInsertSiteCheck)
public java.lang.String getInsertSiteCheck() throws RepositoryException
RepositoryException
public void setSitesSQL(java.lang.String pSitesSQL)
public java.lang.String getSitesSQL() throws RepositoryException
RepositoryException
public void setProductSitesSQL(java.lang.String pProductSitesSQL)
public java.lang.String getProductSitesSQL() throws RepositoryException
RepositoryException
public void setProductAncestorCategoriesSQL(java.lang.String pProductAncestorCategoriesSQL)
public java.lang.String getProductAncestorCategoriesSQL() throws RepositoryException
RepositoryException
public void setCatalogSQL(java.lang.String pCatalogSQL)
public java.lang.String getCatalogsSQL() throws RepositoryException
RepositoryException
public void setProductCatalogSQL(java.lang.String pProductCatalogSQL)
public java.lang.String getProductCatalogsSQL() throws RepositoryException
RepositoryException
public void setParentCategoriesForCatalogSQL(java.lang.String pParentCategoriesForCatalogSQL)
public java.lang.String getProductParentCategoriesForCatalogsSQL() throws RepositoryException
RepositoryException
public void setDeleteProductAncestorCategoriesCheck(java.lang.String pDeleteProductAncestorCategoriesCheck)
public java.lang.String getDeleteProductAncestorCategoriesCheck() throws RepositoryException
RepositoryException
public void setInsertProductAncestorCategoriesCheck(java.lang.String pInsertProductAncestorCategoriesCheck)
public java.lang.String getInsertProductAncestorCategoriesCheck() throws RepositoryException
RepositoryException
public void setDeleteProductParentCategoriesForCatalogCheck(java.lang.String pDeleteProductParentCategoriesForCatalogCheck)
public java.lang.String getDeleteProductParentCategoriesForCatalogCheck() throws RepositoryException
RepositoryException
public void setInsertProductParentCategoriesForCatalogCheck(java.lang.String pInsertProductParentCategoriesForCatalogCheck)
public java.lang.String getInsertProductParentCategoriesForCatalogCheck() throws RepositoryException
RepositoryException
public boolean preService(Repository pRepository, java.util.Collection pCatalogIds, java.util.List pServiceFunctions)
preService
in class atg.commerce.catalog.CMSService
pRepository
- the catalogs repositorypCatalogIds
- the catalog item ids. note this is only relevant for
custom catalog servicespServiceFunctions
- the service functions to perform
public void doStopService() throws ServiceException
SchedulableService
doStopService
in class SchedulableService
ServiceException
- if an error occurred during the operationprotected void updateCatalog()
updateCatalog
in class atg.commerce.catalog.custom.TreeWalkUpdateService
protected void goingDownUpdateItem(RepositoryItem pParentItem, RepositoryItem pCurrentItem, atg.commerce.catalog.custom.TreeWalkUpdateService.ShadowBean pShadowBean) throws RepositoryException
goingDownUpdateItem
in class atg.commerce.catalog.custom.TreeWalkUpdateService
pParentItem
- the parent item is the item that the data will be pulled frompCurrentItem
- the current item is the item that will be updated with
data from the pParentItem.pShadowBean
-
RepositoryException
- the repository exceptionprotected java.util.Collection<java.lang.String> getCategoriesForProduct(RepositoryItem pProduct) throws RepositoryException
pProduct
-
RepositoryException
protected void updateProducts() throws RepositoryException, TransactionDemarcationException
updateProducts
in class atg.commerce.catalog.custom.TreeWalkUpdateService
RepositoryException
TransactionDemarcationException
protected void generateAndExecuteRanges(RepositoryItemDescriptor pRepositoryItemDescriptor, RepositoryViewImpl pRepositoryView, java.lang.String pType) throws RepositoryException, TransactionDemarcationException
pRepositoryItemDescriptor
- pRepositoryView
- pType
-
RepositoryException
TransactionDemarcationException
protected void close(java.sql.ResultSet pResultSet)
pResultSet
- protected final void close(atg.adapter.gsa.SQLStatement pStatement)
pStatement
- statement to close, may be nullprotected void updateSkus() throws RepositoryException, TransactionDemarcationException
updateSkus
in class atg.commerce.catalog.custom.TreeWalkUpdateService
TransactionDemarcationException
RepositoryException
protected java.util.List<java.lang.String> getDynamicProducts(Repository pRepository, RepositoryItem pItem) throws RepositoryException
getDynamicProducts
in class atg.commerce.catalog.custom.TreeWalkUpdateService
pRepository
- pItem
-
RepositoryException
protected void goingUpUpdateItem(RepositoryItem pParentItem, RepositoryItem pCurrentItem, atg.commerce.catalog.custom.TreeWalkUpdateService.ShadowBean shadowBean) throws RepositoryException
goingUpUpdateItem
in class atg.commerce.catalog.custom.TreeWalkUpdateService
pParentItem
- the parent item that will be updated.pCurrentItem
- the current item is used to pull the data
from for the pParentItem update.shadowBean
-
RepositoryException
- the repository exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |