Several CSV, API, HTTP API, and Web interface improvements.

- APIFramework: internal refactoring to consolidate output PrintWriter,
  OutputFormat, and all output flags into SessionConfig
- APIFramework: "HTML" is now a flag, rather than an OutputFormat
- HTTP API: Output format can be select via query parameter in
  addition to HTTP Accept header
- CSV: default output is now without header, to improve roundtripping
- CSV: header can be requested via Accept header or "header" query
  parameter
- Web interface: Added ability to select output format (JSON, CSV or ADM)

Change-Id: I91398bd30dbd6f3b1f69eb51fbf201010d0e5d93
Reviewed-on: http://fulliautomatix.ics.uci.edu:8443/242
Reviewed-by: Chris Hillery <ceej@lambda.nu>
Tested-by: Chris Hillery <ceej@lambda.nu>
diff --git a/asterix-test-framework/src/main/java/edu/uci/ics/asterix/testframework/context/TestCaseContext.java b/asterix-test-framework/src/main/java/edu/uci/ics/asterix/testframework/context/TestCaseContext.java
index 7589909..6488c95 100644
--- a/asterix-test-framework/src/main/java/edu/uci/ics/asterix/testframework/context/TestCaseContext.java
+++ b/asterix-test-framework/src/main/java/edu/uci/ics/asterix/testframework/context/TestCaseContext.java
@@ -36,7 +36,8 @@
         NONE  ("", ""),
         ADM   ("adm", "application/x-adm"),
         JSON  ("json", "application/json"),
-        CSV   ("csv", "text/csv");
+        CSV   ("csv", "text/csv"),
+        CSV_HEADER ("csv-header", "text/csv; header=present");
 
         private final String extension;
         private final String mimetype;
@@ -62,6 +63,8 @@
                 return OutputFormat.JSON;
             case CSV:
                 return OutputFormat.CSV;
+            case CSV_HEADER:
+                return OutputFormat.CSV_HEADER;
             case INSPECT:
             case IGNORE:
                 return OutputFormat.NONE;
diff --git a/asterix-test-framework/src/main/resources/Catalog.xsd b/asterix-test-framework/src/main/resources/Catalog.xsd
index a33399c..e43acdc 100644
--- a/asterix-test-framework/src/main/resources/Catalog.xsd
+++ b/asterix-test-framework/src/main/resources/Catalog.xsd
@@ -188,6 +188,7 @@
          <xs:enumeration value="Ignore"/>

          <xs:enumeration value="JSON"/>

          <xs:enumeration value="CSV"/>

+         <xs:enumeration value="CSV_Header"/>

       </xs:restriction>

    </xs:simpleType>