com.plumtree.remote.portlet
Interface IPortletResponse


public interface IPortletResponse

IPortletResponse represents the HTTP response sent from the portlet to the portal. All of the parameters that are sent from the portlet to the portal are set on IPortletResponse. Generally, a portlet can obtain an IPortletResponse from IPortletContext.getResponse().

See Also:
IPortletContext.getResponse

Method Summary
 void removeAllSettingValues(SettingType type)
          Removes all settings of a specific type associated with this portlet from the portal.
 void removeSettingValue(SettingType type, java.lang.String name)
          Removes a setting from the portal.
 void returnToPortal()
          Redirects the user to the portal page on which they started.
 void setEncryptedSettingValue(SettingType type, java.lang.String name, java.lang.String newValue, javax.crypto.Cipher crypto)
          Uses the cryptographer supplied by the client to encrypt and set a new value for a setting.
 void setHostedDisplayMode(HostedDisplayMode mode)
          Tells the portal how this page should be displayed (with or without a banner).
 void setSettingValue(SettingType type, java.lang.String name, java.lang.String newValue)
          Sets a new value for any portal preference associated with this portlet.
 void setTitle(java.lang.String title)
          Sets this portlet's title in the portlet title bar on the portal page.
 

Method Detail

setHostedDisplayMode

public void setHostedDisplayMode(HostedDisplayMode mode)
Tells the portal how this page should be displayed (with or without a banner). This method is used for pages associated with a portlet (usually Preference pages). Note: This method can only be called once per page.

Parameters:
mode - the requested display mode
Throws:
NotGatewayedException - if the request is not gatewayed
ProtocolNotSupportedException - if used with a version of the portal that does not support this feature
java.lang.IllegalStateException - if the method is called more than once per page

setTitle

public void setTitle(java.lang.String title)
Sets this portlet's title in the portlet title bar on the portal page. If this method is not used, the portlet title bar will display the default name of the portlet set by the administrator. Note: This method can only be called once per page.

Parameters:
title - the title to be displayed for the portlet
Throws:
NotGatewayedException - if the request is not gatewayed
ProtocolNotSupportedException - if used with a version of the portal that does not support this feature
java.lang.IllegalStateException - if the method is called more than once per page

returnToPortal

public void returnToPortal()
Redirects the user to the portal page on which they started. This method is usually used when a user has clicked through to a Preferences page and clicks "Done" or "Cancel." Note: This method will end the processing of the page and immediately redirect the user back to the portal page.

Throws:
NotGatewayedException - if the request is not gatewayed

setSettingValue

public void setSettingValue(SettingType type,
                            java.lang.String name,
                            java.lang.String newValue)
Sets a new value for any portal preference associated with this portlet. This method replaces the Set*Setting() methods in the 3.5 GDK. Note: UserInfo settings cannot be set by a portlet.

Parameters:
type - the type of setting (Admin, Community, CommunityPortlet, Portlet, Session or User)
name - the name of the setting
newValue - the new value to set for this setting
Throws:
NotGatewayedException - if the request is not gatewayed
java.lang.IllegalArgumentException - if the user tries to set a UserInfo setting

setEncryptedSettingValue

public void setEncryptedSettingValue(SettingType type,
                                     java.lang.String name,
                                     java.lang.String newValue,
                                     javax.crypto.Cipher crypto)
                              throws CryptoException
Uses the cryptographer supplied by the client to encrypt and set a new value for a setting. To retrieve an encrypted setting, the portlet must use IPortletRequest.getEncryptedSettingValue() with the same cryptographer. Note: UserInfo settings cannot be set by a ortlet. For example:

IPortletResponse portletResponse = .....;//get IPortletResponse
javax.crypto.Cipher cipher = javax.crypto.Cipher.getInstance("DES");
portletResponse.setEncryptedSettingValue(SettingType.Admin, "password", "secretpassword",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, or User)
name - the name of the setting
newValue - the new value to set for this setting
crypto - the cryptographer that should be used to encrypt the setting value
Throws:
NotGatewayedException - if the request is not gatewayed
java.lang.IllegalArgumentException - if the user tries to set a UserInfo setting
CryptoException - if there is an error encrypting the setting value

removeSettingValue

public void removeSettingValue(SettingType type,
                               java.lang.String name)
Removes a setting from the portal. This method replaces the Remove*Setting() method in the 3.5 GDK. Note: UserInfo settings cannot be removed by a portlet.

Parameters:
type - the type of setting to remove (Admin, Community, CommunityPortlet, Portlet, Session, or User)
name - the name of the setting to remove
Throws:
NotGatewayedException - if the request is not gatewayed
java.lang.IllegalArgumentException - if the user tries to remove a UserInfo setting

removeAllSettingValues

public void removeAllSettingValues(SettingType type)
Removes all settings of a specific type associated with this portlet from the portal. Note: UserInfo settings cannot be removed by a portlet.

Parameters:
type - {the type of settings to remove (Admin, Community, CommunityPortlet, Portlet, Session, or User)
Throws:
NotGatewayedException - if the request is not gatewayed
java.lang.IllegalArgumentException - if the user tries to remove UserInfo settings


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.