How to install CMS Frontend Selection Plugin

Prerequisites

These instructions assume that you have an Hippo project based on the Hippo project archetype, i.e. a Maven multiproject consisting of at least three submodules: cms, site and content.

Installation in CMS/Repository

  1. Add the following dependencies to the pom.xml of your cms module:
      <dependency>
        <groupId>org.onehippo.forge.selectionplugins</groupId>
        <artifactId>selectionplugins-addon-repository</artifactId>
      </dependency>
    
      <dependency>
        <groupId>org.onehippo.forge.selectionplugins</groupId>
        <artifactId>selectionplugins-addon-cms</artifactId>
      </dependency>

    Note: the correct accompanying version is managed from parent artifact org.onehippo.cms7:hippo-cms7-release

  2. Rebuild your project using Maven and go to configuration.

Installation in HST site

  1. Add this dependency:
      <dependency>
        <groupId>org.onehippo.forge.selectionplugins</groupId>
        <artifactId>selectionplugins-hst-client</artifactId>
      </dependency>
  2. In the web.xml, make sure HstContainerServlet has uncommented init-params clientComponentManagerClass and clientComponentManagerConfigurations.
  3. Add this part to the Spring configuration file site/src/main/resources/META-INF/client-assembly/base.xml:
      <bean id="org.onehippo.forge.selection.hst.manager.ValueListManager"
          class="org.onehippo.forge.selection.hst.manager.DefaultValueListManager">
        <constructor-arg>
          <map>
            <entry key="valuelist1" value="valuelists/valuelist1"/>
          </map>
        </constructor-arg>
      </bean>

    NB You can also provide your own custom manager. For the default manager above, make a mapping between an identifier and the location of the value list document, relative to site content base bean.

  4. Add these beans in the HST file site/src/main/webapp/WEB-INF/beans-annotated-classes.xml
      <hst-content-beans>
        <annotated-class>
          org.onehippo.forge.selection.hst.contentbean.ValueList
        </annotated-class>
        <annotated-class>
          org.onehippo.forge.selection.hst.contentbean.ValueListItem
        </annotated-class>
      </hst-content-beans>