Package com.composum.sling.core.service
Interface PathReferencesService
-
- All Known Implementing Classes:
PathReferencesServiceImpl
public interface PathReferencesServicethe service for finding and changing resource references
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfacePathReferencesService.Hita found resource which is referencing the searched pathstatic interfacePathReferencesService.HitIteratorstatic classPathReferencesService.Optionsan options set to specify the parameters of the query to search path references; build the options for the reference search like this:
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description 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)@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 path
-
-
-
Method Detail
-
findReferences
@NotNull @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)
searches resources which are referencing the given path- 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
-
changeReferences
void changeReferences(@NotNull @NotNull org.apache.sling.api.resource.ResourceResolver resolver, @NotNull @NotNull PathReferencesService.Hit hit, @NotNull @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)- Parameters:
resolver- the resolver (user/session) to use for searchinghit- the repository resource which has to be changednewPath- the new path value
-
-