atg.commerce.catalog.custom
Class SubCatalogsGeneratorService

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.commerce.catalog.custom.SubCatalogsGeneratorService
All Implemented Interfaces:
NameContextBindingListener, NameContextElement, NameResolver, AdminableService, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, java.util.EventListener

public class SubCatalogsGeneratorService
extends GenericService

This class will update each catalogs "subCatalogs" property with a list of all the sub catalogs (and their sub catalogs, etc.) The following properties will be updated by this service:
catalog.allRootCategories catalog.allRootCategoryIds catalog.subCatalogs catalog.subCatalogsIds category.subCatalogsChildCategories


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
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
SubCatalogsGeneratorService()
           
 
Method Summary
 void generateCategorysSubCategories()
          Update each categorys list of categories from sub catalogs The following properties will be updated:
category.subCatalogsChildCategories
 void generateCategorysSubCategories(Repository pCatalogRepository)
          Update each categories subCatalogsChildCategories property for all categories in the given repository.
protected  java.util.Collection generateEmptySet(java.lang.String pPropertyName)
          This method generates an empty set.
 void generateSubCatalogs()
          Generate and update the values of the subCatalogs property for all catalogs in all specified product catalogs.
 void generateSubCatalogs(Repository pCatalogRepository)
          Generate and update the values of the subCatalogs property for all catalogs in the specified product catalog repository.
 java.util.Collection generateSubCatalogs(Repository pCatalogRepository, java.util.Collection pCatalogIds)
          Generate and update the values of the subCatalogs property for all catalogs in the specified product catalog repository.
 CatalogProperties getCatalogProperties()
          A helper class that holds commonly accessed reposority property and item names
 java.lang.String[] getCatalogRepositories()
          Returns property catalogRepositories
 CustomCatalogTools getCatalogTools()
          Returns property catalogTools
 int getMaxItemsPerTransaction()
          Returns property maxItemsPerTransaction
 javax.transaction.TransactionManager getTransactionManager()
          Returns property transactionManager
 void setCatalogProperties(CatalogProperties pCatalogProperties)
           
 void setCatalogRepositories(java.lang.String[] pCatalogRepositories)
          Sets property catalogRepositories
 void setCatalogTools(CustomCatalogTools pCatalogTools)
          Sets property catalogTools
 void setMaxItemsPerTransaction(int pMaxItemsPerTransaction)
          Sets property maxItemsPerTransaction
 void setTransactionManager(javax.transaction.TransactionManager pTransactionManager)
          Sets property transactionManager
 void updateSubCatalogInformation()
          This is the main method of this class.
 java.util.Collection updateSubCatalogInformation(java.util.Collection pCatalogIds)
          This is the main method of this class.
 void updateSubCatalogInformation(Repository pCatalogRepository)
          This method will call generateSubCatalogs and generateCategorysSubCategories with the given repository.
 java.util.Collection updateSubCatalogInformation(Repository pCatalogRepository, java.util.Collection pCatalogIds)
          This method will call generateSubCatalogs and generateCategorysSubCategories with the given repository.
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
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

CLASS_VERSION

public static final java.lang.String CLASS_VERSION
Class version string

See Also:
Constant Field Values
Constructor Detail

SubCatalogsGeneratorService

public SubCatalogsGeneratorService()
Method Detail

setCatalogProperties

public void setCatalogProperties(CatalogProperties pCatalogProperties)

getCatalogProperties

public CatalogProperties getCatalogProperties()
A helper class that holds commonly accessed reposority property and item names


setCatalogTools

public void setCatalogTools(CustomCatalogTools pCatalogTools)
Sets property catalogTools


getCatalogTools

public CustomCatalogTools getCatalogTools()
Returns property catalogTools


setCatalogRepositories

public void setCatalogRepositories(java.lang.String[] pCatalogRepositories)
Sets property catalogRepositories


getCatalogRepositories

public java.lang.String[] getCatalogRepositories()
Returns property catalogRepositories


setTransactionManager

public void setTransactionManager(javax.transaction.TransactionManager pTransactionManager)
Sets property transactionManager


