diff --git a/README.md b/README.md index 04c9faf..f4a508f 100644 --- a/README.md +++ b/README.md @@ -131,7 +131,7 @@ CheckConfiguration config = new CheckConfiguration(); config.setScenarioDefinition(scenarios); //Instanziierung der DefaultCheck-Implementierung -Check check = new DefaultCheck(config); +Check implemenation = new DefaultCheck(config); ``` Weitere Konfigurationsoption ist der Pfad zum Repository. Standardmäßig wird das Repository relativ zur Szenarien-Defintion @@ -148,12 +148,12 @@ Check pruefer = new DefaultCheck(config); //einzelne Datei prüfen Input pruefKandidat = InputFactory.read(new File("rechnung.xml")); -Document report = pruefer.check(pruefKandidat); +Document report = pruefer.implemenation(pruefKandidat); //Batch-Prüfung List files = Files.list(Paths.get("rechnungen")).map(path -> path.toFile()).collect(Collectors.toList()); List toCheck = files.stream().map(InputFactory::read).collect(Collectors.toList()); -List reports = pruefer.check(toCheck); +List reports = pruefer.implemenation(toCheck); ``` @@ -284,7 +284,7 @@ verwiesen. insgesamt 310 prüfbaren Aussagen (Assertions) über die resultierenden Prüfberichte erstellt. * Durch diese Testsuite werden, ausgehend von dem Prüfbericht-Schemas alle möglichen Optionen und Auswahlmöglichkeiten mindestens je einmal positiv und einmal negativ getestet. -* Diese Zusicherungen können vom Prüftool selbst mittels des Schalter `--check-assertions` automatisch geprüft werden. +* Diese Zusicherungen können vom Prüftool selbst mittels des Schalter `--implemenation-assertions` automatisch geprüft werden. * Zudem wird die Integrität aller erstellten Prüfberichte automatisch gegen das Schema (XML Schema und Schematron-Regeln) des Prüfberichts getestet. * Für weitere Details siehe [xrechnung/test/readme.txt](configurations/xrechnung/test/readme.txt). diff --git a/pom.xml b/pom.xml index 16b9273..85bc38c 100644 --- a/pom.xml +++ b/pom.xml @@ -18,7 +18,8 @@ ~ under the License. --> - + 4.0.0 3.0 @@ -26,7 +27,7 @@ KoSIT XML Prüftool Implementierung - de.kosit + de.kosit 1.1.0-SNAPSHOT validationtool @@ -51,6 +52,7 @@ 1.16.16 9.9.1-1 1.7.25 + localhost @@ -107,6 +109,12 @@ 1.3.2 test + + io.rest-assured + rest-assured + 3.3.0 + test + @@ -128,6 +136,7 @@ UTF-8 + maven-jar-plugin 2.3.1 @@ -215,6 +224,86 @@ + + io.fabric8 + docker-maven-plugin + 0.28.0 + + tcp://localhost:2375 + true + true + false + + + daemon + daemon + + daemon + + + + + ${project.build.directory}/validationtool-${project.version}-standalone.jar + validationtool-standalone.jar + + + + + + + + bridge + + + 8080:8080 + + + + + + + + + + + up + pre-integration-test + + build + start + + + + post + post-integration-test + + stop + + + + + + + org.apache.maven.plugins + maven-failsafe-plugin + 2.22.1 + + + + integration-test + verify + + + + + -Ddaemon.port=8080 + -Ddaemon.host=http://localhost/ + + + + + + org.codehaus.mojo diff --git a/src/main/docker/daemon/Dockerfile b/src/main/docker/daemon/Dockerfile new file mode 100644 index 0000000..c95f712 --- /dev/null +++ b/src/main/docker/daemon/Dockerfile @@ -0,0 +1,8 @@ +FROM openjdk:8 + +RUN mkdir /opt/validationtool +ADD maven/validationtool-standalone.jar /opt/validationtool +ADD run.sh /opt/validationtool/ +ADD config/ /opt/validationtool/ +EXPOSE 8080 +ENTRYPOINT ["bash", "/opt/validationtool/run.sh" ] \ No newline at end of file diff --git a/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/CCTS_CCT_SchemaModule-2.1.xsd b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/CCTS_CCT_SchemaModule-2.1.xsd new file mode 100644 index 0000000..2bc034a --- /dev/null +++ b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/CCTS_CCT_SchemaModule-2.1.xsd @@ -0,0 +1,769 @@ + + + + + + + + + + + + + + + + UNDT000001 + CCT + Amount. Type + 1.0 + A number of monetary units specified in a currency where the unit of the currency is + explicit or implied. + + Amount + decimal + + + + + + + + UNDT000001-SC2 + SC + Amount Currency. Identifier + The currency of the amount. + Amount Currency + Identification + Identifier + string + Reference UNECE Rec 9, using 3-letter alphabetic codes. + + + + + + + UNDT000001-SC3 + SC + Amount Currency. Code List Version. Identifier + + The VersionID of the UN/ECE Rec9 code list. + Amount Currency + Code List Version + Identifier + string + + + + + + + + + + + + UNDT000002 + CCT + Binary Object. Type + 1.0 + A set of finite-length sequences of binary octets. + Binary Object + binary + + + + + + + + UNDT000002-SC2 + SC + Binary Object. Format. Text + The format of the binary content. + Binary Object + Format + Text + string + + + + + + + UNDT000002-SC3 + SC + Binary Object. Mime. Code + The mime type of the binary object. + Binary Object + Mime + Code + string + + + + + + + UNDT000002-SC4 + SC + Binary Object. Encoding. Code + Specifies the decoding algorithm of the binary object. + Binary Object + Encoding + Code + string + + + + + + + UNDT000002-SC5 + SC + Binary Object. Character Set. Code + The character set of the binary object if the mime type is text. + + Binary Object + Character Set + Code + string + + + + + + + UNDT000002-SC6 + SC + Binary Object. Uniform Resource. Identifier + + The Uniform Resource Identifier that identifies where the binary object is + located. + + Binary Object + Uniform Resource Identifier + Identifier + string + + + + + + + UNDT000002-SC7 + SC + Binary Object. Filename.Text + The filename of the binary object. + Binary Object + Filename + Text + string + + + + + + + + + + + + UNDT000007 + CCT + Code. Type + 1.0 + A character string (letters, figures, or symbols) that for brevity and/or languange + independence may be used to represent or replace a definitive value or text of an attribute together + with relevant supplementary information. + + Code + string + Should not be used if the character string identifies an instance of an object class or + an object in the real world, in which case the Identifier. Type should be used. + + + + + + + + + UNDT000007-SC2 + SC + Code List. Identifier + The identification of a list of codes. + Code List + Identification + Identifier + string + + + + + + + UNDT000007-SC3 + SC + Code List. Agency. Identifier + An agency that maintains one or more lists of codes. + Code List + Agency + Identifier + string + Defaults to the UN/EDIFACT data element 3055 code list. + + + + + + + UNDT000007-SC4 + SC + Code List. Agency Name. Text + The name of the agency that maintains the list of codes. + Code List + Agency Name + Text + string + + + + + + + UNDT000007-SC5 + SC + Code List. Name. Text + The name of a list of codes. + Code List + Name + Text + string + + + + + + + UNDT000007-SC6 + SC + Code List. Version. Identifier + The version of the list of codes. + Code List + Version + Identifier + string + + + + + + + UNDT000007-SC7 + SC + Code. Name. Text + The textual equivalent of the code content component. + Code + Name + Text + string + + + + + + + UNDT000007-SC8 + SC + Language. Identifier + The identifier of the language used in the code name. + Language + Identification + Identifier + string + + + + + + + UNDT000007-SC9 + SC + Code List. Uniform Resource. Identifier + The Uniform Resource Identifier that identifies where the code list is + located. + + Code List + Uniform Resource Identifier + Identifier + string + + + + + + + UNDT000007-SC10 + SC + Code List Scheme. Uniform Resource. Identifier + + The Uniform Resource Identifier that identifies where the code list scheme + is located. + + Code List Scheme + Uniform Resource Identifier + Identifier + string + + + + + + + + + + + + UNDT000008 + CCT + Date Time. Type + 1.0 + A particular point in the progression of time together with the relevant supplementary + information. + + Date Time + string + Can be used for a date and/or time. + + + + + + + + UNDT000008-SC1 + SC + Date Time. Format. Text + The format of the date time content + Date Time + Format + Text + string + + + + + + + + + + + + UNDT000011 + CCT + Identifier. Type + 1.0 + A character string to identify and distinguish uniquely, one instance of an object in + an identification scheme from all other objects in the same scheme together with relevant + supplementary information. + + Identifier + string + + + + + + + + UNDT000011-SC2 + SC + Identification Scheme. Identifier + The identification of the identification scheme. + Identification Scheme + Identification + Identifier + string + + + + + + + UNDT000011-SC3 + SC + Identification Scheme. Name. Text + The name of the identification scheme. + Identification Scheme + Name + Text + string + + + + + + + UNDT000011-SC4 + SC + Identification Scheme Agency. Identifier + + The identification of the agency that maintains the identification + scheme. + + Identification Scheme Agency + Identification + Identifier + string + Defaults to the UN/EDIFACT data element 3055 code list. + + + + + + + UNDT000011-SC5 + SC + Identification Scheme Agency. Name. Text + + The name of the agency that maintains the identification scheme. + + Identification Scheme Agency + Agency Name + Text + string + + + + + + + UNDT000011-SC6 + SC + Identification Scheme. Version. Identifier + + The version of the identification scheme. + Identification Scheme + Version + Identifier + string + + + + + + + UNDT000011-SC7 + SC + Identification Scheme Data. Uniform Resource. Identifier + + The Uniform Resource Identifier that identifies where the identification + scheme data is located. + + Identification Scheme Data + Uniform Resource Identifier + Identifier + string + + + + + + + UNDT000011-SC8 + SC + Identification Scheme. Uniform Resource. Identifier + + The Uniform Resource Identifier that identifies where the identification + scheme is located. + + Identification Scheme + Uniform Resource Identifier + Identifier + string + + + + + + + + + + + + UNDT000012 + CCT + Indicator. Type + 1.0 + A list of two mutually exclusive Boolean values that express the only possible states + of a Property. + + Indicator + string + + + + + + + + UNDT000012-SC2 + SC + Indicator. Format. Text + Whether the indicator is numeric, textual or binary. + Indicator + Format + Text + string + + + + + + + + + + + + UNDT000013 + CCT + Measure. Type + 1.0 + A numeric value determined by measuring an object along with the specified unit of + measure. + + Measure + decimal + + + + + + + + UNDT000013-SC2 + SC + Measure Unit. Code + The type of unit of measure. + Measure Unit + Code + Code + string + Reference UNECE Rec. 20 and X12 355 + + + + + + + UNDT000013-SC3 + SC + Measure Unit. Code List Version. Identifier + + The version of the measure unit code list. + Measure Unit + Code List Version + Identifier + string + + + + + + + + + + + + UNDT000014 + CCT + Numeric. Type + 1.0 + Numeric information that is assigned or is determined by calculation, counting, or + sequencing. It does not require a unit of quantity or unit of measure. + + Numeric + string + + + + + + + + UNDT000014-SC2 + SC + Numeric. Format. Text + Whether the number is an integer, decimal, real number or percentage. + + Numeric + Format + Text + string + + + + + + + + + + + + UNDT000018 + CCT + Quantity. Type + 1.0 + A counted number of non-monetary units possibly including fractions. + Quantity + decimal + + + + + + + + UNDT000018-SC2 + SC + Quantity. Unit. Code + The unit of the quantity + Quantity + Unit Code + Code + string + + + + + + + UNDT000018-SC3 + SC + Quantity Unit. Code List. Identifier + The quantity unit code list. + Quantity Unit + Code List + Identifier + string + + + + + + + UNDT000018-SC4 + SC + Quantity Unit. Code List Agency. Identifier + + The identification of the agency that maintains the quantity unit code + list + + Quantity Unit + Code List Agency + Identifier + string + Defaults to the UN/EDIFACT data element 3055 code list. + + + + + + + UNDT000018-SC5 + SC + Quantity Unit. Code List Agency Name. Text + + The name of the agency which maintains the quantity unit code list. + + Quantity Unit + Code List Agency Name + Text + string + + + + + + + + + + + + UNDT000019 + CCT + Text. Type + 1.0 + A character string (i.e. a finite set of characters) generally in the form of words of + a language. + + Text + string + + + + + + + + UNDT000019-SC2 + SC + Language. Identifier + The identifier of the language used in the content component. + + Language + Identification + Identifier + string + + + + + + + UNDT000019-SC3 + SC + Language. Locale. Identifier + The identification of the locale of the language. + Language + Locale + Identifier + string + + + + + + + diff --git a/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-CommonAggregateComponents-2.1.xsd b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-CommonAggregateComponents-2.1.xsd new file mode 100644 index 0000000..59b826d --- /dev/null +++ b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-CommonAggregateComponents-2.1.xsd @@ -0,0 +1,4166 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-CommonBasicComponents-2.1.xsd b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-CommonBasicComponents-2.1.xsd new file mode 100644 index 0000000..6a00c5d --- /dev/null +++ b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-CommonBasicComponents-2.1.xsd @@ -0,0 +1,5394 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-CommonExtensionComponents-2.1.xsd b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-CommonExtensionComponents-2.1.xsd new file mode 100644 index 0000000..2a9fc38 --- /dev/null +++ b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-CommonExtensionComponents-2.1.xsd @@ -0,0 +1,235 @@ + + + + + + + + + + + + + A container for all extensions present in the document. + + + + + + + A container for all extensions present in the document. + + + + + + + A single extension for private use. + + + + + + + + + A single extension for private use. + + + + + + + A single extension for private use. + + + + + + + An identifier for the Extension assigned by the creator of the extension. + + + + + + + A name for the Extension assigned by the creator of the extension. + + + + + + + An agency that maintains one or more Extensions. + + + + + + + The name of the agency that maintains the Extension. + + + + + + + The version of the Extension. + + + + + + + A URI for the Agency that maintains the Extension. + + + + + + + A URI for the Extension. + + + + + + + A code for reason the Extension is being included. + + + + + + + A description of the reason for the Extension. + + + + + + + The definition of the extension content. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-CommonSignatureComponents-2.1.xsd b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-CommonSignatureComponents-2.1.xsd new file mode 100644 index 0000000..fa0f481 --- /dev/null +++ b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-CommonSignatureComponents-2.1.xsd @@ -0,0 +1,81 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-CoreComponentParameters-2.1.xsd b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-CoreComponentParameters-2.1.xsd new file mode 100644 index 0000000..fbda5b8 --- /dev/null +++ b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-CoreComponentParameters-2.1.xsd @@ -0,0 +1,73 @@ + + + + + + diff --git a/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-ExtensionContentDataType-2.1.xsd b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-ExtensionContentDataType-2.1.xsd new file mode 100644 index 0000000..3a8235b --- /dev/null +++ b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-ExtensionContentDataType-2.1.xsd @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + Any element in any namespace other than the UBL extension + namespace is allowed to be the apex element of an extension. + Only those elements found in the UBL schemas and in the + trees of schemas imported in this module are validated. + Any element for which there is no schema declaration in any + of the trees of schemas passes validation and is not + treated as a schema constraint violation. + + + + + + + + \ No newline at end of file diff --git a/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-QualifiedDataTypes-2.1.xsd b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-QualifiedDataTypes-2.1.xsd new file mode 100644 index 0000000..9f22f94 --- /dev/null +++ b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-QualifiedDataTypes-2.1.xsd @@ -0,0 +1,78 @@ + + + + + + + + + + diff --git a/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-SignatureAggregateComponents-2.1.xsd b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-SignatureAggregateComponents-2.1.xsd new file mode 100644 index 0000000..e58388c --- /dev/null +++ b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-SignatureAggregateComponents-2.1.xsd @@ -0,0 +1,102 @@ + + + + + + + + + + + + + + + + + + + + This is a single digital signature as defined by the W3C specification. + + + + + + + \ No newline at end of file diff --git a/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-SignatureBasicComponents-2.1.xsd b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-SignatureBasicComponents-2.1.xsd new file mode 100644 index 0000000..76d1881 --- /dev/null +++ b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-SignatureBasicComponents-2.1.xsd @@ -0,0 +1,83 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-UnqualifiedDataTypes-2.1.xsd b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-UnqualifiedDataTypes-2.1.xsd new file mode 100644 index 0000000..2480083 --- /dev/null +++ b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-UnqualifiedDataTypes-2.1.xsd @@ -0,0 +1,554 @@ + + + + + + + + + + UBLUDT000001 + UDT + Amount. Type + 1.0 + A number of monetary units specified using a given unit of currency. + Amount + + + + + + + + UNDT000001-SC2 + SC + Amount. Currency. Identifier + The currency of the amount. + Amount Currency + Identification + Identifier + string + Reference UNECE Rec 9, using 3-letter alphabetic codes. + + + + + + + + + + + UBLUDT000002 + UDT + Binary Object. Type + 1.0 + A set of finite-length sequences of binary octets. + Binary Object + binary + + + + + + + + UNDT000002-SC3 + SC + Binary Object. Mime. Code + The mime type of the binary object. + Binary Object + Mime + Code + string + + + + + + + + + + + UBLUDT000003 + UDT + Graphic. Type + 1.0 + A diagram, graph, mathematical curve, or similar representation. + Graphic + binary + + + + + + + + UNDT000003-SC3 + SC + Graphic. Mime. Code + The mime type of the graphic object. + Graphic + Mime + Code + normalizedString + + + + + + + + + + + UBLUDT000004 + UDT + Picture. Type + 1.0 + A diagram, graph, mathematical curve, or similar representation. + Picture + binary + + + + + + + + UNDT000004-SC3 + SC + Picture. Mime. Code + The mime type of the picture object. + Picture + Mime + Code + normalizedString + + + + + + + + + + + UBLUDT000005 + UDT + Sound. Type + 1.0 + An audio representation. + Sound + binary + + + + + + + + UNDT000005-SC3 + SC + Sound. Mime. Code + The mime type of the sound object. + Sound + Mime + Code + normalizedString + + + + + + + + + + + UBLUDT000006 + UDT + Video. Type + 1.0 + A video representation. + Video + binary + + + + + + + + UNDT000006-SC3 + SC + Video. Mime. Code + The mime type of the video object. + Video + Mime + Code + normalizedString + + + + + + + + + + + UBLUDT000007 + UDT + Code. Type + 1.0 + A character string (letters, figures, or symbols) that for brevity and/or language + independence may be used to represent or replace a definitive value or text of an attribute, + together with relevant supplementary information. + + Code + string + Other supplementary components in the CCT are captured as part of the token and name for + the schema module containing the code list and thus, are not declared as attributes. + + + + + + + + + + + + UBLUDT000008 + UDT + Date Time. Type + 1.0 + A particular point in the progression of time, together with relevant supplementary + information. + + Date Time + string + Can be used for a date and/or time. + + + + + + + + + + + UBLUDT000009 + UDT + Date. Type + 1.0 + One calendar day according the Gregorian calendar. + Date + string + + + + + + + + + + + UBLUDT0000010 + UDT + Time. Type + 1.0 + An instance of time that occurs every day. + Time + string + + + + + + + + + + + UBLUDT0000011 + UDT + Identifier. Type + 1.0 + A character string to identify and uniquely distinguish one instance of an object in an + identification scheme from all other objects in the same scheme, together with relevant + supplementary information. + + Identifier + string + Other supplementary components in the CCT are captured as part of the token and name for + the schema module containing the identifier list and thus, are not declared as attributes. + + + + + + + + + + + + UBLUDT0000012 + UDT + Indicator. Type + 1.0 + A list of two mutually exclusive Boolean values that express the only possible states + of a property. + + Indicator + string + + + + + + + + + + + UBLUDT0000013 + UDT + Measure. Type + 1.0 + A numeric value determined by measuring an object using a specified unit of measure. + + Measure + Type + decimal + + + + + + + + UNDT000013-SC2 + SC + Measure. Unit. Code + The type of unit of measure. + Measure Unit + Code + Code + normalizedString + Reference UNECE Rec. 20 and X12 355 + + + + + + + + + + + UBLUDT0000014 + UDT + Numeric. Type + 1.0 + Numeric information that is assigned or is determined by calculation, counting, or + sequencing. It does not require a unit of quantity or unit of measure. + + Numeric + string + + + + + + + + + + + UBLUDT0000015 + UDT + 1.0 + Value. Type + Numeric information that is assigned or is determined by calculation, counting, or + sequencing. It does not require a unit of quantity or unit of measure. + + Value + string + + + + + + + + + + + UBLUDT0000016 + UDT + 1.0 + Percent. Type + Numeric information that is assigned or is determined by calculation, counting, or + sequencing and is expressed as a percentage. It does not require a unit of quantity or unit of + measure. + + Percent + string + + + + + + + + + + + UBLUDT0000017 + UDT + 1.0 + Rate. Type + A numeric expression of a rate that is assigned or is determined by calculation, + counting, or sequencing. It does not require a unit of quantity or unit of measure. + + Rate + string + + + + + + + + + + + UBLUDT0000018 + UDT + Quantity. Type + 1.0 + A counted number of non-monetary units, possibly including a fractional part. + + Quantity + decimal + + + + + + + + + + + UBLUDT0000019 + UDT + Text. Type + 1.0 + A character string (i.e. a finite set of characters), generally in the form of words of + a language. + + Text + string + + + + + + + + + + + UBLUDT0000020 + UDT + Name. Type + 1.0 + A character string that constitutes the distinctive designation of a person, place, + thing or concept. + + Name + string + + + + + + + diff --git a/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-XAdESv132-2.1.xsd b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-XAdESv132-2.1.xsd new file mode 100644 index 0000000..f08c7ba --- /dev/null +++ b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-XAdESv132-2.1.xsd @@ -0,0 +1,499 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-XAdESv141-2.1.xsd b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-XAdESv141-2.1.xsd new file mode 100644 index 0000000..801bae9 --- /dev/null +++ b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-XAdESv141-2.1.xsd @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-xmldsig-core-schema-2.1.xsd b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-xmldsig-core-schema-2.1.xsd new file mode 100644 index 0000000..b30b1d4 --- /dev/null +++ b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-xmldsig-core-schema-2.1.xsd @@ -0,0 +1,332 @@ + + + + + + + + + ]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/maindoc/UBL-CreditNote-2.1.xsd b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/maindoc/UBL-CreditNote-2.1.xsd new file mode 100644 index 0000000..91d48d9 --- /dev/null +++ b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/maindoc/UBL-CreditNote-2.1.xsd @@ -0,0 +1,153 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/maindoc/UBL-Invoice-2.1.xsd b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/maindoc/UBL-Invoice-2.1.xsd new file mode 100644 index 0000000..94ad2cc --- /dev/null +++ b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/maindoc/UBL-Invoice-2.1.xsd @@ -0,0 +1,156 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsl/BIIRULES-UBL-T10.xsl b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsl/BIIRULES-UBL-T10.xsl new file mode 100644 index 0000000..b89fbc5 --- /dev/null +++ b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsl/BIIRULES-UBL-T10.xsl @@ -0,0 +1,1383 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + / + + + + + + *: + + [namespace-uri()=' + + '] + + + + [ + + ] + + + + / + + @ + + + @*[local-name()=' + + ' and namespace-uri()=' + + '] + + + + + + + + + / + + + [ + + ] + + + + /@ + + + + + + + / + + + [ + + ] + + + + /@ + + + + + + + + + + + + + + + + + + + + + + + + . + + + + + U + + U + + + + U. + + n + + + + U. + + _ + + _ + + + + + + + + + + + + + + + + + + + + + + + UBL-T10 + UBL-T10 + + + + + + + + CodesT10 + CodesT10 + + + + + + + + BIIRULES T10 bound to UBL + + + + + + + + + + + + + + BII2-T10-R025 + fatal + + + + [BII2-T10-R025]-Each document level allowance or charge details MUST have an allowance + and charge reason text + + + + + + + + + + + BII2-T10-R043 + fatal + + + + [BII2-T10-R043]-Document level allowances and charges details MUST have allowance and + charge VAT category if the invoice has a VAT total amount + + + + + + + + + + + + + + + + + BII2-T10-R001 + fatal + + + + [BII2-T10-R001]-An invoice MUST have a customization identifier + + + + + + + + + + BII2-T10-R002 + fatal + + + + [BII2-T10-R002]-An invoice MUST have a business profile identifier + + + + + + + + + + BII2-T10-R003 + fatal + + + + [BII2-T10-R003]-An invoice MUST have an invoice identifier + + + + + + + + + + BII2-T10-R004 + fatal + + + + [BII2-T10-R004]-An invoice MUST have an invoice issue date + + + + + + + + + + BII2-T10-R005 + fatal + + + + [BII2-T10-R005]-An invoice MUST specify the currency code for the document + + + + + + + + + + BII2-T10-R006 + fatal + + + + [BII2-T10-R006]-An invoice MUST have a seller name and/or a seller identifier + + + + + + + + + + BII2-T10-R008 + fatal + + + + [BII2-T10-R008]-An invoice MUST have a buyer name and/or a buyer identifier + + + + + + + + + + BII2-T10-R010 + fatal + + + + [BII2-T10-R010]-An invoice MUST have the sum of line amounts + + + + + + + + + + BII2-T10-R011 + fatal + + + + [BII2-T10-R011]-An invoice MUST have the invoice total without VAT + + + + + + + + + + BII2-T10-R012 + fatal + + + + [BII2-T10-R012]-An invoice MUST have the invoice total with VAT (value of purchase) + + + + + + + + + + + BII2-T10-R013 + fatal + + + + [BII2-T10-R013]-An invoice MUST have the amount due for payment + + + + + + + + + + BII2-T10-R014 + fatal + + + + [BII2-T10-R014]-An invoice MUST have at least one invoice line + + + + + + + + + + BII2-T10-R015 + fatal + + + + [BII2-T10-R015]-An invoice MUST specify the VAT total amount, if there are VAT line + amounts + + + + + + + + + + + BII2-T10-R026 + fatal + + + + [BII2-T10-R026]-An invoice MUST contain VAT category details unless VAT total amount is + omitted. + + + + + + + + + + + BII2-T10-R035 + fatal + + + + [BII2-T10-R035]-Invoice total with VAT MUST NOT be negative + + + + + + + + + + BII2-T10-R037 + fatal + + + + [BII2-T10-R037]-Amount due for payment in an invoice MUST NOT be negative + + + + + + + + + + BII2-T10-R044 + fatal + + + + [BII2-T10-R044]-A seller VAT identifier MUST be provided if the invoice has a VAT total + amount + + + + + + + + + + + BII2-T10-R047 + fatal + + + + [BII2-T10-R047]-A buyer VAT identifier MUST be present if the VAT category code is + reverse VAT + + + + + + + + + + + BII2-T10-R048 + fatal + + + + [BII2-T10-R048]-An invoice with a VAT category code of reverse charge MUST NOT contain + other VAT categories. + + + + + + + + + + + BII2-T10-R058 + fatal + + + + [BII2-T10-R058]-Invoice total without VAT MUST be equal to the sum of VAT category + taxable amounts + + + + + + + + + + + + + + + + + BII2-T10-R017 + fatal + + + + [BII2-T10-R017]-Each invoice line MUST have an invoice line identifier + + + + + + + + + + BII2-T10-R018 + fatal + + + + [BII2-T10-R018]-Each invoice line MUST have an invoiced quantity + + + + + + + + + + BII2-T10-R019 + fatal + + + + [BII2-T10-R019]-Each invoice line MUST have a quantity unit of measure + + + + + + + + + + BII2-T10-R020 + fatal + + + + [BII2-T10-R020]-Each invoice line MUST have an invoice line net amount + + + + + + + + + + BII2-T10-R021 + fatal + + + + [BII2-T10-R021]-Each invoice line MUST have an invoice line item name and/or the invoice + line item identifier + + + + + + + + + + + BII2-T10-R032 + fatal + + + + [BII2-T10-R032]-A scheme identifier for the invoice line item registered identifier MUST + be provided if invoice line item registered identifiers are used to identify a product.(e.g. + GTIN) + + + + + + + + + + + BII2-T10-R033 + fatal + + + + [BII2-T10-R033]-A scheme identifier for a invoice line item commodity classification MUST + be provided if invoice line item commodity classification are used to classify an invoice line + item (e.g. CPV or UNSPSC) + + + + + + + + + + + BII2-T10-R034 + fatal + + + + [BII2-T10-R034]-Invoice line item net price MUST NOT be negative + + + + + + + + + + BII2-T10-R046 + fatal + + + + [BII2-T10-R046]-Each invoice line MUST be categorized with the invoice line VAT category + if the invoice has a VAT total amount + + + + + + + + + + + + + + + + + BII2-T10-R023 + fatal + + + + [BII2-T10-R023]-Each invoice period information MUST have an invoice period start date + + + + + + + + + + + BII2-T10-R024 + fatal + + + + [BII2-T10-R024]-Each invoice period information MUST have an invoice period end date + + + + + + + + + + + BII2-T10-R031 + fatal + + + + [BII2-T10-R031]-An invoice period end date MUST be later or equal to an invoice period + start date + + + + + + + + + + + + + + + + + BII2-T10-R039 + fatal + + + + [BII2-T10-R039]-An account identifier MUST be present if payment means type is funds + transfer + + + + + + + + + + + BII2-T10-R040 + fatal + + + + [BII2-T10-R040]-A sellers financial institution identifier MUST be provided if the scheme + of the account identifier is IBAN and the payment means is international bank transfer + + + + + + + + + + + BII2-T10-R041 + fatal + + + + [BII2-T10-R041]-A payment means MUST specify the payment means type + + + + + + + + + + BII2-T10-R042 + fatal + + + + [BII2-T10-R042]-A sellers financial institution identifier scheme MUST be BIC if the + scheme of the account identifier is IBAN and the payment means type is international account + transfer + + + + + + + + + + + + + + + + + BII2-T10-R051 + fatal + + + + [BII2-T10-R051]-Sum of line amounts MUST equal the invoice line net amounts + + + + + + + + + + BII2-T10-R052 + fatal + + + + [BII2-T10-R052]-An invoice total without VAT MUST equal the sum of line amounts plus the + sum of charges on document level minus the sum of allowances on document level + + + + + + + + + + + BII2-T10-R053 + fatal + + + + [BII2-T10-R053]-An invoice total with VAT MUST equal the invoice total without VAT plus + the VAT total amount and the rounding of invoice total + + + + + + + + + + + BII2-T10-R054 + fatal + + + + [BII2-T10-R054]-The sum of allowances at document level MUST be equal to the sum of + document level allowance amounts + + + + + + + + + + + BII2-T10-R055 + fatal + + + + [BII2-T10-R055]-The sum of charges at document level MUST be equal to the sum of document + level charge amounts + + + + + + + + + + + BII2-T10-R056 + fatal + + + + [BII2-T10-R056]-Amount due for payment MUST be equal to the invoice total amount with VAT + minus the paid amounts + + + + + + + + + + + + + + + + + BII2-T10-R027 + fatal + + + + [BII2-T10-R027]-Each VAT category details MUST have a VAT category taxable amount + + + + + + + + + + + BII2-T10-R028 + fatal + + + + [BII2-T10-R028]-Each VAT category details MUST have a VAT category tax amount + + + + + + + + + + BII2-T10-R029 + fatal + + + + [BII2-T10-R029]-Every VAT category details MUST be defined through a VAT category code + + + + + + + + + + + BII2-T10-R030 + fatal + + + + [BII2-T10-R030]-The VAT category percentage MUST be provided if the VAT category code is + standard. + + + + + + + + + + + BII2-T10-R045 + fatal + + + + [BII2-T10-R045]-A VAT exemption reason MUST be provided if the VAT category code is + exempt or reverse charge. + + + + + + + + + + + + + + + + + BII2-T10-R049 + fatal + + + + [BII2-T10-R049]-The invoice total without VAT MUST be equal to the VAT category taxable + amount if the VAT category code is reverse charge + + + + + + + + + + + BII2-T10-R050 + fatal + + + + [BII2-T10-R050]-The VAT category tax amount MUST be zero if the VAT category code is + reverse charge (since there is only one VAT category allowed it follows that the invoice tax + total for reverse charge invoices is zero) + + + + + + + + + + + + + + + + + + + + + + + + CL-T10-R001 + fatal + + + + [CL-T10-R001]-An Invoice MUST be coded with the InvoiceTypeCode code list UNCL D1001 BII2 + subset + + + + + + + + + + + + + + + + + CL-T10-R002 + fatal + + + + [CL-T10-R002]-DocumentCurrencyCode MUST be coded using ISO code list 4217 + + + + + + + + + + + + + + + + CL-T10-R003 + fatal + + + + [CL-T10-R003]-currencyID MUST be coded using ISO code list 4217 + + + + + + + + + + + + + + + + CL-T10-R004 + fatal + + + + [CL-T10-R004]-Country codes in an invoice MUST be coded using ISO code list 3166-1 + + + + + + + + + + + + + + + + + CL-T10-R006 + fatal + + + + [CL-T10-R006]-Payment means in an invoice MUST be coded using UNCL 4461 BII2 subset + + + + + + + + + + + + + + + + + CL-T10-R007 + fatal + + + + [CL-T10-R007]-Invoice tax categories MUST be coded using UNCL 5305 code list BII2 + subset + + + + + + + + + + + + + + + + + CL-T10-R008 + fatal + + + + [CL-T10-R008]-For Mime code in attribute use MIMEMediaType. + + + + + + + + + + + + + + + + CL-T10-R010 + warning + + + + [CL-T10-R010]-Coded allowance and charge reasons SHOULD belong to the UNCL 4465 code list + BII2 subset + + + + + + + + + + + diff --git a/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsl/OPENPEPPOL-UBL-T10.xsl b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsl/OPENPEPPOL-UBL-T10.xsl new file mode 100644 index 0000000..65ca96d --- /dev/null +++ b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsl/OPENPEPPOL-UBL-T10.xsl @@ -0,0 +1,1243 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + / + + + + + + *: + + [namespace-uri()=' + + '] + + + + [ + + ] + + + + / + + @ + + + @*[local-name()=' + + ' and namespace-uri()=' + + '] + + + + + + + + + / + + + [ + + ] + + + + /@ + + + + + + + / + + + [ + + ] + + + + /@ + + + + + + + + + + + + + + + + + + + + + + + + . + + + + + U + + U + + + + U. + + n + + + + U. + + _ + + _ + + + + + + + + + + + + + + + + + + + + + + + UBL-T10 + UBL-T10 + + + + + + + + CodesT10 + CodesT10 + + + + + + + + OPENPEPPOL T10 bound to UBL + + + + + + + + + + + + + + EUGEN-T10-R012 + fatal + + + + [EUGEN-T10-R012]-An allowance percentage MUST NOT be negative. + + + + + + + + + + EUGEN-T10-R022 + fatal + + + + [EUGEN-T10-R022]-An allowance or charge amount MUST NOT be negative. + + + + + + + + + + EUGEN-T10-R052 + fatal + + + + [EUGEN-T10-R052]-Document level amounts cannot have more than 2 decimals + + + + + + + + + + + + + + + + EUGEN-T10-R029 + fatal + + + + [EUGEN-T10-R029]-An allowance charge reason code MUST have a list identifier attribute + 'UNCL4465'. + + + + + + + + + + + + + + + + + EUGEN-T10-R027 + fatal + + + + [EUGEN-T10-R027]-A country identification code MUST have a list identifier attribute + 'ISO3166-1:Alpha2'. + + + + + + + + + + + + + + + + + EUGEN-T10-R026 + fatal + + + + [EUGEN-T10-R026]-A currency code element MUST have a list identifier attribute + 'ISO4217'. + + + + + + + + + + + + + + + + + EUGEN-T10-R036 + fatal + + + + [EUGEN-T10-R036]-An invoice MUST have a buyer name + + + + + + + + + + EUGEN-T10-R038 + fatal + + + + [EUGEN-T10-R038]-An invoice MUST have a buyer postal address + + + + + + + + + + EUGEN-T10-R040 + warning + + + + [EUGEN-T10-R040]-A customer SHOULD provide information about its legal entity + information + + + + + + + + + + + + + + + + + EUGEN-T10-R034 + fatal + + + + [EUGEN-T10-R034]-An delivery location identifier MUST have a scheme identifier + attribute. + + + + + + + + + + + + + + + + + EUGEN-T10-R033 + fatal + + + + [EUGEN-T10-R033]-A document type code MUST have a list identifier attribute 'UNCL1001'. + + + + + + + + + + + + + + + + + EUGEN-T10-R023 + fatal + + + + [EUGEN-T10-R023]-An endpoint identifier MUST have a scheme identifier attribute. + + + + + + + + + + + + + + + + + EUGEN-T10-R031 + fatal + + + + [EUGEN-T10-R031]-A financial account identifier MUST have a scheme identifier + attribute. + + + + + + + + + + + + + + + + + EUGEN-T10-R044 + fatal + + + + [EUGEN-T10-R044]-If the tax currency code is different from the document currency code, + the tax exchange rate MUST be provided + + + + + + + + + + + EUGEN-T10-R047 + warning + + + + [EUGEN-T10-R047]- An invoice should not contain empty elements + + + + + + + + + + EUGEN-T10-R053 + fatal + + + + [EUGEN-T10-R053]- An invoice must have an Invoice type code + + + + + + + + + + + + + + + + EUGEN-T10-R025 + fatal + + + + [EUGEN-T10-R025]-An invoice type code MUST have a list identifier attribute 'UNCL1001'. + + + + + + + + + + + + + + + + + EUGEN-T10-R054 + warning + + + + [EUGEN-T10-R054]-A party legal entity company identifier SHOULD have a scheme identifier + attribute. + + + + + + + + + + + + + + + + + EUGEN-T10-R024 + fatal + + + + [EUGEN-T10-R024]-A party identifier MUST have a scheme identifier attribute. + + + + + + + + + + + + + + + + EUGEN-T10-R004 + warning + + + + [EUGEN-T10-R004]-If the payment means are international account transfer and the account + id is IBAN then the financial institution should be identified by using the BIC id. + + + + + + + + + + + + + + + + + EUGEN-T10-R028 + fatal + + + + [EUGEN-T10-R028]-A payment means code MUST have a list identifier attribute 'UNCL4461'. + + + + + + + + + + + + + + + + + EUGEN-T10-R035 + fatal + + + + [EUGEN-T10-R035]-An invoice MUST have a seller name + + + + + + + + + + EUGEN-T10-R037 + fatal + + + + [EUGEN-T10-R037]-An invoice MUST have a seller postal address + + + + + + + + + + EUGEN-T10-R039 + warning + + + + [EUGEN-T10-R039]-A supplier SHOULD provide information about its legal entity + information + + + + + + + + + + + EUGEN-T10-R041 + warning + + + + [EUGEN-T10-R041]-The VAT identifier for the supplier SHOULD be prefixed with country code + for companies with VAT registration in EU countries + + + + + + + + + + + + + + + + + EUGEN-T10-R008 + fatal + + + + [EUGEN-T10-R008]-For each tax subcategory the category ID and the applicable tax + percentage MUST be provided. + + + + + + + + + + + + + + + + + EUGEN-T10-R032 + fatal + + + + [EUGEN-T10-R032]-A tax category identifier MUST have a scheme identifier attribute + 'UNCL5305'. + + + + + + + + + + + + + + + + + EUGEN-T10-R045 + fatal + + + + [EUGEN-T10-R045]-Tax exchange rate MUST specify the calculation rate and the operator + code. + + + + + + + + + + + + + + + + + EUGEN-T10-R043 + fatal + + + + [EUGEN-T10-R043]-The total tax amount MUST equal the sum of tax amounts per category. + + + + + + + + + + + EUGEN-T10-R049 + fatal + + + + [EUGEN-T10-R049]- Total tax amount cannot have more than 2 decimals. + + + + + + + + + + + + + + + + EUGEN-T10-R050 + fatal + + + + [EUGEN-T10-R050]- Tax subtotal amounts cannot have more than 2 decimals. + + + + + + + + + + EUGEN-T10-R051 + fatal + + + + [EUGEN-T10-R051]-Document level amounts cannot have more than 2 decimals + + + + + + + + + + EUGEN-T10-R042 + fatal + + + + [EUGEN-T10-R042]-The tax amount per category MUST be the taxable amount multiplied by the + category percentage. + + + + + + + + + + + EUGEN-T10-R046 + fatal + + + + [EUGEN-T10-R046]-If the tax currency code is different from the document currency code, + each tax subtotal has to include the tax amount in both currencies + + + + + + + + + + + + + + + + + EUGEN-T10-R030 + fatal + + + + [EUGEN-T10-R030]-A unit code attribute MUST have a unit code list identifier attribute + 'UNECERec20'. + + + + + + + + + + + + + + + + + EUGEN-T10-R048 + fatal + + + + [EUGEN-T10-R048]-Document level amounts cannot have more than 2 decimals + + + + + + + + + + + + + + + + + + + + + + + OP-T10-R001 + fatal + + + + [OP-T10-R001]-Contract document type code MUST be coded using UNCL 1001 list BII2 + subset. + + + + + + + + + + + + + + + + + OP-T10-R002 + fatal + + + + [OP-T10-R002]-An Endpoint Identifier Scheme MUST be from the list of PEPPOL Party + Identifiers described in the "PEPPOL Policy for using Identifiers". + + + + + + + + + + + + + + + + + OP-T10-R003 + fatal + + + + [OP-T10-R003]-An Party Identifier Scheme MUST be from the list of PEPPOL Party + Identifiers described in the "PEPPOL Policy for using Identifiers". + + + + + + + + + + + + + + + + + OP-T10-R004 + fatal + + + + [OP-T10-R004]-A payee account identifier scheme MUST be from the Account ID PEPPOL code + list + + + + + + + + + + + + + + + + + OP-T10-R006 + fatal + + + + [OP-T10-R006]-Unit code MUST be coded according to the UN/ECE Recommendation 20 + + + + + + + + + + + + + + + + + OP-T10-R008 + fatal + + + + [OP-T10-R008]-A Party Company Identifier Scheme MUST be from the list of PEPPOL Party + Identifiers described in the "PEPPOL Policy for using Identifiers". + + + + + + + + + + + + + + + + + OP-T10-R009 + fatal + + + + [OP-T10-R009]-TaxCurrencyCode MUST be coded using ISO code list 4217 + + + + + + + + + + + + + + + + OP-T10-R010 + fatal + + + + [OP-T10-R010]-SourceCurrencyCode MUST be coded using ISO code list 4217 + + + + + + + + + + + + + + + + OP-T10-R011 + fatal + + + + [OP-T10-R011]-TargetCurrencyCode MUST be coded using ISO code list 4217 + + + + + + + + + + diff --git a/src/main/docker/daemon/config/resources/eRechnung/default-report.xsl b/src/main/docker/daemon/config/resources/eRechnung/default-report.xsl new file mode 100644 index 0000000..5b03f79 --- /dev/null +++ b/src/main/docker/daemon/config/resources/eRechnung/default-report.xsl @@ -0,0 +1,756 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + false + false + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unexpected result from schematron validation - there is no + svrl:schematron-output element! + + + + + + + + + + + + + + + + + + + + + + + error + warning + information + warning + error + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Dies ist das zentrale Template des Skripts. Angewandt auf ein + report-Dokument ergänzt es dieses um eine Handlungsempfehlung in Form eines + accept + oder reject Elements. + + + + + + + + reject + reject + accept + + + + + + + + + + + Ermittelt für eine während der Validierung ausgegebene Fehlernachricht deren + Fehlerlevel (error, warning, information) gemäß der + benutzerspezifischen Qualifizierung. + + Jede Fehlernachricht hat im Rahmen der Validierung ein solches Fehlerlevel + erhalten (siehe Attribut @level). Im Regelfall entspricht die + benutzerspezifische Qualifizierung unverändert diesem Level. Nutzer können jedoch im + Rahmen der Bewertung eigene Qualifizierungen vereinbaren und in dem als Parameter + + übergebenen + assessment + Element für bestimmte, anhand des Fehlercodes identifizierten Fehlermeldungen eine + eigene Qualifizierung als customLevel festlegen. + + Dies kann z. B. genutzt werden, um einen error, der ansonsten zur + Rückweisung der Nachricht führen würde, zumindest zeitweilig als + warning + zu qualifizieren, so dass eine entsprechende + Dokumenteninstanz trotz einer Warnung angenommen und verarbeitet würde. + + Die Funktion prüft für eine Fehlernachricht, ob deren @code Attribut + Bestandteil der für ein bestimmtes customLevel des + + Parameters angegebenen Fehlercodes ist. + Falls ja, dann gilt das jeweilige customLevel. Andernfalls wird der im + Rahmen der Validierung ermittelte Fehlerlevel unverändert übernommen. + + + Eine im Rahmen der Validierung ausgegebene + Fehlernachricht + + + + + + + + + + + + + + + + + + + + + + + + + + + Generiert das head Element eines eingebetteten HTML Dokuments, + welches den Prüf- und Bewertungsbericht visualisiert und die Handlungsempfehlung + begründet + + + + + + Prüfbericht + + + + + +

