com.bowstreet.webapp
Interface WebAppAccess


public interface WebAppAccess

Interface used to access a running WebApp instance. Note - An instance of the WebAppAccess is only valid for the lifetime of a single request and therefore you should not hold onto an instance of a WebAppAccess between multiple requests.


Field Summary
static java.lang.String ACTION_NAME_ATTRIBUTE
          Error Handler ActionName attribute name stored in HttpServletRequest.
static char ACTION_REQUEST_SEPARATOR
           
static java.lang.String EVENT_TARGET_ALL
          fireEvent target argument: broadcast event to all model instances in session
static java.lang.String EVENT_TARGET_PARENT
          fireEvent target argument: deliver event to the parent of this model instances
static java.lang.String EVENT_TARGET_SELF
          fireEvent target argument: fire this event only in the current model instance.
static java.lang.String EXCEPTION_ATTRIBUTE
          Error Handler Exception attribute name stored in HttpServletRequest.
static java.lang.String EXPLICIT_PROFILE_SEPARATOR
          Separator ("$") used for specifying multiple ProfileSet/Profile combinations example profiledText!
static java.lang.String MODEL_INSTANCE_KEY_PREFIX
          Prefix used when placing the instance data for a running WebApp in to the users WebAppData (session by default).
static java.lang.String PROFILESET_PROFILE_SEPARATOR
          Separator ("!")
static java.lang.String SERVLET_CONFIG_REQUEST_ATTRIBUTE
          Key used to store the ServletConfig as a Request Attribute, for retrieval if needed by application code
 
