Package org.openxava.actions
Class SaveElementInCollectionAction
- java.lang.Object
-
- org.openxava.actions.BaseAction
-
- org.openxava.actions.ViewBaseAction
-
- org.openxava.actions.CollectionElementViewBaseAction
-
- org.openxava.actions.SaveElementInCollectionAction
-
- All Implemented Interfaces:
IAction
,IChangeModeAction
,IModuleContextAction
,IRequestAction
- Direct Known Subclasses:
AddElementsToCollectionAction
,PasteElementsIntoCollectionAction
,SaveElementInTreeViewAction
public class SaveElementInCollectionAction extends CollectionElementViewBaseAction
To save a collection element.The case of collections of entities with @AsEmbedded (or with as-aggregate="true") is treated by
AddElementsToCollectionAction
.- Author:
- Javier Paniza, Jeromy Altuna
-
-
Field Summary
-
Fields inherited from interface org.openxava.actions.IChangeModeAction
DETAIL, LIST, PREVIOUS_MODE, SPLIT
-
-
Constructor Summary
Constructors Constructor Description SaveElementInCollectionAction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addValidationMessage(java.lang.Exception ex)
protected void
associateEntity(java.util.Map keyValues)
protected void
create(java.util.Map values, boolean isEntity, java.util.Map containerKey)
void
execute()
java.lang.String
getNextAction()
protected java.util.Map
getValuesToSave()
protected void
saveCollectionElement(java.util.Map containerKey)
Saves the collection or aggregate.protected java.util.Map
saveIfNotExists(View view)
-
Methods inherited from class org.openxava.actions.CollectionElementViewBaseAction
closeDialog, getCollectionElementView, getMetaCollection, getParentView, getView, getViewObject, isCloseDialogDisallowed, isEntityReferencesCollection, isEntityReferencesCollection, mustRefreshCollection, setCloseDialogDisallowed, setViewObject, showDialog, validateMaximum, validateMinimum
-
Methods inherited from class org.openxava.actions.ViewBaseAction
changeThisPropertyByViewValue, getModelName, getPreviousView, getPreviousViews, resetDescriptionsCache, returnToPreviousView, setControllers, setPreviousViews, setView, showDialog, showNewView, showView, validateViewValues
-
Methods inherited from class org.openxava.actions.BaseAction
addActions, addError, addErrors, addInfo, addMessage, addMessages, addWarning, clearActions, commit, executeAction, executeAfter, executeBefore, getContext, getEnvironment, getErrors, getLocale, getManager, getMessages, getNextMode, getQualifiedActionIfAvailable, getRequest, removeActions, returnToPreviousControllers, rollback, setContext, setDefaultControllers, setEnvironment, setErrors, setMessages, setNextMode, setRequest
-
-
-
-
Method Detail
-
execute
public void execute() throws java.lang.Exception
- Specified by:
execute
in interfaceIAction
- Specified by:
execute
in classCollectionElementViewBaseAction
- Throws:
java.lang.Exception
-
getValuesToSave
protected java.util.Map getValuesToSave() throws java.lang.Exception
- Throws:
java.lang.Exception
-
saveCollectionElement
protected void saveCollectionElement(java.util.Map containerKey) throws java.lang.Exception
Saves the collection or aggregate.- Parameters:
containerKey
-- Throws:
java.lang.Exception
- Since:
- 4.7
-
create
protected void create(java.util.Map values, boolean isEntity, java.util.Map containerKey) throws javax.ejb.CreateException
- Throws:
javax.ejb.CreateException
-
associateEntity
protected void associateEntity(java.util.Map keyValues) throws ValidationException, XavaException, javax.ejb.ObjectNotFoundException, javax.ejb.FinderException, java.rmi.RemoteException
- Throws:
ValidationException
XavaException
javax.ejb.ObjectNotFoundException
javax.ejb.FinderException
java.rmi.RemoteException
-
saveIfNotExists
protected java.util.Map saveIfNotExists(View view) throws java.lang.Exception
- Returns:
- The saved object
- Throws:
java.lang.Exception
-
addValidationMessage
protected void addValidationMessage(java.lang.Exception ex)
- Since:
- 5.9
-
getNextAction
public java.lang.String getNextAction() throws java.lang.Exception
- Throws:
java.lang.Exception
-
-