From dev-return-48537-apmail-cocoon-dev-archive=cocoon.apache.org@cocoon.apache.org Wed Oct 01 14:30:04 2003 Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 48943 invoked from network); 1 Oct 2003 14:30:03 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 1 Oct 2003 14:30:03 -0000 Received: (qmail 87698 invoked by uid 500); 1 Oct 2003 14:29:51 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 87661 invoked by uid 500); 1 Oct 2003 14:29:51 -0000 Mailing-List: contact dev-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: dev@cocoon.apache.org Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 87601 invoked from network); 1 Oct 2003 14:29:50 -0000 Received: from unknown (HELO darwin.medicdat.de) (194.94.159.3) by daedalus.apache.org with SMTP; 1 Oct 2003 14:29:50 -0000 Received: from alfred-fuchs.de (pc50359.klinik.uni-regensburg.de [132.199.169.111]) by darwin.medicdat.de with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id T7TNFY81; Wed, 1 Oct 2003 16:32:31 +0200 Message-ID: <3F7AE4DE.5050101@alfred-fuchs.de> Date: Wed, 01 Oct 2003 16:29:50 +0200 X-Sybari-Trust: 5e249470 1dddba3e 61b1a5df 0000013c From: Alfred Fuchs User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5b) Gecko/20030901 Thunderbird/0.2 X-Accept-Language: en-us, en MIME-Version: 1.0 To: dev@cocoon.apache.org Subject: Re: DirectoryGenerator References: <3F7A8587.2090402@alfred-fuchs.de> <3F7A87BE.3020004@apache.org> <3F7A97D0.5080308@alfred-fuchs.de> <3F7A9F03.7080800@apache.org> <3F7AB6F7.4070302@alfred-fuchs.de> <3F7ABD92.4080100@apache.org> In-Reply-To: <3F7ABD92.4080100@apache.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit 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 > Why would you use a directory scanner separately? because I already had a directoryscanner (with a callbackhandler and the default callbackhandler writes xml to stdout :-) and the algorithm (based on java.io.File and java.io.FileFilter) is completely independent of other packages. the benefit of separating algorithm and "view" (output) is, that I can use the scanner in a commandline util and in the DirectoryGenerator as well. > Besides, I think you'd much better use Source instead than File (see > o.a.c.g.TraversableGenerator in scratchpad). You are right, I overlooked the scratchpad... I will adapt the generator. > Is that because you have to generate (XML) metadata out of an image, > as an example? yes, and HTML, or f.e. a description (xml)-file (not necessary in the same directory), with the same name as the file (f.e. MS-Word) itself. > 2. extract information from the returned resource in a pluggable and > extensible way (could be XPath or some binary manipulation). > > Have I got the overall picture? If that's the case, I'd still go for a yes, nearly. in my expamle I extract the title of a HTML page in this way: if exist and <title> not empty, use it as title. otherwise use the first <h1> etc... this is logic, simply done in a xslt, but hoe to do this in a single xpath-query? > I tend to like the multiple transformer best though, > since they're more in line with Cocoon's overall design. but why then the XPathDirectoryGenerator? <map:generator type="directory" src="..."/> <map:transformer src="Add-XInclude-Tags.xsl"/> <map:transformer type="xinclude"/> <map:transformer src="apply-xpath-to-included-files.xsl"/> ... would do the same. the "pipeline" approach seems very modualar to me and reuses components, which already are there. whats wrong with the "pipeline"-approach? <map:aggregate/> also uses multiple pipes. > <map:transformer name="infoextractor src="..."> > <renderer match="mime-type" pattern="text/html" class="..."/> > <renderer match="ext" pattern="gif|png|jpg" class="..."/> > </map:transformer> hmmm, would <renderer match="mime-type" pattern="text/html" class="...XSLT..."> <source src="some-xslt.xsl"/> </renderer> be OK? best regards, alfred