Book a Demo

Author Topic: Generate code from Screens  (Read 4493 times)

thomaskilian

  • Guest
Generate code from Screens
« on: October 21, 2005, 12:54:23 am »
Hi,
has anyone succesfully generated (PHP-)code from Screens? I managed to create code for a single screen when using a stereotype. But I was not able to get hold of Screen Elements (Buttons, etc.). The template InnerClass does not recognize them as classes, so no code is generated. What I currently can do is to change theses element types to Class, but that's not my intention. I could also live (better?) with a transformation. But the Screen/elements are not transformed at all to anything.

Clueless ???

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Generate code from Screens
« Reply #1 on: October 23, 2005, 04:30:40 pm »
Hi Thomas,

I haven't tried much, but I briefly modified the C# transformation to force everything to become classes and UI controls were transformed.

Try something like this in your class template.

Quote
%if elemType == "Screen"%
Class
{
$comment="This is a cut down example of what a transformed screen should look like"
  %TRANSFORM_REFERENCE("Class")%
  %TRANSFORM_CURRENT("language")%
  language="PHP"
%list="InnerClass" @separator="\n" @indent="  "%
}
%elseIf elemType=="GUIElement"%
Class
{
$comment="This is a cut down example of what a transformed ui control should look like"
  %TRANSFORM_REFERENCE("Class")%
  %TRANSFORM_CURRENT("language")%
  language="PHP"
%list="InnerClass" @separator="\n" @indent="  "%
}
%endIf%
« Last Edit: October 23, 2005, 04:31:03 pm by simonm »

thomaskilian

  • Guest
Re: Generate code from Screens
« Reply #2 on: October 24, 2005, 02:27:39 am »
Thanks, Simon. That did the trick :)

I'll have to read your discussion with SF_It about transformation reference...
« Last Edit: October 24, 2005, 02:59:43 am by thomaskilian »