Class DependencyServiceInternalImpl
java.lang.Object
org.craftercms.studio.impl.v2.service.dependency.internal.DependencyServiceInternalImpl
- All Implemented Interfaces:
DependencyServiceInternal
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
deleteItemDependencies
(String site, String sourcePath) Delete the dependencies of sourcePathgetDependentItems
(String siteId, String path) Get list of paths of content items that are dependent on given pathgetDependentPaths
(String siteId, List<String> paths) Get list of paths of content items that are dependent on given pathsgetHardDependencies
(String site, List<String> paths) Get a hard dependencies of a item.getItemSpecificDependencies
(String siteId, String path) Get item specific dependencies for given pathgetItemSpecificDependencies
(String siteId, List<String> paths) Get item specific dependencies for given pathgetSoftDependencies
(String site, List<String> paths) Get a soft dependencies of a list of items.void
invalidateDependencies
(String siteId, String targetPath) Mark as invalid the dependency records with the given target pathboolean
isValidDependencySource
(String siteId, String path) Indicate if the given path is a valid dependency source. e.g.: templates, pages, components Some files cannot have dependencies, like images or txt filesresolveDependencies
(String siteId, String path) Resolves dependent files for given content of given pathvoid
setDependencyDao
(DependencyDAO dependencyDao) void
setDependencyResolver
(DependencyResolver dependencyResolver) void
setGeneralLockService
(GeneralLockService generalLockService) void
setItemServiceInternal
(ItemServiceInternal itemServiceInternal) void
setRetryingDatabaseOperationFacade
(RetryingDatabaseOperationFacade retryingDatabaseOperationFacade) void
setServicesConfig
(ServicesConfig servicesConfig) void
setStudioConfiguration
(StudioConfiguration studioConfiguration) void
upsertDependencies
(String site, String path) Scan item for direct dependencies and synchronize those to the dependencies database adding the new deps, updating existing, and removing what was removed from the item.void
validateDependencies
(String siteId) Mark as valid/invalid all site dependencies depending on the existence of the target_path in the sitevoid
validateDependencies
(String siteId, String targetPath) Mark as valid the dependency records with the given target path
-
Constructor Details
-
DependencyServiceInternalImpl
public DependencyServiceInternalImpl()
-
-
Method Details
-
getSoftDependencies
Description copied from interface:DependencyServiceInternal
Get a soft dependencies of a list of items. A soft dependency is: * an edited, shared (not item specific) dependency- Specified by:
getSoftDependencies
in interfaceDependencyServiceInternal
- Parameters:
site
- Site to operate onpaths
- List of paths to items to retrieve deps for- Returns:
- list of soft dependencies
-
getItemSpecificDependenciesPatterns
-
getHardDependencies
Description copied from interface:DependencyServiceInternal
Get a hard dependencies of a item. A hard dependency is: * Never-published item that this item depends on * Item-specific dependency that has been modified but not published- Specified by:
getHardDependencies
in interfaceDependencyServiceInternal
- Parameters:
site
- Site to operate onpaths
- List of paths to items to retrieve deps for- Returns:
- list of hard dependencies
-
getDependentPaths
Description copied from interface:DependencyServiceInternal
Get list of paths of content items that are dependent on given paths- Specified by:
getDependentPaths
in interfaceDependencyServiceInternal
- Parameters:
siteId
- site identifierpaths
- list of paths to get dependent items for- Returns:
- list of paths dependent on given paths
-
getDependentItems
Description copied from interface:DependencyServiceInternal
Get list of paths of content items that are dependent on given path- Specified by:
getDependentItems
in interfaceDependencyServiceInternal
- Parameters:
siteId
- site identifierpath
- path to get dependent items for- Returns:
- list of
DependencyItem
dependent on given path
-
getItemSpecificDependencies
Description copied from interface:DependencyServiceInternal
Get item specific dependencies for given path- Specified by:
getItemSpecificDependencies
in interfaceDependencyServiceInternal
- Parameters:
siteId
- site identifierpath
- path to get item specific dependencies for- Returns:
- list of item specific dependencies
-
getItemSpecificDependencies
Description copied from interface:DependencyServiceInternal
Get item specific dependencies for given path- Specified by:
getItemSpecificDependencies
in interfaceDependencyServiceInternal
- Parameters:
siteId
- site identifierpaths
- path to get item specific dependencies for- Returns:
- list of item specific dependencies
-
resolveDependencies
public Map<String,Set<DependencyResolver.ResolvedDependency>> resolveDependencies(String siteId, String path) Description copied from interface:DependencyServiceInternal
Resolves dependent files for given content of given path- Specified by:
resolveDependencies
in interfaceDependencyServiceInternal
- Parameters:
siteId
- the site idpath
- the path to resolve dependencies for- Returns:
- Map of ResolvedDependency's of files that content is dependent on by type
-
upsertDependencies
@Transactional public void upsertDependencies(String site, String path) throws ServiceLayerException Description copied from interface:DependencyServiceInternal
Scan item for direct dependencies and synchronize those to the dependencies database adding the new deps, updating existing, and removing what was removed from the item.- Specified by:
upsertDependencies
in interfaceDependencyServiceInternal
- Parameters:
site
- Site to operate onpath
- Path to item to scan- Throws:
ServiceLayerException
- Internal error, see exception details
-
deleteItemDependencies
Description copied from interface:DependencyServiceInternal
Delete the dependencies of sourcePath- Specified by:
deleteItemDependencies
in interfaceDependencyServiceInternal
- Parameters:
site
- the site idsourcePath
- the source path of the dependencies to delete- Throws:
ServiceLayerException
-
invalidateDependencies
Description copied from interface:DependencyServiceInternal
Mark as invalid the dependency records with the given target path- Specified by:
invalidateDependencies
in interfaceDependencyServiceInternal
- Parameters:
siteId
- the site idtargetPath
- the target path of the dependencies to invalidate- Throws:
ServiceLayerException
-
validateDependencies
Description copied from interface:DependencyServiceInternal
Mark as valid the dependency records with the given target path- Specified by:
validateDependencies
in interfaceDependencyServiceInternal
- Parameters:
siteId
- the site idtargetPath
- the target path of the dependencies to validate- Throws:
ServiceLayerException
-
validateDependencies
Description copied from interface:DependencyServiceInternal
Mark as valid/invalid all site dependencies depending on the existence of the target_path in the site- Specified by:
validateDependencies
in interfaceDependencyServiceInternal
- Parameters:
siteId
- the site id
-
isValidDependencySource
Description copied from interface:DependencyServiceInternal
Indicate if the given path is a valid dependency source. e.g.: templates, pages, components Some files cannot have dependencies, like images or txt files- Specified by:
isValidDependencySource
in interfaceDependencyServiceInternal
- Parameters:
siteId
- the site idpath
- the path to check- Returns:
- true if the path is a valid dependency source, false otherwise
-
setStudioConfiguration
-
setDependencyDao
-
setItemServiceInternal
-
setDependencyResolver
-
setServicesConfig
-
setGeneralLockService
-
setRetryingDatabaseOperationFacade
public void setRetryingDatabaseOperationFacade(RetryingDatabaseOperationFacade retryingDatabaseOperationFacade)
-