2 This XML file defines a set of producers intended for a typical indymedia
14 <nodedefinition name="Language">
16 <string name="languagecondition" defaultvalue="code != 'ot'"/>
17 <string name="bundle" defaultvalue="bundles.producer" />
22 <List key="languages" table="language" selection="${languagecondition}" order="code"/>
23 <Enumerate key="language" table="language" selection="${languagecondition}" order="code">
24 <Resource bundle="${bundle}" key="lang" language="${language.code}"/>
25 <Define key="pathprefix" value="${language.code}" />
26 <Define key="languagepreference" value="${language.code}" />
28 <If condition="language.code=='en'">
30 <Define key="pathprefix" value="or" />
31 <Define key="languagepreference" value="" />
39 <nodedefinition name="Pull">
42 <string name="blogname"/>
43 <string name="blogurl"/>
44 <string name="articletype"/>
48 <Log message="Pulling 1.0 feed from ${blogname} at ${url}" type="info" />
49 <RSS key="feeditems" url="${url}" encoding="UTF-8" />
50 <Enumerate key="item" list="feeditems['rss:item']" >
51 <Define key="languagecode" value="ot" />
52 <If condition="item['dc:language']">
54 <Set key="languagecode" value="item['dc:language']"/>
58 <If condition="item['dc:source']">
60 <Set key="origin" value="item['dc:source']"/>
63 <Set key="origin" value="item.identifier"/>
69 <If condition="item['dcterms:hasPart']">
71 <Set key="haspartimg" value="'<img align="right" src="'++item['dcterms:hasPart'] ++'" />' " />
74 <Set key="haspartimg" value="' '" />
78 <Set key="present" value="0" />
82 selection="source='${utility.escapeJDBCString(origin)}'" limit="1">
83 <Set key="present" value="1" />
85 <If condition="present==0">
87 <Log message=" new entry from ${blogname}: ${item['rss:title']}" type="info" />
92 date="utility.datetime.formatDate(item['dc:date'], 'yyyyMMdd')"
100 to_article_type="articletype"
102 content_data="item['content:encoded']++' '"
103 creator_main_url="blogurl"
104 description="haspartimg++item['rss:description']++' '"
105 to_language="languageCodeToId(languagecode)"
106 title="item['rss:title']++''"
107 webdb_create="item['dc:date']"
109 comment="'Taken from ' ++ blogname"
118 <nodedefinition name="RSSChannel">
120 <string name="articleSelection"/>
121 <string name="extratables" defaultvalue="none" />
122 <integer name="limit" defaultvalue="15"/>
123 <string name="channelidentifier" defaultvalue=""/>
124 <string name="channelfilename"/>
125 <string name="channeltitle"/>
126 <string name="articleprefix" defaultvalue="${config['Producer.PublicationHost']}/or" />
127 <string name="iconprefix" defaultvalue="${config['Producer.PublicationHost']}/icon" />
128 <string name="channelpublisher" defaultvalue="${config['Mir.Name']}" />
129 <string name="encoding" defaultvalue="UTF-8" />
130 <string name="channeldescription" defaultvalue=""/>
131 <string name="generator" defaultvalue="/RSS.template" />
135 <If condition="extratables == 'none' ">
137 <List key="articles" table="content c" selection="${articleSelection}" order = "c.webdb_create desc, c.date desc" limit="limit" />
140 <List key="articles" table="content c" selection="${articleSelection}" order = "c.webdb_create desc, c.date desc" limit="limit" extratables="${extratables}" />
143 <If condition="channeldescription==''">
145 <Define key="channeldescription" value="${channeltitle}"/>
148 <If condition="channelidentifier==''">
150 <Define key="channelidentifier" value="${config['Producer.PublicationHost']}/or/${channelfilename}"/>
155 parameters="${encoding}"
156 generator="${generator}"
157 destination="${config.storageRoot}/${channelfilename}"/>
161 <nodedefinition name="RSSChannelBundle">
163 <string name="extratables" defaultvalue="none" />
164 <string name="selection" defaultvalue="c.is_published='1'" />
165 <string name="basefilename" defaultvalue="main" />
170 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}"
171 channelfilename="${basefilename}-newswire.rss"
172 channeltitle="${config['Mir.Name']} ${basefilename} newswire"
174 extratables="${extratables}"
177 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}"
178 channelfilename="${basefilename}-newswire-content.rss"
179 channeltitle="${config['Mir.Name']} ${basefilename} newswire"
181 generator="RSS-full.template"
182 extratables="${extratables}"
186 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}"
187 channelfilename="${basefilename}-features.rss"
188 channeltitle="${config['Mir.Name']} ${basefilename} features"
190 extratables="${extratables}"
193 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}"
194 channelfilename="${basefilename}-features-content.rss"
195 channeltitle="${config['Mir.Name']} ${basefilename} features"
197 generator="RSS-full.template"
198 extratables="${extratables}"
204 <producer name="articles">
206 <verb name="changed" default="1">
207 <Define key="verbcondition" value="(not is_produced)"/>
208 <Set key="limit" value="10"/>
211 <Define key="verbcondition" value=""/>
212 <Set key="limit" value="-1"/>
216 <Define key="verbcondition" value=""/>
217 <Set key="limit" value="10"/>
221 <Enumerate key="article" table="content" selection="${verbcondition}"
222 limit="limit" order="webdb_create desc">
224 key="media" table="image"
225 selection="exists (select * from content_x_media where media_id=images.id and content_id=${article.id})
226 or exists (select * from comment_x_media, comment
227 where comment_id = comment.id and media_id=images.id and comment.to_media=${article.id})"
230 <GenerateMedia key="media" />
233 key="media" table="video"
234 selection="exists (select * from content_x_media where media_id=video.id and content_id=${article.id})
235 or exists (select * from comment_x_media, comment
236 where comment_id = comment.id and media_id=video.id and comment.to_media=${article.id})"
238 <GenerateMedia key="media" />
241 key="media" table="audio"
242 selection="exists (select * from content_x_media where media_id=audio.id and content_id=${article.id})
243 or exists (select * from comment_x_media, comment
244 where comment_id = comment.id and media_id=audio.id and comment.to_media=${article.id})"
247 <GenerateMedia key="media" />
252 key="media" table="otherMedia"
253 selection="exists (select * from content_x_media where media_id=other_media.id and content_id=${article.id})
254 or exists (select * from comment_x_media, comment
255 where comment_id = comment.id and media_id=other_media.id and comment.to_media=${article.id})"
258 <GenerateMedia key="media" />
262 <List key="topics" table="topic t"
263 selection="ctx.content_id = ${article.id} AND ctx.topic_id = t.id" />
265 <If condition="article.is_published == '1'">
269 generator="/article.template"
270 destination="${config.storageRoot}/${pathprefix}/${article.date.formatted.yyyy}/${article.date.formatted.MM}/${article.id}.shtml"/>
273 generator="/languagebar.template"
274 destination="${config.storageRoot}/languagebar/${article.to_original.date.formatted.yyyy}/${article.to_original.date.formatted.MM}/${article.to_original.id}.shtml"/>
275 <IndexContent key="article" pathToIndex="${config['IndexPath']}"/>
278 <UnIndexContent key="article" pathToIndex="${config['IndexPath']}"/>
281 <MarkContent key="article"/>
286 <producer name="staticpages">
288 <verb name="changed" default="1">
289 <Define key="verbcondition" value="(not is_produced)"/>
290 <Set key="limit" value="10"/>
293 <Define key="verbcondition" value=""/>
294 <Set key="limit" value="-1"/>
299 <Enumerate key="article" table="content" selection="${verbcondition} and to_article_type = ${articletype.static}"
300 limit="limit" order="webdb_create desc">
302 key="media" table="image"
303 selection="exists (select * from content_x_media where media_id=images.id and content_id=${article.id})"
306 <GenerateMedia key="media" />
309 key="media" table="video"
310 selection="exists (select * from content_x_media where media_id=video.id and content_id=${article.id})"
313 <GenerateMedia key="media" />
316 key="media" table="audio"
317 selection="exists (select * from content_x_media where media_id=audio.id and content_id=${article.id})"
320 <GenerateMedia key="media" />
323 key="media" table="otherMedia"
324 selection="exists (select * from content_x_media where media_id=other_media.id and content_id=${article.id})"
328 <GenerateMedia key="media" />
331 <If condition="article.is_published == '1'">
335 generator="/article.template"
336 destination="${config.storageRoot}/${pathprefix}/static/${article.edittitle}.shtml"/>
339 generator="/languagebar.template"
340 destination="${config.storageRoot}/languagebar/${article.to_original.date.formatted.yyyy}/${article.to_original.date.formatted.MM}/${article.to_original.id}.shtml"/>
341 <IndexContent key="article" pathToIndex="${config['IndexPath']}"/>
344 <UnIndexContent key="article" pathToIndex="${config['IndexPath']}"/>
347 <MarkContent key="article"/>
352 <producer name="navigation">
354 <verb name="generate" default="1" description="generates the left column"/>
359 generator="/navigation.template"
360 destination="${config.storageRoot}/${pathprefix}/navigation.inc"/>
365 <producer name="staticimages">
367 <verb name="generate" default="1" description="copies all the static image files into place"/>
370 <CopyDir destination="img" source="etc/producer/images"/>
374 <producer name="newswirearchive">
377 <Set key="pages" value="3"/>
380 <Set key="pages" value="-1"/>
384 <Define key="docSuffix" value=".shtml"/>
385 <Define key="storageSuffix" value=".shtml"/>
387 <Batch key="articles" infokey="batch" table="content"
388 process="pages" batchsize="20" minbatchsize="10"
389 selection="is_published='1' and to_article_type = ${articletype.newswire}"
390 order="webdb_create asc">
393 <Define key="pagePrefix" value="${pathprefix}/newswire/archive"/>
394 <Define key="storagePrefix" value="${config["Producer.StorageRoot"]}/${pagePrefix}"/>
395 <Define key="docPrefix" value="${config["Producer.DocRoot"]}/${pagePrefix}"/>
398 generator="newswirearchive.template"
399 destination="${storagePrefix}${batch.current.identifier}${storageSuffix}"/>
405 <Define key="pagePrefix" value="${pathprefix}/newswire/archive"/>
406 <Define key="storagePrefix" value="${config["Producer.StorageRoot"]}/${pagePrefix}"/>
407 <Define key="docPrefix" value="${config["Producer.DocRoot"]}/${pagePrefix}"/>
409 generator="batchnav.template"
410 destination="${storagePrefix}nav${storageSuffix}"/>
417 <producer name="featurearchive">
420 <Set key="pages" value="3"/>
423 <Set key="pages" value="-1"/>
427 <Define key="docSuffix" value=".shtml"/>
428 <Define key="storageSuffix" value=".shtml"/>
430 <Batch key="articles" infokey="batch" table="content"
431 process="pages" batchsize="20" minbatchsize="10"
432 selection="is_published='1' and to_article_type in (${articletype.feature}, ${articletype.startspecial})"
433 order="webdb_create asc">
436 <Define key="pagePrefix" value="${pathprefix}/feature/archive"/>
437 <Define key="storagePrefix" value="${config["Producer.StorageRoot"]}/${pagePrefix}"/>
438 <Define key="docPrefix" value="${config["Producer.DocRoot"]}/${pagePrefix}"/>
441 generator="featurearchive.template"
442 destination="${storagePrefix}${batch.current.identifier}${storageSuffix}"/>
448 <Define key="pagePrefix" value="${pathprefix}/feature/archive"/>
449 <Define key="storagePrefix" value="${config["Producer.StorageRoot"]}/${pagePrefix}"/>
450 <Define key="docPrefix" value="${config["Producer.DocRoot"]}/${pagePrefix}"/>
452 generator="batchnav.template"
453 destination="${storagePrefix}nav${storageSuffix}"/>
460 <producer name="topicpages">
463 <Set key="_topics" value="-1"/>
464 <Set key="pages" value="3"/>
467 <Set key="_topics" value="-1"/>
468 <Set key="pages" value="-1"/>
471 <Set key="_topics" value="2"/>
472 <Set key="pages" value="4"/>
476 <Enumerate key="topic" table="topic">
477 <Define key="docSuffix" value=".html"/>
478 <Define key="storageSuffix" value=".html"/>
480 <Log message="topic = ${topic.title}" />
481 <List key="special" table="content c"
482 selection="c.is_published='1' and c.to_article_type = ${articletype.topicspecial} and c.id=cxt.content_id and cxt.topic_id = ${topic.id}"
483 order = "webdb_create desc" limit="1"
484 extratables="content_x_topic cxt"/>
486 <Batch key="articles" infokey="batch" table="content c"
487 process="pages" batchsize="20" minbatchsize="10"
488 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}"
489 order="webdb_create asc" extratables="content_x_topic cxt">
492 <Define key="pagePrefix" value="${pathprefix}/${topic.filename}/archive"/>
493 <Define key="storagePrefix" value="${config["Producer.StorageRoot"]}/${pagePrefix}"/>
494 <Define key="docPrefix" value="${config["Producer.DocRoot"]}/${pagePrefix}"/>
495 <Log message="topic now = ${topic.title}" />
498 generator="topicpage.template"
499 destination="${storagePrefix}${batch.current.identifier}${storageSuffix}"/>
505 <Define key="pagePrefix" value="${pathprefix}/${topic.filename}/archive"/>
506 <Define key="storagePrefix" value="${config["Producer.StorageRoot"]}/${pagePrefix}"/>
507 <Define key="docPrefix" value="${config["Producer.DocRoot"]}/${pagePrefix}"/>
509 generator="batchnav.template"
510 destination="${storagePrefix}nav${storageSuffix}"/>
519 <producer name="opnewswireinclude">
521 <verb name="generate" default="1" description="Generates the op newswire"/>
524 <Set key="whichnewswire" value="Open Publishing News" />
525 <List key="newswire" table="content" limit="20"
526 selection="is_published=true and to_article_type=${articletype.newswire}"
527 order="webdb_create desc"/>
530 generator="/newswireinclude.template"
531 destination="${config.storageRoot}/${pathprefix}/newswireinclude.shtml"/>
538 <producer name="rssnewswireinclude">
540 <verb name="generate" default="1" description="Generates the rss newswire"/>
543 <Set key="whichnewswire" value="RSS Publishing News" />
544 <List key="newswire" table="content" limit="20"
545 selection="is_published=true and to_article_type=${articletype.communityrssarticle}"
546 order="webdb_create desc"/>
549 generator="/newswireinclude.template"
550 destination="${config.storageRoot}/${pathprefix}/rssnewswireinclude.shtml"/>
559 <producer name="startpage">
561 <verb name="generate" default="1" description="Generates the startpage"/>
565 <List key="startspecial" table="content" limit="1"
566 selection="is_published=true and to_article_type=${articletype.startspecial}"
567 order="webdb_create desc"/>
569 <List key="features" table="content" limit="5"
570 selection="is_published=true and to_article_type in (${articletype.feature},${articletype.promotedcommunityarticle},${articletype.promotednewswire})"
571 order="webdb_create desc"/>
573 <List key="communityrssarticles" table="content" limit="10"
574 selection="is_published=true and to_article_type in (${articletype.communityrssarticle},${articletype.promotedcommunityarticle})"
575 order="webdb_create desc"/>
577 <List key="newswire" table="content" limit="20"
578 selection="is_published=true and to_article_type=${articletype.newswire}"
579 order="webdb_create desc"/>
581 <List key="mostcomments"
583 extratables="comment cm"
584 selection="c.webdb_create > NOW()-'2 years'::interval and c.is_published=true and c.id=cm.to_media group by c.id,c.title,
585 c.subtitle,c.edittitle,c.date,c.creator,c.creator_main_url,c.creator_email,c.creator_address,c.creator_phone,c.description,
586 c.comment,c.source,c.is_published,c.is_produced,c.to_publisher,c.to_language,c.to_rights,c.webdb_create,c.webdb_lastchange,
587 c.content_data,c.is_html,c.to_article_type,c.to_content,c.keywords,c.to_locking_user"
588 order="count(cm.id) desc"
593 <List key="breakingnews" table="breakingNews" limit="10"
594 order="webdb_create desc"/>
598 generator="/startpage.template"
599 destination="${config.storageRoot}/${pathprefix}/index.html"/>
604 <producer name="synchronization">
606 <verb name="run" default="1" description="Synchronizes the publication site with the production site"/>
610 <If condition="config['Rsync'] in ('1', 'y', 'yes', 'Y')">
612 <Execute command="${config['Rsync.Script.Path']}"/>
619 <producer name="media">
621 <verb name="new" default="1">
622 <Define key="verbcondition" value="(not is_produced)"/>
623 <Set key="limit" value="10"/>
626 <Define key="verbcondition" value=""/>
627 <Set key="limit" value="-1"/>
631 <Define key="verbcondition" value=""/>
632 <Set key="limit" value="10"/>
637 key="media" table="image"
638 selection="${verbcondition}"
640 order="webdb_create desc">
642 <GenerateMedia key="media" />
645 key="media" table="video"
646 selection="${verbcondition}"
648 order="webdb_create desc">
650 <GenerateMedia key="media" />
653 key="media" table="audio"
654 selection="${verbcondition}"
656 order="webdb_create desc">
658 <GenerateMedia key="media" />
661 key="media" table="otherMedia"
662 selection="${verbcondition}"
664 order="webdb_create desc">
666 <GenerateMedia key="media" />
671 <producer name="syndication">
673 <verb name="generate" />
676 <!-- the main features and newswire -->
679 <!-- the topic features and newswires -->
680 <Enumerate key="topic" table="topic">
682 basefilename="${topic.filename}"
683 selection="c.id=cxt.content_id and cxt.topic_id = ${topic.id}"
684 extratables="content_x_topic cxt"
694 <producer name="radicalendar">
699 <!-- groupname you will see as the value of "group" in the url for your radicalendar page, -->
700 <!-- gmtoffset is in minutes -->
701 <Radicalendar key="calendar" groupname="_imc" gmtoffset="60" />
703 generator="/radicalendar.template"
704 destination="${config.storageRoot}/calendarinclude.shtml"/>
711 <producer name="update">
713 <verb name="templates" description="updates templates and bundles">
714 <Define key="command" value="/usr/bin/rsync -rb --include=*/ --include=*.template /var/lib/mir/nyc/mir/etc/ /var/lib/mir/nyc/mir/bin/mir/WEB-INF/etc/"/>
719 <Execute command="${command}"/>
727 <producer name="generatefpincludes">
733 <Set key="counter" value="1"/>
734 <Enumerate key="fpimage" table="image" selection="to_media_folder=8 and is_published=true" >
735 <Log message="generating include for image id: ${fpimage.id}" type="info" />
738 generator="/fpinclude.template"
739 destination="${config.storageRoot}/fpincludes/${fpimage.id}.inc" />
740 <Set key="counter" value="counter+1" />
744 <List key="fpincludes" table="image" selection="to_media_folder=8 and is_published=true" />
746 generator="/fpmapping.template"
747 destination="${config.storageRoot}/fpincludes/map.txt" />
755 <!-- generates a count for each topic -->
757 <!-- TODO: add date limit when we actually are going live with this -->
758 <producer name="generateTopicCounts">
763 <FreeQuery key="topicCounts" query=" SELECT count(x.content_id) as count, t.title FROM topic as t LEFT OUTER JOIN content_x_topic
764 as x ON (t.id=x.topic_id) LEFT OUTER JOIN content as c ON (c.id=x.content_id)
765 WHERE t.archiv_url = 'Category' GROUP BY t.title ORDER BY length(t.title)"
768 <Generate generator="/topiccount.template"
769 destination="${config.storageRoot}/${pathprefix}/topiccount.shtml" />
775 <producer name="generateRandomTopics">
780 <Set key="counter" value="1"/>
782 <Enumerate key="category" table="topic t" extratables="topic t2"
783 selection="t.id=t2.id AND t.archiv_url = 'Category' AND (SELECT count(*) from content_x_topic where topic_id = t.id) > 0" order="RANDOM()" limit="20">
785 <Log message="Getting Last 5 articles for category: ${category.title} - counter: ${counter}" />
786 <Define key="topictitle" value="${category.title}" />
789 <List key="randomarticles" table="content"
790 selection ="id in (select content_id from content_x_topic where topic_id = ${category.id})" order="date DESC"
794 generator="/randomcategory.template"
795 destination="${config.storageRoot}/fpincludes/random${counter}.inc" />
798 <Set key="counter" value="counter+1" />
803 <producer name="getlocalblogs">
808 <Enumerate key="article" table="content" selection="to_article_type in(${articletype.communityrssfeed}) and is_published=true" order="webdb_create desc">
809 <Log message="Pulling 1.0 feed from ${article.title} at ${article.source}" type="info" />
811 url="${article.source}"
812 articletype="${articletype.communityrssarticle}"
813 blogurl="${article.creator_main_url}"
814 blogname="${article.title}"