Scott,
You could solve this with a file marshaler in JBI. You then have to
either package up the Marshaler and its libraries in a shared library
or in the SU itself. However...
I think it would be a lot better if we could build a Camel component
instead. That component could still be used seamlessly inside
ServiceMix, but would also be useful for people outside of the JBI
community. And, as an extra, a Camel component is usually a lot
easier to write and maintain than a pure JBI component.
Imagine we could build a component which uses a fop: URI scheme to
invoke the Apache FOP processor, that would allow us to build a Camel
route like this to receive message on a queue, convert them to XSL-FO
using XSLT, then use the new FOP processor component and send the
output to a printer and a file.
from("amq:my.document.queue")
.to("xslt:mystylesheet.xsl")
.to("fop:pdf?some.extra.options.here")
.to("file:outputdirectory")
.to("printer:some.printer");
Wdyt? If this sounds like a good plan to you, we can start by raising
a JIRA issue, and if you want to take a stab at implementing the
component yourself, I'll gladly try to help you out wherever I can.
Regards,
Gert Vanthienen
------------------------
FuseSource
Web: http://fusesource.com
Blog: http://gertvanthienen.blogspot.com/
On Sat, Jan 15, 2011 at 8:10 PM, Scott Came <[email protected]> wrote:
> I would like to have (and develop, if necessary) a JBI service engine that
> contains an XSLT stylesheet that transforms an input message (XML) into
> XSL-FO. The service engine would then apply XSL-FO formatting and generate a
> PDF into a file specified at SE configuration/deployment time. So in other
> words, the flow would be:
>
> Nmr --[xml message]--> [XSL FO SE]
> |
> -->[XSLT stylesheet]-->[XSL-FO]-->[Apache
> FOP]-->[PDF output file]
>
> It looks like I may be able to use the file:sender component, and write my
> own Marshaller...am I on the right track here? It seems the page at
> http://fusesource.com/docs/esb/4.3/jbi_file/index.html is a place to start.
> However...forgive the newbie question here...how would I deploy the custom
> marshaller? To use the file component ordinarily, I would use the maven
> archetype to generate the project, then configure it using Spring (in
> xbean.xml). Would I simply write my marshaller class in src/main/java and
> then reference it in xbean.xml? And where in the project would I put all the
> FOP jars (and their dependencies)...there is nothing like a /lib directory
> within the structure generated by the maven archetype...
>
> Thanks for any help you can offer.
> --Scott
>
>