org.apache.jetspeed.modules.actions.portlets
Class PortletAction

java.lang.Object
  extended byorg.apache.turbine.modules.Assembler
      extended byorg.apache.turbine.modules.Action
          extended byorg.apache.turbine.modules.ActionEvent
              extended byorg.apache.jetspeed.modules.actions.portlets.PortletActionEvent
                  extended byorg.apache.jetspeed.modules.actions.portlets.PortletAction
Direct Known Subclasses:
GenericMVCAction

public abstract class PortletAction
extends PortletActionEvent

Abstract holder for the portlet specific methods required above and beyond the standard turbine action. Extends the PortletActionEvent, which encapsulates the event handling feature.

Version:
$Id: PortletAction.java,v 1.8.2.1 2003/02/24 18:45:42 tkuebler Exp $
Author:
tkuebler, Scott T. Weaver

Field Summary
 
Fields inherited from class org.apache.turbine.modules.ActionEvent
BUTTON, BUTTON_LENGTH, LENGTH, METHOD_NAME_LENGTH, METHOD_NAME_PREFIX
 
Constructor Summary
PortletAction()
          Creates a new instance of PortletAction
 
Method Summary
protected abstract  void buildConfigureContext(Portlet portlet, org.apache.velocity.context.Context context, org.apache.turbine.util.RunData data)
           
protected abstract  void buildMaximizedContext(Portlet portlet, org.apache.velocity.context.Context context, org.apache.turbine.util.RunData data)
           
protected abstract  void buildNormalContext(Portlet portlet, org.apache.velocity.context.Context context, org.apache.turbine.util.RunData data)
           
 void doPerform(org.apache.turbine.util.RunData data)
          You need to implement this in your classes that extend this class.
abstract  void doPerform(org.apache.turbine.util.RunData data, org.apache.velocity.context.Context context)
          You SHOULD override this method and implement it in your action.
protected  org.apache.velocity.context.Context getContext(org.apache.turbine.util.RunData data)
          Return the Context
 Portlet getPortlet(org.apache.velocity.context.Context context)
           
 java.lang.String getTemplate(org.apache.velocity.context.Context context)
          Retrieves the template for this PortletAction's Portlet.
protected  void resetTemplate(org.apache.turbine.util.RunData data)
          Clears the PortletSessionState of the template attribute.
 void setTemplate(org.apache.turbine.util.RunData data, java.lang.String template)
          This method is used when you want to short circuit an Action and change the template that will be executed next.
 void setTemplate(org.apache.turbine.util.RunData data, java.lang.String template, boolean persistent)
          This method is used when you want to short circuit an Action and change the template that will be executed next.
 
Methods inherited from class org.apache.jetspeed.modules.actions.portlets.PortletActionEvent
executeEvents, fireEvent, perform
 
Methods inherited from class org.apache.turbine.modules.ActionEvent
executeEvents, formatString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PortletAction

public PortletAction()
Creates a new instance of PortletAction

Method Detail

doPerform

public void doPerform(org.apache.turbine.util.RunData data)
               throws java.lang.Exception
Description copied from class: PortletActionEvent
You need to implement this in your classes that extend this class.

Specified by:
doPerform in class PortletActionEvent
Parameters:
data - A Turbine RunData object.
Throws:
java.lang.Exception

doPerform

public abstract void doPerform(org.apache.turbine.util.RunData data,
                               org.apache.velocity.context.Context context)
                        throws java.lang.Exception
You SHOULD override this method and implement it in your action.

Parameters:
data - Turbine information.
context - Context for web pages.
Throws:
Exception, - a generic exception.
java.lang.Exception

getContext

protected org.apache.velocity.context.Context getContext(org.apache.turbine.util.RunData data)
Return the Context

Returns:
Context, a context for web pages.

setTemplate

public void setTemplate(org.apache.turbine.util.RunData data,
                        java.lang.String template)
This method is used when you want to short circuit an Action and change the template that will be executed next. The TTL for this is a single request.

Parameters:
data - Turbine information.
template - The template that will be executed next.

setTemplate

public void setTemplate(org.apache.turbine.util.RunData data,
                        java.lang.String template,
                        boolean persistent)
This method is used when you want to short circuit an Action and change the template that will be executed next. If the persistent attribute is set to true the template value is stored in the portlet's session state and will be used until a new value has been set, either within portlet session or within the context. Regardless of the value of persistent, the context will ALWAYS have the correct "template" attribute set within.

Parameters:
data - Turbine information.
template - The template that will be executed next.
persistent - whether or not to make the template set persistent for the extent of the portlet session

resetTemplate

protected void resetTemplate(org.apache.turbine.util.RunData data)
Clears the PortletSessionState of the template attribute.


getPortlet

public Portlet getPortlet(org.apache.velocity.context.Context context)

getTemplate

public java.lang.String getTemplate(org.apache.velocity.context.Context context)
Retrieves the template for this PortletAction's Portlet. The Portlet init() will have already initialized the template value within the current context in this order:
1. From the PortletSessionState's "template" attribute
2. From the PortletConfig's "template" parameter.

However, the action may have overriden this value using any of the setTemplate() methods.

Returns:
String Current view template for this action's portlet.

buildConfigureContext

protected abstract void buildConfigureContext(Portlet portlet,
                                              org.apache.velocity.context.Context context,
                                              org.apache.turbine.util.RunData data)
                                       throws java.lang.Exception
Throws:
java.lang.Exception

buildMaximizedContext

protected abstract void buildMaximizedContext(Portlet portlet,
                                              org.apache.velocity.context.Context context,
                                              org.apache.turbine.util.RunData data)
                                       throws java.lang.Exception
Throws:
java.lang.Exception

buildNormalContext

protected abstract void buildNormalContext(Portlet portlet,
                                           org.apache.velocity.context.Context context,
                                           org.apache.turbine.util.RunData data)
                                    throws java.lang.Exception
Throws:
java.lang.Exception


Copyright © 2000-2005 Apache Software Foundation. All Rights Reserved.