Method Summary
 LinkedModel addLinkedModel(java.lang.String name, java.lang.String modelName, boolean singleton)
          Creates a new Linked Model in this instance of the WebApp.
 void addRequestCompleteListener(com.bowstreet.webapp.RequestCompleteListener listener)
           
 SystemTrace addSystemTrace(int type, java.lang.String name)
          Creates and adds a new SystemTrace to trace tree.
 java.lang.Object callMethod(java.lang.String name)
          Call the specified Method by name.
 java.lang.Object callMethod(java.lang.String name, java.lang.Object arg)
          Call the specified Method by name.
 java.lang.Object callMethod(java.lang.String name, java.lang.Object[] args)
          Call the specified Method by name.
 java.lang.Object callMethod(java.lang.String name, java.lang.Object arg1, java.lang.Object arg2)
          Call the specified Method by name.
 java.lang.Object callMethod(java.lang.String name, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3)
          Call the specified Method by name.
 java.lang.Object callMethod(java.lang.String name, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4)
          Call the specified Method by name.
 java.lang.Object callMethod(java.lang.String name, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4, java.lang.Object arg5)
          Call the specified Method by name.
 java.lang.Object fireEvent(java.lang.Object target, java.lang.String eventName, java.lang.Object[] args)
          Deliver an event to a specified set of models.
 java.lang.Object fireEvent(java.lang.String eventName, java.lang.Object[] args)
          This will fire all of the actions for a specified user-defined event.
 void freeLinkedModel(java.lang.String name)
          Frees the reference to the specified Linked Model immediately.
 void freeWebApp()
          Frees the current WebApp when processing this request is complete.
 java.lang.String getActionURL(java.lang.String action)
          Gets the URL to an action in this WebApp.
 java.lang.String getBackchannelActionURL(java.lang.String action, boolean renderOuterPage)
          Gets a URL to an action in this WebApp that is suitable for use to directly access data from the client, especially in AJAX scenarios.
 URLMapper getBackchannelURLMapper(boolean renderOuterPage)
          Gets a URLMapper for this WebApp that is suitable for use to directly access data from the client, especially in AJAX scenarios.
 java.lang.String getCurrentPage()
          This method can be used to determine the last page rendered in this model instance, not including inner inserted pages.
 java.lang.String getDataServiceParameterText(java.lang.String dataService, java.lang.String operation, java.lang.String parameter, java.lang.String path)
          Get String data from a Data Service parameter.
 IXml getDataServiceParameterXml(java.lang.String dataService, java.lang.String operation, java.lang.String parameter, java.lang.String path)
          Get XML data from a Data Service parameter
 URLMapper getDefaultURLMapper()
          Gets an instance of the default URLMapper for the current WebApp.
 javax.servlet.http.HttpServletRequest getHttpServletRequest()
          Gets the HttpServletRequest for the current request.
 javax.servlet.http.HttpServletResponse getHttpServletResponse()
          Gets the HttpServletResponse for the current request.
 java.lang.String getInstanceID()
          Return an ID for this model instance which is unique among active model instances in the current session.
 LinkedModel getLinkedModel(java.lang.String name)
          Gets the the specified Linked Model.
 WebAppAccess getLinkedModelInstance(java.lang.String name)
          Gets the WebAppAccess for a Linked Model.
 WebAppAccess getModelInstance(java.lang.String modelName, java.lang.String profile, boolean singleton)
          Gets the WebAppAccess for the specified model.
 java.lang.String getModelName()
          Gets the name of the current WebApp.
 CacheManager getOutputCacheManager()
          Gets CacheManager for the Action Output Cache.
 java.lang.String getPartialPageRefreshURL(java.lang.String action, boolean renderOuterPage)
          Gets a URL to an action in this WebApp that is suitable for use to directly implement partial-page refresh scenarios.
 URLMapper getPartialPageRefreshURLMapper(boolean renderOuterPage)
          Gets a URLMapper for this WebApp that is suitable for use to directly implement partial-page refresh scenarios.
 java.lang.Object getProfileData(java.lang.String profileSetName, java.lang.String entryName)
          This will get the value of the specified entry for the users profile data.
 RequestData getRequestData()
          Gets the RequestData object for the current request.
 RequestInputs getRequestInputs()
          Gets the input values for the current request.
 SystemProperties getSystemProperties()
          Gets the SystemProperties object.
 URLMapper getURLMapper()
          Gets the URLMapper for the current WebApp.
 UserInfo getUserInfo()
          Return an instance of the configured UserInfo handler.
 Variables getVariables()
          Gets the Variables on the current WebApp.
 WebApp getWebApp()
          Gets the WebApp for current WebApp.
 WebAppData getWebAppData()
          Gets an instance of a WebAppData.
 void logError(java.lang.String message, java.lang.Throwable exception)
          Adds the specified message and exception stack trace to the log file.
 java.lang.Object processAction(java.lang.String action)
          This will process an action string.
 void processPage(java.lang.String name)
          Process the specified Page by name.
 void resetCurrentPage(java.lang.String newPage)
          Similar to setCurrentPage(), except that it forces the page to be set even if the model has had a page set during the current request.
 void setCurrentPage(java.lang.String newPage)
          Set the current page for this model instance.
 SystemTrace setSystemTrace(SystemTrace systemTrace)
          Sets the current SystemTrace for this WebAppAccess.
 

Field Detail

ACTION_NAME_ATTRIBUTE

static final java.lang.String ACTION_NAME_ATTRIBUTE
Error Handler ActionName attribute name stored in HttpServletRequest.

See Also:
Constant Field Values

ACTION_REQUEST_SEPARATOR

static final char ACTION_REQUEST_SEPARATOR
See Also:
Constant Field Values

EVENT_TARGET_ALL

static final java.lang.String EVENT_TARGET_ALL
fireEvent target argument: broadcast event to all model instances in session


EVENT_TARGET_PARENT

static final java.lang.String EVENT_TARGET_PARENT
fireEvent target argument: deliver event to the parent of this model instances

See Also:
Constant Field Values

EVENT_TARGET_SELF

static final java.lang.String EVENT_TARGET_SELF
fireEvent target argument: fire this event only in the current model instance.

See Also:
Constant Field Values

EXCEPTION_ATTRIBUTE

static final java.lang.String EXCEPTION_ATTRIBUTE
Error Handler Exception attribute name stored in HttpServletRequest.

See Also:
Constant Field Values

EXPLICIT_PROFILE_SEPARATOR

static final java.lang.String EXPLICIT_PROFILE_SEPARATOR
Separator ("$") used for specifying multiple ProfileSet/Profile combinations example profiledText!Silver$Region!EastCoast