Prüfbericht

+ + + + + + + + + + + + + + + + + + +
+ + + + + Generiert am Beginn eines eingebetteten HTML Dokuments, welches den Prüf- und + Bewertungsbericht visualisiert und die Handlungsempfehlung begründet, eine Übersicht + mit Metadaten des geprüften Dokuments. + + + + + + + + + + + + Generiert am Ende eines eingebetteten HTML Dokuments, welches den Prüf- und + Bewertungsbericht visualisiert und die Handlungsempfehlung begründet, eine Übersicht + mit Metadaten zum Prüfmodul. + + + + +

+ Dieser Prüfbericht wurde erstellt mit + + . +

+
+ + + + Generiert in dem eingebetetteten HTML Dokument eine Tabelle mit den während der + Validierung ausgegebenen Daten. + + + + +

Übersicht der Validierungsergebnisse:

+ + + + + + + + + + + + + + + + + + + + +
PrüfschrittFehlerWarnungenInformationen
+ + ( + + ) + + + + + + +
+ +

Validierungsergebnisse im Detail:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PosCodeAdj. Grad (Grad)Text
+ + + + + + + + + + +
+ + Pfad: + + + Zeile: + + + Spalte: + +
+
+ + + + Generiert in dem eingebetteten HTML Dokument eine Aussage zur Konformität des + geprüften Dokuments zu den formalen Vorgaben. + + + + + + + + +

