Skip to content
Snippets Groups Projects
Commit fa3050c3 authored by Robert Butora's avatar Robert Butora
Browse files

votable: adds datacubeCount as PARAM metadata to the table

parent ed302e3a
No related branches found
No related tags found
No related merge requests found
...@@ -19,34 +19,22 @@ public final class XmlSerializer ...@@ -19,34 +19,22 @@ public final class XmlSerializer
private XmlSerializer() {} // disables instatiation private XmlSerializer() {} // disables instatiation
public static void serializeToVoTable(PrintWriter writer, String charEncoding, SearchOutputData searchOutputData, 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>"); // writer.println("<DatacubeCount> " + searchOutputData.datacubeCount + " </DatacubeCount>");
StarTable dstable = makeSearchResultsTable( searchOutputData.subsurveyArr ); 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}; StarTable[] tables = {dstable};
try
{
writeTables(writer, tables);
}
catch(IOException ex)
{
;// FIXME System.out.println( ex.getMessage() );
}
} BufferedWriter out = new BufferedWriter( writer );
private static void writeTables(PrintWriter writer, StarTable[] tables ) throws IOException
{
BufferedWriter out = new BufferedWriter( writer /*new OutputStreamWriter( System.out )*/ );
out.write( "<VOTABLE version='1.1'>\n" ); out.write( "<VOTABLE version='1.1'>\n" );
out.write( "<RESOURCE>\n" ); out.write( "<RESOURCE>\n" );
out.write( "<DESCRIPTION>Some tables</DESCRIPTION>\n" ); out.write( "<DESCRIPTION> " + searchOutputData.versionString + " </DESCRIPTION>\n" );
for ( int i = 0; i < tables.length; i++ ) { for ( int i = 0; i < tables.length; i++ )
VOSerializer.makeSerializer( DataFormat.TABLEDATA, tables[ i ] ) {
.writeInlineTableElement( out ); VOSerializer.makeSerializer( DataFormat.TABLEDATA, tables[ i ] ).writeInlineTableElement( out );
} }
out.write( "</RESOURCE>\n" ); out.write( "</RESOURCE>\n" );
out.write( "</VOTABLE>\n" ); out.write( "</VOTABLE>\n" );
......
...@@ -123,7 +123,7 @@ public class FormatResponseFilter implements Filter ...@@ -123,7 +123,7 @@ public class FormatResponseFilter implements Filter
} }
else if(respFormat.equals("application/x-votable+xml")) else if(respFormat.equals("application/x-votable+xml"))
{ {
response.setContentType(respFormat); response.setContentType("application/xml");//respFormat);
boolean showDuration = false; boolean showDuration = false;
XmlSerializer.serializeToVoTable(responseWriter, RESPONSE_ENCODING, searchOutputData,showDuration,startTime_msec); XmlSerializer.serializeToVoTable(responseWriter, RESPONSE_ENCODING, searchOutputData,showDuration,startTime_msec);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment