com.plumtree.remote.portlet
Interface IPortletRequest

All Superinterfaces:
IGenericRequest

public interface IPortletRequest
extends IGenericRequest

IPortletRequest represents the HTTP request sent from the portal to the portlet. All of the parameters that are sent from the portal to the portlet are accessible from IPortletRequest (some user-specific parameters are accessible from IPortletUser). Generally, a portlet can obtain an IPortletRequest from IPortletContext.getRequest().

See Also:
IPortletContext.getRequest

Method Summary
 AggregationMode getAggregationMode()
          Returns the current AggregationMode for the portlet.
 Alignment getAlignment()
          Returns the alignment of this portlet.
 java.lang.String getBasicAuthPassword()
          Returns the password from the HTTP Authorization header in the web request.
 java.lang.String getBasicAuthUsername()
          Returns the username from the HTTP Authorization header in the web request.
 int getClassID()
          Returns the class ID.
 int getCommunityID()
          Returns the ID of the Community in which the portlet is currently displayed.
 java.lang.String getEncryptedSettingValue(SettingType type, java.lang.String name, javax.crypto.Cipher crypto)
          Gives the value for any encrypted portal preference associated with this portlet.
 java.lang.String getGatewayConfigValue(java.lang.String valueName)
          Returns the requested value from the CSP-Gateway-Specific-Config header.
 java.net.URL getHostPageURI()
          Returns the URI for the portal page in which the portlet is currently displayed.
 java.lang.String getHostPageURLQueryString()
          Gets the query string portion of the URL that was used to access this portal's hosting page.
 java.net.URL getImageServerURI()
          Returns the URI for the portal Image Server.
 int getPageID()
          Returns the ID of the portal page on which the portlet is currently displayed.
 java.lang.String getPortalUUID()
          Returns the portal UUID.
 int getPortletID()
          Returns the Portlet ID for the current portlet.
 PortletMode getPortletMode()
          Returns a PortletMode object to tell the client what mode the portlet is running in.
 java.lang.String getProtocolVersion()
          Returns the current version of the protocol being used by the portal to communicate with this portlet.
 java.net.URL getReturnURI()
          Returns the URI for the portal page to return to when done.
 java.util.Map getSettingCollection(SettingType type)
          Returns a map of all settings of the referenced setting type associated with this portlet.
 java.lang.String getSettingValue(SettingType type, java.lang.String name)
          Gives the value for any portal preference associated with this portlet.
 java.net.URL getStylesheetURI()
          Returns the URI for the stylesheet currently being used by the portal user.
 int getSubPortalID()
          Returns the ID of the subportal that the accessing user belongs to.
 java.util.TimeZone getTimeZone()
          Returns a TimeZone object representing the end user's time zone.
 UserInterface getUserInterface()
          Returns a UserInterface object to tell the client what type of device is being used to browse the portal (for example, phone, PDA, or standard Web browser).
 boolean hasBasicAuth()
          Returns whether the request has basic auth.
 boolean hasTimeZone()
          Returns a boolean indicating whether the time zone is available in the request headers.
 boolean isGatewayed()
          Checks if the request is gatewayed.
 boolean isInCommunity()
          Checks if the portlet is currently displayed in a Community page.
 
Methods inherited from interface com.plumtree.remote.portlet.IGenericRequest
getLoginToken, getRemoteAPIEndpoint
 

Method Detail

getSettingValue

public java.lang.String getSettingValue(SettingType type,
                                        java.lang.String name)
Gives the value for any portal preference associated with this portlet. This method replaces the Get*Setting() methods in the 3.5 GDK.

Parameters:
type - the type of setting (Admin, Community, CommunityPortlet, Portlet, Session, User, or UserInfo)
name - the name of the setting
Returns:
the value of the setting and null if the setting was not sent
Throws:
NotGatewayedException - if the request is not gatewayed

getEncryptedSettingValue

public java.lang.String getEncryptedSettingValue(SettingType type,
                                                 java.lang.String name,
                                                 javax.crypto.Cipher crypto)
                                          throws CryptoException
Gives the value for any encrypted portal preference associated with this portlet. Uses the cryptographer supplied by the client to unencrypt the setting value from the portal. For example:

