Prepare GitHub release
Change-Id: Ib986679416e780ece7439c7af0d7e547c1e64081
diff --git a/LICENSE b/LICENSE
new file mode 100755
index 0000000..e983902
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,24 @@
+Copyright (c) 2015-2018, IDS Mannheim
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGE.
\ No newline at end of file
diff --git a/README.md b/README.md
index 4470e46..c958315 100644
--- a/README.md
+++ b/README.md
@@ -1,9 +1,93 @@
-# KalamarExportPlugin
+# Kalamar-Plugin-Export
-## Setup
+![Kalamar-Plugin-Export Screenshot](https://raw.githubusercontent.com/KorAP/Kalamar-Plugin-Export/misc/kalamar-export-screenshot.png)
-The jar file is located in the ```target/``` folder
+## Description
-## Customizing KalamarExportPlugin configuration
+Kalamar-Plugin-Export is a web service that integrates in the plugin framework of
+[Kalamar](https://github.com/KorAP/Kalamar), to export matches for the
+[KorAP Corpus Analysis Platform](http://korap.ids-mannheim.de/) in various formats.
-Copy the default configuration file ```plugin/src/main/resources/exportPlugin.conf``` to the same folder as the KalamarExportPlugin jar file (```/target```). Please do not change the name of the configuration file.
+Currently supported are **RTF**, **CSV**, and **JSON**.
+
+Kalamar-Plugin-Export is meant to be a basic export plugin and should
+demonstrate and evaluate the plugin capabilities of Kalamar.
+
+
+## Prerequisites
+
+Java 8 (OpenJDK or Oracle JDK),
+[Git](http://git-scm.com/),
+[Maven 3](https://maven.apache.org/).
+Further dependencies are resolved using Maven.
+
+
+## Build
+
+To build the latest version of Kalamar-Plugin-Export, do ...
+
+```shell
+$ git clone https://github.com/KorAP/Kalamar-Plugin-Export
+$ cd Kalamar-Plugin-Export
+```
+
+... and build the jar file ...
+
+
+```shell
+$ mvn clean package
+```
+
+Afterwards the jar file is located in the `target/` folder and can
+be started with ...
+
+```shell
+$ java -jar KalamarExportPlugin-[VERSION].jar
+```
+
+Per default, this will start a server at `http://localhost:7777`.
+It will also create a subfolder `files` to temporarily store created
+exports.
+
+Registration of the plugin in Kalamar is not yet officially supported.
+Registration works by passing the following JSON blob
+to the plugin registration handler.
+
+```json
+{
+ "name" : "Export",
+ "desc" : "Exports Kalamar results",
+ "embed" : [{
+ "panel" : "result",
+ "title" : "exports KWICs and snippets",
+ "icon" : "\uf019",
+ "classes" : ["button-icon", "plugin" ],
+ "onClick" : {
+ "action" : "addWidget",
+ "template" : "http://localhost:7777/export"
+ }
+ }]
+}
+```
+
+An [example demo](https://github.com/KorAP/Kalamar/blob/master/dev/demo/export.html)
+showcases the embedded plugin.
+
+
+## Customization
+
+The default configuration file is stored in `src/main/resources/exportPlugin.conf`.
+This file can be overwritten, when a file of that name is stored in the
+same directory as the jar file.
+
+
+## License
+
+Copyright (c) 2020, [IDS Mannheim](http://ids-mannheim.de/), Germany
+
+Kalamar-Plugin-Export is developed as part of the [KorAP](http://korap.ids-mannheim.de/)
+Corpus Analysis Platform at the Leibniz Institute for the German Language
+([IDS](http://ids-mannheim.de/)).
+
+Kalamar-Plugin-Export is published under the
+[BSD-2 License](https://raw.githubusercontent.com/KorAP/Kalamar-Plugin-Export/master/LICENSE).
diff --git a/misc/kalamar-export-screenshot.png b/misc/kalamar-export-screenshot.png
new file mode 100644
index 0000000..9bab6d7
--- /dev/null
+++ b/misc/kalamar-export-screenshot.png
Binary files differ
diff --git a/src/main/java/de/ids_mannheim/korap/plkexport/Service.java b/src/main/java/de/ids_mannheim/korap/plkexport/Service.java
index 9b509fc..98d12e2 100644
--- a/src/main/java/de/ids_mannheim/korap/plkexport/Service.java
+++ b/src/main/java/de/ids_mannheim/korap/plkexport/Service.java
@@ -57,12 +57,8 @@
import freemarker.template.Template;
/**
- * TODO for release:
- * - Rename to "Kalamar-Plugin-Export".
- * - Improve Readme.
- * - Add screenshot.
- *
* TODO:
+ * - Rename "is cutted" to "truncated".
* - Localize RTF export.
* - Change "count" to "number of results" in RTF.
* - Add date info.
@@ -75,6 +71,7 @@
* - Add loading marker.
* - Use a central logging mechanism.
* - Add infos to JsonExporter.
+ * - e.g. q & cq string representation.
* - Check pageSize after init (so pageSize is not
* greater than what the server supports).
* - Restrict CORS to meaningful sources.
@@ -94,7 +91,9 @@
* - Check for q/ql definition in JS.
*
* IDEAS:
- * - Create a template mechanism for RTF export.
+ * - Support more granular exporter-specific options
+ * - Create a template mechanism for RTF export.
+ * - Support CSV separator and quote symbol change.
* - Prettify VC in RTF export (maybe similar to
* the visualisation in Kalamar)
*/