Page History
Info | ||||||
---|---|---|---|---|---|---|
Documentation task
|
Table of Contents |
---|
Goal
- To define new (more logical?) structure of where commands are implemented and defined.
- Allow easier use of commands by the App developers.
- Remove command pooling.
- Get rid of the Commons Chain library (see Greg's comment).
...
The pooling capabilities were removed from the MgnlCommand
base class, and the CommandsManager
has been changed to create new instance for each getCommand()
or executeCommand()
call.
...
AbstractCommandAction
info.magnolia.ui.modelframework.action.CommandActionBase
and AbstractCommandAction
and its definition counterpart counterpart info.magnolia.ui.api.action.CommandActionDefinition
allows for easy use of commands by the App developers by handling much of the boilerplate code they would otherwise need to write.
Todo | ||||||
---|---|---|---|---|---|---|
Class info.magnolia.ui.framework.app.action.CommandActionBase is replaced by info.magnolia.ui.framework.action.AbstractActionBase. |
In most cases it's just a matter of configuration. You define a marker interface extending CommandActionDefinition
and bind CommandActionBase
to AbstractCommandAction
to it. The CommandActionDefinition
needs to define at least the name of the command to execute, optionally it can define a catalog, otherwise it uses the default value, meaning that the command to be executed will be looked up in the registered default catalog of commands. Further parameters can be added in the param subfolder and/or my subclassing CommandActionDefinition
as the example below illustrates
CommandActionBaseAbstractCommandAction
provides 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. It is called by the constructor.
...