Return-Path: Delivered-To: apmail-forrest-dev-archive@www.apache.org Received: (qmail 45389 invoked from network); 18 Dec 2005 01:54:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 18 Dec 2005 01:54:23 -0000 Received: (qmail 79414 invoked by uid 500); 18 Dec 2005 01:54:22 -0000 Delivered-To: apmail-forrest-dev-archive@forrest.apache.org Received: (qmail 79375 invoked by uid 500); 18 Dec 2005 01:54:22 -0000 Mailing-List: contact dev-help@forrest.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@forrest.apache.org List-Id: Delivered-To: mailing list dev@forrest.apache.org Received: (qmail 79360 invoked by uid 99); 18 Dec 2005 01:54:22 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 17 Dec 2005 17:54:22 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [65.77.211.84] (HELO www2.kc.aoindustries.com) (65.77.211.84) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 17 Dec 2005 17:54:19 -0800 Received: from fo2.kc.aoindustries.com (www2.kc.aoindustries.com [65.77.211.84]) by www2.kc.aoindustries.com (8.13.1/8.13.1) with ESMTP id jBI1rw4p017565 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 17 Dec 2005 19:53:58 -0600 Received: from localhost (localhost [[UNIX: localhost]]) by fo2.kc.aoindustries.com (8.13.1/8.13.1/Submit) id jBI1rwWR017485 for dev@forrest.apache.org; Sat, 17 Dec 2005 19:53:58 -0600 X-Authentication-Warning: fo2.kc.aoindustries.com: indexgeo set sender to crossley@apache.org using -f Date: Sun, 18 Dec 2005 12:53:51 +1100 From: David Crossley To: dev@forrest.apache.org Subject: Re: howto-custom-html-source Message-ID: <20051218015351.GA16934@igg.indexgeo.com.au> References: <20051218014750.GB16740@igg.indexgeo.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20051218014750.GB16740@igg.indexgeo.com.au> User-Agent: Mutt/1.4i X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N David Crossley wrote: > Paul Bolger wrote: > > I've been trying to get this to work, and I'm not sure what's going > > wrong. I'll explain what I'd like to be able to do: I'd like to point > > at a directory, and it's subdirectories, processing all html files so > > that all content outside a #content div is stripped. > > Ah, that comment indicates a basic misunderstanding > about how Cocoon operates. It doesn't actually process > directories [1]. Rather it handles requests. Depending > on the components of the URL, the sitemap will respond > by matching certain patterns. > > You need a project sitemap (or plugin if it is common > functionality) to intercept the specific matches that > you want to transform. Any matches that remain are handled > by the guts of forrest. > > Some of our documentation explains how to handle specific > matches. As usual our docs need attention. This doc > is close, but you need to wade through the example that > it points to, because only part of that is relevant. > http://forrest.apache.org/docs/project-sitemap.html > > Basically you need a project sitemap.xmap like this > where "this-tree" is the directory tree to which > you want to apply special processing ... > > > > > > Of course, that should be Also your "myStripContent" transformer could probably just remove the bits that you don't want and then follow it with the forrest html transformer. So ... > (Caveat: Be careful with those directory separators > in the match and generate components: The ** will match > a slash. I just added the above for readability.) > > In other words, presume that the request is > localhost:8888/some-dir/this-tree/foo/bar.html > then your sitemap would fire and it would generate > xml content from xdocs/some-dir/this-tree/foo/bar.html > and apply your transformer to produce the forrest > internal document structure. > > --oOo-- > > [1] Preparing a directory listing, say for a table > of contents page is another matter. For that you > would use more complex Cocoon sitemap operations. > See DirectoryGenerator which traverses the directory > tree generates an xml fragment. Apply a Transformer > to that to turn it into forrest internal xml format. > > You would need to follow Cocoon sitemap docs. Start at > http://forrest.apache.org/docs/project-sitemap.html > Understand sitemaps and then see: > http://cocoon.apache.org/2.1/userdocs/directory-generator.html > > We need to add an example to our seed-sample site. > > > This How-To is > > very detailed and I've learnt a lot from it, but it'd be good to have > > > > a. and example file of sitemap.xmap with the extra element included (I > > can't find the place that it's supposed to go...) > > > > and > > > > b. an example xsl file. > > The stylesheet to strip everything except "div class=content" > is a simple XSLT operation. Not apporpriate for this list. > The "XSL FAQ" is a fantanstic resource http://www.dpawson.co.uk/xsl/ > and get Micahel Kay's book. > > -David