IPortletRequest portletRequest = .....;//get IPortletRequest.
javax.crypto.Cipher cipher = javax.crypto.Cipher.getInstance("DES"); //use DES algorithm.
String decryptedValue = portletRequest.getEncryptedSettingValue(SettingType.Admin, "password", cipher);
Note: The same cipher should be used for both encryption and decryption.
See the javax.crypto.Cipher javadocs for the list of available algorithms.

Parameters:
type - the type of setting (Admin, Community, CommunityPortlet, Portlet, Session, User or UserInfo)
name - the name of the setting
crypto - the cryptographer that can decode the setting value
Returns:
the decoded setting value
Throws:
NotGatewayedException - if the request is not gatewayed
CryptoException - if there is an error decrypting the setting value

getSettingCollection

public java.util.Map getSettingCollection(SettingType type)
Returns a map of all settings of the referenced setting type associated with this portlet.

Parameters:
type - the type of setting (Admin, Community, CommunityPortlet, Portlet, Session, User, or UserInfo)
Returns:
a map of settings
Throws:
NotGatewayedException - if the request is not gatewayed

getUserInterface

public UserInterface getUserInterface()
Returns a UserInterface object to tell the client what type of device is being used to browse the portal (for example, phone, PDA, or standard Web browser).

Returns:
a UserInterface object
Throws:
NotGatewayedException - if the request is not gatewayed
ProtocolNotSupportedException - if the portal does not support the device type

getPortletMode

public PortletMode getPortletMode()
Returns a PortletMode object to tell the client what mode the portlet is running in. The portlet mode indicates whether the portlet should display standard content or a summary for small-screened mobile devices. The mode also indicates if the portlet is syndicated (running asynchronously).

Returns:
a PortletMode instance or null if not found in the request
Throws:
NotGatewayedException - if the request is not gatewayed

hasTimeZone

public boolean hasTimeZone()
Returns a boolean indicating whether the time zone is available in the request headers.

Returns:
true if the time zone is available, false otherwise
Throws:
NotGatewayedException - if the request is not gatewayed

getTimeZone

public java.util.TimeZone getTimeZone()
                               throws NotInRequestException
Returns a TimeZone object representing the end user's time zone.

Returns:
a TimeZone object
Throws:
NotGatewayedException - if the request is not gatewayed
ProtocolNotSupportedException - if the portal does not support this feature
NotInRequestException

getPortletID

public int getPortletID()
Returns the Portlet ID for the current portlet.

Returns:
the Portlet ID
Throws:
NotGatewayedException - if the request is not gatewayed

getGatewayConfigValue

public java.lang.String getGatewayConfigValue(java.lang.String valueName)
                                       throws NotInRequestException
Returns the requested value from the CSP-Gateway-Specific-Config header.

Parameters:
valueName - the name of the requested header value
Returns:
the requested value from the header
Throws:
NotGatewayedException - if the request is not gatewayed
NotInRequestException - if there is nothing in the header with the requested name

getPortalUUID

public java.lang.String getPortalUUID()
Returns the portal UUID.

Returns:
the portal UUID
Throws:
NotGatewayedException - if the request is not gatewayed
ProtocolNotSupportedException - if used with a version of the portal that does not support this feature

getClassID

public int getClassID()
Returns the class ID.

Returns:
the class ID
Throws:
NotGatewayedException - if the request is not gatewayed
ProtocolNotSupportedException - if used with a version of the portal that does not support this feature

getPageID

public int getPageID()
              throws NotInRequestException
Returns the ID of the portal page on which the portlet is currently displayed. This is a new feature in portal version 5.0; this method throws ProtocolNotSupportedException when used with any prior version of the portal. The administrator must configure the portal to send the Page ID to the portlet.

Returns:
the page ID
Throws:
NotGatewayedException - if the request is not gatewayed
ProtocolNotSupportedException - if used with version of the portal earlier than 5.0
NotInRequestException - if the administrator has not configured the portal to send the Page ID to this portlet

getCommunityID

public int getCommunityID()
Returns the ID of the Community in which the portlet is currently displayed.

Returns:
the Community ID
Throws:
NotGatewayedException - if the request is not gatewayed
NotInCommunityException - if the portlet is not currently displayed on a Community page

