Package org.jasig.portlet.newsreader.dao
Class HibernateNewsStore
java.lang.Object
org.springframework.dao.support.DaoSupport
org.springframework.orm.hibernate3.support.HibernateDaoSupport
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.
- Since:
- 5.1.1
- Author:
- Anthony Colebourne, Jen Bourey
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteNewsConfiguration(NewsConfiguration configuration) Remove a news configuration from the data storevoiddeleteNewsDefinition(PredefinedNewsDefinition definition) Remove a news definition from the data store.getHiddenPredefinedNewsDefinitions(Long setId, Set<String> roles) Retrieve a list of hidden predefined newss for this portlet subscription and role.Retrieve a news configuration.getNewsConfigurations(String subscribeId) Retrieve a list of news configurations for the specified portlet.Retrieve a news definition.getNewsSet(Long id) getNewsSet.getNewsSet(String userId, String setName) getNewsSet.getNewsSetsForUser(String userId) getNewsSetsForUser.getPredefinedNewsConfigurations.getPredefinedNewsConfigurations(Long setId, boolean visibleOnly) Retrieve a list of pre-defined news configurations for the specified portlet.Retrieve a pre-defined news definitiongetPredefinedNewsDefinitionByName.getUserDefinedNewsConfigurations(Long setId, boolean visibleOnly) Retrieve a list of user-defined news configurations for the specified portlet.getUserRoles.voidInitialize news subscriptions for a given portlet subscription and role.voidstoreNewsConfiguration(NewsConfiguration configuration) Save or update a news configuration.voidstoreNewsDefinition(NewsDefinition listing) Save or update a news definition.voidstoreNewsSet(NewsSet set) storeNewsSet.Methods inherited from class org.springframework.orm.hibernate3.support.HibernateDaoSupport
checkDaoConfig, convertHibernateAccessException, createHibernateTemplate, getHibernateTemplate, getSession, getSession, getSessionFactory, releaseSession, setHibernateTemplate, setSessionFactoryMethods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDao
-
Constructor Details
-
HibernateNewsStore
public HibernateNewsStore()
-
-
Method Details
-
storeNewsDefinition
Save or update a news definition.- Specified by:
storeNewsDefinitionin interfaceNewsStore- Parameters:
listing- NewsDefinition to be persisted
-
storeNewsConfiguration
Save or update a news configuration.- Specified by:
storeNewsConfigurationin interfaceNewsStore- Parameters:
configuration- NewsConfiguration to be persisted
-
getNewsConfigurations
Retrieve a list of news configurations for the specified portlet.- Specified by:
getNewsConfigurationsin interfaceNewsStore- Parameters:
subscribeId- unique ID for this portlet subscription- Returns:
- a
Listobject
-
getUserDefinedNewsConfigurations
public List<UserDefinedNewsConfiguration> getUserDefinedNewsConfigurations(Long setId, boolean visibleOnly) Retrieve a list of user-defined news configurations for the specified portlet.- Specified by:
getUserDefinedNewsConfigurationsin interfaceNewsStore- Parameters:
setId- unique ID for this portlet subscriptionvisibleOnly-trueto retrieve only non-hidden news configurations,falseotherwise- Returns:
- a
Listobject
-
getPredefinedNewsConfigurations
public List<PredefinedNewsConfiguration> getPredefinedNewsConfigurations(Long setId, boolean visibleOnly) Retrieve a list of pre-defined news configurations for the specified portlet.- Specified by:
getPredefinedNewsConfigurationsin interfaceNewsStore- Parameters:
setId- unique ID for this portlet subscriptionvisibleOnly-trueto retrieve only non-hidden news configurations,falseotherwise- Returns:
- a
Listobject
-
getPredefinedNewsConfigurations
getPredefinedNewsConfigurations.
- Specified by:
getPredefinedNewsConfigurationsin interfaceNewsStore- Returns:
- a
Listobject
-
getHiddenPredefinedNewsDefinitions
public List<PredefinedNewsDefinition> getHiddenPredefinedNewsDefinitions(Long setId, Set<String> roles) Retrieve a list of hidden predefined newss for this portlet subscription and role.- Specified by:
getHiddenPredefinedNewsDefinitionsin interfaceNewsStore- Parameters:
setId- unique ID for this portlet subscriptionroles- user role to use to find default newss- Returns:
- a
Listobject
-
initNews
Initialize news subscriptions for a given portlet subscription and role. -
getPredefinedNewsDefinition
Retrieve a pre-defined news definition- Specified by:
getPredefinedNewsDefinitionin interfaceNewsStore- Parameters:
id- ID of the news definition to be retrieved- Returns:
- a
PredefinedNewsDefinitionobject
-
getPredefinedNewsDefinitionByName
getPredefinedNewsDefinitionByName.
- Specified by:
getPredefinedNewsDefinitionByNamein interfaceNewsStore- Parameters:
name- aStringobject- Returns:
- a
PredefinedNewsDefinitionobject
-
getNewsDefinition
Retrieve a news definition.- Specified by:
getNewsDefinitionin interfaceNewsStore- Parameters:
id- ID of the news definition to be retrieved- Returns:
- a
NewsDefinitionobject
-
getNewsConfiguration
Retrieve a news configuration.- Specified by:
getNewsConfigurationin interfaceNewsStore- Parameters:
id- ID of the news configuration to be retrieved- Returns:
- a
NewsConfigurationobject
-
deleteNewsConfiguration
Remove a news configuration from the data store- Specified by:
deleteNewsConfigurationin interfaceNewsStore- Parameters:
configuration- configuration to be removed
-
deleteNewsDefinition
Remove a news definition from the data store.- Specified by:
deleteNewsDefinitionin interfaceNewsStore- Parameters:
definition- definition to be removed
-
getUserRoles
getUserRoles.
- Specified by:
getUserRolesin interfaceNewsStore- Returns:
- a
Listobject
-
getNewsSet
getNewsSet.
- Specified by:
getNewsSetin interfaceNewsStore- Parameters:
id- aLongobject- Returns:
- a
NewsSetobject
-
getNewsSetsForUser
@Cacheable("HibernateNewsStore.newsSetByUser") public List<NewsSet> getNewsSetsForUser(String userId) getNewsSetsForUser.
- Specified by:
getNewsSetsForUserin interfaceNewsStore- Parameters:
userId- aStringobject- Returns:
- a
Listobject
-
storeNewsSet
@CacheEvict(cacheNames={"HibernateNewsStore.newsSetById","HibernateNewsStore.newsSetByUser","HibernateNewsStore.newsSetByUserAndName"}) public void storeNewsSet(NewsSet set) storeNewsSet.
- Specified by:
storeNewsSetin interfaceNewsStore- Parameters:
set- aNewsSetobject
-
getNewsSet
@Cacheable("HibernateNewsStore.newsSetByUserAndName") public NewsSet getNewsSet(String userId, String setName) getNewsSet.
- Specified by:
getNewsSetin interfaceNewsStore- Parameters:
userId- aStringobjectsetName- aStringobject- Returns:
- a
NewsSetobject
-