lumis.portal.channel
Class ChannelManager

Package class diagram package ChannelManager
java.lang.Object
  extended by lumis.portal.channel.ChannelManager
All Implemented Interfaces:
IChannelManager, IConfigKeyChecker

public class ChannelManager
extends Object
implements IChannelManager

Implementation for the channel manager.

Since:
4.0.0

Constructor Summary
ChannelManager()
           
 
Method Summary
 String add(SessionConfig sessionConfig, ChannelConfig channelConfig, ITransaction transaction)
          Add a Channel.
 void addCssLink(SessionConfig sessionConfig, String channelId, String cssId, int position, ITransaction transaction)
          Add the hyperlink to the channel's CSS file.
 void addOrUpdate(SessionConfig sessionConfig, ChannelConfig channelConfig, ITransaction transaction)
          Add or Update a Channel, depending on its previous existence.
 void clearCache(SessionConfig sessionConfig, String channelId, ITransaction transaction)
          Clear the Channel cache.
 String copy(SessionConfig sessionConfig, String sourceChannelId, String destinationParentChannelId, ITransaction transaction)
          Creates a new channel by copying source channel's properties and structure into destination's parent channel.
 void delete(SessionConfig sessionConfig, String channelId, ITransaction transaction)
          Delete the Channel.
 void deleteCssLink(SessionConfig sessionConfig, String channelId, String cssId, ITransaction transaction)
          Delete the hyperlink to the channel's CSS file.
protected  void deleteRecursively(SessionConfig sessionConfig, String channelId, ITransaction transaction)
           
 String deserialize(SessionConfig sessionConfig, DeserializationConfig deserializationConfig, Node channelNode, ITransaction transaction)
           
 void deserializeCss(SessionConfig sessionConfig, DeserializationConfig deserializationConfig, Node cssLinksNodes, ITransaction transaction)
           
 void deserializeSecondPass(SessionConfig sessionConfig, DeserializationConfig deserializationConfig, Node channelNode, ITransaction transaction)
          Perfoms the second pass of the channels deserialization
protected  void disconnectChannelsFromTemplatesRecursively(SessionConfig sessionConfig, String channelId, ITransaction transaction)
           
 ChannelConfig get(SessionConfig sessionConfig, String channelId, ITransaction transaction)
          Get the Channel's configuration.
 int getCachePages(SessionConfig sessionConfig, ChannelConfig channelConfig, ITransaction transaction)
           
 boolean getCenterPages(SessionConfig sessionConfig, ChannelConfig channelConfig, ITransaction transaction)
          Get a boolean indicating wheter the page must be centralized.
 int getChannelTreeCount(String rootChannelId, ITransaction transaction)
          Returns the number of channels in the tree for which the root is the given channelId.
 List<String> getChannelTreeIds(String rootChannelId, ITransaction transaction)
          Returns all the ids of channels in the tree for which the root is the given channelId.
 List<String> getCssIds(SessionConfig sessionConfig, String channelId, ITransaction transaction)
          Get a list of CSS Ids of the Channel.
 List<String> getCssIdsRecursively(SessionConfig sessionConfig, String channelId, ITransaction transaction)
          Get a list of Css Ids of the Channel including inherited Css.
 String getFriendlyPath(SessionConfig sessionConfig, String channelId, ITransaction transaction)
          Get the friendly path of a channel.
 Collection<String> getIdsByPageTemplateId(SessionConfig sessionConfig, String pageTemplateId, ITransaction transaction)
          Retrieves the Ids of all channel that uses the specified page template as default page template
 List<String> getIdsByParentChannelId(SessionConfig sessionConfig, String channelId, ITransaction transaction)
          Get a list of sub channel's id given the parent Channel's id.
 List<String> getIdsByParentTemplateId(SessionConfig sessionConfig, String parentTemplateId, ITransaction transaction)
          Retrieves the Ids of all channel that uses the specified channel template.
 List<String> getMetaTagIdsRecursively(SessionConfig sessionConfig, String channelId, ITransaction transaction)
          Get a list of meta-tags ids of the Channel including inherit Meta-tag.
 String getPageTemplateIdRecursively(SessionConfig sessionConfig, String channelId, ITransaction transaction)
          Returns the PageTemplateId for the specified channel (local or inherited from a parent channel)
 String getPath(SessionConfig sessionConfig, String channelId, boolean localizable, ITransaction transaction)
          Get the full path of the Channel.
 String getPath(SessionConfig sessionConfig, String channelId, ITransaction transaction)
          Get the full path of the Channel.
 List<String> getPathIds(SessionConfig sessionConfig, String channelId, ITransaction transaction)
          Get Ids of channel and its parents.
 List<String> getPathNames(SessionConfig sessionConfig, String channelId, boolean localizable, ITransaction transaction)
          Returns a list of strings each representing the name of the channel between the root portal channel and the channel solicited.
 int getProtocolType(SessionConfig sessionConfig, ChannelConfig channelConfig, ITransaction transaction)
          Returns the protocolType of the given channel.
 boolean keyExists(SessionConfig sessionConfig, Object configKey, Object config, ITransaction transaction)
          Checks if configId matches an already persisted object
 void serialize(SessionConfig sessionConfig, String channelId, OutputStream outputStream, ITransaction transaction)
           
 void serializeCss(SessionConfig sessionConfig, String channelId, OutputStream outputStream, ITransaction transaction)
           
 void update(SessionConfig sessionConfig, ChannelConfig channelConfig, ITransaction transaction)
          Update the Channel.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChannelManager

