2 This XML file defines a set of producers intended for a typical indymedia site:
13 <nodedefinition name="Language">
15 <string name="languagecondition" defaultvalue="code != 'ot'"/>
16 <string name="bundle" defaultvalue="bundles.producer" />
21 <List key="languages" table="language" selection="${languagecondition}" order="code"/>
22 <Enumerate key="language" table="language" selection="${languagecondition}" order="code">
23 <Resource bundle="${bundle}" key="lang" language="${language.code}"/>
24 <Define key="pathprefix" value="${language.code}" />
25 <Define key="languagepreference" value="${language.code}" />
27 <If condition="language.code=='en'">
29 <Define key="pathprefix" value="or" />
30 <Define key="languagepreference" value="" />
38 <nodedefinition name="Pull">
41 <string name="blogname"/>
42 <string name="blogurl"/>
43 <string name="articletype"/>
47 <Log message="Pulling 1.0 feed from ${blogname} at ${url}" type="info" />
48 <RSS key="feeditems" url="${url}" encoding="UTF-8" />
49 <Enumerate key="item" list="feeditems['rss:item']" >
50 <Define key="languagecode" value="ot" />
51 <If condition="item['dc:language']">
53 <Set key="languagecode" value="item['dc:language']"/>
57 <If condition="item['dc:source']">
59 <Set key="origin" value="item['dc:source']"/>
62 <Set key="origin" value="item.identifier"/>
68 <If condition="item['dcterms:hasPart']">
70 <Set key="haspartimg" value="'<img align="right" src="'++item['dcterms:hasPart'] ++'" />' " />
73 <Set key="haspartimg" value="' '" />
77 <Set key="present" value="0" />
81 selection="source='${utility.escapeJDBCString(origin)}'" limit="1">
82 <Set key="present" value="1" />
84 <If condition="present==0">
86 <Log message=" new entry from ${blogname}: ${item['rss:title']}" type="info" />
91 date="utility.datetime.formatDate(item['dc:date'], 'yyyyMMdd')"
99 to_article_type="articletype"
101 content_data="item['content:encoded']++' '"
102 creator_main_url="blogurl"
103 description="haspartimg++item['rss:description']++' '"
104 to_language="languageCodeToId(languagecode)"
105 title="item['rss:title']++''"
106 webdb_create="item['dc:date']"
108 comment="'Taken from ' ++ blogname"
117 <nodedefinition name="RSSChannel">
119 <string name="articleSelection"/>
120 <string name="extratables" defaultvalue="none" />
121 <integer name="limit" defaultvalue="15"/>
122 <string name="channelidentifier" defaultvalue=""/>
123 <string name="channelfilename"/>
124 <string name="channeltitle"/>
125 <string name="articleprefix" defaultvalue="${config['Producer.PublicationHost']}/or" />
126 <string name="iconprefix" defaultvalue="${config['Producer.PublicationHost']}/icon" />
127 <string name="channelpublisher" defaultvalue="${config['Mir.Name']}" />
128 <string name="encoding" defaultvalue="UTF-8" />
129 <string name="channeldescription" defaultvalue=""/>
130 <string name="generator" defaultvalue="/RSS.template" />
134 <If condition="extratables == 'none' ">
136 <List key="articles" table="content" selection="${articleSelection}" order = "webdb_create desc, date desc" limit="limit" />
139 <List key="articles" table="content" selection="${articleSelection}" order = "webdb_create desc, date desc" limit="limit" extratables="${extratables}" />
142 <If condition="channeldescription==''">
144 <Define key="channeldescription" value="${channeltitle}"/>
147 <If condition="channelidentifier==''">
149 <Define key="channelidentifier" value="${config['Producer.PublicationHost']}/or/${channelfilename}"/>
154 parameters="${encoding}"
155 generator="${generator}"
156 destination="${config.storageRoot}/${channelfilename}"/>
160 <nodedefinition name="RSSChannelBundle">
162 <string name="extratables" defaultvalue="none" />
163 <string name="selection" defaultvalue="is_published='1'" />
164 <string name="basefilename" defaultvalue="main" />
169 articleSelection="(to_article_type in (${articletype.newswire}) or (to_article_type=${articletype.translation} and to_original.to_articletype in (${articletype.newswire}))) and ${selection}"
170 channelfilename="${basefilename}-newswire.rss"
171 channeltitle="${config['Mir.Name']} ${basefilename} newswire"
173 extratables="${extratables}"
176 articleSelection="(to_article_type in (${articletype.newswire}) or (to_article_type=${articletype.translation} and to_original.to_articletype in (${articletype.newsire}))) and ${selection}"
177 channelfilename="${basefilename}-newswire-content.rss"
178 channeltitle="${config['Mir.Name']} ${basefilename} newswire"
180 generator="RSS-full.template"
181 extratables="${extratables}"
185 articleSelection="(to_article_type in (${articletype.feature},${articletype.startspecial},${articletype.topicspecial})) and ${selection}"
186 channelfilename="${basefilename}-features.rss"
187 channeltitle="${config['Mir.Name']} ${basefilename} features"
189 extratables="${extratables}"
192 articleSelection="(to_article_type in (${articletype.feature},${articletype.startspecial},${articletype.topicspecial})) and ${selection}"
193 channelfilename="${basefilename}-features-content.rss"
194 channeltitle="${config['Mir.Name']} ${basefilename} features"
196 generator="RSS-full.template"
197 extratables="${extratables}"
203 <producer name="articles">
205 <verb name="changed" default="1">
206 <Define key="verbcondition" value="(not is_produced) and to_article_type != ${articletype.static}"/>
207 <Set key="limit" value="10"/>
210 <Define key="verbcondition" value="to_article_type != ${articletype.static}"/>
211 <Set key="limit" value="-1"/>
215 <Define key="verbcondition" value="to_article_type != ${articletype.static}"/>
216 <Set key="limit" value="10"/>
220 <Define key="verbcondition" value="(id>=5000 and id<7500 ) and to_article_type != ${articletype.static}"/>
221 <Set key="limit" value="2500"/>
225 <Define key="verbcvondition" value="(not is_produced) and to_article_type != ${articletype.static}"/>
226 <Set key="limit" value="5000"/>
230 <Enumerate key="article" table="content" selection="${verbcondition}"
231 limit="limit" order="webdb_create desc">
233 key="media" table="image"
234 selection="exists (select * from content_x_media where media_id=images.id and content_id=${article.id})
235 or exists (select * from comment_x_media, comment
236 where comment_id = comment.id and media_id=images.id and comment.to_media=${article.id})"
239 <GenerateMedia key="media" />
242 key="media" table="video"
243 selection="exists (select * from content_x_media where media_id=video.id and content_id=${article.id})
244 or exists (select * from comment_x_media, comment
245 where comment_id = comment.id and media_id=video.id and comment.to_media=${article.id})"
247 <GenerateMedia key="media" />
250 key="media" table="audio"
251 selection="exists (select * from content_x_media where media_id=audio.id and content_id=${article.id})
252 or exists (select * from comment_x_media, comment
253 where comment_id = comment.id and media_id=audio.id and comment.to_media=${article.id})"
256 <GenerateMedia key="media" />
261 key="media" table="otherMedia"
262 selection="exists (select * from content_x_media where media_id=other_media.id and content_id=${article.id})
263 or exists (select * from comment_x_media, comment
264 where comment_id = comment.id and media_id=other_media.id and comment.to_media=${article.id})"
267 <GenerateMedia key="media" />
271 <List key="topics" table="topic t" extratables="content_x_topic ctx"
272 selection="ctx.content_id = ${article.id} AND ctx.topic_id = t.id" />
273 <If condition="utility.listSize(topics) > 0">
275 <Log message="I have a topic list with ${utility.listSize(topics)}" />
278 <If condition="article.is_published == '1'">
282 generator="/article.template"
283 destination="${config.storageRoot}/${pathprefix}/${article.date.formatted.yyyy}/${article.date.formatted.MM}/${article.id}.html"/>
286 generator="/languagebar.template"
287 destination="${config.storageRoot}/languagebar/${article.to_original.date.formatted.yyyy}/${article.to_original.date.formatted.MM}/${article.to_original.id}.html"/>
288 <IndexContent key="article" pathToIndex="${config['IndexPath']}"/>
291 <UnIndexContent key="article" pathToIndex="${config['IndexPath']}"/>
294 <MarkContent key="article"/>
299 <producer name="staticpages">
301 <verb name="changed" default="1">
302 <Define key="verbcondition" value="(not is_produced) and to_article_type = ${articletype.static}"/>
303 <Set key="limit" value="10"/>
306 <Define key="verbcondition" value="to_article_type = ${articletype.static}"/>
307 <Set key="limit" value="-1"/>
312 <Enumerate key="article" table="content" selection="${verbcondition}"
313 limit="limit" order="webdb_create desc">
315 key="media" table="image"
316 selection="exists (select * from content_x_media where media_id=images.id and content_id=${article.id})"
319 <GenerateMedia key="media" />
322 key="media" table="video"
323 selection="exists (select * from content_x_media where media_id=video.id and content_id=${article.id})"
326 <GenerateMedia key="media" />
329 key="media" table="audio"
330 selection="exists (select * from content_x_media where media_id=audio.id and content_id=${article.id})"
333 <GenerateMedia key="media" />
336 key="media" table="otherMedia"
337 selection="exists (select * from content_x_media where media_id=other_media.id and content_id=${article.id})"
341 <GenerateMedia key="media" />
343 <List key="topics" table="topic t" extratables="content_x_topic ctx"
344 selection="ctx.content_id = ${article.id} AND ctx.topic_id = t.id" />
346 <If condition="article.is_published == '1'">
350 generator="/staticpage.template"
351 destination="${config.storageRoot}/${pathprefix}/static/${article.edittitle}.html"/>
355 generator="/languagebar.template"
356 destination="${config.storageRoot}/languagebar/${article.to_original.date.formatted.yyyy}/${article.to_original.date.formatted.MM}/${article.to_original.id}.html"/>
357 <IndexContent key="article" pathToIndex="${config['IndexPath']}"/>
360 <UnIndexContent key="article" pathToIndex="${config['IndexPath']}"/>
363 <MarkContent key="article"/>
368 <producer name="navigation">
370 <verb name="generate" default="1" description="generates the left column"/>
375 generator="/navigation.template"
376 destination="${config.storageRoot}/${pathprefix}/navigation.html"/>
381 <producer name="staticimages">
383 <verb name="generate" default="1" description="copies all the static image files into place"/>
386 <CopyDir destination="img" source="etc/producer/images"/>
391 <producer name="staticfiles">
393 <verb name="generate" default="1" description="copies all the static image files into place"/>
396 <CopyDir destination="js" source="etc/producer/js"/>
400 <producer name="newswirearchive">
403 <Set key="pages" value="3"/>
406 <Set key="pages" value="-1"/>
410 <Define key="docSuffix" value=".html"/>
411 <Define key="storageSuffix" value=".html"/>
413 <Batch key="articles" infokey="batch" table="content"
414 process="pages" batchsize="20" minbatchsize="10"
415 selection="is_published='1' and to_article_type = ${articletype.newswire}"
416 order="webdb_create asc">
419 <Define key="pagePrefix" value="${pathprefix}/newswire/archive"/>
420 <Define key="storagePrefix" value="${config["Producer.StorageRoot"]}/${pagePrefix}"/>
421 <Define key="docPrefix" value="${config["Producer.DocRoot"]}/${pagePrefix}"/>
424 generator="newswirearchive.template"
425 destination="${storagePrefix}${batch.current.identifier}${storageSuffix}"/>
431 <Define key="pagePrefix" value="${pathprefix}/newswire/archive"/>
432 <Define key="storagePrefix" value="${config["Producer.StorageRoot"]}/${pagePrefix}"/>
433 <Define key="docPrefix" value="${config["Producer.DocRoot"]}/${pagePrefix}"/>
435 generator="batchnav.template"
436 destination="${storagePrefix}nav${storageSuffix}"/>
443 <producer name="featurearchive">
446 <Set key="pages" value="3"/>
449 <Set key="pages" value="-1"/>
453 <Define key="docSuffix" value=".html"/>
454 <Define key="storageSuffix" value=".html"/>
456 <Batch key="articles" infokey="batch" table="content"
457 process="pages" batchsize="20" minbatchsize="10"
458 selection="is_published='1' and to_article_type in (${articletype.feature}, ${articletype.startspecial})"
459 order="webdb_create asc">
462 <Define key="pagePrefix" value="${pathprefix}/feature/archive"/>
463 <Define key="storagePrefix" value="${config["Producer.StorageRoot"]}/${pagePrefix}"/>
464 <Define key="docPrefix" value="${config["Producer.DocRoot"]}/${pagePrefix}"/>
467 generator="featurearchive.template"
468 destination="${storagePrefix}${batch.current.identifier}${storageSuffix}"/>
474 <Define key="pagePrefix" value="${pathprefix}/feature/archive"/>
475 <Define key="storagePrefix" value="${config["Producer.StorageRoot"]}/${pagePrefix}"/>
476 <Define key="docPrefix" value="${config["Producer.DocRoot"]}/${pagePrefix}"/>
478 generator="batchnav.template"
479 destination="${storagePrefix}nav${storageSuffix}"/>
486 <producer name="topicpages">
489 <Set key="_topics" value="-1"/>
490 <Set key="pages" value="3"/>
493 <Set key="_topics" value="-1"/>
494 <Set key="pages" value="-1"/>
497 <Set key="_topics" value="2"/>
498 <Set key="pages" value="4"/>
502 <Enumerate key="topic" table="topic">
503 <Define key="docSuffix" value=".html"/>
504 <Define key="storageSuffix" value=".html"/>
506 <Log message="topic = ${topic.title}" />
507 <List key="special" table="content c"
508 selection="c.is_published='1' and c.to_article_type = ${articletype.topicspecial} and c.id=cxt.content_id and cxt.topic_id = ${topic.id}"
509 order = "webdb_create desc" limit="1"
510 extratables="content_x_topic cxt"/>
512 <Batch key="articles" infokey="batch" table="content c"
513 process="pages" batchsize="20" minbatchsize="10"
514 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}"
515 order="webdb_create asc" extratables="content_x_topic cxt">
518 <Define key="pagePrefix" value="${pathprefix}/${topic.filename}/archive"/>
519 <Define key="storagePrefix" value="${config["Producer.StorageRoot"]}/${pagePrefix}"/>
520 <Define key="docPrefix" value="${config["Producer.DocRoot"]}/${pagePrefix}"/>
521 <Log message="topic now = ${topic.title}" />
524 generator="topicpage.template"
525 destination="${storagePrefix}${batch.current.identifier}${storageSuffix}"/>
531 <Define key="pagePrefix" value="${pathprefix}/${topic.filename}/archive"/>
532 <Define key="storagePrefix" value="${config["Producer.StorageRoot"]}/${pagePrefix}"/>
533 <Define key="docPrefix" value="${config["Producer.DocRoot"]}/${pagePrefix}"/>
535 generator="batchnav.template"
536 destination="${storagePrefix}nav${storageSuffix}"/>
545 <producer name="opnewswireinclude">
547 <verb name="generate" default="1" description="Generates the op newswire"/>
550 <Set key="whichnewswire" value="Open Publishing News" />
551 <List key="newswire" table="content" limit="50"
552 selection="is_published=true and to_article_type=${articletype.newswire}"
553 order="webdb_create desc"/>
556 generator="/newswireinclude.template"
557 destination="${config.storageRoot}/${pathprefix}/newswireinclude.html"/>
564 <producer name="rssnewswireinclude">
566 <verb name="generate" default="1" description="Generates the rss newswire"/>
569 <Set key="whichnewswire" value="RSS Publishing News" />
570 <List key="newswire" table="content" limit="20"
571 selection="is_published=true and to_article_type=${articletype.communityrssarticle}"
572 order="webdb_create desc"/>
575 generator="/newswireinclude.template"
576 destination="${config.storageRoot}/${pathprefix}/rssnewswireinclude.html"/>
585 <producer name="startpage">
587 <verb name="generate" default="1" description="Generates the startpage"/>
592 <List key="startspecial" table="content" limit="1"
593 selection="is_published=true and to_article_type=${articletype.startspecial}"
594 order="webdb_create desc"/>
596 <Enumerate key="ssimage" table="image" selection="to_media_folder=9 and is_published=true" >
597 <Define key="ssimagepath" value="${ssimage.publish_server}/${ssimage.publish_path}" />
598 <Define key="sstitle" value="${ssimage.title}" />
602 <List key="features" table="content" limit="5"
603 selection="is_published=true and to_article_type in (${articletype.feature},${articletype.promotedcommunityarticle},${articletype.promotednewswire})"
604 order="webdb_create desc"/>
606 <List key="communityrssarticles" table="content" limit="10"
607 selection="is_published=true and to_article_type in (${articletype.communityrssarticle},${articletype.promotedcommunityarticle})"
608 order="webdb_create desc"/>
610 <List key="newswire" table="content" limit="20"
611 selection="is_published=true and to_article_type=${articletype.newswire}"
612 order="webdb_create desc"/>
614 <List key="mostcomments"
616 extratables="comment cm"
617 selection="c.webdb_create > NOW()-'1 week'::interval and c.is_published=true and cm.is_published=true and c.id=cm.to_media group by c.id,c.title,
618 c.subtitle,c.edittitle,c.date,c.creator,c.creator_main_url,c.creator_email,c.creator_address,c.creator_phone,c.description,
619 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,
620 c.content_data,c.is_html,c.to_article_type,c.to_content,c.keywords,c.to_locking_user"
621 order="count(cm.id) desc, c.webdb_create desc "
626 <List key="breakingnews" table="breakingNews" limit="10"
627 order="webdb_create desc"/>
631 generator="/startpage.template"
632 destination="${config.storageRoot}/${pathprefix}/index.html"/>
637 <producer name="synchronization">
639 <verb name="run" default="1" description="Synchronizes the publication site with the production site"/>
643 <If condition="config['Rsync'] in ('1', 'y', 'yes', 'Y')">
645 <Execute command="${config['Rsync.Script.Path']}"/>
652 <producer name="media">
654 <verb name="new" default="1">
655 <Define key="verbcondition" value="(not is_produced)"/>
656 <Set key="limit" value="10"/>
659 <Define key="verbcondition" value=""/>
660 <Set key="limit" value="-1"/>
664 <Define key="verbcondition" value=""/>
665 <Set key="limit" value="10"/>
670 key="media" table="image"
671 selection="${verbcondition}"
673 order="webdb_create desc">
675 <GenerateMedia key="media" />
678 key="media" table="video"
679 selection="${verbcondition}"
681 order="webdb_create desc">
683 <GenerateMedia key="media" />
686 key="media" table="audio"
687 selection="${verbcondition}"
689 order="webdb_create desc">
691 <GenerateMedia key="media" />
694 key="media" table="otherMedia"
695 selection="${verbcondition}"
697 order="webdb_create desc">
699 <GenerateMedia key="media" />
704 <producer name="syndication">
706 <verb name="generate" />
709 <!-- the main features and newswire -->
712 <!-- the topic features and newswires -->
713 <Enumerate key="topic" table="topic">
715 basefilename="${topic.filename}"
716 selection="id=cxt.content_id and cxt.topic_id = ${topic.id}"
717 extratables="content_x_topic as cxt"
727 <producer name="radicalendar">
732 <!-- groupname you will see as the value of "group" in the url for your radicalendar page, -->
733 <!-- gmtoffset is in minutes -->
734 <Radicalendar key="calendar" groupname="_imc" gmtoffset="60" />
736 generator="/radicalendar.template"
737 destination="${config.storageRoot}/calendarinclude.html"/>
744 <producer name="update">
746 <verb name="templates" description="updates templates and bundles">
747 <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/"/>
752 <Execute command="${command}"/>
760 <producer name="generatefpincludes">
766 <Set key="counter" value="1"/>
767 <Enumerate key="fpimage" table="image" selection="to_media_folder=8 and is_published=true" >
768 <Log message="generating include for image id: ${fpimage.id}" type="info" />
771 generator="/fpinclude.template"
772 destination="${config.storageRoot}/fpincludes/${fpimage.id}.inc" />
773 <Set key="counter" value="counter+1" />
777 <List key="fpincludes" table="image" selection="to_media_folder=8 and is_published=true" />
779 generator="/fpmapping.template"
780 destination="${config.storageRoot}/fpincludes/map.txt" />
788 <!-- generates a count for each topic -->
790 <!-- TODO: add date limit when we actually are going live with this -->
791 <producer name="generateTopicCounts">
796 <FreeQuery key="topicCounts" query=" SELECT count(x.content_id) as count, t.title, t.filename FROM topic as t LEFT OUTER JOIN content_x_topic
797 as x ON (t.id=x.topic_id) LEFT OUTER JOIN content as c ON (c.id=x.content_id)
798 WHERE c.webdb_create > NOW()-'1 day'::interval AND t.archiv_url = 'Category' GROUP BY t.title , t.filename ORDER BY t.title"
801 <Generate generator="/topiccount.template"
802 destination="${config.storageRoot}/${pathprefix}/topiccount.html" />
809 <producer name="generateRandomTopics">
814 <Set key="counter" value="1"/>
816 <Enumerate key="category" table="topic t" extratables="topic t2"
817 selection="t.id=t2.id AND t.archiv_url = 'Subcategory' AND (SELECT count(*) from content_x_topic where topic_id = t.id) > 0" order="RANDOM()" limit="10">
819 <Log message="Getting Last 5 articles for category: ${category.title} - counter: ${counter}" />
820 <Define key="topictitle" value="${category.title}" />
821 <Define key="topicfile" value="${category.filename}" />
823 <List key="randomarticles" table="content"
824 selection ="id in (select content_id from content_x_topic where topic_id = ${category.id}) AND is_published=true" order="date DESC"
828 generator="/randomcategory.template"
829 destination="${config.storageRoot}/${pathprefix}/randomcats/random${counter}.html" />
832 <Set key="counter" value="counter+1" />
837 <producer name="getlocalblogs">
842 <Enumerate key="article" table="content" selection="to_article_type in(${articletype.communityrssfeed}) and is_published=true" order="webdb_create desc">
843 <Log message="Pulling 1.0 feed from ${article.title} at ${article.source}" type="info" />
845 url="${article.source}"
846 articletype="${articletype.communityrssarticle}"
847 blogurl="${article.creator_main_url}"
848 blogname="${article.title}"
854 <producer name="footer">
856 <verb name="generate" default="1" description="generates the default footer"/>
861 generator="/footer.template"
862 destination="${config.storageRoot}/${pathprefix}/footer.html"/>
868 <producer name="headArticle">
870 <verb name="generate" default="1" description="generates the article html head"/>
875 generator="/head.article.template"
876 destination="${config.storageRoot}/${pathprefix}/head.article.html"/>