+ Konformitätsprüfung: + Das geprüfte Dokument enthält + + + weder Fehler noch Warnungen. Es ist konform zu den formalen Vorgaben. + + + + nicht konform + zu den formalen Vorgaben. + + +

+
+ +

+ Konformitätsprüfung: + Das geprüfte Dokument entspricht keinen zulässigen Dokumenttyp und ist damit + nicht konform + zu den formalen Vorgaben. +

+
+
+ +
+ + + + Generiert in dem eingebetteten HTML Dokument die Aussage zur + Handlungsempfehlung. + + + + + + + + +

Bewertung: Es wird empfohlen das Dokument zurückzuweisen.

+
+ +

Bewertung: Es wird empfohlen das Dokument anzunehmen und weiter zu verarbeiten.

+
+ +

Bewertung: Es wird empfohlen das Dokument anzunehmen und zu verarbeiten, da die + vorhandenen Fehler derzeit toleriert werden. +

+
+ +

Bewertung: Es wird empfohlen das Dokument zurückzuweisen.

+
+
+
+ + + + +

+ Inhalt des Rechnungsdokuments: +

+ + +
+
+ + + + Eine Element wird als eine Zeile in einer Tabelle visualisiert. Die erste Spalte + enthält die Zeilennummer, die zweite Attribute und Text des Elements + + + + + + + + + + + + + + + + + + + + + + Ein Textbereich (in der Zeile des Elements) + + + +
+ +
+
+ + +
+ [ … ] +
+
+ + + + + + Ein Attributbereich (in der Zeile des Elements) + + + +
+ +
+
+ + +
\ No newline at end of file diff --git a/src/main/docker/daemon/config/resources/eRechnung/report.xsl b/src/main/docker/daemon/config/resources/eRechnung/report.xsl new file mode 100644 index 0000000..7e3555c --- /dev/null +++ b/src/main/docker/daemon/config/resources/eRechnung/report.xsl @@ -0,0 +1,631 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unexpected result from schematron validation - there is no svrl:schematron-output element! + + + + + + + + + + + + + + + + + + error + warning + information + warning + error + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + step_ + + + + + + + + + + message_ + + + + + + + + + + + + + + + Dies ist das zentrale Template des Skripts. Angewandt auf ein + validationReport-Dokument, und unter Nutzung des + + Parameters wird eine Handlungsempfehlung in Form eines + accept + oder reject Elements erstellt, welches eine + Begründung der jeweiligen Empfehlung enthalten kann. + + Das Template realisiert eine Funktion f:validationReport, assessment → + suggestion + + + + + + + + + + + + + + + + + + + + + + Ermittelt für eine während der Validierung ausgegebene Fehlernachricht deren + Fehlerlevel (error, warning, information) gemäß der + benutzerspezifischen Qualifizierung. + + Jede Fehlernachricht hat im Rahmen der Validierung ein solches Fehlerlevel + erhalten (siehe Attribut @level). Im Regelfall entspricht die + benutzerspezifische Qualifizierung unverändert diesem Level. Nutzer können jedoch im + Rahmen der Bewertung eigene Qualifizierungen vereinbaren und in dem als Parameter + + übergebenen + assessment + Element für bestimmte, anhand des Fehlercodes identifizierten Fehlermeldungen eine + eigene Qualifizierung als customLevel festlegen. + + Dies kann z. B. genutzt werden, um einen error, der ansonsten zur + Rückweisung der Nachricht führen würde, zumindest zeitweilig als + warning + zu qualifizieren, so dass eine entsprechende + Dokumenteninstanz trotz einer Warnung angenommen und verarbeitet würde. + + Die Funktion prüft für eine Fehlernachricht, ob deren @code Attribut + Bestandteil der für ein bestimmtes customLevel des + + Parameters angegebenen Fehlercodes ist. + Falls ja, dann gilt das jeweilige customLevel. Andernfalls wird der im + Rahmen der Validierung ermittelte Fehlerlevel unverändert übernommen. + + + Eine im Rahmen der Validierung ausgegebene + Fehlernachricht + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Generiert das head Element eines eingebetteten HTML Dokuments, + welches den Prüf- und Bewertungsbericht visualisiert und die Handlungsempfehlung + begründet + + + + + + Pruefbericht der KoSIT + + + + + + + Generiert die Überschrift des eines eingebetteten HTML Dokuments, welches den + Prüf- und Bewertungsbericht visualisiert und die Handlungsempfehlung + begründet + + + + +

