Package org.opencms.jsp.util
Class A_CmsJspCustomContextBean
- java.lang.Object
-
- org.opencms.jsp.util.A_CmsJspCustomContextBean
-
public abstract class A_CmsJspCustomContextBean extends java.lang.Object
Base class for context sensitive custom beans that supports creation viaCmsJspStandardContextBean.getBean(String className)
. It is the suitable base class for custom beans that need access to the OpenCms context.- Since:
- 11.0
-
-
Constructor Summary
Constructors Constructor Description A_CmsJspCustomContextBean()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CmsObject
getCmsObject()
Returns the cms object for the current context.protected CmsJspStandardContextBean
getStandardContextBean()
Returns the standard context.void
setContext(CmsJspStandardContextBean context)
Set the context for the bean.protected CmsResource
toResource(java.lang.Object input)
Convert the input to a CmsResource using the current context.protected I_CmsXmlDocument
toXml(java.lang.Object input)
Converts the input (typically a specification of an XML file) to an XML document.
-
-
-
Constructor Detail
-
A_CmsJspCustomContextBean
public A_CmsJspCustomContextBean()
-
-
Method Detail
-
getCmsObject
public CmsObject getCmsObject()
Returns the cms object for the current context.- Returns:
- the cms object for the current context.
-
setContext
public void setContext(CmsJspStandardContextBean context)
Set the context for the bean.- Parameters:
context
- the context to set.
-
getStandardContextBean
protected CmsJspStandardContextBean getStandardContextBean()
Returns the standard context.- Returns:
- the standard context.
-
toResource
protected CmsResource toResource(java.lang.Object input) throws CmsException
Convert the input to a CmsResource using the current context.- Parameters:
input
- the object to convert to a resource, e.g., a path, a structure id, an access wrapper ...- Returns:
- the resource for the input.
- Throws:
CmsException
- if resource conversion fails.- See Also:
CmsJspElFunctions.convertResource(CmsObject, Object)
-
toXml
protected I_CmsXmlDocument toXml(java.lang.Object input) throws CmsException
Converts the input (typically a specification of an XML file) to an XML document. If the input already is an XML document, it is returned. Otherwise the method assumes the input specifies an XML file and tries to determine and unmarshal that file.nd unmarshal that file To determine the filetoResource(Object)
is used.- Parameters:
input
- the object to be converted to an XML document.- Returns:
- the XML document specified by the input.
- Throws:
CmsException
- if converting the input to a XML document fails.
-
-