Class PathReferencesServiceImpl

    • Constructor Detail

      • PathReferencesServiceImpl

        public PathReferencesServiceImpl()
    • 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 interface PathReferencesService
        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

        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 interface PathReferencesService
        Parameters:
        resolver - the resolver (user/session) to use for searching
        hit - the repository resource which has to be changed
        newPath - 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)
      • absPath

        @NotNull
        protected static @NotNull String absPath​(@NotNull
                                                 @NotNull String basePath,
                                                 @NotNull
                                                 @NotNull String relPath)