@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.
- package/.gitattributes +26 -0
- package/LICENSE.txt +96 -0
- package/README.md +5 -0
- package/npm-shrinkwrap.json +13 -0
- package/package.json +10 -0
- package/project/client/_build/Bundle-CompLayer-Markup-client.bld +40 -0
- package/project/client/_build/Client-CompLayer-Markup-client-jsx.bld +10 -0
- package/project/client/_build/Client-CompLayer-Markup-client.bld +10 -0
- package/project/client/_build/Client-css-CompLayer-Markup-bundle.bld +9 -0
- package/project/client/_build/z-abs-complayer-markup-client.prj +36 -0
- package/project/client/actions/action-style.js +17 -0
- package/project/client/actions/data-action-style.js +13 -0
- package/project/client/css/markup_addressing.css +30 -0
- package/project/client/css/markup_flowchart.css +53 -0
- package/project/client/css/markup_general.css +4 -0
- package/project/client/css/markup_image.css +10 -0
- package/project/client/css/markup_license.css +107 -0
- package/project/client/css/markup_login.css +201 -0
- package/project/client/css/markup_node_diagram.css +51 -0
- package/project/client/css/markup_sequence_diagram.css +6 -0
- package/project/client/css/markup_state.css +5 -0
- package/project/client/css/markup_table.css +57 -0
- package/project/client/css/markup_tc.css +32 -0
- package/project/client/css/markup_ts.css +36 -0
- package/project/client/data/addresses/data-addresses-client-address-global.js +20 -0
- package/project/client/data/addresses/data-addresses-client-address-local.js +20 -0
- package/project/client/data/addresses/data-addresses-client-interface-global.js +17 -0
- package/project/client/data/addresses/data-addresses-client-interface-local.js +17 -0
- package/project/client/data/addresses/data-addresses-dns-global.js +18 -0
- package/project/client/data/addresses/data-addresses-dns-local.js +19 -0
- package/project/client/data/addresses/data-addresses-dst-global.js +20 -0
- package/project/client/data/addresses/data-addresses-dst-local.js +20 -0
- package/project/client/data/addresses/data-addresses-network-interface-global.js +17 -0
- package/project/client/data/addresses/data-addresses-network-interface-local.js +17 -0
- package/project/client/data/addresses/data-addresses-ports-global.js +18 -0
- package/project/client/data/addresses/data-addresses-ports-local.js +18 -0
- package/project/client/data/addresses/data-addresses-server-address-global.js +20 -0
- package/project/client/data/addresses/data-addresses-server-address-local.js +20 -0
- package/project/client/data/addresses/data-addresses-server-interface-global.js +17 -0
- package/project/client/data/addresses/data-addresses-server-interface-local.js +17 -0
- package/project/client/data/addresses/data-addresses-src-global.js +21 -0
- package/project/client/data/addresses/data-addresses-src-local.js +21 -0
- package/project/client/data/addresses/data-addresses-srv-global.js +20 -0
- package/project/client/data/addresses/data-addresses-srv-local.js +20 -0
- package/project/client/data/addresses/data-addresses-sut-address-global.js +20 -0
- package/project/client/data/addresses/data-addresses-sut-address-local.js +20 -0
- package/project/client/data/addresses/data-addresses-sut-interface-global.js +19 -0
- package/project/client/data/addresses/data-addresses-sut-interface-local.js +19 -0
- package/project/client/data/data-chart/data-chart-axis.js +13 -0
- package/project/client/data/data-chart/data-chart-grid.js +14 -0
- package/project/client/data/data-chart/data-chart-line/data-chart-line-config.js +17 -0
- package/project/client/data/data-chart/data-chart-line/data-chart-line.js +41 -0
- package/project/client/data/data-config.js +14 -0
- package/project/client/data/data-constructor.js +18 -0
- package/project/client/data/data-content/data-content-audio-global.js +18 -0
- package/project/client/data/data-content/data-content-audio-local.js +18 -0
- package/project/client/data/data-content/data-content-documents-global.js +18 -0
- package/project/client/data/data-content/data-content-documents-local.js +18 -0
- package/project/client/data/data-content/data-content-image-global.js +21 -0
- package/project/client/data/data-content/data-content-image-local.js +21 -0
- package/project/client/data/data-content/data-content-other-global.js +20 -0
- package/project/client/data/data-content/data-content-other-local.js +20 -0
- package/project/client/data/data-content/data-content-text-global.js +20 -0
- package/project/client/data/data-content/data-content-text-local.js +20 -0
- package/project/client/data/data-content/data-content-video-global.js +20 -0
- package/project/client/data/data-content/data-content-video-local.js +20 -0
- package/project/client/data/data-data.js +28 -0
- package/project/client/data/data-dependencies/data-dependencies.js +17 -0
- package/project/client/data/data-documentation/data-documentation-navigation.js +15 -0
- package/project/client/data/data-documentation/data-documentation.js +20 -0
- package/project/client/data/data-flowchart/data-flowchart-block.js +33 -0
- package/project/client/data/data-flowchart/data-flowchart-connection.js +17 -0
- package/project/client/data/data-flowchart/data-flowchart.js +30 -0
- package/project/client/data/data-html/data-html-anchor.js +12 -0
- package/project/client/data/data-html/data-html-br.js +11 -0
- package/project/client/data/data-html/data-html-button.js +15 -0
- package/project/client/data/data-html/data-html-log-start.js +12 -0
- package/project/client/data/data-html/data-html-log-stop.js +13 -0
- package/project/client/data/data-html/data-html-log.js +16 -0
- package/project/client/data/data-html/data-html-toolbar.js +19 -0
- package/project/client/data/data-image/data-image.js +20 -0
- package/project/client/data/data-lab/data-lab-interface-client.js +19 -0
- package/project/client/data/data-lab/data-lab-interface-server.js +19 -0
- package/project/client/data/data-lab/data-lab-interface-sut.js +20 -0
- package/project/client/data/data-lab/data-lab-network.js +31 -0
- package/project/client/data/data-lab/data-lab.js +21 -0
- package/project/client/data/data-licenses/data-licenses.js +16 -0
- package/project/client/data/data-node-diagram/data-node-diagram-config.js +21 -0
- package/project/client/data/data-node-diagram/data-node-diagram-connection.js +18 -0
- package/project/client/data/data-node-diagram/data-node-diagram-group.js +16 -0
- package/project/client/data/data-node-diagram/data-node-diagram-node.js +22 -0
- package/project/client/data/data-node-diagram/data-node-diagram.js +47 -0
- package/project/client/data/data-repos/data-repos-content-local.js +15 -0
- package/project/client/data/data-repos/data-repos-data-local.js +15 -0
- package/project/client/data/data-sequence-diagram/data-sequence-diagram-config.js +22 -0
- package/project/client/data/data-sequence-diagram/data-sequence-diagram-message.js +17 -0
- package/project/client/data/data-sequence-diagram/data-sequence-diagram-node.js +11 -0
- package/project/client/data/data-sequence-diagram/data-sequence-diagram.js +32 -0
- package/project/client/data/data-state-machine/data-state-machine-config.js +17 -0
- package/project/client/data/data-state-machine/data-state-machine-state.js +29 -0
- package/project/client/data/data-state-machine/data-state-machine-transition.js +18 -0
- package/project/client/data/data-state-machine/data-state-machine.js +37 -0
- package/project/client/data/data-system-under-test/data-system-under-test-instances.js +15 -0
- package/project/client/data/data-system-under-test/data-system-under-test-nodes.js +18 -0
- package/project/client/data/data-table/data-table-config.js +21 -0
- package/project/client/data/data-table-key-value.js +56 -0
- package/project/client/data/data-test-case/data-actor.js +282 -0
- package/project/client/data/data-test-case/data-test-case-settings.js +49 -0
- package/project/client/data/data-test-case/data-test-case.js +19 -0
- package/project/client/data/data-test-case/data-test-data-iteration.js +54 -0
- package/project/client/data/data-test-case/data-test-data-test-case.js +16 -0
- package/project/client/data/data-test-case/data-verification-test-case.js +24 -0
- package/project/client/data/data-test-data/data-test-data-environment-global.js +18 -0
- package/project/client/data/data-test-data/data-test-data-environment-local.js +18 -0
- package/project/client/data/data-test-data/data-test-data-environment-static.js +16 -0
- package/project/client/data/data-test-data/data-test-data-general-global.js +18 -0
- package/project/client/data/data-test-data/data-test-data-general-local.js +18 -0
- package/project/client/data/data-test-data/data-test-data-output-global.js +18 -0
- package/project/client/data/data-test-data/data-test-data-output-local.js +18 -0
- package/project/client/data/data-test-data/data-test-data-system-global.js +18 -0
- package/project/client/data/data-test-data/data-test-data-system-local.js +18 -0
- package/project/client/data/data-test-suite/data-test-suite-abstraction.js +72 -0
- package/project/client/data/data-test-suite/data-test-suite.js +15 -0
- package/project/client/data/data-tree/data-tree-node.js +17 -0
- package/project/client/data/data-tree/data-tree.js +13 -0
- package/project/client/markup/markup-addresses/markup-addresses-client-address.js +31 -0
- package/project/client/markup/markup-addresses/markup-addresses-client-interface.js +31 -0
- package/project/client/markup/markup-addresses/markup-addresses-dns.js +32 -0
- package/project/client/markup/markup-addresses/markup-addresses-dst.js +31 -0
- package/project/client/markup/markup-addresses/markup-addresses-network-interface.js +31 -0
- package/project/client/markup/markup-addresses/markup-addresses-ports.js +31 -0
- package/project/client/markup/markup-addresses/markup-addresses-server-address.js +31 -0
- package/project/client/markup/markup-addresses/markup-addresses-server-interface.js +31 -0
- package/project/client/markup/markup-addresses/markup-addresses-src.js +31 -0
- package/project/client/markup/markup-addresses/markup-addresses-srv.js +31 -0
- package/project/client/markup/markup-addresses/markup-addresses-sut-address.js +31 -0
- package/project/client/markup/markup-addresses/markup-addresses-sut-interface.js +31 -0
- package/project/client/markup/markup-chart/markup-chart-line.js +92 -0
- package/project/client/markup/markup-content/markup-content-audio.js +31 -0
- package/project/client/markup/markup-content/markup-content-documents.js +31 -0
- package/project/client/markup/markup-content/markup-content-image.js +31 -0
- package/project/client/markup/markup-content/markup-content-other.js +31 -0
- package/project/client/markup/markup-content/markup-content-text.js +31 -0
- package/project/client/markup/markup-content/markup-content-video.js +31 -0
- package/project/client/markup/markup-dependencies/markup-dependencies.js +30 -0
- package/project/client/markup/markup-documentation/markup-documentation-anchor.js +37 -0
- package/project/client/markup/markup-documentation/markup-documentation-api-status.js +67 -0
- package/project/client/markup/markup-documentation/markup-documentation-code.js +20 -0
- package/project/client/markup/markup-documentation/markup-documentation-div.js +34 -0
- package/project/client/markup/markup-documentation/markup-documentation-documentation-status.js +67 -0
- package/project/client/markup/markup-documentation/markup-documentation-embed.js +23 -0
- package/project/client/markup/markup-documentation/markup-documentation-html.js +139 -0
- package/project/client/markup/markup-documentation/markup-documentation-ie.js +21 -0
- package/project/client/markup/markup-documentation/markup-documentation-image.js +46 -0
- package/project/client/markup/markup-documentation/markup-documentation-lab.js +19 -0
- package/project/client/markup/markup-documentation/markup-documentation-local-note.js +33 -0
- package/project/client/markup/markup-documentation/markup-documentation-navigation.js +109 -0
- package/project/client/markup/markup-documentation/markup-documentation-page.js +262 -0
- package/project/client/markup/markup-documentation/markup-documentation-ref.js +28 -0
- package/project/client/markup/markup-documentation/markup-documentation-result.js +21 -0
- package/project/client/markup/markup-documentation/markup-documentation-state-machine.js +194 -0
- package/project/client/markup/markup-documentation/markup-documentation.js +74 -0
- package/project/client/markup/markup-flowchart.js +264 -0
- package/project/client/markup/markup-lab.js +116 -0
- package/project/client/markup/markup-licenses/markup-licenses.js +29 -0
- package/project/client/markup/markup-node-diagram.js +435 -0
- package/project/client/markup/markup-parse-helper.js +26 -0
- package/project/client/markup/markup-pattern-config.js +53 -0
- package/project/client/markup/markup-pattern-data.js +50 -0
- package/project/client/markup/markup-pattern-function.js +47 -0
- package/project/client/markup/markup-repos/markup-repos.js +31 -0
- package/project/client/markup/markup-sequence-diagram.js +466 -0
- package/project/client/markup/markup-system-under-test/markup-system-under-test-instances.js +29 -0
- package/project/client/markup/markup-system-under-test/markup-system-under-test-nodes.js +30 -0
- package/project/client/markup/markup-table-key-value-parse.js +25 -0
- package/project/client/markup/markup-table-key-value-stringify.js +91 -0
- package/project/client/markup/markup-table-key-value.js +18 -0
- package/project/client/markup/markup-table-name-value.js +101 -0
- package/project/client/markup/markup-table.js +85 -0
- package/project/client/markup/markup-tables-parser.js +122 -0
- package/project/client/markup/markup-test-case/markup-test-case.js +67 -0
- package/project/client/markup/markup-test-data/markup-test-data-environment.js +31 -0
- package/project/client/markup/markup-test-data/markup-test-data-general.js +31 -0
- package/project/client/markup/markup-test-data/markup-test-data-output.js +31 -0
- package/project/client/markup/markup-test-data/markup-test-data-system.js +31 -0
- package/project/client/markup/markup-test-suite/markup-test-suite.js +40 -0
- package/project/client/react-components/helper/line-data.js +16 -0
- package/project/client/react-components/helper/line-object.js +22 -0
- package/project/client/react-components/helper/scroll-data.js +74 -0
- package/project/client/react-components/markup/component-chart/component-image-chart-line.jsx +203 -0
- package/project/client/react-components/markup/component-code.jsx +50 -0
- package/project/client/react-components/markup/component-document.jsx +105 -0
- package/project/client/react-components/markup/component-documentation-anchor.jsx +47 -0
- package/project/client/react-components/markup/component-embed.jsx +48 -0
- package/project/client/react-components/markup/component-image-flowchart.jsx +389 -0
- package/project/client/react-components/markup/component-image-image.jsx +32 -0
- package/project/client/react-components/markup/component-image-lab.jsx +696 -0
- package/project/client/react-components/markup/component-image-node-diagram.jsx +506 -0
- package/project/client/react-components/markup/component-image-result.jsx +22 -0
- package/project/client/react-components/markup/component-image-sequence-diagram.jsx +645 -0
- package/project/client/react-components/markup/component-image-state-machine.jsx +633 -0
- package/project/client/react-components/markup/component-image-table.jsx +96 -0
- package/project/client/react-components/markup/component-local-note.jsx +99 -0
- package/project/client/react-components/markup/component-markup-remarkable.jsx +79 -0
- package/project/client/react-components/markup/component-markup.jsx +1036 -0
- package/project/client/react-components/markup/component-table-data-table.jsx +146 -0
- package/project/client/stores/style-store.js +96 -0
- package/project/z-abs-complayer-markup-client.tree +239 -0
|
@@ -0,0 +1,435 @@
|
|
|
1
|
+
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const DataNodeDiagram = require('../data/data-node-diagram/data-node-diagram');
|
|
5
|
+
const DataNodeDiagramNode = require('../data/data-node-diagram/data-node-diagram-node');
|
|
6
|
+
const DataNodeDiagramConnection = require('../data/data-node-diagram/data-node-diagram-connection');
|
|
7
|
+
const DataNodeDiagramGroup = require('../data/data-node-diagram/data-node-diagram-group');
|
|
8
|
+
const DataNodeDiagramConfig = require('../data/data-node-diagram/data-node-diagram-config');
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class MarkupNodeDiagram {
|
|
12
|
+
markupName() {
|
|
13
|
+
return 'node';
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
stringify(dataNodeDiagram) {
|
|
17
|
+
let stringified = '';
|
|
18
|
+
if('' !== dataNodeDiagram.title) {
|
|
19
|
+
stringified += `${MarkupNodeDiagram.TAG_TITLE} ${dataNodeDiagram.title}\n`;
|
|
20
|
+
}
|
|
21
|
+
const dataNodeDiagramConfig = dataNodeDiagram.dataNodeDiagramConfig;
|
|
22
|
+
const keys = Object.keys(dataNodeDiagramConfig);
|
|
23
|
+
stringified += 'Config(';
|
|
24
|
+
if(1 <= keys.length) {
|
|
25
|
+
stringified += `${keys[0]}: ${dataNodeDiagramConfig[keys[0]]}`;
|
|
26
|
+
for(let i = 1; i < keys.length; ++i) {
|
|
27
|
+
stringified += `, ${keys[i]}: ${dataNodeDiagramConfig[keys[i]]}`;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
stringified += ')\n\n';
|
|
31
|
+
if(1 <= dataNodeDiagram.nodeRows.length) {
|
|
32
|
+
for(let i = 0; i < dataNodeDiagram.nodeRows.length; ++i) {
|
|
33
|
+
stringified += 'Nodes[';
|
|
34
|
+
stringified += this._stringifyNodeParameter(dataNodeDiagram.nodeRows[i][0]);
|
|
35
|
+
for(let j = 1; j < dataNodeDiagram.nodeRows[i].length; ++j) {
|
|
36
|
+
stringified += `, ${this._stringifyNodeParameter(dataNodeDiagram.nodeRows[i][j])}`;
|
|
37
|
+
}
|
|
38
|
+
stringified += ']\n';
|
|
39
|
+
}
|
|
40
|
+
stringified += '\n';
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
stringified += 'Nodes[]\n\n';
|
|
44
|
+
}
|
|
45
|
+
if(0 !== dataNodeDiagram.groups.length) {
|
|
46
|
+
stringified += 'Groups[';
|
|
47
|
+
if(1 <= dataNodeDiagram.groups.length) {
|
|
48
|
+
stringified += this._stringifyGroupParameter(dataNodeDiagram.groups[0]);
|
|
49
|
+
for(let i = 1; i < dataNodeDiagram.groups.length; ++i) {
|
|
50
|
+
stringified += `, ${this._stringifyGroupParameter(dataNodeDiagram.groups[i])}`;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
stringified += ']\n';
|
|
54
|
+
}
|
|
55
|
+
for(let i = 0; i < dataNodeDiagram.connections.length; ++i) {
|
|
56
|
+
const connection = dataNodeDiagram.connections[i];
|
|
57
|
+
if(-1 !== connection.fromXIndex && -1 !== connection.fromYIndex && -1 !== connection.toXIndex && -1 !== connection.toYIndex)
|
|
58
|
+
{
|
|
59
|
+
const fromNode = this._getNodeFromName(dataNodeDiagram, connection.fromNodeName);
|
|
60
|
+
const toNode = this._getNodeFromName(dataNodeDiagram, connection.toNodeName);
|
|
61
|
+
if(null !== fromNode && null !== toNode)
|
|
62
|
+
{
|
|
63
|
+
const type = connection.type.trim();
|
|
64
|
+
const fromPosition = connection.fromPosition.trim();
|
|
65
|
+
const toPosition = connection.toPosition.trim();
|
|
66
|
+
const slope = undefined !== connection.slope ? (connection.slope ? 'true' : 'false') : '';
|
|
67
|
+
let connectionParameters = [];
|
|
68
|
+
if(0 !== slope.length) {
|
|
69
|
+
connectionParameters.unshift(type, fromPosition, toPosition, slope);
|
|
70
|
+
}
|
|
71
|
+
else if(0 !== toPosition.length) {
|
|
72
|
+
connectionParameters.unshift(type, fromPosition, toPosition);
|
|
73
|
+
}
|
|
74
|
+
else if(0 !== fromPosition.length) {
|
|
75
|
+
connectionParameters.unshift(type, fromPosition);
|
|
76
|
+
}
|
|
77
|
+
else if(0 !== type.length) {
|
|
78
|
+
connectionParameters.unshift(type);
|
|
79
|
+
}
|
|
80
|
+
stringified += `\n${fromNode.name} ${this._stringifyConnectionType(connection)} ${toNode.name}[${connectionParameters.join(', ')}]: ${connection.data}`;
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
stringified += `\n${connection.data}`
|
|
85
|
+
}
|
|
86
|
+
if(null !== dataNodeDiagram.xml) {
|
|
87
|
+
stringified += '\n' + dataNodeDiagram.xml;
|
|
88
|
+
}
|
|
89
|
+
return stringified;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
_stringifyGroupParameter(group) {
|
|
93
|
+
let stringify = group.name;
|
|
94
|
+
const color = group.color.trim();
|
|
95
|
+
if(-1 !== group.leftStartIndex && -1 !== group.leftStopIndex && -1 !== group.topStartIndex && -1 !== group.topStopIndex) {
|
|
96
|
+
stringify += `(${group.leftStartIndex}; ${group.leftStopIndex}; ${group.topStartIndex}; ${group.topStopIndex}`;
|
|
97
|
+
if(0 !== color.length) {
|
|
98
|
+
stringify += `; ${color}`;
|
|
99
|
+
}
|
|
100
|
+
stringify += `)`;
|
|
101
|
+
}
|
|
102
|
+
return stringify;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
_stringifyNodeParameter(node) {
|
|
106
|
+
let stringify = node.name;
|
|
107
|
+
const type = node.type.trim();
|
|
108
|
+
const corners = node.corners;
|
|
109
|
+
const color = node.color.trim();
|
|
110
|
+
let nodeParameters = [];
|
|
111
|
+
if(0 !== color.length) {
|
|
112
|
+
nodeParameters.unshift(type, corners, color);
|
|
113
|
+
}
|
|
114
|
+
else if(0 !== corners.length) {
|
|
115
|
+
nodeParameters.unshift(type, corners);
|
|
116
|
+
}
|
|
117
|
+
else if(0 !== type.length) {
|
|
118
|
+
nodeParameters.unshift(type);
|
|
119
|
+
}
|
|
120
|
+
if(0 !== nodeParameters.length) {
|
|
121
|
+
stringify += `(${nodeParameters.join('; ')})`;
|
|
122
|
+
}
|
|
123
|
+
return stringify;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
parse(markup) {
|
|
127
|
+
const parsed = this._getRows(markup);
|
|
128
|
+
const rows = parsed.rows;
|
|
129
|
+
const dataNodeDiagram = new DataNodeDiagram();
|
|
130
|
+
rows.forEach((row) => {
|
|
131
|
+
this._parseRow(dataNodeDiagram, row);
|
|
132
|
+
});
|
|
133
|
+
dataNodeDiagram.addXml(parsed.xml);
|
|
134
|
+
return dataNodeDiagram;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
_parseRow(dataNodeDiagram, row) {
|
|
138
|
+
const trimRow = row.trim();
|
|
139
|
+
if(trimRow.startsWith(MarkupNodeDiagram.TAG_TITLE)) {
|
|
140
|
+
dataNodeDiagram.setTitle(trimRow.substr(MarkupNodeDiagram.TAG_TITLE_LENGTH).trim());
|
|
141
|
+
}
|
|
142
|
+
else if(trimRow.startsWith('Nodes')) {
|
|
143
|
+
let index = 0;
|
|
144
|
+
while(true) {
|
|
145
|
+
const start = trimRow.indexOf('[', index);
|
|
146
|
+
if(-1 === start) {
|
|
147
|
+
break;
|
|
148
|
+
}
|
|
149
|
+
const stop = trimRow.indexOf(']', start + 1);
|
|
150
|
+
const nodeNames = trimRow.substring(start + 1, -1 !== stop ? stop : undefined).split(',');
|
|
151
|
+
if(null !== nodeNames) {
|
|
152
|
+
dataNodeDiagram.addNodeRow();
|
|
153
|
+
nodeNames.forEach((nodeName) => {
|
|
154
|
+
let trimNode = '';
|
|
155
|
+
let trimNodeName = '';
|
|
156
|
+
let trimNodeType = '';
|
|
157
|
+
let trimNodeCorners = '';
|
|
158
|
+
let trimNodeColor = '';
|
|
159
|
+
if(nodeName.startsWith(',') && nodeName.endsWith(',')) {
|
|
160
|
+
trimNode = nodeName.substring(1, nodeName.length - 1).trim();
|
|
161
|
+
}
|
|
162
|
+
else {
|
|
163
|
+
trimNode = nodeName.trim();
|
|
164
|
+
}
|
|
165
|
+
const startTrimNode = trimNode.indexOf('(');
|
|
166
|
+
const stopTrimNode = trimNode.indexOf(')', -1 !== startTrimNode ? startTrimNode + 1 : undefined);
|
|
167
|
+
if(-1 !== startTrimNode && -1 !== stopTrimNode) {
|
|
168
|
+
const nodeParameters = trimNode.substring(startTrimNode + 1, -1 !== stopTrimNode ? stopTrimNode : undefined).split(';');
|
|
169
|
+
if(null !== nodeParameters) {
|
|
170
|
+
trimNodeName = trimNode.substring(0, startTrimNode);
|
|
171
|
+
if(1 <= nodeParameters.length) {
|
|
172
|
+
trimNodeType = nodeParameters[0].trim();
|
|
173
|
+
}
|
|
174
|
+
if(2 <= nodeParameters.length) {
|
|
175
|
+
const Corners = Number.parseInt(nodeParameters[1].trim());
|
|
176
|
+
if(!Number.isNaN(Corners)) {
|
|
177
|
+
trimNodeCorners = Corners;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
if(3 <= nodeParameters.length) {
|
|
181
|
+
trimNodeColor = nodeParameters[2].trim();
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
else {
|
|
186
|
+
trimNodeName = trimNode;
|
|
187
|
+
}
|
|
188
|
+
dataNodeDiagram.addNode(new DataNodeDiagramNode(trimNodeName, trimNodeType, trimNodeCorners, trimNodeColor));
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
if(-1 === stop) {
|
|
192
|
+
break;
|
|
193
|
+
}
|
|
194
|
+
else {
|
|
195
|
+
index = stop;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
else if(trimRow.startsWith('Groups')) {
|
|
200
|
+
let start = trimRow.indexOf('[');
|
|
201
|
+
let stop = trimRow.indexOf(']', start);
|
|
202
|
+
if(-1 !== start && -1 !== stop) {
|
|
203
|
+
const groups = trimRow.substring(start + 1, -1 !== stop ? stop : undefined).split(',');
|
|
204
|
+
if(null !== groups) {
|
|
205
|
+
groups.forEach((group) => {
|
|
206
|
+
let groupTrim = group.trim();
|
|
207
|
+
let startGroupIndex = groupTrim.indexOf('(');
|
|
208
|
+
let stopGroupIndex = groupTrim.indexOf(')', startGroupIndex);
|
|
209
|
+
let groupName = '';
|
|
210
|
+
let groupLeftStartIndex = -1;
|
|
211
|
+
let groupLeftStopIndex = -1;
|
|
212
|
+
let groupTopStartIndex = -1;
|
|
213
|
+
let groupTopStopIndex = -1;
|
|
214
|
+
let color = '';
|
|
215
|
+
if(-1 !== startGroupIndex && -1 !== stopGroupIndex) {
|
|
216
|
+
groupName = groupTrim.substring(0, startGroupIndex);
|
|
217
|
+
const groupParameters = groupTrim.substring(startGroupIndex + 1, -1 !== stopGroupIndex ? stopGroupIndex : undefined).split(';');
|
|
218
|
+
if(5 <= groupParameters.length) {
|
|
219
|
+
color = groupParameters[4].trim();
|
|
220
|
+
}
|
|
221
|
+
if(4 <= groupParameters.length) {
|
|
222
|
+
const groupTopStopIndex_ = Number.parseInt(groupParameters[3].trim());
|
|
223
|
+
if(!Number.isNaN(groupTopStopIndex_)) {
|
|
224
|
+
groupTopStopIndex = groupTopStopIndex_;
|
|
225
|
+
}
|
|
226
|
+
const groupTopStartIndex_ = Number.parseInt(groupParameters[2].trim());
|
|
227
|
+
if(!Number.isNaN(groupTopStartIndex_)) {
|
|
228
|
+
groupTopStartIndex = groupTopStartIndex_;
|
|
229
|
+
}
|
|
230
|
+
const groupLeftStopIndex_ = Number.parseInt(groupParameters[1].trim());
|
|
231
|
+
if(!Number.isNaN(groupLeftStopIndex_)) {
|
|
232
|
+
groupLeftStopIndex = groupLeftStopIndex_;
|
|
233
|
+
}
|
|
234
|
+
const groupLeftStartIndex_ = Number.parseInt(groupParameters[0].trim());
|
|
235
|
+
if(!Number.isNaN(groupLeftStartIndex_)) {
|
|
236
|
+
groupLeftStartIndex = groupLeftStartIndex_;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
dataNodeDiagram.addGroup(new DataNodeDiagramGroup(groupName, groupLeftStartIndex, groupLeftStopIndex, groupTopStartIndex, groupTopStopIndex, color));
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
else if(trimRow.startsWith('Config')) {
|
|
246
|
+
const start = trimRow.indexOf('(', 0);
|
|
247
|
+
if(-1 === start) {
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
const stop = trimRow.indexOf(')', start + 1);
|
|
251
|
+
const configParameters = trimRow.substring(start + 1, -1 !== stop ? stop : undefined).split(',');
|
|
252
|
+
if(null !== configParameters) {
|
|
253
|
+
const config = {};
|
|
254
|
+
configParameters.forEach((configParameter) => {
|
|
255
|
+
const parameters = configParameter.split(':');
|
|
256
|
+
if(2 === parameters.length) {
|
|
257
|
+
const parameterName = parameters[0].trim();
|
|
258
|
+
const parameterValue = parameters[1].trim();
|
|
259
|
+
const numberValue = Number.parseInt(parameterValue);
|
|
260
|
+
if(!Number.isNaN(numberValue)) {
|
|
261
|
+
dataNodeDiagram.addConfig(parameterName, numberValue);
|
|
262
|
+
}
|
|
263
|
+
else if('true' === parameterValue) {
|
|
264
|
+
dataNodeDiagram.addConfig(parameterName, true);
|
|
265
|
+
}
|
|
266
|
+
else if('false' === parameterValue) {
|
|
267
|
+
dataNodeDiagram.addConfig(parameterName, false);
|
|
268
|
+
}
|
|
269
|
+
else {
|
|
270
|
+
dataNodeDiagram.addConfig(parameterName, parameterValue);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
else {
|
|
277
|
+
let type = '';
|
|
278
|
+
let fromPosition = '';
|
|
279
|
+
let toPosition = '';
|
|
280
|
+
let data = '';
|
|
281
|
+
let slope;
|
|
282
|
+
let typeStartIndex = trimRow.indexOf('[');
|
|
283
|
+
let typeStopIndex = trimRow.indexOf(']');
|
|
284
|
+
if(-1 !== typeStartIndex && -1 !== typeStopIndex) {
|
|
285
|
+
const types = trimRow.slice(typeStartIndex + 1, typeStopIndex).split(',');
|
|
286
|
+
if(null !== types) {
|
|
287
|
+
if(1 <= types.length) {
|
|
288
|
+
type = types[0].trim();
|
|
289
|
+
}
|
|
290
|
+
if(2 <= types.length) {
|
|
291
|
+
fromPosition = types[1].trim();
|
|
292
|
+
}
|
|
293
|
+
if(3 <= types.length) {
|
|
294
|
+
toPosition = types[2].trim();
|
|
295
|
+
}
|
|
296
|
+
if(4 <= types.length) {
|
|
297
|
+
const slope_ = types[3].trim();
|
|
298
|
+
slope = slope_ === 'true' ? true : (slope_ === 'false') ? false : undefined;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
const dataIndex = trimRow.indexOf(':');
|
|
303
|
+
if(-1 !== dataIndex) {
|
|
304
|
+
data = trimRow.substring(dataIndex + 1, trimRow.length).trim();
|
|
305
|
+
}
|
|
306
|
+
const connectionType = this._parseConnectionType(trimRow);
|
|
307
|
+
if(null !== connectionType) {
|
|
308
|
+
const from = trimRow.substring(0, connectionType.index).trim();
|
|
309
|
+
const to = trimRow.substring(connectionType.index + connectionType.size, typeStartIndex).trim();
|
|
310
|
+
const fromNode = this._getNodeFromName(dataNodeDiagram, from);
|
|
311
|
+
const toNode = this._getNodeFromName(dataNodeDiagram, to);
|
|
312
|
+
if(null !== fromNode && null !== toNode) {
|
|
313
|
+
dataNodeDiagram.addConnection(new DataNodeDiagramConnection(data, type, connectionType.type, fromNode, toNode, fromPosition, toPosition, slope));
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
_getRows(markup) {
|
|
320
|
+
let parsedXml = null;
|
|
321
|
+
const xmls = markup.match(/<[^>]+>|\+/g);
|
|
322
|
+
if(null !== xmls) {
|
|
323
|
+
if(1 === xmls.length) {
|
|
324
|
+
parsedXml = xmls[0];
|
|
325
|
+
}
|
|
326
|
+
else {
|
|
327
|
+
const start = markup.indexOf(xmls[0]);
|
|
328
|
+
const lastXml = xmls[xmls.length - 1];
|
|
329
|
+
const stop = markup.lastIndexOf(lastXml);
|
|
330
|
+
parsedXml = markup.substring(start, stop + lastXml.length);
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
let index = 0;
|
|
334
|
+
let nextIndex = 0;
|
|
335
|
+
let rows = [];
|
|
336
|
+
let length = markup.length;
|
|
337
|
+
while(index < length) {
|
|
338
|
+
nextIndex = markup.indexOf('\n', index);
|
|
339
|
+
if(-1 !== nextIndex) {
|
|
340
|
+
rows.push(markup.substring(index, nextIndex).trim());
|
|
341
|
+
index = nextIndex + 1;
|
|
342
|
+
}
|
|
343
|
+
else {
|
|
344
|
+
rows.push(markup.substring(index, length).trim());
|
|
345
|
+
index = length;
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
return {
|
|
349
|
+
rows: rows,
|
|
350
|
+
xml: parsedXml
|
|
351
|
+
};
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
_stringifyConnectionType(connection) {
|
|
355
|
+
for(let i = 0; i < MarkupNodeDiagram.CONNECTION.length; ++i) {
|
|
356
|
+
if(MarkupNodeDiagram.CONNECTION[i].type === connection.connectionType) {
|
|
357
|
+
return MarkupNodeDiagram.CONNECTION[i].sign;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
_parseConnectionType(row) {
|
|
363
|
+
for(let i = 0; i < MarkupNodeDiagram.CONNECTION.length; ++i) {
|
|
364
|
+
const index = row.indexOf(MarkupNodeDiagram.CONNECTION[i].sign);
|
|
365
|
+
if(-1 !== index) {
|
|
366
|
+
return {
|
|
367
|
+
sign: MarkupNodeDiagram.CONNECTION[i].sign,
|
|
368
|
+
type: MarkupNodeDiagram.CONNECTION[i].type,
|
|
369
|
+
size: MarkupNodeDiagram.CONNECTION[i].sign.length,
|
|
370
|
+
index: index
|
|
371
|
+
};
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
return null;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
_getNodeFromName(dataNodeDiagram, nodeName) {
|
|
378
|
+
for(let i = 0; i < dataNodeDiagram.nodeRows.length; ++i) {
|
|
379
|
+
for(let j = 0; j < dataNodeDiagram.nodeRows[i].length; ++j) {
|
|
380
|
+
if(dataNodeDiagram.nodeRows[i][j].name === nodeName) {
|
|
381
|
+
return dataNodeDiagram.nodeRows[i][j];
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
return null;
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
MarkupNodeDiagram.TAG_TITLE = 'Title:';
|
|
390
|
+
MarkupNodeDiagram.TAG_TITLE_LENGTH = MarkupNodeDiagram.TAG_TITLE.length;
|
|
391
|
+
MarkupNodeDiagram.START = -1;
|
|
392
|
+
MarkupNodeDiagram.OPENED = -2;
|
|
393
|
+
MarkupNodeDiagram.CLOSED = -3;
|
|
394
|
+
MarkupNodeDiagram.COMMA = -4;
|
|
395
|
+
MarkupNodeDiagram.FOUND_TYPE = 0;
|
|
396
|
+
MarkupNodeDiagram.FOUND_INDEX = 1;
|
|
397
|
+
MarkupNodeDiagram.END = 10000;
|
|
398
|
+
|
|
399
|
+
MarkupNodeDiagram.CONNECTION = [
|
|
400
|
+
{
|
|
401
|
+
sign: '=>',
|
|
402
|
+
type: 'normal'
|
|
403
|
+
},
|
|
404
|
+
{
|
|
405
|
+
sign: '<=>',
|
|
406
|
+
type: 'normal-bi-directional'
|
|
407
|
+
},
|
|
408
|
+
{
|
|
409
|
+
sign: '<=',
|
|
410
|
+
type: 'normal-reverse'
|
|
411
|
+
},
|
|
412
|
+
{
|
|
413
|
+
sign: '->',
|
|
414
|
+
type: 'part'
|
|
415
|
+
},
|
|
416
|
+
{
|
|
417
|
+
sign: '<->',
|
|
418
|
+
type: 'part-bi-directional'
|
|
419
|
+
},
|
|
420
|
+
{
|
|
421
|
+
sign: '<-',
|
|
422
|
+
type: 'part-reverse'
|
|
423
|
+
},
|
|
424
|
+
{
|
|
425
|
+
sign: '-o',
|
|
426
|
+
type: 'connect'
|
|
427
|
+
},
|
|
428
|
+
{
|
|
429
|
+
sign: '-x',
|
|
430
|
+
type: 'disconnect'
|
|
431
|
+
}
|
|
432
|
+
];
|
|
433
|
+
|
|
434
|
+
|
|
435
|
+
module.exports = new MarkupNodeDiagram();
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class MarkupParseHelper {
|
|
6
|
+
getRows(markup) {
|
|
7
|
+
let index = 0;
|
|
8
|
+
let nextIndex = 0;
|
|
9
|
+
let rows = [];
|
|
10
|
+
let length = markup.length;
|
|
11
|
+
while(index < length) {
|
|
12
|
+
nextIndex = markup.indexOf('\n', index);
|
|
13
|
+
if(-1 !== nextIndex) {
|
|
14
|
+
rows.push(markup.substring(index, nextIndex));
|
|
15
|
+
index = nextIndex + 1;
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
rows.push(markup.substring(index, length));
|
|
19
|
+
index = length;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return rows;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
module.exports = new MarkupParseHelper();
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class MarkupPatternConfig {
|
|
6
|
+
stringify(config) {
|
|
7
|
+
let stringified = '';
|
|
8
|
+
const keys = Object.keys(config);
|
|
9
|
+
stringified += 'Config(';
|
|
10
|
+
if(1 <= keys.length) {
|
|
11
|
+
stringified += `${keys[0]}: ${config[keys[0]]}`;
|
|
12
|
+
for(let i = 1; i < keys.length; ++i) {
|
|
13
|
+
stringified += `, ${keys[i]}: ${config[keys[i]]}`;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
stringified += ')\n\n';
|
|
17
|
+
return stringified;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
parse(markup, parent) {
|
|
21
|
+
const start = markup.indexOf('(', 0);
|
|
22
|
+
if(-1 === start) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
const stop = markup.indexOf(')', start + 1);
|
|
26
|
+
const configParameters = markup.substring(start + 1, -1 !== stop ? stop : undefined).split(',');
|
|
27
|
+
if(null !== configParameters) {
|
|
28
|
+
const config = {};
|
|
29
|
+
configParameters.forEach((configParameter) => {
|
|
30
|
+
const parameters = configParameter.split(':');
|
|
31
|
+
if(2 === parameters.length) {
|
|
32
|
+
const parameterName = parameters[0].trim();
|
|
33
|
+
const parameterValue = parameters[1].trim();
|
|
34
|
+
const numberValue = Number.parseInt(parameterValue);
|
|
35
|
+
if(!Number.isNaN(numberValue)) {
|
|
36
|
+
parent.addConfig(parameterName, numberValue);
|
|
37
|
+
}
|
|
38
|
+
else if('true' === parameterValue) {
|
|
39
|
+
parent.addConfig(parameterName, true);
|
|
40
|
+
}
|
|
41
|
+
else if('false' === parameterValue) {
|
|
42
|
+
parent.addConfig(parameterName, false);
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
parent.addConfig(parameterName, parameterValue);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
module.exports = new MarkupPatternConfig();
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const DataData = require('../data/data-data');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class MarkupPatternData {
|
|
8
|
+
stringify(datas) {
|
|
9
|
+
let stringified = '';
|
|
10
|
+
datas.forEach((data, key) => {
|
|
11
|
+
stringified += `${key}`;
|
|
12
|
+
data.datas.forEach((d) => {
|
|
13
|
+
stringified += `[${d}]`;
|
|
14
|
+
});
|
|
15
|
+
stringified += '\n';
|
|
16
|
+
});
|
|
17
|
+
return stringified;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
parse(markup, dataParent, numberType = 'int') {
|
|
21
|
+
let index = 0;
|
|
22
|
+
const startData = markup.indexOf('[');
|
|
23
|
+
if(-1 === startData) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const name = markup.substring(0, startData);
|
|
27
|
+
let data = dataParent.getData(name);
|
|
28
|
+
if(undefined === data) {
|
|
29
|
+
data = new DataData(name, numberType);
|
|
30
|
+
dataParent.addData(name, data);
|
|
31
|
+
}
|
|
32
|
+
while(true) {
|
|
33
|
+
const startData = markup.indexOf('[', index);
|
|
34
|
+
if(-1 === startData) {
|
|
35
|
+
break;
|
|
36
|
+
}
|
|
37
|
+
const stopData = markup.indexOf(']', startData + 1);
|
|
38
|
+
const parameters = markup.substring(startData + 1, -1 !== stopData ? stopData : undefined).split(',');
|
|
39
|
+
data.addData(...parameters);
|
|
40
|
+
if(-1 === stopData) {
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
index = stopData;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
module.exports = new MarkupPatternData();
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
|
|
2
|
+
const DataData = require('../data/data-data');
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class MarkupPatternFunction {
|
|
6
|
+
stringify(name, parameterObjects, separationWord = ',', startWord = '(', stopWord = ')') {
|
|
7
|
+
let stringified = '';
|
|
8
|
+
const objects = Array.isArray(parameterObjects) ? parameterObjects : [parameterObjects];
|
|
9
|
+
for(let i = 0; i < objects.length; ++i) {
|
|
10
|
+
stringified += `${name}${startWord}`;
|
|
11
|
+
const object = objects[i];
|
|
12
|
+
const keys = Object.keys(object);
|
|
13
|
+
if(1 <= keys.length) {
|
|
14
|
+
stringified += `${object[keys[0]]}`;
|
|
15
|
+
for(let i = 1; i < keys.length; ++i) {
|
|
16
|
+
stringified += `${separationWord} ${object[keys[i]]}`;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
stringified += `${stopWord}\n`;
|
|
20
|
+
}
|
|
21
|
+
stringified += '\n';
|
|
22
|
+
return stringified;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
parse(markup, parametersCb, separationWord = ',', startWord = '(', stopWord = ')') {
|
|
26
|
+
let index = 0;
|
|
27
|
+
const startWordLength = startWord.length;
|
|
28
|
+
const stopWordLength = stopWord.length;
|
|
29
|
+
while(true) {
|
|
30
|
+
let start = markup.indexOf(startWord, index);
|
|
31
|
+
if(-1 === start) {
|
|
32
|
+
break;
|
|
33
|
+
}
|
|
34
|
+
start += startWordLength;
|
|
35
|
+
const stop = markup.indexOf(stopWord, start);
|
|
36
|
+
if(-1 === stop) {
|
|
37
|
+
break;
|
|
38
|
+
}
|
|
39
|
+
const parameters = markup.substring(start, stop).split(separationWord);
|
|
40
|
+
const trimParameters = parameters.map((parameter) => {return parameter.trim()});
|
|
41
|
+
parametersCb(...trimParameters);
|
|
42
|
+
index = stop + stopWordLength;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
module.exports = new MarkupPatternFunction();
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const DataReposContentLocal = require('../../data/data-repos/data-repos-content-local');
|
|
5
|
+
const DataReposDataLocal = require('../../data/data-repos/data-repos-data-local');
|
|
6
|
+
const MarkupTableKeyValue = require('../markup-table-key-value');
|
|
7
|
+
const MarkupTablesParser = require('../markup-tables-parser');
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class MarkupRepos {
|
|
11
|
+
stringify(dataReposContentLocal, dataReposDataLocal) {
|
|
12
|
+
return `\n${MarkupTableKeyValue.stringify(new DataReposContentLocal(), dataReposContentLocal, true)}\n\n${MarkupTableKeyValue.stringify(new DataReposDataLocal(), dataReposDataLocal, true)}\n`;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
parse(markup) {
|
|
16
|
+
let objectTables = MarkupTablesParser.parse(markup);
|
|
17
|
+
if(!objectTables.success) {
|
|
18
|
+
return {
|
|
19
|
+
success: false,
|
|
20
|
+
rows: objectTables.rows
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
success: true,
|
|
25
|
+
contentRepos: MarkupTableKeyValue.parse(DataReposContentLocal, objectTables.objects),
|
|
26
|
+
dataRepos: MarkupTableKeyValue.parse(DataReposDataLocal, objectTables.objects)
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
module.exports = MarkupRepos;
|