org.hippoecm.hst.configuration.channel
Interface ChannelManager

All Known Subinterfaces:
MutableChannelManager
All Known Implementing Classes:
ChannelManagerImpl

public interface ChannelManager

Management interface for Channels. Basic Channel operations are provided.


Method Summary
 void addChannelManagerEventListeners(ChannelManagerEventListener... channelManagerEventListeners)
          Adds channel manager listeners.
 boolean canUserModifyChannels()
          Can the current user (set in HstSubject) create or modify channels.
 Blueprint getBlueprint(String id)
          Retrieve a blue print from it's ID.
 List<Blueprint> getBlueprints()
          The list of available blueprints
 Channel getChannel(String channelPath)
          Returns the channel configured at the given JCR path.
<T extends ChannelInfo>
T
getChannelInfo(Channel channel)
          The channel info for this channel.
 Class<? extends ChannelInfo> getChannelInfoClass(Channel channel)
          The channel info class for this channel.
 Map<String,Channel> getChannels()
          List all managed channels, identified by their channel IDs
 List<HstPropertyDefinition> getPropertyDefinitions(Channel channel)
           
 ResourceBundle getResourceBundle(Channel channel, Locale locale)
          The resource bundle for the channel info.
 String persist(String blueprintId, Channel channel)
          Persists a channel.
 void removeChannelManagerEventListeners(ChannelManagerEventListener... channelManagerEventListeners)
          Removes channel manager listeners.
 void save(Channel channel)
          Save channel properties.
 

Method Detail

getChannels

Map<String,Channel> getChannels()
                                throws ChannelException
List all managed channels, identified by their channel IDs

Returns:
Throws:
ChannelException

getChannel

Channel getChannel(String channelPath)
                   throws ChannelException
Returns the channel configured at the given JCR path.

Throws:
ChannelException

persist

String persist(String blueprintId,
               Channel channel)
               throws ChannelException
Persists a channel. Will create the mounts, sites and configuration when the channel is new.

When invoking this method, an HstSubject context must be provided with the credentials necessary to persist the channel.

The persisted channel can be retrieved again via #getChannels#get(String) with the returned channel ID.

Parameters:
blueprintId - blueprint that contains prototypes for mount, site and hst configuration
channel - a channel instance to be persisted
Returns:
the channel ID of the created channel
Throws:
ChannelException - with type @{link ChannelException.Type#MOUNT_NOT_FOUND} when all but the last path-step in the URL path of a new channel do not map to existing mounts. The exception has one parameter: the absolute JCR path of the missing mount.
ChannelException - with type @{link ChannelException.Type#MOUNT_EXISTS} when the mount of a new channel already exists. The exception has one parameter: the absolute JCR path of the existing mount.

save

void save(Channel channel)
          throws ChannelException
Save channel properties. If the URL path of the new channel is not empty, all path-steps except the last one should already map to an existing mount.

When invoking this method, an HstSubject context must be provided with the credentials necessary to persist the channel.

Parameters:
channel - the channel to persist
Throws:
ChannelException - with type @{link ChannelException.Type#MOUNT_NOT_FOUND} when all but the last path-step in the URL path of a new channel do not map to existing mounts, or the URL path of an existing channel does not map to an existing mount. The exception has one parameter: the absolute JCR path of the missing mount.
ChannelException - with type ChannelException.Type.UNKNOWN} when the channel could not be persisted.

getBlueprints

List<Blueprint> getBlueprints()
                              throws ChannelException
The list of available blueprints

Returns:
Throws:
ChannelException

getBlueprint

Blueprint getBlueprint(String id)
                       throws ChannelException
Retrieve a blue print from it's ID.

Parameters:
id -
Returns:
Throws:
ChannelException

getChannelInfoClass

Class<? extends ChannelInfo> getChannelInfoClass(Channel channel)
                                                 throws ChannelException
The channel info class for this channel. Since this class comes from a separate context, it cannot be deserialized.

Parameters:
channel -
Returns:
Throws:
ChannelException

getChannelInfo

<T extends ChannelInfo> T getChannelInfo(Channel channel)
                                     throws ChannelException
The channel info for this channel. It is an instance of the getChannelInfoClass(org.hippoecm.hst.configuration.channel.Channel) class.

Type Parameters:
T -
Parameters:
channel -
Returns:
Throws:
ChannelException

getResourceBundle

ResourceBundle getResourceBundle(Channel channel,
                                 Locale locale)
The resource bundle for the channel info. It contains the display names for fields and values.


getPropertyDefinitions

List<HstPropertyDefinition> getPropertyDefinitions(Channel channel)

canUserModifyChannels

boolean canUserModifyChannels()
Can the current user (set in HstSubject) create or modify channels.

Returns:
true when the user can create a channel, false otherwise

addChannelManagerEventListeners

void addChannelManagerEventListeners(ChannelManagerEventListener... channelManagerEventListeners)
Adds channel manager listeners.

Parameters:
channelManagerEventListeners -

removeChannelManagerEventListeners

void removeChannelManagerEventListeners(ChannelManagerEventListener... channelManagerEventListeners)
Removes channel manager listeners.

Parameters:
channelManagerEventListeners -


Copyright © 2008-2012 Hippo. All Rights Reserved.