D
- the action definition typepublic abstract class AbstractMultiItemAction<D extends ActionDefinition> extends AbstractAction<D>
Modifier | Constructor and Description |
---|---|
protected |
AbstractMultiItemAction(D definition,
JcrItemAdapter item,
UiContext uiContext) |
protected |
AbstractMultiItemAction(D definition,
List<JcrItemAdapter> items,
UiContext uiContext) |
Modifier and Type | Method and Description |
---|---|
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. |
getDefinition
protected AbstractMultiItemAction(D definition, JcrItemAdapter item, UiContext uiContext)
protected AbstractMultiItemAction(D definition, List<JcrItemAdapter> items, UiContext uiContext)
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
- /Copyright © 2015 Magnolia International Ltd.. All rights reserved.