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 -->
20 <!-- FIXME: doc for the Language "function" ? -->
21 <nodedefinition name="Language">
23 <string name="languagecondition" defaultvalue="code != 'ot'"/>
24 <string name="bundle" defaultvalue="bundles.producer" />
29 <List key="languages" table="language" selection="${languagecondition}" order="code"/>
30 <Enumerate key="language" table="language" selection="${languagecondition}" order="code">
31 <Resource bundle="${bundle}" key="lang" language="${language.code}"/>
32 <Define key="pathprefix" value="${language.code}" />
33 <Define key="languagepreference" value="${language.code}" />
35 <If condition="language.code=='en'">
37 <Define key="pathprefix" value="or" />
38 <Define key="languagepreference" value="" />
46 <nodedefinition name="RSSChannel">
48 <string name="articleSelection"/>
49 <string name="extratables" defaultvalue="none" />
50 <integer name="limit" defaultvalue="15"/>
51 <string name="channelidentifier" defaultvalue=""/>
52 <string name="channelfilename"/>
53 <string name="channeltitle"/>
54 <string name="articleprefix" defaultvalue="${config['Producer.PublicationHost']}/or" />
55 <string name="iconprefix" defaultvalue="${config['Producer.PublicationHost']}/icon" />
56 <string name="channelpublisher" defaultvalue="${config['Mir.Name']}" />
57 <string name="encoding" defaultvalue="UTF-8" />
58 <string name="channeldescription" defaultvalue=""/>
59 <string name="generator" defaultvalue="/RSS.template" />
63 <If condition="extratables == 'none' ">
65 <List key="articles" table="content c" selection="${articleSelection}" order = "c.webdb_create desc, c.date desc" limit="limit" />
68 <List key="articles" table="content c" selection="${articleSelection}" order = "c.webdb_create desc, c.date desc" limit="limit" extratables="${extratables}" />
71 <If condition="channeldescription==''">
73 <Define key="channeldescription" value="${channeltitle}"/>
76 <If condition="channelidentifier==''">
78 <Define key="channelidentifier" value="${config['Producer.PublicationHost']}/or/${channelfilename}"/>
83 parameters="${encoding}"
84 generator="${generator}"
85 destination="${config.storageRoot}/${channelfilename}"/>
89 <nodedefinition name="RSSChannelBundle">
91 <string name="extratables" defaultvalue="none" />
92 <string name="selection" defaultvalue="c.is_published='1'" />
93 <string name="basefilename" defaultvalue="main" />
98 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}"
99 channelfilename="${basefilename}-newswire.rss"
100 channeltitle="${config['Mir.Name']} ${basefilename} newswire"
102 extratables="${extratables}"
105 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}"
106 channelfilename="${basefilename}-newswire-content.rss"
107 channeltitle="${config['Mir.Name']} ${basefilename} newswire"
109 generator="RSS-full.template"
110 extratables="${extratables}"
114 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}"
115 channelfilename="${basefilename}-features.rss"
116 channeltitle="${config['Mir.Name']} ${basefilename} features"
118 extratables="${extratables}"
121 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}"
122 channelfilename="${basefilename}-features-content.rss"
123 channeltitle="${config['Mir.Name']} ${basefilename} features"
125 generator="RSS-full.template"
126 extratables="${extratables}"
132 <!-- This second section contains actual producers that will appear -->
133 <!-- on the admin->"Generate manually"->"advanced page" -->
135 <!-- This producer generates html pages, as well as media and video -->
136 <!-- files for articles stored in the database. -->
137 <producer name="articles">
139 <verb name="changed" default="1">
140 <Define key="verbcondition" value="(not is_produced)"/>
141 <Set key="limit" value="10"/>
144 <Define key="verbcondition" value=""/>
145 <Set key="limit" value="-1"/>
149 <Define key="verbcondition" value=""/>
150 <Set key="limit" value="10"/>
154 <Enumerate key="article" table="content" selection="${verbcondition}"
155 limit="limit" order="webdb_create desc">
157 key="media" table="image"
158 selection="exists (select * from content_x_media where media_id=images.id and content_id=${article.id})
159 or exists (select * from comment_x_media, comment
160 where comment_id = comment.id and media_id=images.id and comment.to_media=${article.id})"
163 <GenerateMedia key="media" />
166 key="media" table="video"
167 selection="exists (select * from content_x_media where media_id=video.id and content_id=${article.id})
168 or exists (select * from comment_x_media, comment
169 where comment_id = comment.id and media_id=video.id and comment.to_media=${article.id})"
171 <GenerateMedia key="media" />
174 key="media" table="audio"
175 selection="exists (select * from content_x_media where media_id=audio.id and content_id=${article.id})
176 or exists (select * from comment_x_media, comment
177 where comment_id = comment.id and media_id=audio.id and comment.to_media=${article.id})"
180 <GenerateMedia key="media" />
183 key="media" table="otherMedia"
184 selection="exists (select * from content_x_media where media_id=other_media.id and content_id=${article.id})
185 or exists (select * from comment_x_media, comment
186 where comment_id = comment.id and media_id=other_media.id and comment.to_media=${article.id})"
189 <GenerateMedia key="media" />
192 <If condition="article.is_published == '1'">
196 generator="/article.template"
197 destination="${config.storageRoot}/${pathprefix}/${article.date.formatted.yyyy}/${article.date.formatted.MM}/${article.id}.shtml"/>
200 generator="/languagebar.template"
201 destination="${config.storageRoot}/languagebar/${article.to_original.date.formatted.yyyy}/${article.to_original.date.formatted.MM}/${article.to_original.id}.shtml"/>
202 <IndexContent key="article" pathToIndex="${config['IndexPath']}"/>
205 <UnIndexContent key="article" pathToIndex="${config['IndexPath']}"/>
208 <MarkContent key="article"/>
213 <!-- generates the left column FIXME more doc? -->
214 <producer name="navigation">
216 <verb name="generate" default="1" description="generates the left column"/>
221 generator="/navigation.template"
222 destination="${config.storageRoot}/${pathprefix}/navigation.inc"/>
227 <producer name="staticimages">
229 <verb name="generate" default="1" description="copies all the static image files into place"/>
232 <CopyDir destination="img" source="etc/producer/images"/>
236 <producer name="newswirearchive">
239 <Set key="pages" value="3"/>
242 <Set key="pages" value="-1"/>
246 <Define key="docSuffix" value=".shtml"/>
247 <Define key="storageSuffix" value=".shtml"/>
249 <Batch key="articles" infokey="batch" table="content"
250 process="pages" batchsize="20" minbatchsize="10"
251 selection="is_published='1' and to_article_type = ${articletype.newswire}"
252 order="webdb_create asc">
255 <Define key="pagePrefix" value="${pathprefix}/newswire/archive"/>
256 <Define key="storagePrefix" value="${config["Producer.StorageRoot"]}/${pagePrefix}"/>
257 <Define key="docPrefix" value="${config["Producer.DocRoot"]}/${pagePrefix}"/>
260 generator="newswirearchive.template"
261 destination="${storagePrefix}${batch.current.identifier}${storageSuffix}"/>
267 <Define key="pagePrefix" value="${pathprefix}/newswire/archive"/>
268 <Define key="storagePrefix" value="${config["Producer.StorageRoot"]}/${pagePrefix}"/>
269 <Define key="docPrefix" value="${config["Producer.DocRoot"]}/${pagePrefix}"/>
271 generator="batchnav.template"
272 destination="${storagePrefix}nav${storageSuffix}"/>
279 <producer name="featurearchive">
282 <Set key="pages" value="3"/>
285 <Set key="pages" value="-1"/>
289 <Define key="docSuffix" value=".shtml"/>
290 <Define key="storageSuffix" value=".shtml"/>
292 <Batch key="articles" infokey="batch" table="content"
293 process="pages" batchsize="20" minbatchsize="10"
294 selection="is_published='1' and to_article_type in (${articletype.feature}, ${articletype.startspecial})"
295 order="webdb_create asc">
298 <Define key="pagePrefix" value="${pathprefix}/feature/archive"/>
299 <Define key="storagePrefix" value="${config["Producer.StorageRoot"]}/${pagePrefix}"/>
300 <Define key="docPrefix" value="${config["Producer.DocRoot"]}/${pagePrefix}"/>
303 generator="featurearchive.template"
304 destination="${storagePrefix}${batch.current.identifier}${storageSuffix}"/>
310 <Define key="pagePrefix" value="${pathprefix}/feature/archive"/>
311 <Define key="storagePrefix" value="${config["Producer.StorageRoot"]}/${pagePrefix}"/>
312 <Define key="docPrefix" value="${config["Producer.DocRoot"]}/${pagePrefix}"/>
314 generator="batchnav.template"
315 destination="${storagePrefix}nav${storageSuffix}"/>
322 <producer name="topicpages">
325 <Set key="_topics" value="-1"/>
326 <Set key="pages" value="3"/>
329 <Set key="_topics" value="-1"/>
330 <Set key="pages" value="-1"/>
333 <Set key="_topics" value="2"/>
334 <Set key="pages" value="4"/>
338 <Enumerate key="topic" table="topic" limit="_topics">
339 <Define key="docSuffix" value=".shtml"/>
340 <Define key="storageSuffix" value=".shtml"/>
342 <List key="special" table="content c"
343 selection="c.is_published='1' and c.to_article_type = ${articletype.topicspecial} and c.id=cxt.content_id and cxt.topic_id = ${topic.id}"
344 order = "webdb_create desc" limit="1"
345 extratables="content_x_topic cxt"/>
347 <Batch key="articles" infokey="batch" table="content c"
348 process="pages" batchsize="20" minbatchsize="10"
349 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}"
350 order="webdb_create asc" extratables="content_x_topic cxt">
353 <Define key="pagePrefix" value="${pathprefix}/${topic.filename}/archive"/>
354 <Define key="storagePrefix" value="${config["Producer.StorageRoot"]}/${pagePrefix}"/>
355 <Define key="docPrefix" value="${config["Producer.DocRoot"]}/${pagePrefix}"/>
358 generator="topicpage.template"
359 destination="${storagePrefix}${batch.current.identifier}${storageSuffix}"/>
365 <Define key="pagePrefix" value="${pathprefix}/${topic.filename}/archive"/>
366 <Define key="storagePrefix" value="${config["Producer.StorageRoot"]}/${pagePrefix}"/>
367 <Define key="docPrefix" value="${config["Producer.DocRoot"]}/${pagePrefix}"/>
369 generator="batchnav.template"
370 destination="${storagePrefix}nav${storageSuffix}"/>
378 <!-- generates the main html page (startpage) of an indymedia site -->
379 <producer name="startpage">
381 <verb name="generate" default="1" description="Generates the startpage"/>
385 <List key="startspecial" table="content" limit="1"
386 selection="is_published=true and to_article_type=${articletype.startspecial}"
387 order="webdb_create desc"/>
389 <List key="features" table="content" limit="10"
390 selection="is_published=true and to_article_type=${articletype.feature}"
391 order="webdb_create desc"/>
393 <List key="newswire" table="content" limit="30"
394 selection="is_published=true and to_article_type=${articletype.newswire}"
395 order="webdb_create desc"/>
397 <List key="breakingnews" table="breakingNews" limit="10"
398 order="webdb_create desc"/>
402 generator="/startpage.template"
403 destination="${config.storageRoot}/${pathprefix}/index.shtml"/>
408 <!-- Use rsync to copy static site to mirrors (only if requested -->
409 <!-- in config file) -->
410 <producer name="synchronization">
412 <verb name="run" default="1" description="Synchronizes the publication site with the production site"/>
416 <If condition="config['Rsync'] in ('1', 'y', 'yes', 'Y')">
418 <Execute command="${config['Rsync.Script.Path']}"/>
425 <producer name="media">
427 <verb name="new" default="1">
428 <Define key="verbcondition" value="(not is_produced)"/>
429 <Set key="limit" value="10"/>
432 <Define key="verbcondition" value=""/>
433 <Set key="limit" value="-1"/>
437 <Define key="verbcondition" value=""/>
438 <Set key="limit" value="10"/>
443 key="media" table="image"
444 selection="${verbcondition}"
446 order="webdb_create desc">
448 <GenerateMedia key="media" />
451 key="media" table="video"
452 selection="${verbcondition}"
454 order="webdb_create desc">
456 <GenerateMedia key="media" />
459 key="media" table="audio"
460 selection="${verbcondition}"
462 order="webdb_create desc">
464 <GenerateMedia key="media" />
467 key="media" table="otherMedia"
468 selection="${verbcondition}"
470 order="webdb_create desc">
472 <GenerateMedia key="media" />
477 <producer name="syndication">
479 <verb name="generate" />
482 <!-- the main features and newswire -->
485 <!-- the topic features and newswires -->
486 <Enumerate key="topic" table="topic">
488 basefilename="${topic.filename}"
489 selection="c.id=cxt.content_id and cxt.topic_id = ${topic.id}"
490 extratables="content_x_topic cxt"
500 <producer name="radicalendar">
505 <!-- groupname you will see as the value of "group" in the url for your radicalendar page, -->
506 <!-- gmtoffset is in minutes -->
507 <Radicalendar key="calendar" groupname="_imc" gmtoffset="60" />
509 generator="/radicalendar.template"
510 destination="${config.storageRoot}/calendarinclude.shtml"/>