Has anyone done something to populate a tab from an aggregation of files in a directory? I read in the documentation (http://forrest.apache.org/docs/linking.html#menu_generation) about using an alternative tab generation method to select by directory - but I don't want that methodology for every tab, just one. That is, what I'm trying to do is have one tab that gets its entries from all the files in a certain directory, e.g.:
<foolist label="Foos" href="foos/" tab="foolist"> <!-- picks up all entries in foos/ and does their transformation as per the pipeline --> <summary label="Summary" href="foos/"/> </foolist>
If I understand the documentation, it's pretty clear on how to create a pipeline for processing the object files themselves into XML but I'm not sure how I'd go about getting the tab setup.
Could anyone offer anything with the tabs and/or sitemap entry?
This is not currently possible, although it has been discussed before as a possible enhancement. If you fancy having a go at creating this functionality that would be cool. Here are a few pointers:
- tab.xml is processed in tabs.xmap
- cocoon provides a directory generator http://cocoon.apache.org/2.1/userdocs/generators/directory-generator.html
Try something like:
<map:select type="exists">
<map:when test="{project:content.xdocs}tabs.xml">
<!-- process as per current behaviour -->
</map:when>
<map:otherwise>
<!-- use directory generator to read directory, transform with XSL an serialise -->
</map:otherwise>
</map:select>
Ross
-- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.300 / Virus Database: 265.6.8 - Release Date: 03/01/2005
