Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 311397

Summary: ProjectReferenceWizardFragment converts to modulecore project but no facets (like util)
Product: [WebTools] WTP Common Tools Reporter: Rob Stryker <stryker>
Component: wst.commonAssignee: Rob Stryker <stryker>
Status: RESOLVED FIXED QA Contact: Carl Anderson <ccc>
Severity: normal    
Priority: P3 CC: cbridgha, ccc, jasonpet
Version: 3.2Flags: stryker: pmc_approved? (david_williams)
stryker: pmc_approved? (raghunathan.srinivasan)
stryker: pmc_approved? (naci.dai)
deboer: pmc_approved+
stryker: pmc_approved? (neil.hauge)
stryker: pmc_approved? (kaloyan)
ccc: review+
cbridgha: review+
Target Milestone: 3.2 RC1   
Hardware: PC   
OS: Linux   
Whiteboard: PMC_approved
Attachments:
Description Flags
Adds the constant and lets jeetools wizard extensions use it
none
Updated patch with logging none

Description Rob Stryker CLA 2010-05-03 13:27:30 EDT
When creating an EJB project and trying to add a regular java project as a reference, the java project is converted into a module-core project but no default facet type is enabled.

This leaves a modulecore project but one which cannot be exported or published properly since it lacks any facets that could provide it with a viable virtual component factory. 

Might need some small API (a constant in ProjectReferenceWizardFragment) which can at least convert into a utility project if needed. this constant might simply be a string key pointing to a default facet string value, or it could be an operation of some sort. 

Will need to investigate.
Comment 1 Rob Stryker CLA 2010-05-06 04:37:35 EDT
The reason this API addition is needed is because the reference wizard code is in the common plugin, and the common plugin does not know anything about utility projects. So the extending page must provide some operation provider to convert a project into a utility project (or whatever other wtp-enabled project type the adopter product might use and want as a default). 

Without this API, options are extremely limited to fix this bug and the user will have to manually create a utility project instead. 

This API consists of one new String constant and a one-method interface to provide a conversion operation for the wizard. If the constant is not found in the options, the current behaviour is maintained. 

To be clear, the API addition is in the common plugin, whereas the jeetools only make use of this new constant.
Comment 2 Rob Stryker CLA 2010-05-06 04:38:10 EDT
Requires approval from both teams  (and then PMC)
Comment 3 Rob Stryker CLA 2010-05-06 04:38:56 EDT
Created attachment 167274 [details]
Adds the constant and lets jeetools wizard extensions use it
Comment 4 Carl Anderson CLA 2010-05-06 13:06:13 EDT
Rob, first, bug 308665 changed the classes that you are modifying in Common to provisional API (and they are documented as such in their JavaDoc), such that changes like these are not public API changes, so I removed the [API] from the Summary.

Second, can you please update your implementation of ProjectReferenceWizardFragment.convertProject() to log the exceptions instead of just ignoring them?  If a user is unable to convert a project to the proper type, we should log that instead of just ignoring it.  ModuleCoreUIPlugin has some very useful log methods- please make use of them.
Comment 5 Rob Stryker CLA 2010-05-07 04:11:57 EDT
Created attachment 167439 [details]
Updated patch with logging
Comment 6 Chuck Bridgham CLA 2010-05-07 10:56:48 EDT
approved
Comment 7 Carl Anderson CLA 2010-05-07 15:24:14 EDT
Approved.
Comment 8 Rob Stryker CLA 2010-05-10 11:54:25 EDT
requesting PMC approval
Comment 9 Rob Stryker CLA 2010-05-11 21:38:03 EDT
committed to head