Book a Demo

Author Topic: xml/xsd import issue  (Read 7484 times)

petergsimmon

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
xml/xsd import issue
« on: May 09, 2014, 11:13:15 am »
 i am trying to get a structure imported to Sparx EA.  i have an XSD that describes the meta structure or base classes. now i need to import the different members of the classes. i.e. <?xml version="1.0" encoding="utf-8"?>

<xs:schema targetNamespace="http://tempuri.org/XMLSchema.xsd"
   xmlns="http://tempuri.org/XMLSchema.xsd"
   xmlns:mstns="http://tempuri.org/XMLSchema.xsd"
   xmlns:xs="http://www.w3.org/2001/XMLSchema"
           elementFormDefault='qualified'>

 <xs:element name='PadisTTYSegmentList' type='SegmentListType' />

 <xs:complexType name='SegmentListType'>
   <xs:sequence>
     <xs:element name="SegmentItem" type="SegmentItemType" minOccurs="1" maxOccurs="unbounded"/>
   </xs:sequence>
 </xs:complexType>
 <xs:complexType name='SegmentItemType'>
   <xs:sequence>
     <xs:element name="PadisID" type="xs:string" />
     <xs:element name="PadisVersion" type="xs:string" />
     <xs:element name="Description" type="xs:string" />
     <xs:element name="CompositeItems" type="CompositeListType" />
   </xs:sequence>
 </xs:complexType>
 <xs:complexType name="CompositeListType">
   <xs:sequence>
     <xs:element name="CompositeItem" type="CompositeItemType" minOccurs="1" maxOccurs="unbounded"/>
   </xs:sequence>
 </xs:complexType>
 <xs:complexType name='CompositeItemType'>
   <xs:sequence>
     <xs:element name="PadisID" type="xs:string" />
     <xs:element name="PadisVersion" type="xs:string" />
     <xs:element name="Description" type="xs:string" />
     <xs:element name="ElementItems" type="ElementListType" />
   </xs:sequence>
 </xs:complexType>
 <xs:complexType name="ElementListType">
   <xs:sequence>
     <xs:element name="ElementItem" type="ElementItemType" minOccurs="1" maxOccurs="unbounded"/>
   </xs:sequence>
 </xs:complexType>
 <xs:complexType name='ElementItemType'>
   <xs:sequence>
     <xs:element name="PadisID" type="xs:string" />
     <xs:element name="PadisVersion" type="xs:string" />
     <xs:element name="Description" type="xs:string" />
     <xs:element name="PadisType" type="xs:string" />
   </xs:sequence>
 </xs:complexType>
</xs:schema>

this imports into EA fine. but for SEGMENT there are specific instances like abc and 123 and i am trying to figure out how to describe them so that EA will understand them.  

I could be doing this all wrong, and if so please say so. this is my first go with EA.

the second thing to load is the different instances of those classes.
      <?xml version="1.0" encoding="utf-8"?>
<SegmentItemType>
      <PadisID>UNH</PadisID>
      <PadisVersion>00</PadisVersion>
      <Description>this is a segment named unh00</Description>
      <CompositeItems>
          <CompositeItem>
            <PadisID>C009</PadisID>
               <PadisVersion>00.00</PadisVersion>
              <Description>this is a composite named c00900.00</Description>
              <ElementItems>
                <ElementItem>
                  <PadisID>9732</PadisID>
                        <PadisVersion>00</PadisVersion>
                        <Description>this is a date time</Description>
                        <PadisType>PadisDateTimeType</PadisType>
                  <Value>100100100100</Value>
                </ElementItem>
                <ElementItem>
                  <PadisID>9123</PadisID>
                        <PadisVersion>01</PadisVersion>
                        <Description>string value</Description>
                        <PadisType>PadisStringType</PadisType>
                  <Value>hello my friend</Value>
                </ElementItem>
                <ElementItem>
                  <PadisID>0001</PadisID>
                        <PadisVersion>99</PadisVersion>
                        <Description>integer</Description>
                        <PadisType>PadisIntType</PadisType>
                  <Value>123</Value>
                </ElementItem>
            </ElementItems>
          </CompositeItem>
          <CompositeItem>
            <PadisID>C001</PadisID>
               <PadisVersion>00</PadisVersion>
              <Description>new c</Description>
              <ElementItems>
                <ElementItem>
                  <PadisID>0001</PadisID>
                        <PadisVersion>99</PadisVersion>
                        <Description>integer</Description>
                        <PadisType>PadisIntType</PadisType>
                  <Value>123</Value>
                </ElementItem>
                <ElementItem>
                  <PadisID>00e1</PadisID>
                        <PadisVersion>99</PadisVersion>
                        <Description>integer</Description>
                        <PadisType>PadisIntType</PadisType>
                  <Value>123</Value>
                </ElementItem>
                <ElementItem>
                  <PadisID>00a1</PadisID>
                        <PadisVersion>99</PadisVersion>
                        <Description>integer</Description>
                        <PadisType>PadisIntType</PadisType>
                  <Value>123</Value>
                </ElementItem>
                
            </ElementItems>
          </CompositeItem>
      </CompositeItems>