public ChannelManager()
Method Detail

addOrUpdate

public void addOrUpdate(SessionConfig sessionConfig,
                        ChannelConfig channelConfig,
                        ITransaction transaction)
                 throws ManagerException,
                        PortalException
Description copied from interface: IChannelManager
Add or Update a Channel, depending on its previous existence.

Specified by:
addOrUpdate in interface IChannelManager
Throws:
ManagerException
PortalException

add

public String add(SessionConfig sessionConfig,
                  ChannelConfig channelConfig,
                  ITransaction transaction)
           throws ManagerException,
                  PortalException
Description copied from interface: IChannelManager
Add a Channel. To access this method, the user needs the PERMISSION_TYPE_FULL_CONTROL permission in the parent channel.

Specified by:
add in interface IChannelManager
Returns:
a String.
Throws:
ManagerException
PortalException

update

public void update(SessionConfig sessionConfig,
                   ChannelConfig channelConfig,
                   ITransaction transaction)
            throws ManagerException,
                   PortalException
Description copied from interface: IChannelManager
Update the Channel. To access this method, the user needs the PERMISSION_TYPE_FULL_CONTROL permission.

Specified by:
update in interface IChannelManager
Parameters:
sessionConfig - The session information of the user.
Throws:
ManagerException
PortalException

copy

public String copy(SessionConfig sessionConfig,
                   String sourceChannelId,
                   String destinationParentChannelId,
                   ITransaction transaction)
            throws ManagerException,
                   PortalException
Description copied from interface: IChannelManager
Creates a new channel by copying source channel's properties and structure into destination's parent channel. Does not allow the creation of a new Channel based on the "Portal" channel.

Specified by:
copy in interface IChannelManager
Returns:
Throws:
ManagerException
PortalException

get

public ChannelConfig get(SessionConfig sessionConfig,
                         String channelId,
                         ITransaction transaction)
                  throws ManagerException,
                         PortalException
Description copied from interface: IChannelManager
Get the Channel's configuration. To access this method, the user needs the PERMISSION_TYPE_VIEW_CHANNEL permission.

Specified by:
get in interface IChannelManager
Parameters:
sessionConfig - the user's session information.
channelId - the channelId.
transaction - the transaction for persistence access.
Returns:
the channel.
Throws:
PortalObjectNotFoundException - if the channel was not found.
ManagerException
PortalException

delete

public void delete(SessionConfig sessionConfig,
                   String channelId,
                   ITransaction transaction)
            throws ManagerException,
                   PortalException
Description copied from interface: IChannelManager
Delete the Channel. To access this method, the user needs the PERMISSION_TYPE_FULL_CONTROL permission.

Specified by:
delete in interface IChannelManager
Parameters:
sessionConfig - The session information of the user.
Throws:
ManagerException
PortalException

disconnectChannelsFromTemplatesRecursively

protected void disconnectChannelsFromTemplatesRecursively(SessionConfig sessionConfig,
                                                          String channelId,
                                                          ITransaction transaction)
                                                   throws ManagerException,
                                                          PortalException
