public final class CmsJspStandardContextBean
extends java.lang.Object
This bean is available by default in the context of an OpenCms managed JSP.
限定符和类型 | 类和说明 |
---|---|
static class |
CmsJspStandardContextBean.TemplateBean
Bean containing a template name and URI.
|
限定符和类型 | 字段和说明 |
---|---|
static java.lang.String |
ATTRIBUTE_CMS_OBJECT
The attribute name of the cms object.
|
static java.lang.String |
ATTRIBUTE_NAME
The attribute name of the standard JSP context bean.
|
protected static org.apache.commons.logging.Log |
LOG
The logger instance for this class.
|
protected CmsObject |
m_cms
OpenCms user context.
|
限定符和类型 | 方法和说明 |
---|---|
CmsJspStandardContextBean |
createCopy()
Returns a copy of this JSP context bean.
|
java.lang.String |
elementCachingHash()
Returns a caching hash specific to the element, it's properties and the current container width.
|
CmsContainerBean |
getContainer()
Returns the container the currently rendered element is part of.
|
CmsResource |
getDetailContent()
Returns the current detail content, or
null if no detail content is requested. |
CmsUUID |
getDetailContentId()
Returns the structure id of the current detail content, or
null if no detail content is requested. |
java.lang.String |
getDetailContentSitePath()
Returns the detail content site path.
|
CmsContainerPageBean |
getDetailOnlyPage()
Returns the detail only page.
|
CmsContainerElementBean |
getElement()
Returns the currently rendered element.
|
java.lang.Object |
getFunction()
Returns a map which allows access to dynamic function beans using the JSP EL.
|
java.util.Map<java.lang.String,java.lang.String> |
getFunctionDetail()
Returns a lazy map which computes the detail page link as a value when given the name of a (named) dynamic function
as a key.
|
java.util.Map<CmsJspContentAccessBean,CmsDynamicFunctionFormatWrapper> |
getFunctionFormatFromContent()
Returns a lazy map which creates a wrapper object for a dynamic function format when given an XML content
as a key.
|
static CmsJspStandardContextBean |
getInstance(javax.servlet.ServletRequest req)
Creates a new instance of the standard JSP context bean.
|
boolean |
getIsEditMode()
Checks if the current request should be direct edit enabled.
|
boolean |
getIsOnlineProject()
Returns if the current project is the online project.
|
java.util.Locale |
getLocale()
Returns the current locale.
|
CmsContainerPageBean |
getPage()
Returns the currently displayed container page.
|
java.util.Map<java.lang.String,java.lang.String> |
getPreviewFormatter()
JSP EL accessor method for retrieving the preview formatters.
|
CmsRequestContext |
getRequestContext()
Returns the request context.
|
java.lang.String |
getSubSitePath()
Returns the subsite path for the currently requested URI.
|
CmsJspStandardContextBean.TemplateBean |
getTemplate()
Gets a bean containing information about the current template.
|
java.lang.String |
getTitle()
Returns the title of a page delivered from OpenCms, usually used for the
<title> tag of
a HTML page. |
CmsJspVfsAccessBean |
getVfs()
Returns an initialized VFS access bean.
|
java.util.Locale |
getWorkplaceLocale()
Returns the workplace locale from the current user's settings.
|
boolean |
isDetailPageAvailable()
Checks whether a detail page is available for the container element.
|
boolean |
isDetailRequest()
Returns
true if this is a request to a detail resource, false otherwise. |
boolean |
isEdited()
Returns the flag to indicate if in drag and drop mode.
|
protected CmsDynamicFunctionBean |
readDynamicFunctionBean(java.lang.String configuredName)
Reads a dynamic function bean, given its name in the module configuration.
|
void |
setContainer(CmsContainerBean container)
Sets the container the currently rendered element is part of.
|
void |
setDetailOnlyPage(CmsContainerPageBean detailOnlyPage)
Sets the detail only page.
|
void |
setEdited(boolean edited)
Sets the flag to indicate if in drag and drop mode.
|
void |
setElement(CmsContainerElementBean element)
Sets the currently rendered element.
|
void |
setPage(CmsContainerPageBean page)
Sets the currently displayed container page.
|
void |
updateCmsObject(CmsObject cms)
Updates the internally stored OpenCms user context.
|
void |
updateRequestData(CmsFlexRequest cmsFlexRequest)
Updates the standard context bean from the request.
|
public static final java.lang.String ATTRIBUTE_CMS_OBJECT
public static final java.lang.String ATTRIBUTE_NAME
protected static final org.apache.commons.logging.Log LOG
protected CmsObject m_cms
public static CmsJspStandardContextBean getInstance(javax.servlet.ServletRequest req)
To prevent multiple creations of the bean during a request, the OpenCms request context attributes are used to cache the created VFS access utility bean.
req
- the current servlet requestpublic CmsJspStandardContextBean createCopy()
public java.lang.String elementCachingHash()
public CmsContainerBean getContainer()
public CmsResource getDetailContent()
null
if no detail content is requested.null
if no detail content is requested.public CmsUUID getDetailContentId()
null
if no detail content is requested.null
if no detail content is requested.public java.lang.String getDetailContentSitePath()
null
if not available.public CmsContainerPageBean getDetailOnlyPage()
public CmsContainerElementBean getElement()
public java.lang.Object getFunction()
When given a key, the returned map will look up the corresponding dynamic function in the module configuration.
public java.util.Map<java.lang.String,java.lang.String> getFunctionDetail()
public java.util.Map<CmsJspContentAccessBean,CmsDynamicFunctionFormatWrapper> getFunctionFormatFromContent()
public boolean getIsEditMode()
true
if the current request should be direct edit enabledpublic boolean getIsOnlineProject()
true
if the current project is the online projectpublic java.util.Locale getLocale()
public CmsContainerPageBean getPage()
public java.util.Map<java.lang.String,java.lang.String> getPreviewFormatter()
public CmsRequestContext getRequestContext()
public java.lang.String getSubSitePath()
public CmsJspStandardContextBean.TemplateBean getTemplate()
public java.lang.String getTitle()
<title>
tag of
a HTML page.If no title information has been found, the empty String "" is returned.
public CmsJspVfsAccessBean getVfs()
public java.util.Locale getWorkplaceLocale()
public boolean isDetailPageAvailable()
public boolean isDetailRequest()
true
if this is a request to a detail resource, false
otherwise.
Same as to check if getDetailContent()
is null
.
true
if this is a request to a detail resource, false
otherwisepublic boolean isEdited()
true
if in drag and drop modepublic void setContainer(CmsContainerBean container)
container
- the container the currently rendered element is part ofpublic void setDetailOnlyPage(CmsContainerPageBean detailOnlyPage)
detailOnlyPage
- the detail only page to setpublic void setEdited(boolean edited)
edited
- true
if in drag and drop modepublic void setElement(CmsContainerElementBean element)
element
- the currently rendered element to setpublic void setPage(CmsContainerPageBean page)
page
- the currently displayed container page to setpublic void updateCmsObject(CmsObject cms)
cms
- the new OpenCms user contextpublic void updateRequestData(CmsFlexRequest cmsFlexRequest)
cmsFlexRequest
- the request from which to update the dataprotected CmsDynamicFunctionBean readDynamicFunctionBean(java.lang.String configuredName) throws CmsException
configuredName
- the name of the dynamic function in the module configurationCmsException
- if something goes wrong