Class PathReferencesServiceImpl
- java.lang.Object
-
- com.composum.sling.core.service.impl.PathReferencesServiceImpl
-
- All Implemented Interfaces:
PathReferencesService
public class PathReferencesServiceImpl extends Object implements PathReferencesService
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
PathReferencesServiceImpl.HitIteratorImpl
-
Nested classes/interfaces inherited from interface com.composum.sling.core.service.PathReferencesService
PathReferencesService.Hit, PathReferencesService.HitIterator, PathReferencesService.Options
-
-
Constructor Summary
Constructors Constructor Description PathReferencesServiceImpl()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static @NotNull String
absPath(@NotNull String basePath, @NotNull String relPath)
protected void
addPathExpression(@NotNull PathReferencesService.Options options, @NotNull StringBuilder queryBuilder, @NotNull String propertyName, @NotNull String path)
void
changeReferences(@NotNull org.apache.sling.api.resource.ResourceResolver resolver, @NotNull PathReferencesService.Hit hit, @NotNull String newPath)
replaces each occurrence of the paths found in a previous search by the new path in the properties of the found resource (hit)protected static void
collectOccurrences(@NotNull List<String> collection, @NotNull String text, @NotNull String path, boolean includeChildren)
protected static void
collectOccurrences(@NotNull List<String> collection, @NotNull String text, @NotNull Pattern pattern)
@NotNull PathReferencesService.HitIterator
findReferences(@NotNull org.apache.sling.api.resource.ResourceResolver resolver, @NotNull PathReferencesService.Options options, @NotNull String searchRoot, @NotNull String path)
searches resources which are referencing the given pathprotected static Pattern
propertyValuePattern(@NotNull String path, boolean includeChildren)
protected static @NotNull String
relPath(@NotNull String basePath, @NotNull String path)
protected static Pattern
richTextPattern(@NotNull String path, boolean includeChildren)
-
-
-
Method Detail
-
findReferences
@NotNull public @NotNull PathReferencesService.HitIterator findReferences(@NotNull @NotNull org.apache.sling.api.resource.ResourceResolver resolver, @NotNull @NotNull PathReferencesService.Options options, @NotNull @NotNull String searchRoot, @NotNull @NotNull String path)
Description copied from interface:PathReferencesService
searches resources which are referencing the given path- Specified by:
findReferences
in interfacePathReferencesService
- Parameters:
resolver
- the resolver (the user/session context)options
- the options to create the search querysearchRoot
- the repository root path of the area to browsepath
- the path for which the referers have to be found; maybe with wildcards ('*'/'%')- Returns:
- the iterator to traverse the found referrers
-
addPathExpression
protected void addPathExpression(@NotNull @NotNull PathReferencesService.Options options, @NotNull @NotNull StringBuilder queryBuilder, @NotNull @NotNull String propertyName, @NotNull @NotNull String path)
-
changeReferences
public void changeReferences(@NotNull @NotNull org.apache.sling.api.resource.ResourceResolver resolver, @NotNull @NotNull PathReferencesService.Hit hit, @NotNull @NotNull String newPath)
Description copied from interface:PathReferencesService
replaces each occurrence of the paths found in a previous search by the new path in the properties of the found resource (hit)- Specified by:
changeReferences
in interfacePathReferencesService
- Parameters:
resolver
- the resolver (user/session) to use for searchinghit
- the repository resource which has to be changednewPath
- the new path value
-
collectOccurrences
protected static void collectOccurrences(@NotNull @NotNull List<String> collection, @NotNull @NotNull String text, @NotNull @NotNull String path, boolean includeChildren)
-
collectOccurrences
protected static void collectOccurrences(@NotNull @NotNull List<String> collection, @NotNull @NotNull String text, @NotNull @NotNull Pattern pattern)
-
richTextPattern
protected static Pattern richTextPattern(@NotNull @NotNull String path, boolean includeChildren)
-
propertyValuePattern
protected static Pattern propertyValuePattern(@NotNull @NotNull String path, boolean includeChildren)
-
relPath
@NotNull protected static @NotNull String relPath(@NotNull @NotNull String basePath, @NotNull @NotNull String path)
-
-