org.apache.beehive.netui.script.common
Class ImplicitObjectUtil

Object
  extended by ImplicitObjectUtil

public final class ImplicitObjectUtil
extends Object

Utilities for loading NetUI implicit objects into various data binding scopes such as the PageContext, ServletRequest, HttpSession, and ServletContext.


Method Summary
static GlobalApp getGlobalApp(ServletRequest request)
          Internal method!
static PageFlowController getPageFlow(ServletRequest request, ServletResponse response)
          Internal method!
static VariableResolver getReadVariableResolver(JspContext jspContext)
          Internal method!
static Map getSharedFlow(ServletRequest request)
          Get the Map of shared flow objects from the request.
static VariableResolver getUpdateVariableResolver(Object form, ServletRequest request, ServletResponse response, boolean isHandlingPost)
          Internal method!
static VariableResolver getUpdateVariableResolver(ServletRequest request, ServletResponse response, boolean isHandlingPost)
          Internal method!
static void loadActionForm(JspContext jspContext, Object form)
          Load the given form into the JspContext object.
static void loadBundleMap(ServletRequest request, BundleMap bundleMap)
          Load the resource bundle binding map into the request.
static void loadFacesBackingBean(ServletRequest request, FacesBackingBean facesBackingBean)
          Load the JSF backing bean into the request.
static void loadGlobalApp(ServletRequest request, GlobalApp globalApp)
          Load the global app into the request
static void loadImplicitObjects(HttpServletRequest request, HttpServletResponse response, ServletContext servletContext, PageFlowController currentPageFlow)
          Load the NetUI framework's implicit objects into the request.
static void loadOutputFormBean(ServletRequest request, Object bean)
          Load the output form bean into the request.
static void loadPageFlow(ServletRequest request, PageFlowController pageFlow)
          Load Page Flow related implicit objects into the request.
static void loadSharedFlow(ServletRequest request, Map sharedFlows)
          Load the shared flow into the request.
static void unloadActionForm(JspContext jspContext)
          Remove any action form present in the JspContext.
static void unloadFacesBackingBean(ServletRequest request)
          Unload the JSF backing bean from the request
static Object unwrapForm(Object form)
          If applicable, unwrap the given form object to its native backing object.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

loadImplicitObjects

public static void loadImplicitObjects(HttpServletRequest request,
                                       HttpServletResponse response,
                                       ServletContext servletContext,
                                       PageFlowController currentPageFlow)
Load the NetUI framework's implicit objects into the request.

Parameters:
request - the request
response - the response
servletContext - the servlet context
currentPageFlow - the current page flow

loadActionForm

public static void loadActionForm(JspContext jspContext,
                                  Object form)
Load the given form into the JspContext object. Because the framework supports any bean action forms, the type of the form is Object

Parameters:
jspContext - the jsp context
form - the form object

unloadActionForm

public static void unloadActionForm(JspContext jspContext)
Remove any action form present in the JspContext.

Parameters:
jspContext - the jsp context

loadPageFlow

public static void loadPageFlow(ServletRequest request,
                                PageFlowController pageFlow)
Load Page Flow related implicit objects into the request. This method will set the Page Flow itself and any available page inputs into the request.

Parameters:
request - the request
pageFlow - the current page flow

loadFacesBackingBean

public static void loadFacesBackingBean(ServletRequest request,
                                        FacesBackingBean facesBackingBean)
Load the JSF backing bean into the request.

Parameters:
request - the request
facesBackingBean - the JSF backing bean

unloadFacesBackingBean

public static void unloadFacesBackingBean(ServletRequest request)
Unload the JSF backing bean from the request

Parameters:
request - the request

loadSharedFlow

public static void loadSharedFlow(ServletRequest request,
                                  Map sharedFlows)
Load the shared flow into the request.

Parameters:
request - the request
sharedFlows - the current shared flows

loadGlobalApp

public static void loadGlobalApp(ServletRequest request,
                                 GlobalApp globalApp)
Load the global app into the request

Parameters:
request - the request
globalApp - the global app

loadBundleMap

public static void loadBundleMap(ServletRequest request,
                                 BundleMap bundleMap)
Load the resource bundle binding map into the request.

Parameters:
request - the request
bundleMap - the Map of resource bundles

loadOutputFormBean

public static void loadOutputFormBean(ServletRequest request,
                                      Object bean)
Load the output form bean into the request.

Parameters:
request - the request
bean - the output form bean

unwrapForm

public static Object unwrapForm(Object form)
If applicable, unwrap the given form object to its native backing object. If the type of this form is a AnyBeanActionForm, the type returned will be the native object backing the wrapper.

Parameters:
form - the form
Returns:
the unwrapped form

getSharedFlow

public static Map getSharedFlow(ServletRequest request)
Get the Map of shared flow objects from the request.

Parameters:
request -
Returns:
the shared flows

getPageFlow

public static PageFlowController getPageFlow(ServletRequest request,
                                             ServletResponse response)
Internal method! This method is used by the expression engine to get the current page flow. If no page flow is found, an exception will be thrown.

Parameters:
request - the request
response - the response
Returns:
the page flow

getGlobalApp

public static GlobalApp getGlobalApp(ServletRequest request)
Internal method! This method is used by the expression engine to get the current global app. If no global app is found, an exception will be thrown.

Parameters:
request - the request
Returns:
the global app

getUpdateVariableResolver

public static VariableResolver getUpdateVariableResolver(ServletRequest request,
                                                         ServletResponse response,
                                                         boolean isHandlingPost)
Internal method! Create a VariableResolver that contains the implicit objects available for expression updates.


getUpdateVariableResolver

public static VariableResolver getUpdateVariableResolver(Object form,
                                                         ServletRequest request,
                                                         ServletResponse response,
                                                         boolean isHandlingPost)
Internal method! Create a VariableResolver that contains the implicit objects available for expression updates.


getReadVariableResolver

public static VariableResolver getReadVariableResolver(JspContext jspContext)
Internal method! Create a VariableResolver that contains the implicit objects available for expression reads.

Parameters:
jspContext - the jsp context
Returns:
the variable resolver