cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jorg Heymans <Jorg.Heym...@12snap.com>
Subject RE: insert request parameter from action
Date Thu, 04 Sep 2003 09:18:28 GMT
i am using cocoon 2.04 for this, in case it makes a difference.
I tried to do plugin a custom transformer between the action and the
serializer to no avail..

Looking at the Request request = ObjectModelHelper.getRequest(objectModel)
call a bit closer, it doesn't seem that there are much setter functions on
the request object.. equivalent to request.getParameter I expected a
request.setParameter which isn't there .. mmm strange


Here is what I want to accomplish:
- users can upload any type of file using any parameter they like
- strip out the upload from the request, save it under a unique filename and
replace the filename stored in the request object with that unique filename
so the rest of the pipeline can pick it up..


maybe I need to rethink my strategy on how to accomplish this?


-----Original Message-----
From: Jorg Heymans [mailto:Jorg.Heymans@12snap.com] 
Sent: Donnerstag, 4. September 2003 10:29
To: 'users@cocoon.apache.org'
Subject: insert request parameter from action

I have an action to deal with fileuploads
...
getLogger().debug("attached file found -> " + parameterName);
FilePart filePart = (FilePart) request.get(parameterName);
File file = ((FilePartFile) filePart).getFile();
DiskStore ds = new DiskStore();
String id = ds.store(file);
request.setAttribute("newfilename", id);
getLogger().debug("saved as reference " + id);
...
 
sitemap is 
<map:match pattern="upload">
<map:act type="upload-files"/>
<map:generate type="request"/>
<map:serialize type="xml"/>
</map:match>
 
why is the requestattribute parameter "newfilename" set in the action not
visible in the output? Is the requestgenerator not picking up the changed
request object then? Or maybe there is another way to change to request
object before the generator picks it up
 
Any thoughts?
Jorg

---------------------------------------------------------------------
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


Mime
View raw message