Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 406238 - <property name="addToEarByDefault" value="true"/> doesn't have any effect in New JPA Project wizard
Summary: <property name="addToEarByDefault" value="true"/> doesn't have any effect in ...
Status: RESOLVED FIXED
Alias: None
Product: Dali JPA Tools
Classification: WebTools
Component: JPA (show other bugs)
Version: 3.3   Edit
Hardware: PC All
: P3 normal with 1 vote (vote)
Target Milestone: 3.3 RC2   Edit
Assignee: Paul Fullbright CLA
QA Contact:
URL:
Whiteboard: PMC_approved
Keywords:
Depends on: 234383
Blocks:
  Show dependency tree
 
Reported: 2013-04-22 14:01 EDT by Julio C. Chavez CLA
Modified: 2013-05-23 18:16 EDT (History)
5 users (show)

See Also:
neil.hauge: pmc_approved? (david_williams)
neil.hauge: pmc_approved? (raghunathan.srinivasan)
neil.hauge: pmc_approved? (naci.dai)
neil.hauge: pmc_approved? (neil.hauge)
cbridgha: pmc_approved+
neil.hauge: review+


Attachments
proposed patch (17.86 KB, patch)
2013-05-17 15:45 EDT, Paul Fullbright CLA
no flags Details | Diff
screenshot1 (57.50 KB, image/png)
2013-05-17 15:46 EDT, Paul Fullbright CLA
no flags Details
screenshot2 (40.29 KB, image/png)
2013-05-17 15:47 EDT, Paul Fullbright CLA
no flags Details
different patch (19.12 KB, patch)
2013-05-23 15:44 EDT, Paul Fullbright CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Julio C. Chavez CLA 2013-04-22 14:01:25 EDT
The <property name="addToEarByDefault" value="true"/> doesn't have any effect in JPA project wizard.

The JPA Project wizard should honor the property there or provide an alternative property to override the default configuration, so adopters may establish the required behavior
Comment 1 Neil Hauge CLA 2013-04-23 18:49:19 EDT
Please investigate.
Comment 2 Chuck Bridgham CLA 2013-05-13 11:04:38 EDT
Hi - any update on this?   This affects our adoption of Kepler...
Comment 3 Paul Fullbright CLA 2013-05-13 11:06:21 EDT
Where is this property set?
Comment 4 Neil Hauge CLA 2013-05-13 15:04:39 EDT
We're happy to try and resolve this issue, but seems to feel like a new requirement (or at least something we weren't aware that was supposed to be supported).  Did something change and we have regressed somehow, or is this a new issue?
Comment 5 Julio C. Chavez CLA 2013-05-15 11:43:53 EDT
(In reply to comment #4)
> We're happy to try and resolve this issue, but seems to feel like a new
> requirement (or at least something we weren't aware that was supposed to be
> supported).  Did something change and we have regressed somehow, or is this
> a new issue?

Related with this is the https://bugs.eclipse.org/bugs/show_bug.cgi?id=234383, before of that JPA was by default added to an EAR, after the fix it was not the "default" any more.

Anyway, there are still users that consider the previous behavior as the default one, specially in the JEE context; so, the best thing to do is a mechanism that allows the adopters to define the default value for the "Add to EAR", so it won't impact any kind of users, it can a new configuration value, but it is important to highlight that the behavior was modified.
Comment 6 Paul Fullbright CLA 2013-05-16 15:19:26 EDT
This is actually pretty hairy due to the ... particular nature of data model wizards.  I've tried to alter the facets selected based on the product preference, but the wizard keeps undoing what my default values should be (as I've noticed it doing in other places) so I don't think that this is a good way to solve this problem.  It gets very messy very quickly.

The better (and possibly only) ways to solve the problem all add something that wasn't there before:

1 - Add a second JPA project wizard so that we'd have one wizard that would create SE projects and one that would create EE projects, and they'd have different fixed facets.  The JPA EE project wizard would respect the boolean, the SE would not.

