@aj-shadow/z-abs-complayer-markup-client 0.0.0-aj-beta.221

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (208) hide show
  1. package/.gitattributes +26 -0
  2. package/LICENSE.txt +96 -0
  3. package/README.md +5 -0
  4. package/npm-shrinkwrap.json +13 -0
  5. package/package.json +10 -0
  6. package/project/client/_build/Bundle-CompLayer-Markup-client.bld +40 -0
  7. package/project/client/_build/Client-CompLayer-Markup-client-jsx.bld +10 -0
  8. package/project/client/_build/Client-CompLayer-Markup-client.bld +10 -0
  9. package/project/client/_build/Client-css-CompLayer-Markup-bundle.bld +9 -0
  10. package/project/client/_build/z-abs-complayer-markup-client.prj +36 -0
  11. package/project/client/actions/action-style.js +17 -0
  12. package/project/client/actions/data-action-style.js +13 -0
  13. package/project/client/css/markup_addressing.css +30 -0
  14. package/project/client/css/markup_flowchart.css +53 -0
  15. package/project/client/css/markup_general.css +4 -0
  16. package/project/client/css/markup_image.css +10 -0
  17. package/project/client/css/markup_license.css +107 -0
  18. package/project/client/css/markup_login.css +201 -0
  19. package/project/client/css/markup_node_diagram.css +51 -0
  20. package/project/client/css/markup_sequence_diagram.css +6 -0
  21. package/project/client/css/markup_state.css +5 -0
  22. package/project/client/css/markup_table.css +57 -0
  23. package/project/client/css/markup_tc.css +32 -0
  24. package/project/client/css/markup_ts.css +36 -0
  25. package/project/client/data/addresses/data-addresses-client-address-global.js +20 -0
  26. package/project/client/data/addresses/data-addresses-client-address-local.js +20 -0
  27. package/project/client/data/addresses/data-addresses-client-interface-global.js +17 -0
  28. package/project/client/data/addresses/data-addresses-client-interface-local.js +17 -0
  29. package/project/client/data/addresses/data-addresses-dns-global.js +18 -0
  30. package/project/client/data/addresses/data-addresses-dns-local.js +19 -0
  31. package/project/client/data/addresses/data-addresses-dst-global.js +20 -0
  32. package/project/client/data/addresses/data-addresses-dst-local.js +20 -0
  33. package/project/client/data/addresses/data-addresses-network-interface-global.js +17 -0
  34. package/project/client/data/addresses/data-addresses-network-interface-local.js +17 -0
  35. package/project/client/data/addresses/data-addresses-ports-global.js +18 -0
  36. package/project/client/data/addresses/data-addresses-ports-local.js +18 -0
  37. package/project/client/data/addresses/data-addresses-server-address-global.js +20 -0
  38. package/project/client/data/addresses/data-addresses-server-address-local.js +20 -0
  39. package/project/client/data/addresses/data-addresses-server-interface-global.js +17 -0
  40. package/project/client/data/addresses/data-addresses-server-interface-local.js +17 -0
  41. package/project/client/data/addresses/data-addresses-src-global.js +21 -0
  42. package/project/client/data/addresses/data-addresses-src-local.js +21 -0
  43. package/project/client/data/addresses/data-addresses-srv-global.js +20 -0
  44. package/project/client/data/addresses/data-addresses-srv-local.js +20 -0
  45. package/project/client/data/addresses/data-addresses-sut-address-global.js +20 -0
  46. package/project/client/data/addresses/data-addresses-sut-address-local.js +20 -0
  47. package/project/client/data/addresses/data-addresses-sut-interface-global.js +19 -0
  48. package/project/client/data/addresses/data-addresses-sut-interface-local.js +19 -0
  49. package/project/client/data/data-chart/data-chart-axis.js +13 -0
  50. package/project/client/data/data-chart/data-chart-grid.js +14 -0
  51. package/project/client/data/data-chart/data-chart-line/data-chart-line-config.js +17 -0
  52. package/project/client/data/data-chart/data-chart-line/data-chart-line.js +41 -0
  53. package/project/client/data/data-config.js +14 -0
  54. package/project/client/data/data-constructor.js +18 -0
  55. package/project/client/data/data-content/data-content-audio-global.js +18 -0
  56. package/project/client/data/data-content/data-content-audio-local.js +18 -0
  57. package/project/client/data/data-content/data-content-documents-global.js +18 -0
  58. package/project/client/data/data-content/data-content-documents-local.js +18 -0
  59. package/project/client/data/data-content/data-content-image-global.js +21 -0
  60. package/project/client/data/data-content/data-content-image-local.js +21 -0
  61. package/project/client/data/data-content/data-content-other-global.js +20 -0
  62. package/project/client/data/data-content/data-content-other-local.js +20 -0
  63. package/project/client/data/data-content/data-content-text-global.js +20 -0
  64. package/project/client/data/data-content/data-content-text-local.js +20 -0
  65. package/project/client/data/data-content/data-content-video-global.js +20 -0
  66. package/project/client/data/data-content/data-content-video-local.js +20 -0
  67. package/project/client/data/data-data.js +28 -0
  68. package/project/client/data/data-dependencies/data-dependencies.js +17 -0
  69. package/project/client/data/data-documentation/data-documentation-navigation.js +15 -0
  70. package/project/client/data/data-documentation/data-documentation.js +20 -0
  71. package/project/client/data/data-flowchart/data-flowchart-block.js +33 -0
  72. package/project/client/data/data-flowchart/data-flowchart-connection.js +17 -0
  73. package/project/client/data/data-flowchart/data-flowchart.js +30 -0
  74. package/project/client/data/data-html/data-html-anchor.js +12 -0
  75. package/project/client/data/data-html/data-html-br.js +11 -0
  76. package/project/client/data/data-html/data-html-button.js +15 -0
  77. package/project/client/data/data-html/data-html-log-start.js +12 -0
  78. package/project/client/data/data-html/data-html-log-stop.js +13 -0
  79. package/project/client/data/data-html/data-html-log.js +16 -0
  80. package/project/client/data/data-html/data-html-toolbar.js +19 -0
  81. package/project/client/data/data-image/data-image.js +20 -0
  82. package/project/client/data/data-lab/data-lab-interface-client.js +19 -0
  83. package/project/client/data/data-lab/data-lab-interface-server.js +19 -0
  84. package/project/client/data/data-lab/data-lab-interface-sut.js +20 -0
  85. package/project/client/data/data-lab/data-lab-network.js +31 -0
  86. package/project/client/data/data-lab/data-lab.js +21 -0
  87. package/project/client/data/data-licenses/data-licenses.js +16 -0
  88. package/project/client/data/data-node-diagram/data-node-diagram-config.js +21 -0
  89. package/project/client/data/data-node-diagram/data-node-diagram-connection.js +18 -0
  90. package/project/client/data/data-node-diagram/data-node-diagram-group.js +16 -0
  91. package/project/client/data/data-node-diagram/data-node-diagram-node.js +22 -0
  92. package/project/client/data/data-node-diagram/data-node-diagram.js +47 -0
  93. package/project/client/data/data-repos/data-repos-content-local.js +15 -0
  94. package/project/client/data/data-repos/data-repos-data-local.js +15 -0
  95. package/project/client/data/data-sequence-diagram/data-sequence-diagram-config.js +22 -0
  96. package/project/client/data/data-sequence-diagram/data-sequence-diagram-message.js +17 -0
  97. package/project/client/data/data-sequence-diagram/data-sequence-diagram-node.js +11 -0
  98. package/project/client/data/data-sequence-diagram/data-sequence-diagram.js +32 -0
  99. package/project/client/data/data-state-machine/data-state-machine-config.js +17 -0
  100. package/project/client/data/data-state-machine/data-state-machine-state.js +29 -0
  101. package/project/client/data/data-state-machine/data-state-machine-transition.js +18 -0
  102. package/project/client/data/data-state-machine/data-state-machine.js +37 -0
  103. package/project/client/data/data-system-under-test/data-system-under-test-instances.js +15 -0
  104. package/project/client/data/data-system-under-test/data-system-under-test-nodes.js +18 -0
  105. package/project/client/data/data-table/data-table-config.js +21 -0
  106. package/project/client/data/data-table-key-value.js +56 -0
  107. package/project/client/data/data-test-case/data-actor.js +282 -0
  108. package/project/client/data/data-test-case/data-test-case-settings.js +49 -0
  109. package/project/client/data/data-test-case/data-test-case.js +19 -0
  110. package/project/client/data/data-test-case/data-test-data-iteration.js +54 -0
  111. package/project/client/data/data-test-case/data-test-data-test-case.js +16 -0
  112. package/project/client/data/data-test-case/data-verification-test-case.js +24 -0
  113. package/project/client/data/data-test-data/data-test-data-environment-global.js +18 -0
  114. package/project/client/data/data-test-data/data-test-data-environment-local.js +18 -0
  115. package/project/client/data/data-test-data/data-test-data-environment-static.js +16 -0
  116. package/project/client/data/data-test-data/data-test-data-general-global.js +18 -0
  117. package/project/client/data/data-test-data/data-test-data-general-local.js +18 -0
  118. package/project/client/data/data-test-data/data-test-data-output-global.js +18 -0
  119. package/project/client/data/data-test-data/data-test-data-output-local.js +18 -0
  120. package/project/client/data/data-test-data/data-test-data-system-global.js +18 -0
  121. package/project/client/data/data-test-data/data-test-data-system-local.js +18 -0
  122. package/project/client/data/data-test-suite/data-test-suite-abstraction.js +72 -0
  123. package/project/client/data/data-test-suite/data-test-suite.js +15 -0
  124. package/project/client/data/data-tree/data-tree-node.js +17 -0
  125. package/project/client/data/data-tree/data-tree.js +13 -0
  126. package/project/client/markup/markup-addresses/markup-addresses-client-address.js +31 -0
  127. package/project/client/markup/markup-addresses/markup-addresses-client-interface.js +31 -0
  128. package/project/client/markup/markup-addresses/markup-addresses-dns.js +32 -0
  129. package/project/client/markup/markup-addresses/markup-addresses-dst.js +31 -0
  130. package/project/client/markup/markup-addresses/markup-addresses-network-interface.js +31 -0
  131. package/project/client/markup/markup-addresses/markup-addresses-ports.js +31 -0
  132. package/project/client/markup/markup-addresses/markup-addresses-server-address.js +31 -0
  133. package/project/client/markup/markup-addresses/markup-addresses-server-interface.js +31 -0
  134. package/project/client/markup/markup-addresses/markup-addresses-src.js +31 -0
  135. package/project/client/markup/markup-addresses/markup-addresses-srv.js +31 -0
  136. package/project/client/markup/markup-addresses/markup-addresses-sut-address.js +31 -0
  137. package/project/client/markup/markup-addresses/markup-addresses-sut-interface.js +31 -0
  138. package/project/client/markup/markup-chart/markup-chart-line.js +92 -0
  139. package/project/client/markup/markup-content/markup-content-audio.js +31 -0
  140. package/project/client/markup/markup-content/markup-content-documents.js +31 -0
  141. package/project/client/markup/markup-content/markup-content-image.js +31 -0
  142. package/project/client/markup/markup-content/markup-content-other.js +31 -0
  143. package/project/client/markup/markup-content/markup-content-text.js +31 -0
  144. package/project/client/markup/markup-content/markup-content-video.js +31 -0
  145. package/project/client/markup/markup-dependencies/markup-dependencies.js +30 -0
  146. package/project/client/markup/markup-documentation/markup-documentation-anchor.js +37 -0
  147. package/project/client/markup/markup-documentation/markup-documentation-api-status.js +67 -0
  148. package/project/client/markup/markup-documentation/markup-documentation-code.js +20 -0
  149. package/project/client/markup/markup-documentation/markup-documentation-div.js +34 -0
  150. package/project/client/markup/markup-documentation/markup-documentation-documentation-status.js +67 -0
  151. package/project/client/markup/markup-documentation/markup-documentation-embed.js +23 -0
  152. package/project/client/markup/markup-documentation/markup-documentation-html.js +139 -0
  153. package/project/client/markup/markup-documentation/markup-documentation-ie.js +21 -0
  154. package/project/client/markup/markup-documentation/markup-documentation-image.js +46 -0
  155. package/project/client/markup/markup-documentation/markup-documentation-lab.js +19 -0
  156. package/project/client/markup/markup-documentation/markup-documentation-local-note.js +33 -0
  157. package/project/client/markup/markup-documentation/markup-documentation-navigation.js +109 -0
  158. package/project/client/markup/markup-documentation/markup-documentation-page.js +262 -0
  159. package/project/client/markup/markup-documentation/markup-documentation-ref.js +28 -0
  160. package/project/client/markup/markup-documentation/markup-documentation-result.js +21 -0
  161. package/project/client/markup/markup-documentation/markup-documentation-state-machine.js +194 -0
  162. package/project/client/markup/markup-documentation/markup-documentation.js +74 -0
  163. package/project/client/markup/markup-flowchart.js +264 -0
  164. package/project/client/markup/markup-lab.js +116 -0
  165. package/project/client/markup/markup-licenses/markup-licenses.js +29 -0
  166. package/project/client/markup/markup-node-diagram.js +435 -0
  167. package/project/client/markup/markup-parse-helper.js +26 -0
  168. package/project/client/markup/markup-pattern-config.js +53 -0
  169. package/project/client/markup/markup-pattern-data.js +50 -0
  170. package/project/client/markup/markup-pattern-function.js +47 -0
  171. package/project/client/markup/markup-repos/markup-repos.js +31 -0
  172. package/project/client/markup/markup-sequence-diagram.js +466 -0
  173. package/project/client/markup/markup-system-under-test/markup-system-under-test-instances.js +29 -0
  174. package/project/client/markup/markup-system-under-test/markup-system-under-test-nodes.js +30 -0
  175. package/project/client/markup/markup-table-key-value-parse.js +25 -0
  176. package/project/client/markup/markup-table-key-value-stringify.js +91 -0
  177. package/project/client/markup/markup-table-key-value.js +18 -0
  178. package/project/client/markup/markup-table-name-value.js +101 -0
  179. package/project/client/markup/markup-table.js +85 -0
  180. package/project/client/markup/markup-tables-parser.js +122 -0
  181. package/project/client/markup/markup-test-case/markup-test-case.js +67 -0
  182. package/project/client/markup/markup-test-data/markup-test-data-environment.js +31 -0
  183. package/project/client/markup/markup-test-data/markup-test-data-general.js +31 -0
  184. package/project/client/markup/markup-test-data/markup-test-data-output.js +31 -0
  185. package/project/client/markup/markup-test-data/markup-test-data-system.js +31 -0
  186. package/project/client/markup/markup-test-suite/markup-test-suite.js +40 -0
  187. package/project/client/react-components/helper/line-data.js +16 -0
  188. package/project/client/react-components/helper/line-object.js +22 -0
  189. package/project/client/react-components/helper/scroll-data.js +74 -0
  190. package/project/client/react-components/markup/component-chart/component-image-chart-line.jsx +203 -0
  191. package/project/client/react-components/markup/component-code.jsx +50 -0
  192. package/project/client/react-components/markup/component-document.jsx +105 -0
  193. package/project/client/react-components/markup/component-documentation-anchor.jsx +47 -0
  194. package/project/client/react-components/markup/component-embed.jsx +48 -0
  195. package/project/client/react-components/markup/component-image-flowchart.jsx +389 -0
  196. package/project/client/react-components/markup/component-image-image.jsx +32 -0
  197. package/project/client/react-components/markup/component-image-lab.jsx +696 -0
  198. package/project/client/react-components/markup/component-image-node-diagram.jsx +506 -0
  199. package/project/client/react-components/markup/component-image-result.jsx +22 -0
  200. package/project/client/react-components/markup/component-image-sequence-diagram.jsx +645 -0
  201. package/project/client/react-components/markup/component-image-state-machine.jsx +633 -0
  202. package/project/client/react-components/markup/component-image-table.jsx +96 -0
  203. package/project/client/react-components/markup/component-local-note.jsx +99 -0
  204. package/project/client/react-components/markup/component-markup-remarkable.jsx +79 -0
  205. package/project/client/react-components/markup/component-markup.jsx +1036 -0
  206. package/project/client/react-components/markup/component-table-data-table.jsx +146 -0
  207. package/project/client/stores/style-store.js +96 -0
  208. package/project/z-abs-complayer-markup-client.tree +239 -0
