-->
<producers>
- <!-- this first section contains nodedefinitions -->
- <!-- a nodedefinition is a sort of "function" that can be "called" later -->
-
- <!-- FIXME: doc for the Language "function" ? -->
+ <!-- This first section contains nodedefinitions. -->
+ <!-- A nodedefinition is a sort of "function" that can be "called" later -->
+ <!-- in a producer. -->
+
+ <!-- The Language node enumerates over all the available languages -->
+ <!-- and calls the subnode for each language. This way the subnode -->
+ <!-- is succesivelly called with its pathprefix set to "en", "de", -->
+ <!-- "fr", etc. -->
<nodedefinition name="Language">
<parameters>
<string name="languagecondition" defaultvalue="code != 'ot'"/>
<!-- This second section contains actual producers that will appear -->
- <!-- on the admin->"Generate manually"->"advanced page" -->
+ <!-- on the admin->"Generate manually"->"advanced page". -->
<!-- This producer generates html pages, as well as media and video -->
<!-- files for articles stored in the database. -->
<producer name="articles">
<verbs>
+ <!-- only generate articles that have not yet been generated -->
<verb name="changed" default="1">
<Define key="verbcondition" value="(not is_produced)"/>
<Set key="limit" value="10"/>
</verb>
+ <!-- generate all articles in the db (under certain condiftions...) -->
<verb name="all">
<Define key="verbcondition" value=""/>
<Set key="limit" value="-1"/>
</verb>
+ <!-- only generate the last 10 articles in the db -->
<verb name="sample">
<Define key="verbcondition" value=""/>
<Set key="limit" value="10"/>
</verb>
</verbs>
<body>
+ <!-- loop on all articles requested by the "verb" -->
<Enumerate key="article" table="content" selection="${verbcondition}"
limit="limit" order="webdb_create desc">
+ <!-- for each article, generate it's corresponding image files -->
<Enumerate
key="media" table="image"
selection="exists (select * from content_x_media where media_id=images.id and content_id=${article.id})
<GenerateMedia key="media" />
</Enumerate>
+ <!-- for each article, generate it's corresponding video files -->
<Enumerate
key="media" table="video"
selection="exists (select * from content_x_media where media_id=video.id and content_id=${article.id})
order="id desc">
<GenerateMedia key="media" />
</Enumerate>
+ <!-- for each article, generate it's corresponding audio files -->
<Enumerate
key="media" table="audio"
selection="exists (select * from content_x_media where media_id=audio.id and content_id=${article.id})
<GenerateMedia key="media" />
</Enumerate>
+ <!-- for each article, generate it's corresponding other media files -->
<Enumerate
key="media" table="otherMedia"
selection="exists (select * from content_x_media where media_id=other_media.id and content_id=${article.id})
</Enumerate>
<If condition="article.is_published == '1'">
+ <!-- only generate published articles -->
<then>
+ <!-- loop on all available languages -->
<Language>
+ <!-- actually generate the article -->
<Generate
generator="/article.template"
destination="${config.storageRoot}/${pathprefix}/${article.date.formatted.yyyy}/${article.date.formatted.MM}/${article.id}.shtml"/>
- </Language>
- <Generate
- generator="/languagebar.template"
- destination="${config.storageRoot}/languagebar/${article.to_original.date.formatted.yyyy}/${article.to_original.date.formatted.MM}/${article.to_original.id}.shtml"/>
+ </Language>
+ <!-- generate the languagebar -->
+ <Generate
+ generator="/languagebar.template"
+ destination="${config.storageRoot}/languagebar/${article.to_original.date.formatted.yyyy}/${article.to_original.date.formatted.MM}/${article.to_original.id}.shtml"/>
+ <!-- add article to the "search engine" index -->
<IndexContent key="article" pathToIndex="${config['IndexPath']}"/>
</then>
+ <!-- if article is not published, remove it from the search index -->
<else>
<UnIndexContent key="article" pathToIndex="${config['IndexPath']}"/>
</else>
</If>
+ <!-- mark the article as produced -->
<MarkContent key="article"/>
</Enumerate>
</body>