org.apache.jetspeed
Class JetspeedPortalContext

java.lang.Object
  extended by org.apache.jetspeed.JetspeedPortalContext
All Implemented Interfaces:
javax.portlet.PortalContext

public class JetspeedPortalContext
extends Object
implements org.apache.jetspeed.PortalContext

Implementation of Portal Context associated with running thread of the engine

Version:
$Id: JetspeedPortalContext.java 553375 2007-07-05 05:37:00Z taylor $
Author:
David Sean Taylor

Field Summary
private  String applicationRoot
          The base from which the Jetspped application will operate.
private  HashMap attributes
          Runtime attributes.
private  org.apache.jetspeed.administration.PortalConfiguration configuration
          Configuration state
private  org.apache.jetspeed.engine.Engine engine
          The engine associated with this context.
private static String PORTAL_NAME_ATTR
           
private static String PORTAL_VERSION_ATTR
           
private  String portalInfo
           
private static String SUPPORTED_PORTLETMODE_ATTR
           
private static String SUPPORTED_WINDOWSTATE_ATTR
           
 
Constructor Summary
JetspeedPortalContext(org.apache.jetspeed.engine.Engine engine, org.apache.jetspeed.administration.PortalConfiguration configuration, String applicationRoot)
           
 
Method Summary
 String getApplicationRoot()
          Returns the application root for this Jetspeed engine context.
 Object getAttribute(String name)
          Returns the engine attribute with the given name, or null if there is no attribute by that name.
 org.apache.jetspeed.administration.PortalConfiguration getConfiguration()
          Returns the configuration properties for this Jetspeed engine context.
 String getConfigurationProperty(String key)
           
 String getConfigurationProperty(String key, String defaultValue)
           
 org.apache.jetspeed.engine.Engine getEngine()
          Returns the engine associated with this context.
 String getPortalInfo()
           
 String getProperty(String name)
           
 Enumeration getPropertyNames()
           
private  Collection getSupportedModes()
           
 Enumeration getSupportedPortletModes()
           
private  Collection getSupportedStates()
           
 Enumeration getSupportedWindowStates()
           
 boolean isPortletModeAllowed(javax.portlet.PortletMode mode)
           
 boolean isWindowStateAllowed(javax.portlet.WindowState state)
           
 void setApplicationRoot(String applicationRoot)
          Sets the application root path for this Jetspeed engine context.
 void setAttribute(String name, Object value)
          Binds an object to a given attribute name in this servlet context.
 void setConfiguration(org.apache.jetspeed.administration.PortalConfiguration configuration)
          Set the configuration properties for this Jetspeed engine context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SUPPORTED_WINDOWSTATE_ATTR

private static final String SUPPORTED_WINDOWSTATE_ATTR
See Also:
Constant Field Values

SUPPORTED_PORTLETMODE_ATTR

private static final String SUPPORTED_PORTLETMODE_ATTR
See Also:
Constant Field Values

PORTAL_VERSION_ATTR

private static final String PORTAL_VERSION_ATTR
See Also:
Constant Field Values

PORTAL_NAME_ATTR

private static final String PORTAL_NAME_ATTR
See Also:
Constant Field Values

engine

private org.apache.jetspeed.engine.Engine engine
The engine associated with this context.


attributes

private HashMap attributes
Runtime attributes.


configuration

private org.apache.jetspeed.administration.PortalConfiguration configuration
Configuration state


applicationRoot

private String applicationRoot
The base from which the Jetspped application will operate.


portalInfo

private final String portalInfo
Constructor Detail

JetspeedPortalContext

public JetspeedPortalContext(org.apache.jetspeed.engine.Engine engine,
                             org.apache.jetspeed.administration.PortalConfiguration configuration,
                             String applicationRoot)
Method Detail

getConfiguration

public org.apache.jetspeed.administration.PortalConfiguration getConfiguration()
Returns the configuration properties for this Jetspeed engine context.

Returns:
a Configuration containing the configuration properties for this Jetspeed context.

getConfigurationProperty

public String getConfigurationProperty(String key)

getConfigurationProperty

public String getConfigurationProperty(String key,
                                       String defaultValue)

setConfiguration

public void setConfiguration(org.apache.jetspeed.administration.PortalConfiguration configuration)
Set the configuration properties for this Jetspeed engine context.

Parameters:
configuration - - the configuration properties

getApplicationRoot

public String getApplicationRoot()
Returns the application root for this Jetspeed engine context.

Returns:
a String containing the application root path for this Jetspeed context.

setApplicationRoot

public void setApplicationRoot(String applicationRoot)
Sets the application root path for this Jetspeed engine context.

Parameters:
applicationRoot - - the applicationRoot path on the file system.

getEngine

public org.apache.jetspeed.engine.Engine getEngine()
Returns the engine associated with this context.

Returns:
an Engine associated with this context

getAttribute

public Object getAttribute(String name)
Returns the engine attribute with the given name, or null if there is no attribute by that name.

Returns:
an Object containing the value of the attribute, or null if no attribute exists matching the given name

setAttribute

public void setAttribute(String name,
                         Object value)
Binds an object to a given attribute name in this servlet context.

Parameters:
name - - a String specifying the name of the attribute
value - - an Object representing the attribute to be bound

getProperty

public String getProperty(String name)
Specified by:
getProperty in interface javax.portlet.PortalContext

getPropertyNames

public Enumeration getPropertyNames()
Specified by:
getPropertyNames in interface javax.portlet.PortalContext

getSupportedModes

private Collection getSupportedModes()

getSupportedPortletModes

public Enumeration getSupportedPortletModes()
Specified by:
getSupportedPortletModes in interface javax.portlet.PortalContext

isPortletModeAllowed

public boolean isPortletModeAllowed(javax.portlet.PortletMode mode)

getSupportedStates

private Collection getSupportedStates()

getSupportedWindowStates

public Enumeration getSupportedWindowStates()
Specified by:
getSupportedWindowStates in interface javax.portlet.PortalContext

isWindowStateAllowed

public boolean isWindowStateAllowed(javax.portlet.WindowState state)

getPortalInfo

public String getPortalInfo()
Specified by:
getPortalInfo in interface javax.portlet.PortalContext


Copyright © 1999-2007 Apache Software Foundation. All Rights Reserved.