Open file with Tabris and RAP - eclipse-rap

Evaluating Tabris developed by eclipsesource, I could create a simple application browsing some filestructure from a backend. Now I would like to know how it is possible to open/show a file's content. On the serverside I created a service handler for the download. But opening a shell containing a browser widget with the URL to this service just does nothing but show a blank page. If I use "http://www.google.de" as URL then the browser shows this site.
Any ideas?

Does the service handler render html? Can you open the url from a new browser tab and is it showing your content?
Browsing files with a browser widget feels odd to me. Why not using a JFace TreeViewer to show the file structure?

In the upcoming release in December 2012 (Version 0.9.0), the AppLauncher aka OpenWith will be implemented. This will improve showing file contents with an appropriate app - so you don't heed to display everything in a Browser widget.
See: https://github.com/eclipsesource/tabris/issues/89

Related

How to preview local files in the browser in another html page

i am looking for a creative solution for a new task.
my issue is we need a way to preview local files (extentions: doc, docx, ppt, pptx, pdf, tif, jpeg) in a frame or so of a different web page which provides a link.
preview should look like an image of the files or so.
we would like to prevent parsing the files to pdf in order to save time...
we are using angular 7, c# asp.net server side.
we are very limitted in most solutions, as the data is very secure and is used in an inner office net,
that is why we can't use the google docs solution.
i also understood that using iframe tag and pointing it src attribute to the file source doesn't load the page due to security resones.
in addition all users has the ability to preview the above files types when they do it straight from the document by the open with -> IE or other browsers options.
i tried :
<iframe src="file:///C:/Users/cd/Downloads/MyFile.docx"></iframe>
but:
the iframe tag doesn't open the doc file, i can see the iframe in the DOM as a new html but it doesnt have a content of anything
i tried also for images and the same, the frame is blank
If you are using chrome then chrome specifically blocks local file access this way for security reasons.
more detail is this link : here
One possible solution is, render the document pages as images and then display them on the web page i.e. using the iframe.
You may use GroupDocs.Viewer for .NET for rendering the document pages into high-fidelity images (PNG/JPG). You can then embed the images into your web page to preview the document. This is how you can get the image representation of the pages in a Word document:
using GroupDocs.Viewer.Options;
// Set output path
string OutputPagePathFormat = Path.Combine("D:\\output", "page_{0}.png");
// Render document pages
using (Viewer viewer = new Viewer("D:\\sample.docx"))
{
PngViewOptions options = new PngViewOptions(OutputPagePathFormat);
viewer.View(options);
// Rendered images will be saved in the D:\output\ directory.
}
Disclosure: I work as a developer evangelist at GroupDocs.

How to highlight section in VScode live server when clicking my source code?

Question
The editor brackets can do that. Supposed that, when I click my html tag in my source code file, the browser would automatically highlight the section/div in the broswer like google chrome developer tools.
Step 1
Click my tag in my source code file
Step 2
the live server will automatically focus on the section I want
How could I make it in VSCode?
VS Code does not have a built-in live server. Whatever extension you are using for live server can implement this, however I am not aware of any ones that do currently. Consider filing a feature request against them for this
Look at Five Server extension.
I used to love this Live Preview of Brackets, mainly for two unique features unlike many other editors and extensions:
It shows the preview live, literally. It doesn’t wait for file save to show the changes.
Highlights the section in the preview, corresponding to the html tag in which the cursor is placed currently.
I have been looking for a similar VS Code extension for a while.
Finally found it, JUST NOW.

Chrome Extension - Use Another HTML Source

I'm creating a extension and here is what I want to do.
I have site "www.aaa.com" and the extension I developed can read and navigate DOM element by javascript. However, when I click the extension icon, I'd like get and read the HTML source from "www.bbb.com".
The current page is "www.aaa.com", but want to get the source of "www.bbb.com" in the current page.
How can I do this??

MS Dynamics CRM, Web resources (.html) and "custom" Doctype

I'm trying to create heat map on bing maps ajax control using some data from CRM database. For that I created web resource and uploaded it to CRM. I set up button which when clicked open my web resource (.html) with heat maps. Because I'm using BingMaps Ajax v7 control and HTML5 canvas for displaying generated heatmap (as image) I need to have Doctype declaration on my web resource. But everytime when I put that in my html page, while uploading it to CRM (or editing), CRM just delete my Doctype and then I only have
<html>
<head>
...
</head>
</body>
...
</body>
</html>
Heat map is working great because I tested it on my local machine (outside CRM). Using IE Dev tools I'm getting error that getContext() method is not found... So, my guess is that I'm missing doctype which CRM deletes every time when I edit or upload web resource. So my question is how to successfully show HTML5 content in Microsoft Dynamics CRM using Web resource (plain .HTML file). I don't need to have that web resource in CRM form page... When I click map button, web resources need to be opened in separate browser page.....
Thank you in advance!
SOLUTION
If you ever hit this like me, don't use CRM TextEditor because he is removing Doctype tag when you edit your resource using him..
Solution is to edit your web resource on your local machine using your personal text editor and upload it again in CRM. And in this case Doctype tag will be there..

Salesforce.com - Visualforce and ActiveX

I have a Visualforce page through which I am trying to access a SDK. It is done using ActiveX control. The VB + JS script that I have runs fine when it is a normal HTML page residing on my desktop. However the same code when incorporated in Visualforce does not work. Does running ActiveX control require uploading any kind of files to Static Resource? My code need not be a Visualforce. If there is any other way I could integrate ActiveX with Salesforce, even that would be fine.
Thanks in Advance.
If you need somewhere to host the .cab (or .ocx) file, then you can put that in a static resource, and reference that from your VF code.
What browser are you using to test? If IE6 it may need you to enable the ActiveX controls.
If you go to Tools->Internet Options->Security Tab. Click ‘Custom’ and OK any message. Then scroll down to ‘Script Active X Controls ….’. This should be enabled.'