org.jasig.portal
Class RDBMPortletPreferencesStore

java.lang.Object
  extended by org.jasig.portal.RDBMPortletPreferencesStore
All Implemented Interfaces:
IPortletPreferencesStore

public class RDBMPortletPreferencesStore
extends java.lang.Object
implements IPortletPreferencesStore

An implementation of IPortletPreferencesStore which uses a RDBM data source to persist the data.

Version:
$Revision: 1.11.2.2 $
Author:
Eric Dalquist edalquist@unicon.net

Field Summary
private static org.apache.commons.logging.Log log
           
private static java.lang.String PREFIX
           
private static java.lang.String READ_ONLY_FALSE
           
private static java.lang.String READ_ONLY_TRUE
           
private static java.lang.String UP_PORTLET_PREFERENCE_VALUE
           
 
Constructor Summary
RDBMPortletPreferencesStore()
           
 
Method Summary
 void deletePortletPreferencesByInstance(int userId, int layoutId, java.lang.String chanDescId)
          Removes portlet preferences for the specific user and instance of a portlet.
 void deletePortletPreferencesByUser(int userId)
          Removes all portlet preferences stored for the specified user.
 org.apache.pluto.om.common.PreferenceSet getDefinitionPreferences(int chanId)
          Gets the definition level preferences for the specified channel into an implementation of the PreferenceSet interface.
 org.apache.pluto.om.common.PreferenceSet getEntityPreferences(int userId, int layoutId, java.lang.String chanDescId)
          Gets the enitity level preferences for the specified channel into an implementation of the PreferenceSet interface.
 void setDefinitionPreferences(int chanId, org.apache.pluto.om.common.PreferenceSet prefs)
          Stores the definition level preferences described by the PreferenceSet interface.
 void setEntityPreferences(int userId, int layoutId, java.lang.String chanDescId, org.apache.pluto.om.common.PreferenceSet prefs)
          Stores the entity level preferences described by the PreferenceSet interface.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static final org.apache.commons.logging.Log log

READ_ONLY_TRUE

private static final java.lang.String READ_ONLY_TRUE
See Also:
Constant Field Values

READ_ONLY_FALSE

private static final java.lang.String READ_ONLY_FALSE
See Also:
Constant Field Values

UP_PORTLET_PREFERENCE_VALUE

private static final java.lang.String UP_PORTLET_PREFERENCE_VALUE
See Also:
Constant Field Values

PREFIX

private static final java.lang.String PREFIX
See Also:
Constant Field Values
Constructor Detail

RDBMPortletPreferencesStore

public RDBMPortletPreferencesStore()
Method Detail

setDefinitionPreferences

public void setDefinitionPreferences(int chanId,
                                     org.apache.pluto.om.common.PreferenceSet prefs)
                              throws java.lang.Exception
Description copied from interface: IPortletPreferencesStore
Stores the definition level preferences described by the PreferenceSet interface. The store operation is atomic, it can be assumed that if the method completes with no exception being thrown the store was successfull. If an exception is thrown it can be assumed that no changes were made to the underlying persistant store.

Specified by:
setDefinitionPreferences in interface IPortletPreferencesStore
Parameters:
chanId - The id of the channel to store the preferences for.
prefs - The PreferenceSet which describes the data to store.
Throws:
java.lang.Exception - If any error occurs while storing the data.
See Also:
IPortletPreferencesStore.setDefinitionPreferences(int, org.apache.pluto.om.common.PreferenceSet)

getDefinitionPreferences

public org.apache.pluto.om.common.PreferenceSet getDefinitionPreferences(int chanId)
                                                                  throws java.lang.Exception
Description copied from interface: IPortletPreferencesStore
Gets the definition level preferences for the specified channel into an implementation of the PreferenceSet interface.

Specified by:
getDefinitionPreferences in interface IPortletPreferencesStore
Parameters:
chanId - The id of the channel to get the preferences for.
Returns:
An implementation of the PreferenceSet interface that contains the preferences.
Throws:
java.lang.Exception - If any error occurs while getting the data.
See Also:
IPortletPreferencesStore.getDefinitionPreferences(int)

setEntityPreferences

public void setEntityPreferences(int userId,
                                 int layoutId,
                                 java.lang.String chanDescId,
                                 org.apache.pluto.om.common.PreferenceSet prefs)
                          throws java.lang.Exception
Description copied from interface: IPortletPreferencesStore
Stores the entity level preferences described by the PreferenceSet interface. The store operation is atomic, it can be assumed that if the method completes with no exception being thrown the store was successfull. If an exception is thrown it can be assumed that no changes were made to the underlying persistant store. The userId, layoutId and structId make up the primary key for the preferences.

Specified by:
setEntityPreferences in interface IPortletPreferencesStore
Parameters:
userId - The id of the user to store the preferences for.
layoutId - The layout fragment id to store the preferences for.
chanDescId - The structure id to store the preferences for.
prefs - The PreferenceSet which describes the data to store.
Throws:
java.lang.Exception - If any error occurs while storing the data.
See Also:
IPortletPreferencesStore.setEntityPreferences(int, int, String, org.apache.pluto.om.common.PreferenceSet)

getEntityPreferences

public org.apache.pluto.om.common.PreferenceSet getEntityPreferences(int userId,
                                                                     int layoutId,
                                                                     java.lang.String chanDescId)
                                                              throws java.lang.Exception
Description copied from interface: IPortletPreferencesStore
Gets the enitity level preferences for the specified channel into an implementation of the PreferenceSet interface. The userId, layoutId and structId make up the primary key for the preferences.

Specified by:
getEntityPreferences in interface IPortletPreferencesStore
Parameters:
userId - The id of the user to get the preferences for.
layoutId - The layout fragment id to get the preferences for.
chanDescId - The structure id to get the preferences for.
Returns:
An implementation of the PreferenceSet interface that contains the preferences.
Throws:
java.lang.Exception - If any error occurs while getting the data.
See Also:
IPortletPreferencesStore.getEntityPreferences(int, int, java.lang.String)

deletePortletPreferencesByUser

public void deletePortletPreferencesByUser(int userId)
                                    throws java.lang.Exception
Description copied from interface: IPortletPreferencesStore
Removes all portlet preferences stored for the specified user.

Specified by:
deletePortletPreferencesByUser in interface IPortletPreferencesStore
Parameters:
userId - The id of the user to remove the preferences for.
Throws:
java.lang.Exception - If any error occurs while removing the data.
See Also:
IPortletPreferencesStore.deletePortletPreferencesByUser(int)

deletePortletPreferencesByInstance

public void deletePortletPreferencesByInstance(int userId,
                                               int layoutId,
                                               java.lang.String chanDescId)
                                        throws java.lang.Exception
Description copied from interface: IPortletPreferencesStore
Removes portlet preferences for the specific user and instance of a portlet.

Specified by:
deletePortletPreferencesByInstance in interface IPortletPreferencesStore
Parameters:
userId - The id of the user to remove the preferences for.
layoutId - The layout fragment id to remove the preferences for.
chanDescId - The structure id to remove the preferences for.
Throws:
java.lang.Exception - If any error occurs while removing the data.
See Also:
IPortletPreferencesStore.deletePortletPreferencesByInstance(int, int, String)