Class Browser

    • Constructor Detail

      • Browser

        public Browser​(BeanContext context,
                       org.apache.sling.api.resource.Resource resource)
      • Browser

        public Browser()
    • Method Detail

      • getPrimaryType

        public String getPrimaryType()
      • isTyped

        public boolean isTyped()
        returns 'true' if the current resource has a well known resource type
      • isDeclaringType

        public boolean isDeclaringType()
        Returns:
        'true' if the current resource itself declares a resource type
      • isSourcePath

        public boolean isSourcePath()
        Returns:
        'true' if the current resource itself 'implements' a resource type
      • getResourceType

        @NotNull
        public @NotNull String getResourceType()
        the content resource type (sling:resourceType) declared for the current resource
      • getResourceType

        @Nullable
        public static @Nullable String getResourceType​(@NotNull
                                                       @NotNull ResourceHandle resource)
      • getResourceType

        @Nullable
        protected @Nullable String getResourceType​(@Nullable
                                                   @Nullable String resourceType)
        Remove any search path / /mnt/overlay from given path to a resource type = "normalize" path to resource type.
      • getTypeResource

        @Nullable
        protected @Nullable org.apache.sling.api.resource.Resource getTypeResource​(@Nullable
                                                                                   @Nullable String resourceType,
                                                                                   boolean includeOverlay)
        Returns the resource for a resourceType (the "highest" in the search path), or the resource if the path is absolute.
      • getTypeSearchPath

        @NotNull
        protected @NotNull List<String> getTypeSearchPath​(boolean includeOverlay)
      • getSupertypeChain

        @NotNull
        public @NotNull List<String> getSupertypeChain()
        The chain of resource super types. This is also included for content resources since this is used quite often in AEM.
        See Also:
        "https://experienceleague.adobe.com/docs/experience-manager-65/developing/introduction/the-basics.html?lang=en#sling-request-processing"
      • getResourceTypeSet

        @NotNull
        protected @NotNull Map<String,​Browser.Reference> getResourceTypeSet()
        Paths for the locations relevant to the resource typein search paths, /mnt/override / /mnt/overlay, mapped to the label information.
      • getRelatedPathSet

        @NotNull
        public @NotNull Map<String,​Browser.Reference> getRelatedPathSet()
        Set of related paths: for resource types the resource type found in the search path and /mnt/(override|overlay), base paths, resource types.
      • getBasePath

        public String getBasePath()
      • getOverlayRoot

        public String getOverlayRoot()
      • isOverlayResource

        public boolean isOverlayResource()
      • isOverlayAvailable

        public boolean isOverlayAvailable()
      • getOverlayPath

        @Nullable
        public @Nullable String getOverlayPath()
        Path of resource type within /mnt/overlay . If not a declaring resource, this doesn't make sense -> null.
      • getOverrideRoot

        public String getOverrideRoot()
      • isOverrideResource

        public boolean isOverrideResource()
      • isOverrideAvailable

        public boolean isOverrideAvailable()
      • getOverridePath

        @NotNull
        public @NotNull String getOverridePath()
        Path within /mnt/override.
      • isSceneAvailable

        public boolean isSceneAvailable()
      • isRenderable

        public boolean isRenderable()
      • isRenderable

        public static boolean isRenderable​(@NotNull
                                           @NotNull ResourceHandle resource,
                                           @Nullable
                                           @Nullable String extension)
      • isFile

        public boolean isFile()
      • isFile

        public static boolean isFile​(@NotNull
                                     @NotNull ResourceHandle resource)
      • getFilePath

        @NotNull
        public @NotNull String getFilePath()
      • getFilePath

        @NotNull
        public static @NotNull String getFilePath​(@NotNull
                                                  @NotNull ResourceHandle resource)
      • getFileIcon

        @NotNull
        public @NotNull String getFileIcon()
      • getFileIcon

        @NotNull
        public static @NotNull String getFileIcon​(@NotNull
                                                  @NotNull ResourceHandle resource)
      • isAsset

        public boolean isAsset()
      • isImage

        public boolean isImage()
      • getImageCSS

        public String getImageCSS()
      • isVideo

        public boolean isVideo()
      • isText

        public boolean isText()
      • isText

        public static boolean isText​(@NotNull
                                     @NotNull ResourceHandle resource)
      • isMergedResource

        public boolean isMergedResource()
      • isJcrResource

        public boolean isJcrResource()
      • isCanHaveAcl

        public boolean isCanHaveAcl()
      • isVersionable

        public boolean isVersionable()
      • isCaConfigRelevant

        public boolean isCaConfigRelevant()
      • isSetupScript

        public boolean isSetupScript()
      • getTextSnippet

        @NotNull
        public @NotNull String getTextSnippet()
      • getNameExtension

        @NotNull
        public @NotNull String getNameExtension()
      • getTextType

        @NotNull
        public @NotNull String getTextType()
        Determines the text type for the current node using the mimeType (if present) and the extension.
      • getTextType

        @NotNull
        public static @NotNull String getTextType​(@NotNull
                                                  @NotNull ResourceHandle resource)
      • getFileType

        @NotNull
        public static @NotNull String getFileType​(Map<String,​String> typeMap,
                                                  String mimeType,
                                                  String extension)
        Determines the text type for the current node using the mimeType (if present) and the extension.
        Returns:
        the type of the text file (script language) or ""
      • getViewType

        public String getViewType()
      • getTabType

        public String getTabType()
      • getCurrent

        public Browser.NodeHandle getCurrent()
        Returns a JSP handle of the node displayed currently by the browser.
      • getCurrentPathUrl

        public String getCurrentPathUrl()
        Returns a URL to the current nodes View based on the nodes path (without mapping).
      • getMappedUrl

        public String getMappedUrl()
        Returns a URL to the current nodes View with resolver mapping.
      • getCurrentUrl

        public String getCurrentUrl()
        Returns a URL to the current nodes View with mapping according to the configuration.
      • getEditCodeUrl

        public String getEditCodeUrl()
        Returns a URL to the current nodes View with mapping according to the configuration.
      • getMimeType

        public String getMimeType()
        the content mime type declared for the current resource
      • getMimeType

        @NotNull
        public static @NotNull String getMimeType​(@NotNull
                                                  @NotNull org.apache.sling.api.resource.Resource resource)