Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » PDF, JPG, DOC etc.
PDF, JPG, DOC etc. [message #652500] Fri, 04 February 2011 10:06 Go to next message
Edin Edin is currently offline Edin EdinFriend
Messages: 101
Registered: January 2010
Senior Member
Hello,

is it possible with RAP to create a ViePart, that shows Files of PDJ, JPG, DOC or similar common File type? Perhaps, if the Browser has a Plugin for woking with that file type, i would like to open that file with the plugin and show it only i the view.

Thanx Edin
Re: PDF, JPG, DOC etc. [message #652689 is a reply to message #652500] Sat, 05 February 2011 10:38 Go to previous messageGo to next message
Ralf Sternberg is currently offline Ralf SternbergFriend
Messages: 1313
Registered: July 2009
Senior Member

Hi Edin,

you can use the Browser widget to display all file types the browser is
capable of. I'm not sure about DOC, but I seem to remember that even this
can be done somehow. The browser widget would load the files from a URL,
they should be delivered by a ServiceHandler. You can derive your
solution from this recipe [1] in our FAQ.

Hope this helps, Ralf

[1] http://wiki.eclipse.org/RAP/
FAQ#How_to_display_dynamically_created_images.3F

--
Ralf Sternberg

Twitter: @ralfstx
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: PDF, JPG, DOC etc. [message #657062 is a reply to message #652689] Tue, 01 March 2011 13:59 Go to previous messageGo to next message
Edin Edin is currently offline Edin EdinFriend
Messages: 101
Registered: January 2010
Senior Member
Hello,

im trying to show a pdf doc in an browser Object.
When i set the url with setUrl method and give some http adress, everything works fine. i can change the url to another http url and browser reloads to the new pdf. But if i want to show some pdf from local file system i.e.
browser.setUrl("file:///d:/backup/file.pdf");
file doesnt get shown. If i add this file url manually to firefox, it gets shown.
any idea, what the reason might be?

Greetings Edin
Re: PDF, JPG, DOC etc. [message #657264 is a reply to message #657062] Wed, 02 March 2011 08:57 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2359
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Edin,
due to browser security policies, it's not possible to show a file from
the local file system (forced by javascript). I will suggest to register
the "file.pdf" as a resource on the server and show it to the clients
with http protocol.
HTH,
Ivan

On 3/1/2011 3:59 PM, ededagic wrote:
> Hello,
>
> im trying to show a pdf doc in an browser Object. When i set the url
> with setUrl method and give some http adress, everything works fine. i
> can change the url to another http url and browser reloads to the new
> pdf. But if i want to show some pdf from local file system i.e.
> browser.setUrl("file:///d:/backup/file.pdf");
> file doesnt get shown. If i add this file url manually to firefox, it
> gets shown. any idea, what the reason might be?
>
> Greetings Edin
Re: PDF, JPG, DOC etc. [message #658370 is a reply to message #657264] Tue, 08 March 2011 09:05 Go to previous messageGo to next message
Edin Edin is currently offline Edin EdinFriend
Messages: 101
Registered: January 2010
Senior Member
Thnx Ivan,

can you give me an example how to register a ressource?
I have an order c:/backup and the apps http is
http://127.0.0.1:8080/webapp?startup=hello
the content of backup increases every time a user uploads sth. He also have a list of backup files and i want him be able to open that file by doubleclick in rap browser.
that means, i must somehow register not only a static pdf file, but c:/backup folder and access all of the backup files with http, even the new uploaded one, without restarting the app and registering it the plugin.xml
I found this on Eclipse RAP FAQ Page:
<extension
point="org.eclipse.equinox.http.registry.resources">
<resource
alias="/"
base-name="resources">
</resource>
</extension>
can you explain me how to use it on my given folder and my app http adress?
Thnx, Edin
Re: PDF, JPG, DOC etc. [message #658399 is a reply to message #658370] Tue, 08 March 2011 10:20 Go to previous message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2359
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Edin,
the RAP FAQ page that explain how to register a resource (file/folder)
is here:
http://wiki.eclipse.org/RAP/FAQ#How_to_register_a_file.2Ffol der_as_resource.3F
The important point here is that your folder must be under your project
folder. For example, to map the folder ".../<project_name>/backup" to
|"http://<url_to_rap_server>/backup"| use:
<extension
point="org.eclipse.equinox.http.registry.resources">
<resource
alias="/backup"
base-name="backup">
</resource>
</extension>
HTH,
Ivan

On 3/8/2011 11:05 AM, ededagic wrote:
> Thnx Ivan,
>
> can you give me an example how to register a ressource?
> I have an order c:/backup and the apps http is
> http://127.0.0.1:8080/webapp?startup=hello
> the content of backup increases every time a user uploads sth. He also
> have a list of backup files and i want him be able to open that file
> by doubleclick in rap browser. that means, i must somehow register not
> only a static pdf file, but c:/backup folder and access all of the
> backup files with http, even the new uploaded one, without restarting
> the app and registering it the plugin.xml
> I found this on Eclipse RAP FAQ Page:
> <extension
> point="org.eclipse.equinox.http.registry.resources">
> <resource
> alias="/"
> base-name="resources">
> </resource>
> </extension>
> can you explain me how to use it on my given folder and my app http
> adress?
> Thnx, Edin
Previous Topic:Slow RAP application start on Tomcat
Next Topic:HTTP PUT, GET, POST
Goto Forum:
  


Current Time: Tue Oct 19 13:25:43 GMT 2021

Powered by FUDForum. Page generated in 0.01807 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top