See Also:
Constant Field Values

MODEL_INSTANCE_KEY_PREFIX

static final java.lang.String MODEL_INSTANCE_KEY_PREFIX
Prefix used when placing the instance data for a running WebApp in to the users WebAppData (session by default). This is prefixed to the models name.

See Also:
Constant Field Values

PROFILESET_PROFILE_SEPARATOR

static final java.lang.String PROFILESET_PROFILE_SEPARATOR
Separator ("!") used for separate the ProfileSet and Profile combinations. example Region!EastCoast

See Also:
Constant Field Values

SERVLET_CONFIG_REQUEST_ATTRIBUTE

static final java.lang.String SERVLET_CONFIG_REQUEST_ATTRIBUTE
Key used to store the ServletConfig as a Request Attribute, for retrieval if needed by application code

See Also:
Constant Field Values
Method Detail

addLinkedModel

LinkedModel addLinkedModel(java.lang.String name,
                           java.lang.String modelName,
                           boolean singleton)
Creates a new Linked Model in this instance of the WebApp.

Parameters:
name - The local name for the Linked Model.
modelName - The name of the Model to set as the Linked Model.
singleton - Specifies if the model to be linked should be single instance.
Returns:
The LinkedModel that was added to this WebAppAccess.

addRequestCompleteListener

void addRequestCompleteListener(com.bowstreet.webapp.RequestCompleteListener listener)

addSystemTrace

SystemTrace addSystemTrace(int type,
                           java.lang.String name)
Creates and adds a new SystemTrace to trace tree.

Parameters:
type - The trace type defined on SystemTrace(MODEL, METHOD, or PAGE).
name - The name of the specified type.
Returns:
The new SystemTrace that was added.

callMethod

java.lang.Object callMethod(java.lang.String name)
Call the specified Method by name. callMethod can be used to call:
- named method calls created with the Method Builder, or
- named method calls created with the Method Call Builder, or
- java methods on linked java objects created with the Linked Java Object Builder.
- java methods on linked model created with the Linked Model builder.
This version calls the specified method with no arguments. If the specified method is a Method Call Builder, the arguments specified in the Method Call Builder are used. Note: If the Method you wish to call is specified by a Method Builder or a Method Call Builder, then you can specify the name as the name of the builder that created the method or method call. example : webAppAccess.callMethod("getData"); If you are calling a method on a Linked Java Object then you need to specify the name of the Linked Java Object Builder call, then the name of the method on the Linked Java Object class. The identifier name must be separated with a period ".". example : webAppAccess.callMethod("MyJavaClass.getData"); If you are calling a method on a Linked Model then you need to specify the name of the Linked Model Builder call, then the name of the method on the linked Model. The identifier name must be separated with a period ".". example : webAppAccess.callMethod("MyLinkedWebApp.getData"); If you are calling a method on a Linked Java Object in a Linked Model then you need to specify the name of the Linked Model Builder call, then the name of the Linked Java Object Builder call, then the name of the method on the Linked Java Object. The identifier name must be separated with a period ".". example : webAppAccess.callMethod("MyLinkedWebApp.MyJavaClass.getData");

Parameters:
name - The name of Method to call.
Returns:
The Object data that is the results of the Method call.

callMethod

java.lang.Object callMethod(java.lang.String name,
                            java.lang.Object arg)
Call the specified Method by name. This version calls the specified Method with one argument. The number and type of the arguments must match the method being called. See documentation for the zero arg version of this method for additional details.

Parameters:
name - The name of Method to call.
arg - The first argument to pass to the method call as specified by the method signature.
Returns:
The Object data that is the results of the Method call.
Example:
webAppAccess.callMethod("meth_name", my_data1);

callMethod

java.lang.Object callMethod(java.lang.String name,
                            java.lang.Object[] args)
Call the specified Method by name. See documentation for the zero arg version of this method for additional details. This version calls the specified Method using an array of arguments. The number and type of the arguments array must match the arguments of the method being called. Note that this method can be used to call methods with any number of arguments. If you want to use callMethod to invoke a method that takes a single argument which is an array, you will need to cast your argument as "Object" so that the correct variant of callMethod is called (the one that takes a String and and Object) instead of this method.

