Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Print a view's content
Print a view's content [message #85210] Mon, 28 April 2008 14:06 Go to next message
Markus  rüger is currently offline Markus rügerFriend
Messages: 369
Registered: July 2009
Senior Member
Hi all,
I need a view action that prints the content of a view. Is this possible
right now?
If it is, how do I do it? If not, is there a workaround for it?

Regards,
Markus
Re: Print a view's content [message #85312 is a reply to message #85210] Mon, 28 April 2008 18:52 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rherrmann.innoopract.com

Markus,

sorry to say so, but I don't know a way to make this work.
The only thing that comes to my mind is to 'print' the views'
content as a PDF document (or similar) and show it in a Brwoser widget.

Cheers,
Rüdiger


Markus Krüger wrote:
> Hi all,
> I need a view action that prints the content of a view. Is this possible
> right now?
> If it is, how do I do it? If not, is there a workaround for it?
>
> Regards,
> Markus
>
>
Re: Print a view's content [message #85342 is a reply to message #85312] Tue, 29 April 2008 06:10 Go to previous messageGo to next message
Markus  rüger is currently offline Markus rügerFriend
Messages: 369
Registered: July 2009
Senior Member
Are you planning to add some printing functionality to RAP, like printing
views or editors content?
I think this might be very usefull.

Regards,

Markus

"R
Re: Print a view's content [message #85370 is a reply to message #85342] Tue, 29 April 2008 09:06 Go to previous messageGo to next message
Benjamin Muskalla is currently offline Benjamin MuskallaFriend
Messages: 237
Registered: July 2009
Senior Member
Hi Markus,

I don't think it would make any sense to support printing this stuff in
a generic way. It may make sense for text editors but printing a forms
editor or a view with widgets makes just no sense. But with a little
workaround you could achieve something useful: Having an action which
opens a popup window (for example trough the workbench browser support)
and prefixing the content of the html page with something like the
following you could support direct printing for the user. If you now use
the adapter pattern to provide a textual content adapter for each part,
you can retrieve the adapter of the current active part to put this
content into your html page for the browser. This way you can print the
active parts content while the part itself can provide the textual
format of the output.

Here is the snippet for the html page to open the print dialog:

<html><body onload="window.print();"><!-- your text content goes here
--></body</html>

Just an idea I had when I read your post. Maybe it works ;)

Greets
Benny

Markus Krüger wrote:
> Are you planning to add some printing functionality to RAP, like printing
> views or editors content?
> I think this might be very usefull.
>
> Regards,
>
> Markus
>
> "Rüdiger Herrmann" <rherrmann@innoopract.com> schrieb im Newsbeitrag
> news:fv56e7$bst$2@build.eclipse.org...
>> Markus,
>>
>> sorry to say so, but I don't know a way to make this work.
>> The only thing that comes to my mind is to 'print' the views' content as a
>> PDF document (or similar) and show it in a Brwoser widget.
>>
>> Cheers,
>> Rüdiger
>>
>>
>> Markus Krüger wrote:
>>> Hi all,
>>> I need a view action that prints the content of a view. Is this possible
>>> right now?
>>> If it is, how do I do it? If not, is there a workaround for it?
>>>
>>> Regards,
>>> Markus
>
>
Re: Print a view's content [message #85436 is a reply to message #85370] Tue, 29 April 2008 13:15 Go to previous messageGo to next message
Markus  rüger is currently offline Markus rügerFriend
Messages: 369
Registered: July 2009
Senior Member
Hi Benny,
very good idea. Can you provide a snippt on how to get my generated html
body (already available through my apadter) to a browser window. I can just
open an url.
I even tried to use a servlet, but It does not register corretly as it
states a 404 when I ty to open it (http://127.0.0.1:myport/printservlet).

Extension looks like this:
<extension

point="org.eclipse.equinox.http.registry.servlets">

<servlet

alias="/printservlet"

class="raptest.PrintServlet"

httpcontextId="org.eclipse.rap.httpcontext"

load-on-startup="false">

</servlet>

</extension>



Regards,

Markus





"Benjamin Muskalla" <bmuskalla@innoopract.com> schrieb im Newsbeitrag
news:fv6odt$391$1@build.eclipse.org...
> Hi Markus,
>
> I don't think it would make any sense to support printing this stuff in a
> generic way. It may make sense for text editors but printing a forms
> editor or a view with widgets makes just no sense. But with a little
> workaround you could achieve something useful: Having an action which
> opens a popup window (for example trough the workbench browser support)
> and prefixing the content of the html page with something like the
> following you could support direct printing for the user. If you now use
> the adapter pattern to provide a textual content adapter for each part,
> you can retrieve the adapter of the current active part to put this
> content into your html page for the browser. This way you can print the
> active parts content while the part itself can provide the textual format
> of the output.
>
> Here is the snippet for the html page to open the print dialog:
>
> <html><body onload="window.print();"><!-- your text content goes
> here --></body</html>
>
> Just an idea I had when I read your post. Maybe it works ;)
>
> Greets
> Benny
>
> Markus Kr
Re: Print a view's content [message #85451 is a reply to message #85436] Tue, 29 April 2008 13:20 Go to previous messageGo to next message
Markus  rüger is currently offline Markus rügerFriend
Messages: 369
Registered: July 2009
Senior Member
Nevermind, I accidently used doPost in my servlet. Do get works. So I just
need to know how to get my view within my servlet to provide the correct
content.


