Groovy updater bootstrap generator

This project is designed for Hippo developers to have an easy way to create updaters in groovy, without being bothered with the bootstrap xml

Лицензия

Лицензия

Категории

Категории

Groovy Языки программирования
Группа

Группа

nl.openweb.hippo.updater
Идентификатор

Идентификатор

groovy-updater-bootstrap-generator
Последняя версия

Последняя версия

1.14
Дата

Дата

Тип

Тип

jar
Описание

Описание

Groovy updater bootstrap generator
This project is designed for Hippo developers to have an easy way to create updaters in groovy, without being bothered with the bootstrap xml
Организация-разработчик

Организация-разработчик

Open Web IT

Скачать groovy-updater-bootstrap-generator

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/nl.openweb.hippo.updater/groovy-updater-bootstrap-generator/ -->
<dependency>
    <groupId>nl.openweb.hippo.updater</groupId>
    <artifactId>groovy-updater-bootstrap-generator</artifactId>
    <version>1.14</version>
</dependency>
// https://jarcasting.com/artifacts/nl.openweb.hippo.updater/groovy-updater-bootstrap-generator/
implementation 'nl.openweb.hippo.updater:groovy-updater-bootstrap-generator:1.14'
// https://jarcasting.com/artifacts/nl.openweb.hippo.updater/groovy-updater-bootstrap-generator/
implementation ("nl.openweb.hippo.updater:groovy-updater-bootstrap-generator:1.14")
'nl.openweb.hippo.updater:groovy-updater-bootstrap-generator:jar:1.14'
<dependency org="nl.openweb.hippo.updater" name="groovy-updater-bootstrap-generator" rev="1.14">
  <artifact name="groovy-updater-bootstrap-generator" type="jar" />
</dependency>
@Grapes(
@Grab(group='nl.openweb.hippo.updater', module='groovy-updater-bootstrap-generator', version='1.14')
)
libraryDependencies += "nl.openweb.hippo.updater" % "groovy-updater-bootstrap-generator" % "1.14"
[nl.openweb.hippo.updater/groovy-updater-bootstrap-generator "1.14"]

Зависимости

compile (9)

Идентификатор библиотеки Тип Версия
commons-io : commons-io jar 2.6
org.codehaus.plexus : plexus-utils jar 3.2.0
org.apache.commons : commons-lang3 jar 3.9
nl.openweb.hippo.updater : groovy-updater-annotations jar 1.14
org.codehaus.groovy : groovy jar 2.5.6
org.apache.jackrabbit : jackrabbit-spi-commons jar 2.16.2
org.yaml : snakeyaml jar 1.24
javax.jcr : jcr jar 2.0
org.glassfish.jaxb : jaxb-runtime jar 2.4.0-b180830.0438

test (3)

Идентификатор библиотеки Тип Версия
org.slf4j : slf4j-api jar 1.7.26
org.junit.jupiter : junit-jupiter-engine jar 5.4.2
org.junit.jupiter : junit-jupiter-params jar 5.4.2

Модули Проекта

Данный проект не имеет модулей.

Project for Hippo Updaters Maven Plugin

This project is designed for Hippo developers to have an easy way to create updaters in groovy, without being bothered with the bootstrap xml.

For use the updaters are located in their own submodule. Nicely separated from other bootstrap. They are groovy scripts, so the editor can easily provide autocomplete and stuff, configured by Annotations.

The groovy scripts are by default located in:

/src/main/scripts

Modules involved

  • Groovy updater annotations
  • Groovy updater bootstrap generator
  • Groovy updater maven plugin
  • Sample project for the maven plugin
  • Synchronisation module for updater scripts

Annotation use

Minimal use for the Updater definition

@Updater(name = "Name", xpath = "//element(*, hst:mount)")

Bootstrap definition is optional

@Bootstrap(reload = true)

To exclude a groovy script from being bootstrapped:

@Exclude 

To add mixin(s) (since 1.14):

@Updater(name = "Name", mixin = "hippo:named, mix:referenceable")

Use of the maven plugin

In the build section of the (new) module containing the groovy updater scripts, define the execution of the plugin
For Hippo 12 use the 'generate-yaml' goal.

  <plugin>
    <groupId>nl.openweb.hippo.updater</groupId>
    <artifactId>groovy-updater-maven-plugin</artifactId>
    <version>${groovy-updater-maven-plugin.version}</version>
    <executions>
      <execution>
        <id>default-resources</id>
        <phase>compile</phase>
        <goals>
          <goal>generate-xml</goal>
        </goals>
      </execution>
    </executions>
  </plugin>

These are the configuration keys of the plugin:

  • sourceDir
    • the source of the groovy files
      default: ${project.build.scriptSourceDirectory}
  • targetDir
    • where to generate the bootstrap
      (default: ${project.build.outputDirectory})
  • defaultContentRoot (since 1.12)
    • default contentroot value (registry/queue)
      (default: queue)
  • initializeNamePrefix
    • prefix in the ecm-extension.xml nodenames
      (default:hippo-updater-)
  • yamlContentPath (since 1.13)
    • relative path for the yaml queue bootstrap files (default: hcm-content/configuration/update)
  • yamlConfigurationPath (since 1.13)
    • relative path for the yaml registry bootstrap files (default: hcm-config/configuration/update)

When using a separate module in Hippo 12, don't forget to place an hcm-module.yaml in the project.

group:
  name: hippoproject
project: hippoproject
module: 
  name: hippoproject-repository-data-updaters
  after: hippoproject-repository-data-content

Commonly used dependencies for writing the groovy scripts

    <dependency>
      <groupId>nl.openweb.hippo.updater</groupId>
      <artifactId>groovy-updater-annotations</artifactId>
      <version>${groovy-updater-maven-plugin.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.jackrabbit</groupId>
      <artifactId>jackrabbit-core</artifactId>
      <version>${hippo.jackrabbit.version}</version>
      <scope>provided</scope>
    </dependency>

Updater Script Synchronisation module

This module has copied some logic and classes from the well known webfiles module.

The updater scripts add changed groovy scripts to the updaters registry. the module is registered at: /hippo:configuration/hippo:modules/groovyfiles

Add this dependency to the cms or a dependency of the cms, like a separate 'updaters' module or 'content', use this for local development only.
It is highly recommended to use a profile for it.

  <dependency>
    <groupId>nl.openweb.hippo.updater</groupId>
    <artifactId>groovy-updater-sync</artifactId>
    <version>${groovy-updater-maven-plugin.version}</version>
  </dependency>

By default the updater-sync plugin watches a module named 'updater', to use a different module as source for the scripts, set the system property groovy.sync.watchedModules in the cargo container.

  <plugin>
    <groupId>org.codehaus.cargo</groupId>
    <artifactId>cargo-maven2-plugin</artifactId>
    <configuration>
      ...
      <container>
        ...
        <systemProperties>
          ...
          <groovy.sync.watchedModules>updater</groovy.sync.watchedModules>
        </systemProperties>
      </container>
    </configuration>
  </plugin>

Log4j

Add an info logging level for nl.openweb.hippo.groovy to your development log4j configuration

    <logger name="nl.openweb.hippo.groovy" additivity="false">
      <level value="info"/>
      <appender-ref ref="messages"/>
    </logger>

Log4j2:

    <Logger name="nl.openweb.hippo.groovy" additivity="false" level="info">
      <AppenderRef ref="messages"/>
    </Logger>
nl.openweb.hippo.updater

Open Web

Software development and open source is in our DNA. Development, contracting, maintenance and management. Discover what Open Web professionals can do for you.

Версии библиотеки

Версия
1.14
1.13
1.12
1.11
1.9