Introduce information to RTF export similar to COSMAS II

Change-Id: I59dc7a9db95ac606ab823b3103080bedfbbd9711
diff --git a/plugin/src/main/java/de/ids_mannheim/korap/plkexport/IdsExportService.java b/plugin/src/main/java/de/ids_mannheim/korap/plkexport/IdsExportService.java
index 9f6f1ed..211cec3 100644
--- a/plugin/src/main/java/de/ids_mannheim/korap/plkexport/IdsExportService.java
+++ b/plugin/src/main/java/de/ids_mannheim/korap/plkexport/IdsExportService.java
@@ -52,11 +52,10 @@
  *   all pages.
  * - Handle timeout results (with minimum total results).
  * - Use offset instead of page parameter
- * - Add mime type to exporters
- * - Add format to exporters
- * - Add file suffix to exporters
  * - Test Snippet-Export with multiple classes.
  * - Test Snippet-Export with cutted matches.
+ * - Add progress mechanism.
+ * - Add CSV export format.
  */
 
 @Path("/")
@@ -115,9 +114,9 @@
         @FormParam("format") String format,
         @FormParam("q") String q,
         @FormParam("ql") String ql,
-        @FormParam("islimit") String il,
-        @FormParam("cutoff") String cutoffStr,
-        @FormParam("hitc") int hitc
+        @FormParam("cutoff") String cutoffStr
+        // @FormParam("islimit") String il,
+        // @FormParam("hitc") int hitc
         ) throws IOException {
 
         // These parameters are required
diff --git a/plugin/src/main/java/de/ids_mannheim/korap/plkexport/RtfExporter.java b/plugin/src/main/java/de/ids_mannheim/korap/plkexport/RtfExporter.java
index be88860..5c630c7 100644
--- a/plugin/src/main/java/de/ids_mannheim/korap/plkexport/RtfExporter.java
+++ b/plugin/src/main/java/de/ids_mannheim/korap/plkexport/RtfExporter.java
@@ -65,7 +65,7 @@
         rtfText(w, "@ Institut für Deutsche Sprache, Mannheim");
 
         // Page number
-        w.append("  \\endash  \\chpgn / {\\field{\\*\\fldinst{\\fs18\\f0 NUMPAGES}}}");
+        w.append(" \\endash  \\chpgn /{\\field{\\*\\fldinst{\\fs18\\f0 NUMPAGES}}}");
         w.append("\\par}\n");
 
         // Title
@@ -76,6 +76,28 @@
         };
 
         addVersion(w);
+
+
+        // Add Information table
+        if (this.getQueryString() != null) {
+            w.append("{\\pard Query: \\f1 ")
+                .append(this.getQueryString())
+                .append("\\par}\n");
+        };
+        
+        if (this.getMeta() != null) {
+            JsonNode m = this.getMeta();
+            int totalResults = m.at("/totalResults").asInt();
+
+            if (totalResults != -1) {
+                w.append("{\\pard Count: \\f1 ")
+                    .append(m.at("/totalResults").asText())
+                    .append("\\par}\n");
+            };
+        };
+
+        // Add line
+        w.append("{\\pard\\brdrb\\brdrs\\brdrw2\\brsp20\\par}\n");
     };
     
 
@@ -97,7 +119,7 @@
             w.append("\\line ");
 
             // Snippet
-            w.append("{\\pard\\fs22\\f0\\qj ");
+            w.append("{\\pard\\fs20\\f0\\qj ");
             if (s.hasMoreLeft()) {
                 w.append("[...] ");
             };
@@ -113,7 +135,7 @@
 
             // Reference
             w.append("{\\pard");
-            w.append("\\qr\\fs20\\cf2\\f0 ");
+            w.append("\\qr\\fs18\\cf2\\f0 ");
             w.append("{\\b ");
             rtfText(w, match.getTitle());
             w.append(" von ");
@@ -124,7 +146,7 @@
             w.append("\\par}");
 
             // TextSigle
-            w.append("{\\pard\\qr\\b\\fs20\\cf2\\f1 [");
+            w.append("{\\pard\\qr\\b\\fs18\\cf2\\f1 [");
             rtfText(w, match.getTextSigle());
             w.append("]\\par}");