org.apache.jetspeed.components.portletpreferences
Class PortletPreferencesServiceImpl

java.lang.Object
  extended by org.springframework.dao.support.DaoSupport
      extended by org.springframework.orm.ojb.support.PersistenceBrokerDaoSupport
          extended by org.apache.jetspeed.components.portletpreferences.PortletPreferencesServiceImpl
All Implemented Interfaces:
PortletPreferencesProvider, org.apache.pluto.container.PortletPreferencesService, org.springframework.beans.factory.InitializingBean

public class PortletPreferencesServiceImpl
extends org.springframework.orm.ojb.support.PersistenceBrokerDaoSupport
implements PortletPreferencesProvider

Pluto Preferences Service. This service is designed to work with an existing JPA service, in anticipation of deprecating OJB for JPA

Version:
$Id: $
Author:
David Sean Taylor

Field Summary
protected static java.lang.String APPLICATION_NAME
           
protected static java.lang.String DISCRIMINATOR_ENTITY
           
protected static java.lang.String DISCRIMINATOR_PORTLET
           
protected static java.lang.String DISCRIMINATOR_USER
           
protected static java.lang.String DTYPE
           
protected static java.lang.String EMPTY_VALUE
           
protected static java.lang.String ENTITY_ID
           
protected static java.lang.String KEY_SEPARATOR
           
protected static java.lang.String PORTLET_NAME
           
protected static java.lang.String USER_NAME
           
 
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
 
Constructor Summary
PortletPreferencesServiceImpl(PortletFactory portletFactory, JetspeedCache preferenceCache)
           
PortletPreferencesServiceImpl(PortletFactory portletFactory, JetspeedCache preferenceCache, java.util.List<java.lang.String> apps, boolean preloadEntities)
           
 
Method Summary
 void destroy()
           
 java.util.Map<java.lang.String,org.apache.pluto.container.PortletPreference> getDefaultPreferences(org.apache.pluto.container.PortletWindow pw, javax.portlet.PortletRequest request)
          PLUTO: PortletPreferencesService
 java.util.Set<java.lang.String> getPortletWindowIds(PortletDefinition portletdefinition)
           
 javax.portlet.PreferencesValidator getPreferencesValidator(org.apache.pluto.container.om.portlet.PortletDefinition pd)
          PLUTO: PortletPreferencesService
 java.util.Map<java.lang.String,org.apache.pluto.container.PortletPreference> getStoredPreferences(org.apache.pluto.container.PortletWindow pw, javax.portlet.PortletRequest request)
          PLUTO: PortletPreferencesService
 java.util.Set<java.lang.String> getUserNames(PortletDefinition portletdefinition, java.lang.String windowId)
           
 java.util.Map<java.lang.String,org.apache.pluto.container.PortletPreference> getUserPreferences(PortletDefinition portletdefinition, java.lang.String windowId, java.lang.String userName)
           
 void init()
           
 boolean isUseEntityPreferences()
           
 void preload()
           
 void preloadApplicationPreferences(java.lang.String portletApplicationName)
          Jetspeed: PortletPreferencesProvider
 void preloadUserPreferences()
          Jetspeed: PortletPreferencesProvider
 void removeDefaults(PortletApplication app)
          Jetspeed: PortletPreferencesProvider
 void removeDefaults(PortletDefinition pd)
          Jetspeed: PortletPreferencesProvider
 void removeDefaults(PortletDefinition pd, java.lang.String preferenceName)
           
 java.util.Map<java.lang.String,org.apache.pluto.container.PortletPreference> retrieveDefaultPreferences(PortletDefinition pd)
          Jetspeed: PortletPreferencesProvider
 java.util.Map<java.lang.String,org.apache.pluto.container.PortletPreference> retrieveEntityPreferences(PortletWindow window)
          Jetspeed: PortletPreferencesProvider
 java.util.Map<java.lang.String,org.apache.pluto.container.PortletPreference> retrieveUserPreferences(PortletWindow window, java.lang.String userName)
          Jetspeed: PortletPreferencesProvider
 void setUseEntityPreferences(boolean useEntityPreferences)
           
 void store(org.apache.pluto.container.PortletWindow pw, javax.portlet.PortletRequest request, java.util.Map<java.lang.String,org.apache.pluto.container.PortletPreference> map)
          PLUTO: PortletPreferencesService
 void storeDefaults(PortletApplication app)
          Jetspeed: PortletPreferencesProvider
 void storeDefaults(PortletDefinition pd, Preference preference)
           
 void storeDefaults(PortletDefinition pd, Preferences newprefs)
          Jetspeed: PortletPreferencesProvider
 void storeEntityPreferences(java.util.Map<java.lang.String,org.apache.pluto.container.PortletPreference> map, PortletWindow window)
          Jetspeed: PortletPreferencesProvider
 void storePortletPreference(PortletDefinition portletdefinition, java.lang.String windowId, java.lang.String userName, java.util.Map<java.lang.String,org.apache.pluto.container.PortletPreference> map)
           
 void storePortletPreference(java.lang.String appName, java.lang.String portletName, java.lang.String windowId, java.lang.String userName, java.util.Map<java.lang.String,org.apache.pluto.container.PortletPreference> map)
           
 void storeUserPreferences(java.util.Map<java.lang.String,org.apache.pluto.container.PortletPreference> map, PortletWindow window, java.lang.String userName)
          Jetspeed: PortletPreferencesProvider
 
