cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin McDermott" <>
Subject Code offer
Date Tue, 10 Jun 2003 11:40:57 GMT

Following on from the launch of the Cocoon driven sites, I've been given the go-ahead to offer the
code that we developed in order to make our task a bit easier :)

A bit of background will make it easier to understand the changes :)

There are various sub-sites within, and for some
of these sub-sites, there is content that is shared between them.

This content is managed within a "shared" branch inside Teamsite.

We have modified FileSourceFactory to return our new FilePathSource

< public class FilePathSourceFactory extends AbstractLoggable
> public class FileSourceFactory extends AbstractLoggable
<         Source result = new FilePathSource(location, this.manager);
>         Source result = new FileSource(location, this.manager);

FilePathSource extends FileSource with functionality that if the filename
referred to by the FilePathSource doesn't exist, it passes the name of the
file to a class which returns a list of "alternate" names for the file,
which FilePathSource then checks for, of course if none of these
"alternative" names exist, then it complains about not being able to find
the original file, and all is as before.

In our production code, there's only one "alternative" name returned, which
is the result of a Regex on the original filename to replace the original
sitename or Teamsite branch with our "shared" directory.

This / would be replaced with

What this has allowed us to do, is transparently link content on sites,
without having to have some "shared" identified in URIs, as a side-effect
(due to being a modification to the resolver), you can have shared XSLT
documents too, this might have application (WRT our setup), when you have
Apache virtual hosting static content (i.e. images and CSS), you can have a
totally shared page, that is customised by CSS and images.

If this is of interest to the Cocoon project, we're happy to contribute
whatever bits of the code that can be accommodated.

Thanks again for Cocoon.



Kevin McDermott Senior Technologist

0131 476 6000 Cert. TeamSite Consult

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message