Migrating from 3.x to 4.0.0-M1

Upgrade Summary:

  1. stay at Java 17 baseline (as Spring does; however, JRuby 10.x as used for AsciiDoc extensions requires Java 21+ runtime)

  2. upgrade to Jackson 3 (as Spring does)

  3. upgrade to JUnit 6 (as Spring does)

  4. Shiro support removed ✅

  5. JDO support removed ✅

  6. Joda time support removed ✅

  7. RestEasy integration removed ✅

  8. Causeway now uses slf4j (instead of log4j) ✅

  9. Migrate build requirements to Maven 4

Optional to come with 4.0.0 or later

  1. Removal of rest-client artifact in favor of Spring’s RestClient

  2. Removal of encrypt-jbcrypt artifact

Configuration

Some presets for the Spring Configuration have been removed

Table 1. org.apache.causeway.core.config.presets.CausewayPresets
Removals

CausewayPresets.Datanucleus*

CausewayPresets.*Log4j

RestEasy Integration Removed

The Restful Objects viewer no longer has a dependency on JBoss RestEasy, instead using Spring REST APIs. As a consequence, the name of the Maven artifact and Spring configuration module have changed, as well as some configurations.

  • In your Maven pom.xml

    remove:

    Maven
    <dependency>
        <groupId>org.apache.causeway.viewer</groupId>
        <artifactId>causeway-viewer-restfulobjects-jaxrsresteasy</artifactId>
    </dependency>

    and use instead:

    Maven
    <dependency>
        <groupId>org.apache.causeway.viewer</groupId>
        <artifactId>causeway-viewer-restfulobjects-viewer</artifactId>
    </dependency>
  • in your AppManifest (@Import statements):

    replace:

    Spring bean import
    @Import({
        //..
        CausewayModuleViewerRestfulObjectsJaxrsResteasy.class,
        // ...
    })

    instead with:

    Spring bean import
    @Import({
        //..
        CausewayModuleViewerRestfulObjectsViewer.class,
        // ...
    })
  • in your application.yaml configuration properties, change the config properties that configures the servlet-context relative path prefix for the Restful Objects Viewer

    replace:

    application.yaml (Spring configuration properties)
    resteasy:
      jaxrs:
        defaultPath: /restful

    replace with:

    application.yaml (Spring configuration properties)
    causeway:
      viewer:
        restfulobjects:
          basePath: /restful

Immutable Configuration

CausewayConfiguration was refactored using Java records over regular classes, in effect all accessors have been renamed, stripping any get or is prefixes. CausewayConfiguration is now immutable.

ErrorDetails

ErrorDetails as used by the ErrorReportingService has been converted from a class to a record. (In effect all accessors have been renamed, stripping any get or is prefixes)

Object Icon Support (Experimental)

This is a Programming Model/API draft. It might receive some polishing till final 4.0.0.

Object support method FontAwesomeLayers iconFaLayers() has been replaced by IconResource icon(IconSize iconSize), which also supports image data embedding and supersedes String iconName(). However, String iconName() is still supported for backward compatibility.

With IconSize defined as

public enum IconSize {
    /**
     * as used for the object detail page header (along the object's title)
     */
    LARGE,
    /**
     * as used for table data, properties and tree nodes
     */
    MEDIUM,
    /**
     * as used for choice drop downs (single- and multi-choice)
     */
    SMALL
}

TitleService method String iconNameOf(final Object domainObject) was replaced by IconResource iconOf(Object domainObject, IconSize iconSize).

Likewise IconUiEvent was updated to reflect the new programming model.