Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 366621 - ADD_TO_EAR property is blocking the EJB Client Jar generation
Summary: ADD_TO_EAR property is blocking the EJB Client Jar generation
Status: RESOLVED FIXED
Alias: None
Product: WTP EJB Tools
Classification: WebTools
Component: jst.ejb (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 3.2.5 P   Edit
Assignee: Carl Anderson CLA
QA Contact: Kaloyan Raev CLA
URL:
Whiteboard:
Keywords:
Depends on: 365653
Blocks:
  Show dependency tree
 
Reported: 2011-12-13 15:36 EST by Roberto Sanchez Herrera CLA
Modified: 2012-01-20 15:32 EST (History)
5 users (show)

See Also:
ccc: review+


Attachments
Proposed patch (4.38 KB, patch)
2011-12-13 15:53 EST, Roberto Sanchez Herrera CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Roberto Sanchez Herrera CLA 2011-12-13 15:36:46 EST
An adopter is requesting to backport this bug to WTP 3.2.5P

+++ This bug was initially created as a clone of Bug #365653 +++

I need to generate an EJB project, and an EJB Client jar project. But I do not want to add the result to an EAR. I have a different containing application that contains both my EJB and EJB Client projects. The property  IJ2EEModuleFacetInstallDataModelProperties.ADD_TO_EAR need to be set to false.
This would disable the page where a user can select to generate an EJB Client Jar.

We tried to set IJ2EEModuleFacetInstallDataModelProperties.ADD_TO_EAR to true, to enable the UI, and then set it to false only when the user selects to Finish, but that did not work either.
Because the underneath Code blocks the EJB Client generation if the IJ2EEModuleFacetInstallDataModelProperties.ADD_TO_EAR is set to false (not only the UI is blocked).  The following code snippet in the EjbFacetInstallDataModelProvider class propertySet() method  is just the tip of the problem:

 } else if (propertyName.equals(ADD_TO_EAR)) {
   			boolean addToEar = (Boolean) propertyValue;
	    	if (!addToEar && isPropertySet(CREATE_CLIENT)) {
	    		model.setBooleanProperty(CREATE_CLIENT, false);  // create client disabled!
	    	} else {

If we leave the IJ2EEModuleFacetInstallDataModelProperties.ADD_TO_EAR to true, the wizard would finish and generates an EAR project , and this is not what we need.
Seems this property is used for a double purpose. It actually means a creation of an EAR project and it is used to enable the EJB Client generation.
Now we either have no Client jar generation , or we have to end up with an EAR getting generated in the workspace. We need to decouple these two logic with two separate flags.

Suggest to add a new flag like ADD_TO_APPLICATION, which does not imply creation of an application, but means that the project would be part of an application.
Comment 1 Roberto Sanchez Herrera CLA 2011-12-13 15:53:16 EST
Created attachment 208340 [details]
Proposed patch

Proposed patch built using R3_2_5_patches
Comment 2 Carl Anderson CLA 2011-12-13 15:56:47 EST
This same patch was reviewed by the PMC for WTP 3.3.2, and as such merits inclusion in our WTP 3.2.5 patches.
Comment 3 Roberto Sanchez Herrera CLA 2012-01-20 15:32:10 EST
Code committed and released to R3_2_5_patches. Resolving bug.