Newly opened web page closing by itself - spring

This is going to be a bit vague but I have a setup where a web application has 2 entry points - one from parent path and other from a different application. If the user came from the parent path and uses search button it opens up a new tab without any issues. However if user accessed the web application from the external entry point and then used the search function the new tab would open but would close itself after ~3 seconds. The search tab is opened via 'windows.open({url})'command. I don't have ability to debug the backend as it's using vendor war file without source files, so I'm mainly looking for ideas what could cause such behavior. Its not browser specific.

Related

How to start "save as / open" after requesting a file from server?

I'm using MooTools as JS-Framework.
When a user clicks the "Show Report"-Button on my website I'm starting Request.HTML to retrieve the path of the requested report.
If the report does not exists yet, its been created on the server (a waiting popup is shown to the user). The report file is saved to a special path on the server and this path is returned to the browser.
After I got the path to the Report-File - the Report can reach about 5 to 8MB - I want to show the user a "Download-ProgressBar" while starting a new Request.HTML to retrieve the big report file.
Everthing until this point works fine. I got the ProgressBar filling up, after its finished I got my big file.
But my problem is now, how I can start something like "Open File" or "Save File As" from JavaScript.
I got the freaking file downloaded and shown in the console but now I want the user to save this file somewhere or to open it directly...
Kind Regard.
Why don't just show a link to that file so that it opens in a new page?
That way one can open in a new window and save from the browser's menu (or use the right click>save to menu).
Since you already have your file serialized most browsers nowadays supports the data uri scheme so if this fine to support a limited subset of browsers you can do
window.open(fileToSave, '_blank');
notably old version of IE don't support all kind of files using data-uri so it will not work for html.
There are some File API in newer browser too, and there are some other solutions involving flash but historically the right way to do this is to navigate to a server page which returns an header
Content-Disposition: attachment; filename=yourfilename.html
that will work in any browser (I used this a lot in IE6 with no particular problem).

Download Files in wp7

I am developing a windows phone application which allows user to download files from server. The user can select multiple files simultaneously for download. It works perfectly when the user stay on current page until download completed. If the user navigate to other pages when the file download is in progress the download stops. The download should continue even if the user navigate to other pages.
Also when the application exits the download stops. When the user starts the application again the pending files should automatically start download.
How can I do these?
If the files are large you should be using BackgroundTransferRequest, which will continue even if the application is not running and you can still track their progress.
For more information, see Background File Transfers Overview for Windows Phone
The first thing you need to understand is page navigation. If you are navigating from a page to another page (and not changing visibilitiea of controls) then as soon as you navigate your old page page is unloaded and null. If you have a global in your page that you navigated from then that's also null. So you have to put your downloading webclient or whatever at an application global level. Do all your downloading in App.xaml.cs or better yet create your own shared class among all pages.
Now when the application exists the App.xaml.cs Unloaded gets called. So before you unload the app you need to store the already downloaded portion in IsolatedStorage and when the app.xaml.cs gets relaunched in the loaded event handler you need to check to see if the user was downloading something in the isolated storage then complete the download.

Open TFS Work Item Attachment in Image Viewer not Web Browser

