You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "Ulrich, Dominik" <Do...@ids.de> on 2003/11/04 12:58:03 UTC

store file after transformation

Hi Everybody

I'new to cocoon but I've got a difficult question, and I would be really thankful
if somebody can help me out.

what I'm trying to do is:
1. submit a form which tells cocoon which files to include in final document
2. transform this files into another document (xml->pdf)
3. write to a file (SourceWritingTransformer)
4. display a page like "task complete"

how can I configure the sitemap?

this is an example of my sitemap, I'm not sure, can I use two transformers?


<map:pipeline>
	<map:match pattern="file1.pdf">
		<map:generate src="file1.xml"/>
		<!--here should the document be transformed to pdf andafter that given to the sourcewriter--> 
		<map:transform type="sourcewriter"/>
		<map:serialize type="xml"/>
	</map:match>			
</map:pipeline>

sourcewriter
<map:transformer name="sourcewriter" logger="sitemap.transformer.filewriter" src="org.apache.cocoon.transformation.SourceWritingTransformer">
<map:parameter name="serializer" value="xml"/>
</map:transformer> 

everytime i use this, I'm getting the documt in the browser window and not on disk

can anybody help me with this? I'using cocoon 2.1.2

thanks!
ciao
dominik

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: store file after transformation

Posted by Hassan Abolhassani <ns...@ybb.ne.jp>.
You can use two or more transformers in a pipeline.

Are you inserting necessary tags needed for sourcewriter transformer in your
first step transformation. The result of first step transformation should be
something like:

<page>
   ...
   <source:write xmlns:source="http://apache.org/cocoon/source/1.0">
     <source:source>context://doc/editable/my.xml</source:source>
     <source:fragment>
     <page>
       <title>Hello World</title>
       <content>
         <p>This is my first paragraph.</p>
       </content>
     </page>
     </source:fragment>
   </source:write>
   ...
 </page>


Inside the <source:fragment> you can have any xml content like <xsl:fo>
contents.
(
Detailed explanation:
http://cocoon.apache.org/2.1/userdocs/transformers/sourcewriting-transformer.html
)

Anyway please note that pdf files are created in the serialization step, if
you use fop serializer. So in this case, you don't have the pdf content
after first transformation. You can have xsl:fo content instead and write it
to a file using sourcewriter transformation.

If you can explain your use case more clearly, maybe better help can be
provided.

Regards,
Hassan

----- Original Message ----- 
From: "Ulrich, Dominik" <Do...@ids.de>
To: "Cocoon Mailing Liste (E-Mail)" <us...@cocoon.apache.org>
Sent: Tuesday, November 04, 2003 8:58 PM
Subject: store file after transformation


> Hi Everybody
>
> I'new to cocoon but I've got a difficult question, and I would be really
thankful
> if somebody can help me out.
>
> what I'm trying to do is:
> 1. submit a form which tells cocoon which files to include in final
document
> 2. transform this files into another document (xml->pdf)
> 3. write to a file (SourceWritingTransformer)
> 4. display a page like "task complete"
>
> how can I configure the sitemap?
>
> this is an example of my sitemap, I'm not sure, can I use two
transformers?
>
>
> <map:pipeline>
> <map:match pattern="file1.pdf">
> <map:generate src="file1.xml"/>
> <!--here should the document be transformed to pdf andafter that given to
the sourcewriter-->
> <map:transform type="sourcewriter"/>
> <map:serialize type="xml"/>
> </map:match>
> </map:pipeline>
>
> sourcewriter
> <map:transformer name="sourcewriter"
logger="sitemap.transformer.filewriter"
src="org.apache.cocoon.transformation.SourceWritingTransformer">
> <map:parameter name="serializer" value="xml"/>
> </map:transformer>
>
> everytime i use this, I'm getting the documt in the browser window and not
on disk
>
> can anybody help me with this? I'using cocoon 2.1.2
>
> thanks!
> ciao
> dominik
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org