Overview | Package | Class | Tree | Deprecated | Index | Help
| Copyright © 2000, 2009, Oracle and/or its affiliates. All rights reserved.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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:

- Specify the name of the implementation class in `WEB-INF/netuix-config.xml` by setting the `preferences-spi-class element`. This SPI will replace the default SPI for the webapp.
- Register an SPI via Factory class specified in this interface. This SPI will replace the default SPI or the webapp level SPI set in `WEB-INF/netuix-config.xml`.
- Register an SPI at the request time, by setting a request attribute named `com.bea.portlet.prefs.spi.IPreferenceStore` with value equal to the name of the SPI. This SPI will only be used for the current request.

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..

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000, 2009, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates.
Other names may be trademarks of their respective owners.