com.bea.portlet.prefs.spi
Interface IPreferenceStore


public interface IPreferenceStore

An SPI for persisting portlet preferences.

Portal web apps and/or portlets must register an implementation to be able to access/store preferences. The portal framework registers a default implementation that manages preferences persistently in the database. Applications can use any of the following ways to register a different implementation:

The portal framework does not synchronize calls to the SPI. Depending on the datastore used to manage preferences, the SPI must synchronize the implementation.


Nested Class Summary
static class IPreferenceStore.Factory
          A factory to register an SPI.
 
Field Summary
static String PREFERENCE_STORE_PROVIDER
          Name of the provider class.
 
Method Summary
 Map getPreferences(PortletPreferencesId uniqueId, javax.servlet.http.HttpServletRequest httpRequest)
          Returns preferences for the given uniqueId.
 void remove(PortletPreferencesId uniqueId, javax.servlet.http.HttpServletRequest httpRequest)
          Remove all preferences for a portlet with the given unique ID.
 void store(PortletPreferencesId uniqueId, Map preferences, javax.servlet.http.HttpServletRequest httpRequest)
          Stores the preferences to the underlying persistence store.
 boolean supportsPreferences(PortletPreferencesId uniqueId, javax.servlet.http.HttpServletRequest httpRequest)
          Returns true if the given portlet supports portlet preferences.
 

Field Detail

PREFERENCE_STORE_PROVIDER

static final String PREFERENCE_STORE_PROVIDER

Name of the provider class.

Method Detail

getPreferences

Map getPreferences(PortletPreferencesId uniqueId,
                   javax.servlet.http.HttpServletRequest httpRequest)
                   throws PreferenceStoreException

Returns preferences for the given uniqueId. The returned java.util.Map contains names of values of preferences, and may be empty if there are no preferences for the given unique identifier.

Parameters
uniqueId - a unique ID
httpRequest - HTTP request (if any)
Returns
map of preferences
Throws
PreferenceStoreException - if there was an error retrieving all or some of the preferences.

store

void store(PortletPreferencesId uniqueId,
           Map preferences,
           javax.servlet.http.HttpServletRequest httpRequest)
           throws PreferenceStoreException

Stores the preferences to the underlying persistence store.

Parameters
uniqueId - a unique ID
preferences - map of preferences
Throws
PreferenceStoreException - if there was an error storing all or some of the preferences.

remove

void remove(PortletPreferencesId uniqueId,
            javax.servlet.http.HttpServletRequest httpRequest)
            throws PreferenceStoreException

Remove all preferences for a portlet with the given unique ID.

Parameters
uniqueId - a unique ID
Throws
PreferenceStoreException - if there was an error retrieving all or some of the preferences.

supportsPreferences

boolean supportsPreferences(PortletPreferencesId uniqueId,
                            javax.servlet.http.HttpServletRequest httpRequest)
                            throws PreferenceStoreException

Returns true if the given portlet supports portlet preferences.

Parameters
uniqueId - a unique ID
httpRequest - HTTP request
Returns
true if the given portlet supports portlet preferences.
Throws
PreferenceStoreException - if there was an error determining if the given portlet supports portlet preferences..


Copyright © 2011, Oracle. All rights reserved.