org.jasig.portlet.newsreader.dao
Class HibernateNewsStore

java.lang.Object
  extended by org.springframework.dao.support.DaoSupport
      extended by org.springframework.orm.hibernate3.support.HibernateDaoSupport
          extended by org.jasig.portlet.newsreader.dao.HibernateNewsStore
All Implemented Interfaces:
NewsStore, org.springframework.beans.factory.InitializingBean

public class HibernateNewsStore
extends org.springframework.orm.hibernate3.support.HibernateDaoSupport
implements NewsStore

HibernateNewsStore provides a hibernate implementation of the NewsStore.

Author:
Anthony Colebourne, Jen Bourey

Field Summary
 
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
 
Constructor Summary
HibernateNewsStore()
           
 
Method Summary
 void deleteNewsConfiguration(NewsConfiguration configuration)
          Remove a news configuration from the data store
 void deleteNewsDefinition(PredefinedNewsDefinition definition)
          Remove a news definition from the data store.
 java.util.List<PredefinedNewsDefinition> getHiddenPredefinedNewsDefinitions(java.lang.Long setId, java.util.Set<java.lang.String> roles)
          Retrieve a list of hidden predefined newss for this portlet subscription and role.
 NewsConfiguration getNewsConfiguration(java.lang.Long id)
          Retrieve a news configuration.
 java.util.List<NewsConfiguration> getNewsConfigurations(java.lang.String subscribeId)
          Retrieve a list of news configurations for the specified portlet.
 NewsDefinition getNewsDefinition(java.lang.Long id)
          Retrieve a news definition.
 NewsSet getNewsSet(java.lang.Long id)
           
 NewsSet getNewsSet(java.lang.String userId, java.lang.String setName)
           
 java.util.List<NewsSet> getNewsSetsForUser(java.lang.String userId)
           
 java.util.List<PredefinedNewsConfiguration> getPredefinedNewsConfigurations()
          Retrieve a list of all pre-defined news configurations.
 java.util.List<PredefinedNewsConfiguration> getPredefinedNewsConfigurations(java.lang.Long setId, boolean visibleOnly)
          Retrieve a list of pre-defined news configurations for the specified portlet.
 PredefinedNewsDefinition getPredefinedNewsDefinition(java.lang.Long id)
          Retrieve a pre-defined news definition
 java.util.List<UserDefinedNewsConfiguration> getUserDefinedNewsConfigurations(java.lang.Long setId, boolean visibleOnly)
          Retrieve a list of user-defined news configurations for the specified portlet.
 java.util.List<java.lang.String> getUserRoles()
          Get a list of all user roles currently in use.
 void initNews(NewsSet set, java.util.Set<java.lang.String> roles)
          Initialize news subscriptions for a given portlet subscription and role.
 void storeNewsConfiguration(NewsConfiguration configuration)
          Save or update a news configuration.
 void storeNewsDefinition(NewsDefinition listing)
          Save or update a news definition.
 void storeNewsSet(NewsSet set)
           
 
Methods inherited from class org.springframework.orm.hibernate3.support.HibernateDaoSupport
checkDaoConfig, convertHibernateAccessException, createHibernateTemplate, getHibernateTemplate, getSession, getSession, getSessionFactory, releaseSession, setHibernateTemplate, setSessionFactory
 
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
 

Constructor Detail

HibernateNewsStore

public HibernateNewsStore()
Method Detail

storeNewsDefinition

public void storeNewsDefinition(NewsDefinition listing)
Description copied from interface: NewsStore
Save or update a news definition.

Specified by:
storeNewsDefinition in interface NewsStore
Parameters:
listing - NewsDefinition to be persisted

storeNewsConfiguration

public void storeNewsConfiguration(NewsConfiguration configuration)
Description copied from interface: NewsStore
Save or update a news configuration.

Specified by:
storeNewsConfiguration in interface NewsStore
Parameters:
configuration - NewsConfiguration to be persisted

getNewsConfigurations

public java.util.List<NewsConfiguration> getNewsConfigurations(java.lang.String subscribeId)
Description copied from interface: NewsStore
Retrieve a list of news configurations for the specified portlet.

Specified by:
getNewsConfigurations in interface NewsStore
Parameters:
subscribeId - unique ID for this portlet subscription
Returns:

