added log to see whats going on
[nyc.indymedia.org.git] / etc / producer / producers.xml
1 <!--
2   This XML file defines a set of producers intended for a typical indymedia 
3   site:
4     - a start page
5     - a navigational bar
6     - topic pages
7     - a newswire archive
8     - a feature archive
9     - articles
10     - media
11 -->  
12
13 <producers>
14   <nodedefinition name="Language">
15     <parameters>
16       <string name="languagecondition" defaultvalue="code != 'ot'"/>
17       <string name="bundle" defaultvalue="bundles.producer" />
18       <node name="sub"/>    
19     </parameters>
20
21     <definition>
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}" />
27         <sub/>
28         <If condition="language.code=='en'">
29           <then>
30             <Define key="pathprefix" value="or" />
31             <Define key="languagepreference" value="" />
32             <sub/>
33           </then>
34         </If>
35       </Enumerate>
36     </definition>
37   </nodedefinition>
38
39 <nodedefinition name="Pull">
40     <parameters>
41       <string name="url"/>
42       <string name="blogname"/>
43       <string name="blogurl"/>
44       <string name="articletype"/>
45     </parameters>
46
47     <definition>
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']">
53           <then>
54             <Set key="languagecode" value="item['dc:language']"/>
55           </then>
56         </If>
57
58         <If condition="item['dc:source']">
59           <then>
60             <Set key="origin" value="item['dc:source']"/>
61           </then>
62           <else>
63             <Set key="origin" value="item.identifier"/>
64           </else>
65         </If>
66         
67         
68
69         <If condition="item['dcterms:hasPart']">
70           <then>
71             <Set key="haspartimg" value="'&lt;img align=&quot;right&quot; src=&quot;'++item['dcterms:hasPart'] ++'&quot; /&gt;' " />
72           </then>
73           <else>
74             <Set key="haspartimg" value="' '" />
75           </else>
76         </If>
77
78         <Set key="present" value="0" />
79         <Enumerate
80           key="article"
81           table="content"
82           selection="source='${utility.escapeJDBCString(origin)}'" limit="1">
83           <Set key="present" value="1" />
84         </Enumerate>
85         <If condition="present==0">
86           <then>
87             <Log message="  new entry from ${blogname}: ${item['rss:title']}" type="info" />
88              <CreateEntity
89                key="article"
90                table="content"
91
92                date="utility.datetime.formatDate(item['dc:date'], 'yyyyMMdd')"
93                publish_path="' '"
94                to_publisher="'0'"
95                is_produced="'0'"
96                is_published="'1'"
97                is_html="'1'"
98
99                source="origin"
100                to_article_type="articletype"
101
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']"
108                creator="blogname"
109                comment="'Taken from ' ++ blogname"
110              />
111           </then>
112         </If>
113       </Enumerate>
114     </definition>
115   </nodedefinition>
116
117
118   <nodedefinition name="RSSChannel">
119     <parameters>
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" />
132     </parameters>
133
134     <definition>
135       <If condition="extratables == 'none' ">
136         <then>
137           <List key="articles" table="content c" selection="${articleSelection}" order = "c.webdb_create desc, c.date desc" limit="limit" />
138         </then>
139         <else>
140           <List key="articles" table="content c" selection="${articleSelection}" order = "c.webdb_create desc, c.date desc" limit="limit" extratables="${extratables}" />
141         </else>
142       </If>
143       <If condition="channeldescription==''">
144         <then>
145           <Define key="channeldescription" value="${channeltitle}"/>
146         </then>
147       </If>
148       <If condition="channelidentifier==''">
149         <then>
150           <Define key="channelidentifier" value="${config['Producer.PublicationHost']}/or/${channelfilename}"/>
151         </then>
152       </If>
153
154       <Generate
155          parameters="${encoding}"
156          generator="${generator}"
157          destination="${config.storageRoot}/${channelfilename}"/>
158     </definition>
159   </nodedefinition>
160
161   <nodedefinition name="RSSChannelBundle">
162     <parameters>
163       <string name="extratables" defaultvalue="none" />
164       <string name="selection" defaultvalue="c.is_published='1'" />  
165       <string name="basefilename" defaultvalue="main" />
166     </parameters>
167     <definition>
168       <!-- newswire -->
169       <RSSChannel
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"
173         limit="20"
174         extratables="${extratables}"
175       />
176       <RSSChannel
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"
180         limit="20"
181         generator="RSS-full.template"
182         extratables="${extratables}"
183       />    
184       <!-- features -->
185       <RSSChannel
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"
189         limit="20"
190         extratables="${extratables}"
191       />
192       <RSSChannel
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"
196         limit="20"
197         generator="RSS-full.template"
198         extratables="${extratables}"
199       />
200     </definition>
201   </nodedefinition>
202
203  
204   <producer name="articles">
205     <verbs>
206       <verb name="changed" default="1">
207         <Define key="verbcondition" value="(not is_produced)"/>
208         <Set key="limit" value="10"/>
209       </verb>
210       <verb name="all">
211         <Define key="verbcondition" value=""/>
212         <Set key="limit" value="-1"/>
213       </verb>
214
215       <verb name="sample">
216         <Define key="verbcondition" value=""/>
217         <Set key="limit" value="10"/>
218       </verb>
219     </verbs>
220     <body>
221       <Enumerate key="article" table="content" selection="${verbcondition}"
222                   limit="limit" order="webdb_create desc">
223         <Enumerate 
224             key="media" table="image" 
225             selection="exists (select * from content_x_media where media_id=images.id and content_id=${article.id})
226                or      exists (select * from comment_x_media, comment
227                            where comment_id = comment.id and media_id=images.id and comment.to_media=${article.id})"
228             order="id desc">
229             
230            <GenerateMedia key="media" />
231         </Enumerate>
232         <Enumerate 
233             key="media" table="video" 
234             selection="exists (select * from content_x_media where media_id=video.id and content_id=${article.id})
235                or      exists (select * from comment_x_media, comment
236                            where comment_id = comment.id and media_id=video.id and comment.to_media=${article.id})"
237             order="id desc">
238            <GenerateMedia key="media" />
239         </Enumerate>
240         <Enumerate 
241             key="media" table="audio" 
242             selection="exists (select * from content_x_media where media_id=audio.id and content_id=${article.id})
243                or      exists (select * from comment_x_media, comment
244                                        where comment_id = comment.id and media_id=audio.id and comment.to_media=${article.id})"
245             order="id desc">
246             
247            <GenerateMedia key="media" />
248         </Enumerate>
249         
250       
251         <Enumerate 
252             key="media" table="otherMedia" 
253             selection="exists (select * from content_x_media where media_id=other_media.id and content_id=${article.id})
254                or      exists (select * from comment_x_media, comment
255                                        where comment_id = comment.id and media_id=other_media.id and comment.to_media=${article.id})"
256             order="id desc">
257             
258            <GenerateMedia key="media" />
259         </Enumerate>
260
261
262               <List key="topics" table="topic t"
263                 selection="ctx.content_id = ${article.id} AND ctx.topic_id = t.id" />
264
265                   <Log message="I have a topic list with ${utility.listSize(topics)}" />
266         <If condition="article.is_published == '1'">
267           <then>
268             <Language>
269               <Generate 
270                 generator="/article.template" 
271                 destination="${config.storageRoot}/${pathprefix}/${article.date.formatted.yyyy}/${article.date.formatted.MM}/${article.id}.shtml"/>
272              </Language>
273              <Generate 
274                 generator="/languagebar.template" 
275                 destination="${config.storageRoot}/languagebar/${article.to_original.date.formatted.yyyy}/${article.to_original.date.formatted.MM}/${article.to_original.id}.shtml"/>   
276              <IndexContent key="article" pathToIndex="${config['IndexPath']}"/>
277           </then>
278           <else>
279             <UnIndexContent key="article" pathToIndex="${config['IndexPath']}"/>
280           </else>
281         </If>
282         <MarkContent key="article"/>            
283       </Enumerate>
284     </body>
285   </producer>  
286
287   <producer name="staticpages">
288     <verbs>
289       <verb name="changed" default="1">
290         <Define key="verbcondition" value="(not is_produced)"/>
291         <Set key="limit" value="10"/>
292       </verb>
293       <verb name="all">
294         <Define key="verbcondition" value=""/>
295         <Set key="limit" value="-1"/>
296       </verb>
297     </verbs>
298
299     <body>
300       <Enumerate key="article" table="content" selection="${verbcondition}  and to_article_type = ${articletype.static}"
301                   limit="limit" order="webdb_create desc">
302         <Enumerate 
303             key="media" table="image" 
304             selection="exists (select * from content_x_media where media_id=images.id and content_id=${article.id})"
305             order="id desc">
306             
307            <GenerateMedia key="media" />
308         </Enumerate>
309         <Enumerate 
310             key="media" table="video" 
311             selection="exists (select * from content_x_media where media_id=video.id and content_id=${article.id})"
312             order="id desc">
313
314            <GenerateMedia key="media" />
315         </Enumerate>
316         <Enumerate 
317             key="media" table="audio" 
318             selection="exists (select * from content_x_media where media_id=audio.id and content_id=${article.id})"
319             order="id desc">
320             
321            <GenerateMedia key="media" />
322         </Enumerate>
323         <Enumerate 
324             key="media" table="otherMedia" 
325             selection="exists (select * from content_x_media where media_id=other_media.id and content_id=${article.id})"
326
327             order="id desc">
328             
329            <GenerateMedia key="media" />
330         </Enumerate>
331
332         <If condition="article.is_published == '1'">
333           <then>
334             <Language>
335               <Generate 
336                 generator="/article.template" 
337                 destination="${config.storageRoot}/${pathprefix}/static/${article.edittitle}.shtml"/>
338              </Language>
339              <Generate 
340                 generator="/languagebar.template" 
341                 destination="${config.storageRoot}/languagebar/${article.to_original.date.formatted.yyyy}/${article.to_original.date.formatted.MM}/${article.to_original.id}.shtml"/>   
342              <IndexContent key="article" pathToIndex="${config['IndexPath']}"/>
343           </then>
344           <else>
345             <UnIndexContent key="article" pathToIndex="${config['IndexPath']}"/>
346           </else>
347         </If>
348         <MarkContent key="article"/>            
349       </Enumerate>
350     </body>
351   </producer>
352
353   <producer name="navigation">
354     <verbs>
355       <verb name="generate" default="1" description="generates the left column"/>
356     </verbs>
357     <body>
358       <Language>
359         <Generate 
360             generator="/navigation.template" 
361             destination="${config.storageRoot}/${pathprefix}/navigation.inc"/>
362       </Language>
363     </body>
364   </producer>
365   
366   <producer name="staticimages">
367     <verbs>
368       <verb name="generate" default="1" description="copies all the static image files into place"/>
369     </verbs>
370     <body>
371       <CopyDir destination="img" source="etc/producer/images"/>
372     </body>
373   </producer>
374   
375   <producer name="newswirearchive">
376     <verbs>
377       <verb name="new">
378         <Set key="pages" value="3"/>
379       </verb>
380       <verb name="all">
381         <Set key="pages" value="-1"/>
382       </verb>
383     </verbs>
384     <body>
385         <Define key="docSuffix" value=".shtml"/>
386         <Define key="storageSuffix" value=".shtml"/>
387
388         <Batch key="articles" infokey="batch" table="content"
389                process="pages" batchsize="20" minbatchsize="10"
390                selection="is_published='1' and to_article_type = ${articletype.newswire}"
391                order="webdb_create asc">
392           <batches>
393             <Language>
394               <Define key="pagePrefix" value="${pathprefix}/newswire/archive"/>
395               <Define key="storagePrefix" value="${config[&quot;Producer.StorageRoot&quot;]}/${pagePrefix}"/>
396               <Define key="docPrefix" value="${config[&quot;Producer.DocRoot&quot;]}/${pagePrefix}"/>
397
398               <Generate
399                   generator="newswirearchive.template"
400                   destination="${storagePrefix}${batch.current.identifier}${storageSuffix}"/>
401
402             </Language>
403           </batches>
404           <batchlist>
405             <Language>
406               <Define key="pagePrefix" value="${pathprefix}/newswire/archive"/>
407               <Define key="storagePrefix" value="${config[&quot;Producer.StorageRoot&quot;]}/${pagePrefix}"/>
408               <Define key="docPrefix" value="${config[&quot;Producer.DocRoot&quot;]}/${pagePrefix}"/>
409               <Generate
410                   generator="batchnav.template"
411                   destination="${storagePrefix}nav${storageSuffix}"/>
412             </Language>
413           </batchlist>
414         </Batch>
415     </body>
416   </producer>
417
418   <producer name="featurearchive">
419     <verbs>
420       <verb name="new">
421         <Set key="pages" value="3"/>
422       </verb>
423       <verb name="all">
424         <Set key="pages" value="-1"/>
425       </verb> 
426     </verbs>
427     <body>
428         <Define key="docSuffix" value=".shtml"/>
429         <Define key="storageSuffix" value=".shtml"/>
430         
431         <Batch key="articles" infokey="batch" table="content" 
432                process="pages" batchsize="20" minbatchsize="10"
433                selection="is_published='1' and to_article_type in (${articletype.feature}, ${articletype.startspecial})"
434                order="webdb_create asc">
435           <batches>
436             <Language>
437               <Define key="pagePrefix" value="${pathprefix}/feature/archive"/>
438               <Define key="storagePrefix" value="${config[&quot;Producer.StorageRoot&quot;]}/${pagePrefix}"/>
439               <Define key="docPrefix" value="${config[&quot;Producer.DocRoot&quot;]}/${pagePrefix}"/>
440
441               <Generate 
442                   generator="featurearchive.template" 
443                   destination="${storagePrefix}${batch.current.identifier}${storageSuffix}"/>
444
445             </Language>
446           </batches>
447           <batchlist>
448             <Language>
449               <Define key="pagePrefix" value="${pathprefix}/feature/archive"/>
450               <Define key="storagePrefix" value="${config[&quot;Producer.StorageRoot&quot;]}/${pagePrefix}"/>
451               <Define key="docPrefix" value="${config[&quot;Producer.DocRoot&quot;]}/${pagePrefix}"/>
452               <Generate 
453                   generator="batchnav.template" 
454                   destination="${storagePrefix}nav${storageSuffix}"/>
455             </Language>
456           </batchlist>
457         </Batch>
458     </body>
459   </producer>
460
461   <producer name="topicpages">
462     <verbs>
463       <verb name="new">
464         <Set key="_topics" value="-1"/>
465         <Set key="pages" value="3"/>
466       </verb>
467       <verb name="all">
468         <Set key="_topics" value="-1"/>
469         <Set key="pages" value="-1"/>
470       </verb> 
471       <verb name="sample">
472         <Set key="_topics" value="2"/>
473         <Set key="pages" value="4"/>
474       </verb> 
475     </verbs>
476     <body>
477       <Enumerate key="topic" table="topic">
478         <Define key="docSuffix" value=".html"/>
479         <Define key="storageSuffix" value=".html"/>
480         
481         <Log message="topic = ${topic.title}" />
482         <List key="special" table="content c" 
483           selection="c.is_published='1' and c.to_article_type = ${articletype.topicspecial} and c.id=cxt.content_id and cxt.topic_id = ${topic.id}"
484           order = "webdb_create desc" limit="1"
485           extratables="content_x_topic cxt"/>
486       
487         <Batch key="articles" infokey="batch" table="content c" 
488                process="pages" batchsize="20" minbatchsize="10"
489                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}"
490                order="webdb_create asc" extratables="content_x_topic cxt">
491           <batches>
492             <Language>
493               <Define key="pagePrefix" value="${pathprefix}/${topic.filename}/archive"/>
494               <Define key="storagePrefix" value="${config[&quot;Producer.StorageRoot&quot;]}/${pagePrefix}"/>
495               <Define key="docPrefix" value="${config[&quot;Producer.DocRoot&quot;]}/${pagePrefix}"/>
496                   <Log message="topic now = ${topic.title}" />
497
498               <Generate 
499                   generator="topicpage.template" 
500                   destination="${storagePrefix}${batch.current.identifier}${storageSuffix}"/>
501
502             </Language>
503           </batches>
504           <batchlist>
505             <Language>
506               <Define key="pagePrefix" value="${pathprefix}/${topic.filename}/archive"/>
507               <Define key="storagePrefix" value="${config[&quot;Producer.StorageRoot&quot;]}/${pagePrefix}"/>
508               <Define key="docPrefix" value="${config[&quot;Producer.DocRoot&quot;]}/${pagePrefix}"/>
509               <Generate 
510                   generator="batchnav.template" 
511                   destination="${storagePrefix}nav${storageSuffix}"/>
512             </Language>
513           </batchlist>
514         </Batch>
515       </Enumerate>
516     </body>
517   </producer>
518
519
520   <producer name="opnewswireinclude">
521     <verbs>
522       <verb name="generate" default="1" description="Generates the op newswire"/>
523     </verbs>
524 <body>
525 <Set key="whichnewswire" value="Open Publishing News" />
526       <List key="newswire" table="content" limit="20"
527         selection="is_published=true and to_article_type=${articletype.newswire}"
528         order="webdb_create desc"/>
529       <Language>
530         <Generate 
531             generator="/newswireinclude.template" 
532             destination="${config.storageRoot}/${pathprefix}/newswireinclude.shtml"/>
533       </Language>
534
535
536 </body>
537 </producer>
538
539   <producer name="rssnewswireinclude">
540     <verbs>
541       <verb name="generate" default="1" description="Generates the rss newswire"/>
542     </verbs>
543 <body>
544 <Set key="whichnewswire" value="RSS Publishing News" />
545       <List key="newswire" table="content" limit="20"
546         selection="is_published=true and to_article_type=${articletype.communityrssarticle}"
547         order="webdb_create desc"/>
548       <Language>
549         <Generate 
550             generator="/newswireinclude.template" 
551             destination="${config.storageRoot}/${pathprefix}/rssnewswireinclude.shtml"/>
552       </Language>
553
554
555 </body>
556 </producer>
557
558
559   
560   <producer name="startpage">
561     <verbs>
562       <verb name="generate" default="1" description="Generates the startpage"/>
563     </verbs>
564
565     <body>
566       <List key="startspecial" table="content" limit="1"
567         selection="is_published=true and to_article_type=${articletype.startspecial}"
568         order="webdb_create desc"/>
569                                         
570       <List key="features" table="content" limit="5" 
571         selection="is_published=true and to_article_type in (${articletype.feature},${articletype.promotedcommunityarticle},${articletype.promotednewswire})"
572         order="webdb_create desc"/>
573
574       <List key="communityrssarticles" table="content" limit="10" 
575         selection="is_published=true and to_article_type in (${articletype.communityrssarticle},${articletype.promotedcommunityarticle})"
576         order="webdb_create desc"/>
577
578       <List key="newswire" table="content" limit="20"
579         selection="is_published=true and to_article_type=${articletype.newswire}"
580         order="webdb_create desc"/>
581         
582       <List key="mostcomments"
583                   table="content c"
584                   extratables="comment cm"
585                   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,
586                                          c.subtitle,c.edittitle,c.date,c.creator,c.creator_main_url,c.creator_email,c.creator_address,c.creator_phone,c.description,
587                                          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,
588                                          c.content_data,c.is_html,c.to_article_type,c.to_content,c.keywords,c.to_locking_user"
589                           order="count(cm.id) desc"
590                           limit="3"
591                     />    
592                 
593         
594       <List key="breakingnews" table="breakingNews" limit="10"
595          order="webdb_create desc"/>
596         
597       <Language>
598         <Generate 
599             generator="/startpage.template" 
600             destination="${config.storageRoot}/${pathprefix}/index.html"/>
601       </Language>
602     </body>
603   </producer>  
604   
605   <producer name="synchronization">
606     <verbs>
607       <verb name="run" default="1" description="Synchronizes the publication site with the production site"/>
608     </verbs>
609
610     <body>
611       <If condition="config['Rsync'] in ('1', 'y', 'yes', 'Y')">
612         <then>
613           <Execute command="${config['Rsync.Script.Path']}"/>
614         </then>
615       </If>
616     </body>
617   </producer>  
618   
619   
620   <producer name="media">
621     <verbs>
622       <verb name="new" default="1">
623         <Define key="verbcondition" value="(not is_produced)"/>
624         <Set key="limit" value="10"/>
625       </verb>
626       <verb name="all">
627         <Define key="verbcondition" value=""/>
628         <Set key="limit" value="-1"/>
629       </verb>
630
631       <verb name="sample">
632         <Define key="verbcondition" value=""/>
633         <Set key="limit" value="10"/>
634       </verb>
635     </verbs>
636     <body>
637       <Enumerate 
638           key="media" table="image" 
639           selection="${verbcondition}"
640           limit="limit" 
641           order="webdb_create desc">
642           
643          <GenerateMedia key="media" />
644       </Enumerate>
645       <Enumerate 
646           key="media" table="video" 
647           selection="${verbcondition}"
648           limit="limit" 
649           order="webdb_create desc">
650           
651          <GenerateMedia key="media" />
652       </Enumerate>
653       <Enumerate 
654           key="media" table="audio" 
655           selection="${verbcondition}"
656           limit="limit" 
657           order="webdb_create desc">
658           
659          <GenerateMedia key="media" />
660       </Enumerate>
661       <Enumerate 
662           key="media" table="otherMedia" 
663           selection="${verbcondition}"
664           limit="limit" 
665           order="webdb_create desc">
666           
667          <GenerateMedia key="media" />
668       </Enumerate>
669     </body>
670   </producer>  
671
672   <producer name="syndication">
673     <verbs>
674       <verb name="generate" />
675     </verbs>
676     <body>
677       <!-- the main features and newswire -->
678       <RSSChannelBundle />
679       
680       <!-- the topic features and newswires -->
681       <Enumerate key="topic" table="topic">
682         <RSSChannelBundle
683           basefilename="${topic.filename}"
684           selection="c.id=cxt.content_id and cxt.topic_id = ${topic.id}"
685           extratables="content_x_topic cxt"
686         />
687       </Enumerate>
688       
689       
690
691     </body>
692
693   </producer>
694
695   <producer name="radicalendar">
696     <verbs>
697       <verb name="pull" />
698     </verbs>
699     <body>
700       <!-- groupname you will see as the value of "group" in the url for your radicalendar page, -->
701       <!--      gmtoffset is in minutes                                                          -->
702       <Radicalendar key="calendar" groupname="_imc" gmtoffset="60"  />
703       <Generate 
704         generator="/radicalendar.template" 
705         destination="${config.storageRoot}/calendarinclude.shtml"/>
706
707
708     </body>
709   </producer>
710
711
712   <producer name="update">
713     <verbs>
714       <verb name="templates" description="updates templates and bundles">
715         <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/"/>
716       </verb>
717     </verbs>
718
719     <body>
720       <Execute command="${command}"/>
721     </body>
722   </producer>
723
724
725
726
727
728  <producer name="generatefpincludes">
729    <verbs>
730      <verb name="doit" />
731    </verbs>
732    <body>
733
734         <Set key="counter" value="1"/>
735       <Enumerate key="fpimage" table="image" selection="to_media_folder=8 and is_published=true" >
736         <Log message="generating include for image id: ${fpimage.id}" type="info" />
737
738           <Generate
739                 generator="/fpinclude.template"
740                 destination="${config.storageRoot}/fpincludes/${fpimage.id}.inc" />
741        <Set key="counter" value="counter+1" />
742       </Enumerate>
743
744
745            <List key="fpincludes" table="image" selection="to_media_folder=8 and is_published=true" />
746                 <Generate
747                         generator="/fpmapping.template"
748                         destination="${config.storageRoot}/fpincludes/map.txt" />
749
750     </body>
751   </producer>
752
753
754
755
756  <!-- generates a count for each topic -->
757  
758  <!-- TODO: add date limit when we actually are going live with this -->        
759  <producer name="generateTopicCounts"> 
760  <verbs>
761         <verb name="doit" />
762  </verbs>
763  <body>
764         <FreeQuery key="topicCounts" query=" SELECT count(x.content_id) as count, t.title FROM topic as t LEFT OUTER JOIN content_x_topic 
765                                                                                  as x ON (t.id=x.topic_id) LEFT OUTER JOIN content as c ON (c.id=x.content_id) 
766                                                                                  WHERE t.archiv_url = 'Category' GROUP BY t.title ORDER BY length(t.title)"
767                    type="set"/>
768                    
769         <Generate generator="/topiccount.template"
770                 destination="${config.storageRoot}/${pathprefix}/topiccount.shtml" />
771   </body>
772   </producer>
773                 
774
775
776  <producer name="generateRandomTopics">
777   <verbs>
778     <verb name="doit" />
779   </verbs>
780   <body>
781         <Set key="counter" value="1"/>
782         
783         <Enumerate key="category" table="topic t" extratables="topic t2"
784                 selection="t.id=t2.id AND t.archiv_url = 'Category' AND (SELECT count(*) from content_x_topic where topic_id = t.id) > 0" order="RANDOM()" limit="20">
785         
786         <Log message="Getting Last 5 articles for category: ${category.title} - counter: ${counter}" />
787         <Define key="topictitle" value="${category.title}" />
788         
789         
790         <List key="randomarticles" table="content"
791                 selection ="id in (select content_id from content_x_topic where topic_id = ${category.id})" order="date DESC"
792                 limit="1" />
793         <Language>      
794         <Generate
795                 generator="/randomcategory.template"
796                 destination="${config.storageRoot}/fpincludes/random${counter}.inc" />        
797         </Language>
798         
799         <Set key="counter" value="counter+1" />
800     </Enumerate>
801   </body>
802  </producer>
803                           
804  <producer name="getlocalblogs">
805    <verbs>
806      <verb name="doit" />
807    </verbs>
808    <body>
809       <Enumerate key="article" table="content" selection="to_article_type in(${articletype.communityrssfeed}) and is_published=true"  order="webdb_create desc">
810         <Log message="Pulling 1.0 feed from ${article.title} at ${article.source}" type="info" />
811         <Pull
812           url="${article.source}"
813           articletype="${articletype.communityrssarticle}"
814           blogurl="${article.creator_main_url}"
815           blogname="${article.title}"
816         />
817       </Enumerate>
818     </body>
819   </producer>
820
821
822   
823 </producers>
824
825