com.sas.portal.portlet
Interface PortletContext

All Superinterfaces:
java.io.Serializable

@SASScope(value="ALL")
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
abstract  java.util.Set getAttibuteKeys()
          Get the set of known attribute keys
abstract  java.lang.Object getAttribute(java.lang.Object key)
          Get the attribute that is mapped to the given key 22Feb2010 NOTE NOTE NOTE - this is used by non-Portal code... must remain
abstract  java.util.Map getAttributes()
          Get the set of known attributes
abstract  javax.servlet.http.HttpSession getHttpSession()
          Get the HTTPsession attached to this Portlet Context
abstract  java.lang.String getId()
          Get ID for the portlet context
abstract  java.lang.String getMode()
          get the mode for the portlet.
abstract  java.lang.String getOriginatingHost()
          Get the originating host stored in the PortletContext.
abstract  int getOriginatingPort()
          Get the originating port stored in the PortletContext.
abstract  java.lang.String getOriginatingWebContext()
          Get the originating web context stored in the PortletContext.
abstract  java.lang.String getPageEntityKey()
          Get the page entity key stored in this PortletContext
abstract  java.lang.String getPortletEntityKey()
          Get the portlet entity key stored in this PortletContext
abstract  java.lang.String getProtocol()
          Get the protocol stored in the PortletContext.
abstract  com.sas.services.session.SessionContextInterface getSessionContext()
          Get the session context attached to the httpSession stored in this PortletContext.
abstract  LocalizationContext newLocalizationContext(java.lang.String bundleName, java.util.Locale locale)
          Get the localizationContext for the locale and bundlename passed in
abstract  java.lang.Object removeAttribute(java.lang.Object key)
          Remove the attribute that is mapped to the given key 22Feb2010 NOTE NOTE NOTE - this is used by non-Portal code... must remain
abstract  void resetMode()
          Reset the mode of the portlet to the default mode.
abstract  java.lang.String resolveURLForActionName(java.lang.String name)
          This will look up all actions stored in the PortletInfo that is attached to this PortletContext.
abstract  void setAttribute(java.lang.Object key, java.lang.Object value)
          Set the attribute for a given key to map to the provided value
abstract  void setPortletInfo(com.sas.portal.container.deployment.PortletInfo info)
          Set the PortletInfo stored in this PortletContext
abstract  boolean wasInEditMode()
          Return if the portlet was in edit mode.
abstract  void wasInEditMode(boolean flag)
          Sets the flag to say that the portlet was in edit mode.
 

Method Detail

getId

java.lang.String getId()
Get ID for the portlet context

Returns:
java.lang.String - the portlet context ID

getHttpSession

javax.servlet.http.HttpSession getHttpSession()
Get the HTTPsession attached to this Portlet Context

Returns:
HttpSession - the session attached to this portlet context

setAttribute

void setAttribute(java.lang.Object key,
                  java.lang.Object value)
Set the attribute for a given key to map to the provided value

Parameters:
key - the key
value - the value to map to that key

getAttribute

java.lang.Object getAttribute(java.lang.Object key)
Get the attribute that is mapped to the given key 22Feb2010 NOTE NOTE NOTE - this is used by non-Portal code... must remain

Returns:
Object - the value that is mapped to the provided key

removeAttribute

java.lang.Object removeAttribute(java.lang.Object key)
Remove the attribute that is mapped to the given key 22Feb2010 NOTE NOTE NOTE - this is used by non-Portal code... must remain

Returns:
Object - the value that was previously mapped to the provided key

getAttibuteKeys

java.util.Set getAttibuteKeys()
Get the set of known attribute keys

Returns:
Set - the set of attribute keys that can be used with getAttribute

getAttributes

java.util.Map getAttributes()
Get the set of known attributes

Returns:
Map - the set of known attributes

setPortletInfo

void setPortletInfo(com.sas.portal.container.deployment.PortletInfo info)
Set the PortletInfo stored in this PortletContext

Parameters:
info - the PortletInfo stored in this PortletContext

getSessionContext

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. 22Feb2010 NOTE NOTE NOTE - this is used by non-Portal code... must remain

Returns:
java.lang.String - will return the created or found session context

getPageEntityKey

java.lang.String getPageEntityKey()
Get the page entity key stored in this PortletContext

Returns:
java.lang.String - the Page entity key stored in this PortletContext

getPortletEntityKey

java.lang.String getPortletEntityKey()
Get the portlet entity key stored in this PortletContext

Returns:
java.lang.String - the Portlet entity key stored in this PortletContext

newLocalizationContext

LocalizationContext newLocalizationContext(java.lang.String bundleName,
                                           java.util.Locale locale)
                                           throws java.io.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:
java.io.IOException - any IOException thrown while looking up the proper resource bundle

getProtocol

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

Returns:
java.lang.String - the protocol stored in the PortletContext

getOriginatingHost

java.lang.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

java.lang.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

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

java.lang.String resolveURLForActionName(java.lang.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

java.lang.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

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


wasInEditMode

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

boolean wasInEditMode()
Return if the portlet was in edit mode.

Returns:
boolean Was the portlet in edit mode



Copyright © 2009 SAS Institute Inc. All Rights Reserved.