Package lumis.portal.channel
Class ChannelDaoJdbc
- java.lang.Object
-
- lumis.portal.channel.ChannelDaoJdbc
-
- All Implemented Interfaces:
IChannelDao
public class ChannelDaoJdbc extends 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(String channelId, 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(String channelId, ITransaction transaction)
Delete the channel.void
deleteCss(String channelId, String cssId, ITransaction transaction)
Delete the CSS of the channel.String
generateRandomChannelPrefix(ITransaction transaction)
Generates a new random channel prefix, that is not already in use.ChannelConfig
get(String channelId, ITransaction transaction)
Returns the channel with the specified channelId.int
getChannelTreeCount(String rootChannelId, ITransaction transaction)
List<String>
getChannelTreeIds(String rootChannelId, boolean includeIgnoredOnImportExportChannels, ITransaction transaction)
Returns the tree identifiers of the root channel identified by the given identifier.List<String>
getChannelTreeIds(String rootChannelId, ITransaction transaction)
List<String>
getCssIds(String channelId, ITransaction transaction)
Get the ids of the channel's CSS.String
getIdByChannelPrefix(ChannelConfig channelConfig, ITransaction transaction)
Collection<String>
getIdsByPageTemplateId(String pageTemplateId, ITransaction transaction)
Get the Ids of all channels that have the specified page template as the default page templateList<String>
getIdsByParentTemplateId(String parentTemplateId, ITransaction transaction)
Get the Ids of all channels associated with the specified template id.List<String>
getSubChannelIds(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(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 List<String> getSubChannelIds(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(String rootChannelId, ITransaction transaction) throws DaoException, PortalException
- Specified by:
getChannelTreeCount
in interfaceIChannelDao
- Throws:
DaoException
PortalException
-
getChannelTreeIds
public List<String> getChannelTreeIds(String rootChannelId, ITransaction transaction) throws DaoException, PortalException
- Specified by:
getChannelTreeIds
in interfaceIChannelDao
- Throws:
DaoException
PortalException
-
getChannelTreeIds
public List<String> getChannelTreeIds(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(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(String channelId, 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(String channelId, 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 List<String> getCssIds(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 String getIdByChannelPrefix(ChannelConfig channelConfig, ITransaction transaction) throws DaoException, PortalException
- Specified by:
getIdByChannelPrefix
in interfaceIChannelDao
- Throws:
DaoException
PortalException
-
getIdsByParentTemplateId
public List<String> getIdsByParentTemplateId(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 Collection<String> getIdsByPageTemplateId(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 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
-
-