diff --git a/libraries/bot-ai-luis-v3/pom.xml b/libraries/bot-ai-luis-v3/pom.xml new file mode 100644 index 00000000..85608ab7 --- /dev/null +++ b/libraries/bot-ai-luis-v3/pom.xml @@ -0,0 +1,200 @@ + + + 4.0.0 + + + com.microsoft.bot + bot-java + 4.0.0 + ../../pom.xml + + + bot-ai-luis-v3 + jar + 4.0.0-SNAPSHOT + + ${project.groupId}:${project.artifactId} + Bot Framework Dialogs + https://dev.botframework.com/ + + + + MIT License + http://www.opensource.org/licenses/mit-license.php + + + + + + Bot Framework Development + + Microsoft + https://dev.botframework.com/ + + + + + scm:git:https://github.com/Microsoft/botbuilder-java + scm:git:https://github.com/Microsoft/botbuilder-java + https://github.com/Microsoft/botbuilder-java + + + + UTF-8 + false + + + + + junit + junit + + + org.slf4j + slf4j-api + + + + com.microsoft.bot + bot-builder + + + com.microsoft.bot + bot-configuration + + + com.microsoft.bot + bot-applicationinsights + + + + + + MyGet + ${repo.url} + + + + + + MyGet + ${repo.url} + + + + + + build + + true + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + org.apache.maven.plugins + maven-jar-plugin + + + org.apache.maven.plugins + maven-pmd-plugin + + true + + **/** + + + + + + org.eluder.coveralls + coveralls-maven-plugin + + yourcoverallsprojectrepositorytoken + + + + org.codehaus.mojo + cobertura-maven-plugin + + ../../cobertura-report/bot-ai-luis-v3 + xml + 256m + + true + + + + + + + + publish + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + org.apache.maven.plugins + maven-jar-plugin + + + + org.sonatype.plugins + nexus-staging-maven-plugin + true + + ossrh + https://oss.sonatype.org/ + true + + + + org.apache.maven.plugins + maven-gpg-plugin + + + sign-artifacts + verify + + sign + + + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + + jar + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + attach-javadocs + + jar + + + + + + + + + diff --git a/libraries/bot-ai-qna/pom.xml b/libraries/bot-ai-qna/pom.xml new file mode 100644 index 00000000..2846e281 --- /dev/null +++ b/libraries/bot-ai-qna/pom.xml @@ -0,0 +1,197 @@ + + + 4.0.0 + + + com.microsoft.bot + bot-java + 4.0.0 + ../../pom.xml + + + bot-ai-qna + jar + 4.0.0-SNAPSHOT + + ${project.groupId}:${project.artifactId} + Bot Framework Dialogs + https://dev.botframework.com/ + + + + MIT License + http://www.opensource.org/licenses/mit-license.php + + + + + + Bot Framework Development + + Microsoft + https://dev.botframework.com/ + + + + + scm:git:https://github.com/Microsoft/botbuilder-java + scm:git:https://github.com/Microsoft/botbuilder-java + https://github.com/Microsoft/botbuilder-java + + + + UTF-8 + false + + + + + junit + junit + + + + org.slf4j + slf4j-api + + + + com.microsoft.bot + bot-builder + + + com.microsoft.bot + bot-configuration + + + + + + MyGet + ${repo.url} + + + + + + MyGet + ${repo.url} + + + + + + build + + true + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + org.apache.maven.plugins + maven-jar-plugin + + + org.apache.maven.plugins + maven-pmd-plugin + + true + + **/** + + + + + + org.eluder.coveralls + coveralls-maven-plugin + + yourcoverallsprojectrepositorytoken + + + + org.codehaus.mojo + cobertura-maven-plugin + + ../../cobertura-report/bot-ai-qna + xml + 256m + + true + + + + + + + + publish + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + org.apache.maven.plugins + maven-jar-plugin + + + + org.sonatype.plugins + nexus-staging-maven-plugin + true + + ossrh + https://oss.sonatype.org/ + true + + + + org.apache.maven.plugins + maven-gpg-plugin + + + sign-artifacts + verify + + sign + + + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + + jar + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + attach-javadocs + + jar + + + + + + + + + diff --git a/libraries/bot-applicationinsights/pom.xml b/libraries/bot-applicationinsights/pom.xml new file mode 100644 index 00000000..250c78c4 --- /dev/null +++ b/libraries/bot-applicationinsights/pom.xml @@ -0,0 +1,198 @@ + + + 4.0.0 + + + com.microsoft.bot + bot-java + 4.0.0 + ../../pom.xml + + + bot-applicationinsights + jar + 4.0.0-SNAPSHOT + + ${project.groupId}:${project.artifactId} + Bot Framework Dialogs + https://dev.botframework.com/ + + + + MIT License + http://www.opensource.org/licenses/mit-license.php + + + + + + Bot Framework Development + + Microsoft + https://dev.botframework.com/ + + + + + scm:git:https://github.com/Microsoft/botbuilder-java + scm:git:https://github.com/Microsoft/botbuilder-java + https://github.com/Microsoft/botbuilder-java + + + + UTF-8 + false + + + + + junit + junit + + + org.slf4j + slf4j-api + + + + com.microsoft.azure + applicationinsights-core + 2.4.1 + + + + com.microsoft.bot + bot-builder + + + + + + MyGet + ${repo.url} + + + + + + MyGet + ${repo.url} + + + + + + build + + true + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + org.apache.maven.plugins + maven-jar-plugin + + + org.apache.maven.plugins + maven-pmd-plugin + + true + + **/** + + + + + + org.eluder.coveralls + coveralls-maven-plugin + + yourcoverallsprojectrepositorytoken + + + + org.codehaus.mojo + cobertura-maven-plugin + + ../../cobertura-report/bot-applicationinsights + xml + 256m + + true + + + + + + + + publish + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + org.apache.maven.plugins + maven-jar-plugin + + + + org.sonatype.plugins + nexus-staging-maven-plugin + true + + ossrh + https://oss.sonatype.org/ + true + + + + org.apache.maven.plugins + maven-gpg-plugin + + + sign-artifacts + verify + + sign + + + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + + jar + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + attach-javadocs + + jar + + + + + + + + + diff --git a/libraries/bot-azure/pom.xml b/libraries/bot-azure/pom.xml new file mode 100644 index 00000000..d71aa6ec --- /dev/null +++ b/libraries/bot-azure/pom.xml @@ -0,0 +1,197 @@ + + + 4.0.0 + + + com.microsoft.bot + bot-java + 4.0.0 + ../../pom.xml + + + bot-azure + jar + 4.0.0-SNAPSHOT + + ${project.groupId}:${project.artifactId} + Bot Framework Integration Core + https://dev.botframework.com/ + + + + MIT License + http://www.opensource.org/licenses/mit-license.php + + + + + + Bot Framework Development + + Microsoft + https://dev.botframework.com/ + + + + + scm:git:https://github.com/Microsoft/botbuilder-java + scm:git:https://github.com/Microsoft/botbuilder-java + https://github.com/Microsoft/botbuilder-java + + + + UTF-8 + false + + + + + junit + junit + + + org.slf4j + slf4j-api + + + com.microsoft.bot + bot-builder + + + + + + MyGet + ${repo.url} + + + + + + MyGet + ${repo.url} + + + + + + build + + true + + + + + src/main/resources + true + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + org.apache.maven.plugins + maven-jar-plugin + + + org.apache.maven.plugins + maven-pmd-plugin + + + org.apache.maven.plugins + maven-checkstyle-plugin + + + + org.eluder.coveralls + coveralls-maven-plugin + + yourcoverallsprojectrepositorytoken + + + + org.codehaus.mojo + cobertura-maven-plugin + + ../../cobertura-report/bot-azure + xml + 256m + + true + + + + + + + + + publish + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + org.apache.maven.plugins + maven-jar-plugin + + + + org.sonatype.plugins + nexus-staging-maven-plugin + true + + ossrh + https://oss.sonatype.org/ + true + + + + + org.apache.maven.plugins + maven-gpg-plugin + + + sign-artifacts + verify + + sign + + + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + + jar + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + attach-javadocs + + jar + + + + + + + + + diff --git a/libraries/bot-builder/pom.xml b/libraries/bot-builder/pom.xml index 4d0696e6..404ce93b 100644 --- a/libraries/bot-builder/pom.xml +++ b/libraries/bot-builder/pom.xml @@ -12,7 +12,7 @@ bot-builder jar - 4.0-SNAPSHOT + 4.0.0-SNAPSHOT ${project.groupId}:${project.artifactId} Bot Framework Connector @@ -92,12 +92,10 @@ com.microsoft.bot bot-schema - 4.0.0-SNAPSHOT com.microsoft.bot bot-connector - 4.0.0-SNAPSHOT diff --git a/libraries/bot-builder/src/main/resources/log4j2.json b/libraries/bot-builder/src/main/resources/log4j2.json deleted file mode 100644 index b183e4d9..00000000 --- a/libraries/bot-builder/src/main/resources/log4j2.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "configuration": { - "name": "Default", - "appenders": { - "Console": { - "name": "Console-Appender", - "target": "SYSTEM_OUT", - "PatternLayout": {"pattern": "[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %c{1} - %msg%n"} - } - }, - "loggers": { - "logger": [ - { - "name": "com.microsoft.bot.builder", - "level": "debug", - "appender-ref": [{"ref": "Console-Appender", "level": "debug"}] - } - ], - "root": { - "level": "warn", - "appender-ref": {"ref": "Console-Appender","level": "warn"} - } - } - } -} diff --git a/libraries/bot-configuration/pom.xml b/libraries/bot-configuration/pom.xml new file mode 100644 index 00000000..833984ab --- /dev/null +++ b/libraries/bot-configuration/pom.xml @@ -0,0 +1,188 @@ + + + 4.0.0 + + + com.microsoft.bot + bot-java + 4.0.0 + ../../pom.xml + + + bot-configuration + jar + 4.0.0-SNAPSHOT + + ${project.groupId}:${project.artifactId} + Bot Framework Dialogs + https://dev.botframework.com/ + + + + MIT License + http://www.opensource.org/licenses/mit-license.php + + + + + + Bot Framework Development + + Microsoft + https://dev.botframework.com/ + + + + + scm:git:https://github.com/Microsoft/botbuilder-java + scm:git:https://github.com/Microsoft/botbuilder-java + https://github.com/Microsoft/botbuilder-java + + + + UTF-8 + false + + + + + junit + junit + + + + org.slf4j + slf4j-api + + + + + + MyGet + ${repo.url} + + + + + + MyGet + ${repo.url} + + + + + + build + + true + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + org.apache.maven.plugins + maven-jar-plugin + + + org.apache.maven.plugins + maven-pmd-plugin + + true + + **/** + + + + + + org.eluder.coveralls + coveralls-maven-plugin + + yourcoverallsprojectrepositorytoken + + + + org.codehaus.mojo + cobertura-maven-plugin + + ../../cobertura-report/bot-configuration + xml + 256m + + true + + + + + + + + publish + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + org.apache.maven.plugins + maven-jar-plugin + + + + org.sonatype.plugins + nexus-staging-maven-plugin + true + + ossrh + https://oss.sonatype.org/ + true + + + + org.apache.maven.plugins + maven-gpg-plugin + + + sign-artifacts + verify + + sign + + + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + + jar + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + attach-javadocs + + jar + + + + + + + + + diff --git a/libraries/bot-connector/pom.xml b/libraries/bot-connector/pom.xml index b88c170e..61697460 100644 --- a/libraries/bot-connector/pom.xml +++ b/libraries/bot-connector/pom.xml @@ -94,7 +94,6 @@ com.microsoft.bot bot-schema - 4.0.0-SNAPSHOT diff --git a/libraries/bot-dialogs/pom.xml b/libraries/bot-dialogs/pom.xml new file mode 100644 index 00000000..8320a4b0 --- /dev/null +++ b/libraries/bot-dialogs/pom.xml @@ -0,0 +1,203 @@ + + + 4.0.0 + + + com.microsoft.bot + bot-java + 4.0.0 + ../../pom.xml + + + bot-dialogs + jar + 4.0.0-SNAPSHOT + + ${project.groupId}:${project.artifactId} + Bot Framework Dialogs + https://dev.botframework.com/ + + + + MIT License + http://www.opensource.org/licenses/mit-license.php + + + + + + Bot Framework Development + + Microsoft + https://dev.botframework.com/ + + + + + scm:git:https://github.com/Microsoft/botbuilder-java + scm:git:https://github.com/Microsoft/botbuilder-java + https://github.com/Microsoft/botbuilder-java + + + + UTF-8 + false + + + + + junit + junit + + + org.slf4j + slf4j-api + + + + com.microsoft.azure + azure-documentdb + 2.4.1 + + + com.microsoft.azure + azure-storage-blob + 11.0.1 + + + + com.microsoft.bot + bot-builder + + + + + + MyGet + ${repo.url} + + + + + + MyGet + ${repo.url} + + + + + + build + + true + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + org.apache.maven.plugins + maven-jar-plugin + + + org.apache.maven.plugins + maven-pmd-plugin + + true + + **/** + + + + + + org.eluder.coveralls + coveralls-maven-plugin + + yourcoverallsprojectrepositorytoken + + + + org.codehaus.mojo + cobertura-maven-plugin + + ../../cobertura-report/bot-dialogs + xml + 256m + + true + + + + + + + + publish + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + org.apache.maven.plugins + maven-jar-plugin + + + + org.sonatype.plugins + nexus-staging-maven-plugin + true + + ossrh + https://oss.sonatype.org/ + true + + + + org.apache.maven.plugins + maven-gpg-plugin + + + sign-artifacts + verify + + sign + + + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + + jar + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + attach-javadocs + + jar + + + + + + + + + diff --git a/libraries/bot-builder/src/main/java/com/microsoft/bot/builder/dialogs/Dialog.java b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/Dialog.java similarity index 92% rename from libraries/bot-builder/src/main/java/com/microsoft/bot/builder/dialogs/Dialog.java rename to libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/Dialog.java index 729367b7..23bb2718 100644 --- a/libraries/bot-builder/src/main/java/com/microsoft/bot/builder/dialogs/Dialog.java +++ b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/Dialog.java @@ -1,111 +1,111 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.microsoft.bot.builder.dialogs; - - -import com.microsoft.bot.builder.BotAssert; -import com.microsoft.bot.builder.TurnContext; - -import java.util.HashMap; -import java.util.concurrent.CompletableFuture; - -/** - * Base class for controls - */ -public abstract class Dialog -{ - /** - * Starts the dialog. Depending on the dialog, its possible for the dialog to finish - * immediately so it's advised to check the completion Object returned by `begin()` and ensure - * that the dialog is still active before continuing. - * @param context Context for the current turn of the conversation with the user. - * @param state A state Object that the dialog will use to persist its current state. This should be an empty Object which the dialog will populate. The bot should persist this with its other conversation state for as long as the dialog is still active. - * @param options (Optional) additional options supported by the dialog. - * @return DialogCompletion result - */ - public CompletableFuture Begin(TurnContext context, HashMap state) - { - return Begin(context, state, null); - } - public CompletableFuture Begin(TurnContext context, HashMap state, HashMap options) - { - BotAssert.ContextNotNull(context); - if (state == null) - throw new NullPointerException("HashMap state"); - - // Create empty dialog set and ourselves to it - // TODO: Complete - //DialogSet dialogs = new DialogSet(); - //dialogs.Add("dialog", (IDialog)this); - - // Start the control - //HashMap result = null; - - /* - // TODO Complete - - await dc.Begin("dialog", options); - */ - CompletableFuture result = null; - /* - if (dc.ActiveDialog != null) { - result = new DialogCompletion(); - result.setIsActive(true); - result.setIsCompleted(false); - } - else{ - result = new DialogCompletion(); - result.setIsActive(false); - result.setIsCompleted(true); - result.setResult(result); - } - */ - return result; - } - - /** - * Passes a users reply to the dialog for further processing.The bot should keep calling - * 'continue()' for future turns until the dialog returns a completion Object with - * 'isCompleted == true'. To cancel or interrupt the prompt simply delete the `state` Object - * being persisted. - * @param context Context for the current turn of the conversation with the user. - * @param state A state Object that was previously initialized by a call to [begin()](#begin). - * @return DialogCompletion result - */ - public CompletableFuture Continue(TurnContext context, HashMap state) - { - BotAssert.ContextNotNull(context); - if (state == null) - throw new NullPointerException("HashMap"); - - // Create empty dialog set and ourselves to it - // TODO: daveta - //DialogSet dialogs = new DialogSet(); - //dialogs.Add("dialog", (IDialog)this); - - // Continue the dialog - //HashMap result = null; - CompletableFuture result = null; - /* - TODO: daveta - var dc = new DialogContext(dialogs, context, state, (r) => { result = r; }); - if (dc.ActiveDialog != null) - { - await dc.Continue(); - return dc.ActiveDialog != null - ? - new DialogCompletion { IsActive = true, IsCompleted = false } - : - new DialogCompletion { IsActive = false, IsCompleted = true, Result = result }; - } - else - { - return new DialogCompletion { IsActive = false, IsCompleted = false }; - } - */ - - return result; - - } -} - +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.microsoft.bot.dialogs; + + +import com.microsoft.bot.builder.BotAssert; +import com.microsoft.bot.builder.TurnContext; + +import java.util.HashMap; +import java.util.concurrent.CompletableFuture; + +/** + * Base class for controls + */ +public abstract class Dialog +{ + /** + * Starts the dialog. Depending on the dialog, its possible for the dialog to finish + * immediately so it's advised to check the completion Object returned by `begin()` and ensure + * that the dialog is still active before continuing. + * @param context Context for the current turn of the conversation with the user. + * @param state A state Object that the dialog will use to persist its current state. This should be an empty Object which the dialog will populate. The bot should persist this with its other conversation state for as long as the dialog is still active. + * @param options (Optional) additional options supported by the dialog. + * @return DialogCompletion result + */ + public CompletableFuture Begin(TurnContext context, HashMap state) + { + return Begin(context, state, null); + } + public CompletableFuture Begin(TurnContext context, HashMap state, HashMap options) + { + BotAssert.ContextNotNull(context); + if (state == null) + throw new NullPointerException("HashMap state"); + + // Create empty dialog set and ourselves to it + // TODO: Complete + //DialogSet dialogs = new DialogSet(); + //dialogs.Add("dialog", (IDialog)this); + + // Start the control + //HashMap result = null; + + /* + // TODO Complete + + await dc.Begin("dialog", options); + */ + CompletableFuture result = null; + /* + if (dc.ActiveDialog != null) { + result = new DialogCompletion(); + result.setIsActive(true); + result.setIsCompleted(false); + } + else{ + result = new DialogCompletion(); + result.setIsActive(false); + result.setIsCompleted(true); + result.setResult(result); + } + */ + return result; + } + + /** + * Passes a users reply to the dialog for further processing.The bot should keep calling + * 'continue()' for future turns until the dialog returns a completion Object with + * 'isCompleted == true'. To cancel or interrupt the prompt simply delete the `state` Object + * being persisted. + * @param context Context for the current turn of the conversation with the user. + * @param state A state Object that was previously initialized by a call to [begin()](#begin). + * @return DialogCompletion result + */ + public CompletableFuture Continue(TurnContext context, HashMap state) + { + BotAssert.ContextNotNull(context); + if (state == null) + throw new NullPointerException("HashMap"); + + // Create empty dialog set and ourselves to it + // TODO: daveta + //DialogSet dialogs = new DialogSet(); + //dialogs.Add("dialog", (IDialog)this); + + // Continue the dialog + //HashMap result = null; + CompletableFuture result = null; + /* + TODO: daveta + var dc = new DialogContext(dialogs, context, state, (r) => { result = r; }); + if (dc.ActiveDialog != null) + { + await dc.Continue(); + return dc.ActiveDialog != null + ? + new DialogCompletion { IsActive = true, IsCompleted = false } + : + new DialogCompletion { IsActive = false, IsCompleted = true, Result = result }; + } + else + { + return new DialogCompletion { IsActive = false, IsCompleted = false }; + } + */ + + return result; + + } +} + diff --git a/libraries/bot-builder/src/main/java/com/microsoft/bot/builder/dialogs/DialogCompletion.java b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/DialogCompletion.java similarity index 92% rename from libraries/bot-builder/src/main/java/com/microsoft/bot/builder/dialogs/DialogCompletion.java rename to libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/DialogCompletion.java index a978effc..826064ed 100644 --- a/libraries/bot-builder/src/main/java/com/microsoft/bot/builder/dialogs/DialogCompletion.java +++ b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/DialogCompletion.java @@ -1,54 +1,54 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.microsoft.bot.builder.dialogs; - -import java.util.HashMap; - -/** - * Result returned to the caller of one of the various stack manipulation methods and used to - * return the result from a final call to `DialogContext.end()` to the bots logic. - */ -public class DialogCompletion -{ - - - /** - * If 'true' the dialog is still active. - */ - boolean _isActive; - public void setIsActive(boolean isActive) { - this._isActive = isActive; - } - public boolean getIsActive() { - return this._isActive; - } - - /** - * If 'true' the dialog just completed and the final [result](#result) can be retrieved. - */ - boolean _isCompleted; - public void setIsCompleted(boolean isCompleted) - { - this._isCompleted = isCompleted; - } - public boolean getIsCompleted() - { - return this._isCompleted; - } - - /** - * Result returned by a dialog that was just ended.This will only be populated in certain - * cases: - * - The bot calls `dc.begin()` to start a new dialog and the dialog ends immediately. - * - The bot calls `dc.continue()` and a dialog that was active ends. - * In all cases where it's populated, [active](#active) will be `false`. - */ - HashMap _result; - public HashMap getResult() { - return _result; - } - public void setResult(HashMap result) { - this._result = result; - } -} +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.microsoft.bot.dialogs; + +import java.util.HashMap; + +/** + * Result returned to the caller of one of the various stack manipulation methods and used to + * return the result from a final call to `DialogContext.end()` to the bots logic. + */ +public class DialogCompletion +{ + + + /** + * If 'true' the dialog is still active. + */ + boolean _isActive; + public void setIsActive(boolean isActive) { + this._isActive = isActive; + } + public boolean getIsActive() { + return this._isActive; + } + + /** + * If 'true' the dialog just completed and the final [result](#result) can be retrieved. + */ + boolean _isCompleted; + public void setIsCompleted(boolean isCompleted) + { + this._isCompleted = isCompleted; + } + public boolean getIsCompleted() + { + return this._isCompleted; + } + + /** + * Result returned by a dialog that was just ended.This will only be populated in certain + * cases: + * - The bot calls `dc.begin()` to start a new dialog and the dialog ends immediately. + * - The bot calls `dc.continue()` and a dialog that was active ends. + * In all cases where it's populated, [active](#active) will be `false`. + */ + HashMap _result; + public HashMap getResult() { + return _result; + } + public void setResult(HashMap result) { + this._result = result; + } +} diff --git a/libraries/bot-builder/src/main/java/com/microsoft/bot/builder/dialogs/DialogContainer.java b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/DialogContainer.java similarity index 96% rename from libraries/bot-builder/src/main/java/com/microsoft/bot/builder/dialogs/DialogContainer.java rename to libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/DialogContainer.java index 51d0f50d..c7618129 100644 --- a/libraries/bot-builder/src/main/java/com/microsoft/bot/builder/dialogs/DialogContainer.java +++ b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/DialogContainer.java @@ -1,50 +1,50 @@ -/* -public class DialogContainer implements IDialogContinue - - -{ - protected DialogSet Dialogs { get; set; } - protected string DialogId { get; set; } - - public DialogContainer(string dialogId, DialogSet dialogs = null) - { - if (string.IsNullOrEmpty(dialogId)) - throw new ArgumentNullException(nameof(dialogId)); - - Dialogs dialogs = (dialogs != null) ? dialogs : new DialogSet(); - DialogId = dialogId; - } - - public async Task DialogBegin(DialogContext dc, IDictionary dialogArgs = null) - { - if (dc == null) - throw new ArgumentNullException(nameof(dc)); - - // Start the controls entry point dialog. - IDictionary result = null; - var cdc = new DialogContext(this.Dialogs, dc.Context, dc.ActiveDialog.State, (r) => { result = r; }); - await cdc.Begin(DialogId, dialogArgs); - // End if the controls dialog ends. - if (cdc.ActiveDialog == null) - { - await dc.End(result); - } - } - - public async Task DialogContinue(DialogContext dc) - { - if (dc == null) - throw new ArgumentNullException(nameof(dc)); - - // Continue controls dialog stack. - IDictionary result = null; - var cdc = new DialogContext(this.Dialogs, dc.Context, dc.ActiveDialog.State, (r) => { result = r; }); - await cdc.Continue(); - // End if the controls dialog ends. - if (cdc.ActiveDialog == null) - { - await dc.End(result); - } - } -} -*/ +/* +public class DialogContainer implements IDialogContinue + + +{ + protected DialogSet Dialogs { get; set; } + protected string DialogId { get; set; } + + public DialogContainer(string dialogId, DialogSet dialogs = null) + { + if (string.IsNullOrEmpty(dialogId)) + throw new ArgumentNullException(nameof(dialogId)); + + Dialogs dialogs = (dialogs != null) ? dialogs : new DialogSet(); + DialogId = dialogId; + } + + public async Task DialogBegin(DialogContext dc, IDictionary dialogArgs = null) + { + if (dc == null) + throw new ArgumentNullException(nameof(dc)); + + // Start the controls entry point dialog. + IDictionary result = null; + var cdc = new DialogContext(this.Dialogs, dc.Context, dc.ActiveDialog.State, (r) => { result = r; }); + await cdc.Begin(DialogId, dialogArgs); + // End if the controls dialog ends. + if (cdc.ActiveDialog == null) + { + await dc.End(result); + } + } + + public async Task DialogContinue(DialogContext dc) + { + if (dc == null) + throw new ArgumentNullException(nameof(dc)); + + // Continue controls dialog stack. + IDictionary result = null; + var cdc = new DialogContext(this.Dialogs, dc.Context, dc.ActiveDialog.State, (r) => { result = r; }); + await cdc.Continue(); + // End if the controls dialog ends. + if (cdc.ActiveDialog == null) + { + await dc.End(result); + } + } +} +*/ diff --git a/libraries/bot-builder/src/main/java/com/microsoft/bot/builder/dialogs/DialogContext.java b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/DialogContext.java similarity index 96% rename from libraries/bot-builder/src/main/java/com/microsoft/bot/builder/dialogs/DialogContext.java rename to libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/DialogContext.java index 53531a32..2a733f8a 100644 --- a/libraries/bot-builder/src/main/java/com/microsoft/bot/builder/dialogs/DialogContext.java +++ b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/DialogContext.java @@ -1,167 +1,167 @@ -package com.microsoft.bot.builder.dialogs; - -// -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. -// -// Microsoft Bot Framework: http://botframework.com -// -// Bot Builder SDK GitHub: -// https://github.com/Microsoft/BotBuilder -// -// Copyright (c) Microsoft Corporation -// All rights reserved. -// -// MIT License: -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -/** - * Encapsulates a method that represents the code to execute after a result is available. - * - * The result is often a message from the user. - * - * @param T The type of the result. - * @param context The dialog context. - * @param result The result. - * @return A task that represents the code that will resume after the result is available. - */ - -/* -public interface ResumeAfter -{ - CompletableFuture invoke(DialogContext contenxt, Available) -} - -public delegate Task ResumeAfter(IDialogContext context, IAwaitable result); -*/ - -/** - * Encapsulate a method that represents the code to start a dialog. - * @param context The dialog context. - * @return A task that represents the start code for a dialog. - */ -//public delegate Task StartAsync(IDialogContext context); - - - -/** - * The context for the execution of a dialog's conversational process. - */ -// DAVETA: TODO -// public interface DialogContext extends -public interface DialogContext { - } - - -/** - * Helper methods. - */ -/* -public static partial class Extensions -{*/ - /** - * Post a message to be sent to the user, using previous messages to establish a conversation context. - * - * If the locale parameter is not set, locale of the incoming message will be used for reply. - * - * @param botToUser Communication channel to use. - * @param text The message text. - * @param locale The locale of the text. - * @return A task that represents the post operation. - */ -/* - public static async Task PostAsync(this BotToUser botToUser, string text, string locale = null) - { - var message = botToUser.MakeMessage(); - message.Text = text; - - if (!string.IsNullOrEmpty(locale)) - { - message.Locale = locale; - } - - await botToUser.PostAsync(message); - } -*/ - - - /** - * Post a message and optional SSML to be sent to the user, using previous messages to establish a conversation context. - * - * If the locale parameter is not set, locale of the incoming message will be used for reply. - * - * @param botToUser Communication channel to use. - * @param text The message text. - * @param speak The SSML markup for text to speech. - * @param options The options for the message. - * @param locale The locale of the text. - * @return A task that represents the post operation. - */ - /* public static async Task SayAsync(this BotToUser botToUser, string text, string speak = null, MessageOptions options = null, string locale = null) - { - var message = botToUser.MakeMessage(); - - message.Text = text; - message.Speak = speak; - - if (!string.IsNullOrEmpty(locale)) - { - message.Locale = locale; - } - - if (options != null) - { - message.InputHint = options.InputHint; - message.TextFormat = options.TextFormat; - message.AttachmentLayout = options.AttachmentLayout; - message.Attachments = options.Attachments; - message.Entities = options.Entities; - } - - await botToUser.PostAsync(message); - }*/ - - /** - * Suspend the current dialog until the user has sent a message to the bot. - * @param stack The dialog stack. - * @param resume The method to resume when the message has been received. - */ -/* - public static void Wait(this IDialogStack stack, ResumeAfter resume) - { - stack.Wait(resume); - } -*/ - - /** - * Call a child dialog, add it to the top of the stack and post the message to the child dialog. - * @param R The type of result expected from the child dialog. - * @param stack The dialog stack. - * @param child The child dialog. - * @param resume The method to resume when the child dialog has completed. - * @param message The message that will be posted to child dialog. - * @return A task representing the Forward operation. - */ -/* public static async Task Forward(this IDialogStack stack, IDialog child, ResumeAfter resume, MessageActivity message) - { - await stack.Forward(child, resume, message, token); - } -}*/ +package com.microsoft.bot.dialogs; + +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. +// +// Microsoft Bot Framework: http://botframework.com +// +// Bot Builder SDK GitHub: +// https://github.com/Microsoft/BotBuilder +// +// Copyright (c) Microsoft Corporation +// All rights reserved. +// +// MIT License: +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +/** + * Encapsulates a method that represents the code to execute after a result is available. + * + * The result is often a message from the user. + * + * @param T The type of the result. + * @param context The dialog context. + * @param result The result. + * @return A task that represents the code that will resume after the result is available. + */ + +/* +public interface ResumeAfter +{ + CompletableFuture invoke(DialogContext contenxt, Available) +} + +public delegate Task ResumeAfter(IDialogContext context, IAwaitable result); +*/ + +/** + * Encapsulate a method that represents the code to start a dialog. + * @param context The dialog context. + * @return A task that represents the start code for a dialog. + */ +//public delegate Task StartAsync(IDialogContext context); + + + +/** + * The context for the execution of a dialog's conversational process. + */ +// DAVETA: TODO +// public interface DialogContext extends +public interface DialogContext { + } + + +/** + * Helper methods. + */ +/* +public static partial class Extensions +{*/ + /** + * Post a message to be sent to the user, using previous messages to establish a conversation context. + * + * If the locale parameter is not set, locale of the incoming message will be used for reply. + * + * @param botToUser Communication channel to use. + * @param text The message text. + * @param locale The locale of the text. + * @return A task that represents the post operation. + */ +/* + public static async Task PostAsync(this BotToUser botToUser, string text, string locale = null) + { + var message = botToUser.MakeMessage(); + message.Text = text; + + if (!string.IsNullOrEmpty(locale)) + { + message.Locale = locale; + } + + await botToUser.PostAsync(message); + } +*/ + + + /** + * Post a message and optional SSML to be sent to the user, using previous messages to establish a conversation context. + * + * If the locale parameter is not set, locale of the incoming message will be used for reply. + * + * @param botToUser Communication channel to use. + * @param text The message text. + * @param speak The SSML markup for text to speech. + * @param options The options for the message. + * @param locale The locale of the text. + * @return A task that represents the post operation. + */ + /* public static async Task SayAsync(this BotToUser botToUser, string text, string speak = null, MessageOptions options = null, string locale = null) + { + var message = botToUser.MakeMessage(); + + message.Text = text; + message.Speak = speak; + + if (!string.IsNullOrEmpty(locale)) + { + message.Locale = locale; + } + + if (options != null) + { + message.InputHint = options.InputHint; + message.TextFormat = options.TextFormat; + message.AttachmentLayout = options.AttachmentLayout; + message.Attachments = options.Attachments; + message.Entities = options.Entities; + } + + await botToUser.PostAsync(message); + }*/ + + /** + * Suspend the current dialog until the user has sent a message to the bot. + * @param stack The dialog stack. + * @param resume The method to resume when the message has been received. + */ +/* + public static void Wait(this IDialogStack stack, ResumeAfter resume) + { + stack.Wait(resume); + } +*/ + + /** + * Call a child dialog, add it to the top of the stack and post the message to the child dialog. + * @param R The type of result expected from the child dialog. + * @param stack The dialog stack. + * @param child The child dialog. + * @param resume The method to resume when the child dialog has completed. + * @param message The message that will be posted to child dialog. + * @return A task representing the Forward operation. + */ +/* public static async Task Forward(this IDialogStack stack, IDialog child, ResumeAfter resume, MessageActivity message) + { + await stack.Forward(child, resume, message, token); + } +}*/ diff --git a/libraries/bot-builder/src/main/java/com/microsoft/bot/builder/dialogs/IDialog.java b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/IDialog.java similarity index 83% rename from libraries/bot-builder/src/main/java/com/microsoft/bot/builder/dialogs/IDialog.java rename to libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/IDialog.java index 8cb58b52..366a69d0 100644 --- a/libraries/bot-builder/src/main/java/com/microsoft/bot/builder/dialogs/IDialog.java +++ b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/IDialog.java @@ -1,19 +1,19 @@ -package com.microsoft.bot.builder.dialogs; - -// TODO: daveta remove this - not sure where this came from -/** - * Interface for all Dialog objects that can be added to a `DialogSet`. The dialog should generally - * be a singleton and added to a dialog set using `DialogSet.add()` at which point it will be - * assigned a unique ID. - */ -public interface IDialog -{ - /** - * Method called when a new dialog has been pushed onto the stack and is being activated. - * @param dc The dialog context for the current turn of conversation. - * @param dialogArgs (Optional) arguments that were passed to the dialog during `begin()` call that started the instance. - */ - //CompleteableFuture DialogBegin(DialogContext dc, IDictionary dialogArgs = null); - //CompleteableFuture DialogBegin(DialogContext dc, HashMap dialogArgs); - //CompleteableFuture DialogBegin(DialogContext dc); -} +package com.microsoft.bot.dialogs; + +// TODO: daveta remove this - not sure where this came from +/** + * Interface for all Dialog objects that can be added to a `DialogSet`. The dialog should generally + * be a singleton and added to a dialog set using `DialogSet.add()` at which point it will be + * assigned a unique ID. + */ +public interface IDialog +{ + /** + * Method called when a new dialog has been pushed onto the stack and is being activated. + * @param dc The dialog context for the current turn of conversation. + * @param dialogArgs (Optional) arguments that were passed to the dialog during `begin()` call that started the instance. + */ + //CompleteableFuture DialogBegin(DialogContext dc, IDictionary dialogArgs = null); + //CompleteableFuture DialogBegin(DialogContext dc, HashMap dialogArgs); + //CompleteableFuture DialogBegin(DialogContext dc); +} diff --git a/libraries/bot-builder/src/main/java/com/microsoft/bot/builder/dialogs/IDialogContinue.java b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/IDialogContinue.java similarity index 85% rename from libraries/bot-builder/src/main/java/com/microsoft/bot/builder/dialogs/IDialogContinue.java rename to libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/IDialogContinue.java index 0abb6879..bf6c30de 100644 --- a/libraries/bot-builder/src/main/java/com/microsoft/bot/builder/dialogs/IDialogContinue.java +++ b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/IDialogContinue.java @@ -1,21 +1,21 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.microsoft.bot.builder.dialogs; - - -import java.util.concurrent.CompletableFuture; - -/** - * Interface Dialog objects that can be continued. - */ -public interface IDialogContinue extends IDialog -{ - /** - * Method called when an instance of the dialog is the "current" dialog and the - * user replies with a new activity. The dialog will generally continue to receive the users - * replies until it calls either `DialogSet.end()` or `DialogSet.begin()`. - * If this method is NOT implemented then the dialog will automatically be ended when the user replies. - * @param dc The dialog context for the current turn of conversation. - */ - CompletableFuture DialogContinue(DialogContext dc); -} +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.microsoft.bot.dialogs; + + +import java.util.concurrent.CompletableFuture; + +/** + * Interface Dialog objects that can be continued. + */ +public interface IDialogContinue extends IDialog +{ + /** + * Method called when an instance of the dialog is the "current" dialog and the + * user replies with a new activity. The dialog will generally continue to receive the users + * replies until it calls either `DialogSet.end()` or `DialogSet.begin()`. + * If this method is NOT implemented then the dialog will automatically be ended when the user replies. + * @param dc The dialog context for the current turn of conversation. + */ + CompletableFuture DialogContinue(DialogContext dc); +} diff --git a/libraries/bot-builder/src/main/java/com/microsoft/bot/builder/dialogs/MessageOptions.java b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/MessageOptions.java similarity index 97% rename from libraries/bot-builder/src/main/java/com/microsoft/bot/builder/dialogs/MessageOptions.java rename to libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/MessageOptions.java index d64b6915..ff765b72 100644 --- a/libraries/bot-builder/src/main/java/com/microsoft/bot/builder/dialogs/MessageOptions.java +++ b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/MessageOptions.java @@ -1,4 +1,4 @@ -package com.microsoft.bot.builder.dialogs; +package com.microsoft.bot.dialogs; import com.microsoft.bot.schema.AttachmentLayoutTypes; import com.microsoft.bot.schema.TextFormatTypes; diff --git a/libraries/bot-builder/src/main/java/com/microsoft/bot/builder/prompts/Choice.java b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/prompts/Choice.java similarity index 95% rename from libraries/bot-builder/src/main/java/com/microsoft/bot/builder/prompts/Choice.java rename to libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/prompts/Choice.java index ba6f9cfd..53b32c61 100644 --- a/libraries/bot-builder/src/main/java/com/microsoft/bot/builder/prompts/Choice.java +++ b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/prompts/Choice.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.bot.builder.prompts; +package com.microsoft.bot.dialogs.prompts; import com.microsoft.bot.schema.CardAction; diff --git a/libraries/bot-integration-core/pom.xml b/libraries/bot-integration-core/pom.xml index 64233d8a..88a960d5 100644 --- a/libraries/bot-integration-core/pom.xml +++ b/libraries/bot-integration-core/pom.xml @@ -57,16 +57,10 @@ com.microsoft.bot bot-schema - 4.0.0-SNAPSHOT com.microsoft.bot bot-connector - 4.0.0-SNAPSHOT - - - org.slf4j - slf4j-api diff --git a/pom.xml b/pom.xml index b838a955..b5c0771e 100644 --- a/pom.xml +++ b/pom.xml @@ -128,14 +128,57 @@ test + + com.microsoft.bot + bot-schema + 4.0.0-SNAPSHOT + + + com.microsoft.bot + bot-connector + 4.0.0-SNAPSHOT + + + com.microsoft.bot + bot-builder + 4.0.0-SNAPSHOT + + + com.microsoft.bot + bot-dialogs + 4.0.0-SNAPSHOT + + + com.microsoft.bot + bot-configuration + 4.0.0-SNAPSHOT + + + com.microsoft.bot + bot-ai-luis-v3 + 4.0.0-SNAPSHOT + + + com.microsoft.bot + bot-applicationinsights + 4.0.0-SNAPSHOT + + libraries/bot-schema - libraries/bot-builder libraries/bot-connector + libraries/bot-builder libraries/bot-integration-core + libraries/bot-dialogs + libraries/bot-configuration + libraries/bot-ai-luis-v3 + libraries/bot-ai-qna + libraries/bot-applicationinsights + libraries/bot-azure + samples/bot-connector-sample samples/servlet-echo samples/spring-echo