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(a)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(a)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