Respond to Create Channel and Update Channel Settings Events



Implement custom logic which gets triggered when a user creates a channel or updates a channel's settings in the Experience manager.


Users can create channels (from blueprints) and update a channel's settings in the Experience manager. A delivery tier implementation may respond to these events by implementing custom logic in an event listener.

ChannelManagerEventListener Interface

The HST API provides an interface which defines two callback methods:

  • void channelCreated(ChannelManagerEvent event)
    Called immediately after a channel has been created (from a blueprint).
  • void channelUpdated(ChannelManagerEvent event)
    Called immediately after a channel's settings have been updated.

In your project, you can register any number of ChannelManagerEventListener implementations. Whenever one of the above events occurs, the corresponding callback method of each registered listener will be executed.

A ChannelManagerEventListener implementation must be registered as a Spring bean (see Spring Configuration example below).

Example ChannelManagerEventListener Implementation

The following example is part of the Hippo Test Suite.

Implementation Class


 * DemoChannelManagerEventListener
 * <P>
 * Example <CODE>ChannelManagerEventListener</CODE> implementation
 * which simply logs all the triggered event information.
 * </P>
public class DemoChannelManagerEventListener
            implements ChannelManagerEventListener {

    private static Logger log =

    public void channelCreated(ChannelManagerEvent event) {"A channel has been created. {}",

    public void channelUpdated(ChannelManagerEvent event) {"A channel has been updated. {}",

    private String channelManagerEventToString(ChannelManagerEvent event) {
        StringBuilder sb = new StringBuilder(100);
        sb.append("{ ");

        Blueprint blueprint = event.getBlueprint();
        // blueprint can be null
        if (blueprint != null) {
            sb.append("blueprint: [ ");
            sb.append(blueprint.getId()).append(", ");
            sb.append(blueprint.getName()).append(", ");
            sb.append(" ], ");

        Channel channel = event.getChannel();
        // channel will never be null
        sb.append("channel: [ ");
        sb.append(event.getChannel().getId()).append(", ");
        sb.append(channel.getName()).append(", ");
        sb.append(" ], ");

        Node configRootNode = event.getConfigRootNode();

        try {
            if (configRootNode != null) {
                sb.append("configRootNode: ");
        } catch (RepositoryException e) {
            log.error("Failed to read channel node path", e);

        sb.append(" }");
        return sb.toString();

Spring Configuration


  <!-- Custom channel manager event listeners in the following may be
       overriden in their project specific assembly. -->
  <bean id="customChannelManagerEventListeners"
    <property name="sourceList">
        <bean class=
Did you find this page helpful?
How could this documentation serve you better?
On this page
    Did you find this page helpful?
    How could this documentation serve you better?