Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'adopt'
java-version: '21'
distribution: 'temurin'
- name: Build and run unit tests
run: mvn --batch-mode clean install
4 changes: 2 additions & 2 deletions .github/workflows/javadoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'adopt'
java-version: '21'
distribution: 'temurin'
- name: Check javadoc
run: mvn --batch-mode clean test-compile javadoc:javadoc javadoc:test-javadoc
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ jobs:
- name: Set up Java for publishing to Maven Central Repository
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'adopt'
java-version: '21'
distribution: 'temurin'
# Written here because setup-java cannot declare repositoryOrigins. Since Maven 3.10, the
# credentials of a server are sent only to the hosts known for its id, and for the id central
# that is only repo.maven.apache.org. Without central.sonatype.com, snapshots are uploaded
Expand Down
8 changes: 4 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# eForms Core Library 1.10.0 Release Notes
# eForms Core Library 2.0.0-alpha.1 Release Notes

The eForms Core Library is a collection of utilities used by the EFX Toolkit for Java Developers and other eForms applications.

## In this release

This release introduces support for the SDK 2 metadata files located in `fields/fwd`. The new class `SdkRepositoryFactory` creates the repositories of nodes, fields and data types for a given SDK version, for both SDK 1 and SDK 2. The repository constructors that read a single file are deprecated in favour of this factory.
This is the first pre-release of version 2.0.0. It contains all the changes of version 1.10.0, together with the following changes.

The SDK downloader now authenticates with the repositories declared in the Maven `settings.xml` file, and takes into account the profiles that are active by default.
The library now requires Java 21 or later.

This is the final release of the 1.x line. It requires Java 11 or later.
The alias of fields and nodes has been removed, as EFX 2 no longer uses aliases. `SdkFieldV2` and `SdkNodeV2` no longer provide `getAlias()`, and their constructors no longer take an alias parameter. Applications that call these constructors or this method must be adapted. JSON that is deserialised directly into these classes must no longer contain an `alias` property, as it is now rejected.

## Download

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This library provides a set of classes that can be used to solve some common "pr

## Using the eForms Core Library

The eForms Core library requires Java 11 or later.
The eForms Core library requires Java 21 or later.

It is available as a Maven package on Maven Central and can be used by adding the following to the project's `pom.xml`.

Expand All @@ -34,7 +34,7 @@ Replace `${eforms-core.version}` with the latest version available, or define th

Requirements:

* Java 11 or higher
* Java 21 or higher
* Maven 3.8, other versions probably also work

Execute the following on the root folder of this project:
Expand Down
17 changes: 10 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<groupId>eu.europa.ted.eforms</groupId>
<artifactId>eforms-core-java</artifactId>
<version>1.10.0</version>
<version>2.0.0-alpha.1</version>

<name>eForms Core Library</name>
<description>API and tools for eForms applications.</description>
Expand Down Expand Up @@ -33,13 +33,12 @@
</scm>

<properties>
<project.build.outputTimestamp>2026-11-27T14:25:32Z</project.build.outputTimestamp>
<project.build.outputTimestamp>2026-11-28T12:35:13Z</project.build.outputTimestamp>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<!-- Java compiler -->
<java.version>11</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<java.version>21</java.version>
<maven.compiler.release>${java.version}</maven.compiler.release>

<!-- Versions - Third-party libraries -->
<version.antlr4>4.13.1</version.antlr4>
Expand All @@ -64,10 +63,10 @@

<!-- Versions - Plugins -->
<version.build-helper.plugin>3.3.0</version.build-helper.plugin>
<version.compiler.plugin>3.10.1</version.compiler.plugin>
<version.compiler.plugin>3.13.0</version.compiler.plugin>
<version.gpg.plugin>1.5</version.gpg.plugin>
<version.install.plugin>2.5.2</version.install.plugin>
<version.jacoco.plugin>0.8.10</version.jacoco.plugin>
<version.jacoco.plugin>0.8.12</version.jacoco.plugin>
<version.japicmp.plugin>0.20.0</version.japicmp.plugin>
<version.javadoc.plugin>3.4.0</version.javadoc.plugin>
<version.source.plugin>3.2.1</version.source.plugin>
Expand Down Expand Up @@ -377,6 +376,10 @@
<build>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>${version.compiler.plugin}</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>${version.surefire.plugin}</version>
Expand Down
15 changes: 3 additions & 12 deletions src/main/java/eu/europa/ted/eforms/sdk/entity/v2/SdkFieldV2.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,13 @@ public class SdkFieldV2 extends SdkFieldV1 {
*/
private static final String DISCLOSURE_CONTROL = "disclosureControl";

private final String alias;

public SdkFieldV2(String id, String type, String parentNodeId, String xpathAbsolute,
String xpathRelative, String rootCodelistId, boolean repeatable, String alias) {
String xpathRelative, String rootCodelistId, boolean repeatable) {
super(id, type, parentNodeId, xpathAbsolute, xpathRelative, rootCodelistId, repeatable);
this.alias = alias;
}

public SdkFieldV2(JsonNode fieldNode) {
super(fieldNode);
this.alias = fieldNode.has("alias") ? fieldNode.get("alias").asText(null) : null;
}

@JsonCreator
Expand All @@ -49,14 +45,9 @@ public SdkFieldV2(
@JsonProperty("xpathAbsolute") final String xpathAbsolute,
@JsonProperty("xpathRelative") final String xpathRelative,
@JsonProperty("codeList") final Map<String, Map<String, String>> codelist,
@JsonProperty("repeatable") final Map<String, Object> repeatable,
@JsonProperty("alias") final String alias) {
@JsonProperty("repeatable") final Map<String, Object> repeatable) {
this(id, type, parentNodeId, xpathAbsolute, xpathRelative, getCodelistId(codelist),
getRepeatable(repeatable), alias);
}

public String getAlias() {
return alias;
getRepeatable(repeatable));
}

