@adobe/acc-js-sdk 1.1.40 → 1.1.42

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.
@@ -0,0 +1,429 @@
1
+ ---
2
+ layout: post
3
+ title: "Discover and create a FDA schema"
4
+ author: Alexandre Morin
5
+ tags: fda schemas soap
6
+ excerpt: Sequence of APIs to discover and create a FDA schema
7
+ ---
8
+
9
+
10
+ <p>
11
+ This article will illustrate the following flow and show the corresponding SOAP calls.
12
+ <ul>
13
+ <li>Create an external account corresponding to a FDA PostgreSQL database</li>
14
+ <li>Discover all the tables available in the FDA database</li>
15
+ <li>Choose a table and discover the schema</li>
16
+ <li>Annotate and save the schema</li>
17
+ </ul>
18
+ </p>
19
+
20
+ <h1>Create FDA external account</h1>
21
+
22
+ <p>
23
+ We'll create (or update) an external acount for a FDA database. You need the server, port, database and schema name, user and password.
24
+ </p>
25
+
26
+ <h2>Encrypt the password</h2>
27
+
28
+ <p>
29
+ The first step is to encrypt the password.
30
+ The <b>xtk:persist#EncryptPassword</b> API will by used to encrypt the password.
31
+ </p>
32
+
33
+ <p></p>
34
+
35
+ <pre class="code">
36
+ &lt;SOAP-ENV:Envelope xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:ns='urn:xtk:persist' xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/'&gt;
37
+ &lt;SOAP-ENV:Body&gt;
38
+
39
+ &lt;EncryptPassword xmlns='urn:xtk:persist' SOAP-ENV:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'&gt;
40
+ &lt;__sessiontoken xsi:type='xsd:string'&gt;{{SESSION_TOKEN}}&lt;/__sessiontoken&gt;
41
+
42
+ &lt;strDecrypted xsi:type='xsd:string'&gt;admin&lt;/strDecrypted&gt;
43
+
44
+ &lt;/EncryptPassword&gt;
45
+ &lt;/SOAP-ENV:Body&gt;
46
+ &lt;/SOAP-ENV:Envelope&gt;
47
+
48
+ </pre>
49
+
50
+ <p>
51
+ The API will return the encrypted password as follows.
52
+ </p>
53
+
54
+ <pre class="code">
55
+ &lt;?xml version='1.0'?&gt;
56
+ &lt;SOAP-ENV:Envelope
57
+ xmlns:xsd='http://www.w3.org/2001/XMLSchema'
58
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
59
+ xmlns:ns='urn:xtk:session'
60
+ xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/'&gt;
61
+ &lt;SOAP-ENV:Body&gt;
62
+ &lt;EncryptPasswordResponse
63
+ xmlns='urn:xtk:session' SOAP-ENV:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'&gt;
64
+ &lt;pstrEncrypted xsi:type='xsd:string'&gt;@S/U/D7xOdZfRAwf3+WRM3w==&lt;/pstrEncrypted&gt;
65
+ &lt;/EncryptPasswordResponse&gt;
66
+ &lt;/SOAP-ENV:Body&gt;
67
+ &lt;/SOAP-ENV:Envelope&gt;
68
+ </pre>
69
+
70
+
71
+ <h2>Create the external account</h2>
72
+
73
+ <p>
74
+ Now the external account can be created using the <b>xtk:persist#Write</b> API. Give it a name, make sure it's active and set all connection parameters as follows. Make sure you provide the encrypted password
75
+ </p>
76
+
77
+ <pre class="code">
78
+ &lt;SOAP-ENV:Envelope xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:ns='urn:xtk:persist' xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/'&gt;
79
+ &lt;SOAP-ENV:Body&gt;
80
+
81
+ &lt;Write xmlns='urn:xtk:persist' SOAP-ENV:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'&gt;
82
+ &lt;__sessiontoken xsi:type='xsd:string'&gt;{{SESSION_TOKEN}}&lt;/__sessiontoken&gt;
83
+ &lt;domDoc xsi:type='ns:Element' SOAP-ENV:encodingStyle='http://xml.apache.org/xml-soap/literalxml'&gt;
84
+
85
+ &lt;extAccount xtkschema="nms:extAccount"
86
+ name="pg2" label="Postgres (2)" provider="PostgreSQL" type="7" active="1"
87
+ server="localhost" port="" dbName="fda" dbSchema="public"
88
+ account="postgres" password="@S/U/D7xOdZfRAwf3+WRM3w=="
89
+ timezone="_server_" unicodeData="1"&gt;
90
+ &lt;/extAccount&gt;
91
+
92
+ &lt;/domDoc&gt;
93
+ &lt;/Write&gt;
94
+ &lt;/SOAP-ENV:Body&gt;
95
+ &lt;/SOAP-ENV:Envelope&gt;
96
+ </pre>
97
+
98
+ <p>
99
+ The API does not return anything. Note the the <b>name</b> attribute is a unique key in the nms:account schema. So the same API call can be used to update the account.
100
+ </p>
101
+
102
+ <h2>Test the connection</h2>
103
+
104
+ <p>
105
+ Campaign provides the <b>nms:extAccount#TestAccount</b> API to test the connection. Unfortunately, this API cannot take an extAccount id, but it needs to be passed all the credentials settings again.
106
+ Note that the password is still encrypted.
107
+ </p>
108
+
109
+ <pre class="code">
110
+
111
+ &lt;SOAP-ENV:Envelope xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:ns='urn:xtk:persist' xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/'&gt;
112
+ &lt;SOAP-ENV:Body&gt;
113
+
114
+ &lt;TestAccount xmlns='urn:xtk:persist' SOAP-ENV:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'&gt;
115
+ &lt;__sessiontoken xsi:type='xsd:string'&gt;{{SESSION_TOKEN}}&lt;/__sessiontoken&gt;
116
+
117
+ &lt;param xsi:type='xsd:byte'&gt;7&lt;/param&gt;
118
+ &lt;param xsi:type='xsd:boolean'&gt;1&lt;/param&gt;
119
+ &lt;param xsi:type='xsd:string'&gt;PostgreSQL:localhost&lt;/param&gt;
120
+ &lt;param xsi:type='xsd:string'&gt;postgres&lt;/param&gt;
121
+ &lt;param xsi:type='xsd:string'&gt;@S/U/D7xOdZfRAwf3+WRM3w==&lt;/param&gt;
122
+ &lt;param xsi:type='xsd:string'&gt;fda&lt;/param&gt;
123
+ &lt;param xsi:type='xsd:string'&gt;NChar=0;unicodeData=1;timezone=_server_;dbSchema=public;fileMethod=uploadFile;filePath=;&lt;/param&gt;
124
+ &lt;param xsi:type='xsd:string'&gt;pg2&lt;/param&gt;
125
+ &lt;param xsi:type='xsd:boolean'&gt;0&lt;/param&gt;
126
+ &lt;param xsi:type='xsd:string'&gt;&lt;/param&gt;
127
+ &lt;param xsi:type='xsd:string'&gt;&lt;/param&gt;
128
+ &lt;param xsi:type='xsd:string'&gt;&lt;/param&gt;
129
+ &lt;param xsi:type='xsd:string'&gt;&lt;/param&gt;
130
+
131
+ &lt;/TestAccount&gt;
132
+ &lt;/SOAP-ENV:Body&gt;
133
+ &lt;/SOAP-ENV:Envelope&gt;
134
+
135
+ </pre>
136
+
137
+ <p>
138
+ This should return a string with version information.
139
+ </p>
140
+
141
+ <pre class="code">
142
+ &lt;?xml version='1.0'?&gt;
143
+ &lt;SOAP-ENV:Envelope
144
+ xmlns:xsd='http://www.w3.org/2001/XMLSchema'
145
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
146
+ xmlns:ns='urn:nms:extAccount'
147
+ xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/'&gt;
148
+ &lt;SOAP-ENV:Body&gt;
149
+ &lt;TestAccountResponse
150
+ xmlns='urn:nms:extAccount' SOAP-ENV:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'&gt;
151
+ &lt;pstrServer xsi:type='xsd:string'&gt;localhost&lt;/pstrServer&gt;
152
+ &lt;pstrDbmsVer xsi:type='xsd:string'&gt;Database server version &#39;PostgreSQL 12.2, compiled by Visual C++ build 1914, 64-bit&#39;.&lt;/pstrDbmsVer&gt;
153
+ &lt;pstrWarehouse xsi:type='xsd:string'&gt;&lt;/pstrWarehouse&gt;
154
+ &lt;pstrTestDuration xsi:type='xsd:string'&gt;Test connection took: 0 ms&lt;/pstrTestDuration&gt;
155
+ &lt;/TestAccountResponse&gt;
156
+ &lt;/SOAP-ENV:Body&gt;
157
+ &lt;/SOAP-ENV:Envelope&gt;
158
+ </pre>
159
+
160
+
161
+ <h2>Query the external account</h2>
162
+
163
+ <p>
164
+ You can also use a query to get information about the external account.
165
+ </p>
166
+
167
+ <pre class="code">
168
+ &lt;SOAP-ENV:Envelope xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:ns='urn:xtk:persist' xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/'&gt;
169
+ &lt;SOAP-ENV:Body&gt;
170
+
171
+ &lt;ExecuteQuery xmlns='urn:xtk:queryDef' SOAP-ENV:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'&gt;
172
+ &lt;__sessiontoken xsi:type='xsd:string'&gt;{{SESSION_TOKEN}}&lt;/__sessiontoken&gt;
173
+
174
+ &lt;entity xsi:type='ns:Element' SOAP-ENV:encodingStyle='http://xml.apache.org/xml-soap/literalxml'&gt;
175
+ &lt;queryDef fullLoad="true" operation="get" schema="nms:extAccount" startPath="/" xtkschema="xtk:queryDef"&gt;
176
+ &lt;select&gt;
177
+ &lt;node expr="@id"/&gt;
178
+ &lt;node expr="@name"/&gt;
179
+ &lt;node expr="@label"/&gt;
180
+ &lt;node expr="@provider"/&gt;
181
+ &lt;node expr="@active"/&gt;
182
+ &lt;node expr="@server"/&gt;
183
+ &lt;node expr="@port"/&gt;
184
+ &lt;node expr="@dbName"/&gt;
185
+ &lt;node expr="@dbSchema"/&gt;
186
+ &lt;node expr="@account"/&gt;
187
+ &lt;node expr="@password"/&gt;
188
+ &lt;node expr="@timezone"/&gt;
189
+ &lt;node expr="@unicodeData"/&gt;
190
+ &lt;/select&gt;
191
+ &lt;where&gt;
192
+ &lt;condition expr="@name='pg2'"/&gt;
193
+ &lt;/where&gt;
194
+ &lt;/queryDef&gt;
195
+ &lt;/entity&gt;
196
+
197
+ &lt;/ExecuteQuery&gt;
198
+
199
+
200
+ &lt;/SOAP-ENV:Body&gt;
201
+ &lt;/SOAP-ENV:Envelope&gt;
202
+
203
+ </pre>
204
+
205
+ <p>
206
+ It will return something like this
207
+ </p>
208
+
209
+ <pre class="code">
210
+ &lt;?xml version='1.0'?&gt;
211
+ &lt;SOAP-ENV:Envelope
212
+ xmlns:xsd='http://www.w3.org/2001/XMLSchema'
213
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
214
+ xmlns:ns='urn:xtk:queryDef'
215
+ xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/'&gt;
216
+ &lt;SOAP-ENV:Body&gt;
217
+ &lt;ExecuteQueryResponse
218
+ xmlns='urn:xtk:queryDef' SOAP-ENV:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'&gt;
219
+ &lt;pdomOutput xsi:type='ns:Element' SOAP-ENV:encodingStyle='http://xml.apache.org/xml-soap/literalxml'&gt;
220
+ &lt;extAccount account="postgres" active="1" dbName="fda" dbSchema="public" id="4510" label="Postgres (2)" name="pg2" password="@S/U/D7xOdZfRAwf3+WRM3w==" port="" provider="PostgreSQL" server="localhost" timezone="_server_" unicodeData="1"&gt;&lt;/extAccount&gt;
221
+ &lt;/pdomOutput&gt;
222
+ &lt;/ExecuteQueryResponse&gt;
223
+ &lt;/SOAP-ENV:Body&gt;
224
+ &lt;/SOAP-ENV:Envelope&gt;
225
+
226
+ </pre>
227
+
228
+
229
+ <h1>Discover the tables</h1>
230
+
231
+ <p>
232
+ Now you can discover the tables available in the FDA database. The <b>xtk:sqlSchema#BuildTableList</b> API will return a list of tables.
233
+ </p>
234
+
235
+ <pre class="code">
236
+ &lt;SOAP-ENV:Envelope xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:ns='urn:xtk:persist' xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/'&gt;
237
+ &lt;SOAP-ENV:Body&gt;
238
+
239
+ &lt;BuildTableList xmlns='urn:xtk:queryDef' SOAP-ENV:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'&gt;
240
+ &lt;__sessiontoken xsi:type='xsd:string'&gt;{{SESSION_TOKEN}}&lt;/__sessiontoken&gt;
241
+
242
+ &lt;param xsi:type='xsd:string'&gt;nms:extAccount:pg2&lt;/param&gt;
243
+ &lt;param xsi:type='xsd:string'&gt;%%&lt;/param&gt;
244
+
245
+ &lt;/BuildTableList&gt;
246
+
247
+ &lt;/SOAP-ENV:Body&gt;
248
+ &lt;/SOAP-ENV:Envelope&gt;
249
+ </pre>
250
+
251
+ <p>
252
+ Which returns the following. In this example, I only have one table named <b>x</b>.
253
+ </p>
254
+
255
+ <pre class="code">
256
+ &lt;?xml version='1.0'?&gt;
257
+ &lt;SOAP-ENV:Envelope
258
+ xmlns:xsd='http://www.w3.org/2001/XMLSchema'
259
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
260
+ xmlns:ns='urn:xtk:sqlSchema'
261
+ xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/'&gt;
262
+ &lt;SOAP-ENV:Body&gt;
263
+ &lt;BuildTableListResponse
264
+ xmlns='urn:xtk:sqlSchema' SOAP-ENV:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'&gt;
265
+ &lt;pdomTableList xsi:type='ns:Element' SOAP-ENV:encodingStyle='http://xml.apache.org/xml-soap/literalxml'&gt;
266
+ &lt;sqlSchema&gt;
267
+ &lt;table name="public.x"/&gt;
268
+ &lt;/sqlSchema&gt;
269
+ &lt;/pdomTableList&gt;
270
+ &lt;/BuildTableListResponse&gt;
271
+ &lt;/SOAP-ENV:Body&gt;
272
+ &lt;/SOAP-ENV:Envelope&gt;
273
+ </pre>
274
+
275
+
276
+ <h1>Create the schema</h1>
277
+
278
+ <p>
279
+ Schema creation is a 3-step process
280
+ <ul>
281
+ <li>First, create a sql schema by discovering the table structure in the FDA database</li>
282
+ <li>Second, modify the schema if necessary and save it as a source schema</li>
283
+ <li>Finally, build the final schema</li>
284
+ </ul>
285
+ </p>
286
+
287
+ <h2>Discover the table structure</h2>
288
+
289
+ <p>
290
+ We'll call the <b>xtk:builder#GenerateSchema</b> API. It's the API behind the schema creation wizard.
291
+ This API takes high level parameters and return an XML document which is the future schema. Note that
292
+ everything happens in memory. At this point, nothing is created in the database.
293
+ </p>
294
+ <p>
295
+ The rationale is that the discovery may not discover anything, so we return a source schema, give you
296
+ a chance to modify it before it is persisted.
297
+ </p>
298
+
299
+ <pre class="code">
300
+ &lt;SOAP-ENV:Envelope xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:ns='urn:xtk:persist' xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/'&gt;
301
+ &lt;SOAP-ENV:Body&gt;
302
+
303
+ &lt;GenerateSchema xmlns='urn:xtk:queryDef' SOAP-ENV:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'&gt;
304
+ &lt;__sessiontoken xsi:type='xsd:string'&gt;{{SESSION_TOKEN}}&lt;/__sessiontoken&gt;
305
+
306
+ &lt;param xsi:type='xsi:element' SOAP-ENV:encodingStyle='http://xml.apache.org/xml-soap/literalxml'&gt;
307
+ &lt;tmp type="extView" sqltable="public.x" removePrefix="0" advanced="0"&gt;
308
+ &lt;/tmp&gt;
309
+ &lt;/param&gt;
310
+
311
+ &lt;param xsi:type='xsi:element' SOAP-ENV:encodingStyle='http://xml.apache.org/xml-soap/literalxml'&gt;
312
+ &lt;srcSchema dataSource="nms:extAccount:pg2" img="xtk:schema.png" label="NewAPI" mappingType="sql" name="new2" namespace="cus" xtkschema="xtk:srcSchema"&gt;
313
+ &lt;/srcSchema&gt;
314
+ &lt;/param&gt;
315
+
316
+ &lt;/GenerateSchema&gt;
317
+
318
+ &lt;/SOAP-ENV:Body&gt;
319
+ &lt;/SOAP-ENV:Envelope&gt;
320
+ </pre>
321
+
322
+ <p>
323
+ Which returns
324
+ </p>
325
+
326
+ <pre class="code">
327
+ &lt;?xml version='1.0'?&gt;
328
+ &lt;SOAP-ENV:Envelope
329
+ xmlns:xsd='http://www.w3.org/2001/XMLSchema'
330
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
331
+ xmlns:ns='urn:xtk:builder'
332
+ xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/'&gt;
333
+ &lt;SOAP-ENV:Body&gt;
334
+ &lt;GenerateSchemaResponse
335
+ xmlns='urn:xtk:builder' SOAP-ENV:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'&gt;
336
+ &lt;pdomSchema xsi:type='ns:Element' SOAP-ENV:encodingStyle='http://xml.apache.org/xml-soap/literalxml'&gt;
337
+
338
+ &lt;srcSchema img="xtk:schema.png" label="NewAPI" mappingType="sql" name="new2" namespace="cus" view="true" xtkschema="xtk:srcSchema"&gt;
339
+ &lt;element dataSource="nms:extAccount:pg2" label="NewAPI" name="new2" sqltable="public.x"&gt;
340
+ &lt;attribute advanced="false" label="i" name="i" sqlname="i" type="long"/&gt;
341
+ &lt;/element&gt;
342
+ &lt;/srcSchema&gt;
343
+
344
+ &lt;/pdomSchema&gt;
345
+ &lt;/GenerateSchemaResponse&gt;
346
+ &lt;/SOAP-ENV:Body&gt;
347
+ &lt;/SOAP-ENV:Envelope&gt;
348
+ </pre>
349
+
350
+ <p>
351
+ As you can see a src schema is returned. In this case, my table only had one column named "i" which is a long.
352
+ </p>
353
+
354
+ <h2>Create the schema</h2>
355
+
356
+ <p>
357
+ Let's extract the srcSchema object from the result of the previous API call. We can modify this XML document
358
+ and, for example, define links, labels, keys, etc.
359
+
360
+ Typically, we'll create at least a key as follows
361
+ </p>
362
+ <pre class="code">
363
+ &lt;srcSchema img="xtk:schema.png" label="NewAPI" mappingType="sql" name="new2" namespace="cus" view="true" xtkschema="xtk:srcSchema"&gt;
364
+ &lt;element dataSource="nms:extAccount:pg2" label="NewAPI" name="new2" sqltable="public.x"&gt;
365
+ &lt;key name="pk"&gt;
366
+ &lt;keyfield xpath="@i"/&gt;
367
+ &lt;/key&gt;
368
+ &lt;attribute advanced="false" label="i" name="i" sqlname="i" type="long"/&gt;
369
+ &lt;/element&gt;
370
+ &lt;/srcSchema&gt;
371
+ </pre>
372
+ <p>
373
+ When happy with the document, it's time to save it and persist the src schema in the database. This
374
+ can be done with a simple <b>xtk:persist#Write</b> API call.
375
+ </p>
376
+
377
+ <pre class="code">
378
+ &lt;SOAP-ENV:Envelope xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:ns='urn:xtk:persist' xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/'&gt;
379
+ &lt;SOAP-ENV:Body&gt;
380
+
381
+ &lt;Write xmlns='urn:xtk:persist' SOAP-ENV:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'&gt;
382
+ &lt;__sessiontoken xsi:type='xsd:string'&gt;{{SESSION_TOKEN}}&lt;/__sessiontoken&gt;
383
+
384
+ &lt;domDoc xsi:type='ns:Element' SOAP-ENV:encodingStyle='http://xml.apache.org/xml-soap/literalxml'&gt;
385
+
386
+ &lt;srcSchema img="xtk:schema.png" label="NewAPI" mappingType="sql" name="new2" namespace="cus" view="true" xtkschema="xtk:srcSchema"&gt;
387
+ &lt;element dataSource="nms:extAccount:pg2" label="NewAPI" name="new2" sqltable="public.x"&gt;
388
+ &lt;key name="pk"&gt;
389
+ &lt;keyfield xpath="@i"/&gt;
390
+ &lt;/key&gt;
391
+ &lt;attribute advanced="false" label="i" name="i" sqlname="i" type="long"/&gt;
392
+ &lt;/element&gt;
393
+ &lt;/srcSchema&gt;
394
+
395
+ &lt;/domDoc&gt;
396
+
397
+ &lt;/Write&gt;
398
+
399
+
400
+ &lt;/SOAP-ENV:Body&gt;
401
+ &lt;/SOAP-ENV:Envelope&gt;
402
+ </pre>
403
+
404
+ <p>
405
+ This API call does not return anything. But you can check in the database, the schema is there.
406
+ </p>
407
+
408
+ <h2>Build the schema</h2>
409
+
410
+ <p>
411
+ The last step is very important and consists of building a xtk:schema from the xtk:srcSchema which has
412
+ just been created. We can use the <b>xtk:builder#BuildSchemaFromId</b> API call.
413
+ </p>
414
+
415
+ <pre class="code">
416
+ &lt;SOAP-ENV:Envelope xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:ns='urn:xtk:persist' xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/'&gt;
417
+ &lt;SOAP-ENV:Body&gt;
418
+
419
+ &lt;BuildSchemaFromId xmlns='urn:xtk:builder' SOAP-ENV:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'&gt;
420
+ &lt;__sessiontoken xsi:type='xsd:string'&gt;{{SESSION_TOKEN}}&lt;/__sessiontoken&gt;
421
+
422
+ &lt;schemaId&gt;cus:new2&lt;/schemaId&gt;
423
+
424
+ &lt;/BuildSchemaFromId&gt;
425
+
426
+
427
+ &lt;/SOAP-ENV:Body&gt;
428
+ &lt;/SOAP-ENV:Envelope&gt;
429
+ </pre>
package/docs/blog.html CHANGED
@@ -8,7 +8,7 @@ title: Blog (latest posts)
8
8
  {% for post in site.posts %}
