Class CmsJspResourceWrapper
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparable<I_CmsResource>
,I_CmsResource
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.opencms.file.CmsResource
CmsResource.CmsResourceCopyMode, CmsResource.CmsResourceDeleteMode, CmsResource.CmsResourceUndoMode
Nested classes/interfaces inherited from interface org.opencms.file.I_CmsResource
I_CmsResource.CmsResourceAttribute
-
Field Summary
Modifier and TypeFieldDescriptionAll resources that are sources of incoming relations.All resources that are targets of outgoing relations.All parent folder of this resource in the current site as a list.static final boolean
Parameter value used to select incoming relations.static final boolean
Parameter value used to select outgoing relations.Fields inherited from class org.opencms.file.CmsResource
COPY_AS_NEW, COPY_AS_SIBLING, COPY_PRESERVE_SIBLING, DATE_EXPIRED_DEFAULT, DATE_RELEASED_DEFAULT, DATE_RELEASED_EXPIRED_IGNORE, DELETE_PRESERVE_SIBLINGS, DELETE_REMOVE_SIBLINGS, FLAG_INTERNAL, FLAG_LABELED, FLAG_TEMPFILE, m_dateContent, m_length, NAME_CONSTRAINTS, STATE_CHANGED, STATE_DELETED, STATE_KEEP, STATE_NEW, STATE_UNCHANGED, TEMP_FILE_PREFIX, TOUCH_DATE_UNCHANGED, UNDO_CONTENT, UNDO_CONTENT_RECURSIVE, UNDO_MOVE_CONTENT, UNDO_MOVE_CONTENT_RECURSIVE, VFS_FOLDER_SITES, VFS_FOLDER_SYSTEM
Fields inherited from interface org.opencms.file.I_CmsResource
COMPARE_DATE_LAST_MODIFIED, COMPARE_DATE_RELEASED, COMPARE_ROOT_PATH, COMPARE_ROOT_PATH_IGNORE_CASE, COMPARE_ROOT_PATH_IGNORE_CASE_FOLDERS_FIRST
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Two resources are considered equal in case their structure id is equal.Returns the categories assigned to this resource.Returns the OpenCms user context this resource was initialized with.Returns the content of the file as a String.Returns this resources name extension (if present).getFile()
Returns the full file object for this resource.Returns the folder of this resource.Gets a list of resource wrappers for resources with relations pointing to this resource.getIncomingRelations
(String typeName) Gets a list of resource wrappers for resources with relations pointing to this resource, for a specific type.boolean
Returnstrue
in case this resource is an image in the VFS.boolean
getIsXml()
Returnstrue
in case this resource is an XML content.getLink()
Returns a substituted link to this resource.Returns a map of the locale group for the current resource, with locale strings as keys.Returns the main locale for this resource.Returns the mime type for this resource.Returns the navigation builder for this resource.Returns the navigation info element for this resource.Returns the default resource for this resource.Returns the navigation info elements in this resource, assuming that this resource is a folder.Returns the substituted online link to this resource.Gets a list of resources with relations pointing to them from this resources, as resource wrappers.getOutgoingRelations
(String typeName) Gets a list of resources with relations pointing to them from this resources, as resource wrappers.Returns the parent folder of this resource in the current site.Returns all parent folder of this resource in the current site as a list.Returns the direct properties of this resource in a map.Returns the locale specific evaluated "Description" property for the resource.Returns the locale specific evaluated "Keywords" property for the resource.Returns the direct properties of this resource in a map for a given locale.Returns the searched properties of this resource in a map for a given locale.Returns the searched properties of this resource in a map.Returns the OpenCms user request context this resource was initialized with.Returns this resources name extension (if present).Returns the name of this resource without the path information.Returns the folder name of this resource from the root site.int
Returns the directory level of a resource from the root site.Returns the parent folder of this resource from the root site.Returns the current site path to this resource.Returns the folder name of this resource in the current site.int
Returns the directory level of a resource in the current site.Returns the parent folder of this resource in the current site.Returns a scaled image bean from the wrapped value.Returns this resource wrapper.getToXml()
Returns an XML content access bean created for this resource.Returns the resource type name.getXml()
Returns an XML content access bean created for this resource.int
hashCode()
boolean
isChildResourceOf
(String sitePath) Returnstrue
in case this resource is child resource of the provided resource path which is assumed to be a folder in the current site.boolean
isChildResourceOf
(CmsResource resource) Returnstrue
in case this resource is child resource of the provided resource which is assumed to be a folder.boolean
boolean
isParentFolderOf
(String sitePath) Returnstrue
in case this resource is a parent folder of the provided resource path in the current site.boolean
isParentFolderOf
(CmsResource resource) Returnstrue
in case this resource is a parent folder of the provided resource.static CmsJspResourceWrapper
wrap
(CmsObject cms, CmsResource res) Factory method to create a newCmsJspResourceWrapper
instance from aCmsResource
.Methods inherited from class org.opencms.file.CmsResource
checkResourceName, clone, compareTo, getCopy, getDateContent, getDateCreated, getDateExpired, getDateLastModified, getDateReleased, getExtension, getFlags, getFolderPath, getLength, getName, getName, getParentFolder, getPathLevel, getPathPart, getProjectLastModified, getResourceId, getRootPath, getSiblingCount, getState, getStructureId, getTypeId, getUserCreated, getUserLastModified, getVersion, isExpired, isFile, isFolder, isFolder, isInternal, isInternalOrInInternalFolder, isLabeled, isReleased, isReleasedAndNotExpired, isTemporaryFile, isTemporaryFileName, isTouched, setDateExpired, setDateLastModified, setDateReleased, setFlags, setInternal, setState, setType, setUserLastModified, toString
-
Field Details
-
RELATIONS_OUT
Parameter value used to select outgoing relations.- See Also:
-
RELATIONS_IN
Parameter value used to select incoming relations.- See Also:
-
m_incomingRelations
All resources that are sources of incoming relations. -
m_outgoingRelations
All resources that are targets of outgoing relations. -
m_parentFolders
All parent folder of this resource in the current site as a list.
-
-
Method Details
-
wrap
Factory method to create a newCmsJspResourceWrapper
instance from aCmsResource
.In case the parameter resource already is a wrapped resource AND the OpenCms request context is the same as the provided context, the parameter object is returned.
- Parameters:
cms
- the current CMS contextres
- the resource to wrap- Returns:
- a new instance of a
CmsJspResourceWrapper
-
equals
Two resources are considered equal in case their structure id is equal.- Overrides:
equals
in classCmsResource
- See Also:
-
getCategories
Returns the categories assigned to this resource.- Returns:
- the categories assigned to this resource
-
getCmsObject
Returns the OpenCms user context this resource was initialized with.- Returns:
- the OpenCms user context this resource was initialized with
-
getContent
Returns the content of the file as a String.- Returns:
- the content of the file as a String
-
getExtension
Returns this resources name extension (if present).The extension will always be lower case.
- Returns:
- the extension or
null
if not available - See Also:
-
getFile
Returns the full file object for this resource.- Returns:
- the full file object for this resource
-
getFolder
Returns the folder of this resource.In case this resource already is a
CmsFolder
, it is returned without modification. In case it is aCmsFile
, the parent folder of the file is returned.- Returns:
- the folder of this resource
- See Also:
-
getIncomingRelations
Gets a list of resource wrappers for resources with relations pointing to this resource.- Returns:
- the list of resource wrappers
-
getIncomingRelations
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
Returnstrue
in case this resource is an image in the VFS.- Returns:
true
in case this resource is an image in the VFS
-
getIsXml
Returnstrue
in case this resource is an XML content.- Returns:
true
in case this resource is an XML content
-
getLink
Returns a substituted link to this resource.- Returns:
- the link
-
getLocaleResource
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
Returns the main locale for this resource.- Returns:
- the main locale for this resource
-
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
-
getOnlineLink
Returns the substituted online link to this resource.- Returns:
- the link
-
getOutgoingRelations
Gets a list of resources with relations pointing to them from this resources, as resource wrappers.- Returns:
- the list of resource wrappers
-
getOutgoingRelations
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
-
getParentFolder
Returns the parent folder of this resource in the current site.The parent folder of a file is the folder of the file. The parent folder of a folder is the parent folder of the folder. The parent folder of the root folder is
null
.- Returns:
- the parent folder of this resource in the current site
- See Also:
-
getParentFolders
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
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
-
getPropertyDescription
Returns the locale specific evaluated "Description" property for the resource. In case the resource is a default file, also the parent folders "Description" property is read as fallback.- Returns:
- the locale specific description property for the resource.
-
getPropertyKeywords
Returns the locale specific evaluated "Keywords" property for the resource. In case the resource is a default file, also the parent folders "Keywords" property is read as fallback.- Returns:
- the locale specific description property for the resource.
-
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
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
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
Returns the OpenCms user request context this resource was initialized with.- Returns:
- the OpenCms user request context this resource was initialized with
-
getResourceExtension
Returns this resources name extension (if present).The extension will always be lower case.
- Returns:
- the extension or
null
if not available - See Also:
-
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:
-
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 aCmsFile
, the parent folder name of the file is returned.- Returns:
- the folder name of this resource from the root site
-
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:
-
getRootPathParentFolder
Returns the parent folder of this resource from the root site.- Returns:
- the parent folder of this resource from the root site
- See Also:
-
getSitePath
Returns the current site path to this resource.- Returns:
- the current site path to this resource
- See Also:
-
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 aCmsFile
, the parent folder name of the file is returned.- Returns:
- the folder name of this resource in the current site
-
getSitePathLevel
Returns the directory level of a resource in the current 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 in the current site
- See Also:
-
getSitePathParentFolder
Returns the parent folder of this resource in the current site.The parent folder of a file is the folder of the file. The parent folder of a folder is the parent folder of the folder. The parent folder of the root folder is
null
.- Returns:
- the parent folder of this resource in the current site
- See Also:
-
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
-
getToResource
Returns this resource wrapper.This is included because in case
CmsJspStandardContextBean.getWrap()
is used, the result may be either aCmsJspObjectValueWrapper
or aCmsJspResourceWrapper
. UsinggetToResource()
on the result will always return a resource wrapper this way.- Returns:
- this resource wrapper
- See Also:
-
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:
-
getTypeName
Returns the resource type name.- Returns:
- the resource type name
-
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:
-
hashCode
- Overrides:
hashCode
in classCmsResource
- See Also:
-
isChildResourceOf
Returnstrue
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
Returnstrue
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
Returnstrue
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
Returnstrue
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
-