Return-Path: Delivered-To: apmail-cocoon-users-archive@www.apache.org Received: (qmail 20730 invoked from network); 18 Oct 2003 16:33:30 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 18 Oct 2003 16:33:30 -0000 Received: (qmail 70718 invoked by uid 500); 18 Oct 2003 16:33:14 -0000 Delivered-To: apmail-cocoon-users-archive@cocoon.apache.org Received: (qmail 70702 invoked by uid 500); 18 Oct 2003 16:33:14 -0000 Mailing-List: contact users-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: users@cocoon.apache.org Delivered-To: mailing list users@cocoon.apache.org Received: (qmail 70688 invoked from network); 18 Oct 2003 16:33:14 -0000 Received: from unknown (HELO host.leverageweb.com) (64.91.254.192) by daedalus.apache.org with SMTP; 18 Oct 2003 16:33:14 -0000 Received: from va-leesburg-cmts5c-90.chvlva.adelphia.net ([67.21.159.90] helo=leverageweb.com) by host.leverageweb.com with asmtp (Exim 4.24) id 1AAu5C-0003ee-TO for users@cocoon.apache.org; Sat, 18 Oct 2003 12:37:38 -0400 Message-ID: <3F916C16.1080108@leverageweb.com> Date: Sat, 18 Oct 2003 12:36:38 -0400 From: Geoff Howard User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en MIME-Version: 1.0 To: users@cocoon.apache.org Subject: Re: CSV upload to Chaperon References: <67A74B8A6110764D973CE39FF358C3C3D37AAF@fort.dna.dna.co.uk> In-Reply-To: <67A74B8A6110764D973CE39FF358C3C3D37AAF@fort.dna.dna.co.uk> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - host.leverageweb.com X-AntiAbuse: Original Domain - cocoon.apache.org X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [47 12] X-AntiAbuse: Sender Address Domain - leverageweb.com X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Paul Crabtree wrote: > Thanks Geoff. > I've come across something called a FilePartGenerator since my post: > http://www.tempeststrings.com/cocoon/apidocs/org/apache/cocoon/generatio > n/FilePartGenerator.html, which, to me, seems to be what i want. > Is there anything like this in 2.1 or anything coming? That generator was submitted as a patch but was closed because he forgot to attach the source. I haven't looked at the code in a while but the modifications to make that run in 2.1 shouldn't be very big. If you're interested in it, have the author of that Generator re-open the patch at bugzilla with the attachments. You are also probably free to take it yourself and adopt it. If the original author doesn't want to bother submitting it again and you have his license to do so, you could contribute that generator yourself. There was a problem with the other part of the code he was donating in that it introduced a dependency on a project with an incompatible license (though the author granted an exception for the version he used) and overlapped heavily with POI which we already have in cvs. > Im not sure using > the file:// protocol file give me what i want as the file exists in > memory only and im reluctant to save a copy of the file due to me client > requirements. It's only in memory if you have autosave-uploads set to false (which is no longer the default in 2.1). In 2.1 autosave-uploads does not save the file, permanently - it's automatically deleted at the end of the request. Does that meet your client requirements? > Im kind of getting the whole upload process now and the ways in which > Cocoon can handle them, i just see a missing link between that part and > getting the in-memory file through to a pipeline. That's where the generator or a source would come in handy. > I read on a mail list > somewhere that there is a brand new generator in Bugzilla that will > solve this but cant find any more info on this out. anyone come across > this? It may have been the same one you found - I'm not aware of any others. Do you have a link to the archive? Maybe it'd jog my memory. Geoff > Paul Crabtree wrote: > > >>Hi, i've been using Cocoon 2.1 for a few months now but i've only just >>joined this mailing list so i apologise if this sort of question has >>been and gone. >> >>Here's what im trying to do: >> >>"Provide a form for users to upload their CSV files. When the user >>uploads the CSV file Cocoon takes the file and passes it to the text >>generator and through the chaperon transformers to do a similar thing > > to > >>what the chaperon CSV sample does now." >> >>I dont think i need to save the file at all but i cant work out how to >>pass it to the text generator, XSP? >> >>Is this possible? > > > Read the wiki for file-upload handling. If auto-save uploads is set to > true, you should be able to use the name of the upload field (using > input module {request-param:name_of_field}) in the src attribute of the > text generator (we have this? isn't it a Chaperon generator? sorry for > my ignorance). This would be relying on the toString implementation of > PartOnDisk, which I think will give you the file location. You may need > to use src="file://{request-param:name_of_field}". > > Alternatively, you could also use an action or flow to get the filename > in a form that would work (and even save it somewhere permanent) and > pass it to the pipeline as a sitemap param (in the case of action) or > some other form (request attribute??) for use in your src. > > These feel kind of hacky and it would be better to create a source > handler for uploads. This probably would be pretty simple if you want > to pursue it. I think I hinted at this with someone else recently. I > don't have time to invest in it now, but could help you or someone else > through it. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org For additional commands, e-mail: users-help@cocoon.apache.org