Throws:
ManagerException
PortalException

deleteRecursively

protected void deleteRecursively(SessionConfig sessionConfig,
                                 String channelId,
                                 ITransaction transaction)
                          throws ManagerException,
                                 PortalException
Throws:
ManagerException
PortalException

getIdsByParentChannelId

public List<String> getIdsByParentChannelId(SessionConfig sessionConfig,
                                            String channelId,
                                            ITransaction transaction)
                                     throws ManagerException,
                                            PortalException
Description copied from interface: IChannelManager
Get a list of sub channel's id given the parent Channel's id. To access this method, the user needs the PERMISSION_TYPE_VIEW_CHANNEL permission.

Specified by:
getIdsByParentChannelId in interface IChannelManager
Parameters:
sessionConfig - The session information of the user.
Returns:
an array of strings.
Throws:
ManagerException
PortalException

getPath

public String getPath(SessionConfig sessionConfig,
                      String channelId,
                      ITransaction transaction)
               throws ManagerException,
                      PortalException
Description copied from interface: IChannelManager
Get the full path of the Channel. To access this method, the user needs the PERMISSION_TYPE_VIEW_CHANNEL permission.

Specified by:
getPath in interface IChannelManager
Parameters:
sessionConfig - The session information of the user.
Returns:
a String.
Throws:
ManagerException
PortalException

getPath

public String getPath(SessionConfig sessionConfig,
                      String channelId,
                      boolean localizable,
                      ITransaction transaction)
               throws ManagerException,
                      PortalException
Description copied from interface: IChannelManager
Get the full path of the Channel. To access this method, the user needs the PERMISSION_TYPE_VIEW_CHANNEL permission.

Specified by:
getPath in interface IChannelManager
Parameters:
sessionConfig - The session information of the user.
localizable - TODO
Returns:
a String.
Throws:
ManagerException
PortalException

getPathNames

public List<String> getPathNames(SessionConfig sessionConfig,
                                 String channelId,
                                 boolean localizable,
                                 ITransaction transaction)
                          throws ManagerException,
                                 PortalException
Description copied from interface: IChannelManager
Returns a list of strings each representing the name of the channel between the root portal channel and the channel solicited.

The first element of the list is the root portal channel followed by its children in hierarchical order.

Specified by:
getPathNames in interface IChannelManager
Parameters:
sessionConfig - session config of a user
channelId - identifier of the channel for which you want the path names
localizable - if true, the channel names are localized
Returns:
Throws:
ManagerException
PortalException

getFriendlyPath

public String getFriendlyPath(SessionConfig sessionConfig,
                              String channelId,
                              ITransaction transaction)
                       throws ManagerException,
                              PortalException
Description copied from interface: IChannelManager
Get the friendly path of a channel. The friendly path is generated according to the configuration in the channel.

Specified by:
getFriendlyPath in interface IChannelManager
Parameters:
sessionConfig - The session information of the user. the identification of the user.
channelId - the identification of the channel.
transaction - the transaction for persistence access.
Returns:
the generated path.
Throws:
ManagerException
PortalException
See Also:
ChannelConfig.FRIENDLY_PATH_TYPE_CHANNEL_NAME, ChannelConfig.FRIENDLY_PATH_TYPE_INHERIT, ChannelConfig.FRIENDLY_PATH_TYPE_USER_DEFINED

getPathIds

public List<String> getPathIds(SessionConfig sessionConfig,
                               String channelId,
                               ITransaction transaction)
                        throws ManagerException,
                               PortalException
Description copied from interface: IChannelManager
Get Ids of channel and its parents. To access this method, the user needs the PERMISSION_TYPE_VIEW_CHANNEL permission.

Specified by:
getPathIds in interface IChannelManager
Parameters:
sessionConfig - The session information of the user.
Returns:
an array of Strings.
Throws:
ManagerException
PortalException

addCssLink

public void addCssLink(SessionConfig sessionConfig,
                       String channelId,
                       String cssId,
                       int position,
                       ITransaction transaction)
                throws ManagerException,
                       PortalException
Description copied from interface: IChannelManager
Add the hyperlink to the channel's CSS file. To access this method, the user needs the PERMISSION_TYPE_PAGES_LAYOUT permission.

