Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 323542 - Need to be able to use labels for server status/state other than the existing ones.
Summary: Need to be able to use labels for server status/state other than the existing...
Status: CLOSED FIXED
Alias: None
Product: WTP ServerTools
Classification: WebTools
Component: wst.server (show other bugs)
Version: unspecified   Edit
Hardware: PC All
: P3 enhancement (vote)
Target Milestone: 3.2.2   Edit
Assignee: Angel Vera CLA
QA Contact: Angel Vera CLA
URL:
Whiteboard: PMC_approved
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-24 17:37 EDT by Rajiv Senthilnathan CLA
Modified: 2017-10-11 16:57 EDT (History)
4 users (show)

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


Attachments
v1.0 - for 3.2.2 (multi-project patch) (22.65 KB, patch)
2010-08-25 12:12 EDT, Angel Vera CLA
no flags Details | Diff
sample extension point adopter (5.10 KB, application/x-zip-compressed)
2010-08-25 12:14 EDT, Angel Vera CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rajiv Senthilnathan CLA 2010-08-24 17:37:00 EDT
Build Identifier: 

My product is built on top of WTP and I need to be able to change the label for the server status from the traditional start, stop, starting, stopping states. I don't see that there is a way to do that with the existing way that the server states are managed.

Reproducible: Always
Comment 1 Angel Vera CLA 2010-08-25 10:38:04 EDT
Rajiv, 

You are right there is no way of doing this. From the conversation that we had offline and looking into the code this would be a pretty simple request to fulfill, I got the code almost ready. We will allow access to change the state label in the UI only, the underlying code and states are the same. Because the underlying code is the same, I will create a new extension point that loads serverLabelProviders per server type and request them to provide a new label, instead of the default provided. 

As I understand you need this function in 3.2.2. Since this is new function and a new extension point in a maintenance release we need PMC approval.
Comment 2 Angel Vera CLA 2010-08-25 11:03:20 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 this is a not a stop-ship this is new function requested by the adopter in a maintenance release. 

* Is there a work-around? If so, why do you believe the work-around is insufficient? 
There is no workaround for this function

* How has the fix been tested? Is there a test case attached to the bugzilla record? Has a JUnit Test been added? 
I will add a JUnit to ensure that we don't break this provisional API, and extension point

* Give a brief technical overview. Who has reviewed this fix? 
The fix in this case is simple. 

There is two places where the state label is requested. This two places will be now combined into one place in the ServerDecorator class. Whenever a request is made for the server state label, we will try to find (in a pre-loaded HashMap) a adopter who has implemented the extension point for a particular server type, if one is given then he will be responsible for providing a translated state label to be displayed in the UI, instead of the default: Started, Starting, Stopped, Stopping, etc.. 

If no adopters are found the LabelProvider will revert back to its original behaviour using a default pre-loaded class. If two or more LabelProvider adopters are found for one server type, to avoid conflict the LabelProvider will be the one default pre-loaded class provided by WTP and a warning will be printed in the log. This ensure that there is always a meaningful label provided for the different states of a server for all types of servers.

The adopter of this extension point is responsible for fast performance to still provide a reasonable UI response of the ServersView.

* What is the risk associated with this fix? 
none to minimal, as this is a new extension point. 

The testing with no providers will guarantee that there is no impact for adopters who do not implement this new extension point. The testing with an extension point will guarantee that the function works correctly, and minimize the bugs, if any.
Comment 3 Kaloyan Raev CLA 2010-08-25 11:15:34 EDT
Sounds like one that I would approve. 
But it is fair to have a patch with the change attached to this bug.
Comment 4 Angel Vera CLA 2010-08-25 12:12:36 EDT
Created attachment 177438 [details]
v1.0 - for 3.2.2 (multi-project patch)

Sorry for the delay on adding the patch. I was doing some final adjustment to the code adding javadocs and jUnit. 

The attached is a multi-project patch that contains all the changes for:
 org.eclipse.wst.server.ui 
 org.eclipse.wst.server.ui.tests
Comment 5 Angel Vera CLA 2010-08-25 12:14:05 EDT
Created attachment 177439 [details]
sample extension point adopter
Comment 6 Angel Vera CLA 2010-08-25 16:10:26 EDT
Changes committed to 32M
Comment 7 Angel Vera CLA 2010-08-25 16:12:27 EDT
changes released to 32M
Comment 8 Angel Vera CLA 2010-08-25 16:23:39 EDT
changes committed to HEAD (3.3)
Comment 9 Angel Vera CLA 2010-08-25 16:25:17 EDT
changes released to HEAD(3.3)
Comment 10 Eclipse Genie CLA 2017-10-11 16:34:33 EDT
New Gerrit change created: https://git.eclipse.org/r/108986
Comment 11 Eclipse Genie CLA 2017-10-11 16:34:36 EDT
New Gerrit change created: https://git.eclipse.org/r/108987
Comment 12 Eclipse Genie CLA 2017-10-11 16:53:51 EDT
New Gerrit change created: https://git.eclipse.org/r/109833