869db63363fe950e044fec73c39e9d48e5fcc10a
[mir.git] / templates-dist / producer / producers.xml
1 <producers>
2   <nodedefinition name="Language">
3     <parameters>
4       <string name="languagecondition" defaultvalue=""/>
5       <string name="bundle" defaultvalue="bundles.producer" />
6       <node name="sub"/>    
7     </parameters>
8
9     <definition>
10       <Enumerate key="language" table="language" selection="${languagecondition}" order="code">
11         <Resource bundle="${bundle}" key="lang" language="${language.code}"/>
12         <Define key="pathprefix" value="${language.code}" />
13         <sub/>
14       </Enumerate>
15     </definition>
16   </nodedefinition>
17  
18   <producer name="articles">
19     <verbs>
20       <verb name="changed" default="1">
21         <Set key="verbcondition" value="' and (not is_produced)'"/>
22         <Set key="limit" value="10"/>
23       </verb>
24       <verb name="all">
25         <Set key="verbcondition" value="''"/>
26         <Set key="limit" value="-1"/>
27       </verb>
28     </verbs>
29     <body>
30       <Enumerate key="article" table="content" selection="is_published='t' ${verbcondition}"
31                   limit="limit" order="webdb_create desc, date desc">
32         <Language>
33           <Generate 
34               generator="/producer/article.template" 
35               destination="${config.storageRoot}/$pathprefix/${data.content.date.formatted.yyyy}/${data.content.date.formatted.MM}/${data.content.id}.shtml"/>
36         </Language>
37
38         <MarkContent key="data.content"/>               
39     <!-- uncomment the following if you want to make a pdf version of each article  -->
40     <!-- also, you could move it up into the language tag and adjust the paths accordingly
41          to make pdfs in each language -->
42     <!-- PDFPreFormat splits up the text and mixes images in with it -->
43     <!--<PDFPreFormat key="article.content" numLinesBetweenImages="3" charWidthCM="0.19" pixelWidthCM="0.035" contentAreaWidthCM="16" lineHeightCM="0.5" />-->
44     <!-- Regular Generate Tag is used to produce an fo file(but using the split-up content -->
45     <!--<Generate generator="/producer/printablecontent.template" destination="${config.storageRoot}/${article.content.date.formatted.yyyy}/${article.content.date.formatted.MM}/${article.content.id}.fo"/>-->
46     <!-- Finally, PDFGenerate turns the fo file into a pdf.  You could leave this step out 
47     and generate pdfs on the fly using the getpdf OpenMir module as well.  Make sure to fill in the real path on the stylesheet attribute-->
48     <!--<PDFGenerate generator="${config.storageRoot}/${article.content.date.formatted.yyyy}/${article.content.date.formatted.MM}/${article.content.id}.fo" destination="${config.storageRoot}/${article.content.date.formatted.yyyy}/${article.content.date.formatted.MM}/${article.content.id}.pdf" stylesheet="/real/path/goes/here/templates/producer/html2fo.xsl" />-->
49       </Enumerate>
50     </body>
51   </producer>  
52
53   <producer name="navigation">
54     <verbs>
55       <verb name="generate" default="1"/>
56     </verbs>
57     <body>
58       <Language>
59         <Generate 
60             generator="/producer/navigation.template" 
61             destination="${config.storageRoot}/${pathprefix}/navigation.inc"/>
62       </Language>
63     </body>
64   </producer>
65   
66   <producer name="topicpages">
67     <verbs>
68       <verb name="new">
69         <Set key="pages" value="3"/>
70       </verb>
71       <verb name="all">
72         <Set key="pages" value="-1"/>
73       </verb> 
74     </verbs>
75     <body>
76       <Enumerate key="topic" table="topic">
77         <List key="special" table="content" 
78           selection="is_published='1' and to_article_type = ${articletype.topicspecial} and id in (select content_id from content_x_topic where topic_id = ${topic.id})"
79           order = "webdb_create desc, date desc" limit="1"/>
80       
81         <Batch key="articles" infokey="batch" table="content" 
82                process="pages" batchsize="20" minbatchsize="10"
83                selection="is_published='1' and to_article_type in (${articletype.newswire}, ${articletype.feature}) and id in (select content_id from content_x_topic where topic_id = ${topic.id})"
84                order="webdb_create asc">
85           <batches>
86             <Language>
87               <Set key="filename" value="topic.filename ++ batch.current.identifier"/>
88               <Generate 
89                   generator="/producer/topicpage.template" 
90                   destination="${config.storageRoot}/${pathprefix}/${topic.filename}/${filename}.shtml"/>
91             </Language>
92           </batches>
93           <batchlist>
94           </batchlist>
95         </Batch>
96       </Enumerate>
97     </body>
98   </producer>
99   
100   <producer name="archive">
101     <verbs>
102       <verb name="new">
103         <Set key="pages" value="3"/>
104       </verb>
105       <verb name="all">
106         <Set key="pages" value="-1"/>
107       </verb> 
108     </verbs>
109     <body> 
110         <Batch key="articles" infokey="batch" table="content" 
111                process="pages" batchsize="20" minbatchsize="10"
112                selection="is_published='1' and to_article_type in (${articletype.newswire}, ${articletype.feature})"
113                order="webdb_create asc">
114           <batches>
115             <Language>
116               <Set key="filename" value="archive ++ batch.current.identifier"/>
117               <Generate 
118                   generator="/producer/archive.template" 
119                   destination="${config.storageRoot}/${pathprefix}/archive/${filename}.shtml"/>
120             </Language>
121           </batches>
122           <batchlist>
123           </batchlist>
124         </Batch>
125     </body>
126   </producer>
127
128   <producer name="startpage">
129     <verbs>
130       <verb name="generate" default="1" description="Generates the startpage"/>
131     </verbs>
132
133     <body>
134       <List key="startspecial" table="content" limit="1"
135         selection="is_published=true and to_article_type=${articletype.startspecial}"
136         order="webdb_create desc, date desc"/>
137                                         
138       <List key="features" table="content" limit="10" 
139         selection="is_published=true and to_article_type=${articletype.feature}"
140         order="webdb_create desc, date desc"/>
141
142       <List key="newswire" table="content" limit="30"
143         selection="is_published=true and to_article_type=${articletype.newswire}"
144         order="webdb_create desc, date desc"/>
145         
146       <Language>
147         <Generate 
148             generator="/producer/startpage.template" 
149             destination="${config.storageRoot}/${pathprefix}/index.shtml"/>
150       </Language>
151     </body>
152   </producer>  
153   
154 </producers>
155
156