@@ -0,0 +1,74 @@
1
+
2
+ 'use strict';
3
+
4
+ const DataDocumentationNavigation = require('../../data/data-documentation/data-documentation-navigation');
5
+ const MarkupTableKeyValue = require('../markup-table-key-value');
6
+ const MarkupTablesParser = require('../markup-tables-parser');
7
+ const MarkupDocumentationNavigation = require('./markup-documentation-navigation');
8
+ const MarkupDocumentationPage = require('./markup-documentation-page');
9
+ const DataDocumentation = require('../../data/data-documentation/data-documentation');
10
+
11
+
12
+ class MarkupDocumentation {
13
+ stringify(documentation, currentPage) {
14
+ let results = [];
15
+ results.push(MarkupDocumentationNavigation.stringify(documentation.navigations));
16
+ results.push(MarkupDocumentationPage.stringify(documentation.page));
17
+ return `${results.join('\n\n')}\n`;
18
+ }
19
+
20
+ parse(markup) {
21
+ let documentation = new DataDocumentation();
22
+ let foundParts = this._getparse(markup);
23
+ foundParts.forEach((part) => {
24
+ if(MarkupDocumentation.NAVIGATION_START === part.type) {
25
+ // documentation.addNavigation(MarkupDocumentationNavigation.parse(part.value));
26
+ }
27
+ else if(MarkupDocumentation.PAGE_START === part.type) {
28
+ documentation.setPage(MarkupDocumentationPage.parse(part.value).values);
29
+ }
30
+ });
31
+ return {
32
+ success: true,
33
+ result: documentation
34
+ };
35
+ }
36
+
37
+ _getparse(markup, index = 0, foundParts = []) {
38
+ let indexStart = markup.indexOf(MarkupDocumentation.PART_START, index);
39
+ let indexStop = markup.indexOf(MarkupDocumentation.PART_STOP, indexStart + MarkupDocumentation.PART_START_LENGTH);
40
+ if(-1 === indexStart || -1 === indexStop) {
41
+ return foundParts;
42
+ }
43
+ else {
44
+ if(markup.substr(indexStart, MarkupDocumentation.NAVIGATION_START_LENGTH).startsWith(MarkupDocumentation.NAVIGATION_START)) {
45
+ foundParts.push({
46
+ type: MarkupDocumentation.NAVIGATION_START,
47
+ value: markup.substring(indexStart + MarkupDocumentation.NAVIGATION_START_LENGTH, indexStop).trim()
48
+ });
49
+ }
50
+ else if(markup.substr(indexStart, MarkupDocumentation.PAGE_START_LENGTH).startsWith(MarkupDocumentation.PAGE_START)) {
51
+ foundParts.push({
52
+ type: MarkupDocumentation.PAGE_START,
53
+ value: markup.substring(indexStart + MarkupDocumentation.PAGE_START_LENGTH, indexStop).trim()
54
+ });
55
+ }
56
+ }
57
+ return this._getparse(markup, indexStop + MarkupDocumentation.PART_STOP_LENGTH, foundParts);
58
+ }
59
+ }
60
+
61
+ MarkupDocumentation.PART_START = '€[';
62
+ MarkupDocumentation.PART_STOP = '}€[';
63
+ MarkupDocumentation.PART_START_LENGTH = MarkupDocumentation.PART_START.length;
64
+ MarkupDocumentation.PART_STOP_LENGTH = MarkupDocumentation.PART_STOP.length;
65
+
66
+ MarkupDocumentation.NAVIGATION_START = '€[navigation]{';
67
+ MarkupDocumentation.NAVIGATION_STOP = '}€[navigation]';
68
+ MarkupDocumentation.NAVIGATION_START_LENGTH = MarkupDocumentation.NAVIGATION_START.length;
69
+
70
+ MarkupDocumentation.PAGE_START = '€[page]{';
71
+ MarkupDocumentation.PAGE_STOP = '}€[page]';
72
+ MarkupDocumentation.PAGE_START_LENGTH = MarkupDocumentation.PAGE_START.length;
73
+
74
+ module.exports = new MarkupDocumentation();
@@ -0,0 +1,264 @@
1
+
2
+ 'use strict';
3
+
4
+ const DataFlowchart = require('../data/data-flowchart/data-flowchart');
5
+ const DataFlowchartBlock = require('../data/data-flowchart/data-flowchart-block');
6
+ const DataFlowchartConnection = require('../data/data-flowchart/data-flowchart-connection');
7
+
8
+
9
+ class MarkupFlowchart {
10
+ markupName() {
11
+ return 'flow';
12
+ }
13
+
14
+ stringify(flowchart) {
15
+ let stringified = '';
16
+ if('' !== flowchart.title) {
17
+ stringified += `${MarkupFlowchart.TAG_TITLE} ${flowchart.title}\n`;
18
+ }
19
+ if(1 <= flowchart.blockRows.length) {
20
+ for(let i = 0; i < flowchart.blockRows.length; ++i) {
21
+ stringified += 'Blocks[';
22
+ const firstBlock = flowchart.blockRows[i][0];
23
+ stringified += firstBlock.name;
24
+ if('' !== firstBlock.name && (undefined !== firstBlock.type || undefined !== firstBlock.data || undefined !== firstBlock.css || undefined !== firstBlock.link)) {
25
+ stringified += `(${firstBlock.type ? firstBlock.type : ''}:${firstBlock.data ? firstBlock.data : ''}:${firstBlock.css ? firstBlock.css : ''}:${firstBlock.link ? firstBlock.link : ''})`;
26
+ }
27
+ for(let j = 1; j < flowchart.blockRows[i].length; ++j) {
28
+ const block = flowchart.blockRows[i][j];
29
+ stringified += `, ${block.name}`;
30
+ if('' !== block.name && (undefined !== block.type || undefined !== block.data || undefined !== block.css || undefined !== block.link)) {
31
+ stringified += `(${block.type ? block.type : ''}:${block.data ? block.data : ''}:${block.css ? block.css : ''}:${block.link ? block.link : ''})`;
32
+ }
33
+ }
34
+ stringified += ']\n';
35
+ }
36
+ }
37
+ else {
38
+ stringified += 'Blocks[]';
39
+ }
40
+ for(let i = 0; i < flowchart.connections.length; ++i) {
41
+ const connection = flowchart.connections[i];
42
+ if(-1 !== connection.fromXIndex && -1 !== connection.fromYIndex && -1 !== connection.toXIndex && -1 !== connection.toYIndex) {
43
+ const fromBlock = this._getBlockFromName(flowchart, connection.fromBlockName);
44
+ const toBlock = this._getBlockFromName(flowchart, connection.toBlockName);
45
+ if(null !== fromBlock && null !== toBlock) {
46
+ stringified += `\n${fromBlock.name} ${this._stringifyConnectionType(connection)} ${toBlock.name}[${connection.type}]: ${connection.data}`;
47
+ continue;
48
+ }
49
+ }
50
+ stringified += `\n${connection.data}`
51
+ }
52
+ return stringified;
53
+ }
54
+
55
+
56
+ parse(markup) {
57
+ const rows = this._getRows(markup);
58
+ const dataFlowchart = new DataFlowchart();
59
+ rows.forEach((row) => {
60
+ this._parseRow(dataFlowchart, row);
61
+ });
62
+ return dataFlowchart;
63
+ }
64
+
65
+ _parseRow(dataFlowchart, row) {
66
+ const trimRow = row.trim();
67
+ if(trimRow.startsWith(MarkupFlowchart.TAG_TITLE)) {
68
+ dataFlowchart.setTitle(trimRow.substr(MarkupFlowchart.TAG_TITLE_LENGTH).trim());
69
+ }
70
+ else if(trimRow.startsWith('Blocks')) {
71
+ let index = 0;
72
+ while(true) {
73
+ const start = trimRow.indexOf('[', index);
74
+ if(-1 === start) {
75
+ break;
76
+ }
77
+ const stop = trimRow.indexOf(']', start + 1);
78
+ const blockNames = trimRow.substring(start + 1, -1 !== stop ? stop : undefined).split(',');
79
+ if(null !== blockNames) {
80
+ dataFlowchart.addBlockRow();
81
+ blockNames.forEach((blockName) => {
82
+ let trimBlock = '';
83
+ if(blockName.startsWith(',') && blockName.endsWith(',')) {
84
+ trimBlock = blockName.substring(1, blockName.length - 1).trim();
85
+ }
86
+ else {
87
+ trimBlock = blockName.trim();
88
+ }
89
+ const startType = trimBlock.indexOf('(');
90
+ const stopType = trimBlock.indexOf(')', startType + 1);
91
+ if(-1 !== startType && -1 !== stopType) {
92
+ const blockParameters = trimBlock.substring(startType + 1, -1 !== stopType ? stopType : undefined).split(':');
93
+ dataFlowchart.addBlock(new DataFlowchartBlock(trimBlock.substring(0, startType), ...blockParameters));
94
+ }
95
+ else {
96
+ dataFlowchart.addBlock(new DataFlowchartBlock(trimBlock));
97
+ }
98
+ });
99
+ }
100
+ if(-1 === stop) {
101
+ break;
102
+ }
103
+ else {
104
+ index = stop;
105
+ }
106
+ }
107
+ }
108
+ else {
109
+ let type = 'unknown';
110
+ let data = '';
111
+ let typeStartIndex = trimRow.indexOf('[');
112
+ let typeStopIndex = trimRow.indexOf(']');
113
+ if(-1 !== typeStartIndex && -1 !== typeStopIndex) {
114
+ const types = trimRow.slice(typeStartIndex + 1, typeStopIndex).match(/([^\s,]+)/g);
115
+ if(types && 1 === types.length) {
116
+ type = types[0];
117
+ }
118
+ }
119
+ const dataIndex = trimRow.indexOf(':');
120
+ if(-1 !== dataIndex) {
121
+ data = trimRow.substring(dataIndex + 1, trimRow.length).trim();
122
+ }
123
+ let connectionTypeIndex = this._parseConnectionTypeIndex(trimRow);
124
+ if(-1 !== connectionTypeIndex) {
125
+ const connectionType = this._parseConnectionType(trimRow, connectionTypeIndex);
126
+ const from = trimRow.substring(0, connectionTypeIndex).trim();
127
+ const to = trimRow.substring(connectionTypeIndex + connectionType.size, typeStartIndex).trim();
128
+ const fromBlock = this._getBlockFromName(dataFlowchart, from);
129
+ const toBlock = this._getBlockFromName(dataFlowchart, to);
130
+ if(null !== fromBlock && null !== toBlock) {
131
+ dataFlowchart.addConnection(new DataFlowchartConnection(data, type, connectionType.type, fromBlock, toBlock));
132
+ }
133
+ else {
134
+ dataFlowchart.addConnection(new DataFlowchartConnection(trimRow, type, connectionType.type, fromBlock, toBlock));
135
+ }
136
+ }
137
+ }
138
+ }
139
+
140
+ _getRows(markup) {
141
+ let index = 0;
142
+ let nextIndex = 0;
143
+ let rows = [];
144
+ let length = markup.length;
145
+ while(index < length) {
146
+ nextIndex = markup.indexOf('\n', index);
147
+ if(-1 !== nextIndex) {
148
+ rows.push(markup.substring(index, nextIndex).trim());
149
+ index = nextIndex + 1;
150
+ }
151
+ else {
152
+ rows.push(markup.substring(index, length).trim());
153
+ index = length;
154
+ }
155
+ }
156
+ return rows;
157
+ }
158
+
159
+ _stringifyConnectionType(connection) {
160
+ if('normal' === connection.connectionType) {
161
+ return '=>';
162
+ }
163
+ else if('normal-bi-directional' === connection.connectionType) {
164
+ return '<=>';
165
+ }
166
+ else if('part' === connection.connectionType) {
167
+ return '->';
168
+ }
169
+ else if('part-bi-directional' === connection.connectionType) {
170
+ return '<->';
171
+ }
172
+ else if('connect' === connection.connectionType) {
173
+ return '-o';
174
+ }
175
+ else if('disconnect' === connection.connectionType) {
176
+ return '-x';
177
+ }
178
+ }
179
+
180
+ _parseConnectionTypeIndex(row) {
181
+ let index = row.indexOf('<=>');
182
+ if(-1 !== index) {
183
+ return index;
184
+ }
185
+ index = row.indexOf('=>');
186
+ if(-1 !== index) {
187
+ return index;
188
+ }
189
+ index = row.indexOf('<->');
190
+ if(-1 !== index) {
191
+ return index;
192
+ }
193
+ index = row.indexOf('->');
194
+ if(-1 !== index) {
195
+ return index;
196
+ }
197
+ index = row.indexOf('-o');
198
+ if(-1 !== index) {
199
+ return index;
200
+ }
201
+ index = row.indexOf('-x');
202
+ if(-1 !== index) {
203
+ return index;
204
+ }
205
+ return -1;
206
+ }
207
+
208
+ _parseConnectionType(row, index) {
209
+ if('=>' === row.substr(index, 2)) {
210
+ return {
211
+ type: 'normal',
212
+ size: 2
213
+ };
214
+ }
215
+ else if('<=>' === row.substr(index, 3)) {
216
+ return {
217
+ type: 'normal-bi-directional',
218
+ size: 3
219
+ };
220
+ }
221
+ else if('->' === row.substr(index, 2)) {
222
+ return {
223
+ type: 'part',
224
+ size: 2
225
+ };
226
+ }
227
+ else if('<->' === row.substr(index, 3)) {
228
+ return {
229
+ type: 'part-bi-directional',
230
+ size: 3
231
+ };
232
+ }
233
+ else if('-o' === row.substr(index, 2)) {
234
+ return {
235
+ type: 'connect',
236
+ size: 2
237
+ };
238
+ }
239
+ else if('-x' === row.substr(index, 2)) {
240
+ return {
241
+ type: 'disconnect',
242
+ size: 2
243
+ };
244
+ }
245
+ return '';
246
+ }
247
+
248
+ _getBlockFromName(dataFlowchart, blockName) {
249
+ for(let i = 0; i < dataFlowchart.blockRows.length; ++i) {
250
+ for(let j = 0; j < dataFlowchart.blockRows[i].length; ++j) {
251
+ if(dataFlowchart.blockRows[i][j].name === blockName) {
252
+ return dataFlowchart.blockRows[i][j];
253
+ }
254
+ }
255
+ }
256
+ return null;
257
+ }
258
+ }
259
+
260
+ MarkupFlowchart.TAG_TITLE = 'Title:';
261
+ MarkupFlowchart.TAG_TITLE_LENGTH = MarkupFlowchart.TAG_TITLE.length;
262
+
263
+
264
+ module.exports = new MarkupFlowchart();
@@ -0,0 +1,116 @@
1
+
2
+ 'use strict';
3
+
4
+ const DataLab = require('../data/data-lab/data-lab');
5
+ const DataLabNetwork = require('../data/data-lab/data-lab-network');
6
+ const DataLabInterfaceClient = require('../data/data-lab/data-lab-interface-client');
7
+ const DataLabInterfaceSut = require('../data/data-lab/data-lab-interface-sut');
8
+ const DataLabInterfaceServer = require('../data/data-lab/data-lab-interface-server');
9
+ const MarkupPatternFunction = require('./markup-pattern-function');
10
+
11
+
12
+ class MarkupLab {
13
+ markupName() {
14
+ return 'lab';
15
+ }
16
+
17
+ stringify(networks) {
18
+ const dataLab = new DataLab(networks);
19
+ let stringified = '';
20
+ dataLab.networks.forEach((network) => {
21
+ stringified += 'Network(';
22
+ stringified += network.networkName + ', ';
23
+ stringified += network.family + ', ';
24
+ stringified += network.subnet + ', ';
25
+ stringified += network.description + ', ';
26
+ stringified += network.valid + ', ';
27
+ stringified += network.reduced + ')\n';
28
+ if(0 !== network.clients.length) {
29
+ network.clients.forEach((client) => {
30
+ stringified += MarkupPatternFunction.stringify('Client', client);
31
+ });
32
+ }
33
+ if(0 !== network.suts.length) {
34
+ network.suts.forEach((sut) => {
35
+ stringified += MarkupPatternFunction.stringify('Sut', sut);
36
+ });
37
+ }
38
+ if(0 !== network.servers.length) {
39
+ network.servers.forEach((server) => {
40
+ stringified += MarkupPatternFunction.stringify('Server', server);
41
+ });
42
+ }
43
+ });
44
+ return stringified;
45
+ }
46
+
47
+ parse(markup) {
48
+ const rows = this._getRows(markup);
49
+ const dataLab = new DataLab();
50
+ rows.forEach((row) => {
51
+ this._parseRow(dataLab, row);
52
+ });
53
+ return dataLab.networks;
54
+ }
55
+
56
+ _parseRow(dataLab, row) {
57
+ const trimRow = row.trim();
58
+ if(trimRow.startsWith('Network(')) {
59
+ const stop = trimRow.indexOf(')');
60
+ const parametersRaw = trimRow.substring('Network('.length, -1 !== stop ? stop : undefined).split(',');
61
+ const parameters = parametersRaw.map((parameter) => {
62
+ return parameter.trim();
63
+ });
64
+ dataLab.addNetwork(new DataLabNetwork(...parameters));
65
+ }
66
+ else if(trimRow.startsWith('Client')) {
67
+ MarkupPatternFunction.parse(trimRow, (...parameters) => {
68
+ const client = new DataLabInterfaceClient(...parameters);
69
+ const network = dataLab.getNetwork(client.network);
70
+ if(undefined !== network) {
71
+ network.addClient(client);
72
+ }
73
+ });
74
+ }
75
+ else if(trimRow.startsWith('Sut')) {
76
+ MarkupPatternFunction.parse(trimRow, (...parameters) => {
77
+ const sut = new DataLabInterfaceSut(...parameters);
78
+ const network = dataLab.getNetwork(sut.network);
79
+ if(undefined !== network) {
80
+ network.addSut(sut);
81
+ }
82
+ });
83
+ }
84
+ else if(trimRow.startsWith('Server')) {
85
+ MarkupPatternFunction.parse(trimRow, (...parameters) => {
86
+ const server = new DataLabInterfaceServer(...parameters);
87
+ const network = dataLab.getNetwork(server.network);
88
+ if(undefined !== network) {
89
+ network.addServer(server);
90
+ }
91
+ });
92
+ }
93
+ }
94
+
95
+ _getRows(markup) {
96
+ let index = 0;
97
+ let nextIndex = 0;
98
+ let rows = [];
99
+ let length = markup.length;
100
+ while(index < length) {
101
+ nextIndex = markup.indexOf('\n', index);
102
+ if(-1 !== nextIndex) {
103
+ rows.push(markup.substring(index, nextIndex).trim());
104
+ index = nextIndex + 1;
105
+ }
106
+ else {
107
+ rows.push(markup.substring(index, length).trim());
108
+ index = length;
109
+ }
110
+ }
111
+ return rows;
112
+ }
113
+ }
114
+
115
+
116
+ module.exports = new MarkupLab();
@@ -0,0 +1,29 @@
1
+
2
+ 'use strict';
3
+
4
+ const DataLicenses = require('../../data/data-licenses/data-licenses');
5
+ const MarkupTableKeyValue = require('../markup-table-key-value');
6
+ const MarkupTablesParser = require('../markup-tables-parser');
7
+
8
+
9
+ class MarkupLicenses {
10
+ stringify(dataLicenses) {
11
+ return `\n${MarkupTableKeyValue.stringify(new DataLicenses(), dataLicenses, true)}\n`;
12
+ }
13
+
14
+ parse(markup) {
15
+ const objectTables = MarkupTablesParser.parse(markup);
16
+ if(!objectTables.success) {
17
+ return {
18
+ success: false,
19
+ rows: objectTables.rows
20
+ };
21
+ }
22
+ return {
23
+ success: true,
24
+ licenses: MarkupTableKeyValue.parse(DataLicenses, objectTables.objects)
25
+ };
26
+ }
27
+ }
28
+
29
+ module.exports = new MarkupLicenses();