Oracle® Webcenter Interaction Development Kit 10.3.0.0.0

Plumtree.Remote.Portlet Namespace

Provides classes and interfaces for building portlets for Oracle WebCenter Interaction.

Namespace hierarchy

Classes

Class Description
AggregationMode AggregationMode is a flag that tells the portal how this portlet is currently displayed in the portal (with other portlets or alone on the page). AggregationMode is a type-safe enumeration, so instances of the class can be compared using identity equality.
Alignment A type-safe enumeration that identifies the alignment of a portlet. Instances of this type can be compared using identity equality.
CommunityAccessLevel CommunityAccessLevel enumerates the access levels that a user can have for a particular Community. CommunityAccessLevel is a type-safe enumeration, so instances of the class can be compared using identity equality.
CredentialSource CredentialSource is an enumeration of the different locations in the IPortletRequest headers where credentials can be passed. CredentialSource is a type-safe enumeration, so instances of the class can be compared using identity equality.
EncryptionType EncryptionType is an enumeration of the different types of encryption that can be used by a portlet. EncryptionType is a type-safe enumeration, so instances of the class can be compared using identity equality.
GenericRequestWrapper  
HostedDisplayMode HostedDisplayMode is an enumeration of the ways a gatewayed page can be displayed by the portal (with the portal banner and footer or without). HostedDisplayMode is a type-safe enumeration, so instances of the class can be compared using identity equality.
NotGatewayedException Thrown when a user attempts to access API functionality that is only available when the request is gatewayed.
NotInCommunityException Thrown when a user attempts to access Community-related API functionality that is only available when the portlet is displayed in a Community page.
NotInRequestException Thrown when a user attempts to access settings that the administrator has not configured to be sent to the portlet.
PortletContextFactory PortletContextFactory is a class that has one static factory method to generate IPortletContext objects, the entry point for portlets to send and receive information from the portal.
PortletMode PortletMode is an enumerated type that identifies the mode the portal is using to generate portlet content. PortletMode is a type-safe enumeration, so instances of the class can be compared using identity equality.
ProtocolNotSupportedException Thrown when a user attempts to access functionality in a version of the portal that does not support it.
SettingType A type-safe enumeration of the different types of settings that can be used by a portlet. Instances of this type can be compared using identity equality.
UserInterface UserInterface is an enumeration that describes the different kinds of user interfaces (for example, phone, PDA or Web browser) that can be used in the portal. UserInterface is a type-safe enumeration, so instances of the class can be compared using identity equality.

Interfaces

Interface Description
ICredentialProvider ICredentialProvider is an interface for retrieving the username and password for a backend application that were sent to the portlet in the headers. It provides methods for configuring the credential location and type if a config file cannot be used. In most cases a config file should be used, and the values in the config file will override anything set via the Set methods in this interface.

Using ICredentialProvider allows portlet developers to retrieve the username and password from the headers in 3 lines of code, no matter how that information is being passed. It also allows the following modifications without ever having to change your code or re-compile: change the method of passing credentials, switch from basic auth to a preference value, upgrade to the latest portal version, make use of the Credential Vault, change encryption methods, or even change the encryption key. Only settings in the Web.config file need to be updated.

The following sample code shows how easy it is to retrieve the username and password when using a config file:
// Get an ICredentialProvider instance from the IPortletContext
IPortletContext portletContext = PortletContextFactory.CreatePortletContext(req, resp);
ICredentialProvider cProvider = portletContext.GetCredentialProvider();

// get the username and password
String username = cProvider.GetUsername();
String password = cProvider.GetPassword();

Even in the case where a config file cannot be used, using ICredentialProvider can still save developers from having to deal with cipher utilities.

Extracting the username and password when they are passed from the Credential Vault still requires very few lines of code, as illustrated in the following example code:
// Get an ICredentialProvider instance from the IPortletContext
IPortletContext portletContext = PortletContextFactory.CreatePortletContext(req, resp);
ICredentialProvider cProvider = portletContext.GetCredentialProvider();

