Skip to content

Commit 00b6c4f

Browse files
committed
latest
1 parent 96bb1a0 commit 00b6c4f

File tree

4 files changed

+28
-2
lines changed

4 files changed

+28
-2
lines changed
Binary file not shown.
Binary file not shown.
10.9 KB
Binary file not shown.

uml2es/uml2esTransform/src/main/ml-modules/root/xmi2es/cookieCutter.sjs

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,14 @@ function useTemplate(name) {
168168
return ""+doc;
169169
}
170170

171+
function describeClass() {
172+
173+
};
174+
175+
function describeAttrib() {
176+
177+
}
178+
171179
function writeFile(folder, name, content, asText, model, coll, stagingDB) {
172180
var contentNode =content;
173181
if (asText == true) {
@@ -258,7 +266,11 @@ function cutContentES(modelIRI, modelVersion, entity, flowName, pluginFormat, da
258266
visitedEntities.push(entity);
259267

260268
// begin building the function buildEntity_* for the current entity.
269+
var ClassDesc = describeClass(modelIRI, nextEntity);
261270
ContentBuilder += `
271+
/*
272+
${ClassDesc}
273+
*/
262274
function buildEntity_${nextEntity}(id,source,options,ioptions) {
263275
// now check to see if we have XML or json, then create a node clone from the root of the instance
264276
if (source instanceof Element || source instanceof ObjectNode) {
@@ -279,6 +291,9 @@ function buildEntity_${nextEntity}(id,source,options,ioptions) {
279291
};
280292
`;
281293
ContentXBuilder += `
294+
(:
295+
${ClassDesc}
296+
:)
282297
declare function plugin:buildEntity_${nextEntity}($id,$source,$options,$ioptions) {
283298
let $source :=
284299
if ($source/*:envelope and $source/node() instance of element()) then
@@ -302,6 +317,17 @@ declare function plugin:buildEntity_${nextEntity}($id,$source,$options,$ioptions
302317
var attributeType = attributes[i].attributeType;
303318
var attributeIsRequired = attributes[i].attributeIsRequired;
304319
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+
305331
if (attributes[i].attributeIsCalculated == true) {
306332

307333
ContentBuilder += `
@@ -332,7 +358,7 @@ declare function plugin:buildEntity_${nextEntity}($id,$source,$options,$ioptions
332358
`;
333359
ContentXBuilder += `
334360
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)))
336362
`;
337363
}
338364
else {
@@ -341,7 +367,7 @@ declare function plugin:buildEntity_${nextEntity}($id,$source,$options,$ioptions
341367
}
342368
`;
343369
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))
345371
`;
346372
}
347373
}

0 commit comments

Comments
 (0)