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 c" selection="${articleSelection}" order = "c.webdb_create desc, c.date desc" limit="limit" />
139 <List key="articles" table="content c" selection="${articleSelection}" order = "c.webdb_create desc, c.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="c.is_published='1'" />
164 <string name="basefilename" defaultvalue="main" />
169 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}"
170 channelfilename="${basefilename}-newswire.rss"
171 channeltitle="${config['Mir.Name']} ${basefilename} newswire"
173 extratables="${extratables}"
176 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}"
177 channelfilename="${basefilename}-newswire-content.rss"
178 channeltitle="${config['Mir.Name']} ${basefilename} newswire"
180 generator="RSS-full.template"
181 extratables="${extratables}"
185 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}"
186 channelfilename="${basefilename}-features.rss"
187 channeltitle="${config['Mir.Name']} ${basefilename} features"
189 extratables="${extratables}"
192 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}"
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="/article.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"/>
387 <producer name="newswirearchive">
390 <Set key="pages" value="3"/>
393 <Set key="pages" value="-1"/>
397 <Define key="docSuffix" value=".html"/>
398 <Define key="storageSuffix" value=".html"/>
400 <Batch key="articles" infokey="batch" table="content"
401 process="pages" batchsize="20" minbatchsize="10"
402 selection="is_published='1' and to_article_type = ${articletype.newswire}"
403 order="webdb_create asc">
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}"/>
411 generator="newswirearchive.template"
412 destination="${storagePrefix}${batch.current.identifier}${storageSuffix}"/>
418 <Define key="pagePrefix" value="${pathprefix}/newswire/archive"/>
419 <Define key="storagePrefix" value="${config["Producer.StorageRoot"]}/${pagePrefix}"/>
420 <Define key="docPrefix" value="${config["Producer.DocRoot"]}/${pagePrefix}"/>
422 generator="batchnav.template"
423 destination="${storagePrefix}nav${storageSuffix}"/>
430 <producer name="featurearchive">
433 <Set key="pages" value="3"/>
436 <Set key="pages" value="-1"/>
440 <Define key="docSuffix" value=".html"/>
441 <Define key="storageSuffix" value=".html"/>
443 <Batch key="articles" infokey="batch" table="content"
444 process="pages" batchsize="20" minbatchsize="10"
445 selection="is_published='1' and to_article_type in (${articletype.feature}, ${articletype.startspecial})"
446 order="webdb_create asc">
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}"/>
454 generator="featurearchive.template"
455 destination="${storagePrefix}${batch.current.identifier}${storageSuffix}"/>
461 <Define key="pagePrefix" value="${pathprefix}/feature/archive"/>
462 <Define key="storagePrefix" value="${config["Producer.StorageRoot"]}/${pagePrefix}"/>
463 <Define key="docPrefix" value="${config["Producer.DocRoot"]}/${pagePrefix}"/>
465 generator="batchnav.template"
466 destination="${storagePrefix}nav${storageSuffix}"/>
473 <producer name="topicpages">
476 <Set key="_topics" value="-1"/>
477 <Set key="pages" value="3"/>
480 <Set key="_topics" value="-1"/>
481 <Set key="pages" value="-1"/>
484 <Set key="_topics" value="2"/>
485 <Set key="pages" value="4"/>
489 <Enumerate key="topic" table="topic">
490 <Define key="docSuffix" value=".html"/>
491 <Define key="storageSuffix" value=".html"/>
493 <Log message="topic = ${topic.title}" />
494 <List key="special" table="content c"
495 selection="c.is_published='1' and c.to_article_type = ${articletype.topicspecial} and c.id=cxt.content_id and cxt.topic_id = ${topic.id}"
496 order = "webdb_create desc" limit="1"
497 extratables="content_x_topic cxt"/>
499 <Batch key="articles" infokey="batch" table="content c"
500 process="pages" batchsize="20" minbatchsize="10"
501 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}"
502 order="webdb_create asc" extratables="content_x_topic cxt">
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}"/>
508 <Log message="topic now = ${topic.title}" />
511 generator="topicpage.template"
512 destination="${storagePrefix}${batch.current.identifier}${storageSuffix}"/>
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}"/>
522 generator="batchnav.template"
523 destination="${storagePrefix}nav${storageSuffix}"/>
532 <producer name="opnewswireinclude">
534 <verb name="generate" default="1" description="Generates the op newswire"/>
537 <Set key="whichnewswire" value="Open Publishing News" />
538 <List key="newswire" table="content" limit="20"
539 selection="is_published=true and to_article_type=${articletype.newswire}"
540 order="webdb_create desc"/>
543 generator="/newswireinclude.template"
544 destination="${config.storageRoot}/${pathprefix}/newswireinclude.html"/>
551 <producer name="rssnewswireinclude">
553 <verb name="generate" default="1" description="Generates the rss newswire"/>
556 <Set key="whichnewswire" value="RSS Publishing News" />
557 <List key="newswire" table="content" limit="20"
558 selection="is_published=true and to_article_type=${articletype.communityrssarticle}"
559 order="webdb_create desc"/>
562 generator="/newswireinclude.template"
563 destination="${config.storageRoot}/${pathprefix}/rssnewswireinclude.html"/>
572 <producer name="startpage">
574 <verb name="generate" default="1" description="Generates the startpage"/>
578 <List key="startspecial" table="content" limit="1"
579 selection="is_published=true and to_article_type=${articletype.startspecial}"
580 order="webdb_create desc"/>
582 <List key="features" table="content" limit="5"
583 selection="is_published=true and to_article_type in (${articletype.feature},${articletype.promotedcommunityarticle},${articletype.promotednewswire})"
584 order="webdb_create desc"/>
586 <List key="communityrssarticles" table="content" limit="10"
587 selection="is_published=true and to_article_type in (${articletype.communityrssarticle},${articletype.promotedcommunityarticle})"
588 order="webdb_create desc"/>
590 <List key="newswire" table="content" limit="20"
591 selection="is_published=true and to_article_type=${articletype.newswire}"
592 order="webdb_create desc"/>
594 <List key="mostcomments"
596 extratables="comment cm"
597 selection="c.webdb_create > NOW()-'2 weeks'::interval and c.is_published=true and cm.is_published=true and c.id=cm.to_media group by c.id,c.title,
598 c.subtitle,c.edittitle,c.date,c.creator,c.creator_main_url,c.creator_email,c.creator_address,c.creator_phone,c.description,
599 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,
600 c.content_data,c.is_html,c.to_article_type,c.to_content,c.keywords,c.to_locking_user"
601 order="count(cm.id) desc, c.webdb_create desc "
606 <List key="breakingnews" table="breakingNews" limit="10"
607 order="webdb_create desc"/>
611 generator="/startpage.template"
612 destination="${config.storageRoot}/${pathprefix}/index.html"/>
617 <producer name="synchronization">
619 <verb name="run" default="1" description="Synchronizes the publication site with the production site"/>
623 <If condition="config['Rsync'] in ('1', 'y', 'yes', 'Y')">
625 <Execute command="${config['Rsync.Script.Path']}"/>
632 <producer name="media">
634 <verb name="new" default="1">
635 <Define key="verbcondition" value="(not is_produced)"/>
636 <Set key="limit" value="10"/>
639 <Define key="verbcondition" value=""/>
640 <Set key="limit" value="-1"/>
644 <Define key="verbcondition" value=""/>
645 <Set key="limit" value="10"/>
650 key="media" table="image"
651 selection="${verbcondition}"
653 order="webdb_create desc">
655 <GenerateMedia key="media" />
658 key="media" table="video"
659 selection="${verbcondition}"
661 order="webdb_create desc">
663 <GenerateMedia key="media" />
666 key="media" table="audio"
667 selection="${verbcondition}"
669 order="webdb_create desc">
671 <GenerateMedia key="media" />
674 key="media" table="otherMedia"
675 selection="${verbcondition}"
677 order="webdb_create desc">
679 <GenerateMedia key="media" />
684 <producer name="syndication">
686 <verb name="generate" />
689 <!-- the main features and newswire -->
692 <!-- the topic features and newswires -->
693 <Enumerate key="topic" table="topic">
695 basefilename="${topic.filename}"
696 selection="c.id=cxt.content_id and cxt.topic_id = ${topic.id}"
697 extratables="content_x_topic cxt"
707 <producer name="radicalendar">
712 <!-- groupname you will see as the value of "group" in the url for your radicalendar page, -->
713 <!-- gmtoffset is in minutes -->
714 <Radicalendar key="calendar" groupname="_imc" gmtoffset="60" />
716 generator="/radicalendar.template"
717 destination="${config.storageRoot}/calendarinclude.html"/>
724 <producer name="update">
726 <verb name="templates" description="updates templates and bundles">
727 <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/"/>
732 <Execute command="${command}"/>
740 <producer name="generatefpincludes">
746 <Set key="counter" value="1"/>
747 <Enumerate key="fpimage" table="image" selection="to_media_folder=8 and is_published=true" >
748 <Log message="generating include for image id: ${fpimage.id}" type="info" />
751 generator="/fpinclude.template"
752 destination="${config.storageRoot}/fpincludes/${fpimage.id}.inc" />
753 <Set key="counter" value="counter+1" />
757 <List key="fpincludes" table="image" selection="to_media_folder=8 and is_published=true" />
759 generator="/fpmapping.template"
760 destination="${config.storageRoot}/fpincludes/map.txt" />
768 <!-- generates a count for each topic -->
770 <!-- TODO: add date limit when we actually are going live with this -->
771 <producer name="generateTopicCounts">
776 <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
777 as x ON (t.id=x.topic_id) LEFT OUTER JOIN content as c ON (c.id=x.content_id)
778 WHERE c.webdb_create > NOW()-'1 day'::interval AND t.archiv_url = 'Category' GROUP BY t.title , t.filename ORDER BY t.title"
781 <Generate generator="/topiccount.template"
782 destination="${config.storageRoot}/${pathprefix}/topiccount.html" />
789 <producer name="generateRandomTopics">
794 <Set key="counter" value="1"/>
796 <Enumerate key="category" table="topic t" extratables="topic t2"
797 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">
799 <Log message="Getting Last 5 articles for category: ${category.title} - counter: ${counter}" />
800 <Define key="topictitle" value="${category.title}" />
801 <Define key="topicfile" value="${category.filename}" />
803 <List key="randomarticles" table="content"
804 selection ="id in (select content_id from content_x_topic where topic_id = ${category.id})" order="date DESC"
808 generator="/randomcategory.template"
809 destination="${config.storageRoot}/${pathprefix}/randomcats/random${counter}.html" />
812 <Set key="counter" value="counter+1" />
817 <producer name="getlocalblogs">
822 <Enumerate key="article" table="content" selection="to_article_type in(${articletype.communityrssfeed}) and is_published=true" order="webdb_create desc">
823 <Log message="Pulling 1.0 feed from ${article.title} at ${article.source}" type="info" />
825 url="${article.source}"
826 articletype="${articletype.communityrssarticle}"
827 blogurl="${article.creator_main_url}"
828 blogname="${article.title}"
834 <producer name="footer">
836 <verb name="generate" default="1" description="generates the default footer"/>
841 generator="/footer.template"
842 destination="${config.storageRoot}/${pathprefix}/footer.html"/>
848 <producer name="headArticle">
850 <verb name="generate" default="1" description="generates the article html head"/>
855 generator="/head.article.template"
856 destination="${config.storageRoot}/${pathprefix}/head.article.html"/>