|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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 |
---|
static final java.lang.String ACTION_NAME_ATTRIBUTE
static final char ACTION_REQUEST_SEPARATOR
static final java.lang.String EVENT_TARGET_ALL
static final java.lang.String EVENT_TARGET_PARENT
static final java.lang.String EVENT_TARGET_SELF
static final java.lang.String EXCEPTION_ATTRIBUTE
static final java.lang.String EXPLICIT_PROFILE_SEPARATOR
static final java.lang.String MODEL_INSTANCE_KEY_PREFIX
static final java.lang.String PROFILESET_PROFILE_SEPARATOR
static final java.lang.String SERVLET_CONFIG_REQUEST_ATTRIBUTE
Method Detail |
---|
LinkedModel addLinkedModel(java.lang.String name, java.lang.String modelName, boolean singleton)
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.
void addRequestCompleteListener(com.bowstreet.webapp.RequestCompleteListener listener)
SystemTrace addSystemTrace(int type, java.lang.String name)
type
- The trace type defined on SystemTrace(MODEL, METHOD, or PAGE).name
- The name of the specified type.
java.lang.Object callMethod(java.lang.String name)
name
- The name of Method to call.
java.lang.Object callMethod(java.lang.String name, java.lang.Object arg)
name
- The name of Method to call.arg
- The first argument to pass to the method call as specified by the method signature.
webAppAccess.callMethod("meth_name", my_data1);
java.lang.Object callMethod(java.lang.String name, java.lang.Object[] args)
name
- The name of Method to call.args
- An array of arguments to pass to the method call as specified by the method signature.
To call a method that takes three arguments: webAppAccess.callMethod("meth_name", new Object[] {arg1, arg2, arg3});
java.lang.Object callMethod(java.lang.String name, java.lang.Object arg1, java.lang.Object arg2)
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.
webAppAccess.callMethod("meth_name", my_data1, my_data2);
java.lang.Object callMethod(java.lang.String name, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3)
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.
webAppAccess.callMethod("meth_name", my_data1, my_data2, my_data3);
java.lang.Object callMethod(java.lang.String name, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4)
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.
webAppAccess.callMethod("meth_name", my_data1, my_data2, my_data3, my_data4);
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)
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.
webAppAccess.callMethod("meth_name", my_data1, my_data2, my_data3, my_data4, my_data5);
java.lang.Object fireEvent(java.lang.Object target, java.lang.String eventName, java.lang.Object[] args)
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 modeleventName
- the name of the event to fireargs
- array of Objects holding the arguments to this event
java.lang.Object fireEvent(java.lang.String eventName, java.lang.Object[] args)
eventName
- The name of the event which will be raised.args
- An array of arguments passed to the corresponding action(s).
void freeLinkedModel(java.lang.String name)
name
- The name of the Linked Model Builder call.void freeWebApp()
java.lang.String getActionURL(java.lang.String action)
action
- The name of an action in this WebApp.
java.lang.String getBackchannelActionURL(java.lang.String action, boolean renderOuterPage)
action
- Then name of the action in this WebApprenderOuterPage
-
URLMapper getBackchannelURLMapper(boolean renderOuterPage)
renderOuterPage
-
java.lang.String getCurrentPage()
java.lang.String getDataServiceParameterText(java.lang.String dataService, java.lang.String operation, java.lang.String parameter, java.lang.String path)
dataService
- Data Service name.operation
- Service operation name.parameter
- Service parameter name (within the specified operation).path
- Optional path into XML data.
IXml getDataServiceParameterXml(java.lang.String dataService, java.lang.String operation, java.lang.String parameter, java.lang.String path)
dataService
- Data Service name.operation
- Service operation name.parameter
- Service parameter name (within the specified operation).path
- Optional path into XML data.
URLMapper getDefaultURLMapper()
javax.servlet.http.HttpServletRequest getHttpServletRequest()
HttpServletRequest
javax.servlet.http.HttpServletResponse getHttpServletResponse()
HttpServletResponse
java.lang.String getInstanceID()
LinkedModel getLinkedModel(java.lang.String name)
name
- The name of the Linked Model Builder call.
WebAppAccess getLinkedModelInstance(java.lang.String name)
name
- The name of the Linked Model Builder call.
WebAppAccess getModelInstance(java.lang.String modelName, java.lang.String profile, boolean singleton)
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.
// 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);
java.lang.String getModelName()
CacheManager getOutputCacheManager()
CacheManager
java.lang.String getPartialPageRefreshURL(java.lang.String action, boolean renderOuterPage)
action
- Then name of the action in this WebApprenderOuterPage
-
URLMapper getPartialPageRefreshURLMapper(boolean renderOuterPage)
renderOuterPage
-
java.lang.Object getProfileData(java.lang.String profileSetName, java.lang.String entryName)
profileSetName
- The name of the profile set to get the value in.entryName
- The name of the profile entry to get the value for.
RequestData getRequestData()
RequestInputs getRequestInputs()
SystemProperties getSystemProperties()
URLMapper getURLMapper()
UserInfo getUserInfo()
Variables getVariables()
Variables
WebApp getWebApp()
WebAppData getWebAppData()
void logError(java.lang.String message, java.lang.Throwable exception)
message
- The message to go to the log file.exception
- The Throwable object to be logged. Specify null if no exception.java.lang.Object processAction(java.lang.String action)
action
- The action string.
void processPage(java.lang.String name)
name
- The name of the JSP Page to process as specified by the Page Builder.void resetCurrentPage(java.lang.String newPage)
newPage
- void setCurrentPage(java.lang.String newPage)
newPage
- the name of the page to set as current for this model instanceSystemTrace setSystemTrace(SystemTrace systemTrace)
systemTrace
- the new SystemTrace to set on this WebAppAccess.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |