Package org.apache.ofbiz.widget.renderer
Class ScreenRenderer
- java.lang.Object
-
- org.apache.ofbiz.widget.renderer.ScreenRenderer
-
public class ScreenRenderer extends java.lang.Object
Widget Library - Screen model class
-
-
Field Summary
Fields Modifier and Type Field Description protected MapStack<java.lang.String>
context
static java.lang.String
module
protected int
renderFormSeqNumber
protected ScreenStringRenderer
screenStringRenderer
protected java.lang.Appendable
writer
-
Constructor Summary
Constructors Constructor Description ScreenRenderer(java.lang.Appendable writer, MapStack<java.lang.String> context, ScreenStringRenderer screenStringRenderer)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,java.lang.Object>
getContext()
ScreenStringRenderer
getScreenStringRenderer()
void
populateBasicContext(java.util.Map<java.lang.String,java.lang.Object> parameters, Delegator delegator, LocalDispatcher dispatcher, Security security, java.util.Locale locale, GenericValue userLogin)
static void
populateBasicContext(MapStack<java.lang.String> context, ScreenRenderer screens, java.util.Map<java.lang.String,java.lang.Object> parameters, Delegator delegator, LocalDispatcher dispatcher, Security security, java.util.Locale locale, GenericValue userLogin)
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.static void
populateContextForRequest(MapStack<java.lang.String> context, ScreenRenderer screens, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.ServletContext servletContext)
void
populateContextForService(DispatchContext dctx, java.util.Map<java.lang.String,java.lang.Object> serviceContext)
java.lang.String
render(java.lang.String combinedName)
Renders the named screen using the render environment configured when this ScreenRenderer was created.java.lang.String
render(java.lang.String resourceName, java.lang.String screenName)
Renders the named screen using the render environment configured when this ScreenRenderer was created.void
setRenderFormUniqueSeq(int renderFormSeqNumber)
-
-
-
Field Detail
-
module
public static final java.lang.String module
-
writer
protected java.lang.Appendable writer
-
context
protected MapStack<java.lang.String> context
-
screenStringRenderer
protected ScreenStringRenderer screenStringRenderer
-
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 URLsscreenName
- 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)
-
getScreenStringRenderer
public ScreenStringRenderer getScreenStringRenderer()
-
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)
-
populateBasicContext
public static void populateBasicContext(MapStack<java.lang.String> context, ScreenRenderer screens, 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)
-
-