namhnguyen / asterixdb

Automatically exported from code.google.com/p/asterixdb
0 stars 0 forks source link

Separate HTML output for web interface from servlet code #822

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Currently the main query-processing entry point accepts an 
APIFramework.OutputFormat to determine what kind of output to produce: ADM, 
JSON, or CSV. It can also support HTML, but this is strictly for the use of the 
web interface; the actual output is ADM, with some HTML wrappers.

There is other code throughout APIFramework that handles extra output such as 
the logical plan, rewritten expressions, and so on (via flags in the 
SessionConfig object). Those only make sense if the OutputFormat is HTML, in 
which case they are wrapped in <pre> blocks which the web interface's CSS 
formats nicely. If you select any of this extra output with any other output 
format, the output will be invalid.

It should be possible to get this additional output "out of band", rather than 
streamed to the same PrintWriter. This would allow the HTML formatting to be 
relocated inside the web interface itself, where it belongs. It would also make 
it trivially possible for the web interface to display JSON or CSV in addition 
to ADM.

Original issue reported on code.google.com by c...@lambda.nu on 14 Nov 2014 at 10:02