diff --git a/samples/java_springboot/02.echo-bot/pom.xml b/samples/java_springboot/02.echo-bot/pom.xml
index fbd49bb23a..6219c4637f 100644
--- a/samples/java_springboot/02.echo-bot/pom.xml
+++ b/samples/java_springboot/02.echo-bot/pom.xml
@@ -92,7 +92,7 @@
com.microsoft.bot
bot-integration-spring
- 4.13.0
+ 4.15.0-SNAPSHOT
compile
diff --git a/samples/java_springboot/02.echo-bot/src/main/java/com/microsoft/bot/sample/echo/Application.java b/samples/java_springboot/02.echo-bot/src/main/java/com/microsoft/bot/sample/echo/Application.java
index cc7014c763..c3c558eb96 100644
--- a/samples/java_springboot/02.echo-bot/src/main/java/com/microsoft/bot/sample/echo/Application.java
+++ b/samples/java_springboot/02.echo-bot/src/main/java/com/microsoft/bot/sample/echo/Application.java
@@ -4,10 +4,10 @@
package com.microsoft.bot.sample.echo;
import com.microsoft.bot.builder.Bot;
-import com.microsoft.bot.integration.AdapterWithErrorHandler;
-import com.microsoft.bot.integration.BotFrameworkHttpAdapter;
+import com.microsoft.bot.integration.CloudAdapter;
+import com.microsoft.bot.integration.CloudAdapterWithErrorHandler;
import com.microsoft.bot.integration.Configuration;
-import com.microsoft.bot.integration.spring.BotController;
+import com.microsoft.bot.integration.spring.BotCloudAdapterController;
import com.microsoft.bot.integration.spring.BotDependencyConfiguration;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -19,12 +19,12 @@
//
@SpringBootApplication
-// Use the default BotController to receive incoming Channel messages. A custom
+// Use the default BotCloudAdapterController to receive incoming Channel messages. A custom
// controller could be used by eliminating this import and creating a new
// org.springframework.web.bind.annotation.RestController.
// The default controller is created by the Spring Boot container using
// dependency injection. The default route is /api/messages.
-@Import({BotController.class})
+@Import({BotCloudAdapterController.class})
/**
* This class extends the BotDependencyConfiguration which provides the default
@@ -56,10 +56,10 @@ public Bot getBot() {
* Returns a custom Adapter that provides error handling.
*
* @param configuration The Configuration object to use.
- * @return An error handling BotFrameworkHttpAdapter.
+ * @return An error handling CloudAdapter.
*/
@Override
- public BotFrameworkHttpAdapter getBotFrameworkHttpAdaptor(Configuration configuration) {
- return new AdapterWithErrorHandler(configuration);
+ public CloudAdapter getCloudAdapter(Configuration configuration) {
+ return new CloudAdapterWithErrorHandler(configuration);
}
}
diff --git a/samples/java_springboot/03.welcome-user/pom.xml b/samples/java_springboot/03.welcome-user/pom.xml
index 72db889a50..ce75d6efd4 100644
--- a/samples/java_springboot/03.welcome-user/pom.xml
+++ b/samples/java_springboot/03.welcome-user/pom.xml
@@ -92,7 +92,7 @@
com.microsoft.bot
bot-integration-spring
- 4.13.0
+ 4.15.0-SNAPSHOT
compile
diff --git a/samples/java_springboot/03.welcome-user/src/main/java/com/microsoft/bot/sample/welcomeuser/Application.java b/samples/java_springboot/03.welcome-user/src/main/java/com/microsoft/bot/sample/welcomeuser/Application.java
index 78f74fe9d5..c7abdd42ef 100644
--- a/samples/java_springboot/03.welcome-user/src/main/java/com/microsoft/bot/sample/welcomeuser/Application.java
+++ b/samples/java_springboot/03.welcome-user/src/main/java/com/microsoft/bot/sample/welcomeuser/Application.java
@@ -5,10 +5,10 @@
import com.microsoft.bot.builder.Bot;
import com.microsoft.bot.builder.UserState;
-import com.microsoft.bot.integration.AdapterWithErrorHandler;
-import com.microsoft.bot.integration.BotFrameworkHttpAdapter;
+import com.microsoft.bot.integration.CloudAdapter;
+import com.microsoft.bot.integration.CloudAdapterWithErrorHandler;
import com.microsoft.bot.integration.Configuration;
-import com.microsoft.bot.integration.spring.BotController;
+import com.microsoft.bot.integration.spring.BotCloudAdapterController;
import com.microsoft.bot.integration.spring.BotDependencyConfiguration;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -20,12 +20,12 @@
//
@SpringBootApplication
-// Use the default BotController to receive incoming Channel messages. A custom
+// Use the default BotCloudAdapterController to receive incoming Channel messages. A custom
// controller could be used by eliminating this import and creating a new
// org.springframework.web.bind.annotation.RestController.
// The default controller is created by the Spring Boot container using
// dependency injection. The default route is /api/messages.
-@Import({BotController.class})
+@Import({BotCloudAdapterController.class})
/**
* This class extends the BotDependencyConfiguration which provides the default
@@ -56,10 +56,10 @@ public Bot getBot(UserState userState) {
* Returns a custom Adapter that provides error handling.
*
* @param configuration The Configuration object to use.
- * @return An error handling BotFrameworkHttpAdapter.
+ * @return An error handling CloudAdapter.
*/
@Override
- public BotFrameworkHttpAdapter getBotFrameworkHttpAdaptor(Configuration configuration) {
- return new AdapterWithErrorHandler(configuration);
+ public CloudAdapter getCloudAdapter(Configuration configuration) {
+ return new CloudAdapterWithErrorHandler(configuration);
}
}
diff --git a/samples/java_springboot/05.multi-turn-prompt/pom.xml b/samples/java_springboot/05.multi-turn-prompt/pom.xml
index 1d30766da0..5d024f84db 100644
--- a/samples/java_springboot/05.multi-turn-prompt/pom.xml
+++ b/samples/java_springboot/05.multi-turn-prompt/pom.xml
@@ -92,13 +92,13 @@
com.microsoft.bot
bot-integration-spring
- 4.13.0
+ 4.15.0-SNAPSHOT
compile
com.microsoft.bot
bot-dialogs
- 4.13.0
+ 4.15.0-SNAPSHOT
compile
diff --git a/samples/java_springboot/05.multi-turn-prompt/src/main/java/com/microsoft/bot/sample/multiturnprompt/Application.java b/samples/java_springboot/05.multi-turn-prompt/src/main/java/com/microsoft/bot/sample/multiturnprompt/Application.java
index 32ac575617..1dfe1130d8 100644
--- a/samples/java_springboot/05.multi-turn-prompt/src/main/java/com/microsoft/bot/sample/multiturnprompt/Application.java
+++ b/samples/java_springboot/05.multi-turn-prompt/src/main/java/com/microsoft/bot/sample/multiturnprompt/Application.java
@@ -7,10 +7,10 @@
import com.microsoft.bot.builder.ConversationState;
import com.microsoft.bot.builder.UserState;
import com.microsoft.bot.dialogs.Dialog;
-import com.microsoft.bot.integration.AdapterWithErrorHandler;
-import com.microsoft.bot.integration.BotFrameworkHttpAdapter;
+import com.microsoft.bot.integration.CloudAdapter;
+import com.microsoft.bot.integration.CloudAdapterWithErrorHandler;
import com.microsoft.bot.integration.Configuration;
-import com.microsoft.bot.integration.spring.BotController;
+import com.microsoft.bot.integration.spring.BotCloudAdapterController;
import com.microsoft.bot.integration.spring.BotDependencyConfiguration;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -22,12 +22,12 @@
//
@SpringBootApplication
-// Use the default BotController to receive incoming Channel messages. A custom
+// Use the default BotCloudAdapterController to receive incoming Channel messages. A custom
// controller could be used by eliminating this import and creating a new
// org.springframework.web.bind.annotation.RestController.
// The default controller is created by the Spring Boot container using
// dependency injection. The default route is /api/messages.
-@Import({BotController.class})
+@Import({BotCloudAdapterController.class})
/**
* This class extends the BotDependencyConfiguration which provides the default
@@ -77,10 +77,10 @@ public Dialog getRootDialog(UserState userState) {
* Returns a custom Adapter that provides error handling.
*
* @param configuration The Configuration object to use.
- * @return An error handling BotFrameworkHttpAdapter.
+ * @return An error handling CloudAdapter.
*/
@Override
- public BotFrameworkHttpAdapter getBotFrameworkHttpAdaptor(Configuration configuration) {
- return new AdapterWithErrorHandler(configuration);
+ public CloudAdapter getCloudAdapter(Configuration configuration) {
+ return new CloudAdapterWithErrorHandler(configuration);
}
}
diff --git a/samples/java_springboot/06.using-cards/pom.xml b/samples/java_springboot/06.using-cards/pom.xml
index d02313ed50..862c6d6236 100644
--- a/samples/java_springboot/06.using-cards/pom.xml
+++ b/samples/java_springboot/06.using-cards/pom.xml
@@ -92,13 +92,13 @@
com.microsoft.bot
bot-integration-spring
- 4.13.0
+ 4.15.0-SNAPSHOT
compile
com.microsoft.bot
bot-dialogs
- 4.13.0
+ 4.15.0-SNAPSHOT
compile
diff --git a/samples/java_springboot/06.using-cards/src/main/java/com/microsoft/bot/sample/usingcards/Application.java b/samples/java_springboot/06.using-cards/src/main/java/com/microsoft/bot/sample/usingcards/Application.java
index 9db23c06f7..2e49520aff 100644
--- a/samples/java_springboot/06.using-cards/src/main/java/com/microsoft/bot/sample/usingcards/Application.java
+++ b/samples/java_springboot/06.using-cards/src/main/java/com/microsoft/bot/sample/usingcards/Application.java
@@ -7,10 +7,10 @@
import com.microsoft.bot.builder.ConversationState;
import com.microsoft.bot.builder.UserState;
import com.microsoft.bot.dialogs.Dialog;
-import com.microsoft.bot.integration.AdapterWithErrorHandler;
-import com.microsoft.bot.integration.BotFrameworkHttpAdapter;
+import com.microsoft.bot.integration.CloudAdapter;
+import com.microsoft.bot.integration.CloudAdapterWithErrorHandler;
import com.microsoft.bot.integration.Configuration;
-import com.microsoft.bot.integration.spring.BotController;
+import com.microsoft.bot.integration.spring.BotCloudAdapterController;
import com.microsoft.bot.integration.spring.BotDependencyConfiguration;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -22,12 +22,12 @@
//
@SpringBootApplication
-// Use the default BotController to receive incoming Channel messages. A custom
+// Use the default BotCloudAdapterController to receive incoming Channel messages. A custom
// controller could be used by eliminating this import and creating a new
// org.springframework.web.bind.annotation.RestController.
// The default controller is created by the Spring Boot container using
// dependency injection. The default route is /api/messages.
-@Import({BotController.class})
+@Import({BotCloudAdapterController.class})
/**
* This class extends the BotDependencyConfiguration which provides the default
@@ -77,10 +77,10 @@ public Dialog getRootDialog() {
* Returns a custom Adapter that provides error handling.
*
* @param configuration The Configuration object to use.
- * @return An error handling BotFrameworkHttpAdapter.
+ * @return An error handling CloudAdapter.
*/
@Override
- public BotFrameworkHttpAdapter getBotFrameworkHttpAdaptor(Configuration configuration) {
- return new AdapterWithErrorHandler(configuration);
+ public CloudAdapter getCloudAdapter(Configuration configuration) {
+ return new CloudAdapterWithErrorHandler(configuration);
}
}
diff --git a/samples/java_springboot/07.using-adaptive-cards/pom.xml b/samples/java_springboot/07.using-adaptive-cards/pom.xml
index c5ca5c94a1..6c01a60422 100644
--- a/samples/java_springboot/07.using-adaptive-cards/pom.xml
+++ b/samples/java_springboot/07.using-adaptive-cards/pom.xml
@@ -92,19 +92,19 @@
com.microsoft.bot
bot-integration-spring
- 4.13.0
+ 4.15.0-SNAPSHOT
compile
com.microsoft.bot
bot-dialogs
- 4.13.0
+ 4.15.0-SNAPSHOT
compile
com.microsoft.bot
bot-builder
- 4.13.0
+ 4.15.0-SNAPSHOT
compile
diff --git a/samples/java_springboot/07.using-adaptive-cards/src/main/java/com/microsoft/bot/sample/usingadaptivecards/AdaptiveCardsBot.java b/samples/java_springboot/07.using-adaptive-cards/src/main/java/com/microsoft/bot/sample/usingadaptivecards/AdaptiveCardsBot.java
index c69f35d4c1..0862f51d12 100644
--- a/samples/java_springboot/07.using-adaptive-cards/src/main/java/com/microsoft/bot/sample/usingadaptivecards/AdaptiveCardsBot.java
+++ b/samples/java_springboot/07.using-adaptive-cards/src/main/java/com/microsoft/bot/sample/usingadaptivecards/AdaptiveCardsBot.java
@@ -86,14 +86,15 @@ private static CompletableFuture sendWelcomeMessage(TurnContext turnContex
}
private static Attachment createAdaptiveCardAttachment(String filePath) {
+ Attachment attachment = new Attachment();
+
try (
- InputStream inputStream = Thread.currentThread().
- getContextClassLoader().getResourceAsStream(filePath)
+ InputStream inputStream = attachment.getClass()
+ .getClassLoader().getResourceAsStream(filePath)
) {
String adaptiveCardJson = IOUtils
.toString(inputStream, StandardCharsets.UTF_8.toString());
- Attachment attachment = new Attachment();
attachment.setContentType("application/vnd.microsoft.card.adaptive");
attachment.setContent(Serialization.jsonToTree(adaptiveCardJson));
diff --git a/samples/java_springboot/07.using-adaptive-cards/src/main/java/com/microsoft/bot/sample/usingadaptivecards/Application.java b/samples/java_springboot/07.using-adaptive-cards/src/main/java/com/microsoft/bot/sample/usingadaptivecards/Application.java
index 748172789b..7ba6a97a65 100644
--- a/samples/java_springboot/07.using-adaptive-cards/src/main/java/com/microsoft/bot/sample/usingadaptivecards/Application.java
+++ b/samples/java_springboot/07.using-adaptive-cards/src/main/java/com/microsoft/bot/sample/usingadaptivecards/Application.java
@@ -4,10 +4,10 @@
package com.microsoft.bot.sample.usingadaptivecards;
import com.microsoft.bot.builder.Bot;
-import com.microsoft.bot.integration.AdapterWithErrorHandler;
-import com.microsoft.bot.integration.BotFrameworkHttpAdapter;
+import com.microsoft.bot.integration.CloudAdapterWithErrorHandler;
+import com.microsoft.bot.integration.CloudAdapter;
import com.microsoft.bot.integration.Configuration;
-import com.microsoft.bot.integration.spring.BotController;
+import com.microsoft.bot.integration.spring.BotCloudAdapterController;
import com.microsoft.bot.integration.spring.BotDependencyConfiguration;
import org.springframework.boot.SpringApplication;
@@ -20,12 +20,12 @@
//
@SpringBootApplication
-// Use the default BotController to receive incoming Channel messages. A custom
+// Use the default BotCloudAdapterController to receive incoming Channel messages. A custom
// controller could be used by eliminating this import and creating a new
// org.springframework.web.bind.annotation.RestController.
// The default controller is created by the Spring Boot container using
// dependency injection. The default route is /api/messages.
-@Import({BotController.class})
+@Import({BotCloudAdapterController.class})
/**
* This class extends the BotDependencyConfiguration which provides the default
@@ -57,10 +57,10 @@ public Bot getBot() {
* Returns a custom Adapter that provides error handling.
*
* @param configuration The Configuration object to use.
- * @return An error handling BotFrameworkHttpAdapter.
+ * @return An error handling CloudAdapter.
*/
@Override
- public BotFrameworkHttpAdapter getBotFrameworkHttpAdaptor(Configuration configuration) {
- return new AdapterWithErrorHandler(configuration);
+ public CloudAdapter getCloudAdapter(Configuration configuration) {
+ return new CloudAdapterWithErrorHandler(configuration);
}
}
diff --git a/samples/java_springboot/08.suggested-actions/pom.xml b/samples/java_springboot/08.suggested-actions/pom.xml
index 93319c0705..56ecbecaac 100644
--- a/samples/java_springboot/08.suggested-actions/pom.xml
+++ b/samples/java_springboot/08.suggested-actions/pom.xml
@@ -92,7 +92,7 @@
com.microsoft.bot
bot-integration-spring
- 4.13.0
+ 4.15.0-SNAPSHOT
compile
diff --git a/samples/java_springboot/08.suggested-actions/src/main/java/com/microsoft/bot/sample/suggestedactions/Application.java b/samples/java_springboot/08.suggested-actions/src/main/java/com/microsoft/bot/sample/suggestedactions/Application.java
index 08514f8b39..eb0dbc9b57 100644
--- a/samples/java_springboot/08.suggested-actions/src/main/java/com/microsoft/bot/sample/suggestedactions/Application.java
+++ b/samples/java_springboot/08.suggested-actions/src/main/java/com/microsoft/bot/sample/suggestedactions/Application.java
@@ -4,10 +4,10 @@
package com.microsoft.bot.sample.suggestedactions;
import com.microsoft.bot.builder.Bot;
-import com.microsoft.bot.integration.AdapterWithErrorHandler;
-import com.microsoft.bot.integration.BotFrameworkHttpAdapter;
+import com.microsoft.bot.integration.CloudAdapterWithErrorHandler;
+import com.microsoft.bot.integration.CloudAdapter;
import com.microsoft.bot.integration.Configuration;
-import com.microsoft.bot.integration.spring.BotController;
+import com.microsoft.bot.integration.spring.BotCloudAdapterController;
import com.microsoft.bot.integration.spring.BotDependencyConfiguration;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -19,12 +19,12 @@
//
@SpringBootApplication
-// Use the default BotController to receive incoming Channel messages. A custom
+// Use the default BotCloudAdapterController to receive incoming Channel messages. A custom
// controller could be used by eliminating this import and creating a new
// org.springframework.web.bind.annotation.RestController.
// The default controller is created by the Spring Boot container using
// dependency injection. The default route is /api/messages.
-@Import({BotController.class})
+@Import({BotCloudAdapterController.class})
/**
* This class extends the BotDependencyConfiguration which provides the default
@@ -55,10 +55,10 @@ public Bot getBot() {
* Returns a custom Adapter that provides error handling.
*
* @param configuration The Configuration object to use.
- * @return An error handling BotFrameworkHttpAdapter.
+ * @return An error handling CloudAdapter.
*/
@Override
- public BotFrameworkHttpAdapter getBotFrameworkHttpAdaptor(Configuration configuration) {
- return new AdapterWithErrorHandler(configuration);
+ public CloudAdapter getCloudAdapter(Configuration configuration) {
+ return new CloudAdapterWithErrorHandler(configuration);
}
}
diff --git a/samples/java_springboot/11.qnamaker/README.md b/samples/java_springboot/11.qnamaker/README.md
index 02000d4cd1..e90feaf9e1 100644
--- a/samples/java_springboot/11.qnamaker/README.md
+++ b/samples/java_springboot/11.qnamaker/README.md
@@ -23,6 +23,8 @@ This samples **requires** prerequisites in order to run.
QnA knowledge base setup and application configuration steps can be found [here](https://aka.ms/qna-instructions).
+Once the Knowledge Base was created and published, refer to [this section](https://docs.microsoft.com/en-us/azure/bot-service/bot-builder-howto-qna?view=azure-bot-service-4.0&tabs=java#obtain-values-to-connect-your-bot-to-the-knowledge-base) for the instructions on how to obtain the QnAMaker parameters to be used in the application settings.
+
## To try this sample
- From the root of this project folder:
diff --git a/samples/java_springboot/11.qnamaker/pom.xml b/samples/java_springboot/11.qnamaker/pom.xml
index ad7d21935f..8626099fdc 100644
--- a/samples/java_springboot/11.qnamaker/pom.xml
+++ b/samples/java_springboot/11.qnamaker/pom.xml
@@ -77,7 +77,7 @@
com.microsoft.bot
bot-ai-qna
- 4.13.0
+ 4.15.0-SNAPSHOT
@@ -98,7 +98,7 @@
com.microsoft.bot
bot-integration-spring
- 4.13.0
+ 4.15.0-SNAPSHOT
compile
diff --git a/samples/java_springboot/11.qnamaker/src/main/java/com/microsoft/bot/sample/qnamaker/Application.java b/samples/java_springboot/11.qnamaker/src/main/java/com/microsoft/bot/sample/qnamaker/Application.java
index 053636cd5c..fa886eb41c 100644
--- a/samples/java_springboot/11.qnamaker/src/main/java/com/microsoft/bot/sample/qnamaker/Application.java
+++ b/samples/java_springboot/11.qnamaker/src/main/java/com/microsoft/bot/sample/qnamaker/Application.java
@@ -4,10 +4,10 @@
package com.microsoft.bot.sample.qnamaker;
import com.microsoft.bot.builder.Bot;
-import com.microsoft.bot.integration.AdapterWithErrorHandler;
-import com.microsoft.bot.integration.BotFrameworkHttpAdapter;
+import com.microsoft.bot.integration.CloudAdapterWithErrorHandler;
+import com.microsoft.bot.integration.CloudAdapter;
import com.microsoft.bot.integration.Configuration;
-import com.microsoft.bot.integration.spring.BotController;
+import com.microsoft.bot.integration.spring.BotCloudAdapterController;
import com.microsoft.bot.integration.spring.BotDependencyConfiguration;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -19,12 +19,12 @@
//
@SpringBootApplication
-// Use the default BotController to receive incoming Channel messages. A custom
+// Use the default BotCloudAdapterController to receive incoming Channel messages. A custom
// controller could be used by eliminating this import and creating a new
// org.springframework.web.bind.annotation.RestController.
// The default controller is created by the Spring Boot container using
// dependency injection. The default route is /api/messages.
-@Import({BotController.class})
+@Import({BotCloudAdapterController.class})
/**
* This class extends the BotDependencyConfiguration which provides the default
@@ -55,11 +55,11 @@ public Bot getBot(Configuration configuration) {
* Returns a custom Adapter that provides error handling.
*
* @param configuration The Configuration object to use.
- * @return An error handling BotFrameworkHttpAdapter.
+ * @return An error handling CloudAdapter.
*/
@Override
- public BotFrameworkHttpAdapter getBotFrameworkHttpAdaptor(Configuration configuration) {
- return new AdapterWithErrorHandler(configuration);
+ public CloudAdapter getCloudAdapter(Configuration configuration) {
+ return new CloudAdapterWithErrorHandler(configuration);
}
}
diff --git a/samples/java_springboot/13.core-bot/pom.xml b/samples/java_springboot/13.core-bot/pom.xml
index 514c70d07f..e295f3f3af 100644
--- a/samples/java_springboot/13.core-bot/pom.xml
+++ b/samples/java_springboot/13.core-bot/pom.xml
@@ -92,18 +92,23 @@
com.microsoft.bot
bot-integration-spring
- 4.13.0
+ 4.15.0-SNAPSHOT
compile
com.microsoft.bot
bot-dialogs
- 4.13.0
+ 4.15.0-SNAPSHOT
com.microsoft.bot
bot-ai-luis-v3
- 4.13.0
+ 4.15.0-SNAPSHOT
+
+
+ com.microsoft.bot
+ bot-applicationinsights
+ 4.15.0-SNAPSHOT
diff --git a/samples/java_springboot/13.core-bot/src/main/java/com/microsoft/bot/sample/core/Application.java b/samples/java_springboot/13.core-bot/src/main/java/com/microsoft/bot/sample/core/Application.java
index 8ae95d1f77..628518a807 100644
--- a/samples/java_springboot/13.core-bot/src/main/java/com/microsoft/bot/sample/core/Application.java
+++ b/samples/java_springboot/13.core-bot/src/main/java/com/microsoft/bot/sample/core/Application.java
@@ -6,10 +6,10 @@
import com.microsoft.bot.builder.Bot;
import com.microsoft.bot.builder.ConversationState;
import com.microsoft.bot.builder.UserState;
-import com.microsoft.bot.integration.AdapterWithErrorHandler;
-import com.microsoft.bot.integration.BotFrameworkHttpAdapter;
+import com.microsoft.bot.integration.CloudAdapterWithErrorHandler;
+import com.microsoft.bot.integration.CloudAdapter;
import com.microsoft.bot.integration.Configuration;
-import com.microsoft.bot.integration.spring.BotController;
+import com.microsoft.bot.integration.spring.BotCloudAdapterController;
import com.microsoft.bot.integration.spring.BotDependencyConfiguration;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -21,12 +21,12 @@
*/
@SpringBootApplication
-// Use the default BotController to receive incoming Channel messages. A custom
+// Use the default BotCloudAdapterController to receive incoming Channel messages. A custom
// controller could be used by eliminating this import and creating a new
// org.springframework.web.bind.annotation.RestController.
// The default controller is created by the Spring Boot container using
// dependency injection. The default route is /api/messages.
-@Import({BotController.class})
+@Import({BotCloudAdapterController.class})
/**
* This class extends the BotDependencyConfiguration which provides the default
@@ -69,11 +69,11 @@ public Bot getBot(
* Returns a custom Adapter that provides error handling.
*
* @param configuration The Configuration object to use.
- * @return An error handling BotFrameworkHttpAdapter.
+ * @return An error handling CloudAdapter.
*/
@Override
- public BotFrameworkHttpAdapter getBotFrameworkHttpAdaptor(Configuration configuration) {
- return new AdapterWithErrorHandler(configuration);
+ public CloudAdapter getCloudAdapter(Configuration configuration) {
+ return new CloudAdapterWithErrorHandler(configuration);
}
}
diff --git a/samples/java_springboot/13.core-bot/src/main/java/com/microsoft/bot/sample/core/DialogAndWelcomeBot.java b/samples/java_springboot/13.core-bot/src/main/java/com/microsoft/bot/sample/core/DialogAndWelcomeBot.java
index fa6c8e476f..0b4eb31e2f 100644
--- a/samples/java_springboot/13.core-bot/src/main/java/com/microsoft/bot/sample/core/DialogAndWelcomeBot.java
+++ b/samples/java_springboot/13.core-bot/src/main/java/com/microsoft/bot/sample/core/DialogAndWelcomeBot.java
@@ -78,14 +78,15 @@ protected CompletableFuture onMembersAdded(
// Load attachment from embedded resource.
private Attachment createAdaptiveCardAttachment() {
+ Attachment attachment = new Attachment();
+
try (
- InputStream inputStream = Thread.currentThread().
- getContextClassLoader().getResourceAsStream("cards/welcomeCard.json")
+ InputStream inputStream = attachment.getClass()
+ .getClassLoader().getResourceAsStream("cards/welcomeCard.json")
) {
String adaptiveCardJson = IOUtils
.toString(inputStream, StandardCharsets.UTF_8.toString());
- Attachment attachment = new Attachment();
attachment.setContentType("application/vnd.microsoft.card.adaptive");
attachment.setContent(Serialization.jsonToTree(adaptiveCardJson));
return attachment;
diff --git a/samples/java_springboot/14.nlp-with-dispatch/README.md b/samples/java_springboot/14.nlp-with-dispatch/README.md
index 032231611d..83f84f6d7d 100644
--- a/samples/java_springboot/14.nlp-with-dispatch/README.md
+++ b/samples/java_springboot/14.nlp-with-dispatch/README.md
@@ -22,6 +22,12 @@ This sample is a Spring Boot app and uses the Azure CLI and azure-webapp Maven p
This bot uses the Dispatch service to route utterances as it demonstrates the use of multiple LUIS models and QnA maker services to support multiper conversational scenarios.
+### Create a QnAMaker Application to enable QnA Knowledge Bases
+
+QnA knowledge base setup and application configuration steps can be found [here](https://aka.ms/qna-instructions).
+
+Once the Knowledge Base was created and published, refer to [this section](https://docs.microsoft.com/en-us/azure/bot-service/bot-builder-howto-qna?view=azure-bot-service-4.0&tabs=java#obtain-values-to-connect-your-bot-to-the-knowledge-base) for the instructions on how to obtain the QnAMaker parameters to be used in the application settings.
+
### Use Dispatch with Multiple LUIS and QnA Models
To learn how to configure Dispatch with multiple LUIS models and QnA Maker services, refer to the steps found [here](https://docs.microsoft.com/en-us/azure/bot-service/bot-builder-tutorial-dispatch?view=azure-bot-service-4.0).
diff --git a/samples/java_springboot/14.nlp-with-dispatch/pom.xml b/samples/java_springboot/14.nlp-with-dispatch/pom.xml
index 25afa4611c..4ee3bd751e 100644
--- a/samples/java_springboot/14.nlp-with-dispatch/pom.xml
+++ b/samples/java_springboot/14.nlp-with-dispatch/pom.xml
@@ -92,18 +92,18 @@
com.microsoft.bot
bot-integration-spring
- 4.13.0
+ 4.15.0-SNAPSHOT
compile
com.microsoft.bot
bot-ai-luis-v3
- 4.13.0
+ 4.15.0-SNAPSHOT
com.microsoft.bot
bot-ai-qna
- 4.13.0
+ 4.15.0-SNAPSHOT
diff --git a/samples/java_springboot/14.nlp-with-dispatch/src/main/java/com/microsoft/bot/sample/nlpwithdispatch/Application.java b/samples/java_springboot/14.nlp-with-dispatch/src/main/java/com/microsoft/bot/sample/nlpwithdispatch/Application.java
index 7b86c98e7e..15002f6a54 100644
--- a/samples/java_springboot/14.nlp-with-dispatch/src/main/java/com/microsoft/bot/sample/nlpwithdispatch/Application.java
+++ b/samples/java_springboot/14.nlp-with-dispatch/src/main/java/com/microsoft/bot/sample/nlpwithdispatch/Application.java
@@ -4,10 +4,10 @@
package com.microsoft.bot.sample.nlpwithdispatch;
import com.microsoft.bot.builder.Bot;
-import com.microsoft.bot.integration.AdapterWithErrorHandler;
-import com.microsoft.bot.integration.BotFrameworkHttpAdapter;
+import com.microsoft.bot.integration.CloudAdapterWithErrorHandler;
+import com.microsoft.bot.integration.CloudAdapter;
import com.microsoft.bot.integration.Configuration;
-import com.microsoft.bot.integration.spring.BotController;
+import com.microsoft.bot.integration.spring.BotCloudAdapterController;
import com.microsoft.bot.integration.spring.BotDependencyConfiguration;
import org.springframework.boot.SpringApplication;
@@ -20,12 +20,12 @@
//
@SpringBootApplication
-// Use the default BotController to receive incoming Channel messages. A custom
+// Use the default BotCloudAdapterController to receive incoming Channel messages. A custom
// controller could be used by eliminating this import and creating a new
// org.springframework.web.bind.annotation.RestController.
// The default controller is created by the Spring Boot container using
// dependency injection. The default route is /api/messages.
-@Import({BotController.class})
+@Import({BotCloudAdapterController.class})
/**
* This class extends the BotDependencyConfiguration which provides the default
@@ -63,10 +63,10 @@ public BotServices getBotServices(Configuration configuration) {
* Returns a custom Adapter that provides error handling.
*
* @param configuration The Configuration object to use.
- * @return An error handling BotFrameworkHttpAdapter.
+ * @return An error handling CloudAdapter.
*/
@Override
- public BotFrameworkHttpAdapter getBotFrameworkHttpAdaptor(Configuration configuration) {
- return new AdapterWithErrorHandler(configuration);
+ public CloudAdapter getCloudAdapter(Configuration configuration) {
+ return new CloudAdapterWithErrorHandler(configuration);
}
}
diff --git a/samples/java_springboot/15.handling-attachments/pom.xml b/samples/java_springboot/15.handling-attachments/pom.xml
index c61903545a..fbc28c68ff 100644
--- a/samples/java_springboot/15.handling-attachments/pom.xml
+++ b/samples/java_springboot/15.handling-attachments/pom.xml
@@ -97,7 +97,7 @@
com.microsoft.bot
bot-integration-spring
- 4.13.0
+ 4.15.0-SNAPSHOT
compile
diff --git a/samples/java_springboot/15.handling-attachments/src/main/java/com/microsoft/bot/sample/attachments/Application.java b/samples/java_springboot/15.handling-attachments/src/main/java/com/microsoft/bot/sample/attachments/Application.java
index 577e8bcc88..dd7a0b28c6 100644
--- a/samples/java_springboot/15.handling-attachments/src/main/java/com/microsoft/bot/sample/attachments/Application.java
+++ b/samples/java_springboot/15.handling-attachments/src/main/java/com/microsoft/bot/sample/attachments/Application.java
@@ -4,10 +4,10 @@
package com.microsoft.bot.sample.attachments;
import com.microsoft.bot.builder.Bot;
-import com.microsoft.bot.integration.AdapterWithErrorHandler;
-import com.microsoft.bot.integration.BotFrameworkHttpAdapter;
+import com.microsoft.bot.integration.CloudAdapterWithErrorHandler;
+import com.microsoft.bot.integration.CloudAdapter;
import com.microsoft.bot.integration.Configuration;
-import com.microsoft.bot.integration.spring.BotController;
+import com.microsoft.bot.integration.spring.BotCloudAdapterController;
import com.microsoft.bot.integration.spring.BotDependencyConfiguration;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -19,12 +19,12 @@
//
@SpringBootApplication
-// Use the default BotController to receive incoming Channel messages. A custom
+// Use the default BotCloudAdapterController to receive incoming Channel messages. A custom
// controller could be used by eliminating this import and creating a new
// org.springframework.web.bind.annotation.RestController.
// The default controller is created by the Spring Boot container using
// dependency injection. The default route is /api/messages.
-@Import({BotController.class})
+@Import({BotCloudAdapterController.class})
/**
* This class extends the BotDependencyConfiguration which provides the default
@@ -56,10 +56,10 @@ public Bot getBot() {
* Returns a custom Adapter that provides error handling.
*
* @param configuration The Configuration object to use.
- * @return An error handling BotFrameworkHttpAdapter.
+ * @return An error handling CloudAdapter.
*/
@Override
- public BotFrameworkHttpAdapter getBotFrameworkHttpAdaptor(Configuration configuration) {
- return new AdapterWithErrorHandler(configuration);
+ public CloudAdapter getCloudAdapter(Configuration configuration) {
+ return new CloudAdapterWithErrorHandler(configuration);
}
}
diff --git a/samples/java_springboot/15.handling-attachments/src/main/java/com/microsoft/bot/sample/attachments/AttachmentsBot.java b/samples/java_springboot/15.handling-attachments/src/main/java/com/microsoft/bot/sample/attachments/AttachmentsBot.java
index 996812e825..3090a98951 100644
--- a/samples/java_springboot/15.handling-attachments/src/main/java/com/microsoft/bot/sample/attachments/AttachmentsBot.java
+++ b/samples/java_springboot/15.handling-attachments/src/main/java/com/microsoft/bot/sample/attachments/AttachmentsBot.java
@@ -255,7 +255,10 @@ private CompletableFuture getEncodedFileData(String filename) {
}
private CompletableFuture getFileData(String filename) {
- try (InputStream inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(filename)) {
+ try (
+ InputStream inputStream = getClass().getClassLoader()
+ .getResourceAsStream(filename)
+ ) {
return CompletableFuture.completedFuture(IOUtils.toByteArray(inputStream));
} catch (Throwable t) {
return Async.completeExceptionally(t);
diff --git a/samples/java_springboot/16.proactive-messages/README.md b/samples/java_springboot/16.proactive-messages/README.md
index e86209c8fe..b9c1e4de59 100644
--- a/samples/java_springboot/16.proactive-messages/README.md
+++ b/samples/java_springboot/16.proactive-messages/README.md
@@ -41,7 +41,7 @@ With the Bot Framework Emulator connected to your running bot, the sample will n
### Using curl
-- Send a get request to `http://localhost:3978/api/notify` to proactively message users from the bot.
+- Send an HTTP `GET` request to `http://localhost:3978/api/notify` to proactively message users from the bot by opening the URL in the browser or using cURL as shown below:
```bash
curl get http://localhost:3978/api/notify
diff --git a/samples/java_springboot/16.proactive-messages/pom.xml b/samples/java_springboot/16.proactive-messages/pom.xml
index e2cfc39db7..d57b4ded89 100644
--- a/samples/java_springboot/16.proactive-messages/pom.xml
+++ b/samples/java_springboot/16.proactive-messages/pom.xml
@@ -92,7 +92,7 @@
com.microsoft.bot
bot-integration-spring
- 4.13.0
+ 4.15.0-SNAPSHOT
compile
diff --git a/samples/java_springboot/16.proactive-messages/src/main/java/com/microsoft/bot/sample/proactive/Application.java b/samples/java_springboot/16.proactive-messages/src/main/java/com/microsoft/bot/sample/proactive/Application.java
index fead67fbd4..ec09b79df8 100644
--- a/samples/java_springboot/16.proactive-messages/src/main/java/com/microsoft/bot/sample/proactive/Application.java
+++ b/samples/java_springboot/16.proactive-messages/src/main/java/com/microsoft/bot/sample/proactive/Application.java
@@ -4,10 +4,10 @@
package com.microsoft.bot.sample.proactive;
import com.microsoft.bot.builder.Bot;
-import com.microsoft.bot.integration.AdapterWithErrorHandler;
-import com.microsoft.bot.integration.BotFrameworkHttpAdapter;
+import com.microsoft.bot.integration.CloudAdapterWithErrorHandler;
+import com.microsoft.bot.integration.CloudAdapter;
import com.microsoft.bot.integration.Configuration;
-import com.microsoft.bot.integration.spring.BotController;
+import com.microsoft.bot.integration.spring.BotCloudAdapterController;
import com.microsoft.bot.integration.spring.BotDependencyConfiguration;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -19,14 +19,14 @@
//
@SpringBootApplication
-// Use the default BotController to receive incoming Channel messages. A custom
+// Use the default BotCloudAdapterController to receive incoming Channel messages. A custom
// controller could be used by eliminating this import and creating a new
// org.springframework.web.bind.annotation.RestController.
// The default controller is created by the Spring Boot container using
// dependency injection. The default route is /api/messages.
//
// See NotifyController in this project for an example on adding a controller.
-@Import({BotController.class})
+@Import({BotCloudAdapterController.class})
/**
* This class extends the BotDependencyConfiguration which provides the default
@@ -68,10 +68,10 @@ public ConversationReferences getConversationReferences() {
* Returns a custom Adapter that provides error handling.
*
* @param configuration The Configuration object to use.
- * @return An error handling BotFrameworkHttpAdapter.
+ * @return An error handling CloudAdapter.
*/
@Override
- public BotFrameworkHttpAdapter getBotFrameworkHttpAdaptor(Configuration configuration) {
- return new AdapterWithErrorHandler(configuration);
+ public CloudAdapter getCloudAdapter(Configuration configuration) {
+ return new CloudAdapterWithErrorHandler(configuration);
}
}
diff --git a/samples/java_springboot/17.multilingual-bot/pom.xml b/samples/java_springboot/17.multilingual-bot/pom.xml
index 3ba325281e..ec41812eed 100644
--- a/samples/java_springboot/17.multilingual-bot/pom.xml
+++ b/samples/java_springboot/17.multilingual-bot/pom.xml
@@ -92,7 +92,7 @@
com.microsoft.bot
bot-integration-spring
- 4.13.0
+ 4.15.0-SNAPSHOT
compile
diff --git a/samples/java_springboot/17.multilingual-bot/src/main/java/com/microsoft/bot/sample/multilingual/Application.java b/samples/java_springboot/17.multilingual-bot/src/main/java/com/microsoft/bot/sample/multilingual/Application.java
index dafe6ca935..6b6e1c277b 100644
--- a/samples/java_springboot/17.multilingual-bot/src/main/java/com/microsoft/bot/sample/multilingual/Application.java
+++ b/samples/java_springboot/17.multilingual-bot/src/main/java/com/microsoft/bot/sample/multilingual/Application.java
@@ -7,10 +7,10 @@
import com.microsoft.bot.builder.ConversationState;
import com.microsoft.bot.builder.Storage;
import com.microsoft.bot.builder.UserState;
-import com.microsoft.bot.integration.AdapterWithErrorHandler;
-import com.microsoft.bot.integration.BotFrameworkHttpAdapter;
+import com.microsoft.bot.integration.CloudAdapterWithErrorHandler;
+import com.microsoft.bot.integration.CloudAdapter;
import com.microsoft.bot.integration.Configuration;
-import com.microsoft.bot.integration.spring.BotController;
+import com.microsoft.bot.integration.spring.BotCloudAdapterController;
import com.microsoft.bot.integration.spring.BotDependencyConfiguration;
import com.microsoft.bot.sample.multilingual.translation.MicrosoftTranslator;
import com.microsoft.bot.sample.multilingual.translation.TranslationMiddleware;
@@ -25,12 +25,12 @@
//
@SpringBootApplication
-// Use the default BotController to receive incoming Channel messages. A custom
+// Use the default BotCloudAdapterController to receive incoming Channel messages. A custom
// controller could be used by eliminating this import and creating a new
// org.springframework.web.bind.annotation.RestController.
// The default controller is created by the Spring Boot container using
// dependency injection. The default route is /api/messages.
-@Import({BotController.class})
+@Import({BotCloudAdapterController.class})
/**
* This class extends the BotDependencyConfiguration which provides the default
@@ -61,14 +61,14 @@ public Bot getBot(UserState userState) {
* Returns a custom Adapter that provides error handling.
*
* @param configuration The Configuration object to use.
- * @return An error handling BotFrameworkHttpAdapter.
+ * @return An error handling CloudAdapter.
*/
@Override
- public BotFrameworkHttpAdapter getBotFrameworkHttpAdaptor(Configuration configuration) {
+ public CloudAdapter getCloudAdapter(Configuration configuration) {
Storage storage = this.getStorage();
ConversationState conversationState = this.getConversationState(storage);
- BotFrameworkHttpAdapter adapter = new AdapterWithErrorHandler(configuration, conversationState);
+ CloudAdapter adapter = new CloudAdapterWithErrorHandler(configuration, conversationState);
TranslationMiddleware translationMiddleware = this.getTranslationMiddleware(configuration);
adapter.use(translationMiddleware);
return adapter;
diff --git a/samples/java_springboot/17.multilingual-bot/src/main/java/com/microsoft/bot/sample/multilingual/MultiLingualBot.java b/samples/java_springboot/17.multilingual-bot/src/main/java/com/microsoft/bot/sample/multilingual/MultiLingualBot.java
index fba0a1d7d3..5344516171 100644
--- a/samples/java_springboot/17.multilingual-bot/src/main/java/com/microsoft/bot/sample/multilingual/MultiLingualBot.java
+++ b/samples/java_springboot/17.multilingual-bot/src/main/java/com/microsoft/bot/sample/multilingual/MultiLingualBot.java
@@ -142,14 +142,15 @@ private static CompletableFuture sendWelcomeMessage(TurnContext turnContex
* @return the welcome adaptive card
*/
private static Attachment createAdaptiveCardAttachment() {
+ Attachment attachment = new Attachment();
+
// combine path for cross platform support
try (
- InputStream input = Thread.currentThread().getContextClassLoader()
+ InputStream inputStream = attachment.getClass().getClassLoader()
.getResourceAsStream("cards/welcomeCard.json")
) {
- String adaptiveCardJson = IOUtils.toString(input, StandardCharsets.UTF_8.toString());
+ String adaptiveCardJson = IOUtils.toString(inputStream, StandardCharsets.UTF_8.toString());
- Attachment attachment = new Attachment();
attachment.setContentType("application/vnd.microsoft.card.adaptive");
attachment.setContent(Serialization.jsonToTree(adaptiveCardJson));
return attachment;
diff --git a/samples/java_springboot/18.bot-authentication/README.md b/samples/java_springboot/18.bot-authentication/README.md
index 55076c4474..0f68daabff 100644
--- a/samples/java_springboot/18.bot-authentication/README.md
+++ b/samples/java_springboot/18.bot-authentication/README.md
@@ -16,7 +16,7 @@ This sample is a Spring Boot app and uses the Azure CLI and azure-webapp Maven p
- Install [Maven](https://maven.apache.org/)
- An account on [Azure](https://azure.microsoft.com) if you want to deploy to Azure.
- Deploy your bot to Azure
-- [Add Authentication to your bot via Azure Bot Service](https://docs.microsoft.com/en-us/azure/bot-service/bot-builder-authentication?view=azure-bot-service-4.0&tabs=aadv2%2Ccsharp)
+- Follow the instruction in this document to configure the OAuth authentication: [Add Authentication to your bot via Azure Bot Service](https://docs.microsoft.com/en-us/azure/bot-service/bot-builder-authentication?view=azure-bot-service-4.0&tabs=aadv2%2Ccsharp)
## To try this sample
- From the root of this project folder:
diff --git a/samples/java_springboot/18.bot-authentication/pom.xml b/samples/java_springboot/18.bot-authentication/pom.xml
index 03e80ecd80..bcb89cc7ee 100644
--- a/samples/java_springboot/18.bot-authentication/pom.xml
+++ b/samples/java_springboot/18.bot-authentication/pom.xml
@@ -92,13 +92,13 @@
com.microsoft.bot
bot-integration-spring
- 4.13.0
+ 4.15.0-SNAPSHOT
compile
com.microsoft.bot
bot-dialogs
- 4.13.0
+ 4.15.0-SNAPSHOT
compile
diff --git a/samples/java_springboot/18.bot-authentication/src/main/java/com/microsoft/bot/sample/authentication/Application.java b/samples/java_springboot/18.bot-authentication/src/main/java/com/microsoft/bot/sample/authentication/Application.java
index 714c060067..3a2a9a4f61 100644
--- a/samples/java_springboot/18.bot-authentication/src/main/java/com/microsoft/bot/sample/authentication/Application.java
+++ b/samples/java_springboot/18.bot-authentication/src/main/java/com/microsoft/bot/sample/authentication/Application.java
@@ -7,10 +7,10 @@
import com.microsoft.bot.builder.ConversationState;
import com.microsoft.bot.builder.UserState;
import com.microsoft.bot.dialogs.Dialog;
-import com.microsoft.bot.integration.AdapterWithErrorHandler;
-import com.microsoft.bot.integration.BotFrameworkHttpAdapter;
+import com.microsoft.bot.integration.CloudAdapterWithErrorHandler;
+import com.microsoft.bot.integration.CloudAdapter;
import com.microsoft.bot.integration.Configuration;
-import com.microsoft.bot.integration.spring.BotController;
+import com.microsoft.bot.integration.spring.BotCloudAdapterController;
import com.microsoft.bot.integration.spring.BotDependencyConfiguration;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -22,12 +22,12 @@
//
@SpringBootApplication
-// Use the default BotController to receive incoming Channel messages. A custom
+// Use the default BotCloudAdapterController to receive incoming Channel messages. A custom
// controller could be used by eliminating this import and creating a new
// org.springframework.web.bind.annotation.RestController.
// The default controller is created by the Spring Boot container using
// dependency injection. The default route is /api/messages.
-@Import({BotController.class})
+@Import({BotCloudAdapterController.class})
/**
* This class extends the BotDependencyConfiguration which provides the default
@@ -62,10 +62,10 @@ public Bot getBot(
* Returns a custom Adapter that provides error handling.
*
* @param configuration The Configuration object to use.
- * @return An error handling BotFrameworkHttpAdapter.
+ * @return An error handling CloudAdapter.
*/
@Override
- public BotFrameworkHttpAdapter getBotFrameworkHttpAdaptor(Configuration configuration) {
- return new AdapterWithErrorHandler(configuration);
+ public CloudAdapter getCloudAdapter(Configuration configuration) {
+ return new CloudAdapterWithErrorHandler(configuration);
}
}
diff --git a/samples/java_springboot/19.custom-dialogs/pom.xml b/samples/java_springboot/19.custom-dialogs/pom.xml
index a7e8414983..83f94735bf 100644
--- a/samples/java_springboot/19.custom-dialogs/pom.xml
+++ b/samples/java_springboot/19.custom-dialogs/pom.xml
@@ -92,13 +92,13 @@
com.microsoft.bot
bot-integration-spring
- 4.13.0
+ 4.15.0-SNAPSHOT
compile
com.microsoft.bot
bot-dialogs
- 4.13.0
+ 4.15.0-SNAPSHOT
compile
diff --git a/samples/java_springboot/19.custom-dialogs/src/main/java/com/microsoft/bot/sample/customdialogs/Application.java b/samples/java_springboot/19.custom-dialogs/src/main/java/com/microsoft/bot/sample/customdialogs/Application.java
index 4997b04e01..0cdff999e2 100644
--- a/samples/java_springboot/19.custom-dialogs/src/main/java/com/microsoft/bot/sample/customdialogs/Application.java
+++ b/samples/java_springboot/19.custom-dialogs/src/main/java/com/microsoft/bot/sample/customdialogs/Application.java
@@ -7,10 +7,10 @@
import com.microsoft.bot.builder.ConversationState;
import com.microsoft.bot.builder.UserState;
import com.microsoft.bot.dialogs.Dialog;
-import com.microsoft.bot.integration.AdapterWithErrorHandler;
-import com.microsoft.bot.integration.BotFrameworkHttpAdapter;
+import com.microsoft.bot.integration.CloudAdapterWithErrorHandler;
+import com.microsoft.bot.integration.CloudAdapter;
import com.microsoft.bot.integration.Configuration;
-import com.microsoft.bot.integration.spring.BotController;
+import com.microsoft.bot.integration.spring.BotCloudAdapterController;
import com.microsoft.bot.integration.spring.BotDependencyConfiguration;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -22,12 +22,12 @@
//
@SpringBootApplication
-// Use the default BotController to receive incoming Channel messages. A custom
+// Use the default BotCloudAdapterController to receive incoming Channel messages. A custom
// controller could be used by eliminating this import and creating a new
// org.springframework.web.bind.annotation.RestController.
// The default controller is created by the Spring Boot container using
// dependency injection. The default route is /api/messages.
-@Import({BotController.class})
+@Import({BotCloudAdapterController.class})
/**
* This class extends the BotDependencyConfiguration which provides the default
@@ -77,10 +77,10 @@ public Dialog getRootDialog(UserState userState) {
* Returns a custom Adapter that provides error handling.
*
* @param configuration The Configuration object to use.
- * @return An error handling BotFrameworkHttpAdapter.
+ * @return An error handling CloudAdapter.
*/
@Override
- public BotFrameworkHttpAdapter getBotFrameworkHttpAdaptor(Configuration configuration) {
- return new AdapterWithErrorHandler(configuration);
+ public CloudAdapter getCloudAdapter(Configuration configuration) {
+ return new CloudAdapterWithErrorHandler(configuration);
}
}
diff --git a/samples/java_springboot/21.corebot-app-insights/pom.xml b/samples/java_springboot/21.corebot-app-insights/pom.xml
index 2ed9e27130..67109ff020 100644
--- a/samples/java_springboot/21.corebot-app-insights/pom.xml
+++ b/samples/java_springboot/21.corebot-app-insights/pom.xml
@@ -92,23 +92,23 @@
com.microsoft.bot
bot-integration-spring
- 4.13.0
+ 4.15.0-SNAPSHOT
compile
com.microsoft.bot
bot-dialogs
- 4.13.0
+ 4.15.0-SNAPSHOT
com.microsoft.bot
bot-ai-luis-v3
- 4.13.0
+ 4.15.0-SNAPSHOT
com.microsoft.bot
bot-applicationinsights
- 4.13.0
+ 4.15.0-SNAPSHOT
diff --git a/samples/java_springboot/21.corebot-app-insights/src/main/java/com/microsoft/bot/sample/corebot/app/insights/Application.java b/samples/java_springboot/21.corebot-app-insights/src/main/java/com/microsoft/bot/sample/corebot/app/insights/Application.java
index 6cc9570e76..0b4021a11c 100644
--- a/samples/java_springboot/21.corebot-app-insights/src/main/java/com/microsoft/bot/sample/corebot/app/insights/Application.java
+++ b/samples/java_springboot/21.corebot-app-insights/src/main/java/com/microsoft/bot/sample/corebot/app/insights/Application.java
@@ -12,9 +12,9 @@
import com.microsoft.bot.builder.Storage;
import com.microsoft.bot.builder.TelemetryLoggerMiddleware;
import com.microsoft.bot.builder.UserState;
-import com.microsoft.bot.integration.BotFrameworkHttpAdapter;
+import com.microsoft.bot.integration.CloudAdapter;
import com.microsoft.bot.integration.Configuration;
-import com.microsoft.bot.integration.spring.BotController;
+import com.microsoft.bot.integration.spring.BotCloudAdapterController;
import com.microsoft.bot.integration.spring.BotDependencyConfiguration;
import org.apache.commons.lang3.StringUtils;
import org.springframework.boot.SpringApplication;
@@ -27,12 +27,12 @@
*/
@SpringBootApplication
-// Use the default BotController to receive incoming Channel messages. A custom
+// Use the default BotCloudAdapterController to receive incoming Channel messages. A custom
// controller could be used by eliminating this import and creating a new
// org.springframework.web.bind.annotation.RestController.
// The default controller is created by the Spring Boot container using
// dependency injection. The default route is /api/messages.
-@Import({BotController.class})
+@Import({BotCloudAdapterController.class})
/**
* This class extends the BotDependencyConfiguration which provides the default
@@ -80,10 +80,10 @@ public Bot getBot(
* Returns a custom Adapter that provides error handling.
*
* @param configuration The Configuration object to use.
- * @return An error handling BotFrameworkHttpAdapter.
+ * @return An error handling CloudAdapter.
*/
@Override
- public BotFrameworkHttpAdapter getBotFrameworkHttpAdaptor(Configuration configuration) {
+ public CloudAdapter getCloudAdapter(Configuration configuration) {
Storage storage = getStorage();
ConversationState conversationState = getConversationState(storage);
BotTelemetryClient botTelemetryClient = getBotTelemetryClient(configuration);
@@ -91,7 +91,7 @@ public BotFrameworkHttpAdapter getBotFrameworkHttpAdaptor(Configuration configur
TelemetryInitializerMiddleware telemetryInitializerMiddleware =
new TelemetryInitializerMiddleware(telemetryLoggerMiddleware, false);
- AdapterWithErrorHandler adapter = new AdapterWithErrorHandler(
+ CloudAdapterWithErrorHandler adapter = new CloudAdapterWithErrorHandler(
configuration,
telemetryInitializerMiddleware,
botTelemetryClient,
diff --git a/samples/java_springboot/21.corebot-app-insights/src/main/java/com/microsoft/bot/sample/corebot/app/insights/AdapterWithErrorHandler.java b/samples/java_springboot/21.corebot-app-insights/src/main/java/com/microsoft/bot/sample/corebot/app/insights/CloudAdapterWithErrorHandler.java
similarity index 83%
rename from samples/java_springboot/21.corebot-app-insights/src/main/java/com/microsoft/bot/sample/corebot/app/insights/AdapterWithErrorHandler.java
rename to samples/java_springboot/21.corebot-app-insights/src/main/java/com/microsoft/bot/sample/corebot/app/insights/CloudAdapterWithErrorHandler.java
index fb82e8328b..f9875ddaaa 100644
--- a/samples/java_springboot/21.corebot-app-insights/src/main/java/com/microsoft/bot/sample/corebot/app/insights/AdapterWithErrorHandler.java
+++ b/samples/java_springboot/21.corebot-app-insights/src/main/java/com/microsoft/bot/sample/corebot/app/insights/CloudAdapterWithErrorHandler.java
@@ -9,7 +9,7 @@
import com.microsoft.bot.builder.MessageFactory;
import com.microsoft.bot.builder.TurnContext;
import com.microsoft.bot.connector.Channels;
-import com.microsoft.bot.integration.BotFrameworkHttpAdapter;
+import com.microsoft.bot.integration.CloudAdapter;
import com.microsoft.bot.integration.Configuration;
import com.microsoft.bot.schema.Activity;
import com.microsoft.bot.schema.ActivityTypes;
@@ -25,12 +25,10 @@
/**
* An Adapter that provides exception handling.
*/
-public class AdapterWithErrorHandler extends BotFrameworkHttpAdapter {
-
+public class CloudAdapterWithErrorHandler extends CloudAdapter {
private static final String ERROR_MSG_ONE = "The bot encountered an error or bug.";
private static final String ERROR_MSG_TWO =
- "To continue to run this bot, please fix the bot source code.";
- // Create field for telemetry client. Add IBotTelemetryClient parameter to AdapterWithErrorHandler
+ "To continue to run this bot, please fix the bot source code.";
private BotTelemetryClient adapterBotTelemetryClient;
/**
@@ -47,11 +45,10 @@ public class AdapterWithErrorHandler extends BotFrameworkHttpAdapter {
* @param botTelemetryClient The BotTelemetryClient object to use.
* @param withConversationState The ConversationState object to use.
*/
- public AdapterWithErrorHandler(
- Configuration withConfiguration,
- TelemetryInitializerMiddleware telemetryInitializerMiddleware,
- BotTelemetryClient botTelemetryClient,
- @Nullable ConversationState withConversationState) {
+ public CloudAdapterWithErrorHandler(Configuration withConfiguration,
+ TelemetryInitializerMiddleware telemetryInitializerMiddleware,
+ BotTelemetryClient botTelemetryClient,
+ @Nullable ConversationState withConversationState) {
super(withConfiguration);
this.use(telemetryInitializerMiddleware);
@@ -70,7 +67,7 @@ public AdapterWithErrorHandler(
// NOTE: In production environment, you should consider logging this to
// Azure Application Insights. Visit https://aka.ms/bottelemetry to see how
// to add telemetry capture to your bot.
- LoggerFactory.getLogger(AdapterWithErrorHandler.class).error("onTurnError", exception);
+ LoggerFactory.getLogger(CloudAdapterWithErrorHandler.class).error("onTurnError", exception);
// Send a message to the user
return turnContext.sendActivities(
@@ -84,7 +81,7 @@ public AdapterWithErrorHandler(
// Web pages.
return withConversationState.delete(turnContext)
.exceptionally(deleteException -> {
- LoggerFactory.getLogger(AdapterWithErrorHandler.class)
+ LoggerFactory.getLogger(CloudAdapterWithErrorHandler.class)
.error("ConversationState.delete", deleteException);
return null;
});
@@ -95,8 +92,8 @@ public AdapterWithErrorHandler(
}
private CompletableFuture sendTraceActivity(
- TurnContext turnContext,
- Throwable exception
+ TurnContext turnContext,
+ Throwable exception
) {
if (StringUtils.equals(turnContext.getActivity().getChannelId(), Channels.EMULATOR)) {
Activity traceActivity = new Activity(ActivityTypes.TRACE);
@@ -105,7 +102,6 @@ private CompletableFuture sendTraceActivity(
traceActivity.setValue(ExceptionUtils.getStackTrace(exception));
traceActivity.setValueType("https://www.botframework.com/schemas/error");
- // Send a trace activity, which will be displayed in the Bot Framework Emulator
return turnContext.sendActivity(traceActivity).thenApply(resourceResponse -> null);
}
diff --git a/samples/java_springboot/21.corebot-app-insights/src/main/java/com/microsoft/bot/sample/corebot/app/insights/DialogAndWelcomeBot.java b/samples/java_springboot/21.corebot-app-insights/src/main/java/com/microsoft/bot/sample/corebot/app/insights/DialogAndWelcomeBot.java
index fd3bf4ce4a..27473b4064 100644
--- a/samples/java_springboot/21.corebot-app-insights/src/main/java/com/microsoft/bot/sample/corebot/app/insights/DialogAndWelcomeBot.java
+++ b/samples/java_springboot/21.corebot-app-insights/src/main/java/com/microsoft/bot/sample/corebot/app/insights/DialogAndWelcomeBot.java
@@ -78,14 +78,15 @@ protected CompletableFuture onMembersAdded(
// Load attachment from embedded resource.
private Attachment createAdaptiveCardAttachment() {
+ Attachment attachment = new Attachment();
+
try (
- InputStream inputStream = Thread.currentThread().
- getContextClassLoader().getResourceAsStream("cards/welcomeCard.json")
+ InputStream inputStream = attachment.getClass().getClassLoader()
+ .getResourceAsStream("cards/welcomeCard.json")
) {
String adaptiveCardJson = IOUtils
.toString(inputStream, StandardCharsets.UTF_8.toString());
- Attachment attachment = new Attachment();
attachment.setContentType("application/vnd.microsoft.card.adaptive");
attachment.setContent(Serialization.jsonToTree(adaptiveCardJson));
return attachment;
diff --git a/samples/java_springboot/23.facebook-events/pom.xml b/samples/java_springboot/23.facebook-events/pom.xml
index 04c5574075..03a87a80ea 100644
--- a/samples/java_springboot/23.facebook-events/pom.xml
+++ b/samples/java_springboot/23.facebook-events/pom.xml
@@ -91,13 +91,13 @@
com.microsoft.bot
bot-integration-spring
- 4.13.0
+ 4.15.0-SNAPSHOT
compile
com.microsoft.bot
bot-dialogs
- 4.13.0
+ 4.15.0-SNAPSHOT
compile
diff --git a/samples/java_springboot/23.facebook-events/src/main/java/com/microsoft/bot/sample/facebookevents/Application.java b/samples/java_springboot/23.facebook-events/src/main/java/com/microsoft/bot/sample/facebookevents/Application.java
index 49f94931d7..7d70961099 100644
--- a/samples/java_springboot/23.facebook-events/src/main/java/com/microsoft/bot/sample/facebookevents/Application.java
+++ b/samples/java_springboot/23.facebook-events/src/main/java/com/microsoft/bot/sample/facebookevents/Application.java
@@ -4,10 +4,10 @@
package com.microsoft.bot.sample.facebookevents;
import com.microsoft.bot.builder.Bot;
-import com.microsoft.bot.integration.AdapterWithErrorHandler;
-import com.microsoft.bot.integration.BotFrameworkHttpAdapter;
+import com.microsoft.bot.integration.CloudAdapterWithErrorHandler;
+import com.microsoft.bot.integration.CloudAdapter;
import com.microsoft.bot.integration.Configuration;
-import com.microsoft.bot.integration.spring.BotController;
+import com.microsoft.bot.integration.spring.BotCloudAdapterController;
import com.microsoft.bot.integration.spring.BotDependencyConfiguration;
import org.springframework.boot.SpringApplication;
@@ -20,12 +20,12 @@
//
@SpringBootApplication
-// Use the default BotController to receive incoming Channel messages. A custom
+// Use the default BotCloudAdapterController to receive incoming Channel messages. A custom
// controller could be used by eliminating this import and creating a new
// org.springframework.web.bind.annotation.RestController.
// The default controller is created by the Spring Boot container using
// dependency injection. The default route is /api/messages.
-@Import({BotController.class})
+@Import({BotCloudAdapterController.class})
/**
* This class extends the BotDependencyConfiguration which provides the default
@@ -57,10 +57,10 @@ public Bot getBot() {
* Returns a custom Adapter that provides error handling.
*
* @param configuration The Configuration object to use.
- * @return An error handling BotFrameworkHttpAdapter.
+ * @return An error handling CloudAdapter.
*/
@Override
- public BotFrameworkHttpAdapter getBotFrameworkHttpAdaptor(Configuration configuration) {
- return new AdapterWithErrorHandler(configuration);
+ public CloudAdapter getCloudAdapter(Configuration configuration) {
+ return new CloudAdapterWithErrorHandler(configuration);
}
}
diff --git a/samples/java_springboot/24.bot-authentication-msgraph/README.md b/samples/java_springboot/24.bot-authentication-msgraph/README.md
index 9d1b818a59..5855524008 100644
--- a/samples/java_springboot/24.bot-authentication-msgraph/README.md
+++ b/samples/java_springboot/24.bot-authentication-msgraph/README.md
@@ -18,8 +18,9 @@ This sample is a Spring Boot app and uses the Azure CLI and azure-webapp Maven p
- Java 1.8+
- Install [Maven](https://maven.apache.org/)
- An account on [Azure](https://azure.microsoft.com) if you want to deploy to Azure.
+- Follow the instruction in this document to configure the OAuth authentication: [Add Authentication to your bot via Azure Bot Service](https://docs.microsoft.com/en-us/azure/bot-service/bot-builder-authentication?view=azure-bot-service-4.0&tabs=aadv2%2Ccsharp)
- Update `application.properties` with required configuration settings
- - MicrosoftAppId
+ - MicrosoftAppId
- MicrosoftAppPassword
- ConnectionName
diff --git a/samples/java_springboot/24.bot-authentication-msgraph/pom.xml b/samples/java_springboot/24.bot-authentication-msgraph/pom.xml
index 059c2af7ff..04c3a3a292 100644
--- a/samples/java_springboot/24.bot-authentication-msgraph/pom.xml
+++ b/samples/java_springboot/24.bot-authentication-msgraph/pom.xml
@@ -97,13 +97,13 @@
com.microsoft.bot
bot-integration-spring
- 4.13.0
+ 4.15.0-SNAPSHOT
compile
com.microsoft.bot
bot-dialogs
- 4.13.0
+ 4.15.0-SNAPSHOT
compile
diff --git a/samples/java_springboot/24.bot-authentication-msgraph/src/main/java/com/microsoft/bot/sample/authentication/Application.java b/samples/java_springboot/24.bot-authentication-msgraph/src/main/java/com/microsoft/bot/sample/authentication/Application.java
index a00c68e607..3f7f3ce4de 100644
--- a/samples/java_springboot/24.bot-authentication-msgraph/src/main/java/com/microsoft/bot/sample/authentication/Application.java
+++ b/samples/java_springboot/24.bot-authentication-msgraph/src/main/java/com/microsoft/bot/sample/authentication/Application.java
@@ -6,10 +6,10 @@
import com.microsoft.bot.builder.Bot;
import com.microsoft.bot.builder.ConversationState;
import com.microsoft.bot.builder.UserState;
-import com.microsoft.bot.integration.AdapterWithErrorHandler;
-import com.microsoft.bot.integration.BotFrameworkHttpAdapter;
+import com.microsoft.bot.integration.CloudAdapterWithErrorHandler;
+import com.microsoft.bot.integration.CloudAdapter;
import com.microsoft.bot.integration.Configuration;
-import com.microsoft.bot.integration.spring.BotController;
+import com.microsoft.bot.integration.spring.BotCloudAdapterController;
import com.microsoft.bot.integration.spring.BotDependencyConfiguration;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -21,12 +21,12 @@
//
@SpringBootApplication
-// Use the default BotController to receive incoming Channel messages. A custom
+// Use the default BotCloudAdapterController to receive incoming Channel messages. A custom
// controller could be used by eliminating this import and creating a new
// org.springframework.web.bind.annotation.RestController.
// The default controller is created by the Spring Boot container using
// dependency injection. The default route is /api/messages.
-@Import({BotController.class})
+@Import({BotCloudAdapterController.class})
/**
* This class extends the BotDependencyConfiguration which provides the default
@@ -61,10 +61,10 @@ public Bot getBot(
* Returns a custom Adapter that provides error handling.
*
* @param configuration The Configuration object to use.
- * @return An error handling BotFrameworkHttpAdapter.
+ * @return An error handling CloudAdapter.
*/
@Override
- public BotFrameworkHttpAdapter getBotFrameworkHttpAdaptor(Configuration configuration) {
- return new AdapterWithErrorHandler(configuration);
+ public CloudAdapter getCloudAdapter(Configuration configuration) {
+ return new CloudAdapterWithErrorHandler(configuration);
}
}
diff --git a/samples/java_springboot/25.message-reaction/pom.xml b/samples/java_springboot/25.message-reaction/pom.xml
index 7f99640133..d1cf965def 100644
--- a/samples/java_springboot/25.message-reaction/pom.xml
+++ b/samples/java_springboot/25.message-reaction/pom.xml
@@ -92,7 +92,7 @@
com.microsoft.bot
bot-integration-spring
- 4.13.0
+ 4.15.0-SNAPSHOT
compile
diff --git a/samples/java_springboot/25.message-reaction/src/main/java/com/microsoft/bot/sample/messagereaction/Application.java b/samples/java_springboot/25.message-reaction/src/main/java/com/microsoft/bot/sample/messagereaction/Application.java
index 878deca5d1..0a47ca6b8d 100644
--- a/samples/java_springboot/25.message-reaction/src/main/java/com/microsoft/bot/sample/messagereaction/Application.java
+++ b/samples/java_springboot/25.message-reaction/src/main/java/com/microsoft/bot/sample/messagereaction/Application.java
@@ -5,10 +5,10 @@
import com.microsoft.bot.builder.Bot;
import com.microsoft.bot.builder.Storage;
-import com.microsoft.bot.integration.AdapterWithErrorHandler;
-import com.microsoft.bot.integration.BotFrameworkHttpAdapter;
+import com.microsoft.bot.integration.CloudAdapterWithErrorHandler;
+import com.microsoft.bot.integration.CloudAdapter;
import com.microsoft.bot.integration.Configuration;
-import com.microsoft.bot.integration.spring.BotController;
+import com.microsoft.bot.integration.spring.BotCloudAdapterController;
import com.microsoft.bot.integration.spring.BotDependencyConfiguration;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -20,12 +20,12 @@
*/
@SpringBootApplication
-// Use the default BotController to receive incoming Channel messages. A custom
+// Use the default BotCloudAdapterController to receive incoming Channel messages. A custom
// controller could be used by eliminating this import and creating a new
// org.springframework.web.bind.annotation.RestController.
// The default controller is created by the Spring Boot container using
// dependency injection. The default route is /api/messages.
-@Import({BotController.class})
+@Import({BotCloudAdapterController.class})
/**
* This class extends the BotDependencyConfiguration which provides the default
@@ -63,10 +63,10 @@ public Bot getBot(Storage storage) {
* Returns a custom Adapter that provides error handling.
*
* @param configuration The Configuration object to use.
- * @return An error handling BotFrameworkHttpAdapter.
+ * @return An error handling CloudAdapter.
*/
@Override
- public BotFrameworkHttpAdapter getBotFrameworkHttpAdaptor(Configuration configuration) {
- return new AdapterWithErrorHandler(configuration);
+ public CloudAdapter getCloudAdapter(Configuration configuration) {
+ return new CloudAdapterWithErrorHandler(configuration);
}
}
diff --git a/samples/java_springboot/40.timex-resolution/pom.xml b/samples/java_springboot/40.timex-resolution/pom.xml
index 22df7d9b52..15c57102ac 100644
--- a/samples/java_springboot/40.timex-resolution/pom.xml
+++ b/samples/java_springboot/40.timex-resolution/pom.xml
@@ -59,7 +59,7 @@
com.microsoft.bot
bot-dialogs
- 4.13.0
+ 4.15.0-SNAPSHOT
diff --git a/samples/java_springboot/42.scaleout/pom.xml b/samples/java_springboot/42.scaleout/pom.xml
index 7ab55a5274..9c21b940f8 100644
--- a/samples/java_springboot/42.scaleout/pom.xml
+++ b/samples/java_springboot/42.scaleout/pom.xml
@@ -81,13 +81,13 @@
com.microsoft.bot
bot-integration-spring
- 4.13.0
+ 4.15.0-SNAPSHOT
compile
com.microsoft.bot
bot-dialogs
- 4.13.0
+ 4.15.0-SNAPSHOT
compile
diff --git a/samples/java_springboot/42.scaleout/src/main/java/com/microsoft/bot/sample/scaleout/Application.java b/samples/java_springboot/42.scaleout/src/main/java/com/microsoft/bot/sample/scaleout/Application.java
index bc8648c1b5..1009ee7fc2 100644
--- a/samples/java_springboot/42.scaleout/src/main/java/com/microsoft/bot/sample/scaleout/Application.java
+++ b/samples/java_springboot/42.scaleout/src/main/java/com/microsoft/bot/sample/scaleout/Application.java
@@ -4,10 +4,10 @@
package com.microsoft.bot.sample.scaleout;
import com.microsoft.bot.builder.Bot;
-import com.microsoft.bot.integration.AdapterWithErrorHandler;
-import com.microsoft.bot.integration.BotFrameworkHttpAdapter;
+import com.microsoft.bot.integration.CloudAdapterWithErrorHandler;
+import com.microsoft.bot.integration.CloudAdapter;
import com.microsoft.bot.integration.Configuration;
-import com.microsoft.bot.integration.spring.BotController;
+import com.microsoft.bot.integration.spring.BotCloudAdapterController;
import com.microsoft.bot.integration.spring.BotDependencyConfiguration;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -19,12 +19,12 @@
*/
@SpringBootApplication
-// Use the default BotController to receive incoming Channel messages. A custom
+// Use the default BotCloudAdapterController to receive incoming Channel messages. A custom
// controller could be used by eliminating this import and creating a new
// org.springframework.web.bind.annotation.RestController.
// The default controller is created by the Spring Boot container using
// dependency injection. The default route is /api/messages.
-@Import({BotController.class})
+@Import({BotCloudAdapterController.class})
/**
* This class extends the BotDependencyConfiguration which provides the default
@@ -72,10 +72,10 @@ public Bot getBot() {
* Returns a custom Adapter that provides error handling.
*
* @param configuration The Configuration object to use.
- * @return An error handling BotFrameworkHttpAdapter.
+ * @return An error handling CloudAdapter.
*/
@Override
- public BotFrameworkHttpAdapter getBotFrameworkHttpAdaptor(Configuration configuration) {
- return new AdapterWithErrorHandler(configuration);
+ public CloudAdapter getCloudAdapter(Configuration configuration) {
+ return new CloudAdapterWithErrorHandler(configuration);
}
}
diff --git a/samples/java_springboot/42.scaleout/src/main/java/com/microsoft/bot/sample/scaleout/ScaleoutBot.java b/samples/java_springboot/42.scaleout/src/main/java/com/microsoft/bot/sample/scaleout/ScaleoutBot.java
index 58e999d936..5b4dc4119c 100644
--- a/samples/java_springboot/42.scaleout/src/main/java/com/microsoft/bot/sample/scaleout/ScaleoutBot.java
+++ b/samples/java_springboot/42.scaleout/src/main/java/com/microsoft/bot/sample/scaleout/ScaleoutBot.java
@@ -62,7 +62,10 @@ protected CompletableFuture onMessageActivity(TurnContext turnContext) {
final Boolean[] shouldBreak = {false};
String finalKey = key;
- // The execution sits in a loop because there might be a retry if the save operation fails.
+ /**
+ * The execution sits in a loop because there might be a retry if the save operation fails.
+ * The task will fail when running locally with an App Registration configured (MicrosoftAppId/MicrosoftAppPassword)
+ */
while (true) {
// Load any existing state associated with this key
CompletableFuture> saveTask = store.load(finalKey).thenCompose(pairOldState -> {
diff --git a/samples/java_springboot/43.complex-dialog/pom.xml b/samples/java_springboot/43.complex-dialog/pom.xml
index 4b7b36f240..39ba13e7f3 100644
--- a/samples/java_springboot/43.complex-dialog/pom.xml
+++ b/samples/java_springboot/43.complex-dialog/pom.xml
@@ -92,13 +92,13 @@
com.microsoft.bot
bot-integration-spring
- 4.13.0
+ 4.15.0-SNAPSHOT
compile
com.microsoft.bot
bot-dialogs
- 4.13.0
+ 4.15.0-SNAPSHOT
compile
diff --git a/samples/java_springboot/43.complex-dialog/src/main/java/com/microsoft/bot/sample/complexdialog/Application.java b/samples/java_springboot/43.complex-dialog/src/main/java/com/microsoft/bot/sample/complexdialog/Application.java
index 99d5bef01d..aa45a44dfb 100644
--- a/samples/java_springboot/43.complex-dialog/src/main/java/com/microsoft/bot/sample/complexdialog/Application.java
+++ b/samples/java_springboot/43.complex-dialog/src/main/java/com/microsoft/bot/sample/complexdialog/Application.java
@@ -7,10 +7,10 @@
import com.microsoft.bot.builder.ConversationState;
import com.microsoft.bot.builder.UserState;
import com.microsoft.bot.dialogs.Dialog;
-import com.microsoft.bot.integration.AdapterWithErrorHandler;
-import com.microsoft.bot.integration.BotFrameworkHttpAdapter;
+import com.microsoft.bot.integration.CloudAdapterWithErrorHandler;
+import com.microsoft.bot.integration.CloudAdapter;
import com.microsoft.bot.integration.Configuration;
-import com.microsoft.bot.integration.spring.BotController;
+import com.microsoft.bot.integration.spring.BotCloudAdapterController;
import com.microsoft.bot.integration.spring.BotDependencyConfiguration;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -22,12 +22,12 @@
//
@SpringBootApplication
-// Use the default BotController to receive incoming Channel messages. A custom
+// Use the default BotCloudAdapterController to receive incoming Channel messages. A custom
// controller could be used by eliminating this import and creating a new
// org.springframework.web.bind.annotation.RestController.
// The default controller is created by the Spring Boot container using
// dependency injection. The default route is /api/messages.
-@Import({BotController.class})
+@Import({BotCloudAdapterController.class})
/**
* This class extends the BotDependencyConfiguration which provides the default
@@ -77,10 +77,10 @@ public Dialog getRootDialog(UserState userState) {
* Returns a custom Adapter that provides error handling.
*
* @param configuration The Configuration object to use.
- * @return An error handling BotFrameworkHttpAdapter.
+ * @return An error handling CloudAdapter.
*/
@Override
- public BotFrameworkHttpAdapter getBotFrameworkHttpAdaptor(Configuration configuration) {
- return new AdapterWithErrorHandler(configuration);
+ public CloudAdapter getCloudAdapter(Configuration configuration) {
+ return new CloudAdapterWithErrorHandler(configuration);
}
}
diff --git a/samples/java_springboot/44.prompt-users-for-input/pom.xml b/samples/java_springboot/44.prompt-users-for-input/pom.xml
index b8a4c4e3f6..9e92a27a73 100644
--- a/samples/java_springboot/44.prompt-users-for-input/pom.xml
+++ b/samples/java_springboot/44.prompt-users-for-input/pom.xml
@@ -92,13 +92,13 @@
com.microsoft.bot
bot-integration-spring
- 4.13.0
+ 4.15.0-SNAPSHOT
compile
com.microsoft.bot
bot-dialogs
- 4.13.0
+ 4.15.0-SNAPSHOT
compile
diff --git a/samples/java_springboot/44.prompt-users-for-input/src/main/java/com/microsoft/bot/sample/promptusersforinput/Application.java b/samples/java_springboot/44.prompt-users-for-input/src/main/java/com/microsoft/bot/sample/promptusersforinput/Application.java
index bccd07d934..33d77e6c8d 100644
--- a/samples/java_springboot/44.prompt-users-for-input/src/main/java/com/microsoft/bot/sample/promptusersforinput/Application.java
+++ b/samples/java_springboot/44.prompt-users-for-input/src/main/java/com/microsoft/bot/sample/promptusersforinput/Application.java
@@ -6,10 +6,10 @@
import com.microsoft.bot.builder.Bot;
import com.microsoft.bot.builder.ConversationState;
import com.microsoft.bot.builder.UserState;
-import com.microsoft.bot.integration.AdapterWithErrorHandler;
-import com.microsoft.bot.integration.BotFrameworkHttpAdapter;
+import com.microsoft.bot.integration.CloudAdapterWithErrorHandler;
+import com.microsoft.bot.integration.CloudAdapter;
import com.microsoft.bot.integration.Configuration;
-import com.microsoft.bot.integration.spring.BotController;
+import com.microsoft.bot.integration.spring.BotCloudAdapterController;
import com.microsoft.bot.integration.spring.BotDependencyConfiguration;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -21,12 +21,12 @@
//
@SpringBootApplication
-// Use the default BotController to receive incoming Channel messages. A custom
+// Use the default BotCloudAdapterController to receive incoming Channel messages. A custom
// controller could be used by eliminating this import and creating a new
// org.springframework.web.bind.annotation.RestController.
// The default controller is created by the Spring Boot container using
// dependency injection. The default route is /api/messages.
-@Import({BotController.class})
+@Import({BotCloudAdapterController.class})
/**
* This class extends the BotDependencyConfiguration which provides the default
@@ -60,10 +60,10 @@ public Bot getBot(
* Returns a custom Adapter that provides error handling.
*
* @param configuration The Configuration object to use.
- * @return An error handling BotFrameworkHttpAdapter.
+ * @return An error handling CloudAdapter.
*/
@Override
- public BotFrameworkHttpAdapter getBotFrameworkHttpAdaptor(Configuration configuration) {
- return new AdapterWithErrorHandler(configuration);
+ public CloudAdapter getCloudAdapter(Configuration configuration) {
+ return new CloudAdapterWithErrorHandler(configuration);
}
}
diff --git a/samples/java_springboot/45.state-management/pom.xml b/samples/java_springboot/45.state-management/pom.xml
index 478d1558f4..f738f6e625 100644
--- a/samples/java_springboot/45.state-management/pom.xml
+++ b/samples/java_springboot/45.state-management/pom.xml
@@ -91,13 +91,13 @@
com.microsoft.bot
bot-integration-spring
- 4.13.0
+ 4.15.0-SNAPSHOT
compile
com.microsoft.bot
bot-azure
- 4.13.0
+ 4.15.0-SNAPSHOT
compile
diff --git a/samples/java_springboot/45.state-management/src/main/java/com/microsoft/bot/sample/statemanagement/Application.java b/samples/java_springboot/45.state-management/src/main/java/com/microsoft/bot/sample/statemanagement/Application.java
index fb0a125596..cb5fda9c10 100644
--- a/samples/java_springboot/45.state-management/src/main/java/com/microsoft/bot/sample/statemanagement/Application.java
+++ b/samples/java_springboot/45.state-management/src/main/java/com/microsoft/bot/sample/statemanagement/Application.java
@@ -8,11 +8,12 @@
import com.microsoft.bot.azure.blobs.BlobsStorage;
import com.microsoft.bot.builder.Bot;
import com.microsoft.bot.builder.ConversationState;
+import com.microsoft.bot.builder.Storage;
import com.microsoft.bot.builder.UserState;
-import com.microsoft.bot.integration.AdapterWithErrorHandler;
-import com.microsoft.bot.integration.BotFrameworkHttpAdapter;
+import com.microsoft.bot.integration.CloudAdapterWithErrorHandler;
+import com.microsoft.bot.integration.CloudAdapter;
import com.microsoft.bot.integration.Configuration;
-import com.microsoft.bot.integration.spring.BotController;
+import com.microsoft.bot.integration.spring.BotCloudAdapterController;
import com.microsoft.bot.integration.spring.BotDependencyConfiguration;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -24,12 +25,12 @@
//
@SpringBootApplication
-// Use the default BotController to receive incoming Channel messages. A custom
+// Use the default BotCloudAdapterController to receive incoming Channel messages. A custom
// controller could be used by eliminating this import and creating a new
// org.springframework.web.bind.annotation.RestController.
// The default controller is created by the Spring Boot container using
// dependency injection. The default route is /api/messages.
-@Import({BotController.class})
+@Import({BotCloudAdapterController.class})
/**
* This class extends the BotDependencyConfiguration which provides the default
@@ -63,11 +64,11 @@ public Bot getBot(
* Returns a custom Adapter that provides error handling.
*
* @param configuration The Configuration object to use.
- * @return An error handling BotFrameworkHttpAdapter.
+ * @return An error handling CloudAdapter.
*/
@Override
- public BotFrameworkHttpAdapter getBotFrameworkHttpAdaptor(Configuration configuration) {
- return new AdapterWithErrorHandler(configuration);
+ public CloudAdapter getCloudAdapter(Configuration configuration) {
+ return new CloudAdapterWithErrorHandler(configuration);
}
/**
diff --git a/samples/java_springboot/46.teams-auth/README.md b/samples/java_springboot/46.teams-auth/README.md
index 2f265a141c..b24fa8dce6 100644
--- a/samples/java_springboot/46.teams-auth/README.md
+++ b/samples/java_springboot/46.teams-auth/README.md
@@ -25,10 +25,15 @@ This sample is a Spring Boot app and uses the Azure CLI and azure-webapp Maven p
the Teams service needs to call into the bot.
- Run ngrok - point to port 3978
+
+ ```bash
+ ngrok http -host-header=rewrite 3978
+ ```
- Create [Bot Framework registration resource](https://docs.microsoft.com/en-us/azure/bot-service/bot-service-quickstart-registration) in Azure
- - Use the current `https` URL you were given by running ngrok. Append with the path `/api/messages` used by this sample
+ - Configure the messaging endpoint to the `https` URL you were given by ngrok and append a trailing `/api/messages`
- Ensure that you've [enabled the Teams Channel](https://docs.microsoft.com/en-us/azure/bot-service/channel-connect-teams?view=azure-bot-service-4.0)
- __*If you don't have an Azure account*__ you can use this [Bot Framework registration](https://docs.microsoft.com/en-us/microsoftteams/platform/bots/how-to/create-a-bot-for-teams#register-your-web-service-with-the-bot-framework)
+- Follow the instructions on [this document](https://docs.microsoft.com/en-us/azure/bot-service/bot-builder-authentication?view=azure-bot-service-4.0&tabs=java%2Caadv2) to set up the OAuth authentication
- Update the `resources/application.properties` configuration for the bot to use the Microsoft App Id and App Password from the Bot Framework registration. (Note the App Password is referred to as the "client secret" in the azure portal and you can always create a new client secret anytime.)
- __*This step is specific to Teams.*__
- **Edit** the `manifest.json` contained in the `teamsAppManifest` folder to replace your Microsoft App Id (that was created when you registered your bot earlier) *everywhere* you see the place holder string `<>` (depending on the scenario the Microsoft App Id may occur multiple times in the `manifest.json`)
@@ -45,6 +50,8 @@ the Teams service needs to call into the bot.
You can interact with this bot by sending it a message. The bot will respond by requesting you to login to AAD, then making a call to the Graph API on your behalf and returning the results.
+When signed, sending `logout` will cause the bot to sign you out.
+
## Deploy the bot to Azure
To learn more about deploying a bot to Azure, see [Deploy your bot to Azure](https://aka.ms/azuredeployment) for a complete list of deployment instructions.
diff --git a/samples/java_springboot/46.teams-auth/pom.xml b/samples/java_springboot/46.teams-auth/pom.xml
index 7c850150e6..e60c401234 100644
--- a/samples/java_springboot/46.teams-auth/pom.xml
+++ b/samples/java_springboot/46.teams-auth/pom.xml
@@ -98,13 +98,13 @@
com.microsoft.bot
bot-integration-spring
- 4.13.0
+ 4.15.0-SNAPSHOT
compile
com.microsoft.bot
bot-dialogs
- 4.13.0
+ 4.15.0-SNAPSHOT
compile
diff --git a/samples/java_springboot/46.teams-auth/src/main/java/com/microsoft/bot/sample/teamsauth/Application.java b/samples/java_springboot/46.teams-auth/src/main/java/com/microsoft/bot/sample/teamsauth/Application.java
index c375db8395..279b85c16b 100644
--- a/samples/java_springboot/46.teams-auth/src/main/java/com/microsoft/bot/sample/teamsauth/Application.java
+++ b/samples/java_springboot/46.teams-auth/src/main/java/com/microsoft/bot/sample/teamsauth/Application.java
@@ -7,10 +7,10 @@
import com.microsoft.bot.builder.ConversationState;
import com.microsoft.bot.builder.UserState;
import com.microsoft.bot.dialogs.Dialog;
-import com.microsoft.bot.integration.AdapterWithErrorHandler;
-import com.microsoft.bot.integration.BotFrameworkHttpAdapter;
+import com.microsoft.bot.integration.CloudAdapterWithErrorHandler;
+import com.microsoft.bot.integration.CloudAdapter;
import com.microsoft.bot.integration.Configuration;
-import com.microsoft.bot.integration.spring.BotController;
+import com.microsoft.bot.integration.spring.BotCloudAdapterController;
import com.microsoft.bot.integration.spring.BotDependencyConfiguration;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -22,12 +22,12 @@
//
@SpringBootApplication
-// Use the default BotController to receive incoming Channel messages. A custom
+// Use the default BotCloudAdapterController to receive incoming Channel messages. A custom
// controller could be used by eliminating this import and creating a new
// org.springframework.web.bind.annotation.RestController.
// The default controller is created by the Spring Boot container using
// dependency injection. The default route is /api/messages.
-@Import({BotController.class})
+@Import({BotCloudAdapterController.class})
/**
* This class extends the BotDependencyConfiguration which provides the default
@@ -77,10 +77,10 @@ public Dialog getRootDialog(Configuration configuration) {
* Returns a custom Adapter that provides error handling.
*
* @param configuration The Configuration object to use.
- * @return An error handling BotFrameworkHttpAdapter.
+ * @return An error handling CloudAdapter.
*/
@Override
- public BotFrameworkHttpAdapter getBotFrameworkHttpAdaptor(Configuration configuration) {
- return new AdapterWithErrorHandler(configuration);
+ public CloudAdapter getCloudAdapter(Configuration configuration) {
+ return new CloudAdapterWithErrorHandler(configuration);
}
}
diff --git a/samples/java_springboot/47.inspection/pom.xml b/samples/java_springboot/47.inspection/pom.xml
index b17a2a48fd..f3a4a32f36 100644
--- a/samples/java_springboot/47.inspection/pom.xml
+++ b/samples/java_springboot/47.inspection/pom.xml
@@ -92,7 +92,7 @@
com.microsoft.bot
bot-integration-spring
- 4.13.0
+ 4.15.0-SNAPSHOT
compile
diff --git a/samples/java_springboot/47.inspection/src/main/java/com/microsoft/bot/sample/inspection/Application.java b/samples/java_springboot/47.inspection/src/main/java/com/microsoft/bot/sample/inspection/Application.java
index 5165c00862..95ffe7e835 100644
--- a/samples/java_springboot/47.inspection/src/main/java/com/microsoft/bot/sample/inspection/Application.java
+++ b/samples/java_springboot/47.inspection/src/main/java/com/microsoft/bot/sample/inspection/Application.java
@@ -8,10 +8,10 @@
import com.microsoft.bot.builder.Storage;
import com.microsoft.bot.builder.UserState;
import com.microsoft.bot.builder.inspection.InspectionState;
-import com.microsoft.bot.integration.BotFrameworkHttpAdapter;
+import com.microsoft.bot.integration.CloudAdapter;
+import com.microsoft.bot.integration.CloudAdapterWithInspection;
import com.microsoft.bot.integration.Configuration;
-import com.microsoft.bot.integration.AdapterWithInspection;
-import com.microsoft.bot.integration.spring.BotController;
+import com.microsoft.bot.integration.spring.BotCloudAdapterController;
import com.microsoft.bot.integration.spring.BotDependencyConfiguration;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -24,12 +24,12 @@
//
@SpringBootApplication
-// Use the default BotController to receive incoming Channel messages. A custom
+// Use the default BotCloudAdapterController to receive incoming Channel messages. A custom
// controller could be used by eliminating this import and creating a new
// org.springframework.web.bind.annotation.RestController.
// The default controller is created by the Spring Boot container using
// dependency injection. The default route is /api/messages.
-@Import({BotController.class})
+@Import({BotCloudAdapterController.class})
/**
* This class extends the BotDependencyConfiguration which provides the default
@@ -82,13 +82,13 @@ public Bot getBot(
*/
@Bean
@Primary
- public BotFrameworkHttpAdapter getInspectionBotFrameworkHttpAdapter(
+ public CloudAdapter getInspectionAdapter(
Configuration configuration,
InspectionState inspectionState,
UserState userState,
ConversationState conversationState
) {
- return new AdapterWithInspection(
+ return new CloudAdapterWithInspection(
configuration,
inspectionState,
userState,
diff --git a/samples/java_springboot/49.qnamaker-all-features/pom.xml b/samples/java_springboot/49.qnamaker-all-features/pom.xml
index 7a5e4d5c16..1e85dd05b4 100644
--- a/samples/java_springboot/49.qnamaker-all-features/pom.xml
+++ b/samples/java_springboot/49.qnamaker-all-features/pom.xml
@@ -77,7 +77,7 @@
com.microsoft.bot
bot-ai-qna
- 4.13.0
+ 4.15.0-SNAPSHOT
@@ -98,7 +98,7 @@
com.microsoft.bot
bot-integration-spring
- 4.13.0
+ 4.15.0-SNAPSHOT
compile
diff --git a/samples/java_springboot/49.qnamaker-all-features/src/main/java/com/microsoft/bot/sample/qnamaker/all/features/Application.java b/samples/java_springboot/49.qnamaker-all-features/src/main/java/com/microsoft/bot/sample/qnamaker/all/features/Application.java
index 10e036abc8..69a590fbaf 100644
--- a/samples/java_springboot/49.qnamaker-all-features/src/main/java/com/microsoft/bot/sample/qnamaker/all/features/Application.java
+++ b/samples/java_springboot/49.qnamaker-all-features/src/main/java/com/microsoft/bot/sample/qnamaker/all/features/Application.java
@@ -6,10 +6,10 @@
import com.microsoft.bot.builder.Bot;
import com.microsoft.bot.builder.ConversationState;
import com.microsoft.bot.builder.UserState;
-import com.microsoft.bot.integration.AdapterWithErrorHandler;
-import com.microsoft.bot.integration.BotFrameworkHttpAdapter;
+import com.microsoft.bot.integration.CloudAdapterWithErrorHandler;
+import com.microsoft.bot.integration.CloudAdapter;
import com.microsoft.bot.integration.Configuration;
-import com.microsoft.bot.integration.spring.BotController;
+import com.microsoft.bot.integration.spring.BotCloudAdapterController;
import com.microsoft.bot.integration.spring.BotDependencyConfiguration;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -21,12 +21,12 @@
*/
@SpringBootApplication
-// Use the default BotController to receive incoming Channel messages. A custom
+// Use the default BotCloudAdapterController to receive incoming Channel messages. A custom
// controller could be used by eliminating this import and creating a new
// org.springframework.web.bind.annotation.RestController.
// The default controller is created by the Spring Boot container using
// dependency injection. The default route is /api/messages.
-@Import({BotController.class})
+@Import({BotCloudAdapterController.class})
/**
* This class extends the BotDependencyConfiguration which provides the default
@@ -69,10 +69,10 @@ public Bot getBot(
* Returns a custom Adapter that provides error handling.
*
* @param configuration The Configuration object to use.
- * @return An error handling BotFrameworkHttpAdapter.
+ * @return An error handling CloudAdapter.
*/
@Override
- public BotFrameworkHttpAdapter getBotFrameworkHttpAdaptor(Configuration configuration) {
- return new AdapterWithErrorHandler(configuration);
+ public CloudAdapter getCloudAdapter(Configuration configuration) {
+ return new CloudAdapterWithErrorHandler(configuration);
}
}
diff --git a/samples/java_springboot/49.qnamaker-all-features/src/main/resources/application.properties b/samples/java_springboot/49.qnamaker-all-features/src/main/resources/application.properties
index 9598d9ac34..1971e56c7f 100644
--- a/samples/java_springboot/49.qnamaker-all-features/src/main/resources/application.properties
+++ b/samples/java_springboot/49.qnamaker-all-features/src/main/resources/application.properties
@@ -3,5 +3,6 @@ MicrosoftAppPassword=
QnAKnowledgebaseId=
QnAEndpointKey=
QnAEndpointHostName=
+QnAAuthKey=
DefaultAnswer=
server.port=3978
diff --git a/samples/java_springboot/50.teams-messaging-extensions-search/README.md b/samples/java_springboot/50.teams-messaging-extensions-search/README.md
index 3c46eccb4c..d1d5fc3de3 100644
--- a/samples/java_springboot/50.teams-messaging-extensions-search/README.md
+++ b/samples/java_springboot/50.teams-messaging-extensions-search/README.md
@@ -18,6 +18,10 @@ build a Search-based Messaging Extension.
the Teams service needs to call into the bot.
- Run ngrok - point to port 3978
+
+ ```bash
+ ngrok http -host-header=rewrite 3978
+ ```
- Create [Bot Framework registration resource](https://docs.microsoft.com/en-us/azure/bot-service/bot-service-quickstart-registration) in Azure
- Use the current `https` URL you were given by running ngrok. Append with the path `/api/messages` used by this sample
- Ensure that you've [enabled the Teams Channel](https://docs.microsoft.com/en-us/azure/bot-service/channel-connect-teams?view=azure-bot-service-4.0)
diff --git a/samples/java_springboot/50.teams-messaging-extensions-search/pom.xml b/samples/java_springboot/50.teams-messaging-extensions-search/pom.xml
index a1fae99278..dc9c770519 100644
--- a/samples/java_springboot/50.teams-messaging-extensions-search/pom.xml
+++ b/samples/java_springboot/50.teams-messaging-extensions-search/pom.xml
@@ -92,7 +92,7 @@
com.microsoft.bot
bot-integration-spring
- 4.13.0
+ 4.15.0-SNAPSHOT
compile
diff --git a/samples/java_springboot/50.teams-messaging-extensions-search/src/main/java/com/microsoft/bot/sample/teamssearch/Application.java b/samples/java_springboot/50.teams-messaging-extensions-search/src/main/java/com/microsoft/bot/sample/teamssearch/Application.java
index e71c04735c..98482947c1 100644
--- a/samples/java_springboot/50.teams-messaging-extensions-search/src/main/java/com/microsoft/bot/sample/teamssearch/Application.java
+++ b/samples/java_springboot/50.teams-messaging-extensions-search/src/main/java/com/microsoft/bot/sample/teamssearch/Application.java
@@ -4,10 +4,10 @@
package com.microsoft.bot.sample.teamssearch;
import com.microsoft.bot.builder.Bot;
-import com.microsoft.bot.integration.AdapterWithErrorHandler;
-import com.microsoft.bot.integration.BotFrameworkHttpAdapter;
+import com.microsoft.bot.integration.CloudAdapterWithErrorHandler;
+import com.microsoft.bot.integration.CloudAdapter;
import com.microsoft.bot.integration.Configuration;
-import com.microsoft.bot.integration.spring.BotController;
+import com.microsoft.bot.integration.spring.BotCloudAdapterController;
import com.microsoft.bot.integration.spring.BotDependencyConfiguration;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -19,12 +19,12 @@
//
@SpringBootApplication
-// Use the default BotController to receive incoming Channel messages. A custom
+// Use the default BotCloudAdapterController to receive incoming Channel messages. A custom
// controller could be used by eliminating this import and creating a new
// org.springframework.web.bind.annotation.RestController.
// The default controller is created by the Spring Boot container using
// dependency injection. The default route is /api/messages.
-@Import({BotController.class})
+@Import({BotCloudAdapterController.class})
/**
* This class extends the BotDependencyConfiguration which provides the default
@@ -55,10 +55,10 @@ public Bot getBot() {
* Returns a custom Adapter that provides error handling.
*
* @param configuration The Configuration object to use.
- * @return An error handling BotFrameworkHttpAdapter.
+ * @return An error handling CloudAdapter.
*/
@Override
- public BotFrameworkHttpAdapter getBotFrameworkHttpAdaptor(Configuration configuration) {
- return new AdapterWithErrorHandler(configuration);
+ public CloudAdapter getCloudAdapter(Configuration configuration) {
+ return new CloudAdapterWithErrorHandler(configuration);
}
}
diff --git a/samples/java_springboot/51.teams-messaging-extensions-action/README.md b/samples/java_springboot/51.teams-messaging-extensions-action/README.md
index f3abfcab5d..06c6de9c95 100644
--- a/samples/java_springboot/51.teams-messaging-extensions-action/README.md
+++ b/samples/java_springboot/51.teams-messaging-extensions-action/README.md
@@ -21,7 +21,7 @@ This sample is a Spring Boot app and uses the Azure CLI and azure-webapp Maven p
> Note these instructions are for running the sample on your local machine, the tunnelling solution is required because
the Teams service needs to call into the bot.
-- Run ngrok http -host-header=rewrite 3978
+- Run `ngrok http -host-header=rewrite 3978`
- Create [Bot Framework registration resource](https://docs.microsoft.com/en-us/azure/bot-service/bot-service-quickstart-registration) in Azure
- Use the current `https` URL you were given by running ngrok. Append with the path `/api/messages` used by this sample
@@ -45,11 +45,9 @@ the Teams service needs to call into the bot.
> Note this `manifest.json` specified that the bot will be called from both the `compose` and `message` areas of Teams. Please refer to Teams documentation for more details.
-1) Selecting the **Create Card** command from the Compose Box command list. The parameters dialog will be displayed and can be submitted to initiate the card creation within the Messaging Extension code.
-
-or
-
-2) Selecting the **Share Message** command from the Message command list.
+1. Selecting the **Create Card** command from the Compose Box command list. The parameters dialog will be displayed and can be submitted to initiate the card creation within the Messaging Extension code.
+2. Selecting the **Share Message** command from the Message command list.
+3. Selecting the **FetchRoster** command from the Message command list. *Even though this action is being shown on the contextual menu, it's not implemented and is expected to fail.*
## Deploy the bot to Azure
diff --git a/samples/java_springboot/51.teams-messaging-extensions-action/pom.xml b/samples/java_springboot/51.teams-messaging-extensions-action/pom.xml
index a2b45c9d82..30e30f1c66 100644
--- a/samples/java_springboot/51.teams-messaging-extensions-action/pom.xml
+++ b/samples/java_springboot/51.teams-messaging-extensions-action/pom.xml
@@ -92,7 +92,7 @@
com.microsoft.bot
bot-integration-spring
- 4.13.0
+ 4.15.0-SNAPSHOT
compile
diff --git a/samples/java_springboot/51.teams-messaging-extensions-action/src/main/java/com/microsoft/bot/sample/teamsaction/Application.java b/samples/java_springboot/51.teams-messaging-extensions-action/src/main/java/com/microsoft/bot/sample/teamsaction/Application.java
index c8e160336b..0635bb6adc 100644
--- a/samples/java_springboot/51.teams-messaging-extensions-action/src/main/java/com/microsoft/bot/sample/teamsaction/Application.java
+++ b/samples/java_springboot/51.teams-messaging-extensions-action/src/main/java/com/microsoft/bot/sample/teamsaction/Application.java
@@ -4,10 +4,10 @@
package com.microsoft.bot.sample.teamsaction;
import com.microsoft.bot.builder.Bot;
-import com.microsoft.bot.integration.AdapterWithErrorHandler;
-import com.microsoft.bot.integration.BotFrameworkHttpAdapter;
+import com.microsoft.bot.integration.CloudAdapterWithErrorHandler;
+import com.microsoft.bot.integration.CloudAdapter;
import com.microsoft.bot.integration.Configuration;
-import com.microsoft.bot.integration.spring.BotController;
+import com.microsoft.bot.integration.spring.BotCloudAdapterController;
import com.microsoft.bot.integration.spring.BotDependencyConfiguration;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -19,12 +19,12 @@
//
@SpringBootApplication
-// Use the default BotController to receive incoming Channel messages. A custom
+// Use the default BotCloudAdapterController to receive incoming Channel messages. A custom
// controller could be used by eliminating this import and creating a new
// org.springframework.web.bind.annotation.RestController.
// The default controller is created by the Spring Boot container using
// dependency injection. The default route is /api/messages.
-@Import({BotController.class})
+@Import({BotCloudAdapterController.class})
/**
* This class extends the BotDependencyConfiguration which provides the default
@@ -56,10 +56,10 @@ public Bot getBot() {
* Returns a custom Adapter that provides error handling.
*
* @param configuration The Configuration object to use.
- * @return An error handling BotFrameworkHttpAdapter.
+ * @return An error handling CloudAdapter.
*/
@Override
- public BotFrameworkHttpAdapter getBotFrameworkHttpAdaptor(Configuration configuration) {
- return new AdapterWithErrorHandler(configuration);
+ public CloudAdapter getCloudAdapter(Configuration configuration) {
+ return new CloudAdapterWithErrorHandler(configuration);
}
}
diff --git a/samples/java_springboot/52.teams-messaging-extensions-search-auth-config/README.md b/samples/java_springboot/52.teams-messaging-extensions-search-auth-config/README.md
index 6eda34344e..7594a7fdb7 100644
--- a/samples/java_springboot/52.teams-messaging-extensions-search-auth-config/README.md
+++ b/samples/java_springboot/52.teams-messaging-extensions-search-auth-config/README.md
@@ -33,6 +33,10 @@ This sample is a Spring Boot app and uses the Azure CLI and azure-webapp Maven p
the Teams service needs to call into the bot.
- Run ngrok - point to port 3978
+
+ ```bash
+ ngrok http -host-header=rewrite 3978
+ ```
- Create [Bot Framework registration resource](https://docs.microsoft.com/en-us/azure/bot-service/bot-service-quickstart-registration) in Azure
- Use the current `https` URL you were given by running ngrok. Append with the path `/api/messages` used by this sample
- Ensure that you've [enabled the Teams Channel](https://docs.microsoft.com/en-us/azure/bot-service/channel-connect-teams?view=azure-bot-service-4.0)
diff --git a/samples/java_springboot/52.teams-messaging-extensions-search-auth-config/pom.xml b/samples/java_springboot/52.teams-messaging-extensions-search-auth-config/pom.xml
index 397fd3dfb5..46c7664e42 100644
--- a/samples/java_springboot/52.teams-messaging-extensions-search-auth-config/pom.xml
+++ b/samples/java_springboot/52.teams-messaging-extensions-search-auth-config/pom.xml
@@ -97,7 +97,7 @@
com.microsoft.bot
bot-integration-spring
- 4.13.0
+ 4.15.0-SNAPSHOT
compile
diff --git a/samples/java_springboot/52.teams-messaging-extensions-search-auth-config/src/main/java/com/microsoft/bot/sample/teamssearchauth/Application.java b/samples/java_springboot/52.teams-messaging-extensions-search-auth-config/src/main/java/com/microsoft/bot/sample/teamssearchauth/Application.java
index b8435de1e8..88ec975ae2 100644
--- a/samples/java_springboot/52.teams-messaging-extensions-search-auth-config/src/main/java/com/microsoft/bot/sample/teamssearchauth/Application.java
+++ b/samples/java_springboot/52.teams-messaging-extensions-search-auth-config/src/main/java/com/microsoft/bot/sample/teamssearchauth/Application.java
@@ -6,10 +6,10 @@
import com.microsoft.bot.builder.Bot;
import com.microsoft.bot.builder.ConversationState;
import com.microsoft.bot.builder.UserState;
-import com.microsoft.bot.integration.AdapterWithErrorHandler;
-import com.microsoft.bot.integration.BotFrameworkHttpAdapter;
+import com.microsoft.bot.integration.CloudAdapterWithErrorHandler;
+import com.microsoft.bot.integration.CloudAdapter;
import com.microsoft.bot.integration.Configuration;
-import com.microsoft.bot.integration.spring.BotController;
+import com.microsoft.bot.integration.spring.BotCloudAdapterController;
import com.microsoft.bot.integration.spring.BotDependencyConfiguration;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -21,12 +21,12 @@
//
@SpringBootApplication
-// Use the default BotController to receive incoming Channel messages. A custom
+// Use the default BotCloudAdapterController to receive incoming Channel messages. A custom
// controller could be used by eliminating this import and creating a new
// org.springframework.web.bind.annotation.RestController.
// The default controller is created by the Spring Boot container using
// dependency injection. The default route is /api/messages.
-@Import({BotController.class})
+@Import({BotCloudAdapterController.class})
/**
* This class extends the BotDependencyConfiguration which provides the default
@@ -60,10 +60,10 @@ public Bot getBot(
* Returns a custom Adapter that provides error handling.
*
* @param configuration The Configuration object to use.
- * @return An error handling BotFrameworkHttpAdapter.
+ * @return An error handling CloudAdapter.
*/
@Override
- public BotFrameworkHttpAdapter getBotFrameworkHttpAdaptor(Configuration configuration) {
- return new AdapterWithErrorHandler(configuration);
+ public CloudAdapter getCloudAdapter(Configuration configuration) {
+ return new CloudAdapterWithErrorHandler(configuration);
}
}
diff --git a/samples/java_springboot/52.teams-messaging-extensions-search-auth-config/src/main/java/com/microsoft/bot/sample/teamssearchauth/TeamsMessagingExtensionsSearchAuthConfigBot.java b/samples/java_springboot/52.teams-messaging-extensions-search-auth-config/src/main/java/com/microsoft/bot/sample/teamssearchauth/TeamsMessagingExtensionsSearchAuthConfigBot.java
index 1531f6f615..a355088c8b 100644
--- a/samples/java_springboot/52.teams-messaging-extensions-search-auth-config/src/main/java/com/microsoft/bot/sample/teamssearchauth/TeamsMessagingExtensionsSearchAuthConfigBot.java
+++ b/samples/java_springboot/52.teams-messaging-extensions-search-auth-config/src/main/java/com/microsoft/bot/sample/teamssearchauth/TeamsMessagingExtensionsSearchAuthConfigBot.java
@@ -365,7 +365,10 @@ protected CompletableFuture onTeamsMessagingEx
TurnContext turnContext,
MessagingExtensionAction action
) {
- /* This can be uncommented once the MessagingExtensionAction contains the associated state property
+ /*
+ * For context, MessagingExtensionAction lacks the state property in the Java SDK
+ * Given that the SHOWPROFILE command requires this property to exist, this snippet was commented on purpose and should be uncommented once the MessagingExtensionAction is updated
+ * In the meantime, using the Compose action will trigger a 501 HTTP Status Code response as this snippet will not be executed
if (action.getCommandId().equalsIgnoreCase("SHOWPROFILE")) {
String state = action.getState(); // Check the state value
return getTokenResponse(turnContext, state).thenCompose(tokenResponse -> {
@@ -433,13 +436,14 @@ protected CompletableFuture onTeamsMessagingEx
}
private Attachment createAdaptiveCardAttachment() {
+ Attachment attachment = new Attachment();
+
try (
- InputStream input = Thread.currentThread().getContextClassLoader()
+ InputStream inputStream = attachment.getClass().getClassLoader()
.getResourceAsStream("adaptiveCard.json")
) {
- String adaptiveCardJson = IOUtils.toString(input, StandardCharsets.UTF_8.toString());
+ String adaptiveCardJson = IOUtils.toString(inputStream, StandardCharsets.UTF_8.toString());
- Attachment attachment = new Attachment();
attachment.setContentType("application/vnd.microsoft.card.adaptive");
attachment.setContent(Serialization.jsonToTree(adaptiveCardJson));
return attachment;
diff --git a/samples/java_springboot/53.teams-messaging-extensions-action-preview/README.md b/samples/java_springboot/53.teams-messaging-extensions-action-preview/README.md
index faf32e3f96..14b4133271 100644
--- a/samples/java_springboot/53.teams-messaging-extensions-action-preview/README.md
+++ b/samples/java_springboot/53.teams-messaging-extensions-action-preview/README.md
@@ -22,6 +22,10 @@ This sample is a Spring Boot app and uses the Azure CLI and azure-webapp Maven p
the Teams service needs to call into the bot.
- Run ngrok - point to port 3978
+
+ ```bash
+ ngrok http -host-header=rewrite 3978
+ ```
- Create [Bot Framework registration resource](https://docs.microsoft.com/en-us/azure/bot-service/bot-service-quickstart-registration) in Azure
- Use the current `https` URL you were given by running ngrok. Append with the path `/api/messages` used by this sample
- Ensure that you've [enabled the Teams Channel](https://docs.microsoft.com/en-us/azure/bot-service/channel-connect-teams?view=azure-bot-service-4.0)
diff --git a/samples/java_springboot/53.teams-messaging-extensions-action-preview/pom.xml b/samples/java_springboot/53.teams-messaging-extensions-action-preview/pom.xml
index 1e1e6e5de2..0296d2abc8 100644
--- a/samples/java_springboot/53.teams-messaging-extensions-action-preview/pom.xml
+++ b/samples/java_springboot/53.teams-messaging-extensions-action-preview/pom.xml
@@ -92,7 +92,7 @@
com.microsoft.bot
bot-integration-spring
- 4.13.0
+ 4.15.0-SNAPSHOT
compile
diff --git a/samples/java_springboot/53.teams-messaging-extensions-action-preview/src/main/java/com/microsoft/bot/sample/teamsactionpreview/Application.java b/samples/java_springboot/53.teams-messaging-extensions-action-preview/src/main/java/com/microsoft/bot/sample/teamsactionpreview/Application.java
index bdf7287e5a..d9979cd363 100644
--- a/samples/java_springboot/53.teams-messaging-extensions-action-preview/src/main/java/com/microsoft/bot/sample/teamsactionpreview/Application.java
+++ b/samples/java_springboot/53.teams-messaging-extensions-action-preview/src/main/java/com/microsoft/bot/sample/teamsactionpreview/Application.java
@@ -4,10 +4,10 @@
package com.microsoft.bot.sample.teamsactionpreview;
import com.microsoft.bot.builder.Bot;
-import com.microsoft.bot.integration.AdapterWithErrorHandler;
-import com.microsoft.bot.integration.BotFrameworkHttpAdapter;
+import com.microsoft.bot.integration.CloudAdapterWithErrorHandler;
+import com.microsoft.bot.integration.CloudAdapter;
import com.microsoft.bot.integration.Configuration;
-import com.microsoft.bot.integration.spring.BotController;
+import com.microsoft.bot.integration.spring.BotCloudAdapterController;
import com.microsoft.bot.integration.spring.BotDependencyConfiguration;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -19,12 +19,12 @@
//
@SpringBootApplication
-// Use the default BotController to receive incoming Channel messages. A custom
+// Use the default BotCloudAdapterController to receive incoming Channel messages. A custom
// controller could be used by eliminating this import and creating a new
// org.springframework.web.bind.annotation.RestController.
// The default controller is created by the Spring Boot container using
// dependency injection. The default route is /api/messages.
-@Import({BotController.class})
+@Import({BotCloudAdapterController.class})
/**
* This class extends the BotDependencyConfiguration which provides the default
@@ -55,10 +55,10 @@ public Bot getBot() {
* Returns a custom Adapter that provides error handling.
*
* @param configuration The Configuration object to use.
- * @return An error handling BotFrameworkHttpAdapter.
+ * @return An error handling CloudAdapter.
*/
@Override
- public BotFrameworkHttpAdapter getBotFrameworkHttpAdaptor(Configuration configuration) {
- return new AdapterWithErrorHandler(configuration);
+ public CloudAdapter getCloudAdapter(Configuration configuration) {
+ return new CloudAdapterWithErrorHandler(configuration);
}
}
diff --git a/samples/java_springboot/53.teams-messaging-extensions-action-preview/teamsAppManifest/manifest.json b/samples/java_springboot/53.teams-messaging-extensions-action-preview/teamsAppManifest/manifest.json
index 24a5d255dc..584406eafe 100644
--- a/samples/java_springboot/53.teams-messaging-extensions-action-preview/teamsAppManifest/manifest.json
+++ b/samples/java_springboot/53.teams-messaging-extensions-action-preview/teamsAppManifest/manifest.json
@@ -27,7 +27,9 @@
{
"botId": "<>",
"scopes": [
- "team"
+ "team",
+ "personal",
+ "groupchat"
]
}
],
diff --git a/samples/java_springboot/54.teams-task-module/pom.xml b/samples/java_springboot/54.teams-task-module/pom.xml
index 7ac3c1e899..680c1e3f8a 100644
--- a/samples/java_springboot/54.teams-task-module/pom.xml
+++ b/samples/java_springboot/54.teams-task-module/pom.xml
@@ -91,7 +91,7 @@
com.microsoft.bot
bot-integration-spring
- 4.13.0
+ 4.15.0-SNAPSHOT
compile
diff --git a/samples/java_springboot/54.teams-task-module/src/main/java/com/microsoft/bot/sample/teamstaskmodule/Application.java b/samples/java_springboot/54.teams-task-module/src/main/java/com/microsoft/bot/sample/teamstaskmodule/Application.java
index 905caedd83..effbf4aadd 100644
--- a/samples/java_springboot/54.teams-task-module/src/main/java/com/microsoft/bot/sample/teamstaskmodule/Application.java
+++ b/samples/java_springboot/54.teams-task-module/src/main/java/com/microsoft/bot/sample/teamstaskmodule/Application.java
@@ -4,10 +4,10 @@
package com.microsoft.bot.sample.teamstaskmodule;
import com.microsoft.bot.builder.Bot;
-import com.microsoft.bot.integration.AdapterWithErrorHandler;
-import com.microsoft.bot.integration.BotFrameworkHttpAdapter;
+import com.microsoft.bot.integration.CloudAdapterWithErrorHandler;
+import com.microsoft.bot.integration.CloudAdapter;
import com.microsoft.bot.integration.Configuration;
-import com.microsoft.bot.integration.spring.BotController;
+import com.microsoft.bot.integration.spring.BotCloudAdapterController;
import com.microsoft.bot.integration.spring.BotDependencyConfiguration;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -19,12 +19,12 @@
//
@SpringBootApplication
-// Use the default BotController to receive incoming Channel messages. A custom
+// Use the default BotCloudAdapterController to receive incoming Channel messages. A custom
// controller could be used by eliminating this import and creating a new
// org.springframework.web.bind.annotation.RestController.
// The default controller is created by the Spring Boot container using
// dependency injection. The default route is /api/messages.
-@Import({BotController.class})
+@Import({BotCloudAdapterController.class})
/**
* This class extends the BotDependencyConfiguration which provides the default
@@ -56,10 +56,10 @@ public Bot getBot(Configuration configuration) {
* Returns a custom Adapter that provides error handling.
*
* @param configuration The Configuration object to use.
- * @return An error handling BotFrameworkHttpAdapter.
+ * @return An error handling CloudAdapter.
*/
@Override
- public BotFrameworkHttpAdapter getBotFrameworkHttpAdaptor(Configuration configuration) {
- return new AdapterWithErrorHandler(configuration);
+ public CloudAdapter getCloudAdapter(Configuration configuration) {
+ return new CloudAdapterWithErrorHandler(configuration);
}
}
diff --git a/samples/java_springboot/55.teams-link-unfurling/README.md b/samples/java_springboot/55.teams-link-unfurling/README.md
index fab083d25a..5b9626e21e 100644
--- a/samples/java_springboot/55.teams-link-unfurling/README.md
+++ b/samples/java_springboot/55.teams-link-unfurling/README.md
@@ -19,6 +19,10 @@ This sample is a Spring Boot app and uses the Azure CLI and azure-webapp Maven p
the Teams service needs to call into the bot.
- Run ngrok - point to port 3978
+
+ ```bash
+ ngrok http -host-header=rewrite 3978
+ ```
- Create [Bot Framework registration resource](https://docs.microsoft.com/en-us/azure/bot-service/bot-service-quickstart-registration) in Azure
- Use the current `https` URL you were given by running ngrok. Append with the path `/api/messages` used by this sample
- Ensure that you've [enabled the Teams Channel](https://docs.microsoft.com/en-us/azure/bot-service/channel-connect-teams?view=azure-bot-service-4.0)
diff --git a/samples/java_springboot/55.teams-link-unfurling/pom.xml b/samples/java_springboot/55.teams-link-unfurling/pom.xml
index b778fd91f9..3e7d92d341 100644
--- a/samples/java_springboot/55.teams-link-unfurling/pom.xml
+++ b/samples/java_springboot/55.teams-link-unfurling/pom.xml
@@ -92,7 +92,7 @@
com.microsoft.bot
bot-integration-spring
- 4.13.0
+ 4.15.0-SNAPSHOT
compile
diff --git a/samples/java_springboot/55.teams-link-unfurling/src/main/java/com/microsoft/bot/sample/teamsunfurl/Application.java b/samples/java_springboot/55.teams-link-unfurling/src/main/java/com/microsoft/bot/sample/teamsunfurl/Application.java
index 1d2166b030..a9e4ef41ae 100644
--- a/samples/java_springboot/55.teams-link-unfurling/src/main/java/com/microsoft/bot/sample/teamsunfurl/Application.java
+++ b/samples/java_springboot/55.teams-link-unfurling/src/main/java/com/microsoft/bot/sample/teamsunfurl/Application.java
@@ -4,10 +4,10 @@
package com.microsoft.bot.sample.teamsunfurl;
import com.microsoft.bot.builder.Bot;
-import com.microsoft.bot.integration.AdapterWithErrorHandler;
-import com.microsoft.bot.integration.BotFrameworkHttpAdapter;
+import com.microsoft.bot.integration.CloudAdapterWithErrorHandler;
+import com.microsoft.bot.integration.CloudAdapter;
import com.microsoft.bot.integration.Configuration;
-import com.microsoft.bot.integration.spring.BotController;
+import com.microsoft.bot.integration.spring.BotCloudAdapterController;
import com.microsoft.bot.integration.spring.BotDependencyConfiguration;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -19,12 +19,12 @@
//
@SpringBootApplication
-// Use the default BotController to receive incoming Channel messages. A custom
+// Use the default BotCloudAdapterController to receive incoming Channel messages. A custom
// controller could be used by eliminating this import and creating a new
// org.springframework.web.bind.annotation.RestController.
// The default controller is created by the Spring Boot container using
// dependency injection. The default route is /api/messages.
-@Import({BotController.class})
+@Import({BotCloudAdapterController.class})
/**
* This class extends the BotDependencyConfiguration which provides the default
@@ -56,10 +56,10 @@ public Bot getBot() {
* Returns a custom Adapter that provides error handling.
*
* @param configuration The Configuration object to use.
- * @return An error handling BotFrameworkHttpAdapter.
+ * @return An error handling CloudAdapter.
*/
@Override
- public BotFrameworkHttpAdapter getBotFrameworkHttpAdaptor(Configuration configuration) {
- return new AdapterWithErrorHandler(configuration);
+ public CloudAdapter getCloudAdapter(Configuration configuration) {
+ return new CloudAdapterWithErrorHandler(configuration);
}
}
diff --git a/samples/java_springboot/56.teams-file-upload/README.md b/samples/java_springboot/56.teams-file-upload/README.md
index 4e318897cd..5bff19be6e 100644
--- a/samples/java_springboot/56.teams-file-upload/README.md
+++ b/samples/java_springboot/56.teams-file-upload/README.md
@@ -20,6 +20,10 @@ This sample is a Spring Boot app and uses the Azure CLI and azure-webapp Maven p
the Teams service needs to call into the bot.
- Run ngrok - point to port 3978
+
+ ```bash
+ ngrok http -host-header=rewrite 3978
+ ```
- Create [Bot Framework registration resource](https://docs.microsoft.com/en-us/azure/bot-service/bot-service-quickstart-registration) in Azure
- Use the current `https` URL you were given by running ngrok. Append with the path `/api/messages` used by this sample
- Ensure that you've [enabled the Teams Channel](https://docs.microsoft.com/en-us/azure/bot-service/channel-connect-teams?view=azure-bot-service-4.0)
diff --git a/samples/java_springboot/56.teams-file-upload/pom.xml b/samples/java_springboot/56.teams-file-upload/pom.xml
index 0d0b248981..c0effb0215 100644
--- a/samples/java_springboot/56.teams-file-upload/pom.xml
+++ b/samples/java_springboot/56.teams-file-upload/pom.xml
@@ -92,7 +92,7 @@
com.microsoft.bot
bot-integration-spring
- 4.13.0
+ 4.15.0-SNAPSHOT
compile
diff --git a/samples/java_springboot/56.teams-file-upload/src/main/java/com/microsoft/bot/sample/teamsfileupload/Application.java b/samples/java_springboot/56.teams-file-upload/src/main/java/com/microsoft/bot/sample/teamsfileupload/Application.java
index 8ab403a9ae..81c25b44bc 100644
--- a/samples/java_springboot/56.teams-file-upload/src/main/java/com/microsoft/bot/sample/teamsfileupload/Application.java
+++ b/samples/java_springboot/56.teams-file-upload/src/main/java/com/microsoft/bot/sample/teamsfileupload/Application.java
@@ -4,10 +4,10 @@
package com.microsoft.bot.sample.teamsfileupload;
import com.microsoft.bot.builder.Bot;
-import com.microsoft.bot.integration.AdapterWithErrorHandler;
-import com.microsoft.bot.integration.BotFrameworkHttpAdapter;
+import com.microsoft.bot.integration.CloudAdapterWithErrorHandler;
+import com.microsoft.bot.integration.CloudAdapter;
import com.microsoft.bot.integration.Configuration;
-import com.microsoft.bot.integration.spring.BotController;
+import com.microsoft.bot.integration.spring.BotCloudAdapterController;
import com.microsoft.bot.integration.spring.BotDependencyConfiguration;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -19,12 +19,12 @@
//
@SpringBootApplication
-// Use the default BotController to receive incoming Channel messages. A custom
+// Use the default BotCloudAdapterController to receive incoming Channel messages. A custom
// controller could be used by eliminating this import and creating a new
// org.springframework.web.bind.annotation.RestController.
// The default controller is created by the Spring Boot container using
// dependency injection. The default route is /api/messages.
-@Import({BotController.class})
+@Import({BotCloudAdapterController.class})
/**
* This class extends the BotDependencyConfiguration which provides the default
@@ -56,10 +56,10 @@ public Bot getBot(Configuration configuration) {
* Returns a custom Adapter that provides error handling.
*
* @param configuration The Configuration object to use.
- * @return An error handling BotFrameworkHttpAdapter.
+ * @return An error handling CloudAdapter.
*/
@Override
- public BotFrameworkHttpAdapter getBotFrameworkHttpAdaptor(Configuration configuration) {
- return new AdapterWithErrorHandler(configuration);
+ public CloudAdapter getCloudAdapter(Configuration configuration) {
+ return new CloudAdapterWithErrorHandler(configuration);
}
}
diff --git a/samples/java_springboot/57.teams-conversation-bot/pom.xml b/samples/java_springboot/57.teams-conversation-bot/pom.xml
index 6d12197bf7..04b9c720f1 100644
--- a/samples/java_springboot/57.teams-conversation-bot/pom.xml
+++ b/samples/java_springboot/57.teams-conversation-bot/pom.xml
@@ -92,7 +92,7 @@
com.microsoft.bot
bot-integration-spring
- 4.13.0
+ 4.15.0-SNAPSHOT
compile
diff --git a/samples/java_springboot/58.teams-start-new-thread-in-channel/pom.xml b/samples/java_springboot/58.teams-start-new-thread-in-channel/pom.xml
index 3d62eab1a6..6afa6d97ab 100644
--- a/samples/java_springboot/58.teams-start-new-thread-in-channel/pom.xml
+++ b/samples/java_springboot/58.teams-start-new-thread-in-channel/pom.xml
@@ -91,7 +91,7 @@
com.microsoft.bot
bot-integration-spring
- 4.13.0
+ 4.15.0-SNAPSHOT
compile
diff --git a/samples/java_springboot/80.skills-simple-bot-to-bot/DialogRootBot/pom.xml b/samples/java_springboot/80.skills-simple-bot-to-bot/DialogRootBot/pom.xml
index 5ccc92d4f3..0412325a47 100644
--- a/samples/java_springboot/80.skills-simple-bot-to-bot/DialogRootBot/pom.xml
+++ b/samples/java_springboot/80.skills-simple-bot-to-bot/DialogRootBot/pom.xml
@@ -92,13 +92,13 @@
com.microsoft.bot
bot-integration-spring
- 4.13.0
+ 4.15.0-SNAPSHOT
compile
com.microsoft.bot
bot-builder
- 4.13.0
+ 4.15.0-SNAPSHOT
compile
diff --git a/samples/java_springboot/80.skills-simple-bot-to-bot/DialogRootBot/src/main/java/com/microsoft/bot/sample/simplerootbot/Application.java b/samples/java_springboot/80.skills-simple-bot-to-bot/DialogRootBot/src/main/java/com/microsoft/bot/sample/simplerootbot/Application.java
index b7d885facd..45bf396045 100644
--- a/samples/java_springboot/80.skills-simple-bot-to-bot/DialogRootBot/src/main/java/com/microsoft/bot/sample/simplerootbot/Application.java
+++ b/samples/java_springboot/80.skills-simple-bot-to-bot/DialogRootBot/src/main/java/com/microsoft/bot/sample/simplerootbot/Application.java
@@ -115,7 +115,7 @@ public SkillConversationIdFactoryBase getSkillConversationIdFactoryBase() {
}
@Bean public ChannelServiceHandler getChannelServiceHandler(
- BotAdapter botAdapter,
+ BotFrameworkHttpAdapter botAdapter,
Bot bot,
SkillConversationIdFactoryBase conversationIdFactory,
CredentialProvider credentialProvider,
diff --git a/samples/java_springboot/80.skills-simple-bot-to-bot/DialogSkillBot/pom.xml b/samples/java_springboot/80.skills-simple-bot-to-bot/DialogSkillBot/pom.xml
index 6f57ce1e2c..e49f66e802 100644
--- a/samples/java_springboot/80.skills-simple-bot-to-bot/DialogSkillBot/pom.xml
+++ b/samples/java_springboot/80.skills-simple-bot-to-bot/DialogSkillBot/pom.xml
@@ -92,7 +92,7 @@
com.microsoft.bot
bot-integration-spring
- 4.13.0
+ 4.15.0-SNAPSHOT
compile
diff --git a/samples/java_springboot/81.skills-skilldialog/dialog-root-bot/pom.xml b/samples/java_springboot/81.skills-skilldialog/dialog-root-bot/pom.xml
index 3c992dbb0a..ebf5222e27 100644
--- a/samples/java_springboot/81.skills-skilldialog/dialog-root-bot/pom.xml
+++ b/samples/java_springboot/81.skills-skilldialog/dialog-root-bot/pom.xml
@@ -92,19 +92,19 @@
com.microsoft.bot
bot-integration-spring
- 4.13.0
+ 4.15.0-SNAPSHOT
compile
com.microsoft.bot
bot-dialogs
- 4.13.0
+ 4.15.0-SNAPSHOT
compile
com.microsoft.bot
bot-builder
- 4.13.0
+ 4.15.0-SNAPSHOT
compile
diff --git a/samples/java_springboot/81.skills-skilldialog/dialog-skill-bot/pom.xml b/samples/java_springboot/81.skills-skilldialog/dialog-skill-bot/pom.xml
index cb36564734..0f840ebae6 100644
--- a/samples/java_springboot/81.skills-skilldialog/dialog-skill-bot/pom.xml
+++ b/samples/java_springboot/81.skills-skilldialog/dialog-skill-bot/pom.xml
@@ -92,19 +92,24 @@
com.microsoft.bot
bot-integration-spring
- 4.13.0
+ 4.15.0-SNAPSHOT
compile
com.microsoft.bot
bot-dialogs
- 4.13.0
+ 4.15.0-SNAPSHOT
compile
com.microsoft.bot
bot-ai-luis-v3
- 4.13.0
+ 4.15.0-SNAPSHOT
+
+
+ com.microsoft.bot
+ bot-applicationinsights
+ 4.15.0-SNAPSHOT
diff --git a/samples/java_springboot/pom.xml b/samples/java_springboot/pom.xml
index 667149fd43..c03da3a6ce 100644
--- a/samples/java_springboot/pom.xml
+++ b/samples/java_springboot/pom.xml
@@ -4,7 +4,7 @@
com.microsoft.bot
bot-java
- 4.13.0
+ 4.15.0-SNAPSHOT
pom
Microsoft BotBuilder Java SDK Parent
diff --git a/samples/java_springboot/servlet-echo/pom.xml b/samples/java_springboot/servlet-echo/pom.xml
index c84a80d5bb..d7b8607bc2 100644
--- a/samples/java_springboot/servlet-echo/pom.xml
+++ b/samples/java_springboot/servlet-echo/pom.xml
@@ -98,7 +98,7 @@
com.microsoft.bot
bot-integration-core
- 4.13.0
+ 4.15.0-SNAPSHOT