Specified by:
addCssLink in interface IChannelManager
Parameters:
sessionConfig - The session information of the user.
Throws:
ManagerException
PortalException

deleteCssLink

public void deleteCssLink(SessionConfig sessionConfig,
                          String channelId,
                          String cssId,
                          ITransaction transaction)
                   throws ManagerException,
                          PortalException
Description copied from interface: IChannelManager
Delete the hyperlink to the channel's CSS file. To access this method, the user needs the PERMISSION_TYPE_PAGES_LAYOUT permission.

Specified by:
deleteCssLink in interface IChannelManager
Parameters:
sessionConfig - The session information of the user.
Throws:
ManagerException
PortalException

getCssIds

public List<String> getCssIds(SessionConfig sessionConfig,
                              String channelId,
                              ITransaction transaction)
                       throws ManagerException,
                              PortalException
Description copied from interface: IChannelManager
Get a list of CSS Ids of the Channel.

Specified by:
getCssIds in interface IChannelManager
Parameters:
sessionConfig - The session information of the user.
Returns:
an array of Strings.
Throws:
ManagerException
PortalException

getCssIdsRecursively

public List<String> getCssIdsRecursively(SessionConfig sessionConfig,
                                         String channelId,
                                         ITransaction transaction)
                                  throws ManagerException,
                                         PortalException
Description copied from interface: IChannelManager
Get a list of Css Ids of the Channel including inherited Css.

Specified by:
getCssIdsRecursively in interface IChannelManager
Parameters:
sessionConfig - The session information of the user.
Returns:
an array of Strings.
Throws:
ManagerException
PortalException

getMetaTagIdsRecursively

public List<String> getMetaTagIdsRecursively(SessionConfig sessionConfig,
                                             String channelId,
                                             ITransaction transaction)
                                      throws ManagerException,
                                             PortalException
Description copied from interface: IChannelManager
Get a list of meta-tags ids of the Channel including inherit Meta-tag.

Specified by:
getMetaTagIdsRecursively in interface IChannelManager
Returns:
Throws:
ManagerException
PortalException

getCenterPages

public boolean getCenterPages(SessionConfig sessionConfig,
                              ChannelConfig channelConfig,
                              ITransaction transaction)
                       throws ManagerException,
                              PortalException
Description copied from interface: IChannelManager
Get a boolean indicating wheter the page must be centralized.

Specified by:
getCenterPages in interface IChannelManager
Parameters:
sessionConfig - The session information of the user.
Returns:
Throws:
ManagerException
PortalException

getCachePages

public int getCachePages(SessionConfig sessionConfig,
                         ChannelConfig channelConfig,
                         ITransaction transaction)
                  throws ManagerException,
                         PortalException
Specified by:
getCachePages in interface IChannelManager
Parameters:
sessionConfig - The session information of the user.
Returns:
an integer.
Throws:
ManagerException
PortalException

getProtocolType

public int getProtocolType(SessionConfig sessionConfig,
                           ChannelConfig channelConfig,
                           ITransaction transaction)
                    throws ManagerException,
                           PortalException
Description copied from interface: IChannelManager
Returns the protocolType of the given channel.

This method checks recursively up the channel´s ancestors until it finds a protocolType that is not PageConfig.PAGE_PROTOCOL_INHERIT.

Possible protocol types are:

Specified by:
getProtocolType in interface IChannelManager
Returns:
Throws:
ManagerException
PortalException

serialize

public void serialize(SessionConfig sessionConfig,
                      String channelId,
                      OutputStream outputStream,
                      ITransaction transaction)
               throws ManagerException,
                      PortalException
Specified by:
serialize in interface IChannelManager
Parameters:
sessionConfig - The session information of the user.
Throws:
ManagerException
PortalException

deserialize

public String deserialize(SessionConfig sessionConfig,
                          DeserializationConfig deserializationConfig,
                          Node channelNode,
                          ITransaction transaction)
                   throws ManagerException,
                          PortalException
Specified by:
deserialize in interface IChannelManager
Parameters:
sessionConfig - The session information of the user.
Returns:
a String.
Throws:
ManagerException
PortalException

deserializeSecondPass

public void deserializeSecondPass(SessionConfig sessionConfig,
                                  DeserializationConfig deserializationConfig,
                                  Node channelNode,
                                  ITransaction transaction)
                           throws ManagerException,
                                  PortalException
