Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
with:
java-version: '11'
distribution: 'adopt'
server-id: ossrh
server-id: central
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Publish to the Maven Central Repository
Expand Down
56 changes: 21 additions & 35 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>eu.europa.ted.eforms</groupId>
<artifactId>eforms-sdk-analyzer</artifactId>
<version>1.13.1</version>
<version>1.14.0</version>
<packaging>kjar</packaging>

<name>eForms SDK Analyzer</name>
Expand Down Expand Up @@ -36,22 +36,9 @@
<url>https://github.com/OP-TED/eforms-sdk-analyzer</url>
</scm>

<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://${sonatype.server.url}/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://${sonatype.server.url}/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.build.outputTimestamp>2025-03-03T15:39:33Z</project.build.outputTimestamp>

<sonatype.server.url>s01.oss.sonatype.org</sonatype.server.url>
<project.build.outputTimestamp>2025-11-28T08:07:06Z</project.build.outputTimestamp>

<java.version>11</java.version>

Expand All @@ -64,16 +51,16 @@

<!-- Version - Third-party libraries -->
<version.commons-collections4>4.4</version.commons-collections4>
<version.commons-lang3>3.12.0</version.commons-lang3>
<version.commons-lang3>3.19.0</version.commons-lang3>
<version.cucumber>7.11.1</version.cucumber>
<version.drools>8.44.2.Final</version.drools>
<version.istack>3.0.11</version.istack>
<version.jackson>2.14.1</version.jackson>
<version.jackson>2.19.0</version.jackson>
<version.jaxb-bind-api>4.0.0</version.jaxb-bind-api>
<version.jaxb-impl>4.0.4</version.jaxb-impl>
<version.jmh>1.37</version.jmh>
<version.junit>5.9.2</version.junit>
<version.logback>1.4.14</version.logback>
<version.logback>1.5.21</version.logback>
<version.maven-model>3.9.1</version.maven-model>
<version.picocli>4.6.3</version.picocli>
<version.ph-schematron>8.0.3</version.ph-schematron>
Expand All @@ -89,7 +76,7 @@
<version.javadoc.plugin>3.10.0</version.javadoc.plugin>
<version.source.plugin>3.3.1</version.source.plugin>
<version.surefire.plugin>3.2.5</version.surefire.plugin>
<version.nexus-staging.plugin>1.6.14</version.nexus-staging.plugin>
<version.central-publishing.plugin>0.8.0</version.central-publishing.plugin>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -399,9 +386,9 @@

<repositories>
<repository>
<id>oss-snapshots</id>
<name>OSS Snapshots repository</name>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
<id>central-snapshots</id>
<name>Central Snapshots repository</name>
<url>https://central.sonatype.com/repository/maven-snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
Expand Down Expand Up @@ -453,9 +440,9 @@
<version>${version.drools}</version>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>${version.nexus-staging.plugin}</version>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>${version.central-publishing.plugin}</version>
</plugin>
</plugins>
</pluginManagement>
Expand Down Expand Up @@ -593,16 +580,15 @@
</gpgArguments>
</configuration>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://${sonatype.server.url}/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<publishingServerId>central</publishingServerId>
<autoPublish>true</autoPublish>
</configuration>
</plugin>
</plugins>
</build>
</profile>
Expand Down
12 changes: 12 additions & 0 deletions src/main/java/eu/europa/ted/eforms/sdk/analysis/FactsLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import eu.europa.ted.eforms.sdk.analysis.fact.SvrlReportFact;
import eu.europa.ted.eforms.sdk.analysis.fact.TranslationsIndexFact;
import eu.europa.ted.eforms.sdk.analysis.fact.ViewTemplateFact;
import eu.europa.ted.eforms.sdk.analysis.fact.ViewTemplatesIndexFact;
import eu.europa.ted.eforms.sdk.analysis.fact.XmlNoticeFact;

