D
- CommandActionDefinition
.public class AbstractCommandAction<D extends CommandActionDefinition> extends AbstractMultiItemAction<D>
AsyncActionExecutor
if CommandActionDefinition.asynchronous
is set.Modifier and Type | Field and Description |
---|---|
static String |
COMMAND_RESULT |
static String |
LONG_RUNNING_ACTION_NOTIFICATION |
static String |
PARALLEL_EXECUTION_NOT_ALLOWED_NOTIFICATION |
Constructor and Description |
---|
AbstractCommandAction(D definition,
JcrItemAdapter item,
info.magnolia.commands.CommandsManager commandsManager,
UiContext uiContext,
info.magnolia.i18nsystem.SimpleTranslator i18n) |
AbstractCommandAction(D definition,
List<JcrItemAdapter> items,
info.magnolia.commands.CommandsManager commandsManager,
UiContext uiContext,
info.magnolia.i18nsystem.SimpleTranslator i18n) |
Modifier and Type | Method and Description |
---|---|
protected Map<String,Object> |
buildParams(javax.jcr.Item jcrItem)
Builds a map of parameters which will be passed to the current command
for execution.
|
protected void |
executeOnItem(JcrItemAdapter item)
Handles the retrieval of the
Command instance defined in the CommandActionDefinition associated with this action and then
performs the actual command execution. |
protected info.magnolia.commands.chain.Command |
getCommand() |
info.magnolia.commands.CommandsManager |
getCommandsManager() |
protected String |
getFailureMessage()
Returns the message to display, if the execution fails on at least ONE item.
|
Map<String,Object> |
getParams() |
protected String |
getSuccessMessage()
Returns the message to display, if the execution succeeds on ALL items.
|
protected boolean |
isInvokeAsynchronously() |
protected void |
onError(Exception e)
Class that implement CommansActionBase should use
this in order to perform tasks or notification in case of error.
|
protected void |
onPostExecute()
Post Command Execution.
|
protected void |
onPreExecute()
Pre Command Execution.
|
execute, getCurrentItem, getErrorNotification, getFailedItems, getItemComparator, getItems, getSortedItems, getUiContext, setCurrentItem
getDefinition
public static final String COMMAND_RESULT
public static final String LONG_RUNNING_ACTION_NOTIFICATION
public static final String PARALLEL_EXECUTION_NOT_ALLOWED_NOTIFICATION
public AbstractCommandAction(D definition, JcrItemAdapter item, info.magnolia.commands.CommandsManager commandsManager, UiContext uiContext, info.magnolia.i18nsystem.SimpleTranslator i18n)
public AbstractCommandAction(D definition, List<JcrItemAdapter> items, info.magnolia.commands.CommandsManager commandsManager, UiContext uiContext, info.magnolia.i18nsystem.SimpleTranslator i18n)
protected Map<String,Object> buildParams(javax.jcr.Item jcrItem)
onPreExecute()
. Default implementation returns
a map containing the parameters defined at
CommandActionDefinition.getParams()
. It also adds the following
parameters with values retrieved from the passed node.
protected Map<String, Object> buildParams(final Node node) { Map<String, Object> params = super.buildParams(node); params.put(Context.ATTRIBUTE_RECURSIVE, getDefinition().isRecursive()); return params; }
public final Map<String,Object> getParams()
buildParams(javax.jcr.Item)
public final info.magnolia.commands.CommandsManager getCommandsManager()
protected void executeOnItem(JcrItemAdapter item) throws ActionExecutionException
Command
instance defined in the CommandActionDefinition
associated with this action and then
performs the actual command execution.executeOnItem
in class AbstractMultiItemAction<D extends CommandActionDefinition>
ActionExecutionException
- if no command is found or if command execution throws an exception.protected boolean isInvokeAsynchronously()
protected void onPreExecute() throws Exception
Exception
protected void onPostExecute() throws Exception
Exception
protected void onError(Exception e)
protected info.magnolia.commands.chain.Command getCommand()
protected String getSuccessMessage()
AbstractMultiItemAction
null
,
if the implementing action handles the user notification on its own.getSuccessMessage
in class AbstractMultiItemAction<D extends CommandActionDefinition>
protected String getFailureMessage()
AbstractMultiItemAction
null
,
if the implementing action handles the user notification on its own.getFailureMessage
in class AbstractMultiItemAction<D extends CommandActionDefinition>
Copyright © 2016 Magnolia International Ltd.. All rights reserved.