cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean-Claude Moissinac <>
Subject Cocoon use case
Date Thu, 22 Jul 2004 16:26:13 GMT

It's a question of implementation 'philosophy' within Cocoon:
how to use some helper applications from Cocoon;
(there is a world outside Cocoon)

And the detailed use case:
I'm using a lot of XML format -IMS, MPEG-4 XMT, MPEG-21 IDL, SVG, 
SMIL...- and Coccon seems to be a great framework to produce or modify 
(adapt) documents.
The last phase of a lot of my processes is to convert an XML file to 
some binary format.
So, the good place for that seems to be in a serializer.
SVGSerializer or ZipArchiveSerializer are good guide for this work.

My problem is:
a lot of converter I have are not directly mapable in a Serializer (for 
example, because there are exe or C++)
Typically, they take an XML file and some parameters as input and gives 
a binary file as output.

I can't clearly understand how to make the link between these converter 
and Cocoon:
- attempt to access to the cache from a previous pipeline as file input,
- take all the SAX events to generate the input file
- other


Now, I've made some validation with the following pipelines:

One which assume the dynamically produced xml file is accessible, call 
an action which consume the file and produce the binary file
and then use a reader to send the binary file
        <map:match pattern="*.mp4">
            <map:act type="MP4">
                 <map:parameter name="contextPath" 
                <map:parameter name="filename" value="{1}"/>
            <map:read src="{1}.mp4"  mime-type="video/mpeg4"/>
the action is mainly a system call like this:
           String cmdLine = new String("mp4box.exe -out 
"+path+"\\"+file+".mp4"+" -mp4 "+path+"\\"+file+".xmt");
            Process p = Runtime.getRuntime().exec(cmdLine);

and one which just demonstrate the production of the genarated file
        <map:match pattern="*.data">
            <map:generate type="file" src="{1}_info.xml"/>
            <map:transform type="xslt" src="xml2xmt.xsl"/>
            <map:serialize type="text"/>

View raw message