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) and to_article_type != ${articletype.static}"/>
208 <Set key="limit" value="10"/>
211 <Define key="verbcondition" value="to_article_type != ${articletype.static}"/>
212 <Set key="limit" value="-1"/>
216 <Define key="verbcondition" value="to_article_type != ${articletype.static}"/>
217 <Set key="limit" value="10"/>
221 <Define key="verbcondition" value="(id>=5000 and id<7500 ) and to_article_type != ${articletype.static}"/>
222 <Set key="limit" value="2500"/>
228 <Enumerate key="article" table="content" selection="${verbcondition}"
229 limit="limit" order="webdb_create desc">
231 key="media" table="image"
232 selection="exists (select * from content_x_media where media_id=images.id and content_id=${article.id})
233 or exists (select * from comment_x_media, comment
234 where comment_id = comment.id and media_id=images.id and comment.to_media=${article.id})"
237 <GenerateMedia key="media" />
240 key="media" table="video"
241 selection="exists (select * from content_x_media where media_id=video.id and content_id=${article.id})
242 or exists (select * from comment_x_media, comment
243 where comment_id = comment.id and media_id=video.id and comment.to_media=${article.id})"
245 <GenerateMedia key="media" />
248 key="media" table="audio"
249 selection="exists (select * from content_x_media where media_id=audio.id and content_id=${article.id})
250 or exists (select * from comment_x_media, comment
251 where comment_id = comment.id and media_id=audio.id and comment.to_media=${article.id})"
254 <GenerateMedia key="media" />
259 key="media" table="otherMedia"
260 selection="exists (select * from content_x_media where media_id=other_media.id and content_id=${article.id})
261 or exists (select * from comment_x_media, comment
262 where comment_id = comment.id and media_id=other_media.id and comment.to_media=${article.id})"
265 <GenerateMedia key="media" />
269 <List key="topics" table="topic t" extratables="content_x_topic ctx"
270 selection="ctx.content_id = ${article.id} AND ctx.topic_id = t.id" />
271 <If condition="utility.listSize(topics) > 0">
273 <Log message="I have a topic list with ${utility.listSize(topics)}" />
276 <If condition="article.is_published == '1'">
280 generator="/article.template"
281 destination="${config.storageRoot}/${pathprefix}/${article.date.formatted.yyyy}/${article.date.formatted.MM}/${article.id}.html"/>
284 generator="/languagebar.template"
285 destination="${config.storageRoot}/languagebar/${article.to_original.date.formatted.yyyy}/${article.to_original.date.formatted.MM}/${article.to_original.id}.html"/>
286 <IndexContent key="article" pathToIndex="${config['IndexPath']}"/>
289 <UnIndexContent key="article" pathToIndex="${config['IndexPath']}"/>
292 <MarkContent key="article"/>
297 <producer name="staticpages">
299 <verb name="changed" default="1">
300 <Define key="verbcondition" value="(not is_produced) and to_article_type = ${articletype.static}"/>
301 <Set key="limit" value="10"/>
304 <Define key="verbcondition" value="to_article_type = ${articletype.static}"/>
305 <Set key="limit" value="-1"/>
310 <Enumerate key="article" table="content" selection="${verbcondition}"
311 limit="limit" order="webdb_create desc">
313 key="media" table="image"
314 selection="exists (select * from content_x_media where media_id=images.id and content_id=${article.id})"
317 <GenerateMedia key="media" />
320 key="media" table="video"
321 selection="exists (select * from content_x_media where media_id=video.id and content_id=${article.id})"
324 <GenerateMedia key="media" />
327 key="media" table="audio"
328 selection="exists (select * from content_x_media where media_id=audio.id and content_id=${article.id})"
331 <GenerateMedia key="media" />
334 key="media" table="otherMedia"
335 selection="exists (select * from content_x_media where media_id=other_media.id and content_id=${article.id})"
339 <GenerateMedia key="media" />
341 <List key="topics" table="topic t" extratables="content_x_topic ctx"
342 selection="ctx.content_id = ${article.id} AND ctx.topic_id = t.id" />
344 <If condition="article.is_published == '1'">
348 generator="/article.template"
349 destination="${config.storageRoot}/${pathprefix}/static/${article.edittitle}.html"/>
353 generator="/languagebar.template"
354 destination="${config.storageRoot}/languagebar/${article.to_original.date.formatted.yyyy}/${article.to_original.date.formatted.MM}/${article.to_original.id}.html"/>
355 <IndexContent key="article" pathToIndex="${config['IndexPath']}"/>
358 <UnIndexContent key="article" pathToIndex="${config['IndexPath']}"/>
361 <MarkContent key="article"/>
366 <producer name="navigation">
368 <verb name="generate" default="1" description="generates the left column"/>
373 generator="/navigation.template"
374 destination="${config.storageRoot}/${pathprefix}/navigation.html"/>
379 <producer name="staticimages">
381 <verb name="generate" default="1" description="copies all the static image files into place"/>
384 <CopyDir destination="img" source="etc/producer/images"/>
388 <producer name="newswirearchive">
391 <Set key="pages" value="3"/>
394 <Set key="pages" value="-1"/>
398 <Define key="docSuffix" value=".html"/>
399 <Define key="storageSuffix" value=".html"/>
401 <Batch key="articles" infokey="batch" table="content"
402 process="pages" batchsize="20" minbatchsize="10"
403 selection="is_published='1' and to_article_type = ${articletype.newswire}"
404 order="webdb_create asc">
407 <Define key="pagePrefix" value="${pathprefix}/newswire/archive"/>
408 <Define key="storagePrefix" value="${config["Producer.StorageRoot"]}/${pagePrefix}"/>
409 <Define key="docPrefix" value="${config["Producer.DocRoot"]}/${pagePrefix}"/>
412 generator="newswirearchive.template"
413 destination="${storagePrefix}${batch.current.identifier}${storageSuffix}"/>
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}"/>
423 generator="batchnav.template"
424 destination="${storagePrefix}nav${storageSuffix}"/>
431 <producer name="featurearchive">
434 <Set key="pages" value="3"/>
437 <Set key="pages" value="-1"/>
441 <Define key="docSuffix" value=".html"/>
442 <Define key="storageSuffix" value=".html"/>
444 <Batch key="articles" infokey="batch" table="content"
445 process="pages" batchsize="20" minbatchsize="10"
446 selection="is_published='1' and to_article_type in (${articletype.feature}, ${articletype.startspecial})"
447 order="webdb_create asc">
450 <Define key="pagePrefix" value="${pathprefix}/feature/archive"/>
451 <Define key="storagePrefix" value="${config["Producer.StorageRoot"]}/${pagePrefix}"/>
452 <Define key="docPrefix" value="${config["Producer.DocRoot"]}/${pagePrefix}"/>
455 generator="featurearchive.template"
456 destination="${storagePrefix}${batch.current.identifier}${storageSuffix}"/>
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}"/>
466 generator="batchnav.template"
467 destination="${storagePrefix}nav${storageSuffix}"/>
474 <producer name="topicpages">
477 <Set key="_topics" value="-1"/>
478 <Set key="pages" value="3"/>
481 <Set key="_topics" value="-1"/>
482 <Set key="pages" value="-1"/>
485 <Set key="_topics" value="2"/>
486 <Set key="pages" value="4"/>
490 <Enumerate key="topic" table="topic">
491 <Define key="docSuffix" value=".html"/>
492 <Define key="storageSuffix" value=".html"/>
494 <Log message="topic = ${topic.title}" />
495 <List key="special" table="content c"
496 selection="c.is_published='1' and c.to_article_type = ${articletype.topicspecial} and c.id=cxt.content_id and cxt.topic_id = ${topic.id}"
497 order = "webdb_create desc" limit="1"
498 extratables="content_x_topic cxt"/>
500 <Batch key="articles" infokey="batch" table="content c"
501 process="pages" batchsize="20" minbatchsize="10"
502 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}"
503 order="webdb_create asc" extratables="content_x_topic cxt">
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}"/>
509 <Log message="topic now = ${topic.title}" />
512 generator="topicpage.template"
513 destination="${storagePrefix}${batch.current.identifier}${storageSuffix}"/>
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}"/>
523 generator="batchnav.template"
524 destination="${storagePrefix}nav${storageSuffix}"/>
533 <producer name="opnewswireinclude">
535 <verb name="generate" default="1" description="Generates the op newswire"/>
538 <Set key="whichnewswire" value="Open Publishing News" />
539 <List key="newswire" table="content" limit="20"
540 selection="is_published=true and to_article_type=${articletype.newswire}"
541 order="webdb_create desc"/>
544 generator="/newswireinclude.template"
545 destination="${config.storageRoot}/${pathprefix}/newswireinclude.html"/>
552 <producer name="rssnewswireinclude">
554 <verb name="generate" default="1" description="Generates the rss newswire"/>
557 <Set key="whichnewswire" value="RSS Publishing News" />
558 <List key="newswire" table="content" limit="20"
559 selection="is_published=true and to_article_type=${articletype.communityrssarticle}"
560 order="webdb_create desc"/>
563 generator="/newswireinclude.template"
564 destination="${config.storageRoot}/${pathprefix}/rssnewswireinclude.html"/>
573 <producer name="startpage">
575 <verb name="generate" default="1" description="Generates the startpage"/>
579 <List key="startspecial" table="content" limit="1"
580 selection="is_published=true and to_article_type=${articletype.startspecial}"
581 order="webdb_create desc"/>
583 <List key="features" table="content" limit="5"
584 selection="is_published=true and to_article_type in (${articletype.feature},${articletype.promotedcommunityarticle},${articletype.promotednewswire})"
585 order="webdb_create desc"/>
587 <List key="communityrssarticles" table="content" limit="10"
588 selection="is_published=true and to_article_type in (${articletype.communityrssarticle},${articletype.promotedcommunityarticle})"
589 order="webdb_create desc"/>
591 <List key="newswire" table="content" limit="20"
592 selection="is_published=true and to_article_type=${articletype.newswire}"
593 order="webdb_create desc"/>
595 <List key="mostcomments"
597 extratables="comment cm"
598 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,
599 c.subtitle,c.edittitle,c.date,c.creator,c.creator_main_url,c.creator_email,c.creator_address,c.creator_phone,c.description,
600 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,
601 c.content_data,c.is_html,c.to_article_type,c.to_content,c.keywords,c.to_locking_user"
602 order="count(cm.id) desc"
607 <List key="breakingnews" table="breakingNews" limit="10"
608 order="webdb_create desc"/>
612 generator="/startpage.template"
613 destination="${config.storageRoot}/${pathprefix}/index.html"/>
618 <producer name="synchronization">
620 <verb name="run" default="1" description="Synchronizes the publication site with the production site"/>
624 <If condition="config['Rsync'] in ('1', 'y', 'yes', 'Y')">
626 <Execute command="${config['Rsync.Script.Path']}"/>
633 <producer name="media">
635 <verb name="new" default="1">
636 <Define key="verbcondition" value="(not is_produced)"/>
637 <Set key="limit" value="10"/>
640 <Define key="verbcondition" value=""/>
641 <Set key="limit" value="-1"/>
645 <Define key="verbcondition" value=""/>
646 <Set key="limit" value="10"/>
651 key="media" table="image"
652 selection="${verbcondition}"
654 order="webdb_create desc">
656 <GenerateMedia key="media" />
659 key="media" table="video"
660 selection="${verbcondition}"
662 order="webdb_create desc">
664 <GenerateMedia key="media" />
667 key="media" table="audio"
668 selection="${verbcondition}"
670 order="webdb_create desc">
672 <GenerateMedia key="media" />
675 key="media" table="otherMedia"
676 selection="${verbcondition}"
678 order="webdb_create desc">
680 <GenerateMedia key="media" />
685 <producer name="syndication">
687 <verb name="generate" />
690 <!-- the main features and newswire -->
693 <!-- the topic features and newswires -->
694 <Enumerate key="topic" table="topic">
696 basefilename="${topic.filename}"
697 selection="c.id=cxt.content_id and cxt.topic_id = ${topic.id}"
698 extratables="content_x_topic cxt"
708 <producer name="radicalendar">
713 <!-- groupname you will see as the value of "group" in the url for your radicalendar page, -->
714 <!-- gmtoffset is in minutes -->
715 <Radicalendar key="calendar" groupname="_imc" gmtoffset="60" />
717 generator="/radicalendar.template"
718 destination="${config.storageRoot}/calendarinclude.html"/>
725 <producer name="update">
727 <verb name="templates" description="updates templates and bundles">
728 <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/"/>
733 <Execute command="${command}"/>
741 <producer name="generatefpincludes">
747 <Set key="counter" value="1"/>
748 <Enumerate key="fpimage" table="image" selection="to_media_folder=8 and is_published=true" >
749 <Log message="generating include for image id: ${fpimage.id}" type="info" />
752 generator="/fpinclude.template"
753 destination="${config.storageRoot}/fpincludes/${fpimage.id}.inc" />
754 <Set key="counter" value="counter+1" />
758 <List key="fpincludes" table="image" selection="to_media_folder=8 and is_published=true" />
760 generator="/fpmapping.template"
761 destination="${config.storageRoot}/fpincludes/map.txt" />
769 <!-- generates a count for each topic -->
771 <!-- TODO: add date limit when we actually are going live with this -->
772 <producer name="generateTopicCounts">
777 <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
778 as x ON (t.id=x.topic_id) LEFT OUTER JOIN content as c ON (c.id=x.content_id)
779 WHERE c.webdb_create > NOW()-'1 day'::interval AND t.archiv_url = 'Category' GROUP BY t.title , t.filename ORDER BY t.title"
782 <Generate generator="/topiccount.template"
783 destination="${config.storageRoot}/${pathprefix}/topiccount.html" />
790 <producer name="generateRandomTopics">
795 <Set key="counter" value="1"/>
797 <Enumerate key="category" table="topic t" extratables="topic t2"
798 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">
800 <Log message="Getting Last 5 articles for category: ${category.title} - counter: ${counter}" />
801 <Define key="topictitle" value="${category.title}" />
802 <Define key="topicfile" value="${category.filename}" />
804 <List key="randomarticles" table="content"
805 selection ="id in (select content_id from content_x_topic where topic_id = ${category.id})" order="date DESC"
809 generator="/randomcategory.template"
810 destination="${config.storageRoot}/${pathprefix}/randomcats/random${counter}.html" />
813 <Set key="counter" value="counter+1" />
818 <producer name="getlocalblogs">
823 <Enumerate key="article" table="content" selection="to_article_type in(${articletype.communityrssfeed}) and is_published=true" order="webdb_create desc">
824 <Log message="Pulling 1.0 feed from ${article.title} at ${article.source}" type="info" />
826 url="${article.source}"
827 articletype="${articletype.communityrssarticle}"
828 blogurl="${article.creator_main_url}"
829 blogname="${article.title}"
835 <producer name="footer">
837 <verb name="generate" default="1" description="generates the default footer"/>
842 generator="/footer.template"
843 destination="${config.storageRoot}/${pathprefix}/footer.html"/>
849 <producer name="headArticle">
851 <verb name="generate" default="1" description="generates the article html head"/>
856 generator="/head.article.template"
857 destination="${config.storageRoot}/${pathprefix}/head.article.html"/>