Class DependencyServiceImpl
java.lang.Object
org.craftercms.studio.impl.v1.service.dependency.DependencyServiceImpl
- All Implemented Interfaces:
DependencyService
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ContentRepositoryprotected ContentServiceprotected DependencyMapperprotected DependencyResolverprotected DependencyServiceInternalprotected GeneralLockServiceprotected ItemDAOprotected RetryingDatabaseOperationFacadeprotected ServicesConfigprotected StudioConfigurationprotected org.springframework.transaction.PlatformTransactionManager -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncalculateDependencies(String site, List<String> paths) Calculate dependencies for publishingcalculateDependenciesPaths(String site, List<String> paths) Calculate dependencies paths for publishingcreateDependencyEntities(String site, String path, Set<String> dependencyPaths, String dependencyType, Set<String> extractedPaths) voiddeleteAllSourceDependencies(String site, String path) voiddeleteItemDependencies(String site, String path) Delete an item dependencies from the database.voiddeleteSiteDependencies(String site) Delete all dependencies from the database for a given site.getDeleteDependencies(String site, String path) getDeleteDependencies(String site, List<String> paths) getItemDependencies(String site, String path, int depth) Get all item dependencies of an item.getItemsDependingOn(String site, String path, int depth) Get all items that depend on this item.getItemSpecificDependencies(String site, String path, int depth) Get item-specific dependencies of an item.getPublishingDependencies(String site, String path) Get a all publishing dependencies of a list of items.getPublishingDependencies(String site, List<String> paths) Get a all publishing dependencies of a list of items.org.springframework.transaction.PlatformTransactionManagervoidinsertDependenciesIntoDatabase(List<DependencyEntity> dependencyEntities) moveDependencies(String site, String oldPath, String newPath) Move an item and make sure dependency paths remain correct.voidsetContentRepository(ContentRepository contentRepository) voidsetContentService(ContentService contentService) voidsetDependencyMapper(DependencyMapper dependencyMapper) voidsetDependencyResolver(DependencyResolver dependencyResolver) voidsetDependencyService(DependencyServiceInternal dependencyService) voidsetGeneralLockService(GeneralLockService generalLockService) voidsetItemDao(ItemDAO itemDao) voidsetRetryingDatabaseOperationFacade(RetryingDatabaseOperationFacade retryingDatabaseOperationFacade) voidsetServicesConfig(ServicesConfig servicesConfig) voidsetStudioConfiguration(StudioConfiguration studioConfiguration) voidsetTransactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager) upsertDependencies(String site, String path) Scan item for direct dependencies and synchronize those to the depenencies database adding the new deps, updating existing, and removing what was removed from the item.upsertDependencies(String site, List<String> paths) Scan a list of items for direct dependencies and synchroniz those to the depenencies database adding the new deps, updating existing, and removing what was removed from the item.
-
Field Details
-
dependencyMapper
-
studioConfiguration
-
contentService
-
dependencyResolver
-
transactionManager
protected org.springframework.transaction.PlatformTransactionManager transactionManager -
contentRepository
-
servicesConfig
-
dependencyService
-
itemDao
-
generalLockService
-
retryingDatabaseOperationFacade
-
-
Constructor Details
-
DependencyServiceImpl
public DependencyServiceImpl()
-
-
Method Details
-
upsertDependencies
Description copied from interface:DependencyServiceScan item for direct dependencies and synchronize those to the depenencies database adding the new deps, updating existing, and removing what was removed from the item.- Specified by:
upsertDependenciesin interfaceDependencyService- Parameters:
site- Site to operate onpath- Path to item to scan- Returns:
- set of upserted dependencies
- Throws:
ServiceLayerException- Internal error, see exception details
-
upsertDependencies
Description copied from interface:DependencyServiceScan a list of items for direct dependencies and synchroniz those to the depenencies database adding the new deps, updating existing, and removing what was removed from the item.- Specified by:
upsertDependenciesin interfaceDependencyService- Parameters:
site- Site to operate onpaths- List of paths to items to scan- Returns:
- set of upserted dependencies
- Throws:
ServiceLayerException- Internal error, see exception details
-
deleteAllSourceDependencies
-
createDependencyEntities
-
insertDependenciesIntoDatabase
-
getPublishingDependencies
public List<String> getPublishingDependencies(String site, String path) throws ServiceLayerException Description copied from interface:DependencyServiceGet a all publishing dependencies of a list of items. A publishing dependency is: * Never-published item that this item depends on * Item-specific dependency that has been modified but not published- Specified by:
getPublishingDependenciesin interfaceDependencyService- Parameters:
site- Site to operate onpath- Paths to item to retrieve deps for- Returns:
- list of mandatory dependencies paths for publishing
- Throws:
ServiceLayerException- Internal error, see exception details
-
getPublishingDependencies
public List<String> getPublishingDependencies(String site, List<String> paths) throws ServiceLayerException Description copied from interface:DependencyServiceGet a all publishing dependencies of a list of items. A publishing dependency is: * Never-published item that this item depends on * Item-specific dependency that has been modified but not published- Specified by:
getPublishingDependenciesin interfaceDependencyService- Parameters:
site- Site to operate onpaths- List of paths to items to retrieve deps for- Returns:
- list of mandatory dependencies paths for publishing
- Throws:
ServiceLayerException- Internal error, see exception details
-
getItemSpecificDependencies
public Set<String> getItemSpecificDependencies(String site, String path, int depth) throws ServiceLayerException Description copied from interface:DependencyServiceGet item-specific dependencies of an item. An item-specific dependency is: * Only referenced by the parent item * Sits in a special path pattern defined during content modeling- Specified by:
getItemSpecificDependenciesin interfaceDependencyService- Parameters:
site- Site to operate onpath- Path to items to retrieve deps fordepth- Depth of tree to traverse. Depth of -1 disables depth limits- Returns:
- set of hard dependencies
- Throws:
ServiceLayerException- Internal error, see exception details
-
getItemDependencies
public Set<String> getItemDependencies(String site, String path, int depth) throws ServiceLayerException Description copied from interface:DependencyServiceGet all item dependencies of an item.- Specified by:
getItemDependenciesin interfaceDependencyService- Parameters:
site- Site to operate onpath- Path to items to retrieve deps fordepth- Depth of tree to traverse. Depth of -1 disables depth limits- Returns:
- set of items that given item depends on
- Throws:
ServiceLayerException- Internal error, see exception details
-
getItemsDependingOn
public Set<String> getItemsDependingOn(String site, String path, int depth) throws ServiceLayerException Description copied from interface:DependencyServiceGet all items that depend on this item.- Specified by:
getItemsDependingOnin interfaceDependencyService- Parameters:
site- Site to operate onpath- Path to items to retrieve deps fordepth- Depth of tree to traverse. Depth of -1 disables depth limits- Returns:
- set of items depending on given item path
- Throws:
ServiceLayerException- Internal error, see exception details
-
moveDependencies
public Set<String> moveDependencies(String site, String oldPath, String newPath) throws ServiceLayerException Description copied from interface:DependencyServiceMove an item and make sure dependency paths remain correct.- Specified by:
moveDependenciesin interfaceDependencyService- Parameters:
site- Site to operate onoldPath- Path to item to movenewPath- Path the item moves to- Returns:
- set of updated dependencies
- Throws:
ServiceLayerException- Internal error, see exception details
-
deleteItemDependencies
Description copied from interface:DependencyServiceDelete an item dependencies from the database.- Specified by:
deleteItemDependenciesin interfaceDependencyService- Parameters:
site- Site to operate onpath- Path to items to retrieve deps for- Throws:
ServiceLayerException- Internal error, see exception details
-
deleteSiteDependencies
Description copied from interface:DependencyServiceDelete all dependencies from the database for a given site.- Specified by:
deleteSiteDependenciesin interfaceDependencyService- Parameters:
site- Site to operate on- Throws:
ServiceLayerException- Internal error, see exception details
-
getDeleteDependencies
- Specified by:
getDeleteDependenciesin interfaceDependencyService- Parameters:
site- Site to operate onpath- Path to item to retrieve delete dependencies for- Returns:
- Set of paths included as delete dependencies
- Throws:
ServiceLayerException- Internal error
-
getDeleteDependencies
public Set<String> getDeleteDependencies(String site, List<String> paths) throws ServiceLayerException - Specified by:
getDeleteDependenciesin interfaceDependencyService- Parameters:
site- Site to operate onpaths- Paths to items to retrieve delete dependencies for- Returns:
- Set of paths included as delete dependencies
- Throws:
ServiceLayerException- Internal error
-
getItemSpecificDependenciesPatterns
-
calculateDependencies
public Map<String,List<CalculateDependenciesEntityTO>> calculateDependencies(String site, List<String> paths) throws ServiceLayerException Description copied from interface:DependencyServiceCalculate dependencies for publishing- Specified by:
calculateDependenciesin interfaceDependencyService- Parameters:
site- Site to operate onpaths- List of items to calculate dependencies for- Returns:
- Formatted result set
- Throws:
ServiceLayerException- general service error
-
calculateDependenciesPaths
public Set<String> calculateDependenciesPaths(String site, List<String> paths) throws ServiceLayerException Description copied from interface:DependencyServiceCalculate dependencies paths for publishing- Specified by:
calculateDependenciesPathsin interfaceDependencyService- Parameters:
site- site to usepaths- list of items to calculate dependencies for- Returns:
- dependencies paths
- Throws:
ServiceLayerException- general service error
-
getStudioConfiguration
-
setStudioConfiguration
-
getContentService
-
setContentService
-
getDependencyResolver
-
setDependencyResolver
-
getTransactionManager
public org.springframework.transaction.PlatformTransactionManager getTransactionManager() -
setTransactionManager
public void setTransactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager) -
getContentRepository
-
setContentRepository
-
getServicesConfig
-
setServicesConfig
-
getDependencyMapper
-
setDependencyMapper
-
getDependencyService
-
setDependencyService
-
getItemDao
-
setItemDao
-
getGeneralLockService
-
setGeneralLockService
-
getRetryingDatabaseOperationFacade
-
setRetryingDatabaseOperationFacade
public void setRetryingDatabaseOperationFacade(RetryingDatabaseOperationFacade retryingDatabaseOperationFacade)
-