Bug 197199

Summary: [Persistence] Renaming a Profile doesn't cause a save
Product: [Tools] Target Management Reporter: Kevin Doyle <kjdoyle>
Component: RSEAssignee: David Dykstal <ddykstal.eclipse>
Status: CLOSED FIXED QA Contact: Martin Oberhuber <mober.at+eclipse>
Severity: normal    
Priority: P3 CC: dmcknigh
Version: 2.0Keywords: contributed
Target Milestone: 2.0.1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Renaming a profile now performs commit/delete mober.at+eclipse: iplog+

Description Kevin Doyle CLA 2007-07-19 16:35:37 EDT
If you rename a Profile and restart the workbench the old Profile name is visible. This is because we don't do a save of the profile.

Another issue because of this is: If you rename a profile and use it such that the profile does get saved.  After restarting the workbench you will have the old profile and the new profile as the old profile was not removed.

Steps to Reproduce:
1. Go to the Team View
2. Click "Create a new Profile" button on the toolbar.
3. Enter some name and click Finish.
4. Right Click on the new profile and select Rename.
5. Enter some new name.
6. Restart the workbench.
7. Old name is visible for the profile.

-----------Enter bugs above this line-----------
TM 2.0 Testing
installation : eclipse-SDK-3.3
RSE install  : RSE 2.0
java.runtime : Sun 1.5.0_11-b03
os.name:     : Windows XP, Service Pack 2
------------------------------------------------
Comment 1 David Dykstal CLA 2007-07-19 18:52:54 EDT
Kevin -- I was just noticing this today. Can you see if you can develop a patch?
Comment 2 Kevin Doyle CLA 2007-07-23 16:21:11 EDT
Sure.  I'll take a look at this.
Comment 3 Kevin Doyle CLA 2007-08-24 14:04:39 EDT
SystemProfileManager.renameSystemProfile() has a line commented out that would do a save using OLD api with FIXME.  What we need to do is:

RSECorePlugin.getThePersistenceManager().commitProfile(profile, 5000);	
RSECorePlugin.getThePersistenceManager().deleteProfile(profile.getPersistenceProvider(), oldName);

This won't fix the issue completely though as the dom that is retrieved for the profile to commit still contains the old name.  We need to modify RSEDOMExporter.populateRSEDOM() to set the name of the dom to the name of the profile when clean == true or profile is dirty or dom is dirty.
Comment 4 Kevin Doyle CLA 2007-08-30 14:53:00 EDT
Created attachment 77403 [details]
Renaming a profile now performs commit/delete

Legal Message: I, Kevin Doyle, declare that I developed attached code from
scratch, without referencing any 3rd party materials except material licensed
under the EPL. I am authorized by my employer, IBM Canada Ltd. to make this
contribution under the EPL.
Comment 5 David Dykstal CLA 2007-08-30 15:41:11 EDT
Inspected and tested. Patch looks good. Committing.
Comment 6 Kevin Doyle CLA 2007-11-08 10:12:02 EST
Verified fixed in I20071108.