This repository has been archived by the owner on Dec 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* dialogs.choices * bot-dialogs: periodic push (mostly functional ObjectPath) * Dialog Updates * Interim commit and push to protect work in progress * Pushing to protect work in progress * Safety Checkin * Setting up unit tests for Dialogs * Updates to get VS Code test runner working * Completed DialogManager and DialogStateManager * Updates to match namespaces and file structure. * First unit test for DialogStateManager now working. * Addin DialogStateManager unit tests and fixes. * Waterfall dialogs and Prompts * Fixes and unit tests * Choice Prompt unit tests * Additional unit tests and fixes * Unit tests and fixes. * ComponentDialog tests and fixes * DialogContainerTests and fixes to Dialog * Additional tests and fixes * Final unit tests * Correct failing unit test. * Fixes for merge issues. * Update to new exception handling pattern. * Remove uneeded unit test inports. * Added copyright notices. * Update DialogContext * Added recognizer libraries Co-authored-by: tracyboehrer <[email protected]>
- Loading branch information
1 parent
1b478b4
commit 5e1ca81
Showing
688 changed files
with
79,326 additions
and
498 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
libraries/bot-builder/src/main/java/com/microsoft/bot/builder/ComponentRegistration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
package com.microsoft.bot.builder; | ||
|
||
import java.util.concurrent.ConcurrentHashMap; | ||
|
||
/** | ||
* ComponentRegistration is a signature class for discovering assets from components. | ||
*/ | ||
@SuppressWarnings("checkstyle:HideUtilityClassConstructor") | ||
public class ComponentRegistration { | ||
|
||
private static final ConcurrentHashMap<Class<?>, ComponentRegistration> COMPONENTS = | ||
new ConcurrentHashMap<Class<?>, ComponentRegistration>(); | ||
|
||
/** | ||
* Add a component which implements registration methods. | ||
* | ||
* @param componentRegistration The component to add to the registration. | ||
*/ | ||
public static void add(ComponentRegistration componentRegistration) { | ||
COMPONENTS.put(componentRegistration.getClass(), componentRegistration); | ||
} | ||
|
||
/** | ||
* Gets list of all ComponentRegistration objects registered. | ||
* | ||
* @return A array of ComponentRegistration objects. | ||
*/ | ||
public static Iterable<ComponentRegistration> getComponents() { | ||
return COMPONENTS.values(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
libraries/bot-builder/src/main/java/com/microsoft/bot/builder/NextDelegate.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
libraries/bot-builder/src/main/java/com/microsoft/bot/builder/OnTurnErrorHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
libraries/bot-builder/src/main/java/com/microsoft/bot/builder/RegisterClassMiddleware.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
package com.microsoft.bot.builder; | ||
|
||
import java.util.concurrent.CompletableFuture; | ||
|
||
import com.nimbusds.oauth2.sdk.util.StringUtils; | ||
|
||
/** | ||
* Middleware for adding an object to or registering a service with the current | ||
* turn context. | ||
* | ||
* @param <T> The typeof service to add. | ||
*/ | ||
public class RegisterClassMiddleware<T> implements Middleware { | ||
private String key; | ||
|
||
/** | ||
* Initializes a new instance of the RegisterClassMiddleware class. | ||
* | ||
* @param service The Service to register. | ||
*/ | ||
public RegisterClassMiddleware(T service) { | ||
this.service = service; | ||
} | ||
|
||
/** | ||
* Initializes a new instance of the RegisterClassMiddleware class. | ||
* | ||
* @param service The Service to register. | ||
* @param key optional key for service object in turn state. Default is name | ||
* of service. | ||
*/ | ||
public RegisterClassMiddleware(T service, String key) { | ||
this.service = service; | ||
this.key = key; | ||
} | ||
|
||
private T service; | ||
|
||
/** | ||
* Gets the Service. | ||
* | ||
* @return The Service. | ||
*/ | ||
public T getService() { | ||
return service; | ||
} | ||
|
||
/** | ||
* Sets the Service. | ||
* | ||
* @param withService The value to set the Service to. | ||
*/ | ||
public void setService(T withService) { | ||
this.service = withService; | ||
} | ||
|
||
@Override | ||
/** | ||
* Adds the associated object or service to the current turn context. | ||
* @param turnContext The context object for this turn. | ||
* @param next The delegate to call to continue the bot middleware pipeline. | ||
*/ | ||
public CompletableFuture<Void> onTurn(TurnContext turnContext, NextDelegate next) { | ||
if (!StringUtils.isBlank(key)) { | ||
turnContext.getTurnState().add(key, service); | ||
} else { | ||
turnContext.getTurnState().add(service); | ||
} | ||
return next.next(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.