// set the RSA private key used to decrypt the password; this value could
// normally be read from the config file
cProvider.SetPrivateKey(rsaPrivateKeyString);

// get the username and password
String username = cProvider.GetUsername();
String password = cProvider.GetPassword();

When working with a 5.0.x portal without the Credential Vault, it is necessary to define all the parameters that indicate how the credentials are being passed to the portlet.

The following example code retrieves the username and password when they are being sent as user prefs with the parameter names DCTMUsername and DCTMPassword, and the password is RC2 encrypted:
// Get an ICredentialProvider instance from the IPortletContext
IPortletContext portletContext = PortletContextFactory.CreatePortletContext(req, resp);
ICredentialProvider cProvider = portletContext.GetCredentialProvider();

// set the header type and parameter names; these values could normally be
// read from the config file
cProvider.SetCredentialSettingType(SettingType.User);
cProvider.SetUsernameParameterName("DCTMUsername");
cProvider.SetPasswordParameterName("DCTMPassword");

// set the encryption type and key; these values could normally be
// read from the config file
cProvider.SetCredentialEncryptionType(EncryptionType.RC2);
cProvider.SetPrivateKey("skiroblbpauwyryrhfvnmsl");

// get the username and password
String username = cProvider.GetUsername();
String password = cProvider.GetPassword();
ICredentialSetter ICredentialSetter is an interface for encrypting and setting the username and password for a backend application on a PortletResponse. It provides methods for configuring the credential location and type if a config file cannot be used. In most cases a config file should be used, and the values in the config file will override anything set via the Set methods in the interface.

This interface does not work with the Credential Vault. It is intended for use by portlets that communicate with older portal versions and encrypt and decrypt their password settings. Using ICredentialSetter allows portlet developers to set the username and password in the response headers in 3 lines of code, no matter how that information is being written. It also allows the following modifications without ever having to change your code or re-compile: change the method of passing credentials, upgrade to the latest portal version, change encryption methods, or even change the encryption key. Only settings in the Web.config file need to be updated.

The following example code shows how easy it is to write the username and password when using a config file:
// Get an ICredentialSetter instance from the IPortletContext
IPortletContext portletContext = PortletContextFactory.CreatePortletContext(req, resp);
ICredentialSetter cSetter = portletContext.GetCredentialSetter();

// set the username and password
cSetter.SetUsername(username);
cSetter.SetPassword(password);

Even in the case where a config file cannot be used, using ICredentialSetter can still save developers from having to deal with cipher utilities. It is necessary to configure all the parameters that indicate how the credentials are being passed to the portlet.

The following example code writes the username and password when they are being stored as user prefs with the parameter names DCTMUsername and DCTMPassword, and the password is RC2 encrypted:
// Get an ICredentialSetter instance from the IPortletContext
IPortletContext portletContext = PortletContextFactory.CreatePortletContext(req, resp);
ICredentialSetter cSetter = portletContext.GetCredentialSetter();

// set the header type and parameter names; these values could normally be
// read from the config file
cSetter.SetCredentialSettingType(SettingType.User);
cSetter.SetUsernameParameterName("DCTMUsername");
cSetter.SetPasswordParameterName("DCTMPassword");

// set the encryption type and key; these values could normally be
// read from the config file
cSetter.SetCredentialEncryptionType(EncryptionType.RC2);
cSetter.SetPrivateKey("skiroblbpauwyryrhfvnmsl");

// set the username and password
cSetter.SetUsername(username);
cSetter.SetPassword(password);
IGenericRequest
IPortletContext IPortletContext is the root interface for retrieving information from the portal. Generally, the portlet obtains an IPortletContext by using the PortletContextFactory.CreatePortletContext() static factory method.
IPortletRequest 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().
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().
IPortletUser IPortletUser represents the current user requesting the portlet. Generally, a portlet can obtain an IPortletUser from IPortletContext.GetUser().