Add export function to DeLiKo XS and XL
diff --git a/data/exportPlugin.xl.conf b/data/exportPlugin.xl.conf
new file mode 100644
index 0000000..c8094c4
--- /dev/null
+++ b/data/exportPlugin.xl.conf
@@ -0,0 +1,28 @@
+# Server Configuration
+server.port=7778
+server.host=10.10.14.225
+server.scheme=http
+server.origin=https://korap.dnb.de/
+
+# API Configuration
+api.port=8091
+api.host=10.10.14.225
+api.scheme=http
+
+# Asset Configuration
+asset.host=korap.dnb.de
+asset.path=/
+asset.scheme=https
+
+# Default configuration
+conf.page_size=50
+
+# Store in subfolder
+conf.file_dir=./files/
+
+# Session riding config
+cookie.name=kalamar-deliko-xl
+
+rtf.footnote = @ Deutsche Nationalbibliothek, Frankfurt
+rtf.trail = Wenn Sie diese Belege in einer Veröffentlichung verwenden wollen, zitieren Sie bitte DeLiKo und KorAP (s. https://korap.dnb.de/aq\#howToCite).
+api.source = korap.dnb.de/
diff --git a/data/exportPlugin.xs.conf b/data/exportPlugin.xs.conf
new file mode 100644
index 0000000..5133afe
--- /dev/null
+++ b/data/exportPlugin.xs.conf
@@ -0,0 +1,28 @@
+# Server Configuration
+server.port=7777
+server.host=10.10.14.225
+server.scheme=http
+server.origin=https://korap.dnb.de/deliko
+
+# API Configuration
+api.port=8089
+api.host=10.10.14.225
+api.scheme=http
+
+# Asset Configuration
+asset.host=korap.dnb.de
+asset.path=/deliko
+asset.scheme=https
+
+# Default configuration
+conf.page_size=50
+
+# Store in subfolder
+conf.file_dir=./files/
+
+# Session riding config
+cookie.name=kalamar-delikocs
+
+rtf.footnote = @ Deutsche Nationalbibliothek, Frankfurt
+rtf.trail = Wenn Sie diese Belege in einer Veröffentlichung verwenden wollen, zitieren Sie bitte DeLiKo und KorAP (s. https://korap.dnb.de/aq\#howToCite).
+api.source = korap.dnb.de/deliko
diff --git a/kalamar-xl.conf b/data/kalamar-xl.conf
similarity index 83%
rename from kalamar-xl.conf
rename to data/kalamar-xl.conf
index 6c0ade0..d92fa14 100644
--- a/kalamar-xl.conf
+++ b/data/kalamar-xl.conf
@@ -19,6 +19,8 @@
     ## For further Plugins, add them
     ## to this array:
     # plugins => [],
+    plugins  => ['Plugins'],
+
     ## Currently bundled: Piwik, Auth
 
     ## Require everything to be send via https only:
@@ -30,6 +32,21 @@
     ## Set proxy timeouts
     # proxy_inactivity_timeout => 120,
     # proxy_connect_timeout => 120,
+    defaults => {
+      align => 'center'
+    },
+    proxies => [{
+      root_path => '/plugin/export',
+      mount => 'http://10.10.14.225:7778',
+      service => 'export-plugin-proxy'
+    }],
+  },
+  CSP => {
+    'frame-src' => 'self',
+    'frame-ancestors' => ['self','http://korap.dnb.de/','https://korap.dnb.de/']
+   },
+ 'Kalamar-Plugins' => {
+     default_plugins =>'wiki.plugins.json'
   },
   Localize => {
     dict => {
diff --git a/kalamar-xl.conf b/data/kalamar.xs.conf
similarity index 80%
copy from kalamar-xl.conf
copy to data/kalamar.xs.conf
index 6c0ade0..10cba58 100644
--- a/kalamar-xl.conf
+++ b/data/kalamar.xs.conf
@@ -2,7 +2,6 @@
   Kalamar => {
     ## Backend server path
     # api_path => 'https://korap.example.org/api/',
-    # plugins => ["Auth"],
     ## Backend API version
     # api_version => '1.0',
 
@@ -10,7 +9,10 @@
     # proxy_host => 0,
 
     ## Run the application in a subfolder behind a proxy:
-    # proxy_prefix => '/deliko',
+    proxy_prefix => '/deliko',
+    plugins  => ['Plugins'],
+    # https_only => 1,
+
 
     ## The name of the base corpus,
     ## for query examples (see kalamar.queries.dict)
@@ -30,10 +32,25 @@
     ## Set proxy timeouts
     # proxy_inactivity_timeout => 120,
     # proxy_connect_timeout => 120,
+  defaults => {
+    align => 'center'
+  },
+   proxies => [{
+     root_path => '/plugin/export',
+     mount => 'http://10.10.14.225:7777',
+     service => 'export-plugin-proxy'
+  }],
+ },
+  CSP => {
+    'frame-src' => 'self',
+    'frame-ancestors' => ['self','http://korap.dnb.de/','https://korap.dnb.de/']
+   },
+ 'Kalamar-Plugins' => {
+     default_plugins =>'wiki.plugins.json'
   },
   Localize => {
     dict => {
-      'en_title_addon' => 'DeLiKo@DNB-XL',
+      'en_title_addon' => 'DeLiKo@DNB',
       'de_Template_intro' => 'custom/intro',
       'en_Template_intro' => 'custom/intro',
       'en_howToCite' => 'Citation Help',
diff --git a/deliko-xl-compose.yml b/deliko-xl-compose.yml
index b12fbb2..a4471ab 100644
--- a/deliko-xl-compose.yml
+++ b/deliko-xl-compose.yml
@@ -2,7 +2,7 @@
   example-index:
 services:
   kalamar:
-    image: "korap/kalamar:v0.60.0-DNB-4"
+    image: "korap/kalamar:v0.60.0-DNB-6"
     ports:
       - "4000:64543"
     environment:
@@ -14,7 +14,7 @@
         source: ./html/robots.txt
         target: /kalamar/public/robots.txt
       - type: bind
-        source: ./kalamar-xl.conf
+        source: ./data/kalamar-xl.conf
         target: /kalamar/kalamar.production.conf
       - type: bind
         source: ./data/doc/buchpreis.html.ep
@@ -25,11 +25,14 @@
       - type: bind
         source: ./data/partial/citation.html.ep
         target: /kalamar/templates/custom/partial/citation.html.ep
+      - type: bind
+        source: ./data/wiki.plugins.xl.json
+        target: /kalamar/wiki.plugins.json
     profiles:
       - lite
     restart: "unless-stopped"
   kustvakt:
-    image: "korap/kustvakt:master-43184b93-lite"
+    image: "korap/kustvakt:v0.79-DNB-3-lite"
     ports:
       - "8091:8089"
     user: root
diff --git a/korap4dnb-compose.yml b/korap4dnb-compose.yml
index 7a1766b..37351df 100644
--- a/korap4dnb-compose.yml
+++ b/korap4dnb-compose.yml
@@ -2,7 +2,7 @@
   example-index:
 services:
   kalamar:
-    image: "korap/kalamar:v0.60.0-DNB-4"
+    image: "korap/kalamar:v0.60.0-DNB-6"
     ports:
       - "4002:64543"
     environment:
@@ -14,7 +14,7 @@
         source: ./html/robots.txt
         target: /kalamar/public/robots.txt
       - type: bind
-        source: ./kalamar.conf
+        source: ./data/kalamar.xs.conf
         target: /kalamar/kalamar.production.conf
       - type: bind
         source: ./data/doc/buchpreis.html.ep
@@ -25,6 +25,9 @@
       - type: bind
         source: ./data/partial/citation.html.ep
         target: /kalamar/templates/custom/partial/citation.html.ep
+      - type: bind
+        source: ./data/wiki.plugins.xs.json
+        target: /kalamar/wiki.plugins.json
     profiles:
       - lite
     restart: "unless-stopped"
diff --git a/lib/KalamarExportPlugin-0.2.10.jar b/lib/KalamarExportPlugin-0.2.10.jar
new file mode 100644
index 0000000..ad6ce0d
--- /dev/null
+++ b/lib/KalamarExportPlugin-0.2.10.jar
Binary files differ
diff --git a/lib/KalamarExportPlugin.jar b/lib/KalamarExportPlugin.jar
new file mode 120000
index 0000000..fd54411
--- /dev/null
+++ b/lib/KalamarExportPlugin.jar
@@ -0,0 +1 @@
+KalamarExportPlugin-0.2.10.jar
\ No newline at end of file
diff --git a/scripts/start-kalamar-export-plugins.sh b/scripts/start-kalamar-export-plugins.sh
new file mode 100755
index 0000000..5560f77
--- /dev/null
+++ b/scripts/start-kalamar-export-plugins.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+wd=.
+mkdir -p $wd/log
+mkdir -p $wd/files
+nohup java -jar $wd/lib/KalamarExportPlugin.jar $wd/data/exportPlugin.xs.conf > $wd/log/kalamar-xs.export.log 2>&1 & echo $! > $wd/kalamar-xs.export.pid &
+nohup java -jar $wd/lib/KalamarExportPlugin.jar $wd/data/exportPlugin.xl.conf > $wd/log/kalamar-xl.export.log 2>&1 & echo $! > $wd/kalamar-xl.export.pid &