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="verbcondition" 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'">
281 <Log message="I am generating: ${article.id}"/>
283 generator="/article.template"
284 destination="${config.storageRoot}/${pathprefix}/${article.date.formatted.yyyy}/${article.date.formatted.MM}/${article.id}.html"/>
287 generator="/languagebar.template"
288 destination="${config.storageRoot}/languagebar/${article.to_original.date.formatted.yyyy}/${article.to_original.date.formatted.MM}/${article.to_original.id}.html"/>
289 <IndexContent key="article" pathToIndex="${config['IndexPath']}"/>
292 <UnIndexContent key="article" pathToIndex="${config['IndexPath']}"/>
295 <MarkContent key="article"/>
300 <producer name="staticpages">
302 <verb name="changed" default="1">
303 <Define key="verbcondition" value="(not is_produced) and to_article_type = ${articletype.static}"/>
304 <Set key="limit" value="10"/>
307 <Define key="verbcondition" value="to_article_type = ${articletype.static}"/>
308 <Set key="limit" value="-1"/>
313 <Enumerate key="article" table="content" selection="${verbcondition}"
314 limit="limit" order="webdb_create desc">
316 key="media" table="image"
317 selection="exists (select * from content_x_media where media_id=images.id and content_id=${article.id})"
320 <GenerateMedia key="media" />
323 key="media" table="video"
324 selection="exists (select * from content_x_media where media_id=video.id and content_id=${article.id})"
327 <GenerateMedia key="media" />
330 key="media" table="audio"
331 selection="exists (select * from content_x_media where media_id=audio.id and content_id=${article.id})"
334 <GenerateMedia key="media" />
337 key="media" table="otherMedia"
338 selection="exists (select * from content_x_media where media_id=other_media.id and content_id=${article.id})"
342 <GenerateMedia key="media" />
344 <List key="topics" table="topic t" extratables="content_x_topic ctx"
345 selection="ctx.content_id = ${article.id} AND ctx.topic_id = t.id" />
347 <If condition="article.is_published == '1'">
351 generator="/staticpage.template"
352 destination="${config.storageRoot}/${pathprefix}/static/${article.edittitle}.html"/>
356 generator="/languagebar.template"
357 destination="${config.storageRoot}/languagebar/${article.to_original.date.formatted.yyyy}/${article.to_original.date.formatted.MM}/${article.to_original.id}.html"/>
358 <IndexContent key="article" pathToIndex="${config['IndexPath']}"/>
361 <UnIndexContent key="article" pathToIndex="${config['IndexPath']}"/>
364 <MarkContent key="article"/>
369 <producer name="navigation">
371 <verb name="generate" default="1" description="generates the left column"/>
376 generator="/navigation.template"
377 destination="${config.storageRoot}/${pathprefix}/navigation.html"/>
382 <producer name="staticimages">
384 <verb name="generate" default="1" description="copies all the static image files into place"/>
387 <CopyDir destination="img" source="etc/producer/images"/>
392 <producer name="staticfiles">
394 <verb name="generate" default="1" description="copies all the static image files into place"/>
397 <CopyDir destination="js" source="etc/producer/js"/>
401 <producer name="newswirearchive">
404 <Set key="pages" value="3"/>
407 <Set key="pages" value="-1"/>
411 <Define key="docSuffix" value=".html"/>
412 <Define key="storageSuffix" value=".html"/>
414 <Batch key="articles" infokey="batch" table="content"
415 process="pages" batchsize="20" minbatchsize="10"
416 selection="is_published='1' and to_article_type = ${articletype.newswire}"
417 order="webdb_create asc">
420 <Define key="pagePrefix" value="${pathprefix}/newswire/archive"/>
421 <Define key="storagePrefix" value="${config["Producer.StorageRoot"]}/${pagePrefix}"/>
422 <Define key="docPrefix" value="${config["Producer.DocRoot"]}/${pagePrefix}"/>
425 generator="newswirearchive.template"
426 destination="${storagePrefix}${batch.current.identifier}${storageSuffix}"/>
432 <Define key="pagePrefix" value="${pathprefix}/newswire/archive"/>
433 <Define key="storagePrefix" value="${config["Producer.StorageRoot"]}/${pagePrefix}"/>
434 <Define key="docPrefix" value="${config["Producer.DocRoot"]}/${pagePrefix}"/>
436 generator="batchnav.template"
437 destination="${storagePrefix}nav${storageSuffix}"/>
444 <producer name="featurearchive">
447 <Set key="pages" value="3"/>
450 <Set key="pages" value="-1"/>
454 <Define key="docSuffix" value=".html"/>
455 <Define key="storageSuffix" value=".html"/>
457 <Batch key="articles" infokey="batch" table="content"
458 process="pages" batchsize="20" minbatchsize="10"
459 selection="is_published='1' and to_article_type in (${articletype.feature}, ${articletype.startspecial})"
460 order="webdb_create asc">
463 <Define key="pagePrefix" value="${pathprefix}/feature/archive"/>
464 <Define key="storagePrefix" value="${config["Producer.StorageRoot"]}/${pagePrefix}"/>
465 <Define key="docPrefix" value="${config["Producer.DocRoot"]}/${pagePrefix}"/>
468 generator="featurearchive.template"
469 destination="${storagePrefix}${batch.current.identifier}${storageSuffix}"/>
475 <Define key="pagePrefix" value="${pathprefix}/feature/archive"/>
476 <Define key="storagePrefix" value="${config["Producer.StorageRoot"]}/${pagePrefix}"/>
477 <Define key="docPrefix" value="${config["Producer.DocRoot"]}/${pagePrefix}"/>
479 generator="batchnav.template"
480 destination="${storagePrefix}nav${storageSuffix}"/>
487 <producer name="topicpages">
490 <Set key="_topics" value="-1"/>
491 <Set key="pages" value="3"/>
494 <Set key="_topics" value="-1"/>
495 <Set key="pages" value="-1"/>
498 <Set key="_topics" value="2"/>
499 <Set key="pages" value="4"/>
503 <Enumerate key="topic" table="topic">
504 <Define key="docSuffix" value=".html"/>
505 <Define key="storageSuffix" value=".html"/>
507 <Log message="topic = ${topic.title}" />
508 <List key="special" table="content c"
509 selection="c.is_published='1' and c.to_article_type = ${articletype.topicspecial} and c.id=cxt.content_id and cxt.topic_id = ${topic.id}"
510 order = "webdb_create desc" limit="1"
511 extratables="content_x_topic cxt"/>
513 <Batch key="articles" infokey="batch" table="content c"
514 process="pages" batchsize="20" minbatchsize="10"
515 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}"
516 order="webdb_create asc" extratables="content_x_topic cxt">
519 <Define key="pagePrefix" value="${pathprefix}/${topic.filename}/archive"/>
520 <Define key="storagePrefix" value="${config["Producer.StorageRoot"]}/${pagePrefix}"/>
521 <Define key="docPrefix" value="${config["Producer.DocRoot"]}/${pagePrefix}"/>
522 <Log message="topic now = ${topic.title}" />
525 generator="topicpage.template"
526 destination="${storagePrefix}${batch.current.identifier}${storageSuffix}"/>
532 <Define key="pagePrefix" value="${pathprefix}/${topic.filename}/archive"/>
533 <Define key="storagePrefix" value="${config["Producer.StorageRoot"]}/${pagePrefix}"/>
534 <Define key="docPrefix" value="${config["Producer.DocRoot"]}/${pagePrefix}"/>
536 generator="batchnav.template"
537 destination="${storagePrefix}nav${storageSuffix}"/>
546 <producer name="opnewswireinclude">
548 <verb name="generate" default="1" description="Generates the op newswire"/>
551 <Set key="whichnewswire" value="Open Publishing News" />
552 <List key="newswire" table="content" limit="50"
553 selection="is_published=true and to_article_type=${articletype.newswire}"
554 order="webdb_create desc"/>
557 generator="/newswireinclude.template"
558 destination="${config.storageRoot}/${pathprefix}/newswireinclude.html"/>
565 <producer name="rssnewswireinclude">
567 <verb name="generate" default="1" description="Generates the rss newswire"/>
570 <Set key="whichnewswire" value="RSS Publishing News" />
571 <List key="newswire" table="content" limit="20"
572 selection="is_published=true and to_article_type=${articletype.communityrssarticle}"
573 order="webdb_create desc"/>
576 generator="/newswireinclude.template"
577 destination="${config.storageRoot}/${pathprefix}/rssnewswireinclude.html"/>
586 <producer name="startpage">
588 <verb name="generate" default="1" description="Generates the startpage"/>
593 <List key="startspecial" table="content" limit="1"
594 selection="is_published=true and to_article_type=${articletype.startspecial}"
595 order="webdb_create desc"/>
597 <Enumerate key="ssimage" table="image" selection="to_media_folder=9 and is_published=true" >
598 <Define key="ssimagepath" value="${ssimage.publish_server}/${ssimage.publish_path}" />
599 <Define key="sstitle" value="${ssimage.title}" />
603 <List key="features" table="content" limit="5"
604 selection="is_published=true and to_article_type in (${articletype.feature},${articletype.promotedcommunityarticle},${articletype.promotednewswire})"
605 order="webdb_create desc"/>
607 <List key="communityrssarticles" table="content" limit="10"
608 selection="is_published=true and to_article_type in (${articletype.communityrssarticle},${articletype.promotedcommunityarticle})"
609 order="webdb_create desc"/>
611 <List key="newswire" table="content" limit="20"
612 selection="is_published=true and to_article_type=${articletype.newswire}"
613 order="webdb_create desc"/>
615 <List key="mostcomments"
617 extratables="comment cm"
618 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,
619 c.subtitle,c.edittitle,c.date,c.creator,c.creator_main_url,c.creator_email,c.creator_address,c.creator_phone,c.description,
620 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,
621 c.content_data,c.is_html,c.to_article_type,c.to_content,c.keywords,c.to_locking_user"
622 order="count(cm.id) desc, c.webdb_create desc "
627 <List key="breakingnews" table="breakingNews" limit="10"
628 order="webdb_create desc"/>
632 generator="/startpage.template"
633 destination="${config.storageRoot}/${pathprefix}/index.html"/>
638 <producer name="synchronization">
640 <verb name="run" default="1" description="Synchronizes the publication site with the production site"/>
644 <If condition="config['Rsync'] in ('1', 'y', 'yes', 'Y')">
646 <Execute command="${config['Rsync.Script.Path']}"/>
653 <producer name="media">
655 <verb name="new" default="1">
656 <Define key="verbcondition" value="(not is_produced)"/>
657 <Set key="limit" value="10"/>
660 <Define key="verbcondition" value=""/>
661 <Set key="limit" value="-1"/>
665 <Define key="verbcondition" value=""/>
666 <Set key="limit" value="10"/>
671 key="media" table="image"
672 selection="${verbcondition}"
674 order="webdb_create desc">
676 <GenerateMedia key="media" />
679 key="media" table="video"
680 selection="${verbcondition}"
682 order="webdb_create desc">
684 <GenerateMedia key="media" />
687 key="media" table="audio"
688 selection="${verbcondition}"
690 order="webdb_create desc">
692 <GenerateMedia key="media" />
695 key="media" table="otherMedia"
696 selection="${verbcondition}"
698 order="webdb_create desc">
700 <GenerateMedia key="media" />
705 <producer name="syndication">
707 <verb name="generate" />
710 <!-- the main features and newswire -->
713 <!-- the topic features and newswires -->
714 <Enumerate key="topic" table="topic">
716 basefilename="${topic.filename}"
717 selection="id=cxt.content_id and cxt.topic_id = ${topic.id}"
718 extratables="content_x_topic as cxt"
728 <producer name="radicalendar">
733 <!-- groupname you will see as the value of "group" in the url for your radicalendar page, -->
734 <!-- gmtoffset is in minutes -->
735 <Radicalendar key="calendar" groupname="_imc" gmtoffset="60" />
737 generator="/radicalendar.template"
738 destination="${config.storageRoot}/calendarinclude.html"/>
745 <producer name="update">
747 <verb name="templates" description="updates templates and bundles">
748 <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/"/>
753 <Execute command="${command}"/>
761 <producer name="generatefpincludes">
767 <Set key="counter" value="1"/>
768 <Enumerate key="fpimage" table="image" selection="to_media_folder=8 and is_published=true" >
769 <Log message="generating include for image id: ${fpimage.id}" type="info" />
772 generator="/fpinclude.template"
773 destination="${config.storageRoot}/fpincludes/${fpimage.id}.inc" />
774 <Set key="counter" value="counter+1" />
778 <List key="fpincludes" table="image" selection="to_media_folder=8 and is_published=true" />
780 generator="/fpmapping.template"
781 destination="${config.storageRoot}/fpincludes/map.txt" />
789 <!-- generates a count for each topic -->
791 <!-- TODO: add date limit when we actually are going live with this -->
792 <producer name="generateTopicCounts">
797 <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
798 as x ON (t.id=x.topic_id) LEFT OUTER JOIN content as c ON (c.id=x.content_id)
799 WHERE c.webdb_create > NOW()-'1 day'::interval AND t.archiv_url = 'Category' GROUP BY t.title , t.filename ORDER BY t.title"
802 <Generate generator="/topiccount.template"
803 destination="${config.storageRoot}/${pathprefix}/topiccount.html" />
810 <producer name="generateRandomTopics">
815 <Set key="counter" value="1"/>
817 <Enumerate key="category" table="topic t" extratables="topic t2"
818 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">
820 <Log message="Getting Last 5 articles for category: ${category.title} - counter: ${counter}" />
821 <Define key="topictitle" value="${category.title}" />
822 <Define key="topicfile" value="${category.filename}" />
824 <List key="randomarticles" table="content"
825 selection ="id in (select content_id from content_x_topic where topic_id = ${category.id}) AND is_published=true" order="date DESC"
829 generator="/randomcategory.template"
830 destination="${config.storageRoot}/${pathprefix}/randomcats/random${counter}.html" />
833 <Set key="counter" value="counter+1" />
838 <producer name="getlocalblogs">
843 <Enumerate key="article" table="content" selection="to_article_type in(${articletype.communityrssfeed}) and is_published=true" order="webdb_create desc">
844 <Log message="Pulling 1.0 feed from ${article.title} at ${article.source}" type="info" />
846 url="${article.source}"
847 articletype="${articletype.communityrssarticle}"
848 blogurl="${article.creator_main_url}"
849 blogname="${article.title}"
855 <producer name="footer">
857 <verb name="generate" default="1" description="generates the default footer"/>
862 generator="/footer.template"
863 destination="${config.storageRoot}/${pathprefix}/footer.html"/>
869 <producer name="headArticle">
871 <verb name="generate" default="1" description="generates the article html head"/>
876 generator="/head.article.template"
877 destination="${config.storageRoot}/${pathprefix}/head.article.html"/>