cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Mazzocchi <>
Subject Re: Using sitemap to generate all static pages of a collection of XML/XSLfiles
Date Sun, 27 Aug 2000 10:05:53 GMT
Jon Lancelle wrote:
> I would like to use Cocoon 2 at this time to take a webapp and create a
> series of static HTML files to be uploaded to another server NOT running
> Cocoon at all.
> I have studied the files cocoon.xconf and sitemap.xmap and have a grasp
> on creating a map to all pertinent pages to be generated. My assumption
> is every page to be linked to via ANY of the XML/XSL generated HTML
> files (on the server itself) should appear under the pipeline element.

It's much harder than that: if you have a wildcard matcher of
"/docs/*/**.html" how do you know the URLs you have to iterate thru? you
can't simply generate all possible URLs and ignore those 404 errors.

You have to "crawl" the site first, acquire all internal links thru some
link-specific semantic view, then obtain the page/resources, rewrite the
links and save them on the appropriate structure on storage (file ystem,
FTP, WebDAV, CVS, whatever)

It's a pain in the ass, but I'm almost there. (I've hit the "link
rewriting" problem and honestly don't know how to proceed... hmmm, will
think about it next week in Zurich with Giacomo)

> It seems quite apparent that the href definitions under pipeline would
> be accessible as if using them as links somewhere in the collection of
> XML/XSL files (phew!)

If you have "links" this is workable, but if you have "wildcards" or
"regexps", this is nothing useful.
> Is there a way to use the sitemap.xmap file, in conjunction with the
> cocoon.xconf file (not to mention all of the XML/XSL/etc files) to
> create all the pages? Do I use Ant? Perhaps a class in a jar file?

Cocoon2 will have command line usage. It's already implemented... it
doesn't work, but it's there. Take a look at org.apache.cocoon.Main
> Of course at this time I will just FTP the files to their destination,
> but in the future would automate that. Probably through an ant
> configuration.

Well, this is a possibility... another possibility is to use
URLConnections to feed a storage system and create different handlers
for different use cases.

But I'm aiming at disk first, everything else is just a bunch of lines
of code away, but nothing really interesting to research on.

Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<>                             Friedrich Nietzsche
 Missed us in Orlando? Make it up with ApacheCON Europe in London!
------------------------- http://ApacheCon.Com ---------------------

View raw message