9
9
  <li>
10
10
  <div class="blog-expert">
11
- <h2><a href="{{ post.url }}">{{ post.title }}</a></h2>
11
+ <h2><a href="{{ site.baseurl }}/{{ post.url }}">{{ post.title }}</a></h2>
12
12
  <div class="blog-header">{{ post.author }} - {{ post.date | date_to_string }}</div>
13
13
  {{ post.excerpt }}
14
14
  </div>
@@ -2,6 +2,31 @@
2
2
  layout: page
3
3
  title: Change Log
4
4
  ---
5
+ <section class="changelog"><h1>Version 1.1.42</h1>
6
+ <h2>2023/12/20</h2>
7
+ <li>
8
+ Fixed a typo in documentation
9
+ </li>
10
+ <li>
11
+ Added 2 blog articles about schema creation (SOAP calls)
12
+ </li>
13
+ <li>
14
+ Fixed the documentation: blog articles links were broken
15
+ </li>
16
+ <li>
17
+ Upgraded Axios to fix a vulnerability
18
+ </li>
19
+ </section>
20
+
21
+ <section class="changelog"><h1>Version 1.1.41</h1>
22
+ <h2>2023/11/01</h2>
23
+ <li>
24
+ Support submitting jobs on static methods
25
+ </li>
26
+ <li>
27
+ Fixed a bug (missing await) when retreiving method object from cache when submitting a job on a non-static method
28
+ </li>
29
+ </section>
5
30
 
