Bug 248274 - Migrate JETEmitter usage to M2T/JET technology
Summary: Migrate JETEmitter usage to M2T/JET technology
Status: NEW
Alias: None
Product: WTP Java EE Tools
Classification: WebTools
Component: jst.j2ee (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: Future   Edit
Assignee: Kaloyan Raev CLA
QA Contact: Chuck Bridgham CLA
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2008-09-23 10:23 EDT by Kaloyan Raev CLA
Modified: 2010-11-04 14:22 EDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kaloyan Raev CLA 2008-09-23 10:23:22 EDT
I am not sure which component this bug belongs to: WTP Java EE Tools or Modeling M2T JET.

Currently in WTP we use JETEmitter to generate the code for the Java EE artifacts: servlets, EJB beans, etc. As a side effect a .JETEmitter project is created in the workspace. Although there is a filter that hides it in the Project Explorer view, users assume that the workspace folder on the hard drive is there own property and they do not expect any system project there. We have cases where users just delete the .JETEmitter project (see bug 247854) from outside Eclipse, which makes the workspace to be out of sync and causes problems with JET code generation. 

It would be nice if there is a way that the .JETEmitter project is not generated next to  workspace projects, but hidden in the .metadata folder. 

I am not sure if this change has to be done in the JET engine, or in the way it is used in WTP.
Comment 1 Carl Anderson CLA 2008-09-23 23:09:58 EDT
WTPJetEmitter just extends JetEmitter, which is in EMF, so this is definitely a limitation of the EMF Jet implementation.  (In other words, it doesn't belong in WTP, and should probably be moved to EMF's codegen).
Comment 2 Kaloyan Raev CLA 2008-09-24 03:09:28 EDT
Moving to the JET component in Modeling. 

Folks, is it possible to get rid of the .JETEmitter project in the workspace?
Comment 3 Paul Elder CLA 2008-09-26 13:52:40 EDT
Simple answer: Yes - stop compiling JET templates on-the-fly.

Detailed answer:
The .JETEmitters project is created by the JETEmitter class when it must compile a JET template 'on-the-fly'. For each template compiled, a .java file is created. The Java builder in .JETEmitters the compiles this to a .class file, which the JETEmitter class then loads and executes.

On-the-fly template compilation allows templates to be overridden at runtime. It is unclear whether WTP is making use of template overriding, or is simply failing to statically compiling its templates. A builder is provided to statically compile JET templates, but I cannot find any instances of it in the WTP projects that contain JET templates.

The name of the .JETEmitters project can be changed by subclasses of JETEmitter. However, the project location cannot be changed.

Finally, the JET template environment used by WTP is actually part of EMF (Project: EMF, Component: Core). The M2T/JET component is an evolution of EMF's JET. It supports tag libraries and a completely different invocation paradigm. For compatibility, M2T/JET can compile EMF/Codegen templates, with some restrictions. And, it offers a mechanism for template overriding that does not rely on the on-the-fly compilation or the configuration a hidden Java projects. I'm willing to discuss how you could adopt M2T/JET. 

If you want to continue to use the current technology, this should be re-assigned to EMF/Core.
Comment 4 Kaloyan Raev CLA 2008-10-01 12:34:39 EDT
Paul, thank you for this detailed answer. 
I am willing to migrate to M2T/JET in Galileo. I appreciate your will to help. 
For Ganymede I will search solution with the EMF/Core/JET technology, but I will clone another bug for this. 

I move the bug to WTP, because there will be the actual work done.