Class CmsJspResourceWrapper

    • Method Detail

      • getCmsObject

        public CmsObject getCmsObject()
        Returns the OpenCms user context this resource was initialized with.

        Returns:
        the OpenCms user context this resource was initialized with
      • getContent

        public java.lang.String getContent()
        Returns the content of the file as a String.

        Returns:
        the content of the file as a String
      • getFile

        public CmsFile getFile()
        Returns the full file object for this resource.

        Returns:
        the full file object for this resource
      • getIncomingRelations

        public java.util.List<CmsJspResourceWrappergetIncomingRelations()
        Gets a list of resource wrappers for resources with relations pointing to this resource.
        Returns:
        the list of resource wrappers
      • getIncomingRelations

        public java.util.List<CmsJspResourceWrappergetIncomingRelations​(java.lang.String typeName)
        Gets a list of resource wrappers for resources with relations pointing to this resource, for a specific type.
        Parameters:
        typeName - name of the type to filter
        Returns:
        the list of resource wrappers
      • getIsImage

        public boolean getIsImage()
        Returns true in case this resource is an image in the VFS.

        Returns:
        true in case this resource is an image in the VFS
      • getIsXml

        public boolean getIsXml()
        Returns true in case this resource is an XML content.

        Returns:
        true in case this resource is an XML content
      • getLink

        public java.lang.String getLink()
        Returns a substituted link to this resource.

        Returns:
        the link
      • getLocaleResource

        public java.util.Map<java.lang.String,​CmsJspResourceWrappergetLocaleResource()
        Returns a map of the locale group for the current resource, with locale strings as keys.

        Returns:
        a map with locale strings as keys and resource wrappers for the corresponding locale variants
      • getMainLocale

        public java.util.Locale getMainLocale()
        Returns the main locale for this resource.

        Returns:
        the main locale for this resource
      • getMimeType

        public java.lang.String getMimeType()
        Returns the mime type for this resource.

        In case no valid mime type can be determined from the file extension, text/plain is returned.

        Returns:
        the mime type for this resource
      • getNavBuilder

        public CmsJspNavBuilder getNavBuilder()
        Returns the navigation builder for this resource.

        This will be initialized with this resource as default URI.

        Returns:
        the navigation builder for this resource
      • getNavigation

        public CmsJspNavElement getNavigation()
        Returns the navigation info element for this resource.

        Returns:
        the navigation info element for this resource
      • getNavigationForFolder

        public java.util.List<CmsJspNavElementgetNavigationForFolder()
        Returns the navigation info elements in this resource, assuming that this resource is a folder.

        Returns:
        the navigation info elements in this resource, assuming that this resource is a folder
      • getOnlineLink

        public java.lang.String getOnlineLink()
        Returns the substituted online link to this resource.

        Returns:
        the link
      • getOutgoingRelations

        public java.util.List<CmsJspResourceWrappergetOutgoingRelations()
        Gets a list of resources with relations pointing to them from this resources, as resource wrappers.
        Returns:
        the list of resource wrappers
      • getOutgoingRelations

        public java.util.List<CmsJspResourceWrappergetOutgoingRelations​(java.lang.String typeName)
        Gets a list of resources with relations pointing to them from this resources, as resource wrappers. Only gets resources with the given type.
        Parameters:
        typeName - the name of the type to filter
        Returns:
        the list of resource wrappers
      • getParentFolders

        public java.util.List<CmsJspResourceWrappergetParentFolders()
        Returns all parent folder of this resource in the current site as a list.

        First resource in the list will be the direct parent folder of this resource, the last element will be the site root folder.

        Returns:
        all parent folder of this resource in the current site as a list
      • getProperty

        public java.util.Map<java.lang.String,​java.lang.String> getProperty()
        Returns the direct properties of this resource in a map.

        This is without "search", so it will not include inherited properties from the parent folders.

        Returns:
        the direct properties of this resource in a map
      • getPropertyLocale

        public java.util.Map<java.lang.String,​java.util.Map<java.lang.String,​java.lang.String>> getPropertyLocale()
        Returns the direct properties of this resource in a map for a given locale.

        This is without "search", so it will not include inherited properties from the parent folders.

        Returns:
        the direct properties of this resource in a map for a given locale
      • getPropertyLocaleSearch

        public java.util.Map<java.lang.String,​java.util.Map<java.lang.String,​java.lang.String>> getPropertyLocaleSearch()
        Returns the searched properties of this resource in a map for a given locale.

        This is with "search", so it will include inherited properties from the parent folders.

        Returns:
        the direct properties of this resource in a map for a given locale
      • getPropertySearch

        public java.util.Map<java.lang.String,​java.lang.String> getPropertySearch()
        Returns the searched properties of this resource in a map.

        This is with "search", so it will include inherited properties from the parent folders.

        Returns:
        the direct properties of this resource in a map
      • getRequestContext

        public CmsRequestContext getRequestContext()
        Returns the OpenCms user request context this resource was initialized with.

        Returns:
        the OpenCms user request context this resource was initialized with
      • getResourceName

        public java.lang.String getResourceName()
        Returns the name of this resource without the path information.

        The resource name of a file is the name of the file. The resource name of a folder is the folder name with trailing "/". The resource name of the root folder is /.

        Returns:
        the name of this resource without the path information
        See Also:
        CmsResource.getName(), CmsJspVfsAccessBean.getResourceName(Object)
      • getRootPathFolder

        public java.lang.String getRootPathFolder()
        Returns the folder name of this resource from the root site.

        In case this resource already is a CmsFolder, the folder path is returned without modification. In case it is a CmsFile, the parent folder name of the file is returned.

        Returns:
        the folder name of this resource from the root site
      • getRootPathLevel

        public int getRootPathLevel()
        Returns the directory level of a resource from the root site.

        The root folder "/" has level 0, a folder "/foo/" would have level 1, a folder "/foo/bar/" level 2 etc.

        Returns:
        the directory level of a resource from the root site
        See Also:
        CmsResource.getPathLevel(String)
      • getSitePathFolder

        public java.lang.String getSitePathFolder()
        Returns the folder name of this resource in the current site.

        In case this resource already is a CmsFolder, the folder path is returned without modification. In case it is a CmsFile, the parent folder name of the file is returned.

        Returns:
        the folder name of this resource in the current site
      • getToImage

        public CmsJspImageBean getToImage()
        Returns a scaled image bean from the wrapped value.

        In case the value does not point to an image resource, null is returned.

        Returns:
        the scaled image bean
      • getToXml

        public CmsJspContentAccessBean getToXml()
        Returns an XML content access bean created for this resource.

        In case this resource is not an XML content, null is returned.

        Returns:
        an XML content access bean created for this resource
        See Also:
        getIsXml()
      • getTypeName

        public java.lang.String getTypeName()
        Returns the resource type name.

        Returns:
        the resource type name
      • getXml

        public CmsJspContentAccessBean getXml()
        Returns an XML content access bean created for this resource.

        In case this resource is not an XML content, null is returned.

        Returns:
        an XML content access bean created for this resource
        See Also:
        getToXml(), getIsXml()
      • isChildResourceOf

        public boolean isChildResourceOf​(CmsResource resource)
        Returns true in case this resource is child resource of the provided resource which is assumed to be a folder.

        Parameters:
        resource - the resource to check
        Returns:
        true in case this resource is child resource of the provided resource which is assumed to be a folder
      • isChildResourceOf

        public boolean isChildResourceOf​(java.lang.String sitePath)
        Returns true in case this resource is child resource of the provided resource path which is assumed to be a folder in the current site.

        No check is performed to see if the provided site path resource actually exists.

        Parameters:
        sitePath - the resource to check
        Returns:
        true in case this resource is child resource of the provided resource path which is assumed to be a folder in the current site
      • isParentFolderOf

        public boolean isParentFolderOf​(CmsResource resource)
        Returns true in case this resource is a parent folder of the provided resource.

        Parameters:
        resource - the resource to check
        Returns:
        true in case this resource is a parent folder of the provided resource
      • isParentFolderOf

        public boolean isParentFolderOf​(java.lang.String sitePath)
        Returns true in case this resource is a parent folder of the provided resource path in the current site.

        No check is performed to see if the provided site path resource actually exists.

        Parameters:
        sitePath - the path to check
        Returns:
        true in case this resource is a parent folder of the provided resource path in the current site