Book a Demo

Author Topic: Schema Composer method to get Namespace  (Read 5418 times)

Rodrigo Nascimento

  • EA User
  • **
  • Posts: 33
  • Karma: +3/-0
    • View Profile
Schema Composer method to get Namespace
« on: June 09, 2015, 02:01:17 am »
Hi All,

I've decided not to wait for a Schema Composer update to support the functionalities that I've mentioned in this post:

http://www.sparxsystems.com/cgi-bin/yabb/YaBB.cgi?num=1427195476

Therefore, I've decided to write an add-in and customise the outputs of the Schema Composer. It's been a bit tricky as I couldn't find any documentation that could help me with the Schema Composer reference object model.

After looking at the sample code and some debugging exercise, I've managed to get almost everything I wanted. The only part missing is to retrieve the Schema profile namespace set in the Schema Composer.

I've managed to implement an workaround by retrieving the target namespace from the respective XSD Schema Package, but it would be good to use what is defined in Composer's schema profile.

Does anybody know how to do it? Or any documentation that could help?

Thanks
Rod
« Last Edit: June 09, 2015, 02:01:47 am by rodrigocmn »
Please check my blog for more EA related articles!

http://connection.rnascimento.com

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Schema Composer method to get Namespace
« Reply #1 on: June 09, 2015, 09:24:40 am »
I'm glad to hear you're close. Unfortunately, I can't find the documentation either. I'll chase that up, but I don't think it will happen soon enough.

I can't see any way to get the information at the moment. I see the sample add-in setting what I hope is a default namespace in EA_GetProfileInfo. But EA_GenerateFromSchema takes a SchemaComposer, which doesn't appear to have any reference to the properties set by the user. (And the sample add-in completely ignores the exports parameter)

My conclusion is that for the moment the best you can do is your current workaround. (Potentially combined with setting the namespace property on the profile to "this will be ignored. Set the targetNamespace on the package instead")

Rodrigo Nascimento

  • EA User
  • **
  • Posts: 33
  • Karma: +3/-0
    • View Profile
Re: Schema Composer method to get Namespace
« Reply #2 on: June 09, 2015, 11:01:17 pm »
Thanks for the help Simon!

Any documentation or updates on this will be much appreciated!

As far as I could see, the 'exports' parameter pass the export format (i.e. XSD, JSON...) that is being requested by the SC. These export formats are defined in the 'EA_GetProfileInfo' method. I'm using them to give the option to generate both XSD and JSON schemas.
« Last Edit: June 09, 2015, 11:03:41 pm by rodrigocmn »
Please check my blog for more EA related articles!

http://connection.rnascimento.com

Rodrigo Nascimento

  • EA User
  • **
  • Posts: 33
  • Karma: +3/-0
    • View Profile
Re: Schema Composer method to get Namespace
« Reply #3 on: August 14, 2015, 11:50:38 pm »
Hi Simon,

Any luck with this one?

Regards,
Rodrigo
Please check my blog for more EA related articles!

http://connection.rnascimento.com