mirror of
https://github.com/itplr-kosit/validator.git
synced 2026-06-10 09:10:03 +00:00
Compare commits
No commits in common. "main" and "v1.2.0" have entirely different histories.
356 changed files with 22838 additions and 38561 deletions
1
.gitattributes
vendored
1
.gitattributes
vendored
|
|
@ -1 +0,0 @@
|
|||
* text eol=lf
|
||||
21
.gitignore
vendored
21
.gitignore
vendored
|
|
@ -5,12 +5,11 @@
|
|||
|
||||
# Log file
|
||||
*.log
|
||||
.idea
|
||||
#*.iml
|
||||
|
||||
# Package Files #
|
||||
*.jar
|
||||
!libs/**/*.jar
|
||||
|
||||
**/generated
|
||||
|
||||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||
|
|
@ -34,22 +33,6 @@ src/generated
|
|||
.project
|
||||
.classpath
|
||||
.factorypath
|
||||
.idea/
|
||||
.settings/
|
||||
.externalToolBuilders/
|
||||
.settings
|
||||
.vscode
|
||||
*.code-workspace
|
||||
*.xpr
|
||||
# Testing stuff
|
||||
xrechnung
|
||||
|
||||
# Mac stuff
|
||||
.DS_Store
|
||||
andre*-simple.xml
|
||||
somePrefix*.xml
|
||||
zz
|
||||
|
||||
# 2.0 stuff
|
||||
api/
|
||||
cli/
|
||||
core/
|
||||
|
|
|
|||
194
.gitlab-ci.yml
194
.gitlab-ci.yml
|
|
@ -1,31 +1,19 @@
|
|||
image: maven:latest
|
||||
|
||||
|
||||
variables:
|
||||
BUILD_PROPS: "-Dbuild.revision=$CI_COMMIT_SHA -Dbuild.branch=$CI_COMMIT_REF_NAME -Dbuild.number=$CI_PIPELINE_IID -Dfile.encoding=UTF-8 -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false"
|
||||
MAVEN_OPTS: "-Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true -Xmx6g"
|
||||
MAVEN_CLI_OPTS: " --batch-mode --update-snapshots --errors --fail-at-end --show-version -s .mvn/settings.xml"
|
||||
MAVEN_CLI_OPTS_CENTRAL: " --batch-mode --show-version -s .mvn/settings-maven-central.xml"
|
||||
BUILD_PROPS: "-Dbuild.revision=$CI_COMMIT_SHA -Dbuild.branch=$CI_COMMIT_REF_NAME -Dbuild.number=$CI_PIPELINE_IID "
|
||||
MAVEN_CLI_OPTS: " --batch-mode -Dmaven.repo.local=/cache/repository -Dfile.encoding=UTF-8"
|
||||
|
||||
before_script:
|
||||
- export CI_JOB_TIMESTAMP="-Dbuild.timestamp=$(date --utc --iso-8601=seconds)"
|
||||
|
||||
cache:
|
||||
# Change the cache key if major dependencies change
|
||||
key: constant160
|
||||
paths:
|
||||
- .m2/repository
|
||||
|
||||
# Basic Java build steps
|
||||
.java:
|
||||
build-amazoncorretto:
|
||||
stage: build
|
||||
needs:
|
||||
- job: java-11
|
||||
artifacts: false
|
||||
image: maven:amazoncorretto
|
||||
script:
|
||||
- mvn $MAVEN_CLI_OPTS $BUILD_PROPS $CI_JOB_TIMESTAMP verify
|
||||
artifacts:
|
||||
name: artifacts
|
||||
when: on_failure
|
||||
name: amazoncorretto
|
||||
paths:
|
||||
- target/*.jar
|
||||
reports:
|
||||
|
|
@ -33,15 +21,69 @@ cache:
|
|||
- target/surefire-reports/*.xml
|
||||
- target/failsafe-reports/*.xml
|
||||
|
||||
java-11:
|
||||
extends: .java
|
||||
image: maven:3-eclipse-temurin-11-alpine
|
||||
needs: [ ]
|
||||
build-java-14:
|
||||
stage: build
|
||||
image: maven:3-jdk-14
|
||||
script:
|
||||
- mvn $MAVEN_CLI_OPTS $BUILD_PROPS $CI_JOB_TIMESTAMP install
|
||||
- mvn $MAVEN_CLI_OPTS $BUILD_PROPS $CI_JOB_TIMESTAMP verify
|
||||
artifacts:
|
||||
name: java-14
|
||||
paths:
|
||||
- target/*.jar
|
||||
reports:
|
||||
junit:
|
||||
- target/surefire-reports/*.xml
|
||||
- target/failsafe-reports/*.xml
|
||||
|
||||
build-java-13:
|
||||
stage: build
|
||||
image: maven:3-jdk-13
|
||||
script:
|
||||
- mvn $MAVEN_CLI_OPTS $BUILD_PROPS $CI_JOB_TIMESTAMP verify
|
||||
artifacts:
|
||||
name: java-13
|
||||
paths:
|
||||
- target/*.jar
|
||||
reports:
|
||||
junit:
|
||||
- target/surefire-reports/*.xml
|
||||
- target/failsafe-reports/*.xml
|
||||
|
||||
build-java-12:
|
||||
stage: build
|
||||
image: maven:3-jdk-12
|
||||
script:
|
||||
- mvn $MAVEN_CLI_OPTS $BUILD_PROPS $CI_JOB_TIMESTAMP verify
|
||||
artifacts:
|
||||
name: java-12
|
||||
paths:
|
||||
- target/*.jar
|
||||
reports:
|
||||
junit:
|
||||
- target/surefire-reports/*.xml
|
||||
- target/failsafe-reports/*.xml
|
||||
|
||||
build-java-11-openj9:
|
||||
stage: build
|
||||
image: maven:3-jdk-11-openj9
|
||||
script:
|
||||
- mvn $MAVEN_CLI_OPTS $BUILD_PROPS $CI_JOB_TIMESTAMP verify
|
||||
artifacts:
|
||||
name: java-11-openj9
|
||||
paths:
|
||||
- target/*.jar
|
||||
reports:
|
||||
junit:
|
||||
- target/surefire-reports/*.xml
|
||||
- target/failsafe-reports/*.xml
|
||||
|
||||
build-java-11:
|
||||
stage: build
|
||||
image: maven:3-jdk-11
|
||||
script:
|
||||
- mvn $MAVEN_CLI_OPTS $BUILD_PROPS $CI_JOB_TIMESTAMP verify
|
||||
artifacts:
|
||||
name: java-11
|
||||
when: always
|
||||
paths:
|
||||
- target/*.jar
|
||||
- target/*.zip
|
||||
|
|
@ -50,86 +92,30 @@ java-11:
|
|||
- target/surefire-reports/*.xml
|
||||
- target/failsafe-reports/*.xml
|
||||
|
||||
java-17:
|
||||
extends: .java
|
||||
image: maven:3-eclipse-temurin-17-alpine
|
||||
|
||||
java-21:
|
||||
extends: .java
|
||||
image: maven:3-eclipse-temurin-21-alpine
|
||||
|
||||
java-25:
|
||||
extends: .java
|
||||
image: maven:3-eclipse-temurin-25-alpine
|
||||
|
||||
# Rare Java stuff
|
||||
.java_extended:
|
||||
extends: .java
|
||||
rules:
|
||||
- if: $CI_PIPELINE_SOURCE == "schedule"
|
||||
|
||||
# Note: the openj9 images don't exist for Java 17, 21 or 25
|
||||
# Removed because the latest public image is 11.0.11 which is not comaptible to the Lombok requirement of 11.0.23
|
||||
#java-11-openj9:
|
||||
# extends: .java_extended
|
||||
# image: maven:3-jdk-11-openj9
|
||||
|
||||
# Deploy Java 11 build on Maven Central
|
||||
deploy-java-11-snapshot:
|
||||
extends: java-11
|
||||
build-java-8-openj9:
|
||||
stage: build
|
||||
image: maven:3-jdk-8-openj9
|
||||
script:
|
||||
- mvn $MAVEN_CLI_OPTS_CENTRAL -P release-snapshot deploy
|
||||
|
||||
# Deploy Java 11 build to KoSIT repository (manually)
|
||||
deploy:
|
||||
stage: deploy
|
||||
image: maven:3-eclipse-temurin-11-alpine
|
||||
needs:
|
||||
- job: java-11
|
||||
script:
|
||||
- export PROJECT_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
|
||||
- mvn $MAVEN_CLI_OPTS deploy:deploy-file -Dfile=target/validator-${PROJECT_VERSION}.zip -DgroupId=kosit -DartifactId=validator -Dversion=${PROJECT_VERSION} -Dclassifier="distribution" -Dpackaging=zip -DrepositoryId="gitlab-maven" -Durl=https://projekte.kosit.org/api/v4/projects/7/packages/maven
|
||||
- mvn $MAVEN_CLI_OPTS deploy:deploy-file -Dfile=target/validator-${PROJECT_VERSION}.jar -DgroupId=kosit -DartifactId=validator -Dversion=${PROJECT_VERSION} -Dpackaging=jar -DrepositoryId="gitlab-maven" -Durl=https://projekte.kosit.org/api/v4/projects/7/packages/maven
|
||||
- mvn $MAVEN_CLI_OPTS deploy:deploy-file -Dfile=target/validator-${PROJECT_VERSION}-javadoc.jar -DgroupId=kosit -DartifactId=validator -Dversion=${PROJECT_VERSION} -Dclassifier="javadoc" -Dpackaging=zip -DrepositoryId="gitlab-maven" -Durl=https://projekte.kosit.org/api/v4/projects/7/packages/maven
|
||||
- mvn $MAVEN_CLI_OPTS deploy:deploy-file -Dfile=target/validator-${PROJECT_VERSION}-standalone.jar -DgroupId=kosit -DartifactId=validator -Dversion=${PROJECT_VERSION} -Dclassifier="standalone" -Dpackaging=jar -DrepositoryId="gitlab-maven" -Durl=https://projekte.kosit.org/api/v4/projects/7/packages/maven
|
||||
- mvn $MAVEN_CLI_OPTS deploy:deploy-file -Dfile=target/validator-${PROJECT_VERSION}-sources.jar -DgroupId=kosit -DartifactId=validator -Dversion=${PROJECT_VERSION} -Dclassifier="sources" -Dpackaging=jar -DrepositoryId="gitlab-maven" -Durl=https://projekte.kosit.org/api/v4/projects/7/packages/maven
|
||||
when: manual
|
||||
|
||||
# Build Docker images and upload to KoSIT registry
|
||||
create-build-image:
|
||||
stage: deploy
|
||||
image: docker:latest
|
||||
needs: [ ]
|
||||
services:
|
||||
- docker:dind
|
||||
script:
|
||||
- apk add bash
|
||||
- bash .mvn/createBuildImages.sh
|
||||
rules:
|
||||
- if: $CI_PIPELINE_SOURCE == "schedule"
|
||||
- if: $CI_COMMIT_REF_NAME == "main"
|
||||
changes:
|
||||
- .mvn/createBuildImages.sh
|
||||
|
||||
# Run OWASP checks - expensive so only on main branch
|
||||
owasp-check:
|
||||
stage: test
|
||||
image: maven:3-eclipse-temurin-21-alpine
|
||||
needs: [ ]
|
||||
# set job timeout to 1 hour - it's required when new rules are downloaded
|
||||
timeout: 1h
|
||||
variables:
|
||||
RUNNER_SCRIPT_TIMEOUT: 1h
|
||||
script:
|
||||
- mvn $MAVEN_CLI_OPTS $BUILD_PROPS $CI_JOB_TIMESTAMP validate -Powasp-check
|
||||
- mvn $MAVEN_CLI_OPTS $BUILD_PROPS $CI_JOB_TIMESTAMP verify
|
||||
artifacts:
|
||||
name: artifacts
|
||||
name: java-8-open-j9
|
||||
paths:
|
||||
- target/*.jar
|
||||
reports:
|
||||
codequality:
|
||||
- target/dependency-check-report.html
|
||||
rules:
|
||||
- if: $CI_PIPELINE_SOURCE == "schedule"
|
||||
- if: $CI_COMMIT_REF_NAME == "main"
|
||||
changes:
|
||||
- pom.xml
|
||||
- owasp-suppressions.xml
|
||||
junit:
|
||||
- target/surefire-reports/*.xml
|
||||
- target/failsafe-reports/*.xml
|
||||
|
||||
build-java8-alpine:
|
||||
stage: build
|
||||
image: maven:3-jdk-8-alpine
|
||||
script:
|
||||
- mvn $MAVEN_CLI_OPTS $BUILD_PROPS $CI_JOB_TIMESTAMP verify
|
||||
artifacts:
|
||||
name: java-8-alpine
|
||||
paths:
|
||||
- target/*.jar
|
||||
reports:
|
||||
junit:
|
||||
- target/surefire-reports/*.xml
|
||||
- target/failsafe-reports/*.xml
|
||||
|
|
|
|||
16
.idea/checkstyle-idea.xml
generated
Normal file
16
.idea/checkstyle-idea.xml
generated
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CheckStyle-IDEA">
|
||||
<option name="configuration">
|
||||
<map>
|
||||
<entry key="checkstyle-version" value="8.16" />
|
||||
<entry key="copy-libs" value="true" />
|
||||
<entry key="location-0" value="BUNDLED:(bundled):Sun Checks" />
|
||||
<entry key="location-1" value="BUNDLED:(bundled):Google Checks" />
|
||||
<entry key="scan-before-checkin" value="false" />
|
||||
<entry key="scanscope" value="JavaOnly" />
|
||||
<entry key="suppress-errors" value="false" />
|
||||
</map>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
13
.idea/compiler.xml
generated
Normal file
13
.idea/compiler.xml
generated
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<annotationProcessing>
|
||||
<profile name="Maven default annotation processors profile" enabled="true">
|
||||
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||
<outputRelativeToContentRoot value="true" />
|
||||
<module name="validationtool" />
|
||||
</profile>
|
||||
</annotationProcessing>
|
||||
</component>
|
||||
</project>
|
||||
16
.idea/eclipseCodeFormatter.xml
generated
Normal file
16
.idea/eclipseCodeFormatter.xml
generated
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="EclipseCodeFormatterProjectSettings">
|
||||
<option name="projectSpecificProfile">
|
||||
<ProjectSpecificProfile>
|
||||
<option name="disabledFileTypes" value="xml" />
|
||||
<option name="formatSeletedTextInAllFileTypes" value="false" />
|
||||
<option name="formatter" value="ECLIPSE" />
|
||||
<option name="importOrderConfigFilePath" value="$PROJECT_DIR$/.settings/org.eclipse.jdt.ui.prefs" />
|
||||
<option name="importOrderFromFile" value="true" />
|
||||
<option name="pathToConfigFileJava" value="$PROJECT_DIR$/.settings/org.eclipse.jdt.core.prefs" />
|
||||
<option name="useForLiveTemplates" value="true" />
|
||||
</ProjectSpecificProfile>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
10
.idea/encodings.xml
generated
Normal file
10
.idea/encodings.xml
generated
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding">
|
||||
<file url="file://$PROJECT_DIR$" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/src/main/model" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
|
||||
<file url="PROJECT" charset="UTF-8" />
|
||||
</component>
|
||||
</project>
|
||||
83
.idea/misc.xml
generated
Normal file
83
.idea/misc.xml
generated
Normal file
|
|
@ -0,0 +1,83 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="MarkdownProjectSettings">
|
||||
<PreviewSettings splitEditorLayout="SPLIT" splitEditorPreview="PREVIEW" useGrayscaleRendering="false" zoomFactor="1.0" maxImageWidth="0" showGitHubPageIfSynced="false" allowBrowsingInPreview="false" synchronizePreviewPosition="true" highlightPreviewType="LINE" highlightFadeOut="5" highlightOnTyping="true" synchronizeSourcePosition="true">
|
||||
<PanelProvider>
|
||||
<provider providerId="com.vladsch.idea.multimarkdown.editor.swing.html.panel" providerName="Default - Swing" />
|
||||
</PanelProvider>
|
||||
</PreviewSettings>
|
||||
<ParserSettings>
|
||||
<PegdownExtensions>
|
||||
<option name="ABBREVIATIONS" value="false" />
|
||||
<option name="ANCHORLINKS" value="true" />
|
||||
<option name="ATXHEADERSPACE" value="true" />
|
||||
<option name="AUTOLINKS" value="true" />
|
||||
<option name="DEFINITIONS" value="false" />
|
||||
<option name="FENCED_CODE_BLOCKS" value="true" />
|
||||
<option name="FOOTNOTES" value="false" />
|
||||
<option name="HARDWRAPS" value="false" />
|
||||
<option name="INSERTED" value="false" />
|
||||
<option name="QUOTES" value="false" />
|
||||
<option name="RELAXEDHRULES" value="true" />
|
||||
<option name="SMARTS" value="false" />
|
||||
<option name="STRIKETHROUGH" value="true" />
|
||||
<option name="SUBSCRIPT" value="false" />
|
||||
<option name="SUPERSCRIPT" value="false" />
|
||||
<option name="SUPPRESS_HTML_BLOCKS" value="false" />
|
||||
<option name="SUPPRESS_INLINE_HTML" value="false" />
|
||||
<option name="TABLES" value="true" />
|
||||
<option name="TASKLISTITEMS" value="true" />
|
||||
<option name="TOC" value="false" />
|
||||
<option name="WIKILINKS" value="true" />
|
||||
</PegdownExtensions>
|
||||
<ParserOptions>
|
||||
<option name="COMMONMARK_LISTS" value="false" />
|
||||
<option name="DUMMY" value="false" />
|
||||
<option name="EMOJI_SHORTCUTS" value="true" />
|
||||
<option name="FLEXMARK_FRONT_MATTER" value="false" />
|
||||
<option name="GFM_TABLE_RENDERING" value="true" />
|
||||
<option name="GITBOOK_URL_ENCODING" value="false" />
|
||||
<option name="GITHUB_EMOJI_URL" value="false" />
|
||||
<option name="GITHUB_LISTS" value="true" />
|
||||
<option name="GITHUB_WIKI_LINKS" value="true" />
|
||||
<option name="JEKYLL_FRONT_MATTER" value="false" />
|
||||
<option name="SIM_TOC_BLANK_LINE_SPACER" value="true" />
|
||||
</ParserOptions>
|
||||
</ParserSettings>
|
||||
<HtmlSettings headerTopEnabled="false" headerBottomEnabled="false" bodyTopEnabled="false" bodyBottomEnabled="false" embedUrlContent="false" addPageHeader="true">
|
||||
<GeneratorProvider>
|
||||
<provider providerId="com.vladsch.idea.multimarkdown.editor.swing.html.generator" providerName="Default Swing HTML Generator" />
|
||||
</GeneratorProvider>
|
||||
<headerTop />
|
||||
<headerBottom />
|
||||
<bodyTop />
|
||||
<bodyBottom />
|
||||
</HtmlSettings>
|
||||
<CssSettings previewScheme="UI_SCHEME" cssUri="" isCssUriEnabled="false" isCssTextEnabled="false" isDynamicPageWidth="true">
|
||||
<StylesheetProvider>
|
||||
<provider providerId="com.vladsch.idea.multimarkdown.editor.swing.html.css" providerName="Default Swing Stylesheet" />
|
||||
</StylesheetProvider>
|
||||
<ScriptProviders />
|
||||
<cssText />
|
||||
</CssSettings>
|
||||
<HtmlExportSettings updateOnSave="false" parentDir="$ProjectFileDir$" targetDir="$ProjectFileDir$" cssDir="" scriptDir="" plainHtml="false" imageDir="" copyLinkedImages="false" imageUniquifyType="0" targetExt="" useTargetExt="false" noCssNoScripts="false" linkToExportedHtml="true" exportOnSettingsChange="true" regenerateOnProjectOpen="false" />
|
||||
<LinkMapSettings>
|
||||
<textMaps />
|
||||
</LinkMapSettings>
|
||||
</component>
|
||||
<component name="MavenProjectsManager">
|
||||
<option name="originalFiles">
|
||||
<list>
|
||||
<option value="$PROJECT_DIR$/pom.xml" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="NodePackageJsonFileManager">
|
||||
<packageJsonPaths />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" project-jdk-name="11" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
<component name="jetbrains.communicator.idea.IdProvider" IDEtalkID="4B2DA906C3A7DF4F7B6EA28093E19A3F" />
|
||||
</project>
|
||||
22
.idea/saveactions_settings.xml
generated
Normal file
22
.idea/saveactions_settings.xml
generated
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="SaveActionSettings">
|
||||
<option name="actions">
|
||||
<set>
|
||||
<option value="activate" />
|
||||
<option value="activateOnShortcut" />
|
||||
<option value="activateOnBatch" />
|
||||
<option value="organizeImports" />
|
||||
<option value="reformatChangedCode" />
|
||||
<option value="rearrange" />
|
||||
<option value="fieldCanBeFinal" />
|
||||
<option value="localCanBeFinal" />
|
||||
<option value="methodMayBeStatic" />
|
||||
<option value="unqualifiedFieldAccess" />
|
||||
<option value="missingOverrideAnnotation" />
|
||||
<option value="useBlocks" />
|
||||
</set>
|
||||
</option>
|
||||
<option name="configurationPath" value="" />
|
||||
</component>
|
||||
</project>
|
||||
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
#
|
||||
# Copyright 2017-2022 Koordinierungsstelle für IT-Standards (KoSIT)
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
TAGS=("3-jdk-8" "3-jdk-8-openj9" "3-eclipse-temurin-11-alpine" "3-jdk-11-openj9" "3-eclipse-temurin-17-alpine" "3-eclipse-temurin-21-alpine" "3-eclipse-temurin-24-alpine")
|
||||
|
||||
docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
|
||||
for i in "${TAGS[@]}"
|
||||
do
|
||||
echo Creating build image for "$i"
|
||||
{
|
||||
echo "FROM maven:${i}"
|
||||
} >>Dockerfile
|
||||
docker build -t "$CI_REGISTRY_IMAGE/maven:$i" .
|
||||
docker push "$CI_REGISTRY_IMAGE/maven:${i}"
|
||||
rm Dockerfile
|
||||
done
|
||||
|
|
@ -1 +0,0 @@
|
|||
-Xms128m -Xmx256m
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
|
||||
<servers>
|
||||
<server>
|
||||
<id>central</id>
|
||||
<username>${MVN_CENTRAL_USER}</username>
|
||||
<password>${MAVEN_CENTRAL_TOKEN}</password>
|
||||
</server>
|
||||
</servers>
|
||||
</settings>
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
|
||||
<servers>
|
||||
<server>
|
||||
<id>gitlab-maven</id>
|
||||
<configuration>
|
||||
<httpHeaders>
|
||||
<property>
|
||||
<name>Job-Token</name>
|
||||
<value>${env.CI_JOB_TOKEN}</value>
|
||||
</property>
|
||||
</httpHeaders>
|
||||
</configuration>
|
||||
</server>
|
||||
</servers>
|
||||
</settings>
|
||||
422
.settings/org.eclipse.jdt.core.prefs
Normal file
422
.settings/org.eclipse.jdt.core.prefs
Normal file
|
|
@ -0,0 +1,422 @@
|
|||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
|
||||
org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
|
||||
org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
|
||||
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
|
||||
org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
|
||||
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||
org.eclipse.jdt.core.compiler.compliance=1.8
|
||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||
org.eclipse.jdt.core.compiler.doc.comment.support=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
|
||||
org.eclipse.jdt.core.compiler.problem.deadCode=warning
|
||||
org.eclipse.jdt.core.compiler.problem.deprecation=warning
|
||||
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
|
||||
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
|
||||
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=warning
|
||||
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
|
||||
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
|
||||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
||||
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
|
||||
org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
|
||||
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
|
||||
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
|
||||
org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning
|
||||
org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
|
||||
org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
|
||||
org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
|
||||
org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
|
||||
org.eclipse.jdt.core.compiler.problem.missingJavadocComments=warning
|
||||
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected
|
||||
org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=all_standard_tags
|
||||
org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning
|
||||
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
|
||||
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
|
||||
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
|
||||
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warning
|
||||
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
|
||||
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
|
||||
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
|
||||
org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
|
||||
org.eclipse.jdt.core.compiler.problem.nullReference=warning
|
||||
org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
|
||||
org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
|
||||
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
|
||||
org.eclipse.jdt.core.compiler.problem.parameterAssignment=warning
|
||||
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
|
||||
org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
|
||||
org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
|
||||
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
|
||||
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
|
||||
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
|
||||
org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
|
||||
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
|
||||
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=warning
|
||||
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
|
||||
org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
|
||||
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
|
||||
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unusedImport=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unusedParameter=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
|
||||
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
|
||||
org.eclipse.jdt.core.compiler.processAnnotations=enabled
|
||||
org.eclipse.jdt.core.compiler.release=disabled
|
||||
org.eclipse.jdt.core.compiler.source=1.8
|
||||
org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647
|
||||
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
|
||||
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=18
|
||||
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_assignment=0
|
||||
org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
|
||||
org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
|
||||
org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header=0
|
||||
org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
|
||||
org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references=0
|
||||
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=83
|
||||
org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_type_arguments=0
|
||||
org.eclipse.jdt.core.formatter.alignment_for_type_parameters=0
|
||||
org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
|
||||
org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
|
||||
org.eclipse.jdt.core.formatter.blank_lines_after_package=1
|
||||
org.eclipse.jdt.core.formatter.blank_lines_before_field=1
|
||||
org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=1
|
||||
org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
|
||||
org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
|
||||
org.eclipse.jdt.core.formatter.blank_lines_before_method=1
|
||||
org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
|
||||
org.eclipse.jdt.core.formatter.blank_lines_before_package=0
|
||||
org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
|
||||
org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
|
||||
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
|
||||
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
|
||||
org.eclipse.jdt.core.formatter.comment.format_block_comments=true
|
||||
org.eclipse.jdt.core.formatter.comment.format_header=false
|
||||
org.eclipse.jdt.core.formatter.comment.format_html=true
|
||||
org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
|
||||
org.eclipse.jdt.core.formatter.comment.format_line_comments=true
|
||||
org.eclipse.jdt.core.formatter.comment.format_source_code=true
|
||||
org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
|
||||
org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
|
||||
org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
|
||||
org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert
|
||||
org.eclipse.jdt.core.formatter.comment.line_length=120
|
||||
org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
|
||||
org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
|
||||
org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
|
||||
org.eclipse.jdt.core.formatter.compact_else_if=true
|
||||
org.eclipse.jdt.core.formatter.continuation_indentation=2
|
||||
org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
|
||||
org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
|
||||
org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
|
||||
org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
|
||||
org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
|
||||
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
|
||||
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
|
||||
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
|
||||
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
|
||||
org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
|
||||
org.eclipse.jdt.core.formatter.indent_empty_lines=false
|
||||
org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
|
||||
org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
|
||||
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
|
||||
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true
|
||||
org.eclipse.jdt.core.formatter.indentation.size=4
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
|
||||
org.eclipse.jdt.core.formatter.join_lines_in_comments=true
|
||||
org.eclipse.jdt.core.formatter.join_wrapped_lines=true
|
||||
org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
|
||||
org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
|
||||
org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
|
||||
org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
|
||||
org.eclipse.jdt.core.formatter.lineSplit=140
|
||||
org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
|
||||
org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
|
||||
org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
|
||||
org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
|
||||
org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation=common_lines
|
||||
org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause=common_lines
|
||||
org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration=common_lines
|
||||
org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment=common_lines
|
||||
org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement=common_lines
|
||||
org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration=common_lines
|
||||
org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration=common_lines
|
||||
org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation=common_lines
|
||||
org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement=common_lines
|
||||
org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause=common_lines
|
||||
org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
|
||||
org.eclipse.jdt.core.formatter.tabulation.char=space
|
||||
org.eclipse.jdt.core.formatter.tabulation.size=4
|
||||
org.eclipse.jdt.core.formatter.use_on_off_tags=true
|
||||
org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=true
|
||||
org.eclipse.jdt.core.formatter.wrap_before_assignment_operator=false
|
||||
org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
|
||||
org.eclipse.jdt.core.formatter.wrap_before_conditional_operator=true
|
||||
org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
|
||||
org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
|
||||
org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter
|
||||
127
.settings/org.eclipse.jdt.ui.prefs
Normal file
127
.settings/org.eclipse.jdt.ui.prefs
Normal file
File diff suppressed because one or more lines are too long
246
CHANGELOG.md
246
CHANGELOG.md
|
|
@ -1,260 +1,47 @@
|
|||
# Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
All notable changes to the Schematron Rules and this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
|
||||
## 1.6.2 - 2026-02-17
|
||||
|
||||
### Changed
|
||||
|
||||
- (BUILD) [GitHub #173]( https://github.com/itplr-kosit/validator/issues/173) The JAR files now contain details on the used third-party component licenses. Thanks to @cech12
|
||||
- (BUILD) [GitHub #169](https://github.com/itplr-kosit/validator/issues/169) The `.zip` file created from `maven-assembly-plugin` now contains the correct xml-resolver dependencies. Thanks to @landrix for pointing that out
|
||||
- (BUILD) [#179](https://projekte.kosit.org/kosit/validator/-/issues/179) Updated all dependencies to the latest suitable versions
|
||||
|
||||
## 1.6.1 - 2026-02-05
|
||||
|
||||
### Changed
|
||||
|
||||
- (CORE) [#106](https://projekte.kosit.org/kosit/validator/-/issues/106) The `match` element in `scenarios.xml` is required to have at least one character (per XSD change)
|
||||
- (BUILD) [#176](https://projekte.kosit.org/kosit/validator/-/issues/176) The Maven Central deployed `pom.xml` properly includes runtime dependencies
|
||||
- (BUILD) [#175](https://projekte.kosit.org/kosit/validator/-/issues/175) The `.zip` file created from `maven-assembly-plugin` no longer contains the standalone validator, which reduces its size to 50%
|
||||
|
||||
## 1.6.0 - 2025-11-07
|
||||
|
||||
## 1.2.0 (unreleased)
|
||||
### Added
|
||||
|
||||
- (CORE) [GitHub #127](https://github.com/itplr-kosit/validator/issues/127) New API method `Result.getCustomFailedAsserts()` to access failed asserts with custom error levels
|
||||
|
||||
### Fixed
|
||||
|
||||
- (DOC) [GitHub PR#166](https://github.com/itplr-kosit/validator/pull/166) Fixed broken links in `docs/api.md`
|
||||
|
||||
### Changed
|
||||
|
||||
- (CORE) Migration from javax to jakarta xml bind
|
||||
- (DOC) [GitHub PR#132](https://github.com/itplr-kosit/validator/pull/132) Updated the link to the example Validator scenario configuration
|
||||
- (BUILD) Support for *building and compilation* is restricted to the following Java versions:
|
||||
- Java 11: any version ≥ 11.0.23
|
||||
- Java 12 to 16 will not work
|
||||
- Java 17: any version ≥ 17.0.11
|
||||
- Java 18 to 20 will not work
|
||||
- Any version from Java 21 onwards will work
|
||||
- The reason for this is the usage of the `-proc:full` compiler parameter which in turn is needed for Lombok usage in JDK 23+.
|
||||
|
||||
### Removed
|
||||
|
||||
- (CORE) java 8 support. new default jdk 11
|
||||
|
||||
## 1.5.2 - 2025-09-01
|
||||
|
||||
### Fixed
|
||||
|
||||
- (BUILD) [#148](https://projekte.kosit.org/kosit/validator/-/issues/148) Regression that due to renaming from `validationtool` to `validator` the distribution zip did not contain all jars anymore
|
||||
|
||||
## 1.5.1 - 2025-09-01
|
||||
|
||||
### Fixed
|
||||
|
||||
- (CORE) [#130](https://projekte.kosit.org/kosit/validator/-/issues/130) Check result to stdout causes an exception. This also fixes [GitHub #131](https://github.com/itplr-kosit/validator/issues/131)
|
||||
- (CORE) [#131](https://projekte.kosit.org/kosit/validator/-/issues/131) `UnsupportedOperationException` because of read-only list. This also fixes [GitHub #136](https://github.com/itplr-kosit/validator/issues/136)
|
||||
- (CLI) [#104](https://projekte.kosit.org/kosit/validator/-/issues/104) made the usage of the `-r` parameter optional, if only one unnamed scenario is used
|
||||
- (CLI) [#145](https://projekte.kosit.org/kosit/validator/-/issues/145) If the CLI is invoked without any parameter, the usage is shown twice
|
||||
- (DOC) [#129](https://projekte.kosit.org/kosit/validator/-/issues/129) API documentation is outdated. This also fixes [GitHub #130](https://github.com/itplr-kosit/validator/issues/130)
|
||||
- (BUILD) [#62](https://projekte.kosit.org/kosit/validator/-/issues/62) Surefire Test Error running `de.kosit.validationtool.impl.xml.RemoteResolvingStrategyTest` fails without `http.proxy` setting
|
||||
- (BUILD) [#110](https://projekte.kosit.org/kosit/validator/-/issues/110) reactivated the GitLab CI environment
|
||||
|
||||
### Added
|
||||
|
||||
- (BUILD) [#140](https://projekte.kosit.org/kosit/validator/-/issues/140) prepare pom.xml to be able to release to Maven Central
|
||||
- (BUILD) [#144](https://projekte.kosit.org/kosit/validator/-/issues/144) created a Maven profile to release on Maven Central
|
||||
|
||||
### Changed
|
||||
|
||||
- (CORE) [#109](https://projekte.kosit.org/kosit/validator/-/issues/109) dependencies were updated to the latest Java 1.8 compatible versions
|
||||
- Bump [Saxon HE](https://www.saxonica.com/documentation11/documentation.xml) to 12.8
|
||||
- Bump [jaxb-ri](https://github.com/eclipse-ee4j/jaxb-ri) to 2.3.9
|
||||
- Bump [SLF4J](https://www.slf4j.org/) to 2.0.17
|
||||
- (CORE) [#136](https://projekte.kosit.org/kosit/validator/-/issues/136) removed IDE project folders from git
|
||||
- (BUILD) [#135](https://projekte.kosit.org/kosit/validator/-/issues/135) protected specific git branches
|
||||
- (BUILD) [#137](https://projekte.kosit.org/kosit/validator/-/issues/137) GitLab CI should only run on Java LTS versions as well as the latest Java version
|
||||
- (BUILD) [#147](https://projekte.kosit.org/kosit/validator/-/issues/147) Change Maven coordinates from `de.kosit:validationtool` to `org.kosit:validator`
|
||||
|
||||
## 1.5.0
|
||||
|
||||
### Fixed
|
||||
|
||||
- (CLI) [#93](https://projekte.kosit.org/kosit/validator/-/issues/93) Remove usage information, when validation failed
|
||||
- (CLI) [#95](https://projekte.kosit.org/kosit/validator/-/issues/95) NPE when using empty repository definition (-r "")
|
||||
- (CORE) [GitHub #101](https://github.com/itplr-kosit/validator/issues/101) Role is null in FailedAssert
|
||||
|
||||
### Added
|
||||
|
||||
- (CLI) Support for multiple configurations and multiple repositories. See [cli documentation](docs/cli.md) for details
|
||||
- (API) Possibility to use preconfigured Saxon `Processor` instance for validation
|
||||
|
||||
### Changed
|
||||
|
||||
- (CORE) [GitHub #100](https://github.com/itplr-kosit/validator/issues/100) Make createReport optional
|
||||
- (DAEMON) UI rewrite based on [Docusaurs](https://docusaurus.io)
|
||||
- (API) [ResolvingConfigurationStrategy.java#getProcessor()](de/kosit/validationtool/api/ResolvingConfigurationStrategy) is removed.
|
||||
- (CORE) Bump [Saxon HE](https://www.saxonica.com/documentation11/documentation.xml) to 11.4
|
||||
- (CORE) Bump [jaxb-ri](https://github.com/eclipse-ee4j/jaxb-ri) to 2.3.7
|
||||
- (CORE) Various other dependency updates. See pom.xml
|
||||
- (CORE) CLI parsing based on pico-cli, commons-cli is removed
|
||||
|
||||
## 1.4.2
|
||||
|
||||
### Fixed
|
||||
|
||||
- (CLI) [#74](https://projekte.kosit.org/kosit/validator/-/issues/74) fix ansi output of the cli version
|
||||
- [#80](https://github.com/itplr-kosit/validator/issues/80) using classloader to initialize jaxb context (to support
|
||||
usage in OSGi
|
||||
environments)
|
||||
- [#75](https://github.com/itplr-kosit/validator/issues/75) Improve logging on invalid documents
|
||||
|
||||
## 1.4.1
|
||||
|
||||
### Fixed
|
||||
|
||||
- Allow more than 3 customLevel elements in scenarios (see xrechnung
|
||||
configuration [issue 49](https://github.com/itplr-kosit/validator-configuration-xrechnung/issues/49))
|
||||
- Remove saxon signature from java8 uber-jar (see [67](https://github.com/itplr-kosit/validator/issues/67))
|
||||
|
||||
## 1.4.0
|
||||
|
||||
### Fixed
|
||||
|
||||
- date conversion when
|
||||
using [ConfigurationBuilder#date(Date)](https://github.com/itplr-kosit/validator/blob/d7beb1040418ae5cbeb9427532fd87482f55756c/src/main/java/de/kosit/validationtool/config/ConfigurationBuilder.java#L109)
|
||||
- (CLI) [#51](https://github.com/itplr-kosit/validator/issues/51) Suffix of report xml is missing
|
||||
- [#53](https://github.com/itplr-kosit/validator/issues/53) Fix copyright and licensing information
|
||||
- [#56](https://github.com/itplr-kosit/validator/issues/56) `namespace` element content needs trimming
|
||||
- [DAEMON] [#57](https://github.com/itplr-kosit/validator/issues/57) Reading large inputs correctly
|
||||
|
||||
### Added
|
||||
|
||||
- read saxon XdmNode with InputFactory
|
||||
- (CLI) custom output without the various log messages
|
||||
- (CLI) options to set the log level (`-X` = full debug output, `-l <level>` set a specific level)
|
||||
- (CLI) return code is not 0 on rejected results
|
||||
- (CLI) read (single) test target from stdin
|
||||
- [DAEMON] name inputs via request URI
|
||||
|
||||
### Changed
|
||||
|
||||
- InputFactory has methods to read any java.xml.transform.Source as Input not only StreamSources
|
||||
- InputFactory uses a generated UUID as name for SourceInput, if no "real" name can be derived
|
||||
- saxon dependency update (minor, 9.9.1-7)
|
||||
- [DAEMON] proper status codes when returning results (see [daemon documentation](./docs/daemon.md#status-codes))
|
||||
|
||||
## 1.3.1
|
||||
|
||||
### Fixed
|
||||
|
||||
- `getFailedAsserts()` and `isSchematronValid()`
|
||||
in [DefaultResult.java](https://github.com/itplr-kosit/validator/blob/main/src/main/java/de/kosit/validationtool/impl/DefaultResult.java)
|
||||
do not reflect actual schematron validation result
|
||||
- processing aborts on schematron execution errors (e.g. errors within schematron logic). The validator now generates a
|
||||
report in such cases.
|
||||
- exception while resolving when using XSLT's `unparsed-text()` function within report generation
|
||||
|
||||
### Added
|
||||
|
||||
- (CLI) summary report
|
||||
|
||||
### Changed
|
||||
|
||||
- engine info contains version number of the validator (configurations can output this in the report for maintainance
|
||||
puposes)
|
||||
- options to customize serialized report file names (cmdline only) via `--report-prefix` and `--report-postfix`
|
||||
- remove unused dependency Apache Commons HTTP
|
||||
|
||||
## 1.3.0
|
||||
|
||||
### Added
|
||||
|
||||
- Added a builder style configuration API to configure scenarios
|
||||
- Added an option to configure xml security e.g. to load from http sources or not from a specific repository
|
||||
(so loading is configurable less restrictive, default strategy is to only load from a local repository)
|
||||
- Support java.xml.transform.Source as Input
|
||||
|
||||
### Changed
|
||||
|
||||
- Inputs are NOT read into memory (e.g. Byte-Array) prior processing within the validator. This reduces memory
|
||||
consumption.
|
||||
- Overall processing of xml files is based on Saxon s9api. No JAXP or SAX classes are used by
|
||||
the validator (this further improves performance and memory consumption)
|
||||
|
||||
### Deprecations
|
||||
|
||||
- CheckConfiguration is deprecated now. Use Configuration.load(...) or Configuration.build(...)
|
||||
|
||||
## 1.2.1
|
||||
|
||||
### Fixed
|
||||
|
||||
- Validator is creating invalid createReportInput xml in case of no scenario match
|
||||
|
||||
## 1.2.0
|
||||
|
||||
### Added
|
||||
|
||||
- Provide access to schematron result
|
||||
through [Result.java](https://github.com/itplr-kosit/validator/blob/main/src/main/java/de/kosit/validationtool/api/Result.java)
|
||||
- Provide access to schematron result through Result.java
|
||||
- *Result#getFailedAsserts()* returns a list of failed asserts found by schematron
|
||||
- *Result#isSchematronValid()* convinience access to evaluate whether schematron was processed without any *
|
||||
FailedAsserts*
|
||||
|
||||
- *Result#isSchematronValid()* convinience access to evaluate whether schematron was processed without any *FailedAsserts*
|
||||
### Changed
|
||||
|
||||
- *Result#getAcceptRecommendation()* does not *only* work when *acceptMatch* is configured in the scenario
|
||||
- schema correctness is a precondition, if the checked instance is not valid, this evaluates to *REJECTED*
|
||||
- if *acceptMatch* is configured, the result is based on the boolean result of the xpath expression evaluated against
|
||||
the generated report
|
||||
- if *no* *acceptMatch* is configured, the result is based on evaluation of schema and schematron correctness
|
||||
- *UNDEFINED* is only returned, when processing is stopped somehow
|
||||
- *Result#isAcceptable()* can now evaluate to true, when no *acceptMatch* is configured (see above)
|
||||
|
||||
- *getAcceptRecommendation()* does not _only_ work when _acceptMatch_ is configured in the scenario
|
||||
- schema correct is a precondion, of the checked instance is not valid, this evaluates to _REJECTED_
|
||||
- if _acceptMatch_ is configured, the result is based on the boolean result of the xpath expression evaluated against the generated report
|
||||
- if *no* _acceptMatch_ is configured, the result is based on evaluation of schema and schematron correctness
|
||||
- _UNDEFINED_ is only returned, when processing is stopped somehow
|
||||
- *isAcceptable()* can no evaluate to true, when no _acceptMatch_ is configured (see above)
|
||||
|
||||
## 1.1.3
|
||||
|
||||
### Fixed
|
||||
|
||||
- XXE vulnerability when reading xml documents with Saxon [#44](https://github.com/itplr-kosit/validator/issues/44)
|
||||
- validator unintentionally stopped when schematron processing has errors.
|
||||
See [#41](https://github.com/itplr-kosit/validator/issues/41).
|
||||
- validator unintentionally stopped when schematron processing has errors. See [#41](https://github.com/itplr-kosit/validator/issues/41).
|
||||
|
||||
## 1.1.2
|
||||
|
||||
### Fixed
|
||||
|
||||
- NPE in Result.getReportDocument for malformed xml input
|
||||
|
||||
## 1.1.1
|
||||
|
||||
### Added
|
||||
|
||||
- Convenience method for accessing information about well-formedness in Result
|
||||
- Convenience method for accessing information about schema validation result in Result
|
||||
|
||||
### Fixed
|
||||
|
||||
- NPE when validating non-XML files
|
||||
|
||||
## 1.1.0
|
||||
|
||||
### Added
|
||||
|
||||
- Enhanced API-Usage e.g. return *Result* object with processing information
|
||||
- Enhanced API-Usage e.g. return _Result_ object with processing information
|
||||
- Support loading scenarios and content from a JAR-File
|
||||
- Simple Daemon-Mode exposing validation functionality via http
|
||||
- cli option to serialize the 'report input' xml document to *cwd* (current working directory)
|
||||
- cli option to serialize the 'report input' xml document to _cwd_ (current working directory)
|
||||
- Documentation in `docs` folder
|
||||
|
||||
### Changed
|
||||
|
||||
- Use s9api (e.g. XdmNode) internally for loading and holding xml objects (further memory optimization)
|
||||
- Builds with java 8 and >= 11
|
||||
- Packages for java8 and java >= 11 (with jaxb included)
|
||||
|
|
@ -270,8 +57,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
|
||||
### Changed
|
||||
|
||||
- Removed XRechnung configuration from release artifacts and source (moved
|
||||
to [own repository](https://github.com/itplr-kosit/validator-configuration-xrechnung) )
|
||||
- Removed XRechnung configuration from release artifacts and source (moved to [own repository](https://github.com/itplr-kosit/validator-configuration-xrechnung) )
|
||||
|
||||
## 1.0.0
|
||||
|
||||
|
|
|
|||
25
LICENSE
25
LICENSE
|
|
@ -174,3 +174,28 @@
|
|||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "{}"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright {yyyy} {name of copyright owner}
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
|
|
|||
30
NOTICE
30
NOTICE
|
|
@ -1,29 +1,5 @@
|
|||
KoSIT XML Validator
|
||||
Copyright 2017-2026 Koordinierungsstelle für IT-Standards (KoSIT)
|
||||
KoSIT Validaor
|
||||
Copyright 2019 Koordinierungsstelle für IT-Standards
|
||||
|
||||
This product includes software developed by
|
||||
Koordinierungsstelle für IT-Standards (<https://xeinkauf.de/>).
|
||||
|
||||
This product includes software developed at
|
||||
The Apache Software Foundation (http://www.apache.org/).
|
||||
Licensed under Apache 2.0
|
||||
|
||||
This product includes software developed at
|
||||
Fusesource (http://fusesource.github.io/jansi/).
|
||||
Licensed under Apache 2.0
|
||||
|
||||
This product includes software developed at
|
||||
Remko Popma (https://picocli.info/).
|
||||
Licensed under Apache 2.0
|
||||
|
||||
This product includes software developed at
|
||||
Saxonica (https://github.com/Saxonica/Saxon-HE).
|
||||
Licensed under MPL 2.0
|
||||
|
||||
This product includes software developed at
|
||||
Eclipse Foundation (https://github.com/eclipse-ee4j/jaxb-ri).
|
||||
Licensed under EDL 1.0
|
||||
|
||||
This product includes software developed at
|
||||
QOS.ch (https://www.slf4j.org/).
|
||||
Licensed under MIT
|
||||
Koordinierungsstelle für IT-Standards (https://www.kosit.de/).
|
||||
|
|
|
|||
150
README.md
150
README.md
|
|
@ -1,159 +1,93 @@
|
|||
# KoSIT Validator
|
||||
# Validator
|
||||
|
||||
[](https://central.sonatype.com/artifact/org.kosit/validator)
|
||||
[](https://www.apache.org/licenses/LICENSE-2.0)
|
||||
The validator is an XML validation-engine. It validates XML documents against XML Schema and Schematron Rules depending on self defined [scenarios](docs/configurations.md) which are used to fully configure the validation process.
|
||||
The validator always outputs a [validation report in XML](docs/configurations.md#validators-report) including all validation errors and data about the validation.
|
||||
|
||||
## Packages
|
||||
|
||||
## Introduction
|
||||
The validator distribution contains the following artifacts:
|
||||
|
||||
The Validator is an XML validation engine to validate and process XML files in various formats. It basically does the following in order:
|
||||
1. **validationtool-`<version>`.jar**: Java library for embedded use within an application
|
||||
1. **validationtool-`<version`>-standalone.jar**: Uber-JAR for standalone usage containing all dependencies in one jar file. This file comes with JAXB *embedded* and can be used with Java 8 and Java >= 11)
|
||||
1. **validationtool-`<version`>-java8-standalone.jar**: Uber-JAR for standalone usage with Java JDK 8 containing all dependencies in one jar file. This file file *does not* contain JAXB and depends on the bundled version of the JDK.
|
||||
1. **libs/***: directory containing all (incl. optional) dependencies of the validator
|
||||
|
||||
1. identify actual XML format
|
||||
1. validate the XML file (using schema and schematron rules)
|
||||
1. generate a custom report / extract custom data from the XML file
|
||||
1. compute an acceptance status (according the supplied schema and rules)
|
||||
## Build
|
||||
|
||||
The Validator depends on self defined [scenarios](docs/configurations.md) in order to fully configure the whole process.
|
||||
It always creates a [validation report in XML](docs/configurations.md#validators-report). The actual content of the report can also be controlled by the scenario.
|
||||
### Requirements
|
||||
|
||||
See [architecture](docs/architecture.md) for information about the whole validation process.
|
||||
* Maven > 3.0.0
|
||||
* Java > 8 update 111
|
||||
|
||||
### Procedure
|
||||
|
||||
## Validation configurations
|
||||
`mvn install` generates two different packages in the `dist` directory:
|
||||
|
||||
## Validation Configurations
|
||||
|
||||
The validator is just an engine and does not know anything about XML Documents and has no own validation rules.
|
||||
|
||||
The Validator is just an engine and does not know anything about XML documents and has no own validation rules.
|
||||
Validation rules and details are defined in [validation scenarios](docs/configurations.md) which are used to fully configure the validation process.
|
||||
All configurations are self-contained modules which are deployed and developed on their own.
|
||||
|
||||
### Example validation configurations
|
||||
All configurations are self-contained modules and deployed on their own.
|
||||
|
||||
Here are some public validation configurations:
|
||||
### Third Party Validation Configurations
|
||||
|
||||
* Validation Configuration for [XRechnung](https://xeinkauf.de/xrechnung/):
|
||||
Currently, there are two public third party validation configurations available.
|
||||
|
||||
* Validation Configuration for [XRechnung](http://www.xoev.de/de/xrechnung) is available on
|
||||
* Source code is available on [GitHub](https://github.com/itplr-kosit/validator-configuration-xrechnung)
|
||||
* [Releases](https://github.com/itplr-kosit/validator-configuration-xrechnung/releases) can also be downloaded
|
||||
* Validation Configuration for [Peppol BIS Billing](https://docs.peppol.eu/poacc/billing/3.0/):
|
||||
* Source code is available on [GitHub](https://github.com/itplr-kosit/validator-configuration-bis)
|
||||
* [Releases](https://github.com/itplr-kosit/validator-configuration-bis/releases) can also be downloaded
|
||||
* Validation Configuration for [XGewerbeanzeige](https://xgewerbeanzeige.de/)
|
||||
* Validation Configuration for XGewerbeanzeige
|
||||
* Source code is available on [GitHub](https://github.com/itplr-kosit/validator-configuration-xgewerbeanzeige)
|
||||
* [Releases](https://github.com/itplr-kosit/validator-configuration-xgewerbeanzeige/releases) can also be downloaded
|
||||
|
||||
## Usage
|
||||
|
||||
The Validator can be used in three different ways:
|
||||
The validator is designed to be used in three different ways:
|
||||
|
||||
* as standalone application running from the CLI
|
||||
* as standalone application running from the cli
|
||||
* as library embedded within a custom application
|
||||
* as a daemon providing an http interface
|
||||
* as a daemon providing a http interface
|
||||
|
||||
### Standalone Command Line Interface (CLI)
|
||||
|
||||
**Important hint**: since v1.5.1 the filename has been changed from `validationtool-*` to `validator-*`
|
||||
### Standalone Command-Line Interface
|
||||
|
||||
The general way using the CLI is:
|
||||
|
||||
```shell
|
||||
java -jar validator-<version>-standalone.jar -s <scenario-config-file> [-r <repository-path>]
|
||||
[OPTIONS] [FILE] [FILE] [FILE] ...
|
||||
java -jar validationtool-<version>-standalone.jar -s <scenario-config-file> [OPTIONS] [FILE] [FILE] [FILE] ...
|
||||
```
|
||||
|
||||
The help option displays further CLI options to customize the process:
|
||||
You can more CLI options by
|
||||
|
||||
```shell
|
||||
java -jar validator-<version>-standalone.jar --help
|
||||
java -jar validationtool-<version>-standalone.jar --help
|
||||
```
|
||||
|
||||
A concrete example with a specific Validator configuration can be found on
|
||||
[validator-configuration-bis](https://github.com/itplr-kosit/validator-configuration-bis)
|
||||
|
||||
The [CLI documentation](./docs/cli.md) shows further configuration options.
|
||||
A concrete example with a specific validator configuration can be found on [GitHub](https://github.com/itplr-kosit/validator-configuration-xrechnung)
|
||||
|
||||
### Application User Interface (API / embedded usage)
|
||||
|
||||
The Validator can also be used in own Java Applications via the API. An example use of the API as follows:
|
||||
|
||||
```java
|
||||
URL scenarios = this.getClass().getClassLoader().getResource("scenarios.xml");
|
||||
Configuration config = Configuration.load(scenarios.toURI()).build(ProcessorProvider.getProcessor());
|
||||
Check validator = new DefaultCheck(config);
|
||||
|
||||
Input document = InputFactory.read(testDocument);
|
||||
Result report = validator.checkInput(document);
|
||||
|
||||
// examine the result here
|
||||
```
|
||||
|
||||
The [API documentation](./docs/api.md) shows further configuration options.
|
||||
|
||||
**Note:** With Java 11+, you need to include a dependency to `org.glassfish.jaxb:jaxb-runtime` in your project explicitly,
|
||||
as that dependency is marked `optional` in this project and will thus not be resolved transitively.
|
||||
The validator can also be used in own Java Applications via the API. Details can be [found here](./docs/api.md).
|
||||
|
||||
### Daemon-Mode
|
||||
|
||||
You can also start the validator as a HTTP-Server. Just start it in _Daemon-Mode_ with the `-D` option.
|
||||
You can also start the validator as an HTTP-Server. Just start it in _Daemon-Mode_ with the `-D` option.
|
||||
|
||||
```shell
|
||||
java -jar validator-<version>-standalone.jar -s <scenario-config-file> -D
|
||||
java -jar validationtool-<version>-standalone.jar -s <scenario-config-file> -D
|
||||
```
|
||||
|
||||
Per default the HTTP-Server listens on _localhost_ at Port 8080.
|
||||
|
||||
The [daemon documentation](./docs/daemon.md) shows more usage details and further configuration options.
|
||||
You can configure it with `-H` for IP Adress and `-P` for port number:
|
||||
|
||||
## Packages
|
||||
|
||||
The Validator distribution contains the following artifacts:
|
||||
|
||||
1. **validator-`<version>`.jar**: Java library for embedded use within an application
|
||||
1. **validator-`<version>`-standalone.jar**: Uber-JAR for standalone usage containing all dependencies in one jar file. This file comes with JAXB *embedded* and can be used with Java >= 11)
|
||||
1. **libs/**: directory containing all (incl. optional) dependencies of the validator
|
||||
|
||||
## Installation
|
||||
|
||||
Download from the following sources is possible:
|
||||
|
||||
* GitHub releases: https://github.com/itplr-kosit/validator/releases
|
||||
* This release contains a ZIP file with all the different JAR variants
|
||||
* Maven Central with the below coordinates (replace `x.y.z` with the actual version to use)
|
||||
|
||||
```xml
|
||||
<dependency>
|
||||
<groupId>org.kosit</groupId>
|
||||
<artifactId>validator</artifactId>
|
||||
<version>x.y.z</version>
|
||||
</dependency>
|
||||
```shell
|
||||
java -jar validationtool-<version>-standalone.jar -s <scenario-config-file> -D -H 192.168.1.x -P 8081
|
||||
```
|
||||
|
||||
To use the standalone version with Maven coordinates, add the respective classifier:
|
||||
You can HTTP-POST to `/` and the response will return the report document as defined in your validator configuration.
|
||||
|
||||
```xml
|
||||
<dependency>
|
||||
<groupId>org.kosit</groupId>
|
||||
<artifactId>validator</artifactId>
|
||||
<version>x.y.z</version>
|
||||
<classifier>standalone</classifier>
|
||||
</dependency>
|
||||
```
|
||||
Additionally there is the GET `/health` endpoint which can be used by monitoring systems.
|
||||
|
||||
## Roadmap
|
||||
|
||||
This section describes the next steps planned in the Validator development.
|
||||
|
||||
* Version 1.5.x is frozen - no maintainance, no support
|
||||
* Version 1.6.x - no feature development, but maintainance and best-effort support
|
||||
* Develop version 2.0.0 which will include major API incompatibilities - Winter 2025
|
||||
* Rework scenarios.xml
|
||||
* Rework report output engine
|
||||
* Change the output type to [XVRL](https://github.com/xproc/xvrl)-based document types → this implies that existing XSL templates need to be updated
|
||||
* Consider multi Schematron engine support
|
||||
* Extract the daemon mode into its own submodule
|
||||
* Consider extracting the CLI into its own submodule
|
||||
* The release of version 2.0.0 implies a feature-freeze for version 1.6
|
||||
|
||||
## Authors & Acknowledgements
|
||||
|
||||
We are thankful to numerous third-party [contributors](https://github.com/itplr-kosit/validator/graphs/contributors).
|
||||
|
||||
## License
|
||||
|
||||
The Validator is licensed under the [Apache 2.0 license](https://www.apache.org/licenses/LICENSE-2.0).
|
||||
|
|
@ -2,4 +2,4 @@
|
|||
|
||||
## German
|
||||
|
||||
In seiner 23. Sitzung hat der [IT-Planungsrat](https://www.it-planungsrat.de) mit [Beschluss 2017/22 (6a)](https://www.it-planungsrat.de/SharedDocs/Sitzungen/DE/2017/Sitzung_23.html?pos=3) die [Koordinierungsstelle für IT-Standards (KoSIT)](https://xeinkauf.de/) im Rahmen des Betriebs des Standards XRechnung mit der dauerhaften„…Bereitstellung eines Moduls zur Konformitätsprüfung elektronischer Rechnungen als offene Referenzimplementierung sowie …“ aller zugehöriger Artefakte beauftragt. Im Rahmen dieser Beauftragung wurde die hier bereitgestellte Software "Prüftool" (Engl. Validator) entwickelt und (vor-) konfiguriert.
|
||||
In seiner 23. Sitzung hat der [IT-Planungsrat](https://www.it-planungsrat.de) mit [Beschluss 2017/22 (6a)](https://www.it-planungsrat.de/SharedDocs/Sitzungen/DE/2017/Sitzung_23.html?pos=3) die [Koordinierungsstelle für IT-Standards (KoSIT)](https://www.xoev.de/) im Rahmen des Betriebs des Standards XRechnung mit der dauerhaften„…Bereitstellung eines Moduls zur Konformitätsprüfung elektronischer Rechnungen als offene Referenzimplementierung sowie …“ aller zugehöriger Artefakte beauftragt. Im Rahmen dieser Beauftragung wurde die hier bereitgestellte Software "Prüftool" (Engl. Validator) entwickelt und (vor-) konfiguriert.
|
||||
|
|
|
|||
183
docs/api.md
183
docs/api.md
|
|
@ -1,10 +1,11 @@
|
|||
# Validator API
|
||||
|
||||
The Validator offers an API which allows you to integrate the Validator in your own applications.
|
||||
The Validator offers an API which allows you to integrate Validator in your own applications.
|
||||
|
||||
## Dependency Management
|
||||
|
||||
Currently, we *do not* deploy to Maven Central or similar. Hence, you need to build and optionally deploy the Validator artifacts to your own shared (or local) repository (see for example [Maven Documentation](https://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html)).
|
||||
Currently, we *do not* deploy to Maven Central or similar. Hence you need to build and optionally deploy the Validator artifacts to your own
|
||||
shared (or local) repository (see for example [Maven Documentation](https://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html)).
|
||||
|
||||
### Maven
|
||||
|
||||
|
|
@ -12,8 +13,8 @@ Then you can declare the dependency as follows:
|
|||
|
||||
```xml
|
||||
<dependency>
|
||||
<groupId>org.kosit</groupId>
|
||||
<artifactId>validator</artifactId>
|
||||
<groupId>de.kosit</groupId>
|
||||
<artifactId>validationtool</artifactId>
|
||||
<version>${validator.version}</version>
|
||||
</dependency>
|
||||
```
|
||||
|
|
@ -22,52 +23,46 @@ Then you can declare the dependency as follows:
|
|||
|
||||
```js
|
||||
dependencies {
|
||||
compile group: 'org.kosit', name: 'validator', version: '1.5.1'
|
||||
compile group: 'de.kosit', name: 'validationtool', version: '1.1.0'
|
||||
}
|
||||
```
|
||||
|
||||
Hint: prior to v1.5.1 the group ID was `de.kosit` and the artifact ID was `validationtool`.
|
||||
|
||||
## Usage
|
||||
|
||||
Prerequisite for use is a valid [scenario definition](configurations.md) and the a folder with all necessary artifacts for validation (repository) either on the filesystem or on the classpath.
|
||||
Prerequisite for use is a valid [scenario definition](configurations.md) and the a folder with all necessary artifacts for validation
|
||||
(repository) either on the filesystem or on the classpath.
|
||||
|
||||
The following example demonstrates loading scenario.xml and whole configuration from classpath and validating one XML document:
|
||||
|
||||
```java
|
||||
package de.kosit.validationtool.docs;
|
||||
package org.kosit.validator.example;
|
||||
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import org.w3c.dom.Document;
|
||||
|
||||
import de.kosit.validationtool.api.Check;
|
||||
import de.kosit.validationtool.api.Configuration;
|
||||
import de.kosit.validationtool.api.CheckConfiguration;
|
||||
import de.kosit.validationtool.api.Input;
|
||||
import de.kosit.validationtool.api.InputFactory;
|
||||
import de.kosit.validationtool.api.Result;
|
||||
import de.kosit.validationtool.impl.DefaultCheck;
|
||||
import de.kosit.validationtool.impl.xml.ProcessorProvider;
|
||||
import org.w3c.dom.Document;
|
||||
|
||||
/**
|
||||
* Example code that is used in the docs/api.md file
|
||||
*/
|
||||
public class StandardExample {
|
||||
|
||||
public void run(final Path testDocument) throws URISyntaxException {
|
||||
public void run(Path testDocument) throws URISyntaxException {
|
||||
// Load scenarios.xml from classpath
|
||||
final URL scenarios = this.getClass().getClassLoader().getResource("examples/simple/scenarios-with-relative-paths.xml");
|
||||
URL scenarios = this.getClass().getClassLoader().getResource("scenarios.xml");
|
||||
// Load the rest of the specific Validator configuration from classpath
|
||||
final Configuration config = Configuration.load(scenarios.toURI()).build(ProcessorProvider.getProcessor());
|
||||
CheckConfiguration config = new CheckConfiguration(scenarios.toURI());
|
||||
// Use the default validation procedure
|
||||
final Check validator = new DefaultCheck(config);
|
||||
Check validator = new DefaultCheck(config);
|
||||
// Validate a single document
|
||||
final Input document = InputFactory.read(testDocument);
|
||||
Input document = InputFactory.read(testDocument);
|
||||
// Get Result including information about the whole validation
|
||||
final Result report = validator.checkInput(document);
|
||||
Result report = validator.checkInput(document);
|
||||
System.out.println("Is processing succesful=" + report.isProcessingSuccessful());
|
||||
// Get report document if processing was successful
|
||||
Document result = null;
|
||||
|
|
@ -77,41 +72,34 @@ public class StandardExample {
|
|||
// continue processing results...
|
||||
}
|
||||
|
||||
public static void main(final String[] args) throws Exception {
|
||||
// Use e.g. "src/test/resources/examples/simple/input/foo.xml"
|
||||
if (args.length == 0) {
|
||||
throw new IllegalStateException("Provide a test document filename on the commandline");
|
||||
}
|
||||
public static void main(String[] args) throws Exception {
|
||||
// Path of document for validation
|
||||
final Path testDoc = Paths.get(args[0]);
|
||||
final StandardExample example = new StandardExample();
|
||||
Path testDoc = Paths.get(args[0]);
|
||||
StandardExample example = new StandardExample();
|
||||
// run example validation
|
||||
example.run(testDoc);
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
The `Result` interface has convenience methods to retrieve details about XSD validation errors and Schematron messages and other processing results. See
|
||||
[Result.java](https://github.com/itplr-kosit/validator/blob/main/src/main/java/de/kosit/validationtool/api/Result.java) for details.
|
||||
[Result.java](https://github.com/itplr-kosit/validator/blob/master/src/main/java/de/kosit/validationtool/api/Result.java) for details.
|
||||
|
||||
Initializing all XML artifacts and XSLT-executables is expensive. The `Check` instance is *threadsafe* and keeps all artifacts. Therefore,
|
||||
we recommend the re-use of an `Check` instance.
|
||||
|
||||
Initializing all XML artifacts and XSLT-executables is expensive. The `Check` instance is *threadsafe* and keeps all artifacts. Therefore,
|
||||
we recommend the re-use of a `Check` instance.
|
||||
The only input `de.kosit.validationtool.api.Input` which can be created by various methods of `de.kosit.validationtool.api.InputFactory`.
|
||||
The `InputFactory` calculates a hash sum for each Input which is also written to the Report. _SHA-256_ from the JDK is the default algorithm.
|
||||
It can be changed using the `read`-methods of `InputFactory`.
|
||||
|
||||
Beside the validator's configuration the only input are instances of [Input](https://github.com/itplr-kosit/validator/blob/main/src/main/java/de/kosit/validationtool/api/Input.java)
|
||||
which can be created by various methods of the [InputFactory](https://github.com/itplr-kosit/validator/blob/main/src/main/java/de/kosit/validationtool/api/InputFactory.java).
|
||||
The [InputFactory](https://github.com/itplr-kosit/validator/blob/main/src/main/java/de/kosit/validationtool/api/InputFactory.java)
|
||||
calculates a hash sum for each Input which is also written to the Report. _SHA-256_ from the JDK is the default algorithm.
|
||||
It can be changed using other `read`-methods of [InputFactory](https://github.com/itplr-kosit/validator/blob/main/src/main/java/de/kosit/validationtool/api/InputFactory.java).
|
||||
|
||||
The main interface [Check.java](https://github.com/itplr-kosit/validator/blob/main/src/main/java/de/kosit/validationtool/api/Check.java)
|
||||
allows using a batch interface (processing list of [Inputs](https://github.com/itplr-kosit/validator/blob/main/src/main/java/de/kosit/validationtool/api/Input.java)).
|
||||
The main interface [Check.java](https://github.com/itplr-kosit/validator/blob/master/src/main/java/de/kosit/validationtool/api/Check.java)
|
||||
allows using a batch interface (processing list of [Inputs](https://github.com/itplr-kosit/validator/blob/master/src/main/java/de/kosit/validationtool/api/Input.java)).
|
||||
However, there is no parallel processing implemented at the moment.
|
||||
|
||||
## Accept Recommendation and Accept Match
|
||||
|
||||
A tri-state object [AcceptRecommendation](https://github.com/itplr-kosit/validator/blob/main/src/main/java/de/kosit/validationtool/api/AcceptRecommendation.java)
|
||||
can be retrieved from the [Result](https://github.com/itplr-kosit/validator/blob/main/src/main/java/de/kosit/validationtool/api/Result.java) using `getAcceptRecommendation()`.
|
||||
A tri-state Object `AcceptRecommendation` can be retrieved from the `Result` using `getAcceptRecommendation()`.
|
||||
|
||||
The three defined states are:
|
||||
|
||||
|
|
@ -121,108 +109,15 @@ The three defined states are:
|
|||
|
||||
The accept recommendation is based on either:
|
||||
|
||||
1. Schema and Schematron validation results
|
||||
1. or on _acceptMatch_ configuration of the scenario (see below)
|
||||
1. schema and schematron validation result
|
||||
1. if configured based on _acceptMatch_ configuration of the scenario (see below)
|
||||
|
||||
### Accept match in scenario configuration
|
||||
### Accept Match in Scenario Configuration
|
||||
|
||||
For your own configuration you can add an `acceptMatch` element in each scenario. It can contain an XPATH expression over your own defined `Report` to compute a boolean value. An XPATH expression evaluating to true will lead to an `ACCEPTABLE` and otherwise to a `REJECT` recommendation.
|
||||
For your own configuration you can add an `acceptMatch` element in each scenario. It can contain in XPATH expression over your own
|
||||
defined `Report` to compute a boolean. An XPATH expression evaluating to true will lead to an `ACCEPTABLE` and otherwise to a `REJECT`
|
||||
recommendation.
|
||||
|
||||
This allows to have control over what validation result is to be considered _acceptable_ for your own application context. E.g. you can overrule Schematron validation errors with _acceptMatch_ configuration and consider certain errors as _acceptable_. Nevertheless you can *not* overrule schema errors with accept match.
|
||||
|
||||
## Building scenario configurations with the Builder API
|
||||
|
||||
Instead of pre-configured [scenario files](configurations.md) it is possible to create a validator configuration using a builder API. A valid configuration consists of the following:
|
||||
|
||||
* at least one valid scenario configuration, this includes
|
||||
* a valid match configuration to identify/activate this scenario
|
||||
* a valid XML schema configuration
|
||||
* a valid report transformation configuration
|
||||
* valid schematron validation configurations (optional)
|
||||
* a valid accept match configuration to compute acceptance information (optional)
|
||||
* a valid fallback scenario configuration
|
||||
|
||||
A simple configuration looks like this:
|
||||
|
||||
```java
|
||||
package de.kosit.validationtool.docs;
|
||||
|
||||
import static de.kosit.validationtool.config.ConfigurationBuilder.fallback;
|
||||
import static de.kosit.validationtool.config.ConfigurationBuilder.report;
|
||||
import static de.kosit.validationtool.config.ConfigurationBuilder.scenario;
|
||||
import static de.kosit.validationtool.config.ConfigurationBuilder.schema;
|
||||
import static de.kosit.validationtool.config.ConfigurationBuilder.schematron;
|
||||
|
||||
import java.net.URI;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import de.kosit.validationtool.api.Check;
|
||||
import de.kosit.validationtool.api.Configuration;
|
||||
import de.kosit.validationtool.impl.DefaultCheck;
|
||||
import de.kosit.validationtool.impl.xml.ProcessorProvider;
|
||||
|
||||
/**
|
||||
* Example code that is used in the docs/api.md file
|
||||
*/
|
||||
public class MyValidator {
|
||||
|
||||
public static void main(final String[] args) {
|
||||
final Configuration config = Configuration.create().name("myconfiguration")
|
||||
.with(scenario("firstScenario").match("//myNode").validate(schema("Sample Schema").schemaLocation(URI.create("simple.xsd")))
|
||||
.validate(schematron("my rules").source("myRules.xsl")).with(report("my report").source("report.xsl")))
|
||||
.with(fallback().name("default-report").source("fallback.xsl")).useRepository(Paths.get("/opt/myrepository"))
|
||||
.build(ProcessorProvider.getProcessor());
|
||||
final Check validator = new DefaultCheck(config);
|
||||
// .. run your checks
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
The build API provides various methods to configure your scenarios and the validation process.
|
||||
|
||||
It is also possible to provide runtime artifacts like `XsltExecutable`, `XPathExecutable` or `Schema` to configure the validator.
|
||||
This gives you complete control over loading these artifacts.
|
||||
|
||||
---
|
||||
**Note:** Creating these objects requires usage of the same instance of the saxon `Processor` as used during validation later. Therefore, you need to supply a custom `ResolvingConfigurationStrategy` or use the internal one to create these objects. See below.
|
||||
|
||||
---
|
||||
|
||||
## Configure XML Security and Resolving
|
||||
|
||||
When using XML related technologies you are supposed to handle certain security issues properly. The KoSIT validator pursues a rather strict strategy. The default configuration:
|
||||
|
||||
* disables DTD validation completely
|
||||
* allows loading/resolving only from a configured local content repository (a specific folder)
|
||||
* tries to prevent known XML security issues (see [OWASP XML_Security_Cheat_Sheet.html](https://cheatsheetseries.owasp.org/cheatsheets/XML_Security_Cheat_Sheet.html))
|
||||
|
||||
However, you can configure certain aspects related to resolving and security yourself. The validator uses a single interface for accessing or creating the necessary XML API objects like `SchemaFactory`, `Validator`,`URIResolver` or `Processor`: [ResolvingConfigurationStrategy.java](https://github.com/itplr-kosit/validator/tree/main/src/main/java/de/kosit/validationtool/api/ResolvingConfigurationStrategy.java)
|
||||
|
||||
There are 3 implementations available out of the box:
|
||||
|
||||
1. [StrictRelativeResolvingStrategy.java](https://github.com/itplr-kosit/validator/tree/main/src/main/java/de/kosit/validationtool/impl/xml/StrictRelativeResolvingStrategy.java)
|
||||
which is the **default**, prevents known XML attacks and only allows loading from a specific local repository location
|
||||
1. [StrictLocalResolvingStrategy.java](https://github.com/itplr-kosit/validator/tree/main/src/main/java/de/kosit/validationtool/impl/xml/StrictLocalResolvingStrategy.java)
|
||||
which opens the first strategy to load resources from local locations
|
||||
1. [RemoteResolvingStrategy.java](https://github.com/itplr-kosit/validator/tree/main/src/main/java/de/kosit/validationtool/impl/xml/RemoteResolvingStrategy.java)
|
||||
which further opens the second to load resources also from remote locations via http and https
|
||||
|
||||
You can configure usage of one of these implementations using the `ResolvingMode` via
|
||||
|
||||
```java
|
||||
final Configuration config = Configuration.load(URI.create("myscenarios.xml")).setResolvingMode(ResolvingMode.STRICT_LOCAL)
|
||||
.build(ProcessorProvider.getProcessor());
|
||||
```
|
||||
|
||||
If you decide to implement your own strategy, you can configure this via:
|
||||
|
||||
```java
|
||||
final Configuration config = Configuration.load(URI.create("myscenarios.xml"))
|
||||
.setResolvingStrategy(new MyCustomResolvingConfigurationStrategy()).build(ProcessorProvider.getProcessor());
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
:warning: **Attention:** If you decide to implement a custom strategy you need to handle XML security risks on your own. Please make sure, that you prevent XXE and other kind of attacks. Consider using [BaseResolvingStrategy.java](https://github.com/itplr-kosit/validator/blob/main/src/main/java/de/kosit/validationtool/impl/xml/BaseResolvingStrategy.java) and the protected methods within to disable certain features.
|
||||
|
||||
---
|
||||
This allows to have control over what validation result is to be considered _acceptable_ for your own application context. E.g. you can
|
||||
overrule schematron validation errors with _acceptMatch_ configuration and consider certain errors as _acceptable_. Nevertheless you can *not*
|
||||
overrule schema errors with accept match.
|
||||
|
|
|
|||
|
|
@ -1,10 +1,9 @@
|
|||
# General Architecture
|
||||
|
||||
The validator itself is just an engine which executes validation according to a certain configuration (
|
||||
see [configuration documentation](configurations.md)).
|
||||
The validator itself is just an engine which executes validation according to a certain configuration (see [configuration documentation](docs/configurations.md)).
|
||||
|
||||
The validator takes a scenario.xml and the configured directory with all artifacts necessary for validation (scenario repository). Then it
|
||||
performs the validation and generates a report in XML format. This report is then the input to an XSLT provided by the configuration.
|
||||
The validator takes a scenario.xml and the configured directory with all artifacts necessary for validation (scenario repository). Then it performs
|
||||
the validation and generates a report in XML format. This report is then the input to an XSLT provided by the configuration.
|
||||
|
||||
## Separation of concerns
|
||||
|
||||
|
|
|
|||
66
docs/cli.md
66
docs/cli.md
|
|
@ -1,66 +0,0 @@
|
|||
# Validator Command Line Interface (CLI)
|
||||
|
||||
The `validator` comes with a command line interface (CLI) which allows validating any number of input XML files.
|
||||
|
||||
**Important hint**: since v1.5.1 the filename has been changed from `validationtool-*` to `validator-*`
|
||||
|
||||
The general way using the CLI is:
|
||||
|
||||
```shell
|
||||
java -jar validator-<version>-standalone.jar -s <scenario-config-file> [OPTIONS] [FILE] [FILE] [FILE] ...
|
||||
```
|
||||
|
||||
The validator can also read the XML file from the standard input
|
||||
|
||||
```shell
|
||||
# via redirection
|
||||
java -jar validator-<version>-standalone.jar -s <scenario-config-file> [OPTIONS] < my-input.xml
|
||||
|
||||
# read from pipe
|
||||
cat my-input.xml | validator-<version>-standalone.jar -s <scenario-config-file> [OPTIONS]
|
||||
```
|
||||
|
||||
The help option displays further CLI options:
|
||||
|
||||
```shell
|
||||
java -jar validator-<version>-standalone.jar --help
|
||||
```
|
||||
|
||||
You can also use multiple scenario configurations and multiple repositories with resources for these. The validator either supports
|
||||
supplying the parameters in order or using named configuration. Valid usages are
|
||||
|
||||
```shell
|
||||
# multiple scenarios, implicit repository
|
||||
java -jar validator-<version>-standalone.jar -s <scenario-config-file1> -s <scenario-config-file2> [OPTIONS] [FILE]
|
||||
|
||||
# multiple scenarios, single defined repository
|
||||
java -jar validator-<version>-standalone.jar -s <scenario-config-file1> -s <scenario-config-file2> -r <path-to-repo> [OPTIONS] [FILE]
|
||||
|
||||
# multiple scenarios, multiple repositories ordered
|
||||
java -jar validator-<version>-standalone.jar -s <scenario-config-file1> -r <path-to-repo1> -s <scenario-config-file2> -r <path-to-repo2> [OPTIONS] [FILE]
|
||||
java -jar validator-<version>-standalone.jar -s <scenario-config-file1> -s <scenario-config-file2> -r <path-to-repo1> -r <path-to-repo2> [OPTIONS] [FILE]
|
||||
|
||||
# multiple scenarios, multiple repositories (named)
|
||||
java -jar validator-<version>-standalone.jar -s "NAME1=<scenario-config-file1>" -s "NAME2=<scenario-config-file2>" -r "NAME1=<path-to-repo1>" -r "NAME2=<path-to-repo2>" [OPTIONS] [FILE]
|
||||
```
|
||||
|
||||
## Special features
|
||||
|
||||
Besides the obvious functionality of validating, the cli provides additional functionality to customize the processing:
|
||||
|
||||
| name | option | description |
|
||||
| - | - | - |
|
||||
| [Daemon mode](daemon.md) | `-D` | Starts the validator in daemon mode as an HTTP service |
|
||||
| print mode | `-p` | Print the report to stdout |
|
||||
| extract html | `-h` | Extracts any html blocks within the report and saves the content to the filesystem. Note: the file name is derived from the node name the html appears in |
|
||||
| print memory stats | `-m` | Prints some memory usage information. Mainly for debugging purposes on processing huge xml files |
|
||||
| check assertions | `-c <file>` | Check assertions on the generated reports. This is mainly useful for scenario developers. Ask KoSIT for documentation, if you want to use this feauture |
|
||||
|
||||
## Return codes
|
||||
|
||||
| code | description |
|
||||
|-|-|
|
||||
| 0 | All validated xml files are acceptable according to the scenario configurations or application usage was requested |
|
||||
| positive integer | Number of rejected (e.g. not acceptable) xml files according to the scenario configurations|
|
||||
| -1 | Parsing error. The commandline arguments specified are incorrect |
|
||||
| -2 | Configuration error. There is an error loading the configuration and/or validation targets |
|
||||
|
|
@ -22,22 +22,6 @@ For other IDEs the correct setup is up to you.
|
|||
We use an automatic formatting of the source code in our environment. This is based on the Eclipse code formatter functionality
|
||||
due to historical reasons. This not only works in Eclipse but also in IntelliJ (via plugin) and can be used standalone.
|
||||
|
||||
The configuration can be found in `.settings`-directory. For IntelliJ this is all set up. The correct formatting is validated as part of the build
|
||||
process. If your IDE does not support the eclipse formatter, your can run the maven build locally prior commit like this:
|
||||
|
||||
```shell script
|
||||
mvn package -Pformat
|
||||
```
|
||||
|
||||
This will format all changed files according to our rules. Afterwards your can commit and push your changes.
|
||||
|
||||
## Build
|
||||
|
||||
### Requirements
|
||||
|
||||
* Maven > 3.0.0
|
||||
* Java > 8 update 111
|
||||
|
||||
### Procedure
|
||||
|
||||
`mvn install` generates two different packages in the `dist` directory:
|
||||
The configuration can be found in `.settings`-directory. For IntelliJ this is all set up. Additionally this should work in Eclipse out of the box.
|
||||
Another potential usage scenario would be to integrate the formatter via git hooks into the commit-pipeline (e.g [Example Hook](https://gist.github.com/ktoso/708972) ).
|
||||
For other IDEs you are on your own.
|
||||
|
|
|
|||
141
docs/daemon.md
141
docs/daemon.md
|
|
@ -1,141 +0,0 @@
|
|||
# Validator HTTP Daemon
|
||||
|
||||
You can start the validator as an HTTP-Server. This server is based on the [JDK HTTP server](https://docs.oracle.com/javase/8/docs/jre/api/net/httpserver/spec/com/sun/net/httpserver/HttpServer.html) functionality
|
||||
and should work with OpenJDK based distributions. Keep this in mind, if you want to deploy this in production scenarios with heavy load.
|
||||
|
||||
## Basic usage
|
||||
|
||||
To use the validator daemon as is, start the _Daemon-Mode_ with the `-D` option and supply a suitable
|
||||
[validator configuration](configurations.md).
|
||||
|
||||
**Important hint**: since v1.5.1 the filename has been changed from `validationtool-*` to `validator-*`
|
||||
|
||||
```shell
|
||||
java -jar validator-<version>-standalone.jar -s <scenario-config-file> -D
|
||||
```
|
||||
|
||||
Per default the HTTP-Server listens on _localhost_ at Port 8080.
|
||||
|
||||
You can configure the daemon with `-H` for IP Adress and `-P` for port number:
|
||||
|
||||
```shell
|
||||
java -jar validator-<version>-standalone.jar -s <scenario-config-file> -D -H 192.168.1.x -P 8081
|
||||
```
|
||||
|
||||
## Customized usage
|
||||
|
||||
You can also leverage the API to create a customized version of the daemon. Just instantiate, configure and start the daemon like this:
|
||||
|
||||
````java
|
||||
Configuration config = Configuration.load(...);
|
||||
|
||||
Daemon daemon = new Daemon();
|
||||
daemon.setPort("8090");
|
||||
// further config goes here
|
||||
daemon.startServer(config);
|
||||
````
|
||||
|
||||
The possible customizations are:
|
||||
|
||||
* `bindAddress` - the interface to bind the daemon to
|
||||
* `port` - the port to expose
|
||||
* `threadCount` - number of worker threads to handle results
|
||||
* `guiEnabled` - enable or disable the basic GUI with usage information
|
||||
|
||||
## Access the HTTP interface
|
||||
|
||||
The validation service listens to `POST`-requests on any server URL. You need to supply the xml/object to validate in the HTTP body.
|
||||
The last segment of the request URI is treated as the name of the input. E.g. requests to `/myfile.xml`, `/mypath/myfile.xml` and `/mypath/myfile.xml?someParam=1`
|
||||
would all result in an input named `myfile.xml`. If you don't specify a specific request URI (e.g. POST to `/`), the name is auto generated for you.
|
||||
|
||||
The service expects a single XML input in the HTTP body, e.g. `multipart/form-data` is NOT supported.
|
||||
|
||||
Examples:
|
||||
|
||||
* `cURL`
|
||||
```shell script
|
||||
curl --location --request POST 'http://localhost:8080' \
|
||||
--header 'Content-Type: application/xml' \
|
||||
--data-binary '@/target.xml'
|
||||
```
|
||||
|
||||
* `java` (Apache HttpClient)
|
||||
```java
|
||||
HttpClient httpClient = HttpClientBuilder.create().build();
|
||||
HttpPost postRequest = new HttpPost("http://localhost:8080/");
|
||||
FileEntity entity = new FileEntity(Paths.get("some.xml").toFile(), ContentType.APPLICATION_XML);
|
||||
postRequest.setEntity(entity);
|
||||
HttpResponse response = httpClient.execute(postRequest);
|
||||
System.out.println(IOUtils.toString(response.getEntity().getContent()));
|
||||
```
|
||||
|
||||
* `javascript`
|
||||
```javascript
|
||||
var myHeaders = new Headers();
|
||||
myHeaders.append("Content-Type", "application/xml");
|
||||
|
||||
var file = "<file contents here>";
|
||||
|
||||
var requestOptions = {
|
||||
method: 'POST',
|
||||
headers: myHeaders,
|
||||
body: file,
|
||||
redirect: 'follow'
|
||||
};
|
||||
|
||||
fetch("http://localhost:8080", requestOptions)
|
||||
.then(response => response.text())
|
||||
.then(result => console.log(result))
|
||||
.catch(error => console.log('error', error));
|
||||
```
|
||||
|
||||
* `PHP` (Symfony HttpClient)
|
||||
```php
|
||||
$httpClient = HttpClient::create();
|
||||
|
||||
$response = $httpClient->request('POST', 'http://localhost:8080', [
|
||||
'headers' => [
|
||||
'Content-Type' => 'application/xml',
|
||||
],
|
||||
'body' => fopen('/path/to/some.xml', 'r'),
|
||||
]);
|
||||
|
||||
echo $response->getContent();
|
||||
|
||||
```
|
||||
|
||||
## Status codes
|
||||
| code | description |
|
||||
|-|-|
|
||||
| 200 | The xml file is acceptable according to the scenario configurations |
|
||||
| 400 | Bad request. the request contains errors, e.g. no content supplied |
|
||||
| 405 | Method not allowed. Thec check service is only answering on POST requests |
|
||||
| 406 | The xml file is NOT acceptable according to the scenario configurations|
|
||||
| 422 | Unprocessable entity. Indicates an error while processing the xml file. This hints to errors in the scenario configuration |
|
||||
| 500 | Internal server error. Something went wrong |
|
||||
|
||||
## Authorization
|
||||
There is no mechanism to check, whether client is allowed to consume the service or not. The user is responsible to secure access to the service.
|
||||
This can be done using infrastructural service like a forwarding proxies (e.g. `nginx` or `Apache http server`) or by implementing a custom solution.
|
||||
|
||||
## Monitoring and administration
|
||||
|
||||
The validation service can be integrated in monitoring solutions like `Icinga` or `Nagios`. There is a `health` endpoint exposed under `/server/health` wich returns some basic information about the service like memory consumption, general information about the version and a status `UP` as an XML file.
|
||||
|
||||
## GUI
|
||||
|
||||
| :warning: The GUI is just for Show Casing and not to be used in production environments |
|
||||
|---|
|
||||
|
||||
|
||||
The daemon provides a simple GUI when issuing `GET` requests providing the following:
|
||||
|
||||
1. usage information
|
||||
1. information about the actual [validator configuration](configurations.md) used by this daemon
|
||||
1. a simple form to test the daemon with custom inputs
|
||||
|
||||
The GUI can be disabled using the API (see above) or via CLI:
|
||||
|
||||
```shell script
|
||||
java -jar validator-<version>-standalone.jar -s <scenario-config-file> -D --disable-gui
|
||||
```
|
||||
382
formatter.xml
382
formatter.xml
|
|
@ -1,382 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!--
|
||||
~ Copyright 2017-2022 Koordinierungsstelle für IT-Standards (KoSIT)
|
||||
~
|
||||
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||
~ you may not use this file except in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing, software
|
||||
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
~ See the License for the specific language governing permissions and
|
||||
~ limitations under the License.
|
||||
-->
|
||||
|
||||
<profiles version="18">
|
||||
<profile kind="CodeFormatterProfile" name="init" version="18">
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment" value="common_lines"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_logical_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation" value="common_lines"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement" value="common_lines"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration" value="common_lines"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_default" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.align_with_spaces" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.disabling_tag" value="@formatter:off"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="2"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_before_code_block" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_switch_case_expressions" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_method_body" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement" value="common_lines"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.enabling_tag" value="@formatter:on"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.count_line_length_from_starting_position" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_case" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_logical_operator" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_annotation_declaration_on_one_line" value="one_line_never"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.align_tags_descriptions_grouped" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="120"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.use_on_off_tags" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_method_body_on_one_line" value="one_line_never"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_loop_body_block_on_one_line" value="one_line_never"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_abstract_method" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_enum_constant_declaration_on_one_line" value="one_line_never"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.align_variable_declarations_on_columns" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_type_declaration_on_one_line" value="one_line_never"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause" value="common_lines"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_additive_operator" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_relational_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_anonymous_type_declaration_on_one_line" value="one_line_never"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_switch_case_expressions" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_shift_operator" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_lambda_body" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_code_block" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_type_parameters" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_loops" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_simple_for_body_on_same_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_relational_operator" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation" value="common_lines"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_additive_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.text_block_indentation" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_module_statements" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_after_code_block" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.align_tags_names_descriptions" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_if_then_body_block_on_one_line" value="one_line_never"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="80"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.align_assignment_statements_on_columns" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_default" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_between_different_tags" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression_chain" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_additive_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_method_declaration" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.join_wrapped_lines" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_conditional_operator" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_shift_operator" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines" value="2147483647"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_resources_in_try" value="83"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause" value="common_lines"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_code_block_on_one_line" value="one_line_never"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="2"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_assignment_operator" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_not_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration" value="common_lines"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_lambda_body_block_on_one_line" value="one_line_never"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_type_arguments" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation" value="18"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_label" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_case" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_logical_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_relational_operator" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.indent_tag_description" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_string_concatenation" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_last_class_body_declaration" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_simple_while_body_on_same_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_logical_operator" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_shift_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_statement_group_in_switch" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration" value="common_lines"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_shift_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_simple_do_while_body_on_same_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_enum_declaration_on_one_line" value="one_line_never"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_additive_operator" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_simple_getter_setter_on_one_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.join_lines_in_comments" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/>
|
||||
<!-- <setting id="org.eclipse.jdt.core.javaFormatter" value="org.eclipse.jdt.core.defaultJavaFormatter"/>-->
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_code_block" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="space"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_relational_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_string_concatenation" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="140"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/>
|
||||
</profile>
|
||||
</profiles>
|
||||
Binary file not shown.
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>de.kosit.validationtool</groupId>
|
||||
<artifactId>packaged-test-scenarios</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<description>POM was created from install:install-file</description>
|
||||
</project>
|
||||
Binary file not shown.
|
|
@ -1,26 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
~ Copyright 2017-2022 Koordinierungsstelle für IT-Standards (KoSIT)
|
||||
~
|
||||
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||
~ you may not use this file except in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing, software
|
||||
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
~ See the License for the specific language governing permissions and
|
||||
~ limitations under the License.
|
||||
-->
|
||||
|
||||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>de.kosit.validationtool</groupId>
|
||||
<artifactId>packaged-test-scenarios</artifactId>
|
||||
<version>1.0.2</version>
|
||||
<description>POM was created from install:install-file</description>
|
||||
</project>
|
||||
|
|
@ -1,28 +1,12 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
~ Copyright 2017-2022 Koordinierungsstelle für IT-Standards (KoSIT)
|
||||
~
|
||||
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||
~ you may not use this file except in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing, software
|
||||
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
~ See the License for the specific language governing permissions and
|
||||
~ limitations under the License.
|
||||
-->
|
||||
|
||||
<metadata>
|
||||
<groupId>de.kosit.validationtool</groupId>
|
||||
<artifactId>packaged-test-scenarios</artifactId>
|
||||
<versioning>
|
||||
<release>1.0.2</release>
|
||||
<release>1.0.0</release>
|
||||
<versions>
|
||||
<version>1.0.2</version>
|
||||
<version>1.0.0</version>
|
||||
</versions>
|
||||
<lastUpdated>20201007064929</lastUpdated>
|
||||
<lastUpdated>20190507064929</lastUpdated>
|
||||
</versioning>
|
||||
</metadata>
|
||||
|
|
|
|||
|
|
@ -1,5 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<suppressions xmlns="https://jeremylong.github.io/DependencyCheck/dependency-suppression.1.3.xsd">
|
||||
|
||||
|
||||
</suppressions>
|
||||
546
pom.xml
546
pom.xml
|
|
@ -1,13 +1,14 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!-- License below -->
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<name>KoSIT XML Validator</name>
|
||||
<name>KoSIT XML Prüftool Implementierung</name>
|
||||
|
||||
<groupId>org.kosit</groupId>
|
||||
<artifactId>validator</artifactId>
|
||||
<version>1.6.3-SNAPSHOT</version>
|
||||
<groupId>de.kosit</groupId>
|
||||
<version>1.2.0</version>
|
||||
|
||||
<artifactId>validationtool</artifactId>
|
||||
<description>KoSIT XML Validator against XSD and Schematron based on defined scenarios.</description>
|
||||
<developers>
|
||||
<!-- In alphabetical order by last name -->
|
||||
|
|
@ -15,13 +16,13 @@
|
|||
<id>fabian.buettner</id>
|
||||
<name>Fabian Büttner</name>
|
||||
<organization>KoSIT</organization>
|
||||
<organizationUrl>https://xoev.de/</organizationUrl>
|
||||
<organizationUrl>http://www.xoev.de</organizationUrl>
|
||||
</developer>
|
||||
<developer>
|
||||
<id>renzo.kottmann</id>
|
||||
<name>Renzo Kottmann</name>
|
||||
<organization>KoSIT</organization>
|
||||
<organizationUrl>https://xeinkauf.de</organizationUrl>
|
||||
<organizationUrl>http://www.xoev.de</organizationUrl>
|
||||
<roles>
|
||||
<role>Product Owner</role>
|
||||
</roles>
|
||||
|
|
@ -38,40 +39,17 @@
|
|||
</developers>
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<version.assertj>3.27.7</version.assertj>
|
||||
<version.commons-io>2.21.0</version.commons-io>
|
||||
<version.commons-lang>3.20.0</version.commons-lang>
|
||||
<version.jacoco>0.8.13</version.jacoco>
|
||||
<version.jaxb-api>4.0.4</version.jaxb-api>
|
||||
<version.jaxb-impl>4.0.6</version.jaxb-impl>
|
||||
<version.lombok>1.18.42</version.lombok>
|
||||
<version.mockito>5.21.0</version.mockito>
|
||||
<version.owasp-dependency-check>12.1.8</version.owasp-dependency-check>
|
||||
<!-- 6.0.0 requires Java 17+ -->
|
||||
<version.rest-assured>5.5.7</version.rest-assured>
|
||||
<version.saxon-he>12.9</version.saxon-he>
|
||||
<version.slf4j>2.0.17</version.slf4j>
|
||||
<version.jaxb-maven-plugin>4.0.11</version.jaxb-maven-plugin>
|
||||
<version.jacoco>0.8.4</version.jacoco>
|
||||
<version.lombok>1.18.8</version.lombok>
|
||||
<version.saxon-he>9.9.1-3</version.saxon-he>
|
||||
<version.slf4j>1.7.25</version.slf4j>
|
||||
</properties>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>project.local</id>
|
||||
<name>project</name>
|
||||
<url>file:${project.basedir}/libs</url>
|
||||
</repository>
|
||||
|
||||
<repository>
|
||||
<name>Central Portal Snapshots</name>
|
||||
<id>central-portal-snapshots</id>
|
||||
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
|
||||
<releases>
|
||||
<enabled>false</enabled>
|
||||
</releases>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<dependencies>
|
||||
|
|
@ -81,26 +59,21 @@
|
|||
<version>${version.lombok}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.sf.saxon</groupId>
|
||||
<artifactId>Saxon-HE</artifactId>
|
||||
<version>${version.saxon-he}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
<version>${version.slf4j}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.sf.saxon</groupId>
|
||||
<artifactId>Saxon-HE</artifactId>
|
||||
<version>${version.saxon-he}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>info.picocli</groupId>
|
||||
<artifactId>picocli</artifactId>
|
||||
<version>4.7.7</version>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.fusesource.jansi</groupId>
|
||||
<artifactId>jansi</artifactId>
|
||||
<version>2.4.2</version>
|
||||
<groupId>commons-cli</groupId>
|
||||
<artifactId>commons-cli</artifactId>
|
||||
<version>1.4</version>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
|
@ -113,54 +86,45 @@
|
|||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>${version.commons-lang}</version>
|
||||
<version>3.9</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.glassfish.jaxb</groupId>
|
||||
<artifactId>jaxb-runtime</artifactId>
|
||||
<version>${version.jaxb-impl}</version>
|
||||
<version>2.3.2</version>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>jakarta.xml.bind</groupId>
|
||||
<artifactId>jakarta.xml.bind-api</artifactId>
|
||||
<version>${version.jaxb-api}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.assertj</groupId>
|
||||
<artifactId>assertj-core</artifactId>
|
||||
<version>${version.assertj}</version>
|
||||
<version>3.12.2</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.13.2</version>
|
||||
<version>4.12</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>${version.commons-io}</version>
|
||||
<version>1.3.2</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.rest-assured</groupId>
|
||||
<artifactId>rest-assured</artifactId>
|
||||
<version>${version.rest-assured}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
<version>${version.mockito}</version>
|
||||
<version>3.3.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>de.kosit.validationtool</groupId>
|
||||
<artifactId>packaged-test-scenarios</artifactId>
|
||||
<version>1.0.2</version>
|
||||
<version>1.0.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
|
@ -175,88 +139,11 @@
|
|||
</resource>
|
||||
</resources>
|
||||
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.sonatype.central</groupId>
|
||||
<artifactId>central-publishing-maven-plugin</artifactId>
|
||||
<version>0.10.0</version>
|
||||
<extensions>true</extensions>
|
||||
<configuration>
|
||||
<publishingServerId>central</publishingServerId>
|
||||
<autoPublish>true</autoPublish>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-gpg-plugin</artifactId>
|
||||
<version>3.2.8</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
|
||||
<plugins>
|
||||
<!-- for PR 152 -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>3.3.1</version>
|
||||
<configuration>
|
||||
<propertiesEncoding>ISO-8859-1</propertiesEncoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
|
||||
<plugin>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>3.4.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy-license-notice</id>
|
||||
<phase>process-resources</phase>
|
||||
<goals>
|
||||
<goal>copy-resources</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${project.build.outputDirectory}/META-INF</outputDirectory>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>${project.basedir}</directory>
|
||||
<includes>
|
||||
<include>NOTICE</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</resources>
|
||||
<overwrite>true</overwrite>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>build-helper-maven-plugin</artifactId>
|
||||
<version>3.6.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>reserve-network-port</id>
|
||||
<goals>
|
||||
<goal>reserve-network-port</goal>
|
||||
</goals>
|
||||
<phase>process-resources</phase>
|
||||
<configuration>
|
||||
<portNames>
|
||||
<portName>validator.server.port</portName>
|
||||
<portName>jacoco.tcp.port</portName>
|
||||
</portNames>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-enforcer-plugin</artifactId>
|
||||
<version>3.6.1</version>
|
||||
<version>3.0.0-M2</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>enforce-versions</id>
|
||||
|
|
@ -266,19 +153,8 @@
|
|||
<configuration>
|
||||
<rules>
|
||||
<requireMavenVersion>
|
||||
<!-- minimum for OWASP check-->
|
||||
<version>[3.6.3,)</version>
|
||||
<version>[3.3.9,)</version>
|
||||
</requireMavenVersion>
|
||||
<requireJavaVersion>
|
||||
<!-- Required for "-proc:full" required for Lombok:
|
||||
Any Java 11 (LTS) >= 11.0.23
|
||||
No Java 12 to 16
|
||||
Any Java 17 (LTS) >= 17.0.11
|
||||
No Java 18 to 20
|
||||
Any Java 21 or higher
|
||||
-->
|
||||
<version>[11.0.23,12),[17.0.11,18),[21,)</version>
|
||||
</requireJavaVersion>
|
||||
</rules>
|
||||
</configuration>
|
||||
</execution>
|
||||
|
|
@ -287,82 +163,84 @@
|
|||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.14.0</version>
|
||||
<version>3.8.1</version>
|
||||
<configuration>
|
||||
<release>11</release>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
<encoding>UTF-8</encoding>
|
||||
<!-- This is required for Lombok only since JDK 23
|
||||
Was backported to 17.0.11 and 11.0.23.
|
||||
See: https://inside.java/2024/06/18/quality-heads-up/
|
||||
-->
|
||||
<proc>full</proc>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>3.6.1</version>
|
||||
<version>3.2.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>jdk11+</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>shade</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<createDependencyReducedPom>false</createDependencyReducedPom>
|
||||
<shadedArtifactAttached>true</shadedArtifactAttached>
|
||||
<shadedClassifierName>standalone</shadedClassifierName>
|
||||
<transformers>
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
|
||||
<mainClass>de.kosit.validationtool.cmd.CommandLineApplication</mainClass>
|
||||
</transformer>
|
||||
|
||||
<!--
|
||||
Some open source producers (including the Apache Software Foundation) include a copy of their
|
||||
license in the META-INF directory. These are conventionally named either LICENSE,LICENSE.txt
|
||||
or LICENSE.md. When merging these dependencies, adding these resources may cause confusion.
|
||||
The ApacheLicenseResourceTransformer ensures that duplicate licenses (named according to this
|
||||
convention) are not merged.
|
||||
Technically it simply avoids adding them into the final JAR.
|
||||
We don't need the detailed licensed in the shaded JAR.
|
||||
-->
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer" />
|
||||
|
||||
<!--
|
||||
Some licenses (including the Apache License, Version 2) require that notices are preserved by
|
||||
downstream distributors. ApacheNoticeResourceTransformer automates the assembly of an
|
||||
appropriate NOTICE.
|
||||
Technically it merges all NOTICE files together
|
||||
-->
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.ApacheNoticeResourceTransformer">
|
||||
<addHeader>false</addHeader>
|
||||
</transformer>
|
||||
</transformers>
|
||||
<filters>
|
||||
<filter>
|
||||
<artifact>*:*</artifact>
|
||||
<excludes>
|
||||
<!-- E.g. MANIFEST.MF -->
|
||||
<exclude>META-INF/*.MF</exclude>
|
||||
<!-- Required for JAR signing artefacts -->
|
||||
<exclude>META-INF/*.SF</exclude>
|
||||
<exclude>META-INF/*.DSA</exclude>
|
||||
<exclude>META-INF/*.RSA</exclude>
|
||||
<!-- We're breaking the Java module system -->
|
||||
<exclude>**/module-info.class</exclude>
|
||||
</excludes>
|
||||
</filter>
|
||||
</filters>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>jdk8</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>shade</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<shadedArtifactAttached>true</shadedArtifactAttached>
|
||||
<shadedClassifierName>java8-standalone</shadedClassifierName>
|
||||
<artifactSet>
|
||||
<excludes>
|
||||
<exclude>org.glassfish.jaxb:jaxb-runtime</exclude>
|
||||
<exclude>com.sun.istack:istack-commons-runtime</exclude>
|
||||
<exclude>com.sun.xml.fastinfoset:FastInfoset</exclude>
|
||||
<exclude>jakarta.activation:jakarta.activation-api</exclude>
|
||||
<exclude>jakarta.xml.bind:jakarta.xml.bind-api</exclude>
|
||||
<exclude>org.jvnet.staxex:stax-ex</exclude>
|
||||
<exclude>org.glassfish.jaxb:txw2</exclude>
|
||||
</excludes>
|
||||
</artifactSet>
|
||||
<transformers>
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
|
||||
<mainClass>de.kosit.validationtool.cmd.CommandLineApplication</mainClass>
|
||||
</transformer>
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.DontIncludeResourceTransformer">
|
||||
<!-- Signatur von saxon entfernen - sonst läuft die standalone-anwendung nicht -->
|
||||
<resource>META-INF/TE-050AC.SF</resource>
|
||||
</transformer>
|
||||
</transformers>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<version>3.7.1</version>
|
||||
<version>3.1.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>full_dist</id>
|
||||
|
|
@ -383,11 +261,33 @@
|
|||
</executions>
|
||||
</plugin>
|
||||
|
||||
|
||||
<plugin>
|
||||
<!-- Integrate the /src/main/generated folder -->
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>build-helper-maven-plugin</artifactId>
|
||||
<version>3.0.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>add-source</id>
|
||||
<phase>generate-sources</phase>
|
||||
<goals>
|
||||
<goal>add-source</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<sources>
|
||||
<source>src/generated/java</source>
|
||||
</sources>
|
||||
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<!-- Generate model classes -->
|
||||
<plugin>
|
||||
<groupId>org.jvnet.jaxb</groupId>
|
||||
<artifactId>jaxb-maven-plugin</artifactId>
|
||||
<version>${version.jaxb-maven-plugin}</version>
|
||||
<groupId>org.jvnet.jaxb2.maven2</groupId>
|
||||
<artifactId>maven-jaxb2-plugin</artifactId>
|
||||
<version>0.14.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
|
|
@ -399,15 +299,16 @@
|
|||
<extension>true</extension>
|
||||
<schemaDirectory>src/main/model/xsd</schemaDirectory>
|
||||
<bindingDirectory>src/main/model/binding</bindingDirectory>
|
||||
<generateDirectory>src/generated/java</generateDirectory>
|
||||
<packageLevelAnnotations>false</packageLevelAnnotations>
|
||||
<args>
|
||||
<arg>-Xinheritance</arg>
|
||||
</args>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.jvnet.jaxb</groupId>
|
||||
<artifactId>jaxb-plugins</artifactId>
|
||||
<version>${version.jaxb-maven-plugin}</version>
|
||||
<groupId>org.jvnet.jaxb2_commons</groupId>
|
||||
<artifactId>jaxb2-basics</artifactId>
|
||||
<version>0.11.1</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</configuration>
|
||||
|
|
@ -426,38 +327,12 @@
|
|||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>prepareJacocoSurefireArgLine</id>
|
||||
<id>prepareJacocoJUnitArgLine</id>
|
||||
<goals>
|
||||
<goal>prepare-agent</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<propertyName>jacocoSurefire</propertyName>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>prepareJacocoFailsafeArgLine</id>
|
||||
<phase>pre-integration-test</phase>
|
||||
<goals>
|
||||
<goal>prepare-agent</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<propertyName>jacocoFailsafe</propertyName>
|
||||
<output>tcpserver</output>
|
||||
<address>localhost</address>
|
||||
<port>${jacoco.tcp.port}</port>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>dump</id>
|
||||
<phase>post-integration-test</phase>
|
||||
<goals>
|
||||
<goal>dump</goal>
|
||||
|
||||
</goals>
|
||||
<configuration>
|
||||
<address>localhost</address>
|
||||
<port>${jacoco.tcp.port}</port>
|
||||
<append>true</append>
|
||||
<propertyName>jacocoArgumentsJUnit</propertyName>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
|
|
@ -472,23 +347,17 @@
|
|||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>3.5.3</version>
|
||||
<version>2.22.0</version>
|
||||
<configuration>
|
||||
<!--suppress MavenModelInspection -->
|
||||
<argLine>-Dfile.encoding=UTF-8 ${jacocoSurefire}</argLine>
|
||||
<systemProperties>
|
||||
<property>
|
||||
<name>java.net.useSystemProxies</name>
|
||||
<value>true</value>
|
||||
</property>
|
||||
</systemProperties>
|
||||
<argLine>-Dfile.encoding=UTF-8 ${jacocoArgumentsJUnit}</argLine>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-source-plugin</artifactId>
|
||||
<version>3.3.1</version>
|
||||
<version>3.1.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-sources</id>
|
||||
|
|
@ -502,7 +371,7 @@
|
|||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-release-plugin</artifactId>
|
||||
<version>3.1.1</version>
|
||||
<version>2.5.3</version>
|
||||
<configuration>
|
||||
<tagNameFormat>v@{project.version}</tagNameFormat>
|
||||
</configuration>
|
||||
|
|
@ -511,7 +380,7 @@
|
|||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>exec-maven-plugin</artifactId>
|
||||
<version>3.6.2</version>
|
||||
<version>1.6.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>run</id>
|
||||
|
|
@ -522,28 +391,18 @@
|
|||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<inheritIo>true</inheritIo>
|
||||
<!-- have to catch exit codes, cause daemon throws 1 if shutdown is not proper-->
|
||||
<successCodes>0,1</successCodes>
|
||||
<executable>java</executable>
|
||||
<longClasspath>false</longClasspath>
|
||||
<longClasspath>true</longClasspath>
|
||||
<async>true</async>
|
||||
<asyncDestroyOnShutdown>true</asyncDestroyOnShutdown>
|
||||
|
||||
<cleanupDaemonThreads>false</cleanupDaemonThreads>
|
||||
<arguments>
|
||||
<!--suppress MavenModelInspection -->
|
||||
<argument>${jacocoFailsafe}</argument>
|
||||
<argument>-Xmx128m</argument>
|
||||
<argument>-classpath</argument>
|
||||
<classpath />
|
||||
<argument>de.kosit.validationtool.cmd.CommandLineApplication</argument>
|
||||
<argument>-s</argument>
|
||||
<argument>${project.build.testOutputDirectory}/examples/simple/scenarios.xml</argument>
|
||||
<argument>${project.build.testOutputDirectory}/examples/UBLReady/scenarios-2.xml</argument>
|
||||
<argument>-r</argument>
|
||||
<argument>${project.build.testOutputDirectory}/examples/simple/repository</argument>
|
||||
<argument>--port</argument>
|
||||
<argument>${validator.server.port}</argument>
|
||||
<argument>${project.build.testOutputDirectory}/examples/repository</argument>
|
||||
<argument>-D</argument>
|
||||
|
||||
</arguments>
|
||||
|
|
@ -553,12 +412,11 @@
|
|||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-antrun-plugin</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<version>1.8</version>
|
||||
<configuration>
|
||||
<target>
|
||||
<!-- schlafen um den Start des Daemon abzuwarten -->
|
||||
<sleep seconds="10" />
|
||||
<echo>jacoco.tcp.port=${jacoco.tcp.port}</echo>
|
||||
<sleep seconds="5" />
|
||||
</target>
|
||||
</configuration>
|
||||
<executions>
|
||||
|
|
@ -574,7 +432,7 @@
|
|||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-failsafe-plugin</artifactId>
|
||||
<version>3.5.3</version>
|
||||
<version>2.22.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>test-it</id>
|
||||
|
|
@ -582,179 +440,35 @@
|
|||
<goal>integration-test</goal>
|
||||
<goal>verify</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<!--suppress MavenModelInspection -->
|
||||
<argLine>-Dfile.encoding=UTF-8 -Ddaemon.port=${validator.server.port}</argLine>
|
||||
</configuration>
|
||||
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>3.11.2</version>
|
||||
<configuration>
|
||||
<source>11</source>
|
||||
<doclint>none</doclint>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-javadocs</id>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>net.revelc.code.formatter</groupId>
|
||||
<artifactId>formatter-maven-plugin</artifactId>
|
||||
<version>2.13.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>validate</id>
|
||||
<phase>generate-sources</phase>
|
||||
<goals>
|
||||
<goal>validate</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<configFile>${project.basedir}/formatter.xml</configFile>
|
||||
<lineEnding>LF</lineEnding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>release-sign-artifacts</id>
|
||||
<activation>
|
||||
<property>
|
||||
<name>performRelease</name>
|
||||
<value>true</value>
|
||||
</property>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-gpg-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>sign-artifacts</id>
|
||||
<phase>verify</phase>
|
||||
<goals>
|
||||
<goal>sign</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.sonatype.central</groupId>
|
||||
<artifactId>central-publishing-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>owasp-check</id>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.owasp</groupId>
|
||||
<artifactId>dependency-check-maven</artifactId>
|
||||
<version>${version.owasp-dependency-check}</version>
|
||||
<configuration>
|
||||
<!-- Specifies if the build should be failed if a CVSS score
|
||||
above a specified level is identified.
|
||||
The default is 11 which means since the CVSS scores are 0-10,
|
||||
by default the build will never fail.-->
|
||||
<failBuildOnCVSS>0</failBuildOnCVSS>
|
||||
<suppressionFiles>
|
||||
<suppressionFile>${project.basedir}/owasp-suppressions.xml</suppressionFile>
|
||||
</suppressionFiles>
|
||||
<!-- ref to CI CD variable -->
|
||||
<nvdApiKey>${NVD_API_KEY}</nvdApiKey>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>
|
||||
validate
|
||||
</phase>
|
||||
<goals>
|
||||
<goal>check</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>format</id>
|
||||
<activation>
|
||||
<activeByDefault>false</activeByDefault>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>net.revelc.code.formatter</groupId>
|
||||
<artifactId>formatter-maven-plugin</artifactId>
|
||||
<version>2.13.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>maven-formatting</id>
|
||||
<phase>initialize</phase>
|
||||
<goals>
|
||||
<goal>format</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<configFile>${project.basedir}/formatter.xml</configFile>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>release-snapshot</id>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.sonatype.central</groupId>
|
||||
<artifactId>central-publishing-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
<reporting>
|
||||
<plugins>
|
||||
|
||||
</plugins>
|
||||
</reporting>
|
||||
|
||||
<scm>
|
||||
<connection>scm:git:https://github.com/itplr-kosit/validator.git</connection>
|
||||
<connection>https://github.com/itplr-kosit/validationtool.git</connection>
|
||||
<developerConnection>scm:git:https://projekte.kosit.org/kosit/validator.git</developerConnection>
|
||||
<tag>release/1.6.x</tag>
|
||||
<url>https://github.com/itplr-kosit/validator</url>
|
||||
<tag>v1.2.0</tag>
|
||||
</scm>
|
||||
|
||||
<url>https://github.com/itplr-kosit/validator</url>
|
||||
|
||||
<licenses>
|
||||
<license>
|
||||
<name>Apache License, Version 2.0</name>
|
||||
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
|
||||
<distribution>repo</distribution>
|
||||
</license>
|
||||
</licenses>
|
||||
</project>
|
||||
</project> <!--
|
||||
~ Licensed to the Koordinierungsstelle für IT-Standards (KoSIT) under
|
||||
~ one or more contributor license agreements. See the NOTICE file
|
||||
~ distributed with this work for additional information
|
||||
~ regarding copyright ownership. KoSIT licenses this file
|
||||
~ to you under the Apache License, Version 2.0 (the
|
||||
~ "License"); you may not use this file except in compliance
|
||||
~ with the License. You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing,
|
||||
~ software distributed under the License is distributed on an
|
||||
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
~ KIND, either express or implied. See the License for the
|
||||
~ specific language governing permissions and limitations
|
||||
~ under the License.
|
||||
-->
|
||||
|
|
|
|||
|
|
@ -1,18 +0,0 @@
|
|||
**/build/
|
||||
**/dist/
|
||||
**/coverage/
|
||||
**/.nyc_output
|
||||
**/.husky
|
||||
**/.vscode
|
||||
**/.webpack
|
||||
packages/electron/out
|
||||
**/node_modules/
|
||||
**/tmp/
|
||||
**/package-lock.json
|
||||
**/pnpm-lock.yaml
|
||||
**/yarn.lock
|
||||
**/package.json
|
||||
**/tsconfig.json
|
||||
**/*.html
|
||||
packages/*/types
|
||||
.docusaurus
|
||||
|
|
@ -1,55 +0,0 @@
|
|||
{
|
||||
"plugins": ["prettier", "@typescript-eslint/eslint-plugin", "react"],
|
||||
"extends": [
|
||||
"airbnb",
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"plugin:react/recommended",
|
||||
"plugin:react-hooks/recommended",
|
||||
"plugin:prettier/recommended"
|
||||
],
|
||||
"rules": {
|
||||
"indent": "off",
|
||||
"@typescript-eslint/indent": "off",
|
||||
"@typescript-eslint/explicit-member-accessibility": "off",
|
||||
"@typescript-eslint/consistent-type-imports": [
|
||||
"error",
|
||||
{ "prefer": "type-imports" }
|
||||
],
|
||||
"react/react-in-jsx-scope": "off",
|
||||
"react/prop-types": "off",
|
||||
"react/jsx-props-no-spreading": "off",
|
||||
"react/require-default-props": "off",
|
||||
"react/jsx-filename-extension": "off",
|
||||
"react/jsx-one-expression-per-line": "off",
|
||||
"react/function-component-definition": "off",
|
||||
"react/jsx-no-useless-fragment": "off",
|
||||
"import/extensions": "off",
|
||||
"import/no-unresolved": "off",
|
||||
"no-console": "warn",
|
||||
"no-shadow": "off",
|
||||
"no-continue": "off",
|
||||
"no-restricted-syntax": "off",
|
||||
"@typescript-eslint/no-shadow": ["error"],
|
||||
"import/no-relative-packages": "off"
|
||||
},
|
||||
"env": {
|
||||
"es6": true,
|
||||
"browser": true,
|
||||
"node": true,
|
||||
"jest": true
|
||||
},
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"settings": {
|
||||
"react": {
|
||||
"version": "17.0"
|
||||
},
|
||||
"import/parsers": {
|
||||
"@typescript-eslint/parser": [".ts", ".tsx"]
|
||||
},
|
||||
"import/resolver": {
|
||||
"typescript": {
|
||||
"alwaysTryTypes": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
20
server/ui/.gitignore
vendored
20
server/ui/.gitignore
vendored
|
|
@ -1,20 +0,0 @@
|
|||
# Dependencies
|
||||
/node_modules
|
||||
|
||||
# Production
|
||||
/build
|
||||
|
||||
# Generated files
|
||||
.docusaurus
|
||||
.cache-loader
|
||||
|
||||
# Misc
|
||||
.DS_Store
|
||||
.env.local
|
||||
.env.development.local
|
||||
.env.test.local
|
||||
.env.production.local
|
||||
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
**/build/
|
||||
**/dist/
|
||||
**/build/
|
||||
**/coverage/
|
||||
**/.nyc_output
|
||||
**/.husky
|
||||
**/.vscode
|
||||
**/.webpack
|
||||
packages/electron/out
|
||||
**/node_modules/
|
||||
**/tmp
|
||||
**/package-lock.json
|
||||
**/pnpm-lock.yaml
|
||||
**/yarn.lock
|
||||
**/package.json
|
||||
packages/*/types
|
||||
**/*.yaml
|
||||
**/*.yml
|
||||
docs
|
||||
.docusaurus
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
module.exports = {
|
||||
trailingComma: "all",
|
||||
useTabs: true,
|
||||
proseWrap: "always",
|
||||
endOfLine: "auto",
|
||||
};
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
# Website
|
||||
|
||||
This folder contains the ui, served by the daemon version of the validator. At
|
||||
the moment, this is generated within this module and copied to the actual source
|
||||
location of the daemon. There are plans to modularize the whole validator source
|
||||
in the future so that this will be done by build process.
|
||||
|
||||
This ui is built using [Docusaurus 3](https://docusaurus.io/), a modern static
|
||||
website generator.
|
||||
|
||||
### Local Development
|
||||
|
||||
```shell
|
||||
$ npm start
|
||||
```
|
||||
|
||||
This command starts a local development server and opens up a browser window.
|
||||
Most changes are reflected live without having to restart the server.
|
||||
|
||||
### Build
|
||||
|
||||
```shell
|
||||
$ npm run build
|
||||
```
|
||||
|
||||
This command generates static content into the `build` directory and must be
|
||||
copied to `src/main/resources/ui`
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
module.exports = {
|
||||
presets: [require.resolve("@docusaurus/core/lib/babel/preset")],
|
||||
};
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
---
|
||||
sidebar_position: 2
|
||||
---
|
||||
|
||||
# API Usage
|
||||
|
||||
The validation service listens to `POST`-requests to any server uri. You need to supply the xml/object to validate in
|
||||
the post body.
|
||||
The service expects a single plain input in the post body, e.g. `multipart/form-data` is not supported.
|
||||
|
||||
Examples:
|
||||
|
||||
* `cURL`
|
||||
|
||||
```shell script
|
||||
curl --location --request POST 'http://localhost:8080' \
|
||||
--header 'Content-Type: application/xml' \
|
||||
--data-binary '@/target.xml'
|
||||
```
|
||||
|
||||
* `Java` (Apache HttpClient)
|
||||
|
||||
```java
|
||||
HttpClient httpClient=HttpClientBuilder.create().build();
|
||||
HttpPost postRequest=new HttpPost("http://localhost:8080/");
|
||||
FileEntity entity=new FileEntity(Paths.get("some.xml").toFile(),ContentType.APPLICATION_XML);
|
||||
postRequest.setEntity(entity);
|
||||
HttpResponse response=httpClient.execute(postRequest);
|
||||
System.out.println(IOUtils.toString(response.getEntity().getContent()));
|
||||
```
|
||||
|
||||
* `JavaScript`
|
||||
|
||||
```javascript
|
||||
var myHeaders = new Headers();
|
||||
myHeaders.append("Content-Type", "application/xml");
|
||||
|
||||
var file = "<file contents here>";
|
||||
|
||||
var requestOptions = {
|
||||
method: 'POST',
|
||||
headers: myHeaders,
|
||||
body: file,
|
||||
redirect: 'follow'
|
||||
};
|
||||
|
||||
fetch("http://localhost:8080", requestOptions)
|
||||
.then(response => response.text())
|
||||
.then(result => console.log(result))
|
||||
.catch(error => console.log('error', error));
|
||||
```
|
||||
|
|
@ -1,250 +0,0 @@
|
|||
# Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## 1.6.0
|
||||
|
||||
### Fixed
|
||||
|
||||
- (DOC) [GitHub PR#166](https://github.com/itplr-kosit/validator/pull/166) Fixed broken links in `docs/api.md`
|
||||
|
||||
### Changed
|
||||
|
||||
- (CORE) Migration from javax to jakarta xml bind
|
||||
- (DOC) [GitHub PR#132](https://github.com/itplr-kosit/validator/pull/132) Updated the link to the example Validator scenario configuration
|
||||
|
||||
### Removed
|
||||
|
||||
- (CORE) java 8 support. new default jdk 11
|
||||
|
||||
## 1.5.2 - 2025-09-01
|
||||
|
||||
### Fixed
|
||||
|
||||
- (BUILD) [#148](https://projekte.kosit.org/kosit/validator/-/issues/148) Regression that due to renaming from `validationtool` to `validator` the distribution zip did not contain all jars anymore
|
||||
|
||||
## 1.5.1 - 2025-09-01
|
||||
|
||||
### Fixed
|
||||
|
||||
- (CORE) [#130](https://projekte.kosit.org/kosit/validator/-/issues/130) Check result to stdout causes an exception. This also fixes [GitHub #131](https://github.com/itplr-kosit/validator/issues/131)
|
||||
- (CORE) [#131](https://projekte.kosit.org/kosit/validator/-/issues/131) `UnsupportedOperationException` because of read-only list. This also fixes [GitHub #136](https://github.com/itplr-kosit/validator/issues/136)
|
||||
- (CLI) [#104](https://projekte.kosit.org/kosit/validator/-/issues/104) made the usage of the `-r` parameter optional, if only one unnamed scenario is used
|
||||
- (CLI) [#145](https://projekte.kosit.org/kosit/validator/-/issues/145) If the CLI is invoked without any parameter, the usage is shown twice
|
||||
- (DOC) [#129](https://projekte.kosit.org/kosit/validator/-/issues/129) API documentation is outdated. This also fixes [GitHub #130](https://github.com/itplr-kosit/validator/issues/130)
|
||||
- (BUILD) [#62](https://projekte.kosit.org/kosit/validator/-/issues/62) Surefire Test Error running `de.kosit.validationtool.impl.xml.RemoteResolvingStrategyTest` fails without `http.proxy` setting
|
||||
- (BUILD) [#110](https://projekte.kosit.org/kosit/validator/-/issues/110) reactivated the GitLab CI environment
|
||||
|
||||
### Added
|
||||
|
||||
- (BUILD) [#140](https://projekte.kosit.org/kosit/validator/-/issues/140) prepare pom.xml to be able to release to Maven Central
|
||||
- (BUILD) [#144](https://projekte.kosit.org/kosit/validator/-/issues/144) created a Maven profile to release on Maven Central
|
||||
|
||||
### Changed
|
||||
|
||||
- (CORE) [#109](https://projekte.kosit.org/kosit/validator/-/issues/109) dependencies were updated to the latest Java 1.8 compatible versions
|
||||
- Bump [Saxon HE](https://www.saxonica.com/documentation11/documentation.xml) to 12.8
|
||||
- Bump [jaxb-ri](https://github.com/eclipse-ee4j/jaxb-ri) to 2.3.9
|
||||
- Bump [SLF4J](https://www.slf4j.org/) to 2.0.17
|
||||
- (CORE) [#136](https://projekte.kosit.org/kosit/validator/-/issues/136) removed IDE project folders from git
|
||||
- (BUILD) [#135](https://projekte.kosit.org/kosit/validator/-/issues/135) protected specific git branches
|
||||
- (BUILD) [#137](https://projekte.kosit.org/kosit/validator/-/issues/137) GitLab CI should only run on Java LTS versions as well as the latest Java version
|
||||
- (BUILD) [#147](https://projekte.kosit.org/kosit/validator/-/issues/147) Change Maven coordinates from `de.kosit:validationtool` to `org.kosit:validator`
|
||||
|
||||
## 1.5.0
|
||||
|
||||
### Fixed
|
||||
|
||||
- (CLI) [#93](https://projekte.kosit.org/kosit/validator/-/issues/93) Remove usage information, when validation failed
|
||||
- (CLI) [#95](https://projekte.kosit.org/kosit/validator/-/issues/95) NPE when using empty repository definition (-r "")
|
||||
- (CORE) [GitHub #101](https://github.com/itplr-kosit/validator/issues/101) Role is null in FailedAssert
|
||||
|
||||
### Added
|
||||
|
||||
- (CLI) Support for multiple configurations and multiple repositories. See [cli documentation](docs/cli.md) for details
|
||||
- (API) Possibility to use preconfigured Saxon `Processor` instance for validation
|
||||
|
||||
### Changed
|
||||
|
||||
- (CORE) [GitHub #100](https://github.com/itplr-kosit/validator/issues/100) Make createReport optional
|
||||
- (DAEMON) UI rewrite based on [Docusaurs](https://docusaurus.io)
|
||||
- (API) [ResolvingConfigurationStrategy.java#getProcessor()](de/kosit/validationtool/api/ResolvingConfigurationStrategy) is removed.
|
||||
- (CORE) Bump [Saxon HE](https://www.saxonica.com/documentation11/documentation.xml) to 11.4
|
||||
- (CORE) Bump [jaxb-ri](https://github.com/eclipse-ee4j/jaxb-ri) to 2.3.7
|
||||
- (CORE) Various other dependency updates. See pom.xml
|
||||
- (CORE) CLI parsing based on pico-cli, commons-cli is removed
|
||||
|
||||
## 1.4.2
|
||||
|
||||
### Fixed
|
||||
|
||||
- (CLI) [#74](https://projekte.kosit.org/kosit/validator/-/issues/74) fix ansi output of the cli version
|
||||
- [#80](https://github.com/itplr-kosit/validator/issues/80) using classloader to initialize jaxb context (to support
|
||||
usage in OSGi
|
||||
environments)
|
||||
- [#75](https://github.com/itplr-kosit/validator/issues/75) Improve logging on invalid documents
|
||||
|
||||
## 1.4.1
|
||||
|
||||
### Fixed
|
||||
|
||||
- Allow more than 3 customLevel elements in scenarios (see xrechnung
|
||||
configuration [issue 49](https://github.com/itplr-kosit/validator-configuration-xrechnung/issues/49))
|
||||
- Remove saxon signature from java8 uber-jar (see [67](https://github.com/itplr-kosit/validator/issues/67))
|
||||
|
||||
## 1.4.0
|
||||
|
||||
### Fixed
|
||||
|
||||
- date conversion when
|
||||
using [ConfigurationBuilder#date(Date)](https://github.com/itplr-kosit/validator/blob/d7beb1040418ae5cbeb9427532fd87482f55756c/src/main/java/de/kosit/validationtool/config/ConfigurationBuilder.java#L109)
|
||||
- (CLI) [#51](https://github.com/itplr-kosit/validator/issues/51) Suffix of report xml is missing
|
||||
- [#53](https://github.com/itplr-kosit/validator/issues/53) Fix copyright and licensing information
|
||||
- [#56](https://github.com/itplr-kosit/validator/issues/56) `namespace` element content needs trimming
|
||||
- [DAEMON] [#57](https://github.com/itplr-kosit/validator/issues/57) Reading large inputs correctly
|
||||
|
||||
### Added
|
||||
|
||||
- read saxon XdmNode with InputFactory
|
||||
- (CLI) custom output without the various log messages
|
||||
- (CLI) options to set the log level (`-X` = full debug output, `-l <level>` set a specific level)
|
||||
- (CLI) return code is not 0 on rejected results
|
||||
- (CLI) read (single) test target from stdin
|
||||
- [DAEMON] name inputs via request URI
|
||||
|
||||
### Changed
|
||||
|
||||
- InputFactory has methods to read any java.xml.transform.Source as Input not only StreamSources
|
||||
- InputFactory uses a generated UUID as name for SourceInput, if no "real" name can be derived
|
||||
- saxon dependency update (minor, 9.9.1-7)
|
||||
- [DAEMON] proper status codes when returning results (see [daemon documentation](./docs/daemon.md#status-codes))
|
||||
|
||||
## 1.3.1
|
||||
|
||||
### Fixed
|
||||
|
||||
- `getFailedAsserts()` and `isSchematronValid()`
|
||||
in [DefaultResult.java](https://github.com/itplr-kosit/validator/blob/main/src/main/java/de/kosit/validationtool/impl/DefaultResult.java)
|
||||
do not reflect actual schematron validation result
|
||||
- processing aborts on schematron execution errors (e.g. errors within schematron logic). The validator now generates a
|
||||
report in such cases.
|
||||
- exception while resolving when using XSLT's `unparsed-text()` function within report generation
|
||||
|
||||
### Added
|
||||
|
||||
- (CLI) summary report
|
||||
|
||||
### Changed
|
||||
|
||||
- engine info contains version number of the validator (configurations can output this in the report for maintainance
|
||||
puposes)
|
||||
- options to customize serialized report file names (cmdline only) via `--report-prefix` and `--report-postfix`
|
||||
- remove unused dependency Apache Commons HTTP
|
||||
|
||||
## 1.3.0
|
||||
|
||||
### Added
|
||||
|
||||
- Added a builder style configuration API to configure scenarios
|
||||
- Added an option to configure xml security e.g. to load from http sources or not from a specific repository
|
||||
(so loading is configurable less restrictive, default strategy is to only load from a local repository)
|
||||
- Support java.xml.transform.Source as Input
|
||||
|
||||
### Changed
|
||||
|
||||
- Inputs are NOT read into memory (e.g. Byte-Array) prior processing within the validator. This reduces memory
|
||||
consumption.
|
||||
- Overall processing of xml files is based on Saxon s9api. No JAXP or SAX classes are used by
|
||||
the validator (this further improves performance and memory consumption)
|
||||
|
||||
### Deprecations
|
||||
|
||||
- CheckConfiguration is deprecated now. Use Configuration.load(...) or Configuration.build(...)
|
||||
|
||||
## 1.2.1
|
||||
|
||||
### Fixed
|
||||
|
||||
- Validator is creating invalid createReportInput xml in case of no scenario match
|
||||
|
||||
## 1.2.0
|
||||
|
||||
### Added
|
||||
|
||||
- Provide access to schematron result
|
||||
through [Result.java](https://github.com/itplr-kosit/validator/blob/main/src/main/java/de/kosit/validationtool/api/Result.java)
|
||||
- _Result#getFailedAsserts()_ returns a list of failed asserts found by schematron
|
||||
- _Result#isSchematronValid()_ convinience access to evaluate whether schematron was processed without any _
|
||||
FailedAsserts_
|
||||
|
||||
### Changed
|
||||
|
||||
- _Result#getAcceptRecommendation()_ does not _only_ work when _acceptMatch_ is configured in the scenario
|
||||
- schema correctness is a precondition, if the checked instance is not valid, this evaluates to _REJECTED_
|
||||
- if _acceptMatch_ is configured, the result is based on the boolean result of the xpath expression evaluated against
|
||||
the generated report
|
||||
- if _no_ _acceptMatch_ is configured, the result is based on evaluation of schema and schematron correctness
|
||||
- _UNDEFINED_ is only returned, when processing is stopped somehow
|
||||
- _Result#isAcceptable()_ can now evaluate to true, when no _acceptMatch_ is configured (see above)
|
||||
|
||||
## 1.1.3
|
||||
|
||||
### Fixed
|
||||
|
||||
- XXE vulnerability when reading xml documents with Saxon [#44](https://github.com/itplr-kosit/validator/issues/44)
|
||||
- validator unintentionally stopped when schematron processing has errors.
|
||||
See [#41](https://github.com/itplr-kosit/validator/issues/41).
|
||||
|
||||
## 1.1.2
|
||||
|
||||
### Fixed
|
||||
|
||||
- NPE in Result.getReportDocument for malformed xml input
|
||||
|
||||
## 1.1.1
|
||||
|
||||
### Added
|
||||
|
||||
- Convenience method for accessing information about well-formedness in Result
|
||||
- Convenience method for accessing information about schema validation result in Result
|
||||
|
||||
### Fixed
|
||||
|
||||
- NPE when validating non-XML files
|
||||
|
||||
## 1.1.0
|
||||
|
||||
### Added
|
||||
|
||||
- Enhanced API-Usage e.g. return _Result_ object with processing information
|
||||
- Support loading scenarios and content from a JAR-File
|
||||
- Simple Daemon-Mode exposing validation functionality via http
|
||||
- cli option to serialize the 'report input' xml document to _cwd_ (current working directory)
|
||||
- Documentation in `docs` folder
|
||||
|
||||
### Changed
|
||||
|
||||
- Use s9api (e.g. XdmNode) internally for loading and holding xml objects (further memory optimization)
|
||||
- Builds with java 8 and >= 11
|
||||
- Packages for java8 and java >= 11 (with jaxb included)
|
||||
- Translated README.md
|
||||
|
||||
## 1.0.2
|
||||
|
||||
### Fixed
|
||||
|
||||
- Memory issues when validating multiple targets
|
||||
|
||||
## 1.0.1
|
||||
|
||||
### Changed
|
||||
|
||||
- Removed XRechnung configuration from release artifacts and source (moved
|
||||
to [own repository](https://github.com/itplr-kosit/validator-configuration-xrechnung) )
|
||||
|
||||
## 1.0.0
|
||||
|
||||
- Initial Release
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
---
|
||||
sidebar_position: 1
|
||||
---
|
||||
|
||||
# Configurations
|
||||
|
||||
The validator needs a scenario configuration for working properly.
|
||||
|
||||
Here are some public validation configurations:
|
||||
|
||||
* Validation Configuration for [XRechnung](https://xeinkauf.de/xrechnung/):
|
||||
* Source code is available on [GitHub](https://github.com/itplr-kosit/validator-configuration-xrechnung)
|
||||
* [Releases](https://github.com/itplr-kosit/validator-configuration-xrechnung/releases) can also be downloaded
|
||||
* Validation Configuration for [Peppol BIS Billing](https://docs.peppol.eu/poacc/billing/3.0/):
|
||||
* Source code is available on [GitHub](https://github.com/itplr-kosit/validator-configuration-bis)
|
||||
* [Releases](https://github.com/itplr-kosit/validator-configuration-bis/releases) can also be downloaded
|
||||
* Validation Configuration for [XGewerbeanzeige](https://xgewerbeanzeige.de/)
|
||||
* Source code is available on [GitHub](https://github.com/itplr-kosit/validator-configuration-xgewerbeanzeige)
|
||||
* [Releases](https://github.com/itplr-kosit/validator-configuration-xgewerbeanzeige/releases) can also be downloaded
|
||||
|
||||
|
||||
For creating custom configurations
|
||||
see [configuration documentation](https://github.com/itplr-kosit/validator/blob/main/docs/configurations.md)
|
||||
for details
|
||||
|
|
@ -1,184 +0,0 @@
|
|||
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||
/*
|
||||
* Copyright 2017-2022 Koordinierungsstelle für IT-Standards (KoSIT)
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// @ts-check
|
||||
// Note: type annotations allow type checking and IDEs autocompletion
|
||||
|
||||
const lightCodeTheme = require("prism-react-renderer").themes.github;
|
||||
const darkCodeTheme = require("prism-react-renderer").themes.dracula;
|
||||
const pkg = require("./package.json");
|
||||
|
||||
/** @type {import('@docusaurus/types').Config} */
|
||||
const config = {
|
||||
title: "KoSIT Validator Daemon",
|
||||
tagline: "Validating any XML",
|
||||
url: "https://your-docusaurus-test-site.com",
|
||||
baseUrl: "/",
|
||||
onBrokenLinks: "log",
|
||||
onBrokenMarkdownLinks: "warn",
|
||||
favicon: "img/favicon.svg",
|
||||
customFields: {
|
||||
// We fake a base endpoint here, so that our proxy works in development mode.
|
||||
// It does not seem to work when trying to proxy requests to the root, so we
|
||||
// need to create a base path to proxy against
|
||||
apiBase: process.env.NODE_ENV === "development" ? "/api" : "/",
|
||||
},
|
||||
|
||||
// GitHub pages deployment config.
|
||||
// If you aren't using GitHub pages, you don't need these.
|
||||
organizationName: "KoSIT", // Usually your GitHub org/user name.
|
||||
projectName: "Validator", // Usually your repo name.
|
||||
|
||||
// Even if you don't use internalization, you can use this field to set useful
|
||||
// metadata like html lang. For example, if your site is Chinese, you may want
|
||||
// to replace "en" with "zh-Hans".
|
||||
i18n: {
|
||||
defaultLocale: "en",
|
||||
locales: ["en"],
|
||||
},
|
||||
|
||||
presets: [
|
||||
[
|
||||
"classic",
|
||||
/** @type {import('@docusaurus/preset-classic').Options} */
|
||||
({
|
||||
docs: {
|
||||
sidebarPath: require.resolve("./sidebars.js"),
|
||||
// Please change this to your repo.
|
||||
// Remove this to remove the "edit this page" links.
|
||||
editUrl: "https://github.com/itplr-kosit/validator/server/ui",
|
||||
},
|
||||
theme: {
|
||||
customCss: require.resolve("./src/css/custom.css"),
|
||||
},
|
||||
}),
|
||||
],
|
||||
],
|
||||
|
||||
themeConfig:
|
||||
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
|
||||
({
|
||||
navbar: {
|
||||
style: "primary",
|
||||
title: "Validator Daemon",
|
||||
logo: {
|
||||
alt: "KoSIT Validator Daemon",
|
||||
src: "img/logo.svg",
|
||||
},
|
||||
items: [
|
||||
{
|
||||
type: "doc",
|
||||
docId: "api",
|
||||
position: "left",
|
||||
label: "Documentation",
|
||||
},
|
||||
{
|
||||
to: "config",
|
||||
position: "left",
|
||||
label: "Validator configuration",
|
||||
},
|
||||
{
|
||||
to: "health",
|
||||
position: "left",
|
||||
label: "Health information",
|
||||
},
|
||||
],
|
||||
},
|
||||
footer: {
|
||||
style: "dark",
|
||||
links: [
|
||||
{
|
||||
title: "Docs",
|
||||
items: [
|
||||
{
|
||||
label: "Configuration",
|
||||
to: "/docs/configurations",
|
||||
},
|
||||
{
|
||||
label: "API",
|
||||
to: "/docs/api",
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
{
|
||||
title: "Community",
|
||||
items: [
|
||||
{
|
||||
label: "GitHub",
|
||||
href: "https://github.com/itplr-kosit/validator",
|
||||
},
|
||||
{
|
||||
label: "Issues",
|
||||
href: "https://github.com/itplr-kosit/validator/issues",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "More",
|
||||
items: [
|
||||
{
|
||||
label: "KoSIT",
|
||||
href: "https://xeinkauf.de",
|
||||
},
|
||||
{
|
||||
label: "XRechnung",
|
||||
href: "https://xeinkauf.de/xrechnung/",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
copyright: `Copyright © ${new Date().getFullYear()} Koordinierungstelle für IT-Standards (KoSIT)`,
|
||||
},
|
||||
prism: {
|
||||
theme: lightCodeTheme,
|
||||
darkTheme: darkCodeTheme,
|
||||
},
|
||||
}),
|
||||
|
||||
plugins: [
|
||||
/** @type {import('@docusaurus/types').PluginModule} */
|
||||
(
|
||||
// For the development environment to work, we need to proxy all requests
|
||||
// that are not meant to fetch static content (js, css, html files), to
|
||||
// the backend server. The dev server makes tht a little hard for us, as
|
||||
// it does not allow us to just proxy all requests that don't match any
|
||||
// static file. That's why we prefix every request with `/api`, and remove
|
||||
// it again when forwarding the request. In ptoduction mode, the endpoint
|
||||
// will be just `/` (see `config.customFields.apiBase`)
|
||||
function proxyPlugin() {
|
||||
return {
|
||||
name: "custom-docusaurus-plugin",
|
||||
configureWebpack() {
|
||||
return {
|
||||
devServer: {
|
||||
proxy: {
|
||||
"/api": {
|
||||
target: pkg.apiProxy,
|
||||
pathRewrite: { "^/api": "" },
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
},
|
||||
};
|
||||
}
|
||||
),
|
||||
],
|
||||
};
|
||||
|
||||
module.exports = config;
|
||||
21491
server/ui/package-lock.json
generated
21491
server/ui/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -1,68 +0,0 @@
|
|||
{
|
||||
"name": "validator-frontend",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"apiProxy": "http://localhost:8080",
|
||||
"scripts": {
|
||||
"docusaurus": "docusaurus",
|
||||
"start": "cross-env NODE_ENV=development docusaurus start",
|
||||
"build": "docusaurus build",
|
||||
"swizzle": "docusaurus swizzle",
|
||||
"deploy": "docusaurus deploy",
|
||||
"clear": "docusaurus clear",
|
||||
"serve": "docusaurus serve",
|
||||
"write-translations": "docusaurus write-translations",
|
||||
"write-heading-ids": "docusaurus write-heading-ids",
|
||||
"typecheck": "tsc",
|
||||
"checkFormatting": "prettier . --check",
|
||||
"format": "prettier . --write",
|
||||
"lint": "eslint . && npm run checkFormatting",
|
||||
"lint:fix": "npm run format && eslint . --fix"
|
||||
},
|
||||
"dependencies": {
|
||||
"@docusaurus/core": "^3.8.1",
|
||||
"@docusaurus/preset-classic": "^3.8.1",
|
||||
"@mdx-js/react": "^3.1.1",
|
||||
"@mui/icons-material": "^7.3.2",
|
||||
"clsx": "^2.1.1",
|
||||
"js-file-download": "^0.4.12",
|
||||
"prism-react-renderer": "^2.4.1",
|
||||
"react": "^19.1.1",
|
||||
"react-dom": "^19.1.1",
|
||||
"react-dropzone": "^14.3.8"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@docusaurus/module-type-aliases": "^3.8.1",
|
||||
"@tsconfig/docusaurus": "^2.0.3",
|
||||
"@typescript-eslint/eslint-plugin": "^8.43.0",
|
||||
"@typescript-eslint/parser": "^8.43.0",
|
||||
"cross-env": "^10.0.0",
|
||||
"eslint": "^9.35.0",
|
||||
"eslint-config-prettier": "^10.1.8",
|
||||
"eslint-import-resolver-typescript": "^4.4.4",
|
||||
"eslint-plugin-import": "^2.32.0",
|
||||
"eslint-plugin-jsx-a11y": "^6.10.2",
|
||||
"eslint-plugin-prettier": "^5.5.4",
|
||||
"eslint-plugin-react": "^7.37.5",
|
||||
"eslint-plugin-react-hooks": "^5.2.0",
|
||||
"prettier": "^3.6.2",
|
||||
"typescript": "^5.9.2"
|
||||
},
|
||||
"browserslist": {
|
||||
"production": [
|
||||
"> 0.5%",
|
||||
"last 2 versions",
|
||||
"Firefox ESR",
|
||||
"not dead"
|
||||
],
|
||||
"development": [
|
||||
"last 1 chrome version",
|
||||
"last 1 firefox version",
|
||||
"last 1 safari version"
|
||||
]
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18.0"
|
||||
},
|
||||
"overrides": {}
|
||||
}
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
/**
|
||||
* Creating a sidebar enables you to:
|
||||
- create an ordered group of docs
|
||||
- render a sidebar for each doc of that group
|
||||
- provide next/previous navigation
|
||||
|
||||
The sidebars can be generated from the filesystem, or explicitly defined here.
|
||||
|
||||
Create as many sidebars as you want.
|
||||
*/
|
||||
|
||||
// @ts-check
|
||||
|
||||
/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
|
||||
const sidebars = {
|
||||
// By default, Docusaurus generates a sidebar from the docs folder structure
|
||||
tutorialSidebar: [{ type: "autogenerated", dirName: "." }],
|
||||
|
||||
// But you can create a sidebar manually
|
||||
/*
|
||||
tutorialSidebar: [
|
||||
'intro',
|
||||
'hello',
|
||||
{
|
||||
type: 'category',
|
||||
label: 'Tutorial',
|
||||
items: ['tutorial-basics/create-a-document'],
|
||||
},
|
||||
],
|
||||
*/
|
||||
};
|
||||
|
||||
module.exports = sidebars;
|
||||
|
|
@ -1,105 +0,0 @@
|
|||
:where(.button) {
|
||||
--button-shadow: var(--ifm-global-shadow-lw);
|
||||
--button-accent-shadow: var(--ifm-global-shadow-md);
|
||||
--button-text-color: var(--text-accent-bg-0);
|
||||
--button-background-color: var(--surface-accent-3);
|
||||
--button-background-color-hover: var(--surface-accent-4);
|
||||
--button-background-color-disabled: var(--surface-4);
|
||||
--button-accent-shadow-opacity: 0;
|
||||
}
|
||||
|
||||
:where([data-theme="dark"] .button) {
|
||||
--button-shadow: none;
|
||||
--button-accent-shadow: none;
|
||||
--button-text-color: var(--text-accent-bg-0);
|
||||
--button-background-color: var(--surface-accent-4);
|
||||
--button-background-color-hover: var(--surface-accent-3);
|
||||
--button-background-color-disabled: var(--surface-5);
|
||||
--button-accent-shadow-opacity: 0;
|
||||
}
|
||||
|
||||
.button {
|
||||
position: relative;
|
||||
background: var(--button-background-color);
|
||||
font-family: inherit;
|
||||
font-size: 1rem;
|
||||
font-size: 0.875rem;
|
||||
text-transform: uppercase;
|
||||
color: var(--button-text-color);
|
||||
font-weight: var(--ifm-font-weight-semibold);
|
||||
border: none;
|
||||
padding: 0 1.25em;
|
||||
height: 2.25em;
|
||||
line-height: 1;
|
||||
border-radius: var(--border-radius-small);
|
||||
box-shadow: var(--button-shadow);
|
||||
cursor: pointer;
|
||||
transition: color 150ms ease, background-color 150ms ease;
|
||||
}
|
||||
|
||||
.button::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
box-shadow: var(--button-accent-shadow);
|
||||
opacity: var(--button-accent-shadow-opacity);
|
||||
transition: opacity 200ms ease;
|
||||
}
|
||||
|
||||
.button:where(:hover, :focus) {
|
||||
--button-background-color: var(--button-background-color-hover);
|
||||
}
|
||||
.button:not([disabled]):where(:hover, :focus) {
|
||||
--button-accent-shadow-opacity: 1;
|
||||
}
|
||||
.button:not([disabled]):where(:active) {
|
||||
--button-accent-shadow-opacity: 0.5;
|
||||
}
|
||||
|
||||
.button[disabled] {
|
||||
--button-background-color: var(--button-background-color-disabled);
|
||||
cursor: auto;
|
||||
}
|
||||
|
||||
.spinnerWrapper {
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
display: grid;
|
||||
place-content: center;
|
||||
background: #ffffff55;
|
||||
backdrop-filter: blur(1px);
|
||||
transition: opacity 150ms ease;
|
||||
}
|
||||
|
||||
.loading .spinnerWrapper {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.spinner {
|
||||
--_size: 1.75rem;
|
||||
--_thickness: 3px;
|
||||
|
||||
width: var(--_size);
|
||||
height: var(--_size);
|
||||
border: var(--_thickness) solid var(--button-text-color);
|
||||
border-bottom-color: transparent;
|
||||
border-radius: 50%;
|
||||
animation: spin 1100ms infinite cubic-bezier(0.5, 0.1, 0.5, 0.9);
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
0% {
|
||||
rotate: 0deg;
|
||||
}
|
||||
100% {
|
||||
rotate: 360deg;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
import clsx from "clsx";
|
||||
import type { ButtonHTMLAttributes, DetailedHTMLProps, JSX, ReactNode } from "react";
|
||||
import React from "react";
|
||||
import type { ExtendProps } from "../util/types";
|
||||
import styles from "./Button.module.css";
|
||||
|
||||
type HTMLButtonProps = DetailedHTMLProps<
|
||||
ButtonHTMLAttributes<HTMLButtonElement>,
|
||||
HTMLButtonElement
|
||||
>;
|
||||
type ButtonProps = ExtendProps<
|
||||
HTMLButtonProps,
|
||||
{
|
||||
children: ReactNode;
|
||||
type?: "button" | "submit" | "reset";
|
||||
className?: string;
|
||||
loading?: boolean;
|
||||
}
|
||||
>;
|
||||
|
||||
function Button({
|
||||
children,
|
||||
type = "button",
|
||||
className,
|
||||
loading = false,
|
||||
...props
|
||||
}: ButtonProps): JSX.Element {
|
||||
return (
|
||||
<button
|
||||
{...props}
|
||||
className={clsx(styles.button, loading && styles.loading, className)}
|
||||
// eslint-disable-next-line react/button-has-type
|
||||
type={type}
|
||||
aria-busy={loading}
|
||||
>
|
||||
<div className={styles.spinnerWrapper} aria-hidden>
|
||||
<div className={styles.spinner} />
|
||||
</div>
|
||||
{children}
|
||||
</button>
|
||||
);
|
||||
}
|
||||
|
||||
export default Button;
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
import Button from "./Button";
|
||||
|
||||
export default Button;
|
||||
|
|
@ -1,89 +0,0 @@
|
|||
.codeblock {
|
||||
box-shadow: inset var(--ifm-global-shadow-lw);
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.wrapper {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
:where(.buttonWrapper) {
|
||||
--codeblock-button-text-color: var(--text-main);
|
||||
--codeblock-button-background-color: var(--surface-2);
|
||||
--codeblock-button-background-color-hover: var(--surface-accent-1);
|
||||
--codeblock-button-separator-color: var(--surface-4);
|
||||
--codeblock-button-border-color: var(--codeblock-button-separator-color);
|
||||
--codeblock-button-icon-size: 1.5rem;
|
||||
--codeblock-button-size: 2rem;
|
||||
--codeblock-button-shadow: var(--ifm-global-shadow-tl);
|
||||
}
|
||||
|
||||
:where([data-theme="dark"] .buttonWrapper) {
|
||||
--codeblock-button-text-color: var(--text-0);
|
||||
--codeblock-button-background-color: var(--surface-6);
|
||||
--codeblock-button-background-color-hover: var(--surface-5);
|
||||
--codeblock-button-separator-color: var(--codeblock-button-text-color);
|
||||
--codeblock-button-shadow: var(--ifm-global-shadow-tl);
|
||||
--codeblock-button-shadow: none;
|
||||
}
|
||||
|
||||
.button {
|
||||
position: relative;
|
||||
width: var(--codeblock-button-size);
|
||||
height: var(--codeblock-button-size);
|
||||
background: var(--codeblock-button-background-color);
|
||||
font-family: inherit;
|
||||
font-size: 1rem;
|
||||
font-size: 0.875rem;
|
||||
text-transform: uppercase;
|
||||
color: var(--codeblock-button-text-color);
|
||||
font-weight: var(--ifm-font-weight-semibold);
|
||||
border: none;
|
||||
padding: 0;
|
||||
height: 2.25em;
|
||||
line-height: 1;
|
||||
border-radius: var(--border-radius-small);
|
||||
border-radius: 0;
|
||||
cursor: pointer;
|
||||
transition: color 200ms ease, background-color 200ms ease;
|
||||
}
|
||||
|
||||
.button:not(:first-child) {
|
||||
border-left: 1px solid var(--codeblock-button-separator-color);
|
||||
}
|
||||
.button:first-child {
|
||||
border-top-left-radius: var(--border-radius-small);
|
||||
border-bottom-left-radius: var(--border-radius-small);
|
||||
}
|
||||
.button:last-child {
|
||||
border-top-right-radius: var(--border-radius-small);
|
||||
border-bottom-right-radius: var(--border-radius-small);
|
||||
}
|
||||
|
||||
.button:hover,
|
||||
.button:focus {
|
||||
background: var(--codeblock-button-background-color-hover);
|
||||
}
|
||||
|
||||
.button svg {
|
||||
width: var(--codeblock-button-icon-size);
|
||||
height: var(--codeblock-button-icon-size);
|
||||
}
|
||||
|
||||
.buttonWrapper {
|
||||
position: absolute;
|
||||
display: flex;
|
||||
top: 1rem;
|
||||
right: 1rem;
|
||||
z-index: 1;
|
||||
box-shadow: var(--codeblock-button-shadow);
|
||||
border: 1px solid var(--codeblock-button-border-color);
|
||||
border-radius: var(--border-radius-small);
|
||||
opacity: 0.75;
|
||||
transition: opacity 300ms ease;
|
||||
}
|
||||
|
||||
.buttonWrapper:hover,
|
||||
.buttonWrapper:focus-within {
|
||||
opacity: 1;
|
||||
}
|
||||
|
|
@ -1,118 +0,0 @@
|
|||
import React, { JSX, useEffect, useState } from "react";
|
||||
import type { PrismTheme, Language } from "prism-react-renderer";
|
||||
import { Highlight, themes } from "prism-react-renderer";
|
||||
import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
|
||||
import clsx from "clsx";
|
||||
import downloadFile from "js-file-download";
|
||||
import styles from "./Codeblock.module.css";
|
||||
|
||||
type ThemeValue = "light" | "dark";
|
||||
|
||||
const getTheme = () =>
|
||||
(document.documentElement.dataset.theme || "light") as ThemeValue;
|
||||
|
||||
function useGlobalTheme() {
|
||||
const [theme, setTheme] = useState<ThemeValue>(getTheme);
|
||||
useEffect(() => {
|
||||
const mo = new MutationObserver(() => {
|
||||
setTheme(getTheme());
|
||||
});
|
||||
mo.observe(document.documentElement, {
|
||||
subtree: false,
|
||||
attributeFilter: ["data-theme"],
|
||||
});
|
||||
return () => mo.disconnect();
|
||||
});
|
||||
return theme;
|
||||
}
|
||||
|
||||
function Codeblock({
|
||||
children,
|
||||
language = "markup",
|
||||
enableCopy = false,
|
||||
download,
|
||||
}: {
|
||||
children: string;
|
||||
language?: Language;
|
||||
enableCopy?: boolean;
|
||||
download?: { fileName: string; mime: string };
|
||||
}): JSX.Element {
|
||||
const { siteConfig } = useDocusaurusContext();
|
||||
const theme = useGlobalTheme();
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const codeThemeLight = (siteConfig.themeConfig.prism as any)
|
||||
.theme as PrismTheme;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const codeThemeDark = (siteConfig.themeConfig.prism as any)
|
||||
.darkTheme as PrismTheme;
|
||||
const codeTheme = theme === "light" ? codeThemeLight : codeThemeDark;
|
||||
|
||||
const handleCopy = async () => {
|
||||
try {
|
||||
navigator.clipboard.writeText(children);
|
||||
} catch {
|
||||
// Copying did unfortunately not work, but we'll not crash the app
|
||||
// beacause of that...
|
||||
}
|
||||
};
|
||||
const handleDownload = () => {
|
||||
if (!download || !download.fileName || !download.mime) return;
|
||||
downloadFile(children, download.fileName, download.mime);
|
||||
};
|
||||
|
||||
return (
|
||||
<div className={styles.wrapper}>
|
||||
<Highlight
|
||||
code={children}
|
||||
language={language}
|
||||
theme={codeTheme}
|
||||
>
|
||||
{({ className, style, tokens, getLineProps, getTokenProps }) => (
|
||||
<pre className={clsx(className, styles.codeblock)} style={style}>
|
||||
{tokens.map((line, i) => (
|
||||
// eslint-disable-next-line react/jsx-key
|
||||
<div {...getLineProps({ line, key: i })}>
|
||||
{line.map((token, key) => (
|
||||
// eslint-disable-next-line react/jsx-key
|
||||
<span {...getTokenProps({ token, key })} />
|
||||
))}
|
||||
</div>
|
||||
))}
|
||||
</pre>
|
||||
)}
|
||||
</Highlight>
|
||||
{(enableCopy || download) && (
|
||||
<div className={styles.buttonWrapper}>
|
||||
{enableCopy && (
|
||||
<button
|
||||
className={styles.button}
|
||||
type="button"
|
||||
aria-label="Copy content"
|
||||
title="Copy content"
|
||||
onClick={handleCopy}
|
||||
>
|
||||
<svg aria-hidden="true" viewBox="0 0 24 24" fill="currentColor">
|
||||
<path d="M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z" />
|
||||
</svg>
|
||||
</button>
|
||||
)}
|
||||
{download && (
|
||||
<button
|
||||
className={styles.button}
|
||||
type="button"
|
||||
aria-label="Download content as file"
|
||||
title="Download content as file"
|
||||
onClick={handleDownload}
|
||||
>
|
||||
<svg aria-hidden="true" viewBox="0 0 24 24" fill="currentColor">
|
||||
<path d="M5 20h14v-2H5v2zM19 9h-4V3H9v6H5l7 7 7-7z" />
|
||||
</svg>
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default Codeblock;
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
import Codeblock from "./Codeblock";
|
||||
|
||||
export default Codeblock;
|
||||
|
|
@ -1,94 +0,0 @@
|
|||
:where(.dropzone) {
|
||||
--dropzone-color-text: var(--text-faded);
|
||||
--dropzone-icon-active: var(--text-accent-2);
|
||||
--dropzone-color-background: var(--surface-2);
|
||||
--dropzone-color-background-active: var(--surface-accent-0);
|
||||
--dropzone-color-border: var(--color-border);
|
||||
--dropzone-color-border-active: var(--color-border-accent);
|
||||
--dropzone-opacity-hover-preview: 0;
|
||||
--dropzone-shadow-opacity: 0;
|
||||
--dropzone-border-size: 0.2rem;
|
||||
}
|
||||
|
||||
:where([data-theme="dark"] .dropzone) {
|
||||
--dropzone-color-text: var(--text-0);
|
||||
--dropzone-icon-active: var(--text-accent-0);
|
||||
--dropzone-color-background: transparent;
|
||||
--dropzone-color-background-active: var(--surface-accent-5);
|
||||
}
|
||||
|
||||
.dropzone {
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
width: 100%;
|
||||
height: 15em;
|
||||
color: var(--dropzone-color-text);
|
||||
background: var(--dropzone-color-background);
|
||||
border: var(--dropzone-border-size) dashed var(--dropzone-color-border);
|
||||
border-radius: var(--border-radius-medium);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-shadow: var(--ifm-global-shadow-lw);
|
||||
}
|
||||
|
||||
.dropzone::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
pointer-events: none;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
box-shadow: var(--ifm-global-shadow-md);
|
||||
z-index: -1;
|
||||
opacity: var(--dropzone-shadow-opacity);
|
||||
transition: opacity 200ms ease;
|
||||
}
|
||||
|
||||
.active {
|
||||
--dropzone-opacity-hover-preview: 0.8;
|
||||
--dropzone-shadow-opacity: 1;
|
||||
}
|
||||
|
||||
.hasFiles {
|
||||
--dropzone-color-background: var(--dropzone-color-background-active);
|
||||
--dropzone-color-border: var(--dropzone-color-border-active);
|
||||
--dropzone-shadow-opacity: 0.25;
|
||||
}
|
||||
|
||||
.fileHoverPreview {
|
||||
--dropzone-color-background: var(--dropzone-color-background-active);
|
||||
--dropzone-color-border: var(--dropzone-color-border-active);
|
||||
|
||||
position: absolute;
|
||||
top: calc(-1 * var(--dropzone-border-size));
|
||||
right: calc(-1 * var(--dropzone-border-size));
|
||||
bottom: calc(-1 * var(--dropzone-border-size));
|
||||
left: calc(-1 * var(--dropzone-border-size));
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
color: var(--dropzone-color-text);
|
||||
background: var(--dropzone-color-background);
|
||||
border: var(--dropzone-border-size) dashed var(--dropzone-color-border);
|
||||
border-radius: var(--border-radius-medium);
|
||||
opacity: var(--dropzone-opacity-hover-preview);
|
||||
transition: opacity 150ms ease-in-out;
|
||||
}
|
||||
|
||||
.icon {
|
||||
font-size: 3rem;
|
||||
width: 1em;
|
||||
height: 1em;
|
||||
}
|
||||
|
||||
.fileHoverIcon {
|
||||
font-size: 5rem;
|
||||
color: var(--dropzone-icon-active);
|
||||
}
|
||||
|
||||
.uploadIcon {
|
||||
color: var(--dropzone-color-text);
|
||||
margin-right: 0.5rem;
|
||||
}
|
||||
|
|
@ -1,80 +0,0 @@
|
|||
/* eslint-disable react/jsx-props-no-spreading */
|
||||
import React, { JSX } from "react";
|
||||
import clsx from "clsx";
|
||||
import type { DropEvent } from "react-dropzone";
|
||||
import { useDropzone } from "react-dropzone";
|
||||
import type { DropzoneProps, RejectionType } from "./types";
|
||||
import styles from "./Dropzone.module.css";
|
||||
|
||||
const Dropzone = ({
|
||||
accept,
|
||||
children,
|
||||
className,
|
||||
activeClassName,
|
||||
multiple = false,
|
||||
name,
|
||||
onDrop,
|
||||
hasSelectedFiles,
|
||||
...props
|
||||
}: DropzoneProps): JSX.Element => {
|
||||
const handleDrop = (
|
||||
accepted: File[],
|
||||
fileRejections: RejectionType[],
|
||||
event: DropEvent,
|
||||
) => {
|
||||
const rejected = fileRejections.map((rejection) => rejection.file);
|
||||
onDrop(accepted, rejected, event);
|
||||
};
|
||||
const {
|
||||
getRootProps,
|
||||
getInputProps,
|
||||
isDragActive,
|
||||
isDragAccept,
|
||||
isDragReject,
|
||||
} = useDropzone({ accept, multiple, onDrop: handleDrop, ...props });
|
||||
return (
|
||||
<div
|
||||
{...getRootProps()}
|
||||
className={clsx(
|
||||
styles.dropzone,
|
||||
isDragActive && styles.active,
|
||||
hasSelectedFiles && styles.hasFiles,
|
||||
className,
|
||||
isDragActive && activeClassName,
|
||||
)}
|
||||
data-testid="dropzone"
|
||||
data-is-drag-active={isDragActive}
|
||||
data-is-drag-accepted={isDragAccept}
|
||||
data-is-drag-rejected={isDragReject}
|
||||
data-has-files={hasSelectedFiles}
|
||||
>
|
||||
<div
|
||||
className={clsx(
|
||||
styles.fileHoverPreview,
|
||||
isDragActive && styles.previewActive,
|
||||
)}
|
||||
>
|
||||
<svg
|
||||
className={clsx(styles.icon, styles.fileHoverIcon)}
|
||||
fill="currentColor"
|
||||
aria-hidden="true"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
<path d="M6 2c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6H6zm7 7V3.5L18.5 9H13z" />
|
||||
</svg>
|
||||
</div>
|
||||
<svg
|
||||
className={clsx(styles.icon, styles.uploadIcon)}
|
||||
fill="currentColor"
|
||||
aria-hidden="true"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
<path d="M9 16h6v-6h4l-7-7-7 7h4zm-4 2h14v2H5z" />
|
||||
</svg>
|
||||
{children}
|
||||
<input name={name} {...getInputProps()} data-testid="dropzone-input" />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default Dropzone;
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
import Dropzone from "./Dropzone";
|
||||
|
||||
export { default as useDropzone } from "./useDropzone";
|
||||
|
||||
export default Dropzone;
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
import type { ReactNode, RefAttributes } from "react";
|
||||
import type {
|
||||
DropEvent,
|
||||
DropzoneProps as ReactDropzoneProps,
|
||||
DropzoneRef,
|
||||
} from "react-dropzone";
|
||||
import type { ExtendProps } from "../util/types";
|
||||
|
||||
export interface RejectionType {
|
||||
file: File;
|
||||
}
|
||||
|
||||
export type DropzoneProps = ExtendProps<
|
||||
ReactDropzoneProps & RefAttributes<DropzoneRef>,
|
||||
{
|
||||
children?: ReactNode;
|
||||
className?: string;
|
||||
activeClassName?: string;
|
||||
multiple?: boolean;
|
||||
hasSelectedFiles?: boolean;
|
||||
name?: string;
|
||||
onDrop: (accepted: File[], rejections: File[], event: DropEvent) => void;
|
||||
}
|
||||
>;
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
import { useCallback, useMemo, useState } from "react";
|
||||
|
||||
interface DropzoneHelpers {
|
||||
selectedFiles: File[];
|
||||
rejectedFiles: File[];
|
||||
hasSelectedFiles: boolean;
|
||||
getProps: () => {
|
||||
onDrop: (accepted: File[], rejected: File[]) => void;
|
||||
multiple: boolean;
|
||||
accept: string | string[];
|
||||
hasSelectedFiles: boolean;
|
||||
};
|
||||
reset: () => void;
|
||||
}
|
||||
|
||||
function useDropzone({
|
||||
multiple = false,
|
||||
accept,
|
||||
}: {
|
||||
multiple?: boolean;
|
||||
accept: string | string[];
|
||||
}): DropzoneHelpers {
|
||||
const [selectedFiles, setSelectedFiles] = useState<File[]>([]);
|
||||
const [rejectedFiles, setRejectedFiles] = useState<File[]>([]);
|
||||
|
||||
const hasSelectedFiles = selectedFiles.length > 0;
|
||||
|
||||
const getProps = useMemo(() => {
|
||||
const handleDrop = (accepted: File[], rejected: File[]) => {
|
||||
setSelectedFiles(accepted);
|
||||
if (rejected.length === 0) {
|
||||
setRejectedFiles([]);
|
||||
} else {
|
||||
setRejectedFiles(rejected);
|
||||
}
|
||||
};
|
||||
return () => ({
|
||||
onDrop: handleDrop,
|
||||
multiple,
|
||||
accept,
|
||||
hasSelectedFiles,
|
||||
});
|
||||
}, [accept, hasSelectedFiles, multiple]);
|
||||
|
||||
const reset = useCallback(() => {
|
||||
setSelectedFiles([]);
|
||||
setRejectedFiles([]);
|
||||
}, []);
|
||||
|
||||
return { selectedFiles, rejectedFiles, hasSelectedFiles, getProps, reset };
|
||||
}
|
||||
|
||||
export default useDropzone;
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
.errorDisplay {
|
||||
background-color: var(--red-3);
|
||||
color: var(--text-accent-bg-0);
|
||||
padding: 0.75em 1.25em;
|
||||
border-radius: var(--ifm-global-radius);
|
||||
box-shadow: var(--ifm-global-shadow-lw);
|
||||
margin: 1em 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.75em;
|
||||
}
|
||||
|
||||
.title {
|
||||
display: block;
|
||||
line-height: 1;
|
||||
}
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
import type { ReactNode } from "react";
|
||||
import React from "react";
|
||||
import styles from "./ErrorDisplay.module.css";
|
||||
|
||||
function ErrorDisplay({
|
||||
title,
|
||||
children,
|
||||
}: {
|
||||
title: string;
|
||||
children?: ReactNode;
|
||||
}): JSX.Element {
|
||||
return (
|
||||
<div role="alert" className={styles.errorDisplay}>
|
||||
<strong className={styles.title}>{title}</strong>
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default ErrorDisplay;
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
import ErrorDisplay from "./ErrorDisplay";
|
||||
|
||||
export default ErrorDisplay;
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
.headline {
|
||||
font-size: 3rem;
|
||||
}
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
import type { JSX, ReactNode } from "react";
|
||||
import React from "react";
|
||||
import Layout from "@theme/Layout";
|
||||
import styles from "./PageLayout.module.css";
|
||||
|
||||
function PageLayout({
|
||||
children,
|
||||
layoutDescription,
|
||||
description,
|
||||
title,
|
||||
headline,
|
||||
}: {
|
||||
children: ReactNode;
|
||||
layoutDescription: string;
|
||||
description: string;
|
||||
headline: string;
|
||||
title?: string;
|
||||
}): JSX.Element {
|
||||
return (
|
||||
<Layout description={layoutDescription} title={title}>
|
||||
<main className="container padding-top--md padding-bottom--lg">
|
||||
<h1 className={styles.headline}>{headline}</h1>
|
||||
<p>{description}</p>
|
||||
{children}
|
||||
</main>
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
|
||||
export default PageLayout;
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
import PageLayout from "./PageLayout";
|
||||
|
||||
export default PageLayout;
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
.buttonGroup {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin: 1rem 0;
|
||||
}
|
||||
|
||||
.resultDisplay {
|
||||
margin: 1em 0;
|
||||
}
|
||||
|
||||
.withError {
|
||||
border: 0.2rem solid var(--text-error);
|
||||
border-radius: var(--border-radius-small);
|
||||
}
|
||||
|
|
@ -1,115 +0,0 @@
|
|||
import type { FormEventHandler } from "react";
|
||||
import React, { useCallback, useState } from "react";
|
||||
import clsx from "clsx";
|
||||
import Dropzone from "../Dropzone";
|
||||
import Codeblock from "../Codeblock";
|
||||
import ErrorDisplay from "../ErrorDisplay";
|
||||
import useRequest, { RequestStatus } from "../util/useRequest";
|
||||
import Button from "../Button";
|
||||
import styles from "./Upload.module.css";
|
||||
|
||||
const ENDPOINT = "/";
|
||||
|
||||
const ACCEPT = {
|
||||
"text/xml": [".xml", ".XML"],
|
||||
"application/xml": [".xml", ".XML"],
|
||||
};
|
||||
|
||||
function createFileName(selectedFileName: string | undefined) {
|
||||
return selectedFileName
|
||||
? `${selectedFileName.replace(/\.xml$/i, "")}-report.xml`
|
||||
: "report.xml";
|
||||
}
|
||||
|
||||
function Upload(): JSX.Element {
|
||||
const [selectedFile, setSelectedFile] = useState<File | null>(null);
|
||||
const [rejected, setRejected] = useState<File[]>([]);
|
||||
const { data, error, request, status } = useRequest();
|
||||
|
||||
const handleDrop = useCallback(
|
||||
(acceptedFiles: File[], rejectedFiles: File[]) => {
|
||||
if (acceptedFiles.length) {
|
||||
setSelectedFile(acceptedFiles[0]);
|
||||
setRejected([]);
|
||||
} else {
|
||||
setRejected(rejectedFiles);
|
||||
}
|
||||
},
|
||||
[],
|
||||
);
|
||||
|
||||
const handleSubmit: FormEventHandler<HTMLFormElement> = (e) => {
|
||||
e.preventDefault();
|
||||
if (!selectedFile) return;
|
||||
request(ENDPOINT, {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/xml" },
|
||||
body: selectedFile,
|
||||
redirect: "follow",
|
||||
});
|
||||
};
|
||||
|
||||
const meaningfulErrorResponse = !!error && [406, 422].includes(error.code);
|
||||
|
||||
return (
|
||||
<>
|
||||
<form onSubmit={handleSubmit}>
|
||||
{status === RequestStatus.Failure && error && !meaningfulErrorResponse && (
|
||||
<ErrorDisplay title="An error occurred while validating the file">
|
||||
<Codeblock enableCopy>{error.message}</Codeblock>
|
||||
</ErrorDisplay>
|
||||
)}
|
||||
{rejected.length > 1 && (
|
||||
<ErrorDisplay title="Please select a single file only" />
|
||||
)}
|
||||
{rejected.length === 1 && (
|
||||
<ErrorDisplay title="Only XML files are supported">
|
||||
<Codeblock>{`Invalid file found: ${rejected[0].name}`}</Codeblock>
|
||||
</ErrorDisplay>
|
||||
)}
|
||||
<Dropzone
|
||||
onDrop={handleDrop}
|
||||
accept={ACCEPT}
|
||||
multiple={false}
|
||||
hasSelectedFiles={!!selectedFile}
|
||||
>
|
||||
{selectedFile ? (
|
||||
selectedFile.name
|
||||
) : (
|
||||
<>Drag & drop files here or click to select a file</>
|
||||
)}
|
||||
</Dropzone>
|
||||
<div className={styles.buttonGroup}>
|
||||
<Button
|
||||
type="submit"
|
||||
disabled={!selectedFile}
|
||||
loading={status === RequestStatus.Loading}
|
||||
>
|
||||
Validate
|
||||
</Button>
|
||||
</div>
|
||||
</form>
|
||||
{((data && status === RequestStatus.Success) ||
|
||||
meaningfulErrorResponse) && (
|
||||
<div
|
||||
className={clsx(
|
||||
styles.resultDisplay,
|
||||
meaningfulErrorResponse && styles.withError,
|
||||
)}
|
||||
>
|
||||
<Codeblock
|
||||
download={{
|
||||
fileName: createFileName(selectedFile?.name),
|
||||
mime: "application/xml",
|
||||
}}
|
||||
enableCopy
|
||||
>
|
||||
{data || error?.message || ""}
|
||||
</Codeblock>
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default Upload;
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
import Upload from "./Upload";
|
||||
|
||||
export default Upload;
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
import React, { useEffect } from "react";
|
||||
import Codeblock from "../Codeblock";
|
||||
import ErrorDisplay from "../ErrorDisplay";
|
||||
import useRequest, { RequestStatus } from "../util/useRequest";
|
||||
|
||||
function XmlView({
|
||||
endpoint,
|
||||
fileName,
|
||||
}: {
|
||||
endpoint: string;
|
||||
fileName: string;
|
||||
}): JSX.Element {
|
||||
const { request, data, error, status } = useRequest();
|
||||
|
||||
useEffect(() => {
|
||||
request(endpoint, { headers: { "Content-Type": "application/xml" } });
|
||||
}, [endpoint, request]);
|
||||
|
||||
return (
|
||||
<>
|
||||
{status === RequestStatus.Failure && error && (
|
||||
<ErrorDisplay title="An error occurred while fetching">
|
||||
<Codeblock>{error.message}</Codeblock>
|
||||
</ErrorDisplay>
|
||||
)}
|
||||
{status === RequestStatus.Success && data && (
|
||||
<Codeblock download={{ fileName, mime: "application/xml" }} enableCopy>
|
||||
{data}
|
||||
</Codeblock>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default XmlView;
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
import XmlView from "./XmlView";
|
||||
|
||||
export default XmlView;
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
export type SharedKeys<A, B> = Extract<keyof A, keyof B>;
|
||||
export type ExtendProps<Base, Extension> = Omit<
|
||||
Base,
|
||||
SharedKeys<Base, Extension>
|
||||
> &
|
||||
Extension;
|
||||
|
|
@ -1,93 +0,0 @@
|
|||
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
||||
import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
|
||||
|
||||
export enum RequestStatus {
|
||||
Idle = "idle",
|
||||
Loading = "loading",
|
||||
Success = "success",
|
||||
Failure = "failure",
|
||||
}
|
||||
|
||||
export interface RequestState {
|
||||
status: RequestStatus;
|
||||
data: null | string;
|
||||
error: null | { code: number; message: string };
|
||||
}
|
||||
|
||||
export interface UseRequest extends RequestState {
|
||||
request: (endpoint: string, init?: RequestInit) => void;
|
||||
}
|
||||
|
||||
const EMPTY_REQUEST: RequestState = {
|
||||
status: RequestStatus.Idle,
|
||||
data: null,
|
||||
error: null,
|
||||
};
|
||||
|
||||
function createEndpoint(endpoint: string, apiBase: string): string {
|
||||
const segments = apiBase
|
||||
.split("/")
|
||||
.concat(endpoint.split("/"))
|
||||
.filter(Boolean);
|
||||
return `/${segments.join("/")}`;
|
||||
}
|
||||
|
||||
function useRequest(): UseRequest {
|
||||
const [requestState, setRequest] = useState(EMPTY_REQUEST);
|
||||
const { siteConfig } = useDocusaurusContext();
|
||||
const apiBase = siteConfig.customFields?.apiBase as string;
|
||||
|
||||
const isMountedRef = useRef(true);
|
||||
useEffect(() => {
|
||||
return () => {
|
||||
isMountedRef.current = false;
|
||||
};
|
||||
}, []);
|
||||
|
||||
const request = useCallback(
|
||||
(endpoint: string, init?: RequestInit) => {
|
||||
setRequest((prev) => ({ ...prev, status: RequestStatus.Loading }));
|
||||
|
||||
fetch(createEndpoint(endpoint, apiBase), init)
|
||||
.then((response) => {
|
||||
return response.text().then((text) => ({
|
||||
data: text,
|
||||
ok: response.ok,
|
||||
code: response.status,
|
||||
}));
|
||||
})
|
||||
.then(({ data, ok, code }) => {
|
||||
if (!isMountedRef.current) return;
|
||||
if (ok) {
|
||||
setRequest({
|
||||
status: RequestStatus.Success,
|
||||
data,
|
||||
error: null,
|
||||
});
|
||||
} else {
|
||||
setRequest((prev) => ({
|
||||
...prev,
|
||||
status: RequestStatus.Failure,
|
||||
error: { code, message: data },
|
||||
}));
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
if (!isMountedRef.current) return;
|
||||
setRequest((prev) => ({
|
||||
...prev,
|
||||
status: RequestStatus.Failure,
|
||||
error: {
|
||||
code: 0,
|
||||
message: error?.toString?.() || "An unknown error occurred",
|
||||
},
|
||||
}));
|
||||
});
|
||||
},
|
||||
[apiBase],
|
||||
);
|
||||
|
||||
return useMemo(() => ({ ...requestState, request }), [request, requestState]);
|
||||
}
|
||||
|
||||
export default useRequest;
|
||||
|
|
@ -1,172 +0,0 @@
|
|||
/**
|
||||
* Any CSS included here will be global. The classic template
|
||||
* bundles Infima by default. Infima is a CSS framework designed to
|
||||
* work well for content-centric websites.
|
||||
*/
|
||||
|
||||
/* You can override the default Infima variables here. */
|
||||
:root {
|
||||
--ifm-color-primary: var(--blue-3);
|
||||
--ifm-color-primary-dark: var(--blue-4);
|
||||
--ifm-color-primary-darker: var(--blue-5);
|
||||
--ifm-color-primary-darkest: var(--blue-6);
|
||||
--ifm-color-primary-light: var(--blue-2);
|
||||
--ifm-color-primary-lighter: var(--blue-1);
|
||||
--ifm-color-primary-lightest: var(--blue-0);
|
||||
|
||||
--ifm-code-font-size: 95%;
|
||||
--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.1);
|
||||
--ifm-global-radius: var(--border-radius-small);
|
||||
|
||||
--ifm-font-family-base: var(--font-sans);
|
||||
--ifm-font-family-monospace: var(--font-mono);
|
||||
}
|
||||
|
||||
/* For readability concerns, you should choose a lighter palette in dark mode. */
|
||||
[data-theme="dark"]:root {
|
||||
--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3);
|
||||
--ifm-background-color: var(--surface-6);
|
||||
}
|
||||
|
||||
[data-theme] .footer {
|
||||
--ifm-footer-background-color: var(--surface-accent-4);
|
||||
--ifm-footer-color: var(--text-accent-bg-main);
|
||||
--ifm-footer-link-color: var(--text-accent-bg-main);
|
||||
--ifm-footer-link-hover-color: var(--text-accent-bg-main);
|
||||
--ifm-footer-title-color: var(--text-accent-bg-main);
|
||||
}
|
||||
[data-theme="dark"] .footer {
|
||||
--ifm-footer-background-color: var(--surface-6);
|
||||
border-top: 1px solid var(--ifm-table-border-color);
|
||||
}
|
||||
[data-theme] .navbar {
|
||||
--ifm-navbar-background-color: var(--blue-4);
|
||||
}
|
||||
|
||||
/* XÖV Theme */
|
||||
:where(html) {
|
||||
--blue-0: hsl(206 100% 95%);
|
||||
--blue-1: hsl(206 100% 80%);
|
||||
--blue-2: hsl(206 100% 65%);
|
||||
--blue-3: hsl(206 100% 47%);
|
||||
--blue-4: hsl(220 41% 30%);
|
||||
--blue-5: hsl(220 41% 24%);
|
||||
--blue-6: hsl(220 41% 18%);
|
||||
|
||||
--gray-0: hsl(216 33% 100%);
|
||||
--gray-1: hsl(216 33% 97%);
|
||||
--gray-2: hsl(220 21% 95%);
|
||||
--gray-3: hsl(220 21% 92%);
|
||||
--gray-4: hsl(212 10% 73%);
|
||||
--gray-5: hsl(212 10% 45%);
|
||||
--gray-6: hsl(212 15% 13%);
|
||||
|
||||
--red-0: hsl(357 80% 96%);
|
||||
--red-1: hsl(357 80% 89%);
|
||||
--red-2: hsl(357 80% 75%);
|
||||
--red-3: hsl(357 80% 60%);
|
||||
--red-4: hsl(357 80% 40%);
|
||||
--red-5: hsl(357 60% 22%);
|
||||
|
||||
--orange-0: hsl(46 80% 90%);
|
||||
--orange-1: hsl(46 80% 80%);
|
||||
--orange-2: hsl(46 80% 68%);
|
||||
--orange-3: hsl(46 80% 40%);
|
||||
--orange-4: hsl(46 80% 25%);
|
||||
--orange-5: hsl(46 80% 10%);
|
||||
|
||||
--green-0: hsl(162 100% 93%);
|
||||
--green-1: hsl(162 100% 74%);
|
||||
--green-2: hsl(162 100% 45%);
|
||||
--green-3: hsl(162 100% 30%);
|
||||
--green-4: hsl(162 100% 20%);
|
||||
--green-5: hsl(162 100% 10%);
|
||||
|
||||
/* Surface colors */
|
||||
--surface-0: var(--gray-0);
|
||||
--surface-1: var(--gray-1);
|
||||
--surface-2: var(--gray-2);
|
||||
--surface-3: var(--gray-3);
|
||||
--surface-4: var(--gray-4);
|
||||
--surface-5: var(--gray-5);
|
||||
--surface-6: var(--gray-6);
|
||||
|
||||
--surface-accent-0: var(--blue-0);
|
||||
--surface-accent-1: var(--blue-1);
|
||||
--surface-accent-2: var(--blue-2);
|
||||
--surface-accent-3: var(--blue-3);
|
||||
--surface-accent-4: var(--blue-4);
|
||||
--surface-accent-5: var(--blue-5);
|
||||
|
||||
/* Text colors */
|
||||
--text-0: var(--gray-4);
|
||||
--text-1: var(--gray-5);
|
||||
--text-2: var(--gray-6);
|
||||
--text-main: var(--text-2);
|
||||
--text-faded: var(--text-1);
|
||||
|
||||
--text-accent-0: var(--blue-3);
|
||||
--text-accent-1: var(--blue-4);
|
||||
--text-accent-2: var(--blue-5);
|
||||
--text-accent: var(--text-accent-2);
|
||||
|
||||
--text-accent-bg-0: var(--gray-0);
|
||||
--text-accent-bg-1: var(--gray-1);
|
||||
--text-accent-bg-2: var(--gray-4);
|
||||
--text-accent-bg-3: var(--blue-4);
|
||||
--text-accent-bg-main: var(--text-accent-bg-0);
|
||||
|
||||
--text-negative: var(--red-3);
|
||||
--text-error: var(--red-3);
|
||||
--text-warning: var(--orange-3);
|
||||
--text-info: var(--blue-3);
|
||||
--text-success: var(--green-3);
|
||||
|
||||
/* Misc elements */
|
||||
--divider: var(--gray-4);
|
||||
--scrollthumb: var(--gray-4);
|
||||
--input-background: var(--surface-0);
|
||||
--input-background-disabled: var(--surface-2);
|
||||
|
||||
/* Border Radius */
|
||||
--border-radius-small: 2px;
|
||||
--border-radius-medium: 0.2rem;
|
||||
--border-radius-large: 1rem;
|
||||
|
||||
--color-border: var(--gray-4);
|
||||
--color-border-hover: var(--gray-4);
|
||||
--color-border-accent: var(--blue-2);
|
||||
--color-border-accent-hover: var(--blue-2);
|
||||
|
||||
/* Fonts */
|
||||
--font-sans: "Open Sans", system-ui, -apple-system, "Segoe UI", "Roboto",
|
||||
"Ubuntu", "Cantarell", "Noto Sans", sans-serif, "Apple Color Emoji",
|
||||
"Segoe UI Emoji", "Segoe UI Symbol";
|
||||
--font-serif: ui-serif, serif, "Apple Color Emoji", "Segoe UI Emoji",
|
||||
"Segoe UI Symbol";
|
||||
--font-mono: "Cascadia Code", "Dank Mono", "Operator Mono", "Inconsolata",
|
||||
"Fira Mono", ui-monospace, "SF Mono", "Monaco", "Droid Sans Mono",
|
||||
"Source Code Pro", monospace, "Apple Color Emoji", "Segoe UI Emoji",
|
||||
"Segoe UI Symbol";
|
||||
}
|
||||
|
||||
/* Scrollbars: */
|
||||
/* Firefox */
|
||||
* {
|
||||
scrollbar-width: thin;
|
||||
scrollbar-color: var(--scrollthumb) transparent;
|
||||
}
|
||||
/* Chrome, Edge, and Safari */
|
||||
*::-webkit-scrollbar {
|
||||
width: min(8px, 0.5rem);
|
||||
height: min(8px, 0.5rem);
|
||||
}
|
||||
|
||||
*::-webkit-scrollbar-track {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
*::-webkit-scrollbar-thumb {
|
||||
background-color: var(--scrollthumb);
|
||||
border-radius: 999rem;
|
||||
}
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
import React, { JSX } from "react";
|
||||
import PageLayout from "@site/src/components/PageLayout";
|
||||
import XmlView from "@site/src/components/XmlView";
|
||||
|
||||
function ConfigPage(): JSX.Element {
|
||||
return (
|
||||
<PageLayout
|
||||
title="Validator configuration"
|
||||
layoutDescription="The currently loaded validator configuration"
|
||||
headline="Validator configuration"
|
||||
description="View the currently loaded validator configuration."
|
||||
>
|
||||
<XmlView endpoint="/server/config" fileName="config.xml" />
|
||||
</PageLayout>
|
||||
);
|
||||
}
|
||||
|
||||
export default ConfigPage;
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
import ConfigPage from "./ConfigPage";
|
||||
|
||||
export default ConfigPage;
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
import React, { JSX } from "react";
|
||||
import PageLayout from "@site/src/components/PageLayout";
|
||||
import XmlView from "@site/src/components/XmlView";
|
||||
|
||||
function HealthPage(): JSX.Element {
|
||||
return (
|
||||
<PageLayout
|
||||
title="Health information"
|
||||
layoutDescription="Health and status information about the system"
|
||||
headline="Server health information"
|
||||
description="Information about health and status of the running system."
|
||||
>
|
||||
<XmlView endpoint="/server/health" fileName="health.xml" />
|
||||
</PageLayout>
|
||||
);
|
||||
}
|
||||
|
||||
export default HealthPage;
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
import HealthPage from "./HealthPage";
|
||||
|
||||
export default HealthPage;
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
import React, { JSX } from "react";
|
||||
import Upload from "../components/Upload";
|
||||
import PageLayout from "../components/PageLayout";
|
||||
|
||||
export default function Home(): JSX.Element {
|
||||
return (
|
||||
<PageLayout
|
||||
layoutDescription="KoSIT Validator Daemon"
|
||||
headline="Try the validator!"
|
||||
description="Upload an XML file here to validate its contents. Note: this is just a demo implementation, not meant for production usage. If you need a production ready implementation you are welcome to contribute to the open source project."
|
||||
>
|
||||
<Upload />
|
||||
</PageLayout>
|
||||
);
|
||||
}
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
---
|
||||
title: Markdown page example
|
||||
---
|
||||
|
||||
# Markdown page example
|
||||
|
||||
You don't need React to write simple standalone pages.
|
||||
Binary file not shown.
|
|
@ -1,3 +0,0 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200" viewBox="0 0 24 24">
|
||||
<path fill="hsl(220, 41%, 30%)" d="M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm-3.06 16L7.4 14.46l1.41-1.41 2.12 2.12 4.24-4.24 1.41 1.41L10.94 18zM13 9V3.5L18.5 9H13z"></path>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 306 B |
|
|
@ -1,3 +0,0 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200" viewBox="0 0 24 24">
|
||||
<path fill="#fff" d="M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm-3.06 16L7.4 14.46l1.41-1.41 2.12 2.12 4.24-4.24 1.41 1.41L10.94 18zM13 9V3.5L18.5 9H13z"></path>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 292 B |
|
|
@ -1,9 +0,0 @@
|
|||
{
|
||||
// This file is not used in compilation. It is here just for a nice editor experience.
|
||||
"extends": "@tsconfig/docusaurus/tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"resolveJsonModule": true,
|
||||
"strict": true
|
||||
}
|
||||
}
|
||||
|
|
@ -1,5 +1,25 @@
|
|||
<!--
|
||||
~ Licensed to the Koordinierungsstelle für IT-Standards (KoSIT) under
|
||||
~ one or more contributor license agreements. See the NOTICE file
|
||||
~ distributed with this work for additional information
|
||||
~ regarding copyright ownership. KoSIT licenses this file
|
||||
~ to you under the Apache License, Version 2.0 (the
|
||||
~ "License"); you may not use this file except in compliance
|
||||
~ with the License. You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing,
|
||||
~ software distributed under the License is distributed on an
|
||||
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
~ KIND, either express or implied. See the License for the
|
||||
~ specific language governing permissions and limitations
|
||||
~ under the License.
|
||||
-->
|
||||
|
||||
<assembly xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="http://maven.apache.org/ASSEMBLY/2.0.0" xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
|
||||
xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
|
||||
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
|
||||
<id>full</id>
|
||||
<formats>
|
||||
<format>zip</format>
|
||||
|
|
@ -18,12 +38,8 @@
|
|||
<directory>${project.build.directory}</directory>
|
||||
<outputDirectory/>
|
||||
<includes>
|
||||
<include>validator-*.jar</include>
|
||||
<include>validationtool-*.jar</include>
|
||||
</includes>
|
||||
<!-- excludes always win over includes if both patterns match -->
|
||||
<excludes>
|
||||
<exclude>*standalone.jar</exclude>
|
||||
</excludes>
|
||||
</fileSet>
|
||||
|
||||
</fileSets>
|
||||
|
|
@ -32,6 +48,7 @@
|
|||
<outputDirectory>libs</outputDirectory>
|
||||
<useProjectArtifact>false</useProjectArtifact>
|
||||
<scope>runtime</scope>
|
||||
<outputFileNameMapping>${artifact.artifactId}-${artifact.baseVersion}.${artifact.extension}</outputFileNameMapping>
|
||||
</dependencySet>
|
||||
</dependencySets>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,38 +1,21 @@
|
|||
/*
|
||||
* Copyright 2017-2022 Koordinierungsstelle für IT-Standards (KoSIT)
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package de.kosit.validationtool.api;
|
||||
|
||||
/**
|
||||
* Tri-state recommendation whether to accept the {@link Input} or not.
|
||||
* Tri-state describtion of a Recommendation.
|
||||
*/
|
||||
public enum AcceptRecommendation {
|
||||
|
||||
/**
|
||||
* The evaluation of the overall validation could not be computed.
|
||||
*/
|
||||
UNDEFINED,
|
||||
|
||||
/**
|
||||
* Recommendation is to accept {@link Input} based on the evaluation of the overall validation.
|
||||
* Recommendation is to accept input based on the evaluation of the overall validation.
|
||||
*/
|
||||
ACCEPTABLE,
|
||||
|
||||
/**
|
||||
* Recommendation is to reject {@link Input} based on the evaluation of the overall validation.
|
||||
* Recommendation is to reject input based on the evaluation of the overall validation.
|
||||
*/
|
||||
REJECT
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,17 +1,20 @@
|
|||
/*
|
||||
* Copyright 2017-2022 Koordinierungsstelle für IT-Standards (KoSIT)
|
||||
* Licensed to the Koordinierungsstelle für IT-Standards (KoSIT) under
|
||||
* one or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. KoSIT licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package de.kosit.validationtool.api;
|
||||
|
|
@ -21,19 +24,20 @@ import java.util.stream.Collectors;
|
|||
|
||||
import org.w3c.dom.Document;
|
||||
|
||||
|
||||
/**
|
||||
* Main validator interface for checking incoming files.
|
||||
* Zentrale Schnittstellendefinition für das Prüf-Tool.
|
||||
*
|
||||
* @author Andreas Penski
|
||||
*/
|
||||
public interface Check {
|
||||
|
||||
/**
|
||||
* Checks an incoming xml {@link Input Inputs}. The result-{@link Document} is readonly. To change the this document
|
||||
* you need to copy the nodes into an new {@link Document}.
|
||||
* Führt die konfigurierte Prüfung für die übergebene Resource aus. Das Ergebnis-{@link Document} ist readonly. Soll es
|
||||
* weiterverarbeitet werden, so muss es kopiert werden.
|
||||
*
|
||||
* @param input the resource / xml file to validate.
|
||||
* @return a result-{@link Document} (readonly)
|
||||
* @param input die Resource / XML-Datei, die geprüft werden soll.
|
||||
* @return ein Ergebnis-{@link Document} (readonly)
|
||||
*/
|
||||
default Document check(final Input input) {
|
||||
final Result result = checkInput(input);
|
||||
|
|
@ -42,33 +46,33 @@ public interface Check {
|
|||
}
|
||||
|
||||
/**
|
||||
* Checks an incoming xml file.
|
||||
* Führt die konfigurierte Prüfung für die übergebene Resource aus.
|
||||
*
|
||||
* @param input the resource / xml file to validate.
|
||||
* @return a {@link Result} object
|
||||
* @param input die Resource / XML-Datei, die geprüft werden soll.
|
||||
* @return ein Ergebnis-{@link Document}
|
||||
*/
|
||||
Result checkInput(Input input);
|
||||
|
||||
/**
|
||||
* Checks an incoming xml files in batch mode. Processing is sequential. The result-{@link Document Documents} are
|
||||
* readonly. To change the this document you need to copy them into new {@link Document Documents}.
|
||||
*
|
||||
*
|
||||
* @param input list of xml {@link Input Inputs}
|
||||
* @return list of result-{@link Document Documents} (readonly)
|
||||
* Führt eine Prüfung im Batch-Mode durch. Die Default-Implementierung führt die Prüfung sequentiell aus. Die Ergebnis
|
||||
* -{@link Document Dokumente} sind readonly. Sollen sie weiterverarbeitet werden, so müssen Kopien erstellt werden.
|
||||
*
|
||||
* @param input die Eingabe
|
||||
* @return Liste mit Ergebnis-Dokumenten (readonly)
|
||||
*/
|
||||
default List<Document> check(final List<Input> input) {
|
||||
return input.stream().map(this::check).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks an incoming xml files in batch mode. Processing is sequential.
|
||||
* Führt eine Prüfung im Batch-Mode durch. Die Default-Implementierung führt die Prüfung sequentiell aus.
|
||||
*
|
||||
* @param input list of xml {@link Input Inputs}
|
||||
* @return list of {@link Result}
|
||||
* @param input die Eingabe
|
||||
* @return Liste mit Ergebnis-Dokumenten
|
||||
*/
|
||||
default List<Result> checkInput(final List<Input> input) {
|
||||
return input.stream().map(this::checkInput).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,46 +1,43 @@
|
|||
/*
|
||||
* Copyright 2017-2022 Koordinierungsstelle für IT-Standards (KoSIT)
|
||||
* Licensed to the Koordinierungsstelle für IT-Standards (KoSIT) under
|
||||
* one or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. KoSIT licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package de.kosit.validationtool.api;
|
||||
|
||||
import java.net.URI;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import de.kosit.validationtool.impl.ContentRepository;
|
||||
import de.kosit.validationtool.impl.Scenario;
|
||||
import de.kosit.validationtool.impl.xml.ProcessorProvider;
|
||||
import de.kosit.validationtool.impl.RelativeUriResolver;
|
||||
|
||||
/**
|
||||
* Zentrale Konfigration einer Prüf-Instanz.
|
||||
*
|
||||
* @author Andreas Penski
|
||||
* @deprecated since 1.3.0 use {@link Configuration} instead. Will be removed in 2.0
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@Deprecated
|
||||
public class CheckConfiguration implements Configuration {
|
||||
public class CheckConfiguration {
|
||||
|
||||
/**
|
||||
* URL, die auf die scenerio.xml Datei zeigt.
|
||||
|
|
@ -52,47 +49,22 @@ public class CheckConfiguration implements Configuration {
|
|||
*/
|
||||
private URI scenarioRepository;
|
||||
|
||||
private Configuration delegate;
|
||||
|
||||
private Configuration getDelegate() {
|
||||
if (this.delegate == null) {
|
||||
this.delegate = Configuration.load(this.scenarioDefinition, this.scenarioRepository).build(ProcessorProvider.getProcessor());
|
||||
/**
|
||||
* Liefert das Repository mit den Artefakten der einzelnen Szenarien.
|
||||
*
|
||||
* @return uri die durch entsprechende resolver aufgelöst werden kann
|
||||
*/
|
||||
public URI getScenarioRepository() {
|
||||
if (this.scenarioRepository == null) {
|
||||
this.scenarioRepository = createDefaultRepository();
|
||||
}
|
||||
return this.delegate;
|
||||
return this.scenarioRepository;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Scenario> getScenarios() {
|
||||
return getDelegate().getScenarios();
|
||||
private URI createDefaultRepository() {
|
||||
log.info("Creating default scenario repository (alongside scenario definition)");
|
||||
return RelativeUriResolver.resolve(URI.create("."), this.scenarioDefinition);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Scenario getFallbackScenario() {
|
||||
return getDelegate().getFallbackScenario();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDate() {
|
||||
return getDelegate().getDate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getAdditionalParameters() {
|
||||
return this.delegate.getAdditionalParameters();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return getDelegate().getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAuthor() {
|
||||
return getDelegate().getAuthor();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ContentRepository getContentRepository() {
|
||||
return getDelegate().getContentRepository();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,124 +0,0 @@
|
|||
/*
|
||||
* Copyright 2017-2022 Koordinierungsstelle für IT-Standards (KoSIT)
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package de.kosit.validationtool.api;
|
||||
|
||||
import java.net.URI;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import de.kosit.validationtool.config.ConfigurationBuilder;
|
||||
import de.kosit.validationtool.config.ConfigurationLoader;
|
||||
import de.kosit.validationtool.impl.ContentRepository;
|
||||
import de.kosit.validationtool.impl.Scenario;
|
||||
|
||||
/**
|
||||
* Configuration of the actual {@link Check} instance. This is an interface and can be implemented by custom
|
||||
* configuration classes. There are two implementations supported out of the box:
|
||||
*
|
||||
* <ol>
|
||||
* <li>{@link ConfigurationLoader} implements loading {@link Check} configurations from a scenario.xml file</li>
|
||||
* <li>Using a builder style api {@link de.kosit.validationtool.config.ConfigurationBuilder}to configure the
|
||||
* {@link Check}</li>
|
||||
* </ol>
|
||||
* <p>
|
||||
* Both methods can be used via convinience methods. See below.
|
||||
*
|
||||
* @author Andreas Penski
|
||||
*/
|
||||
|
||||
public interface Configuration {
|
||||
|
||||
/**
|
||||
* Returns a list of configured scenarios.
|
||||
*
|
||||
* @return the list of scenarios
|
||||
*/
|
||||
List<Scenario> getScenarios();
|
||||
|
||||
/**
|
||||
* Returns the configured fallback scenario to use, in case no configured scenario match.
|
||||
*
|
||||
* @return the fallback scenario
|
||||
*/
|
||||
Scenario getFallbackScenario();
|
||||
|
||||
/**
|
||||
* Returns the author of this configuration.
|
||||
*
|
||||
* @return the author
|
||||
*/
|
||||
String getAuthor();
|
||||
|
||||
/**
|
||||
* Returns the name of the specification
|
||||
*
|
||||
* @return the name
|
||||
*/
|
||||
String getName();
|
||||
|
||||
/**
|
||||
* The creation date of the config
|
||||
*
|
||||
* @return the date
|
||||
*/
|
||||
String getDate();
|
||||
|
||||
/**
|
||||
* Add some additional parameters to the validator configuration. Parameter usage depends on actual implementation
|
||||
* of {@link Check}
|
||||
*
|
||||
* @return A Map containing the additional Parameters to be added.
|
||||
*/
|
||||
Map<String, Object> getAdditionalParameters();
|
||||
|
||||
/**
|
||||
* The content repository including resolving strategies.
|
||||
*
|
||||
* @return the configured {@link ContentRepository}
|
||||
*/
|
||||
ContentRepository getContentRepository();
|
||||
|
||||
/**
|
||||
* Loads an XML based scenario definition from the file specified via URI.
|
||||
*
|
||||
* @param scenarioDefinition the XML file with scenario definition
|
||||
* @return the loaded configuration
|
||||
*/
|
||||
static ConfigurationLoader load(final URI scenarioDefinition) {
|
||||
return load(scenarioDefinition, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads an XML based scenario definition from the file with an specific repository / source location specified via
|
||||
* URIs.
|
||||
*
|
||||
* @param scenarioDefinition the XML file with scenario definition
|
||||
* @return the loaded configuration
|
||||
*/
|
||||
static ConfigurationLoader load(final URI scenarioDefinition, final URI repository) {
|
||||
return new ConfigurationLoader(scenarioDefinition, repository);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a {@link Configuration} based on a builder style API using {@link ConfigurationBuilder}
|
||||
*
|
||||
* @return the Builder
|
||||
*/
|
||||
static ConfigurationBuilder create() {
|
||||
return new ConfigurationBuilder();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,60 +1,42 @@
|
|||
/*
|
||||
* Copyright 2017-2022 Koordinierungsstelle für IT-Standards (KoSIT)
|
||||
* Licensed to the Koordinierungsstelle für IT-Standards (KoSIT) under
|
||||
* one or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. KoSIT licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package de.kosit.validationtool.api;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.xml.transform.Source;
|
||||
import lombok.*;
|
||||
|
||||
/**
|
||||
* An input for the validator.
|
||||
* Eine Datei in eingelesener Form.
|
||||
*
|
||||
* @author apenski
|
||||
*/
|
||||
@Getter
|
||||
@RequiredArgsConstructor (access = AccessLevel.PACKAGE)
|
||||
@AllArgsConstructor (access = AccessLevel.PACKAGE)
|
||||
public class Input {
|
||||
|
||||
public interface Input {
|
||||
private final byte[] content;
|
||||
|
||||
/**
|
||||
* The name of the input for document identification
|
||||
*
|
||||
* @return the name
|
||||
*/
|
||||
String getName();
|
||||
private final String name;
|
||||
|
||||
/**
|
||||
* The hashcode for document identification
|
||||
*
|
||||
* @return the computed hashcode
|
||||
*/
|
||||
byte[] getHashCode();
|
||||
private byte[] hashCode;
|
||||
|
||||
/**
|
||||
* The digest algorithm used for computing the {@link #getHashCode()}
|
||||
*
|
||||
* @return the name of the digest algorithm
|
||||
*/
|
||||
String getDigestAlgorithm();
|
||||
|
||||
/**
|
||||
* Creates a new {@link Source } for this input which carries the actual data
|
||||
*
|
||||
* @return an open {@link Source}
|
||||
* @throws IOException on I/O while opening the source
|
||||
*/
|
||||
Source getSource() throws IOException;
|
||||
private String digestAlgorithm;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,49 +1,48 @@
|
|||
/*
|
||||
* Copyright 2017-2022 Koordinierungsstelle für IT-Standards (KoSIT)
|
||||
* Licensed to the Koordinierungsstelle für IT-Standards (KoSIT) under
|
||||
* one or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. KoSIT licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package de.kosit.validationtool.api;
|
||||
|
||||
import static org.apache.commons.lang3.StringUtils.isNotEmpty;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URI;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.UUID;
|
||||
import java.security.DigestInputStream;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
||||
import javax.xml.transform.Source;
|
||||
import javax.xml.transform.stream.StreamSource;
|
||||
import javax.xml.bind.DatatypeConverter;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import de.kosit.validationtool.impl.input.ByteArrayInput;
|
||||
import de.kosit.validationtool.impl.input.ResourceInput;
|
||||
import de.kosit.validationtool.impl.input.SourceInput;
|
||||
import de.kosit.validationtool.impl.input.StreamHelper;
|
||||
import de.kosit.validationtool.impl.input.XdmNodeInput;
|
||||
|
||||
import net.sf.saxon.s9api.XdmNode;
|
||||
|
||||
/**
|
||||
* Service zum Einlesen des Test-Objekts in den Speicher. Beim Einlesen wird gleichzeitig eine Prüfsumme ermittelt und
|
||||
* mit dem Ergebnis mitgeführt.
|
||||
|
|
@ -55,10 +54,9 @@ public class InputFactory {
|
|||
|
||||
static final String DEFAULT_ALGORITH = "SHA-256";
|
||||
|
||||
/**
|
||||
* Pseudo hashcode algorithm name, which indicates, thate the hashcode of the {@link Input} is actually the name.
|
||||
*/
|
||||
static final String PSEUDO_NAME_ALGORITHM = "NAME";
|
||||
private static final int EOF = -1;
|
||||
|
||||
private static final int DEFAULT_BUFFER_SIZE = 4096;
|
||||
|
||||
private static final String MESSAGE_OPEN_STREAM_ERROR = "Can not open stream from";
|
||||
|
||||
|
|
@ -71,13 +69,12 @@ public class InputFactory {
|
|||
|
||||
InputFactory(final String specifiedAlgorithm) {
|
||||
this.algorithm = isNotEmpty(specifiedAlgorithm) ? specifiedAlgorithm : DEFAULT_ALGORITH;
|
||||
// check validity
|
||||
StreamHelper.createDigest(this.algorithm);
|
||||
createDigest();
|
||||
}
|
||||
|
||||
/**
|
||||
* Liest einen Prüfling von dem übergebenen Pfad. Es wird der Default-Prüfsummenalgorithmus zur Ermittlung der
|
||||
* Prüfsumme genutzt.
|
||||
* Liest einen Prüfling von dem übergebenen Pfad. Es wird der Default-Prüfsummenalgorithmus zur Ermittlung der Prüfsumme
|
||||
* genutzt.
|
||||
*
|
||||
* @param path der Prüflings
|
||||
* @return ein Prüf-Eingabe-Objekt
|
||||
|
|
@ -96,7 +93,11 @@ public class InputFactory {
|
|||
*/
|
||||
public static Input read(final Path path, final String digestAlgorithm) {
|
||||
checkNull(path);
|
||||
return read(path.toUri(), digestAlgorithm);
|
||||
try ( final InputStream stream = Files.newInputStream(path) ) {
|
||||
return read(stream, path.toString(), digestAlgorithm);
|
||||
} catch (final IOException e) {
|
||||
throw new IllegalArgumentException(MESSAGE_OPEN_STREAM_ERROR + path, e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -111,36 +112,9 @@ public class InputFactory {
|
|||
}
|
||||
|
||||
/**
|
||||
* Liest einen Prüfling von der übergebenen URI. Es wird der Default-Prüfsummenalgorithmus zur Ermittlung der
|
||||
* Prüfsumme genutzt.
|
||||
*
|
||||
* @param uri URI des Prüflings
|
||||
* @return ein Prüf-Eingabe-Objekt
|
||||
*/
|
||||
public static Input read(final URI uri) {
|
||||
return read(uri, DEFAULT_ALGORITH);
|
||||
}
|
||||
|
||||
/**
|
||||
* Liest einen Prüfling von der übergebenen URL. Es wird ein definierter Algorithmis zur Ermittlung der Prüfsumme
|
||||
* Liest einen Prüfling von der übergebenen URL. Es wird der Default-Prüfsummenalgorithmus zur Ermittlung der Prüfsumme
|
||||
* genutzt.
|
||||
*
|
||||
* @param uri URI des Prüflings
|
||||
* @param digestAlgorithm der Prüfsummenalgorithmus
|
||||
* @return ein Prüf-Eingabe-Objekt
|
||||
*/
|
||||
public static Input read(final URI uri, final String digestAlgorithm) {
|
||||
try {
|
||||
return read(uri.toURL(), digestAlgorithm);
|
||||
} catch (final MalformedURLException e) {
|
||||
throw new IllegalArgumentException(String.format("URL invalid or protocol not supported: %s", uri), e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Liest einen Prüfling von der übergebenen URL. Es wird der Default-Prüfsummenalgorithmus zur Ermittlung der
|
||||
* Prüfsumme genutzt.
|
||||
*
|
||||
*
|
||||
* @param url URL des Prüflings
|
||||
* @return ein Prüf-Eingabe-Objekt
|
||||
*/
|
||||
|
|
@ -148,8 +122,16 @@ public class InputFactory {
|
|||
return read(url, DEFAULT_ALGORITH);
|
||||
}
|
||||
|
||||
public static Input read(final URI uri) {
|
||||
try {
|
||||
return read(uri.toURL(), DEFAULT_ALGORITH);
|
||||
} catch (final MalformedURLException e) {
|
||||
throw new IllegalArgumentException(String.format("Can not read from uri %s Not a valid uri supplied", uri));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Liest einen Prüfling von der übergebenen URL. Es wird ein definierter Algorithmus zur Ermittlung der Prüfsumme
|
||||
* Liest einen Prüfling von der übergebenen URL. Es wird ein definierter Algorithmis zur Ermittlung der Prüfsumme
|
||||
* genutzt.
|
||||
*
|
||||
* @param url URL des Prüflings
|
||||
|
|
@ -158,67 +140,11 @@ public class InputFactory {
|
|||
*/
|
||||
public static Input read(final URL url, final String digestAlgorithm) {
|
||||
checkNull(url);
|
||||
checkNotEmpty(url.getFile());
|
||||
try {
|
||||
final URLConnection urlConnection = url.openConnection();
|
||||
urlConnection.connect();
|
||||
return read(url.openStream(), url.getFile(), digestAlgorithm);
|
||||
} catch (final IOException e) {
|
||||
throw new IllegalArgumentException(MESSAGE_OPEN_STREAM_ERROR + url, e);
|
||||
}
|
||||
return new ResourceInput(url, url.getFile(), digestAlgorithm);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads a test document from a {@link Source}. Note: computing the hashcode is only supported for
|
||||
* {@link StreamSource}. You can not directly use other {@link Source Soures}. You need to supply the hashcode for
|
||||
* identification then.
|
||||
*
|
||||
* @param source source
|
||||
* @return an {@link Input}
|
||||
*/
|
||||
public static Input read(final Source source) {
|
||||
if (source instanceof StreamSource) {
|
||||
return read(source, source.getSystemId(), DEFAULT_ALGORITH);
|
||||
}
|
||||
final String name = UUID.randomUUID().toString();
|
||||
return read(source, name, PSEUDO_NAME_ALGORITHM, name.getBytes());
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads a test document from a {@link Source} using a specified digest algorithm.
|
||||
*
|
||||
* Note: computing the hashcode is only supported for {@link StreamSource}. You can not directly use other
|
||||
* {@link Source Soures}. You need to supply the hashcode for identification then.
|
||||
*
|
||||
* @param source source
|
||||
* @param name the digest algorithm
|
||||
* @return an {@link Input}
|
||||
*/
|
||||
public static Input read(final Source source, final String name) {
|
||||
checkNotEmpty(name);
|
||||
return read(source, name, PSEUDO_NAME_ALGORITHM, name.getBytes());
|
||||
}
|
||||
|
||||
public static Input read(final Source source, final String name, final String digestAlgorithm) {
|
||||
return read(source, name, digestAlgorithm, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads a test document from a {@link Source} using a specified digest algorithm.
|
||||
*
|
||||
* @param source source
|
||||
* @param digestAlgorithm the digest algorithm
|
||||
* @return an {@link Input}
|
||||
*/
|
||||
public static Input read(final Source source, final String digestAlgorithm, final byte[] hashcode) {
|
||||
checkNull(source);
|
||||
return read(source, source.getSystemId(), digestAlgorithm, hashcode);
|
||||
}
|
||||
|
||||
public static Input read(final Source source, final String name, final String digestAlgorithm, final byte[] hashcode) {
|
||||
checkNull(source);
|
||||
return new SourceInput(source, name, digestAlgorithm, hashcode);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -236,7 +162,6 @@ public class InputFactory {
|
|||
} catch (final IOException e) {
|
||||
throw new IllegalArgumentException(MESSAGE_OPEN_STREAM_ERROR + file, e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -261,14 +186,7 @@ public class InputFactory {
|
|||
*/
|
||||
public static Input read(final byte[] input, final String name, final String digestAlgorithm) {
|
||||
checkNull(input);
|
||||
checkNotEmpty(name);
|
||||
return new ByteArrayInput(input, name, digestAlgorithm);
|
||||
}
|
||||
|
||||
private static void checkNotEmpty(final String name) {
|
||||
if (StringUtils.isBlank(name)) {
|
||||
throw new IllegalArgumentException("Input name can not be null");
|
||||
}
|
||||
return read(new ByteArrayInputStream(input), name, digestAlgorithm);
|
||||
}
|
||||
|
||||
private static void checkNull(final Object input) {
|
||||
|
|
@ -297,21 +215,45 @@ public class InputFactory {
|
|||
* @return einen Prüfling in eingelesener Form
|
||||
*/
|
||||
public static Input read(final InputStream inputStream, final String name, final String digestAlgorithm) {
|
||||
checkNull(inputStream);
|
||||
return read(new StreamSource(inputStream, name), name, digestAlgorithm);
|
||||
return new InputFactory(digestAlgorithm).readStream(inputStream, name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads a saxon {@link XdmNode} with a given name. Hashcode identification is based on the name of the supplied
|
||||
* input. Now real hashcode is computed.
|
||||
*
|
||||
* @param node the node to read
|
||||
* @param name the name of the {@link Input}
|
||||
* @return an {@link Input} to validate
|
||||
*/
|
||||
public static Input read(final XdmNode node, final String name) {
|
||||
checkNull(node);
|
||||
return new XdmNodeInput(node, name, PSEUDO_NAME_ALGORITHM, name.getBytes());
|
||||
private Input readStream(final InputStream inputStream, final String name) {
|
||||
if (StringUtils.isNotBlank(name)) {
|
||||
log.debug("Generating hashcode for {} using {} algorithm", name, getAlgorithm());
|
||||
final MessageDigest digest = createDigest();
|
||||
final byte[] buffer = new byte[DEFAULT_BUFFER_SIZE];
|
||||
try ( final BufferedInputStream bis = new BufferedInputStream(inputStream);
|
||||
final DigestInputStream dis = new DigestInputStream(bis, digest);
|
||||
final ByteArrayOutputStream out = new ByteArrayOutputStream() ) {
|
||||
|
||||
// read the file and update the hash calculation
|
||||
int n;
|
||||
while (EOF != (n = dis.read(buffer))) {
|
||||
out.write(buffer, 0, n);
|
||||
}
|
||||
// get the hash value as byte array
|
||||
final byte[] hash = digest.digest();
|
||||
log.debug("Generated hashcode for {} is {}", name, DatatypeConverter.printHexBinary(hash));
|
||||
out.flush();
|
||||
return new Input(out.toByteArray(), name, hash, digest.getAlgorithm());
|
||||
} catch (final IOException e) {
|
||||
throw new IllegalArgumentException(MESSAGE_OPEN_STREAM_ERROR + name, e);
|
||||
}
|
||||
} else {
|
||||
throw new IllegalArgumentException("Must supply a valid name/identifier for the input");
|
||||
}
|
||||
}
|
||||
|
||||
private MessageDigest createDigest() {
|
||||
try {
|
||||
final MessageDigest digest;
|
||||
digest = MessageDigest.getInstance(getAlgorithm());
|
||||
return digest;
|
||||
} catch (final NoSuchAlgorithmException e) {
|
||||
// should not happen
|
||||
throw new IllegalStateException(String.format("Specified method %s is not available", getAlgorithm()), e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,84 +0,0 @@
|
|||
/*
|
||||
* Copyright 2017-2022 Koordinierungsstelle für IT-Standards (KoSIT)
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package de.kosit.validationtool.api;
|
||||
|
||||
import java.net.URI;
|
||||
|
||||
import javax.xml.transform.URIResolver;
|
||||
import javax.xml.validation.Schema;
|
||||
import javax.xml.validation.SchemaFactory;
|
||||
import javax.xml.validation.Validator;
|
||||
|
||||
import net.sf.saxon.lib.UnparsedTextURIResolver;
|
||||
|
||||
/**
|
||||
* Centralized construction and configuration of XML related infrastructure components. This interface allows to use
|
||||
* custom implementations and configurations of internal xml related factories and objects.
|
||||
*
|
||||
* The KoSIT Validator provides out of the box implementations with various security levels based on openjdk SAX stack.
|
||||
*
|
||||
* If you decide to implement a custom strategy, please be aware of XML security within your stack. The validator
|
||||
* components beyond this strategy asume secured implementation of the interfaces provided by this strategy. There is no
|
||||
* effort to mitigate or prevent xml related security issues such as XXE, loading external sources etc. Your would be
|
||||
* responsible for this!
|
||||
*
|
||||
* @see de.kosit.validationtool.impl.ResolvingMode
|
||||
* @author Andreas Penski
|
||||
*/
|
||||
public interface ResolvingConfigurationStrategy {
|
||||
|
||||
/**
|
||||
* Creates a preconfigured {@link SchemaFactory} for loading {@link javax.xml.validation.Schema} objects. The
|
||||
* implementation is responsible for xml security. Take care
|
||||
*
|
||||
* @return preconfigured {@link SchemaFactory}
|
||||
*/
|
||||
SchemaFactory createSchemaFactory();
|
||||
|
||||
/**
|
||||
* Creates a specific implementation for resolving referenced objects in XML files. The URIResolver is used for
|
||||
* dereferencing an absolute URI (after resolution) to return a {@link javax.xml.transform.Source}. It <b>can</b> be
|
||||
* used for resolving relative URIs against a base URI or restrict access to certain URIs.
|
||||
* <p>
|
||||
* This URIResolver is used to dereference the URIs appearing in <code>xsl:import</code>, <code>xsl:include</code>,
|
||||
* and <code>xsl:import-schema</code> declarations.
|
||||
* </p>
|
||||
*
|
||||
* @param scenarioRepository an optional repository, your implementation might not need this
|
||||
* @return a preconfigured {@link URIResolver}
|
||||
*/
|
||||
URIResolver createResolver(URI scenarioRepository);
|
||||
|
||||
/**
|
||||
* Creates a specific implementation for resolving objects referenced via XSLT's <code>unparsed-text()</code>
|
||||
* function.
|
||||
*
|
||||
* @param scenarioRepository an optional repository, your implementation might not need this
|
||||
* @return a preconfigured {@link net.sf.saxon.lib.UnparsedTextURIResolver} or null for using saxons default
|
||||
*/
|
||||
UnparsedTextURIResolver createUnparsedTextURIResolver(URI scenarioRepository);
|
||||
|
||||
/**
|
||||
* Creates a preconfigured {@link Validator } instance for a given schema for xml file validation. The
|
||||
* implementation takes care about security and reference resolving strategies.
|
||||
*
|
||||
* @param schema the scheme to create a {@link Validator} for
|
||||
* @return a preconfigured {@link Validator}
|
||||
*/
|
||||
Validator createValidator(Schema schema);
|
||||
|
||||
}
|
||||
|
|
@ -1,19 +1,3 @@
|
|||
/*
|
||||
* Copyright 2017-2022 Koordinierungsstelle für IT-Standards (KoSIT)
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package de.kosit.validationtool.api;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -22,19 +6,18 @@ import org.oclc.purl.dsdl.svrl.FailedAssert;
|
|||
import org.oclc.purl.dsdl.svrl.SchematronOutput;
|
||||
import org.w3c.dom.Document;
|
||||
|
||||
import de.kosit.validationtool.impl.model.CustomFailedAssert;
|
||||
import net.sf.saxon.s9api.XdmNode;
|
||||
|
||||
/**
|
||||
* API result object holding various information of the validation process results.
|
||||
* API Rückgabe Objekt des Ergebnisses des Validierungsprozesses.
|
||||
*
|
||||
* @author Andreas Penski
|
||||
*/
|
||||
public interface Result {
|
||||
|
||||
/**
|
||||
* Zeigt an, ob die Verarbeitung durch den Validator erfolgreich durchlaufen wurde. Diese Funktion macht
|
||||
* ausdrücklich keine Aussage über die zur Akzeptanz.
|
||||
* Zeigt an, ob die Verarbeitung durch den Validator erfolgreich durchlaufen wurde. Diese Funktion macht ausdrücklich
|
||||
* keine Aussage über die zur Akzeptanz.
|
||||
*
|
||||
* @return true, wenn die Verarbeitung komplett und erfolgreich durchlaufen wurde
|
||||
* @see #getAcceptRecommendation()
|
||||
|
|
@ -70,34 +53,26 @@ public interface Result {
|
|||
/**
|
||||
* Schnellzugriff auf die Empfehlung zur Weiterverarbeitung des Dokuments.
|
||||
*
|
||||
* @return <code>true</code> wenn {@link AcceptRecommendation#ACCEPTABLE}
|
||||
* @return true wenn {@link AcceptRecommendation#ACCEPTABLE}
|
||||
*/
|
||||
boolean isAcceptable();
|
||||
|
||||
/**
|
||||
* Gibt eine Liste mit gefundenen Schema-Validation-Fehler zurück. Diese Liste ist leer, wenn keine Fehler gefunden
|
||||
* wurden.
|
||||
*
|
||||
* @return List of schema validation errors.
|
||||
*/
|
||||
List<XmlError> getSchemaViolations();
|
||||
|
||||
/**
|
||||
* Liefert die Ergebnisse der Schematron-Prüfungen, in der Reihenfolge der Szenario-Konfiguration.
|
||||
*
|
||||
* @return List with Schematron results
|
||||
* @return Liste mit Schematron-Ergebnissen
|
||||
*/
|
||||
List<SchematronOutput> getSchematronResult();
|
||||
|
||||
/**
|
||||
* @return List of custom failed asserts per Schematron level. Only failed assertions with a custom level are
|
||||
* contained. Never <code>null</code> but maybe empty.
|
||||
*/
|
||||
List<CustomFailedAssert> getCustomFailedAsserts();
|
||||
|
||||
/**
|
||||
* Returns {@link org.oclc.purl.dsdl.svrl.FailedAssert FailedAsserts} of a schematron evaluation.
|
||||
*
|
||||
*
|
||||
* @return list of {@link org.oclc.purl.dsdl.svrl.FailedAssert FailedAsserts}, if any, empty list otherwise
|
||||
*/
|
||||
List<FailedAssert> getFailedAsserts();
|
||||
|
|
@ -105,22 +80,21 @@ public interface Result {
|
|||
/**
|
||||
* Liefert ein true, wenn keine Schema-Violations vorhanden sind.
|
||||
*
|
||||
* @return <code>true</code> if XML Schema compliant
|
||||
* @return true wenn Schema-valide
|
||||
*/
|
||||
boolean isSchemaValid();
|
||||
|
||||
/**
|
||||
* Liefert ein true, wenn der Prüfling eine well-formed XML-Datei ist.
|
||||
*
|
||||
* @return <code>true</code> if wellformed
|
||||
* @return true wenn well-formed
|
||||
*/
|
||||
boolean isWellformed();
|
||||
|
||||
/**
|
||||
* Returns true, if schematron has been checked and the result does not contain any {@link FailedAssert
|
||||
* FailedAsserts}.
|
||||
*
|
||||
* @return <code>true</code>, if valid
|
||||
* Returns true, if schematron has been checked and the result does not contain any {@link FailedAssert FailedAsserts}.
|
||||
*
|
||||
* @return true, if valid
|
||||
*/
|
||||
boolean isSchematronValid();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,19 +1,3 @@
|
|||
/*
|
||||
* Copyright 2017-2022 Koordinierungsstelle für IT-Standards (KoSIT)
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package de.kosit.validationtool.api;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,17 +1,20 @@
|
|||
/*
|
||||
* Copyright 2017-2022 Koordinierungsstelle für IT-Standards (KoSIT)
|
||||
* Licensed to the Koordinierungsstelle für IT-Standards (KoSIT) under
|
||||
* one or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. KoSIT licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package de.kosit.validationtool.cmd;
|
||||
|
|
@ -23,14 +26,16 @@ import java.util.Map;
|
|||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import de.kosit.validationtool.cmd.assertions.AssertionType;
|
||||
import de.kosit.validationtool.cmd.assertions.Assertions;
|
||||
import de.kosit.validationtool.impl.model.Result;
|
||||
import de.kosit.validationtool.impl.tasks.CheckAction;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import de.kosit.validationtool.cmd.assertions.AssertionType;
|
||||
import de.kosit.validationtool.cmd.assertions.Assertions;
|
||||
import de.kosit.validationtool.impl.model.Result;
|
||||
import de.kosit.validationtool.impl.tasks.CheckAction;
|
||||
|
||||
import net.sf.saxon.s9api.Processor;
|
||||
import net.sf.saxon.s9api.SaxonApiException;
|
||||
import net.sf.saxon.s9api.XPathCompiler;
|
||||
|
|
@ -54,12 +59,12 @@ class CheckAssertionAction implements CheckAction {
|
|||
|
||||
private Map<String, List<AssertionType>> mappedAssertions;
|
||||
|
||||
private static boolean matches(final String key, final String name) {
|
||||
private static boolean matches(String key, String name) {
|
||||
return key.startsWith(name) || (name + ".xml").endsWith(key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void check(final Bag results) {
|
||||
public void check(Bag results) {
|
||||
log.info("Checking assertions for {}", results.getInput().getName());
|
||||
final List<AssertionType> toCheck = findAssertions(results.getName());
|
||||
final List<String> errors = new ArrayList<>();
|
||||
|
|
@ -82,28 +87,29 @@ class CheckAssertionAction implements CheckAction {
|
|||
}
|
||||
}
|
||||
|
||||
private List<AssertionType> findAssertions(final String name) {
|
||||
private List<AssertionType> findAssertions(String name) {
|
||||
return getMapped().entrySet().stream().filter(e -> matches(e.getKey(), name)).map(Map.Entry::getValue).findFirst().orElse(null);
|
||||
}
|
||||
|
||||
private boolean check(final XdmNode document, final AssertionType assertion) {
|
||||
|
||||
private boolean check(XdmNode document, AssertionType assertion) {
|
||||
try {
|
||||
final XPathSelector selector = createSelector(assertion);
|
||||
selector.setContextItem(document);
|
||||
return selector.effectiveBooleanValue();
|
||||
} catch (final SaxonApiException e) {
|
||||
} catch (SaxonApiException e) {
|
||||
log.error("Error evaluating assertion {} for {}", assertion.getTest(), assertion.getReportDoc(), e);
|
||||
}
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
private XPathSelector createSelector(final AssertionType assertion) {
|
||||
private XPathSelector createSelector(AssertionType assertion) throws SaxonApiException {
|
||||
try {
|
||||
final XPathCompiler compiler = getProcessor().newXPathCompiler();
|
||||
assertions.getNamespace().forEach(ns -> compiler.declareNamespace(ns.getPrefix(), ns.getValue()));
|
||||
return compiler.compile(assertion.getTest()).load();
|
||||
} catch (final SaxonApiException e) {
|
||||
} catch (SaxonApiException e) {
|
||||
throw new IllegalStateException(String.format("Can not compile xpath match expression '%s'",
|
||||
StringUtils.isNotBlank(assertion.getTest()) ? assertion.getTest() : "EMPTY EXPRESSION"), e);
|
||||
}
|
||||
|
|
@ -112,8 +118,8 @@ class CheckAssertionAction implements CheckAction {
|
|||
private Map<String, List<AssertionType>> getMapped() {
|
||||
if (mappedAssertions == null) {
|
||||
mappedAssertions = new HashMap<>();
|
||||
for (final AssertionType assertionType : assertions.getAssertion()) {
|
||||
final List<AssertionType> list = mappedAssertions.computeIfAbsent(assertionType.getReportDoc(), k -> new ArrayList<>());
|
||||
for (AssertionType assertionType : assertions.getAssertion()) {
|
||||
List<AssertionType> list = mappedAssertions.computeIfAbsent(assertionType.getReportDoc(), k -> new ArrayList<>());
|
||||
list.add(assertionType);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,112 +1,378 @@
|
|||
/*
|
||||
* Copyright 2017-2022 Koordinierungsstelle für IT-Standards (KoSIT)
|
||||
* Licensed to the Koordinierungsstelle für IT-Standards (KoSIT) under
|
||||
* one or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. KoSIT licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package de.kosit.validationtool.cmd;
|
||||
|
||||
import static de.kosit.validationtool.impl.Printer.writeErr;
|
||||
import static org.apache.commons.lang3.StringUtils.isNotEmpty;
|
||||
import java.io.IOException;
|
||||
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;
|
||||
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.fusesource.jansi.AnsiConsole;
|
||||
import org.fusesource.jansi.AnsiRenderer.Code;
|
||||
import org.apache.commons.cli.CommandLine;
|
||||
import org.apache.commons.cli.CommandLineParser;
|
||||
import org.apache.commons.cli.DefaultParser;
|
||||
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 de.kosit.validationtool.cmd.report.Line;
|
||||
import de.kosit.validationtool.impl.Printer;
|
||||
import picocli.CommandLine;
|
||||
import picocli.CommandLine.ParseResult;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import de.kosit.validationtool.api.CheckConfiguration;
|
||||
import de.kosit.validationtool.api.Input;
|
||||
import de.kosit.validationtool.api.InputFactory;
|
||||
import de.kosit.validationtool.cmd.assertions.Assertions;
|
||||
import de.kosit.validationtool.impl.ConversionService;
|
||||
import de.kosit.validationtool.impl.ObjectFactory;
|
||||
|
||||
/**
|
||||
* Commandline interface of the validator. It parses the commandline args and hands over actual execution to
|
||||
* {@link Validator}.
|
||||
*
|
||||
* This separated from {@link Validator} to configure the slf4j simple logging.
|
||||
* Commandline Version des Prüftools. Parsed die Kommandozeile und führt die konfigurierten Aktionen aus.
|
||||
*
|
||||
* @author Andreas Penski
|
||||
*/
|
||||
// performance is not a problem here
|
||||
@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")
|
||||
.desc("Defines the out directory for results. Defaults to cwd").hasArg().build();
|
||||
|
||||
private static final Option EXTRACT_HTML = Option.builder("h").longOpt("html")
|
||||
.desc("Extract and save any html content within result as a separate file ").build();
|
||||
|
||||
private static final Option DEBUG = Option.builder("d").longOpt("debug").desc("Prints some more debug information").build();
|
||||
|
||||
private static final Option SERIALIZE_REPORT_INPUT = Option.builder("c").longOpt("serialize-report-input")
|
||||
.desc("Serializes the report input to the cwd").build();
|
||||
|
||||
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();
|
||||
|
||||
private CommandLineApplication() {
|
||||
// main class -> hide constructor
|
||||
}
|
||||
|
||||
/**
|
||||
* Main.
|
||||
* Main-Funktion für die Kommandozeilen-Applikation.
|
||||
*
|
||||
* @param args die Eingabe-Argumente
|
||||
*/
|
||||
public static void main(final String[] args) {
|
||||
AnsiConsole.systemInstall();
|
||||
final ReturnValue resultStatus = mainProgram(args);
|
||||
if (!resultStatus.equals(ReturnValue.DAEMON_MODE)) {
|
||||
if (!resultStatus.equals(ReturnValue.HELP_REQUEST) && resultStatus.getCode() >= 0) {
|
||||
sayGoodby(resultStatus);
|
||||
}
|
||||
System.exit(resultStatus.getCode());
|
||||
} else {
|
||||
Runtime.getRuntime().addShutdownHook(new Thread(() -> Printer.writeOut("Shutting down daemon ...")));
|
||||
final int resultStatus = mainProgram(args);
|
||||
if (DAEMON_SIGNAL != resultStatus) {
|
||||
System.exit(resultStatus);
|
||||
}
|
||||
}
|
||||
|
||||
private static void sayGoodby(final ReturnValue resultStatus) {
|
||||
Printer.writeOut("\n##############################");
|
||||
if (resultStatus.equals(ReturnValue.SUCCESS)) {
|
||||
Printer.writeOut("# " + new Line(Code.GREEN).add("Validation successful!").render(false, false) + " #");
|
||||
/**
|
||||
* Hauptprogramm für die Kommandozeilen-Applikation.
|
||||
*
|
||||
* @param args die Eingabe-Argumente
|
||||
*/
|
||||
static int mainProgram(final String[] args) {
|
||||
int returnValue = 0;
|
||||
final Options options = createOptions();
|
||||
if (isHelpRequested(args)) {
|
||||
printHelp(options);
|
||||
} else {
|
||||
Printer.writeOut("# " + new Line(Code.RED).add("Validation failed!").render(false, false) + " #");
|
||||
}
|
||||
Printer.writeOut("##############################");
|
||||
}
|
||||
|
||||
// for testing purposes. Unless jvm is terminated during tests. See above
|
||||
static ReturnValue mainProgram(final String[] args) {
|
||||
|
||||
ReturnValue resultStatus;
|
||||
final CommandLine commandLine = new CommandLine(new CommandLineOptions());
|
||||
try {
|
||||
commandLine.setExecutionExceptionHandler(CommandLineApplication::logExecutionException);
|
||||
final int cmdlineRetVal = commandLine.execute(args);
|
||||
if (commandLine.isUsageHelpRequested() || cmdlineRetVal == CommandLine.ExitCode.USAGE) {
|
||||
resultStatus = ReturnValue.HELP_REQUEST;
|
||||
} else {
|
||||
resultStatus = ObjectUtils.getIfNull(commandLine.getExecutionResult(), ReturnValue.PARSING_ERROR);
|
||||
if (resultStatus.isError()) {
|
||||
commandLine.usage(System.out);
|
||||
try {
|
||||
final CommandLineParser parser = new DefaultParser();
|
||||
final CommandLine cmd = parser.parse(options, args);
|
||||
if (cmd.hasOption(SERVER.getOpt())) {
|
||||
returnValue = startDaemonMode(cmd);
|
||||
} else if (cmd.getArgList().isEmpty()) {
|
||||
printHelp(createOptions());
|
||||
} else {
|
||||
returnValue = processActions(cmd);
|
||||
}
|
||||
} catch (final ParseException e) {
|
||||
log.error("Error processing command line arguments: " + e.getMessage());
|
||||
printHelp(options);
|
||||
}
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
private static int determinePort(final CommandLine cmd) {
|
||||
int port = 8080;
|
||||
if (checkOptionWithValue(PORT, cmd)) {
|
||||
port = Integer.parseInt(cmd.getOptionValue(PORT.getOpt()));
|
||||
}
|
||||
return port;
|
||||
}
|
||||
|
||||
private static int determineThreads(final 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(final CommandLine cmd) {
|
||||
String host = "localhost";
|
||||
if (checkOptionWithValue(HOST, cmd)) {
|
||||
host = cmd.getOptionValue(HOST.getOpt());
|
||||
}
|
||||
return host;
|
||||
}
|
||||
|
||||
private static int startDaemonMode(final CommandLine cmd) {
|
||||
final Option[] unavailable = new Option[] { PRINT, CHECK_ASSERTIONS, DEBUG, OUTPUT, EXTRACT_HTML };
|
||||
warnUnusedOptions(cmd, unavailable, true);
|
||||
final Daemon validDaemon = new Daemon(determineDefinition(cmd), determineRepository(cmd), determineHost(cmd), determinePort(cmd),
|
||||
determineThreads(cmd));
|
||||
validDaemon.startServer();
|
||||
return DAEMON_SIGNAL;
|
||||
}
|
||||
|
||||
private static void warnUnusedOptions(final CommandLine cmd, final Option[] unavailable, final 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(final String[] args) {
|
||||
final Options helpOptions = createHelpOptions();
|
||||
try {
|
||||
final CommandLineParser parser = new DefaultParser();
|
||||
final CommandLine cmd = parser.parse(helpOptions, args, true);
|
||||
if (cmd.hasOption(HELP.getOpt()) || args.length == 0) {
|
||||
return true;
|
||||
}
|
||||
} catch (final ParseException e) {
|
||||
// we can ignore that, we just look for the help parameters
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private static int processActions(final CommandLine cmd) {
|
||||
try {
|
||||
|
||||
long start = System.currentTimeMillis();
|
||||
final Option[] unavailable = new Option[] { HOST, PORT, WORKER_COUNT };
|
||||
warnUnusedOptions(cmd, unavailable, false);
|
||||
final CheckConfiguration d = new CheckConfiguration(determineDefinition(cmd));
|
||||
d.setScenarioRepository(determineRepository(cmd));
|
||||
final InternalCheck check = new InternalCheck(d);
|
||||
final Path outputDirectory = determineOutputDirectory(cmd);
|
||||
|
||||
if (cmd.hasOption(EXTRACT_HTML.getOpt())) {
|
||||
check.getCheckSteps().add(new ExtractHtmlContentAction(check.getContentRepository(), outputDirectory));
|
||||
}
|
||||
check.getCheckSteps().add(new SerializeReportAction(outputDirectory));
|
||||
if (cmd.hasOption(SERIALIZE_REPORT_INPUT.getOpt())) {
|
||||
check.getCheckSteps().add(new SerializeReportInputAction(outputDirectory, check.getConversionService()));
|
||||
}
|
||||
if (cmd.hasOption(PRINT.getOpt())) {
|
||||
check.getCheckSteps().add(new PrintReportAction());
|
||||
}
|
||||
|
||||
if (cmd.hasOption(CHECK_ASSERTIONS.getOpt())) {
|
||||
final Assertions assertions = loadAssertions(cmd.getOptionValue(CHECK_ASSERTIONS.getOpt()));
|
||||
check.getCheckSteps().add(new CheckAssertionAction(assertions, ObjectFactory.createProcessor()));
|
||||
}
|
||||
if (cmd.hasOption(PRINT_MEM_STATS.getOpt())) {
|
||||
check.getCheckSteps().add(new PrintMemoryStats());
|
||||
}
|
||||
|
||||
log.info("Setup completed in {}ms\n", System.currentTimeMillis() - start);
|
||||
|
||||
final Collection<Path> targets = determineTestTargets(cmd);
|
||||
start = System.currentTimeMillis();
|
||||
for (final Path p : targets) {
|
||||
final Input input = InputFactory.read(p);
|
||||
check.checkInput(input);
|
||||
}
|
||||
final boolean result = check.printAndEvaluate();
|
||||
log.info("Processing {} object(s) completed in {}ms", targets.size(), System.currentTimeMillis() - start);
|
||||
return result ? 0 : 1;
|
||||
|
||||
} catch (final Exception e) {
|
||||
writeErr("Error processing command line arguments: {0}", e.getMessage(), e);
|
||||
resultStatus = ReturnValue.PARSING_ERROR;
|
||||
if (cmd.hasOption(DEBUG.getOpt())) {
|
||||
log.error(e.getMessage(), e);
|
||||
} else {
|
||||
log.error(e.getMessage());
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
return resultStatus;
|
||||
}
|
||||
|
||||
// The signature is required, because the method is used a lambda
|
||||
@SuppressWarnings("unused")
|
||||
private static int logExecutionException(final Exception ex, final CommandLine cli, final ParseResult parseResult) {
|
||||
final String message = isNotEmpty(ex.getMessage()) ? ex.getMessage() : "Es ist eine Fehler aufgetreten";
|
||||
Printer.writeErr(ex, message);
|
||||
return 1;
|
||||
private static Assertions loadAssertions(final String optionValue) {
|
||||
final Path p = Paths.get(optionValue);
|
||||
Assertions a = null;
|
||||
if (Files.exists(p)) {
|
||||
final ConversionService c = new ConversionService();
|
||||
c.initialize(de.kosit.validationtool.cmd.assertions.ObjectFactory.class.getPackage());
|
||||
a = c.readXml(p.toUri(), Assertions.class);
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
enum Level {
|
||||
private static Path determineOutputDirectory(final CommandLine cmd) {
|
||||
final String value = cmd.getOptionValue(OUTPUT.getOpt());
|
||||
final Path fir;
|
||||
if (StringUtils.isNotBlank(value)) {
|
||||
fir = Paths.get(value);
|
||||
if ((!Files.exists(fir) && !fir.toFile().mkdirs()) || !Files.isDirectory(fir)) {
|
||||
throw new IllegalStateException(String.format("Invalid target directory %s specified", value));
|
||||
}
|
||||
} else {
|
||||
fir = Paths.get(""/* cwd */);
|
||||
}
|
||||
return fir;
|
||||
}
|
||||
|
||||
INFO, WARN, DEBUG, TRACE, ERROR, OFF;
|
||||
private static Collection<Path> determineTestTargets(final CommandLine cmd) {
|
||||
final Collection<Path> targets = new ArrayList<>();
|
||||
if (!cmd.getArgList().isEmpty()) {
|
||||
cmd.getArgList().forEach(e -> targets.addAll(determineTestTarget(e)));
|
||||
}
|
||||
if (targets.isEmpty()) {
|
||||
throw new IllegalStateException("No test targets found. Nothing to check. Will quit now!");
|
||||
}
|
||||
return targets;
|
||||
}
|
||||
|
||||
private static Collection<Path> determineTestTarget(final String s) {
|
||||
final Path d = Paths.get(s);
|
||||
if (Files.isDirectory(d)) {
|
||||
return listDirectoryTargets(d);
|
||||
} else if (Files.exists(d)) {
|
||||
return Collections.singleton(d);
|
||||
}
|
||||
log.warn("The specified test target {} does not exist. Will be ignored", s);
|
||||
return Collections.emptyList();
|
||||
|
||||
}
|
||||
|
||||
private static Collection<Path> listDirectoryTargets(final Path d) {
|
||||
try {
|
||||
return Files.list(d).filter(path -> path.toString().endsWith(".xml")).collect(Collectors.toList());
|
||||
} catch (final IOException e) {
|
||||
throw new IllegalStateException("IOException while list directory content. Can not determine test targets.", e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static URI determineRepository(final CommandLine cmd) {
|
||||
if (checkOptionWithValue(REPOSITORY, cmd)) {
|
||||
final Path d = Paths.get(cmd.getOptionValue(REPOSITORY.getOpt()));
|
||||
if (Files.isDirectory(d)) {
|
||||
return d.toUri();
|
||||
} else {
|
||||
throw new IllegalArgumentException(
|
||||
String.format("Not a valid path for repository definition specified: '%s'", d.toAbsolutePath()));
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static URI determineDefinition(final CommandLine cmd) {
|
||||
checkOptionWithValue(SCENARIOS, cmd);
|
||||
final Path f = Paths.get(cmd.getOptionValue(SCENARIOS.getOpt()));
|
||||
if (Files.isRegularFile(f)) {
|
||||
return f.toAbsolutePath().toUri();
|
||||
} else {
|
||||
throw new IllegalArgumentException(
|
||||
String.format("Not a valid path for scenario definition specified: '%s'", f.toAbsolutePath()));
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean checkOptionWithValue(final Option option, final CommandLine cmd) {
|
||||
final String opt = option.getOpt();
|
||||
if (cmd.hasOption(opt)) {
|
||||
final String value = cmd.getOptionValue(opt);
|
||||
if (StringUtils.isNoneBlank(value)) {
|
||||
return true;
|
||||
} else {
|
||||
throw new IllegalArgumentException(String.format("Option value required for Option '%s'", option.getLongOpt()));
|
||||
}
|
||||
} else if (option.isRequired()) {
|
||||
|
||||
throw new IllegalArgumentException(String.format("Option '%s' required ", option.getLongOpt()));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private static void printHelp(final Options options) {
|
||||
// automatically generate the help statement
|
||||
final HelpFormatter formatter = new HelpFormatter();
|
||||
formatter.printHelp("check-tool -s <scenario-config-file> [OPTIONS] [FILE]... ", options, false);
|
||||
}
|
||||
|
||||
private static Options createHelpOptions() {
|
||||
final Options options = new Options();
|
||||
options.addOption(HELP);
|
||||
return options;
|
||||
}
|
||||
|
||||
private static Options createOptions() {
|
||||
final 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);
|
||||
options.addOption(OUTPUT);
|
||||
options.addOption(EXTRACT_HTML);
|
||||
options.addOption(DEBUG);
|
||||
options.addOption(CHECK_ASSERTIONS);
|
||||
options.addOption(PRINT_MEM_STATS);
|
||||
options.addOption(WORKER_COUNT);
|
||||
return options;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,191 +0,0 @@
|
|||
/*
|
||||
* Copyright 2017-2022 Koordinierungsstelle für IT-Standards (KoSIT)
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package de.kosit.validationtool.cmd;
|
||||
|
||||
import java.nio.file.Path;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.Callable;
|
||||
|
||||
import de.kosit.validationtool.cmd.CommandLineApplication.Level;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import picocli.CommandLine.ArgGroup;
|
||||
import picocli.CommandLine.Command;
|
||||
import picocli.CommandLine.Help.Visibility;
|
||||
import picocli.CommandLine.Option;
|
||||
import picocli.CommandLine.Parameters;
|
||||
|
||||
/**
|
||||
* Commandline Interface definition.
|
||||
*
|
||||
* @author Andreas Penski
|
||||
*/
|
||||
@Command(description = "Structural and semantic validation of xml files", name = "KoSIT Validator", mixinStandardHelpOptions = false,
|
||||
separator = " ", synopsisHeading = CommandLineOptions.SYNOSIS_HEADING)
|
||||
@Getter
|
||||
public class CommandLineOptions implements Callable<ReturnValue> {
|
||||
|
||||
static final String SYNOSIS_HEADING = "Usage: ";
|
||||
|
||||
/**
|
||||
* @author Andreas Penski
|
||||
*/
|
||||
@Getter
|
||||
@NoArgsConstructor
|
||||
static class DaemonOptions {
|
||||
|
||||
@Option(names = { "-D", "--daemon" }, description = "Starts a daemon listing for validation requests", defaultValue = "false",
|
||||
required = true)
|
||||
private boolean daemonMode;
|
||||
|
||||
@Option(names = { "-H", "--host" }, description = "The hostname / IP address to bind the daemon.", defaultValue = "localhost",
|
||||
showDefaultValue = Visibility.ALWAYS)
|
||||
private String host;
|
||||
|
||||
@Option(names = { "-P", "--port" }, description = "The port to bind the daemon.", defaultValue = "8080",
|
||||
showDefaultValue = Visibility.ALWAYS)
|
||||
private int port;
|
||||
|
||||
@Option(names = { "-T", "--threads" },
|
||||
description = "Number of threads processing validation requests. Default depends on processor count", defaultValue = "-1",
|
||||
showDefaultValue = Visibility.NEVER)
|
||||
private int workerCount;
|
||||
|
||||
@Option(names = { "-G", "--disable-gui" }, description = "Disables the GUI of the daemon mode")
|
||||
private boolean disableGUI;
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Andreas Penski
|
||||
*/
|
||||
@Getter
|
||||
@NoArgsConstructor
|
||||
static class CliOptions {
|
||||
|
||||
@Option(names = { "-o", "--output-directory" }, description = "Defines the out directory for results.", defaultValue = ".",
|
||||
required = true)
|
||||
private Path outputPath;
|
||||
|
||||
@Option(names = { "-h", "--html", "--extract-html" },
|
||||
description = "Extract and save any html content within result as a separate file")
|
||||
private boolean extractHtml;
|
||||
|
||||
@Option(names = { "--serialize-report-input" }, description = "Serializes the report input to the cwd", defaultValue = "false")
|
||||
private boolean serializeInput;
|
||||
|
||||
@Option(names = { "-c", "--check-assertions" }, paramLabel = "assertions-file",
|
||||
description = "Check the result using defined assertions")
|
||||
private Path assertions;
|
||||
|
||||
@Option(names = { "--report-postfix" }, description = "Postfix of the generated report name")
|
||||
private String reportPostfix;
|
||||
|
||||
@Option(names = { "--report-prefix" }, description = "Prefix of the generated report name")
|
||||
private String reportPrefix;
|
||||
|
||||
@Option(names = { "-m", "--memory-stats" }, description = "Prints some memory stats")
|
||||
private boolean printMemoryStats;
|
||||
|
||||
@Option(names = { "-p", "--print" }, description = "Prints the check result to stdout")
|
||||
private boolean printReport;
|
||||
|
||||
@Parameters(arity = "1..*", description = "Files to validate")
|
||||
private List<Path> files;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Definition of logical name and a path for a configuration artifact.
|
||||
*
|
||||
* @author Andreas Penski
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
public abstract static class Definition {
|
||||
|
||||
String name;
|
||||
|
||||
Path path;
|
||||
}
|
||||
|
||||
/**
|
||||
* Definition of logical name and a path for a repository.
|
||||
*
|
||||
* @author Andreas Penski
|
||||
*/
|
||||
public static class RepositoryDefinition extends Definition {
|
||||
// just for type safety
|
||||
}
|
||||
|
||||
/**
|
||||
* Definition of logical name and a path for a scenario configuration file.
|
||||
*
|
||||
* @author Andreas Penski
|
||||
*/
|
||||
public static class ScenarioDefinition extends Definition {
|
||||
// just for type safety
|
||||
}
|
||||
|
||||
@ArgGroup(exclusive = false, heading = "Daemon options\n")
|
||||
private DaemonOptions daemonOptions;
|
||||
|
||||
@ArgGroup(exclusive = false, heading = "CLI usage options\n")
|
||||
private CliOptions cliOptions;
|
||||
|
||||
@Option(names = { "-d", "--debug" }, description = "Prints some more debug information")
|
||||
private boolean debugOutput;
|
||||
|
||||
@Option(names = { "-?", "--help" }, usageHelp = true, description = "display this help message")
|
||||
boolean usageHelpRequested;
|
||||
|
||||
@Option(names = { "-X", "--debug-logging" }, description = "Enables full debug log. Alias for -l debug")
|
||||
private boolean debugLog;
|
||||
|
||||
@Option(names = { "-l", "--log-level" }, description = "Enables a certain log level for debugging purposes", defaultValue = "OFF")
|
||||
private Level logLevel;
|
||||
|
||||
@Option(names = { "-r", "--repository" }, paramLabel = "repository-path", description = "Directory containing scenario content",
|
||||
converter = TypeConverter.RepositoryConverter.class)
|
||||
private List<RepositoryDefinition> repositories;
|
||||
|
||||
@Option(names = { "-s", "--scenarios" }, description = "Location of scenarios.xml", paramLabel = "scenario.xml", required = true,
|
||||
converter = TypeConverter.ScenarioConverter.class)
|
||||
private List<ScenarioDefinition> scenarios;
|
||||
|
||||
@Override
|
||||
public ReturnValue call() throws Exception {
|
||||
configureLogging(this);
|
||||
return Validator.mainProgram(this);
|
||||
}
|
||||
|
||||
private static void configureLogging(final CommandLineOptions cmd) {
|
||||
if (cmd.isDebugLog()) {
|
||||
System.setProperty(org.slf4j.simple.SimpleLogger.DEFAULT_LOG_LEVEL_KEY, "DEBUG");
|
||||
} else {
|
||||
System.setProperty(org.slf4j.simple.SimpleLogger.DEFAULT_LOG_LEVEL_KEY, cmd.getLogLevel().name());
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isDaemonModeEnabled() {
|
||||
return getDaemonOptions() != null;
|
||||
}
|
||||
|
||||
public boolean isCliModeEnabled() {
|
||||
return getCliOptions() != null;
|
||||
}
|
||||
}
|
||||
198
src/main/java/de/kosit/validationtool/cmd/Daemon.java
Normal file
198
src/main/java/de/kosit/validationtool/cmd/Daemon.java
Normal file
|
|
@ -0,0 +1,198 @@
|
|||
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 {
|
||||
log.debug("Incoming request");
|
||||
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 (Exception 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 unter Port {} ist erfolgreich gestartet", port);
|
||||
} catch (IOException e) {
|
||||
log.error("Fehler beim HttpServer erstellen!", e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
/*
|
||||
* Copyright 2017-2022 Koordinierungsstelle für IT-Standards (KoSIT)
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package de.kosit.validationtool.cmd;
|
||||
|
||||
import static org.apache.commons.io.FilenameUtils.isExtension;
|
||||
import static org.apache.commons.lang3.StringUtils.isEmpty;
|
||||
import static org.apache.commons.lang3.StringUtils.isNotEmpty;
|
||||
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* A default {@link NamingStrategy} supporting prefix and postfix configurations for generating report names
|
||||
*
|
||||
* @author Andreas Penski
|
||||
*/
|
||||
@Setter
|
||||
public class DefaultNamingStrategy implements NamingStrategy {
|
||||
|
||||
private String prefix;
|
||||
|
||||
private String postfix;
|
||||
|
||||
@Override
|
||||
public String createName(final String name) {
|
||||
if (StringUtils.isEmpty(name)) {
|
||||
throw new IllegalArgumentException("Can not generate name based on null input");
|
||||
}
|
||||
final String base = isExtension(name.toLowerCase(), "xml") ? FilenameUtils.getBaseName(name) : name;
|
||||
final StringBuilder result = new StringBuilder();
|
||||
if (isNotEmpty(this.prefix)) {
|
||||
result.append(this.prefix).append("-");
|
||||
}
|
||||
result.append(base);
|
||||
if (isNotEmpty(this.postfix)) {
|
||||
result.append("-").append(this.postfix);
|
||||
} else if (isEmpty(this.prefix)) {
|
||||
result.append("-").append("report");
|
||||
}
|
||||
result.append(".xml");
|
||||
return result.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,17 +1,20 @@
|
|||
/*
|
||||
* Copyright 2017-2022 Koordinierungsstelle für IT-Standards (KoSIT)
|
||||
* Licensed to the Koordinierungsstelle für IT-Standards (KoSIT) under
|
||||
* one or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. KoSIT licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package de.kosit.validationtool.cmd;
|
||||
|
|
@ -21,10 +24,10 @@ import java.nio.file.Path;
|
|||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import de.kosit.validationtool.impl.ContentRepository;
|
||||
import de.kosit.validationtool.impl.HtmlExtractor;
|
||||
import de.kosit.validationtool.impl.tasks.CheckAction;
|
||||
|
||||
import net.sf.saxon.s9api.Processor;
|
||||
import net.sf.saxon.s9api.QName;
|
||||
import net.sf.saxon.s9api.SaxonApiException;
|
||||
import net.sf.saxon.s9api.Serializer;
|
||||
|
|
@ -46,12 +49,12 @@ class ExtractHtmlContentAction implements CheckAction {
|
|||
|
||||
private HtmlExtractor htmlExtraction;
|
||||
|
||||
private Processor processor;
|
||||
private ContentRepository repository;
|
||||
|
||||
public ExtractHtmlContentAction(final Processor p, final Path outputDirectory) {
|
||||
public ExtractHtmlContentAction(final ContentRepository repository, final Path outputDirectory) {
|
||||
this.outputDirectory = outputDirectory;
|
||||
this.htmlExtraction = new HtmlExtractor(p);
|
||||
this.processor = p;
|
||||
this.htmlExtraction = new HtmlExtractor(repository);
|
||||
this.repository = repository;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -63,12 +66,12 @@ class ExtractHtmlContentAction implements CheckAction {
|
|||
final XdmNode node = (XdmNode) xdmItem;
|
||||
final String name = origName + "-" + node.getAttributeValue(NAME_ATTRIBUTE);
|
||||
final Path file = this.outputDirectory.resolve(name + ".html");
|
||||
final Serializer serializer = this.processor.newSerializer(file.toFile());
|
||||
final Serializer serializer = this.repository.getProcessor().newSerializer(file.toFile());
|
||||
try {
|
||||
log.info("Writing report html '{}' to {}", name, file.toAbsolutePath());
|
||||
serializer.serializeNode(node);
|
||||
} catch (final SaxonApiException e) {
|
||||
log.error("Error extracting html content to {}", file.toAbsolutePath(), e);
|
||||
log.info("Error extracting html content to {}", file.toAbsolutePath(), e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue