This article covers a Hippo CMS version 7.7. There's an updated version available that covers our most recent release.

View a document in a channel 

Since CMS 7.7

The 'View' menu for channels is available since CMS 7.7. Projects with older CMS versions can use the old View menu that allows you to see a document in its 'live' and 'preview' environment (i.e. one channel only).

The document editor contains a 'View' menu that lists the names of all channels that document is part of. Clicking on a channel name shows the document in that channel in the channel viewer inside the CMS.

http://www.onehippo.org/binaries/sixteencolumn/content/gallery/connect/library/view-channels.png

CMS configuration

The list of channels for the document is fetched from the HST via REST. The CMS contains a 'REST proxy' service that uses the CXF JAX-RS client to create a proxy from classes that represent a REST service. These classes are provided by the HST in the 'hst-rest-api' module.

REST proxy service

The REST proxy service to use for the HST can be configured at:

/hippo:configuration/hippo:frontend/cms/cms-services/hstRestProxyService

Configuration parameters:

  • rest.uri
    the URI at which the CMS can access the 'CMS REST service' run by the site.
    Default value: 'http://127.0.0.1:8080/site/_cmsrest'
    The default host name ('127.0.0.1') and mount ('_cmsrest') are set via Spring configuration in the HST, and can be overridden if needed.

  • plugin.class
    Should be 'org.hippoecm.frontend.service.restproxy.RestProxyServicePlugin'

  • service.id
    CMS service ID to use in the plugin framework.
    Default value: 'hst.rest.proxy.service'

"Running the container on a different port than 8080

When running Tomcat or some other container on a different port than 8080, you should change the 'CMS REST service' URI the portnumber. Thus change:
rest.uri = http://127.0.0.1:9080/site/_cmsrest'

Some Spring configuration has to be present in the site module of your project to inject the CMS REST pipeline in the HST. This consists of the file

site/src/main/resources/META-INF/hst-assembly/overrides/hst-cms-rest.xml

with the following contents:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:lang="http://www.springframework.org/schema/lang"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:util="http://www.springframework.org/schema/util"
       xmlns:aop="http://www.springframework.org/schema/aop"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
                           http://www.springframework.org/schema/lang http://www.springframework.org/schema/beans/spring-lang-3.0.xsd
                           http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd
                           http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd">

  <import resource="classpath:/org/hippoecm/hst/site/optional/jaxrs/SpringComponentManager-rest-jackson.xml" />
  <import resource="classpath:/org/hippoecm/hst/cmsrest/SpringComponentManager-cmsrest.xml" />

</beans>

The HST will automatically add a mount for the CMS REST service to the HST hosts configuration at runtime.

If everything is configured correctly, the following URL should return all channels for the UUID of a hippo:handle of a document:

http://127.0.0.1:8080/site/_cmsrest/documents/<uuid>/channels

View menu

The 'View' menu itself is rendered by the 'channel actions' plugin. Its configuration is located at:

/hippo:configuration/hippo:workflows/channelactions/button/frontend:renderer

The channel actions plugin recognizes the following properties:

  • rest.proxy.service.id
    Service ID of the CMS REST proxy service to use.
    Default: hst.rest.proxy.service

  • plugin.class
    CMS plugin class that renders the menu.
    Default: org.onehippo.cms7.channelmanager.plugins.channelactions.ChannelActionsPlugin

Removing the 'View' menu for channels

The view menu for channels can be removed entirely with the following steps:

1. Remove the value 'channelactions' from the multi-string property 'workflow.categories' in these nodes:

/hippo:configuration/hippo:frontend/cms/cms-preview/workflowPlugin
/hippo:configuration/hippo:frontend/cms/cms-compare/workflowPlugin

2. Remove the node

/hippo:configuration/hippo:workflows/channelactions