org.apache.jetspeed.portal
Interface PortletContext


public interface PortletContext

The PortletContext interface defines a portlet's view of the portal container within which each portlet is running. The PortletContext also allows a portlet to access resources available to it. Using the context, a portlet can log events, and obtain URL references to resources.


Method Summary
 java.lang.Object getAttribute(java.lang.String aName)
          Returns the portlet container attribute with the given name, or null if there is no attribute by that name.
 java.util.Enumeration getAttributeNames()
          Returns an enumeration of the attribute names available within this portlet context.
 java.lang.String getContainerInfo()
          Returns the name and version of the portlet container which the portlet is running in.
 int getMajorVersion()
          Returns the major version of the Portlet API that this portlet container supports.
 int getMinorVersion()
          Returns the minor version of the Portlet API that this portlet container supports.
 void include(java.lang.String aURL, PortletRequest aRequest, PortletResponse aResponse)
          Allows the portlet to delegate the rendering to another resource as specified by the URL.
 void log(java.lang.String aMessage)
          Logs the given message in the portal's log file, usually an event log.
 void log(java.lang.String aMessage, java.lang.Throwable aCause)
          Logs the given message, cause, and a stack trace in the portal's log.
 

Method Detail

getAttribute

public java.lang.Object getAttribute(java.lang.String aName)
Returns the portlet container attribute with the given name, or null if there is no attribute by that name. The attribute is returned as a java.lang.Object or some subclass. An attribute allows a portlet container to give the portlet additional information not alreay provided by this interface.
Parameters:
aName - the attribute name
Returns:
the attribute value, or null> if no attribute with the given name exists

getAttributeNames

public java.util.Enumeration getAttributeNames()
Returns an enumeration of the attribute names available within this portlet context.
Returns:
an enumeration of attribute names
See Also:
getAttribute(String)

include

public void include(java.lang.String aURL,
                    PortletRequest aRequest,
                    PortletResponse aResponse)
             throws PortletException,
                    java.io.IOException
Allows the portlet to delegate the rendering to another resource as specified by the URL.
Parameters:
aURL - the url of the delegate resource
aRequest - the portlet request
aResponse - the portlet response

log

public void log(java.lang.String aMessage)
Logs the given message in the portal's log file, usually an event log. The name and type of the log file are specific the portal container.
Parameters:
aMessage - the message to log
See Also:
log(String,Throwable)

log

public void log(java.lang.String aMessage,
                java.lang.Throwable aCause)
Logs the given message, cause, and a stack trace in the portal's log.
Parameters:
aMessage - the message to log
aCause - the cause for logging
See Also:
log(String)

getMajorVersion

public int getMajorVersion()
Returns the major version of the Portlet API that this portlet container supports.
Returns:
the major version
See Also:
getMinorVersion()

getMinorVersion

public int getMinorVersion()
Returns the minor version of the Portlet API that this portlet container supports.
Returns:
the minor version
See Also:
getMajorVersion()

getContainerInfo

public java.lang.String getContainerInfo()
Returns the name and version of the portlet container which the portlet is running in. The form of the returned string is servername/versionnumer. For the Jetspeed Framework may return the string Apache Jetspeed/1.2.
Returns:
the string containing at least name and version number