</SegmentItemType>
let me know if you can help.  thanks
  

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: xml/xsd import issue
« Reply #1 on: May 09, 2014, 06:22:43 pm »
I'm not sure, but I don't think you can import instances with the xml schema import feature.
You could either model them manually, or create your own importer tool

Geert

petergsimmon

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: xml/xsd import issue
« Reply #2 on: May 10, 2014, 01:38:12 am »
i can code in c#.net do you have any examples of adding instances that i might copy/extend??  and the how_to's would also be helpful..   or just a link with more examples would be good as well.  thanks.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: xml/xsd import issue
« Reply #3 on: May 12, 2014, 04:05:37 pm »
You can check
- my site: Tutorial: Create your first C# Enterprise Architect addin in 10 minutes
- My Open source Repositories on Github:https://github.com/GeertBellekens/
- The community site http://community.sparxsystems.com/
- The help file
- The examples in your installation folder.

Geert

shimon

  • EA User
  • **
  • Posts: 172
  • Karma: +6/-0
    • View Profile
Re: xml/xsd import issue
« Reply #4 on: May 12, 2014, 08:53:05 pm »
Gert,
Going off -topic, is there an easy way to make an addin accessible to all users of a computer?

Thanks,
Shimon

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: xml/xsd import issue
« Reply #5 on: May 12, 2014, 09:47:11 pm »
Yes,

Since version 8 or 9 you can also put the registry entry under HKLM (HKEY_LOCAL_MACHINE)

Geert

petergsimmon

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: xml/xsd import issue
« Reply #6 on: May 12, 2014, 11:28:43 pm »
thank you Sir!!!
I will have a look.  and let you know if i need additional help.    :D

Tehila1

  • EA User
  • **
  • Posts: 256
  • Karma: +0/-0
    • View Profile
Re: xml/xsd import issue
« Reply #7 on: May 19, 2014, 08:22:29 pm »
Hello Geert,

Following your great instructions here http://bellekens.com/2011/02/23/tutorial-deploy-your-enterprise-architect-csharp-add-in-with-an-msi-package/  I try to make the add-in accessible for multiple users.  

Instead of creating the registry in the HKEY_CURRENT_USER I create it under HKEY_LOCAL_MACHINE.  

I changed the code:
 
Code: [Select]
<RegistryKey Root="HKLM" Key="Software\Sparx Systems\EAAddins\MyAddin" Action="createAndRemoveOnUninstall">
<RegistryValue Type="string" Value="MyAddin.MyAddinClass" />
 </RegistryKey>
 
  
However, nothing happens. The add-in does not appear in the 'Manage add ins' window.  
  
What is missing?
Thanks in advance.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: xml/xsd import issue
« Reply #8 on: May 19, 2014, 08:47:20 pm »
Have you checked that the key has been created correctly?

If you are working on an 64bit system is should be under
Code: [Select]
HKEY_LOCAL_MACHINE\SOFTWARE\[highlight]Wow6432Node[/highlight]\Sparx Systems\EAAddins
Geert

Tehila1

  • EA User
  • **
  • Posts: 256
  • Karma: +0/-0
    • View Profile
Re: xml/xsd import issue
« Reply #9 on: June 19, 2014, 04:54:00 pm »
Quote
Have you checked that the key has been created correctly?

If you are working on an 64bit system is should be under
Code: [Select]
HKEY_LOCAL_MACHINE\SOFTWARE\[highlight]Wow6432Node[/highlight]\Sparx Systems\EAAddins
Geert

Thanks a lot - that's it.

This may be off -topic, but how should I make the registry entries for EA add-ins in case the users use EA via CITRIX?

I understand the registry should be public, therefore I use the per machine option, but still not seems to be enabled for the users.

Any ideas?