Description copied from interface: IChannelManager
Perfoms the second pass of the channels deserialization

Specified by:
deserializeSecondPass in interface IChannelManager
Parameters:
sessionConfig - user session information.
deserializationConfig - deserialization configuration.
channelNode - the data for the channel to be imported.
transaction - the transaction for persistence access.
Throws:
ManagerException
PortalException

serializeCss

public void serializeCss(SessionConfig sessionConfig,
                         String channelId,
                         OutputStream outputStream,
                         ITransaction transaction)
                  throws ManagerException,
                         PortalException
Specified by:
serializeCss in interface IChannelManager
Parameters:
sessionConfig - The session information of the user.
Throws:
ManagerException
PortalException

deserializeCss

public void deserializeCss(SessionConfig sessionConfig,
                           DeserializationConfig deserializationConfig,
                           Node cssLinksNodes,
                           ITransaction transaction)
                    throws ManagerException,
                           PortalException
Specified by:
deserializeCss in interface IChannelManager
Parameters:
sessionConfig - The session information of the user.
Throws:
ManagerException
PortalException

getIdsByParentTemplateId

public List<String> getIdsByParentTemplateId(SessionConfig sessionConfig,
                                             String parentTemplateId,
                                             ITransaction transaction)
                                      throws ManagerException,
                                             PortalException
Description copied from interface: IChannelManager
Retrieves the Ids of all channel that uses the specified channel template.

Specified by:
getIdsByParentTemplateId in interface IChannelManager
Returns:
Throws:
ManagerException
PortalException

clearCache

public void clearCache(SessionConfig sessionConfig,
                       String channelId,
                       ITransaction transaction)
                throws ManagerException,
                       PortalException
Description copied from interface: IChannelManager
Clear the Channel cache.

This method clears the following caches

If the channel being cleared is the Portal Channel, the string cache will also be cleared.

If there are subchannels to which the user does not have access, these channels and their subchannels are skipped.

Specified by:
clearCache in interface IChannelManager
Throws:
ManagerException
PortalException

getPageTemplateIdRecursively

public String getPageTemplateIdRecursively(SessionConfig sessionConfig,
                                           String channelId,
                                           ITransaction transaction)
                                    throws PortalException
Description copied from interface: IChannelManager
Returns the PageTemplateId for the specified channel (local or inherited from a parent channel)

Specified by:
getPageTemplateIdRecursively in interface IChannelManager
Returns:
Throws:
PortalException

getChannelTreeCount

public int getChannelTreeCount(String rootChannelId,
                               ITransaction transaction)
                        throws ManagerException,
                               PortalException
Description copied from interface: IChannelManager
Returns the number of channels in the tree for which the root is the given channelId.

Specified by:
getChannelTreeCount in interface IChannelManager
Parameters:
rootChannelId - root channel identifier
Returns:
Throws:
ManagerException
PortalException

getChannelTreeIds

public List<String> getChannelTreeIds(String rootChannelId,
                                      ITransaction transaction)
                               throws ManagerException,
                                      PortalException
Description copied from interface: IChannelManager
Returns all the ids of channels in the tree for which the root is the given channelId.

Specified by:
getChannelTreeIds in interface IChannelManager
Parameters:
rootChannelId - root channel identifier
Returns:
Throws:
ManagerException
PortalException

getIdsByPageTemplateId

public Collection<String> getIdsByPageTemplateId(SessionConfig sessionConfig,
                                                 String pageTemplateId,
                                                 ITransaction transaction)
                                          throws ManagerException,
                                                 PortalException
Description copied from interface: IChannelManager
Retrieves the Ids of all channel that uses the specified page template as default page template

Specified by:
getIdsByPageTemplateId in interface IChannelManager
Returns:
Throws:
ManagerException
PortalException

keyExists

public boolean keyExists(SessionConfig sessionConfig,
                         Object configKey,
                         Object config,
                         ITransaction transaction)
Description copied from interface: IConfigKeyChecker
Checks if configId matches an already persisted object

Specified by:
keyExists in interface IConfigKeyChecker
config - Optional, allows a checker to read aditional fields to check composed keys
Returns:
true if configId matches an already persisted object


Lumisportal  4.1.0.071221 - Copyright © 2001-2007, Lumis. All Rights Reserved.