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 classPathReferencesServiceImpl.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 StringabsPath(@NotNull String basePath, @NotNull String relPath)protected voidaddPathExpression(@NotNull PathReferencesService.Options options, @NotNull StringBuilder queryBuilder, @NotNull String propertyName, @NotNull String path)voidchangeReferences(@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 voidcollectOccurrences(@NotNull List<String> collection, @NotNull String text, @NotNull String path, boolean includeChildren)protected static voidcollectOccurrences(@NotNull List<String> collection, @NotNull String text, @NotNull Pattern pattern)@NotNull PathReferencesService.HitIteratorfindReferences(@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 PatternpropertyValuePattern(@NotNull String path, boolean includeChildren)protected static @NotNull StringrelPath(@NotNull String basePath, @NotNull String path)protected static PatternrichTextPattern(@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:PathReferencesServicesearches resources which are referencing the given path- Specified by:
 findReferencesin 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:PathReferencesServicereplaces each occurrence of the paths found in a previous search by the new path in the properties of the found resource (hit)- Specified by:
 changeReferencesin 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)
 
 - 
 
 -