org.apache.jetspeed.portal.controls
Class VelocityPortletControl

java.lang.Object
  extended byorg.apache.jetspeed.portal.portlets.AbstractPortlet
      extended byorg.apache.jetspeed.portal.controls.AbstractPortletControl
          extended byorg.apache.jetspeed.portal.controls.VelocityPortletControl
All Implemented Interfaces:
Cacheable, Portlet, PortletControl, PortletSet, PortletState, org.apache.turbine.services.cache.Refreshable, java.io.Serializable
Direct Known Subclasses:
VelocityPortletSetControl

public class VelocityPortletControl
extends AbstractPortletControl

A Velocity based portlet control which implements all PortletState action

To use this control you need to define in your registry the following entry or similar:

   
     org.apache.jetspeed.portal.controls.VelocityPortletControl
     
     
       TitleControl
       The standard Jetspeed boxed control
       url of image (icon)
     
     
   
 

Version:
$Id: VelocityPortletControl.java,v 1.32 2005/03/21 18:21:41 sgala Exp $
Author:
Roberto Carrasco, RaphaŽl Luta, Mark Orciuch
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class org.apache.jetspeed.portal.PortletSet
PortletSet.Constraints
 
Field Summary
protected static JetspeedLogger logger
          Static initialization of the logger for this class
 
Fields inherited from class org.apache.jetspeed.portal.controls.AbstractPortletControl
BACKGROUND_COLOR, COLOR, TITLE_COLOR, WIDTH
 
Fields inherited from class org.apache.jetspeed.portal.portlets.AbstractPortlet
content
 
Fields inherited from interface org.apache.jetspeed.portal.Portlet
PORTLET_MAXIMIZED, PORTLET_MINIMIZED, PORTLET_NORMAL
 
Constructor Summary
VelocityPortletControl()
           
 
Method Summary
protected  java.util.List buildActionList(org.apache.turbine.util.RunData rundata, Portlet portlet)
          Builds a list of possible window actions for this portlet instance.
 void buildContext(org.apache.turbine.util.RunData rundata, org.apache.velocity.context.Context context)
          This method allows subclasses of the VelocityPortletControl to populate the context of this control before rendering by the template engine.
protected  java.util.List createActionList(java.util.List actions, JetspeedRunData rundata, Portlet portlet)
           
protected static java.lang.String getAction(java.lang.String name)
          Transforms an Action name in Turbine valid action name, by adding a controls package prefix and capitalizing the first letter of the name.
 org.apache.ecs.ConcreteElement getContent(org.apache.turbine.util.RunData rundata)
          Handles the content generation for this control using Velocity
 boolean isCacheable()
          Disable content caching
 
Methods inherited from class org.apache.jetspeed.portal.controls.AbstractPortletControl
addPortlet, addPortlet, addPortlet, addPortlet, allowClose, allowCustomize, allowInfo, allowMaximize, allowMinimize, allowPrintFriendly, getBackgroundColor, getColor, getConfig, getController, getDescription, getID, getName, getPortlet, getPortletAt, getPortletByID, getPortletByName, getPortletConfig, getPortlets, getTitle, getTitleColor, getWidth, init, init, isClosed, isMinimized, setBackgroundColor, setClosed, setColor, setConfig, setController, setDescription, setID, setMinimized, setName, setPortlet, setPortletConfig, setTitle, setTitleColor, setWidth, setWidth, size, supportsType, toArray
 
Methods inherited from class org.apache.jetspeed.portal.portlets.AbstractPortlet
allowView, clearContent, getAllowEdit, getAllowMaximize, getAllowView, getAttribute, getContent, getContent, getCreationTime, getDescription, getExpirationMillis, getExpire, getHandle, getHandle, getImage, getImage, getInstance, getTitle, isShowTitleBar, providesCustomization, refresh, setAttribute, setCacheable, setCachedObject, setContent, setContent, setContent, setCreationTime, setExpirationMillis, setHandle, setImage, setTitle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.jetspeed.portal.Portlet
getAllowEdit, getAllowMaximize, getAllowView, getAttribute, getCreationTime, getDescription, getImage, getInstance, getTitle, isShowTitleBar, providesCustomization, setAttribute, setCreationTime, setImage, setTitle
 

Field Detail

logger

protected static final JetspeedLogger logger
Static initialization of the logger for this class

Constructor Detail

VelocityPortletControl

public VelocityPortletControl()
Method Detail

isCacheable

public boolean isCacheable()
Disable content caching

Specified by:
isCacheable in interface Cacheable
Overrides:
isCacheable in class AbstractPortlet
Returns:
true Cachable
false Not cachable

getContent

public org.apache.ecs.ConcreteElement getContent(org.apache.turbine.util.RunData rundata)
Handles the content generation for this control using Velocity

Specified by:
getContent in interface Portlet
Overrides:
getContent in class AbstractPortletControl
Parameters:
rundata - the RunData for the request

buildContext

public void buildContext(org.apache.turbine.util.RunData rundata,
                         org.apache.velocity.context.Context context)
This method allows subclasses of the VelocityPortletControl to populate the context of this control before rendering by the template engine.

Parameters:
rundata - the RunData object for this request
context - the Context used by the template

buildActionList

protected java.util.List buildActionList(org.apache.turbine.util.RunData rundata,
                                         Portlet portlet)
Builds a list of possible window actions for this portlet instance. For best results, the portlet should also implement the PortletState interface.

Parameters:
rundata - the request RunData
Returns:
a list of ordered PortletAction objects describing the the actions available for this portlet

createActionList

protected java.util.List createActionList(java.util.List actions,
                                          JetspeedRunData rundata,
                                          Portlet portlet)

getAction

protected static java.lang.String getAction(java.lang.String name)
Transforms an Action name in Turbine valid action name, by adding a controls package prefix and capitalizing the first letter of the name.



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