Parameters:
name - The name of Method to call.
args - An array of arguments to pass to the method call as specified by the method signature.
Returns:
The Object data that is the results of the Method call.
Example:
To call a method that takes three arguments:
 webAppAccess.callMethod("meth_name", new Object[] {arg1, arg2, arg3});

callMethod

java.lang.Object callMethod(java.lang.String name,
                            java.lang.Object arg1,
                            java.lang.Object arg2)
Call the specified Method by name. This version calls the specified Method with two arguments. The number and type of the arguments must match the method being called. See documentation for the zero arg version of this method for additional details.

Parameters:
name - The name of Method to call.
arg1 - The first argument to pass to the method call as specified by the method signature.
arg2 - The second argument to pass to the method call as specified by the method signature.
Returns:
The Object data that is the results of the Method call.
Example:
webAppAccess.callMethod("meth_name", my_data1, my_data2);

callMethod

java.lang.Object callMethod(java.lang.String name,
                            java.lang.Object arg1,
                            java.lang.Object arg2,
                            java.lang.Object arg3)
Call the specified Method by name. This version calls the specified Method with three arguments. The number and type of the arguments must match the method being called. See documentation for the zero arg version of this method for additional details.

Parameters:
name - The name of Method to call.
arg1 - The first argument to pass to the method call as specified by the method signature.
arg2 - The second argument to pass to the method call as specified by the method signature.
arg3 - The third argument to pass to the method call as specified by the method signature.
Returns:
The Object data that is the results of the Method call.
Example:
webAppAccess.callMethod("meth_name", my_data1, my_data2, my_data3);

callMethod

java.lang.Object callMethod(java.lang.String name,
                            java.lang.Object arg1,
                            java.lang.Object arg2,
                            java.lang.Object arg3,
                            java.lang.Object arg4)
Call the specified Method by name. This version calls the specified Method with four arguments. The number and type of the arguments must match the method being called. See documentation for the zero arg version of this method for additional details.

Parameters:
name - The name of Method to call.
arg1 - The first argument to pass to the method call as specified by the method signature.
arg2 - The second argument to pass to the method call as specified by the method signature.
arg3 - The third argument to pass to the method call as specified by the method signature.
arg4 - The fourth argument to pass to the method call as specified by the method signature.
Returns:
The Object data that is the results of the Method call.
Example:
webAppAccess.callMethod("meth_name", my_data1, my_data2, my_data3, my_data4);

callMethod

java.lang.Object callMethod(java.lang.String name,
                            java.lang.Object arg1,
                            java.lang.Object arg2,
                            java.lang.Object arg3,
                            java.lang.Object arg4,
                            java.lang.Object arg5)
Call the specified Method by name. This version calls the specified Method with five arguments. The number and type of the arguments must match the method being called. See documentation for the zero arg version of this method for additional details.

Parameters:
name - The name of Method to call.
arg1 - The first argument to pass to the method call as specified by the method signature.
arg2 - The second argument to pass to the method call as specified by the method signature.
arg3 - The third argument to pass to the method call as specified by the method signature.
arg4 - The fourth argument to pass to the method call as specified by the method signature.
arg5 - The fifth argument to pass to the method call as specified by the method signature.
Returns:
The Object data that is the results of the Method call.
Example:
webAppAccess.callMethod("meth_name", my_data1, my_data2, my_data3, my_data4, my_data5);

fireEvent

java.lang.Object fireEvent(java.lang.Object target,
                           java.lang.String eventName,
                           java.lang.Object[] args)
Deliver an event to a specified set of models.

Parameters:
target - where to deliver this event: EVENT_TARGET_ALL indicates broadcast to all models in session, EVENT_TARGET_SELF sends event only to the current model, EVENT_TARGET_PARENT means deliver to the parent of this model, and a value which is an instance of WebAppAccess causes delivery to that specific model
eventName - the name of the event to fire
args - array of Objects holding the arguments to this event
Returns:
the return value of firing this event

fireEvent

