|
||||||||||
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>
D
- the action definition typepublic abstract class AbstractMultiItemAction<D extends ActionDefinition>
Abstract multi-item Action that defines the default behavior.
Constructor Summary | |
---|---|
protected |
AbstractMultiItemAction(D definition,
JcrItemAdapter item,
UiContext uiContext)
|
protected |
AbstractMultiItemAction(D definition,
List<JcrItemAdapter> items,
UiContext uiContext)
|
Method Summary | |
---|---|
void |
execute()
Executes the action. |
protected abstract void |
executeOnItem(JcrItemAdapter item)
Executes the action on ONE item. |
protected JcrItemAdapter |
getCurrentItem()
Returns the item that is currently being processed - i.e. |
protected String |
getErrorNotification()
|
protected Map<JcrItemAdapter,Exception> |
getFailedItems()
|
protected abstract String |
getFailureMessage()
Returns the message to display, if the execution fails on at least ONE item. |
protected Comparator<JcrItemAdapter> |
getItemComparator()
Create a Comparator used to sort JcrItemAdapter . |
protected List<JcrItemAdapter> |
getItems()
|
protected List<JcrItemAdapter> |
getSortedItems(Comparator<JcrItemAdapter> comparator)
|
protected abstract String |
getSuccessMessage()
Returns the message to display, if the execution succeeds on ALL items. |
protected UiContext |
getUiContext()
|
protected void |
setCurrentItem(JcrItemAdapter item)
This method should be used only in tests (when the test does not call the execute() method but e.g. |
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 |
---|
protected AbstractMultiItemAction(D definition, JcrItemAdapter item, UiContext uiContext)
protected AbstractMultiItemAction(D definition, List<JcrItemAdapter> items, UiContext uiContext)
Method Detail |
---|
protected abstract void executeOnItem(JcrItemAdapter item) throws Exception
Exception
protected abstract String getSuccessMessage()
null
,
if the implementing action handles the user notification on its own.
protected abstract String getFailureMessage()
null
,
if the implementing action handles the user notification on its own.
public void execute() throws ActionExecutionException
Action
ActionExecutionException
- if an error occurs performing the actionprotected String getErrorNotification()
protected List<JcrItemAdapter> getItems()
protected List<JcrItemAdapter> getSortedItems(Comparator<JcrItemAdapter> comparator)
Comparator
.protected UiContext getUiContext()
protected Map<JcrItemAdapter,Exception> getFailedItems()
protected JcrItemAdapter getCurrentItem()
null
if the execute()
method is not running.
protected void setCurrentItem(JcrItemAdapter item)
execute()
method but e.g. only the AbstractCommandAction.onPreExecute()
so the current item hasn't been set.
protected Comparator<JcrItemAdapter> getItemComparator()
Comparator
used to sort JcrItemAdapter
.
First element of the list are child items:
- /a/b.property
- /a/b
- /a
- /
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |