Book a Demo

Author Topic: Accessing the Repository without xml through API  (Read 4152 times)

Stefan Bolleininger

  • EA User
  • **
  • Posts: 308
  • Karma: +0/-0
    • View Profile
Accessing the Repository without xml through API
« on: September 10, 2011, 05:58:06 am »
Hi there

i want to generate an api with a few outputs of search stings. i created a form and an  interface for the api and this works quite well.

when i want so access my sql database i can do this by logging me in with my api and work out all informations. That is well... not so good.

I tried another way with

Repository.SQLQuery("SELect ............

and got the xml tags as i expected and i got with my problems from scripts.

is there a way to get access to my searches on the repository ( eap or SQL) and get rid of the xml tags?

Thank you in advance
Enterprise Architect in "safetycritical development" like medical device industry. My free Add-in at my Website

pha

  • EA User
  • **
  • Posts: 39
  • Karma: +0/-0
    • View Profile
Re: Accessing the Repository without xml through A
« Reply #1 on: September 10, 2011, 07:37:05 am »
When I had problems with sql query result in VBScript I have tried to use the following part of parsing (xml) code:

Code: [Select]
dim objXMLDoc, NodeList, numNodes, i, CurrNode, FileName_xml, fileObj_xml, ts ...

...

Set objXMLDoc = CreateObject("Microsoft.XMLDOM")
objXMLDoc.async = False
objXMLDoc.load(FileName_xml)

Set NodeList = objXMLDoc.getElementsByTagName("ea_guid")
numNodes = NodeList.Length

For i = 1 To numNodes
Set CurrNode = NodeList.nextNode
ts.write(CurrNode.text & vbCrLf)
Project.PutDiagramImageToFile CurrNode.text, "C:\VBScript_Result\Diagram_PNG_Image\"+CurrNode.text+".png", 1
Next

But my sql query was too simple:
Code: [Select]
Repository.SQLQuery("SELECT ea_guid FROM t_diagram WHERE Diagram_Type = 'Custom'")
« Last Edit: September 10, 2011, 07:45:20 am by 666999 »

Stefan Bolleininger

  • EA User
  • **
  • Posts: 308
  • Karma: +0/-0
    • View Profile
Re: Accessing the Repository without xml through A
« Reply #2 on: September 11, 2011, 11:42:29 pm »
Hi,

i also need just a very simple sqlquery, but i have to do this quite often.
ANd i want to write them back with repository.execute and then i can't have the tags.

Is there any quick solution or a "nice" solution?
Enterprise Architect in "safetycritical development" like medical device industry. My free Add-in at my Website