Methods inherited from class org.springframework.orm.ojb.support.PersistenceBrokerDaoSupport
checkDaoConfig, convertOjbAccessException, createPersistenceBrokerTemplate, getJcdAlias, getPersistenceBroker, getPersistenceBrokerTemplate, releasePersistenceBroker, setJcdAlias, setPersistenceBrokerTemplate
 
Methods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDao
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DISCRIMINATOR_PORTLET

protected static final java.lang.String DISCRIMINATOR_PORTLET
See Also:
Constant Field Values

DISCRIMINATOR_ENTITY

protected static final java.lang.String DISCRIMINATOR_ENTITY
See Also:
Constant Field Values

DISCRIMINATOR_USER

protected static final java.lang.String DISCRIMINATOR_USER
See Also:
Constant Field Values

KEY_SEPARATOR

protected static final java.lang.String KEY_SEPARATOR
See Also:
Constant Field Values

EMPTY_VALUE

protected static final java.lang.String EMPTY_VALUE
See Also:
Constant Field Values

DTYPE

protected static final java.lang.String DTYPE
See Also:
Constant Field Values

APPLICATION_NAME

protected static final java.lang.String APPLICATION_NAME
See Also:
Constant Field Values

PORTLET_NAME

protected static final java.lang.String PORTLET_NAME
See Also:
Constant Field Values

ENTITY_ID

protected static final java.lang.String ENTITY_ID
See Also:
Constant Field Values

USER_NAME

protected static final java.lang.String USER_NAME
See Also:
Constant Field Values
Constructor Detail

PortletPreferencesServiceImpl

public PortletPreferencesServiceImpl(PortletFactory portletFactory,
                                     JetspeedCache preferenceCache)
                              throws java.lang.ClassNotFoundException
Throws:
java.lang.ClassNotFoundException

PortletPreferencesServiceImpl

public PortletPreferencesServiceImpl(PortletFactory portletFactory,
                                     JetspeedCache preferenceCache,
                                     java.util.List<java.lang.String> apps,
                                     boolean preloadEntities)
                              throws java.lang.ClassNotFoundException
Throws:
java.lang.ClassNotFoundException
Method Detail

isUseEntityPreferences

public boolean isUseEntityPreferences()

setUseEntityPreferences

public void setUseEntityPreferences(boolean useEntityPreferences)

init

public void init()

destroy

public void destroy()

getDefaultPreferences

public java.util.Map<java.lang.String,org.apache.pluto.container.PortletPreference> getDefaultPreferences(org.apache.pluto.container.PortletWindow pw,
                                                                                                          javax.portlet.PortletRequest request)
                                                                                                   throws org.apache.pluto.container.PortletContainerException
PLUTO: PortletPreferencesService

Specified by:
getDefaultPreferences in interface org.apache.pluto.container.PortletPreferencesService
Throws:
org.apache.pluto.container.PortletContainerException

getStoredPreferences

public java.util.Map<java.lang.String,org.apache.pluto.container.PortletPreference> getStoredPreferences(org.apache.pluto.container.PortletWindow pw,
                                                                                                         javax.portlet.PortletRequest request)
                                                                                                  throws org.apache.pluto.container.PortletContainerException
PLUTO: PortletPreferencesService

Specified by:
getStoredPreferences in interface org.apache.pluto.container.PortletPreferencesService
Throws:
org.apache.pluto.container.PortletContainerException

retrieveUserPreferences

public java.util.Map<java.lang.String,org.apache.pluto.container.PortletPreference> retrieveUserPreferences(PortletWindow window,
                                                                                                            java.lang.String userName)
Jetspeed: PortletPreferencesProvider

Specified by:
retrieveUserPreferences in interface PortletPreferencesProvider
Parameters:
window -
userName -
Returns:
Throws:
org.apache.pluto.container.PortletContainerException

store

public void store(org.apache.pluto.container.PortletWindow pw,
                  javax.portlet.PortletRequest request,
                  java.util.Map<java.lang.String,org.apache.pluto.container.PortletPreference> map)
           throws org.apache.pluto.container.PortletContainerException
PLUTO: PortletPreferencesService

Specified by:
store in interface org.apache.pluto.container.PortletPreferencesService
Throws:
org.apache.pluto.container.PortletContainerException