Regards,
Markus


"Markus Kr
Re: Print a view's content [message #85544 is a reply to message #85451] Wed, 30 April 2008 04:37 Go to previous message
Eclipse UserFriend
Originally posted by: fappel.innoopract.com

Hi,

maybe you find the thread 'How to tell RAP to switch perspective from
external servlet?' helpful for your problem


Ciao
Frank

-----Ursprüngliche Nachricht-----
Von: Markus Krüger [mailto:krueger@ion.ag]
Bereitgestellt: Dienstag, 29. April 2008 15:20
Bereitgestellt in: eclipse.technology.rap
Unterhaltung: Print a view's content
Betreff: Re: Print a view's content


Nevermind, I accidently used doPost in my servlet. Do get works. So I
just need to know how to get my view within my servlet to provide the
correct content.


Regards,
Markus


"Markus Krüger" <krueger@ion.ag> schrieb im Newsbeitrag
news:fv76tb$3ib$1@build.eclipse.org...
> Hi Benny,
> very good idea. Can you provide a snippt on how to get my generated
> html body (already available through my apadter) to a browser window.
> I can just open an url.
> I even tried to use a servlet, but It does not register corretly as it

> states a 404 when I ty to open it
(http://127.0.0.1:myport/printservlet).
>
> Extension looks like this:
> <extension
>
> point="org.eclipse.equinox.http.registry.servlets">
>
> <servlet
>
> alias="/printservlet"
>
> class="raptest.PrintServlet"
>
> httpcontextId="org.eclipse.rap.httpcontext"
>
> load-on-startup="false">
>
> </servlet>
>
> </extension>
>
>
>
> Regards,
>
> Markus
>
>
>
>
>
> "Benjamin Muskalla" <bmuskalla@innoopract.com> schrieb im Newsbeitrag
> news:fv6odt$391$1@build.eclipse.org...
>> Hi Markus,
>>
>> I don't think it would make any sense to support printing this stuff
>> in a generic way. It may make sense for text editors but printing a
>> forms editor or a view with widgets makes just no sense. But with a
>> little workaround you could achieve something useful: Having an
>> action which opens a popup window (for example trough the workbench
>> browser support) and prefixing the content of the html page with
>> something like the following you could support direct printing for
>> the user. If you now use the adapter pattern to provide a textual
>> content adapter for each part, you can retrieve the adapter of the
>> current active part to put this content into your html page for the
>> browser. This way you can print the active parts content while the
>> part itself can provide the textual format of the output.
>>
>> Here is the snippet for the html page to open the print dialog:
>>
>> <html><body onload="window.print();"><!-- your text content goes here

>> --></body</html>
>>
>> Just an idea I had when I read your post. Maybe it works ;)
>>
>> Greets
>> Benny
>>
>> Markus Krüger wrote:
>>> Are you planning to add some printing functionality to RAP, like
>>> printing views or editors content?
>>> I think this might be very usefull.
>>>
>>> Regards,
>>>
>>> Markus
>>>
>>> "Rüdiger Herrmann" <rherrmann@innoopract.com> schrieb im Newsbeitrag

>>> news:fv56e7$bst$2@build.eclipse.org...
>>>> Markus,
>>>>
>>>> sorry to say so, but I don't know a way to make this work.
>>>> The only thing that comes to my mind is to 'print' the views'
>>>> content as a PDF document (or similar) and show it in a Brwoser
widget.
>>>>
>>>> Cheers,
>>>> Rüdiger
>>>>
>>>>
>>>> Markus Krüger wrote:
>>>>> Hi all,
>>>>> I need a view action that prints the content of a view. Is this
>>>>> possible right now?
>>>>> If it is, how do I do it? If not, is there a workaround for it?
>>>>>
>>>>> Regards,
>>>>> Markus
>>>
>
Previous Topic:RCP ->RAP equivalent
Next Topic:PreferenceManager
Goto Forum:
  


Current Time: Tue Apr 16 10:44:47 GMT 2024

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

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

Back to the top