org.jasig.portal.channel.dao.jpa
Class JpaChannelDefinitionDao

java.lang.Object
  extended by org.jasig.portal.channel.dao.jpa.JpaChannelDefinitionDao
All Implemented Interfaces:
IChannelDefinitionDao

@Repository
public class JpaChannelDefinitionDao
extends Object
implements IChannelDefinitionDao

JPA/Hibernate implementation of IChannelDefinitionDao. This DAO handles channel definitions, their parameters, and their localization strings.

Author:
Jen Bourey, jbourey@unicon.net

Constructor Summary
JpaChannelDefinitionDao()
           
 
Method Summary
 IChannelDefinition createChannelDefinition(IChannelType channelType, String fname, String clazz, String name, String title)
          Creates, initializes and persists a new IChannelDefinition based on the specified parameters
 void deleteChannelDefinition(IChannelDefinition definition)
          Removes the specified IChannelDefinition from the persistent store.
 IChannelDefinition getChannelDefinition(int id)
          Get a IChannelDefinition for the specified id.
 IChannelDefinition getChannelDefinition(String fname)
          Get a IChannelDefinition for the specified functional name
 IChannelDefinition getChannelDefinitionByName(String name)
          Get a IChannelDefinition for the specified channel name.
 List<IChannelDefinition> getChannelDefinitions()
           
 void setEntityManager(EntityManager entityManager)
           
 IChannelDefinition updateChannelDefinition(IChannelDefinition definition)
          Persists changes to a IChannelDefinition.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JpaChannelDefinitionDao

public JpaChannelDefinitionDao()
Method Detail

setEntityManager

public void setEntityManager(EntityManager entityManager)
Parameters:
entityManager - the entityManager to set

createChannelDefinition

@Transactional
public IChannelDefinition createChannelDefinition(IChannelType channelType,
                                                                String fname,
                                                                String clazz,
                                                                String name,
                                                                String title)
Description copied from interface: IChannelDefinitionDao
Creates, initializes and persists a new IChannelDefinition based on the specified parameters

Specified by:
createChannelDefinition in interface IChannelDefinitionDao
Parameters:
channelType - The type the channel is based on
fname - A unique, human-readable key for the channel. Must match the regular expression FunctionalNameType.VALID_FNAME_PATTERN
clazz - A fully qualified Java class name that implements the IChannel interface. This is the class the portal will execute when rendering the channel.
name - The display name for the channel, this is shown in administrative UIs
title - The title used on portal generated chrome
Returns:
A newly created, initialized and persisted IChannelDefinition

deleteChannelDefinition

@Transactional
public void deleteChannelDefinition(IChannelDefinition definition)
Description copied from interface: IChannelDefinitionDao
Removes the specified IChannelDefinition from the persistent store.

Specified by:
deleteChannelDefinition in interface IChannelDefinitionDao
Parameters:
definition - The definition to remove.

getChannelDefinitions

public List<IChannelDefinition> getChannelDefinitions()
Specified by:
getChannelDefinitions in interface IChannelDefinitionDao
Returns:
A List of all persisted IChannelDefinitions

getChannelDefinition

public IChannelDefinition getChannelDefinition(int id)
Description copied from interface: IChannelDefinitionDao
Get a IChannelDefinition for the specified id.

Specified by:
getChannelDefinition in interface IChannelDefinitionDao
Parameters:
id - The id to get the definition for.
Returns:
The channel definition for the id, null if no definition exists for the id.

getChannelDefinition

public IChannelDefinition getChannelDefinition(String fname)
Description copied from interface: IChannelDefinitionDao
Get a IChannelDefinition for the specified functional name

Specified by:
getChannelDefinition in interface IChannelDefinitionDao
Parameters:
fname - The fname to get the definition for.
Returns:
The channel definition for the fname, null if no definition exists for the fname.

getChannelDefinitionByName

public IChannelDefinition getChannelDefinitionByName(String name)
Description copied from interface: IChannelDefinitionDao
Get a IChannelDefinition for the specified channel name.

Specified by:
getChannelDefinitionByName in interface IChannelDefinitionDao
Parameters:
name - The name to get the definition for.
Returns:
THe channel definition for the name, null if no definition exists for the name.

updateChannelDefinition

@Transactional
public IChannelDefinition updateChannelDefinition(IChannelDefinition definition)
Description copied from interface: IChannelDefinitionDao
Persists changes to a IChannelDefinition.

Specified by:
updateChannelDefinition in interface IChannelDefinitionDao
Parameters:
definition - The channel definition to store the changes for


Copyright © 2010 Jasig. All Rights Reserved.