Class A_CmsJspCustomContextBean

java.lang.Object
org.opencms.jsp.util.A_CmsJspCustomContextBean

public abstract class A_CmsJspCustomContextBean extends Object
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 Details

  • Method Details

    • 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

      Returns the standard context.
      Returns:
      the standard context.
    • toResource

      protected CmsResource toResource(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:
    • toXml

      protected I_CmsXmlDocument toXml(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 file toResource(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.