org.apache.jetspeed.util.template
Class JetspeedTool

java.lang.Object
  extended byorg.apache.jetspeed.util.template.JetspeedTool
All Implemented Interfaces:
org.apache.turbine.services.pull.ApplicationTool

public class JetspeedTool
extends java.lang.Object
implements org.apache.turbine.services.pull.ApplicationTool

Utility class for accessing Jetspeed in a "pull" mode Since the tool stores a RunData object, it may not be shared between threads and/or requests

Version:
$Id: JetspeedTool.java,v 1.44 2005/05/19 15:59:40 morciuch Exp $
Author:
RaphaŽl Luta, David Sean Taylor, Mark Orciuch, Scott T. Weaver

Field Summary
protected  JetspeedRunData rundata
          RunData object for this request
 
Constructor Summary
JetspeedTool()
          Empty constructor used by introspection
JetspeedTool(org.apache.turbine.util.RunData data)
          The Tool constructor
 
Method Summary
static Portlet getCustomizer(Portlet p)
          This method retrieves the appropriate customizer portlet for the current portlet
 Entry getEntryFromRequest()
          Retreives the Entry object for current portlet based on the "js_peid" parameter
 org.apache.ecs.ConcreteElement getPane(java.lang.String name)
          Returns the portlet content customized for the current user.
static java.lang.String getParameter(org.apache.turbine.util.RunData data, java.lang.String parmStyle, java.lang.String parmName, java.lang.String parmValue, java.lang.String parmOptions)
          Returns a parameter rendered in specific parameter style
 org.apache.ecs.ConcreteElement getPortalElement(java.lang.String id)
          Return the content of a portal element given the id of the element.
 org.apache.ecs.ConcreteElement getPortlet(java.lang.String name)
          Deprecated. Use getPortletById()
 org.apache.ecs.ConcreteElement getPortletById(java.lang.String peid)
          Return the content of a portlet using the portlet's id (PEID).
 org.apache.ecs.ConcreteElement getPortletById(java.lang.String peid, boolean returnNull)
          Return the content of a portlet using the portlet's id (PEID).
 org.apache.ecs.ConcreteElement getPortletFromRegistry(org.apache.turbine.util.RunData data)
          Return the content of a portlet using the portlet's name.
 org.apache.ecs.ConcreteElement getPortletFromRegistry(java.lang.String portletName, java.lang.String controlName)
          Deprecated. Do not use this method because it's not secure. It will be removed after Beta 5.
static Portlet getPortletInfoPortlet(org.apache.turbine.util.RunData data)
          This method retrieves the appropriate information portlet for the current portlet
static java.lang.String getPortletParameter(org.apache.turbine.util.RunData data, Portlet portlet, java.lang.String parmName)
          Returns a parameter in its defined parameter style
static java.lang.String getPortletParameter(org.apache.turbine.util.RunData data, Portlet portlet, java.lang.String parmName, java.lang.String parmValue)
          Returns a parameter in its defined parameter style
static java.lang.String getPortletParameter(org.apache.turbine.util.RunData data, Portlet portlet, java.lang.String parmName, java.lang.String parmValue, java.lang.String parmOptions)
          Returns a parameter in its defined parameter style
 SecurityReference getSecurityReference(Entry entry)
          Retreives the correct SecurityReference for the portlet based on the current profile and the request.
 int getSecuritySource(Entry entry)
           
 void init(java.lang.Object data)
          This will initialise a JetspeedTool object that was constructed with the default constructor (ApplicationTool method).
 void refresh()
          Refresh method - does nothing
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rundata

protected JetspeedRunData rundata
RunData object for this request

Constructor Detail

JetspeedTool

public JetspeedTool()
Empty constructor used by introspection


JetspeedTool

public JetspeedTool(org.apache.turbine.util.RunData data)
The Tool constructor

Parameters:
data - the RunData object for the current request
Method Detail

init

public void init(java.lang.Object data)
This will initialise a JetspeedTool object that was constructed with the default constructor (ApplicationTool method).

Specified by:
init in interface org.apache.turbine.services.pull.ApplicationTool
Parameters:
data - assumed to be a RunData object

refresh

public void refresh()
Refresh method - does nothing

Specified by:
refresh in interface org.apache.turbine.services.pull.ApplicationTool

getPane

public org.apache.ecs.ConcreteElement getPane(java.lang.String name)
Returns the portlet content customized for the current user. Currently, the layout engine does not handle panes, so the panes are mapped to real PSML files. If the pane name is null or "default", the profiler will automatically chose the PSML content, else the tool will try to load the PSML file with the specified name

Parameters:
name - the name of the pane to render
Returns:
the rendered content of the pane

getPortlet

public org.apache.ecs.ConcreteElement getPortlet(java.lang.String name)
Deprecated. Use getPortletById()

Return the content of a named portlet. This portlet is sought in the current PSML resource. If a control is attached to the portlet description, returns the defined portlet and control, otherwise use the default control. Note: This will return the FIRST portlet with a name = name. Use getPortletById().

