Loading data-discovery/src/main/java/vlkb/output/XmlSerializer.java +7 −19 Original line number Diff line number Diff line Loading @@ -19,34 +19,22 @@ public final class XmlSerializer private XmlSerializer() {} // disables instatiation public static void serializeToVoTable(PrintWriter writer, String charEncoding, SearchOutputData searchOutputData, boolean showDuration, long startTime_msec) boolean showDuration, long startTime_msec) throws IOException { // writer.println("<msg> " + searchOutputData.versionString + " </msg>"); // writer.println("<DatacubeCount> " + searchOutputData.datacubeCount + " </DatacubeCount>"); StarTable dstable = makeSearchResultsTable( searchOutputData.subsurveyArr ); dstable.setParameter(new DescribedValue(new DefaultValueInfo( "datacubeCount", Integer.class, "Count of datacubes from VLKB-search" ), searchOutputData.datacubeCount ) ); StarTable[] tables = {dstable}; try { writeTables(writer, tables); } catch(IOException ex) { ;// FIXME System.out.println( ex.getMessage() ); } } private static void writeTables(PrintWriter writer, StarTable[] tables ) throws IOException { BufferedWriter out = new BufferedWriter( writer /*new OutputStreamWriter( System.out )*/ ); BufferedWriter out = new BufferedWriter( writer ); out.write( "<VOTABLE version='1.1'>\n" ); out.write( "<RESOURCE>\n" ); out.write( "<DESCRIPTION>Some tables</DESCRIPTION>\n" ); for ( int i = 0; i < tables.length; i++ ) { VOSerializer.makeSerializer( DataFormat.TABLEDATA, tables[ i ] ) .writeInlineTableElement( out ); out.write( "<DESCRIPTION> " + searchOutputData.versionString + " </DESCRIPTION>\n" ); for ( int i = 0; i < tables.length; i++ ) { VOSerializer.makeSerializer( DataFormat.TABLEDATA, tables[ i ] ).writeInlineTableElement( out ); } out.write( "</RESOURCE>\n" ); out.write( "</VOTABLE>\n" ); Loading data-discovery/src/main/java/vlkb/webapi/FormatResponseFilter.java +1 −1 Original line number Diff line number Diff line Loading @@ -123,7 +123,7 @@ public class FormatResponseFilter implements Filter } else if(respFormat.equals("application/x-votable+xml")) { response.setContentType(respFormat); response.setContentType("application/xml");//respFormat); boolean showDuration = false; XmlSerializer.serializeToVoTable(responseWriter, RESPONSE_ENCODING, searchOutputData,showDuration,startTime_msec); } Loading Loading
data-discovery/src/main/java/vlkb/output/XmlSerializer.java +7 −19 Original line number Diff line number Diff line Loading @@ -19,34 +19,22 @@ public final class XmlSerializer private XmlSerializer() {} // disables instatiation public static void serializeToVoTable(PrintWriter writer, String charEncoding, SearchOutputData searchOutputData, boolean showDuration, long startTime_msec) boolean showDuration, long startTime_msec) throws IOException { // writer.println("<msg> " + searchOutputData.versionString + " </msg>"); // writer.println("<DatacubeCount> " + searchOutputData.datacubeCount + " </DatacubeCount>"); StarTable dstable = makeSearchResultsTable( searchOutputData.subsurveyArr ); dstable.setParameter(new DescribedValue(new DefaultValueInfo( "datacubeCount", Integer.class, "Count of datacubes from VLKB-search" ), searchOutputData.datacubeCount ) ); StarTable[] tables = {dstable}; try { writeTables(writer, tables); } catch(IOException ex) { ;// FIXME System.out.println( ex.getMessage() ); } } private static void writeTables(PrintWriter writer, StarTable[] tables ) throws IOException { BufferedWriter out = new BufferedWriter( writer /*new OutputStreamWriter( System.out )*/ ); BufferedWriter out = new BufferedWriter( writer ); out.write( "<VOTABLE version='1.1'>\n" ); out.write( "<RESOURCE>\n" ); out.write( "<DESCRIPTION>Some tables</DESCRIPTION>\n" ); for ( int i = 0; i < tables.length; i++ ) { VOSerializer.makeSerializer( DataFormat.TABLEDATA, tables[ i ] ) .writeInlineTableElement( out ); out.write( "<DESCRIPTION> " + searchOutputData.versionString + " </DESCRIPTION>\n" ); for ( int i = 0; i < tables.length; i++ ) { VOSerializer.makeSerializer( DataFormat.TABLEDATA, tables[ i ] ).writeInlineTableElement( out ); } out.write( "</RESOURCE>\n" ); out.write( "</VOTABLE>\n" ); Loading
data-discovery/src/main/java/vlkb/webapi/FormatResponseFilter.java +1 −1 Original line number Diff line number Diff line Loading @@ -123,7 +123,7 @@ public class FormatResponseFilter implements Filter } else if(respFormat.equals("application/x-votable+xml")) { response.setContentType(respFormat); response.setContentType("application/xml");//respFormat); boolean showDuration = false; XmlSerializer.serializeToVoTable(responseWriter, RESPONSE_ENCODING, searchOutputData,showDuration,startTime_msec); } Loading