Bug 231827 - [remotecdt][api] Default for Remote path to executable should be computed automatically
Summary: [remotecdt][api] Default for Remote path to executable should be computed aut...
Status: RESOLVED FIXED
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: 3.0   Edit
Hardware: All All
: P2 enhancement (vote)
Target Milestone: 3.0 RC1   Edit
Assignee: Johann Draschwandtner CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords: api, contributed, helpwanted
Depends on:
Blocks: 233057
  Show dependency tree
 
Reported: 2008-05-13 10:39 EDT by Martin Oberhuber CLA
Modified: 2011-05-25 07:34 EDT (History)
6 users (show)

See Also:


Attachments
proposed patch (12.49 KB, patch)
2008-05-19 04:48 EDT, Johann Draschwandtner CLA
mober.at+eclipse: iplog+
Details | Diff
Updated patch (23.50 KB, patch)
2008-05-20 15:54 EDT, Martin Oberhuber CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Oberhuber CLA 2008-05-13 10:39:11 EDT
The remote cdt launch currently requires entering the path to the executable twice: once the location in the workspace (for debugger and upload), and once the remote location (for upload, and starting the executable).

For the common case that there exists a mapping between the local workspace and the corresponding path on the remote machine, the launch should be able to compute the remote path automatically. Also, users should be able to predefine a default for the "skip upload" checkbox per connection.

Suggested solution is as follows:
---------------------------------
1.) remotecdt plugin defines a propertyset ("org.eclipse.rse.remotecdt")
2.) remotecdt plugin searches for that propertyset attached to the IHost
    that's currently selected. If that propertyset is found attached to the
    IHost, then
2.1.) If "defaultSkipDownload" property is set, then the "skip download"
      checkbox is activated.
2.2.) If "remoteWsRoot" property is set, then a remote path based on the
      remoteWsRoot location is computed automatically.

The remote cdt launch main tab should install a listener on the "connection" dropdown. When either (a) a new Launch is created, or (b) the selected Launch is changed, then remotecdt tries to pre-fill the "remote execution path" and "skip download" controls according to the algorithm above.

This is an API Addition Request, because the Strings that identify the Properties being used need to be public API:
   "org.eclipse.rse.remotecdt"
   "defaultSkipDownload"
   "remoteWsRoot"
Since API Freeze is over already, these Strings should be created in an "internal" package for now, and labelled as EXPERIMENTAL. The existing IRemoteConnectionConfigurationConstants interface can be used to hold these experimental API Strings, since the other constants in that interface are also "experimental API" in the sense that they can be used to programmatically create a RemoteCDT Launch.
Comment 1 Martin Oberhuber CLA 2008-05-13 10:40:24 EDT
We will accept patches for this feature addition.
Comment 2 Martin Oberhuber CLA 2008-05-13 17:11:42 EDT
I think that ideally, the remotecdt launcher should also be enhanced to add a "Properties" button beside the connection dropdown, which shows a Dialog for creating / editing the properties stored in the remotecdt propertyset:

  * Remote Workspace Location
  * Default for "Skip Download"

Xuan, Dave: Does the IBM PII drop include remotecdt?
Comment 3 Xuan Chen CLA 2008-05-13 20:53:24 EDT
I think so.  

CC Vivian here:

Vivian, could you confirm that is true?  Thanks.
Comment 4 Chris Recoskie CLA 2008-05-14 10:02:48 EDT
(In reply to comment #3)
> I think so.  
> CC Vivian here:
> Vivian, could you confirm that is true?  Thanks.

This isn't a CDT component so we wouldn't know.  You'd have to ask whomever is in charge of PII drops for RSE (Dave Dykstal?)
Comment 5 Xuan Chen CLA 2008-05-14 11:32:26 EDT
Thanks for the information, Chris.  

Martin, I don't think it is part of our PII drop.
Comment 6 Johann Draschwandtner CLA 2008-05-19 04:48:53 EDT
Created attachment 100869 [details]
proposed patch
Comment 7 Martin Oberhuber CLA 2008-05-19 17:56:12 EDT
Patch looks good, though the new file (IRemoteConnectionConstants.java) does not seem to have a proper EPL Copyright Header.

Drasch, can you please add a comment here on bugzilla, saying that you contribute your work under the EPL and have the rights to do so, as per http://www.eclipse.org/dsdp/tm/development/committer_howto.php#external_contrib
Comment 8 Johann Draschwandtner CLA 2008-05-20 02:03:02 EDT
I, Johann Draschwandtner, 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 to make this contribution under the EPL.
Comment 9 Martin Oberhuber CLA 2008-05-20 15:54:02 EDT
Created attachment 101128 [details]
Updated patch

Attached updated patch with following modifications:

  * Created correct Copyright Headers everywhere
  * Replaced Java5-only Boolean.parseBoolean() by Java4 
    Boolean.valueOf(String).booleanValue()
  * Created Class Javadoc with @noinstantiate, EXPERIMENTAL and @since for 
    the new IRemoteConnectionConstants interface

Committing the patch with these modifications. Thanks for the Contribution, it's 128 lines of code.

One minor gotcha I found is that in case no connection at all is available in RSE yet (i.e. "Local" is not installed and RSE is started the first time), the connection dropdown can be empty with nothing selected. The Properties button should be disabled in this case. This can also happen if none of the available connections fits the needs of remotecdt (shell subsystem available).
Comment 10 Martin Oberhuber CLA 2008-05-20 15:59:02 EDT
Another Gotcha is that when choosing Properties for Local, the dialog is shown but no values are editable. The button should better be disabled in this case.
Comment 11 Martin Oberhuber CLA 2008-05-20 16:02:41 EDT
Filed bug 233057 for dealing with the two minor gotchas.