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"/>
227 <Enumerate key="article" table="content" selection="${verbcondition}"
228 limit="limit" order="webdb_create desc">
230 key="media" table="image"
231 selection="exists (select * from content_x_media where media_id=images.id and content_id=${article.id})
232 or exists (select * from comment_x_media, comment
233 where comment_id = comment.id and media_id=images.id and comment.to_media=${article.id})"
236 <GenerateMedia key="media" />
239 key="media" table="video"
240 selection="exists (select * from content_x_media where media_id=video.id and content_id=${article.id})
241 or exists (select * from comment_x_media, comment
242 where comment_id = comment.id and media_id=video.id and comment.to_media=${article.id})"
244 <GenerateMedia key="media" />
247 key="media" table="audio"
248 selection="exists (select * from content_x_media where media_id=audio.id and content_id=${article.id})
249 or exists (select * from comment_x_media, comment
250 where comment_id = comment.id and media_id=audio.id and comment.to_media=${article.id})"
253 <GenerateMedia key="media" />
258 key="media" table="otherMedia"
259 selection="exists (select * from content_x_media where media_id=other_media.id and content_id=${article.id})
260 or exists (select * from comment_x_media, comment
261 where comment_id = comment.id and media_id=other_media.id and comment.to_media=${article.id})"
264 <GenerateMedia key="media" />
268 <List key="topics" table="topic t" extratables="content_x_topic ctx"
269 selection="ctx.content_id = ${article.id} AND ctx.topic_id = t.id" />
270 <If condition="utility.listSize(topics) > 0">
272 <Log message="I have a topic list with ${utility.listSize(topics)}" />
275 <If condition="article.is_published == '1'">
279 generator="/article.template"
280 destination="${config.storageRoot}/${pathprefix}/${article.date.formatted.yyyy}/${article.date.formatted.MM}/${article.id}.html"/>
283 generator="/languagebar.template"
284 destination="${config.storageRoot}/languagebar/${article.to_original.date.formatted.yyyy}/${article.to_original.date.formatted.MM}/${article.to_original.id}.html"/>
285 <IndexContent key="article" pathToIndex="${config['IndexPath']}"/>
288 <UnIndexContent key="article" pathToIndex="${config['IndexPath']}"/>
291 <MarkContent key="article"/>
296 <producer name="staticpages">
298 <verb name="changed" default="1">
299 <Define key="verbcondition" value="(not is_produced) and to_article_type = ${articletype.static}"/>
300 <Set key="limit" value="10"/>
303 <Define key="verbcondition" value="to_article_type = ${articletype.static}"/>
304 <Set key="limit" value="-1"/>
309 <Enumerate key="article" table="content" selection="${verbcondition}"
310 limit="limit" order="webdb_create desc">
312 key="media" table="image"
313 selection="exists (select * from content_x_media where media_id=images.id and content_id=${article.id})"
316 <GenerateMedia key="media" />
319 key="media" table="video"
320 selection="exists (select * from content_x_media where media_id=video.id and content_id=${article.id})"
323 <GenerateMedia key="media" />
326 key="media" table="audio"
327 selection="exists (select * from content_x_media where media_id=audio.id and content_id=${article.id})"
330 <GenerateMedia key="media" />
333 key="media" table="otherMedia"
334 selection="exists (select * from content_x_media where media_id=other_media.id and content_id=${article.id})"
338 <GenerateMedia key="media" />
340 <List key="topics" table="topic t" extratables="content_x_topic ctx"
341 selection="ctx.content_id = ${article.id} AND ctx.topic_id = t.id" />
343 <If condition="article.is_published == '1'">
347 generator="/staticpage.template"
348 destination="${config.storageRoot}/${pathprefix}/static/${article.edittitle}.html"/>
352 generator="/languagebar.template"
353 destination="${config.storageRoot}/languagebar/${article.to_original.date.formatted.yyyy}/${article.to_original.date.formatted.MM}/${article.to_original.id}.html"/>
354 <IndexContent key="article" pathToIndex="${config['IndexPath']}"/>
357 <UnIndexContent key="article" pathToIndex="${config['IndexPath']}"/>
360 <MarkContent key="article"/>
365 <producer name="navigation">
367 <verb name="generate" default="1" description="generates the left column"/>
372 generator="/navigation.template"
373 destination="${config.storageRoot}/${pathprefix}/navigation.html"/>
378 <producer name="staticimages">
380 <verb name="generate" default="1" description="copies all the static image files into place"/>
383 <CopyDir destination="img" source="etc/producer/images"/>
388 <producer name="staticfiles">
390 <verb name="generate" default="1" description="copies all the static image files into place"/>
393 <CopyDir destination="js" source="etc/producer/js"/>
397 <producer name="newswirearchive">
400 <Set key="pages" value="3"/>
403 <Set key="pages" value="-1"/>
407 <Define key="docSuffix" value=".html"/>
408 <Define key="storageSuffix" value=".html"/>
410 <Batch key="articles" infokey="batch" table="content"
411 process="pages" batchsize="20" minbatchsize="10"
412 selection="is_published='1' and to_article_type = ${articletype.newswire}"
413 order="webdb_create asc">
416 <Define key="pagePrefix" value="${pathprefix}/newswire/archive"/>
417 <Define key="storagePrefix" value="${config["Producer.StorageRoot"]}/${pagePrefix}"/>
418 <Define key="docPrefix" value="${config["Producer.DocRoot"]}/${pagePrefix}"/>
421 generator="newswirearchive.template"
422 destination="${storagePrefix}${batch.current.identifier}${storageSuffix}"/>
428 <Define key="pagePrefix" value="${pathprefix}/newswire/archive"/>
429 <Define key="storagePrefix" value="${config["Producer.StorageRoot"]}/${pagePrefix}"/>
430 <Define key="docPrefix" value="${config["Producer.DocRoot"]}/${pagePrefix}"/>
432 generator="batchnav.template"
433 destination="${storagePrefix}nav${storageSuffix}"/>
440 <producer name="featurearchive">
443 <Set key="pages" value="3"/>
446 <Set key="pages" value="-1"/>
450 <Define key="docSuffix" value=".html"/>
451 <Define key="storageSuffix" value=".html"/>
453 <Batch key="articles" infokey="batch" table="content"
454 process="pages" batchsize="20" minbatchsize="10"
455 selection="is_published='1' and to_article_type in (${articletype.feature}, ${articletype.startspecial})"
456 order="webdb_create asc">
459 <Define key="pagePrefix" value="${pathprefix}/feature/archive"/>
460 <Define key="storagePrefix" value="${config["Producer.StorageRoot"]}/${pagePrefix}"/>
461 <Define key="docPrefix" value="${config["Producer.DocRoot"]}/${pagePrefix}"/>
464 generator="featurearchive.template"
465 destination="${storagePrefix}${batch.current.identifier}${storageSuffix}"/>
471 <Define key="pagePrefix" value="${pathprefix}/feature/archive"/>
472 <Define key="storagePrefix" value="${config["Producer.StorageRoot"]}/${pagePrefix}"/>
473 <Define key="docPrefix" value="${config["Producer.DocRoot"]}/${pagePrefix}"/>
475 generator="batchnav.template"
476 destination="${storagePrefix}nav${storageSuffix}"/>
483 <producer name="topicpages">
486 <Set key="_topics" value="-1"/>
487 <Set key="pages" value="3"/>
490 <Set key="_topics" value="-1"/>
491 <Set key="pages" value="-1"/>
494 <Set key="_topics" value="2"/>
495 <Set key="pages" value="4"/>
499 <Enumerate key="topic" table="topic">
500 <Define key="docSuffix" value=".html"/>
501 <Define key="storageSuffix" value=".html"/>
503 <Log message="topic = ${topic.title}" />
504 <List key="special" table="content c"
505 selection="c.is_published='1' and c.to_article_type = ${articletype.topicspecial} and c.id=cxt.content_id and cxt.topic_id = ${topic.id}"
506 order = "webdb_create desc" limit="1"
507 extratables="content_x_topic cxt"/>
509 <Batch key="articles" infokey="batch" table="content c"
510 process="pages" batchsize="20" minbatchsize="10"
511 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}"
512 order="webdb_create asc" extratables="content_x_topic cxt">
515 <Define key="pagePrefix" value="${pathprefix}/${topic.filename}/archive"/>
516 <Define key="storagePrefix" value="${config["Producer.StorageRoot"]}/${pagePrefix}"/>
517 <Define key="docPrefix" value="${config["Producer.DocRoot"]}/${pagePrefix}"/>
518 <Log message="topic now = ${topic.title}" />
521 generator="topicpage.template"
522 destination="${storagePrefix}${batch.current.identifier}${storageSuffix}"/>
528 <Define key="pagePrefix" value="${pathprefix}/${topic.filename}/archive"/>
529 <Define key="storagePrefix" value="${config["Producer.StorageRoot"]}/${pagePrefix}"/>
530 <Define key="docPrefix" value="${config["Producer.DocRoot"]}/${pagePrefix}"/>
532 generator="batchnav.template"
533 destination="${storagePrefix}nav${storageSuffix}"/>
542 <producer name="opnewswireinclude">
544 <verb name="generate" default="1" description="Generates the op newswire"/>
547 <Set key="whichnewswire" value="Open Publishing News" />
548 <List key="newswire" table="content" limit="50"
549 selection="is_published=true and to_article_type=${articletype.newswire}"
550 order="webdb_create desc"/>
553 generator="/newswireinclude.template"
554 destination="${config.storageRoot}/${pathprefix}/newswireinclude.html"/>
561 <producer name="rssnewswireinclude">
563 <verb name="generate" default="1" description="Generates the rss newswire"/>
566 <Set key="whichnewswire" value="RSS Publishing News" />
567 <List key="newswire" table="content" limit="20"
568 selection="is_published=true and to_article_type=${articletype.communityrssarticle}"
569 order="webdb_create desc"/>
572 generator="/newswireinclude.template"
573 destination="${config.storageRoot}/${pathprefix}/rssnewswireinclude.html"/>
582 <producer name="startpage">
584 <verb name="generate" default="1" description="Generates the startpage"/>
589 <List key="startspecial" table="content" limit="1"
590 selection="is_published=true and to_article_type=${articletype.startspecial}"
591 order="webdb_create desc"/>
593 <Enumerate key="ssimage" table="image" selection="to_media_folder=9 and is_published=true" >
594 <Define key="ssimagepath" value="${ssimage.publish_server}/${ssimage.publish_path}" />
595 <Define key="sstitle" value="${ssimage.title}" />
599 <List key="features" table="content" limit="5"
600 selection="is_published=true and to_article_type in (${articletype.feature},${articletype.promotedcommunityarticle},${articletype.promotednewswire})"
601 order="webdb_create desc"/>
603 <List key="communityrssarticles" table="content" limit="10"
604 selection="is_published=true and to_article_type in (${articletype.communityrssarticle},${articletype.promotedcommunityarticle})"
605 order="webdb_create desc"/>
607 <List key="newswire" table="content" limit="20"
608 selection="is_published=true and to_article_type=${articletype.newswire}"
609 order="webdb_create desc"/>
611 <List key="mostcomments"
613 extratables="comment cm"
614 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,
615 c.subtitle,c.edittitle,c.date,c.creator,c.creator_main_url,c.creator_email,c.creator_address,c.creator_phone,c.description,
616 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,
617 c.content_data,c.is_html,c.to_article_type,c.to_content,c.keywords,c.to_locking_user"
618 order="count(cm.id) desc, c.webdb_create desc "
623 <List key="breakingnews" table="breakingNews" limit="10"
624 order="webdb_create desc"/>
628 generator="/startpage.template"
629 destination="${config.storageRoot}/${pathprefix}/index.html"/>
634 <producer name="synchronization">
636 <verb name="run" default="1" description="Synchronizes the publication site with the production site"/>
640 <If condition="config['Rsync'] in ('1', 'y', 'yes', 'Y')">
642 <Execute command="${config['Rsync.Script.Path']}"/>
649 <producer name="media">
651 <verb name="new" default="1">
652 <Define key="verbcondition" value="(not is_produced)"/>
653 <Set key="limit" value="10"/>
656 <Define key="verbcondition" value=""/>
657 <Set key="limit" value="-1"/>
661 <Define key="verbcondition" value=""/>
662 <Set key="limit" value="10"/>
667 key="media" table="image"
668 selection="${verbcondition}"
670 order="webdb_create desc">
672 <GenerateMedia key="media" />
675 key="media" table="video"
676 selection="${verbcondition}"
678 order="webdb_create desc">
680 <GenerateMedia key="media" />
683 key="media" table="audio"
684 selection="${verbcondition}"
686 order="webdb_create desc">
688 <GenerateMedia key="media" />
691 key="media" table="otherMedia"
692 selection="${verbcondition}"
694 order="webdb_create desc">
696 <GenerateMedia key="media" />
701 <producer name="syndication">
703 <verb name="generate" />
706 <!-- the main features and newswire -->
709 <!-- the topic features and newswires -->
710 <Enumerate key="topic" table="topic">
712 basefilename="${topic.filename}"
713 selection="id=cxt.content_id and cxt.topic_id = ${topic.id}"
714 extratables="content_x_topic as cxt"
724 <producer name="radicalendar">
729 <!-- groupname you will see as the value of "group" in the url for your radicalendar page, -->
730 <!-- gmtoffset is in minutes -->
731 <Radicalendar key="calendar" groupname="_imc" gmtoffset="60" />
733 generator="/radicalendar.template"
734 destination="${config.storageRoot}/calendarinclude.html"/>
741 <producer name="update">
743 <verb name="templates" description="updates templates and bundles">
744 <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/"/>
749 <Execute command="${command}"/>
757 <producer name="generatefpincludes">
763 <Set key="counter" value="1"/>
764 <Enumerate key="fpimage" table="image" selection="to_media_folder=8 and is_published=true" >
765 <Log message="generating include for image id: ${fpimage.id}" type="info" />
768 generator="/fpinclude.template"
769 destination="${config.storageRoot}/fpincludes/${fpimage.id}.inc" />
770 <Set key="counter" value="counter+1" />
774 <List key="fpincludes" table="image" selection="to_media_folder=8 and is_published=true" />
776 generator="/fpmapping.template"
777 destination="${config.storageRoot}/fpincludes/map.txt" />
785 <!-- generates a count for each topic -->
787 <!-- TODO: add date limit when we actually are going live with this -->
788 <producer name="generateTopicCounts">
793 <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
794 as x ON (t.id=x.topic_id) LEFT OUTER JOIN content as c ON (c.id=x.content_id)
795 WHERE c.webdb_create > NOW()-'1 day'::interval AND t.archiv_url = 'Category' GROUP BY t.title , t.filename ORDER BY t.title"
798 <Generate generator="/topiccount.template"
799 destination="${config.storageRoot}/${pathprefix}/topiccount.html" />
806 <producer name="generateRandomTopics">
811 <Set key="counter" value="1"/>
813 <Enumerate key="category" table="topic t" extratables="topic t2"
814 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">
816 <Log message="Getting Last 5 articles for category: ${category.title} - counter: ${counter}" />
817 <Define key="topictitle" value="${category.title}" />
818 <Define key="topicfile" value="${category.filename}" />
820 <List key="randomarticles" table="content"
821 selection ="id in (select content_id from content_x_topic where topic_id = ${category.id}) AND is_published=true" order="date DESC"
825 generator="/randomcategory.template"
826 destination="${config.storageRoot}/${pathprefix}/randomcats/random${counter}.html" />
829 <Set key="counter" value="counter+1" />
834 <producer name="getlocalblogs">
839 <Enumerate key="article" table="content" selection="to_article_type in(${articletype.communityrssfeed}) and is_published=true" order="webdb_create desc">
840 <Log message="Pulling 1.0 feed from ${article.title} at ${article.source}" type="info" />
842 url="${article.source}"
843 articletype="${articletype.communityrssarticle}"
844 blogurl="${article.creator_main_url}"
845 blogname="${article.title}"
851 <producer name="footer">
853 <verb name="generate" default="1" description="generates the default footer"/>
858 generator="/footer.template"
859 destination="${config.storageRoot}/${pathprefix}/footer.html"/>
865 <producer name="headArticle">
867 <verb name="generate" default="1" description="generates the article html head"/>
872 generator="/head.article.template"
873 destination="${config.storageRoot}/${pathprefix}/head.article.html"/>