Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CityDoctor
CityDoctor2
Commits
be520dc3
Commit
be520dc3
authored
1 month ago
by
Riegel
Browse files
Options
Download
Email Patches
Plain Diff
Feat: Implement ZIP stream check in GUI
parent
2494bd64
master
dev
dev_gui_features_zip_loading
archive/dev_gui_features_zip_loading
2 merge requests
!28
Version 3.17.0 Release
,
!26
Add ZIP-archive support
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
CityDoctorParent/CityDoctorValidation/src/main/java/de/hft/stuttgart/citydoctor2/check/Checker.java
+18
-3
...main/java/de/hft/stuttgart/citydoctor2/check/Checker.java
CityDoctorParent/CityDoctorValidation/src/test/java/de/hft/stuttgart/citydoctor2/check/CheckerTest.java
+11
-0
.../java/de/hft/stuttgart/citydoctor2/check/CheckerTest.java
CityDoctorParent/Extensions/CityDoctorGUI/src/main/java/de/hft/stuttgart/citydoctor2/gui/CheckDialog.java
+1
-1
...in/java/de/hft/stuttgart/citydoctor2/gui/CheckDialog.java
CityDoctorParent/Extensions/CityDoctorGUI/src/main/java/de/hft/stuttgart/citydoctor2/gui/CityDoctorController.java
+12
-4
...e/hft/stuttgart/citydoctor2/gui/CityDoctorController.java
CityDoctorParent/Extensions/CityDoctorGUI/src/main/resources/de/hft/stuttgart/citydoctor2/gui/CheckDialog.fxml
+2
-1
...sources/de/hft/stuttgart/citydoctor2/gui/CheckDialog.fxml
with
44 additions
and
9 deletions
+44
-9
CityDoctorParent/CityDoctorValidation/src/main/java/de/hft/stuttgart/citydoctor2/check/Checker.java
+
18
-
3
View file @
be520dc3
...
...
@@ -57,6 +57,7 @@ import de.hft.stuttgart.quality.model.properties.RequirementProperty;
import
de.hft.stuttgart.quality.model.types.Checking
;
import
de.hft.stuttgart.quality.model.types.Parameter
;
import
de.hft.stuttgart.quality.model.types.ValidationPlan
;
import
org.apache.commons.io.FilenameUtils
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
...
...
@@ -78,6 +79,7 @@ import java.io.FileOutputStream;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.UncheckedIOException
;
import
java.nio.file.Path
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.HashMap
;
...
...
@@ -751,10 +753,23 @@ public class Checker {
for
(
CityGmlZipEntry
entry
:
archive
.
getEntries
())
{
String
xmlOutput
=
xmlDirectory
==
null
?
null
:
xmlDirectory
+
entry
.
getFullFileName
().
replaceFirst
(
"\\..+"
,
".xml"
);
String
pdfOutput
=
pdfDirectory
==
null
?
null
:
pdfDirectory
+
entry
.
getFullFileName
().
replaceFirst
(
"\\..+"
,
".pdf"
);
String
outputFile
=
outputDirectory
==
null
?
null
:
outputDirectory
+
entry
.
getFullFileName
();
String
entryName
=
FilenameUtils
.
removeExtension
(
entry
.
getDisplayName
());
String
xmlOutput
=
null
;
String
pdfOutput
=
null
;
String
outputFile
=
null
;
if
(
xmlDirectory
!=
null
)
{
xmlOutput
=
Path
.
of
(
xmlDirectory
).
resolve
(
entryName
+
"_report.xml"
).
toString
();
}
if
(
pdfDirectory
!=
null
)
{
pdfOutput
=
Path
.
of
(
pdfDirectory
).
resolve
(
entryName
+
"_report.pdf"
).
toString
();
}
if
(
outputDirectory
!=
null
)
{
outputFile
=
Path
.
of
(
outputDirectory
).
resolve
(
entryName
+
"_validated.gml"
).
toString
();
}
streamCheck
(
entry
,
xmlOutput
,
pdfOutput
,
config
,
l
,
outputFile
);
}
if
(
outputDirectory
!=
null
)
{
ArchivePacker
.
packAndDeleteDirectory
(
outputDirectory
);
...
...
This diff is collapsed.
Click to expand it.
CityDoctorParent/CityDoctorValidation/src/test/java/de/hft/stuttgart/citydoctor2/check/CheckerTest.java
+
11
-
0
View file @
be520dc3
...
...
@@ -175,7 +175,18 @@ public class CheckerTest {
for
(
CityGmlZipEntry
entry
:
cgmlArch
.
getEntries
())
{
Checker
.
streamCheck
(
entry
,
null
,
null
,
config
,
l
,
null
);
}
}
@Test
public
void
testZipArchiveChecking
()
throws
CityGmlParseException
,
IOException
{
CityGmlZipArchive
cgmlArch
=
CityGmlZipArchive
.
register
(
"src/test/resources/zipArchive.zip"
);
assertNotNull
(
cgmlArch
);
cgmlArch
.
mountArchive
(
new
ParserConfiguration
(
8
,
false
));
ValidationConfiguration
config
=
ValidationConfiguration
.
loadStandardValidationConfig
();
FeatureCheckedListener
l
=
co
->
{
assertTrue
(
co
.
isValidated
());
};
Checker
.
streamCheck
(
cgmlArch
,
null
,
null
,
config
,
l
,
null
);
}
}
This diff is collapsed.
Click to expand it.
CityDoctorParent/Extensions/CityDoctorGUI/src/main/java/de/hft/stuttgart/citydoctor2/gui/CheckDialog.java
+
1
-
1
View file @
be520dc3
...
...
@@ -500,7 +500,7 @@ public class CheckDialog {
return
;
}
outputPath
=
Path
.
of
(
outputPathTextField
.
getText
());
progress
.
setProgress
(
ProgressIndicator
.
INDETERMINATE_PROGRESS
);
Platform
.
runLater
(()
->
progress
.
setProgress
(
ProgressIndicator
.
INDETERMINATE_PROGRESS
)
)
;
}
controller
.
startZipFileChecks
(
config
,
progress:
:
setProgress
,
streamCheckOption
.
isSelected
(),
outputPath
,
pdfReportsOption
.
isSelected
(),
...
...
This diff is collapsed.
Click to expand it.
CityDoctorParent/Extensions/CityDoctorGUI/src/main/java/de/hft/stuttgart/citydoctor2/gui/CityDoctorController.java
+
12
-
4
View file @
be520dc3
...
...
@@ -31,10 +31,13 @@ import org.apache.logging.log4j.Logger;
import
org.citygml4j.core.model.core.CityModel
;
import
org.xml.sax.SAXParseException
;
import
java.awt.*
;
import
java.io.File
;
import
java.io.IOException
;
import
java.nio.file.Files
;
import
java.nio.file.Path
;
import
java.util.*
;
import
java.util.List
;
import
java.util.concurrent.atomic.AtomicInteger
;
import
java.util.function.Function
;
...
...
@@ -981,6 +984,7 @@ public class CityDoctorController {
String
filename
=
FilenameUtils
.
removeExtension
(
zipArchive
.
getArchivePath
().
getFileName
().
toString
());
filename
=
filename
+
"_validated"
;
outputZipDirectory
=
outputPath
.
resolve
(
filename
);
Files
.
createDirectories
(
outputZipDirectory
);
}
else
{
String
filename
=
FilenameUtils
.
removeExtension
(
outputPath
.
toAbsolutePath
().
getFileName
().
toString
());
outputZipDirectory
=
Path
.
of
(
filename
);
...
...
@@ -988,13 +992,17 @@ public class CityDoctorController {
String
xmlReportsDirectory
=
null
;
String
pdfReportsDirectory
=
null
;
if
(
pdfReports
)
{
pdfReportsDirectory
=
outputZipDirectory
.
resolve
(
"pdf_reports"
).
toAbsolutePath
().
toString
();
}
if
(
xmlReports
)
{
xmlReportsDirectory
=
outputZipDirectory
.
resolve
(
"xml_reports"
).
toAbsolutePath
().
toString
();
xmlReportsDirectory
=
Files
.
createDirectories
(
outputZipDirectory
.
resolve
(
"xml_reports/"
)).
toAbsolutePath
().
toString
();
}
if
(
pdfReports
)
{
pdfReportsDirectory
=
Files
.
createDirectories
(
outputZipDirectory
.
resolve
(
"pdf_reports/"
)).
toAbsolutePath
().
toString
();
}
Checker
.
streamCheck
(
zipArchive
,
xmlReportsDirectory
,
pdfReportsDirectory
,
valConfig
,
outputZipDirectory
.
toString
());
Desktop
desktop
=
Desktop
.
getDesktop
();
desktop
.
open
(
outputPath
.
toFile
());
}
catch
(
CityGmlParseException
e
)
{
throw
new
RuntimeException
(
e
);
}
catch
(
IOException
e
)
{
...
...
This diff is collapsed.
Click to expand it.
CityDoctorParent/Extensions/CityDoctorGUI/src/main/resources/de/hft/stuttgart/citydoctor2/gui/CheckDialog.fxml
+
2
-
1
View file @
be520dc3
...
...
@@ -75,7 +75,8 @@
</Label>
</children>
</HBox>
<VBox
fx:id=
"streamCheckParametersVBox"
prefHeight=
"200.0"
prefWidth=
"100.0"
>
<VBox
fx:id=
"streamCheckParametersVBox"
disable=
"true"
prefHeight=
"200.0"
prefWidth=
"100.0"
>
<children>
<Label
fx:id=
"outputPathLabel"
text=
"Output path:"
>
<font>
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets