Package org.openxava.actions
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,ReleaseChartAction,ResetPreviousControllersAction,ReturnPreviousModuleAction,SearchAction,SetCustomViewAction,SetDefaultSchemaAction,SetLocaleAction,SetPersistenceUnitAction,SubscribeToEmailNotificationsAction,ViewBaseAction
public abstract class BaseAction extends java.lang.Object implements IAction, IRequestAction, IModuleContextAction, IChangeModeAction
- Author:
- Javier Paniza
-
-
Field Summary
-
Fields inherited from interface org.openxava.actions.IChangeModeAction
DETAIL, LIST, PREVIOUS_MODE, SPLIT
-
-
Constructor Summary
Constructors Constructor Description BaseAction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddActions(java.lang.String... qualifiedActions)Actions add added even if they are hidden.protected voidaddError(java.lang.String messageId, java.lang.Object... ids)If some id is a String between quotes (') it will be displayed literally, untranslated.protected voidaddErrors(Messages errors)protected voidaddInfo(java.lang.String messageId, java.lang.Object... ids)If some id is a String between quotes (') it will be displayed literally, untranslated.protected voidaddMessage(java.lang.String messageId, java.lang.Object... ids)If some id is a String between quotes (') it will be displayed literally, untranslated.protected voidaddMessages(Messages messages)protected voidaddWarning(java.lang.String messageId, java.lang.Object... ids)If some id is a String between quotes (') it will be displayed literally, untranslated.protected voidclearActions()protected voidcommit()Commit the current transaction.protected voidexecuteAction(java.lang.String qualifiedActionName)Execute an action, you can call it several times, for several actions.voidexecuteAfter()voidexecuteBefore()protected ModuleContextgetContext()EnvironmentgetEnvironment()MessagesgetErrors()protected java.util.LocalegetLocale()The Locale of the current request.protected ModuleManagergetManager()MessagesgetMessages()java.lang.StringgetNextMode()LIST, DETAIL or PREVIOUS_MODE.protected java.lang.StringgetQualifiedActionIfAvailable(java.lang.String simpleName)From an action simple name get the qualified name of the action.protected javax.servlet.http.HttpServletRequestgetRequest()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.protected voidremoveActions(java.lang.String... qualifiedActions)protected voidresetDescriptionsCache()Reset the cache of all descriptions-list and others uses of descriptionsEditors.protected voidreturnToPreviousControllers()protected voidrollback()Rollback the current transaction.voidsetContext(ModuleContext context)protected voidsetControllers(java.lang.String... controllers)protected voidsetDefaultControllers()Set the default controllers of the current module.voidsetEnvironment(Environment environment)voidsetErrors(Messages errors)voidsetMessages(Messages messages)protected voidsetNextMode(java.lang.String nextMode)voidsetRequest(javax.servlet.http.HttpServletRequest request)
-
-
-
Method Detail
-
getMessages
public Messages getMessages()
- Specified by:
getMessagesin interfaceIAction
-
setMessages
public void setMessages(Messages messages)
- Specified by:
setMessagesin interfaceIAction
-
addErrors
protected void addErrors(Messages errors)
-
addMessages
protected void addMessages(Messages messages)
-
addError
protected void addError(java.lang.String messageId, java.lang.Object... ids)If some id is a String between quotes (') it will be displayed literally, untranslated.
-
addMessage
protected void addMessage(java.lang.String messageId, java.lang.Object... ids)If some id is a String between quotes (') it will be displayed literally, untranslated.
-
addInfo
protected void addInfo(java.lang.String messageId, java.lang.Object... ids)If some id is a String between quotes (') it will be displayed literally, untranslated.- Since:
- 4.3
-
addWarning
protected void addWarning(java.lang.String messageId, java.lang.Object... ids)If some id is a String between quotes (') it will be displayed literally, untranslated.- Since:
- 4.3
-
executeBefore
public void executeBefore() throws java.lang.Exception- Throws:
java.lang.Exception
-
executeAfter
public void executeAfter() throws java.lang.Exception- Throws:
java.lang.Exception
-
setEnvironment
public void setEnvironment(Environment environment)
- Specified by:
setEnvironmentin interfaceIAction
-
getEnvironment
public Environment 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
protected java.util.Locale getLocale()
The Locale of the current request.
-
getContext
protected ModuleContext getContext()
- Since:
- 4m1
-
setContext
public void setContext(ModuleContext context)
- Specified by:
setContextin interfaceIModuleContextAction
-
getNextMode
public java.lang.String getNextMode()
Description copied from interface:IChangeModeActionLIST, DETAIL or PREVIOUS_MODE.- Specified by:
getNextModein interfaceIChangeModeAction- Since:
- 4m1
-
setNextMode
protected void setNextMode(java.lang.String nextMode)
- Since:
- 4m1
-
getManager
protected ModuleManager getManager()
- Since:
- 4m1
-
addActions
protected void addActions(java.lang.String... qualifiedActions)
Actions add added even if they are hidden.- Since:
- 4m2
-
removeActions
protected void removeActions(java.lang.String... qualifiedActions)
- Since:
- 4m2
-
clearActions
protected void clearActions()
- Since:
- 4m2
-
setControllers
protected void setControllers(java.lang.String... controllers)
- 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 toreturnToPreviousController() it will not have effect.- 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
protected void executeAction(java.lang.String qualifiedActionName)
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
protected java.lang.String getQualifiedActionIfAvailable(java.lang.String simpleName)
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
-
-