Fork me on GitHub

Build and running

Add the Forge repository configuration

In the main pom.xml of the project, in the repositories section, add this repository if it is not configured there yet.

    <repository>
      <id>hippo-forge</id>
      <name>Bloomreach Forge maven 2 repository.</name>
      <url>https://maven.onehippo.com/maven2-forge/</url>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <releases>
        <updatePolicy>never</updatePolicy>
      </releases>
      <layout>default</layout>
    </repository>
        

Add version property to the project pom

In the main pom.xml of the project, in the properties section, add this property. For the correct version number, check the Release Notes page.

    <forge.jcrrunner.version>version.number</forge.jcrrunner.version>
        

Maven dependency

Preferred way is to get the code as Maven dependency into your project.

<dependency>
  <groupId>org.onehippo.forge.jcrrunner</groupId>
  <artifactId>jcrrunner</artifactId>
  <version>${forge.jcrrunner.version}</version>
</dependency>

Fork me on GitHub

Fork me on GitHub: https://github.com/bloomreach-forge/jcr-runner.

Build the project using Maven:

$ mvn clean install

You can also execute it:

mvn clean compile exec:java

After the first run you can use the slightly faster command

mvn -o -q compile exec:java

Configuring the properties

The properties can be found in the runner.properties

Configuring the path to traverse

In the (absolute) path * and ** can be used. For example:

repository.path=/content/documents/*/2009/**

This will match /content/documents/[any path element]/2009/[everything below]

Using queries

repository.query.language=xpath

Specify the query language, in this case "xpath"

repository.query=content/gallery//element(*, hippogallery:imageset)

This will match all document; within path "content/gallery which are of the type "hippogallery:imageset"

Example path usage

  # repository configuration
  repository.url=rmi://127.0.0.1:1099/hipporepository
  repository.user=admin
  repository.pass=admin

  # everything that starts with /content/documents
  repository.path=/content/documents/**

  # Java plugins
  plugins.java.logplugin.class=org.onehippo.forge.jcrrunner.plugins.LoggingPlugin

Example query usage

  # repository configuration
  repository.url=rmi://127.0.0.1:1099/hipporepository
  repository.user=admin
  repository.pass=admin

  repository.query.language=xpath
  repository.query=content/gallery//element(*, hippogallery:imageset)

  # Java plugins
  plugins.java.logplugin.class=org.onehippo.forge.jcrrunner.plugins.LoggingPlugin