You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by bonekrusher <dj...@yahoo.com> on 2008/08/28 18:09:25 UTC

ErrorListener [0.95]

Hi,

Using FOP 0.95 embedded; is there a way to pipe the warnings/info messages
to an ErrorListener?

e.g.

            TransformerFactory factory = TransformerFactory.newInstance();
            ErrorListener listener = new ErrorListener() {

                public void warning(TransformerException exception) throws
TransformerException {
                    System.out.println("[error] " + exception);
                }

                public void error(TransformerException exception) throws
TransformerException {
                    System.out.println("[error] " + exception);
                }

                public void fatalError(TransformerException exception)
throws TransformerException {
                    System.out.println("[error] " + exception);
                }
            };

             factory.setErrorListener(listener);
-- 
View this message in context: http://www.nabble.com/ErrorListener--0.95--tp19203830p19203830.html
Sent from the FOP - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: ErrorListener [0.95]

Posted by bonekrusher <dj...@yahoo.com>.
My pleasure. I've been playing with this all morning.  This has a lot of
possibilities. The framework is very flexible. Since I am able to catch all
the messages rather then sending them to the gui app or std.out in real
time, the process speeds up. 

HTH,

Phil

 

Jeremias Maerki-2 wrote:
> 
> Thanks a lot for your feedback, Phil! Much appreciated. I'm sure there's
> room for improvement still.
> 
> On 29.08.2008 13:28:18 bonekrusher wrote:
>> 
>> Jeremias,
>> 
>> This is perfect I just finished running this in a sandbox swing app. This
>> allows control over what gets spit out by all events. Nice work.
>> 
>> In the sandbox, I just piped all the messages to an Arraylist, which can
>> either be sent to the app, out to a text file, or ignored for the end
>> user.
>> 
>> Nice!
>> 
>> Regards,
>> 
>> Phil
>> 
>> -- 
>> View this message in context:
>> http://www.nabble.com/ErrorListener--0.95--tp19203830p19218128.html
>> Sent from the FOP - Users mailing list archive at Nabble.com.
> 
> 
> 
> Jeremias Maerki
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/ErrorListener--0.95--tp19203830p19218919.html
Sent from the FOP - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: ErrorListener [0.95]

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Thanks a lot for your feedback, Phil! Much appreciated. I'm sure there's
room for improvement still.

On 29.08.2008 13:28:18 bonekrusher wrote:
> 
> Jeremias,
> 
> This is perfect I just finished running this in a sandbox swing app. This
> allows control over what gets spit out by all events. Nice work.
> 
> In the sandbox, I just piped all the messages to an Arraylist, which can
> either be sent to the app, out to a text file, or ignored for the end user.
> 
> Nice!
> 
> Regards,
> 
> Phil
> 
> -- 
> View this message in context: http://www.nabble.com/ErrorListener--0.95--tp19203830p19218128.html
> Sent from the FOP - Users mailing list archive at Nabble.com.



Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: ErrorListener [0.95]

Posted by bonekrusher <dj...@yahoo.com>.
Jeremias,

This is perfect I just finished running this in a sandbox swing app. This
allows control over what gets spit out by all events. Nice work.

In the sandbox, I just piped all the messages to an Arraylist, which can
either be sent to the app, out to a text file, or ignored for the end user.

Nice!

Regards,

Phil

-- 
View this message in context: http://www.nabble.com/ErrorListener--0.95--tp19203830p19218128.html
Sent from the FOP - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: ErrorListener [0.95]

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
In FOP 0.95 this is not easily possible. Can I point you to the event
framework introduced after 0.95 in FOP Trunk? This is still somewhat
experimental since I haven't had any substantial feedback since I've
implemented it. Documentation is found here:
http://xmlgraphics.apache.org/fop/trunk/events.html

This is not exactly using ErrorListener although you can easily route
all events through to an ErrorListener if you chose to do so. But it
allows you to get all sorts of detailed events about what's happening
inside FOP.

If you need help getting it going, just yell.

HTH

On 28.08.2008 18:09:25 bonekrusher wrote:
> 
> Hi,
> 
> Using FOP 0.95 embedded; is there a way to pipe the warnings/info messages
> to an ErrorListener?
> 
> e.g.
> 
>             TransformerFactory factory = TransformerFactory.newInstance();
>             ErrorListener listener = new ErrorListener() {
> 
>                 public void warning(TransformerException exception) throws
> TransformerException {
>                     System.out.println("[error] " + exception);
>                 }
> 
>                 public void error(TransformerException exception) throws
> TransformerException {
>                     System.out.println("[error] " + exception);
>                 }
> 
>                 public void fatalError(TransformerException exception)
> throws TransformerException {
>                     System.out.println("[error] " + exception);
>                 }
>             };
> 
>              factory.setErrorListener(listener);
> -- 
> View this message in context: http://www.nabble.com/ErrorListener--0.95--tp19203830p19203830.html
> Sent from the FOP - Users mailing list archive at Nabble.com.
> 




Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org