Migrating from 3.x to 4.0.0-M1
Upgrade Summary:
-
stay at Java 17 baseline (as Spring does; however, JRuby 10.x as used for AsciiDoc extensions requires Java 21+ runtime)
-
upgrade to Jackson 3 (as Spring does)
-
upgrade to JUnit 6 (as Spring does)
-
Shiro support removed ✅
-
JDO support removed ✅
-
Joda time support removed ✅
-
RestEasy integration removed ✅
-
Causeway now uses slf4j (instead of log4j) ✅
-
Migrate build requirements to Maven 4 ✅
Optional to come with 4.0.0 or later
-
Removal of rest-client artifact in favor of Spring’s RestClient
-
Removal of encrypt-jbcrypt artifact
Configuration
Some presets for the Spring Configuration have been removed
| Removals |
|---|
|
|
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.xmlremove:
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(@Importstatements):replace:
Spring bean import@Import({ //.. CausewayModuleViewerRestfulObjectsJaxrsResteasy.class, // ... })instead with:
Spring bean import@Import({ //.. CausewayModuleViewerRestfulObjectsViewer.class, // ... }) -
in your
application.yamlconfiguration properties, change the config properties that configures the servlet-context relative path prefix for the Restful Objects Viewerreplace:
application.yaml (Spring configuration properties)resteasy: jaxrs: defaultPath: /restfulreplace 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.