From 8497efa0c876f6d241f0b4ddd24561a1913f89fa Mon Sep 17 00:00:00 2001 From: Cindy Qi Li Date: Fri, 2 Feb 2018 09:52:26 -0500 Subject: [PATCH 1/5] GPII-2843: Use the GPII config that includes the local flow manager to support the browser channel example. --- documentation/BrowserChannel.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/BrowserChannel.md b/documentation/BrowserChannel.md index 035678ba9..6d31c7d14 100644 --- a/documentation/BrowserChannel.md +++ b/documentation/BrowserChannel.md @@ -82,7 +82,7 @@ The workflow between the client and server can be summarised as follows: The client has been checked in to [../examples/browserChannelClient](../examples/browserChannelClient). To try it out, first start the GPII in the CloudBased browserChannel test configuration from the root of universal with - node gpii.js gpii/configs gpii.config.cloudBased.production + node gpii.js gpii/configs gpii.config.development.all.local Then start the client from [../examples/browserChannelClient](../examples/browserChannelClient) with From 8837aaa3ceba28acf7da353ca59270bbf37ab2f7 Mon Sep 17 00:00:00 2001 From: Cindy Qi Li Date: Fri, 2 Feb 2018 14:11:14 -0500 Subject: [PATCH 2/5] GPII-2843: Use gpii.config.development.all.local.mock.windows to support the browser channel example. --- documentation/BrowserChannel.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/BrowserChannel.md b/documentation/BrowserChannel.md index 6d31c7d14..da8ed0b94 100644 --- a/documentation/BrowserChannel.md +++ b/documentation/BrowserChannel.md @@ -82,7 +82,7 @@ The workflow between the client and server can be summarised as follows: The client has been checked in to [../examples/browserChannelClient](../examples/browserChannelClient). To try it out, first start the GPII in the CloudBased browserChannel test configuration from the root of universal with - node gpii.js gpii/configs gpii.config.development.all.local + node gpii.js gpii/configs/mocks gpii.config.development.all.local.mock.windows Then start the client from [../examples/browserChannelClient](../examples/browserChannelClient) with From 417b798b069509e727e83ea17ad06bb125e86c18 Mon Sep 17 00:00:00 2001 From: Cindy Qi Li Date: Thu, 1 Mar 2018 10:51:48 -0500 Subject: [PATCH 3/5] GPII-2843: Fixed the browser channel example. --- documentation/BrowserChannel.md | 33 +++++---- testData/solutions/darwin.json5 | 127 ++++++++++++++++++++++++++++++++ 2 files changed, 144 insertions(+), 16 deletions(-) diff --git a/documentation/BrowserChannel.md b/documentation/BrowserChannel.md index da8ed0b94..223a396da 100644 --- a/documentation/BrowserChannel.md +++ b/documentation/BrowserChannel.md @@ -58,32 +58,33 @@ socket.on("message", function (data) { }); ``` -The workflow between the client and server can be summarised as follows: +The workflow between the client and server can be summarized as follows: * After connecting to the flow manager, the client sends a socket message to the channel, which is a payload containing the *id* of the client, in this instance `net.gpii.uioPlus`. * The client will be registered if the solution's id can be found of the solutions registry, otherwise, the registration will be rejected and the system will emit en error, and the client will disconnect. -* When the flow manager emits either the _connectionSucceeded_ (after being registered) or the _onSettingsChanged_ (after a user login/logout) signal to the client, it is delivering the current available settings for the client in the following way: +* When the flow manager emits either the _connectionSucceeded_ (after being registered) or the _onSettingsChanged_ (after a user login/logout) signal to the client, it is delivering the current available user settings for the client in the following way: ``` { - "screenReaderTTSEnabled":false, - "highContrastEnabled":true, - "invertColours":false, - "magnifierEnabled":true, - "magnification":2, - "fontSize":"medium", - "simplifier":false, - "highContrastTheme":"white-black" + "contrastTheme": "wb", + "dictionaryEnabled": false } ``` * When a client disconnects, it'll be removed from the list of registered clients ### Running the sample client -The client has been checked in to [../examples/browserChannelClient](../examples/browserChannelClient). To try it out, first -start the GPII in the CloudBased browserChannel test configuration from the root of universal with - - node gpii.js gpii/configs/mocks gpii.config.development.all.local.mock.windows +The client has been checked in to [../examples/browserChannelClient](../examples/browserChannelClient). To try it out: +1. start the GPII in the local development configuration from the root of universal with +``` +node gpii.js gpii/configs gpii.config.development.all.local +``` -Then start the client from [../examples/browserChannelClient](../examples/browserChannelClient) with +2. login with `snapset_2a` by sending a login request to GPII +``` +curl http://localhost:8081/user/snapset_2a/login +``` - node browserChannelClient.js +3. start the client from [../examples/browserChannelClient](../examples/browserChannelClient) with +``` +node browserChannelClient.js +``` diff --git a/testData/solutions/darwin.json5 b/testData/solutions/darwin.json5 index c5117ea61..e3dadc50d 100644 --- a/testData/solutions/darwin.json5 +++ b/testData/solutions/darwin.json5 @@ -114,5 +114,132 @@ "type": "gpii.deviceReporter.alwaysInstalled" } ] + }, + + "net.gpii.uioPlus": { + "name": "UIO+", + "contexts": { + "OS": [{ + "id": "darwin" + }] + }, + "settingsHandlers": { + "configuration": { + "type": "gpii.settingsHandlers.webSockets", + "options": { + "path": "net.gpii.uioPlus" + }, + "supportedSettings": { + "lineSpace": {}, + "fontSize": {}, + "characterSpace": {}, + "inputsLargerEnabled": {}, + "contrastTheme": {}, + "selfVoicingEnabled": {}, + "selectionTheme": {}, + "tableOfContentsEnabled": {}, + "dictionaryEnabled": {}, + "simplifiedUiEnabled": {}, + "syllabificationEnabled": {} + }, + "capabilities": [ + "http://registry\\.gpii\\.net/common/lineSpace", + "http://registry\\.gpii\\.net/common/fontSize", + "http://registry\\.gpii\\.net/common/characterSpace", + "http://registry\\.gpii\\.net/common/inputsLargerEnabled", + "http://registry\\.gpii\\.net/common/highContrastEnabled", + "http://registry\\.gpii\\.net/common/highContrastTheme", + "http://registry\\.gpii\\.net/common/selfVoicingEnabled", + "http://registry\\.gpii\\.net/common/highlightColor", + "http://registry\\.gpii\\.net/common/tableOfContents", + "http://registry\\.gpii\\.net/common/supportTool", + "http://registry\\.gpii\\.net/common/simplifiedUiEnabled" + ], + "capabilitiesTransformations": { + "lineSpace": "http://registry\\.gpii\\.net/common/lineSpace", + "fontSize": { + "transform": { + "type": "fluid.transforms.round", + "scale": 1, + "input": { + "transform": { + "type": "fluid.transforms.binaryOp", + "leftPath": "http://registry\\.gpii\\.net/common/fontSize", + "right": 12, + "operator": "/" + } + } + } + }, + "characterSpace": "http://registry\\.gpii\\.net/common/characterSpace", + "inputsLargerEnabled": "http://registry\\.gpii\\.net/common/inputsLargerEnabled", + "contrastTheme": { + "transform": { + "type": "fluid.transforms.condition", + "conditionPath": "http://registry\\.gpii\\.net/common/highContrastEnabled", + "true": { + "transform": { + "type": "fluid.transforms.valueMapper", + "defaultInputPath": "http://registry\\.gpii\\.net/common/highContrastTheme", + "defaultOutputValue": "default", + "match": { + "black-white": "bw", + "white-black": "wb", + "black-yellow": "by", + "yellow-black": "yb" + } + } + }, + "false": "default" + } + }, + "selfVoicingEnabled": "http://registry\\.gpii\\.net/common/selfVoicingEnabled", + "selectionTheme": "http://registry\\.gpii\\.net/common/highlightColor", + "tableOfContentsEnabled": "http://registry\\.gpii\\.net/common/tableOfContents", + "dictionaryEnabled": { + "transform": { + "type": "fluid.transforms.valueMapper", + "match": [{ + "inputValue": { + "dictionaryEnabled": true + }, + "outputValue": true + }], + "noMatch": { + "outputValue": false + }, + "defaultInput": { + "transform": { + "type": "fluid.transforms.arrayToSetMembership", + "inputPath": "http://registry\\.gpii\\.net/common/supportTool", + "options": { + "dictionary": "dictionaryEnabled" + } + } + } + } + }, + "simplifiedUiEnabled": "http://registry\\.gpii\\.net/common/simplifiedUiEnabled", + "syllabificationEnabled": "http://registry\\.gpii\\.net/common/syllabificationEnabled" + }, + "inverseCapabilitiesTransformations": {} + } + }, + "update": [ + "configure" + ], + "configure": [ + "settings.configuration" + ], + "restore": [ + "settings.configuration" + ], + "start": [], + "stop": [], + "isInstalled": [ + { + "type": "gpii.deviceReporter.alwaysInstalled" + } + ] } } From d1928d2a132a05be4872aaeb40bcdcbcdad24f9b Mon Sep 17 00:00:00 2001 From: Cindy Qi Li Date: Thu, 1 Mar 2018 12:51:54 -0500 Subject: [PATCH 4/5] GPII-2843: Switch to use "wget" from "curl" at building cloud based docker container to find out if it helps to work around the couchdb connection failure. --- scripts/vagrantCloudBasedContainers.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/vagrantCloudBasedContainers.sh b/scripts/vagrantCloudBasedContainers.sh index d118bddea..929a4b685 100755 --- a/scripts/vagrantCloudBasedContainers.sh +++ b/scripts/vagrantCloudBasedContainers.sh @@ -52,8 +52,9 @@ docker run -d -p $COUCHDB_PORT:$COUCHDB_PORT --name couchdb $COUCHDB_IMAGE # Wait for CouchDB sleep $COUCHDB_HEALTHCHECK_DELAY -curl --retry $COUCHDB_HEALTHCHECK_TIMEOUT --retry-delay 1 --retry-connrefused http://localhost:$COUCHDB_PORT +#curl --retry $COUCHDB_HEALTHCHECK_TIMEOUT --retry-delay 1 --retry-connrefused http://localhost:$COUCHDB_PORT +wget --retry-connrefused --waitretry=1 --read-timeout=20 --timeout=15 -t 30 http://localhost:$COUCHDB_PORT docker run -d -p $PREFERENCES_PORT:$PREFERENCES_PORT --name preferences --link couchdb -e NODE_ENV=$PREFERENCES_CONFIG -e GPII_PREFERENCES_DATASOURCE_URL=$PREFERENCES_DATASOURCE_URL -e GPII_PREFERENCES_LISTEN_PORT=$PREFERENCES_PORT $UNIVERSAL_IMAGE docker run -d -p $FLOWMANAGER_PORT:$FLOWMANAGER_PORT --name flowmanager --link preferences -e NODE_ENV=$FLOWMANAGER_CONFIG -e GPII_FLOWMANAGER_PREFERENCES_URL=$FLOWMANAGER_PREFERENCES_URL -e GPII_FLOWMANAGER_LISTEN_PORT=$FLOWMANAGER_PORT $UNIVERSAL_IMAGE -docker run --rm --link couchdb -v $PREFERENCES_DIR:/data -e PREFERENCES_DIR=/data -e COUCHDB_URL=$DATALOADER_COUCHDB_URL -e CLEAR_INDEX=$DATALOADER_CLEAR_INDEX $DATALOADER_IMAGE \ No newline at end of file +docker run --rm --link couchdb -v $PREFERENCES_DIR:/data -e PREFERENCES_DIR=/data -e COUCHDB_URL=$DATALOADER_COUCHDB_URL -e CLEAR_INDEX=$DATALOADER_CLEAR_INDEX $DATALOADER_IMAGE From 9330d2dd807c60a3575688dabb224a6bf2681c3d Mon Sep 17 00:00:00 2001 From: Cindy Qi Li Date: Thu, 1 Mar 2018 15:06:04 -0500 Subject: [PATCH 5/5] GPII-2843: Replaced "wget" work around with the change in the latest master. --- scripts/vagrantCloudBasedContainers.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/vagrantCloudBasedContainers.sh b/scripts/vagrantCloudBasedContainers.sh index 5fb6713c6..462d57766 100755 --- a/scripts/vagrantCloudBasedContainers.sh +++ b/scripts/vagrantCloudBasedContainers.sh @@ -52,8 +52,7 @@ docker run -d -p $COUCHDB_PORT:$COUCHDB_PORT --name couchdb $COUCHDB_IMAGE # Wait for CouchDB sleep $COUCHDB_HEALTHCHECK_DELAY -#curl --retry $COUCHDB_HEALTHCHECK_TIMEOUT --retry-delay 1 --retry-connrefused http://localhost:$COUCHDB_PORT -wget --retry-connrefused --waitretry=1 --read-timeout=20 --timeout=15 -t 30 http://localhost:$COUCHDB_PORT +curl --retry $COUCHDB_HEALTHCHECK_TIMEOUT --retry-delay 1 --retry-connrefused http://localhost:$COUCHDB_PORT docker run -d -p $PREFERENCES_PORT:$PREFERENCES_PORT --name preferences --link couchdb -e NODE_ENV=$PREFERENCES_CONFIG -e GPII_PREFERENCES_DATASOURCE_URL=$PREFERENCES_DATASOURCE_URL -e GPII_PREFERENCES_LISTEN_PORT=$PREFERENCES_PORT $UNIVERSAL_IMAGE docker run -d -p $FLOWMANAGER_PORT:$FLOWMANAGER_PORT --name flowmanager --link preferences -e NODE_ENV=$FLOWMANAGER_CONFIG -e GPII_FLOWMANAGER_PREFERENCES_URL=$FLOWMANAGER_PREFERENCES_URL -e GPII_FLOWMANAGER_LISTEN_PORT=$FLOWMANAGER_PORT $UNIVERSAL_IMAGE