This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 221505 - Provide access to proxy settings from HTML5 Application wizard
Summary: Provide access to proxy settings from HTML5 Application wizard
Status: RESOLVED FIXED
Alias: None
Product: web
Classification: Unclassified
Component: HTML Project (show other bugs)
Version: 7.3
Hardware: All All
: P3 normal (vote)
Assignee: Tomas Mysik
URL:
Keywords:
Depends on:
Blocks: 222738
  Show dependency tree
 
Reported: 2012-11-05 16:51 UTC by Petr Jiricka
Modified: 2012-11-30 02:43 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
illustrative screenhost (19.86 KB, image/png)
2012-11-26 22:44 UTC, David Konecny
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Jiricka 2012-11-05 16:51:00 UTC
1. Start up NetBeans in a network environment where proxy is required (e.g. Oracle network)
2. Switch to a network environment with direct internet access (WiFi)
3. Create New HTML5 Application; select one of the Online templates in the Site Templates step

=> Downloading the template will time out, and the wizard will display error message "Can not prepare template "Initializr (Responsive)" (see IDE log for more details)."

And the IDE log contains:
java.net.ConnectException: Operation timed out
	at java.net.PlainSocketImpl.socketConnect(Native Method)
....
	at java.net.URL.openStream(URL.java:1037)
	at org.netbeans.modules.web.clientproject.sites.SiteHelper.download(SiteHelper.java:103)
....

I.e. a network connection problem.

It would be useful to give the user access to proxy settings here, so she can correct the proxy settings.
Comment 1 David Konecny 2012-11-21 22:45:30 UTC
There are few places where we are downloading code from the net - templates, libraries, project samples, etc. I wonder whether we should add some helper API method to show an error dialog with a warning that download of some URLs failed and what these URLs are and also have a button to "Configure Proxy" and "Try Again" and "Cancel" of course. And we would use this error dialog whenever we failed to download something. The dialog would return results:
- Cancel
- TryAgain

Do you think that would work Tomas?
Comment 2 Tomas Mysik 2012-11-22 07:39:06 UTC
Well, it would work I think. In this particular case, we call siteTemplate.prepare() method. But this method is not only about downloading, it is about general preparing (e.g. unzip template which can also throw an IOException) so we should add NetworkException (extends IOException) or similar and show the dialog only if this exception is thrown (it would be thrown from SiteHelper.download() in our case).

One note: of course, I would like to see this kind of support in core NetBeans so everyone could benefit from it - but we can propose such API later once we know that it is useful.

What do you think?

BTW I should be able to implement it so feel free to reassign to me if you want to. I would also use it in the new project wizard (sorry don't know anything about libraries or samples).

Thanks.
Comment 3 David Konecny 2012-11-22 18:43:33 UTC
(In reply to comment #2)
> One note: of course, I would like to see this kind of support in core NetBeans

Yes, an API in our web.clientproject.api for now.

> BTW I should be able to implement it so feel free to reassign

That would be great. Thanks!

> I would also use it in the new project wizard (sorry don't know anything
> about libraries or samples).

In "JavaScript Files" (in new project wizard or via project properties)  we do downloading of remote files too, right? And MartinJ in web.clientproject.samples is reusing OnlineSites to download remote files so he could use this API too.
Comment 4 Tomas Mysik 2012-11-26 11:01:18 UTC
Fixed, any comments are welcome, of course.

The "NetworkFailed" dialog is shown during:
- preparing template,
- downloading JS libraries (only in new project wizard; project properties stay unchanged - they only inform about failed libraries).

Please verify, thanks.

http://hg.netbeans.org/web-main/rev/20b02c764b72
Comment 5 Tomas Mysik 2012-11-26 11:25:38 UTC
Missing classes added, sorry.

http://hg.netbeans.org/web-main/rev/262a11dc7e84
Comment 6 David Konecny 2012-11-26 22:44:52 UTC
Created attachment 128424 [details]
illustrative screenhost

I've tried it as I have frequently problems with download of initializr templates. It works fine I think. The dialog could look slightly more appealing though - see the attachment.
Comment 7 Quality Engineering 2012-11-27 02:57:12 UTC
Integrated into 'main-golden', will be available in build *201211270002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/20b02c764b72
User: Tomas Mysik <tmysik@netbeans.org>
Log: #221505 - Provide access to proxy settings from HTML5 Application wizard
Comment 8 Tomas Mysik 2012-11-27 09:56:20 UTC
I see; I will likely truncate the given URLs...

Thanks for catching that.
Comment 9 David Konecny 2012-11-27 20:07:16 UTC
(In reply to comment #8)
> I see; I will likely truncate the given URLs...

<priority=P4>Hmmm... keeping whole URL would be good for users so that they can see what we are downloading. However if shortened URL is clickable (that is clicking it opens it using standard URLDisplayer) then it would be perfectly OK to shorten it.</priority>
Comment 10 Tomas Mysik 2012-11-28 05:21:38 UTC
Good point, I will do it if the given "request" is a URL.
Comment 11 Tomas Mysik 2012-11-28 11:12:02 UTC
Fixed.

http://hg.netbeans.org/web-main/rev/f7d9df9c4a67
Comment 12 Quality Engineering 2012-11-30 02:43:56 UTC
Integrated into 'main-golden', will be available in build *201211300001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/f7d9df9c4a67
User: Tomas Mysik <tmysik@netbeans.org>
Log: #221505 cont' - Provide access to proxy settings from HTML5 Application wizard

Hyperlinks added and long requests are truncated.