Package org.apache.ofbiz.widget.renderer
Class ScreenRenderer
java.lang.Object
org.apache.ofbiz.widget.renderer.ScreenRenderer
Widget Library - Screen model class
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Contains the stack of screen area ids that are generated during screen rendering This allow inherent refreshment of the parent screen, when using callback feature -
Constructor Summary
ConstructorDescriptionScreenRenderer
(Appendable writer, MapStack<String> context, ScreenStringRenderer screenStringRenderer) -
Method Summary
Modifier and TypeMethodDescriptionGets context.Gets screen string renderer.void
populateBasicContext
(Map<String, Object> parameters, Delegator delegator, LocalDispatcher dispatcher, Security security, Locale locale, GenericValue userLogin) Populate basic context.static void
populateBasicContext
(MapStack<String> context, ScreenRenderer screens, Map<String, Object> parameters, Delegator delegator, LocalDispatcher dispatcher, Security security, Locale locale, GenericValue userLogin) void
populateContextForRequest
(HttpServletRequest request, HttpServletResponse response, 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<String> context, ScreenRenderer screens, HttpServletRequest request, HttpServletResponse response, ServletContext servletContext) void
populateContextForService
(DispatchContext dctx, Map<String, Object> serviceContext) Populate context for service.Renders the named screen using the render environment configured when this ScreenRenderer was created.Renders the named screen using the render environment configured when this ScreenRenderer was created.void
setRenderFormUniqueSeq
(int renderFormSeqNumber) Sets render form unique seq.
-
Constructor Details
-
ScreenRenderer
public ScreenRenderer(Appendable writer, MapStack<String> context, ScreenStringRenderer screenStringRenderer)
-
-
Method Details
-
render
public String render(String combinedName) throws GeneralException, IOException, SAXException, 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:
IOException
SAXException
ParserConfigurationException
GeneralException
-
render
public String render(String resourceName, String screenName) throws GeneralException, IOException, SAXException, 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:
IOException
SAXException
ParserConfigurationException
GeneralException
-
setRenderFormUniqueSeq
public void setRenderFormUniqueSeq(int renderFormSeqNumber) Sets render form unique seq.- Parameters:
renderFormSeqNumber
- the render form seq number
-
getScreenStringRenderer
Gets screen string renderer.- Returns:
- the screen string renderer
-
populateBasicContext
public void populateBasicContext(Map<String, Object> parameters, Delegator delegator, LocalDispatcher dispatcher, Security security, Locale locale, GenericValue userLogin) Populate basic context.- Parameters:
parameters
- the parametersdelegator
- the delegatordispatcher
- the dispatchersecurity
- the securitylocale
- the localeuserLogin
- the user login
-
populateBasicContext
public static void populateBasicContext(MapStack<String> context, ScreenRenderer screens, Map<String, Object> parameters, Delegator delegator, LocalDispatcher dispatcher, Security security, Locale locale, GenericValue userLogin) -
populateContextForRequest
public void populateContextForRequest(HttpServletRequest request, HttpServletResponse response, 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<String> context, ScreenRenderer screens, HttpServletRequest request, HttpServletResponse response, ServletContext servletContext) -
getContext
Gets context.- Returns:
- the context
-
populateContextForService
Populate context for service.- Parameters:
dctx
- the dctxserviceContext
- the service context
-