2 This XML file defines a set of producers intended for a typical indymedia
12 please check the mir user's guide and developer's guide
17 <!-- This first section contains nodedefinitions. -->
18 <!-- A nodedefinition is a sort of "function" that can be "called" later -->
19 <!-- in a producer. -->
21 <!-- The Language node enumerates over all the available languages -->
22 <!-- and calls the subnode for each language. This way the subnode -->
23 <!-- is succesivelly called with its pathprefix set to "en", "de", -->
25 <nodedefinition name="Language">
27 <string name="languagecondition" defaultvalue="code != 'ot'"/>
28 <string name="bundle" defaultvalue="bundles.producer" />
33 <List key="languages" table="language" selection="${languagecondition}" order="code"/>
34 <Enumerate key="language" table="language" selection="${languagecondition}" order="code">
35 <Resource bundle="${bundle}" key="lang" language="${language.code}"/>
36 <Define key="pathprefix" value="${language.code}" />
37 <Define key="languagepreference" value="${language.code}" />
39 <If condition="language.code=='en'">
41 <Define key="pathprefix" value="or" />
42 <Define key="languagepreference" value="" />
50 <nodedefinition name="RSSChannel">
52 <string name="articleSelection"/>
53 <string name="extratables" defaultvalue="none" />
54 <integer name="limit" defaultvalue="15"/>
55 <string name="channelidentifier" defaultvalue=""/>
56 <string name="channelfilename"/>
57 <string name="channeltitle"/>
58 <string name="articleprefix" defaultvalue="${config['Producer.PublicationHost']}/or" />
59 <string name="iconprefix" defaultvalue="${config['Producer.PublicationHost']}/icon" />
60 <string name="channelpublisher" defaultvalue="${config['Mir.Name']}" />
61 <string name="encoding" defaultvalue="UTF-8" />
62 <string name="channeldescription" defaultvalue=""/>
63 <string name="generator" defaultvalue="/RSS.template" />
67 <If condition="extratables == 'none' ">
69 <List key="articles" table="content c" selection="${articleSelection}" order = "c.webdb_create desc, c.date desc" limit="limit" />
72 <List key="articles" table="content c" selection="${articleSelection}" order = "c.webdb_create desc, c.date desc" limit="limit" extratables="${extratables}" />
75 <If condition="channeldescription==''">
77 <Define key="channeldescription" value="${channeltitle}"/>
80 <If condition="channelidentifier==''">
82 <Define key="channelidentifier" value="${config['Producer.PublicationHost']}/or/${channelfilename}"/>
87 parameters="${encoding}"
88 generator="${generator}"
89 destination="${config.storageRoot}/${channelfilename}"/>
93 <nodedefinition name="RSSChannelBundle">
95 <string name="extratables" defaultvalue="none" />
96 <string name="selection" defaultvalue="c.is_published='1'" />
97 <string name="basefilename" defaultvalue="main" />
102 articleSelection="(c.to_article_type in (${articletype.newswire}) or (c.to_article_type=${articletype.translation} and c.to_original.to_articletype in (${articletype.newswire}))) and ${selection}"
103 channelfilename="${basefilename}-newswire.rss"
104 channeltitle="${config['Mir.Name']} ${basefilename} newswire"
106 extratables="${extratables}"
109 articleSelection="(c.to_article_type in (${articletype.newswire}) or (c.to_article_type=${articletype.translation} and c.to_original.to_articletype in (${articletype.newsire}))) and ${selection}"
110 channelfilename="${basefilename}-newswire-content.rss"
111 channeltitle="${config['Mir.Name']} ${basefilename} newswire"
113 generator="RSS-full.template"
114 extratables="${extratables}"
118 articleSelection="(c.to_article_type in (${articletype.feature},${articletype.startspecial},${articletype.topicspecial}) or (c.to_article_type=${articletype.translation} and c.to_original.to_articletype in (${articletype.feature},${articletype.startspecial},${articletype.topicspecial}))) and ${selection}"
119 channelfilename="${basefilename}-features.rss"
120 channeltitle="${config['Mir.Name']} ${basefilename} features"
122 extratables="${extratables}"
125 articleSelection="(c.to_article_type in (${articletype.feature},${articletype.startspecial},${articletype.topicspecial}) or (c.to_article_type=${articletype.translation} and c.to_original.to_articletype in (${articletype.feature},${articletype.startspecial},${articletype.topicspecial}))) and ${selection}"
126 channelfilename="${basefilename}-features-content.rss"
127 channeltitle="${config['Mir.Name']} ${basefilename} features"
129 generator="RSS-full.template"
130 extratables="${extratables}"
136 <!-- This second section contains actual producers that will appear -->
137 <!-- on the admin->"Generate manually"->"advanced page". -->
139 <!-- This producer generates html pages, as well as media and video -->
140 <!-- files for articles stored in the database. -->
141 <producer name="articles">
143 <!-- only generate articles that have not yet been generated -->
144 <verb name="changed" default="1">
145 <Define key="verbcondition" value="(not is_produced)"/>
146 <Set key="limit" value="10"/>
148 <!-- generate all articles in the db (under certain condiftions...) -->
150 <Define key="verbcondition" value=""/>
151 <Set key="limit" value="-1"/>
154 <!-- only generate the last 10 articles in the db -->
156 <Define key="verbcondition" value=""/>
157 <Set key="limit" value="10"/>
161 <!-- loop on all articles requested by the "verb" -->
162 <Enumerate key="article" table="content" selection="${verbcondition}"
163 limit="limit" order="webdb_create desc">
164 <!-- for each article, generate it's corresponding image files -->
166 key="media" table="image"
167 selection="exists (select * from content_x_media where media_id=images.id and content_id=${article.id})
168 or exists (select * from comment_x_media, comment
169 where comment_id = comment.id and media_id=images.id and comment.to_media=${article.id})"
172 <GenerateMedia key="media" />
174 <!-- for each article, generate it's corresponding video files -->
176 key="media" table="video"
177 selection="exists (select * from content_x_media where media_id=video.id and content_id=${article.id})
178 or exists (select * from comment_x_media, comment
179 where comment_id = comment.id and media_id=video.id and comment.to_media=${article.id})"
181 <GenerateMedia key="media" />
183 <!-- for each article, generate it's corresponding audio files -->
185 key="media" table="audio"
186 selection="exists (select * from content_x_media where media_id=audio.id and content_id=${article.id})
187 or exists (select * from comment_x_media, comment
188 where comment_id = comment.id and media_id=audio.id and comment.to_media=${article.id})"
191 <GenerateMedia key="media" />
193 <!-- for each article, generate it's corresponding other media files -->
195 key="media" table="otherMedia"
196 selection="exists (select * from content_x_media where media_id=other_media.id and content_id=${article.id})
197 or exists (select * from comment_x_media, comment
198 where comment_id = comment.id and media_id=other_media.id and comment.to_media=${article.id})"
201 <GenerateMedia key="media" />
204 <If condition="article.is_published == '1'">
205 <!-- only generate published articles -->
207 <!-- loop on all available languages -->
209 <!-- actually generate the article -->
211 generator="/article.template"
212 destination="${config.storageRoot}/${pathprefix}/${article.date.formatted.yyyy}/${article.date.formatted.MM}/${article.id}.shtml"/>
214 <!-- generate the languagebar -->
216 generator="/languagebar.template"
217 destination="${config.storageRoot}/languagebar/${article.to_original.date.formatted.yyyy}/${article.to_original.date.formatted.MM}/${article.to_original.id}.shtml"/>
218 <!-- add article to the "search engine" index -->
219 <IndexContent key="article" pathToIndex="${config['IndexPath']}"/>
221 <!-- if article is not published, remove it from the search index -->
223 <UnIndexContent key="article" pathToIndex="${config['IndexPath']}"/>
226 <!-- mark the article as produced -->
227 <MarkContent key="article"/>
232 <!-- generates the left column FIXME more doc? -->
233 <producer name="navigation">
235 <verb name="generate" default="1" description="generates the left column"/>
240 generator="/navigation.template"
241 destination="${config.storageRoot}/${pathprefix}/navigation.inc"/>
246 <producer name="staticimages">
248 <verb name="generate" default="1" description="copies all the static image files into place"/>
251 <CopyDir destination="img" source="etc/producer/images"/>
255 <producer name="newswirearchive">
258 <Set key="pages" value="3"/>
261 <Set key="pages" value="-1"/>
265 <Define key="docSuffix" value=".shtml"/>
266 <Define key="storageSuffix" value=".shtml"/>
268 <Batch key="articles" infokey="batch" table="content"
269 process="pages" batchsize="20" minbatchsize="10"
270 selection="is_published='1' and to_article_type = ${articletype.newswire}"
271 order="webdb_create asc">
274 <Define key="pagePrefix" value="${pathprefix}/newswire/archive"/>
275 <Define key="storagePrefix" value="${config["Producer.StorageRoot"]}/${pagePrefix}"/>
276 <Define key="docPrefix" value="${config["Producer.DocRoot"]}/${pagePrefix}"/>
279 generator="newswirearchive.template"
280 destination="${storagePrefix}${batch.current.identifier}${storageSuffix}"/>
286 <Define key="pagePrefix" value="${pathprefix}/newswire/archive"/>
287 <Define key="storagePrefix" value="${config["Producer.StorageRoot"]}/${pagePrefix}"/>
288 <Define key="docPrefix" value="${config["Producer.DocRoot"]}/${pagePrefix}"/>
290 generator="batchnav.template"
291 destination="${storagePrefix}nav${storageSuffix}"/>
298 <producer name="featurearchive">
301 <Set key="pages" value="3"/>
304 <Set key="pages" value="-1"/>
308 <Define key="docSuffix" value=".shtml"/>
309 <Define key="storageSuffix" value=".shtml"/>
311 <Batch key="articles" infokey="batch" table="content"
312 process="pages" batchsize="20" minbatchsize="10"
313 selection="is_published='1' and to_article_type in (${articletype.feature}, ${articletype.startspecial})"
314 order="webdb_create asc">
317 <Define key="pagePrefix" value="${pathprefix}/feature/archive"/>
318 <Define key="storagePrefix" value="${config["Producer.StorageRoot"]}/${pagePrefix}"/>
319 <Define key="docPrefix" value="${config["Producer.DocRoot"]}/${pagePrefix}"/>
322 generator="featurearchive.template"
323 destination="${storagePrefix}${batch.current.identifier}${storageSuffix}"/>
329 <Define key="pagePrefix" value="${pathprefix}/feature/archive"/>
330 <Define key="storagePrefix" value="${config["Producer.StorageRoot"]}/${pagePrefix}"/>
331 <Define key="docPrefix" value="${config["Producer.DocRoot"]}/${pagePrefix}"/>
333 generator="batchnav.template"
334 destination="${storagePrefix}nav${storageSuffix}"/>
341 <producer name="topicpages">
344 <Set key="_topics" value="-1"/>
345 <Set key="pages" value="3"/>
348 <Set key="_topics" value="-1"/>
349 <Set key="pages" value="-1"/>
352 <Set key="_topics" value="2"/>
353 <Set key="pages" value="4"/>
357 <Enumerate key="topic" table="topic" limit="_topics">
358 <Define key="docSuffix" value=".shtml"/>
359 <Define key="storageSuffix" value=".shtml"/>
361 <List key="special" table="content c"
362 selection="c.is_published='1' and c.to_article_type = ${articletype.topicspecial} and c.id=cxt.content_id and cxt.topic_id = ${topic.id}"
363 order = "webdb_create desc" limit="1"
364 extratables="content_x_topic cxt"/>
366 <Batch key="articles" infokey="batch" table="content c"
367 process="pages" batchsize="20" minbatchsize="10"
368 selection="c.is_published='1' and c.to_article_type in (${articletype.newswire}, ${articletype.feature}) and c.id=cxt.content_id and cxt.topic_id = ${topic.id}"
369 order="webdb_create asc" extratables="content_x_topic cxt">
372 <Define key="pagePrefix" value="${pathprefix}/${topic.filename}/archive"/>
373 <Define key="storagePrefix" value="${config["Producer.StorageRoot"]}/${pagePrefix}"/>
374 <Define key="docPrefix" value="${config["Producer.DocRoot"]}/${pagePrefix}"/>
377 generator="topicpage.template"
378 destination="${storagePrefix}${batch.current.identifier}${storageSuffix}"/>
384 <Define key="pagePrefix" value="${pathprefix}/${topic.filename}/archive"/>
385 <Define key="storagePrefix" value="${config["Producer.StorageRoot"]}/${pagePrefix}"/>
386 <Define key="docPrefix" value="${config["Producer.DocRoot"]}/${pagePrefix}"/>
388 generator="batchnav.template"
389 destination="${storagePrefix}nav${storageSuffix}"/>
397 <!-- generates the main html page (startpage) of an indymedia site -->
398 <producer name="startpage">
400 <verb name="generate" default="1" description="Generates the startpage"/>
404 <List key="startspecial" table="content" limit="1"
405 selection="is_published=true and to_article_type=${articletype.startspecial}"
406 order="webdb_create desc"/>
408 <List key="features" table="content" limit="10"
409 selection="is_published=true and to_article_type=${articletype.feature}"
410 order="webdb_create desc"/>
412 <List key="newswire" table="content" limit="30"
413 selection="is_published=true and to_article_type=${articletype.newswire}"
414 order="webdb_create desc"/>
416 <List key="breakingnews" table="breakingNews" limit="10"
417 order="webdb_create desc"/>
421 generator="/startpage.template"
422 destination="${config.storageRoot}/${pathprefix}/index.shtml"/>
427 <!-- Use rsync to copy static site to mirrors (only if requested -->
428 <!-- in config file) -->
429 <producer name="synchronization">
431 <verb name="run" default="1" description="Synchronizes the publication site with the production site"/>
435 <If condition="config['Rsync'] in ('1', 'y', 'yes', 'Y')">
437 <Execute command="${config['Rsync.Script.Path']}"/>
444 <producer name="media">
446 <verb name="new" default="1">
447 <Define key="verbcondition" value="(not is_produced)"/>
448 <Set key="limit" value="10"/>
451 <Define key="verbcondition" value=""/>
452 <Set key="limit" value="-1"/>
456 <Define key="verbcondition" value=""/>
457 <Set key="limit" value="10"/>
462 key="media" table="image"
463 selection="${verbcondition}"
465 order="webdb_create desc">
467 <GenerateMedia key="media" />
470 key="media" table="video"
471 selection="${verbcondition}"
473 order="webdb_create desc">
475 <GenerateMedia key="media" />
478 key="media" table="audio"
479 selection="${verbcondition}"
481 order="webdb_create desc">
483 <GenerateMedia key="media" />
486 key="media" table="otherMedia"
487 selection="${verbcondition}"
489 order="webdb_create desc">
491 <GenerateMedia key="media" />
496 <producer name="syndication">
498 <verb name="generate" />
501 <!-- the main features and newswire -->
504 <!-- the topic features and newswires -->
505 <Enumerate key="topic" table="topic">
507 basefilename="${topic.filename}"
508 selection="c.id=cxt.content_id and cxt.topic_id = ${topic.id}"
509 extratables="content_x_topic cxt"
519 <producer name="radicalendar">
524 <!-- groupname you will see as the value of "group" in the url for your radicalendar page, -->
525 <!-- gmtoffset is in minutes -->
526 <Radicalendar key="calendar" groupname="_imc" gmtoffset="60" />
528 generator="/radicalendar.template"
529 destination="${config.storageRoot}/calendarinclude.shtml"/>