120
120
import gov .nasa .pds .validate .report .XmlReport ;
121
121
import gov .nasa .pds .validate .util .ToolInfo ;
122
122
import gov .nasa .pds .validate .util .Utility ;
123
+ import jdk .internal .org .jline .utils .Log ;
123
124
124
125
/**
125
126
* Wrapper class for the Validate Tool. Class handles command-line parsing and querying, in addition
@@ -593,9 +594,9 @@ private String getSearchAfterFromDocument(Map<String, Object> document, String s
593
594
private void parseJsonObjectWriteTofile (List <Map <String , Object >> documents ,
594
595
String contextJsonFilePath ) {
595
596
final List <String > empty = Arrays .asList ("N/A" );
596
- final List <String > fieldNames = Arrays .asList ("pds:Airborne.pds" , "pds: Facility.pds" ,
597
+ final List <String > fieldNames = Arrays .asList ("pds:Facility.pds" ,
597
598
"pds:Instrument.pds" , "pds:Instrument_Host.pds" , "pds:Investigation.pds" ,
598
- "pds:Resource.pds" , "pds:Target.pds" );
599
+ "pds:Resource.pds" , "pds:Target.pds" , "pds:Telescope.pds" );
599
600
// backup old file
600
601
try {
601
602
if (registeredProductsFile .exists ()) {
@@ -617,29 +618,32 @@ private void parseJsonObjectWriteTofile(List<Map<String, Object>> documents,
617
618
Map <String , Object > properties = (Map <String , Object >) document .get ("properties" );
618
619
@ SuppressWarnings ("unchecked" )
619
620
String lidvid = ((List <String >) properties .get ("lidvid" )).get (0 );
621
+ @ SuppressWarnings ("unchecked" )
622
+ List <String > title = (List <String >) properties .get ("title" );
620
623
for (String fieldName : fieldNames ) {
621
- if (properties .containsKey (fieldName + ":name" )
622
- || properties .containsKey (fieldName + ":type" )) {
623
- @ SuppressWarnings ("unchecked" )
624
- List <Object > names = (List <Object >) properties .getOrDefault (fieldName + ":name" , empty );
625
- @ SuppressWarnings ("unchecked" )
626
- List <Object > types = (List <Object >) properties .getOrDefault (fieldName + ":type" , empty );
627
- jsonWriter .beginObject (); // start a product
628
- jsonWriter .name ("name" );
629
- jsonWriter .beginArray ();
630
- for (Object n : names ) {
631
- jsonWriter .value ((String ) n );
632
- }
633
- jsonWriter .endArray ();
634
- jsonWriter .name ("type" );
635
- jsonWriter .beginArray ();
636
- for (Object t : types ) {
637
- jsonWriter .value ((String ) t );
624
+ if (properties .containsKey (fieldName + ":name" )
625
+ || properties .containsKey (fieldName + ":type" )
626
+ || properties .containsKey (fieldName + ":aperture" )) {
627
+ @ SuppressWarnings ("unchecked" )
628
+ List <Object > names = (List <Object >) properties .getOrDefault (fieldName + ":name" , title );
629
+ @ SuppressWarnings ("unchecked" )
630
+ List <Object > types = (List <Object >) properties .getOrDefault (fieldName + ":type" , empty );
631
+ jsonWriter .beginObject (); // start a product
632
+ jsonWriter .name ("name" );
633
+ jsonWriter .beginArray ();
634
+ for (Object n : names ) {
635
+ jsonWriter .value ((String ) n );
636
+ }
637
+ jsonWriter .endArray ();
638
+ jsonWriter .name ("type" );
639
+ jsonWriter .beginArray ();
640
+ for (Object t : types ) {
641
+ jsonWriter .value ((String ) t );
642
+ }
643
+ jsonWriter .endArray ();
644
+ jsonWriter .name ("lidvid" ).value (lidvid );
645
+ jsonWriter .endObject (); // end a product
638
646
}
639
- jsonWriter .endArray ();
640
- jsonWriter .name ("lidvid" ).value (lidvid );
641
- jsonWriter .endObject (); // end a product
642
- }
643
647
}
644
648
}
645
649
jsonWriter .endArray ();
@@ -648,10 +652,6 @@ private void parseJsonObjectWriteTofile(List<Map<String, Object>> documents,
648
652
} catch (IOException e ) {
649
653
e .printStackTrace ();
650
654
}
651
-
652
- // System.out.println("New Registered Products File: " +
653
- // registeredProductsFile);
654
-
655
655
}
656
656
657
657
private void copyFile (File source , File dest ) throws IOException {
0 commit comments