2 - Create a dynamic "Default JPA Configuration" preset that would optionally include the utility facet if the product preference were set.  This would be the initial preset selected for the wizard, and the user would have to select the "Default Configuration" to remove the utility facet (and the add to ear option).  I'm not sure that this is strictly possible.

3 - Create two presets "Default JPA Configuration" and "Default JPA EE Configuration", which one is preselected would depend on the product preference, and one could switch between them, with the product preference being respected for the EE config.

Thoughts?
Comment 7 Leonard Theivendra CLA 2013-05-16 16:09:31 EDT
Hi Paul, amongst your choices, I would vote for #2 first, then #3.  I think we we should avoid #1 and multiple wizards if at all possible.

We are ok with waiting for SR1 for a proper fix so there's no urgent need for this to make RC1.
Comment 8 Paul Fullbright CLA 2013-05-17 15:45:37 EDT
Created attachment 231171 [details]
proposed patch

Here's a proposal.

I've created two dynamic preset configurations: Basic JPA and Basic JPA EE.  (I tried using one dynamic preset configuration, but it was very flaky, and presented weird usage behavior.)  If the default is to "add to ear" the EE preset is used initially.  If not, the "SE" (sometimes not actually SE) preset is used initially.  These presets don't appear anywhere other than the JPA project wizard.  I like the flow of this.

Screenshots following.
Comment 9 Paul Fullbright CLA 2013-05-17 15:46:48 EDT
Created attachment 231172 [details]
screenshot1

This screenshot shows the initial dialog for the case where the default is not to add to ear.  It also shows the description for the two presets.
Comment 10 Paul Fullbright CLA 2013-05-17 15:47:50 EDT
Created attachment 231173 [details]
screenshot2

This screenshot shows the initial dialog for default add-to-ear = true.
Comment 11 Neil Hauge CLA 2013-05-23 11:11:05 EDT
We'd like to avoid making this change in a service release, so given Paul's recent proposal, are there any objections to the proposed change for Kepler RC2?
Comment 12 Paul Fullbright CLA 2013-05-23 11:21:48 EDT
Leonard, Julio, Chuck?

We've gotten OK on our end. Does this sound OK on yours?
Comment 13 Leonard Theivendra CLA 2013-05-23 12:31:00 EDT
(In reply to comment #12)
> Leonard, Julio, Chuck?
> 
> We've gotten OK on our end. Does this sound OK on yours?

Sounds good to me
Comment 14 Chuck Bridgham CLA 2013-05-23 12:51:19 EDT
Sounds good - submit to PMC!
Comment 15 Julio C. Chavez CLA 2013-05-23 15:23:58 EDT
It is fine for me too.
Comment 16 Paul Fullbright CLA 2013-05-23 15:44:05 EDT
Created attachment 231415 [details]
different patch

only sets to JPA preset on wizard initially
Comment 17 Neil Hauge CLA 2013-05-23 17:26:18 EDT
After much testing today, I think the most recent patch does the best job without being too intrusive to the existing behavior.  The second patch also addresses some issues with Add to EAR functionality.
Comment 18 Neil Hauge CLA 2013-05-23 17:29:24 EDT
    Explain why you believe this is a stop-ship defect. Or, if it is a "hotbug" (requested by an adopter) please document it as such. 

This addresses an issue in an adopter product where previous functionality no longer existed.

    Is there a work-around? If so, why do you believe the work-around is insufficient? 

No workaround.

    How has the fix been tested? Is there a test case attached to the bugzilla record? Has a JUnit Test been added? 

Fix has been manually tested by Paul and myself.

    Give a brief technical overview. Who has reviewed this fix? 

See comment 8 and comment 16.  I have reviewed the fix.

    What is the risk associated with this fix? 

Risk is medium.  Changes have been tested, but as this is project creation code there is some risk involved.
Comment 19 Chuck Bridgham CLA 2013-05-23 17:36:38 EDT
Approved - thanks for submitting this solution, I think this is an improvement all around...
Comment 20 Neil Hauge CLA 2013-05-23 18:16:09 EDT
Changes pushed to master for RC2.