Upgrade Targeting Add-On
Rename Targeting Dependencies
In cms/pom.xml, rename the CMS dependency artifact hippo-addon-targeting-dependencies-cms to hippo-addon-targeting-cms-dependencies.
In site/pom.xml, rename the site dependency artifact hippo-addon-targeting-dependencies-site to hippo-addon-targeting-site-dependencies.
Set Up Shared Targeting API
As of version 13, Targeting contains a new artifact, hippo-addon-targeting-shared-api, which lives in the shared library. This artifact is not provided out of the box when running in a local development environment (using the cargo.run Maven profile). Instead, it must be added both to the project's cargo.run profile configuration and to the assembly plugin configuration.
Add Shared Targeting API to cargo.run
In order to add the hippo-addon-targeting-shared-api artifact to the project's cargo.run profile in the root pom.xml, first declare a provided dependency at the POM's root level:
<project> <!-- snip! --> <dependencies> <dependency> <groupId>com.onehippo.cms7</groupId> <artifactId>hippo-addon-targeting-shared-api</artifactId> <scope>provided</scope> </dependency> </dependencies> <!-- snip! --> </project>
Then, in the configuration/container/dependencies element of the cargo.run profile, specify the dependency as follows:
<dependency> <groupId>com.onehippo.cms7</groupId> <artifactId>hippo-addon-targeting-shared-api</artifactId> <classpath>shared</classpath> </dependency>
Add Shared Targeting API to Assembly Plugin Configuration
In analogy to adding the hst-api artifact to the Maven assembly plugin configuration, described in a previous step, you must also add hippo-addon-targeting-shared-api to the <includes> section in src/main/assembly/shared-lib-component.xml:
<include>com.onehippo.cms7:hippo-addon-targeting-shared-api</include>
Upgrade Custom Targeting Collectors
In case you have built Custom Targeting Collectors, you need to take some extra steps. At Develop a Custom Collector, it is described what needs to be done if you start with version 13. If you have built your custom targeting collector before version 13, and you need to upgrade, you have to make sure that the custom targeting collector code ends up in the CMS/platform web application instead of the site web application (like it used to be before version 13). If you need to access targeting data from an HstComponent in your site web application, you need to extract an interface of the custom targeting data and that interface must end up in a jar that is part of the shared lib. See Develop a Custom Collector for more detail.
Upgrade Public Relevance Rest API
If you expose the Public Relevance Rest API, but you have also added custom endpoints, you might have to upgrade these custom endpoint classes. If you use the VisitorService bean in the Spring wiring of your custom endpoint, you need to upgrade your code. The following Spring configuration and code:
<bean id="com.hap.targeting.rest.LatestVisitorsResource" class="com.hap.targeting.rest.LatestVisitorsResource"> <property name="visitorService" ref="com.onehippo.cms7.targeting.VisitorService"/> </bean> public class LatestVisitorsResource { private VisitorService visitorService; public void setVisitorService(final VisitorService visitorService) { this.visitorService = visitorService; }
must be replaced with
<bean id="com.hap.targeting.rest.LatestVisitorsResource" class="com.hap.targeting.rest.LatestVisitorsResource" init-method="init"/> public class LatestVisitorsResource { private VisitorService visitorService; public void init() { this.visitorService = HippoServiceRegistry.getService(VisitorService.class); }
The VisitorService bean is not available any more in site web applications.
Upgrade Visitor Data Filters
If you have implemented custom Visitor Data Filters, make sure to move the implementation from the site web application to the CMS/platform web application.
Elasticsearch version
Elasticssearch 5.x and 6.x are supported, but the default version is now 6.x. If you want to keep using Elasticsearch 5, you need to bootstrap version 5 of ElasticStoreFactory as described in Configure Visits Data Store.
Remove MaxMind GeoLite Dependency
Up to version 12, the Relevance Module required a Maven dependency on hippo-maxmind-geolite2 in site/pom.xml. As of version 13, this dependency has moved to the cms module, is now pulled in transitively and does not need to be managed at project level. Remove the dependency on hippo-maxmind-geolite2 from site/pom.xml.