public class FactsLoader {
Expand Down Expand Up @@ -147,6 +148,17 @@ public DataStore<ViewTemplateFact> loadViewTemplates() throws IOException {
return datastore;
}

public DataStore<ViewTemplatesIndexFact> loadViewTemplatesIndex() throws IOException {
logger.debug("Creating facts datastore for view templates index");

TedefoViewTemplatesIndex viewTemplatesIndex = sdkLoader.getViewTemplatesIndex();

final DataStore<ViewTemplatesIndexFact> datastore = DataSource.createStore();
datastore.add(new ViewTemplatesIndexFact(viewTemplatesIndex));

return datastore;
}

public DataStore<DocumentTypeFact> loadDocumentTypes() throws IOException {
logger.debug("Creating facts datastore for document types");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"attributeName", "attributeOf", "attributes",
"presetValue", "businessEntityId", "idSchemes", "idScheme", "schemeName", "referencedBusinessEntityIds",
"legalType", "maxLength", "description",
"privacy", "repeatable", "forbidden", "mandatory", "pattern", "rangeNumeric", "codeList",
"privacy", "repeatable", "forbidden", "mandatory", "pattern", "numericRange", "codeList",
"inChangeNotice", "inContinueProcedure", "assert"})
public class Field implements Serializable {
private static final long serialVersionUID = -1387933500392516298L;
Expand Down Expand Up @@ -68,7 +68,7 @@ public class Field implements Serializable {
private BooleanProperty mandatory;

private StringProperty pattern;
private RangeNumericProperty rangeNumeric;
private RangeNumericProperty numericRange;
private CodeListProperty codeList;

private ChangeableOrCpProperty inChangeNotice;
Expand Down Expand Up @@ -181,8 +181,8 @@ public StringProperty getPattern() {
return pattern;
}

public RangeNumericProperty getRangeNumeric() {
return rangeNumeric;
public RangeNumericProperty getNumericRange() {
return numericRange;
}

public CodeListProperty getCodeList() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,9 @@ public enum NoticeLegalBasis implements ILiteral {

_31985R2137("31985R2137"),

_32018R1046("32018R1046"),

_32024R2509("32024R2509"),

OTHER("other"),

UNKNOWN("unknown");
OTHER("other");

private final String literal;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import eu.europa.ted.eforms.sdk.analysis.fact.SchematronFileFact;
import eu.europa.ted.eforms.sdk.analysis.fact.SvrlReportFact;
import eu.europa.ted.eforms.sdk.analysis.fact.ViewTemplateFact;
import eu.europa.ted.eforms.sdk.analysis.fact.ViewTemplatesIndexFact;
import eu.europa.ted.eforms.sdk.analysis.fact.XmlNoticeFact;
import eu.europa.ted.eforms.sdk.analysis.vo.SdkMetadata;
import eu.europa.ted.eforms.sdk.analysis.vo.ValidationResult;
Expand All @@ -39,6 +40,7 @@ public class SdkUnit implements RuleUnit {
private DataStore<NodeFact> nodes;
private DataStore<NoticeTypesIndexFact> noticeTypesIndex;
private DataStore<NoticeTypeFact> noticeTypes;
private DataStore<ViewTemplatesIndexFact> viewTemplatesIndex;
private DataStore<ViewTemplateFact> viewTemplates;
private DataStore<SvrlReportFact> svrlReports;
private DataStore<SchematronFileFact> schematrons;
Expand Down Expand Up @@ -153,6 +155,15 @@ public SdkUnit setNoticeTypes(DataStore<NoticeTypeFact> noticeTypes) {
return this;
}

public DataStore<ViewTemplatesIndexFact> getViewTemplatesIndex() {
return viewTemplatesIndex;
}

public SdkUnit setViewTemplatesIndex(DataStore<ViewTemplatesIndexFact> viewTemplatesIndex) {
this.viewTemplatesIndex = viewTemplatesIndex;
return this;
}

public DataStore<ViewTemplateFact> getViewTemplates() {
return viewTemplates;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ public String getBusinessEntityId() {
*/
private Stream<AbstractFieldProperty<? extends AbstractConstraint<?>, ?>> getDynamicProperties() {
return Stream.of(field.getRepeatable(), field.getForbidden(), field.getMandatory(),
field.getCodeList(), field.getPattern(), field.getRangeNumeric(), field.getAssertion(),
field.getCodeList(), field.getPattern(), field.getNumericRange(), field.getAssertion(),
field.getInChangeNotice(), field.getInContinueProcedure());
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package eu.europa.ted.eforms.sdk.analysis.fact;

import java.util.Set;
import java.util.stream.Collectors;

import org.apache.commons.lang3.StringUtils;

import eu.europa.ted.eforms.sdk.analysis.domain.view.index.TedefoViewTemplateIndex;
import eu.europa.ted.eforms.sdk.analysis.domain.view.index.TedefoViewTemplatesIndex;

public class ViewTemplatesIndexFact implements SdkComponentFact<String> {

private final TedefoViewTemplatesIndex viewTemplatesIndex;

public ViewTemplatesIndexFact(TedefoViewTemplatesIndex viewTemplatesIndex) {
this.viewTemplatesIndex = viewTemplatesIndex;
}

public Set<String> getLabelIds() {
return viewTemplatesIndex.getViewTemplates().stream()
.map(TedefoViewTemplateIndex::getLabelId)
.collect(Collectors.toSet());
}

@Override
public String getId() {
return StringUtils.EMPTY;
}

@Override
public String getTypeName() {
return "viewTemplatesIndex";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public Validator validate() throws Exception {
.setNoticeTypesIndex(factsLoader.loadNoticeTypesIndex())
.setLabels(factsLoader.loadLabels())
.setViewTemplates(factsLoader.loadViewTemplates())
.setViewTemplatesIndex(factsLoader.loadViewTemplatesIndex())
.setXmlNotices(factsLoader.loadXmlNotices())
.setSvrlReports(factsLoader.loadSvrlReports())
.setSchematrons(factsLoader.loadSchematrons());
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package eu.europa.ted.eforms.sdk.analysis.drools;

unit SdkUnit;

rule "View templates index references existing labels"
when
$labelId : /viewTemplatesIndex[ $v: this ]/labelIds
not (exists /labels[ id == $labelId ])
then
results.add(new ValidationResult($v, "Referenced label " + $labelId + " does not exist", ValidationStatusEnum.ERROR));
end
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ public void i_load_all_labels()
@When("I load the view templates index")
public void i_load_the_view_templates_index()
throws IOException, JAXBException, SAXException, ParserConfigurationException {
sdkValidator.getSdkUnit().setViewTemplatesIndex(new FactsLoader(testsFolder).loadViewTemplatesIndex());
}

@When("I load the view templates")
public void i_load_the_view_templates()
throws IOException, JAXBException, SAXException, ParserConfigurationException {
sdkValidator.getSdkUnit().setViewTemplates(new FactsLoader(testsFolder).loadViewTemplates());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@
"viewTemplateIds" : [ "40", "summary" ]
}, {
"documentType" : "PIN",
"legalBasis" : "32018R1046",
"legalBasis" : "32024R2509",
"formType" : "competition",
"type" : "pin-cfc-standard",
"description" : "Call for expressions of interest",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@
"viewTemplateIds" : [ "40", "summary" ]
}, {
"documentType" : "PIN",
"legalBasis" : "32018R1046",
"legalBasis" : "32024R2509",
"formType" : "competition",
"type" : "pin-cfc-standard",
"description" : "Call for expressions of interest",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@
"viewTemplateIds" : [ "40", "summary" ]
}, {
"documentType" : "PIN",
"legalBasis" : "32018R1046",
"legalBasis" : "32024R2509",
"formType" : "competition",
"type" : "pin-cfc-standard",
"description" : "Call for expressions of interest",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@
"viewTemplateIds" : [ "40", "summary" ]
}, {
"documentType" : "PIN",
"legalBasis" : "32018R1046",
"legalBasis" : "32024R2509",
"formType" : "competition",
"type" : "pin-cfc-standard",
"description" : "Call for expressions of interest",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"files" : [ {
"assetType" : "view",
"twoLetterCode" : "en",
"threeLetterCode" : "eng",
"filename" : "view_en.xml"
} ],
"languages" : [ {
"description" : "English",
"twoLetterCode" : "en",
"threeLetterCode" : "eng"
} ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
<comment>view in English. File generated from metadata database.</comment>
<entry key="view|name|1">View template for notice subtype 1</entry>
<entry key="view|name|2">View template for notice subtype 2</entry>
<entry key="view|name|summary">View template for notice summary</entry>
</properties>
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"ublVersion" : "2.3",
"sdkVersion" : "1.6.0",
"metadataDatabase" : {
"version" : "1.5.29",
"createdOn" : "2023-01-24T11:03:12"
},
"viewTemplates" : [ {
"id" : "1",
"filename" : "1.efx",
"description" : "Default",
"_noticeSubtypeIds" : [ "1" ],
"_label" : "view|name|1"
}, {
"id" : "2",
"filename" : "2.efx",
"description" : "Default",
"_noticeSubtypeIds" : [ "2" ],
"_label" : "view|name|2BAD"
}, {
"id" : "3",
"filename" : "3.efx",
"description" : "Default",
"_noticeSubtypeIds" : [ "3" ],
"_label" : "view|name|3"
} , {
"id" : "summary",
"filename" : "summary.efx",
"description" : "The summary view works for all notices",
"_noticeSubtypeIds" : [ "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "CEI", "T01", "T02", "X01", "X02" ],
"_label" : "view|name|summary"
} ]
}
Loading