getTransactionManager

public javax.transaction.TransactionManager getTransactionManager()
Returns property transactionManager


setMaxItemsPerTransaction

public void setMaxItemsPerTransaction(int pMaxItemsPerTransaction)
Sets property maxItemsPerTransaction


getMaxItemsPerTransaction

public int getMaxItemsPerTransaction()
Returns property maxItemsPerTransaction


updateSubCatalogInformation

public void updateSubCatalogInformation()
This is the main method of this class. It will call generateSubCatalogs and generateCategorysSubCategories


updateSubCatalogInformation

public void updateSubCatalogInformation(Repository pCatalogRepository)
This method will call generateSubCatalogs and generateCategorysSubCategories with the given repository.

Parameters:
pCatalogRepository - The repository that will be updated

updateSubCatalogInformation

public java.util.Collection updateSubCatalogInformation(java.util.Collection pCatalogIds)
This is the main method of this class. It will call generateSubCatalogs and generateCategorysSubCategories This method will also remember if there are any new sub catalogs for the given list. If the list is null, then null is returned. This list can tell you which catalogs needs to have the InfoGeneratorService run on them.

Parameters:
pCatalogIds - Return the list of new sub catalogs for these
Returns:
The list of new sub catalogs of the given catalogs

updateSubCatalogInformation

public java.util.Collection updateSubCatalogInformation(Repository pCatalogRepository,
                                                        java.util.Collection pCatalogIds)
This method will call generateSubCatalogs and generateCategorysSubCategories with the given repository. This method will also remember if there are any new sub catalogs for the given list. If the list is null, then null is returned. This list can tell you which catalogs needs to have the InfoGeneratorService run on them.

Parameters:
pCatalogRepository - The repository that will be updated
pCatalogIds - Return the list of new sub catalogs for these
Returns:
The list of new sub catalogs of the given catalogs

generateSubCatalogs

public void generateSubCatalogs()
Generate and update the values of the subCatalogs property for all catalogs in all specified product catalogs. The following properties will be updated:
catalog.allRootCategories catalog.allRootCategoryIds catalog.subCatalogs catalog.subCatalogsIds


generateCategorysSubCategories

public void generateCategorysSubCategories()
Update each categorys list of categories from sub catalogs The following properties will be updated:
category.subCatalogsChildCategories


generateSubCatalogs

public void generateSubCatalogs(Repository pCatalogRepository)
Generate and update the values of the subCatalogs property for all catalogs in the specified product catalog repository. If the given repository is null then catalogRepositories is used. If that list is empty, then the default catalog repository is used.

Parameters:
pCatalogRepository - The repository that will be updated
See Also:
CustomCatalogTools

generateSubCatalogs

public java.util.Collection generateSubCatalogs(Repository pCatalogRepository,
                                                java.util.Collection pCatalogIds)
Generate and update the values of the subCatalogs property for all catalogs in the specified product catalog repository. If the given repository is null then catalogRepositories is used. If that list is empty, then the default catalog repository is used. This method will also remember if there are any new sub catalogs for the given list. If the list is null, then null is returned. This list can tell you which catalogs needs to have the InfoGeneratorService run on them.

Parameters:
pCatalogRepository - The repository that will be updated
pCatalogIds - Return the list of new sub catalogs for these
Returns:
The list of new sub catalogs of the given catalogs
See Also:
CustomCatalogTools

generateCategorysSubCategories

public void generateCategorysSubCategories(Repository pCatalogRepository)
Update each categories subCatalogsChildCategories property for all categories in the given repository. If the given repository is null then catalogRepositories is used. If that list is empty, then the default catalog repository is used.

Parameters:
pCatalogRepository - The repository that will be updated
See Also:
CustomCatalogTools

generateEmptySet

protected java.util.Collection generateEmptySet(java.lang.String pPropertyName)
This method generates an empty set. If some set property needs to be changed to a list, you should extend this method to generate a list. The property name is provided if you want to use different classes for different properties. This implementation just returns an empty Set

Returns:
a newly-constructed Set with nothing in it