2 Words for Cocoon.

>>
Hi Carl,
I am new to APEX so my question is probably too simple but if you could describe in 2 words the major benefit of using Cocoon as opposed to just FOP.

Thanks in advance,

Vadim
>>

Well lucky for you Vadim I just happened to be playing around with my Cocoon instance today and am absolutely even more thrilled with the APEX + Cocoon combo than before. So my 2 words if I had to pick them would be XML and Pipelines!

XML for two reasons.
Once Cocoon is setup most of it's configuration is controlled by the sitemap.xmap file which is an XML file , no java libraries, no crazy .conf files, just nice clean XML. For me who has a rational hatred towards all things java this is awesome.

Also the mechanics behind the PDF printing no matter if you using BI Publisher or the Apache FOP solution or my Cocoon example is XML + XSL > FOP = PDF.
Cocoon is made to deal with XML and XSL in hundreds of ways, just using the sitemap.xmap file which gets us to the next word......

Pipelines the cornerstone of Cocoon.

http://cocoon.apache.org/2.1/userdocs/concepts/sitemap.html


Now the dirty little secret I have is that I never use the XSL that is posted from the APEX engine. I use XSL from the filesystem.

In Cocoon once you have your XML you can look into it for certain values and pipeline the XML to different transformations. This can easily give you different report formats for the same Apex Report depending on near any value in the report , page or session.

One of the things I hope to make facilitating this in the future is to allow for each report (via the APEX Builder) to have an individual FOP posting endpoint.

Finally two more points , though it goes over my two word limit it's my blog, in Cocoon you also have the ability for RTF output which you don't get from standard FOP and also the ease of setup which I find amazingly easy.

5 Comments:

  1. Vadim Loevski said...
    Hi Carl,

    Thanks a lot for sharing your thoughts. I really got interested in APEX/Cocoon combo and installed based on your detailed instructions. It worked but only for Standard reports based on Report region. It just does not work for any report based on a Shared Component/Report Query. If you know why it does not work it would be nice to know otherwise this solution is not useful at all. It can be easily reproduced by creating a report based on select * from dept.

    I am hoping for your reply because your blog's Cocoon entry generated lots of interest and it would be awesome to get it working.

    Regards,

    Vadim
    Vadim Loevski said...
    Hi Carl,

    to be more accuaret if I make a report based on a query the error is

    javax.xml.transform.TransformerException: attribute-set named #TEXT_ALIGN# does not exist
    cocoon://fop_post/xsl - 148:58

    Cocoon stacktrace[hide]
    attribute-set named #TEXT_ALIGN# does not exist
    cocoon://fop_post/xsl - 148:58

    Exception in StreamGenerator.generate()
    cocoon://fop_post/xsl - 148:58 [TransformerException]
    file:/E:/APEX_FOP/apache-tomcat-6.0.13/webapps

    Thanks,

    Vadim
    pay per head call center said...
    Useful information ..I am very happy to read this article..thanks for giving us this useful information. Fantastic walk-through. I appreciate this post.
    Anonymous said...
    Nice share. Thanks for nice writing.
    hermes wallet
    Anonymous said...

Post a Comment