Commit aa62787f6ca23d814c166b762bec959e5a53852b

Authored by Thomas Ziemer
0 parents

Initial commit

Showing 60 changed files with 4637 additions and 0 deletions

Too many changes to show.

To preserve performance only 60 of 146 files are displayed.

.gitignore 0 → 100755
  1 +++ a/.gitignore
  1 +*.class
  2 +
  3 +# Mobile Tools for Java (J2ME)
  4 +.mtj.tmp/
  5 +
  6 +# Package Files #
  7 +*.war
  8 +*.war.*
  9 +*.ear
  10 +
  11 +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
  12 +hs_err_pid*
  13 +
  14 +# Logfiles
  15 +**.log
  16 +**.log.*
  17 +
  18 +**/.DS_Store
  19 +.idea
  20 +.gradle
  21 +bht-chatbot.iml
  22 +target/
  23 +build
... ...
README.md 0 → 100755
  1 +++ a/README.md
  1 +# BHT-Chatbot
  2 +Master-Projekt SS2017 Medieninformatik
  3 +<!-- MarkdownTOC -->
  4 +
  5 +- [Requirements](#requirements)
  6 +- [Main TechStack](#main-techstack)
  7 +- [Project documention](#project-documention)
  8 +- [Run and stop the application](#run-and-stop-the-application)
  9 +- [Used online sources](#used-online-sources)
  10 +
  11 +<!-- /MarkdownTOC -->
  12 +
  13 +## Requirements
  14 +- Java 8 to build the application
  15 +- a running docker daemon to start application server
  16 +
  17 +## Main TechStack
  18 +- Gradle 3.5
  19 +- Docker
  20 +- WildFly 10
  21 +
  22 +## Project documention
  23 +You can find the whole project documentation under [project_documentation](docu/project_documentation.md).
  24 +
  25 +## Run and stop the application
  26 +Go to project path and executes the following gradle tasks to start/stop the application:
  27 + ```bash
  28 + # Unix based
  29 + ./gradlew chatbotRun
  30 + ./gradlew chatbotStop
  31 +
  32 + # Windows
  33 + gradlew.bat chatbotRun
  34 + gradlew.bat chatbotStop
  35 +
  36 + # MacOS
  37 + # you need to execute the docker commands directly
  38 + cd docker
  39 + docker-compose up --build
  40 + docker-compose down
  41 + ```
  42 +
  43 +The following ports are mapped to host:
  44 +- 8080 -> 8080
  45 +- 8787 -> 8787 (Remote Debug Port)
  46 +- 9990 -> 9990 (WildFly Server Manager)
  47 +
  48 +If all went well, you should see the application appearing at [localhost:8080/bht-chatbot](http://localhost:8080/bht-chatbot)
  49 +
  50 +## Known issues
  51 +- The usage of `./gradlew chatbotRun` is not working under Mac OSX
  52 +
  53 +## Used online sources
  54 +- [Markdown CheetSheet](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet)
  55 +- [Docker base image for WildFly application server](https://hub.docker.com/r/jboss/wildfly/)
  56 +- [Gradle 3.5 User Guide](https://docs.gradle.org/3.5/userguide/userguide.html)
  57 +
... ...
build.gradle 0 → 100755
  1 +++ a/build.gradle
  1 +/* Plugins
  2 +---------------------------------*/
  3 +apply plugin: 'war'
  4 +
  5 +
  6 +/* Repositories
  7 +---------------------------------*/
  8 +
  9 +
  10 +/* Dependencies
  11 +---------------------------------*/
  12 +/*dependencies {
  13 +
  14 + compile 'org.jboss.resteasy:resteasy-jaxrs-all:3.1.3.Final'
  15 +
  16 + compile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.3'
  17 + compile group: 'org.apache.httpcomponents', name: 'httpmime', version: '4.3.1'
  18 +
  19 + compile "org.jboss.spec:jboss-javaee-7.0:1.1.0.Final",
  20 + "org.json:json:20160810",
  21 + "com.github.pengrad:java-telegram-bot-api:3.0.0",
  22 + "com.mashape.unirest:unirest-java:1.4.9",
  23 + "org.drools:drools-compiler:7.0.0.Final",
  24 + "commons-cli:commons-cli:1.3.1",
  25 + "org.jsoup:jsoup:1.10.2",
  26 + "net.jodah:expiringmap:0.5.8"
  27 +
  28 + providedCompile "org.slf4j:slf4j-api:1.7.25",
  29 + "org.jboss.resteasy:resteasy-client:3.1.3.Final",
  30 + "org.infinispan:infinispan-core:8.2.4.Final"
  31 +
  32 + testCompile "org.jboss.arquillian.junit:arquillian-junit-container:1.1.13.Final",
  33 + "junit:junit:4.12"
  34 +
  35 + testRuntime "org.wildfly.arquillian:wildfly-arquillian-container-remote:2.0.2.Final",
  36 + "org.slf4j:slf4j-simple:1.7.25"
  37 +}*/
  38 +
  39 +
  40 +/* Configurations
  41 +---------------------------------*/
  42 +
  43 +
  44 +
  45 +/* Tasks
  46 +---------------------------------*/
  47 +task wrapper(type: Wrapper) {
  48 + gradleVersion = '3.5'
  49 +}
  50 +
  51 +
  52 +task chatbotRun(type: Exec, dependsOn: war) {
  53 + workingDir 'docker'
  54 + commandLine 'docker-compose', 'up', '--build'
  55 +}
  56 +
  57 +task chatbotStop(type: Exec) {
  58 + workingDir 'docker'
  59 + commandLine 'docker-compose', 'down'
  60 +}
  61 +
  62 +task cleanWar(type: Delete) {
  63 + delete fileTree(dir: 'docker/wildfly/volumes/deployments/', include: '*.war')
  64 +}
  65 +
  66 +tasks.war.dependsOn(cleanWar)
... ...
config/checkstyle/checkstyle.xml 0 → 100755
  1 +++ a/config/checkstyle/checkstyle.xml
  1 +<?xml version="1.0"?>
  2 +<!DOCTYPE module PUBLIC
  3 + "-//Puppy Crawl//DTD Check Configuration 1.3//EN"
  4 + "http://checkstyle.sourceforge.net/dtds/configuration_1_3.dtd">
  5 +
  6 +<!--
  7 + Checkstyle configuration that checks the sun coding conventions from:
  8 + - the Java Language Specification at
  9 + http://java.sun.com/docs/books/jls/second_edition/html/index.html
  10 + - the Sun Code Conventions at http://java.sun.com/docs/codeconv/
  11 + - the Javadoc guidelines at
  12 + http://java.sun.com/j2se/javadoc/writingdoccomments/index.html
  13 + - the JDK Api documentation http://java.sun.com/j2se/docs/api/index.html
  14 + - some best practices
  15 + Checkstyle is very configurable. Be sure to read the documentation at
  16 + http://checkstyle.sf.net (or in your downloaded distribution).
  17 + Most Checks are configurable, be sure to consult the documentation.
  18 + To completely disable a check, just comment it out or delete it from the file.
  19 + Finally, it is worth reading the documentation.
  20 +-->
  21 +
  22 +<module name="Checker">
  23 + <!--
  24 + If you set the basedir property below, then all reported file
  25 + names will be relative to the specified directory. See
  26 + http://checkstyle.sourceforge.net/5.x/config.html#Checker
  27 + <property name="basedir" value="${basedir}"/>
  28 + -->
  29 +
  30 + <property name="fileExtensions" value="java, properties, xml"/>
  31 +
  32 + <!-- Checks that a package-info.java file exists for each package. -->
  33 + <!-- See http://checkstyle.sf.net/config_javadoc.html#JavadocPackage -->
  34 + <module name="JavadocPackage"/>
  35 +
  36 + <!-- Checks whether files end with a new line. -->
  37 + <!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile -->
  38 + <module name="NewlineAtEndOfFile"/>
  39 +
  40 + <!-- Checks that property files contain the same keys. -->
  41 + <!-- See http://checkstyle.sf.net/config_misc.html#Translation -->
  42 + <module name="Translation"/>
  43 +
  44 + <!-- Checks for Size Violations. -->
  45 + <!-- See http://checkstyle.sf.net/config_sizes.html -->
  46 + <module name="FileLength"/>
  47 +
  48 + <!-- Checks for whitespace -->
  49 + <!-- See http://checkstyle.sf.net/config_whitespace.html -->
  50 + <module name="FileTabCharacter"/>
  51 +
  52 + <!-- Miscellaneous other checks. -->
  53 + <!-- See http://checkstyle.sf.net/config_misc.html -->
  54 + <module name="RegexpSingleline">
  55 + <property name="format" value="\s+$"/>
  56 + <property name="minimum" value="0"/>
  57 + <property name="maximum" value="0"/>
  58 + <property name="message" value="Line has trailing spaces."/>
  59 + </module>
  60 +
  61 + <!-- Checks for Headers -->
  62 + <!-- See http://checkstyle.sf.net/config_header.html -->
  63 + <!-- <module name="Header"> -->
  64 + <!-- <property name="headerFile" value="${checkstyle.header.file}"/> -->
  65 + <!-- <property name="fileExtensions" value="java"/> -->
  66 + <!-- </module> -->
  67 +
  68 + <module name="TreeWalker">
  69 +
  70 + <!-- Checks for Javadoc comments. -->
  71 + <!-- See http://checkstyle.sf.net/config_javadoc.html -->
  72 + <module name="JavadocMethod"/>
  73 + <module name="JavadocType"/>
  74 + <module name="JavadocVariable"/>
  75 + <module name="JavadocStyle"/>
  76 +
  77 + <!-- Checks for Naming Conventions. -->
  78 + <!-- See http://checkstyle.sf.net/config_naming.html -->
  79 + <module name="ConstantName"/>
  80 + <module name="LocalFinalVariableName"/>
  81 + <module name="LocalVariableName"/>
  82 + <module name="MemberName"/>
  83 + <module name="MethodName"/>
  84 + <module name="PackageName"/>
  85 + <module name="ParameterName"/>
  86 + <module name="StaticVariableName"/>
  87 + <module name="TypeName"/>
  88 +
  89 + <!-- Checks for imports -->
  90 + <!-- See http://checkstyle.sf.net/config_import.html -->
  91 + <module name="AvoidStarImport"/>
  92 + <module name="IllegalImport"/> <!-- defaults to sun.* packages -->
  93 + <module name="RedundantImport"/>
  94 + <module name="UnusedImports">
  95 + <property name="processJavadoc" value="false"/>
  96 + </module>
  97 +
  98 + <!-- Checks for Size Violations. -->
  99 + <!-- See http://checkstyle.sf.net/config_sizes.html -->
  100 + <module name="LineLength"/>
  101 + <module name="MethodLength"/>
  102 + <module name="ParameterNumber"/>
  103 +
  104 + <!-- Checks for whitespace -->
  105 + <!-- See http://checkstyle.sf.net/config_whitespace.html -->
  106 + <module name="EmptyForIteratorPad"/>
  107 + <module name="GenericWhitespace"/>
  108 + <module name="MethodParamPad"/>
  109 + <module name="NoWhitespaceAfter"/>
  110 + <module name="NoWhitespaceBefore"/>
  111 + <module name="OperatorWrap"/>
  112 + <module name="ParenPad"/>
  113 + <module name="TypecastParenPad"/>
  114 + <module name="WhitespaceAfter"/>
  115 + <module name="WhitespaceAround"/>
  116 +
  117 + <!-- Modifier Checks -->
  118 + <!-- See http://checkstyle.sf.net/config_modifiers.html -->
  119 + <module name="ModifierOrder"/>
  120 + <module name="RedundantModifier"/>
  121 +
  122 + <!-- Checks for blocks. You know, those {}'s -->
  123 + <!-- See http://checkstyle.sf.net/config_blocks.html -->
  124 + <module name="AvoidNestedBlocks"/>
  125 + <module name="EmptyBlock"/>
  126 + <module name="LeftCurly"/>
  127 + <module name="NeedBraces"/>
  128 + <module name="RightCurly"/>
  129 +
  130 + <!-- Checks for common coding problems -->
  131 + <!-- See http://checkstyle.sf.net/config_coding.html -->
  132 + <module name="AvoidInlineConditionals"/>
  133 + <module name="EmptyStatement"/>
  134 + <module name="EqualsHashCode"/>
  135 + <module name="HiddenField"/>
  136 + <module name="IllegalInstantiation"/>
  137 + <module name="InnerAssignment"/>
  138 + <module name="MagicNumber"/>
  139 + <module name="MissingSwitchDefault"/>
  140 + <module name="SimplifyBooleanExpression"/>
  141 + <module name="SimplifyBooleanReturn"/>
  142 +
  143 + <!-- Checks for class design -->
  144 + <!-- See http://checkstyle.sf.net/config_design.html -->
  145 + <module name="DesignForExtension"/>
  146 + <module name="FinalClass"/>
  147 + <module name="HideUtilityClassConstructor"/>
  148 + <module name="InterfaceIsType"/>
  149 + <module name="VisibilityModifier"/>
  150 +
  151 + <!-- Miscellaneous other checks. -->
  152 + <!-- See http://checkstyle.sf.net/config_misc.html -->
  153 + <module name="ArrayTypeStyle"/>
  154 + <module name="FinalParameters"/>
  155 + <module name="TodoComment"/>
  156 + <module name="UpperEll"/>
  157 +
  158 + </module>
  159 +
  160 +</module>
0 161 \ No newline at end of file
... ...
docker/docker-compose.yml 0 → 100755
  1 +++ a/docker/docker-compose.yml
  1 +version: '3'
  2 +
  3 +services:
  4 + app-server:
  5 + build: ./wildfly
  6 + container_name: chatbot-wildfly
  7 + image: bht-chatbot:latest
  8 + ports:
  9 + - "8080:8080"
  10 + - "8787:8787"
  11 + - "9990:9990"
  12 + volumes:
  13 + - ./wildfly/volumes/deployments/:/opt/jboss/wildfly/standalone/deployments/
  14 + - ./wildfly/volumes/logs/:/opt/jboss/wildfly/standalone/log/
  15 + - ./wildfly/volumes/conf/:/opt/jboss/wildfly/standalone/conf/
  16 + links:
  17 + - rasa-server
  18 + command: /opt/jboss/wildfly/bin/standalone.sh -b 0.0.0.0 -bmanagement 0.0.0.0 --debug
  19 + rasa-server:
  20 + build: ./rasa_nlu
  21 + container_name: rasa_nlu
  22 + image: rasa_nlu:latest
  23 + ports:
  24 + - "5000:5000"
  25 + volumes:
  26 + - ./rasa_nlu/volumes/data/api/:/app/data/api
  27 + - ./rasa_nlu/volumes/logs/:/app/logs/
  28 + command: python -m rasa_nlu.server -c config/chatbot_config.json --server_model_dirs=default
0 29 \ No newline at end of file
... ...
docker/rasa_nlu/Dockerfile 0 → 100755
  1 +++ a/docker/rasa_nlu/Dockerfile
  1 +FROM python:2.7-slim
  2 +
  3 +ENV RASA_NLU_DOCKER="YES" \
  4 + RASA_NLU_HOME="/app"
  5 +
  6 +# Run updates, install basics and cleanup
  7 +# - build-essential: Compile specific dependencies
  8 +# - git-core and ssh: Checkout git repos
  9 +RUN apt-get update -qq && \
  10 + apt-get install -y --no-install-recommends build-essential git-core wget && \
  11 + apt-get clean && \
  12 + rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
  13 +
  14 +WORKDIR ${RASA_NLU_HOME}
  15 +
  16 +# Install rasa and its dependencies
  17 +RUN pip install -U spacy scikit-learn scipy sklearn-crfsuite
  18 +RUN python -m spacy download de
  19 +RUN pip install rasa_nlu==0.9.1
  20 +
  21 +# train the model
  22 +COPY rasa_config.json config/chatbot_config.json
  23 +COPY volumes/data/api/ data/api
  24 +RUN python -m rasa_nlu.train -c config/chatbot_config.json
  25 +
  26 +# Cleanup
  27 +RUN mv models/model_* models/default && rm -r data/api
  28 +
  29 +EXPOSE 5000
0 30 \ No newline at end of file
... ...
docker/rasa_nlu/rasa_config.json 0 → 100755
  1 +++ a/docker/rasa_nlu/rasa_config.json
  1 +{
  2 + "pipeline": "spacy_sklearn",
  3 + "num_threads": 2,
  4 + "language": "de",
  5 + "path": "/app/models",
  6 + "data": "/app/data/api",
  7 + "response_log": "/app/logs"
  8 +}
... ...
docker/rasa_nlu/volumes/data/api/agent.json 0 → 100755
  1 +++ a/docker/rasa_nlu/volumes/data/api/agent.json
  1 +{
  2 + "description": "",
  3 + "language": "de",
  4 + "activeAssistantAgents": [
  5 + "smalltalk-domain-on",
  6 + "smalltalk-fulfillment-on"
  7 + ],
  8 + "googleAssistant": {
  9 + "googleAssistantCompatible": false,
  10 + "welcomeIntentSignInRequired": false,
  11 + "startIntents": [],
  12 + "systemIntents": [],
  13 + "endIntentIds": [],
  14 + "oAuthLinking": {
  15 + "required": false,
  16 + "grantType": "AUTH_CODE_GRANT"
  17 + },
  18 + "voiceType": "MALE_1",
  19 + "capabilities": [],
  20 + "protocolVersion": "V1"
  21 + },
  22 + "defaultTimezone": "Europe/Madrid",
  23 + "webhook": {
  24 + "available": false,
  25 + "useForDomains": false
  26 + },
  27 + "isPrivate": false,
  28 + "customClassifierMode": "use.after",
  29 + "mlMinConfidence": 0.2
  30 +}
0 31 \ No newline at end of file
... ...
docker/rasa_nlu/volumes/data/api/entities/date.json 0 → 100755
  1 +++ a/docker/rasa_nlu/volumes/data/api/entities/date.json
  1 +{
  2 + "id": "7d5ec91f-9608-4a88-aa16-91f02a60ce60",
  3 + "name": "date",
  4 + "isOverridable": true,
  5 + "entries": [
  6 + {
  7 + "value": "today",
  8 + "synonyms": [
  9 + "today",
  10 + "heute",
  11 + "heut",
  12 + "heutigen"
  13 + ]
  14 + },
  15 + {
  16 + "value": "tomorrow",
  17 + "synonyms": [
  18 + "tomorrow",
  19 + "morgen"
  20 + ]
  21 + },
  22 + {
  23 + "value": "dayaftertomorrow",
  24 + "synonyms": [
  25 + "übermorgen",
  26 + "day after tomorrow"
  27 + ]
  28 + },
  29 + {
  30 + "value": "Montag",
  31 + "synonyms": [
  32 + "Montag"
  33 + ]
  34 + },
  35 + {
  36 + "value": "Dienstag",
  37 + "synonyms": [
  38 + "Dienstag"
  39 + ]
  40 + },
  41 + {
  42 + "value": "Mittwoch",
  43 + "synonyms": [
  44 + "Mittwoch"
  45 + ]
  46 + },
  47 + {
  48 + "value": "Donnerstag",
  49 + "synonyms": [
  50 + "Donnerstag"
  51 + ]
  52 + },
  53 + {
  54 + "value": "Freitag",
  55 + "synonyms": [
  56 + "Freitag"
  57 + ]
  58 + },
  59 + {
  60 + "value": "yesterday",
  61 + "synonyms": [
  62 + "gestern",
  63 + "yesterday"
  64 + ]
  65 + }
  66 + ],
  67 + "isEnum": false,
  68 + "automatedExpansion": false
  69 +}
0 70 \ No newline at end of file
... ...
docker/rasa_nlu/volumes/data/api/entities/dishcategory.json 0 → 100755
  1 +++ a/docker/rasa_nlu/volumes/data/api/entities/dishcategory.json
  1 +{
  2 + "id": "8a0a0ef7-e6b4-4abb-814d-482d5135bbec",
  3 + "name": "dishcategory",
  4 + "isOverridable": true,
  5 + "entries": [
  6 + {
  7 + "value": "vorspeisen",
  8 + "synonyms": [
  9 + "vorspeisen",
  10 + "Vorspeise",
  11 + "Vorspeisen"
  12 + ]
  13 + },
  14 + {
  15 + "value": "salate",
  16 + "synonyms": [
  17 + "salate",
  18 + "Salat",
  19 + "Salate"
  20 + ]
  21 + },
  22 + {
  23 + "value": "suppen",
  24 + "synonyms": [
  25 + "suppen",
  26 + "Suppe",
  27 + "Suppen"
  28 + ]
  29 + },
  30 + {
  31 + "value": "aktionen",
  32 + "synonyms": [
  33 + "aktionen",
  34 + "Aktion",
  35 + "Aktionen"
  36 + ]
  37 + },
  38 + {
  39 + "value": "essen",
  40 + "synonyms": [
  41 + "Hauptgerichte",
  42 + "Hauptspeise",
  43 + "Hauptspeisen"
  44 + ]
  45 + },
  46 + {
  47 + "value": "beilagen",
  48 + "synonyms": [
  49 + "beilagen",
  50 + "Beilage",
  51 + "Beilagen"
  52 + ]
  53 + },
  54 + {
  55 + "value": "desserts",
  56 + "synonyms": [
  57 + "desserts",
  58 + "Dessert",
  59 + "Nachspeise",
  60 + "Nachtisch",
  61 + "Nachspeisen",
  62 + "Desserts"
  63 + ]
  64 + }
  65 + ],
  66 + "isEnum": false,
  67 + "automatedExpansion": false
  68 +}
0 69 \ No newline at end of file
... ...
docker/rasa_nlu/volumes/data/api/entities/dishtype.json 0 → 100755
  1 +++ a/docker/rasa_nlu/volumes/data/api/entities/dishtype.json
  1 +{
  2 + "id": "4f3135fd-2367-4e89-8860-a80582f4523a",
  3 + "name": "dishtype",
  4 + "isOverridable": true,
  5 + "entries": [
  6 + {
  7 + "value": "vegan",
  8 + "synonyms": [
  9 + "vegan",
  10 + "veganes",
  11 + "veganer",
  12 + "vegane"
  13 + ]
  14 + },
  15 + {
  16 + "value": "vegetarian",
  17 + "synonyms": [
  18 + "vegetarisch",
  19 + "vegetarisches",
  20 + "vegetarier",
  21 + "ohne Fleisch",
  22 + "kein Fleisch",
  23 + "vegetarische"
  24 + ]
  25 + },
  26 + {
  27 + "value": "bio",
  28 + "synonyms": [
  29 + "bio"
  30 + ]
  31 + }
  32 + ],
  33 + "isEnum": false,
  34 + "automatedExpansion": false
  35 +}
0 36 \ No newline at end of file
... ...
docker/rasa_nlu/volumes/data/api/entities/healthy.json 0 → 100755
  1 +++ a/docker/rasa_nlu/volumes/data/api/entities/healthy.json
  1 +{
  2 + "id": "c61797ac-dedc-4881-8863-4c656eb47359",
  3 + "name": "healthy",
  4 + "isOverridable": true,
  5 + "entries": [
  6 + {
  7 + "value": "green",
  8 + "synonyms": [
  9 + "grün",
  10 + "gesund",
  11 + "gesunde",
  12 + "gesundes",
  13 + "Gruen"
  14 + ]
  15 + },
  16 + {
  17 + "value": "red",
  18 + "synonyms": [
  19 + "rot",
  20 + "ungesund",
  21 + "ungesunde",
  22 + "Ungesundes",
  23 + "fettig"
  24 + ]
  25 + },
  26 + {
  27 + "value": "yellow",
  28 + "synonyms": [
  29 + "gelb",
  30 + "gelbe"
  31 + ]
  32 + }
  33 + ],
  34 + "isEnum": false,
  35 + "automatedExpansion": false
  36 +}
0 37 \ No newline at end of file
... ...
docker/rasa_nlu/volumes/data/api/entities/ingredients.json 0 → 100755
  1 +++ a/docker/rasa_nlu/volumes/data/api/entities/ingredients.json
  1 +{
  2 + "id": "a940b7e1-44fe-4ec6-8a2f-e330821c6a07",
  3 + "name": "ingredients",
  4 + "isOverridable": true,
  5 + "entries": [
  6 + {
  7 + "value": "laktosefree",
  8 + "synonyms": [
  9 + "laktosefrei",
  10 + "ohne Laktose"
  11 + ]
  12 + },
  13 + {
  14 + "value": "glutenfree",
  15 + "synonyms": [
  16 + "glutenfrei",
  17 + "ohne Gluten"
  18 + ]
  19 + },
  20 + {
  21 + "value": "sugarfree",
  22 + "synonyms": [
  23 + "zuckerfrei",
  24 + "ohne Zucker"
  25 + ]
  26 + }
  27 + ],
  28 + "isEnum": false,
  29 + "automatedExpansion": false
  30 +}
0 31 \ No newline at end of file
... ...
docker/rasa_nlu/volumes/data/api/entities/price.json 0 → 100755
  1 +++ a/docker/rasa_nlu/volumes/data/api/entities/price.json
  1 +{
  2 + "id": "92b3c202-7cd4-43b1-a9fb-856a20c2ff87",
  3 + "name": "price",
  4 + "isOverridable": true,
  5 + "entries": [
  6 + {
  7 + "value": "howmuch",
  8 + "synonyms": [
  9 + "howmuch",
  10 + "Was kostet",
  11 + "wie teuer"
  12 + ]
  13 + },
  14 + {
  15 + "value": "under",
  16 + "synonyms": [
  17 + "unter",
  18 + "under",
  19 + "weniger als"
  20 + ]
  21 + }
  22 + ],
  23 + "isEnum": false,
  24 + "automatedExpansion": false
  25 +}
0 26 \ No newline at end of file
... ...
docker/rasa_nlu/volumes/data/api/intents/Bye.json 0 → 100755
  1 +++ a/docker/rasa_nlu/volumes/data/api/intents/Bye.json
  1 +{
  2 + "userSays": [
  3 + {
  4 + "id": "96688a3e-5905-4a32-8887-99735525f0b5",
  5 + "data": [
  6 + {
  7 + "text": "Tschüss."
  8 + }
  9 + ],
  10 + "isTemplate": false,
  11 + "count": 0
  12 + },
  13 + {
  14 + "id": "540dc163-d340-4ccf-ac32-2a4b46af9ad7",
  15 + "data": [
  16 + {
  17 + "text": "Bye",
  18 + "userDefined": false
  19 + }
  20 + ],
  21 + "isTemplate": false,
  22 + "count": 1
  23 + },
  24 + {
  25 + "id": "45422bce-8688-45e8-bcf0-88a4db4c3fb0",
  26 + "data": [
  27 + {
  28 + "text": "Auf Wiedersehen"
  29 + }
  30 + ],
  31 + "isTemplate": false,
  32 + "count": 0
  33 + },
  34 + {
  35 + "id": "8ec89276-d8f4-4b92-bd5f-8d74e2fa7258",
  36 + "data": [
  37 + {
  38 + "text": "tschüss"
  39 + }
  40 + ],
  41 + "isTemplate": false,
  42 + "count": 0
  43 + },
  44 + {
  45 + "id": "7667c3bf-c8ea-4628-a09c-84f9acbf5414",
  46 + "data": [
  47 + {
  48 + "text": "adieu"
  49 + }
  50 + ],
  51 + "isTemplate": false,
  52 + "count": 0
  53 + },
  54 + {
  55 + "id": "daeb2cdc-a213-40b4-9dd1-3ad60f39d64a",
  56 + "data": [
  57 + {
  58 + "text": "ciao"
  59 + }
  60 + ],
  61 + "isTemplate": false,
  62 + "count": 0
  63 + },
  64 + {
  65 + "id": "88a42bc6-db2f-4826-aea6-abb434ef07bb",
  66 + "data": [
  67 + {
  68 + "text": "lebe wohl"
  69 + }
  70 + ],
  71 + "isTemplate": false,
  72 + "count": 0
  73 + }
  74 + ],
  75 + "id": "31c24025-1d89-4dab-8f61-fe14a0687129",
  76 + "name": "Bye",
  77 + "auto": true,
  78 + "contexts": [],
  79 + "responses": [
  80 + {
  81 + "resetContexts": false,
  82 + "affectedContexts": [],
  83 + "parameters": [],
  84 + "messages": [
  85 + {
  86 + "type": 0,
  87 + "speech": []
  88 + }
  89 + ],
  90 + "defaultResponsePlatforms": {}
  91 + }
  92 + ],
  93 + "priority": 500000,
  94 + "webhookUsed": false,
  95 + "webhookForSlotFilling": false,
  96 + "fallbackIntent": false,
  97 + "events": []
  98 +}
0 99 \ No newline at end of file
... ...
docker/rasa_nlu/volumes/data/api/intents/Fallback.json 0 → 100755
  1 +++ a/docker/rasa_nlu/volumes/data/api/intents/Fallback.json
  1 +{
  2 + "userSays": [],
  3 + "id": "27e9cc67-9092-47a7-a09a-04a876334133",
  4 + "name": "Fallback",
  5 + "auto": false,
  6 + "contexts": [],
  7 + "responses": [
  8 + {
  9 + "resetContexts": false,
  10 + "affectedContexts": [],
  11 + "parameters": [],
  12 + "messages": [],
  13 + "defaultResponsePlatforms": {}
  14 + }
  15 + ],
  16 + "priority": 500000,
  17 + "webhookUsed": false,
  18 + "webhookForSlotFilling": false,
  19 + "fallbackIntent": true,
  20 + "events": []
  21 +}
0 22 \ No newline at end of file
... ...
docker/rasa_nlu/volumes/data/api/intents/Hello.json 0 → 100755
  1 +++ a/docker/rasa_nlu/volumes/data/api/intents/Hello.json
  1 +{
  2 + "userSays": [
  3 + {
  4 + "id": "a46d8cf9-13f8-4f7e-a6b6-701b616d3b1b",
  5 + "data": [
  6 + {
  7 + "text": "Mahlzeit!"
  8 + }
  9 + ],
  10 + "isTemplate": false,
  11 + "count": 2
  12 + },
  13 + {
  14 + "id": "7e2cb139-ac8c-48f8-937f-5e561d7a5b21",
  15 + "data": [
  16 + {
  17 + "text": "Hallo"
  18 + }
  19 + ],
  20 + "isTemplate": false,
  21 + "count": 1
  22 + },
  23 + {
  24 + "id": "c071bead-c204-416b-b6ed-74965cb1f12c",
  25 + "data": [
  26 + {
  27 + "text": "Hallo bot."
  28 + }
  29 + ],
  30 + "isTemplate": false,
  31 + "count": 0
  32 + },
  33 + {
  34 + "id": "6aec7f9f-1ea8-4004-a6e2-eb0dd8274d5f",
  35 + "data": [
  36 + {
  37 + "text": "hallo"
  38 + }
  39 + ],
  40 + "isTemplate": false,
  41 + "count": 7
  42 + },
  43 + {
  44 + "id": "55cd7273-87cf-472a-89b7-2664fd45982c",
  45 + "data": [
  46 + {
  47 + "text": "Hallo Bot",
  48 + "userDefined": false
  49 + }
  50 + ],
  51 + "isTemplate": false,
  52 + "count": 0
  53 + },
  54 + {
  55 + "id": "fe2d3681-3461-4e71-a80a-f3755d03db89",
  56 + "data": [
  57 + {
  58 + "text": "Hallo du",
  59 + "userDefined": false
  60 + }
  61 + ],
  62 + "isTemplate": false,
  63 + "count": 0
  64 + },
  65 + {
  66 + "id": "f39e8b17-6baf-4a7f-a130-029ed0486190",
  67 + "data": [
  68 + {
  69 + "text": "Heyho"
  70 + }
  71 + ],
  72 + "isTemplate": false,
  73 + "count": 2
  74 + },
  75 + {
  76 + "id": "8a034279-2ae7-41f8-ace2-0be60fc11843",
  77 + "data": [
  78 + {
  79 + "text": "Hallo Welt"
  80 + }
  81 + ],
  82 + "isTemplate": false,
  83 + "count": 0
  84 + },
  85 + {
  86 + "id": "27ade6fd-22a8-4026-80a0-dc464a133e5d",
  87 + "data": [
  88 + {
  89 + "text": "Guten Tag"
  90 + }
  91 + ],
  92 + "isTemplate": false,
  93 + "count": 1
  94 + },
  95 + {
  96 + "id": "8251e097-7f65-46c8-82d7-4521360823f8",
  97 + "data": [
  98 + {
  99 + "text": "Hello",
  100 + "userDefined": false
  101 + }
  102 + ],
  103 + "isTemplate": false,
  104 + "count": 1
  105 + },
  106 + {
  107 + "id": "7c16e6f9-df2c-44f7-ba9a-36315a5e9f47",
  108 + "data": [
  109 + {
  110 + "text": "Hello Bot",
  111 + "userDefined": false
  112 + }
  113 + ],
  114 + "isTemplate": false,
  115 + "count": 0
  116 + },
  117 + {
  118 + "id": "535a9275-ab39-43f9-87df-431be10d09d5",
  119 + "data": [
  120 + {
  121 + "text": "Tag"
  122 + }
  123 + ],
  124 + "isTemplate": false,
  125 + "count": 0
  126 + },
  127 + {
  128 + "id": "df882ea3-1cdb-4797-8d70-c3b661839f9b",
  129 + "data": [
  130 + {
  131 + "text": "Servus"
  132 + }
  133 + ],
  134 + "isTemplate": false,
  135 + "count": 0
  136 + },
  137 + {
  138 + "id": "0aa700e1-6b51-4921-8c2d-c294ef7769cd",
  139 + "data": [
  140 + {
  141 + "text": "Moin"
  142 + }
  143 + ],
  144 + "isTemplate": false,
  145 + "count": 0
  146 + },
  147 + {
  148 + "id": "9b7d796f-7c54-40f8-a04f-ceaea25d9b94",
  149 + "data": [
  150 + {
  151 + "text": "Hi"
  152 + }
  153 + ],
  154 + "isTemplate": false,
  155 + "count": 0
  156 + }
  157 + ],
  158 + "id": "298d49fa-5122-430d-bd63-ee2d4316274d",
  159 + "name": "Hello",
  160 + "auto": true,
  161 + "contexts": [],
  162 + "responses": [
  163 + {
  164 + "resetContexts": false,
  165 + "affectedContexts": [],
  166 + "parameters": [],
  167 + "messages": [
  168 + {
  169 + "type": 0,
  170 + "speech": []
  171 + }
  172 + ],
  173 + "defaultResponsePlatforms": {}
  174 + }
  175 + ],
  176 + "priority": 500000,
  177 + "webhookUsed": false,
  178 + "webhookForSlotFilling": false,
  179 + "fallbackIntent": false,
  180 + "events": []
  181 +}
0 182 \ No newline at end of file
... ...
docker/rasa_nlu/volumes/data/api/intents/Start.json 0 → 100755
  1 +++ a/docker/rasa_nlu/volumes/data/api/intents/Start.json
  1 +{
  2 + "userSays": [
  3 + {
  4 + "id": "999fcf31-211e-4c43-a48c-200b2cc4ad0f",
  5 + "data": [
  6 + {
  7 + "text": "start",
  8 + "userDefined": false
  9 + }
  10 + ],
  11 + "isTemplate": false,
  12 + "count": 1
  13 + },
  14 + {
  15 + "id": "b0d6aef8-fa8d-4151-b1f2-41162374f60d",
  16 + "data": [
  17 + {
  18 + "text": "/start"
  19 + }
  20 + ],
  21 + "isTemplate": false,
  22 + "count": 1
  23 + },
  24 + {
  25 + "id": "a775b2f8-984a-4e4f-be8e-92dcf9d426a9",
  26 + "data": [
  27 + {
  28 + "text": "Start"
  29 + }
  30 + ],
  31 + "isTemplate": false,
  32 + "count": 1
  33 + }
  34 + ],
  35 + "id": "fd44ae16-5a7d-40d6-9216-cf528db47b93",
  36 + "name": "Start",
  37 + "auto": true,
  38 + "contexts": [],
  39 + "responses": [
  40 + {
  41 + "resetContexts": false,
  42 + "affectedContexts": [],
  43 + "parameters": [],
  44 + "messages": [
  45 + {
  46 + "type": 0,
  47 + "speech": []
  48 + }
  49 + ]
  50 + }
  51 + ],
  52 + "priority": 500000,
  53 + "webhookUsed": false,
  54 + "webhookForSlotFilling": false,
  55 + "fallbackIntent": false,
  56 + "events": []
  57 +}
0 58 \ No newline at end of file
... ...
docker/rasa_nlu/volumes/data/api/intents/showFood.json 0 → 100755
  1 +++ a/docker/rasa_nlu/volumes/data/api/intents/showFood.json
  1 +{
  2 + "userSays": [
  3 + {
  4 + "id": "fd32ca0d-bb7f-4d03-b1c8-5ad41ae4847a",
  5 + "data": [
  6 + {
  7 + "text": "Bitte nur "
  8 + },
  9 + {
  10 + "text": "vegetarisches",
  11 + "alias": "dishtype",
  12 + "meta": "@dishtype",
  13 + "userDefined": false
  14 + }
  15 + ],
  16 + "isTemplate": false,
  17 + "count": 0
  18 + },
  19 + {
  20 + "id": "7b2cce20-9ea4-4532-90f6-d86374d4ece6",
  21 + "data": [
  22 + {
  23 + "text": "Schön "
  24 + },
  25 + {
  26 + "text": "fettig",
  27 + "alias": "healthy",
  28 + "meta": "@healthy",
  29 + "userDefined": false
  30 + }
  31 + ],
  32 + "isTemplate": false,
  33 + "count": 0
  34 + },
  35 + {
  36 + "id": "56891d52-fe5c-4669-b4f4-20d394d0f291",
  37 + "data": [
  38 + {
  39 + "text": "was gibt\u0027s zum "
  40 + },
  41 + {
  42 + "text": "Nachtisch",
  43 + "alias": "dishcategory",
  44 + "meta": "@dishcategory",
  45 + "userDefined": false
  46 + },
  47 + {
  48 + "text": "?"
  49 + }
  50 + ],
  51 + "isTemplate": false,
  52 + "count": 0
  53 + },
  54 + {
  55 + "id": "b85b0135-3a69-4564-9fea-d6dc168673c5",
  56 + "data": [
  57 + {
  58 + "text": "Was gibt es "
  59 + },
  60 + {
  61 + "text": "gesundes",
  62 + "alias": "healthy",
  63 + "meta": "@healthy",
  64 + "userDefined": false
  65 + }
  66 + ],
  67 + "isTemplate": false,
  68 + "count": 0
  69 + },
  70 + {
  71 + "id": "86306079-6fb2-4a85-a024-a415f67d17c2",
  72 + "data": [
  73 + {
  74 + "text": "Wat gibts "
  75 + },
  76 + {
  77 + "text": "gesundes",
  78 + "alias": "healthy",
  79 + "meta": "@healthy",
  80 + "userDefined": false
  81 + }
  82 + ],
  83 + "isTemplate": false,
  84 + "count": 0
  85 + },
  86 + {
  87 + "id": "d3bddb57-2a96-42d4-9517-2fe39b7eb81b",
  88 + "data": [
  89 + {
  90 + "text": "Ick hab Knast"
  91 + }
  92 + ],
  93 + "isTemplate": false,
  94 + "count": 0
  95 + },
  96 + {
  97 + "id": "762b3473-f577-4b6f-9130-4cc36c9fea6c",
  98 + "data": [
  99 + {
  100 + "text": "Man...! Sach mir was es zu "
  101 + },
  102 + {
  103 + "text": "essen",
  104 + "meta": "@sys.ignore",
  105 + "userDefined": false
  106 + },
  107 + {
  108 + "text": " gibt!"
  109 + }
  110 + ],
  111 + "isTemplate": false,
  112 + "count": 0
  113 + },
  114 + {
  115 + "id": "024e9b2b-6030-4e71-8a26-c1b2dcd302d2",
  116 + "data": [
  117 + {
  118 + "text": "Zeig mir "
  119 + },
  120 + {
  121 + "text": "futter",
  122 + "meta": "@sys.ignore",
  123 + "userDefined": false
  124 + }
  125 + ],
  126 + "isTemplate": false,
  127 + "count": 0
  128 + },
  129 + {
  130 + "id": "37884b73-ef5c-4788-8286-48741d1687ab",
  131 + "data": [
  132 + {
  133 + "text": "Was gibbet"
  134 + }
  135 + ],
  136 + "isTemplate": false,
  137 + "count": 0
  138 + },
  139 + {
  140 + "id": "900ae728-5008-4ac1-a27e-9a5663b1f8a0",
  141 + "data": [
  142 + {
  143 + "text": "Grün",
  144 + "alias": "healthy",
  145 + "meta": "@healthy",
  146 + "userDefined": false
  147 + }
  148 + ],
  149 + "isTemplate": false,
  150 + "count": 0
  151 + },
  152 + {
  153 + "id": "add47ed0-8ef8-4ff9-90e6-acdc33ea4b3c",
  154 + "data": [
  155 + {
  156 + "text": "Was gibt es "
  157 + },
  158 + {
  159 + "text": "heute",
  160 + "alias": "date",
  161 + "meta": "@date",
  162 + "userDefined": false
  163 + },
  164 + {
  165 + "text": " zu Essen?"
  166 + }
  167 + ],
  168 + "isTemplate": false,
  169 + "count": 0
  170 + },
  171 + {
  172 + "id": "76068d03-8dfa-4053-a4d7-f9580d7c1269",
  173 + "data": [
  174 + {
  175 + "text": "Gibt es irgendetwas "
  176 + },
  177 + {
  178 + "text": "vegetarisches",
  179 + "alias": "dishtype",
  180 + "meta": "@dishtype",
  181 + "userDefined": false
  182 + },
  183 + {
  184 + "text": "?"
  185 + }
  186 + ],
  187 + "isTemplate": false,
  188 + "count": 0
  189 + },
  190 + {
  191 + "id": "4fe7e652-929b-4a3b-840b-b24e1ecb9fcc",
  192 + "data": [
  193 + {
  194 + "text": "Was gibt es "
  195 + },
  196 + {
  197 + "text": "morgen",
  198 + "alias": "date",
  199 + "meta": "@date",
  200 + "userDefined": false
  201 + },
  202 + {
  203 + "text": " "
  204 + },
  205 + {
  206 + "text": "veganes",
  207 + "alias": "dishtype",
  208 + "meta": "@dishtype",
  209 + "userDefined": false
  210 + },
  211 + {
  212 + "text": "?"
  213 + }
  214 + ],
  215 + "isTemplate": false,
  216 + "count": 0
  217 + },
  218 + {
  219 + "id": "7bac360a-65db-4698-b9fc-81024a052f7c",
  220 + "data": [
  221 + {
  222 + "text": "Was gibt es für "
  223 + },
  224 + {
  225 + "text": "Suppen",
  226 + "alias": "dishcategory",
  227 + "meta": "@dishcategory",
  228 + "userDefined": false
  229 + }
  230 + ],
  231 + "isTemplate": false,
  232 + "count": 0
  233 + },
  234 + {
  235 + "id": "1407d888-0d5a-451b-8d30-6c804dec373c",
  236 + "data": [
  237 + {
  238 + "text": "Welche "
  239 + },
  240 + {
  241 + "text": "Vorspeisen",
  242 + "alias": "dishcategory",
  243 + "meta": "@dishcategory",
  244 + "userDefined": false
  245 + },
  246 + {
  247 + "text": " gibt es "
  248 + },
  249 + {
  250 + "text": "heute",
  251 + "alias": "date",
  252 + "meta": "@date",
  253 + "userDefined": false
  254 + },
  255 + {
  256 + "text": "?"
  257 + }
  258 + ],
  259 + "isTemplate": false,
  260 + "count": 0
  261 + },
  262 + {
  263 + "id": "d7fc8387-d1c6-4ed2-aeeb-a12466ebb7bb",
  264 + "data": [
  265 + {
  266 + "text": "Was gibt es "
  267 + },
  268 + {
  269 + "text": "heute",
  270 + "alias": "date",
  271 + "meta": "@date",
  272 + "userDefined": false
  273 + },
  274 + {
  275 + "text": " zu essen?"
  276 + }
  277 + ],
  278 + "isTemplate": false,
  279 + "count": 0
  280 + },
  281 + {
  282 + "id": "3589c50d-8ec0-4276-aa21-a88145530ddb",
  283 + "data": [
  284 + {
  285 + "text": "Was gibt es zu essen?"
  286 + }
  287 + ],
  288 + "isTemplate": false,
  289 + "count": 0
  290 + },
  291 + {
  292 + "id": "1f9d235d-eaae-4999-b5d2-0d19720e90e9",
  293 + "data": [
  294 + {
  295 + "text": "Zeige mir "
  296 + },
  297 + {
  298 + "text": "gesunde",
  299 + "alias": "healthy",
  300 + "meta": "@healthy",
  301 + "userDefined": true
  302 + },
  303 + {
  304 + "text": " "
  305 + },
  306 + {
  307 + "text": "Hauptgerichte",
  308 + "alias": "dishcategory",
  309 + "meta": "@dishcategory",
  310 + "userDefined": true
  311 + },
  312 + {
  313 + "text": " "
  314 + },
  315 + {
  316 + "text": "unter",
  317 + "alias": "price",
  318 + "meta": "@price",
  319 + "userDefined": true
  320 + },
  321 + {
  322 + "text": " "
  323 + },
  324 + {
  325 + "text": "5",
  326 + "meta": "@sys.ignore",
  327 + "userDefined": true
  328 + },
  329 + {
  330 + "text": " Euro"
  331 + }
  332 + ],
  333 + "isTemplate": false,
  334 + "count": 0
  335 + },
  336 + {
  337 + "id": "8efb4896-f4ff-4864-af90-7e2b594afd4a",
  338 + "data": [
  339 + {
  340 + "text": "Gibt es "
  341 + },
  342 + {
  343 + "text": "heute",
  344 + "alias": "date",
  345 + "meta": "@date",
  346 + "userDefined": true
  347 + },
  348 + {
  349 + "text": " "
  350 + },
  351 + {
  352 + "text": "Hauptgerichte",
  353 + "alias": "dishcategory",
  354 + "meta": "@dishcategory",
  355 + "userDefined": true
  356 + },
  357 + {
  358 + "text": "?"
  359 + }
  360 + ],
  361 + "isTemplate": false,
  362 + "count": 0
  363 + },
  364 + {
  365 + "id": "daab71ce-3882-42e9-8749-30cb4e1b41ee",
  366 + "data": [
  367 + {
  368 + "text": "Gibt es "
  369 + },
  370 + {
  371 + "text": "heute",
  372 + "alias": "date",
  373 + "meta": "@date",
  374 + "userDefined": true
  375 + },
  376 + {
  377 + "text": " "
  378 + },
  379 + {
  380 + "text": "vegetarische",
  381 + "alias": "dishtype",
  382 + "meta": "@dishtype",
  383 + "userDefined": true
  384 + },
  385 + {
  386 + "text": " "
  387 + },
  388 + {
  389 + "text": "Hauptgerichte",
  390 + "alias": "dishcategory",
  391 + "meta": "@dishcategory",
  392 + "userDefined": true
  393 + },
  394 + {
  395 + "text": "?"
  396 + }
  397 + ],
  398 + "isTemplate": false,
  399 + "count": 0
  400 + },
  401 + {
  402 + "id": "ca1f84cc-504e-4c2c-9ba4-b6917653d396",
  403 + "data": [
  404 + {
  405 + "text": "Was für "
  406 + },
  407 + {
  408 + "text": "Hauptgerichte",
  409 + "alias": "dishcategory",
  410 + "meta": "@dishcategory",
  411 + "userDefined": true
  412 + },
  413 + {
  414 + "text": " gibt es "
  415 + },
  416 + {
  417 + "text": "heute",
  418 + "alias": "date",
  419 + "meta": "@date",
  420 + "userDefined": true
  421 + },
  422 + {
  423 + "text": "?"
  424 + }
  425 + ],
  426 + "isTemplate": false,
  427 + "count": 0
  428 + },
  429 + {
  430 + "id": "3635fca1-e08b-49e2-93f5-754244a0b895",
  431 + "data": [
  432 + {
  433 + "text": "Zeige mir "
  434 + },
  435 + {
  436 + "text": "Suppen",
  437 + "alias": "dishcategory",
  438 + "meta": "@dishcategory",
  439 + "userDefined": true
  440 + },
  441 + {
  442 + "text": " für "
  443 + },
  444 + {
  445 + "text": "weniger als",
  446 + "alias": "price",
  447 + "meta": "@price",
  448 + "userDefined": true
  449 + },
  450 + {
  451 + "text": " "
  452 + },
  453 + {
  454 + "text": "2",
  455 + "meta": "@sys.ignore",
  456 + "userDefined": true
  457 + },
  458 + {
  459 + "text": "€"
  460 + }
  461 + ],
  462 + "isTemplate": false,
  463 + "count": 0
  464 + },
  465 + {
  466 + "id": "68051902-f5a0-4c6e-8233-f390cd37299e",
  467 + "data": [
  468 + {
  469 + "text": "Zeige "
  470 + },
  471 + {
  472 + "text": "Hauptgerichte",
  473 + "alias": "dishcategory",
  474 + "meta": "@dishcategory",
  475 + "userDefined": true
  476 + },
  477 + {
  478 + "text": " unter "
  479 + },
  480 + {
  481 + "text": "5",
  482 + "meta": "@sys.ignore",
  483 + "userDefined": true
  484 + },
  485 + {
  486 + "text": " Euro"
  487 + }
  488 + ],
  489 + "isTemplate": false,
  490 + "count": 0
  491 + },
  492 + {
  493 + "id": "76436c32-a320-4e39-929e-74fd301ea362",
  494 + "data": [
  495 + {
  496 + "text": "Was kostet "
  497 + },
  498 + {
  499 + "text": "weniger als",
  500 + "alias": "price",
  501 + "meta": "@price",
  502 + "userDefined": true
  503 + },
  504 + {
  505 + "text": " "
  506 + },
  507 + {
  508 + "text": "5",
  509 + "meta": "@sys.ignore",
  510 + "userDefined": true
  511 + },
  512 + {
  513 + "text": "€?"
  514 + }
  515 + ],
  516 + "isTemplate": false,
  517 + "count": 0
  518 + },
  519 + {
  520 + "id": "fcd4493e-a39e-457b-801b-9514d4312b8c",
  521 + "data": [
  522 + {
  523 + "text": "Was gibt es heute in der Mensa "
  524 + },
  525 + {
  526 + "text": "unter",
  527 + "alias": "price",
  528 + "meta": "@price",
  529 + "userDefined": true
  530 + },
  531 + {
  532 + "text": " "
  533 + },
  534 + {
  535 + "text": "2",
  536 + "meta": "@sys.ignore",
  537 + "userDefined": true
  538 + },
  539 + {
  540 + "text": " Euro?"
  541 + }
  542 + ],
  543 + "isTemplate": false,
  544 + "count": 0
  545 + },
  546 + {
  547 + "id": "c7bccc6f-4bcd-43a7-bf82-6edf055fb9f1",
  548 + "data": [
  549 + {
  550 + "text": "Wie teuer",
  551 + "alias": "price",
  552 + "meta": "@price",
  553 + "userDefined": true
  554 + },
  555 + {
  556 + "text": " ist ein großer "
  557 + },
  558 + {
  559 + "text": "Salat",
  560 + "alias": "dishcategory",
  561 + "meta": "@dishcategory",
  562 + "userDefined": true
  563 + },
  564 + {
  565 + "text": "?"
  566 + }
  567 + ],
  568 + "isTemplate": false,
  569 + "count": 0
  570 + },
  571 + {
  572 + "id": "76d924f8-3ebb-452b-834b-a701d0294112",
  573 + "data": [
  574 + {
  575 + "text": "Was gibt es "
  576 + },
  577 + {
  578 + "text": "über morgen",
  579 + "alias": "date",
  580 + "meta": "@date",
  581 + "userDefined": true
  582 + },
  583 + {
  584 + "text": " in der Mensa?"
  585 + }
  586 + ],
  587 + "isTemplate": false,
  588 + "count": 1
  589 + },
  590 + {
  591 + "id": "03c11ea5-acca-4903-aee3-12ccc005fd27",
  592 + "data": [
  593 + {
  594 + "text": "Was gibt es "
  595 + },
  596 + {
  597 + "text": "morgen",
  598 + "alias": "date",
  599 + "meta": "@date",
  600 + "userDefined": true
  601 + },
  602 + {
  603 + "text": " zu essen?"
  604 + }
  605 + ],
  606 + "isTemplate": false,
  607 + "count": 0
  608 + },
  609 + {
  610 + "id": "659ad693-d0bf-4586-a831-fb9fd83d2f57",
  611 + "data": [
  612 + {
  613 + "text": "Was gibt es am "
  614 + },
  615 + {
  616 + "text": "Dienstag",
  617 + "alias": "date",
  618 + "meta": "@date",
  619 + "userDefined": true
  620 + },
  621 + {
  622 + "text": " zu essen?"
  623 + }
  624 + ],
  625 + "isTemplate": false,
  626 + "count": 0
  627 + },
  628 + {
  629 + "id": "dbfd7a39-dd3c-4d67-8190-5293d17efb72",
  630 + "data": [
  631 + {
  632 + "text": "Was kostet",
  633 + "alias": "price",
  634 + "meta": "@price",
  635 + "userDefined": true
  636 + },
  637 + {
  638 + "text": " die "
  639 + },
  640 + {
  641 + "text": "Currywurst",
  642 + "alias": "ingredients",
  643 + "meta": "@ingredients",
  644 + "userDefined": true
  645 + },
  646 + {
  647 + "text": "?"
  648 + }
  649 + ],
  650 + "isTemplate": false,
  651 + "count": 0
  652 + },
  653 + {
  654 + "id": "e5883e1d-4fba-457a-93d1-8c42827864f3",
  655 + "data": [
  656 + {
  657 + "text": "Habe Lust auf "
  658 + },
  659 + {
  660 + "text": "Suppe",
  661 + "alias": "dishcategory",
  662 + "meta": "@dishcategory",
  663 + "userDefined": true
  664 + },
  665 + {
  666 + "text": ". Gibt es da heute was?"
  667 + }
  668 + ],
  669 + "isTemplate": false,
  670 + "count": 0
  671 + },
  672 + {
  673 + "id": "9133cd15-77ae-456d-b645-f4cb006a6e88",
  674 + "data": [
  675 + {
  676 + "text": "was gibt es "
  677 + },
  678 + {
  679 + "text": "heute",
  680 + "alias": "date",
  681 + "meta": "@date",
  682 + "userDefined": false
  683 + },
  684 + {
  685 + "text": " in der mensa"
  686 + }
  687 + ],
  688 + "isTemplate": false,
  689 + "count": 23
  690 + },
  691 + {
  692 + "id": "d9491ecb-a4ef-4890-8c11-e1a74e3f6821",
  693 + "data": [
  694 + {
  695 + "text": "was gibt es "
  696 + },
  697 + {
  698 + "text": "heute",
  699 + "alias": "date",
  700 + "meta": "@date",
  701 + "userDefined": false
  702 + },
  703 + {
  704 + "text": " "
  705 + },
  706 + {
  707 + "text": "veganes",
  708 + "alias": "dishtype",
  709 + "meta": "@dishtype",
  710 + "userDefined": false
  711 + },
  712 + {
  713 + "text": " in der mensa"
  714 + }
  715 + ],
  716 + "isTemplate": false,
  717 + "count": 4
  718 + },
  719 + {
  720 + "id": "23bbbd06-8919-49b4-8b77-f4f7167a71fa",
  721 + "data": [
  722 + {
  723 + "text": "Was gibt es "
  724 + },
  725 + {
  726 + "text": "morgen",
  727 + "alias": "date",
  728 + "meta": "@date",
  729 + "userDefined": false
  730 + },
  731 + {
  732 + "text": " für "
  733 + },
  734 + {
  735 + "text": "vegane",
  736 + "alias": "dishtype",
  737 + "meta": "@dishtype",
  738 + "userDefined": true
  739 + },
  740 + {
  741 + "text": " Gerichte?"
  742 + }
  743 + ],
  744 + "isTemplate": false,
  745 + "count": 2
  746 + },
  747 + {
  748 + "id": "d288cb87-12fc-4875-947d-71d6094690ab",
  749 + "data": [
  750 + {
  751 + "text": "Was gibt es "
  752 + },
  753 + {
  754 + "text": "heute",
  755 + "alias": "date",
  756 + "meta": "@date",
  757 + "userDefined": false
  758 + },
  759 + {
  760 + "text": " "
  761 + },
  762 + {
  763 + "text": "vegetarisches",
  764 + "alias": "dishtype",
  765 + "meta": "@dishtype",
  766 + "userDefined": true
  767 + },
  768 + {
  769 + "text": " in der Mensa?"
  770 + }
  771 + ],
  772 + "isTemplate": false,
  773 + "count": 1
  774 + },
  775 + {
  776 + "id": "65af4b91-d76c-4c98-a1d4-5dda5534a374",
  777 + "data": [
  778 + {
  779 + "text": "Hallo Bot was gibt es "
  780 + },
  781 + {
  782 + "text": "morgen",
  783 + "alias": "date",
  784 + "meta": "@date",
  785 + "userDefined": false
  786 + },
  787 + {
  788 + "text": " in der Mensa."
  789 + }
  790 + ],
  791 + "isTemplate": false,
  792 + "count": 0
  793 + },
  794 + {
  795 + "id": "b35b3289-8345-4cf2-8f59-736f2b61004f",
  796 + "data": [
  797 + {
  798 + "text": "Zeige mir alle Gerichte."
  799 + }
  800 + ],
  801 + "isTemplate": false,
  802 + "count": 0
  803 + },
  804 + {
  805 + "id": "70acf56e-8e2d-4d9a-b2d6-12cbc838b2ae",
  806 + "data": [
  807 + {
  808 + "text": "Habe Lust auf "
  809 + },
  810 + {
  811 + "text": "Suppe",
  812 + "alias": "dishcategory",
  813 + "meta": "@dishcategory",
  814 + "userDefined": true
  815 + },
  816 + {
  817 + "text": ". Gibt es da "
  818 + },
  819 + {
  820 + "text": "heute",
  821 + "alias": "date",
  822 + "meta": "@date",
  823 + "userDefined": false
  824 + },
  825 + {
  826 + "text": " was?"
  827 + }
  828 + ],
  829 + "isTemplate": false,
  830 + "count": 0
  831 + },
  832 + {
  833 + "id": "cce7e036-4b08-4a0c-9a4f-219db43e3a18",
  834 + "data": [
  835 + {
  836 + "text": "Was gibt es "
  837 + },
  838 + {
  839 + "text": "morgen",
  840 + "alias": "date",
  841 + "meta": "@date",
  842 + "userDefined": false
  843 + },
  844 + {
  845 + "text": " in der Mensa?"
  846 + }
  847 + ],
  848 + "isTemplate": false,
  849 + "count": 0
  850 + },
  851 + {
  852 + "id": "c87d3aff-b7c1-4ae7-a85e-b7d51081cb7c",
  853 + "data": [
  854 + {
  855 + "text": "Was gab es "
  856 + },
  857 + {
  858 + "text": "gestern",
  859 + "alias": "date",
  860 + "meta": "@date",
  861 + "userDefined": true
  862 + },
  863 + {
  864 + "text": " in der Mensa?"
  865 + }
  866 + ],
  867 + "isTemplate": false,
  868 + "count": 0
  869 + },
  870 + {
  871 + "id": "c37a2f00-d350-4670-b7bb-0b7018c8840a",
  872 + "data": [
  873 + {
  874 + "text": "Was gibt es "
  875 + },
  876 + {
  877 + "text": "übermorgen",
  878 + "alias": "date",
  879 + "meta": "@date",
  880 + "userDefined": false
  881 + },
  882 + {
  883 + "text": " in der Mensa?"
  884 + }
  885 + ],
  886 + "isTemplate": false,
  887 + "count": 1
  888 + },
  889 + {
  890 + "id": "749033aa-ff61-4fc4-8105-2a6e89e9db64",
  891 + "data": [
  892 + {
  893 + "text": "Was gibt es "
  894 + },
  895 + {
  896 + "text": "Freitag",
  897 + "alias": "date",
  898 + "meta": "@date",
  899 + "userDefined": true
  900 + },
  901 + {
  902 + "text": " in der Mensa?"
  903 + }
  904 + ],
  905 + "isTemplate": false,
  906 + "count": 0
  907 + },
  908 + {
  909 + "id": "5db0b947-d27d-452a-b84c-85440876d490",
  910 + "data": [
  911 + {
  912 + "text": "Was gibt es "
  913 + },
  914 + {
  915 + "text": "Donnerstag",
  916 + "alias": "date",
  917 + "meta": "@date",
  918 + "userDefined": true
  919 + },
  920 + {
  921 + "text": " in der Mensa?"
  922 + }
  923 + ],
  924 + "isTemplate": false,
  925 + "count": 0
  926 + },
  927 + {
  928 + "id": "ea2aa68e-3bb7-4902-a56d-36f96275800a",
  929 + "data": [
  930 + {
  931 + "text": "Was gibt es "
  932 + },
  933 + {
  934 + "text": "Mittwoch",
  935 + "alias": "date",
  936 + "meta": "@date",
  937 + "userDefined": true
  938 + },
  939 + {
  940 + "text": " in der Mensa?"
  941 + }
  942 + ],
  943 + "isTemplate": false,
  944 + "count": 0
  945 + },
  946 + {
  947 + "id": "63084452-c279-40ac-b6bc-3baf51fb144f",
  948 + "data": [
  949 + {
  950 + "text": "Was gibt es "
  951 + },
  952 + {
  953 + "text": "Dienstag",
  954 + "alias": "date",
  955 + "meta": "@date",
  956 + "userDefined": true
  957 + },
  958 + {
  959 + "text": " in der Mensa?"
  960 + }
  961 + ],
  962 + "isTemplate": false,
  963 + "count": 0
  964 + },
  965 + {
  966 + "id": "9c35b6e8-ea88-4165-94b0-6be5f83ba76c",
  967 + "data": [
  968 + {
  969 + "text": "Was gibt es "
  970 + },
  971 + {
  972 + "text": "Montag",
  973 + "alias": "date",
  974 + "meta": "@date",
  975 + "userDefined": true
  976 + },
  977 + {
  978 + "text": " in der Mensa?"
  979 + }
  980 + ],
  981 + "isTemplate": false,
  982 + "count": 0
  983 + },
  984 + {
  985 + "id": "900221fa-f3d3-463b-b224-604521c503e3",
  986 + "data": [
  987 + {
  988 + "text": "Was gibt es "
  989 + },
  990 + {
  991 + "text": "heute",
  992 + "alias": "date",
  993 + "meta": "@date",
  994 + "userDefined": false
  995 + },
  996 + {
  997 + "text": " in der Mensa?"
  998 + }
  999 + ],
  1000 + "isTemplate": false,
  1001 + "count": 0
  1002 + },
  1003 + {
  1004 + "id": "0d64638d-fe5d-47c9-807d-1be539af917c",
  1005 + "data": [
  1006 + {
  1007 + "text": "Was gibt es "
  1008 + },
  1009 + {
  1010 + "text": "morgen",
  1011 + "alias": "date",
  1012 + "meta": "@date",
  1013 + "userDefined": false
  1014 + },
  1015 + {
  1016 + "text": " "
  1017 + },
  1018 + {
  1019 + "text": "Ungesundes",
  1020 + "alias": "healthy",
  1021 + "meta": "@healthy",
  1022 + "userDefined": false
  1023 + },
  1024 + {
  1025 + "text": " in der Mensa?"
  1026 + }
  1027 + ],
  1028 + "isTemplate": false,
  1029 + "count": 0
  1030 + },
  1031 + {
  1032 + "id": "8def9d65-14e0-4980-a57f-31be651b8e9f",
  1033 + "data": [
  1034 + {
  1035 + "text": "Was gibt es "
  1036 + },
  1037 + {
  1038 + "text": "heute",
  1039 + "alias": "date",
  1040 + "meta": "@date",
  1041 + "userDefined": false
  1042 + },
  1043 + {
  1044 + "text": " "
  1045 + },
  1046 + {
  1047 + "text": "gesundes",
  1048 + "alias": "healthy",
  1049 + "meta": "@healthy",
  1050 + "userDefined": false
  1051 + },
  1052 + {
  1053 + "text": " in der Mensa?"
  1054 + }
  1055 + ],
  1056 + "isTemplate": false,
  1057 + "count": 0
  1058 + },
  1059 + {
  1060 + "id": "abbe2177-b8e7-4801-9872-3c9a359fa7fb",
  1061 + "data": [
  1062 + {
  1063 + "text": "Was gibt es "
  1064 + },
  1065 + {
  1066 + "text": "morgen",
  1067 + "alias": "date",
  1068 + "meta": "@date",
  1069 + "userDefined": false
  1070 + },
  1071 + {
  1072 + "text": " "
  1073 + },
  1074 + {
  1075 + "text": "vegetarisches",
  1076 + "alias": "dishtype",
  1077 + "meta": "@dishtype",
  1078 + "userDefined": false
  1079 + },
  1080 + {
  1081 + "text": " in der Mensa?"
  1082 + }
  1083 + ],
  1084 + "isTemplate": false,
  1085 + "count": 0
  1086 + },
  1087 + {
  1088 + "id": "4255baf9-704a-4749-a441-0b24d8d716ad",
  1089 + "data": [
  1090 + {
  1091 + "text": "Was gibt es "
  1092 + },
  1093 + {
  1094 + "text": "morgen",
  1095 + "alias": "date",
  1096 + "meta": "@date",
  1097 + "userDefined": false
  1098 + },
  1099 + {
  1100 + "text": " "
  1101 + },
  1102 + {
  1103 + "text": "gesundes",
  1104 + "alias": "healthy",
  1105 + "meta": "@healthy",
  1106 + "userDefined": true
  1107 + },
  1108 + {
  1109 + "text": " in der Mensa?"
  1110 + }
  1111 + ],
  1112 + "isTemplate": false,
  1113 + "count": 0
  1114 + },
  1115 + {
  1116 + "id": "05c9c76f-e7cc-417f-990d-fc9c0c3d202a",
  1117 + "data": [
  1118 + {
  1119 + "text": "Ick hab Hunger..."
  1120 + }
  1121 + ],
  1122 + "isTemplate": false,
  1123 + "count": 0
  1124 + },
  1125 + {
  1126 + "id": "4c28ddca-a35e-475d-967b-bc513645cf19",
  1127 + "data": [
  1128 + {
  1129 + "text": "Zeige Gerichte",
  1130 + "meta": "@sys.ignore",
  1131 + "userDefined": true
  1132 + },
  1133 + {
  1134 + "text": " "
  1135 + },
  1136 + {
  1137 + "text": "ohne Zucker",
  1138 + "alias": "ingredients",
  1139 + "meta": "@ingredients",
  1140 + "userDefined": true
  1141 + }
  1142 + ],
  1143 + "isTemplate": false,
  1144 + "count": 1
  1145 + },
  1146 + {
  1147 + "id": "823222a6-c09c-430d-8164-ac9398a3ae42",
  1148 + "data": [
  1149 + {
  1150 + "text": "Zeige "
  1151 + },
  1152 + {
  1153 + "text": "gesunde",
  1154 + "alias": "healthy",
  1155 + "meta": "@healthy",
  1156 + "userDefined": true
  1157 + },
  1158 + {
  1159 + "text": " Gerichte"
  1160 + }
  1161 + ],
  1162 + "isTemplate": false,
  1163 + "count": 0
  1164 + },
  1165 + {
  1166 + "id": "26104cc6-c7d1-4952-bbe8-ea66c0a608b8",
  1167 + "data": [
  1168 + {
  1169 + "text": "Ich habe "
  1170 + },
  1171 + {
  1172 + "text": "Hunger",
  1173 + "meta": "@sys.ignore",
  1174 + "userDefined": true
  1175 + }
  1176 + ],
  1177 + "isTemplate": false,
  1178 + "count": 1
  1179 + },
  1180 + {
  1181 + "id": "0e61a171-092e-4100-ae11-8e96e4c8eb8a",
  1182 + "data": [
  1183 + {
  1184 + "text": "Was gibt es "
  1185 + },
  1186 + {
  1187 + "text": "veganes",
  1188 + "alias": "dishtype",
  1189 + "meta": "@dishtype",
  1190 + "userDefined": true
  1191 + },
  1192 + {
  1193 + "text": "?"
  1194 + }
  1195 + ],
  1196 + "isTemplate": false,
  1197 + "count": 1
  1198 + },
  1199 + {
  1200 + "id": "9b0d67ca-09ea-4d7d-bc72-342e0e7c5088",
  1201 + "data": [
  1202 + {
  1203 + "text": "Wie ist der aktuelle "
  1204 + },
  1205 + {
  1206 + "text": "Speiseplan",
  1207 + "meta": "@sys.ignore",
  1208 + "userDefined": true
  1209 + }
  1210 + ],
  1211 + "isTemplate": false,
  1212 + "count": 0
  1213 + },
  1214 + {
  1215 + "id": "e4281c8d-f69d-4b90-a12f-d39edc59b052",
  1216 + "data": [
  1217 + {
  1218 + "text": "Habe "
  1219 + },
  1220 + {
  1221 + "text": "Hunger",
  1222 + "meta": "@sys.ignore",
  1223 + "userDefined": false
  1224 + }
  1225 + ],
  1226 + "isTemplate": false,
  1227 + "count": 1
  1228 + },
  1229 + {
  1230 + "id": "f7606b89-2724-41cb-973f-34210fa976fc",
  1231 + "data": [
  1232 + {
  1233 + "text": "Ich möchte gerne etwas "
  1234 + },
  1235 + {
  1236 + "text": "ohne Fleisch",
  1237 + "alias": "dishtype",
  1238 + "meta": "@dishtype",
  1239 + "userDefined": true
  1240 + },
  1241 + {
  1242 + "text": " "
  1243 + },
  1244 + {
  1245 + "text": "essen",
  1246 + "meta": "@sys.ignore",
  1247 + "userDefined": true
  1248 + }
  1249 + ],
  1250 + "isTemplate": false,
  1251 + "count": 0
  1252 + },
  1253 + {
  1254 + "id": "5cb17168-c227-4ac9-ac83-520b70a5252c",
  1255 + "data": [
  1256 + {
  1257 + "text": "Was ist "
  1258 + },
  1259 + {
  1260 + "text": "vegetarisch",
  1261 + "alias": "dishtype",
  1262 + "meta": "@dishtype",
  1263 + "userDefined": true
  1264 + }
  1265 + ],
  1266 + "isTemplate": false,
  1267 + "count": 1
  1268 + },
  1269 + {
  1270 + "id": "1a749580-2d92-4526-9f9c-d5fa76e509eb",
  1271 + "data": [
  1272 + {
  1273 + "text": "Was kann ich "
  1274 + },
  1275 + {
  1276 + "text": "essen",
  1277 + "meta": "@sys.ignore",
  1278 + "userDefined": true
  1279 + }
  1280 + ],
  1281 + "isTemplate": false,
  1282 + "count": 0
  1283 + },
  1284 + {
  1285 + "id": "f49e58ff-4782-4701-9661-07accede286c",
  1286 + "data": [
  1287 + {
  1288 + "text": "Was gibt es "
  1289 + },
  1290 + {
  1291 + "text": "heute",
  1292 + "alias": "date",
  1293 + "meta": "@date",
  1294 + "userDefined": true
  1295 + },
  1296 + {
  1297 + "text": " in der Mensa"
  1298 + }
  1299 + ],
  1300 + "isTemplate": false,
  1301 + "count": 2
  1302 + }
  1303 + ],
  1304 + "id": "fb49a221-02a6-4dff-8da4-9d31cf8f267b",
  1305 + "name": "showFood",
  1306 + "auto": true,
  1307 + "contexts": [],
  1308 + "responses": [
  1309 + {
  1310 + "resetContexts": false,
  1311 + "affectedContexts": [],
  1312 + "parameters": [
  1313 + {
  1314 + "dataType": "@date",
  1315 + "name": "date",
  1316 + "value": "$date",
  1317 + "isList": false
  1318 + },
  1319 + {
  1320 + "dataType": "@dishtype",
  1321 + "name": "dishtype",
  1322 + "value": "$dishtype",
  1323 + "isList": false
  1324 + },
  1325 + {
  1326 + "dataType": "@healthy",
  1327 + "name": "healthy",
  1328 + "value": "$healthy",
  1329 + "isList": false
  1330 + },
  1331 + {
  1332 + "dataType": "@ingredients",
  1333 + "name": "ingredients",
  1334 + "value": "$ingredients",
  1335 + "isList": false
  1336 + },
  1337 + {
  1338 + "dataType": "@price",
  1339 + "name": "price",
  1340 + "value": "$price",
  1341 + "isList": false
  1342 + },
  1343 + {
  1344 + "dataType": "@dishcategory",
  1345 + "name": "dishcategory",
  1346 + "value": "$dishcategory",
  1347 + "isList": false
  1348 + }
  1349 + ],
  1350 + "messages": [
  1351 + {
  1352 + "type": 0,
  1353 + "speech": []
  1354 + }
  1355 + ],
  1356 + "defaultResponsePlatforms": {}
  1357 + }
  1358 + ],
  1359 + "priority": 500000,
  1360 + "webhookUsed": false,
  1361 + "webhookForSlotFilling": false,
  1362 + "fallbackIntent": false,
  1363 + "events": []
  1364 +}
0 1365 \ No newline at end of file
... ...
docker/wildfly/Dockerfile 0 → 100755
  1 +++ a/docker/wildfly/Dockerfile
  1 +FROM jboss/wildfly:10.1.0.Final
  2 +RUN /opt/jboss/wildfly/bin/add-user.sh admin Admin
  3 +COPY standalone.xml /opt/jboss/wildfly/standalone/configuration/standalone.xml
0 4 \ No newline at end of file
... ...
docker/wildfly/standalone.xml 0 → 100755
  1 +++ a/docker/wildfly/standalone.xml
  1 +<?xml version='1.0' encoding='UTF-8'?>
  2 +
  3 +<server xmlns="urn:jboss:domain:4.2">
  4 +
  5 + <extensions>
  6 + <extension module="org.jboss.as.clustering.infinispan"/>
  7 + <extension module="org.jboss.as.connector"/>
  8 + <extension module="org.jboss.as.deployment-scanner"/>
  9 + <extension module="org.jboss.as.ee"/>
  10 + <extension module="org.jboss.as.ejb3"/>
  11 + <extension module="org.jboss.as.jaxrs"/>
  12 + <extension module="org.jboss.as.jdr"/>
  13 + <extension module="org.jboss.as.jmx"/>
  14 + <extension module="org.jboss.as.jpa"/>
  15 + <extension module="org.jboss.as.jsf"/>
  16 + <extension module="org.jboss.as.logging"/>
  17 + <extension module="org.jboss.as.mail"/>
  18 + <extension module="org.jboss.as.naming"/>
  19 + <extension module="org.jboss.as.pojo"/>
  20 + <extension module="org.jboss.as.remoting"/>
  21 + <extension module="org.jboss.as.sar"/>
  22 + <extension module="org.jboss.as.security"/>
  23 + <extension module="org.jboss.as.transactions"/>
  24 + <extension module="org.jboss.as.webservices"/>
  25 + <extension module="org.jboss.as.weld"/>
  26 + <extension module="org.wildfly.extension.batch.jberet"/>
  27 + <extension module="org.wildfly.extension.bean-validation"/>
  28 + <extension module="org.wildfly.extension.io"/>
  29 + <extension module="org.wildfly.extension.messaging-activemq"/>
  30 + <extension module="org.wildfly.extension.request-controller"/>
  31 + <extension module="org.wildfly.extension.security.manager"/>
  32 + <extension module="org.wildfly.extension.undertow"/>
  33 + </extensions>
  34 +
  35 +
  36 + <management>
  37 + <security-realms>
  38 + <security-realm name="ManagementRealm">
  39 + <authentication>
  40 + <local default-user="$local" skip-group-loading="true"/>
  41 + <properties path="mgmt-users.properties" relative-to="jboss.server.config.dir"/>
  42 + </authentication>
  43 + <authorization map-groups-to-roles="false">
  44 + <properties path="mgmt-groups.properties" relative-to="jboss.server.config.dir"/>
  45 + </authorization>
  46 + </security-realm>
  47 + <security-realm name="ApplicationRealm">
  48 + <server-identities>
  49 + <ssl>
  50 + <keystore path="application.keystore" relative-to="jboss.server.config.dir" keystore-password="password" alias="server" key-password="password" generate-self-signed-certificate-host="localhost"/>
  51 + </ssl>
  52 + </server-identities>
  53 + <authentication>
  54 + <local default-user="$local" allowed-users="*" skip-group-loading="true"/>
  55 + <properties path="application-users.properties" relative-to="jboss.server.config.dir"/>
  56 + </authentication>
  57 + <authorization>
  58 + <properties path="application-roles.properties" relative-to="jboss.server.config.dir"/>
  59 + </authorization>
  60 + </security-realm>
  61 + </security-realms>
  62 + <audit-log>
  63 + <formatters>
  64 + <json-formatter name="json-formatter"/>
  65 + </formatters>
  66 + <handlers>
  67 + <file-handler name="file" formatter="json-formatter" path="audit-log.log" relative-to="jboss.server.data.dir"/>
  68 + </handlers>
  69 + <logger log-boot="true" log-read-only="false" enabled="false">
  70 + <handlers>
  71 + <handler name="file"/>
  72 + </handlers>
  73 + </logger>
  74 + </audit-log>
  75 + <management-interfaces>
  76 + <http-interface security-realm="ManagementRealm" http-upgrade-enabled="true">
  77 + <socket-binding http="management-http"/>
  78 + </http-interface>
  79 + </management-interfaces>
  80 + <access-control provider="simple">
  81 + <role-mapping>
  82 + <role name="SuperUser">
  83 + <include>
  84 + <user name="$local"/>
  85 + </include>
  86 + </role>
  87 + </role-mapping>
  88 + </access-control>
  89 + </management>
  90 +
  91 + <profile>
  92 + <subsystem xmlns="urn:jboss:domain:logging:3.0">
  93 + <console-handler name="CONSOLE">
  94 + <level name="DEBUG"/>
  95 + <formatter>
  96 + <named-formatter name="COLOR-PATTERN"/>
  97 + </formatter>
  98 + </console-handler>
  99 + <periodic-rotating-file-handler name="FILE" autoflush="true">
  100 + <formatter>
  101 + <named-formatter name="PATTERN"/>
  102 + </formatter>
  103 + <file relative-to="jboss.server.log.dir" path="server.log"/>
  104 + <suffix value=".yyyy-MM-dd"/>
  105 + <append value="true"/>
  106 + </periodic-rotating-file-handler>
  107 + <logger category="com.arjuna">
  108 + <level name="WARN"/>
  109 + </logger>
  110 + <logger category="org.jboss.as.config">
  111 + <level name="DEBUG"/>
  112 + </logger>
  113 + <logger category="sun.rmi">
  114 + <level name="WARN"/>
  115 + </logger>
  116 + <logger category="de.bht.beuthbot">
  117 + <level name="DEBUG"/>
  118 + </logger>
  119 + <root-logger>
  120 + <level name="INFO"/>
  121 + <handlers>
  122 + <handler name="CONSOLE"/>
  123 + <handler name="FILE"/>
  124 + </handlers>
  125 + </root-logger>
  126 + <formatter name="PATTERN">
  127 + <pattern-formatter pattern="%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n"/>
  128 + </formatter>
  129 + <formatter name="COLOR-PATTERN">
  130 + <pattern-formatter pattern="%K{level}%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n"/>
  131 + </formatter>
  132 + </subsystem>
  133 + <subsystem xmlns="urn:jboss:domain:batch-jberet:1.0">
  134 + <default-job-repository name="in-memory"/>
  135 + <default-thread-pool name="batch"/>
  136 + <job-repository name="in-memory">
  137 + <in-memory/>
  138 + </job-repository>
  139 + <thread-pool name="batch">
  140 + <max-threads count="10"/>
  141 + <keepalive-time time="30" unit="seconds"/>
  142 + </thread-pool>
  143 + </subsystem>
  144 + <subsystem xmlns="urn:jboss:domain:bean-validation:1.0"/>
  145 + <subsystem xmlns="urn:jboss:domain:deployment-scanner:2.0">
  146 + <deployment-scanner path="deployments" relative-to="jboss.server.base.dir" scan-interval="5000" runtime-failure-causes-rollback="${jboss.deployment.scanner.rollback.on.failure:false}"/>
  147 + </subsystem>
  148 + <subsystem xmlns="urn:jboss:domain:ee:4.0">
  149 + <spec-descriptor-property-replacement>false</spec-descriptor-property-replacement>
  150 + <concurrent>
  151 + <context-services>
  152 + <context-service name="default" jndi-name="java:jboss/ee/concurrency/context/default" use-transaction-setup-provider="true"/>
  153 + </context-services>
  154 + <managed-thread-factories>
  155 + <managed-thread-factory name="default" jndi-name="java:jboss/ee/concurrency/factory/default" context-service="default"/>
  156 + </managed-thread-factories>
  157 + <managed-executor-services>
  158 + <managed-executor-service name="default" jndi-name="java:jboss/ee/concurrency/executor/default" context-service="default" hung-task-threshold="60000" keepalive-time="5000"/>
  159 + </managed-executor-services>
  160 + <managed-scheduled-executor-services>
  161 + <managed-scheduled-executor-service name="default" jndi-name="java:jboss/ee/concurrency/scheduler/default" context-service="default" hung-task-threshold="60000" keepalive-time="3000"/>
  162 + </managed-scheduled-executor-services>
  163 + </concurrent>
  164 + <default-bindings context-service="java:jboss/ee/concurrency/context/default" datasource="java:jboss/datasources/ExampleDS" jms-connection-factory="java:jboss/DefaultJMSConnectionFactory" managed-executor-service="java:jboss/ee/concurrency/executor/default" managed-scheduled-executor-service="java:jboss/ee/concurrency/scheduler/default" managed-thread-factory="java:jboss/ee/concurrency/factory/default"/>
  165 + </subsystem>
  166 + <subsystem xmlns="urn:jboss:domain:ejb3:4.0">
  167 + <session-bean>
  168 + <stateless>
  169 + <bean-instance-pool-ref pool-name="slsb-strict-max-pool"/>
  170 + </stateless>
  171 + <stateful default-access-timeout="5000" cache-ref="simple" passivation-disabled-cache-ref="simple"/>
  172 + <singleton default-access-timeout="5000"/>
  173 + </session-bean>
  174 + <mdb>
  175 + <resource-adapter-ref resource-adapter-name="${ejb.resource-adapter-name:activemq-ra.rar}"/>
  176 + <bean-instance-pool-ref pool-name="mdb-strict-max-pool"/>
  177 + </mdb>
  178 + <pools>
  179 + <bean-instance-pools>
  180 + <strict-max-pool name="slsb-strict-max-pool" derive-size="from-worker-pools" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
  181 + <strict-max-pool name="mdb-strict-max-pool" derive-size="from-cpu-count" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
  182 + </bean-instance-pools>
  183 + </pools>
  184 + <caches>
  185 + <cache name="simple"/>
  186 + <cache name="distributable" passivation-store-ref="infinispan" aliases="passivating clustered"/>
  187 + </caches>
  188 + <passivation-stores>
  189 + <passivation-store name="infinispan" cache-container="ejb" max-size="10000"/>
  190 + </passivation-stores>
  191 + <async thread-pool-name="default"/>
  192 + <timer-service thread-pool-name="default" default-data-store="default-file-store">
  193 + <data-stores>
  194 + <file-data-store name="default-file-store" path="timer-service-data" relative-to="jboss.server.data.dir"/>
  195 + </data-stores>
  196 + </timer-service>
  197 + <remote connector-ref="http-remoting-connector" thread-pool-name="default"/>
  198 + <thread-pools>
  199 + <thread-pool name="default">
  200 + <max-threads count="10"/>
  201 + <keepalive-time time="100" unit="milliseconds"/>
  202 + </thread-pool>
  203 + </thread-pools>
  204 + <default-security-domain value="other"/>
  205 + <default-missing-method-permissions-deny-access value="true"/>
  206 + <log-system-exceptions value="true"/>
  207 + </subsystem>
  208 + <subsystem xmlns="urn:jboss:domain:io:1.1">
  209 + <worker name="default"/>
  210 + <buffer-pool name="default"/>
  211 + </subsystem>
  212 + <subsystem xmlns="urn:jboss:domain:infinispan:4.0">
  213 + <cache-container name="server" default-cache="default" module="org.wildfly.clustering.server">
  214 + <local-cache name="default">
  215 + <transaction mode="BATCH"/>
  216 + </local-cache>
  217 + </cache-container>
  218 + <cache-container name="web" default-cache="passivation" module="org.wildfly.clustering.web.infinispan">
  219 + <local-cache name="passivation">
  220 + <locking isolation="REPEATABLE_READ"/>
  221 + <transaction mode="BATCH"/>
  222 + <file-store passivation="true" purge="false"/>
  223 + </local-cache>
  224 + <local-cache name="persistent">
  225 + <locking isolation="REPEATABLE_READ"/>
  226 + <transaction mode="BATCH"/>
  227 + <file-store passivation="false" purge="false"/>
  228 + </local-cache>
  229 + <local-cache name="concurrent">
  230 + <file-store passivation="true" purge="false"/>
  231 + </local-cache>
  232 + </cache-container>
  233 + <cache-container name="ejb" aliases="sfsb" default-cache="passivation" module="org.wildfly.clustering.ejb.infinispan">
  234 + <local-cache name="passivation">
  235 + <locking isolation="REPEATABLE_READ"/>
  236 + <transaction mode="BATCH"/>
  237 + <file-store passivation="true" purge="false"/>
  238 + </local-cache>
  239 + <local-cache name="persistent">
  240 + <locking isolation="REPEATABLE_READ"/>
  241 + <transaction mode="BATCH"/>
  242 + <file-store passivation="false" purge="false"/>
  243 + </local-cache>
  244 + </cache-container>
  245 + <cache-container name="hibernate" default-cache="local-query" module="org.hibernate.infinispan">
  246 + <local-cache name="entity">
  247 + <transaction mode="NON_XA"/>
  248 + <eviction strategy="LRU" max-entries="10000"/>
  249 + <expiration max-idle="100000"/>
  250 + </local-cache>
  251 + <local-cache name="local-query">
  252 + <eviction strategy="LRU" max-entries="10000"/>
  253 + <expiration max-idle="100000"/>
  254 + </local-cache>
  255 + <local-cache name="timestamps"/>
  256 + </cache-container>
  257 + <cache-container name="app-caches">
  258 + <local-cache name="mensaCache">
  259 + <!-- 30' cache -->
  260 + <expiration lifespan="1800000" />
  261 + </local-cache>
  262 + <local-cache name="tokenCache">
  263 + <!-- 9' cache -->
  264 + <expiration lifespan="540" />
  265 + </local-cache>
  266 + <local-cache name="sessionCache">
  267 + <!-- 12h idle cache -->
  268 + <expiration max-idle="43200000" />
  269 + <file-store preload="true" path="/tmp/chatbot-sessions">
  270 + <write-behind />
  271 + </file-store>
  272 + </local-cache>
  273 + </cache-container>
  274 + </subsystem>
  275 + <subsystem xmlns="urn:jboss:domain:jaxrs:1.0"/>
  276 + <subsystem xmlns="urn:jboss:domain:jca:4.0">
  277 + <archive-validation enabled="true" fail-on-error="true" fail-on-warn="false"/>
  278 + <bean-validation enabled="true"/>
  279 + <default-workmanager>
  280 + <short-running-threads>
  281 + <core-threads count="50"/>
  282 + <queue-length count="50"/>
  283 + <max-threads count="50"/>
  284 + <keepalive-time time="10" unit="seconds"/>
  285 + </short-running-threads>
  286 + <long-running-threads>
  287 + <core-threads count="50"/>
  288 + <queue-length count="50"/>
  289 + <max-threads count="50"/>
  290 + <keepalive-time time="10" unit="seconds"/>
  291 + </long-running-threads>
  292 + </default-workmanager>
  293 + <cached-connection-manager/>
  294 + </subsystem>
  295 + <subsystem xmlns="urn:jboss:domain:jdr:1.0"/>
  296 + <subsystem xmlns="urn:jboss:domain:jmx:1.3">
  297 + <expose-resolved-model/>
  298 + <expose-expression-model/>
  299 + <remoting-connector/>
  300 + </subsystem>
  301 + <subsystem xmlns="urn:jboss:domain:jpa:1.1">
  302 + <jpa default-datasource="" default-extended-persistence-inheritance="DEEP"/>
  303 + </subsystem>
  304 + <subsystem xmlns="urn:jboss:domain:jsf:1.0"/>
  305 + <subsystem xmlns="urn:jboss:domain:mail:2.0">
  306 + <mail-session name="default" jndi-name="java:jboss/mail/Default">
  307 + <smtp-server outbound-socket-binding-ref="mail-smtp"/>
  308 + </mail-session>
  309 + </subsystem>
  310 + <subsystem xmlns="urn:jboss:domain:messaging-activemq:1.0">
  311 + <server name="default">
  312 + <http-connector name="http-connector" socket-binding="http" endpoint="http-acceptor"/>
  313 + <http-connector name="http-connector-throughput" socket-binding="http" endpoint="http-acceptor-throughput">
  314 + <param name="batch-delay" value="50"/>
  315 + </http-connector>
  316 + <in-vm-connector name="in-vm" server-id="0"/>
  317 + <http-acceptor name="http-acceptor" http-listener="default"/>
  318 + <http-acceptor name="http-acceptor-throughput" http-listener="default">
  319 + <param name="batch-delay" value="50"/>
  320 + <param name="direct-deliver" value="false"/>
  321 + </http-acceptor>
  322 + <in-vm-acceptor name="in-vm" server-id="0"/>
  323 + <jms-topic name="messagesInbox" entries="java:/jms/messages/inbox"/>
  324 + <connection-factory name="InVmConnectionFactory" entries="java:/ConnectionFactory" connectors="in-vm"/>
  325 + <pooled-connection-factory name="activemq-ra" entries="java:/JmsXA java:jboss/DefaultJMSConnectionFactory" connectors="in-vm" transaction="xa"/>
  326 + </server>
  327 + </subsystem>
  328 + <subsystem xmlns="urn:jboss:domain:naming:2.0">
  329 + <remote-naming/>
  330 + </subsystem>
  331 + <subsystem xmlns="urn:jboss:domain:pojo:1.0"/>
  332 + <subsystem xmlns="urn:jboss:domain:remoting:3.0">
  333 + <endpoint/>
  334 + <http-connector name="http-remoting-connector" connector-ref="default" security-realm="ApplicationRealm"/>
  335 + </subsystem>
  336 + <subsystem xmlns="urn:jboss:domain:resource-adapters:4.0"/>
  337 + <subsystem xmlns="urn:jboss:domain:request-controller:1.0"/>
  338 + <subsystem xmlns="urn:jboss:domain:sar:1.0"/>
  339 + <subsystem xmlns="urn:jboss:domain:security-manager:1.0">
  340 + <deployment-permissions>
  341 + <maximum-set>
  342 + <permission class="java.security.AllPermission"/>
  343 + </maximum-set>
  344 + </deployment-permissions>
  345 + </subsystem>
  346 + <subsystem xmlns="urn:jboss:domain:security:1.2">
  347 + <security-domains>
  348 + <security-domain name="other" cache-type="default">
  349 + <authentication>
  350 + <login-module code="Remoting" flag="optional">
  351 + <module-option name="password-stacking" value="useFirstPass"/>
  352 + </login-module>
  353 + <login-module code="RealmDirect" flag="required">
  354 + <module-option name="password-stacking" value="useFirstPass"/>
  355 + </login-module>
  356 + </authentication>
  357 + </security-domain>
  358 + <security-domain name="jboss-web-policy" cache-type="default">
  359 + <authorization>
  360 + <policy-module code="Delegating" flag="required"/>
  361 + </authorization>
  362 + </security-domain>
  363 + <security-domain name="jboss-ejb-policy" cache-type="default">
  364 + <authorization>
  365 + <policy-module code="Delegating" flag="required"/>
  366 + </authorization>
  367 + </security-domain>
  368 + <security-domain name="jaspitest" cache-type="default">
  369 + <authentication-jaspi>
  370 + <login-module-stack name="dummy">
  371 + <login-module code="Dummy" flag="optional"/>
  372 + </login-module-stack>
  373 + <auth-module code="Dummy"/>
  374 + </authentication-jaspi>
  375 + </security-domain>
  376 + </security-domains>
  377 + </subsystem>
  378 + <subsystem xmlns="urn:jboss:domain:transactions:3.0">
  379 + <core-environment>
  380 + <process-id>
  381 + <uuid/>
  382 + </process-id>
  383 + </core-environment>
  384 + <recovery-environment socket-binding="txn-recovery-environment" status-socket-binding="txn-status-manager"/>
  385 + </subsystem>
  386 + <subsystem xmlns="urn:jboss:domain:undertow:3.1">
  387 + <buffer-cache name="default"/>
  388 + <server name="default-server">
  389 + <http-listener name="default" socket-binding="http" redirect-socket="https" enable-http2="true"/>
  390 + <https-listener name="https" socket-binding="https" security-realm="ApplicationRealm" enable-http2="true"/>
  391 + <host name="default-host" alias="localhost">
  392 + <location name="/" handler="welcome-content"/>
  393 + <filter-ref name="server-header"/>
  394 + <filter-ref name="x-powered-by-header"/>
  395 + </host>
  396 + </server>
  397 + <servlet-container name="default">
  398 + <jsp-config/>
  399 + <websockets/>
  400 + </servlet-container>
  401 + <handlers>
  402 + <file name="welcome-content" path="${jboss.home.dir}/welcome-content"/>
  403 + </handlers>
  404 + <filters>
  405 + <response-header name="server-header" header-name="Server" header-value="WildFly/10"/>
  406 + <response-header name="x-powered-by-header" header-name="X-Powered-By" header-value="Undertow/1"/>
  407 + </filters>
  408 + </subsystem>
  409 + <subsystem xmlns="urn:jboss:domain:webservices:2.0">
  410 + <wsdl-host>${jboss.bind.address:127.0.0.1}</wsdl-host>
  411 + <endpoint-config name="Standard-Endpoint-Config"/>
  412 + <endpoint-config name="Recording-Endpoint-Config">
  413 + <pre-handler-chain name="recording-handlers" protocol-bindings="##SOAP11_HTTP ##SOAP11_HTTP_MTOM ##SOAP12_HTTP ##SOAP12_HTTP_MTOM">
  414 + <handler name="RecordingHandler" class="org.jboss.ws.common.invocation.RecordingServerHandler"/>
  415 + </pre-handler-chain>
  416 + </endpoint-config>
  417 + <client-config name="Standard-Client-Config"/>
  418 + </subsystem>
  419 + <subsystem xmlns="urn:jboss:domain:weld:3.0"/>
  420 + </profile>
  421 +
  422 + <interfaces>
  423 + <interface name="management">
  424 + <inet-address value="${jboss.bind.address.management:127.0.0.1}"/>
  425 + </interface>
  426 + <interface name="public">
  427 + <inet-address value="${jboss.bind.address:127.0.0.1}"/>
  428 + </interface>
  429 + </interfaces>
  430 +
  431 + <socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
  432 + <socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9990}"/>
  433 + <socket-binding name="management-https" interface="management" port="${jboss.management.https.port:9993}"/>
  434 + <socket-binding name="ajp" port="${jboss.ajp.port:8009}"/>
  435 + <socket-binding name="http" port="${jboss.http.port:8080}"/>
  436 + <socket-binding name="https" port="${jboss.https.port:8443}"/>
  437 + <socket-binding name="txn-recovery-environment" port="4712"/>
  438 + <socket-binding name="txn-status-manager" port="4713"/>
  439 + <outbound-socket-binding name="mail-smtp">
  440 + <remote-destination host="localhost" port="25"/>
  441 + </outbound-socket-binding>
  442 + </socket-binding-group>
  443 +
  444 +</server>
... ...
docker/wildfly/volumes/conf/README.md 0 → 100755
  1 +++ a/docker/wildfly/volumes/conf/README.md
  1 +## Conf Directory
  2 +This is the conf directory which holds the BeuthBot runtime configuration and will be mounted into the docker wildfly container.
0 3 \ No newline at end of file
... ...
docker/wildfly/volumes/conf/beuthbot.properties 0 → 100755
  1 +++ a/docker/wildfly/volumes/conf/beuthbot.properties
  1 +WEB_URL = https://yourdomain.com
  2 +
  3 +
  4 +# Webhook token you set in the Facebook App Settings
  5 +FACEBOOK_WEBHOOK_TOKEN = bhtchatbot
  6 +
  7 +# Facebook Message Token for your page
  8 +FACEBOOK_BOT_TOKEN = XXXXX
  9 +
  10 +FACEBOOK_ACCESS_TOKEN = XXXXX|XXXXX-XXXXX
  11 +
  12 +
  13 +
  14 +# API.ai client token
  15 +API_AI_TOKEN = XXXXX
  16 +
  17 +
  18 +# Your WebHook URL e.g.: https://yourdomain.com/webhook/
  19 +TELEGRAM_WEBHOOK_URL = /telegram/getUpdates
  20 +
  21 +
  22 +# Your Bot Token e.g.: 000000000:AAAAa0aAA_aaA-Aaaa0A0Aa_a0aa0A0AAAA
  23 +TELEGRAM_BOT_TOKEN = XXXXX:XXXXX-XXXXX
  24 +
  25 +
  26 +
  27 +BING_SPEECH_LOCALE = global
  28 +
  29 +BING_SPEECH_GUID = XXXXX
  30 +
  31 +BING_SPEECH_SECRET_KEY = XXXXX
  32 +
  33 +
  34 +LOCAL_ATTACHMENT_PATH = /tmp/bhtchatbot/attachments
  35 +
  36 +RASA_URL = http://rasa_nlu:5000
  37 +
  38 +RASA_UNIT_ON = on
  39 +APIAI_UNIT_ON = on
  40 +FACEBOOK_UNIT_ON = on
  41 +TELEGRAM_UNIT_ON = on
  42 +MAINBOT_UNIT_ON = on
  43 +BING_UNIT_ON = on
0 44 \ No newline at end of file
... ...
docker/wildfly/volumes/deployments/README.md 0 → 100755
  1 +++ a/docker/wildfly/volumes/deployments/README.md
  1 +## Deployment Directory
  2 +This is the deployment directory which will be mounted into the docker wildfly container.
0 3 \ No newline at end of file
... ...
docker/wildfly/volumes/logs/README.md 0 → 100755
  1 +++ a/docker/wildfly/volumes/logs/README.md
  1 +## Log Directory
  2 +This is the log directory which will be mounted into the docker wildfly container.
0 3 \ No newline at end of file
... ...
docu/apiai.md 0 → 100755
  1 +++ a/docu/apiai.md
  1 +# api.ai API
  2 +
  3 +<!-- MarkdownTOC -->
  4 +
  5 +- [api.ai Setup](#api.ai-setup)
  6 +- [Bot Setup](#bot-setup)
  7 +- [About apiai package](#about-apiai-package)
  8 +- [Used online sources](#used-online-sources)
  9 +
  10 +<!-- /MarkdownTOC -->
  11 +
  12 +## api.ai Setup
  13 +
  14 +- Create new [api.ai Account](https://console.api.ai/api-client)
  15 +- Add a new agent "BHT-Chatbot"
  16 +- You can import our agent settings(which include all intents and entities we created) under 'Settings'->'Export and Import', search agents in the agent list or create an own one
  17 +- Our settings are located under src\main\docker\rasa_nlu\volumes\data\api ... put them into a zip and you are able to upload them as described above
  18 +- The 'Training'-tab helps you to improve your bot in understanding requests
  19 +
  20 +## Bot Setup
  21 +- Get your 'Client access token' in the api.ai agent settings and place it under 'API_AI_TOKEN' in the 'config.properties'
  22 +- If necessary, change the context and language in 'ApiAiConnector'->'onMessage'
  23 +
  24 +## About apiai package
  25 +
  26 +- The 'model' directory contains java classes which represent the json-response we get from api.ai requests, which makes it possible to parse these jsons into java classes
  27 +- ApiAiResponse implements NLUResponse and makes it possible to access the intents and entities of api.ai's answer
  28 +- <b>IMPORTANT:</b> 'Parameters' contains the entities given by api.ai and has to be changed on changes of the entities at your api.ai agent
  29 +- ApiAiMessage contains the given BotMessage but also the ApiAiResponse to send both to Drools
  30 +
  31 +## Used online sources
  32 +- [api.ai Docs](https://api.ai/docs/getting-started/basics)
0 33 \ No newline at end of file
... ...
docu/attachmentstore.md 0 → 100755
  1 +++ a/docu/attachmentstore.md
  1 +# AttachmentStore
  2 +
  3 +<!-- MarkdownTOC -->
  4 +
  5 +- [Description](#desription)
  6 +- [Functionality](#functionality)
  7 +- [AttachmentService](#attachmentService)
  8 +
  9 +<!-- /MarkdownTOC -->
  10 +
  11 +## Description
  12 +
  13 +The AttachmentStore represents a Service to persist Data in any variation. For example: an audio-file from a messenger need to be stored locally to be processed further.
  14 +
  15 +## Functionality
  16 +
  17 +* storing voice/audio files locally
  18 +** you can give FileURIs or ByteArrayOutputStreams
  19 +* create and return file pathes (local)
  20 +* create and return FileURIs for GET requests
  21 +
  22 +## AttachmentService
  23 +
  24 +* the AttachmentService is simple REST Service to provide the data upload via GET requests.
0 25 \ No newline at end of file
... ...
docu/bingspeechapi.md 0 → 100755
  1 +++ a/docu/bingspeechapi.md
  1 +# Bing Speech API
  2 +
  3 +Step by step Guide.
  4 +<!-- MarkdownTOC -->
  5 +
  6 +- [Requirements](#requirements)
  7 +- [Microsoft Azure](#microsoft-azure-registration)
  8 + - [Registration](#registration)
  9 + - [Subscription plan](#subscription-plan)
  10 + - [Bing Speech Service](#bing-speech-service)
  11 +- [BingConnector](#bing-connector)
  12 +- [Used online sources](#used-online-sources)
  13 +
  14 +<!-- /MarkdownTOC -->
  15 +
  16 +## Requirements
  17 +
  18 +- Valid Credit Card
  19 + - Service can be used for free! But you need to deposit a payment method.
  20 +
  21 +## Microsoft Azure
  22 +
  23 +### Registration
  24 +
  25 +- Create new [Azure](https://azure.microsoft.com/de-de/free/) Account
  26 +
  27 +![Azure Registration](img/bing/azure-registration.png)
  28 +
  29 +- Deposit a Payment Method - e.g. Credit Card
  30 + - You will receive 170 Euro welcome bonus for the first month. (You have to spend that in this month)
  31 +- [Log-In](https://portal.azure.com/#dashboard/private) with your new Account
  32 +
  33 +### Subscription plan
  34 +
  35 +- You have two options:
  36 + 1. Use your free trial subscription (ends after 30 days)
  37 + - Go back to Azure Dashboard
  38 +
  39 + 2. Create a new subscription (recommended)
  40 +
  41 + - Create new subscription for user-based payment
  42 +
  43 + ![Billing Menu](img/bing/billing-menu.png)
  44 +
  45 + - Click on that ![Manage Button](img/bing/manage-btn.png) button
  46 + - Create new subscription for user-based payment
  47 + - Go back to Azure Dashboard
  48 +
  49 +### Bing Speech Service
  50 +
  51 +- Create a new Bing Speech Service (initialization might take a while)
  52 +
  53 + - Choose your subscription plan
  54 + - Choose your pricing plan (here you should choose the F0 - free tier - for 5k calls in a month)
  55 +
  56 +![Create Service](img/bing/create-new-bing-speech-service.png)
  57 +
  58 +- Go back to Azure Dashboard and click on your new Service
  59 +- The secret keys and your subscription id is necessary for your authentication. You have to copy & paste them to your config.properties
  60 +
  61 +![Bing Speech Service](img/bing/bing-speech-service-dashboard.png)
  62 +
  63 +## Bing Connector
  64 +
  65 +- For Text to Speech and Speech to Text requests.
  66 +
  67 +```java
  68 +public class BingConnector implements MessageListener {
  69 +
  70 + private void generateAccesToken(){}
  71 +
  72 + private void sendSpeechToTextRequest(final BotMessage botMessage){}
  73 +
  74 + private void sendTextToSpeechRequest(final BotMessage botMessage){}
  75 +}
  76 +```
  77 +
  78 +- AccessToken is required to successfully send parsing-request. Token generates from secret-keys mentioned above.
  79 +- AccessToken decays after 10 mins. You need to refresh the Token.
  80 +
  81 +__Important:__ Speech to Text REST requests need to have **_Transfer-Endcoding: chunked_** Header!
  82 +
  83 +## Used online sources
  84 +- [Bing Speech API overview](https://docs.microsoft.com/de-de/azure/cognitive-services/speech/home)
0 85 \ No newline at end of file
... ...
docu/canteenParser.md 0 → 100755
  1 +++ a/docu/canteenParser.md
  1 +# Canteen Parser with JSoup
  2 +
  3 +<!-- MarkdownTOC -->
  4 +
  5 +- [Installation](#installation)
  6 +- [Procedure](#procedure)
  7 +- [Result](#result)
  8 +
  9 +<!-- /MarkdownTOC -->
  10 +
  11 +JSoup is a Java library for working with real-world HTML. It provides a very convenient API for extracting and manipulating data, using the best of DOM, CSS, and jquery-like methods.
  12 +
  13 +[Jsoup: Java HTML Parser](https://jsoup.org/)
  14 +
  15 +## Installation
  16 +Just add the following line to your gradle dependencies in your build.gradle and refresh the project.
  17 +```gradle
  18 +compile "org.jsoup:jsoup:1.10.2"
  19 +```
  20 +
  21 +## Procedure
  22 +The parser collects data of the beuth university canteen in the Luxemburger Straße 9, 13353 Berlin.
  23 +To get the requested data, the parser has to navigate through the single pages.
  24 +
  25 +To get data for two weeks, we have to call a page for every day. So at first we have to get all dates for the current and the next week.
  26 +
  27 +The other thing we need is the `resource_id` for the canteen we like to parse. In our case it's the `527`.
  28 +
  29 +If we have the dates we wish to parse and the correct resource_id for our canteen, we loop the dates and call the URL:
  30 +`https://www.stw.berlin/xhr/speiseplan-wochentag.html`
  31 +with the date and resource_id as params.
  32 +
  33 +After calling:
  34 +```java
  35 +Document doc = Jsoup.connect("https://www.stw.berlin/xhr/speiseplan-wochentag.html").data(params).userAgent("Mozilla").post();
  36 +```
  37 +where params represents a string map containing the resource_id and the requested date, we got an Document which we can parse to get all needed data.
  38 +
  39 +The Parser is called right before a given message needs to be checked by the drools rules.
  40 +
  41 +## Result
  42 +As a result we got a CanteenData object containing information of dishes for the current and next week.
0 43 \ No newline at end of file
... ...
docu/drools.md 0 → 100755
  1 +++ a/docu/drools.md
  1 +#Drools
  2 +
  3 +<!-- MarkdownTOC -->
  4 +
  5 +- [examples](#examples)
  6 +- [preparation](#preparation)
  7 +- [kmodule](#kmodule)
  8 +- [rule](#rule)
  9 +- [usage](#usage)
  10 +
  11 +<!-- /MarkdownTOC -->
  12 +
  13 +Official documentation:
  14 +[Drools documentation](https://docs.jboss.org/drools/release/7.0.0.Final/drools-docs/html_single/index.html)
  15 +
  16 +## examples
  17 +On the bottom of the [drools website](https://www.drools.org/) you can find a ZIP with many examples.
  18 +Just download it and follow the instructions to execute the instructions given on this page.
  19 +
  20 +###preparation
  21 +Befor we can start, we need to edit our build.gradle as follows:
  22 +```gradle
  23 +repositories {
  24 + mavenCentral()
  25 + maven {
  26 + url 'https://repository.jboss.org/nexus/content/groups/public/'
  27 + }
  28 +}
  29 +
  30 +dependencies {
  31 + compile "org.drools:drools-compiler:7.0.0.Final"
  32 +}
  33 +```
  34 +We have to set a dependency and declare another maven repository. The installation doesn't work with the standard mavenCentral() repository.
  35 +
  36 +###kmodule
  37 +Another thing what we need is the `kmodule.xml` file. A config file for drools to know, which rules-file to use.
  38 +This file has to be saved under `resources/META-INF/`.
  39 +```xml
  40 +<?xml version="1.0" encoding="UTF-8"?>
  41 +<kmodule xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  42 + xmlns="http://www.drools.org/xsd/kmodule">
  43 + <kbase name="TestKB" packages="my.example.de">
  44 + <ksession name="TestKS"/>
  45 + </kbase>
  46 +</kmodule>
  47 +```
  48 +
  49 +###rule
  50 +Rules are defined in Drools via .drl files and has to be saved in the `resources` folder. Such a file could look like this:
  51 +```drools
  52 +import my.example.de.TestObject
  53 +import my.example.de.TextEnum;
  54 +
  55 +global my.example.de.TestKlasse testKlasse
  56 +
  57 +rule "Test Rule"
  58 + dialect "java"
  59 + when
  60 + m : TestObject( attribute.equals("Test") )
  61 + then
  62 + modify ( m ) { setAnotherAttribute("Test successful" )};
  63 +end
  64 +
  65 +rule "Greeting"
  66 + dialect "java"
  67 + when
  68 + m : TestObject( attribute.equals(TestEnum.GREETING.getText()))
  69 + then
  70 + modify ( m ) { setAnotherAttribute(testKlasse.getGreetingMsg())};
  71 +end
  72 +```
  73 +If we want to use caches or similar objects, we have to set them as global variables.
  74 +This is shown by the line `global my.example.de.TestKlasse testKlasse`.
  75 +
  76 +All rules in a drools-file are processed on an object, if the `when`-block fits for the given object.
  77 +
  78 +After `rule` we give our rules names.
  79 +
  80 +There are two possible dialects in drools-files. Default is `java` and the other one is `mvel`.
  81 +
  82 +The `when`-block checks if a given object fits for this rule and in the `then`-block you can do stuff if conditions are met.
  83 +
  84 +###usage
  85 +Now, that we've set the necessary dependencies and defined some rules, we can start and use our rules on some objects.
  86 +```
  87 + // KieServices is the factory for all KIE services
  88 + KieServices ks = KieServices.Factory.get();
  89 +
  90 + // From the kie services, a container is created from the classpath
  91 + KieContainer kc = ks.getKieClasspathContainer();
  92 +
  93 + // From the container, a session is created based on
  94 + // its definition and configuration in the META-INF/kmodule.xml file
  95 + KieSession ksession = kc.newKieSession("TestKS");
  96 +
  97 + // Once the session is created, the application can interact with it
  98 + // In this case it is setting a global as defined in the
  99 + // org/drools/examples/helloworld/HelloWorld.drl file
  100 + Testklasse testKlasse = new TestKlasse();
  101 + ksession.setGlobal("testKlasse", testKlasse);
  102 +
  103 + // Object, to fire rules on
  104 + TestObject testObject = new TestObject();
  105 +
  106 + // The application can insert facts into the session
  107 + ksession.insert(testObject);
  108 +
  109 + // Test output before
  110 + System.out.println(testObject.getAnotherAttribute());
  111 +
  112 + // and fire the rules
  113 + ksession.fireAllRules();
  114 +
  115 + // Test output after
  116 + System.out.println(testObject.getAnotherAttribute());
  117 +
  118 + // and then dispose the session
  119 + ksession.dispose();
  120 +```
  121 +The first line are just standard to create a `KieSession`.
  122 +On this `KieSession` we can set globals as mentioned in rules section.
  123 +Objects, on which we want to process the rules have to be inserted in this sessoin `ksession.insert(testObject);`.
  124 +
  125 +After we have inserted all objects we want to process, we start the procession by `kieSession.fireAllRules();`.
  126 +
  127 +This is it, after the last command is finished, all objects should be processed.
0 128 \ No newline at end of file
... ...
docu/facebook.md 0 → 100755
  1 +++ a/docu/facebook.md
  1 +# Facebook Adapter
  2 +
  3 +<!-- MarkdownTOC -->
  4 +
  5 +- [Framework](#framework)
  6 +- [Setup](#setup)
  7 +- [Structure](#structure)
  8 +- [Used online sources](#used-online-sources)
  9 +
  10 +<!-- /MarkdownTOC -->
  11 +
  12 +## Framework
  13 +
  14 +- Contrary to the Telegram Adapter, we did not use a Framework for Facebook and implemented the communication with Facebook by ourselves
  15 +
  16 +## Setup
  17 +
  18 +- You need:
  19 + 1. Facebook Page (https://www.facebook.com/pages/create/)
  20 + 2. Facebook App (https://developers.facebook.com/apps/)
  21 + 3. A Server with ssl certificate
  22 +
  23 +##### i. Facebook Page
  24 +
  25 +- your users communicate with this page while the App is working in the background
  26 +- use an existing one or create a new page
  27 +
  28 +##### ii. Facebook App
  29 +
  30 +- after you created the app, add the 'messenger product' in the control panel on the left side
  31 +- generate an messaging key for your Facebook page and store it under 'FACEBOOK_BOT_TOKEN' in the config.properties
  32 +- setup a webhook by using your webhook address (https://yourdomain.com/rest/facebook/getUpdates) and the identification key set in 'FACEBOOK_WEBHOOK_TOKEN' in the config.properties
  33 +- subscribe the webhook to your Facebook page
  34 +- NOTE: if you want to change the address of the webhook (for example if your server address changes) there are two possibilities:
  35 + 1. navigate to the webhook product on the left and select 'Edit Subscription'
  36 + 2. you can set the webhook to your current address by opening 'http(s)://yourdomain.com/rest/facebook/setWebhook', but this requires to set 'FACEBOOK_ACCESS_TOKEN' in the config.properties. You can get your access token at 'https://developers.facebook.com/tools/explorer/' by selecting your app. Be sure you select 'app access token' in the dropdown menu, otherwise it generates an user access token. The app token should look like this: '00000000000|XXXXXXXXX-XXXXXXX'. This possibility of changing the webhook path needs more time in setting it up at the beginning, but it's more comfortable in the end, especially when the amount of Messengers grows (e.g you set your Telegram webhook at 'http(s)://yourdomain.com/rest/telegram/setWebhook').
  37 +
  38 +##### iii. ssl certificate
  39 +
  40 +- if you don't have a valid sll crtificate, there are several ways of setting up https for your domain for free. While we were in development, we used localtunnel to generate a https-URL which tunneled the port 8080 to our PCs. If you own a domain, you can also use Cloudflare as nameserver which makes it possible to use free SSL-certificates as well.
  41 +
  42 +## Structure
  43 +
  44 +- Facebook Adapter is split into three basic classes:
  45 + 1. FacebookReceiveAdapter
  46 + 2. FacebookSendAdapter
  47 + 3. FacebookUtils
  48 +
  49 +##### i. FacebookReceiveAdapter
  50 +
  51 +- For receiving new messages from Users and webhook requests.
  52 +
  53 +Using RESTEasy for HTTP Requests
  54 +```java
  55 +@Path("/facebook")
  56 +public class FacebookReceiveAdapter {
  57 +```
  58 +POST Requests for incoming Facebook messages:
  59 +```java
  60 + @POST
  61 + @Path("/getUpdates")
  62 + @Consumes("application/json")
  63 + public String ReceiveMessage(String InputMessage) {}
  64 +```
  65 +GET Requests for webhook verification:
  66 +```java
  67 + @GET
  68 + @Path("/getUpdates")
  69 + @Produces("text/plain")
  70 + public String verification(@Context HttpServletRequest request){}
  71 +```
  72 +GET Requests for webhook initialization (if user opens http://yourdomain.com/rest/facebook/setWebhook to set the Facebook webhook to your current server address):
  73 +```java
  74 + @GET
  75 + @Path("/setWebhook")
  76 + @Produces("text/plain")
  77 + public String setWebhook(@Context HttpServletRequest request){}
  78 +```
  79 +```java
  80 + }
  81 +```
  82 +
  83 +##### ii. FacebookSendAdapter
  84 +
  85 +- For sending new messages to Users.
  86 +
  87 +Send Text Request:
  88 +- Facebook limits the character amount per message to 640, that's why we have to split messages if they are to long
  89 +- if the messages contain multiple entries (e.g. dishes), it makes sense to split them to avoid message-splits within entries
  90 +```java
  91 + private void sendMessage(Long recipient, String messageJson) {
  92 + Boolean seperateMessages = true;
  93 + String seperator = ", --------------------------";
  94 +
  95 + for( String currentMessage : facebookUtils.splitIntoMultipleMessages(messageJson,600,seperateMessages,seperator) ) {
  96 + String payload = "{\"recipient\": {\"id\": \"" + recipient + "\"}, \"message\": { \"text\": \"" + currentMessage + "\"}}";
  97 + facebookUtils.sendPostRequest(requestUrl, payload, facebookUtils.token());
  98 + }
  99 + }
  100 +```
  101 +
  102 +Send Media Request:
  103 +```java
  104 + private void sendMedia(BotMessage message,String mediaType){
  105 + String fileURL=attachmentStore.loadAttachmentPath(message.getAttachments()[0].getId(), AttachmentStoreMode.FILE_URI);
  106 + String payload = "{recipient: { id: "+message.getSenderID()+" }, message: { attachment: { type: \""+mediaType+"\", payload: { url: \""+fileURL+"\" } } }} ";
  107 + String requestUrl = "https://graph.facebook.com/v2.6/me/messages" ;
  108 + facebookUtils.sendPostRequest(requestUrl, payload,facebookUtils.token());
  109 + }
  110 +```
  111 +
  112 +##### iii. FacebookUtils
  113 +
  114 +- Contains methods which are used by both, sender and receiver.
  115 +- While some methods just return property configs, these three are more important:
  116 +
  117 +Webhook activation:
  118 +- after the webhook is verified, it needs to be activated to subscribe to the incoming messages
  119 +- this has to be done after a short delay to ensure that the webhook is registered by Facebook
  120 +```java
  121 +public void activateWebhook() {
  122 +
  123 + Runnable activation = new Runnable() {
  124 + public void run() {
  125 + try {
  126 + Thread.sleep(5000);
  127 + } catch (InterruptedException e) {
  128 + e.printStackTrace();
  129 + }
  130 + sendPostRequest("https://graph.facebook.com/v2.9/me/subscribed_apps","",token());
  131 + }
  132 + };
  133 + new Thread(activation).start();
  134 + }
  135 +```
  136 +Send requests to Facebook via our FacebookRESTServiceInterface:
  137 +```java
  138 + public String sendPostRequest(String requestUrl, String payload, String token) {
  139 +
  140 + ResteasyClient client = new ResteasyClientBuilder().build();
  141 + ResteasyWebTarget target = client.target(UriBuilder.fromPath(requestUrl));
  142 + FacebookRESTServiceInterface facebookProxy = target.proxy(FacebookRESTServiceInterface.class);
  143 +
  144 + Response response = facebookProxy.sendMessage(payload, token);
  145 +
  146 + String responseAsString = response.readEntity(String.class);
  147 +
  148 +
  149 + return responseAsString;
  150 +
  151 + }
  152 +```
  153 +Split the message into multiple messages with sendable size:
  154 +- split at newlines and store message before char limit reached or between entries (if enabled)
  155 +- return list of messages which FacebookSend iterates through to send everything
  156 +```java
  157 +public List<String> splitIntoMultipleMessages(String messageJson, int charLimit, Boolean seperateMessages, String seperator){
  158 + List<String> messages = new ArrayList<String>();
  159 +
  160 + String linesOfMessage[] = messageJson.split("\\r?\\n");
  161 +
  162 + String currentOutput = "";
  163 + for (int i = 0; i < linesOfMessage.length; i++) {
  164 + String line = linesOfMessage[i];
  165 + if ((currentOutput + "\\n" + line).length() > charLimit || (line.contains(seperator)&&seperateMessages)) {
  166 + messages.add(currentOutput);
  167 +
  168 + if(line.contains(seperator) && seperateMessages) {
  169 + line="";
  170 + }
  171 +
  172 + currentOutput = line;
  173 + } else {
  174 + currentOutput = currentOutput + "\\n" + line;
  175 + }
  176 +
  177 +
  178 + }
  179 + messages.add(currentOutput);
  180 +
  181 +
  182 + return messages;
  183 + }
  184 +```
  185 +## Used online sources
  186 +
  187 +- [Facebook API overview](https://developers.facebook.com/docs/)
0 188 \ No newline at end of file
... ...
docu/img/architecture.png 0 → 100755

11.7 KB

docu/img/bing/azure-registration.png 0 → 100755

46.1 KB

docu/img/bing/billing-menu.png 0 → 100755

32.3 KB

docu/img/bing/bing-speech-service-dashboard.png 0 → 100755

50.8 KB

docu/img/bing/create-new-bing-speech-service.png 0 → 100755

145 KB

docu/img/bing/manage-btn.png 0 → 100755

658 Bytes

docu/img/model.png 0 → 100755

5.4 KB

docu/project_documentation.md 0 → 100755
  1 +++ a/docu/project_documentation.md
  1 +# BHT-Chatbot Project
  2 +The hole project is build by gradle and divided into a couple of subprojects (cf. [Subprojects section](#subprojects) ).
  3 +Each module is loosely connected through a Java Message Service. The application is running on a Jboss Wildfly
  4 +inside of a docker container. Another docker container is used for the Rasa backend.
  5 +
  6 +## Infrastructure
  7 +- see [docker compose file](../docker/docker-compose.yml)
  8 +
  9 +The productive project is represented by a separate Git repository in absent of a continuous integration server.
  10 +Pushing into this repository will automatically trigger a rebuild of the productive environment.
  11 +- confer [post-receive](../scripts/post-receive) - Git hook for auto deploying the application
  12 +
  13 +### Subprojects
  14 +
  15 +#### MainBot
  16 +- [Canteen Parser](canteenParser.md) - web crawler for collecting data of the beuth university canteen
  17 +- Common - holding common classes used by all other subprojects
  18 +- [Drools](drools.md) - Business Rules Management System used to generate the right answer
  19 +- Global - global available services
  20 +
  21 +#### Natural Language Processing
  22 +- [ApiAi](apiai.md) - simple RESTEasy client application calling googles Api.ai API
  23 +- [Rasa](rasa.md) - simple RESTEasy client application calling the rasa backend rest API
  24 +
  25 +#### Messenger
  26 +- [Facebook](facebook.md) - Facebook Messenger connector
  27 +- [Telegram](telegram.md) - Telegram Messenger connector
  28 +
  29 +#### Text <-> Speech Processing
  30 +- [Bing Speech](binspeechapi.md) - REST client for Microsofts Bing Speech API
0 31 \ No newline at end of file
... ...
docu/rasa.md 0 → 100755
  1 +++ a/docu/rasa.md
  1 +# Rasa
  2 +The Rasa subproject is basically a simple RESTEasy client application calling the rasa backend REST API.
  3 +
  4 +## Update and train the model
  5 +We are using the same training data as used by Api.ai. Just extract the exported agent zip to `docker/rasa_nlu/volumes/data/api/` and rebuild the container.
  6 +You can login to the running container and execute `python -m rasa_nlu.train -c config/chatbot_config.json` also (cf. [rasa Dockerfile](../docker/rasa_nlu/Dockerfile)).
  7 +Be aware of that training the model can take some time.
  8 +
  9 +## Used online sources
  10 + - [rasa documentation](https://rasa-nlu.readthedocs.io/en/latest/tutorial.html)
  11 + - [RESTEasy 3.1.3](https://docs.jboss.org/resteasy/docs/3.1.3.Final/userguide/html/)
0 12 \ No newline at end of file
... ...
docu/telegram.md 0 → 100755
  1 +++ a/docu/telegram.md
  1 +# Telegram Adapter
  2 +
  3 +Step by step Guide.
  4 +<!-- MarkdownTOC -->
  5 +
  6 +- [Framework](#framework)
  7 +- [Structure](#structure)
  8 +- [Used online sources](#used-online-sources)
  9 +
  10 +<!-- /MarkdownTOC -->
  11 +
  12 +## Framework
  13 +
  14 +- Using [Java-Telegram-Bot-API](https://github.com/pengrad/java-telegram-bot-api) Framework from github user pengrad.
  15 + - Easy access to Telegram API via TelegramBot-Objects
  16 + - Well maintained repository (June 2017)
  17 +
  18 +## Structure
  19 +
  20 +- Telegram Adapter is split in two basic classes:
  21 + 1. TelegramReceiveAdapter
  22 + 2. TelegramSendAdapter
  23 +- Receiving messages via webhook.
  24 +
  25 +##### i. TelegramReceiveAdapter
  26 +
  27 +- For receiving new messages from Users.
  28 +
  29 +Using RESTEasy for HTTP Requests.
  30 +```java
  31 +@Path("/telegram")
  32 +public class TelegramReceiveAdapter {
  33 +
  34 + @POST
  35 + @Path("/getUpdates")
  36 + public void getUpdates(final String msg) {}
  37 +
  38 + ...
  39 +}
  40 +```
  41 +
  42 +
  43 +##### ii. TelegramSendAdapter
  44 +
  45 +- For sending new messages to Users.
  46 +
  47 +Asynchronus Webhook verification.
  48 +```java
  49 +SetWebhook webhook = new SetWebhook().url(properties.getProperty("WEB_URL") + properties.getProperty("TELEGRAM_WEBHOOK_URL"));
  50 +
  51 +bot.execute(webhook, new Callback<SetWebhook, BaseResponse>() {
  52 + @Override
  53 + public void onResponse(final SetWebhook request, final BaseResponse response) {
  54 + logger.debug("No errors while setting Telegram webhook.");
  55 + }
  56 + @Override
  57 + public void onFailure(final SetWebhook request, final IOException e) {
  58 + logger.warn("An Error occured while setting Telegram webhook. BOT_TOKEN: " + properties.getProperty("TELEGRAM_BOT_TOKEN") + " - WEBHOOK_URL: " + properties.getProperty("WEB_URL") + properties.getProperty("TELEGRAM_WEBHOOK_URL"));
  59 + }
  60 +});
  61 +```
  62 +
  63 +Send Text Request.
  64 +```java
  65 +private void sendMessage(final Long senderId, final String message) {
  66 + SendMessage request = new SendMessage(senderId, message);
  67 + SendResponse sendResponse = bot.execute(request);
  68 + logger.debug("Send de.bht.chatbot.message: " + sendResponse.isOk());
  69 + }
  70 +```
  71 +
  72 +Send Audio Request.
  73 +```java
  74 +private void sendAudio(final BotMessage botMessage){
  75 + SendAudio request;
  76 +
  77 + // check and send each attachement
  78 + for (Attachment attachment : botMessage.getAttachements()) {
  79 + request = new SendAudio(botMessage.getSenderID(), attachment.getFileURI());
  80 +
  81 + if (attachment.getCaption() != null)
  82 + request.caption(attachment.getCaption());
  83 +
  84 + SendResponse sendResponse = bot.execute(request);
  85 + logger.debug("Send Audio: " + sendResponse.isOk());
  86 + }
  87 +}
  88 +```
  89 +
  90 +## Used online sources
  91 +
  92 +- [Telegram API overview](https://core.telegram.org/bots/api)
  93 +- [Java-Telegram-Bot-API](https://github.com/pengrad/java-telegram-bot-api) (github - user: pengrad)
0 94 \ No newline at end of file
... ...
gradle/wrapper/gradle-wrapper.jar 0 → 100755
No preview for this file type
gradle/wrapper/gradle-wrapper.properties 0 → 100755
  1 +++ a/gradle/wrapper/gradle-wrapper.properties
  1 +#Thu May 04 17:39:29 CEST 2017
  2 +distributionBase=GRADLE_USER_HOME
  3 +distributionPath=wrapper/dists
  4 +zipStoreBase=GRADLE_USER_HOME
  5 +zipStorePath=wrapper/dists
  6 +distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-bin.zip
... ...
gradlew 0 → 100755
  1 +++ a/gradlew
  1 +#!/usr/bin/env sh
  2 +
  3 +##############################################################################
  4 +##
  5 +## Gradle start up script for UN*X
  6 +##
  7 +##############################################################################
  8 +
  9 +# Attempt to set APP_HOME
  10 +# Resolve links: $0 may be a link
  11 +PRG="$0"
  12 +# Need this for relative symlinks.
  13 +while [ -h "$PRG" ] ; do
  14 + ls=`ls -ld "$PRG"`
  15 + link=`expr "$ls" : '.*-> \(.*\)$'`
  16 + if expr "$link" : '/.*' > /dev/null; then
  17 + PRG="$link"
  18 + else
  19 + PRG=`dirname "$PRG"`"/$link"
  20 + fi
  21 +done
  22 +SAVED="`pwd`"
  23 +cd "`dirname \"$PRG\"`/" >/dev/null
  24 +APP_HOME="`pwd -P`"
  25 +cd "$SAVED" >/dev/null
  26 +
  27 +APP_NAME="Gradle"
  28 +APP_BASE_NAME=`basename "$0"`
  29 +
  30 +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
  31 +DEFAULT_JVM_OPTS=""
  32 +
  33 +# Use the maximum available, or set MAX_FD != -1 to use that value.
  34 +MAX_FD="maximum"
  35 +
  36 +warn ( ) {
  37 + echo "$*"
  38 +}
  39 +
  40 +die ( ) {
  41 + echo
  42 + echo "$*"
  43 + echo
  44 + exit 1
  45 +}
  46 +
  47 +# OS specific support (must be 'true' or 'false').
  48 +cygwin=false
  49 +msys=false
  50 +darwin=false
  51 +nonstop=false
  52 +case "`uname`" in
  53 + CYGWIN* )
  54 + cygwin=true
  55 + ;;
  56 + Darwin* )
  57 + darwin=true
  58 + ;;
  59 + MINGW* )
  60 + msys=true
  61 + ;;
  62 + NONSTOP* )
  63 + nonstop=true
  64 + ;;
  65 +esac
  66 +
  67 +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
  68 +
  69 +# Determine the Java command to use to start the JVM.
  70 +if [ -n "$JAVA_HOME" ] ; then
  71 + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
  72 + # IBM's JDK on AIX uses strange locations for the executables
  73 + JAVACMD="$JAVA_HOME/jre/sh/java"
  74 + else
  75 + JAVACMD="$JAVA_HOME/bin/java"
  76 + fi
  77 + if [ ! -x "$JAVACMD" ] ; then
  78 + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
  79 +
  80 +Please set the JAVA_HOME variable in your environment to match the
  81 +location of your Java installation."
  82 + fi
  83 +else
  84 + JAVACMD="java"
  85 + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
  86 +
  87 +Please set the JAVA_HOME variable in your environment to match the
  88 +location of your Java installation."
  89 +fi
  90 +
  91 +# Increase the maximum file descriptors if we can.
  92 +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
  93 + MAX_FD_LIMIT=`ulimit -H -n`
  94 + if [ $? -eq 0 ] ; then
  95 + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
  96 + MAX_FD="$MAX_FD_LIMIT"
  97 + fi
  98 + ulimit -n $MAX_FD
  99 + if [ $? -ne 0 ] ; then
  100 + warn "Could not set maximum file descriptor limit: $MAX_FD"
  101 + fi
  102 + else
  103 + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
  104 + fi
  105 +fi
  106 +
  107 +# For Darwin, add options to specify how the application appears in the dock
  108 +if $darwin; then
  109 + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
  110 +fi
  111 +
  112 +# For Cygwin, switch paths to Windows format before running java
  113 +if $cygwin ; then
  114 + APP_HOME=`cygpath --path --mixed "$APP_HOME"`
  115 + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
  116 + JAVACMD=`cygpath --unix "$JAVACMD"`
  117 +
  118 + # We build the pattern for arguments to be converted via cygpath
  119 + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
  120 + SEP=""
  121 + for dir in $ROOTDIRSRAW ; do
  122 + ROOTDIRS="$ROOTDIRS$SEP$dir"
  123 + SEP="|"
  124 + done
  125 + OURCYGPATTERN="(^($ROOTDIRS))"
  126 + # Add a user-defined pattern to the cygpath arguments
  127 + if [ "$GRADLE_CYGPATTERN" != "" ] ; then
  128 + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
  129 + fi
  130 + # Now convert the arguments - kludge to limit ourselves to /bin/sh
  131 + i=0
  132 + for arg in "$@" ; do
  133 + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
  134 + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
  135 +
  136 + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
  137 + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
  138 + else
  139 + eval `echo args$i`="\"$arg\""
  140 + fi
  141 + i=$((i+1))
  142 + done
  143 + case $i in
  144 + (0) set -- ;;
  145 + (1) set -- "$args0" ;;
  146 + (2) set -- "$args0" "$args1" ;;
  147 + (3) set -- "$args0" "$args1" "$args2" ;;
  148 + (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
  149 + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
  150 + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
  151 + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
  152 + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
  153 + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
  154 + esac
  155 +fi
  156 +
  157 +# Escape application args
  158 +save ( ) {
  159 + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
  160 + echo " "
  161 +}
  162 +APP_ARGS=$(save "$@")
  163 +
  164 +# Collect all arguments for the java command, following the shell quoting and substitution rules
  165 +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
  166 +
  167 +# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
  168 +if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
  169 + cd "$(dirname "$0")"
  170 +fi
  171 +
  172 +exec "$JAVACMD" "$@"
... ...
gradlew.bat 0 → 100755
  1 +++ a/gradlew.bat
  1 +@if "%DEBUG%" == "" @echo off
  2 +@rem ##########################################################################
  3 +@rem
  4 +@rem Gradle startup script for Windows
  5 +@rem
  6 +@rem ##########################################################################
  7 +
  8 +@rem Set local scope for the variables with windows NT shell
  9 +if "%OS%"=="Windows_NT" setlocal
  10 +
  11 +set DIRNAME=%~dp0
  12 +if "%DIRNAME%" == "" set DIRNAME=.
  13 +set APP_BASE_NAME=%~n0
  14 +set APP_HOME=%DIRNAME%
  15 +
  16 +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
  17 +set DEFAULT_JVM_OPTS=
  18 +
  19 +@rem Find java.exe
  20 +if defined JAVA_HOME goto findJavaFromJavaHome
  21 +
  22 +set JAVA_EXE=java.exe
  23 +%JAVA_EXE% -version >NUL 2>&1
  24 +if "%ERRORLEVEL%" == "0" goto init
  25 +
  26 +echo.
  27 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
  28 +echo.
  29 +echo Please set the JAVA_HOME variable in your environment to match the
  30 +echo location of your Java installation.
  31 +
  32 +goto fail
  33 +
  34 +:findJavaFromJavaHome
  35 +set JAVA_HOME=%JAVA_HOME:"=%
  36 +set JAVA_EXE=%JAVA_HOME%/bin/java.exe
  37 +
  38 +if exist "%JAVA_EXE%" goto init
  39 +
  40 +echo.
  41 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
  42 +echo.
  43 +echo Please set the JAVA_HOME variable in your environment to match the
  44 +echo location of your Java installation.
  45 +
  46 +goto fail
  47 +
  48 +:init
  49 +@rem Get command-line arguments, handling Windows variants
  50 +
  51 +if not "%OS%" == "Windows_NT" goto win9xME_args
  52 +
  53 +:win9xME_args
  54 +@rem Slurp the command line arguments.
  55 +set CMD_LINE_ARGS=
  56 +set _SKIP=2
  57 +
  58 +:win9xME_args_slurp
  59 +if "x%~1" == "x" goto execute
  60 +
  61 +set CMD_LINE_ARGS=%*
  62 +
  63 +:execute
  64 +@rem Setup the command line
  65 +
  66 +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
  67 +
  68 +@rem Execute Gradle
  69 +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
  70 +
  71 +:end
  72 +@rem End local scope for the variables with windows NT shell
  73 +if "%ERRORLEVEL%"=="0" goto mainEnd
  74 +
  75 +:fail
  76 +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
  77 +rem the _cmd.exe /c_ return code!
  78 +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
  79 +exit /b 1
  80 +
  81 +:mainEnd
  82 +if "%OS%"=="Windows_NT" endlocal
  83 +
  84 +:omega
... ...
scripts/deployment.sh 0 → 100755
  1 +++ a/scripts/deployment.sh
  1 +#!/usr/bin/env bash
  2 +./gradlew war
  3 +cd src/main/docker
  4 +docker-compose down && docker-compose up --build -d
0 5 \ No newline at end of file
... ...
scripts/post-receive 0 → 100755
  1 +++ a/scripts/post-receive
  1 +#!/bin/bash
  2 +
  3 +# git hook
  4 +while read oldrev newrev ref
  5 +do
  6 + # only checking out the master (or whatever branch you would like to deploy)
  7 + if [[ $ref =~ .*/master$ ]];
  8 + then
  9 + echo "Master ref received. Deploying master branch to production..."
  10 + git --work-tree=/home/beuthbot/BeuthBotServer/ --git-dir=/home/beuthbot/BeuthBotServer.git/ checkout -f
  11 + cd /home/beuthbot/BeuthBotServer/
  12 + ./scripts/deployment.sh
  13 + else
  14 + echo "Ref $ref successfully received. Doing nothing: only the master branch may be deployed on this server."
  15 + fi
  16 +done
0 17 \ No newline at end of file
... ...
services/ApiAi/build.gradle 0 → 100755
  1 +++ a/services/ApiAi/build.gradle
  1 +apply plugin: 'java'
  2 +apply plugin: 'war'
  3 +apply plugin: 'checkstyle'
  4 +
  5 +repositories {
  6 + mavenCentral()
  7 +}
  8 +
  9 +dependencies {
  10 + compile project(':services:Common'),
  11 + "org.jboss.spec:jboss-javaee-7.0:1.1.0.Final",
  12 + "com.google.code.gson:gson:2.8.1"
  13 +
  14 + providedCompile "org.slf4j:slf4j-api:1.7.25",
  15 + "org.jboss.resteasy:resteasy-client:3.1.3.Final"
  16 +
  17 + testCompile "org.jboss.arquillian.junit:arquillian-junit-container:1.1.13.Final",
  18 + "junit:junit:4.12"
  19 +
  20 + testRuntime "org.wildfly.arquillian:wildfly-arquillian-container-remote:2.0.2.Final",
  21 + "org.slf4j:slf4j-simple:1.7.25"
  22 +}
  23 +
  24 +sourceCompatibility = 1.8
  25 +
  26 +war {
  27 + destinationDir new File(project.rootProject.projectDir, 'docker/wildfly/volumes/deployments/')
  28 + archiveName "apiai.war"
  29 +}
0 30 \ No newline at end of file
... ...
services/ApiAi/src/main/java/de/bht/beuthbot/nlp/apiai/ApiAiConnector.java 0 → 100755
  1 +++ a/services/ApiAi/src/main/java/de/bht/beuthbot/nlp/apiai/ApiAiConnector.java
  1 +package de.bht.beuthbot.nlp.apiai;
  2 +
  3 +import com.google.gson.Gson;
  4 +import de.bht.beuthbot.conf.Application;
  5 +import de.bht.beuthbot.conf.Configuration;
  6 +import de.bht.beuthbot.jms.ProcessQueue;
  7 +import de.bht.beuthbot.jms.ProcessQueueMessageProtocol;
  8 +import de.bht.beuthbot.jms.TaskMessage;
  9 +import de.bht.beuthbot.nlp.apiai.model.ApiAiMessage;
  10 +import de.bht.beuthbot.nlp.apiai.model.ApiAiResponse;
  11 +import org.jboss.resteasy.client.jaxrs.ResteasyClient;
  12 +import org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder;
  13 +import org.jboss.resteasy.client.jaxrs.ResteasyWebTarget;
  14 +import org.slf4j.Logger;
  15 +import org.slf4j.LoggerFactory;
  16 +
  17 +import javax.annotation.PostConstruct;
  18 +import javax.annotation.Resource;
  19 +import javax.ejb.ActivationConfigProperty;
  20 +import javax.ejb.MessageDriven;
  21 +import javax.jms.JMSException;
  22 +import javax.jms.Message;
  23 +import javax.jms.MessageListener;
  24 +import javax.ws.rs.core.Response;
  25 +import javax.ws.rs.core.UriBuilder;
  26 +
  27 +/**
  28 + * @authors: georg.glossmann@adesso.de (template) + oliverdavid@hotmail.de (content)
  29 + * Date: 04.06.17
  30 + */
  31 +@MessageDriven(
  32 + name = "ApiAiConnector",
  33 + activationConfig = {
  34 + @ActivationConfigProperty(
  35 + propertyName = "destinationType",
  36 + propertyValue = "javax.jms.Topic"),
  37 + @ActivationConfigProperty(
  38 + propertyName = "destination",
  39 + propertyValue = "jms/messages/inbox"),
  40 + @ActivationConfigProperty(
  41 + propertyName = "messageSelector", propertyValue = "NLU = 'in'")
  42 + }
  43 +)
  44 +public class ApiAiConnector implements MessageListener {
  45 +
  46 + /** Injected JMS MessageQueue */
  47 + @Resource(lookup = "java:global/global/ProcessQueueBean")
  48 + private ProcessQueue processQueue;
  49 +
  50 + /** BeuthBot Application Bean */
  51 + @Resource(lookup = "java:global/global/ApplicationBean")
  52 + private Application application;
  53 +
  54 + private final Logger logger = LoggerFactory.getLogger(ApiAiConnector.class);
  55 + private ApiAiRESTServiceInterface apiaiProxy;
  56 +
  57 + @PostConstruct
  58 + public void init() {
  59 +
  60 + ResteasyClient client = new ResteasyClientBuilder().build();
  61 + ResteasyWebTarget target = client.target(UriBuilder.fromPath("https://api.api.ai/api/query"));
  62 + apiaiProxy = target.proxy(ApiAiRESTServiceInterface.class);
  63 + }
  64 +
  65 + /**
  66 + * process messages received over the JMS
  67 + *
  68 + * @param message from JMS which contains the bot message
  69 + */
  70 + @Override
  71 + public void onMessage(final Message message) {
  72 + try {
  73 + ProcessQueueMessageProtocol botMessage = message.getBody(TaskMessage.class);
  74 + logger.debug("Receive message: {}", botMessage.toString());
  75 +
  76 + String token = application.getConfiguration(Configuration.API_AI_TOKEN);
  77 +
  78 + String sessionID = String.valueOf(botMessage.getMessageID());
  79 + String language = "de";
  80 +
  81 + //create a requests to te API.ai server
  82 + Response response = apiaiProxy.processText(botMessage.getText(), language, sessionID, "BHT-Chatbot", "Bearer " + token);
  83 + String responseAsString = response.readEntity(String.class);
  84 +
  85 + //parse the response into ApiAiResponse
  86 + ApiAiResponse apiAiResponse = new Gson().fromJson(responseAsString, ApiAiResponse.class);
  87 +
  88 + //Create ApiAiMessage
  89 + ApiAiMessage apiAiMessage = new ApiAiMessage(botMessage, apiAiResponse);
  90 +
  91 + //logger.debug("API.AI RESPONSE:"+responseAsString);
  92 +
  93 + //put ApiAiMessage into messageQueue
  94 + processQueue.route(new TaskMessage(apiAiMessage));
  95 +
  96 + } catch (JMSException e) {
  97 + logger.error("Could not process message.", e);
  98 + }
  99 + }
  100 +}
... ...
services/ApiAi/src/main/java/de/bht/beuthbot/nlp/apiai/ApiAiRESTServiceInterface.java 0 → 100755
  1 +++ a/services/ApiAi/src/main/java/de/bht/beuthbot/nlp/apiai/ApiAiRESTServiceInterface.java
  1 +package de.bht.beuthbot.nlp.apiai;
  2 +
  3 +import javax.ws.rs.*;
  4 +import javax.ws.rs.core.MediaType;
  5 +import javax.ws.rs.core.Response;
  6 +
  7 +/**
  8 + * @author: georg.glossmann@adesso.de (template) + oliverdavid@hotmail.de (content)
  9 + * Date: 04.06.17
  10 + * <p>
  11 + * Proxy interface to query api.ai REST api
  12 + */
  13 +@Path("/")
  14 +public interface ApiAiRESTServiceInterface {
  15 +
  16 + /**
  17 + * Processing the given text for intent and entities
  18 + *
  19 + * @return JAX RS Response representing the result of querying the api.ai server
  20 + */
  21 + @GET
  22 + @Produces({MediaType.APPLICATION_JSON})
  23 + Response processText(@QueryParam("query") String text, @QueryParam("lang") String language, @QueryParam("sessionId") String sessionID, @QueryParam("contexts") String context, @HeaderParam("Authorization") String auth);
  24 +}
... ...
services/ApiAi/src/main/java/de/bht/beuthbot/nlp/apiai/model/ApiAiMessage.java 0 → 100755
  1 +++ a/services/ApiAi/src/main/java/de/bht/beuthbot/nlp/apiai/model/ApiAiMessage.java
  1 +package de.bht.beuthbot.nlp.apiai.model;
  2 +
  3 +import de.bht.beuthbot.jms.ProcessQueueMessageProtocol;
  4 +import de.bht.beuthbot.jms.Target;
  5 +import de.bht.beuthbot.model.Attachment;
  6 +import de.bht.beuthbot.model.Messenger;
  7 +import de.bht.beuthbot.model.nlp.NLUResponse;
  8 +
  9 +import java.util.List;
  10 +import java.util.Map;
  11 +
  12 +/**
  13 + * Created by oliver on 19.06.2017.
  14 + * <p>
  15 + * ApiAi-specific class of the NLUBotMessage Interface
  16 + */
  17 +public class ApiAiMessage implements ProcessQueueMessageProtocol {
  18 +
  19 + //store BotMessage and NLUResponse to query necessary information
  20 + ProcessQueueMessageProtocol botMessage;
  21 + NLUResponse nluResponse;
  22 +
  23 + public ApiAiMessage(ProcessQueueMessageProtocol botMessage, NLUResponse nluResponse){
  24 + this.botMessage=botMessage;
  25 + this.nluResponse=nluResponse;
  26 + }
  27 +
  28 + @Override
  29 + public Long getId() {
  30 + return botMessage.getId();
  31 + }
  32 +
  33 + @Override
  34 + public Target getTarget() {
  35 + return Target.MAINBOT;
  36 + }
  37 +
  38 + @Override
  39 + public Long getMessageID() {
  40 + return botMessage.getMessageID();
  41 + }
  42 +
  43 + @Override
  44 + public Long getSenderID() {
  45 + return botMessage.getSenderID();
  46 + }
  47 +
  48 + @Override
  49 + public Messenger getMessenger() {
  50 + return botMessage.getMessenger();
  51 + }
  52 +
  53 + @Override
  54 + public String getText() {
  55 + return botMessage.getText();
  56 + }
  57 +
  58 + @Override
  59 + public boolean hasAttachments() {
  60 + return botMessage.hasAttachments();
  61 + }
  62 +
  63 + @Override
  64 + public List<Attachment> getAttachments() {
  65 + return botMessage.getAttachments();
  66 + }
  67 +
  68 + @Override
  69 + public String getIntent() {
  70 + return nluResponse.getIntent();
  71 + }
  72 +
  73 + @Override
  74 + public Map<String, String> getEntities() {
  75 + return nluResponse.getEntities();
  76 + }
  77 +}
... ...
services/ApiAi/src/main/java/de/bht/beuthbot/nlp/apiai/model/ApiAiResponse.java 0 → 100755
  1 +++ a/services/ApiAi/src/main/java/de/bht/beuthbot/nlp/apiai/model/ApiAiResponse.java
  1 +package de.bht.beuthbot.nlp.apiai.model;
  2 +
  3 +import com.google.gson.annotations.Expose;
  4 +import com.google.gson.annotations.SerializedName;
  5 +import de.bht.beuthbot.model.nlp.NLUResponse;
  6 +
  7 +import java.io.Serializable;
  8 +import java.util.HashMap;
  9 +import java.util.Map;
  10 +
  11 +/**
  12 + * @author: Oliver
  13 + * Date: 19.06.17
  14 + * <p>
  15 + * ApiAi-specific class of the NLUResponse Interface
  16 + * class which represents the JSON received from ApiAI
  17 + */
  18 +public class ApiAiResponse implements NLUResponse, Serializable {
  19 +
  20 + @SerializedName("id")
  21 + @Expose
  22 + private String id;
  23 + @SerializedName("timestamp")
  24 + @Expose
  25 + private String timestamp;
  26 + @SerializedName("lang")
  27 + @Expose
  28 + private String lang;
  29 + @SerializedName("result")
  30 + @Expose
  31 + private Result result;
  32 + @SerializedName("status")
  33 + @Expose
  34 + private Status status;
  35 + @SerializedName("sessionId")
  36 + @Expose
  37 + private String sessionId;
  38 +
  39 + @Override
  40 + public String getIntent() {
  41 + //TODO: implement getScore into NLUResponse Interface and move decision to Drools
  42 + // the following is not necessary anymore because api.ai should set the fallback event automatically
  43 + if (result.getScore() <= 0.2 || result.getMetadata().getIntentName() == null) {
  44 + return "Fallback";
  45 + } else return result.getMetadata().getIntentName();
  46 + }
  47 +
  48 + @Override
  49 + public Map<String, String> getEntities() {
  50 + if (result.getParameters() != null) {
  51 + return result.getParameters().getEntities();
  52 + } else return new HashMap<String, String>();
  53 + }
  54 +
  55 + public String getId() {
  56 + return id;
  57 + }
  58 +
  59 + public void setId(String id) {
  60 + this.id = id;
  61 + }
  62 +
  63 + public String getTimestamp() {
  64 + return timestamp;
  65 + }
  66 +
  67 + public void setTimestamp(String timestamp) {
  68 + this.timestamp = timestamp;
  69 + }
  70 +
  71 + public String getLang() {
  72 + return lang;
  73 + }
  74 +
  75 + public void setLang(String lang) {
  76 + this.lang = lang;
  77 + }
  78 +
  79 + public Result getResult() {
  80 + return result;
  81 + }
  82 +
  83 + public void setResult(Result result) {
  84 + this.result = result;
  85 + }
  86 +
  87 + public Status getStatus() {
  88 + return status;
  89 + }
  90 +
  91 + public void setStatus(Status status) {
  92 + this.status = status;
  93 + }
  94 +
  95 + public String getSessionId() {
  96 + return sessionId;
  97 + }
  98 +
  99 + public void setSessionId(String sessionId) {
  100 + this.sessionId = sessionId;
  101 + }
  102 +}
... ...
services/ApiAi/src/main/java/de/bht/beuthbot/nlp/apiai/model/Fulfillment.java 0 → 100755
  1 +++ a/services/ApiAi/src/main/java/de/bht/beuthbot/nlp/apiai/model/Fulfillment.java
  1 +
  2 +package de.bht.beuthbot.nlp.apiai.model;
  3 +
  4 +import java.io.Serializable;
  5 +import java.util.List;
  6 +import com.google.gson.annotations.Expose;
  7 +import com.google.gson.annotations.SerializedName;
  8 +/**
  9 + * @author: Oliver
  10 + * Date: 19.06.17
  11 + */
  12 +public class Fulfillment implements Serializable {
  13 +
  14 + @SerializedName("speech")
  15 + @Expose
  16 + private String speech;
  17 + @SerializedName("messages")
  18 + @Expose
  19 + private List<Message> messages = null;
  20 +
  21 + public String getSpeech() {
  22 + return speech;
  23 + }
  24 +
  25 + public void setSpeech(String speech) {
  26 + this.speech = speech;
  27 + }
  28 +
  29 + public List<Message> getMessages() {
  30 + return messages;
  31 + }
  32 +
  33 + public void setMessages(List<Message> messages) {
  34 + this.messages = messages;
  35 + }
  36 +
  37 +}
... ...
services/ApiAi/src/main/java/de/bht/beuthbot/nlp/apiai/model/Message.java 0 → 100755
  1 +++ a/services/ApiAi/src/main/java/de/bht/beuthbot/nlp/apiai/model/Message.java
  1 +
  2 +package de.bht.beuthbot.nlp.apiai.model;
  3 +
  4 +import com.google.gson.annotations.Expose;
  5 +import com.google.gson.annotations.SerializedName;
  6 +
  7 +import java.io.Serializable;
  8 +
  9 +/**
  10 + * @author: Oliver
  11 + * Date: 19.06.17
  12 + */
  13 +public class Message implements Serializable {
  14 +
  15 + @SerializedName("type")
  16 + @Expose
  17 + private Integer type;
  18 + @SerializedName("speech")
  19 + @Expose
  20 + private String speech;
  21 +
  22 + public Integer getType() {
  23 + return type;
  24 + }
  25 +
  26 + public void setType(Integer type) {
  27 + this.type = type;
  28 + }
  29 +
  30 + public String getSpeech() {
  31 + return speech;
  32 + }
  33 +
  34 + public void setSpeech(String speech) {
  35 + this.speech = speech;
  36 + }
  37 +
  38 +}
... ...
services/ApiAi/src/main/java/de/bht/beuthbot/nlp/apiai/model/Metadata.java 0 → 100755
  1 +++ a/services/ApiAi/src/main/java/de/bht/beuthbot/nlp/apiai/model/Metadata.java
  1 +
  2 +package de.bht.beuthbot.nlp.apiai.model;
  3 +
  4 +import com.google.gson.annotations.Expose;
  5 +import com.google.gson.annotations.SerializedName;
  6 +
  7 +import java.io.Serializable;
  8 +
  9 +/**
  10 + * @author: Oliver
  11 + * Date: 19.06.17
  12 + */
  13 +public class Metadata implements Serializable {
  14 +
  15 + @SerializedName("intentId")
  16 + @Expose
  17 + private String intentId;
  18 + @SerializedName("webhookUsed")
  19 + @Expose
  20 + private String webhookUsed;
  21 + @SerializedName("webhookForSlotFillingUsed")
  22 + @Expose
  23 + private String webhookForSlotFillingUsed;
  24 + @SerializedName("intentName")
  25 + @Expose
  26 + private String intentName;
  27 +
  28 + public String getIntentId() {
  29 + return intentId;
  30 + }
  31 +
  32 + public void setIntentId(String intentId) {
  33 + this.intentId = intentId;
  34 + }
  35 +
  36 + public String getWebhookUsed() {
  37 + return webhookUsed;
  38 + }
  39 +
  40 + public void setWebhookUsed(String webhookUsed) {
  41 + this.webhookUsed = webhookUsed;
  42 + }
  43 +
  44 + public String getWebhookForSlotFillingUsed() {
  45 + return webhookForSlotFillingUsed;
  46 + }
  47 +
  48 + public void setWebhookForSlotFillingUsed(String webhookForSlotFillingUsed) {
  49 + this.webhookForSlotFillingUsed = webhookForSlotFillingUsed;
  50 + }
  51 +
  52 + public String getIntentName() {
  53 + return intentName;
  54 + }
  55 +
  56 + public void setIntentName(String intentName) {
  57 + this.intentName = intentName;
  58 + }
  59 +
  60 +}
... ...
services/ApiAi/src/main/java/de/bht/beuthbot/nlp/apiai/model/Parameters.java 0 → 100755
  1 +++ a/services/ApiAi/src/main/java/de/bht/beuthbot/nlp/apiai/model/Parameters.java
  1 +
  2 +package de.bht.beuthbot.nlp.apiai.model;
  3 +
  4 +import com.google.gson.annotations.Expose;
  5 +import com.google.gson.annotations.SerializedName;
  6 +
  7 +import java.io.Serializable;
  8 +import java.util.HashMap;
  9 +import java.util.Map;
  10 +
  11 +/**
  12 + * @author: Oliver
  13 + * Date: 19.06.17
  14 + */
  15 +public class Parameters implements Serializable{
  16 +
  17 +
  18 + @SerializedName("date")
  19 + @Expose
  20 + private String date;
  21 + @SerializedName("dishtype")
  22 + @Expose
  23 + private String dishtype;
  24 + @SerializedName("healthy")
  25 + @Expose
  26 + private String healthy;
  27 + @SerializedName("ingredients")
  28 + @Expose
  29 + private String ingredients;
  30 + @SerializedName("price")
  31 + @Expose
  32 + private String price;
  33 + @SerializedName("number")
  34 + @Expose
  35 + private String number;
  36 + @SerializedName("dishcategory")
  37 + @Expose
  38 + private String dishcategory;
  39 +
  40 + public String getDate() {
  41 + return date;
  42 + }
  43 +
  44 + public void setDate(String date) {
  45 + this.date = date;
  46 + }
  47 +
  48 + public String getDishtype() {
  49 + return dishtype;
  50 + }
  51 +
  52 + public void setDishtype(String dishtype) {
  53 + this.dishtype = dishtype;
  54 + }
  55 +
  56 + public String getHealthy() {
  57 + return healthy;
  58 + }
  59 +
  60 + public void setHealthy(String healthy) {
  61 + this.healthy = healthy;
  62 + }
  63 +
  64 + public String getIngredients() {
  65 + return ingredients;
  66 + }
  67 +
  68 + public void setIngredients(String ingredients) {
  69 + this.ingredients = ingredients;
  70 + }
  71 +
  72 + public String getPrice() {
  73 + return price;
  74 + }
  75 +
  76 + public void setPrice(String price) {
  77 + this.price = price;
  78 + }
  79 +
  80 + public String getNumber() {
  81 + return number;
  82 + }
  83 +
  84 + public void setNumber(String number) {
  85 + this.number = number;
  86 + }
  87 +
  88 + public String getDishcategory() {
  89 + return dishcategory;
  90 + }
  91 +
  92 + public void setDishcategory(String dishcategory) {
  93 + this.dishcategory = dishcategory;
  94 + }
  95 +
  96 + /**
  97 + * @return puts the given entities with their values into a Map
  98 + */
  99 + public Map<String, String> getEntities(){
  100 + Map<String, String> Entities = new HashMap<>();
  101 +
  102 + if (date!=null)Entities.put("date",date);
  103 + if (dishtype!=null)Entities.put("dishtype",dishtype);
  104 + if (healthy!=null)Entities.put("healthy",healthy);
  105 + if (ingredients!=null)Entities.put("ingredients",ingredients);
  106 + if (price!=null)Entities.put("price",price);
  107 + if (number!=null)Entities.put("number",number);
  108 + if (dishcategory!=null)Entities.put("dishcategory",dishcategory);
  109 +
  110 + return Entities;
  111 + }
  112 +
  113 +}
... ...
services/ApiAi/src/main/java/de/bht/beuthbot/nlp/apiai/model/Result.java 0 → 100755
  1 +++ a/services/ApiAi/src/main/java/de/bht/beuthbot/nlp/apiai/model/Result.java
  1 +
  2 +package de.bht.beuthbot.nlp.apiai.model;
  3 +
  4 +import java.io.Serializable;
  5 +import java.util.List;
  6 +
  7 +import com.google.gson.annotations.Expose;
  8 +import com.google.gson.annotations.SerializedName;
  9 +
  10 +/**
  11 + * @author: Oliver
  12 + * Date: 19.06.17
  13 + */
  14 +public class Result implements Serializable {
  15 +
  16 + @SerializedName("source")
  17 + @Expose
  18 + private String source;
  19 + @SerializedName("resolvedQuery")
  20 + @Expose
  21 + private String resolvedQuery;
  22 + @SerializedName("action")
  23 + @Expose
  24 + private String action;
  25 + @SerializedName("actionIncomplete")
  26 + @Expose
  27 + private Boolean actionIncomplete;
  28 + @SerializedName("parameters")
  29 + @Expose
  30 + private Parameters parameters;
  31 + @SerializedName("contexts")
  32 + @Expose
  33 + private List<Object> contexts = null;
  34 + @SerializedName("metadata")
  35 + @Expose
  36 + private Metadata metadata;
  37 + @SerializedName("fulfillment")
  38 + @Expose
  39 + private Fulfillment fulfillment;
  40 + @SerializedName("score")
  41 + @Expose
  42 + private Float score;
  43 +
  44 + public String getSource() {
  45 + return source;
  46 + }
  47 +
  48 + public void setSource(String source) {
  49 + this.source = source;
  50 + }
  51 +
  52 + public String getResolvedQuery() {
  53 + return resolvedQuery;
  54 + }
  55 +
  56 + public void setResolvedQuery(String resolvedQuery) {
  57 + this.resolvedQuery = resolvedQuery;
  58 + }
  59 +
  60 + public String getAction() {
  61 + return action;
  62 + }
  63 +
  64 + public void setAction(String action) {
  65 + this.action = action;
  66 + }
  67 +
  68 + public Boolean getActionIncomplete() {
  69 + return actionIncomplete;
  70 + }
  71 +
  72 + public void setActionIncomplete(Boolean actionIncomplete) {
  73 + this.actionIncomplete = actionIncomplete;
  74 + }
  75 +
  76 + public Parameters getParameters(){
  77 + return parameters;
  78 + }
  79 +
  80 + /*public Map<String,String> getEntities() {
  81 + Map<String, String> Entities = new HashMap<>();
  82 +
  83 + JSONObject obj =new JSONObject(parameters);
  84 + for(Iterator iterator = obj.keySet().iterator(); iterator.hasNext();) {
  85 + String key = (String) iterator.next();
  86 + Entities.put(key, obj.getString(key));
  87 + }
  88 +
  89 + return Entities;
  90 + }*/
  91 +
  92 + public void setParameters(Parameters parameters) {
  93 + this.parameters = parameters;
  94 + }
  95 +
  96 + public List<Object> getContexts() {
  97 + return contexts;
  98 + }
  99 +
  100 + public void setContexts(List<Object> contexts) {
  101 + this.contexts = contexts;
  102 + }
  103 +
  104 + public Metadata getMetadata() {
  105 + return metadata;
  106 + }
  107 +
  108 + public void setMetadata(Metadata metadata) {
  109 + this.metadata = metadata;
  110 + }
  111 +
  112 + public Fulfillment getFulfillment() {
  113 + return fulfillment;
  114 + }
  115 +
  116 + public void setFulfillment(Fulfillment fulfillment) {
  117 + this.fulfillment = fulfillment;
  118 + }
  119 +
  120 + public Float getScore() {
  121 + return score;
  122 + }
  123 +
  124 + public void setScore(Float score) {
  125 + this.score = score;
  126 + }
  127 +
  128 +}
... ...
services/ApiAi/src/main/java/de/bht/beuthbot/nlp/apiai/model/Status.java 0 → 100755
  1 +++ a/services/ApiAi/src/main/java/de/bht/beuthbot/nlp/apiai/model/Status.java
  1 +
  2 +package de.bht.beuthbot.nlp.apiai.model;
  3 +
  4 +import com.google.gson.annotations.Expose;
  5 +import com.google.gson.annotations.SerializedName;
  6 +
  7 +import java.io.Serializable;
  8 +
  9 +/**
  10 + * @author: Oliver
  11 + * Date: 19.06.17
  12 + */
  13 +public class Status implements Serializable {
  14 +
  15 + @SerializedName("code")
  16 + @Expose
  17 + private Integer code;
  18 + @SerializedName("errorType")
  19 + @Expose
  20 + private String errorType;
  21 +
  22 + public Integer getCode() {
  23 + return code;
  24 + }
  25 +
  26 + public void setCode(Integer code) {
  27 + this.code = code;
  28 + }
  29 +
  30 + public String getErrorType() {
  31 + return errorType;
  32 + }
  33 +
  34 + public void setErrorType(String errorType) {
  35 + this.errorType = errorType;
  36 + }
  37 +
  38 +}
... ...
services/ApiAi/src/main/webapp/WEB-INF/beans.xml 0 → 100755
  1 +++ a/services/ApiAi/src/main/webapp/WEB-INF/beans.xml
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!--
  3 + JBoss, Home of Professional Open Source
  4 + Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual
  5 + contributors by the @authors tag. See the copyright.txt in the
  6 + distribution for a full listing of individual contributors.
  7 + Licensed under the Apache License, Version 2.0 (the "License");
  8 + you may not use this file except in compliance with the License.
  9 + You may obtain a copy of the License at
  10 + http://www.apache.org/licenses/LICENSE-2.0
  11 + Unless required by applicable law or agreed to in writing, software
  12 + distributed under the License is distributed on an "AS IS" BASIS,
  13 + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14 + See the License for the specific language governing permissions and
  15 + limitations under the License.
  16 +-->
  17 +<!-- Marker file indicating CDI should be enabled -->
  18 +<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  19 + xsi:schemaLocation="
  20 + http://xmlns.jcp.org/xml/ns/javaee
  21 + http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd"
  22 + bean-discovery-mode="all">
  23 +</beans>
0 24 \ No newline at end of file
... ...
services/Bing/build.gradle 0 → 100755
  1 +++ a/services/Bing/build.gradle
  1 +apply plugin: 'java'
  2 +apply plugin: 'war'
  3 +apply plugin: 'checkstyle'
  4 +
  5 +repositories {
  6 + mavenCentral()
  7 +}
  8 +
  9 +dependencies {
  10 + compile project(':services:Common'),
  11 + "org.jboss.spec:jboss-javaee-7.0:1.1.0.Final",
  12 + "org.apache.httpcomponents:httpclient:4.5.3",
  13 + "org.apache.httpcomponents:httpmime:4.3.1"
  14 +
  15 + providedCompile "org.slf4j:slf4j-api:1.7.25"
  16 +}
  17 +
  18 +sourceCompatibility = 1.8
  19 +
  20 +war {
  21 + destinationDir new File(project.rootProject.projectDir, 'docker/wildfly/volumes/deployments/')
  22 + archiveName "bing.war"
  23 +}
0 24 \ No newline at end of file
... ...