info.magnolia.ui.framework.action
Class DeleteAction<D extends CommandActionDefinition>

java.lang.Object
  extended by info.magnolia.ui.api.action.AbstractAction<D>
      extended by info.magnolia.ui.framework.action.AbstractMultiItemAction<D>
          extended by info.magnolia.ui.framework.action.AbstractCommandAction<D>
              extended by info.magnolia.ui.framework.action.DeleteAction<D>
Type Parameters:
D - CommandActionDefinition.
All Implemented Interfaces:
Action
Direct Known Subclasses:
MarkNodeAsDeletedAction

public class DeleteAction<D extends CommandActionDefinition>
extends AbstractCommandAction<D>

Deletes a node from the repository using the delete command.


Field Summary
protected  info.magnolia.event.EventBus eventBus
           
protected  javax.jcr.Item jcrItem
           
protected  UiContext uiContext
           
 
Fields inherited from class info.magnolia.ui.framework.action.AbstractCommandAction
COMMAND_RESULT
 
Constructor Summary
DeleteAction(D definition, JcrItemAdapter item, info.magnolia.commands.CommandsManager commandsManager, info.magnolia.event.EventBus eventBus, UiContext uiContext, info.magnolia.i18nsystem.SimpleTranslator i18n)
           
DeleteAction(D definition, List<JcrItemAdapter> items, info.magnolia.commands.CommandsManager commandsManager, info.magnolia.event.EventBus eventBus, UiContext uiContext, info.magnolia.i18nsystem.SimpleTranslator i18n)
           
 
Method Summary
 void execute()
          Executes the action.
protected  String getFailureMessage()
          Returns the message to display, if the execution fails on at least ONE item.
protected  String getSuccessMessage()
          Returns the message to display, if the execution succeeds on ALL items.
protected  void onPostExecute()
          Post Command Execution.
protected  void onPreExecute()
          Pre Command Execution.
 
Methods inherited from class info.magnolia.ui.framework.action.AbstractCommandAction
buildParams, executeOnItem, getCommand, getCommandsManager, getParams, onError
 
Methods inherited from class info.magnolia.ui.framework.action.AbstractMultiItemAction
getCurrentItem, getErrorNotification, getFailedItems, getItemComparator, getItems, getSortedItems, getUiContext, setCurrentItem
 
Methods inherited from class info.magnolia.ui.api.action.AbstractAction
getDefinition
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

uiContext

protected final UiContext uiContext

jcrItem

protected final javax.jcr.Item jcrItem

eventBus

protected final info.magnolia.event.EventBus eventBus
Constructor Detail

DeleteAction

public DeleteAction(D definition,
                    JcrItemAdapter item,
                    info.magnolia.commands.CommandsManager commandsManager,
                    @Named(value="admincentral")
                    info.magnolia.event.EventBus eventBus,
                    UiContext uiContext,
                    info.magnolia.i18nsystem.SimpleTranslator i18n)

DeleteAction

public DeleteAction(D definition,
                    List<JcrItemAdapter> items,
                    info.magnolia.commands.CommandsManager commandsManager,
                    @Named(value="admincentral")
                    info.magnolia.event.EventBus eventBus,
                    UiContext uiContext,
                    info.magnolia.i18nsystem.SimpleTranslator i18n)
Method Detail

onPreExecute

protected void onPreExecute()
                     throws Exception
Description copied from class: AbstractCommandAction
Pre Command Execution. Class that implement CommansActionBase should use this in order to perform pre Command Tasks. When overriding make sure to call super to build the parameter map.

Overrides:
onPreExecute in class AbstractCommandAction<D extends CommandActionDefinition>
Throws:
Exception

execute

public final void execute()
                   throws ActionExecutionException
Description copied from interface: Action
Executes the action.

Specified by:
execute in interface Action
Overrides:
execute in class AbstractMultiItemAction<D extends CommandActionDefinition>
Throws:
ActionExecutionException - if an error occurs performing the action

onPostExecute

protected void onPostExecute()
                      throws Exception
Description copied from class: AbstractCommandAction
Post Command Execution. Class that implement CommansActionBase should use this in order to perform post Command Tasks.

Overrides:
onPostExecute in class AbstractCommandAction<D extends CommandActionDefinition>
Throws:
Exception

getSuccessMessage

protected String getSuccessMessage()
Description copied from class: AbstractMultiItemAction
Returns the message to display, if the execution succeeds on ALL items. May return null, if the implementing action handles the user notification on its own.

Overrides:
getSuccessMessage in class AbstractCommandAction<D extends CommandActionDefinition>

getFailureMessage

protected String getFailureMessage()
Description copied from class: AbstractMultiItemAction
Returns the message to display, if the execution fails on at least ONE item. May return null, if the implementing action handles the user notification on its own.

Overrides:
getFailureMessage in class AbstractCommandAction<D extends CommandActionDefinition>


Copyright © 2013 Magnolia International Ltd.. All Rights Reserved.