[seam-dev] PDF: missing pageEventClass

Kenneth Christensen kec at mediatorsystems.com
Fri Aug 28 01:43:35 EDT 2009


Hi Dan,

Thank you for the answer.

Sorry, my mistake.

Wow... my short (or long) term memory is a bit rusty :-)
Yes, it's one of our own Seam patch.

:-)

Best regards

Kenneth

On 28/08/2009, at 05.54, Dan Allen wrote:

> I can't find a reference to pageEventClass or the initPageEvent()  
> method in any of the Seam source code that I have on my machine  
> (which is most Seam versions). Are you sure this wasn't a patch you  
> or your team was maintaining? If not, please point to the SVN URL of  
> the UIDocument class when it had this method. Then we can get to the  
> bottom of it. If it is a new feature -> JIRA.
>
> -Dan
>
> On Sat, Aug 22, 2009 at 4:47 PM, Kenneth Christensen <kec at mediatorsystems.com 
> > wrote:
> Maybe someone could explain me why the "pageEventClass" have been
> removed from the UIDocument and why is it not supported by Seam PDF
> anymore?
>
> JBoss Seam 2.0.3:
>
>     @Override
>     public void encodeBegin(FacesContext context)
>         throws IOException
>     {
>         super.encodeBegin(context);
>
>         stream = new ByteArrayOutputStream();
>
>         try {
>             writer = createWriterForStream(stream);
>
>             initMetaData(context);
>             initPageEvent(writer);
>             processHeaders();
>
>             document.open();
>         } catch (DocumentException e) {
>             throw new RuntimeException(e);
>         }
>     }
>
>     protected void initPageEvent(DocWriter writer) {
>         if (pageEventClass != null && writer instanceof PdfWriter) {
>             try {
>                 PdfPageEvent event = (PdfPageEvent)
> Class.forName(pageEventClass).getConstructor().newInstance();
>                 ((PdfWriter) writer).setPageEvent(event);
>             } catch (Exception e) {
>                 throw new RuntimeException(e);
>             }
>         }
>     }
>
> JBoss Seam 2.2.0:
>
>    @Override
>    public void encodeBegin(FacesContext context) throws IOException
>    {
>       super.encodeBegin(context);
>
>       stream = new ByteArrayOutputStream();
>
>       try
>       {
>          writer = createWriterForStream(stream);
>
>          initMetaData(context);
>          processHeaders();
>
>          document.open();
>       }
>       catch (DocumentException e)
>       {
>          throw new RuntimeException(e);
>       }
>    }
>
> Best regards
>
> Kenneth Christensen
>
> _______________________________________________
> seam-dev mailing list
> seam-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/seam-dev
>
>
>
> -- 
> Dan Allen
> Senior Software Engineer, Red Hat | Author of Seam in Action
> Registered Linux User #231597
>
> http://mojavelinux.com
> http://mojavelinux.com/seaminaction
> http://in.relation.to/Bloggers/Dan

Med venlig hilsen / Best regards
Mediator Systems ApS

Kenneth Christensen
Direktør / CEO

=======================================================
Email from Mediator Systems ApS

Mediator Systems ApS
Stenfeldtsvej 19
DK-3000 Helsingør
Denmark

Tel: +45 35 10 44 19
Mobile: +45 61 60 50 00

http://www.mediatorsystems.com
=======================================================
e-branchekoden: http://e-branchekoden.com
Workout Journal: http://www.workout-journal.com
=======================================================





-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/seam-dev/attachments/20090828/2174ee0a/attachment-0001.html 


More information about the seam-dev mailing list