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 TypeMethodDescriptionvoiddeleteItemDependencies(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.voidinvalidateDependencies(String siteId, String targetPath) Mark as invalid the dependency records with the given target pathbooleanisValidDependencySource(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 pathvoidsetDependencyDao(DependencyDAO dependencyDao) voidsetDependencyResolver(DependencyResolver dependencyResolver) voidsetGeneralLockService(GeneralLockService generalLockService) voidsetItemServiceInternal(ItemServiceInternal itemServiceInternal) voidsetRetryingDatabaseOperationFacade(RetryingDatabaseOperationFacade retryingDatabaseOperationFacade) voidsetServicesConfig(ServicesConfig servicesConfig) voidsetStudioConfiguration(StudioConfiguration studioConfiguration) voidupsertDependencies(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.voidvalidateDependencies(String siteId) Mark as valid/invalid all site dependencies depending on the existence of the target_path in the sitevoidvalidateDependencies(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:DependencyServiceInternalGet a soft dependencies of a list of items. A soft dependency is: * an edited, shared (not item specific) dependency- Specified by:
getSoftDependenciesin 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:DependencyServiceInternalGet 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:
getHardDependenciesin 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:DependencyServiceInternalGet list of paths of content items that are dependent on given paths- Specified by:
getDependentPathsin 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:DependencyServiceInternalGet list of paths of content items that are dependent on given path- Specified by:
getDependentItemsin interfaceDependencyServiceInternal- Parameters:
siteId- site identifierpath- path to get dependent items for- Returns:
- list of
DependencyItemdependent on given path
-
getItemSpecificDependencies
Description copied from interface:DependencyServiceInternalGet item specific dependencies for given path- Specified by:
getItemSpecificDependenciesin interfaceDependencyServiceInternal- Parameters:
siteId- site identifierpath- path to get item specific dependencies for- Returns:
- list of item specific dependencies
-
getItemSpecificDependencies
Description copied from interface:DependencyServiceInternalGet item specific dependencies for given path- Specified by:
getItemSpecificDependenciesin 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:DependencyServiceInternalResolves dependent files for given content of given path- Specified by:
resolveDependenciesin 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:DependencyServiceInternalScan 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:
upsertDependenciesin interfaceDependencyServiceInternal- Parameters:
site- Site to operate onpath- Path to item to scan- Throws:
ServiceLayerException- Internal error, see exception details
-
deleteItemDependencies
Description copied from interface:DependencyServiceInternalDelete the dependencies of sourcePath- Specified by:
deleteItemDependenciesin interfaceDependencyServiceInternal- Parameters:
site- the site idsourcePath- the source path of the dependencies to delete- Throws:
ServiceLayerException
-
invalidateDependencies
Description copied from interface:DependencyServiceInternalMark as invalid the dependency records with the given target path- Specified by:
invalidateDependenciesin interfaceDependencyServiceInternal- Parameters:
siteId- the site idtargetPath- the target path of the dependencies to invalidate- Throws:
ServiceLayerException
-
validateDependencies
Description copied from interface:DependencyServiceInternalMark as valid the dependency records with the given target path- Specified by:
validateDependenciesin interfaceDependencyServiceInternal- Parameters:
siteId- the site idtargetPath- the target path of the dependencies to validate- Throws:
ServiceLayerException
-
validateDependencies
Description copied from interface:DependencyServiceInternalMark as valid/invalid all site dependencies depending on the existence of the target_path in the site- Specified by:
validateDependenciesin interfaceDependencyServiceInternal- Parameters:
siteId- the site id
-
isValidDependencySource
Description copied from interface:DependencyServiceInternalIndicate 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:
isValidDependencySourcein 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)
-