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
FieldsModifier and TypeFieldDescriptionstatic final StringDeprecated.Global appianwebmvc forward for all errors - "error"static final StringDeprecated.Global appianwebmvc forward for actions that the current user does not have access to - "no_access"static final StringDeprecated.Global default appianwebmvc forward - "success"Fields inherited from class com.appiancorp.web.framework.kernel.main.Action
servlet -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddError(javax.servlet.http.HttpServletRequest q_, AppianException ae_) Deprecated.Adds an application exception to the request.voidaddError(javax.servlet.http.HttpServletRequest q, ErrorCode errorCode, Object... errorCodeArguments) Deprecated.Adds an error to the request using the specifiedAppianErrorCodeto retrieve the message and substitutes the provided arguments inside the error text.voidaddError(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.voidaddError(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.voidDeprecated.use addError(HttpServletRequest q_, ActionError error_) instead.voidaddError(javax.servlet.http.HttpServletRequest q, String property, ErrorCode errorCode, Object... errorCodeArguments) Deprecated.Adds an error to the request using the specifiedAppianErrorCodeto retrieve the message and substitutes the provided arguments inside the error text.voidaddError(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.voidaddError(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.voidaddMessage(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.voidaddMessage(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.voidaddMessage(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.voidaddMessage(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 booleancanAccess(com.appiancorp.web.framework.kernel.main.IActionMapping m, javax.servlet.http.HttpServletRequest q) Deprecated.Returns whether the web user can execute this action.static MapdecodeParameters(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.IActionForwardexecute(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 callingcanAccessand then callsexecuteImpl, ifcanAccessreturnstrue.protected StringgenerateToken(javax.servlet.http.HttpServletRequest q_) Deprecated.Do not call.protected StringgetAuthorizationActionName(javax.servlet.http.HttpServletRequest q) Deprecated.Returns this action's name, as registered with the authorization framework.protected com.appiancorp.security.authz.AuthorizationProviderDeprecated.Returns theAuthorizationProviderto be used to perform authorization.protected ServiceContextgetServiceContext(javax.servlet.http.HttpServletRequest q) Deprecated.Returns theServiceContextfor the user executing this request.static StringgetValueFromRequest(javax.servlet.http.HttpServletRequest q_, String key_) Deprecated.Returns the parameter or attribute value from the request based on the keystatic StringgetValueFromRequest(javax.servlet.http.HttpServletRequest q_, String key_, String default_) Deprecated.Returns the parameter or attribute value from the request based on the key.protected voidDeprecated.protected booleanisTokenValid(javax.servlet.http.HttpServletRequest q_) Deprecated.Detemines if the current request token is validprotected booleanisTokenValid(javax.servlet.http.HttpServletRequest q_, boolean reset_) Deprecated.Detemines if the current request token is validprotected booleanrequiresAuthorization(javax.servlet.http.HttpServletRequest q) Deprecated.Returns whether this action needs to be authorized prior to execution.protected voidresetToken(javax.servlet.http.HttpServletRequest q_) Deprecated.Reset the tokenprotected voidsaveErrors(javax.servlet.http.HttpServletRequest q_, com.appiancorp.web.framework.kernel.main.ActionMessages errors_, String bundle_) Deprecated.Mimics the implementation of the appianwebmvc ActionsaveErrorsmethod.protected voidsaveErrors(javax.servlet.http.HttpServletRequest q_, com.appiancorp.web.framework.kernel.main.IActionMessages errors_) Deprecated.Overrides the implementation of the appianwebmvc ActionsaveErrorsmethod.protected voidsaveMessages(javax.servlet.http.HttpServletRequest q_, com.appiancorp.web.framework.kernel.main.ActionMessages messages_, String bundle_) Deprecated.Mimics the implementation of the appianwebmvc ActionsaveMessagesmethod.protected voidsaveMessages(javax.servlet.http.HttpServletRequest q_, com.appiancorp.web.framework.kernel.main.IActionMessages messages_) Deprecated.Overrides the implementation of the appianwebmvc ActionsaveMessagesmethod.protected voidsaveToken(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
Mapof 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_- theHttpServletRequestwith which to associate the errorae_- theAppianExceptionrepresenting 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_- theHttpServletRequestwith which to associate the errorerror_- theActionErrorrepresenting 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_- theHttpServletRequestwith which to associate the errorerror_- theActionErrorrepresenting 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_- theHttpServletRequestwith which to associate the errorproperty_- The property on the form that was the source of this error.error_- theActionErrorrepresenting 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_- theHttpServletRequestwith which to associate the errorproperty_- The property on the form that was the source of this errorerror_- theActionErrorrepresenting 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 specifiedAppianErrorCodeto retrieve the message and substitutes the provided arguments inside the error text.- Parameters:
q- theHttpServletRequestwith which to associate the errorerrorCode- theAppianErrorCodethat will be used to retrieve the messageerrorCodeArguments- theObjectarray 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 specifiedAppianErrorCodeto 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 theHttpServletRequestwith which to associate the errorproperty- property The property on the form that was the source of this errorerrorCode- errorCode theAppianErrorCodethat will be used to retrieve the messageerrorCodeArguments- theObjectarray 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_- theHttpServletRequestwith 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_- theHttpServletRequestwith 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_- theHttpServletRequestwith 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_- theHttpServletRequestwith 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 ActionsaveErrorsmethod. Default bundle for this action is used.- Overrides:
saveErrorsin classcom.appiancorp.web.framework.kernel.main.Action- Parameters:
q_- theHttpServletRequestwith which to associate the messageerrors_- theActionErrorsrepresentation 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 ActionsaveErrorsmethod.- Parameters:
q_- theHttpServletRequestwith which to associate the errorserrors_- theActionErrorsrepresentation 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 ActionsaveMessagesmethod. Default bundle for this action is used.- Overrides:
saveMessagesin classcom.appiancorp.web.framework.kernel.main.Action- Parameters:
q_- theHttpServletRequestwith which to associate the messagesmessages_- theActionMessagesrepresentation 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 ActionsaveMessagesmethod. Default bundle for this action is used.- Parameters:
q_- theHttpServletRequestwith 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 callingcanAccessand then callsexecuteImpl, ifcanAccessreturnstrue. IfcanAccessreturnsfalse, the returned action forward will be the one corresponding toFORWARD_NO_ACCESS. If there is no such forward, then the forward corresponding toFORWARD_ERRORwill be returned.- Specified by:
executein interfacecom.appiancorp.web.framework.kernel.main.IAction- Overrides:
executein classcom.appiancorp.web.framework.kernel.main.Action- Parameters:
m_- the information mapping the request to anActionobjectf_- anActionFormJavaBean that contains the form data from the request parametersq_- the requestr_- the response- Returns:
- an
ActionForwardto theActionto perform after this one - Throws:
com.appiancorp.common.appianwebmvc.InvalidFormClassException- if theActionFormcannot be cast to requiredActionFormimplementation.
-
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:
trueif the current user can execute this action;falseotherwise
-
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 theServiceContextfor the user executing this request. -
getAuthorizationProvider
protected com.appiancorp.security.authz.AuthorizationProvider getAuthorizationProvider()Deprecated.Returns theAuthorizationProviderto be used to perform authorization. -
generateToken
Deprecated.Do not call. Will throw AbstractMethodError- Overrides:
generateTokenin 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:
isTokenValidin classcom.appiancorp.web.framework.kernel.main.Action- Parameters:
q_- the request- Returns:
trueif the token is valid;falseotherwise
-
isTokenValid
protected boolean isTokenValid(javax.servlet.http.HttpServletRequest q_, boolean reset_) Deprecated.Detemines if the current request token is valid- Overrides:
isTokenValidin classcom.appiancorp.web.framework.kernel.main.Action- Parameters:
q_- the requestreset_- whether to reset the token- Returns:
trueif the token is valid;falseotherwise
-
resetToken
protected void resetToken(javax.servlet.http.HttpServletRequest q_) Deprecated.Reset the token- Overrides:
resetTokenin 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:
saveTokenin classcom.appiancorp.web.framework.kernel.main.Action- Parameters:
q_- the request
-