@cyklang/cli 0.12.1 → 0.14.0
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/asset/test/balance.xml +147 -0
- package/asset/test/hello_world.xml +44 -0
- package/asset/test/tableau.xml +92 -0
- package/build/AssetCommand.js +3 -5
- package/build/DBClient.js +5 -7
- package/build/index.js +1 -1
- package/package.json +4 -2
- package/run_test.sh +3 -0
- package/src/AssetCommand.ts +2 -4
- package/src/DBClient.ts +4 -7
- package/src/index.ts +1 -1
- package/test/db/t14.output +4 -4
- package/test/db/t21.output +2 -2
- package/test/db/t22.xml +16 -1
- package/test/db/t23.output +86 -0
- package/test/db/t23.xml +5 -0
- package/test/db/t33.xml +6 -0
- package/test/db/t_load_cache.sql +17 -0
- package/test/t04.output +2 -2
- package/test/t04.xml +1 -1
- package/test/t09.output +2 -2
- package/test/t26.output +2 -2
- package/test/t28.output +2 -2
- package/test/t31.output +2 -0
- package/test/t31.xml +8 -0
- package/test/t32.xml +61 -0
- package/test/t_report.xml +85 -0
- package/test/test.ts +3 -0
- /package/test/db/{t10.output → dbinit.output} +0 -0
- /package/test/db/{t10.xml → dbinit.xml} +0 -0
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
2
|
+
<xsl:stylesheet version="1.0"
|
|
3
|
+
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
|
4
|
+
xmlns:fo="http://www.w3.org/1999/XSL/Format"
|
|
5
|
+
xmlns:java="http://xml.apache.org/xslt/java" exclude-result-prefixes="java">
|
|
6
|
+
|
|
7
|
+
<xsl:template match="object[@name='resultset']">
|
|
8
|
+
|
|
9
|
+
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
|
|
10
|
+
<fo:layout-master-set>
|
|
11
|
+
<!-- Définition du layout -->
|
|
12
|
+
<fo:simple-page-master master-name="page" page-height="29.7cm" page-width="21cm" margin-left="1.5cm" margin-right="1.5cm" margin-top="0.5cm" margin-bottom="0.5cm">
|
|
13
|
+
<fo:region-body margin-top="3.5cm"/>
|
|
14
|
+
<fo:region-before extent="5cm"/>
|
|
15
|
+
</fo:simple-page-master>
|
|
16
|
+
</fo:layout-master-set>
|
|
17
|
+
|
|
18
|
+
<!-- Début du document -->
|
|
19
|
+
<fo:page-sequence master-reference="page">
|
|
20
|
+
<!-- En-tête de page -->
|
|
21
|
+
<fo:static-content flow-name="xsl-region-before">
|
|
22
|
+
<!-- cartouche d'entête -->
|
|
23
|
+
<fo:block>
|
|
24
|
+
<fo:table width="100%" table-layout="fixed" line-height="1.5" border="1pt solid black">
|
|
25
|
+
<fo:table-column column-width="4cm"/>
|
|
26
|
+
<fo:table-column column-width="proportional-column-width(1)"/>
|
|
27
|
+
<fo:table-column column-width="5cm"/>
|
|
28
|
+
<fo:table-body>
|
|
29
|
+
<fo:table-row border-bottom="1pt solid black" border-top="1pt solid black" font="8pt Helvetica" >
|
|
30
|
+
<fo:table-cell padding="5pt" >
|
|
31
|
+
<fo:block font-weight="bold" >Database Concept</fo:block>
|
|
32
|
+
<fo:block >12 ter chemin bois rouge</fo:block>
|
|
33
|
+
<fo:block></fo:block>
|
|
34
|
+
<fo:block>97490 Sainte-Clotilde</fo:block>
|
|
35
|
+
<fo:block>0692 87 79 45</fo:block>
|
|
36
|
+
</fo:table-cell>
|
|
37
|
+
<fo:table-cell padding="5pt" text-align="center" >
|
|
38
|
+
<fo:block font="14pt Helvetica" font-weight="bold">Balance complète</fo:block>
|
|
39
|
+
<fo:block font="10pt Helvetica">de: Janvier 2023 à: Décembre 2023</fo:block>
|
|
40
|
+
</fo:table-cell>
|
|
41
|
+
<fo:table-cell padding="5pt" >
|
|
42
|
+
<fo:table>
|
|
43
|
+
<fo:table-column column-width="1.5cm"/>
|
|
44
|
+
<fo:table-column column-width="proportional-column-width(1)"/>
|
|
45
|
+
<fo:table-body>
|
|
46
|
+
<fo:table-row>
|
|
47
|
+
<fo:table-cell>
|
|
48
|
+
<fo:block font-weight="bold">N° Siret</fo:block>
|
|
49
|
+
</fo:table-cell>
|
|
50
|
+
<fo:table-cell>
|
|
51
|
+
<fo:block>319412304560790</fo:block>
|
|
52
|
+
</fo:table-cell>
|
|
53
|
+
</fo:table-row>
|
|
54
|
+
<fo:table-row>
|
|
55
|
+
<fo:table-cell>
|
|
56
|
+
<fo:block font-weight="bold">Code APE</fo:block>
|
|
57
|
+
</fo:table-cell>
|
|
58
|
+
<fo:table-cell>
|
|
59
|
+
<fo:block>722Z</fo:block>
|
|
60
|
+
</fo:table-cell>
|
|
61
|
+
</fo:table-row>
|
|
62
|
+
<fo:table-row>
|
|
63
|
+
<fo:table-cell>
|
|
64
|
+
<fo:block font-weight="bold">Exercice</fo:block>
|
|
65
|
+
</fo:table-cell>
|
|
66
|
+
<fo:table-cell>
|
|
67
|
+
<fo:block>2023</fo:block>
|
|
68
|
+
</fo:table-cell>
|
|
69
|
+
</fo:table-row>
|
|
70
|
+
<fo:table-row>
|
|
71
|
+
<fo:table-cell>
|
|
72
|
+
<fo:block font-weight="bold">Début</fo:block>
|
|
73
|
+
</fo:table-cell>
|
|
74
|
+
<fo:table-cell>
|
|
75
|
+
<fo:block>01/01/2023</fo:block>
|
|
76
|
+
</fo:table-cell>
|
|
77
|
+
</fo:table-row>
|
|
78
|
+
<fo:table-row>
|
|
79
|
+
<fo:table-cell>
|
|
80
|
+
<fo:block font-weight="bold">Fin</fo:block>
|
|
81
|
+
</fo:table-cell>
|
|
82
|
+
<fo:table-cell>
|
|
83
|
+
<fo:block>31/12/2023</fo:block>
|
|
84
|
+
</fo:table-cell>
|
|
85
|
+
</fo:table-row>
|
|
86
|
+
</fo:table-body>
|
|
87
|
+
</fo:table>
|
|
88
|
+
</fo:table-cell>
|
|
89
|
+
</fo:table-row>
|
|
90
|
+
</fo:table-body>
|
|
91
|
+
</fo:table>
|
|
92
|
+
</fo:block>
|
|
93
|
+
|
|
94
|
+
<!-- Entête avec des rectangles -->
|
|
95
|
+
<fo:block>
|
|
96
|
+
<fo:table width="100%" table-layout="fixed">
|
|
97
|
+
<fo:table-column column-width="proportional-column-width(1)"/>
|
|
98
|
+
<fo:table-column column-width="proportional-column-width(1)"/>
|
|
99
|
+
<fo:table-body>
|
|
100
|
+
<fo:table-row border-bottom="1pt solid black" border-top="1pt solid black" font="8pt Helvetica" font-weight="bold">
|
|
101
|
+
<fo:table-cell padding="5pt" >
|
|
102
|
+
<fo:block>First Name</fo:block>
|
|
103
|
+
</fo:table-cell>
|
|
104
|
+
<fo:table-cell padding="5pt" >
|
|
105
|
+
<fo:block>Last Name</fo:block>
|
|
106
|
+
</fo:table-cell>
|
|
107
|
+
|
|
108
|
+
</fo:table-row>
|
|
109
|
+
</fo:table-body>
|
|
110
|
+
</fo:table>
|
|
111
|
+
</fo:block>
|
|
112
|
+
</fo:static-content>
|
|
113
|
+
|
|
114
|
+
<!-- Corps de la page -->
|
|
115
|
+
<fo:flow flow-name="xsl-region-body">
|
|
116
|
+
<!-- Tableau de données -->
|
|
117
|
+
<fo:block >
|
|
118
|
+
<fo:table width="100%" table-layout="fixed" font="8pt Helvetica">
|
|
119
|
+
<fo:table-column column-width="proportional-column-width(1)"/>
|
|
120
|
+
<fo:table-column column-width="proportional-column-width(1)"/>
|
|
121
|
+
<!-- Ajoutez autant de colonnes que nécessaire-->
|
|
122
|
+
<fo:table-body>
|
|
123
|
+
<!-- Lignes de données -->
|
|
124
|
+
<xsl:apply-templates select="object[@type='t__t_actor']"/>
|
|
125
|
+
</fo:table-body>
|
|
126
|
+
</fo:table>
|
|
127
|
+
</fo:block>
|
|
128
|
+
</fo:flow>
|
|
129
|
+
</fo:page-sequence>
|
|
130
|
+
</fo:root>
|
|
131
|
+
|
|
132
|
+
</xsl:template>
|
|
133
|
+
|
|
134
|
+
<xsl:template match="/object/object[@name='resultset']/object[@type='t__t_actor']">
|
|
135
|
+
<fo:table-row border-bottom="1pt solid black" border-top="1pt solid black">
|
|
136
|
+
<fo:table-cell padding="5pt" >
|
|
137
|
+
<fo:block ><xsl:apply-templates select="string[@name='first_name']"/></fo:block>
|
|
138
|
+
</fo:table-cell>
|
|
139
|
+
<fo:table-cell padding="5pt" >
|
|
140
|
+
<fo:block><xsl:apply-templates select="string[@name='last_name']"/></fo:block>
|
|
141
|
+
</fo:table-cell>
|
|
142
|
+
<!-- Ajoutez autant de cellules que nécessaire -->
|
|
143
|
+
</fo:table-row>
|
|
144
|
+
<xsl:apply-templates/>
|
|
145
|
+
</xsl:template>
|
|
146
|
+
|
|
147
|
+
</xsl:stylesheet>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
2
|
+
<xsl:stylesheet version="1.0"
|
|
3
|
+
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
|
4
|
+
xmlns:fo="http://www.w3.org/1999/XSL/Format"
|
|
5
|
+
xmlns:java="http://xml.apache.org/xslt/java" exclude-result-prefixes="java">
|
|
6
|
+
|
|
7
|
+
<xsl:template match="root">
|
|
8
|
+
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
|
|
9
|
+
<!-- Modèle de pages -->
|
|
10
|
+
<fo:layout-master-set>
|
|
11
|
+
<fo:simple-page-master master-name="A4" page-width="210mm" page-height="297mm" margin="1cm">
|
|
12
|
+
<!-- Région principale -->
|
|
13
|
+
<fo:region-body margin="2cm"/>
|
|
14
|
+
<!-- Tête de page aka header -->
|
|
15
|
+
<fo:region-before extent="1cm"/>
|
|
16
|
+
<!-- Pied de page aka footer -->
|
|
17
|
+
<fo:region-after extent="1cm"/>
|
|
18
|
+
</fo:simple-page-master>
|
|
19
|
+
</fo:layout-master-set>
|
|
20
|
+
<!-- Contenus -->
|
|
21
|
+
<fo:page-sequence master-reference="A4">
|
|
22
|
+
<!-- Contenu de la tête de page -->
|
|
23
|
+
<fo:static-content flow-name="xsl-region-before">
|
|
24
|
+
<fo:block text-align="center">XSL-FO <xsl:apply-templates/>
|
|
25
|
+
Document Example Root</fo:block>
|
|
26
|
+
</fo:static-content>
|
|
27
|
+
<!-- Contenu du pied de page : numéro de la page -->
|
|
28
|
+
<fo:static-content flow-name="xsl-region-after">
|
|
29
|
+
<fo:block text-align="center">- <fo:page-number/>
|
|
30
|
+
-</fo:block>
|
|
31
|
+
</fo:static-content>
|
|
32
|
+
<!-- Contenu de la partie centrale -->
|
|
33
|
+
<fo:flow flow-name="xsl-region-body">
|
|
34
|
+
<fo:block text-align="center" font="32pt Times" border="black solid thick">
|
|
35
|
+
<xsl:apply-templates/>
|
|
36
|
+
</fo:block>
|
|
37
|
+
</fo:flow>
|
|
38
|
+
</fo:page-sequence>
|
|
39
|
+
</fo:root>
|
|
40
|
+
</xsl:template>
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
</xsl:stylesheet>
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
2
|
+
<xsl:stylesheet version="1.0"
|
|
3
|
+
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
|
4
|
+
xmlns:fo="http://www.w3.org/1999/XSL/Format"
|
|
5
|
+
xmlns:java="http://xml.apache.org/xslt/java" exclude-result-prefixes="java">
|
|
6
|
+
|
|
7
|
+
<xsl:template match="object[@name='resultset']">
|
|
8
|
+
|
|
9
|
+
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
|
|
10
|
+
<fo:layout-master-set>
|
|
11
|
+
<!-- Définition du layout -->
|
|
12
|
+
<fo:simple-page-master master-name="page" page-height="29.7cm" page-width="21cm" margin="1.5cm">
|
|
13
|
+
<fo:region-body margin-top="2cm"/>
|
|
14
|
+
<fo:region-before extent="4cm"/>
|
|
15
|
+
</fo:simple-page-master>
|
|
16
|
+
</fo:layout-master-set>
|
|
17
|
+
|
|
18
|
+
<!-- Début du document -->
|
|
19
|
+
<fo:page-sequence master-reference="page">
|
|
20
|
+
<!-- En-tête de page -->
|
|
21
|
+
<fo:static-content flow-name="xsl-region-before">
|
|
22
|
+
<fo:block>
|
|
23
|
+
<fo:table width="100%" table-layout="fixed">
|
|
24
|
+
<fo:table-column column-width="proportional-column-width(1)"/>
|
|
25
|
+
<fo:table-column column-width="proportional-column-width(1)"/>
|
|
26
|
+
<fo:table-body>
|
|
27
|
+
<fo:table-row border-bottom="1pt solid black" border-top="1pt solid black" font="8pt Helvetica" font-weight="bold">
|
|
28
|
+
<fo:table-cell background-color="lightgray" padding="5pt" >
|
|
29
|
+
<fo:block>First Name</fo:block>
|
|
30
|
+
</fo:table-cell>
|
|
31
|
+
<fo:table-cell background-color="lightgray" padding="5pt" >
|
|
32
|
+
<fo:block>Last Name</fo:block>
|
|
33
|
+
</fo:table-cell>
|
|
34
|
+
<!-- Ajoutez autant de colonnes que nécessaire -->
|
|
35
|
+
</fo:table-row>
|
|
36
|
+
</fo:table-body>
|
|
37
|
+
</fo:table>
|
|
38
|
+
</fo:block>
|
|
39
|
+
<!-- Entête avec des rectangles -->
|
|
40
|
+
<fo:block>
|
|
41
|
+
<fo:table width="100%" table-layout="fixed">
|
|
42
|
+
<fo:table-column column-width="proportional-column-width(1)"/>
|
|
43
|
+
<fo:table-column column-width="proportional-column-width(1)"/>
|
|
44
|
+
<fo:table-body>
|
|
45
|
+
<fo:table-row border-bottom="1pt solid black" border-top="1pt solid black" font="8pt Helvetica" font-weight="bold">
|
|
46
|
+
<fo:table-cell background-color="lightgray" padding="5pt" >
|
|
47
|
+
<fo:block>First Name</fo:block>
|
|
48
|
+
</fo:table-cell>
|
|
49
|
+
<fo:table-cell background-color="lightgray" padding="5pt" >
|
|
50
|
+
<fo:block>Last Name</fo:block>
|
|
51
|
+
</fo:table-cell>
|
|
52
|
+
<!-- Ajoutez autant de colonnes que nécessaire -->
|
|
53
|
+
</fo:table-row>
|
|
54
|
+
</fo:table-body>
|
|
55
|
+
</fo:table>
|
|
56
|
+
</fo:block>
|
|
57
|
+
</fo:static-content>
|
|
58
|
+
|
|
59
|
+
<!-- Corps de la page -->
|
|
60
|
+
<fo:flow flow-name="xsl-region-body">
|
|
61
|
+
<!-- Tableau de données -->
|
|
62
|
+
<fo:block >
|
|
63
|
+
<fo:table width="100%" table-layout="fixed" font="8pt Helvetica">
|
|
64
|
+
<fo:table-column column-width="proportional-column-width(1)"/>
|
|
65
|
+
<fo:table-column column-width="proportional-column-width(1)"/>
|
|
66
|
+
<!-- Ajoutez autant de colonnes que nécessaire-->
|
|
67
|
+
<fo:table-body>
|
|
68
|
+
<!-- Lignes de données -->
|
|
69
|
+
<xsl:apply-templates select="object[@type='t__t_actor']"/>
|
|
70
|
+
</fo:table-body>
|
|
71
|
+
</fo:table>
|
|
72
|
+
</fo:block>
|
|
73
|
+
</fo:flow>
|
|
74
|
+
</fo:page-sequence>
|
|
75
|
+
</fo:root>
|
|
76
|
+
|
|
77
|
+
</xsl:template>
|
|
78
|
+
|
|
79
|
+
<xsl:template match="/object/object[@name='resultset']/object[@type='t__t_actor']">
|
|
80
|
+
<fo:table-row border-bottom="1pt solid black" border-top="1pt solid black">
|
|
81
|
+
<fo:table-cell padding="5pt" >
|
|
82
|
+
<fo:block ><xsl:apply-templates select="string[@name='first_name']"/></fo:block>
|
|
83
|
+
</fo:table-cell>
|
|
84
|
+
<fo:table-cell padding="5pt" >
|
|
85
|
+
<fo:block><xsl:apply-templates select="string[@name='last_name']"/></fo:block>
|
|
86
|
+
</fo:table-cell>
|
|
87
|
+
<!-- Ajoutez autant de cellules que nécessaire -->
|
|
88
|
+
</fo:table-row>
|
|
89
|
+
<xsl:apply-templates/>
|
|
90
|
+
</xsl:template>
|
|
91
|
+
|
|
92
|
+
</xsl:stylesheet>
|
package/build/AssetCommand.js
CHANGED
|
@@ -51,11 +51,9 @@ const scanAssets = async (dbManager, dest) => {
|
|
|
51
51
|
dbReq.selectFromTable = 'cyk_asset';
|
|
52
52
|
const pFields = dbReq.parameters.addVariable('fields', dbManager.scope.structure.stringDataType);
|
|
53
53
|
pFields.data = new core_1.PrimitiveData(dbManager.scope.structure.stringDataType, "asset_id,asset_route,asset_last_update,asset_mimetype");
|
|
54
|
-
const
|
|
55
|
-
if (
|
|
56
|
-
throw '
|
|
57
|
-
const tag = (0, core_1.parseXML)('scanAssets', xmlResult);
|
|
58
|
-
const objResult = await dbManager.scope.structure.objectDataType.parseData(tag, dbManager.scope);
|
|
54
|
+
const objResult = await dbManager.dbExecute(dbReq);
|
|
55
|
+
if (!objResult)
|
|
56
|
+
throw 'objResult undefined';
|
|
59
57
|
const rows = objResult.variables.getData('resultset').variables;
|
|
60
58
|
for (let ind = 0; ind < rows.list.length; ind++) {
|
|
61
59
|
const { variable: row } = rows.list[ind];
|
package/build/DBClient.js
CHANGED
|
@@ -74,12 +74,10 @@ class DBClient {
|
|
|
74
74
|
// request.parameters.addVariable(key, stringDataType).data = data
|
|
75
75
|
// })
|
|
76
76
|
// }
|
|
77
|
-
const
|
|
78
|
-
if (
|
|
79
|
-
throw '
|
|
80
|
-
const
|
|
81
|
-
const objXmlResult = (await objectDataType.parseData(tagXmlResult, this.dbManager.scope));
|
|
82
|
-
const metaObject = (objXmlResult.variables.getData('meta'));
|
|
77
|
+
const objResult = await this.dbManager.dbExecute(request);
|
|
78
|
+
if (!objResult)
|
|
79
|
+
throw 'objResult undefined';
|
|
80
|
+
const metaObject = (objResult.variables.getData('meta'));
|
|
83
81
|
if (metaObject === undefined)
|
|
84
82
|
throw 'objectMeta not found';
|
|
85
83
|
const typeObject = metaObject.variables.getData('resultset');
|
|
@@ -99,7 +97,7 @@ class DBClient {
|
|
|
99
97
|
throw 'field ' + field + ' not found';
|
|
100
98
|
list.addDBColumn(dbColumn);
|
|
101
99
|
}
|
|
102
|
-
const objDataset =
|
|
100
|
+
const objDataset = objResult.variables.getData('resultset');
|
|
103
101
|
for (let ind = 0; ind < objDataset.variables.length(); ind++) {
|
|
104
102
|
const variable = objDataset.variables.at(ind);
|
|
105
103
|
if (variable) {
|
package/build/index.js
CHANGED
|
@@ -182,7 +182,7 @@ class StopCommand extends commander_1.Command {
|
|
|
182
182
|
*/
|
|
183
183
|
const program = new commander_1.Command();
|
|
184
184
|
program.name('cyk').description('cyklang CLI')
|
|
185
|
-
.version('0.
|
|
185
|
+
.version('0.14.0');
|
|
186
186
|
program.addCommand(new StartCommand('start'));
|
|
187
187
|
program.addCommand(new StopCommand('stop'));
|
|
188
188
|
program.addCommand(new InstallCommand_1.InstallCommand('install'));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cyklang/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"description": "cyklang CLI",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -11,13 +11,15 @@
|
|
|
11
11
|
"npm:upgrade": "npx npm-check-updates -iu",
|
|
12
12
|
"refresh": "rm -rf ./node_modules ./package-lock.json && npm install",
|
|
13
13
|
"dev": "nodemon -e ts --ignore build --exec \"npm run global\" ",
|
|
14
|
+
"asset:upload": "cyk asset upload -d / -y asset",
|
|
15
|
+
"asset:dev": "nodemon --watch asset --ext xml --exec \"npm run asset:upload \" ",
|
|
14
16
|
"test": "./run_test.sh"
|
|
15
17
|
},
|
|
16
18
|
"keywords": [],
|
|
17
19
|
"author": "",
|
|
18
20
|
"license": "ISC",
|
|
19
21
|
"dependencies": {
|
|
20
|
-
"@cyklang/core": "^0.
|
|
22
|
+
"@cyklang/core": "^0.11.0",
|
|
21
23
|
"commander": "^9.4.0",
|
|
22
24
|
"dotenv": "^16.0.1",
|
|
23
25
|
"form-data": "^4.0.0",
|
package/run_test.sh
CHANGED
package/src/AssetCommand.ts
CHANGED
|
@@ -26,10 +26,8 @@ const scanAssets = async (dbManager: DBManager | undefined, dest?: string): Prom
|
|
|
26
26
|
dbReq.selectFromTable = 'cyk_asset'
|
|
27
27
|
const pFields = dbReq.parameters.addVariable('fields', dbManager.scope.structure.stringDataType)
|
|
28
28
|
pFields.data = new PrimitiveData(dbManager.scope.structure.stringDataType, "asset_id,asset_route,asset_last_update,asset_mimetype")
|
|
29
|
-
const
|
|
30
|
-
if (
|
|
31
|
-
const tag = parseXML('scanAssets', xmlResult)
|
|
32
|
-
const objResult = await dbManager.scope.structure.objectDataType.parseData(tag, dbManager.scope) as ObjectData
|
|
29
|
+
const objResult = await dbManager.dbExecute(dbReq)
|
|
30
|
+
if (!objResult) throw 'objResult undefined'
|
|
33
31
|
const rows = (objResult.variables.getData('resultset') as ObjectData).variables
|
|
34
32
|
for (let ind = 0; ind < rows.list.length; ind++) {
|
|
35
33
|
const { variable: row } = rows.list[ind]
|
package/src/DBClient.ts
CHANGED
|
@@ -79,12 +79,9 @@ export class DBClient {
|
|
|
79
79
|
// })
|
|
80
80
|
// }
|
|
81
81
|
|
|
82
|
-
const
|
|
83
|
-
if (
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
const objXmlResult = (await objectDataType.parseData(tagXmlResult, this.dbManager.scope)) as ObjectData
|
|
87
|
-
const metaObject = (objXmlResult.variables.getData('meta')) as ObjectData
|
|
82
|
+
const objResult = await this.dbManager.dbExecute(request)
|
|
83
|
+
if (!objResult) throw 'objResult undefined'
|
|
84
|
+
const metaObject = (objResult.variables.getData('meta')) as ObjectData
|
|
88
85
|
if (metaObject === undefined) throw 'objectMeta not found'
|
|
89
86
|
const typeObject = metaObject.variables.getData('resultset')
|
|
90
87
|
if (!typeObject || typeObject === null) throw 'meta resultset not found'
|
|
@@ -102,7 +99,7 @@ export class DBClient {
|
|
|
102
99
|
list.addDBColumn(dbColumn)
|
|
103
100
|
}
|
|
104
101
|
|
|
105
|
-
const objDataset =
|
|
102
|
+
const objDataset = objResult.variables.getData('resultset') as ObjectData
|
|
106
103
|
for (let ind = 0; ind < objDataset.variables.length(); ind++) {
|
|
107
104
|
const variable = objDataset.variables.at(ind)
|
|
108
105
|
if (variable) {
|
package/src/index.ts
CHANGED
|
@@ -176,7 +176,7 @@ class StopCommand extends Command {
|
|
|
176
176
|
*/
|
|
177
177
|
const program = new Command()
|
|
178
178
|
program.name('cyk').description('cyklang CLI')
|
|
179
|
-
.version('0.
|
|
179
|
+
.version('0.14.0')
|
|
180
180
|
program.addCommand(new StartCommand('start'))
|
|
181
181
|
program.addCommand(new StopCommand('stop'))
|
|
182
182
|
program.addCommand(new InstallCommand('install'))
|
package/test/db/t14.output
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
obj2 <object name="selected">
|
|
2
2
|
</object>
|
|
3
3
|
<string name="command" literal="">new</string>
|
|
4
|
-
undefined =
|
|
4
|
+
undefined =
|
|
5
5
|
actor <string name="actor_id">
|
|
6
6
|
</string>
|
|
7
7
|
<string name="first_name">
|
|
8
8
|
</string>
|
|
9
9
|
========
|
|
10
|
-
|
|
10
|
+
|
|
11
11
|
--------
|
|
12
12
|
condition actor.actor_id == undefined is true
|
|
13
|
-
|
|
14
|
-
actor.actor_id ==
|
|
13
|
+
|
|
14
|
+
actor.actor_id ==
|
|
15
15
|
========= TEST OF COPY =======
|
|
16
16
|
init copie with source.copy()
|
|
17
17
|
copie first first orig, second second orig
|
package/test/db/t21.output
CHANGED
|
@@ -7,14 +7,14 @@ owner yves not in the collection
|
|
|
7
7
|
john's car's brand is BMW
|
|
8
8
|
bool : false
|
|
9
9
|
chaine : 150
|
|
10
|
-
<datetime name="dtbirthday">datetime("
|
|
10
|
+
<datetime name="dtbirthday">datetime("1963-11-04 04:00:00 GMT+0400")</datetime>
|
|
11
11
|
<datetime name="dtundef1">
|
|
12
12
|
</datetime>
|
|
13
13
|
<datetime name="dtundef2">
|
|
14
14
|
</datetime>
|
|
15
15
|
<datetime name="dtnull1">
|
|
16
16
|
</datetime>
|
|
17
|
-
<datetime name="dtbirthday">datetime("
|
|
17
|
+
<datetime name="dtbirthday">datetime("1963-11-04 04:00:00 GMT+0400")</datetime>
|
|
18
18
|
<datetime name="dtundef1">
|
|
19
19
|
</datetime>
|
|
20
20
|
<datetime name="dtundef2">
|
package/test/db/t22.xml
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
<string name="surname">"Philippe"</string>
|
|
13
13
|
<object name="t_actor">result_t_actor.resultset</object>
|
|
14
14
|
<object name="meta">
|
|
15
|
-
<
|
|
15
|
+
<type name="t_actor">result_t_actor.meta.resultset</type>
|
|
16
16
|
</object>
|
|
17
17
|
</object>
|
|
18
18
|
<set name="result">result_</set>
|
|
@@ -20,4 +20,19 @@
|
|
|
20
20
|
<print>"Server side : " + string(result)</print>
|
|
21
21
|
</block>
|
|
22
22
|
</function>
|
|
23
|
+
|
|
24
|
+
<function name="t_load_cache" returns="cache: object">
|
|
25
|
+
<block>
|
|
26
|
+
<query name="t_load_cache">
|
|
27
|
+
<string name="sql" literal="">select * from t_load_cache()</string>
|
|
28
|
+
<string name="multiple">"
|
|
29
|
+
t_actor: t_actor;
|
|
30
|
+
t_film: t_film
|
|
31
|
+
"
|
|
32
|
+
</string>
|
|
33
|
+
</query>
|
|
34
|
+
<runquery name="t_load_cache" result="cache"></runquery>
|
|
35
|
+
</block>
|
|
36
|
+
</function>
|
|
37
|
+
|
|
23
38
|
</module>
|
package/test/db/t23.output
CHANGED
|
@@ -2,3 +2,89 @@ Third (1 sec)
|
|
|
2
2
|
Second (2 sec)
|
|
3
3
|
First (3 sec)
|
|
4
4
|
AFTER parallel
|
|
5
|
+
<object name="t_actor">
|
|
6
|
+
<object name="1" type="t__t_actor">
|
|
7
|
+
<number name="actor_id">1</number>
|
|
8
|
+
<string name="first_name" literal="">Maria</string>
|
|
9
|
+
<string name="last_name" literal="">DUPONT</string>
|
|
10
|
+
<datetime name="last_update">
|
|
11
|
+
</datetime>
|
|
12
|
+
<string name="cyk_remark" literal="">remarque</string>
|
|
13
|
+
<boolean name="cyk_disable">
|
|
14
|
+
</boolean>
|
|
15
|
+
<object name="t_actor__meta">
|
|
16
|
+
<string name="user_name" literal="">cyk</string>
|
|
17
|
+
<number name="last_update">1707709479673</number>
|
|
18
|
+
<string name="key" literal="">1</string>
|
|
19
|
+
</object>
|
|
20
|
+
</object>
|
|
21
|
+
<object name="2" type="t__t_actor">
|
|
22
|
+
<number name="actor_id">2</number>
|
|
23
|
+
<string name="first_name" literal="">Leonardo</string>
|
|
24
|
+
<string name="last_name" literal="">DI CAPRIO</string>
|
|
25
|
+
<datetime name="last_update">
|
|
26
|
+
</datetime>
|
|
27
|
+
<string name="cyk_remark">
|
|
28
|
+
</string>
|
|
29
|
+
<boolean name="cyk_disable">
|
|
30
|
+
</boolean>
|
|
31
|
+
<object name="t_actor__meta">
|
|
32
|
+
<string name="user_name" literal="">cyk</string>
|
|
33
|
+
<number name="last_update">1707709485710</number>
|
|
34
|
+
<string name="key" literal="">2</string>
|
|
35
|
+
</object>
|
|
36
|
+
</object>
|
|
37
|
+
</object>
|
|
38
|
+
<object name="t_film">
|
|
39
|
+
<object name="1" type="t__t_film">
|
|
40
|
+
<number name="film_id">1</number>
|
|
41
|
+
<string name="title" literal="">La mélodie du bonheur</string>
|
|
42
|
+
<string name="description" literal="">Le film préféré de Mao</string>
|
|
43
|
+
<number name="release_year">1965</number>
|
|
44
|
+
<number name="length">60</number>
|
|
45
|
+
<number name="language_id">1</number>
|
|
46
|
+
<object name="t_film__meta">
|
|
47
|
+
<string name="user_name" literal="">cyk</string>
|
|
48
|
+
<number name="last_update">1707709479799</number>
|
|
49
|
+
<string name="key" literal="">1</string>
|
|
50
|
+
</object>
|
|
51
|
+
</object>
|
|
52
|
+
</object>
|
|
53
|
+
<object name="meta">
|
|
54
|
+
<type name="t_actor">
|
|
55
|
+
<number name="actor_id" dbtype="int" generated="by default">
|
|
56
|
+
</number>
|
|
57
|
+
<string name="first_name" dbtype="varchar(50)">
|
|
58
|
+
</string>
|
|
59
|
+
<string name="last_name" dbtype="text">
|
|
60
|
+
</string>
|
|
61
|
+
<datetime name="last_update" dbtype="timestamp with time zone">
|
|
62
|
+
</datetime>
|
|
63
|
+
<string name="cyk_remark" dbtype="varchar(255)">
|
|
64
|
+
</string>
|
|
65
|
+
<boolean name="cyk_disable" dbtype="boolean">
|
|
66
|
+
</boolean>
|
|
67
|
+
<object name="t_actor__meta" dbtype="jsonb">
|
|
68
|
+
</object>
|
|
69
|
+
<key name="actor_id">
|
|
70
|
+
</key>
|
|
71
|
+
</type>
|
|
72
|
+
<type name="t_film">
|
|
73
|
+
<number name="film_id" dbtype="int" generated="by default">
|
|
74
|
+
</number>
|
|
75
|
+
<string name="title" dbtype="varchar(255)">
|
|
76
|
+
</string>
|
|
77
|
+
<string name="description" dbtype="text">
|
|
78
|
+
</string>
|
|
79
|
+
<number name="release_year" dbtype="int">
|
|
80
|
+
</number>
|
|
81
|
+
<number name="length" dbtype="int">
|
|
82
|
+
</number>
|
|
83
|
+
<number name="language_id" dbtype="int">
|
|
84
|
+
</number>
|
|
85
|
+
<object name="t_film__meta" dbtype="jsonb">
|
|
86
|
+
</object>
|
|
87
|
+
<key name="film_id">
|
|
88
|
+
</key>
|
|
89
|
+
</type>
|
|
90
|
+
</object>
|
package/test/db/t23.xml
CHANGED
package/test/db/t33.xml
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<?xml-model href="https://www.cyklang.net/schema/cyklang.xsd" ?>
|
|
2
|
+
<module>
|
|
3
|
+
<print>"test dlookup: " + dlookup('first_name', 't_actor', 'actor_id=1')</print>
|
|
4
|
+
<print>hex2string(dlookup('asset_content','cyk_asset', "asset_route='/test/tableau.xml'"))</print>
|
|
5
|
+
|
|
6
|
+
</module>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
drop function if exists t_load_cache;
|
|
2
|
+
|
|
3
|
+
create or replace function t_load_cache (
|
|
4
|
+
) returns table(
|
|
5
|
+
t_actor json,
|
|
6
|
+
t_film json
|
|
7
|
+
)
|
|
8
|
+
language plpgsql
|
|
9
|
+
as $$
|
|
10
|
+
declare t_actor json;
|
|
11
|
+
declare t_film json;
|
|
12
|
+
begin
|
|
13
|
+
select array_to_json(array_agg(actor)) into t_actor from t_actor actor;
|
|
14
|
+
select array_to_json(array_agg(film)) into t_film from t_film film;
|
|
15
|
+
|
|
16
|
+
return query select t_actor, t_film;
|
|
17
|
+
end;$$;
|
package/test/t04.output
CHANGED
|
@@ -7,12 +7,12 @@ ms = 100
|
|
|
7
7
|
AVANT
|
|
8
8
|
APRES
|
|
9
9
|
length('1234') = 4
|
|
10
|
-
length(undefined) =
|
|
10
|
+
length(undefined) =
|
|
11
11
|
counter_next('JANV-010') = JANV-011
|
|
12
12
|
counter_next('March-999') = March-1000
|
|
13
13
|
counter_next('April-909') = April-910
|
|
14
14
|
counter_next('Février') = Février1
|
|
15
|
-
counter_next(undefined) =
|
|
15
|
+
counter_next(undefined) =
|
|
16
16
|
padend('1',3,'0') = 100
|
|
17
17
|
substring('abc',0,1) = a
|
|
18
18
|
substring('abc',0,0) =
|
package/test/t04.xml
CHANGED
package/test/t09.output
CHANGED
package/test/t26.output
CHANGED
|
@@ -4,8 +4,8 @@ format 1 : Format sans paramètre
|
|
|
4
4
|
format 2 : Nom : CYK Final
|
|
5
5
|
format 3 : Nom : { CYK Prénom Philippe }
|
|
6
6
|
{"name":"CYK","surname":"Philippe","adresses":[{"town":"Saint-Denis","department":"Reunion"},{"town":"Paris","department":"Paris"}]}
|
|
7
|
-
var1 =
|
|
8
|
-
var2 =
|
|
7
|
+
var1 =
|
|
8
|
+
var2 =
|
|
9
9
|
var1 == var2
|
|
10
10
|
after set var2 from var1
|
|
11
11
|
var1 == var2
|
package/test/t28.output
CHANGED
package/test/t31.output
CHANGED
package/test/t31.xml
CHANGED
|
@@ -26,5 +26,13 @@
|
|
|
26
26
|
<sleep>100</sleep>
|
|
27
27
|
<print>"name: " + name</print>
|
|
28
28
|
<print>"resume: " + resume</print>
|
|
29
|
+
|
|
30
|
+
<datetime name="dtbirth">datetime("1963-11-04 14:00")</datetime>
|
|
31
|
+
<print>"dtbirth: " + dateformat(dtbirth, "DD/MM/YYYY HH:mm")</print>
|
|
32
|
+
<print>"dtbirth: " + dateformat(dtbirth, "MMMM YYYY", "fr")</print>
|
|
29
33
|
|
|
34
|
+
<print>"numberformat(123456.789) : " + numberformat(123456.789)</print>
|
|
35
|
+
<print>"moneyformat(123456.789) : " + moneyformat(123456.789)</print>
|
|
36
|
+
<print>"moneyformat(123456.789, 'USD') : " + moneyformat(123456.789, 'USD')</print>
|
|
37
|
+
|
|
30
38
|
</module>
|
package/test/t32.xml
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<?xml-model href="../../../../VueProjects/docs-vuepress/docs/.vuepress/public/cyklang.xsd" ?>
|
|
2
|
+
<module>
|
|
3
|
+
<object name="dbresult"/>
|
|
4
|
+
<string name="data" literal=""><![CDATA[
|
|
5
|
+
<message>
|
|
6
|
+
Bonjour Le Monde2
|
|
7
|
+
</message>
|
|
8
|
+
]]>
|
|
9
|
+
</string>
|
|
10
|
+
<db.report returns="dbresult" format="pdf">
|
|
11
|
+
<string name="style" literal=""><![CDATA[<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
12
|
+
<xsl:stylesheet version="1.0"
|
|
13
|
+
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
|
14
|
+
xmlns:fo="http://www.w3.org/1999/XSL/Format"
|
|
15
|
+
xmlns:java="http://xml.apache.org/xslt/java" exclude-result-prefixes="java"
|
|
16
|
+
>
|
|
17
|
+
|
|
18
|
+
<xsl:template match="message">
|
|
19
|
+
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
|
|
20
|
+
<!-- Modèle de pages -->
|
|
21
|
+
<fo:layout-master-set>
|
|
22
|
+
<fo:simple-page-master master-name="A4"
|
|
23
|
+
page-width="210mm" page-height="297mm"
|
|
24
|
+
margin="1cm">
|
|
25
|
+
<!-- Région principale -->
|
|
26
|
+
<fo:region-body margin="2cm"/>
|
|
27
|
+
<!-- Tête de page aka header -->
|
|
28
|
+
<fo:region-before extent="1cm"/>
|
|
29
|
+
<!-- Pied de page aka footer -->
|
|
30
|
+
<fo:region-after extent="1cm"/>
|
|
31
|
+
</fo:simple-page-master>
|
|
32
|
+
</fo:layout-master-set>
|
|
33
|
+
<!-- Contenus -->
|
|
34
|
+
<fo:page-sequence master-reference="A4">
|
|
35
|
+
<!-- Contenu de la tête de page -->
|
|
36
|
+
<fo:static-content flow-name="xsl-region-before">
|
|
37
|
+
<fo:block text-align="center">XSL-FO <xsl:apply-templates/> example</fo:block>
|
|
38
|
+
</fo:static-content>
|
|
39
|
+
<!-- Contenu du pied de page : numéro de la page -->
|
|
40
|
+
<fo:static-content flow-name="xsl-region-after">
|
|
41
|
+
<fo:block text-align="center">- <fo:page-number/> -</fo:block>
|
|
42
|
+
</fo:static-content>
|
|
43
|
+
<!-- Contenu de la partie centrale -->
|
|
44
|
+
<fo:flow flow-name="xsl-region-body">
|
|
45
|
+
<fo:block text-align="center"
|
|
46
|
+
font="32pt Times"
|
|
47
|
+
border="black solid thick"><xsl:apply-templates/></fo:block>
|
|
48
|
+
</fo:flow>
|
|
49
|
+
</fo:page-sequence>
|
|
50
|
+
</fo:root>
|
|
51
|
+
</xsl:template>
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
</xsl:stylesheet> ]]>
|
|
56
|
+
|
|
57
|
+
</string>
|
|
58
|
+
<string name="data">data
|
|
59
|
+
</string>
|
|
60
|
+
</db.report>
|
|
61
|
+
</module>
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
<?xml-model href="https://www.cyklang.net/schema/cyklang.xsd" type="application/xml" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
|
2
|
+
<module>
|
|
3
|
+
|
|
4
|
+
<!-- function hello_world -->
|
|
5
|
+
|
|
6
|
+
<function name="hello_world" returns="result: object">
|
|
7
|
+
<block>
|
|
8
|
+
<string name="data" literal=""><![CDATA[
|
|
9
|
+
<root>
|
|
10
|
+
<message>
|
|
11
|
+
<title>Bonjour Le Monde4</title>
|
|
12
|
+
Suite
|
|
13
|
+
</message>
|
|
14
|
+
</root>
|
|
15
|
+
]]>
|
|
16
|
+
</string>
|
|
17
|
+
<db.report returns="result" format="pdf">
|
|
18
|
+
<string name="style">
|
|
19
|
+
hex2string(dlookup('asset_content','cyk_asset', "asset_route='/test/hello_world.xml'"))
|
|
20
|
+
</string>
|
|
21
|
+
<string name="data">data
|
|
22
|
+
</string>
|
|
23
|
+
</db.report>
|
|
24
|
+
</block>
|
|
25
|
+
</function>
|
|
26
|
+
|
|
27
|
+
<!-- function tableau -->
|
|
28
|
+
|
|
29
|
+
<function name="tableau" returns="result: object">
|
|
30
|
+
<block>
|
|
31
|
+
<query name="query">
|
|
32
|
+
<string name="sql" literal="">
|
|
33
|
+
select * from t_actor
|
|
34
|
+
</string>
|
|
35
|
+
</query>
|
|
36
|
+
|
|
37
|
+
<object name="query_result"/>
|
|
38
|
+
|
|
39
|
+
<runquery name="query" result="query_result"/>
|
|
40
|
+
|
|
41
|
+
<print>xmlformat(query_result)</print>
|
|
42
|
+
|
|
43
|
+
<string name="data">xmlformat(query_result)
|
|
44
|
+
</string>
|
|
45
|
+
|
|
46
|
+
<db.report returns="result" format="pdf">
|
|
47
|
+
<string name="style">
|
|
48
|
+
hex2string(dlookup('asset_content','cyk_asset', "asset_route='/test/tableau.xml'"))
|
|
49
|
+
</string>
|
|
50
|
+
<string name="data">data
|
|
51
|
+
</string>
|
|
52
|
+
</db.report>
|
|
53
|
+
</block>
|
|
54
|
+
</function>
|
|
55
|
+
|
|
56
|
+
<!-- function balance -->
|
|
57
|
+
|
|
58
|
+
<function name="balance" returns="result: object">
|
|
59
|
+
<block>
|
|
60
|
+
<query name="query">
|
|
61
|
+
<string name="sql" literal="">
|
|
62
|
+
select * from t_actor
|
|
63
|
+
</string>
|
|
64
|
+
</query>
|
|
65
|
+
|
|
66
|
+
<object name="query_result"/>
|
|
67
|
+
|
|
68
|
+
<runquery name="query" result="query_result"/>
|
|
69
|
+
|
|
70
|
+
<print>xmlformat(query_result)</print>
|
|
71
|
+
|
|
72
|
+
<string name="data">xmlformat(query_result)
|
|
73
|
+
</string>
|
|
74
|
+
|
|
75
|
+
<db.report returns="result" format="pdf">
|
|
76
|
+
<string name="style">
|
|
77
|
+
hex2string(dlookup('asset_content','cyk_asset', "asset_route='/test/balance.xml'"))
|
|
78
|
+
</string>
|
|
79
|
+
<string name="data">data
|
|
80
|
+
</string>
|
|
81
|
+
</db.report>
|
|
82
|
+
</block>
|
|
83
|
+
</function>
|
|
84
|
+
|
|
85
|
+
</module>
|
package/test/test.ts
ADDED
|
File without changes
|
|
File without changes
|