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

Bug 312440

Summary: Deployment Assembly doesn't persist added folder mappings unless Deploy Path is edited
Product: [WebTools] WTP Common Tools Reporter: Larry Isaacs <larryisaacs>
Component: wst.commonAssignee: Rob Stryker <stryker>
Status: VERIFIED FIXED QA Contact: Carl Anderson <ccc>
Severity: major    
Priority: P3 CC: david_williams, jasonpet
Version: 3.2Flags: david_williams: pmc_approved+
stryker: pmc_approved? (raghunathan.srinivasan)
stryker: pmc_approved? (naci.dai)
stryker: pmc_approved? (deboer)
stryker: pmc_approved? (neil.hauge)
stryker: pmc_approved? (kaloyan)
ccc: review+
Target Milestone: 3.2 RC1   
Hardware: All   
OS: All   
Whiteboard: PMC_approved
Attachments:
Description Flags
Simple patch to set resourceMappingsChanged true when adding and removing folder mappings stryker: iplog+

Description Larry Isaacs CLA 2010-05-11 10:56:39 EDT
Created attachment 167935 [details]
Simple patch to set resourceMappingsChanged true when adding and removing folder mappings

If you add or remove folder mappings in the Deployment Assembly page, changes are not persisted unless you edit, though not necessarily change, a folder mapping Deploy Path.  This behavior occurs because the resourceMappingsChanged field in AddModuleDependenciesPropertiesPage must be true (as of rev 1.19) before resource changes will be persisted when OK is clicked.  The only action that currently sets this field true is editing a Deploy Path of a folder mapping.  The attached patch assumes that adding and removing folder mappings should also set resourceMappingsChanged true.
Comment 1 Carl Anderson CLA 2010-05-11 16:43:22 EDT
Assigning to Rob Stryker for initial investigation.
Comment 2 Rob Stryker CLA 2010-05-11 21:10:55 EDT
Comment on attachment 167935 [details]
Simple patch to set resourceMappingsChanged true when adding and removing folder mappings

Patch looks good... seeking approvals
Comment 3 Rob Stryker CLA 2010-05-11 21:11:31 EDT
looking for official approval
Comment 4 Carl Anderson CLA 2010-05-12 12:28:53 EDT
I approve of this change.
Comment 5 Rob Stryker CLA 2010-05-12 12:38:04 EDT
requires PMC
Comment 6 Carl Anderson CLA 2010-05-12 22:57:41 EDT
This is data loss- folder mappings that are added or removed are not saved when you press OK.

The workaround is to edit a folder mapping deploy path.  This is not a suitable workaround.

No tests have been added- this was tested by hand.

Simply put, as was stated, we now set the dirty flag for resourceMappingsChanged when a resourceMapping is added or removed.  This flag is (already) checked when OK is pressed, and will properly save the addition/removal of mappings.  Rob and I have reviewed this fix.

The risk is low, limited only to the AddModuleDependenciesPropertiesPage.
Comment 7 Carl Anderson CLA 2010-05-13 00:33:51 EDT
Committed to HEAD for WTP 3.2 RC1
Comment 8 Larry Isaacs CLA 2010-05-13 09:42:38 EDT
Verified added and removed jar references are now persisted without editing the Deploy Path with WTP I-3.2.0-20100513045407 build.