|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object info.magnolia.ui.api.action.AbstractAction<D> info.magnolia.ui.framework.action.AbstractMultiItemAction<D> info.magnolia.ui.framework.action.AbstractCommandAction<D>
D
- CommandActionDefinition
.public class AbstractCommandAction<D extends CommandActionDefinition>
Base action supporting execution of commands.
Field Summary | |
---|---|
static String |
COMMAND_RESULT
|
Constructor Summary | |
---|---|
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)
|
Method Summary | |
---|---|
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 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. |
Methods inherited from class info.magnolia.ui.framework.action.AbstractMultiItemAction |
---|
execute, 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 |
---|
public static final String COMMAND_RESULT
Constructor Detail |
---|
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)
Method Detail |
---|
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 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>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |