Class ScreenRenderer


  • public class ScreenRenderer
    extends java.lang.Object
    Widget Library - Screen model class
    • Field Detail

      • module

        public static final java.lang.String module
      • writer

        protected java.lang.Appendable writer
      • context

        protected MapStack<java.lang.String> context
      • renderFormSeqNumber

        protected int renderFormSeqNumber
    • Constructor Detail

      • ScreenRenderer

        public ScreenRenderer​(java.lang.Appendable writer,
                              MapStack<java.lang.String> context,
                              ScreenStringRenderer screenStringRenderer)
    • Method Detail

      • render

        public java.lang.String render​(java.lang.String combinedName)
                                throws GeneralException,
                                       java.io.IOException,
                                       org.xml.sax.SAXException,
                                       javax.xml.parsers.ParserConfigurationException
        Renders the named screen using the render environment configured when this ScreenRenderer was created.
        Parameters:
        combinedName - A combination of the resource name/location for the screen XML file and the name of the screen within that file, separated by a pound sign ("#"). This is the same format that is used in the view-map elements on the controller.xml file.
        Throws:
        java.io.IOException
        org.xml.sax.SAXException
        javax.xml.parsers.ParserConfigurationException
        GeneralException
      • render

        public java.lang.String render​(java.lang.String resourceName,
                                       java.lang.String screenName)
                                throws GeneralException,
                                       java.io.IOException,
                                       org.xml.sax.SAXException,
                                       javax.xml.parsers.ParserConfigurationException
        Renders the named screen using the render environment configured when this ScreenRenderer was created.
        Parameters:
        resourceName - The name/location of the resource to use, can use "component://[component-name]/" and "ofbiz://" and other special OFBiz style URLs
        screenName - The name of the screen within the XML file specified by the resourceName.
        Throws:
        java.io.IOException
        org.xml.sax.SAXException
        javax.xml.parsers.ParserConfigurationException
        GeneralException
      • setRenderFormUniqueSeq

        public void setRenderFormUniqueSeq​(int renderFormSeqNumber)
      • populateBasicContext

        public void populateBasicContext​(java.util.Map<java.lang.String,​java.lang.Object> parameters,
                                         Delegator delegator,
                                         LocalDispatcher dispatcher,
                                         Security security,
                                         java.util.Locale locale,
                                         GenericValue userLogin)
      • populateContextForRequest

        public void populateContextForRequest​(javax.servlet.http.HttpServletRequest request,
                                              javax.servlet.http.HttpServletResponse response,
                                              javax.servlet.ServletContext servletContext)
        This method populates the context for this ScreenRenderer based on the HTTP Request and Response objects and the ServletContext. It leverages various conventions used in other places, namely the ControlServlet and so on, of OFBiz to get the different resources needed.
        Parameters:
        request -
        response -
        servletContext -
      • populateContextForRequest

        public static void populateContextForRequest​(MapStack<java.lang.String> context,
                                                     ScreenRenderer screens,
                                                     javax.servlet.http.HttpServletRequest request,
                                                     javax.servlet.http.HttpServletResponse response,
                                                     javax.servlet.ServletContext servletContext)
      • getContext

        public java.util.Map<java.lang.String,​java.lang.Object> getContext()
      • populateContextForService

        public void populateContextForService​(DispatchContext dctx,
                                              java.util.Map<java.lang.String,​java.lang.Object> serviceContext)