public class CatalogCompletionService extends GenericService
This service performs incremental maintenance on the catalog system
after changes have been made to the catalog structure in the UI.
Methods are called from CatalogChangesListener
when:
a catalog is created
a catalogFolder or catalog is added/removed as a child from another
catalogFolder
a catalog or category is added/removed as a child from another category
or catalog.
Methods are also called from CatalogChangesListener
when
sites are added or removed to/from a catalogFolder or catalog.
Properties computed by this service:
catalogFolder.siteIds
catalog.directAncestorCatalogsAndSelf
catalog.allRootCategories
catalog.indirectAncestorCatalogs
catalog.ancestorCategories
catalog.siteIds
category.parentCatalog
category.catalogs
category.siteIds
CatalogChangesListener
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
SERVICE_INFO_KEY
DEFAULT_LOG_TRACE_STATUS
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
Constructor and Description |
---|
CatalogCompletionService() |
Modifier and Type | Method and Description |
---|---|
void |
addCatalogFolderToCatalogFolder(MutableRepositoryItem pParentFolder,
MutableRepositoryItem pChildFolder)
This method will update site property details for the new child catalog folder.
|
void |
addCatalogToCatalog(MutableRepositoryItem pParentCatalog,
MutableRepositoryItem pChildCatalog)
This method performs the operations related to adding a catalog to
another catalog's rootSubCatalogs.
|
void |
addCatalogToCatalogFolder(MutableRepositoryItem pCatalogFolder,
MutableRepositoryItem pCatalog)
This method will update site property details for the new child catalog.
|
void |
addCatalogToCategory(MutableRepositoryItem pCategory,
MutableRepositoryItem pCatalog)
This method performs the operations related to adding a catalog to
a category's subCatalogs.
|
void |
addCategoryToCatalog(MutableRepositoryItem pCatalog,
MutableRepositoryItem pCategory)
This method performs the operations related to adding a category to
a catalog's rootCategories.
|
void |
addCategoryToCategory(MutableRepositoryItem pParentCategory,
MutableRepositoryItem pChildCategory)
This method performs the operations related to adding a category to
another category's fixedChildCategories.
|
void |
addItemProperties(MutableRepositoryItem pItem,
java.util.Collection<java.lang.String> pSiteIds,
java.util.Collection<RepositoryItem> pDirectCatalogs,
java.util.Collection<RepositoryItem> pIndirectCatalogs)
Walks down the catalog tree, adding sites and catalogs to each catalog folder/catalog/
category, where applicable.
|
void |
createCatalog(MutableRepositoryItem pCatalog)
This method performs the operations related to the creation of a catalog.
|
CatalogProperties |
getCatalogProperties()
A helper class that holds commonly accessed reposority property
and item names
|
MutableRepository |
getCatalogRepository()
Returns property catalogRepository
|
CustomCatalogTools |
getCatalogTools()
Returns property catalogTools
|
javax.transaction.TransactionManager |
getTransactionManager()
The beginning and ending of transactions are handled by the
transaction manager.
|
boolean |
isComputeSubCatalogs()
Deprecated.
catalog.subCatalogs is never computed by this service
|
boolean |
isEnabled()
Returns property enabled, which indicates if this service should compute
any properties.
|
void |
removeCatalogFolderFromCatalogFolder(MutableRepositoryItem pParentFolder,
MutableRepositoryItem pChildFolder)
This method will update site property details for the child catalog folder
being removed.
|
void |
removeCatalogFromCatalog(MutableRepositoryItem pParentCatalog,
MutableRepositoryItem pChildCatalog)
This method performs the operations related to removing a catalog from
another catalog's rootSubCatalogs.
|
void |
removeCatalogFromCatalogFolder(MutableRepositoryItem pCatalogFolder,
MutableRepositoryItem pCatalog)
This method will update site property details for the catalog being removed.
|
void |
removeCatalogFromCategory(MutableRepositoryItem pCategory,
MutableRepositoryItem pCatalog)
This method performs the operations related to removing a catalog from
a category's subCatalogs.
|
void |
removeCategoryFromCatalog(MutableRepositoryItem pCatalog,
MutableRepositoryItem pCategory)
This method performs the operations related to removing a category from
a catalog's rootCategories.
|
void |
removeCategoryFromCategory(MutableRepositoryItem pParentCategory,
MutableRepositoryItem pChildCategory)
This method performs the operations related to removing a category from
another category's fixedChildCategories.
|
void |
removeItemProperties(RepositoryItem pItem,
java.util.Collection<java.lang.String> pSiteIds,
java.util.Collection<RepositoryItem> pCatalogs)
Walks down the catalog, attempting to remove sites and catalogs from each catalog folder/catalog/category
encountered.
|
void |
setCatalogProperties(CatalogProperties pCatalogProperties) |
void |
setCatalogRepository(MutableRepository pCatalogRepository)
Sets the GSA repository instance to modify.
|
void |
setCatalogTools(CustomCatalogTools pCatalogTools)
Sets the instance of CatalogTools to be used
|
void |
setComputeSubCatalogs(boolean pComputeSubCatalogs)
Deprecated.
catalog.subCatalogs is never computed by this service
|
void |
setEnabled(boolean pEnabled)
Sets boolean indicating if this service should compute any properties
|
void |
setTransactionManager(javax.transaction.TransactionManager pTransactionManager) |
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, 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, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
public void setTransactionManager(javax.transaction.TransactionManager pTransactionManager)
public javax.transaction.TransactionManager getTransactionManager()
public void setCatalogProperties(CatalogProperties pCatalogProperties)
public CatalogProperties getCatalogProperties()
public void setCatalogTools(CustomCatalogTools pCatalogTools)
public CustomCatalogTools getCatalogTools()
public void setCatalogRepository(MutableRepository pCatalogRepository)
public MutableRepository getCatalogRepository()
public void setComputeSubCatalogs(boolean pComputeSubCatalogs)
public boolean isComputeSubCatalogs()
public void setEnabled(boolean pEnabled)
public boolean isEnabled()
public void addCatalogFolderToCatalogFolder(MutableRepositoryItem pParentFolder, MutableRepositoryItem pChildFolder) throws RepositoryException
pParentFolder
- repository item representing a parent catalog folderpChildFolder
- repository item representing a child catalog folderRepositoryException
- if there was an error updating the sites propertypublic void addCatalogToCatalogFolder(MutableRepositoryItem pCatalogFolder, MutableRepositoryItem pCatalog) throws RepositoryException
pCatalogFolder
- repository item representing a catalog folderpCatalog
- repository item representing a catalog folderRepositoryException
- if there was an error updating the sites propertypublic void addCategoryToCatalog(MutableRepositoryItem pCatalog, MutableRepositoryItem pCategory) throws RepositoryException, CatalogLoopException
pCatalog
- - The repository item representing the parent catalogpCategory
- - The repository item representing the child categoryRepositoryException
- if there is an error in any of the property
changesCatalogLoopException
- if the new category causes the catalog to become a descendant of itselfpublic void addCatalogToCatalog(MutableRepositoryItem pParentCatalog, MutableRepositoryItem pChildCatalog) throws RepositoryException, CatalogLoopException
pParentCatalog
- - The repository item representing the parent catalogpChildCatalog
- - The repository item representing the child catalogRepositoryException
- if there is an error in any of the property
changesCatalogLoopException
- if the operation creates a situation where a
catalog is an ancestor of itselfpublic void addCatalogToCategory(MutableRepositoryItem pCategory, MutableRepositoryItem pCatalog) throws RepositoryException, CatalogLoopException
pCategory
- - The repository item representing the parent category.pCatalog
- - The repository item representing the child catalog.RepositoryException
- if there is an error in any of the property
changesCatalogLoopException
- if the operation creates a situation where a
catalog is an ancestor of itselfpublic void addCategoryToCategory(MutableRepositoryItem pParentCategory, MutableRepositoryItem pChildCategory) throws RepositoryException, CatalogLoopException
pParentCategory
- - The repository item representing the parent category.pChildCategory
- - The repository item representing the child category.RepositoryException
- if there is an error in any of the property
changesCatalogLoopException
- if the added child category is an ancestor of the parent categorypublic void removeCatalogFolderFromCatalogFolder(MutableRepositoryItem pParentFolder, MutableRepositoryItem pChildFolder) throws RepositoryException
pParentFolder
- repository item representing a parent catalog folderpChildFolder
- repository item representing a child catalog folderRepositoryException
- if there was an error updating the sites propertypublic void removeCatalogFromCatalogFolder(MutableRepositoryItem pCatalogFolder, MutableRepositoryItem pCatalog) throws RepositoryException
pCatalogFolder
- repository item representing a catalog folderpCatalog
- repository item representing a catalog folderRepositoryException
- if there was an error updating the sites propertypublic void removeCategoryFromCatalog(MutableRepositoryItem pCatalog, MutableRepositoryItem pCategory) throws RepositoryException
pCatalog
- - The repository item representing the former parent catalogpCategory
- - The repository item representing the former child categoryRepositoryException
- if there is an error in any of the property
changespublic void removeCatalogFromCatalog(MutableRepositoryItem pParentCatalog, MutableRepositoryItem pChildCatalog) throws RepositoryException
pParentCatalog
- - The repository item representing the former parent
catalog.pChildCatalog
- - The repository item representing the former child catalog.RepositoryException
- if there is an error in any of the property changespublic void removeCatalogFromCategory(MutableRepositoryItem pCategory, MutableRepositoryItem pCatalog) throws RepositoryException
pCategory
- - The repository item representing the former parent categorypCatalog
- - The repository item representing the former child catalogRepositoryException
- if there is an error in any of the property changespublic void removeCategoryFromCategory(MutableRepositoryItem pParentCategory, MutableRepositoryItem pChildCategory) throws RepositoryException
pParentCategory
- - The repository item representing the former parent
categorypChildCategory
- - The repository item representing the former child
categoryRepositoryException
- if there is an error in any of the property changespublic void createCatalog(MutableRepositoryItem pCatalog) throws RepositoryException
pCatalog
- - The repository item representing the newly created catalogRepositoryException
public void addItemProperties(MutableRepositoryItem pItem, java.util.Collection<java.lang.String> pSiteIds, java.util.Collection<RepositoryItem> pDirectCatalogs, java.util.Collection<RepositoryItem> pIndirectCatalogs) throws RepositoryException
pItem
- the item that is going to be updatedpSiteIds
- a collection of new sites to add to the itempDirectCatalogs
- a collection of potential new direct catalogspIndirectCatalogs
- a collection of potential new indirect catalogsRepositoryException
- if there was an error when checking descendantspublic void removeItemProperties(RepositoryItem pItem, java.util.Collection<java.lang.String> pSiteIds, java.util.Collection<RepositoryItem> pCatalogs) throws RepositoryException
pItem
- the item that is going to be updatedpSiteIds
- a collection of site for removalpCatalogs
- a collection of catalogs to removeRepositoryException
- if there was an error when checking ancestors or descendants