Is there a way to open an attachment for a TFS work item by double clicking on it (or rather just opening it from the IDE) in your computer's default image viewer, rather than opening it in a web browser? I'd love to be able to change this setting (if it is a setting).
Edit: after reviewing Kate Gregory's response, I looked into this option and realized that the trouble is that VS is launching a url (a handler file to respond with the attachment), which results in the default web browser being launched. A potential work around i'm considering is writing a custom mapper for all web based calls (as in, when going to start->run and enter a URL) that the mapper would determine what kind of call it is (TFS, etc) and use an appropriate program, based on the MIME type responded with, with a second phase to be incorporate this as a VS add-in.
I'm reasonably sure VS just uses your default program. Word for .doc files, IE for .htm files, and (in your case I bet) IE for .jpg files. Try changing the default program you're using in Windows and see what happens.
All files saved in TFS are saved in a path that starts with the following address:
http ://{YourServerName}TFS01:8080/tfs/.../.../...&FileName={YourFileName}.{YourExt}
This means that all files are opened using the default program defined for HTTP protocol, regardless of the extension for your file.
You can probably change the default program for your HTTP protocol (if you have permissions, and usually you wouldn't) but this would also affect opening any regular web page or URL, which is probably not recommended.
I still haven't found a workaround this issue too.
Some kind of preview function in VST/Team Explorer would be nice. Then, only a minor of attachments must be opened in the browser.
http://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/6224713-preview-attachments-in-team-explorer

Controlling multiple Internet Explorer windows?

We've got several web-based applications that are launched from our ERP system (SAP R/3 in this case, but since we're using ShellExec, I don't consider this a SAP issue). The problem is that we can either set the IE to "open every URL passed from the ERP system in a new window" or to "reuse any one of the existing IE windows" (same problem with tabs). Both settings are not acceptable for our users: one of the web applications is a rather bulky medical image viewer applet that wreaks havoc if invoked multiple times. The other option is a no-go either because this way opening the image browser for a patient automatically displaces the lab result display for the very same patient and vice versa.
I'd like to have some control over which window may or may not be reused. My idea would be a kind of "window tag" and a helper program that checks if a window with that tag exists - if it does, reuse it, if not create it. So basically
IELauncher SEARCH http://www.google.com
would open a new window and tag it as SEARCH.
IELauncher DEVEL http://stackoverflow.com
would open a second window, tagging it as DEVEL. Then
IELauncher SEARCH http://www.wikipedia.org
would replace the contents of the first (google) window only.
Is this possible at all? Do you have any pointers for me where to start? I don't even know what to look for...
I had to resort to some rather ugly methods - dynamically assembling a HTML page that uses JavaScript and window.open() to open and access a window by name, then close the page executing the JavaScript. Ugly, but at least this way you get the additional benefit of being able to control certain aspects of the browser window like switching of the menu bar, toolbar and location bar.

Opening a file from TFS using the full TFS Path, from a web site

So I have a website running that displays full path of a TFS File on the page somewhere, I want the user to be able to click on it, which should then open up that file from TFS inside their Visual Studio.
The command to do this inside Visual Studio is "File.TfsOpenFromSourceControl" (DTE command) - it's basically the user manually going to that file using the Source control explorer and double clicking to open it up.
I am wanting to simulate that action from my web app inside the browser.
Update: The Web app is a pure ASPNet MVC app with Jquery available to it. I am already showing the file's content to the user in the web app. But I want the user to open the same file in Visual studio, by clicking on the file path in the web app. The question is more of Browser to VS integration and how to execute the DTE command in question, from within the web app context of the browser.
Any clues would be helpful
I don't know the answer to Pavel's question, so I'll sketch an outline of both solutions.
If you want to display the file inside the browser, call the Item.DownloadFile() API. NB: in 2008 SP1 there is another overload of this method that allows streaming into a memory buffer instead of writing directly to the filesystem. If you don't already work with Item objects directly, you can retrieve them via the GetItem() / GetItems() APIs.
If you want to make the file open in VS, there are a couple approaches. Perhaps your web app already includes the concept of local workspace(s) for the user, similar to Source Control Explorer. If so, you'd simply call Workspace.GetLocalItemForServerItem() to find the local path of the item, then ShellExecute it. (Or maybe pass it as a command line parameter to devenv.exe, if it's not natively associated with VS.) If not, you can either create a temporary workspace on behalf of the user, or use the same DownloadFile() API shown before; stream the contents to the client over a web service, save to disk, then launch VS as before.
Naturally, the more involved scenarios under option #2 will require deeper OS integration than the DOM / Javascript can provide. Would help to know if this web app is already built on ActiveX, Flash, Silverlight, XBAP, or similar technology...

Resources