6
31
  <section class="changelog"><h1>Version 1.1.40</h1>
7
32
  <h2>2023/09/27</h2>
@@ -105,7 +105,7 @@ await client.logoff();
105
105
  </p>
106
106
 
107
107
  <h2>Login with user and password</h2>
108
- <p>This is the most common method to log in to Campaign. User the <b>ofUserAndPassword</b> function and pass it the user name and password</p>
108
+ <p>This is the most common method to log in to Campaign. Use the <b>ofUserAndPassword</b> function and pass it the user name and password</p>
109
109
  <pre class="code">
110
110
  const connectionParameters = sdk.ConnectionParameters.ofUserAndPassword(
111
111
  "https://myInstance.campaign.adobe.com",
package/docs/xtkJob.html CHANGED
@@ -129,3 +129,28 @@ title: XTK Jobs (xkt:job, xkt:jobInterface)
129
129
  <pre class="code">
130
130
  var result = await job.getResult();
131
131
  </pre>
132
+
133
+
134
+ <h1>Jobs & Static methods</h1>
135
+ <p>
136
+ Version 1.1.41 and above support submitting jobs on static methods.
137
+ </p>
138
+ <ul>
139
+ <li>Set the jobId parameter with the entity primary key. In the example below, the jobId is the id of the webApp to publish</li>
140
+ <li>Do not pass an object parameter. The method is static, there's no object.</li>
141
+ </ul>
142
+ <pre class="code">
143
+ const job = await client.jobInterface({
144
+ xtkschema: 'nms:webApp',
145
+ jobId: 9876,
146
+ method: 'Publish',
147
+ args: [
148
+ { where: { condition: { expr: "@id=9876" } } },
149
+ { type: "byte", value: "10" }
150
+ ]
151
+ });
152
+
153
+ const jobId = await job.submitSoapCall();
154
+ </pre>
155
+
156
+