Bug 430481 - [import/export] Install Software Items from File - support for HTTP
Summary: [import/export] Install Software Items from File - support for HTTP
Status: RESOLVED WONTFIX
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: p2 (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: P2 Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: bugday
Depends on:
Blocks:
 
Reported: 2014-03-16 13:44 EDT by Lars Vogel CLA
Modified: 2020-12-04 04:31 EST (History)
12 users (show)

See Also:


Attachments
Team Project Set dialog (35.62 KB, image/png)
2014-03-31 09:45 EDT, Paul Webster CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Vogel CLA 2014-03-16 13:44:29 EDT
We as the platform provide a p2f file for newe contributors. Would be nice if they can access the file directly via http from the Git repo:

http://git.eclipse.org/c/platform/eclipse.platform.ui.git/plain/releng/org.eclipse.ui.releng/platformUiTools.p2f

Currently only the file protocol is supported.
Comment 1 Pascal Rapicault CLA 2014-03-16 18:37:33 EDT
This could be a nice contribution for the hackathon
Comment 2 Lars Vogel CLA 2014-03-16 19:07:49 EDT
Affect class: ImportPage from the
org.eclipse.equinox.p2.ui.importexport plug-in
Comment 3 Lars Vogel CLA 2014-03-16 19:09:35 EDT
I think this method would need to get adjusted: 

protected void handleDestinationChanged(String newDestination)
Comment 4 Paul Webster CLA 2014-03-16 19:29:05 EDT
See File>Import...>Team Project Set for how they do it, and org.eclipse.team.internal.ui.wizards.ProjectSetImportWizard is the class that implements it.

PW
Comment 5 Lars Vogel CLA 2014-03-17 10:32:28 EDT
(In reply to Paul Webster from comment #4)
> See File>Import...>Team Project Set for how they do it, and
> org.eclipse.team.internal.ui.wizards.ProjectSetImportWizard is the class
> that implements it.
> 
> PW

I think this class delegates to  org.eclipse.compare.internal.Utilities.getURLContents, which is internal API. Don't we have a public API in the platform for retrieving the content of a file for a giving URL?
Comment 6 Pascal Rapicault CLA 2014-03-17 10:39:39 EDT
Please use the org.eclipse.equinox.internal.p2.repository.Transport class from p2. This is known to work with proxy, authentication and offers cancellability.
Comment 7 Lars Vogel CLA 2014-03-17 10:45:10 EDT
(In reply to Pascal Rapicault from comment #6)
> Please use the org.eclipse.equinox.internal.p2.repository.Transport class
> from p2. This is known to work with proxy, authentication and offers
> cancellability.

RepositoryTransport.stream looks good
Comment 8 Felix Heppner CLA 2014-03-28 16:47:58 EDT
Added Fix with 

https://git.eclipse.org/r/#/c/24111/

The UI does not reflect the possibility to use a URL as well. Is this okay? Or expected?
Comment 9 Pascal Rapicault CLA 2014-03-28 17:18:41 EDT
Thanks for you contribution. Make sure to also update the UI because otherwise people won't be able to use the new functionality.

I retriggered a build because there were issues with Git clone.
Comment 10 Pascal Rapicault CLA 2014-03-28 17:22:49 EDT
https://hudson.eclipse.org/p2/job/p2-gerrit/202/
Comment 11 Felix Heppner CLA 2014-03-28 18:57:03 EDT
I will have a look for the UI. 

Any hints how to get rid of the line ending stuff in the gerrit change? It might be a little late today but for me it seems like my local line endings are unix style. Although on windows platform. Is there any git magic to configure?
Comment 12 Lars Vogel CLA 2014-03-28 19:05:37 EDT
(In reply to Felix Heppner from comment #11)
> I will have a look for the UI. 
> 

I think a label is sufficient, e.g., enter an URL or select a file via the Browse button.
Comment 13 Felix Heppner CLA 2014-03-29 03:39:28 EDT
I see two possibilities for the UI.

First is to change the description in the wizzard page from "Install the software mentioned in the description file." to "Enter an URL or select a file via the Browse button." A concatenation of both sentences would be possible but too long imo.

Second is to decorate the input with a litte blue "i" Icon and a tool tip with a text similar to that proposed by Lars. This would be the same look as in "Install new software" page where it is possible to type or paste repository urls in the site input / combo box (Work with:).

The first one is esay to implement. Simply change the string resource. My first idea was to implement the decoration, for consistency with the other wizzard look.

Any preferences for the one or the other possibility or other other ideas?
Comment 14 Lars Vogel CLA 2014-03-29 06:05:44 EDT
Pascal has the final say here, but I like option 1.
Comment 15 Felix Heppner CLA 2014-03-29 09:01:39 EDT
I tried (easy) first UI tweak and I think this is fine and enough. 

It actually has been too late yesterday. It seems like the source in repository has windows line endings and my "autocrlf" config in git made it unix style during push. My change now contains the changed string for UI and the source with windows style line endings.
Comment 16 Paul Webster CLA 2014-03-31 09:45:20 EDT
Created attachment 241434 [details]
Team Project Set dialog

In the Team Project Set dialog, they offer the URL field as a separate box, with a dropdown.

Any reason we can't do it the same way (for consistency).

PW
Comment 17 Felix Heppner CLA 2014-03-31 11:27:13 EDT
We can definitely do it like in the Team Project Set dialog. It is only code. I am not sure if I really like this solution better than the simple one. Consistency is an argument though. Since there is some hierarchy for the import/export page class the explicit choice solution will require a couple of lines of code to implement this "clean".

Pascal, any comments from you about the direction to go?
Comment 18 Pascal Rapicault CLA 2014-04-07 14:06:04 EDT
Sorry for the late reply. I lie Paul's request because then it becomes obvious for users that it is now possible to specify a URL.
Comment 19 Lars Vogel CLA 2014-04-07 14:14:53 EDT
(In reply to Pascal Rapicault from comment #18)
> Sorry for the late reply. I lie Paul's request because then it becomes
> obvious for users that it is now possible to specify a URL.

Hurry Felix, M7 is going soon (I think next week) and that means feature freeze, AFAIK.
Comment 20 Pascal Rapicault CLA 2014-04-07 14:20:00 EDT
Don't need to stress him Lars :)
We have been leaving without this for years so it can wait. 
M7 is May 5th so we have another 3w.
Comment 21 Felix Heppner CLA 2014-04-08 02:24:32 EDT
I started having a look at the UI in "team Project Set" style. I can't promise a solution for this week ...

Is there a (written) policy for dependencies? The UI code might be easier and "cleaner" when using jface databinding instead of a couple of listeners at UI events. I will start without databinding and mimic the existing style in ImportPage and Team Project Set code.
Comment 22 Lars Vogel CLA 2014-04-28 16:47:50 EDT
(In reply to Felix Heppner from comment #21)
> I started having a look at the UI in "team Project Set" style. I can't
> promise a solution for this week ...
> 
> Is there a (written) policy for dependencies? The UI code might be easier
> and "cleaner" when using jface databinding instead of a couple of listeners
> at UI events. I will start without databinding and mimic the existing style
> in ImportPage and Team Project Set code.

I think runtime components cannot use databinding (higher level component)
Comment 23 Lars Vogel CLA 2014-11-10 10:38:31 EST
(In reply to Lars Vogel from comment #22)
> (In reply to Felix Heppner from comment #21)

Any update here Felix?
Comment 24 Felix Heppner CLA 2014-11-11 09:38:04 EST
Hm ... I have to admit that this issue went pretty much down in my to do list. Thanks for the reminder. Not much to be done afair. I promise to give it some love soon. Sorry.
Comment 25 Felix Heppner CLA 2014-11-24 03:37:20 EST
Pushed changes to https://git.eclipse.org/r/#/c/24111/12

Jenkins build fail due to a failing test (org.eclipse.equinox.p2.tests.ui.actions.ElementUtilsTest.testUpdateUsingElements see https://hudson.eclipse.org/p2/job/p2-gerrit/287/) most likely not related to my changes. The tests already failed prior to my changes but I hadn't checked it before. The failing test passes in my IDE. I didn't find the time to set up the environment to run the maven build locally.
Comment 26 Lars Vogel CLA 2015-09-28 05:18:43 EDT
Adding Stefan, as he showed interest in making the test setup easier via bug 478485.
Comment 27 Stefan Xenos CLA 2016-05-17 10:30:18 EDT
IMO, the oomph setup scripts make the p2f files irrelevant. They're much easier to use and more powerful. I'd suggest that we delete the p2f scripts and eliminate the extra maintenance burden.
Comment 28 Lars Vogel CLA 2016-05-17 10:32:27 EDT
(In reply to Stefan Xenos from comment #27)
> IMO, the oomph setup scripts make the p2f files irrelevant. They're much
> easier to use and more powerful. I'd suggest that we delete the p2f scripts
> and eliminate the extra maintenance burden.

This should go to a separate bug for the corresponding project. This bug is about the support for this feature in p2, if we decide not to use it in platform UI that is a different story.
Comment 29 Stefan Xenos CLA 2016-05-17 11:24:16 EDT
Fair enough. You're right that this feature makes sense independently of what the UI team does with it.