Bug 197199 - [Persistence] Renaming a Profile doesn't cause a save
Summary: [Persistence] Renaming a Profile doesn't cause a save
Status: CLOSED FIXED
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 2.0.1   Edit
Assignee: David Dykstal CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2007-07-19 16:35 EDT by Kevin Doyle CLA
Modified: 2011-05-25 09:37 EDT (History)
1 user (show)

See Also:


Attachments
Renaming a profile now performs commit/delete (3.13 KB, patch)
2007-08-30 14:53 EDT, Kevin Doyle CLA
mober.at+eclipse: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.