Parameters:
name - the name of the portlet to render
Returns:
the rendered content of the portlet

getCustomizer

public static Portlet getCustomizer(Portlet p)
This method retrieves the appropriate customizer portlet for the current portlet

Parameters:
p - the portlet to customize
Returns:
the portlet object of the appropriate customizer

getPortletInfoPortlet

public static Portlet getPortletInfoPortlet(org.apache.turbine.util.RunData data)
This method retrieves the appropriate information portlet for the current portlet

Parameters:
data - the RunData for this request
Returns:
the portlet object of the appropriate customizer

getPortalElement

public org.apache.ecs.ConcreteElement getPortalElement(java.lang.String id)
Return the content of a portal element given the id of the element.

Parameters:
id - The portlet id
Returns:
the rendered content of the portlet

getPortletById

public org.apache.ecs.ConcreteElement getPortletById(java.lang.String peid)
Return the content of a portlet using the portlet's id (PEID). This portlet is sought in the current PSML resource. If a control is attached to the portlet description, returns the defined portlet and control, otherwise use the default control.

Parameters:
peid - the peid of the portlet to render
Returns:
the rendered content of the portlet

getPortletById

public org.apache.ecs.ConcreteElement getPortletById(java.lang.String peid,
                                                     boolean returnNull)
Return the content of a portlet using the portlet's id (PEID). This portlet is sought in the current PSML resource. If a control is attached to the portlet description, returns the defined portlet and control, otherwise use the default control.

Parameters:
peid - the peid of the portlet to render
returnNull - allows the method to return null or not
Returns:
the rendered content of the portlet

getPortletFromRegistry

public org.apache.ecs.ConcreteElement getPortletFromRegistry(org.apache.turbine.util.RunData data)
Return the content of a portlet using the portlet's name. This portlet is sought in the registry. This is useful when you want to get portlet's content without actually having the portlet in user's profile (for example, to preview a portlet before adding it to the profile).

If a control name is specified to the portlet description, returns the defined portlet and control, otherwise use the default control.

Issues to resolve:

Returns:
the rendered content of the portlet

getPortletFromRegistry

public org.apache.ecs.ConcreteElement getPortletFromRegistry(java.lang.String portletName,
                                                             java.lang.String controlName)
Deprecated. Do not use this method because it's not secure. It will be removed after Beta 5.

Return the content of a portlet using the portlet's name. This portlet is sought in the registry. This is useful when you want to get portlet's content without actually having the portlet in user's profile (for example, to preview a portlet before adding it to the profile).

If a control name is specified to the portlet description, returns the defined portlet and control, otherwise use the default control.

Issues to resolve:

Parameters:
portletName - Name of the portlet as defined in registry
controlName - Optional control name to use in displaying the portlet
Returns:
the rendered content of the portlet

getPortletParameter

public static java.lang.String getPortletParameter(org.apache.turbine.util.RunData data,
                                                   Portlet portlet,
                                                   java.lang.String parmName)
Returns a parameter in its defined parameter style

Parameters:
data - for this request
portlet - portlet instance
parmName - parameter name
Returns:
current parameter value using specified presentation style

getPortletParameter

public static java.lang.String getPortletParameter(org.apache.turbine.util.RunData data,
                                                   Portlet portlet,
                                                   java.lang.String parmName,
                                                   java.lang.String parmValue)
Returns a parameter in its defined parameter style

Parameters:
data - for this request
portlet - portlet instance
parmName - parameter name
parmValue - current parameter value
Returns:
current parameter value using specified presentation style

getPortletParameter

public static java.lang.String getPortletParameter(org.apache.turbine.util.RunData data,
                                                   Portlet portlet,
                                                   java.lang.String parmName,
                                                   java.lang.String parmValue,
                                                   java.lang.String parmOptions)
Returns a parameter in its defined parameter style

Parameters:
data - for this request
portlet - portlet instance
parmName - parameter name
parmValue - current parameter value
Returns:
current parameter value using specified presentation style

getParameter

public static java.lang.String getParameter(org.apache.turbine.util.RunData data,
                                            java.lang.String parmStyle,
                                            java.lang.String parmName,
                                            java.lang.String parmValue,
                                            java.lang.String parmOptions)
Returns a parameter rendered in specific parameter style

Parameters:
data - for this request
parmStyle - parameter style
parmName - parameter name
parmValue - current parameter value
Returns:
current parameter value using specified presentation style

getSecurityReference

public SecurityReference getSecurityReference(Entry entry)
Retreives the correct SecurityReference for the portlet based on the current profile and the request.


getSecuritySource

public int getSecuritySource(Entry entry)

getEntryFromRequest

public Entry getEntryFromRequest()
                          throws java.lang.Exception
Retreives the Entry object for current portlet based on the "js_peid" parameter

Throws:
java.lang.Exception


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