com.gentics.api.portalnode.action
Class GenericPluggableAction

java.lang.Object
  extended by com.gentics.api.portalnode.action.GenericPluggableAction
All Implemented Interfaces:
PluggableAction

public abstract class GenericPluggableAction
extends java.lang.Object
implements PluggableAction

abstract base class for pluggable actions. implements basic functionality.

Author:
norbert

Field Summary
protected  org.apache.log4j.Logger logger
          logger object used for output of log messages in pluggable actions
 
Fields inherited from interface com.gentics.api.portalnode.action.PluggableAction
CONFIGURATION_ERROR, INCONSISTENT_ERROR
 
Constructor Summary
GenericPluggableAction()
           
 
Method Summary
protected  boolean assertRequiredParametersSet(PluggableActionRequest request, java.lang.String[] requiredParameters)
          Convenience method to check whether all required parameters are really set.
protected  boolean assertRequiredParametersSet(PluggableActionRequest request, java.lang.String[] requiredParameters, org.apache.log4j.Level logLevel)
          Convenience method to check whether all required parameters are really set.
 void destroy()
          Called by the view when the pluggable action is no longer used.
protected  PluggableActionContext getContext()
          get the pluggable action context
protected  GenticsPortlet getModule()
          get the module from the pluggable action context
 void init(PluggableActionContext context)
          Initialize the pluggable action
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.gentics.api.portalnode.action.PluggableAction
processAction
 

Field Detail

logger

protected org.apache.log4j.Logger logger
logger object used for output of log messages in pluggable actions

Constructor Detail

GenericPluggableAction

public GenericPluggableAction()
Method Detail

init

public void init(PluggableActionContext context)
          throws PluggableActionException
Description copied from interface: PluggableAction
Initialize the pluggable action

Specified by:
init in interface PluggableAction
Parameters:
context - context of the pluggable action
Throws:
PluggableActionException - when the action cannot be initialized and shall not be processed

destroy

public void destroy()
Description copied from interface: PluggableAction
Called by the view when the pluggable action is no longer used. Implement this to perform cleanup of ressources.

Specified by:
destroy in interface PluggableAction

getModule

protected GenticsPortlet getModule()
get the module from the pluggable action context

Returns:
the module

getContext

protected PluggableActionContext getContext()
get the pluggable action context

Returns:
Returns the context.

assertRequiredParametersSet

protected boolean assertRequiredParametersSet(PluggableActionRequest request,
                                              java.lang.String[] requiredParameters,
                                              org.apache.log4j.Level logLevel)
Convenience method to check whether all required parameters are really set. If any parameters are found to be missing, a log message of the given loglevel is generated

Parameters:
request - pluggable action request holding the parameters
requiredParameters - array required parameter names
logLevel - log level for the generated messages
Returns:
true when all parameters are set, false if not

assertRequiredParametersSet

protected boolean assertRequiredParametersSet(PluggableActionRequest request,
                                              java.lang.String[] requiredParameters)
Convenience method to check whether all required parameters are really set. If any parameters are found to be missing, error messages are created

Parameters:
request - pluggable action request holding the parameters
requiredParameters - array required parameter names
Returns:
true when all parameters are set, false if not


Copyright © 2013 Gentics Software GmbH. All Rights Reserved.