getUserDefinedNewsConfigurations

public java.util.List<UserDefinedNewsConfiguration> getUserDefinedNewsConfigurations(java.lang.Long setId,
                                                                                     boolean visibleOnly)
Description copied from interface: NewsStore
Retrieve a list of user-defined news configurations for the specified portlet.

Specified by:
getUserDefinedNewsConfigurations in interface NewsStore
visibleOnly - true to retrieve only non-hidden news configurations, false otherwise
Returns:

getPredefinedNewsConfigurations

public java.util.List<PredefinedNewsConfiguration> getPredefinedNewsConfigurations(java.lang.Long setId,
                                                                                   boolean visibleOnly)
Description copied from interface: NewsStore
Retrieve a list of pre-defined news configurations for the specified portlet.

Specified by:
getPredefinedNewsConfigurations in interface NewsStore
visibleOnly - true to retrieve only non-hidden news configurations, false otherwise
Returns:

getPredefinedNewsConfigurations

public java.util.List<PredefinedNewsConfiguration> getPredefinedNewsConfigurations()
Description copied from interface: NewsStore
Retrieve a list of all pre-defined news configurations.

Specified by:
getPredefinedNewsConfigurations in interface NewsStore
Returns:

getHiddenPredefinedNewsDefinitions

public java.util.List<PredefinedNewsDefinition> getHiddenPredefinedNewsDefinitions(java.lang.Long setId,
                                                                                   java.util.Set<java.lang.String> roles)
Description copied from interface: NewsStore
Retrieve a list of hidden predefined newss for this portlet subscription and role.

Specified by:
getHiddenPredefinedNewsDefinitions in interface NewsStore
roles - user role to use to find default newss
Returns:

initNews

public void initNews(NewsSet set,
                     java.util.Set<java.lang.String> roles)
Description copied from interface: NewsStore
Initialize news subscriptions for a given portlet subscription and role.

Specified by:
initNews in interface NewsStore
roles - user roles to use to find default newss

getPredefinedNewsDefinition

public PredefinedNewsDefinition getPredefinedNewsDefinition(java.lang.Long id)
Description copied from interface: NewsStore
Retrieve a pre-defined news definition

Specified by:
getPredefinedNewsDefinition in interface NewsStore
Parameters:
id - ID of the news definition to be retrieved
Returns:

getNewsDefinition

public NewsDefinition getNewsDefinition(java.lang.Long id)
Description copied from interface: NewsStore
Retrieve a news definition.

Specified by:
getNewsDefinition in interface NewsStore
Parameters:
id - ID of the news definition to be retrieved
Returns:

getNewsConfiguration

public NewsConfiguration getNewsConfiguration(java.lang.Long id)
Description copied from interface: NewsStore
Retrieve a news configuration.

Specified by:
getNewsConfiguration in interface NewsStore
Parameters:
id - ID of the news configuration to be retrieved
Returns:

deleteNewsConfiguration

public void deleteNewsConfiguration(NewsConfiguration configuration)
Description copied from interface: NewsStore
Remove a news configuration from the data store

Specified by:
deleteNewsConfiguration in interface NewsStore
Parameters:
configuration - configuration to be removed

deleteNewsDefinition

public void deleteNewsDefinition(PredefinedNewsDefinition definition)
Description copied from interface: NewsStore
Remove a news definition from the data store.

Specified by:
deleteNewsDefinition in interface NewsStore
Parameters:
definition - definition to be removed

getUserRoles

public java.util.List<java.lang.String> getUserRoles()
Description copied from interface: NewsStore
Get a list of all user roles currently in use.

Specified by:
getUserRoles in interface NewsStore
Returns:

getNewsSet

public NewsSet getNewsSet(java.lang.Long id)
Specified by:
getNewsSet in interface NewsStore

getNewsSetsForUser

public java.util.List<NewsSet> getNewsSetsForUser(java.lang.String userId)
Specified by:
getNewsSetsForUser in interface NewsStore

storeNewsSet

public void storeNewsSet(NewsSet set)
Specified by:
storeNewsSet in interface NewsStore

getNewsSet

public NewsSet getNewsSet(java.lang.String userId,
                          java.lang.String setName)
Specified by:
getNewsSet in interface NewsStore


Copyright © 2009-2011 Jasig. All Rights Reserved.