Interface PathReferencesService

  • All Known Implementing Classes:
    PathReferencesServiceImpl

    public interface PathReferencesService
    the service for finding and changing resource references
    • 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 query
        searchRoot - the repository root path of the area to browse
        path - 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 searching
        hit - the repository resource which has to be changed
        newPath - the new path value