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

Bug 333762

Summary: HTTPLaunchable should accept a provider and not a URL
Product: [WebTools] WTP ServerTools Reporter: Angel Vera <arvera>
Component: wst.serverAssignee: Angel Vera <arvera>
Status: RESOLVED FIXED QA Contact: Angel Vera <arvera>
Severity: normal    
Priority: P2    
Version: 3.1   
Target Milestone: 3.2.3   
Hardware: PC   
OS: Windows XP   
See Also: https://git.eclipse.org/r/109011
https://git.eclipse.org/r/109012
https://git.eclipse.org/r/109837
https://git.eclipse.org/c/servertools/webtools.servertools.git/commit/?id=935e0f1f64042a72a4a45e014c3130fe9da383a5
Whiteboard:
Attachments:
Description Flags
v1.0 none

Description Angel Vera CLA 2011-01-07 11:40:30 EST
For Run on Server scenarios, adopters that use HTTPLaunchable are required to calculate the URL much earlier than what is needed. 

In other words, LaunchableAdapterDelegateonly contains one method that requires to return the launchable Object for the moduleArtifact. If adopters decide to use the HTTPLaunchable as the object being returned, they are forced to have to calculate the complete URL to be launched by the browser during the LaunchableAdapterDelegate.getLaunchable, which is called very early during the Run On Server path. 

A better way of doing things, is to allow to calculate the URL at the precise moment is required during the browser.openURL. 

The new support needs to be backward compatible so that adopters are not forced to move to the delay URL calculation.
Comment 1 Angel Vera CLA 2011-01-07 14:08:40 EST
Created attachment 186299 [details]
v1.0
Comment 2 Angel Vera CLA 2011-01-07 14:14:45 EST
With the new code adopters do not need to change their current code, but it would be preferable that they do. 

To delay the calculation of the URL to be launched in the browser, adopters would need to create a class that implements IURLProvider2, create a constructor that accept the required objects (e.g. Server and IModuleArtifact) and then provide an implementation to getLaunchableURL() so that it can correctly open a browser in the correct URL. 

We didn't want to make IURLProvider2 context specific to the Run On Server scenario in case we can use the interface in a different place.
Comment 3 Angel Vera CLA 2011-01-07 14:49:14 EST
Changes committed to 32M
Comment 4 Angel Vera CLA 2011-01-07 14:51:47 EST
changes released to 32M
Comment 5 Angel Vera CLA 2011-01-07 15:06:50 EST
changes committed to HEAD
Comment 6 Angel Vera CLA 2011-01-07 15:11:32 EST
changes released to HEAD
Comment 7 Eclipse Genie CLA 2017-10-11 16:35:27 EDT
New Gerrit change created: https://git.eclipse.org/r/109011
Comment 8 Eclipse Genie CLA 2017-10-11 16:35:28 EDT
New Gerrit change created: https://git.eclipse.org/r/109012
Comment 9 Eclipse Genie CLA 2017-10-11 16:53:59 EDT
New Gerrit change created: https://git.eclipse.org/r/109837