Hi Mansour, I am for simplicity assuming you want to process a batch of files in some directory.
http://cocoon.apache.org/2.1/userdocs/directory-generator.html So the match pattern [listfiles/**] will generate sth like <dir:directory xmlns:dir="http://apache.org/cocoon/directory/2.0" name="stylesheets" lastModified="1056668768203" date="27.06.03 01:06" size="0" requested="true" sort="name" reverse="false"> <dir:directory name="someDirectory" lastModified="1056668768203" date="27.06.03 01:06" size="0"/> <dir:file name="001.xml" lastModified="1056668768203" date="27.06.03 01:06" size="4321"/> <dir:file name="002.xml" lastModified="1056668768203" date="27.06.03 01:06" size="1234"/> </dir:directory> So what the pattern [filelist2zip/**] has to produce is sth like below (this can be done using XSLT -> filelist2ZipArchive.xslt which you can write in a few minutes time) <zip:archive xmlns:zip="http://apache.org/cocoon/zip-archive/1.0"> <zip:entry name="someDirectory/001.xml" src="cocoon://documents-1/001.html"/> <zip:entry name="someDirectory/002.xml" src="cocoon://documents-1/002.html"/> </zip:archive> So after the transformer has done its work you only need to use the zip serializer. Hope this helps? Robby -----Original Message----- From: Mansour Al Akeel [mailto:mansour.alak...@gmail.com] Sent: Friday, November 30, 2012 1:23 PM To: users@cocoon.apache.org Subject: Re: Download Zip for processed contents Robby, thank you. Can you please explain or give me a hint of what would the output of : <map:transform src="filelist2ZipArchive.xslt"/> look like ?? On Fri, Nov 30, 2012 at 4:01 AM, Robby Pelssers <robby.pelss...@nxp.com> wrote: > Of course there is Mansour. > > You first need to define a pipeline that will dynamically generate the below > zip:archive document. If that is based on processing files from some > directory you could potentially first use the directory generator to list the > files in XML directory representation. But in fact you should think the other > way around: > > Next you transform that XML directory representation to the one below. > > From a sitemap point of view: > > <!-- {1} : absolute path to folder --> <map:match > pattern="listfiles/**"> > Use directory generator > </map:match> > > <!-- {1} : absolute path to folder --> <map:match > pattern="filelist2zip/**"> > <map:generate src="cocoon:/listfiles/{1}"/> > <map:transform src="filelist2ZipArchive.xslt"/> > <map:serialize type="zip"/> > </map:match> > > -----Original Message----- > From: Mansour Al Akeel [mailto:mansour.alak...@gmail.com] > Sent: Friday, November 30, 2012 4:49 AM > To: users > Subject: Download Zip for processed contents > > I have multiple matchers, that do transformation for many documents, I am > wondering if there's a way to download the whole processed contents. > I know there's a directory generator, but this will generate listing > for the files, and will not be able to invoke the processing. For > example: > > <zip:archive xmlns:zip="http://apache.org/cocoon/zip-archive/1.0"> > <zip:entry name="someDirectory/001" src="cocoon://documents-1/001.html"/> > <zip:entry name="someDirectory/002" src="cocoon://documents-1/002.html"/> > <zip:entry name="someDirectory/003" src="cocoon://documents-1/003.html"/> > <zip:entry name="someDirectory/004" > src="cocoon://documents-1/004.html"/> > ... > <zip:entry name="someDirectory/999" > src="cocoon://documents-1/999.html"/> > > <zip:entry name="path1/001" src="cocoon://documents-2/001.html"/> > <zip:entry name="path1/002" src="cocoon://documents-2/002.html"/> > ..... > </zip:archive> > > > Thank you. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org > For additional commands, e-mail: users-h...@cocoon.apache.org > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org > For additional commands, e-mail: users-h...@cocoon.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org For additional commands, e-mail: users-h...@cocoon.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org For additional commands, e-mail: users-h...@cocoon.apache.org