Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GPII-2843: Fix the broken browser channel example #586

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
33 changes: 17 additions & 16 deletions documentation/BrowserChannel.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
```
{
"screenReaderTTS/enabled":false,
"highContrast/enabled":true,
"invertColours":false,
"magnifierEnabled":true,
"magnification":2,
"fontSize":"medium",
"simplifier":false,
"highContrastTheme":"white-black"
contrastTheme: 'default',
dictionaryEnabled: true
}
```
* 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 gpii.config.cloudBased.production
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
```
127 changes: 127 additions & 0 deletions testData/solutions/darwin.json5
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
]
}
}