Class DependencyServiceImpl
java.lang.Object
org.craftercms.studio.impl.v2.service.dependency.DependencyServiceImpl
- All Implemented Interfaces:
DependencyService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
deleteItemDependencies
(String site, String sourcePath) Delete the dependencies of sourcePathgetDependentItems
(String siteId, String path) Get all items that depend on this itemgetDependentPaths
(String siteId, List<String> paths) Get list of paths of content items that are dependant on given pathsgetHardDependencies
(String site, List<String> paths) Get a hard dependencies of a item.getSoftDependencies
(String siteId, 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 pathvoid
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, String targetPath) Mark as valid the dependency records with the given target path
-
Constructor Details
-
DependencyServiceImpl
@ConstructorProperties("dependencyServiceInternal") public DependencyServiceImpl(DependencyServiceInternal dependencyServiceInternal)
-
-
Method Details
-
getSoftDependencies
public Collection<String> getSoftDependencies(String siteId, List<String> paths) throws ServiceLayerException Description copied from interface:DependencyService
Get a soft dependencies of a list of items. A soft dependency is: * an edited, shared (not item specific) dependency- Specified by:
getSoftDependencies
in interfaceDependencyService
- Parameters:
siteId
- Site to operate onpaths
- List of paths to items to retrieve deps for- Returns:
- list of soft dependencies
- Throws:
ServiceLayerException
- Internal error, see exception details
-
getDependentPaths
public List<String> getDependentPaths(String siteId, List<String> paths) throws SiteNotFoundException Description copied from interface:DependencyService
Get list of paths of content items that are dependant on given paths- Specified by:
getDependentPaths
in interfaceDependencyService
- Parameters:
siteId
- site identifierpaths
- list of paths to get dependent items for- Returns:
- list of paths dependent on given paths
- Throws:
SiteNotFoundException
-
getHardDependencies
public List<String> getHardDependencies(String site, List<String> paths) throws ServiceLayerException Description copied from interface:DependencyService
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 interfaceDependencyService
- Parameters:
site
- Site to operate onpaths
- List of paths to items to retrieve deps for- Returns:
- list of hard dependencies
- Throws:
ServiceLayerException
- Internal error, see exception details
-
getDependentItems
public List<DependencyItem> getDependentItems(String siteId, String path) throws ServiceLayerException Description copied from interface:DependencyService
Get all items that depend on this item- Specified by:
getDependentItems
in interfaceDependencyService
- Parameters:
siteId
- site identifierpath
- path to get dependent items for- Returns:
- list of items depending on given item path
- Throws:
ServiceLayerException
- Internal error, see exception details
-
upsertDependencies
Description copied from interface:DependencyService
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 interfaceDependencyService
- Parameters:
site
- Site to operate onpath
- Path to item to scan- Throws:
ServiceLayerException
- Internal error, see exception details
-
deleteItemDependencies
Description copied from interface:DependencyService
Delete the dependencies of sourcePath- Specified by:
deleteItemDependencies
in interfaceDependencyService
- Parameters:
site
- the site idsourcePath
- the source path of the dependencies to delete- Throws:
ServiceLayerException
-
invalidateDependencies
Description copied from interface:DependencyService
Mark as invalid the dependency records with the given target path- Specified by:
invalidateDependencies
in interfaceDependencyService
- Parameters:
siteId
- the site idtargetPath
- the target path of the dependencies to invalidate- Throws:
ServiceLayerException
-
validateDependencies
Description copied from interface:DependencyService
Mark as valid the dependency records with the given target path- Specified by:
validateDependencies
in interfaceDependencyService
- Parameters:
siteId
- the site idtargetPath
- the target path of the dependencies to validate- Throws:
ServiceLayerException
-