i guess topic page generation was already in there. whoops!
[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         <Enumerate 
250             key="media" table="otherMedia" 
251             selection="exists (select * from content_x_media where media_id=other_media.id and content_id=${article.id})
252                or      exists (select * from comment_x_media, comment
253                                        where comment_id = comment.id and media_id=other_media.id and comment.to_media=${article.id})"
254             order="id desc">
255             
256            <GenerateMedia key="media" />
257         </Enumerate>
258
259         <If condition="article.is_published == '1'">
260           <then>
261             <Language>
262               <Generate 
263                 generator="/article.template" 
264                 destination="${config.storageRoot}/${pathprefix}/${article.date.formatted.yyyy}/${article.date.formatted.MM}/${article.id}.shtml"/>
265              </Language>
266              <Generate 
267                 generator="/languagebar.template" 
268                 destination="${config.storageRoot}/languagebar/${article.to_original.date.formatted.yyyy}/${article.to_original.date.formatted.MM}/${article.to_original.id}.shtml"/>   
269              <IndexContent key="article" pathToIndex="${config['IndexPath']}"/>
270           </then>
271           <else>
272             <UnIndexContent key="article" pathToIndex="${config['IndexPath']}"/>
273           </else>
274         </If>
275         <MarkContent key="article"/>            
276       </Enumerate>
277     </body>
278   </producer>  
279
280   <producer name="staticpages">
281     <verbs>
282       <verb name="changed" default="1">
283         <Define key="verbcondition" value="(not is_produced)"/>
284         <Set key="limit" value="10"/>
285       </verb>
286       <verb name="all">
287         <Define key="verbcondition" value=""/>
288         <Set key="limit" value="-1"/>
289       </verb>
290     </verbs>
291
292     <body>
293       <Enumerate key="article" table="content" selection="${verbcondition}  and to_article_type = ${articletype.static}"
294                   limit="limit" order="webdb_create desc">
295         <Enumerate 
296             key="media" table="image" 
297             selection="exists (select * from content_x_media where media_id=images.id and content_id=${article.id})"
298             order="id desc">
299             
300            <GenerateMedia key="media" />
301         </Enumerate>
302         <Enumerate 
303             key="media" table="video" 
304             selection="exists (select * from content_x_media where media_id=video.id and content_id=${article.id})"
305             order="id desc">
306
307            <GenerateMedia key="media" />
308         </Enumerate>
309         <Enumerate 
310             key="media" table="audio" 
311             selection="exists (select * from content_x_media where media_id=audio.id and content_id=${article.id})"
312             order="id desc">
313             
314            <GenerateMedia key="media" />
315         </Enumerate>
316         <Enumerate 
317             key="media" table="otherMedia" 
318             selection="exists (select * from content_x_media where media_id=other_media.id and content_id=${article.id})"
319
320             order="id desc">
321             
322            <GenerateMedia key="media" />
323         </Enumerate>
324
325         <If condition="article.is_published == '1'">
326           <then>
327             <Language>
328               <Generate 
329                 generator="/article.template" 
330                 destination="${config.storageRoot}/${pathprefix}/static/${article.edittitle}.shtml"/>
331              </Language>
332              <Generate 
333                 generator="/languagebar.template" 
334                 destination="${config.storageRoot}/languagebar/${article.to_original.date.formatted.yyyy}/${article.to_original.date.formatted.MM}/${article.to_original.id}.shtml"/>   
335              <IndexContent key="article" pathToIndex="${config['IndexPath']}"/>
336           </then>
337           <else>
338             <UnIndexContent key="article" pathToIndex="${config['IndexPath']}"/>
339           </else>
340         </If>
341         <MarkContent key="article"/>            
342       </Enumerate>
343     </body>
344   </producer>
345
346   <producer name="navigation">
347     <verbs>
348       <verb name="generate" default="1" description="generates the left column"/>
349     </verbs>
350     <body>
351       <Language>
352         <Generate 
353             generator="/navigation.template" 
354             destination="${config.storageRoot}/${pathprefix}/navigation.inc"/>
355       </Language>
356     </body>
357   </producer>
358   
359   <producer name="staticimages">
360     <verbs>
361       <verb name="generate" default="1" description="copies all the static image files into place"/>
362     </verbs>
363     <body>
364       <CopyDir destination="img" source="etc/producer/images"/>
365     </body>
366   </producer>
367   
368   <producer name="newswirearchive">
369     <verbs>
370       <verb name="new">
371         <Set key="pages" value="3"/>
372       </verb>
373       <verb name="all">
374         <Set key="pages" value="-1"/>
375       </verb>
376     </verbs>
377     <body>
378         <Define key="docSuffix" value=".shtml"/>
379         <Define key="storageSuffix" value=".shtml"/>
380
381         <Batch key="articles" infokey="batch" table="content"
382                process="pages" batchsize="20" minbatchsize="10"
383                selection="is_published='1' and to_article_type = ${articletype.newswire}"
384                order="webdb_create asc">
385           <batches>
386             <Language>
387               <Define key="pagePrefix" value="${pathprefix}/newswire/archive"/>
388               <Define key="storagePrefix" value="${config[&quot;Producer.StorageRoot&quot;]}/${pagePrefix}"/>
389               <Define key="docPrefix" value="${config[&quot;Producer.DocRoot&quot;]}/${pagePrefix}"/>
390
391               <Generate
392                   generator="newswirearchive.template"
393                   destination="${storagePrefix}${batch.current.identifier}${storageSuffix}"/>
394
395             </Language>
396           </batches>
397           <batchlist>
398             <Language>
399               <Define key="pagePrefix" value="${pathprefix}/newswire/archive"/>
400               <Define key="storagePrefix" value="${config[&quot;Producer.StorageRoot&quot;]}/${pagePrefix}"/>
401               <Define key="docPrefix" value="${config[&quot;Producer.DocRoot&quot;]}/${pagePrefix}"/>
402               <Generate
403                   generator="batchnav.template"
404                   destination="${storagePrefix}nav${storageSuffix}"/>
405             </Language>
406           </batchlist>
407         </Batch>
408     </body>
409   </producer>
410
411   <producer name="featurearchive">
412     <verbs>
413       <verb name="new">
414         <Set key="pages" value="3"/>
415       </verb>
416       <verb name="all">
417         <Set key="pages" value="-1"/>
418       </verb> 
419     </verbs>
420     <body>
421         <Define key="docSuffix" value=".shtml"/>
422         <Define key="storageSuffix" value=".shtml"/>
423         
424         <Batch key="articles" infokey="batch" table="content" 
425                process="pages" batchsize="20" minbatchsize="10"
426                selection="is_published='1' and to_article_type in (${articletype.feature}, ${articletype.startspecial})"
427                order="webdb_create asc">
428           <batches>
429             <Language>
430               <Define key="pagePrefix" value="${pathprefix}/feature/archive"/>
431               <Define key="storagePrefix" value="${config[&quot;Producer.StorageRoot&quot;]}/${pagePrefix}"/>
432               <Define key="docPrefix" value="${config[&quot;Producer.DocRoot&quot;]}/${pagePrefix}"/>
433
434               <Generate 
435                   generator="featurearchive.template" 
436                   destination="${storagePrefix}${batch.current.identifier}${storageSuffix}"/>
437
438             </Language>
439           </batches>
440           <batchlist>
441             <Language>
442               <Define key="pagePrefix" value="${pathprefix}/feature/archive"/>
443               <Define key="storagePrefix" value="${config[&quot;Producer.StorageRoot&quot;]}/${pagePrefix}"/>
444               <Define key="docPrefix" value="${config[&quot;Producer.DocRoot&quot;]}/${pagePrefix}"/>
445               <Generate 
446                   generator="batchnav.template" 
447                   destination="${storagePrefix}nav${storageSuffix}"/>
448             </Language>
449           </batchlist>
450         </Batch>
451     </body>
452   </producer>
453
454   <producer name="topicpages">
455     <verbs>
456       <verb name="new">
457         <Set key="_topics" value="-1"/>
458         <Set key="pages" value="3"/>
459       </verb>
460       <verb name="all">
461         <Set key="_topics" value="-1"/>
462         <Set key="pages" value="-1"/>
463       </verb> 
464       <verb name="sample">
465         <Set key="_topics" value="2"/>
466         <Set key="pages" value="4"/>
467       </verb> 
468     </verbs>
469     <body>
470       <Enumerate key="topic" table="topic" limit="_topics">
471         <Define key="docSuffix" value=".shtml"/>
472         <Define key="storageSuffix" value=".shtml"/>
473         
474         <List key="special" table="content c" 
475           selection="c.is_published='1' and c.to_article_type = ${articletype.topicspecial} and c.id=cxt.content_id and cxt.topic_id = ${topic.id}"
476           order = "webdb_create desc" limit="1"
477           extratables="content_x_topic cxt"/>
478       
479         <Batch key="articles" infokey="batch" table="content c" 
480                process="pages" batchsize="20" minbatchsize="10"
481                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}"
482                order="webdb_create asc" extratables="content_x_topic cxt">
483           <batches>
484             <Language>
485               <Define key="pagePrefix" value="${pathprefix}/${topic.filename}/archive"/>
486               <Define key="storagePrefix" value="${config[&quot;Producer.StorageRoot&quot;]}/${pagePrefix}"/>
487               <Define key="docPrefix" value="${config[&quot;Producer.DocRoot&quot;]}/${pagePrefix}"/>
488
489               <Generate 
490                   generator="topicpage.template" 
491                   destination="${storagePrefix}${batch.current.identifier}${storageSuffix}"/>
492
493             </Language>
494           </batches>
495           <batchlist>
496             <Language>
497               <Define key="pagePrefix" value="${pathprefix}/${topic.filename}/archive"/>
498               <Define key="storagePrefix" value="${config[&quot;Producer.StorageRoot&quot;]}/${pagePrefix}"/>
499               <Define key="docPrefix" value="${config[&quot;Producer.DocRoot&quot;]}/${pagePrefix}"/>
500               <Generate 
501                   generator="batchnav.template" 
502                   destination="${storagePrefix}nav${storageSuffix}"/>
503             </Language>
504           </batchlist>
505         </Batch>
506       </Enumerate>
507     </body>
508   </producer>
509
510
511   <producer name="opnewswireinclude">
512     <verbs>
513       <verb name="generate" default="1" description="Generates the op newswire"/>
514     </verbs>
515 <body>
516 <Set key="whichnewswire" value="Open Publishing News" />
517       <List key="newswire" table="content" limit="30"
518         selection="is_published=true and to_article_type=${articletype.newswire}"
519         order="webdb_create desc"/>
520       <Language>
521         <Generate 
522             generator="/newswireinclude.template" 
523             destination="${config.storageRoot}/${pathprefix}/newswireinclude.shtml"/>
524       </Language>
525
526
527 </body>
528 </producer>
529
530   <producer name="rssnewswireinclude">
531     <verbs>
532       <verb name="generate" default="1" description="Generates the rss newswire"/>
533     </verbs>
534 <body>
535 <Set key="whichnewswire" value="RSS Publishing News" />
536       <List key="newswire" table="content" limit="30"
537         selection="is_published=true and to_article_type=${articletype.communityrssarticle}"
538         order="webdb_create desc"/>
539       <Language>
540         <Generate 
541             generator="/newswireinclude.template" 
542             destination="${config.storageRoot}/${pathprefix}/rssnewswireinclude.shtml"/>
543       </Language>
544
545
546 </body>
547 </producer>
548
549
550   
551   <producer name="startpage">
552     <verbs>
553       <verb name="generate" default="1" description="Generates the startpage"/>
554     </verbs>
555
556     <body>
557       <List key="startspecial" table="content" limit="2"
558         selection="is_published=true and to_article_type=${articletype.startspecial}"
559         order="webdb_create desc"/>
560                                         
561       <List key="features" table="content" limit="10" 
562         selection="is_published=true and to_article_type in (${articletype.feature},${articletype.promotedcommunityarticle},${articletype.promotednewswire})"
563         order="webdb_create desc"/>
564
565       <List key="communityrssarticles" table="content" limit="10" 
566         selection="is_published=true and to_article_type in (${articletype.communityrssarticle},${articletype.promotedcommunityarticle})"
567         order="webdb_create desc"/>
568
569       <List key="newswire" table="content" limit="30"
570         selection="is_published=true and to_article_type=${articletype.newswire}"
571         order="webdb_create desc"/>
572         
573       <List key="mostcomments"
574                   table="content c"
575                   extratables="comment cm"
576                   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,
577                                          c.subtitle,c.edittitle,c.date,c.creator,c.creator_main_url,c.creator_email,c.creator_address,c.creator_phone,c.description,
578                                          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,
579                                          c.content_data,c.is_html,c.to_article_type,c.to_content,c.keywords,c.to_locking_user"
580                           order="count(cm.id) desc"
581                           limit="5"
582                     />    
583                 
584         
585       <List key="breakingnews" table="breakingNews" limit="10"
586          order="webdb_create desc"/>
587         
588       <Language>
589         <Generate 
590             generator="/startpage.template" 
591             destination="${config.storageRoot}/${pathprefix}/index.html"/>
592       </Language>
593     </body>
594   </producer>  
595   
596   <producer name="synchronization">
597     <verbs>
598       <verb name="run" default="1" description="Synchronizes the publication site with the production site"/>
599     </verbs>
600
601     <body>
602       <If condition="config['Rsync'] in ('1', 'y', 'yes', 'Y')">
603         <then>
604           <Execute command="${config['Rsync.Script.Path']}"/>
605         </then>
606       </If>
607     </body>
608   </producer>  
609   
610   
611   <producer name="media">
612     <verbs>
613       <verb name="new" default="1">
614         <Define key="verbcondition" value="(not is_produced)"/>
615         <Set key="limit" value="10"/>
616       </verb>
617       <verb name="all">
618         <Define key="verbcondition" value=""/>
619         <Set key="limit" value="-1"/>
620       </verb>
621
622       <verb name="sample">
623         <Define key="verbcondition" value=""/>
624         <Set key="limit" value="10"/>
625       </verb>
626     </verbs>
627     <body>
628       <Enumerate 
629           key="media" table="image" 
630           selection="${verbcondition}"
631           limit="limit" 
632           order="webdb_create desc">
633           
634          <GenerateMedia key="media" />
635       </Enumerate>
636       <Enumerate 
637           key="media" table="video" 
638           selection="${verbcondition}"
639           limit="limit" 
640           order="webdb_create desc">
641           
642          <GenerateMedia key="media" />
643       </Enumerate>
644       <Enumerate 
645           key="media" table="audio" 
646           selection="${verbcondition}"
647           limit="limit" 
648           order="webdb_create desc">
649           
650          <GenerateMedia key="media" />
651       </Enumerate>
652       <Enumerate 
653           key="media" table="otherMedia" 
654           selection="${verbcondition}"
655           limit="limit" 
656           order="webdb_create desc">
657           
658          <GenerateMedia key="media" />
659       </Enumerate>
660     </body>
661   </producer>  
662
663   <producer name="syndication">
664     <verbs>
665       <verb name="generate" />
666     </verbs>
667     <body>
668       <!-- the main features and newswire -->
669       <RSSChannelBundle />
670       
671       <!-- the topic features and newswires -->
672       <Enumerate key="topic" table="topic">
673         <RSSChannelBundle
674           basefilename="${topic.filename}"
675           selection="c.id=cxt.content_id and cxt.topic_id = ${topic.id}"
676           extratables="content_x_topic cxt"
677         />
678       </Enumerate>
679       
680       
681
682     </body>
683
684   </producer>
685
686   <producer name="radicalendar">
687     <verbs>
688       <verb name="pull" />
689     </verbs>
690     <body>
691       <!-- groupname you will see as the value of "group" in the url for your radicalendar page, -->
692       <!--      gmtoffset is in minutes                                                          -->
693       <Radicalendar key="calendar" groupname="_imc" gmtoffset="60"  />
694       <Generate 
695         generator="/radicalendar.template" 
696         destination="${config.storageRoot}/calendarinclude.shtml"/>
697
698
699     </body>
700   </producer>
701
702
703   <producer name="update">
704     <verbs>
705       <verb name="templates" description="updates templates and bundles">
706         <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/"/>
707       </verb>
708     </verbs>
709
710     <body>
711       <Execute command="${command}"/>
712     </body>
713   </producer>
714
715
716
717
718
719  <producer name="generatefpincludes">
720    <verbs>
721      <verb name="doit" />
722    </verbs>
723    <body>
724
725
726       <Enumerate key="fpimage" table="image" selection="to_media_folder=8 and is_published=true" >
727         <Log message="generating include for image id: ${fpimage.id}" type="info" />
728
729           <Generate
730                 generator="/fpinclude.template"
731                 destination="${config.storageRoot}/fpincludes/${fpimage.id}.inc" />
732
733       </Enumerate>
734
735
736            <List key="fpincludes" table="image" selection="to_media_folder=8 and is_published=true" />
737                 <Generate
738                         generator="/fpmapping.template"
739                         destination="${config.storageRoot}/fpincludes/map.txt" />
740
741     </body>
742   </producer>
743
744
745
746
747  <!-- generates a count for each topic -->
748  
749  <!-- TODO: add date limit when we actually are going live with this -->        
750  <producer name="generateTopicCounts"> 
751  <verbs>
752         <verb name="doit" />
753  </verbs>
754  <body>
755         <FreeQuery key="topicCounts" query=" SELECT count(c.id) AS count, t.title AS title from content c, topic t, content_x_topic x
756                                              WHERE c.id = x.content_id AND t.id = x.topic_id GROUP BY t.title ORDER BY length(t.title)"
757                    type="set"/>
758                    
759         <Generate generator="/topiccount.template"
760                 destination="${config.storageRoot}/${pathprefix}/topiccount.shtml" />
761   </body>
762   </producer>
763                 
764
765
766  <producer name="generateRandomTopics">
767   <verbs>
768     <verb name="doit" />
769   </verbs>
770   <body>
771         <Set key="counter" value="1"/>
772         
773         <Enumerate key="category" table="topic t" extratables="topic t2"
774                 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="4">
775         
776         <Log message="Getting Last 5 articles for category: ${category.title} - counter: ${counter}" />
777         <Define key="topictitle" value="${category.title}" />
778         
779         
780         <List key="randomarticles" table="content"
781                 selection ="id in (select content_id from content_x_topic where topic_id = ${category.id})" order="date DESC"
782                 limit="5" />
783                 
784         <Generate
785                 generator="/randomcategory.template"
786                 destination="${config.storageRoot}/fpincludes/random${counter}.inc" />        
787       
788         
789         <Set key="counter" value="counter+1" />
790     </Enumerate>
791   </body>
792  </producer>
793                           
794  <producer name="getlocalblogs">
795    <verbs>
796      <verb name="doit" />
797    </verbs>
798    <body>
799       <Enumerate key="article" table="content" selection="to_article_type in(${articletype.communityrssfeed}) and is_published=true"  order="webdb_create desc">
800         <Log message="Pulling 1.0 feed from ${article.title} at ${article.source}" type="info" />
801         <Pull
802           url="${article.source}"
803           articletype="${articletype.communityrssarticle}"
804           blogurl="${article.creator_main_url}"
805           blogname="${article.title}"
806         />
807       </Enumerate>
808     </body>
809   </producer>
810
811
812   
813 </producers>
814
815