java.lang.Object fireEvent(java.lang.String eventName,
                           java.lang.Object[] args)
This will fire all of the actions for a specified user-defined event. The event is broadcast to all active models in the current session.

Parameters:
eventName - The name of the event which will be raised.
args - An array of arguments passed to the corresponding action(s).
Returns:
The Object data that is the results of the fireEvent call.

freeLinkedModel

void freeLinkedModel(java.lang.String name)
Frees the reference to the specified Linked Model immediately. If the linked model is single instance then it is immediately removed from the WebAppData location. If the linked model is multi-instance the reference is immediately freed from the linked model.

Parameters:
name - The name of the Linked Model Builder call.

freeWebApp

void freeWebApp()
Frees the current WebApp when processing this request is complete.


getActionURL

java.lang.String getActionURL(java.lang.String action)
Gets the URL to an action in this WebApp. Note - If this model is a linked multi-instance model, then this will fix up the URL to point back to the parent model.

Parameters:
action - The name of an action in this WebApp.
Returns:
The URL to the action as a String.

getBackchannelActionURL

java.lang.String getBackchannelActionURL(java.lang.String action,
                                         boolean renderOuterPage)
Gets a URL to an action in this WebApp that is suitable for use to directly access data from the client, especially in AJAX scenarios. Based on the second parameter, the URL can either cause the specified action to be executed directly and its results returned (renderOuterPage = false) or to first execute the action in "silent mode" (no output produced) and then re-render the outermost page of the top-level model, returning this as the results. If page-generated HTML markup will be returned, you whould normally pass "true" as the second parameter; if the action returns a simple non-page data like a String or XML, then you should pass "false" as the value for the second parameter.

Parameters:
action - Then name of the action in this WebApp
renderOuterPage -
Returns:
AJAX-suitable action URL as a String.

getBackchannelURLMapper

URLMapper getBackchannelURLMapper(boolean renderOuterPage)
Gets a URLMapper for this WebApp that is suitable for use to directly access data from the client, especially in AJAX scenarios. Based on the parameter, the generated URL can either cause the specified action to be executed directly and its results returned (renderOuterPage = false) or to first execute the action in "silent mode" (no output produced) and then re-render the outermost page of the top-level model, returning this as the results. If page-generated HTML markup will be returned, you whould normally pass "true" as the second parameter; if the action returns a simple non-page data like a String or XML, then you should pass "false" as the value for the second parameter.

Parameters:
renderOuterPage -
Returns:
AJAX-suitable URLMapper

getCurrentPage

java.lang.String getCurrentPage()
This method can be used to determine the last page rendered in this model instance, not including inner inserted pages. Note that processAction, not processPage, should be used to execute the returned action, because "main" will be returned if there is no current page yet.

Returns:
the name of the current page, or "main" if no page has yet been rendered in this model instance.

getDataServiceParameterText

java.lang.String getDataServiceParameterText(java.lang.String dataService,
                                             java.lang.String operation,
                                             java.lang.String parameter,
                                             java.lang.String path)
Get String data from a Data Service parameter.

Parameters:
dataService - Data Service name.
operation - Service operation name.
parameter - Service parameter name (within the specified operation).
path - Optional path into XML data.
Returns:
The text value, or null if path is specified and doesn't exist within XML data.

getDataServiceParameterXml

IXml getDataServiceParameterXml(java.lang.String dataService,
                                java.lang.String operation,
                                java.lang.String parameter,
                                java.lang.String path)
Get XML data from a Data Service parameter

Parameters:
dataService - Data Service name.
operation - Service operation name.
parameter - Service parameter name (within the specified operation).
path - Optional path into XML data.
Returns:
The XML element, or null if path is specified and doesn't exist within XML data.

getDefaultURLMapper

URLMapper getDefaultURLMapper()
Gets an instance of the default URLMapper for the current WebApp. This does not pick up new URLMappers that may be set during execution.

Returns:
The URLMapper.

getHttpServletRequest

javax.servlet.http.HttpServletRequest getHttpServletRequest()
Gets the HttpServletRequest for the current request.

Returns:
The HttpServletRequest.
See Also:
HttpServletRequest

