public class CmsJspResourceWrapper extends CmsResource
CmsResource.CmsResourceCopyMode, CmsResource.CmsResourceDeleteMode, CmsResource.CmsResourceUndoMode
I_CmsResource.CmsResourceAttribute
Modifier and Type | Field and Description |
---|---|
java.util.List<CmsJspResourceWrapper> |
m_parentFolders
All parent folder of this resource in the current site as a list.
|
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
COMPARE_DATE_LAST_MODIFIED, COMPARE_DATE_RELEASED, COMPARE_ROOT_PATH, COMPARE_ROOT_PATH_IGNORE_CASE, COMPARE_ROOT_PATH_IGNORE_CASE_FOLDERS_FIRST
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj)
Two resources are considered equal in case their structure id is equal.
|
CmsJspCategoryAccessBean |
getCategories()
Returns the categories assigned to this resource.
|
CmsObject |
getCmsObject()
Returns the OpenCms user context this resource was initialized with.
|
java.lang.String |
getContent()
Returns the content of the file as a String.
|
java.lang.String |
getExtension()
Returns this resources name extension (if present).
|
CmsFile |
getFile()
Returns the full file object for this resource.
|
CmsJspResourceWrapper |
getFolder()
Returns the folder of this resource.
|
boolean |
getIsImage()
Returns
true in case this resource is an image in the VFS. |
boolean |
getIsXml()
Returns
true in case this resource is an XML content. |
java.lang.String |
getLink()
Returns a substituted link to this resource.
|
java.util.Map<java.lang.String,CmsJspResourceWrapper> |
getLocaleResource()
Returns a map of the locale group for the current resource, with locale strings as keys.
|
java.util.Locale |
getMainLocale()
Returns the main locale for this resource.
|
java.lang.String |
getMimeType()
Returns the mime type for this resource.
|
CmsJspNavBuilder |
getNavBuilder()
Returns the navigation builder for this resource.
|
CmsJspNavElement |
getNavigation()
Returns the navigation info element for this resource.
|
CmsJspResourceWrapper |
getNavigationDefaultFile()
Returns the default resource for this resource.
|
java.util.List<CmsJspNavElement> |
getNavigationForFolder()
Returns the navigation info elements in this resource, assuming that this resource is a folder.
|
CmsJspResourceWrapper |
getParentFolder()
Returns the parent folder of this resource in the current site.
|
java.util.List<CmsJspResourceWrapper> |
getParentFolders()
Returns all parent folder of this resource in the current site as a list.
|
java.util.Map<java.lang.String,java.lang.String> |
getProperty()
Returns the direct properties of this resource in a map.
|
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.
|
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.
|
java.util.Map<java.lang.String,java.lang.String> |
getPropertySearch()
Returns the searched properties of this resource in a map.
|
CmsRequestContext |
getRequestContext()
Returns the OpenCms user request context this resource was initialized with.
|
java.lang.String |
getResourceExtension()
Returns this resources name extension (if present).
|
java.lang.String |
getResourceName()
Returns the name of this resource without the path information.
|
java.lang.String |
getRootPathFolder()
Returns the folder name of this resource from the root site.
|
int |
getRootPathLevel()
Returns the directory level of a resource from the root site.
|
java.lang.String |
getRootPathParentFolder()
Returns the parent folder of this resource from the root site.
|
java.lang.String |
getSitePath()
Returns the current site path to this resource.
|
java.lang.String |
getSitePathFolder()
Returns the folder name of this resource in the current site.
|
int |
getSitePathLevel()
Returns the directory level of a resource in the current site.
|
java.lang.String |
getSitePathParentFolder()
Returns the parent folder of this resource in the current site.
|
CmsJspImageBean |
getToImage()
Returns a scaled image bean from the wrapped value.
|
CmsJspContentAccessBean |
getToXml()
Returns an XML content access bean created for this resource.
|
CmsJspContentAccessBean |
getXml()
Returns an XML content access bean created for this resource.
|
int |
hashCode() |
boolean |
isChildResourceOf(CmsResource resource)
Returns
true in case this resource is child resource of the provided resource which is assumed to be a folder. |
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. |
boolean |
isParentFolderOf(CmsResource resource)
Returns
true in case this resource is a parent folder of the provided resource. |
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. |
static CmsJspResourceWrapper |
wrap(CmsObject cms,
CmsResource res)
Factory method to create a new
CmsJspResourceWrapper instance from a 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, isLabeled, isReleased, isReleasedAndNotExpired, isTemporaryFile, isTemporaryFileName, isTouched, setDateExpired, setDateLastModified, setDateReleased, setFlags, setInternal, setState, setType, setUserLastModified, toString
public java.util.List<CmsJspResourceWrapper> m_parentFolders
public static CmsJspResourceWrapper wrap(CmsObject cms, CmsResource res)
CmsJspResourceWrapper
instance from a CmsResource
.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.
cms
- the current CMS contextres
- the resource to wrapCmsJspResourceWrapper
public boolean equals(java.lang.Object obj)
equals
in class CmsResource
CmsResource.equals(java.lang.Object)
public CmsJspCategoryAccessBean getCategories()
public CmsObject getCmsObject()
public java.lang.String getContent()
public java.lang.String getExtension()
The extension will always be lower case.
null
if not availableCmsResource.getExtension(String)
,
CmsJspVfsAccessBean.getResourceExtension(Object)
public CmsFile getFile()
public CmsJspResourceWrapper getFolder()
In case this resource already is a CmsFolder
, it is returned without modification.
In case it is a CmsFile
, the parent folder of the file is returned.
getSitePathFolder()
public boolean getIsImage()
true
in case this resource is an image in the VFS.true
in case this resource is an image in the VFSpublic boolean getIsXml()
true
in case this resource is an XML content.true
in case this resource is an XML contentpublic java.lang.String getLink()
public java.util.Map<java.lang.String,CmsJspResourceWrapper> getLocaleResource()
public java.util.Locale getMainLocale()
public java.lang.String getMimeType()
In case no valid mime type can be determined from the file extension, text/plain
is returned.
public CmsJspNavBuilder getNavBuilder()
This will be initialized with this resource as default URI.
public CmsJspNavElement getNavigation()
public CmsJspResourceWrapper getNavigationDefaultFile()
If this resource is a file, then this file is returned.
Otherwise, in case this resource is a folder:
CmsPropertyDefinition.PROPERTY_DEFAULT_FILE
is checked, and
opencms-vfs.xml
configuration are iterated until a match is
found, and
null
is returned
CmsObject.readDefaultFile(CmsResource, CmsResourceFilter)
public java.util.List<CmsJspNavElement> getNavigationForFolder()
public CmsJspResourceWrapper getParentFolder()
In case this resource represents the site root folder, null
is returned.
getSitePathParentFolder()
,
CmsResource.getParentFolder(String)
,
CmsJspVfsAccessBean.getParentFolder(Object)
public java.util.List<CmsJspResourceWrapper> getParentFolders()
First resource in the list will be the direct parent folder of this resource, the last element will be the site root folder.
public java.util.Map<java.lang.String,java.lang.String> getProperty()
This is without "search", so it will not include inherited properties from the parent folders.
public java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> getPropertyLocale()
This is without "search", so it will not include inherited properties from the parent folders.
public java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> getPropertyLocaleSearch()
This is with "search", so it will include inherited properties from the parent folders.
public java.util.Map<java.lang.String,java.lang.String> getPropertySearch()
This is with "search", so it will include inherited properties from the parent folders.
public CmsRequestContext getRequestContext()
public java.lang.String getResourceExtension()
The extension will always be lower case.
null
if not availableCmsResource.getExtension(String)
,
CmsJspVfsAccessBean.getResourceExtension(Object)
public java.lang.String getResourceName()
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 /
.
CmsResource.getName()
,
CmsJspVfsAccessBean.getResourceName(Object)
public java.lang.String getRootPathFolder()
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.
public int getRootPathLevel()
The root folder "/" has level 0, a folder "/foo/" would have level 1, a folder "/foo/bar/" level 2 etc.
CmsResource.getPathLevel(String)
public java.lang.String getRootPathParentFolder()
CmsResource.getParentFolder(String)
public java.lang.String getSitePath()
CmsRequestContext.getSitePath(CmsResource)
public java.lang.String getSitePathFolder()
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.
public int getSitePathLevel()
The root folder "/" has level 0, a folder "/foo/" would have level 1, a folder "/foo/bar/" level 2 etc.
CmsResource.getPathLevel(String)
,
CmsJspVfsAccessBean.getPathLevel(Object)
public java.lang.String getSitePathParentFolder()
CmsResource.getParentFolder(String)
,
CmsJspVfsAccessBean.getParentFolder(Object)
public CmsJspImageBean getToImage()
In case the value does not point to an image resource, null
is returned.
public CmsJspContentAccessBean getToXml()
In case this resource is not an XML content, null
is returned.
getIsXml()
public CmsJspContentAccessBean getXml()
In case this resource is not an XML content, null
is returned.
getToXml()
,
getIsXml()
public int hashCode()
hashCode
in class CmsResource
CmsResource.hashCode()
,
Object.hashCode()
public boolean isChildResourceOf(CmsResource resource)
true
in case this resource is child resource of the provided resource which is assumed to be a folder.resource
- the resource to checktrue
in case this resource is child resource of the provided resource which is assumed to be a folderpublic boolean isChildResourceOf(java.lang.String sitePath)
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.
sitePath
- the resource to checktrue
in case this resource is child resource of the provided resource path which is assumed to be a folder in the current sitepublic boolean isParentFolderOf(CmsResource resource)
true
in case this resource is a parent folder of the provided resource.resource
- the resource to checktrue
in case this resource is a parent folder of the provided resourcepublic boolean isParentFolderOf(java.lang.String sitePath)
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.
sitePath
- the path to checktrue
in case this resource is a parent folder of the provided resource path in the current site