info.magnolia.ui.api.action
Interface ActionExecutor

All Known Implementing Classes:
AbstractActionExecutor, DialogActionExecutor, MediaEditorActionExecutor, MessageActionExecutor, SubAppActionExecutor, UserActionExecutor

public interface ActionExecutor

Responsible for executing actions, doing lookups of action definitions based on action names and evaluating if an action is available. Creates a new instance of the action for each execution and allows the action to receive its action definition object and all parameters given through injection as it is created.

See Also:
Action, ActionDefinition

Method Summary
 void execute(String actionName, Object... args)
          Creates a new instance of the action for the supplied name and executes it.
 ActionDefinition getActionDefinition(String actionName)
          Performs a lookup for an action definition by name.
 boolean isAvailable(String actionName, javax.jcr.Item... items)
          Evaluates if an action is available for the current user.
 

Method Detail

execute

void execute(String actionName,
             Object... args)
             throws ActionExecutionException
Creates a new instance of the action for the supplied name and executes it. The arguments passed here along with the action definition are made available to the action instance using injection.

Throws:
ActionExecutionException - if the action encounters a problem during execution or if no action definition matches the name

getActionDefinition

ActionDefinition getActionDefinition(String actionName)
Performs a lookup for an action definition by name.

Returns:
the action definition for the supplied action name or null if not found

isAvailable

boolean isAvailable(String actionName,
                    javax.jcr.Item... items)
Evaluates if an action is available for the current user. This involves checking if the user has the required permission to use the action and if the action is available for a specific item.

See Also:
AvailabilityDefinition


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