You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by thuertas <tu...@aql.fr> on 2007/09/11 17:25:06 UTC

file upload and stream generator

hi,

I have a problem between uploading xml files and generating them with a 
stream generator in cocoon.
here are my html file and my sitemap.xmap

myfile.html

<html>
    <form method="POST" 
action="http://127.0.0.1:8081/ma/services/ma-import/mapipeline" 
enctype="multipart/form-data">
        <input type="file" name="Filename"/>
        <input type="submit" name="Envoyer"/>
    </form>
</html>

sitemap.xmap

<?xml version="1.0" encoding="UTF-8"?>
<map:sitemap xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://apache.org/cocoon/sitemap/1.0
  http://cocoon.apache.org/schema/sitemap/cocoon-sitemap-1.0.xsd" 
xmlns:map="http://apache.org/cocoon/sitemap/1.0">
    <map:resources>
        <map:resource name="transform-axml2maxml">
            <map:transform type="xslt" src="transform/axml2maxml.xslt"/>
        </map:resource>
    </map:resources>
    <map:generators default="file">
            <map:generator name="stream" 
src="org.apache.cocoon.generation.StreamGenerator"/>
    </map:generators>
    <map:transformers>
             <map:transformer 
src="com.mycompany.transform.Maxml2ObjectsTransformer" 
name="maxml2objects"/>
    </map:transformers>
    <map:pipelines>
        <map:pipeline>
            <map:match pattern="mapipeline">
                <map:generate type="stream">
                      <map:parameter name="form-name" value="Filename"/>
                      <map:parameter name="defaultContentType" 
value="multipart/form-data"/>
                </map:generate>
                <map:call resource="transform-axml2maxml"/>
                <map:transform type="maxml2objects"/>
                <map:serialize type="xml"/>
            </map:match>
        </map:pipeline>
    </map:pipelines>
</map:sitemap>

So, when I try to test that, I have this exception:
 >>> Unknown request object encountered named Filename : null


Does anybody has any idea to solve this problem?

regards,

tug

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


Re: file upload and stream generator

Posted by ahuut <ah...@yahoo.fr>.
Hello,

With uploads enabled in web.xml I am having exactly the same problem.
-- 
View this message in context: http://www.nabble.com/file-upload-and-stream-generator-tf4423363.html#a12975287
Sent from the Cocoon - Users mailing list archive at Nabble.com.


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


Re: file upload and stream generator

Posted by Joerg Heinicke <jo...@gmx.de>.
On 11.09.2007 11:25 Uhr, thuertas wrote:

> I have a problem between uploading xml files and generating them with a 
> stream generator in cocoon.

> So, when I try to test that, I have this exception:
>  >>> Unknown request object encountered named Filename : null

Are uploads enabled in web.xml?

Joerg

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


Re: file upload and stream generator

Posted by Martin Heiden <ma...@netcologne.de>.
Hi!

Tuesday, September 11, 2007, 5:25:06 PM, you wrote:

t> I have a problem between uploading xml files and generating them with a
t> stream generator in cocoon.
t> here are my html file and my sitemap.xmap

t> So, when I try to test that, I have this exception:
 >>>> Unknown request object encountered named Filename : null

I had a similar problem with cocoon 2.2. I could only read the file
once, after that it was deleted and I got the same error message.

I remember that the first time I tried to use the stream generator
there was a bug in 2.2 which caused the same exception. But I filed a
report and it was solved some days later.

Maybe you should debug the stream generator to see what's going on.

I solved my problem in a very unclean way. I read the transmitted file
in a flow script and write it to a temporary file. Than I use the
stream generator to read that file. Like that I am able to use the
data more than once.

Good luck!

Martin.



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