getHttpServletResponse

javax.servlet.http.HttpServletResponse getHttpServletResponse()
Gets the HttpServletResponse for the current request.

Returns:
The HttpServletResponse.
See Also:
HttpServletResponse

getInstanceID

java.lang.String getInstanceID()
Return an ID for this model instance which is unique among active model instances in the current session.

Returns:
a unique ID for this model instance

getLinkedModel

LinkedModel getLinkedModel(java.lang.String name)
Gets the the specified Linked Model.

Parameters:
name - The name of the Linked Model Builder call.
Returns:
The specified LinkedModel from this WebAppAccess.

getLinkedModelInstance

WebAppAccess getLinkedModelInstance(java.lang.String name)
Gets the WebAppAccess for a Linked Model.

Parameters:
name - The name of the Linked Model Builder call.
Returns:
The WebAppAccess for a linked Model.

getModelInstance

WebAppAccess getModelInstance(java.lang.String modelName,
                              java.lang.String profile,
                              boolean singleton)
Gets the WebAppAccess for the specified model. If needed this will instantiate a Model instance.

Parameters:
modelName - The name of the Model to get. This will be the full path of the model relative to the "J2EERoot\WEB-INF\models" directory (e.g. "factory/core/Welcome").
profile - The explicit profile name(s) to use to get the Model.
singleton - Specifies if the model should be single instance. If true then the instance of the model is shared within the session, if false then a unique copy is created and returned.
Returns:
The WebAppAccess for the specified Model.
Example:
// build name (e.g. profiledText!Silver$Region!EastCoast)
String profileName = "profiledText" + WebAppAccess.PROFILESET_PROFILE_SEPARATOR + "Silver" + LinkedModel.EXPLICIT_PROFILE_SEPARATOR + "Region" + WebAppAccess.PROFILESET_PROFILE_SEPARATOR + "EastCoast";
WebAppAccess myModel = webAppAccess.getModelInstance("acme/dev/SampleModel", profileName, true);

getModelName

java.lang.String getModelName()
Gets the name of the current WebApp.

Returns:
The WebApp name. This will be the full path of the model relative to the "J2EERoot\WEB-INF\models" directory (e.g. "factory/core/Welcome").

getOutputCacheManager

CacheManager getOutputCacheManager()
Gets CacheManager for the Action Output Cache. The CacheManager can be used to enable/disable output caching and for getting statistics on cache hits/misses

Returns:
The CacheManager
See Also:
CacheManager

getPartialPageRefreshURL

java.lang.String getPartialPageRefreshURL(java.lang.String action,
                                          boolean renderOuterPage)
Gets a URL to an action in this WebApp that is suitable for use to directly implement partial-page refresh scenarios. Based on the second parameter, the URL can either cause the specified action to be executed directly and its results returned (renderOuterPage = false) or to first execute the action in "silent mode" (no output produced) and then re-render the outermost page of the top-level model, returning this as the results. If page-generated HTML markup will be returned, you whould normally pass "true" as the second parameter; if the action returns a simple non-page data like a String or XML, then you should pass "false" as the value for the second parameter.

Parameters:
action - Then name of the action in this WebApp
renderOuterPage -
Returns:
AJAX-suitable action URL as a String.

getPartialPageRefreshURLMapper

URLMapper getPartialPageRefreshURLMapper(boolean renderOuterPage)
Gets a URLMapper for this WebApp that is suitable for use to directly implement partial-page refresh scenarios. Based on the parameter, the generated URL can either cause the specified action to be executed directly and its results returned (renderOuterPage = false) or to first execute the action in "silent mode" (no output produced) and then re-render the outermost page of the top-level model, returning this as the results. If page-generated HTML markup will be returned, you whould normally pass "true" as the second parameter; if the action returns a simple non-page data like a String or XML, then you should pass "false" as the value for the second parameter.

Parameters:
renderOuterPage -
Returns:
AJAX-suitable URLMapper

getProfileData

java.lang.Object getProfileData(java.lang.String profileSetName,
                                java.lang.String entryName)
This will get the value of the specified entry for the users profile data.