/**
Expand Down
10 changes: 1 addition & 9 deletions src/main/java/eu/europa/ted/eforms/sdk/entity/v2/SdkNodeV2.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,18 @@
*/
@SdkComponent(versions = {"2"}, componentType = SdkComponentType.NODE)
public class SdkNodeV2 extends SdkNodeV1 {
private final String alias;

@JsonCreator
public SdkNodeV2(
@JsonProperty("id") String id,
@JsonProperty("parentId") String parentId,
@JsonProperty("xpathAbsolute") String xpathAbsolute,
@JsonProperty("xpathRelative") String xpathRelative,
@JsonProperty("repeatable") boolean repeatable,
@JsonProperty("alias") String alias) {
@JsonProperty("repeatable") boolean repeatable) {
super(id, parentId, xpathAbsolute, xpathRelative, repeatable);
this.alias = alias;
}

public SdkNodeV2(JsonNode node) {
super(node);
this.alias = node.has("alias") ? node.get("alias").asText(null) : null;
}

public String getAlias() {
return alias;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,6 @@ void testEachSdkVersionGetsItsOwnFields() throws InstantiationException {

assertTrue(ofSdk1 instanceof SdkFieldV1, "SDK 1 gives " + ofSdk1.getClass());
assertTrue(ofSdk2 instanceof SdkFieldV2, "SDK 2 gives " + ofSdk2.getClass());
assertEquals("plain", ((SdkFieldV2) ofSdk2).getAlias(), "SDK 2 also reads the alias");
}

/** The constructor that takes a fields.json reads the file it is given. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ void testEachSdkVersionGetsItsOwnNodes() throws InstantiationException {

assertTrue(ofSdk1 instanceof SdkNodeV1, "SDK 1 gives " + ofSdk1.getClass());
assertTrue(ofSdk2 instanceof SdkNodeV2, "SDK 2 gives " + ofSdk2.getClass());
assertEquals("root", ((SdkNodeV2) ofSdk2).getAlias(), "SDK 2 also reads the alias");
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
"xpathAbsolute" : "/*/cac:ProcurementProjectLot/cbc:Plain",
"xpathRelative" : "cbc:Plain",
"type" : "text",
"repeatable" : true,
"alias" : "plain"
"repeatable" : true
},
{
"id" : "BT-NotRepeatable",
Expand Down
3 changes: 1 addition & 2 deletions src/test/resources/sdk-fixture/2.0/fields/fwd/fields.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
"xpathAbsolute" : "/*/cac:ProcurementProjectLot/cbc:Plain",
"xpathRelative" : "cbc:Plain",
"type" : "text",
"repeatable" : true,
"alias" : "plain"
"repeatable" : true
}, {
"id" : "BT-NotRepeatable",
"parentNodeId" : "ND-Lot",
Expand Down
6 changes: 2 additions & 4 deletions src/test/resources/sdk-fixture/2.0/fields/fwd/nodes.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
"id" : "ND-Root",
"xpathAbsolute" : "/*",
"xpathRelative" : "/*",
"repeatable" : false,
"alias" : "root"
"repeatable" : false
}, {
"id" : "ND-Fwd-Only",
"parentId" : "ND-Lot",
Expand All @@ -20,7 +19,6 @@
"parentId" : "ND-Root",
"xpathAbsolute" : "/*/cac:ProcurementProjectLot",
"xpathRelative" : "cac:ProcurementProjectLot",
"repeatable" : true,
"alias" : "lot"
"repeatable" : true
} ]
}
Loading