Page History
...
The pooling capabilities will be removed from the MgnlCommand
base class, and the CommandsManager
will be changed to create new instance for each getCommand()
or executeCommand()
call.
Command base action
info.magnolia.ui.model.action.CommandActionBase
and its definition counterpart CommandActionDefinition
will allow for easier use of commands by the App developers. The Command action class will provide a
Map<String, Object> buildParams(final Node node)
method which builds a map of parameters which will be passed to the current command for execution. Called by the constructor.
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
It will also provide a getCommandsManager()
method which will return an instance of CommandsManager
to be used for action execution. Typically the execute()
method of a subclass action will do something like the following
getCommandsManager().executeCommand(getDefinition().getCatalog(), getDefinition().getCommand(), getParams());
Proposals for future goals (not to be implemented in this sprint):
...