Prüfbericht der KoSIT

+
+ + + + Generiert am Beginn eines eingebetteten HTML Dokuments, welches den Prüf- und + Bewertungsbericht visualisiert und die Handlungsempfehlung begründet, eine Übersicht + mit Metadaten des geprüften Dokuments. + + + + +

+ Angaben zum geprüften Dokument +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Prüfbericht Nr. + +
Dokument: + +
Szenario: + +
Zeitpunkt: + +
Validierungsschritte:FehlerWarnungInformation
+ + + + + + + + + +
+
+ + + + Generiert am Ende eines eingebetteten HTML Dokuments, welches den Prüf- und + Bewertungsbericht visualisiert und die Handlungsempfehlung begründet, eine Übersicht + mit Metadaten zum Prüfmodul. + + + + +

+ Erstellt mit: + + für das InstructionSet + + + + vom + + . +

+
+ + + + Generiert in dem eingebetetteten HTML Dokument eine Tabelle mit den während der + Validierung ausgegebenen Daten. + + + + + + + + + + + +
+
+ + + + Generiert in der HTML-Tabelle der Validierungsnachtichten in dem eingebetteten + HTML Dokument dn Tabellenkopf + + + + + + + Pos + Code + CustomLevel (Level) + Step + Text + + + + + + + Generiert in der HTML-Tabelle der Validierungsnachtichten in dem eingebetteten + HTML Dokument eine oder mehrere Zeilen pro Validierungsnachricht + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Generiert in dem eingebetteten HTML Dokument eine Aussage zur Konformität des + geprüften Dokuments zu den formalen Vorgaben. + + + + + + +

