Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 286699 - ServerEditorPart.doSave never called by ServerEditor
Summary: ServerEditorPart.doSave never called by ServerEditor
Status: RESOLVED FIXED
Alias: None
Product: WTP ServerTools
Classification: WebTools
Component: wst.server (show other bugs)
Version: 3.1   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.2 RC2   Edit
Assignee: Angel Vera CLA
QA Contact: Angel Vera CLA
URL:
Whiteboard: PMC_approved
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-14 20:30 EDT by Rob Stryker CLA
Modified: 2017-10-11 16:33 EDT (History)
3 users (show)

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


Attachments
Calls doSave() on editor pages (1.07 KB, patch)
2009-08-14 20:31 EDT, Rob Stryker CLA
no flags Details | Diff
Fixed the ticks count (1.40 KB, patch)
2009-08-14 21:19 EDT, Rob Stryker CLA
no flags Details | Diff
v1.1 (1.90 KB, patch)
2010-05-17 10:10 EDT, Angel Vera CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rob Stryker CLA 2009-08-14 20:30:01 EDT
The server editor can have multiple pages. I've added a page which extends ServerEditorPart. However, ServerEditor.doSave() does not call doSave() on the children parts / pages. 

I recognize the idea here is that we should only be editing objects in the IServerWorkingCopy and so the parts themselves shouldn't need to save anything, however our editor would like to keep some data in an xml file in workspace metadata rather than inside the IServer / IServerWorkingCopy.  

The Javadoc for ServerEditorPart does not state that these methods will not be called, and so I'm assuming they should still be called. 

Attaching a patch for ServerEditor
Comment 1 Rob Stryker CLA 2009-08-14 20:31:17 EDT
Created attachment 144606 [details]
Calls doSave() on editor pages
Comment 2 Rob Stryker CLA 2009-08-14 21:19:30 EDT
Created attachment 144607 [details]
Fixed the ticks count
Comment 3 Angel Vera CLA 2009-08-18 16:51:41 EDT
In theory sounds reasonable to me as long as adopters don't have to implement the doSave() method, will look into it for 3.2 M2
Comment 4 Rob Stryker CLA 2009-08-19 17:46:32 EDT
EditorPart already requires an implementation of doSave(), so it should already be in one of the superclass implementations. Subclasses that override will now have it called / respected. 
Comment 5 David Williams CLA 2009-10-29 15:01:57 EDT
Does this meet the definition of "blocker" as given in 
http://wiki.eclipse.org/WTP/Conventions_of_bug_priority_and_severity

To my naive read, it sounds more like an enhancement request?
Comment 6 Rob Stryker CLA 2009-10-29 16:28:10 EDT
According to the conventions, I would group this with expected behaviour which is not present and I'm reclassifying as a normal bug.

I do have to wonder, however, why the server team seems to take a fairly long time to review and close out bugs which already include patches attached to the bug.
Comment 7 Nitin Dahyabhai CLA 2009-10-29 17:17:01 EDT
Nothing says that it should have been calling doSave() on factory-created pages, as far as I can see.

I've set the review flag to make it easier for Angel to find.
Comment 8 Rob Stryker CLA 2009-10-29 18:03:04 EDT
Nothing explicitly says it should be, however, I would imagine the purpose of adding a page to an editor is so that you can edit more details of the server. An expectation of being able to edit is being able to persist those edits. 

If the new page cannot persist its changes to the server, then I'd see this as a problem and a gap in expected functionality.
Comment 9 Angel Vera CLA 2010-05-17 10:10:15 EDT
Created attachment 168734 [details]
v1.1

Added a null check and updated the copyrights.
Comment 10 Angel Vera CLA 2010-05-17 10:23:29 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. 

Although not a stop-ship. The fix is simple and something that adopter requires to implement their function to persist data in a xml file different from the .server file. 

* Is there a work-around? If so, why do you believe the work-around is insufficient? 
There might be another way , but reality is that it might be more complex that it would need to be. This patch calls the editorPart.save which is a much simpler and clean solution.

* How has the fix been tested? Is there a test case attached to the bugzilla record? Has a JUnit Test been added? 
I created different servers and launched the server editor

* Give a brief technical overview. Who has reviewed this fix? 
A reviewed the patch submitted by Rob and added a null check and updated the copyrights

* What is the risk associated with this fix? 
low
Comment 11 Angel Vera CLA 2010-05-18 11:04:48 EDT
changes committed to HEAD
Comment 12 Angel Vera CLA 2010-05-18 13:29:57 EDT
released to HEAD
Comment 13 Eclipse Genie CLA 2017-10-11 16:33:36 EDT
New Gerrit change created: https://git.eclipse.org/r/108954