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 <Log message="I have a topic list with ${utility.listSize(topics)}" />
266 <If condition="article.is_published == '1'">
270 generator="/article.template"
271 destination="${config.storageRoot}/${pathprefix}/${article.date.formatted.yyyy}/${article.date.formatted.MM}/${article.id}.shtml"/>
274 generator="/languagebar.template"
275 destination="${config.storageRoot}/languagebar/${article.to_original.date.formatted.yyyy}/${article.to_original.date.formatted.MM}/${article.to_original.id}.shtml"/>
276 <IndexContent key="article" pathToIndex="${config['IndexPath']}"/>
279 <UnIndexContent key="article" pathToIndex="${config['IndexPath']}"/>
282 <MarkContent key="article"/>
287 <producer name="staticpages">
289 <verb name="changed" default="1">
290 <Define key="verbcondition" value="(not is_produced)"/>
291 <Set key="limit" value="10"/>
294 <Define key="verbcondition" value=""/>
295 <Set key="limit" value="-1"/>
300 <Enumerate key="article" table="content" selection="${verbcondition} and to_article_type = ${articletype.static}"
301 limit="limit" order="webdb_create desc">
303 key="media" table="image"
304 selection="exists (select * from content_x_media where media_id=images.id and content_id=${article.id})"
307 <GenerateMedia key="media" />
310 key="media" table="video"
311 selection="exists (select * from content_x_media where media_id=video.id and content_id=${article.id})"
314 <GenerateMedia key="media" />
317 key="media" table="audio"
318 selection="exists (select * from content_x_media where media_id=audio.id and content_id=${article.id})"
321 <GenerateMedia key="media" />
324 key="media" table="otherMedia"
325 selection="exists (select * from content_x_media where media_id=other_media.id and content_id=${article.id})"
329 <GenerateMedia key="media" />
332 <If condition="article.is_published == '1'">
336 generator="/article.template"
337 destination="${config.storageRoot}/${pathprefix}/static/${article.edittitle}.shtml"/>
340 generator="/languagebar.template"
341 destination="${config.storageRoot}/languagebar/${article.to_original.date.formatted.yyyy}/${article.to_original.date.formatted.MM}/${article.to_original.id}.shtml"/>
342 <IndexContent key="article" pathToIndex="${config['IndexPath']}"/>
345 <UnIndexContent key="article" pathToIndex="${config['IndexPath']}"/>
348 <MarkContent key="article"/>
353 <producer name="navigation">
355 <verb name="generate" default="1" description="generates the left column"/>
360 generator="/navigation.template"
361 destination="${config.storageRoot}/${pathprefix}/navigation.inc"/>
366 <producer name="staticimages">
368 <verb name="generate" default="1" description="copies all the static image files into place"/>
371 <CopyDir destination="img" source="etc/producer/images"/>
375 <producer name="newswirearchive">
378 <Set key="pages" value="3"/>
381 <Set key="pages" value="-1"/>
385 <Define key="docSuffix" value=".shtml"/>
386 <Define key="storageSuffix" value=".shtml"/>
388 <Batch key="articles" infokey="batch" table="content"
389 process="pages" batchsize="20" minbatchsize="10"
390 selection="is_published='1' and to_article_type = ${articletype.newswire}"
391 order="webdb_create asc">
394 <Define key="pagePrefix" value="${pathprefix}/newswire/archive"/>
395 <Define key="storagePrefix" value="${config["Producer.StorageRoot"]}/${pagePrefix}"/>
396 <Define key="docPrefix" value="${config["Producer.DocRoot"]}/${pagePrefix}"/>
399 generator="newswirearchive.template"
400 destination="${storagePrefix}${batch.current.identifier}${storageSuffix}"/>
406 <Define key="pagePrefix" value="${pathprefix}/newswire/archive"/>
407 <Define key="storagePrefix" value="${config["Producer.StorageRoot"]}/${pagePrefix}"/>
408 <Define key="docPrefix" value="${config["Producer.DocRoot"]}/${pagePrefix}"/>
410 generator="batchnav.template"
411 destination="${storagePrefix}nav${storageSuffix}"/>
418 <producer name="featurearchive">
421 <Set key="pages" value="3"/>
424 <Set key="pages" value="-1"/>
428 <Define key="docSuffix" value=".shtml"/>
429 <Define key="storageSuffix" value=".shtml"/>
431 <Batch key="articles" infokey="batch" table="content"
432 process="pages" batchsize="20" minbatchsize="10"
433 selection="is_published='1' and to_article_type in (${articletype.feature}, ${articletype.startspecial})"
434 order="webdb_create asc">
437 <Define key="pagePrefix" value="${pathprefix}/feature/archive"/>
438 <Define key="storagePrefix" value="${config["Producer.StorageRoot"]}/${pagePrefix}"/>
439 <Define key="docPrefix" value="${config["Producer.DocRoot"]}/${pagePrefix}"/>
442 generator="featurearchive.template"
443 destination="${storagePrefix}${batch.current.identifier}${storageSuffix}"/>
449 <Define key="pagePrefix" value="${pathprefix}/feature/archive"/>
450 <Define key="storagePrefix" value="${config["Producer.StorageRoot"]}/${pagePrefix}"/>
451 <Define key="docPrefix" value="${config["Producer.DocRoot"]}/${pagePrefix}"/>
453 generator="batchnav.template"
454 destination="${storagePrefix}nav${storageSuffix}"/>
461 <producer name="topicpages">
464 <Set key="_topics" value="-1"/>
465 <Set key="pages" value="3"/>
468 <Set key="_topics" value="-1"/>
469 <Set key="pages" value="-1"/>
472 <Set key="_topics" value="2"/>
473 <Set key="pages" value="4"/>
477 <Enumerate key="topic" table="topic">
478 <Define key="docSuffix" value=".html"/>
479 <Define key="storageSuffix" value=".html"/>
481 <Log message="topic = ${topic.title}" />
482 <List key="special" table="content c"
483 selection="c.is_published='1' and c.to_article_type = ${articletype.topicspecial} and c.id=cxt.content_id and cxt.topic_id = ${topic.id}"
484 order = "webdb_create desc" limit="1"
485 extratables="content_x_topic cxt"/>
487 <Batch key="articles" infokey="batch" table="content c"
488 process="pages" batchsize="20" minbatchsize="10"
489 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}"
490 order="webdb_create asc" extratables="content_x_topic cxt">
493 <Define key="pagePrefix" value="${pathprefix}/${topic.filename}/archive"/>
494 <Define key="storagePrefix" value="${config["Producer.StorageRoot"]}/${pagePrefix}"/>
495 <Define key="docPrefix" value="${config["Producer.DocRoot"]}/${pagePrefix}"/>
496 <Log message="topic now = ${topic.title}" />
499 generator="topicpage.template"
500 destination="${storagePrefix}${batch.current.identifier}${storageSuffix}"/>
506 <Define key="pagePrefix" value="${pathprefix}/${topic.filename}/archive"/>
507 <Define key="storagePrefix" value="${config["Producer.StorageRoot"]}/${pagePrefix}"/>
508 <Define key="docPrefix" value="${config["Producer.DocRoot"]}/${pagePrefix}"/>
510 generator="batchnav.template"
511 destination="${storagePrefix}nav${storageSuffix}"/>
520 <producer name="opnewswireinclude">
522 <verb name="generate" default="1" description="Generates the op newswire"/>
525 <Set key="whichnewswire" value="Open Publishing News" />
526 <List key="newswire" table="content" limit="20"
527 selection="is_published=true and to_article_type=${articletype.newswire}"
528 order="webdb_create desc"/>
531 generator="/newswireinclude.template"
532 destination="${config.storageRoot}/${pathprefix}/newswireinclude.shtml"/>
539 <producer name="rssnewswireinclude">
541 <verb name="generate" default="1" description="Generates the rss newswire"/>
544 <Set key="whichnewswire" value="RSS Publishing News" />
545 <List key="newswire" table="content" limit="20"
546 selection="is_published=true and to_article_type=${articletype.communityrssarticle}"
547 order="webdb_create desc"/>
550 generator="/newswireinclude.template"
551 destination="${config.storageRoot}/${pathprefix}/rssnewswireinclude.shtml"/>
560 <producer name="startpage">
562 <verb name="generate" default="1" description="Generates the startpage"/>
566 <List key="startspecial" table="content" limit="1"
567 selection="is_published=true and to_article_type=${articletype.startspecial}"
568 order="webdb_create desc"/>
570 <List key="features" table="content" limit="5"
571 selection="is_published=true and to_article_type in (${articletype.feature},${articletype.promotedcommunityarticle},${articletype.promotednewswire})"
572 order="webdb_create desc"/>
574 <List key="communityrssarticles" table="content" limit="10"
575 selection="is_published=true and to_article_type in (${articletype.communityrssarticle},${articletype.promotedcommunityarticle})"
576 order="webdb_create desc"/>
578 <List key="newswire" table="content" limit="20"
579 selection="is_published=true and to_article_type=${articletype.newswire}"
580 order="webdb_create desc"/>
582 <List key="mostcomments"
584 extratables="comment cm"
585 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,
586 c.subtitle,c.edittitle,c.date,c.creator,c.creator_main_url,c.creator_email,c.creator_address,c.creator_phone,c.description,
587 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,
588 c.content_data,c.is_html,c.to_article_type,c.to_content,c.keywords,c.to_locking_user"
589 order="count(cm.id) desc"
594 <List key="breakingnews" table="breakingNews" limit="10"
595 order="webdb_create desc"/>
599 generator="/startpage.template"
600 destination="${config.storageRoot}/${pathprefix}/index.html"/>
605 <producer name="synchronization">
607 <verb name="run" default="1" description="Synchronizes the publication site with the production site"/>
611 <If condition="config['Rsync'] in ('1', 'y', 'yes', 'Y')">
613 <Execute command="${config['Rsync.Script.Path']}"/>
620 <producer name="media">
622 <verb name="new" default="1">
623 <Define key="verbcondition" value="(not is_produced)"/>
624 <Set key="limit" value="10"/>
627 <Define key="verbcondition" value=""/>
628 <Set key="limit" value="-1"/>
632 <Define key="verbcondition" value=""/>
633 <Set key="limit" value="10"/>
638 key="media" table="image"
639 selection="${verbcondition}"
641 order="webdb_create desc">
643 <GenerateMedia key="media" />
646 key="media" table="video"
647 selection="${verbcondition}"
649 order="webdb_create desc">
651 <GenerateMedia key="media" />
654 key="media" table="audio"
655 selection="${verbcondition}"
657 order="webdb_create desc">
659 <GenerateMedia key="media" />
662 key="media" table="otherMedia"
663 selection="${verbcondition}"
665 order="webdb_create desc">
667 <GenerateMedia key="media" />
672 <producer name="syndication">
674 <verb name="generate" />
677 <!-- the main features and newswire -->
680 <!-- the topic features and newswires -->
681 <Enumerate key="topic" table="topic">
683 basefilename="${topic.filename}"
684 selection="c.id=cxt.content_id and cxt.topic_id = ${topic.id}"
685 extratables="content_x_topic cxt"
695 <producer name="radicalendar">
700 <!-- groupname you will see as the value of "group" in the url for your radicalendar page, -->
701 <!-- gmtoffset is in minutes -->
702 <Radicalendar key="calendar" groupname="_imc" gmtoffset="60" />
704 generator="/radicalendar.template"
705 destination="${config.storageRoot}/calendarinclude.shtml"/>
712 <producer name="update">
714 <verb name="templates" description="updates templates and bundles">
715 <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/"/>
720 <Execute command="${command}"/>
728 <producer name="generatefpincludes">
734 <Set key="counter" value="1"/>
735 <Enumerate key="fpimage" table="image" selection="to_media_folder=8 and is_published=true" >
736 <Log message="generating include for image id: ${fpimage.id}" type="info" />
739 generator="/fpinclude.template"
740 destination="${config.storageRoot}/fpincludes/${fpimage.id}.inc" />
741 <Set key="counter" value="counter+1" />
745 <List key="fpincludes" table="image" selection="to_media_folder=8 and is_published=true" />
747 generator="/fpmapping.template"
748 destination="${config.storageRoot}/fpincludes/map.txt" />
756 <!-- generates a count for each topic -->
758 <!-- TODO: add date limit when we actually are going live with this -->
759 <producer name="generateTopicCounts">
764 <FreeQuery key="topicCounts" query=" SELECT count(x.content_id) as count, t.title FROM topic as t LEFT OUTER JOIN content_x_topic
765 as x ON (t.id=x.topic_id) LEFT OUTER JOIN content as c ON (c.id=x.content_id)
766 WHERE t.archiv_url = 'Category' GROUP BY t.title ORDER BY length(t.title)"
769 <Generate generator="/topiccount.template"
770 destination="${config.storageRoot}/${pathprefix}/topiccount.shtml" />
776 <producer name="generateRandomTopics">
781 <Set key="counter" value="1"/>
783 <Enumerate key="category" table="topic t" extratables="topic t2"
784 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">
786 <Log message="Getting Last 5 articles for category: ${category.title} - counter: ${counter}" />
787 <Define key="topictitle" value="${category.title}" />
790 <List key="randomarticles" table="content"
791 selection ="id in (select content_id from content_x_topic where topic_id = ${category.id})" order="date DESC"
795 generator="/randomcategory.template"
796 destination="${config.storageRoot}/fpincludes/random${counter}.inc" />
799 <Set key="counter" value="counter+1" />
804 <producer name="getlocalblogs">
809 <Enumerate key="article" table="content" selection="to_article_type in(${articletype.communityrssfeed}) and is_published=true" order="webdb_create desc">
810 <Log message="Pulling 1.0 feed from ${article.title} at ${article.source}" type="info" />
812 url="${article.source}"
813 articletype="${articletype.communityrssarticle}"
814 blogurl="${article.creator_main_url}"
815 blogname="${article.title}"