Book a Demo

Author Topic: New Language - cannot set "Generate Namespaces"  (Read 3098 times)

AndreasKo

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
New Language - cannot set "Generate Namespaces"
« on: July 13, 2011, 11:12:48 pm »
Hi all,

I want to generate Spring configuration files from a package, and it almost works,just one thing: My custom template (based on Connector) does not see the package / namespace information of the destination element of the Connector. %connectorDestElemQualName% is always evaluated to the same as %connectorDestElemName% (i.e. the unqualified class name).

I read that this might be due to the new language not supporting namespaces. I tried to specify this in a code options file for the new language, but it didn't work. Can anyone please tell me what I'm missing?
Code: [Select]
<CodeOptions>
<CodeOption name="DefaultExtension">.xml</CodeOption>
<CodeOption name="DefaultSourceDirectory">c:\temp</CodeOption>
<CodeOption name="GenerateNamespaces">True</CodeOption>
</CodeOptions>
I don't know if a GenerateNamespaces option exists, saw it in the options dialog for with VB.net.

AndreasKo

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: New Language - cannot set "Generate Namespaces
« Reply #1 on: July 14, 2011, 08:37:10 pm »
I realized I was not iterating through namespaces so they were not collected. In File template I used
%list="Class" @separator="\n\n" @indent="\t"%
but to resolve namespaces seems important to iterate like this: %list="Namespace" @separator="\n\n" @indent=""%
and in Namespace template or Namespace Body you can iterate through the Classes. This way, the packagePath variable is set correctly.