Class BaseAction
java.lang.Object
org.openxava.actions.BaseAction
- All Implemented Interfaces:
IAction, IChangeModeAction, IModuleContextAction, IRequestAction
- Direct Known Subclasses:
CancelInListAction, ChangeModuleAction, ChangeSectionAction, EmptyAction, GoDetailAction, GoListAction, NavigationAction, ResetPreviousControllersAction, ReturnPreviousModuleAction, SearchAction, SetCustomViewAction, SetDefaultSchemaAction, SetLocaleAction, SetPersistenceUnitAction, SubscribeToEmailNotificationsAction, ViewBaseAction
public abstract class BaseAction
extends Object
implements IAction, IRequestAction, IModuleContextAction, IChangeModeAction
- Author:
- Javier Paniza
-
Field Summary
Fields inherited from interface IChangeModeAction
DETAIL, LIST, PREVIOUS_MODE, SPLIT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddActions(String... qualifiedActions) Actions add added even if they are hidden.protected voidIf some id is a String between quotes (') it will be displayed literally, untranslated.protected voidprotected voidIf some id is a String between quotes (') it will be displayed literally, untranslated.protected voidaddMessage(String messageId, Object... ids) If some id is a String between quotes (') it will be displayed literally, untranslated.protected voidaddMessages(Messages messages) protected voidaddWarning(String messageId, Object... ids) If some id is a String between quotes (') it will be displayed literally, untranslated.protected voidprotected voidcommit()Commit the current transaction.protected voidexecuteAction(String qualifiedActionName) Execute an action, you can call it several times, for several actions.voidvoidprotected ModuleContextprotected LocaleThe Locale of the current request.protected ModuleManagerLIST, DETAIL or PREVIOUS_MODE.protected StringgetQualifiedActionIfAvailable(String simpleName) From an action simple name get the qualified name of the action.protected javax.servlet.http.HttpServletRequestWith this method you can access directly to the web application resources, but it ties you to implementation technology (servlets), hence it's better to avoid it if you have alternative and are thinking in migrating to another tecnology.protected voidremoveActions(String... qualifiedActions) protected voidReset the cache of all descriptions-list and others uses of descriptionsEditors.protected voidprotected voidrollback()Rollback the current transaction.voidsetContext(ModuleContext context) protected voidsetControllers(String... controllers) protected voidSet the default controllers of the current module.voidsetEnvironment(Environment environment) voidvoidsetMessages(Messages messages) protected voidsetNextMode(String nextMode) voidsetRequest(javax.servlet.http.HttpServletRequest request)
-
Constructor Details
-
BaseAction
public BaseAction()
-
-
Method Details
-
getErrors
-
setErrors
-
getMessages
- Specified by:
getMessagesin interfaceIAction
-
setMessages
- Specified by:
setMessagesin interfaceIAction
-
addErrors
-
addMessages
-
addError
-
addMessage
-
addInfo
-
addWarning
-
executeBefore
-
executeAfter
-
setEnvironment
- Specified by:
setEnvironmentin interfaceIAction
-
getEnvironment
-
resetDescriptionsCache
protected void resetDescriptionsCache()Reset the cache of all descriptions-list and others uses of descriptionsEditors. -
setRequest
public void setRequest(javax.servlet.http.HttpServletRequest request) - Specified by:
setRequestin interfaceIRequestAction
-
getRequest
protected javax.servlet.http.HttpServletRequest getRequest()With this method you can access directly to the web application resources, but it ties you to implementation technology (servlets), hence it's better to avoid it if you have alternative and are thinking in migrating to another tecnology.- Since:
- 4m1
-
getLocale
The Locale of the current request. -
getContext
- Since:
- 4m1
-
setContext
- Specified by:
setContextin interfaceIModuleContextAction
-
getNextMode
Description copied from interface:IChangeModeActionLIST, DETAIL or PREVIOUS_MODE.- Specified by:
getNextModein interfaceIChangeModeAction- Since:
- 4m1
-
setNextMode
- Since:
- 4m1
-
getManager
- Since:
- 4m1
-
addActions
Actions add added even if they are hidden.- Since:
- 4m2
-
removeActions
- Since:
- 4m2
-
clearActions
protected void clearActions()- Since:
- 4m2
-
setControllers
- Since:
- 4m2
-
returnToPreviousControllers
protected void returnToPreviousControllers()- Since:
- 4m2
-
setDefaultControllers
protected void setDefaultControllers()Set the default controllers of the current module.The defaults controllers are those declared in application.xml for the module, so the initial controllers when the module starts.
Also, this method clear the stack of controllers navigation, that is, if after calling to this method you call to() it will not have effect.invalid reference
returnToPreviousController- Since:
- 4m2
-
commit
protected void commit()Commit the current transaction.- Since:
- 5.0
-
rollback
protected void rollback()Rollback the current transaction.- Since:
- 5.0
-
executeAction
Execute an action, you can call it several times, for several actions. It does not throw exceptions but accumulate the errors in getErrors(). Also it can modify getMessages().- Since:
- 5.7
-
getQualifiedActionIfAvailable
From an action simple name get the qualified name of the action.
If the action is not available returns null.
For example, from "new" gets "CRUD.new" if it exists, but if there is no an action called "new" in that moment it returns null.- Since:
- 5.8
-