com.gentics.api.portalnode.action
Interface PluggableAction

All Known Implementing Classes:
GenericPluggableAction

public interface PluggableAction

Interface for pluggable actions.
Pluggable actions can be plugged into views (forms) to implement business logic inside/behind them. When a button/link with a pluggable action configured is triggered (by the user), the view will generate an instance of the specified PluggableAction class, initialize it with the configuration and context and call processAction on it.
Pluggable actions may be chained (ev. with different followers depending on whether the previuous action succeeded, failed). Every pluggable action may modify the given actionData such that the following action will get the modified data rather than the original data.

Author:
norbert

Field Summary
static java.lang.String CONFIGURATION_ERROR
          constant for the error message (in case of a configuration error)
static java.lang.String INCONSISTENT_ERROR
          constant for the error message (in case of a configuration error).
 
Method Summary
 void destroy()
          Called by the view when the pluggable action is no longer used.
 void init(PluggableActionContext context)
          Initialize the pluggable action
 boolean processAction(PluggableActionRequest request, PluggableActionResponse response)
          Process the implemented pluggable action.
 

Field Detail

INCONSISTENT_ERROR

static final java.lang.String INCONSISTENT_ERROR
constant for the error message (in case of a configuration error).

See Also:
Constant Field Values

CONFIGURATION_ERROR

static final java.lang.String CONFIGURATION_ERROR
constant for the error message (in case of a configuration error)

See Also:
Constant Field Values
Method Detail

init

void init(PluggableActionContext context)
          throws PluggableActionException
Initialize the pluggable action

Parameters:
context - context of the pluggable action
Throws:
PluggableActionException - when the action cannot be initialized and shall not be processed

processAction

boolean processAction(PluggableActionRequest request,
                      PluggableActionResponse response)
                      throws PluggableActionException
Process the implemented pluggable action.
this may also modify the given actionData such that eventually following actions will get the modified data rather than the original.

Parameters:
request - data used to process the data. the data may be coming from the origination view or may be modified by previous pluggable actions
Returns:
true when the action processed successfully, false if not
Throws:
PluggableActionException - when the processing failed due to an unexpected error

destroy

void destroy()
Called by the view when the pluggable action is no longer used. Implement this to perform cleanup of ressources.



Copyright © 2013 Gentics Software GmbH. All Rights Reserved.