storeUserPreferences

public void storeUserPreferences(java.util.Map<java.lang.String,org.apache.pluto.container.PortletPreference> map,
                                 PortletWindow window,
                                 java.lang.String userName)
                          throws PreferencesException
Jetspeed: PortletPreferencesProvider

Specified by:
storeUserPreferences in interface PortletPreferencesProvider
Throws:
PreferencesException

getPreferencesValidator

public javax.portlet.PreferencesValidator getPreferencesValidator(org.apache.pluto.container.om.portlet.PortletDefinition pd)
                                                           throws javax.portlet.ValidatorException
PLUTO: PortletPreferencesService

Specified by:
getPreferencesValidator in interface org.apache.pluto.container.PortletPreferencesService
Throws:
javax.portlet.ValidatorException

preloadApplicationPreferences

public void preloadApplicationPreferences(java.lang.String portletApplicationName)
Jetspeed: PortletPreferencesProvider

Specified by:
preloadApplicationPreferences in interface PortletPreferencesProvider

preloadUserPreferences

public void preloadUserPreferences()
Jetspeed: PortletPreferencesProvider

Specified by:
preloadUserPreferences in interface PortletPreferencesProvider

preload

public void preload()
             throws java.lang.Exception
Specified by:
preload in interface PortletPreferencesProvider
Throws:
java.lang.Exception

storeDefaults

public void storeDefaults(PortletApplication app)
Jetspeed: PortletPreferencesProvider

Specified by:
storeDefaults in interface PortletPreferencesProvider

storeDefaults

public void storeDefaults(PortletDefinition pd,
                          Preferences newprefs)
Jetspeed: PortletPreferencesProvider

Specified by:
storeDefaults in interface PortletPreferencesProvider

storeDefaults

public void storeDefaults(PortletDefinition pd,
                          Preference preference)
Specified by:
storeDefaults in interface PortletPreferencesProvider

retrieveEntityPreferences

public java.util.Map<java.lang.String,org.apache.pluto.container.PortletPreference> retrieveEntityPreferences(PortletWindow window)
Jetspeed: PortletPreferencesProvider

Specified by:
retrieveEntityPreferences in interface PortletPreferencesProvider

storeEntityPreferences

public void storeEntityPreferences(java.util.Map<java.lang.String,org.apache.pluto.container.PortletPreference> map,
                                   PortletWindow window)
                            throws PreferencesException
Jetspeed: PortletPreferencesProvider

Specified by:
storeEntityPreferences in interface PortletPreferencesProvider
Throws:
PreferencesException

removeDefaults

public void removeDefaults(PortletDefinition pd)
Jetspeed: PortletPreferencesProvider

Specified by:
removeDefaults in interface PortletPreferencesProvider

removeDefaults

public void removeDefaults(PortletDefinition pd,
                           java.lang.String preferenceName)
Specified by:
removeDefaults in interface PortletPreferencesProvider

removeDefaults

public void removeDefaults(PortletApplication app)
Jetspeed: PortletPreferencesProvider

Specified by:
removeDefaults in interface PortletPreferencesProvider

retrieveDefaultPreferences

public java.util.Map<java.lang.String,org.apache.pluto.container.PortletPreference> retrieveDefaultPreferences(PortletDefinition pd)
Jetspeed: PortletPreferencesProvider

Specified by:
retrieveDefaultPreferences in interface PortletPreferencesProvider

getPortletWindowIds

public java.util.Set<java.lang.String> getPortletWindowIds(PortletDefinition portletdefinition)
Specified by:
getPortletWindowIds in interface PortletPreferencesProvider

getUserPreferences

public java.util.Map<java.lang.String,org.apache.pluto.container.PortletPreference> getUserPreferences(PortletDefinition portletdefinition,
                                                                                                       java.lang.String windowId,
                                                                                                       java.lang.String userName)
Specified by:
getUserPreferences in interface PortletPreferencesProvider

getUserNames

public java.util.Set<java.lang.String> getUserNames(PortletDefinition portletdefinition,
                                                    java.lang.String windowId)
Specified by:
getUserNames in interface PortletPreferencesProvider

storePortletPreference

public void storePortletPreference(PortletDefinition portletdefinition,
                                   java.lang.String windowId,
                                   java.lang.String userName,
                                   java.util.Map<java.lang.String,org.apache.pluto.container.PortletPreference> map)
Specified by:
storePortletPreference in interface PortletPreferencesProvider

storePortletPreference

public void storePortletPreference(java.lang.String appName,
                                   java.lang.String portletName,
                                   java.lang.String windowId,
                                   java.lang.String userName,
                                   java.util.Map<java.lang.String,org.apache.pluto.container.PortletPreference> map)
Specified by:
storePortletPreference in interface PortletPreferencesProvider


Copyright © 1999-2011 The Apache Software Foundation. All Rights Reserved.