Add Version

Change-Id: I90e3ce2ab7acadd609ee1e09dab3fc9ba14ae251
diff --git a/plugin/src/main/java/de/ids_mannheim/korap/plkexport/ExWSConf.java b/plugin/src/main/java/de/ids_mannheim/korap/plkexport/ExWSConf.java
index e5eb5be..3bd8e03 100644
--- a/plugin/src/main/java/de/ids_mannheim/korap/plkexport/ExWSConf.java
+++ b/plugin/src/main/java/de/ids_mannheim/korap/plkexport/ExWSConf.java
@@ -16,4 +16,9 @@
      * See also: https://www.ids-mannheim.de/cosmas2/script-app/hilfe/sitzung.html
      */
     public static final int MAX_EXP_LIMIT = 10000;
+    
+    //Version of Export Plugin
+    public static final int VERSION_MAJOR = 0;
+    public static final int VERSION_MINOR = 1;
+    public static final int VERSION_PATCHLEVEL= 0;
 }
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 3a89ae3..b02a1e4 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
@@ -22,6 +22,7 @@
 
 import com.fasterxml.jackson.core.JsonFactory;
 import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.Version;
 import com.fasterxml.jackson.databind.JsonNode;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.tutego.jrtf.*;
@@ -58,6 +59,7 @@
             @FormParam("ql") String ql, @FormParam("islimit") String il,
             @FormParam("hitc") int hitc) throws IOException {
 
+
         String[][] params = { { "fname", fname }, { "format", format },
                 { "q", q }, { "ql", ql } };
 
@@ -138,6 +140,16 @@
         String textSigle;
         int j = matchlist.size();
 
+        //TODO Add export plugin version to JSON output?
+        /*
+         * TODO 
+         * The output rtf file lacks style, 
+         * but I'm thinking about changing the jRTF library to OpenRTF https://github.com/LibrePDF/OpenRTF, 
+         * because jRTF is very rudimentary, so I only list the information in a section right now.
+         */
+        RtfTextPara pv = getVersion();
+        listp.add(pv);
+
         for (int i = 0; i < j; i++) {
             MatchExport matchakt = (MatchExport) matchlist.get(i);
             reference = " (" + matchakt.getTitle() + " von "
@@ -154,4 +166,14 @@
         String rtfresp = rtf().section(listp).toString();
         return rtfresp;
     }
+
+
+    public RtfTextPara getVersion () {
+        Version version = new Version(ExWSConf.VERSION_MAJOR,
+                ExWSConf.VERSION_MINOR, ExWSConf.VERSION_PATCHLEVEL, null, null,
+                null);
+        RtfTextPara parv = p("@Institut für Deutsche Sprache, Mannheim", ("\n"),
+                "IDSExportPlugin-Version:  ", version, "\n");
+        return parv;
+    }
 }