Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - daniel.levy

Pages: [1]
1
Hi Geert, 
No, it is not the problem.
  • It's easy to instantiate a DOM in JScript inside EA13. For instance : xmlDOM = new ActiveXObject( "MSXML2.DOMDocument.6.0" );
  • It's also easy to instantiate a DOM in JavaScript inside EA13. for instance : xmlDOM = new COMObject( "MSXML2.DOMDocument" );
 
The problem is now how to manipulate this DOM. There are commands than you can use in both langages (JScript and JavaScript either). For instance :
  • loadXML() ---------------------> xmlDOM.loadXML(SEARCH_SPECIFICATION);
  • createElement() --------------> row = pXmlDOM.createElement("Row");
 
But the problem begins now if you have to handle your XML DOM :
  • parentNode.appendChild(childNode); will operate seamlessly in JScript. That will append an XML childNode to your parentNode.
  • parentNode.appendChild(childNode); won't work in JavaScript because this function doesn't exist. And I can't find an equivalent function or how to do it in SpiderMonkey JavaScript 1.8.
 
So, the main problem is how to handle an XML DOM (retrieve a Node, append a Node, read a DOM, ...) inside EA13 with JavaScript as you are able to do with JScript or VBScript.
 
Best Regards,
 
Daniel 

2
Hi Geert, 
It's good to hear from you  :)
I looked deep inside this forum but I never could find how to manipulate an XML DOM with this JavaScript builted-in EA13.0.1310 (SpiderMonkey JavaScript 1.8 ). 
I posted my question on StackOverflow (here : https://stackoverflow.com/questions/44570789/handling-xml-dom-in-spidermonkey-javascript-1-8-function-appendchildchildnode) and it seems that SpiderMonkey JavaScript 1.8 doesn't have the libraries to manipulate XML DOM ... 
  This causes big problems because : 
  • I can't debug anymore VBScripts or JScripts since we have installed Windows 10 Pro and Enterprise Architect 13.0.1310. I can only debug JavaScript inside EA13. I tried to install the Microsoft Script Debugger (scd10en.exe) as it was used to work with Windows 7 Pro and EA12 but I couldn't manage to debug JScripts and VBScripts inside EA13.
  • As you know, Microsoft doesn't offer his Microsoft Script Debugger anymore. I can't afford to buy something like Microsoft Visual Studio just for getting their Microsoft Script Debugger.
  • Sparx recommanded me to develop JavaScript scripts inside EA13 to be sure that I would be able to debug.
  • A lot of EA functions as for instance Repository.SQLQuery(aQuery) returns an XML flow. So I don't know how I'll be able to read and manipulate XML results using JavaScript inside EA13 if I can't manipulate a XML DOM.
  As you can see, in EAScriptLib, you 've got a JScript-XML library and a VBScript-XML library. But you don't have a JavaScript-XML Library. 
So I'm still wondering how I could add a JavaScript XML library inside EA13 so that I could use such functions as append(), appendChild(), ... My purpose is to be able to manipulate the results of EA functions using EA JavaScript. 
Best regards, 
Daniel


3
Hi everybody,

I've got exactly the same question that Michael Junkin : which version of the Javascript is builted-in EA13 ?

The answer from Sparx was  on November 19, 2014 : "EA SSProfiler32 and SSProfiler75 are based on SpiderMonkey 1.8, which implements Javascript 1.8.".

But, is it always the same in EA 13.0.1310 today (2017, June the 13th) ?

How can we know wich functions are allowed in JavaScript within EA 13 ?

Best Regards,

Daniel

4
Hi Viking,

unfortunately no idea and I've got exactly the same problem as you. (Windows 10 Pro, EA 13.0.1310).

Sparx told me that I should better script in JavaScript thus Microsoft isn't maintening the microsoft script debugger.
The EA Debugger operates seamlessly with JavaScript (I've tried it).

But I 'll have to translate all my old scripts (VBScripts and JScripts)...

Best Regards

Daniel

5
Hi qwerty,
thank you for your pointful answer but I'm not quite sure.

If you take a look at JavaScript documentation (here for instance : https://developer.mozilla.org/fr/docs/Web/API/Node/appendChild), you 'll see that appendChild(...) exists. So, I'm affraid that the guys at https://stackoverflow.com/ will answser me that my code is correct in JavaScript.

It looks like the issue comes from JavaScript built-in EA13.0.1310. That's why I was asking about the type and the version of JavaScript builted-in EA 13. I saw that it could be spiderMonkey JavaScript on this forum but I couldn't find any version or where to find the documentation.

I would like to verify if appendChild(...)  exists for JavaScript builted-in EA13.

In my script, I'm listing the whole connectors (EA.Connector) appearing on a diagram.

Maybe it would be useful if I could send you my scripts (both JScript and JavaScript) ?

You could see that my script is good when written in JScript. The only problem remains in JavaScript.

Maybe you or someone else have done such that kind of script in JavaScript ? In fact, I'm looking for examples showing how to manipulate XML DOM inside scripts (JavaScript) in EA 13.

Best regards,

Daniel

6
Hi qwerty,

I'm sorry but I'm french and I'm not sure I have quite understood your answer.

I am not asking about Java but JavaScript in EA 13.

I've got a function in my script (JavaScript) where pRow is an XML Node from the DOM pXmlDOM :

<code>
function AddField(pXmlDOM, pRow, pNomDuChamp, pValeurDuChamp) {
   
    var fieldNode = pXmlDOM.createElement("Field");
   
    fieldNode.setAttribute("name", pNomDuChamp);
   
    fieldNode.setAttribute("value", pValeurDuChamp);
   
/* ************************************* */
/* DOES NOT WORK !!!! */
/* ************************************* */
    pRow.appendChild(fieldNode);

}
</code>

EA says that  appendChild(...) is not a function for the object XML Node pRow.

This operates seamlessly with JScript, but not with JavaScript.

So, do you know how I could figure out this issue in JavaScript ?

Thanks,

Daniel

7
Hi everybody  :),

I'm trying to write a JavaScript in EA;13.0.1310 (Windows 10 Pro).

I need to append a ChildNode to an ElementNode (XML) :

elementNode.appendChild(childNode);

this works seamlessly with JScript, but not at all with JavaScript.

Does anyone know :
  • which JavaScript and wich version is built-in in EA13 ? (Spider Monkey ??)
  • where I can find the references and functions of this JavaScript ?
  • How it is possible to append a ChildNode to an Element Node in a script (JavaScript) written inside EA13 ?

Best Regards,

Daniel

Pages: [1]