Class BaseAction
java.lang.Object
com.appiancorp.web.framework.kernel.main.Action
com.appiancorp.common.appianwebmvc.BaseAction
- All Implemented Interfaces:
com.appiancorp.web.framework.kernel.main.IAction
- Direct Known Subclasses:
BaseViewAction
@Deprecated
public abstract class BaseAction
extends com.appiancorp.web.framework.kernel.main.Action
Deprecated.
The Portal functionality will be removed in a future release. Use the Tempo Interface for similar functionality.
Base Action class for all actions in the product.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Deprecated.Global appianwebmvc forward for all errors - "error"static final String
Deprecated.Global appianwebmvc forward for actions that the current user does not have access to - "no_access"static final String
Deprecated.Global default appianwebmvc forward - "success"Fields inherited from class com.appiancorp.web.framework.kernel.main.Action
servlet
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addError
(javax.servlet.http.HttpServletRequest q_, AppianException ae_) Deprecated.Adds an application exception to the request.void
addError
(javax.servlet.http.HttpServletRequest q, ErrorCode errorCode, Object... errorCodeArguments) Deprecated.Adds an error to the request using the specifiedAppianErrorCode
to retrieve the message and substitutes the provided arguments inside the error text.void
addError
(javax.servlet.http.HttpServletRequest q_, com.appiancorp.web.framework.kernel.main.ActionMessage error_, String bundle_) Deprecated.Adds an error to the request using the specified bundle for this Action.void
addError
(javax.servlet.http.HttpServletRequest q_, com.appiancorp.web.framework.kernel.main.IActionMessage error_) Deprecated.Adds an error to the request using the default bundle for this Action.void
Deprecated.use addError(HttpServletRequest q_, ActionError error_) instead.void
addError
(javax.servlet.http.HttpServletRequest q, String property, ErrorCode errorCode, Object... errorCodeArguments) Deprecated.Adds an error to the request using the specifiedAppianErrorCode
to retrieve the message and substitutes the provided arguments inside the error text.void
addError
(javax.servlet.http.HttpServletRequest q_, String property_, com.appiancorp.web.framework.kernel.main.ActionMessage error_) Deprecated.Adds an error to the request using the default bundle for this Action.void
addError
(javax.servlet.http.HttpServletRequest q_, String property_, com.appiancorp.web.framework.kernel.main.ActionMessage error_, String bundle_) Deprecated.Adds an error to the request using the specified bundle for this Action.void
addMessage
(javax.servlet.http.HttpServletRequest q_, com.appiancorp.web.framework.kernel.main.ActionMessage message_, String bundle_) Deprecated.Adds a message to the request using the specified bundle for this Action.void
addMessage
(javax.servlet.http.HttpServletRequest q_, com.appiancorp.web.framework.kernel.main.IActionMessage message_) Deprecated.Adds a message to the request using the default bundle for this Action.void
addMessage
(javax.servlet.http.HttpServletRequest q_, String property_, com.appiancorp.web.framework.kernel.main.ActionMessage message_) Deprecated.Adds a message to the request using the default bundle for this Action.void
addMessage
(javax.servlet.http.HttpServletRequest q_, String property_, com.appiancorp.web.framework.kernel.main.ActionMessage message_, String bundle_) Deprecated.Adds a message to the request using the specified bundle for this Action.protected boolean
canAccess
(com.appiancorp.web.framework.kernel.main.IActionMapping m, javax.servlet.http.HttpServletRequest q) Deprecated.Returns whether the web user can execute this action.static Map
decodeParameters
(javax.servlet.http.HttpServletRequest q_) Deprecated.Decodes the parameters from the request and returns them in the Map.final com.appiancorp.web.framework.kernel.main.IActionForward
execute
(com.appiancorp.web.framework.kernel.main.IActionMapping m_, com.appiancorp.web.framework.kernel.main.IActionForm f_, javax.servlet.http.HttpServletRequest q_, javax.servlet.http.HttpServletResponse r_) Deprecated.Checks credentials by callingcanAccess
and then callsexecuteImpl
, ifcanAccess
returnstrue
.protected String
generateToken
(javax.servlet.http.HttpServletRequest q_) Deprecated.Do not call.protected String
getAuthorizationActionName
(javax.servlet.http.HttpServletRequest q) Deprecated.Returns this action's name, as registered with the authorization framework.protected com.appiancorp.security.authz.AuthorizationProvider
Deprecated.Returns theAuthorizationProvider
to be used to perform authorization.protected ServiceContext
getServiceContext
(javax.servlet.http.HttpServletRequest q) Deprecated.Returns theServiceContext
for the user executing this request.static String
getValueFromRequest
(javax.servlet.http.HttpServletRequest q_, String key_) Deprecated.Returns the parameter or attribute value from the request based on the keystatic String
getValueFromRequest
(javax.servlet.http.HttpServletRequest q_, String key_, String default_) Deprecated.Returns the parameter or attribute value from the request based on the key.protected void
Deprecated.protected boolean
isTokenValid
(javax.servlet.http.HttpServletRequest q_) Deprecated.Detemines if the current request token is validprotected boolean
isTokenValid
(javax.servlet.http.HttpServletRequest q_, boolean reset_) Deprecated.Detemines if the current request token is validprotected boolean
requiresAuthorization
(javax.servlet.http.HttpServletRequest q) Deprecated.Returns whether this action needs to be authorized prior to execution.protected void
resetToken
(javax.servlet.http.HttpServletRequest q_) Deprecated.Reset the tokenprotected void
saveErrors
(javax.servlet.http.HttpServletRequest q_, com.appiancorp.web.framework.kernel.main.ActionMessages errors_, String bundle_) Deprecated.Mimics the implementation of the appianwebmvc ActionsaveErrors
method.protected void
saveErrors
(javax.servlet.http.HttpServletRequest q_, com.appiancorp.web.framework.kernel.main.IActionMessages errors_) Deprecated.Overrides the implementation of the appianwebmvc ActionsaveErrors
method.protected void
saveMessages
(javax.servlet.http.HttpServletRequest q_, com.appiancorp.web.framework.kernel.main.ActionMessages messages_, String bundle_) Deprecated.Mimics the implementation of the appianwebmvc ActionsaveMessages
method.protected void
saveMessages
(javax.servlet.http.HttpServletRequest q_, com.appiancorp.web.framework.kernel.main.IActionMessages messages_) Deprecated.Overrides the implementation of the appianwebmvc ActionsaveMessages
method.protected void
saveToken
(javax.servlet.http.HttpServletRequest q_) Deprecated.Save a new token for the requestMethods inherited from class com.appiancorp.web.framework.kernel.main.Action
addErrors, addMessages, execute, getErrors, getLocale, getMessages, getResources, getResources, getServlet, isCancelled, saveErrors, saveMessages, setLocale, setServlet
-
Field Details
-
FORWARD_ERROR
Deprecated.Global appianwebmvc forward for all errors - "error"- See Also:
-
FORWARD_NO_ACCESS
Deprecated.Global appianwebmvc forward for actions that the current user does not have access to - "no_access"- See Also:
-
FORWARD_SUCCESS
Deprecated.Global default appianwebmvc forward - "success"- See Also:
-
-
Constructor Details
-
BaseAction
public BaseAction()Deprecated.
-
-
Method Details
-
decodeParameters
Deprecated.Decodes the parameters from the request and returns them in the Map. This is useful for hiding multipart request parameters (i.e. doc upload) since any form submitted using this mechanism can only be decoded once. This function can be called any number of times, since the decoding is done only once, and the results are stored on the request.- Parameters:
q_
- the request that contains the parameters to be decoded.- Returns:
- a
Map
of the parameters, where the keys are the parameter names and the values are the parameter values
-
addError
Deprecated.Adds an application exception to the request. Used to display the error to the end user. The message displayed to the end user will be the detail message of the exception. These types of exception cannot be associated with a form element.- Parameters:
q_
- theHttpServletRequest
with which to associate the errorae_
- theAppianException
representing the error
-
addError
Deprecated.use addError(HttpServletRequest q_, ActionError error_) instead. -
addError
public void addError(javax.servlet.http.HttpServletRequest q_, com.appiancorp.web.framework.kernel.main.IActionMessage error_) Deprecated.Adds an error to the request using the default bundle for this Action. Bundles are associated to actions by the package of the concrete action class.- Parameters:
q_
- theHttpServletRequest
with which to associate the errorerror_
- theActionError
representing the error
-
addError
public void addError(javax.servlet.http.HttpServletRequest q_, com.appiancorp.web.framework.kernel.main.ActionMessage error_, String bundle_) Deprecated.Adds an error to the request using the specified bundle for this Action.- Parameters:
q_
- theHttpServletRequest
with which to associate the errorerror_
- theActionError
representing the errorbundle_
- The name of the bundle as it is referenced in appianwebmvc.
-
addError
public void addError(javax.servlet.http.HttpServletRequest q_, String property_, com.appiancorp.web.framework.kernel.main.ActionMessage error_) Deprecated.Adds an error to the request using the default bundle for this Action. Bundles are associated to actions by the package of the concrete action class.
This method takes in the form property that the error is associated with. For example, if you validate a form and the "username" field is invalid, you would pass in "username" in the property field and the error messages will appear context sensitive to the username on the form.- Parameters:
q_
- theHttpServletRequest
with which to associate the errorproperty_
- The property on the form that was the source of this error.error_
- theActionError
representing the error
-
addError
public void addError(javax.servlet.http.HttpServletRequest q_, String property_, com.appiancorp.web.framework.kernel.main.ActionMessage error_, String bundle_) Deprecated.Adds an error to the request using the specified bundle for this Action.
This method takes in the form property that the error is associated with. For example, if you validate a form and the "username" field is invalid, you would pass in "username" in the property field and the error messages will appear context sensitive to the username on the form.- Parameters:
q_
- theHttpServletRequest
with which to associate the errorproperty_
- The property on the form that was the source of this errorerror_
- theActionError
representing the errorbundle_
- The name of the bundle as it is referenced in appianwebmvc.
-
addError
public void addError(javax.servlet.http.HttpServletRequest q, ErrorCode errorCode, Object... errorCodeArguments) Deprecated.Adds an error to the request using the specifiedAppianErrorCode
to retrieve the message and substitutes the provided arguments inside the error text.- Parameters:
q
- theHttpServletRequest
with which to associate the errorerrorCode
- theAppianErrorCode
that will be used to retrieve the messageerrorCodeArguments
- theObject
array that will be replaced inside the error code message
-
addError
public void addError(javax.servlet.http.HttpServletRequest q, String property, ErrorCode errorCode, Object... errorCodeArguments) Deprecated.Adds an error to the request using the specifiedAppianErrorCode
to retrieve the message and substitutes the provided arguments inside the error text. This method takes in the form property that the error is associated with. For example, if you are validating a form and the "username" field is invalid, "username" is the property value. The error messages will appear context sensitive to the "username" field in the form.- Parameters:
q
- q theHttpServletRequest
with which to associate the errorproperty
- property The property on the form that was the source of this errorerrorCode
- errorCode theAppianErrorCode
that will be used to retrieve the messageerrorCodeArguments
- theObject
array that will be replaced inside the error code message
-
addMessage
public void addMessage(javax.servlet.http.HttpServletRequest q_, com.appiancorp.web.framework.kernel.main.IActionMessage message_) Deprecated.Adds a message to the request using the default bundle for this Action. Bundles are associated to actions by the package of the concrete action class.- Parameters:
q_
- theHttpServletRequest
with which to associate the messagemessage_
- the message
-
addMessage
public void addMessage(javax.servlet.http.HttpServletRequest q_, com.appiancorp.web.framework.kernel.main.ActionMessage message_, String bundle_) Deprecated.Adds a message to the request using the specified bundle for this Action.- Parameters:
q_
- theHttpServletRequest
with which to associate the messagemessage_
- the messagebundle_
- The name of the bundle as it is referenced in appianwebmvc. e.g. "ap-app-i18n" and not "text.java.com.appiancorp.ap2.application-i18n"
-
addMessage
public void addMessage(javax.servlet.http.HttpServletRequest q_, String property_, com.appiancorp.web.framework.kernel.main.ActionMessage message_) Deprecated.Adds a message to the request using the default bundle for this Action. Bundles are associated to actions by the package of the concrete action class.
This method takes in the form property that the message is associated with. For example, if you validate a form and the "username" field is invalid, you would pass in "username" in the property field and the messages will appear context sensitive to the username on the form.- Parameters:
q_
- theHttpServletRequest
with which to associate the messageproperty_
- the property on the form that was the source of this error.message_
- the message
-
addMessage
public void addMessage(javax.servlet.http.HttpServletRequest q_, String property_, com.appiancorp.web.framework.kernel.main.ActionMessage message_, String bundle_) Deprecated.Adds a message to the request using the specified bundle for this Action.
This method takes in the form property that the message is associated with.- Parameters:
q_
- theHttpServletRequest
with which to associate the messageproperty_
- The property on the form that was the source of this error.message_
- the messagebundle_
- The name of the bundle as it is referenced in appianwebmvc. e.g. "ap-app-i18n" and not "text.java.com.appiancorp.ap2.application-i18n"
-
saveErrors
protected void saveErrors(javax.servlet.http.HttpServletRequest q_, com.appiancorp.web.framework.kernel.main.IActionMessages errors_) Deprecated.Overrides the implementation of the appianwebmvc ActionsaveErrors
method. Default bundle for this action is used.- Overrides:
saveErrors
in classcom.appiancorp.web.framework.kernel.main.Action
- Parameters:
q_
- theHttpServletRequest
with which to associate the messageerrors_
- theActionErrors
representation of the errors
-
saveErrors
protected void saveErrors(javax.servlet.http.HttpServletRequest q_, com.appiancorp.web.framework.kernel.main.ActionMessages errors_, String bundle_) Deprecated.Mimics the implementation of the appianwebmvc ActionsaveErrors
method.- Parameters:
q_
- theHttpServletRequest
with which to associate the errorserrors_
- theActionErrors
representation of the errorsbundle_
- the name of the bundle as it is referenced in appianwebmvc. e.g. "ap-app-i18n" and not "text.java.com.appiancorp.ap2.application-i18n"
-
saveMessages
protected void saveMessages(javax.servlet.http.HttpServletRequest q_, com.appiancorp.web.framework.kernel.main.IActionMessages messages_) Deprecated.Overrides the implementation of the appianwebmvc ActionsaveMessages
method. Default bundle for this action is used.- Overrides:
saveMessages
in classcom.appiancorp.web.framework.kernel.main.Action
- Parameters:
q_
- theHttpServletRequest
with which to associate the messagesmessages_
- theActionMessages
representation of the messages e.g. "ap-app-i18n" and not "text.java.com.appiancorp.ap2.application-i18n"
-
saveMessages
protected void saveMessages(javax.servlet.http.HttpServletRequest q_, com.appiancorp.web.framework.kernel.main.ActionMessages messages_, String bundle_) Deprecated.Mimics the implementation of the appianwebmvc ActionsaveMessages
method. Default bundle for this action is used.- Parameters:
q_
- theHttpServletRequest
with which to associate the messagesmessages_
- the messages to savebundle_
- the name of the bundle as it is referenced in appianwebmvc. e.g. "ap-app-i18n" and not "text.java.com.appiancorp.ap2.application-i18n"
-
execute
public final com.appiancorp.web.framework.kernel.main.IActionForward execute(com.appiancorp.web.framework.kernel.main.IActionMapping m_, com.appiancorp.web.framework.kernel.main.IActionForm f_, javax.servlet.http.HttpServletRequest q_, javax.servlet.http.HttpServletResponse r_) Deprecated.Checks credentials by callingcanAccess
and then callsexecuteImpl
, ifcanAccess
returnstrue
. IfcanAccess
returnsfalse
, the returned action forward will be the one corresponding toFORWARD_NO_ACCESS
. If there is no such forward, then the forward corresponding toFORWARD_ERROR
will be returned.- Specified by:
execute
in interfacecom.appiancorp.web.framework.kernel.main.IAction
- Overrides:
execute
in classcom.appiancorp.web.framework.kernel.main.Action
- Parameters:
m_
- the information mapping the request to anAction
objectf_
- anActionForm
JavaBean that contains the form data from the request parametersq_
- the requestr_
- the response- Returns:
- an
ActionForward
to theAction
to perform after this one - Throws:
com.appiancorp.common.appianwebmvc.InvalidFormClassException
- if theActionForm
cannot be cast to requiredActionForm
implementation.
-
initBundle
protected void initBundle()Deprecated. -
getValueFromRequest
Deprecated.Returns the parameter or attribute value from the request based on the keyCalls
getValueFromRequest(q_,key_,null)
- Parameters:
q_
- the requestkey_
- the property name- Returns:
- the value for the given requeset parameter or request attribute key
-
getValueFromRequest
public static String getValueFromRequest(javax.servlet.http.HttpServletRequest q_, String key_, String default_) Deprecated.Returns the parameter or attribute value from the request based on the key.- Parameters:
q_
- the requestkey_
- the property namedefault_
- the default value (what to return if no value exists)- Returns:
- the value for the given key from a request parameter or attribute
-
canAccess
protected boolean canAccess(com.appiancorp.web.framework.kernel.main.IActionMapping m, javax.servlet.http.HttpServletRequest q) Deprecated.Returns whether the web user can execute this action. The default implementation will perform authorization ifrequiresAuthorization(HttpServletRequest)
returnstrue
. IfrequiresAuthorization(HttpServletRequest)
returnsfalse
, this method will just returntrue
.
This method should be overridden to provide an alternative access scheme.- Parameters:
m
- the action mappingq
- the request- Returns:
true
if the current user can execute this action;false
otherwise
-
requiresAuthorization
protected boolean requiresAuthorization(javax.servlet.http.HttpServletRequest q) Deprecated.Returns whether this action needs to be authorized prior to execution. By default, returnsfalse
. -
getAuthorizationActionName
Deprecated.Returns this action's name, as registered with the authorization framework. By default, returns this action's fully qualified class name. This method should be overridden to provide more granular action names, based on the data in the request. -
getServiceContext
Deprecated.Returns theServiceContext
for the user executing this request. -
getAuthorizationProvider
protected com.appiancorp.security.authz.AuthorizationProvider getAuthorizationProvider()Deprecated.Returns theAuthorizationProvider
to be used to perform authorization. -
generateToken
Deprecated.Do not call. Will throw AbstractMethodError- Overrides:
generateToken
in classcom.appiancorp.web.framework.kernel.main.Action
-
isTokenValid
protected boolean isTokenValid(javax.servlet.http.HttpServletRequest q_) Deprecated.Detemines if the current request token is valid- Overrides:
isTokenValid
in classcom.appiancorp.web.framework.kernel.main.Action
- Parameters:
q_
- the request- Returns:
true
if the token is valid;false
otherwise
-
isTokenValid
protected boolean isTokenValid(javax.servlet.http.HttpServletRequest q_, boolean reset_) Deprecated.Detemines if the current request token is valid- Overrides:
isTokenValid
in classcom.appiancorp.web.framework.kernel.main.Action
- Parameters:
q_
- the requestreset_
- whether to reset the token- Returns:
true
if the token is valid;false
otherwise
-
resetToken
protected void resetToken(javax.servlet.http.HttpServletRequest q_) Deprecated.Reset the token- Overrides:
resetToken
in classcom.appiancorp.web.framework.kernel.main.Action
- Parameters:
q_
- the request
-
saveToken
protected void saveToken(javax.servlet.http.HttpServletRequest q_) Deprecated.Save a new token for the request- Overrides:
saveToken
in classcom.appiancorp.web.framework.kernel.main.Action
- Parameters:
q_
- the request
-