getReturnURI

public java.net.URL getReturnURI()
Returns the URI for the portal page to return to when done. This URI is typically used when a portlet's Preferences page is finished processing; the portlet should always return the user to the portal page. Note: You can also use IPortletResponse.returnToPortal to return the user to the portal page.

Returns:
the URI for the portal page, or null if the portlet is run as a job
Throws:
NotGatewayedException - if the request is not gatewayed

getHostPageURI

public java.net.URL getHostPageURI()
Returns the URI for the portal page in which the portlet is currently displayed.

Returns:
the URI for the portal page, or null if the portlet is run as a job
Throws:
NotGatewayedException - if the request is not gatewayed

getStylesheetURI

public java.net.URL getStylesheetURI()
Returns the URI for the stylesheet currently being used by the portal user.

Returns:
the URI for the stylesheet, or null if the portlet is run as a job
Throws:
NotGatewayedException - if the request is not gatewayed

getImageServerURI

public java.net.URL getImageServerURI()
Returns the URI for the portal Image Server.

Returns:
the URI for the Image Server, or null if the portlet is run as a job
Throws:
NotGatewayedException - if the request is not gatewayed

getAggregationMode

public AggregationMode getAggregationMode()
Returns the current AggregationMode for the portlet. The aggregation mode indicates whether the portlet is alone on the portal page or displayed with other portlets.

Returns:
the AggregationMode
Throws:
NotGatewayedException - if the request is not gatewayed
ProtocolNotSupportedException - if used with a version of the portal that does not support this feature

getProtocolVersion

public java.lang.String getProtocolVersion()
Returns the current version of the protocol being used by the portal to communicate with this portlet.

Note: The version will be returned in the en-us locale, i.e. '1.3'.

Returns:
the protocol version
Throws:
NotGatewayedException - if the request is not gatewayed

isGatewayed

public boolean isGatewayed()
Checks if the request is gatewayed.

Returns:
true if the request is gatewayed and false otherwise

getSubPortalID

public int getSubPortalID()
                   throws NotInRequestException
Returns the ID of the subportal that the accessing user belongs to.

Returns:
the subportal ID
Throws:
NotGatewayedException - if the request is not gatewayed
ProtocolNotSupportedException - if used with a version of the portal that does not support this feature
NotInRequestException - if the administrator has not configured the portal to send the subportal ID to this portlet

isInCommunity

public boolean isInCommunity()
Checks if the portlet is currently displayed in a Community page.

Returns:
true if the portlet is displayed in a Community page and false otherwise
Throws:
NotGatewayedException - if the request is not gatewayed

getBasicAuthUsername

public java.lang.String getBasicAuthUsername()
                                      throws NotInRequestException
Returns the username from the HTTP Authorization header in the web request.

Returns:
the basic authentication username
Throws:
NotInRequestException - if no Basic Auth username is present in the web request

getBasicAuthPassword

public java.lang.String getBasicAuthPassword()
                                      throws NotInRequestException
Returns the password from the HTTP Authorization header in the web request.

Returns:
the basic authentication password
Throws:
NotInRequestException - if no Basic Auth password is present in the web request

hasBasicAuth

public boolean hasBasicAuth()
Returns whether the request has basic auth. Throws no exceptions as the auth may be present on a non-gatewayed request.

Returns:
true if and only if this request includes basic authorization information

getAlignment

public Alignment getAlignment()
Returns the alignment of this portlet.

Returns:
the alignment
Throws:
NotGatewayedException - if the request is not gatewayed
ProtocolNotSupportedException - if used with a version of the portal that does not support this feature

getHostPageURLQueryString

public java.lang.String getHostPageURLQueryString()
Gets the query string portion of the URL that was used to access this portal's hosting page.

Returns:
the query string
Throws:
NotGatewayedException - if the request is not gatewayed
ProtocolNotSupportedException - if used with a version of the portal that does not support this feature


For additional information on the Oracle® WebCenter Interaction Development Kit, including tutorials, blogs, code samples and more, see the Oracle Technology Network (http://www.oracle.com/technology/index.html).

Copyright ©2010 Oracle® Corporation. All Rights Reserved.