Project

General

Profile

Sockets » History » Version 2

Denis Kildishev, 08/24/2022 08:50 PM

1 1 Denis Kildishev
h1. Web Sockets
2
3
Now requality starts several web sockets for different editors. Current mapping is
4
5
 markup editor: 9920
6
 Requirements editor1 (unieditor): 9921
7
 Report view (reportView): 9922;
8
 Requirements editor2 (moduleeditor): 9923
9
 Requirements editor1 (review, in read-only mode): 9924
10
11
Web sockets uses JSON in messages.
12
13
Common format of client-server request includes
14
{"operation":"{op}", "location":"{loc}","session":"{sess}"}
15
where {op} is the name of operation(for ex. "init"),
16
{loc} is uri like http://localhost:9807/SMiqI3pGjPql/documents/stpo::6bc8a38f-45ba-4c82-bba8-db0c74e06125//?inTool=1&port=9920&document=6bc8a38f-45ba-4c82-bba8-db0c74e06125&session=4741003328181833534&
17
{sess} is generated session identification, for ex. 4741003328181833534
18
19
Requests may also include more parameters like, for example, init uses parameter "document",
20
like "document":"6bc8a38f-45ba-4c82-bba8-db0c74e06125"
21
Each new connection to server requires first call of init operation.
22
As an full example may be
23
{"operation":"init", "location":"http://localhost:9807/SMiqI3pGjPql/documents/stpo::6bc8a38f-45ba-4c82-bba8-db0c74e06125//?inTool=1&port=9920&document=6bc8a38f-45ba-4c82-bba8-db0c74e06125&session=4741003328181833534&","session":"4741003328181833534", "document":"6bc8a38f-45ba-4c82-bba8-db0c74e06125"}
24
or for one more editor
25
{"operation":"init", "location":"http://localhost:9807/r4AV8F78228D/reports/stpo::33cfa331-7d99-47e3-9c4a-0455df4101b5/jetos-reqs.stpo2.html?inTool=1&port=9922&document=33cfa331-7d99-47e3-9c4a-0455df4101b5&session=8974468582254662369&","session":"8974468582254662369", "document":"33cfa331-7d99-47e3-9c4a-0455df4101b5"}
26
27
Server-client messages are mostly formed as follows:
28
{"operation":"{op}", "data":{data}}
29
where op is the name of operation(for example, update of selection listed below)
30
and {data} is an json object storing all passed data according to operation kind
31
for example,
32
{"data":{"nextId":"011","requirementId":"Requirements","requirementUUID":"4e24f8a1-22b8-40b7-b406-01acc4d89d52"},"operation":"updateSelection"}
33
34
h1. Resources provider
35 2 Denis Kildishev
36 1 Denis Kildishev
Resources(and editors) are available at port 9807. URI is formed mostly according to given template:
37
http://{ip}:9807/{appSessId}/{editor}/{project}::{nodeUUId}/{resPath}?{params}
38
where ip is ip address of server(commonly localhost)
39
appSessId - randomly generated on app start string
40
editor - one of set{markup,unieditor,reportView,moduleeditor,review}
41
project - name of project 
42
nodeUUId - id of node where editor needs to be openned
43
resPath - path to resources. For documents resources(markup) were provided from corresponding document. Default path points at document xhtml file. If uri points at resource like /image.png it will be taken from corresponding resources folder of node. But if some commonly used resource like jquery is requested then it will be loaded from plugin folder jstools(used to load ckeditor and jquery and so on).
44
params - set of additional parameters passed to script. For example, ?inTool=1&port=9922&document=33cfa331-7d99-47e3-9c4a-0455df4101b5&session=8974468582254662369& - port is socket port, document - uuid of node and session is session identification, isTool - param used to determine if editor was started from eclipse
45
As example can be URL for markup
46
http://localhost:9807/r4AV8F78228D/reports/stpo::33cfa331-7d99-47e3-9c4a-0455df4101b5/jetos-reqs.stpo2.html?inTool=1&port=9922&document=33cfa331-7d99-47e3-9c4a-0455df4101b5&session=8974468582254662369&