Book a Demo

Author Topic: XSDSchema Schema File access using automation API  (Read 7200 times)

Vladimir Iszer

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
XSDSchema Schema File access using automation API
« on: November 06, 2014, 10:36:42 pm »
In EA a XSDSchema Package can be created (http://www.sparxsystems.com/enterprise_architect_user_guide/9.3/soa_and_xml/xsd_schema.html). It contains a property named 'Schema File'. Is this property accessible via API ?
If yes, how ?
If no, in which table can it be found ?

Thanx for help.
« Last Edit: November 06, 2014, 10:37:06 pm by visCns »

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: XSDSchema Schema File access using automation
« Reply #1 on: November 06, 2014, 10:51:31 pm »
Those values are stored in tagged values for the package. The can be edited as usual.

q.

Vladimir Iszer

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: XSDSchema Schema File access using automation
« Reply #2 on: November 07, 2014, 01:02:42 am »
No, not really. Using following code:
Code: [Select]
foreach (IDualTaggedValue tv in selectedPackage.Element.TaggedValuesEx)
{
    Logger.Debug("{0}: {1}", tv.Name, tv.Value);
}

I get only following two items:
2014-11-06 14:57:27,209 [1] DEBUG - targetNamespace: http://schemas.test.com/domain/types/v1
2014-11-06 14:57:27,210 [1] DEBUG - targetNamespacePrefix: dbt_v1

But in EA UI I can see also the Schema File path.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: XSDSchema Schema File access using automation
« Reply #3 on: November 07, 2014, 02:03:03 am »
I ran this code:
Code: [Select]
my $ap = $rep->GetTreeSelectedObject();
for my $tv (in $ap->Element->TaggedValues) {
  print $tv->Name . ":" . $tv->Value . "\n";
}
and got
Quote
anonymousRole:false
anonymousType:true
attributeFormDefault:unqualified
defaultNamespace:namespace
elementDerivation:true
elementFormDefault:unqualified
memberNames:unqualified
modelGroup:sequence
schemaLocation:
targetNamespace:http://www.exampleURI.com/Schema1
targetNamespacePrefix:s1
version:
xmlns:<memo>

q.

P.S. I saw that you're mainly after the filename. It's stored in Package.Element.GenFile
« Last Edit: November 07, 2014, 02:06:59 am by qwerty »

Vladimir Iszer

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: XSDSchema Schema File access using automation
« Reply #4 on: November 07, 2014, 02:10:27 am »
This is strange, I have only those two. But nevertheless your schemaLocation is empty.

In the meantime I found it the hard way  :)

It is stored in the t_object.GenFile column.

Anyway, thanx for help.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: XSDSchema Schema File access using automation
« Reply #5 on: November 07, 2014, 05:28:05 am »
See my P.S. above ;) You likely missed it.

q.

Vladimir Iszer

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: XSDSchema Schema File access using automation
« Reply #6 on: November 07, 2014, 05:53:06 pm »
Yes, I missed it.  ::)

Thank you for help.