cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: RequestURI in aggregation page
Date Wed, 03 Aug 2005 20:36:21 GMT
Mark Lundquist wrote:

I'm curious though why you don't want to do the aggregation in the


A fair question.

The scenario is this: Authors create documentation in XML, and no one is
to touch the XML documentation except the author or an editor.

The documentation is created either statically, using Ant, or
dynamically, by simply dropping the XML source files into a directory
under Cocoon.

These source files contain references that pull menus and other "stuff"
into the HTML, PDF, or whatever is created. Again, these XSLs are not to
be touched by anyone other than the authorized personnel.

So, I can only call these XML and XSL files, not modify them. With me so
far? ;)

OK. So, now we have these files that contain content, and they also
contain menus to other content files.

Now we want to drop these XML files containing content into a directory,
and aggregate them with newsfeeds, something like a portal, but without
the necessity of authentication.

While I could do the aggregation in the sitemap, I would have to create
a new matcher every time a new source file was created, thus always
having to update the sitemap.

By using a single "aggregate.xml" file to call the ever-changing content
files, I can use the wildcard matcher. Thus, however many content files
are added or deleted, the sitemap does not have to change.

Make sense?

So, the ideal thing would be a sitemap matcher like the following:

      <map:match pattern="*">
        <map:generate src="aggregate.xml"/>
        <map:transform type="cinclude"/>
        <map:transform src="../index.xsl"/>
        <map:serialize type="html"/>

...where the "index.xsl" is an override that calls the pre-existing XSL
and my code that transforms the RSS newsfeeds and whatever other
overrides I need to make.

Now, the "aggregate.xml" would call the content file requested by the user:

<page xmlns:cinclude="">
	<cinclude:include src="cocoon:/{REQUESTED URL}"/>
	<cinclude:include src="cocoon:/newsfeed1"/>
	<cinclude:include src="cocoon:/newsfeed2"/>

And the missing piece(s) of the puzzle are:

1. Given a request from the client for "http://mydomain/foo", how to
capture "foo" in a variable in the sitemap, and
2. Pass that variable in the place of {REQUESTED URL} in the
"aggregate.xml" above.

Further suggestions would be welcomed, and I would even buy you a beer
in San Diego in December.


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

View raw message