+ Konformitätsprüfung: + Das geprüfte Dokument enthält + + + weder Fehler noch Warnungen. Es ist konform zu den formalen Vorgaben. + + + + nicht konform + zu den formalen Vorgaben. + + +

+
+ + + + Generiert in dem eingebetteten HTML Dokument die Aussage zur + Handlungsempfehlung. + + + + + + +

+ Bewertung: + + + Es wird empfohlen das Dokument anzunehmen un weiter zu verarbeiten. + + + Es wird empfohlen das Dokument anzunehmen und zu verarbeiten, da die vorhandenen Fehler derzeit toleriert werden. + + + Es wird empfohlen das Dokument zurückzuweisen. + + +

+
+ + +
\ No newline at end of file diff --git a/src/main/docker/daemon/config/scenarios.xml b/src/main/docker/daemon/config/scenarios.xml new file mode 100644 index 0000000..086a093 --- /dev/null +++ b/src/main/docker/daemon/config/scenarios.xml @@ -0,0 +1,68 @@ + + + + + XInneres + 2017-08-08 + +

Prüft XInneres Nachrichten anhand der von uns offiziell herausgegebenen XML Schemata und Beispielen für mögliche weitergehende + Prüfungen mit Schematron. +

+

Prüft elektronische Rechnungen im Format UBL 2.1

