This article covers a Bloomreach Experience Manager version 13. There's an updated version available that covers our most recent release.

30-10-2019

Install Universal Pixel Integration Addon

This Bloomreach Experience Manager feature requires a standard or premium license. Please contact Bloomreach for more information.

Introduction

Installing the Universal Pixel Integration Addon requires adding Maven dependencies, enabling the Open UI Extension, and configuring the shared library. Each step is described in this page.

Add Dependencies

To install Universal Pixel Integration Addon module, add the version property and dependency definitions in dependency management section in the root pom.xml:

  <properties>
    <!-- SNIP -->
    <hippo-addon-universal-pixel-integration.version>2.0.0</hippo-addon-universal-pixel-integration.version>
  </properties>

  <!-- SNIP -->

  <dependencyManagement>
    <dependencies>
      <!-- SNIP -->

      <dependency>
        <groupId>com.onehippo.cms7</groupId>
        <artifactId>hippo-addon-universal-pixel-integration-api</artifactId>
        <version>${hippo-addon-universal-pixel-integration.version}</version>
        <scope>provided</scope>
      </dependency>

      <dependency>
        <groupId>com.onehippo.cms7</groupId>
        <artifactId>hippo-addon-universal-pixel-integration-repository</artifactId>
        <version>${hippo-addon-universal-pixel-integration.version}</version>
      </dependency>

      <dependency>
        <groupId>com.onehippo.cms7</groupId>
        <artifactId>hippo-addon-universal-pixel-integration-frontend</artifactId>
        <version>${hippo-addon-universal-pixel-integration.version}</version>
      </dependency>

      <dependency>
        <groupId>com.onehippo.cms7</groupId>
        <artifactId>hippo-addon-universal-pixel-integration-frontend-ng</artifactId>
        <version>${hippo-addon-universal-pixel-integration.version}</version>
      </dependency>

      <dependency>
        <groupId>com.onehippo.cms7</groupId>
        <artifactId>hippo-addon-universal-pixel-integration-hst</artifactId>
        <version>${hippo-addon-universal-pixel-integration.version}</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

Add the following dependencies to the content authoring application (cms-dependencies/pom.xml):

  <dependencies>
    <!-- SNIP -->

    <dependency>
      <groupId>com.onehippo.cms7</groupId>
      <artifactId>hippo-addon-universal-pixel-integration-repository</artifactId>
    </dependency>

    <dependency>
      <groupId>com.onehippo.cms7</groupId>
      <artifactId>hippo-addon-universal-pixel-integration-frontend</artifactId>
    </dependency>

    <dependency>
      <groupId>com.onehippo.cms7</groupId>
      <artifactId>hippo-addon-universal-pixel-integration-frontend-ng</artifactId>
    </dependency>
  </dependencies>

And, add the following dependency to the content delivery application (site/components/pom.xml):

  <dependencies>
    <!-- SNIP -->

    <dependency>
      <groupId>com.onehippo.cms7</groupId>
      <artifactId>hippo-addon-universal-pixel-integration-hst</artifactId>
    </dependency>
  </dependencies>

Enabling WicketSessionFilter for Universal Pixel Integration Addon JAX-RS Services

The Universal Pixel Integration addon includes a REST endpoint used by the Universal Pixel Editor UI. To enable the REST endpoint to access data through the current CMS user's session, configure WicketSessionFilter by adding the servlet filter configuration in the web.xml file of the CMS application (cms/src/main/webapp/WEB-INF/web.xml):

  <filter>
    <filter-name>UniversalPixelJaxrsWicketSessionFilter</filter-name>
    <filter-class>org.apache.wicket.protocol.http.servlet.WicketSessionFilter</filter-class>
    <init-param>
      <param-name>filterName</param-name>
      <param-value>CMS</param-value>
    </init-param>
  </filter>

  <filter-mapping>
    <filter-name>UniversalPixelJaxrsWicketSessionFilter</filter-name>
    <url-pattern>/ws/universal-pixel/*</url-pattern>
  </filter-mapping>

Configure Shared Library

The Universal Pixel Integration addon provides a shared library for both content authoring (CMS) and content delivery web applications. In order to make that shared library available, configure the shared library dependency in both the cargo.run Maven profile and the distribution assembly XML file.

In the cargo.run Maven profile in your project's root pom.xml, add the hippo-addon-universal-pixel-integration-api JAR dependency as a shared module as follows:

    <!-- SNIP -->

    <profile>
      <id>cargo.run</id>
      <dependencies>
        <!-- SNIP -->
        <dependency>
          <groupId>com.onehippo.cms7</groupId>
          <artifactId>hippo-addon-universal-pixel-integration-api</artifactId>
          <scope>provided</scope>
        </dependency>
        <!-- SNIP -->
      </dependencies>
      <!-- SNIP -->
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.cargo</groupId>
            <artifactId>cargo-maven2-plugin</artifactId>
            <configuration>
              <!-- SNIP -->
              <container>
                <!-- SNIP -->
                <dependencies>
                  <!-- SNIP -->
                  <dependency>
                    <groupId>com.onehippo.cms7</groupId>
                    <artifactId>hippo-addon-universal-pixel-integration-api</artifactId>
                    <classpath>shared</classpath>
                  </dependency>
                  <!-- SNIP -->
                </dependencies>
              </container>
            </configuration>
          </plugin>
          <!-- SNIP -->
        </plugins>
      </build>
    </profile>

    <!-- SNIP -->

Now, the Apache Tomcat container started by the cargo.run profile makes the hippo-addon-universal-pixel-integration-api JAR module available on the shared classpath.

Also, when creating a tar.gz distribution file through the dist Maven profile, shared dependencies are defined in a Maven Assembly Plugin descriptor file, i.e. src/main/assembly/shared-lib-component.xml. Update it as follows:

<component xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/component/1.1.2"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/component/1.1.2
                               http://maven.apache.org/xsd/component-1.1.2.xsd">
  <dependencySets>
    <dependencySet>
      <useProjectArtifact>false</useProjectArtifact>
      <outputDirectory>shared/lib</outputDirectory>
      <scope>provided</scope>
      <includes>
        <!-- SNIP -->
        <include>com.onehippo.cms7:hippo-addon-universal-pixel-integration-api</include>
      </includes>
    </dependencySet>
  </dependencySets>
</component>

Be sure to add the hippo-addon-universal-pixel-integration-api dependency in the dist Maven profile in your project's root pom.xml so that it can recognize the dependency during the assembly process.

<profile>
  <id>dist</id>
  <dependencies>
    <!-- SNIP -->
    <dependency>
      <groupId>com.onehippo.cms7</groupId>
      <artifactId>hippo-addon-universal-pixel-integration-api</artifactId>
      <scope>provided</scope>
    </dependency>
  </dependencies>
  <build>
    <!-- SNIP -->
  </build>
</profile>

Now, the distribution tar.gz file will contain the hippo-addon-universal-pixel-integration-api JAR module in the shared library path.

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?

    We rely on cookies

    to optimize our communication and to enhance your customer experience. By clicking on the Accept and Close button, you agree to the collection of cookies. You can also adjust your preferences by clicking on Manage Preferences. For more information please see our Privacy policy.

    Manage cookies
    Accept & close

    Cookies preferences

    Accept & close
    Back