info.magnolia.ui.framework.action
Class ActivationAction<D extends ActivationActionDefinition>

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.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().


Field Summary
 
Fields inherited from class info.magnolia.ui.framework.action.AbstractCommandAction
COMMAND_RESULT
 
Constructor Summary
ActivationAction(D definition, JcrItemAdapter item, info.magnolia.commands.CommandsManager commandsManager, info.magnolia.event.EventBus admincentralEventBus, SubAppContext 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  String getErrorMessage()
           
protected  String getMessage(boolean success)
           
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.
 
Methods inherited from class info.magnolia.ui.framework.action.AbstractCommandAction
executeOnItem, getCommand, getCommandsManager, getFailureMessage, getParams, getSuccessMessage, onPreExecute
 
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
 

Constructor Detail

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)
Method Detail

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. 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.