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 <Log message="I am generating: ${article.id}"/>
280 <If condition="article.is_published == '1'">
284 generator="/article.template"
285 destination="${config.storageRoot}/${pathprefix}/${article.date.formatted.yyyy}/${article.date.formatted.MM}/${article.id}.html"/>
288 generator="/languagebar.template"
289 destination="${config.storageRoot}/languagebar/${article.to_original.date.formatted.yyyy}/${article.to_original.date.formatted.MM}/${article.to_original.id}.html"/>
290 <IndexContent key="article" pathToIndex="${config['IndexPath']}"/>
293 <UnIndexContent key="article" pathToIndex="${config['IndexPath']}"/>
296 <MarkContent key="article"/>
301 <producer name="staticpages">
303 <verb name="changed" default="1">
304 <Define key="verbcondition" value="(not is_produced) and to_article_type = ${articletype.static}"/>
305 <Set key="limit" value="10"/>
308 <Define key="verbcondition" value="to_article_type = ${articletype.static}"/>
309 <Set key="limit" value="-1"/>
314 <Enumerate key="article" table="content" selection="${verbcondition}"
315 limit="limit" order="webdb_create desc">
317 key="media" table="image"
318 selection="exists (select * from content_x_media where media_id=images.id and content_id=${article.id})"
321 <GenerateMedia key="media" />
324 key="media" table="video"
325 selection="exists (select * from content_x_media where media_id=video.id and content_id=${article.id})"
328 <GenerateMedia key="media" />
331 key="media" table="audio"
332 selection="exists (select * from content_x_media where media_id=audio.id and content_id=${article.id})"
335 <GenerateMedia key="media" />
338 key="media" table="otherMedia"
339 selection="exists (select * from content_x_media where media_id=other_media.id and content_id=${article.id})"
343 <GenerateMedia key="media" />
345 <List key="topics" table="topic t" extratables="content_x_topic ctx"
346 selection="ctx.content_id = ${article.id} AND ctx.topic_id = t.id" />
348 <If condition="article.is_published == '1'">
352 generator="/staticpage.template"
353 destination="${config.storageRoot}/${pathprefix}/static/${article.edittitle}.html"/>
357 generator="/languagebar.template"
358 destination="${config.storageRoot}/languagebar/${article.to_original.date.formatted.yyyy}/${article.to_original.date.formatted.MM}/${article.to_original.id}.html"/>
359 <IndexContent key="article" pathToIndex="${config['IndexPath']}"/>
362 <UnIndexContent key="article" pathToIndex="${config['IndexPath']}"/>
365 <MarkContent key="article"/>
370 <producer name="navigation">
372 <verb name="generate" default="1" description="generates the left column"/>
377 generator="/navigation.template"
378 destination="${config.storageRoot}/${pathprefix}/navigation.html"/>
383 <producer name="staticimages">
385 <verb name="generate" default="1" description="copies all the static image files into place"/>
388 <CopyDir destination="img" source="etc/producer/images"/>
393 <producer name="staticfiles">
395 <verb name="generate" default="1" description="copies all the static image files into place"/>
398 <CopyDir destination="js" source="etc/producer/js"/>
402 <producer name="newswirearchive">
405 <Set key="pages" value="3"/>
408 <Set key="pages" value="-1"/>
412 <Define key="docSuffix" value=".html"/>
413 <Define key="storageSuffix" value=".html"/>
415 <Batch key="articles" infokey="batch" table="content"
416 process="pages" batchsize="20" minbatchsize="10"
417 selection="is_published='1' and to_article_type = ${articletype.newswire}"
418 order="webdb_create asc">
421 <Define key="pagePrefix" value="${pathprefix}/newswire/archive"/>
422 <Define key="storagePrefix" value="${config["Producer.StorageRoot"]}/${pagePrefix}"/>
423 <Define key="docPrefix" value="${config["Producer.DocRoot"]}/${pagePrefix}"/>
426 generator="newswirearchive.template"
427 destination="${storagePrefix}${batch.current.identifier}${storageSuffix}"/>
433 <Define key="pagePrefix" value="${pathprefix}/newswire/archive"/>
434 <Define key="storagePrefix" value="${config["Producer.StorageRoot"]}/${pagePrefix}"/>
435 <Define key="docPrefix" value="${config["Producer.DocRoot"]}/${pagePrefix}"/>
437 generator="batchnav.template"
438 destination="${storagePrefix}nav${storageSuffix}"/>
445 <producer name="featurearchive">
448 <Set key="pages" value="3"/>
451 <Set key="pages" value="-1"/>
455 <Define key="docSuffix" value=".html"/>
456 <Define key="storageSuffix" value=".html"/>
458 <Batch key="articles" infokey="batch" table="content"
459 process="pages" batchsize="20" minbatchsize="10"
460 selection="is_published='1' and to_article_type in (${articletype.feature}, ${articletype.startspecial})"
461 order="webdb_create asc">
464 <Define key="pagePrefix" value="${pathprefix}/feature/archive"/>
465 <Define key="storagePrefix" value="${config["Producer.StorageRoot"]}/${pagePrefix}"/>
466 <Define key="docPrefix" value="${config["Producer.DocRoot"]}/${pagePrefix}"/>
469 generator="featurearchive.template"
470 destination="${storagePrefix}${batch.current.identifier}${storageSuffix}"/>
476 <Define key="pagePrefix" value="${pathprefix}/feature/archive"/>
477 <Define key="storagePrefix" value="${config["Producer.StorageRoot"]}/${pagePrefix}"/>
478 <Define key="docPrefix" value="${config["Producer.DocRoot"]}/${pagePrefix}"/>
480 generator="batchnav.template"
481 destination="${storagePrefix}nav${storageSuffix}"/>
488 <producer name="topicpages">
491 <Set key="_topics" value="-1"/>
492 <Set key="pages" value="3"/>
495 <Set key="_topics" value="-1"/>
496 <Set key="pages" value="-1"/>
499 <Set key="_topics" value="2"/>
500 <Set key="pages" value="4"/>
504 <Enumerate key="topic" table="topic">
505 <Define key="docSuffix" value=".html"/>
506 <Define key="storageSuffix" value=".html"/>
508 <Log message="topic = ${topic.title}" />
509 <List key="special" table="content c"
510 selection="c.is_published='1' and c.to_article_type = ${articletype.topicspecial} and c.id=cxt.content_id and cxt.topic_id = ${topic.id}"
511 order = "webdb_create desc" limit="1"
512 extratables="content_x_topic cxt"/>
514 <Batch key="articles" infokey="batch" table="content c"
515 process="pages" batchsize="20" minbatchsize="10"
516 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}"
517 order="webdb_create asc" extratables="content_x_topic cxt">
520 <Define key="pagePrefix" value="${pathprefix}/${topic.filename}/archive"/>
521 <Define key="storagePrefix" value="${config["Producer.StorageRoot"]}/${pagePrefix}"/>
522 <Define key="docPrefix" value="${config["Producer.DocRoot"]}/${pagePrefix}"/>
523 <Log message="topic now = ${topic.title}" />
526 generator="topicpage.template"
527 destination="${storagePrefix}${batch.current.identifier}${storageSuffix}"/>
533 <Define key="pagePrefix" value="${pathprefix}/${topic.filename}/archive"/>
534 <Define key="storagePrefix" value="${config["Producer.StorageRoot"]}/${pagePrefix}"/>
535 <Define key="docPrefix" value="${config["Producer.DocRoot"]}/${pagePrefix}"/>
537 generator="batchnav.template"
538 destination="${storagePrefix}nav${storageSuffix}"/>
547 <producer name="opnewswireinclude">
549 <verb name="generate" default="1" description="Generates the op newswire"/>
552 <Set key="whichnewswire" value="Open Publishing News" />
553 <List key="newswire" table="content" limit="50"
554 selection="is_published=true and to_article_type=${articletype.newswire}"
555 order="webdb_create desc"/>
558 generator="/newswireinclude.template"
559 destination="${config.storageRoot}/${pathprefix}/newswireinclude.html"/>
566 <producer name="rssnewswireinclude">
568 <verb name="generate" default="1" description="Generates the rss newswire"/>
571 <Set key="whichnewswire" value="RSS Publishing News" />
572 <List key="newswire" table="content" limit="20"
573 selection="is_published=true and to_article_type=${articletype.communityrssarticle}"
574 order="webdb_create desc"/>
577 generator="/newswireinclude.template"
578 destination="${config.storageRoot}/${pathprefix}/rssnewswireinclude.html"/>
587 <producer name="startpage">
589 <verb name="generate" default="1" description="Generates the startpage"/>
594 <List key="startspecial" table="content" limit="1"
595 selection="is_published=true and to_article_type=${articletype.startspecial}"
596 order="webdb_create desc"/>
598 <Enumerate key="ssimage" table="image" selection="to_media_folder=9 and is_published=true" >
599 <Define key="ssimagepath" value="${ssimage.publish_server}/${ssimage.publish_path}" />
600 <Define key="sstitle" value="${ssimage.title}" />
604 <List key="features" table="content" limit="5"
605 selection="is_published=true and to_article_type in (${articletype.feature},${articletype.promotedcommunityarticle},${articletype.promotednewswire})"
606 order="webdb_create desc"/>
608 <List key="communityrssarticles" table="content" limit="10"
609 selection="is_published=true and to_article_type in (${articletype.communityrssarticle},${articletype.promotedcommunityarticle})"
610 order="webdb_create desc"/>
612 <List key="newswire" table="content" limit="20"
613 selection="is_published=true and to_article_type=${articletype.newswire}"
614 order="webdb_create desc"/>
616 <List key="mostcomments"
618 extratables="comment cm"
619 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,
620 c.subtitle,c.edittitle,c.date,c.creator,c.creator_main_url,c.creator_email,c.creator_address,c.creator_phone,c.description,
621 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,
622 c.content_data,c.is_html,c.to_article_type,c.to_content,c.keywords,c.to_locking_user"
623 order="count(cm.id) desc, c.webdb_create desc "
628 <List key="breakingnews" table="breakingNews" limit="10"
629 order="webdb_create desc"/>
633 generator="/startpage.template"
634 destination="${config.storageRoot}/${pathprefix}/index.html"/>
639 <producer name="synchronization">
641 <verb name="run" default="1" description="Synchronizes the publication site with the production site"/>
645 <If condition="config['Rsync'] in ('1', 'y', 'yes', 'Y')">
647 <Execute command="${config['Rsync.Script.Path']}"/>
654 <producer name="media">
656 <verb name="new" default="1">
657 <Define key="verbcondition" value="(not is_produced)"/>
658 <Set key="limit" value="10"/>
661 <Define key="verbcondition" value=""/>
662 <Set key="limit" value="-1"/>
666 <Define key="verbcondition" value=""/>
667 <Set key="limit" value="10"/>
672 key="media" table="image"
673 selection="${verbcondition}"
675 order="webdb_create desc">
677 <GenerateMedia key="media" />
680 key="media" table="video"
681 selection="${verbcondition}"
683 order="webdb_create desc">
685 <GenerateMedia key="media" />
688 key="media" table="audio"
689 selection="${verbcondition}"
691 order="webdb_create desc">
693 <GenerateMedia key="media" />
696 key="media" table="otherMedia"
697 selection="${verbcondition}"
699 order="webdb_create desc">
701 <GenerateMedia key="media" />
706 <producer name="syndication">
708 <verb name="generate" />
711 <!-- the main features and newswire -->
714 <!-- the topic features and newswires -->
715 <Enumerate key="topic" table="topic">
717 basefilename="${topic.filename}"
718 selection="id=cxt.content_id and cxt.topic_id = ${topic.id}"
719 extratables="content_x_topic as cxt"
729 <producer name="radicalendar">
734 <!-- groupname you will see as the value of "group" in the url for your radicalendar page, -->
735 <!-- gmtoffset is in minutes -->
736 <Radicalendar key="calendar" groupname="_imc" gmtoffset="60" />
738 generator="/radicalendar.template"
739 destination="${config.storageRoot}/calendarinclude.html"/>
746 <producer name="update">
748 <verb name="templates" description="updates templates and bundles">
749 <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/"/>
754 <Execute command="${command}"/>
762 <producer name="generatefpincludes">
768 <Set key="counter" value="1"/>
769 <Enumerate key="fpimage" table="image" selection="to_media_folder=8 and is_published=true" >
770 <Log message="generating include for image id: ${fpimage.id}" type="info" />
773 generator="/fpinclude.template"
774 destination="${config.storageRoot}/fpincludes/${fpimage.id}.inc" />
775 <Set key="counter" value="counter+1" />
779 <List key="fpincludes" table="image" selection="to_media_folder=8 and is_published=true" />
781 generator="/fpmapping.template"
782 destination="${config.storageRoot}/fpincludes/map.txt" />
790 <!-- generates a count for each topic -->
792 <!-- TODO: add date limit when we actually are going live with this -->
793 <producer name="generateTopicCounts">
798 <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
799 as x ON (t.id=x.topic_id) LEFT OUTER JOIN content as c ON (c.id=x.content_id)
800 WHERE c.webdb_create > NOW()-'1 day'::interval AND t.archiv_url = 'Category' GROUP BY t.title , t.filename ORDER BY t.title"
803 <Generate generator="/topiccount.template"
804 destination="${config.storageRoot}/${pathprefix}/topiccount.html" />
811 <producer name="generateRandomTopics">
816 <Set key="counter" value="1"/>
818 <Enumerate key="category" table="topic t" extratables="topic t2"
819 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">
821 <Log message="Getting Last 5 articles for category: ${category.title} - counter: ${counter}" />
822 <Define key="topictitle" value="${category.title}" />
823 <Define key="topicfile" value="${category.filename}" />
825 <List key="randomarticles" table="content"
826 selection ="id in (select content_id from content_x_topic where topic_id = ${category.id}) AND is_published=true" order="date DESC"
830 generator="/randomcategory.template"
831 destination="${config.storageRoot}/${pathprefix}/randomcats/random${counter}.html" />
834 <Set key="counter" value="counter+1" />
839 <producer name="getlocalblogs">
844 <Enumerate key="article" table="content" selection="to_article_type in(${articletype.communityrssfeed}) and is_published=true" order="webdb_create desc">
845 <Log message="Pulling 1.0 feed from ${article.title} at ${article.source}" type="info" />
847 url="${article.source}"
848 articletype="${articletype.communityrssarticle}"
849 blogurl="${article.creator_main_url}"
850 blogname="${article.title}"
856 <producer name="footer">
858 <verb name="generate" default="1" description="generates the default footer"/>
863 generator="/footer.template"
864 destination="${config.storageRoot}/${pathprefix}/footer.html"/>
870 <producer name="headArticle">
872 <verb name="generate" default="1" description="generates the article html head"/>
877 generator="/head.article.template"
878 destination="${config.storageRoot}/${pathprefix}/head.article.html"/>