+
+ + + UBL 2.1 Invoice + urn:oasis:names:specification:ubl:schema:xsd:Invoice-2 + /invoice:Invoice + + + + UBL 2.1 Invoice + resources/eRechnung/UBL-2.1/xsdrt/maindoc/UBL-Invoice-2.1.xsd + + + + + BII Rules for Invoice + resources/eRechnung/UBL-2.1/xsl/BIIRULES-UBL-T10.xsl + + + + + openPEPPOL Rules for Invoice + resources/eRechnung/UBL-2.1/xsl/OPENPEPPOL-UBL-T10.xsl + + + + + Report für eRechnung + resources/eRechnung/report.xsl + + + + + + default + resources/eRechnung/default-report.xsl + + + +
diff --git a/src/main/docker/daemon/run.sh b/src/main/docker/daemon/run.sh new file mode 100644 index 0000000..3daa916 --- /dev/null +++ b/src/main/docker/daemon/run.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +cd /opt/validationtool && java -jar validationtool-standalone.jar -s scenarios.xml -D \ No newline at end of file diff --git a/src/main/java/de/kosit/validationtool/api/Input.java b/src/main/java/de/kosit/validationtool/api/Input.java index db2dac5..69f9c22 100644 --- a/src/main/java/de/kosit/validationtool/api/Input.java +++ b/src/main/java/de/kosit/validationtool/api/Input.java @@ -19,10 +19,7 @@ package de.kosit.validationtool.api; -import lombok.AccessLevel; -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.RequiredArgsConstructor; +import lombok.*; /** * Eine Datei in eingelesener Form. diff --git a/src/main/java/de/kosit/validationtool/cmd/CommandLineApplication.java b/src/main/java/de/kosit/validationtool/cmd/CommandLineApplication.java index dbe586b..09e4bbe 100644 --- a/src/main/java/de/kosit/validationtool/cmd/CommandLineApplication.java +++ b/src/main/java/de/kosit/validationtool/cmd/CommandLineApplication.java @@ -20,12 +20,12 @@ package de.kosit.validationtool.cmd; import java.io.IOException; -import java.net.MalformedURLException; import java.net.URI; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.stream.Collectors; @@ -37,6 +37,7 @@ import org.apache.commons.cli.HelpFormatter; import org.apache.commons.cli.Option; import org.apache.commons.cli.Options; import org.apache.commons.cli.ParseException; +import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.StringUtils; import lombok.extern.slf4j.Slf4j; @@ -50,20 +51,21 @@ import de.kosit.validationtool.impl.ObjectFactory; /** * Commandline Version des Prüftools. Parsed die Kommandozeile und führt die konfigurierten Aktionen aus. - * + * * @author Andreas Penski */ @Slf4j public class CommandLineApplication { + private static final Option HELP = Option.builder("?").longOpt("help").argName("Help").desc("Displays this help").build(); + private static final Option SCENARIOS = Option.builder("s").required().longOpt("scenarios").hasArg() .desc("Location of scenarios.xml e.g.").build(); private static final Option REPOSITORY = Option.builder("r").longOpt("repository").hasArg() .desc("Directory containing scenario content").build(); - private static final Option PRINT = Option.builder("p").longOpt("print").desc("Prints the check result to stdout").build(); private static final Option OUTPUT = Option.builder("o").longOpt("output-directory") @@ -76,6 +78,17 @@ public class CommandLineApplication { private static final Option CHECK_ASSERTIONS = Option.builder("c").longOpt("check-assertions").hasArg() .desc("Check the result using defined assertions").argName("assertions-file").build(); + private static final Option SERVER = Option.builder("D").longOpt("daemon").desc("Starts a daemon listing for validation requests").build(); + + private static final Option HOST = Option.builder("H").longOpt("host").hasArg() + .desc("The hostname / IP address to bind the daemon. Default is localhost").build(); + + private static final Option PORT = Option.builder("P").longOpt("port").hasArg() + .desc("The port to bind the daemon. Default is 8080").build(); + + private static final Option WORKER_COUNT = Option.builder("T").longOpt("threads").hasArg().desc("Number of threads processing validation requests").build(); + public static final int DAEMON_SIGNAL = 100; + private static final Option PRINT_MEM_STATS = Option.builder("m").longOpt("memory-stats").desc("Prints some memory stats").build(); @@ -90,15 +103,19 @@ public class CommandLineApplication { */ public static void main(String[] args) { final int resultStatus = mainProgram(args); - System.exit(resultStatus); + if (DAEMON_SIGNAL != resultStatus) { + System.exit(resultStatus); + } } + /** * Hauptprogramm für die Kommandozeilen-Applikation. * * @param args die Eingabe-Argumente */ static int mainProgram(String[] args) { + int returnValue = 0; Options options = createOptions(); if (isHelpRequested(args)) { printHelp(options); @@ -106,10 +123,12 @@ public class CommandLineApplication { try { CommandLineParser parser = new DefaultParser(); final CommandLine cmd = parser.parse(options, args); - if (cmd.getArgList().isEmpty()) { + if (cmd.hasOption(SERVER.getOpt())) { + returnValue = startDaemonMode(cmd); + } else if (cmd.getArgList().isEmpty()) { printHelp(createOptions()); } else { - return processActions(cmd); + returnValue = processActions(cmd); } } catch (ParseException e) { log.error("Error processing command line arguments: " + e.getMessage()); @@ -119,6 +138,46 @@ public class CommandLineApplication { return 0; } + private static int determinePort(CommandLine cmd) { + int port = 8080; + if (checkOptionWithValue(PORT, cmd)) { + port = Integer.parseInt(cmd.getOptionValue(PORT.getOpt())); + } + return port; + } + + private static int determineThreads(CommandLine cmd) { + int threads = Runtime.getRuntime().availableProcessors(); + if (checkOptionWithValue(WORKER_COUNT, cmd)) { + threads = Integer.parseInt(cmd.getOptionValue(WORKER_COUNT.getOpt())); + } + return threads; + } + + private static String determineHost(CommandLine cmd) { + String host = "localhost"; + if (checkOptionWithValue(HOST, cmd)) { + host = cmd.getOptionValue(HOST.getOpt()); + } + return host; + } + + private static int startDaemonMode(CommandLine cmd) { + Option[] unavailable = new Option[]{PRINT, CHECK_ASSERTIONS, DEBUG, OUTPUT, EXTRACT_HTML}; + warnUnusedOptions(cmd, unavailable, true); + Daemon validDaemon = new Daemon(determineDefinition(cmd), determineRepository(cmd), determineHost(cmd), determinePort(cmd), determineThreads(cmd)); + validDaemon.startServer(); + return DAEMON_SIGNAL; + } + + private static void warnUnusedOptions(CommandLine cmd, Option[] unavailable, boolean daemon) { + Arrays.stream(cmd.getOptions()).filter(o -> ArrayUtils.contains(unavailable, o)).map(o -> "The option " + o.getLongOpt() + " is not available in daemon mode").forEach(log::error); + if (daemon && !cmd.getArgList().isEmpty()) { + log.info("Ignoring test targets in daemon mode"); + } + } + + private static boolean isHelpRequested(String[] args) { Options helpOptions = createHelpOptions(); try { @@ -137,6 +196,8 @@ public class CommandLineApplication { try { long start = System.currentTimeMillis(); + Option[] unavailable = new Option[]{HOST, PORT, WORKER_COUNT}; + warnUnusedOptions(cmd, unavailable, false); CheckConfiguration d = new CheckConfiguration(determineDefinition(cmd)); d.setScenarioRepository(determineRepository(cmd)); InternalCheck check = new InternalCheck(d); @@ -149,6 +210,7 @@ public class CommandLineApplication { if (cmd.hasOption(PRINT.getOpt())) { check.getCheckSteps().add(new PrintReportAction()); } + if (cmd.hasOption(CHECK_ASSERTIONS.getOpt())) { Assertions assertions = loadAssertions(cmd.getOptionValue(CHECK_ASSERTIONS.getOpt())); check.getCheckSteps().add(new CheckAssertionAction(assertions, ObjectFactory.createProcessor())); @@ -236,7 +298,7 @@ public class CommandLineApplication { } - private static URI determineRepository(CommandLine cmd) throws MalformedURLException { + private static URI determineRepository(CommandLine cmd) { if (checkOptionWithValue(REPOSITORY, cmd)) { Path d = Paths.get(cmd.getOptionValue(REPOSITORY.getOpt())); if (Files.isDirectory(d)) { @@ -249,7 +311,7 @@ public class CommandLineApplication { return null; } - private static URI determineDefinition(CommandLine cmd) throws MalformedURLException { + private static URI determineDefinition(CommandLine cmd) { checkOptionWithValue(SCENARIOS, cmd); Path f = Paths.get(cmd.getOptionValue(SCENARIOS.getOpt())); if (Files.isRegularFile(f)) { @@ -291,6 +353,9 @@ public class CommandLineApplication { private static Options createOptions() { Options options = new Options(); options.addOption(HELP); + options.addOption(SERVER); + options.addOption(HOST); + options.addOption(PORT); options.addOption(SCENARIOS); options.addOption(REPOSITORY); options.addOption(PRINT); @@ -299,6 +364,7 @@ public class CommandLineApplication { options.addOption(DEBUG); options.addOption(CHECK_ASSERTIONS); options.addOption(PRINT_MEM_STATS); + options.addOption(WORKER_COUNT); return options; } } diff --git a/src/main/java/de/kosit/validationtool/cmd/Daemon.java b/src/main/java/de/kosit/validationtool/cmd/Daemon.java new file mode 100644 index 0000000..7f05c09 --- /dev/null +++ b/src/main/java/de/kosit/validationtool/cmd/Daemon.java @@ -0,0 +1,197 @@ +package de.kosit.validationtool.cmd; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.InetSocketAddress; +import java.net.URI; +import java.util.concurrent.Executors; +import java.util.concurrent.atomic.AtomicLong; + +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerException; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; + +import org.w3c.dom.Document; + +import com.sun.net.httpserver.HttpExchange; +import com.sun.net.httpserver.HttpHandler; +import com.sun.net.httpserver.HttpServer; + +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import lombok.Setter; +import lombok.extern.slf4j.Slf4j; + +import de.kosit.validationtool.api.Check; +import de.kosit.validationtool.api.CheckConfiguration; +import de.kosit.validationtool.api.Input; +import de.kosit.validationtool.api.InputFactory; +import de.kosit.validationtool.impl.DefaultCheck; +import de.kosit.validationtool.impl.ObjectFactory; +import de.kosit.validationtool.model.scenarios.Scenarios; + +/** + * HTTP-Daemon für die Bereitstellung der Prüf-Funktionalität via http. + * + * @author Roula Antoun + */ +@RequiredArgsConstructor +@Setter +@Getter +@Slf4j +class Daemon { + + /** + * Wir benötigen einen Handler, der zur Verarbeitung von HTTP-Anforderungen aufgerufen wird um hier die Verarbeitung des + * POST Request zu realisieren. + */ + @Slf4j + private static class HttpServerHandler implements HttpHandler { + + private static final AtomicLong counter = new AtomicLong(0); + + private final Check implemenation; + + HttpServerHandler(Check check) { + this.implemenation = check; + } + + /** + * Methode, die eine gegebene Anforderung verarbeitet und eine entsprechende Antwort generiert + * + * @param httpExchange kapselt eine empfangene HTTP-Anforderung und eine Antwort, die in einem Exchange generiert werden + * soll. + */ + @Override + public void handle(HttpExchange httpExchange) throws IOException { + try { + String requestMethod = httpExchange.getRequestMethod(); + if (requestMethod.equals("POST")) { + InputStream inputStream = httpExchange.getRequestBody(); + Input serverInput = InputFactory.read(inputStream, "Prüfling" + counter.incrementAndGet()); + + int contentLength = serverInput.getContent().length; + if (contentLength != 0) { + writeOutputstreamArray(httpExchange, implemenation.check(serverInput)); + } else { + writeError(httpExchange, 400, "XML-Inhalt erforderlich!"); + } + } else { + writeError(httpExchange, 405, "Es ist nur die POST-Methode erlaubt!"); + } + } catch (TransformerException e) { + writeError(httpExchange, 500, "Interner Fehler bei der Verarbeitung des Requests: " + e.getMessage()); + log.error("Es ist ein Fehler aufgetreten. Das Dokument kann nicht geprüft werden", e); + } + } + + } + + /** + * Wir benötigen einen Handler, der zur Verarbeitung von HTTP-Anforderungen aufgerufen wird , und hier für Verarbeitung + * das GET Request um Health-Endpunkt zu erstellen. Die Klasse HealthHandler implementiert diese Schnittstelle + */ + @Slf4j + static class HealthHandler implements HttpHandler { + + private final Scenarios scenarios; + + HealthHandler(Scenarios scenarios) { + this.scenarios = scenarios; + } + + @Override + public void handle(HttpExchange httpExchange) throws IOException { + Health health = new Health(scenarios); + Document doc = health.writeHealthXml(); + try { + writeOutputstreamArray(httpExchange, doc); + } catch (TransformerException e) { + writeError(httpExchange, 500, e.getMessage()); + log.error("Fehler beim Erzeugen der Status-Information", e); + } + } + } + + private final URI scenarioDefinition; + + private final URI repository; + + private final String hostName; + + private final int port; + + private final int threadCount; + + /** + * Methode, die die Antwort als String-Text schreibt + * + * @param httpExchange um den Antwort Body zu erhalten + * @param rCode der Code-Status + * @param response die String antwort, die ich anzeigen möchte + */ + private static void writeError(HttpExchange httpExchange, int rCode, String response) throws IOException { + httpExchange.sendResponseHeaders(rCode, response.length()); + OutputStream os = httpExchange.getResponseBody(); + os.write(response.getBytes()); + os.close(); + } + + /** + * Methode, die die Antwort als String-Text schreibt + * + * @param httpExchange um den Antwort Body zu erhalten + * @param doc der Report + */ + private static void writeOutputstreamArray(HttpExchange httpExchange, Document doc) throws IOException, TransformerException { + final byte[] bytes = serialize(doc); + OutputStream os = httpExchange.getResponseBody(); + httpExchange.getResponseHeaders().add("Content-Type", "application/xml"); + httpExchange.sendResponseHeaders(200, bytes.length); + os.write(bytes); + os.close(); + log.debug("Xml File erzeugen ist Fertig "); + } + + /** + * Methode zum Serialisieren des Dokuments. + * + * @param report Vom Typ Dokument, aka Report . + */ + private static byte[] serialize(Document report) throws TransformerException { + + try ( ByteArrayOutputStream bArrayOS = new ByteArrayOutputStream() ) { + DOMSource source = new DOMSource(report); + StreamResult streamResult = new StreamResult(bArrayOS); + Transformer transformer = ObjectFactory.createTransformer(true); + transformer.transform(source, streamResult); + return bArrayOS.toByteArray(); + } catch (IOException e) { + log.error("Report {}", e.getMessage(), e); + throw new IllegalStateException(e); + } + } + + /** + * Methode zum Starten des Servers + */ + void startServer() { + CheckConfiguration config = new CheckConfiguration(scenarioDefinition); + config.setScenarioRepository(repository); + HttpServer server = null; + try { + server = HttpServer.create(new InetSocketAddress(hostName, port), 0); + DefaultCheck check = new DefaultCheck(config); + server.createContext("/", new HttpServerHandler(check)); + server.createContext("/health", new HealthHandler(check.getRepository().getScenarios())); + server.setExecutor(Executors.newFixedThreadPool(threadCount)); + server.start(); + log.info("Server ist erfolgreich gestartet"); + } catch (IOException e) { + log.error("Fehler beim HttpServer erstellen!", e.getMessage(), e); + } + } +} diff --git a/src/main/java/de/kosit/validationtool/cmd/Health.java b/src/main/java/de/kosit/validationtool/cmd/Health.java new file mode 100644 index 0000000..e3056a6 --- /dev/null +++ b/src/main/java/de/kosit/validationtool/cmd/Health.java @@ -0,0 +1,117 @@ +package de.kosit.validationtool.cmd; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; + +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; + +import lombok.extern.slf4j.Slf4j; + +import de.kosit.validationtool.model.scenarios.Scenarios; + +/** + * Klasse zur Erzeugung Health Xml , die optiamle Status. + * + * @author Roula Antoun + */ +@Slf4j +class Health { + + private final long freeMemory; + + private final long maxMemory; + + private final long totalMemory; + + private final Scenarios scenarios; + + Health(Scenarios scenarios) { + + Runtime runtime = Runtime.getRuntime(); + freeMemory = runtime.freeMemory(); + maxMemory = runtime.maxMemory(); + totalMemory = runtime.totalMemory(); + this.scenarios = scenarios; + } + + /** + * Methode, die schreibt das Health Xml für optimale Status + * + */ + Document writeHealthXml() { + DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder dBuilder; + Document doc = null; + try { + dBuilder = dbFactory.newDocumentBuilder(); + doc = dBuilder.newDocument(); + Element rootElement = doc.createElementNS("https://localhost:8080/Health", "Health"); + doc.appendChild(rootElement); + rootElement.appendChild(getMemory(doc, freeMemory, maxMemory, totalMemory)); + rootElement.appendChild(getState(doc)); + rootElement.appendChild(getScenario(doc, scenarios)); + } catch (ParserConfigurationException e) { + log.error("Fehler beim Schreiben der Status-Informationen", e); + } + return doc; + } + + /** + * Methode, die schreibt das System Status Node im Xml File + * + * @param doc Vom Typ Dokument. + * + */ + private Node getState(Document doc) { + Element state = doc.createElement("state"); + state.setAttribute("indicator", "OK"); + Element stateNode = doc.createElement("message"); + stateNode.appendChild(doc.createTextNode("System is up and running normally")); + state.appendChild(stateNode); + return state; + } + + /** + * Methode, die schreibt das Scnarios Information Node im Xml File + * + * @param doc Vom Typ Dokument . + * @param scenarios Vom Typ {@link Scenarios} das verwendete scenario. + * + */ + private Node getScenario(Document doc, Scenarios scenarios) { + Element scenario = doc.createElement("scenario"); + Element scenarioNameNode = doc.createElement("name"); + scenarioNameNode.appendChild(doc.createTextNode(scenarios.getName())); + scenario.appendChild(scenarioNameNode); + return scenario; + } + + /** + * Methode, die schreibt das Scnarios Information Node im Xml File + * + * @param doc Vom Typ Dokument . + * @param freeMemory Vom Typ long , der freier Speicher. + * @param maxMemory Vom Typ long , der maximaler Speicher + * @param totalMemory Vom Typ long , der Gesamte speicher. + * + */ + private static Node getMemory(Document doc, long freeMemory, long maxMemory, long totalMemory) { + Element memory = doc.createElement("memoryState"); + String freeM = Long.toString(freeMemory); + Element freeMNode = doc.createElement("freeMemory"); + freeMNode.appendChild(doc.createTextNode(freeM)); + memory.appendChild(freeMNode); + String maxM = Long.toString(maxMemory); + Element maxMNode = doc.createElement("maxMemory"); + maxMNode.appendChild(doc.createTextNode(maxM)); + memory.appendChild(maxMNode); + String totalM = Long.toString(totalMemory); + Element totalMNode = doc.createElement("totalMemory"); + totalMNode.appendChild(doc.createTextNode(totalM)); + memory.appendChild(totalMNode); + return memory; + } +} diff --git a/src/main/java/de/kosit/validationtool/impl/DefaultCheck.java b/src/main/java/de/kosit/validationtool/impl/DefaultCheck.java index 82b06ae..81d15db 100644 --- a/src/main/java/de/kosit/validationtool/impl/DefaultCheck.java +++ b/src/main/java/de/kosit/validationtool/impl/DefaultCheck.java @@ -21,6 +21,10 @@ package de.kosit.validationtool.impl; import java.util.ArrayList; import java.util.List; +import java.util.stream.Collectors; + +import de.kosit.validationtool.model.scenarios.Scenarios; +import org.w3c.dom.Document; import lombok.Getter; import lombok.extern.slf4j.Slf4j; @@ -46,7 +50,7 @@ import net.sf.saxon.s9api.XdmNode; /** * Die Referenz-Implementierung für den Prüfprozess. Nach initialer Konfiguration ist diese Klasse threadsafe und kann * in Server-Umgebungen eingesetzt werden - * + * * @author Andreas Penski */ @Slf4j @@ -56,6 +60,7 @@ public class DefaultCheck implements Check { private static final String ENGINE_VERSION = "1.0.0"; + @Getter private ScenarioRepository repository; @Getter @@ -63,12 +68,13 @@ public class DefaultCheck implements Check { private ConversionService conversionService; + @Getter private List checkSteps; /** * Erzeugt eine neue Instanz mit der angegebenen Konfiguration. - * + * * @param configuration die Konfiguration */ public DefaultCheck(CheckConfiguration configuration) { @@ -135,5 +141,4 @@ public class DefaultCheck implements Check { transporter.getReportInput().setDocumentIdentification(i); return true; } - } diff --git a/src/main/java/de/kosit/validationtool/impl/ScenarioRepository.java b/src/main/java/de/kosit/validationtool/impl/ScenarioRepository.java index 6bf9a17..0622e10 100644 --- a/src/main/java/de/kosit/validationtool/impl/ScenarioRepository.java +++ b/src/main/java/de/kosit/validationtool/impl/ScenarioRepository.java @@ -70,7 +70,7 @@ public class ScenarioRepository { private XsltExecutable noScenarioReport; - @Getter(value = AccessLevel.PACKAGE) + @Getter private Scenarios scenarios; private static boolean isSupportedDocument(XdmNode doc) { diff --git a/src/main/model/xsd/assertions.xsd b/src/main/model/xsd/assertions.xsd index e7d5e73..4a5bdcc 100644 --- a/src/main/model/xsd/assertions.xsd +++ b/src/main/model/xsd/assertions.xsd @@ -28,7 +28,7 @@ In diesem Dokument werden zum Test einer Prüftoolkonfiguration Zusicherungen zu einzelnen Prüfberichten beschrieben. Ein - solches Dokument kann der Kommandozeilenversion des Prüftools über --check-assertions übergeben werden. + solches Dokument kann der Kommandozeilenversion des Prüftools über --implemenation-assertions übergeben werden. diff --git a/src/test/java/de/kosit/validationtool/cmd/DaemonIT.java b/src/test/java/de/kosit/validationtool/cmd/DaemonIT.java new file mode 100644 index 0000000..0201c62 --- /dev/null +++ b/src/test/java/de/kosit/validationtool/cmd/DaemonIT.java @@ -0,0 +1,74 @@ +package de.kosit.validationtool.cmd; + +import static io.restassured.RestAssured.given; + +import java.io.IOException; +import java.io.InputStream; + +import org.junit.Before; +import org.junit.Test; + +import io.restassured.RestAssured; + +/** + * Testet the Daemon-Mode input , Methoden , Output Content-Type and the success case + * + * @author Roula Antoun + */ +public class DaemonIT { + + private static final String EXAMPLE_FILE = "examples/UBLReady/UBLReady_EU_UBL-NL_20170102_FULL.xml"; + + private static final String APPLICATION_XML = "application/xml"; + + private static final String INVALID_XML = "examples/UBLReady/UBLReady_EU_UBL-NL_20170102_FULL-invalid.xml"; + + @Before + public void setup() { + final String port = System.getProperty("daemon.port"); + if (port != null) { + RestAssured.port = Integer.valueOf(port); + } + final String baseHost = System.getProperty("daemon.host"); + if (baseHost != null) { + RestAssured.baseURI = baseHost; + } + + } + + @Test + public void makeSureThatSuccessTest() throws IOException { + try ( InputStream io = DaemonIT.class.getClassLoader().getResourceAsStream(EXAMPLE_FILE) ) { + given().contentType(APPLICATION_XML).body(io).when().post("/").then().statusCode(200); + } + } + + @Test + public void NoInputTest() { + given().body("").contentType(APPLICATION_XML).when().post("/").then().statusCode(400); + } + + @Test + public void internalServerErrorTest() throws IOException { + try ( InputStream io = DaemonIT.class.getClassLoader().getResourceAsStream(INVALID_XML) ) { + given().contentType(APPLICATION_XML).body(io).when().post("/").then().statusCode(200); + } + } + + @Test + public void methodNotAllowedTest() { + given().when().get("/").then().statusCode(405); + given().when().put("/").then().statusCode(405); + given().when().patch("/").then().statusCode(405); + given().when().delete("/").then().statusCode(405); + given().when().head("/").then().statusCode(405); + given().when().options("/").then().statusCode(405); + } + + @Test + public void xmlResultTest() throws IOException { + try ( InputStream io = DaemonIT.class.getClassLoader().getResourceAsStream(EXAMPLE_FILE) ) { + given().body(io).when().post("/").then().contentType(APPLICATION_XML).and().statusCode(200); + } + } +} diff --git a/src/test/resources/examples/repository/resources/eRechnung/default-report.xsl b/src/test/resources/examples/repository/resources/eRechnung/default-report.xsl index 1d3b383..413a4d7 100644 --- a/src/test/resources/examples/repository/resources/eRechnung/default-report.xsl +++ b/src/test/resources/examples/repository/resources/eRechnung/default-report.xsl @@ -104,7 +104,7 @@ - + diff --git a/src/test/resources/examples/repository/resources/eRechnung/report.xsl b/src/test/resources/examples/repository/resources/eRechnung/report.xsl index f4f03fb..bf1dafe 100644 --- a/src/test/resources/examples/repository/resources/eRechnung/report.xsl +++ b/src/test/resources/examples/repository/resources/eRechnung/report.xsl @@ -87,7 +87,7 @@ - +