Skip to content

Commit

Permalink
Merge pull request #58 from OP-TED/release/1.12.0
Browse files Browse the repository at this point in the history
Prepare release of version 1.12.0
  • Loading branch information
bertrand-lorentz authored Jun 14, 2024
2 parents 46e0c99 + abd2806 commit 97f4535
Show file tree
Hide file tree
Showing 100 changed files with 35,767 additions and 228 deletions.
23 changes: 16 additions & 7 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.11.0</version>
<version>1.12.0</version>
<packaging>kjar</packaging>

<name>eforms-sdk-analyzer</name>
Expand All @@ -29,15 +29,15 @@
<finalName>${project.artifactId}-${project.version}</finalName>

<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.build.outputTimestamp>2024-03-04T15:16:30Z</project.build.outputTimestamp>
<project.build.outputTimestamp>2024-06-11T14:03:49Z</project.build.outputTimestamp>

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

<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>

<version.eforms-core-java>1.3.0</version.eforms-core-java>
<version.efx-toolkit>2.0.0-alpha.2</version.efx-toolkit>
<version.eforms-core-java>1.4.0-SNAPSHOT</version.eforms-core-java>
<version.efx-toolkit>2.0.0-SNAPSHOT</version.efx-toolkit>

<!-- Version - Third-party libraries -->
<version.commons-collections4>4.4</version.commons-collections4>
Expand All @@ -46,13 +46,13 @@
<version.drools>8.44.0.Final</version.drools>
<version.istack>3.0.11</version.istack>
<version.jackson>2.14.1</version.jackson>
<version.jaxb-bind-api>2.3.2</version.jaxb-bind-api>
<version.jaxb-impl>2.3.2</version.jaxb-impl>
<version.jaxb-bind-api>4.0.0</version.jaxb-bind-api>
<version.jaxb-impl>4.0.4</version.jaxb-impl>
<version.junit>5.9.2</version.junit>
<version.logback>1.4.14</version.logback>
<version.maven-model>3.9.1</version.maven-model>
<version.picocli>4.6.3</version.picocli>
<version.ph-schematron>6.3.4</version.ph-schematron>
<version.ph-schematron>8.0.0</version.ph-schematron>
<version.semver4j>3.1.0</version.semver4j>
<version.slf4j>2.0.3</version.slf4j>
<version.xmlschema>2.3.0</version.xmlschema>
Expand Down Expand Up @@ -183,6 +183,11 @@
<artifactId>ph-schematron-api</artifactId>
<version>${version.ph-schematron}</version>
</dependency>
<dependency>
<groupId>com.helger.schematron</groupId>
<artifactId>ph-schematron-pure</artifactId>
<version>${version.ph-schematron}</version>
</dependency>
<dependency>
<groupId>com.helger.schematron</groupId>
<artifactId>ph-schematron-validator</artifactId>
Expand Down Expand Up @@ -335,6 +340,10 @@
<groupId>com.helger.schematron</groupId>
<artifactId>ph-schematron-api</artifactId>
</dependency>
<dependency>
<groupId>com.helger.schematron</groupId>
<artifactId>ph-schematron-pure</artifactId>
</dependency>
<dependency>
<groupId>com.helger.schematron</groupId>
<artifactId>ph-schematron-validator</artifactId>
Expand Down
25 changes: 24 additions & 1 deletion src/main/java/eu/europa/ted/eforms/sdk/analysis/FactsLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import java.io.IOException;
import java.nio.file.Path;
import java.util.List;
import javax.xml.bind.JAXBException;
import jakarta.xml.bind.JAXBException;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.xpath.XPathExpressionException;
import org.drools.ruleunits.api.DataSource;
Expand All @@ -15,13 +15,15 @@
import eu.europa.ted.eforms.sdk.analysis.domain.SvrlReport;
import eu.europa.ted.eforms.sdk.analysis.domain.XmlNotice;
import eu.europa.ted.eforms.sdk.analysis.domain.codelist.Codelist;
import eu.europa.ted.eforms.sdk.analysis.domain.field.BusinessEntity;
import eu.europa.ted.eforms.sdk.analysis.domain.field.Field;
import eu.europa.ted.eforms.sdk.analysis.domain.field.XmlStructureNode;
import eu.europa.ted.eforms.sdk.analysis.domain.label.Label;
import eu.europa.ted.eforms.sdk.analysis.domain.noticetype.DocumentType;
import eu.europa.ted.eforms.sdk.analysis.domain.noticetype.NoticeType;
import eu.europa.ted.eforms.sdk.analysis.domain.view.index.TedefoViewTemplateIndex;
import eu.europa.ted.eforms.sdk.analysis.domain.view.index.TedefoViewTemplatesIndex;
import eu.europa.ted.eforms.sdk.analysis.fact.BusinessEntityFact;
import eu.europa.ted.eforms.sdk.analysis.fact.CodelistFact;
import eu.europa.ted.eforms.sdk.analysis.fact.CodelistsIndexFact;
import eu.europa.ted.eforms.sdk.analysis.fact.DocumentTypeFact;
Expand All @@ -31,6 +33,7 @@
import eu.europa.ted.eforms.sdk.analysis.fact.NodeFact;
import eu.europa.ted.eforms.sdk.analysis.fact.NoticeTypeFact;
import eu.europa.ted.eforms.sdk.analysis.fact.NoticeTypesIndexFact;
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.TranslationsIndexFact;
import eu.europa.ted.eforms.sdk.analysis.fact.ViewTemplateFact;
Expand Down Expand Up @@ -70,6 +73,17 @@ public DataStore<FieldFact> loadFields() throws IOException {
return datastore;
}

