@@ -168,6 +168,14 @@ function useTemplate(name) {
168
168
return "" + doc ;
169
169
}
170
170
171
+ function describeClass ( ) {
172
+
173
+ } ;
174
+
175
+ function describeAttrib ( ) {
176
+
177
+ }
178
+
171
179
function writeFile ( folder , name , content , asText , model , coll , stagingDB ) {
172
180
var contentNode = content ;
173
181
if ( asText == true ) {
@@ -258,7 +266,11 @@ function cutContentES(modelIRI, modelVersion, entity, flowName, pluginFormat, da
258
266
visitedEntities . push ( entity ) ;
259
267
260
268
// begin building the function buildEntity_* for the current entity.
269
+ var ClassDesc = describeClass ( modelIRI , nextEntity ) ;
261
270
ContentBuilder += `
271
+ /*
272
+ ${ ClassDesc }
273
+ */
262
274
function buildEntity_${ nextEntity } (id,source,options,ioptions) {
263
275
// now check to see if we have XML or json, then create a node clone from the root of the instance
264
276
if (source instanceof Element || source instanceof ObjectNode) {
@@ -279,6 +291,9 @@ function buildEntity_${nextEntity}(id,source,options,ioptions) {
279
291
};
280
292
` ;
281
293
ContentXBuilder += `
294
+ (:
295
+ ${ ClassDesc }
296
+ :)
282
297
declare function plugin:buildEntity_${ nextEntity } ($id,$source,$options,$ioptions) {
283
298
let $source :=
284
299
if ($source/*:envelope and $source/node() instance of element()) then
@@ -302,6 +317,17 @@ declare function plugin:buildEntity_${nextEntity}($id,$source,$options,$ioptions
302
317
var attributeType = attributes [ i ] . attributeType ;
303
318
var attributeIsRequired = attributes [ i ] . attributeIsRequired ;
304
319
var attributeIsArray = attributes [ i ] . attributeIsArray ;
320
+
321
+ var AttribDesc = describeAttrib ( modelIRI , nextEntity , attributes [ i ] ) ;
322
+ ContentBuilder += `
323
+ /*
324
+ ${ SJSAttribDesc }
325
+ */` ;
326
+ ContentXBuilder += `
327
+ (:
328
+ ${ SJSAttribDesc }
329
+ :)` ;
330
+
305
331
if ( attributes [ i ] . attributeIsCalculated == true ) {
306
332
307
333
ContentBuilder += `
@@ -332,7 +358,7 @@ declare function plugin:buildEntity_${nextEntity}($id,$source,$options,$ioptions
332
358
` ;
333
359
ContentXBuilder += `
334
360
let $_ := map:put($model, "${ attributeName } ", json:array())
335
- for $x in 1 to 42 return json:array-push(map:get($model, "${ attributeName } "), plugin:buildEntity_${ entity2 } ($id,$source,$options,$ioptions)))
361
+ for $x in 1 to 1 return json:array-push(map:get($model, "${ attributeName } "), plugin:buildEntity_${ entity2 } ($id,$source,$options,$ioptions)))
336
362
` ;
337
363
}
338
364
else {
@@ -341,7 +367,7 @@ declare function plugin:buildEntity_${nextEntity}($id,$source,$options,$ioptions
341
367
}
342
368
` ;
343
369
ContentXBuilder += `
344
- let $_ := map:put($model, "${ attributeName } ", plugin:buildESEntity_ ${ entity2 } ($id,$source,$options,$ioptions))
370
+ let $_ := map:put($model, "${ attributeName } ", plugin:buildEntity_ ${ entity2 } ($id,$source,$options,$ioptions))
345
371
` ;
346
372
}
347
373
}
0 commit comments