Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CityDoctor
CityDoctor2
Commits
3610be70
Commit
3610be70
authored
Oct 23, 2020
by
Matthias Betz
Browse files
more translation
parent
2d43c43b
Pipeline
#1077
passed with stage
in 2 minutes and 18 seconds
Changes
18
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/check/ErrorVisitor.java
View file @
3610be70
...
@@ -21,7 +21,7 @@ package de.hft.stuttgart.citydoctor2.check;
...
@@ -21,7 +21,7 @@ package de.hft.stuttgart.citydoctor2.check;
import
de.hft.stuttgart.citydoctor2.check.error.AllPolygonsWrongOrientationError
;
import
de.hft.stuttgart.citydoctor2.check.error.AllPolygonsWrongOrientationError
;
import
de.hft.stuttgart.citydoctor2.check.error.ConsecutivePointSameError
;
import
de.hft.stuttgart.citydoctor2.check.error.ConsecutivePointSameError
;
import
de.hft.stuttgart.citydoctor2.check.error.DependenciesNotMetError
;
import
de.hft.stuttgart.citydoctor2.check.error.DependenciesNotMetError
;
import
de.hft.stuttgart.citydoctor2.check.error.DistanceError
;
import
de.hft.stuttgart.citydoctor2.check.error.
NonPlanarPolygon
Distance
Plane
Error
;
import
de.hft.stuttgart.citydoctor2.check.error.DuplicatePointError
;
import
de.hft.stuttgart.citydoctor2.check.error.DuplicatePointError
;
import
de.hft.stuttgart.citydoctor2.check.error.EdgeIntersectionError
;
import
de.hft.stuttgart.citydoctor2.check.error.EdgeIntersectionError
;
import
de.hft.stuttgart.citydoctor2.check.error.HoleOutsideError
;
import
de.hft.stuttgart.citydoctor2.check.error.HoleOutsideError
;
...
@@ -37,7 +37,7 @@ import de.hft.stuttgart.citydoctor2.check.error.NotGroundError;
...
@@ -37,7 +37,7 @@ import de.hft.stuttgart.citydoctor2.check.error.NotGroundError;
import
de.hft.stuttgart.citydoctor2.check.error.NotWallError
;
import
de.hft.stuttgart.citydoctor2.check.error.NotWallError
;
import
de.hft.stuttgart.citydoctor2.check.error.NullAreaError
;
import
de.hft.stuttgart.citydoctor2.check.error.NullAreaError
;
import
de.hft.stuttgart.citydoctor2.check.error.PointTouchesEdgeError
;
import
de.hft.stuttgart.citydoctor2.check.error.PointTouchesEdgeError
;
import
de.hft.stuttgart.citydoctor2.check.error.Polygon
SelfInt
Error
;
import
de.hft.stuttgart.citydoctor2.check.error.Polygon
IntersectingRings
Error
;
import
de.hft.stuttgart.citydoctor2.check.error.PolygonWrongOrientationError
;
import
de.hft.stuttgart.citydoctor2.check.error.PolygonWrongOrientationError
;
import
de.hft.stuttgart.citydoctor2.check.error.RingNotClosedError
;
import
de.hft.stuttgart.citydoctor2.check.error.RingNotClosedError
;
import
de.hft.stuttgart.citydoctor2.check.error.RingSelfIntError
;
import
de.hft.stuttgart.citydoctor2.check.error.RingSelfIntError
;
...
@@ -96,9 +96,9 @@ public interface ErrorVisitor {
...
@@ -96,9 +96,9 @@ public interface ErrorVisitor {
public
void
visit
(
NormalDeviationError
err
);
public
void
visit
(
NormalDeviationError
err
);
public
void
visit
(
DistanceError
err
);
public
void
visit
(
NonPlanarPolygon
Distance
Plane
Error
err
);
public
void
visit
(
Polygon
SelfInt
Error
err
);
public
void
visit
(
Polygon
IntersectingRings
Error
err
);
public
void
visit
(
SolidSelfIntError
err
);
public
void
visit
(
SolidSelfIntError
err
);
...
...
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/check/HealingMethod.java
View file @
3610be70
...
@@ -21,7 +21,7 @@ package de.hft.stuttgart.citydoctor2.check;
...
@@ -21,7 +21,7 @@ package de.hft.stuttgart.citydoctor2.check;
import
de.hft.stuttgart.citydoctor2.check.error.AllPolygonsWrongOrientationError
;
import
de.hft.stuttgart.citydoctor2.check.error.AllPolygonsWrongOrientationError
;
import
de.hft.stuttgart.citydoctor2.check.error.ConsecutivePointSameError
;
import
de.hft.stuttgart.citydoctor2.check.error.ConsecutivePointSameError
;
import
de.hft.stuttgart.citydoctor2.check.error.DependenciesNotMetError
;
import
de.hft.stuttgart.citydoctor2.check.error.DependenciesNotMetError
;
import
de.hft.stuttgart.citydoctor2.check.error.DistanceError
;
import
de.hft.stuttgart.citydoctor2.check.error.
NonPlanarPolygon
Distance
Plane
Error
;
import
de.hft.stuttgart.citydoctor2.check.error.DuplicatePointError
;
import
de.hft.stuttgart.citydoctor2.check.error.DuplicatePointError
;
import
de.hft.stuttgart.citydoctor2.check.error.EdgeIntersectionError
;
import
de.hft.stuttgart.citydoctor2.check.error.EdgeIntersectionError
;
import
de.hft.stuttgart.citydoctor2.check.error.HoleOutsideError
;
import
de.hft.stuttgart.citydoctor2.check.error.HoleOutsideError
;
...
@@ -37,7 +37,7 @@ import de.hft.stuttgart.citydoctor2.check.error.NotGroundError;
...
@@ -37,7 +37,7 @@ import de.hft.stuttgart.citydoctor2.check.error.NotGroundError;
import
de.hft.stuttgart.citydoctor2.check.error.NotWallError
;
import
de.hft.stuttgart.citydoctor2.check.error.NotWallError
;
import
de.hft.stuttgart.citydoctor2.check.error.NullAreaError
;
import
de.hft.stuttgart.citydoctor2.check.error.NullAreaError
;
import
de.hft.stuttgart.citydoctor2.check.error.PointTouchesEdgeError
;
import
de.hft.stuttgart.citydoctor2.check.error.PointTouchesEdgeError
;
import
de.hft.stuttgart.citydoctor2.check.error.Polygon
SelfInt
Error
;
import
de.hft.stuttgart.citydoctor2.check.error.Polygon
IntersectingRings
Error
;
import
de.hft.stuttgart.citydoctor2.check.error.PolygonWrongOrientationError
;
import
de.hft.stuttgart.citydoctor2.check.error.PolygonWrongOrientationError
;
import
de.hft.stuttgart.citydoctor2.check.error.RingNotClosedError
;
import
de.hft.stuttgart.citydoctor2.check.error.RingNotClosedError
;
import
de.hft.stuttgart.citydoctor2.check.error.RingSelfIntError
;
import
de.hft.stuttgart.citydoctor2.check.error.RingSelfIntError
;
...
@@ -85,7 +85,7 @@ public interface HealingMethod {
...
@@ -85,7 +85,7 @@ public interface HealingMethod {
return
false
;
return
false
;
}
}
default
boolean
visit
(
DistanceError
err
,
ModificationListener
l
)
{
default
boolean
visit
(
NonPlanarPolygon
Distance
Plane
Error
err
,
ModificationListener
l
)
{
return
false
;
return
false
;
}
}
...
@@ -125,7 +125,7 @@ public interface HealingMethod {
...
@@ -125,7 +125,7 @@ public interface HealingMethod {
return
false
;
return
false
;
}
}
default
boolean
visit
(
Polygon
SelfInt
Error
err
,
ModificationListener
l
)
{
default
boolean
visit
(
Polygon
IntersectingRings
Error
err
,
ModificationListener
l
)
{
return
false
;
return
false
;
}
}
...
...
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/check/error/DistanceError.java
→
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/check/error/
NonPlanarPolygon
Distance
Plane
Error.java
View file @
3610be70
...
@@ -37,7 +37,7 @@ import de.hft.stuttgart.citydoctor2.utils.Localization;
...
@@ -37,7 +37,7 @@ import de.hft.stuttgart.citydoctor2.utils.Localization;
* @author Matthias Betz
* @author Matthias Betz
*
*
*/
*/
public
class
DistanceError
extends
CheckError
{
public
class
NonPlanarPolygon
Distance
Plane
Error
extends
CheckError
{
private
static
final
long
serialVersionUID
=
-
3504364055236383519L
;
private
static
final
long
serialVersionUID
=
-
3504364055236383519L
;
...
@@ -46,7 +46,7 @@ public class DistanceError extends CheckError {
...
@@ -46,7 +46,7 @@ public class DistanceError extends CheckError {
private
Vertex
v
;
private
Vertex
v
;
private
Plane
plane
;
private
Plane
plane
;
public
DistanceError
(
Polygon
p
,
double
distance
,
Vertex
v
,
Plane
plane
)
{
public
NonPlanarPolygon
Distance
Plane
Error
(
Polygon
p
,
double
distance
,
Vertex
v
,
Plane
plane
)
{
super
(
ErrorId
.
GE_P_NON_PLANAR_POLYGON_DISTANCE_PLANE
,
ErrorType
.
ERROR
,
p
);
super
(
ErrorId
.
GE_P_NON_PLANAR_POLYGON_DISTANCE_PLANE
,
ErrorType
.
ERROR
,
p
);
this
.
p
=
p
;
this
.
p
=
p
;
this
.
distance
=
distance
;
this
.
distance
=
distance
;
...
...
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/check/error/Polygon
SelfInt
Error.java
→
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/check/error/Polygon
IntersectingRings
Error.java
View file @
3610be70
...
@@ -36,14 +36,14 @@ import de.hft.stuttgart.citydoctor2.utils.SerializablePair;
...
@@ -36,14 +36,14 @@ import de.hft.stuttgart.citydoctor2.utils.SerializablePair;
* @author Matthias Betz
* @author Matthias Betz
*
*
*/
*/
public
class
Polygon
SelfInt
Error
extends
CheckError
{
public
class
Polygon
IntersectingRings
Error
extends
CheckError
{
private
static
final
long
serialVersionUID
=
-
7043521697085991901L
;
private
static
final
long
serialVersionUID
=
-
7043521697085991901L
;
private
Polygon
p
;
private
Polygon
p
;
private
SerializablePair
<
LinearRing
,
LinearRing
>
intersectingRings
;
private
SerializablePair
<
LinearRing
,
LinearRing
>
intersectingRings
;
public
Polygon
SelfInt
Error
(
Polygon
p
,
SerializablePair
<
LinearRing
,
LinearRing
>
intersectingRings
)
{
public
Polygon
IntersectingRings
Error
(
Polygon
p
,
SerializablePair
<
LinearRing
,
LinearRing
>
intersectingRings
)
{
super
(
ErrorId
.
GE_P_INTERSECTING_RINGS
,
ErrorType
.
ERROR
,
p
);
super
(
ErrorId
.
GE_P_INTERSECTING_RINGS
,
ErrorType
.
ERROR
,
p
);
this
.
p
=
p
;
this
.
p
=
p
;
this
.
intersectingRings
=
intersectingRings
;
this
.
intersectingRings
=
intersectingRings
;
...
...
CityDoctorParent/CityDoctorModel/src/main/resources/CityDoctorLocalization.properties
View file @
3610be70
...
@@ -3,6 +3,7 @@ DistanceError.distanceFromPlane=distance from plane
...
@@ -3,6 +3,7 @@ DistanceError.distanceFromPlane=distance from plane
AboutDialog.developedBy
=
Developed by
AboutDialog.developedBy
=
Developed by
AboutDialog.contact
=
Contact
AboutDialog.contact
=
Contact
AboutDialog.title
=
CityDoctor 3 - About
AboutDialog.title
=
CityDoctor 3 - About
AboutDialog.closeBtn
=
Close
CheckDialog.title
=
Check Configuration
CheckDialog.title
=
Check Configuration
CheckDialog.schematronFiles
=
Schematron Files
CheckDialog.schematronFiles
=
Schematron Files
CheckDialog.schematronChooserTitle
=
Choose schematron file..
CheckDialog.schematronChooserTitle
=
Choose schematron file..
...
@@ -53,5 +54,28 @@ MainWindow.showLabel=Show:
...
@@ -53,5 +54,28 @@ MainWindow.showLabel=Show:
MainWindow.searchLabel
=
Search:
MainWindow.searchLabel
=
Search:
MainWindow.searchBtn
=
Search
MainWindow.searchBtn
=
Search
MainWindow.clearBtn
=
Clear
MainWindow.clearBtn
=
Clear
MainWindow.errorsTab
=
Errors
MainWindow.polygonsTab
=
Polygons
MainWindow.edgesTab
=
Edges
MainWindow.verticesTab
=
Vertices
MainWindow.logTab
=
Log
MainWindow.globalErrorsTab
=
Global Errors
OpenFileDialog.fileLabel
=
File:
OpenFileDialog.fileLabel
=
File:
OpenFileDialog.selectBtn
=
Select
OpenFileDialog.selectBtn
=
Select
\ No newline at end of file
OpenFileDialog.loadBtn
=
Load
OpenFileDialog.settingsPane
=
Parser Preferences
OpenFileDialog.roundingPlacesLabel
=
NumberOfRoundingPlaces
OpenFileDialog.xmlValidationLabel
=
Use XML Validation
Checker.failXml
=
Failed to write XML Error Report.
Checker.failPdf
=
Failed to write PDF Report.
Checker.checksFinished
=
Finished executing checks
Checker.schematronValidation
=
Starting Schematron validation
Checker.finishedSchematron
=
Finished Schematron validation
Checker.failReports
=
Failed to write reports.
Checker.checkFeature
=
Checking feature: {}
Checker.executeCheck
=
Executing check: {}
ValidationConfiguration.reenable
=
{} has been disabled but {} depends on it, reenabling
ValidationConfiguration.missingSchematron
=
{} is not an existing file, disabling schematron check
CheckContainer.error
=
Unexpected exception while executing check: {}
Checks.missingCheck
=
Could not find check for id: {}
OpenFileDialog.cancelBtn
=
Cancel
\ No newline at end of file
CityDoctorParent/CityDoctorModel/src/main/resources/CityDoctorLocalization_de.properties
View file @
3610be70
DistanceError.distanceFromPlane
=
Abstand von der Ebene
DistanceError.distanceFromPlane
=
Abstand von der Ebene
AboutDialog.developedBy
=
Entwickelt von
AboutDialog.developedBy
=
Entwickelt von
AboutDialog.contact
=
Kontakt
AboutDialog.contact
=
Kontakt
AboutDialog.title
=
CityDoctor 3 - ber
AboutDialog.title
=
CityDoctor 3 -
\u
00DCber
CheckDialog.title
=
Prfungskonfiguration
AboutDialog.closeBtn
=
Schlie
\u
00DFen
CheckDialog.title
=
Pr
\u
00fcfungskonfiguration
CheckDialog.schematronFiles
=
Schematron Dateien
CheckDialog.schematronFiles
=
Schematron Dateien
CheckDialog.schematronChooserTitle
=
Whle Schematron Datei..
CheckDialog.schematronChooserTitle
=
W
\u
00e4
hle Schematron Datei..
CheckDialog.validationConfiguration
=
Validierungs Konfiguration
CheckDialog.validationConfiguration
=
Validierungs Konfiguration
CheckDialog.startingChecks
=
Starte Prfung
CheckDialog.startingChecks
=
Starte Pr
\u
00fc
fung
CheckDialog.checksDone
=
Prfung abgeschlossen
CheckDialog.checksDone
=
Pr
\u
00fc
fung abgeschlossen
CheckDialog.failedChecks
=
Konnte Prfungen nicht ausfhren
CheckDialog.failedChecks
=
Konnte Pr
\u
00fc
fungen nicht ausf
\u
00fc
hren
CheckDialog.schematronFileNotExisting
=
Schematron Datei existiert nicht, ignoriere
CheckDialog.schematronFileNotExisting
=
Schematron Datei existiert nicht, ignoriere
CheckDialog.checkEnabled
=
Aktiv
CheckDialog.checkEnabled
=
Aktiv
CheckDialog.parameterValue
=
Wert
CheckDialog.parameterValue
=
Wert
CheckDialog.parameterUnit
=
Einheit
CheckDialog.parameterUnit
=
Einheit
CityDoctorController.noDatamodel
=
Datenmodell ist null, keine Prfungen konnten ausgefhrt werden
CityDoctorController.noDatamodel
=
Datenmodell ist null, keine Pr
\u
00fc
fungen konnten ausgef
\u
00fc
hrt werden
CityDoctorController.noSourceFile
=
Quelldatei ist null, keine Prfungen konnten ausgefhrt werden
CityDoctorController.noSourceFile
=
Quelldatei ist null, keine Pr
\u
00fc
fungen konnten ausgef
\u
00fc
hrt werden
ExceptionDialog.stacktrace
=
Der Stacktrace des Fehlers war:
ExceptionDialog.stacktrace
=
Der Stacktrace des Fehlers war:
FilterPane.buildings
=
Gebude
FilterPane.buildings
=
Geb
\u
00e4
ude
FilterPane.bridges
=
Brcken
FilterPane.bridges
=
Br
\u
00fc
cken
FilterPane.landUse
=
Landnutzung
FilterPane.landUse
=
Landnutzung
FilterPane.transportation
=
Transport
FilterPane.transportation
=
Transport
FilterPane.vegetation
=
Vegetation
FilterPane.vegetation
=
Vegetation
FilterPane.water
=
Wasser
FilterPane.water
=
Wasser
MainToolBar.wireframe
=
Zeige/Verstecke Gitternetz
MainToolBar.wireframe
=
Zeige/Verstecke Gitternetz
MainToolBar.culling
=
Aktiviere/Deaktiviere Entfernen der Rckseiten
MainToolBar.culling
=
Aktiviere/Deaktiviere Entfernen der R
\u
00fc
ckseiten
MainToolBar.writeReports
=
Schreibe Reports
MainToolBar.writeReports
=
Schreibe Reports
MainToolBar.executeChecks
=
F
hre Pr
fungen aus
MainToolBar.executeChecks
=
F
\u
00fchre Pr
\u
00fc
fungen aus
MainWindow.missingConfig
=
Konnte Konfigurationsdatei nicht finden.
MainWindow.missingConfig
=
Konnte Konfigurationsdatei nicht finden.
MainWindow.loadGivenFile
=
Lade vorhandene Datei, bitte warten
MainWindow.loadGivenFile
=
Lade vorhandene Datei, bitte warten
MainWindow.finishedLoading
=
Fertig geladen
MainWindow.finishedLoading
=
Fertig geladen
MainWindow.checking
=
Prfe, bitte warten
MainWindow.checking
=
Pr
\u
00fc
fe, bitte warten
MainWindow.writeXml
=
Schreibe Xml Report
MainWindow.writeXml
=
Schreibe Xml Report
MainWindow.finishedXml
=
Xml Report abgeschlossen
MainWindow.finishedXml
=
Xml Report abgeschlossen
MainWindow.writePdf
=
Schreibe Pdf Report
MainWindow.writePdf
=
Schreibe Pdf Report
...
@@ -38,18 +39,41 @@ MainWindow.loadFailed=Konnte GML-Datei nicht laden: {}
...
@@ -38,18 +39,41 @@ MainWindow.loadFailed=Konnte GML-Datei nicht laden: {}
MainWindow.all
=
Alle
MainWindow.all
=
Alle
MainWindow.withErrors
=
Mit Fehlern
MainWindow.withErrors
=
Mit Fehlern
MainWindow.export
=
Exportieren
MainWindow.export
=
Exportieren
OpenFileDialog.select
=
Whle CityGML Datei aus
OpenFileDialog.select
=
W
\u
00e4
hle CityGML Datei aus
MainWindow.languageChange
=
Um die Spracheinstellung zu bernehmen muss CityDoctor2 neugestartet werden.
MainWindow.languageChange
=
Um die Spracheinstellung zu
\u
00fc
bernehmen muss CityDoctor2 neugestartet werden.
MainWindow.buildingsTab
=
Gebude
MainWindow.buildingsTab
=
Geb
\u
00e4
ude
MainWindow.vegetationTab
=
Vegetation
MainWindow.vegetationTab
=
Vegetation
MainWindow.transportationTab
=
Verkehrsobjekte
MainWindow.transportationTab
=
Verkehrsobjekte
MainWindow.bridgeTab
=
Brcken
MainWindow.bridgeTab
=
Br
\u
00fc
cken
MainWindow.waterTab
=
Gewsser
MainWindow.waterTab
=
Gew
\u
00e4
sser
MainWindow.terrainTab
=
Gelnde
MainWindow.terrainTab
=
Gel
\u
00e4
nde
MainWindow.viewLabel
=
Ansicht
MainWindow.viewLabel
=
Ansicht
MainWindow.showLabel
=
Zeige:
MainWindow.showLabel
=
Zeige:
MainWindow.searchLabel
=
Suche:
MainWindow.searchLabel
=
Suche:
MainWindow.searchBtn
=
Suche
MainWindow.searchBtn
=
Suche
MainWindow.clearBtn
=
Leeren
MainWindow.clearBtn
=
Leeren
MainWindow.errorsTab
=
Fehler
MainWindow.polygonsTab
=
Polygone
MainWindow.edgesTab
=
Kanten
MainWindow.verticesTab
=
Punkte
MainWindow.logTab
=
Log
MainWindow.globalErrorsTab
=
Globale Fehler
OpenFileDialog.fileLabel
=
Datei:
OpenFileDialog.fileLabel
=
Datei:
OpenFileDialog.selectBtn
=
Auswhlen
OpenFileDialog.selectBtn
=
Ausw
\u
00e4hlen
\ No newline at end of file
OpenFileDialog.loadBtn
=
Laden
OpenFileDialog.settingsPane
=
Parser Einstellungen
OpenFileDialog.roundingPlacesLabel
=
NumberOfRoundingPlaces
OpenFileDialog.xmlValidationLabel
=
F
\u
00fchre XML-Validierung aus
Checker.failXml
=
Konnte XML Fehlerbericht nicht schreiben.
Checker.failPdf
=
Konnte PDF Fehlerbericht nicht schreiben.
Checker.checksFinished
=
Pr
\u
00fcfungen beendet
Checker.schematronValidation
=
Starte Schematron Pr
\u
00fcfung
Checker.finishedSchematron
=
Schematron Pr
\u
00fcfung abgeschlossen
Checker.failReports
=
Konnte Pr
\u
00fcfberichte nicht schreiben.
Checker.checkFeature
=
Pr
\u
00fcfe Feature: {}
Checker.executeCheck
=
F
\u
00fchre Pr
\u
00fcfung aus: {}
ValidationConfiguration.reenable
=
{} ist deaktiviert wird aber von {} ben
\u
00f6tigt, reaktiviere
ValidationConfiguration.missingSchematron
=
{} existiert nicht, deaktiviere Schematron Pr
\u
00fcfung
CheckContainer.error
=
Unerwarteter Fehler bei der Ausf
\u
00fchrung von Pr
\u
00fcfung: {}
Checks.missingCheck
=
Konnte keine Pr
\u
00fcfung f
\u
00fcr id {} finden
OpenFileDialog.cancelBtn
=
Abbrechen
\ No newline at end of file
CityDoctorParent/CityDoctorValidation/src/main/java/de/hft/stuttgart/citydoctor2/check/Checker.java
View file @
3610be70
...
@@ -27,9 +27,11 @@ import java.util.ArrayList;
...
@@ -27,9 +27,11 @@ import java.util.ArrayList;
import
java.util.Collections
;
import
java.util.Collections
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.HashSet
;
import
java.util.HashSet
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Map.Entry
;
import
java.util.Map.Entry
;
import
java.util.Set
;
import
java.util.stream.Stream
;
import
java.util.stream.Stream
;
import
javax.xml.XMLConstants
;
import
javax.xml.XMLConstants
;
...
@@ -47,7 +49,7 @@ import org.w3c.dom.Document;
...
@@ -47,7 +49,7 @@ import org.w3c.dom.Document;
import
de.hft.stuttgart.citydoctor2.check.error.SchematronError
;
import
de.hft.stuttgart.citydoctor2.check.error.SchematronError
;
import
de.hft.stuttgart.citydoctor2.checkresult.utility.CheckReportWriteException
;
import
de.hft.stuttgart.citydoctor2.checkresult.utility.CheckReportWriteException
;
import
de.hft.stuttgart.citydoctor2.checks.Check
Container
;
import
de.hft.stuttgart.citydoctor2.checks.Check
Prototype
;
import
de.hft.stuttgart.citydoctor2.checks.Checks
;
import
de.hft.stuttgart.citydoctor2.checks.Checks
;
import
de.hft.stuttgart.citydoctor2.checks.SvrlContentHandler
;
import
de.hft.stuttgart.citydoctor2.checks.SvrlContentHandler
;
import
de.hft.stuttgart.citydoctor2.checks.util.FeatureCheckedListener
;
import
de.hft.stuttgart.citydoctor2.checks.util.FeatureCheckedListener
;
...
@@ -65,6 +67,7 @@ import de.hft.stuttgart.citydoctor2.reporting.XmlStreamReporter;
...
@@ -65,6 +67,7 @@ import de.hft.stuttgart.citydoctor2.reporting.XmlStreamReporter;
import
de.hft.stuttgart.citydoctor2.reporting.XmlValidationReporter
;
import
de.hft.stuttgart.citydoctor2.reporting.XmlValidationReporter
;
import
de.hft.stuttgart.citydoctor2.reporting.pdf.PdfReporter
;
import
de.hft.stuttgart.citydoctor2.reporting.pdf.PdfReporter
;
import
de.hft.stuttgart.citydoctor2.reporting.pdf.PdfStreamReporter
;
import
de.hft.stuttgart.citydoctor2.reporting.pdf.PdfStreamReporter
;
import
de.hft.stuttgart.citydoctor2.utils.Localization
;
import
net.sf.saxon.s9api.DOMDestination
;
import
net.sf.saxon.s9api.DOMDestination
;
import
net.sf.saxon.s9api.Destination
;
import
net.sf.saxon.s9api.Destination
;
import
net.sf.saxon.s9api.Processor
;
import
net.sf.saxon.s9api.Processor
;
...
@@ -133,7 +136,7 @@ public class Checker {
...
@@ -133,7 +136,7 @@ public class Checker {
try
(
BufferedOutputStream
bos
=
new
BufferedOutputStream
(
new
FileOutputStream
(
xmlFile
.
getAbsolutePath
())))
{
try
(
BufferedOutputStream
bos
=
new
BufferedOutputStream
(
new
FileOutputStream
(
xmlFile
.
getAbsolutePath
())))
{
reporter
.
writeReport
(
checkConfig
,
bos
,
model
,
config
);
reporter
.
writeReport
(
checkConfig
,
bos
,
model
,
config
);
}
catch
(
CheckReportWriteException
|
IOException
e
)
{
}
catch
(
CheckReportWriteException
|
IOException
e
)
{
logger
.
error
(
"Failed to write XML Error Report."
,
e
);
logger
.
error
(
Localization
.
getText
(
"Checker.failXml"
)
,
e
);
}
}
}
}
...
@@ -149,7 +152,7 @@ public class Checker {
...
@@ -149,7 +152,7 @@ public class Checker {
try
(
BufferedOutputStream
bos
=
new
BufferedOutputStream
(
new
FileOutputStream
(
pdfFile
.
getAbsolutePath
())))
{
try
(
BufferedOutputStream
bos
=
new
BufferedOutputStream
(
new
FileOutputStream
(
pdfFile
.
getAbsolutePath
())))
{
reporter
.
writeReport
(
checkConfig
,
bos
,
model
,
config
);
reporter
.
writeReport
(
checkConfig
,
bos
,
model
,
config
);
}
catch
(
IOException
|
CheckReportWriteException
e
)
{
}
catch
(
IOException
|
CheckReportWriteException
e
)
{
logger
.
error
(
"Failed to write PDF Report."
,
e
);
logger
.
error
(
Localization
.
getText
(
"Checker.failPdf"
)
,
e
);
}
}
}
}
...
@@ -179,7 +182,7 @@ public class Checker {
...
@@ -179,7 +182,7 @@ public class Checker {
config
=
ValidationConfiguration
.
loadStandardValidationConfig
();
config
=
ValidationConfiguration
.
loadStandardValidationConfig
();
}
}
checkCityModel
(
model
,
l
);
checkCityModel
(
model
,
l
);
logger
.
info
(
"Finished executing checks"
);
logger
.
info
(
Localization
.
getText
(
"Checker.checksFinished"
)
);
SvrlContentHandler
handler
=
executeSchematronValidationIfAvailable
(
config
,
model
.
getFile
());
SvrlContentHandler
handler
=
executeSchematronValidationIfAvailable
(
config
,
model
.
getFile
());
if
(
handler
!=
null
)
{
if
(
handler
!=
null
)
{
model
.
addGlobalErrors
(
handler
.
getGeneralErrors
());
model
.
addGlobalErrors
(
handler
.
getGeneralErrors
());
...
@@ -210,7 +213,7 @@ public class Checker {
...
@@ -210,7 +213,7 @@ public class Checker {
private
static
SvrlContentHandler
executeSchematronValidationIfAvailable
(
ValidationConfiguration
config
,
private
static
SvrlContentHandler
executeSchematronValidationIfAvailable
(
ValidationConfiguration
config
,
File
file
)
{
File
file
)
{
if
(
config
.
getSchematronFilePath
()
!=
null
&&
!
config
.
getSchematronFilePath
().
isEmpty
())
{
if
(
config
.
getSchematronFilePath
()
!=
null
&&
!
config
.
getSchematronFilePath
().
isEmpty
())
{
logger
.
info
(
"Starting S
chematron
v
alidation"
);
logger
.
info
(
Localization
.
getText
(
"Checker.s
chematron
V
alidation"
)
)
;
Processor
processor
=
new
Processor
(
false
);
Processor
processor
=
new
Processor
(
false
);
XsltCompiler
xsltCompiler
=
processor
.
newXsltCompiler
();
XsltCompiler
xsltCompiler
=
processor
.
newXsltCompiler
();
xsltCompiler
.
setURIResolver
(
new
URIResolver
()
{
xsltCompiler
.
setURIResolver
(
new
URIResolver
()
{
...
@@ -252,7 +255,7 @@ public class Checker {
...
@@ -252,7 +255,7 @@ public class Checker {
Destination
dest
=
new
SAXDestination
(
handler
);
Destination
dest
=
new
SAXDestination
(
handler
);
schematronTransformer
.
setDestination
(
dest
);
schematronTransformer
.
setDestination
(
dest
);
schematronTransformer
.
transform
();
schematronTransformer
.
transform
();
logger
.
info
(
"F
inished
Schematron
validation
"
);
logger
.
info
(
Localization
.
getText
(
"Checker.f
inishedSchematron"
)
);
return
handler
;
return
handler
;
}
catch
(
SaxonApiException
|
ParserConfigurationException
e
)
{
}
catch
(
SaxonApiException
|
ParserConfigurationException
e
)
{
logger
.
catching
(
e
);
logger
.
catching
(
e
);
...
@@ -329,7 +332,6 @@ public class Checker {
...
@@ -329,7 +332,6 @@ public class Checker {
ParserConfiguration
parserConfig
=
config
.
getParserConfiguration
();
ParserConfiguration
parserConfig
=
config
.
getParserConfiguration
();
List
<
Check
>
checks
=
collectEnabledChecksAndInit
(
parserConfig
,
config
);
List
<
Check
>
checks
=
collectEnabledChecksAndInit
(
parserConfig
,
config
);
execLayers
=
buildExecutionLayers
(
checks
);
execLayers
=
buildExecutionLayers
(
checks
);
// model has not been validated against the new configuration
}
}
private
List
<
Check
>
collectEnabledChecksAndInit
(
ParserConfiguration
parserConfig
,
ValidationConfiguration
config
)
{
private
List
<
Check
>
collectEnabledChecksAndInit
(
ParserConfiguration
parserConfig
,
ValidationConfiguration
config
)
{
...
@@ -409,46 +411,56 @@ public class Checker {
...
@@ -409,46 +411,56 @@ public class Checker {
public
void
executeChecksForCheckable
(
Checkable
co
)
{
public
void
executeChecksForCheckable
(
Checkable
co
)
{
// throw away old results
// throw away old results
co
.
clearAllContainedCheckResults
();
co
.
clearAllContainedCheckResults
();
logger
.
debug
(
"Checking feature: {}"
,
co
);
if
(
logger
.
isDebugEnabled
())
{
logger
.
debug
(
Localization
.
getText
(
"Checker.checkFeature"
),
co
);
}
for
(
int
i
=
0
;
i
<
execLayers
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
execLayers
.
size
();
i
++)
{
for
(
Check
check
:
execLayers
.
get
(
i
))
{
for
(
Check
check
:
execLayers
.
get
(
i
))
{
logger
.
trace
(
"Executing check: {}"
,
check
.
getCheckId
());
if
(
logger
.
isTraceEnabled
())
{
logger
.
trace
(
Localization
.
getText
(
"Checker.executeCheck"
),
check
.
getCheckId
());
}
co
.
accept
(
check
);
co
.
accept
(
check
);
}
}
}
}
}
}
p
rivate
List
<
List
<
Check
>>
buildExecutionLayers
(
List
<
Check
>
checks
)
{
p
ublic
static
List
<
List
<
Check
>>
buildExecutionLayers
(
List
<
Check
>
checks
)
{
List
<
List
<
Check
>>
result
=
new
ArrayList
<>();
List
<
List
<
Check
>>
result
=
new
ArrayList
<>();
for
(
Check
c
:
checks
)
{
int
layer
=
getLayerDepthForCheck
(
c
);
Set
<
Check
>
availableChecks
=
new
HashSet
<>(
checks
);
while
(
layer
>=
result
.
size
())
{
Set
<
CheckId
>
usedChecks
=
new
HashSet
<>();
result
.
add
(
new
ArrayList
<
Check
>());
while
(!
availableChecks
.
isEmpty
())
{
List
<
Check
>
layer
=
new
ArrayList
<>();
Iterator
<
Check
>
iterator
=
availableChecks
.
iterator
();
while
(
iterator
.
hasNext
())
{
Check
c
=
iterator
.
next
();
boolean
hasUnusedDependency
=
searchForUnusedDependency
(
usedChecks
,
c
);
if
(!
hasUnusedDependency
)
{
iterator
.
remove
();
layer
.
add
(
c
);
}
}
if
(
layer
.
isEmpty
())
{
throw
new
IllegalStateException
(
"There are checks that have dependencies that are not executed or are unknown"
);
}
result
.
add
(
layer
);
for
(
Check
c
:
layer
)
{
usedChecks
.
add
(
c
.
getCheckId
());
}
}
List
<
Check
>
checkLayer
=
result
.
get
(
layer
);
checkLayer
.
add
(
new
CheckContainer
(
c
));
}
}
return
result
;
return
result
;
}
}
private
int
getLayerDepthForCheck
(
Check
c
)
{
private
static
boolean
searchForUnusedDependency
(
Set
<
CheckId
>
usedChecks
,
Check
c
)
{
if
(
c
.
getDependencies
().
isEmpty
())
{
boolean
hasUnusedDependency
=
false
;
return
0
;
for
(
CheckId
id
:
c
.
getDependencies
())
{
}
if
(!
usedChecks
.
contains
(
id
))
{
HashSet
<
CheckId
>
checkedChecks
=
new
HashSet
<>();
hasUnusedDependency
=
true
;
return
getLayerDepthForCheck
(
c
,
checkedChecks
);
break
;
}
}
private
int
getLayerDepthForCheck
(
Check
c
,
HashSet
<
CheckId
>
checkedChecks
)
{
checkedChecks
.
add
(
c
.
getCheckId
());
if
(
c
.
getDependencies
().
isEmpty
())
{
return
0
;
}
int
maxDepth
=
0
;
for
(
CheckId
dependency
:
c
.
getDependencies
())
{
maxDepth
=
Math
.
max
(
maxDepth
,
getLayerDepthForCheck
(
checkConfig
.
getCheckForId
(
dependency
),
checkedChecks
));
}
}
return
maxDepth
+
1
;
return
hasUnusedDependency
;
}
}
public
static
void
streamCheck
(
FeatureStream
stream
,
String
xmlOutput
,
String
pdfOutput
,
public
static
void
streamCheck
(
FeatureStream
stream
,
String
xmlOutput
,
String
pdfOutput
,
...
@@ -481,7 +493,7 @@ public class Checker {
...
@@ -481,7 +493,7 @@ public class Checker {
writeReport
(
xmlReporter
,
handler
);
writeReport
(
xmlReporter
,
handler
);
writeReport
(
pdfReporter
,
handler
);
writeReport
(
pdfReporter
,
handler
);