public DataStore<BusinessEntityFact> loadBusinessEntities() throws IOException {
logger.debug("Creating facts datastore for business entities");

final DataStore<BusinessEntityFact> datastore = DataSource.createStore();

sdkLoader.getFieldsAndNodes().getBusinessEntities()
.forEach((BusinessEntity entity) -> datastore.add(new BusinessEntityFact(entity)));

return datastore;
}

public DataStore<NodeFact> loadNodes() throws IOException {
logger.debug("Creating facts datastore for nodes");

Expand Down Expand Up @@ -184,4 +198,13 @@ public DataStore<SvrlReportFact> loadSvrlReports()

return datastore;
}

public DataStore<SchematronFileFact> loadSchematrons() {
logger.debug("Creating facts datastore for Schematron files");

final DataStore<SchematronFileFact> datastore = DataSource.createStore();
sdkLoader.getSchematronFiles().forEach(f -> datastore.add(new SchematronFileFact(f)));

return datastore;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@

import java.nio.file.Path;
import eu.europa.ted.eforms.sdk.SdkSymbolResolver;
import eu.europa.ted.eforms.sdk.component.SdkComponent;
import eu.europa.ted.eforms.sdk.component.SdkComponentType;
import eu.europa.ted.eforms.sdk.SdkConstants.SdkResource;
import eu.europa.ted.eforms.sdk.repository.SdkCodelistRepository;
import eu.europa.ted.eforms.sdk.repository.SdkFieldRepository;
import eu.europa.ted.eforms.sdk.repository.SdkNodeRepository;

@SdkComponent(versions = { "1", "2" }, componentType = SdkComponentType.SYMBOL_RESOLVER,
qualifier = SdkAnalyzerSymbolResolver.QUALIFIER)
public class SdkAnalyzerSymbolResolver extends SdkSymbolResolver {
public static final String QUALIFIER = "analyzer";

public SdkAnalyzerSymbolResolver(String sdkVersion, Path sdkRootPath)
throws InstantiationException {
super(sdkVersion, sdkRootPath);
Expand Down
15 changes: 13 additions & 2 deletions src/main/java/eu/europa/ted/eforms/sdk/analysis/SdkLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import javax.xml.bind.JAXBException;
import jakarta.xml.bind.JAXBException;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.stream.StreamSource;
import javax.xml.xpath.XPathExpressionException;
Expand Down Expand Up @@ -42,13 +42,15 @@
import eu.europa.ted.eforms.sdk.analysis.domain.noticetype.NoticeType;
import eu.europa.ted.eforms.sdk.analysis.domain.noticetype.NoticeTypeSdk;
import eu.europa.ted.eforms.sdk.analysis.domain.noticetype.NoticeTypesForIndex;
import eu.europa.ted.eforms.sdk.analysis.domain.schematron.SchematronFile;
import eu.europa.ted.eforms.sdk.analysis.domain.view.index.TedefoViewTemplateIndex;
import eu.europa.ted.eforms.sdk.analysis.domain.view.index.TedefoViewTemplatesIndex;
import eu.europa.ted.eforms.sdk.analysis.domain.xml.CodeList;
import eu.europa.ted.eforms.sdk.analysis.domain.xml.Identification;
import eu.europa.ted.eforms.sdk.analysis.domain.xml.Properties;
import eu.europa.ted.eforms.sdk.analysis.domain.xml.SimpleCodeList.Row;
import eu.europa.ted.eforms.sdk.analysis.domain.xml.SimpleCodeList.Row.Value;
import eu.europa.ted.eforms.sdk.analysis.util.SchematronParser;
import eu.europa.ted.eforms.sdk.analysis.util.XmlDataExtractor;
import eu.europa.ted.eforms.sdk.analysis.util.XmlParser;

Expand Down Expand Up @@ -341,11 +343,20 @@ public XmlSchemaCollection getXmlSchemas() throws IOException {
return schemaCol;
}

public List<Path> getSchematronFiles() {
public List<Path> getSchematronFilesPaths() {
String startFile = "complete-validation.sch";

return List.of(
sdkRoot.resolve(SCHEMATRONS_DYNAMIC).resolve(startFile),
sdkRoot.resolve(SCHEMATRONS_STATIC).resolve(startFile));
}

public Set<SchematronFile> getSchematronFiles() {
final Set<SchematronFile> result = new HashSet<>();
for (Path file : getSchematronFilesPaths()) {
result.add(SchematronParser.loadSchematronFile(file));
}

return result;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package eu.europa.ted.eforms.sdk.analysis.domain.field;

import com.fasterxml.jackson.annotation.JsonPropertyOrder;

@JsonPropertyOrder({"id", "name", "description", "labelId", "repeatable", "repeatsWithNodeId",
"changeIdentification", "instanceIdentifier"})
public class BusinessEntity {
private String id;
private String name;
private String description;
private String labelId;
private boolean repeatable;
private String repeatsWithNodeId;

private BusinessEntityChangeIdentification changeIdentification;

private BusinessEntityIdentifier instanceIdentifier;

public String getId() {
return id;
}

public String getName() {
return name;
}

public String getDescription() {
return description;
}

public String getLabelId() {
return labelId;
}

public boolean isRepeatable() {
return repeatable;
}

public String getRepeatsWithNodeId() {
return repeatsWithNodeId;
}

public BusinessEntityChangeIdentification getChangeIdentification() {
return changeIdentification;
}

public BusinessEntityIdentifier getInstanceIdentifier() {
return instanceIdentifier;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package eu.europa.ted.eforms.sdk.analysis.domain.field;

import com.fasterxml.jackson.annotation.JsonPropertyOrder;

@JsonPropertyOrder({"identifyInChangeNotice", "useInstanceIdentifier", "changeIdentifier"})
public class BusinessEntityChangeIdentification {
private boolean identifyInChangeNotice;
private boolean useInstanceIdentifier;
private String changeIdentifier;

public boolean isIdentifyInChangeNotice() {
return identifyInChangeNotice;
}

public boolean isUseInstanceIdentifier() {
return useInstanceIdentifier;
}

public String getChangeIdentifier() {
return changeIdentifier;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package eu.europa.ted.eforms.sdk.analysis.domain.field;

import com.fasterxml.jackson.annotation.JsonPropertyOrder;

import eu.europa.ted.eforms.sdk.analysis.domain.field.enums.IdentifierSchemeFormatName;

@JsonPropertyOrder({"referencedBusinessEntityId", "prefix", "schemeName", "identifierFieldId",
"captionFieldId"})
public class BusinessEntityIdentifier {
private IdentifierSchemeFormatName formatName;
private String prefix;
private String schemeName;
private String referencedBusinessEntityId;
private String identifierFieldId;
private String captionFieldId;

public IdentifierSchemeFormatName getFormatName() {
return formatName;
}

public String getPrefix() {
return prefix;
}

public String getSchemeName() {
return schemeName;
}

public String getReferencedBusinessEntityId() {
return referencedBusinessEntityId;
}

public String getIdentifierFieldId() {
return identifierFieldId;
}

public String getCaptionFieldId() {
return captionFieldId;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@
* but we may not need that.
* </p>
*/
@JsonPropertyOrder({"id", "parentNodeId", "name", "btId", "xpathAbsolute", "xpathRelative", "type",
@JsonPropertyOrder({"id", "parentNodeId", "name", "btId",
"xpathAbsolute", "xpathRelative", "xsdSequenceOrder",
"type",
"attributeName", "attributeOf", "attributes",
"presetValue", "idSchemes", "idScheme", "schemeName", "legalType", "maxLength", "privacy",
"repeatable", "forbidden", "mandatory", "pattern", "rangeNumeric", "codeList", "inChangeNotice",
"inContinueProcedure", "assert"})
"presetValue", "businessEntityId", "idSchemes", "idScheme", "schemeName", "referencedBusinessEntityIds",
"legalType", "maxLength", "description",
"privacy", "repeatable", "forbidden", "mandatory", "pattern", "rangeNumeric", "codeList",
"inChangeNotice", "inContinueProcedure", "assert"})
public class Field implements Serializable {
private static final long serialVersionUID = -1387933500392516298L;

Expand All @@ -47,39 +50,30 @@ public class Field implements Serializable {
private List<String> attributes;
private String presetValue;

private String businessEntityId;

private List<String> idSchemes;
private List<String> referencedBusinessEntityIds;

private String idScheme;
private String schemeName;

private String legalType;
private Integer maxLength;

/**
* Related to TEDEFO-219.
*/
private FieldPrivacy privacy;

private BooleanProperty repeatable;
private BooleanProperty forbidden;
private BooleanProperty mandatory; // Since TEDEFO-433.
private BooleanProperty mandatory;

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

/**
* Since TEDEFO-1090. TEDEFO-1111. Can be null.
*/
private ChangeableOrCpProperty inChangeNotice;

/**
* Since TEDEFO-1090. TEDEFO-1111. Can be null.
*/
private ChangeableOrCpProperty inContinueProcedure;

/**
* Since TEDEFO-1180.
*/
@JsonProperty("assert")
private StringProperty assertion;

Expand Down Expand Up @@ -139,10 +133,18 @@ public String getPresetValue() {
return presetValue;
}

public String getBusinessEntityId() {
return businessEntityId;
}

public List<String> getIdSchemes() {
return idSchemes;
}

public List<String> getReferencedBusinessEntityIds() {
return referencedBusinessEntityIds;
}

public String getIdScheme() {
return idScheme;
}
Expand Down
Loading

0 comments on commit 97f4535

Please sign in to comment.