Upgrade a custom collector

Contents

This document explains what is needed to move a custom collector to a new major version of Explorer.

From 4.x to 5.x

Explorer 5 is the release for Enonic XP 8. A collector built for Explorer 4 is an XP 7 application, and must be upgraded to XP 8 and rebuilt with lib-explorer 5 before it can be installed next to Explorer 5.

This section explains what is needed to move from

  • lib-explorer-4.x.x to lib-explorer-5.x.x

  • app-explorer-4.x.x to app-explorer-5.x.x

The Collector API itself is unchanged: the Collector class, the collectors.json file, the documentTypes.json file and the React component of the collector form all work the same way as in Explorer 4.

Upgrade the application to XP 8

A collector is a regular XP application, so start by following the general guide for upgrading Enonic apps from XP 7 to XP 8. It covers the new Gradle setup, the enonic.yaml application descriptor and the conversion of XML descriptors to YAML.

Dependencies

gradle.properties

lib-explorer-5.0.0 (and app-explorer-5.0.0) requires XP 8.1.

gradle.properties
xpVersion=8.1.1

build.gradle

In build.gradle you have to bump the lib-explorer version to 5.0.0.

build.gradle
dependencies {
  include "com.enonic.lib:lib-explorer:5.x.x"
}

Other Enonic libraries used by your collector must be upgraded to their XP 8 versions as well.

lib-explorer no longer depends on lib-util and lib-guillotine. If your collector imports /lib/util or /lib/guillotine without declaring them, add them to your own build.gradle.

Task descriptor

XP 8 uses YAML descriptors, so the task descriptor of the collector must be converted from XML to YAML. The parameters passed to the task are the same as before.

src/main/resources/tasks/<taskName>/<taskName>.yaml
kind: "Task"
description: "Collect"
form:
  - type: "TextLine"
    name: "collectionId"
    label: "Collection ID"
    occurrences:
      min: 0
      max: 1
  - type: "TextLine"
    name: "collectorId"
    label: "Collector ID"
    occurrences:
      min: 1
      max: 1
  - type: "TextLine"
    name: "configJson"
    label: "Config JSON"
    occurrences:
      min: 1
      max: 1
  - type: "TextLine"
    name: "language"
    label: "Language"
    occurrences:
      min: 0
      max: 1

TypeScript

Type definitions for lib-explorer are now published to npm as @enonic-types/lib-explorer, with the same version number as the library. If your collector has its own copies of these types, you can remove them.

See TypeScript for how to set it up.

Notifications

The e-mails sent when a collector job is done no longer use a fixed sender address. They are now sent from the default sender of the XP installation, see Notifications.

Older versions

For upgrading a collector from lib-explorer 3.x to 4.x, see the Explorer 4 documentation.


Contents

Contents