Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Jet template for a new file not generated
Jet template for a new file not generated [message #548571] Thu, 22 July 2010 11:42 Go to next message
Kate Jackson is currently offline Kate JacksonFriend
Messages: 4
Registered: July 2009
Junior Member
Hello,

I trying to switch from EMF 2.0.1 to 2.5.0.

My problem is that I generate additional classes from my model and it does not work anymore.

For example:
Class.javajet (overrides standard template to generate {CLASS}.java) - this one works fine, generates with my template.
ClassProxy.javajet (this should generate a {CLASS}Proxy.java file) - this one is not generated, not even present in .JETEmitters src.

Dynamic templates and Force Overwrite are enabled.
I even tried to copy Class.javajet to ClassProxy.javajet and change class attribute in jet directive but with no success.

What do I miss ?
Thanks in advance,
Kate


this reality sucks
Re: Jet template for a new file not generated [message #548613 is a reply to message #548571] Thu, 22 July 2010 13:25 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Kate,

Comments below.

Kate Jackson wrote:
> Hello,
>
> I trying to switch from EMF 2.0.1 to 2.5.0.
Better late than never! Given 2.6 is the latest release, that would
seem better...
>
> My problem is that I generate additional classes from my model and it
> does not work anymore.
>
> For example:
> Class.javajet (overrides standard template to generate {CLASS}.java) -
> this one works fine, generates with my template.
> ClassProxy.javajet (this should generate a {CLASS}Proxy.java file) -
> this one is not generated, not even present in .JETEmitters src.
We've never had such a template. So that's one of your own... Are the
other ones showing up there?
>
> Dynamic templates and Force Overwrite are enabled.
Do you see any errors in the Error log that might provide a clue?
> I even tried to copy Class.javajet to ClassProxy.javajet and change
> class attribute in jet directive but with no success.
How would a template EMF doesn't know about end up getting used?
>
> What do I miss ?
> Thanks in advance,
> Kate


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Jet template for a new file not generated [message #548703 is a reply to message #548613] Thu, 22 July 2010 17:05 Go to previous messageGo to next message
Kate Jackson is currently offline Kate JacksonFriend
Messages: 4
Registered: July 2009
Junior Member
>Better late than never! Given 2.6 is the latest release, that would seem better...
I'll definitely give it a try when I get back from my vacation..

>We've never had such a template. So that's one of your own... Are the other ones showing up there?

I have two own javajet templates and neither one of them shows up there. But isn't that the result of some incompatible changes in jet template format between 2.0.1 and 2.5.0 (like passing an array of Object instead of single object as script parameters) ? However no jet compilation errors were reported.
Nevertheless for a good start of migration I copied Class.javajet template into my templates/model directory and modified it a bit just to see if EMF will use it and it did. Modified Class.javajet template was used for generation - fine.
After that I copied Class.javajet into ClassProxy.javajet (and changed 'class' attribute to ClassProxy inside jet directive) - but as result ClassProxy_.java is missing in .JETEmmiters src. It seems that for some reason my dummy ClassProxy.javajet template is ignored.

> Do you see any errors in the Error log that might provide a clue?
no, didn't find anything related to this

> How would a template EMF doesn't know about end up getting used?
hm I don't get it


this reality sucks
Re: Jet template for a new file not generated [message #548707 is a reply to message #548703] Thu, 22 July 2010 17:18 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Kate,

Dynamic templates are only useful for overriding/specializing what's in
the default templates. Any new/other templates you add, simply won't
end up being used by EMF. So don't understand how ClassProxy.javajet
will be used. In fact, I think the dynamic templates are compiled on
demand so only the ones that EMF actually uses (tries to apply) will get
dynamically compiled. That's why I'm wondering how you use such
templates. We have an Example that shows how to extend the generator to
apply additional templates to produce additional artifacts...


Kate Jackson wrote:
>> Better late than never! Given 2.6 is the latest release, that would
>> seem better...
> I'll definitely give it a try when I get back from my vacation..
>
>> We've never had such a template. So that's one of your own... Are
>> the other ones showing up there?
>
> I have two own javajet templates and neither one of them shows up
> there. But isn't that the result of some incompatible changes in jet
> template format between 2.0.1 and 2.5.0 (like passing an array of
> Object instead of single object as script parameters) ? However no jet
> compilation errors were reported.
> Nevertheless for a good start of migration I copied Class.javajet
> template into my templates/model directory and modified it a bit just
> to see if EMF will use it and it did. Modified Class.javajet template
> was used for generation - fine.
> After that I copied Class.javajet into ClassProxy.javajet (and changed
> 'class' attribute to ClassProxy inside jet directive) - but as result
> ClassProxy_.java is missing in .JETEmmiters src. It seems that for
> some reason my dummy ClassProxy.javajet template is ignored.
>
>> Do you see any errors in the Error log that might provide a clue?
> no, didn't find anything related to this
>
>> How would a template EMF doesn't know about end up getting used?
> hm I don't get it


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Jet template for a new file not generated [message #548712 is a reply to message #548707] Thu, 22 July 2010 17:25 Go to previous message
Kate Jackson is currently offline Kate JacksonFriend
Messages: 4
Registered: July 2009
Junior Member
Ed Merks wrote on Thu, 22 July 2010 19:18
Kate,

Dynamic templates are only useful for overriding/specializing what's in
the default templates. Any new/other templates you add, simply won't
end up being used by EMF. ... We have an Example that shows how to extend the generator to
apply additional templates to produce additional artifacts...


Okay, that pretty much explains everything. I must have missed that info. I guess the migration won't be that easy then Sad

Thanks for quick answer


this reality sucks
Previous Topic:XSD to ECORE transformation
Next Topic:EMF Source for SDK builds?
Goto Forum:
  


Current Time: Thu Apr 25 13:00:46 GMT 2024

Powered by FUDForum. Page generated in 0.02782 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top