***  This class is subject to change   ***

com.sas.portal.portlet
Interface PortletContext

All Superinterfaces:
All Known Implementing Classes:

public interface PortletContext
extends java.io.Serializable

Common storage area assigned to each portlet instance. For each unique user session that interacts with a given portlet, a separate instance of a PortletContext is created and stored in the user session.

Since:
09/02/2002

Method Summary
 Set getAttibuteKeys()
          Get the set of known attribute keys
 Object getAttribute(Object key)
          Get the attribute that is mapped to the given key
 Map getAttributes()
          Get the set of known attributes
 HttpSession getHttpSession()
          Get the HTTPsession attached to this Portlet Context
 String getId()
          Get ID for the portlet context
 String getMode()
          get the mode for the portlet.
 String getOriginatingHost()
          Get the originating host stored in the PortletContext.
 int getOriginatingPort()
          Get the originating port stored in the PortletContext.
 String getOriginatingWebContext()
          Get the originating web context stored in the PortletContext.
 String getPageEntityKey()
          Get the page entity key stored in this PortletContext
 String getPortletEntityKey()
          Get the portlet entity key stored in this PortletContext
 String getProtocol()
          Get the protocol stored in the PortletContext.
 com.sas.services.session.SessionContextInterface getSessionContext()
          Get the session context attached to the httpSession stored in this PortletContext.
 LocalizationContext newLocalizationContext(String bundleName, Locale locale)
          Get the localizationContext for the locale and bundlename passed in
 Object removeAttribute(Object key)
          Remove the attribute that is mapped to the given key
 void resetMode()
          Reset the mode of the portlet to the default mode.
 String resolveURLForActionName(String name)
          This will look up all actions stored in the PortletInfo that is attached to this PortletContext.
 void setAttribute(Object key, Object value)
          Set the attribute for a given key to map to the provided value
 void setPortletInfo(PortletInfo info)
          Set the PortletInfo stored in this PortletContext
 boolean wasInEditMode()
          Return if the portlet was in edit mode.
 void wasInEditMode(boolean flag)
          Sets the flag to say that the portlet was in edit mode.
 

Method Detail

getId

public String getId()
Get ID for the portlet context
Returns:
java.lang.String - the portlet context ID

getHttpSession

public HttpSession getHttpSession()
Get the HTTPsession attached to this Portlet Context
Returns:
HttpSession - the session attached to this portlet context

setAttribute

public void setAttribute(Object key,
                         Object value)
Set the attribute for a given key to map to the provided value
Parameters:
Object - the key
Object - the value to map to that key

getAttribute

public Object getAttribute(Object key)
Get the attribute that is mapped to the given key
Returns:
Object - the value that is mapped to the provided key

removeAttribute

public Object removeAttribute(Object key)
Remove the attribute that is mapped to the given key
Returns:
Object - the value that was previously mapped to the provided key

getAttibuteKeys

public Set getAttibuteKeys()
Get the set of known attribute keys
Returns:
Set - the set of attribute keys that can be used with getAttribute

getAttributes

public Map getAttributes()
Get the set of known attributes
Returns:
Map - the set of known attributes

setPortletInfo

public void setPortletInfo(PortletInfo info)
Set the PortletInfo stored in this PortletContext
Parameters:
PortletInfo - the PortletInfo stored in this PortletContext

getSessionContext

public com.sas.services.session.SessionContextInterface getSessionContext()
Get the session context attached to the httpSession stored in this PortletContext. It will create a new session if one does not exist.
Returns:
java.lang.String - will return the created or found session context

getPageEntityKey

public String getPageEntityKey()
Get the page entity key stored in this PortletContext
Returns:
java.lang.String - the Page entity key stored in this PortletContext

getPortletEntityKey

public String getPortletEntityKey()
Get the portlet entity key stored in this PortletContext
Returns:
java.lang.String - the Portlet entity key stored in this PortletContext

newLocalizationContext

public LocalizationContext newLocalizationContext(String bundleName,
                                                  Locale locale)
                                           throws IOException
Get the localizationContext for the locale and bundlename passed in
Parameters:
bundleName - the name of the resource bundle
locale - the locale of the resource bundle
Returns:
LocalizationContext - the localization context mapping to the locale and bundle passed in
Throws:
IOException - any IOException thrown while looking up the proper resource bundle

getProtocol

public String getProtocol()
Get the protocol stored in the PortletContext. Support for Remote Portlets
Returns:
java.lang.String - the protocol stored in the PortletContext

getOriginatingHost

public String getOriginatingHost()
Get the originating host stored in the PortletContext. Support for Remote Portlets
Returns:
java.lang.String - the originating host stored in the PortletContext

getOriginatingWebContext

public String getOriginatingWebContext()
Get the originating web context stored in the PortletContext. Support for Remote Portlets
Returns:
java.lang.String - the originating web context stored in the PortletContext

getOriginatingPort

public int getOriginatingPort()
Get the originating port stored in the PortletContext. Support for Remote Portlets
Returns:
java.lang.int - the originating port stored in the PortletContext

resolveURLForActionName

public String resolveURLForActionName(String name)
This will look up all actions stored in the PortletInfo that is attached to this PortletContext. It will then return the URL first PortletActionInfoInterface object whose name matches the name passed in.
Returns:
java.lang.String - the URL for the action name passed in

getMode

public String getMode()
get the mode for the portlet. This is to support state changes for portlets. Choices: PortletConstants.DISPLAY_MODE PortletConstants.EDIT_MODE PortletConstants.NORENDER_MODE
Returns:
java.lang.String - the current mode for the portlet

resetMode

public void resetMode()
Reset the mode of the portlet to the default mode. Only valid if the portlet is not in NORENDER_MODE

wasInEditMode

public void wasInEditMode(boolean flag)
Sets the flag to say that the portlet was in edit mode.
Parameters:
flag - boolean - Was the portlet in edit mode.

wasInEditMode

public boolean wasInEditMode()
Return if the portlet was in edit mode.
Returns:
boolean Was the portlet in edit mode

***  This class is subject to change   ***




Copyright © 2005 SAS Institute Inc. All Rights Reserved.
javadoc generated Fri, 10 Feb 2006 17:05:12