Package org.opencms.jsp.util
Class A_CmsJspCustomContextBean
java.lang.Object
org.opencms.jsp.util.A_CmsJspCustomContextBean
Base class for context sensitive custom beans that supports creation via
CmsJspStandardContextBean.getBean(String className)
.
It is the suitable base class for custom beans that need access to the OpenCms context.- Since:
- 11.0
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the cms object for the current context.protected CmsJspStandardContextBean
Returns the standard context.void
setContext
(CmsJspStandardContextBean context) Set the context for the bean.protected CmsResource
toResource
(Object input) Convert the input to a CmsResource using the current context.protected I_CmsXmlDocument
Converts the input (typically a specification of an XML file) to an XML document.
-
Constructor Details
-
A_CmsJspCustomContextBean
public A_CmsJspCustomContextBean()
-
-
Method Details
-
getCmsObject
Returns the cms object for the current context.- Returns:
- the cms object for the current context.
-
setContext
Set the context for the bean.- Parameters:
context
- the context to set.
-
getStandardContextBean
Returns the standard context.- Returns:
- the standard context.
-
toResource
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:
-
toXml
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.
-