Package lumis.portal.channel
Class ChannelDaoJdbc
- java.lang.Object
-
- lumis.portal.channel.ChannelDaoJdbc
-
- All Implemented Interfaces:
IChannelDao
public class ChannelDaoJdbc extends java.lang.Object implements IChannelDao
Dao implementation for channels, based on JDBC.- Since:
- 4.0.0
- Version:
- $Revision: 16545 $ $Date: 2014-10-27 19:43:41 -0200 (Mon, 27 Oct 2014) $
-
-
Constructor Summary
Constructors Constructor Description ChannelDaoJdbc()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(ChannelConfig channelConfig, ITransaction transaction)
Add the channel.void
addCss(java.lang.String channelId, java.lang.String cssId, int position, ITransaction transaction)
Add the CSS of the channel.boolean
checkForChannelPrefix(ChannelConfig channelConfig, ITransaction transaction)
Returns if the channel prefix for local groups is already in use.void
delete(java.lang.String channelId, ITransaction transaction)
Delete the channel.void
deleteCss(java.lang.String channelId, java.lang.String cssId, ITransaction transaction)
Delete the CSS of the channel.java.lang.String
generateRandomChannelPrefix(ITransaction transaction)
Generates a new random channel prefix, that is not already in use.ChannelConfig
get(java.lang.String channelId, ITransaction transaction)
Returns the channel with the specified channelId.int
getChannelTreeCount(java.lang.String rootChannelId, ITransaction transaction)
java.util.List<java.lang.String>
getChannelTreeIds(java.lang.String rootChannelId, boolean includeIgnoredOnImportExportChannels, ITransaction transaction)
Returns the tree identifiers of the root channel identified by the given identifier.java.util.List<java.lang.String>
getChannelTreeIds(java.lang.String rootChannelId, ITransaction transaction)
java.util.List<java.lang.String>
getCssIds(java.lang.String channelId, ITransaction transaction)
Get the ids of the channel's CSS.java.lang.String
getIdByChannelPrefix(ChannelConfig channelConfig, ITransaction transaction)
java.util.Collection<java.lang.String>
getIdsByPageTemplateId(java.lang.String pageTemplateId, ITransaction transaction)
Get the Ids of all channels that have the specified page template as the default page templatejava.util.List<java.lang.String>
getIdsByParentTemplateId(java.lang.String parentTemplateId, ITransaction transaction)
Get the Ids of all channels associated with the specified template id.java.util.List<java.lang.String>
getSubChannelIds(java.lang.String channelId, ITransaction transaction)
Get a list with ids of the sub channels.void
update(ChannelConfig channelConfig, ITransaction transaction)
Update the channel.
-
-
-
Method Detail
-
get
public ChannelConfig get(java.lang.String channelId, ITransaction transaction) throws DaoException, PortalException
Description copied from interface:IChannelDao
Returns the channel with the specified channelId.- Specified by:
get
in interfaceIChannelDao
- Parameters:
channelId
- the channelId.transaction
- the transaction for persistence access.- Returns:
- the channel.
- Throws:
PortalObjectNotFoundException
- if the channel was not found.DaoException
PortalException
-
add
public void add(ChannelConfig channelConfig, ITransaction transaction) throws DaoException, PortalException
Description copied from interface:IChannelDao
Add the channel.- Specified by:
add
in interfaceIChannelDao
- Throws:
DaoException
PortalException
-
update
public void update(ChannelConfig channelConfig, ITransaction transaction) throws DaoException, PortalException
Description copied from interface:IChannelDao
Update the channel.- Specified by:
update
in interfaceIChannelDao
- Throws:
DaoException
PortalException
-
getSubChannelIds
public java.util.List<java.lang.String> getSubChannelIds(java.lang.String channelId, ITransaction transaction) throws DaoException, PortalException
Description copied from interface:IChannelDao
Get a list with ids of the sub channels.- Specified by:
getSubChannelIds
in interfaceIChannelDao
- Returns:
- an array of Strings.
- Throws:
DaoException
PortalException
-
getChannelTreeCount
public int getChannelTreeCount(java.lang.String rootChannelId, ITransaction transaction) throws DaoException, PortalException
- Specified by:
getChannelTreeCount
in interfaceIChannelDao
- Throws:
DaoException
PortalException
-
getChannelTreeIds
public java.util.List<java.lang.String> getChannelTreeIds(java.lang.String rootChannelId, ITransaction transaction) throws DaoException, PortalException
- Specified by:
getChannelTreeIds
in interfaceIChannelDao
- Throws:
DaoException
PortalException
-
getChannelTreeIds
public java.util.List<java.lang.String> getChannelTreeIds(java.lang.String rootChannelId, boolean includeIgnoredOnImportExportChannels, ITransaction transaction) throws DaoException, PortalException
Description copied from interface:IChannelDao
Returns the tree identifiers of the root channel identified by the given identifier.- Specified by:
getChannelTreeIds
in interfaceIChannelDao
- Parameters:
rootChannelId
- the root channel identifier.includeIgnoredOnImportExportChannels
- indicates whether the ignored channels on export and import should be ignored.transaction
- the transaction.- Returns:
- the tree identifiers of the root channel identified by the given identifier.
- Throws:
DaoException
PortalException
-
delete
public void delete(java.lang.String channelId, ITransaction transaction) throws DaoException, PortalException
Description copied from interface:IChannelDao
Delete the channel.- Specified by:
delete
in interfaceIChannelDao
- Throws:
DaoException
PortalException
-
addCss
public void addCss(java.lang.String channelId, java.lang.String cssId, int position, ITransaction transaction) throws DaoException, PortalException
Description copied from interface:IChannelDao
Add the CSS of the channel.- Specified by:
addCss
in interfaceIChannelDao
- Throws:
DaoException
PortalException
-
deleteCss
public void deleteCss(java.lang.String channelId, java.lang.String cssId, ITransaction transaction) throws DaoException, PortalException
Description copied from interface:IChannelDao
Delete the CSS of the channel.- Specified by:
deleteCss
in interfaceIChannelDao
- Throws:
DaoException
PortalException
-
getCssIds
public java.util.List<java.lang.String> getCssIds(java.lang.String channelId, ITransaction transaction) throws DaoException, PortalException
Description copied from interface:IChannelDao
Get the ids of the channel's CSS.- Specified by:
getCssIds
in interfaceIChannelDao
- Returns:
- an array of Strings.
- Throws:
DaoException
PortalException
-
checkForChannelPrefix
public boolean checkForChannelPrefix(ChannelConfig channelConfig, ITransaction transaction) throws DaoException, PortalException
Description copied from interface:IChannelDao
Returns if the channel prefix for local groups is already in use. If channel does not have local groups prefix specified, returns false.- Specified by:
checkForChannelPrefix
in interfaceIChannelDao
- Returns:
- Throws:
PortalException
UnexpectedException
DaoException
-
getIdByChannelPrefix
public java.lang.String getIdByChannelPrefix(ChannelConfig channelConfig, ITransaction transaction) throws DaoException, PortalException
- Specified by:
getIdByChannelPrefix
in interfaceIChannelDao
- Throws:
DaoException
PortalException
-
getIdsByParentTemplateId
public java.util.List<java.lang.String> getIdsByParentTemplateId(java.lang.String parentTemplateId, ITransaction transaction) throws DaoException, PortalException
Description copied from interface:IChannelDao
Get the Ids of all channels associated with the specified template id.- Specified by:
getIdsByParentTemplateId
in interfaceIChannelDao
- Returns:
- Throws:
DaoException
PortalException
-
getIdsByPageTemplateId
public java.util.Collection<java.lang.String> getIdsByPageTemplateId(java.lang.String pageTemplateId, ITransaction transaction) throws DaoException, PortalException
Description copied from interface:IChannelDao
Get the Ids of all channels that have the specified page template as the default page template- Specified by:
getIdsByPageTemplateId
in interfaceIChannelDao
- Returns:
- Throws:
DaoException
PortalException
-
generateRandomChannelPrefix
public java.lang.String generateRandomChannelPrefix(ITransaction transaction) throws PortalException
Description copied from interface:IChannelDao
Generates a new random channel prefix, that is not already in use.- Specified by:
generateRandomChannelPrefix
in interfaceIChannelDao
- Parameters:
transaction
- the transaction for persistence access.- Returns:
- the generated channel prefix.
- Throws:
PortalException
-
-