Parameters:
profileSetName - The name of the profile set to get the value in.
entryName - The name of the profile entry to get the value for.
Returns:
The resulting Profile Data for the specified entry.

getRequestData

RequestData getRequestData()
Gets the RequestData object for the current request. This data will be request specific data such as the Browser type and Browser version.

Returns:
The RequestData object

getRequestInputs

RequestInputs getRequestInputs()
Gets the input values for the current request.

Returns:
The input data as a RequestInputAccess.

getSystemProperties

SystemProperties getSystemProperties()
Gets the SystemProperties object. The SystemProperties can be static data such as the HTML root directory, home directory, etc.

Returns:
The SystemProperties object

getURLMapper

URLMapper getURLMapper()
Gets the URLMapper for the current WebApp.

Returns:
The URLMapper.

getUserInfo

UserInfo getUserInfo()
Return an instance of the configured UserInfo handler.

Returns:
UserInfo reference to a handler implementing UserInfo interface

getVariables

Variables getVariables()
Gets the Variables on the current WebApp.

Returns:
The WebApp Variables data.
See Also:
Variables

getWebApp

WebApp getWebApp()
Gets the WebApp for current WebApp. Use this to effect the current WebApp associated with this WebAppAccess. This will provide functionality such as getPage(), addLinkedModel(), etc.

Returns:
The WebApp for the current running WebApp.

getWebAppData

WebAppData getWebAppData()
Gets an instance of a WebAppData. The data stored and retrieved from this interface is globally shared across the requester session. This object can be used to store application data for the current requester for cases where the data must be shared between multiple WebAppAccess instances for a single user. The default implementation of this interface stores the data in the users Session so take care in how much data you store. The implementation of this is replaceable, so that other mechanisms can be used as the storage location. See the technical reference for more detail.

Returns:
the WebAppData

logError

void logError(java.lang.String message,
              java.lang.Throwable exception)
Adds the specified message and exception stack trace to the log file.

Parameters:
message - The message to go to the log file.
exception - The Throwable object to be logged. Specify null if no exception.

processAction

java.lang.Object processAction(java.lang.String action)
This will process an action string. The action string can be a page, method, LJO method, or linked model (page or method). This method is only called for an incoming request. Example: MyLinkedModel.StartingPage MyLJO.doWork

Parameters:
action - The action string.
Returns:
the return value of the specified action or null if there was no value. Page actions will always return null.

processPage

void processPage(java.lang.String name)
Process the specified Page by name. processPage can be used to call:
- named page within this WebApp
- named page within a Linked Model
ProcessPage performs the JSP processing of a page within the WebApp. The page output is sent directly back to the client. The argument to processPage is the name of a JSP Page builder call, or the name of an Imported JSP Page builder call. Note: If the Page you wish to process is local to this WebApp, then you can specify the name as the name of the builder that created the page. example : webAppAccess.processPage("StartingPage"); If you are calling a page in a Linked Model then you need to specify the name of the Linked Model Builder call, then the name of the page in the Linked Model. The identifier name must be separated with a period ".". example : webAppAccess.processPage("MyOtherModel.StartingPage");

Parameters:
name - The name of the JSP Page to process as specified by the Page Builder.

resetCurrentPage

void resetCurrentPage(java.lang.String newPage)
Similar to setCurrentPage(), except that it forces the page to be set even if the model has had a page set during the current request.

Parameters:
newPage -

setCurrentPage

void setCurrentPage(java.lang.String newPage)
Set the current page for this model instance. This will be the action executed by operations that re-render the current page, as when the model is contained as a portlet or in a Model Container builder instance. Note that if the current page has been set already for this model instance in this request, this method will do nothing: to force a re-set of the current page, use resetCurrentPage().

Parameters:
newPage - the name of the page to set as current for this model instance

setSystemTrace

SystemTrace setSystemTrace(SystemTrace systemTrace)
Sets the current SystemTrace for this WebAppAccess.

Parameters:
systemTrace - the new SystemTrace to set on this WebAppAccess.
Returns:
The SystemTrace that was previously set on this WebAppAccess.


Copyright © 2009 IBM. All Rights Reserved.