Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
vlkb-siav2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ViaLactea
vlkb-siav2
Commits
d9d55530
Commit
d9d55530
authored
Apr 19, 2024
by
Robert Butora
Browse files
Options
Downloads
Patches
Plain Diff
simplifies algorithm output VoTable bySurveys
parent
aa7a24a3
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
data-discovery/src/main/java/vlkb/output/XmlSerializer.java
+39
-63
39 additions, 63 deletions
data-discovery/src/main/java/vlkb/output/XmlSerializer.java
with
39 additions
and
63 deletions
data-discovery/src/main/java/vlkb/output/XmlSerializer.java
+
39
−
63
View file @
d9d55530
...
...
@@ -148,61 +148,46 @@ final class XmlSerializer
out
.
write
(
"<VOTABLE version='1.1'>"
);
out
.
write
(
"<DESCRIPTION> "
+
searchOutputData
.
versionString
+
"
SUBSURVCOUNT
: "
+
searchOutputData
.
subsurveyArr
.
length
+
" </DESCRIPTION>"
);
"
subsurvey count
: "
+
searchOutputData
.
subsurveyArr
.
length
+
" </DESCRIPTION>"
);
if
((
searchOutputData
.
subsurveyArr
!=
null
)
&&
(
searchOutputData
.
subsurveyArr
.
length
>
0
))
{
Subsurvey
[]
subsurv
=
searchOutputData
.
subsurveyArr
;
// assumes ORDERED subsurveyArray: by surveyname
List
<
StarTable
>
tableList
=
new
ArrayList
();
String
prevSurveyname
=
searchOutputData
.
subsurveyArr
[
0
].
surveyname
.
trim
();
for
(
Subsurvey
subsurvey
:
searchOutputData
.
subsurveyArr
)
String
prevSurveyname
;
// = subsurv[0].surveyname.trim();
int
ix
=
0
;
do
{
prevSurveyname
=
subsurv
[
ix
].
surveyname
.
trim
();
if
(
prevSurveyname
.
equals
(
subsurvey
.
surveyname
.
trim
()))
do
{
StarTable
table
=
makeSubsurveyTable
(
subsurv
ey
);
StarTable
table
=
makeSubsurveyTable
(
subsurv
[
ix
]
);
tableList
.
add
(
table
);
ix
++;
}
else
{
out
.
write
(
"<RESOURCE>"
);
out
.
write
(
"<DESCRIPTION> "
+
prevSurveyname
+
" </DESCRIPTION>"
);
/* PLACEHOLDER FOR RESOURCE PARAM
table.setParameter(new DescribedValue(
new DefaultValueInfo("subsurveyCount",Integer.class,
"Count of subsurveys with found datacube(s)" ),
subsurveyArr.length ) );
table.setParameter(new DescribedValue(
new DefaultValueInfo( "survey", String.class,
"Survey name" ),
subsurvey.surveyname ) );
*/
while
((
ix
<
subsurv
.
length
)
&&
prevSurveyname
.
equals
(
subsurv
[
ix
].
surveyname
.
trim
()));
StarTable
[]
tables
=
tableList
.
toArray
(
new
StarTable
[
0
]);
for
(
int
i
=
0
;
i
<
tables
.
length
;
i
++
)
{
VOSerializer
.
makeSerializer
(
DataFormat
.
TABLEDATA
,
tables
[
i
]
).
writeInlineTableElement
(
out
);
}
writeResourceSurvey
(
out
,
prevSurveyname
,
tables
);
tableList
.
clear
();
out
.
write
(
"</RESOURCE>"
);
prevSurveyname
=
subsurvey
.
surveyname
.
trim
();
StarTable
table
=
makeSubsurveyTable
(
subsurvey
);
tableList
.
add
(
table
);
}
while
(
ix
<
subsurv
.
length
);
}
out
.
write
(
"</VOTABLE>"
);
out
.
flush
();
}
if
(!
tableList
.
isEmpty
())
private
static
void
writeResourceSurvey
(
BufferedWriter
out
,
String
description
,
StarTable
[]
tables
)
throws
IOException
{
out
.
write
(
"<RESOURCE>"
);
out
.
write
(
"<DESCRIPTION> "
+
prevSurveyname
+
" </DESCRIPTION>"
);
out
.
write
(
"<DESCRIPTION> "
+
description
+
" </DESCRIPTION>"
);
/* PLACEHOLDER FOR RESOURCE PARAM
...
...
@@ -217,23 +202,14 @@ final class XmlSerializer
subsurvey.surveyname ) );
*/
StarTable
[]
tables
=
tableList
.
toArray
(
new
StarTable
[
0
]);
for
(
int
i
=
0
;
i
<
tables
.
length
;
i
++
)
{
VOSerializer
.
makeSerializer
(
DataFormat
.
TABLEDATA
,
tables
[
i
]
).
writeInlineTableElement
(
out
);
}
tableList
.
clear
();
out
.
write
(
"</RESOURCE>"
);
}
}
out
.
write
(
"</VOTABLE>"
);
out
.
flush
();
}
private
static
StarTable
makeSubsurveyTable
(
Subsurvey
subsurvey
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
sign in
to comment