com.oracle.producer.spi
Interface IPortletDataContext

All Superinterfaces
IBaseDataContext

public interface IPortletDataContext
extends IBaseDataContext

Object used to access all information about a portlet instance. The SPI implementation is responsible for the creation and implementation of IPortletDataContext objects. Once created, the PortletDataContext object will be used for the duration of the request. Multiple simultaneous requests accessing the same portlet instance are possible, and the SPI implementation is responsible for handling any synchronization issues.

The getHandle() and getState() methods must always return the current correct values for the portlet handle and portlet state. For example, if the portlet instance was created on the request with handle "1" and subsequently had preferences stored which created a new portlet instance, the new portlet handle and state should be returned in subsequent calls to getHandle() and getState().


Nested Class Summary
static class IPortletDataContext.StateChangeFlag
           
 
Method Summary
 void cloneInstance()
          Create an explicit clone of this portlet instance.
 String getPOPHandle()
          Returns the POP handle for this portlet instance.
 String[] getPreferenceResetValues(String preferenceKey)
          Gets the preference values to use when resetting the specified preference.
 Map<String,String[]> getPreferences()
          Gets a map of the preference values for the portlet instance.
 IPortletDataContext.StateChangeFlag getStateChangeFlag()
          Gets the state change flag for the portlet, to indicate whether setting preferences should force a portlet clone.
 boolean isNewInstance()
          Returns true if the current portlet instance is not the same instance that the object was created with, due to an explicit clone caused by the cloneInstance() method, or an implicit clone caused by storePreferences().
 boolean isPreferenceReadOnly(String preferenceKey)
          Returns true if the specified preference is read-only and cannot be modified by the user.
 void storePreferences(Map<String,String[]> preferences)
          Stores a new set of preference values for the portlet.
 
Methods inherited from interface com.oracle.producer.spi.IBaseDataContext
getHandle, getState
 

Method Detail

getPOPHandle

String getPOPHandle()
Returns the POP handle for this portlet instance.


getStateChangeFlag

IPortletDataContext.StateChangeFlag getStateChangeFlag()
Gets the state change flag for the portlet, to indicate whether setting preferences should force a portlet clone.


getPreferences

Map<String,String[]> getPreferences()
Gets a map of the preference values for the portlet instance. If the portlet instance has no preferences, an empty map should be returned, not null. The map should be unmodifiable.


getPreferenceResetValues

String[] getPreferenceResetValues(String preferenceKey)
Gets the preference values to use when resetting the specified preference. null may be returned to indicate that the specified preference should be removed on a reset.


isPreferenceReadOnly

boolean isPreferenceReadOnly(String preferenceKey)
Returns true if the specified preference is read-only and cannot be modified by the user.


storePreferences

void storePreferences(Map<String,String[]> preferences)
                      throws WSRPFaultException
Stores a new set of preference values for the portlet. If the portlet's state change flag is cloneBeforeWrite, the implementation is responsible for cloning the portlet instance, and subsequent calls on this object to getHandle() and getState() must return the appropriate values for the newly cloned instance, and isNewInstance() must return true. If the portlet's state change flag is readOnly, an exception must be thrown. If the portlet's state change flag is readWrite, the implementation must change the preference values on the current portlet instance and must not create a clone.

Throws
WSRPFaultException - if the operation failed for any reason. The exception can be created using the IConfigurationContext.createWsrpFaultException() method.

cloneInstance

void cloneInstance()
                   throws WSRPFaultException
Create an explicit clone of this portlet instance. The implementation is responsible for creating preference information for the portlet instance. Subsequent calls on this object to getHandle() and getState() must return the appropriate values for the newly cloned instance, and isNewInstance() must return true.

Throws
WSRPFaultException - if the operation failed for any reason. The exception can be created using the IConfigurationContext.createWsrpFaultException() method.

isNewInstance

boolean isNewInstance()
Returns true if the current portlet instance is not the same instance that the object was created with, due to an explicit clone caused by the cloneInstance() method, or an implicit clone caused by storePreferences(). This method is used to determine whether the producer should return the WSRP PortletContext object on the SOAP response to indicate to the consumer that the portlet was cloned.



Copyright © 2011, Oracle. All rights reserved.