info.magnolia.ui.framework.action
Class ActivationAction<D extends ActivationActionDefinition>
java.lang.Object
info.magnolia.ui.api.action.AbstractAction<D>
info.magnolia.ui.framework.action.AbstractMultiItemAction<D>
info.magnolia.ui.framework.action.AbstractCommandAction<D>
info.magnolia.ui.framework.action.ActivationAction<D>
- Type Parameters:
D
- ActivationActionDefinition
.
- All Implemented Interfaces:
- Action
- Direct Known Subclasses:
- DeactivationAction
public class ActivationAction<D extends ActivationActionDefinition>
- extends AbstractCommandAction<D>
UI action that allows to activate a single page (node) or recursively with all its sub-nodes depending on the value of ActivationActionDefinition.isRecursive()
.
Constructor Summary |
ActivationAction(D definition,
JcrItemAdapter item,
info.magnolia.commands.CommandsManager commandsManager,
info.magnolia.event.EventBus admincentralEventBus,
SubAppContext uiContext,
info.magnolia.i18nsystem.SimpleTranslator i18n)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ActivationAction
@Inject
public ActivationAction(D definition,
JcrItemAdapter item,
info.magnolia.commands.CommandsManager commandsManager,
@Named(value="admincentral")
info.magnolia.event.EventBus admincentralEventBus,
SubAppContext uiContext,
info.magnolia.i18nsystem.SimpleTranslator i18n)
buildParams
protected Map<String,Object> buildParams(javax.jcr.Item jcrItem)
- Description copied from class:
AbstractCommandAction
- Builds a map of parameters which will be passed to the current command
for execution. Called by
AbstractCommandAction.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.
- Context.ATTRIBUTE_REPOSITORY = current node's workspace name
- Context.ATTRIBUTE_UUID = current node's identifier
- Context.ATTRIBUTE_PATH = current node's path
Subclasses can override this method to add further parameters to the
command execution. E.g.
protected Map<String, Object> buildParams(final Node node) {
Map<String, Object> params = super.buildParams(node);
params.put(Context.ATTRIBUTE_RECURSIVE, getDefinition().isRecursive());
return params;
}
- Overrides:
buildParams
in class AbstractCommandAction<D extends ActivationActionDefinition>
onError
protected void onError(Exception e)
- Description copied from class:
AbstractCommandAction
- Class that implement CommansActionBase should use
this in order to perform tasks or notification in case of error.
- Overrides:
onError
in class AbstractCommandAction<D extends ActivationActionDefinition>
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 ActivationActionDefinition>
- Throws:
Exception
getMessage
protected String getMessage(boolean success)
getErrorMessage
protected String getErrorMessage()
Copyright © 2013 Magnolia International Ltd.. All Rights Reserved.