info.magnolia.ui.framework.action
Class AbstractRepositoryAction<D extends ActionDefinition>

java.lang.Object
  extended by info.magnolia.ui.api.action.AbstractAction<D>
      extended by info.magnolia.ui.framework.action.AbstractRepositoryAction<D>
Type Parameters:
D - The ActionDefinition used by the action.
All Implemented Interfaces:
Action
Direct Known Subclasses:
AddNodeAction, AddPropertyAction, DuplicateNodeAction

public abstract class AbstractRepositoryAction<D extends ActionDefinition>
extends AbstractAction<D>

A repository operation action which saves the changes and informs the event bus.


Field Summary
static String DEFAULT_NEW_ITEM_NAME
           
protected  JcrItemAdapter item
           
 
Constructor Summary
protected AbstractRepositoryAction(D definition, JcrItemAdapter item, info.magnolia.event.EventBus eventBus)
           
 
Method Summary
 void execute()
          Executes the defined action on the passed in item.
protected  String getUniqueNewItemName(javax.jcr.Node parent)
           
protected  String getUniqueNewItemName(javax.jcr.Node parent, String name)
           
protected abstract  void onExecute(JcrItemAdapter item)
           
protected  void setItemContentChanged(boolean itemContentChanged)
           
protected  void setItemIdOfChangedItem(String itemIdOfChangedItem)
           
 
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

DEFAULT_NEW_ITEM_NAME

public static final String DEFAULT_NEW_ITEM_NAME
See Also:
Constant Field Values

item

protected final JcrItemAdapter item
Constructor Detail

AbstractRepositoryAction

protected AbstractRepositoryAction(D definition,
                                   JcrItemAdapter item,
                                   info.magnolia.event.EventBus eventBus)
Method Detail

setItemIdOfChangedItem

protected void setItemIdOfChangedItem(String itemIdOfChangedItem)

setItemContentChanged

protected void setItemContentChanged(boolean itemContentChanged)

execute

public void execute()
             throws ActionExecutionException
Executes the defined action on the passed in item. When successful, it will fire a ContentChangedEvent.

Throws:
ActionExecutionException - if an error occurs performing the action

onExecute

protected abstract void onExecute(JcrItemAdapter item)
                           throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

getUniqueNewItemName

protected String getUniqueNewItemName(javax.jcr.Node parent)
                               throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

getUniqueNewItemName

protected String getUniqueNewItemName(javax.jcr.Node parent,
                                      String name)
                               throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException


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