moving all configurable stuff to etc/
[mir.git] / etc / 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     - articles
9 -->  
10
11 <producers>
12   <nodedefinition name="Language">
13     <parameters>
14       <string name="languagecondition" defaultvalue=""/>
15       <string name="bundle" defaultvalue="bundles.producer" />
16       <node name="sub"/>    
17     </parameters>
18
19     <definition>
20       <List key="languages" table="language" selection="${languagecondition}" order="code"/>
21       <Enumerate key="language" table="language" selection="${languagecondition}" order="code">
22         <Resource bundle="${bundle}" key="lang" language="${language.code}"/>
23         <Define key="pathprefix" value="${language.code}" />
24         <sub/>
25       </Enumerate>
26     </definition>
27   </nodedefinition>
28  
29   <producer name="articles">
30     <verbs>
31       <verb name="changed" default="1">
32         <Define key="verbcondition" value=" and (not is_produced)"/>
33         <Set key="limit" value="10"/>
34       </verb>
35       <verb name="all">
36         <Define key="verbcondition" value=""/>
37         <Set key="limit" value="-1"/>
38       </verb>
39
40       <verb name="sample">
41         <Define key="verbcondition" value=""/>
42         <Set key="limit" value="10"/>
43       </verb>
44     </verbs>
45     <body>
46       <Enumerate key="article" table="content" selection="is_published='t' ${verbcondition}"
47                   limit="limit" order="webdb_create desc, date desc">
48         <Language>
49           <Generate 
50               generator="/article.template" 
51               destination="${config.storageRoot}/${pathprefix}/${article.date.formatted.yyyy}/${article.date.formatted.MM}/${article.id}.shtml"/>
52         </Language>
53
54         <MarkContent key="article"/>            
55
56     <!-- uncomment the following if you want to make a pdf version of each article  -->
57     <!-- also, you could move it up into the language tag and adjust the paths accordingly
58          to make pdfs in each language -->
59     <!-- PDFPreFormat splits up the text and mixes images in with it -->
60     <!--<PDFPreFormat key="article.content" numLinesBetweenImages="3" charWidthCM="0.19" pixelWidthCM="0.035" contentAreaWidthCM="16" lineHeightCM="0.5" />-->
61     <!-- Regular Generate Tag is used to produce an fo file(but using the split-up content -->
62     <!--<Generate generator="/printablecontent.template" destination="${config.storageRoot}/${article.content.date.formatted.yyyy}/${article.content.date.formatted.MM}/${article.content.id}.fo"/>-->
63     <!-- Finally, PDFGenerate turns the fo file into a pdf.  You could leave this step out 
64     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-->
65     <!--<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" />-->
66
67
68       </Enumerate>
69     </body>
70   </producer>  
71
72   <producer name="stylesheet">
73     <verbs>
74       <verb name="generate" default="1" description="generates the style sheet"/>
75     </verbs>
76     <body>
77       <Language>
78         <Generate 
79             generator="/stylesheet.template" 
80             destination="${config.storageRoot}/${pathprefix}/style.css"/>
81       </Language>
82     </body>
83   </producer>
84
85   <producer name="navigation">
86     <verbs>
87       <verb name="generate" default="1" description="generates the left column"/>
88     </verbs>
89     <body>
90       <Language>
91         <Generate 
92             generator="/navigation.template" 
93             destination="${config.storageRoot}/${pathprefix}/navigation.inc"/>
94       </Language>
95     </body>
96   </producer>
97   
98   <producer name="topicpages">
99     <verbs>
100       <verb name="new">
101         <Set key="pages" value="3"/>
102       </verb>
103       <verb name="all">
104         <Set key="pages" value="-1"/>
105       </verb> 
106     </verbs>
107     <body>
108       <Enumerate key="topic" table="topic">
109         <List key="special" table="content" 
110           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})"
111           order = "webdb_create desc, date desc" limit="1"/>
112       
113         <Batch key="articles" infokey="batch" table="content" 
114                process="pages" batchsize="20" minbatchsize="10"
115                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})"
116                order="webdb_create asc">
117           <batches>
118             <Set key="filename" value="topic.filename ++ batch.current.identifier"/>
119             <Language>
120               <Generate 
121                   generator="/topicpage.template" 
122                   destination="${config.storageRoot}/${pathprefix}/${topic.filename}/${filename}.shtml"/>
123             </Language>
124           </batches>
125           <batchlist>
126           </batchlist>
127         </Batch>
128       </Enumerate>
129     </body>
130   </producer>
131   
132   <producer name="newswirearchive">
133     <verbs>
134       <verb name="new">
135         <Set key="pages" value="3"/>
136       </verb>
137       <verb name="all">
138         <Set key="pages" value="-1"/>
139       </verb> 
140     </verbs>
141     <body> 
142         <Batch key="articles" infokey="batch" table="content" 
143                process="pages" batchsize="20" minbatchsize="10"
144                selection="is_published='1' and to_article_type in (${articletype.newswire})"
145                order="webdb_create asc">
146           <batches>
147             <Set key="filename" value="archive ++ batch.current.identifier"/>
148             <Language>
149               <Generate 
150                   generator="/archive.template" 
151                   destination="${config.storageRoot}/${pathprefix}/archive/${filename}.shtml"/>
152             </Language>
153           </batches>
154           <batchlist>
155           </batchlist>
156         </Batch>
157     </body>
158   </producer>
159
160   <producer name="startpage">
161     <verbs>
162       <verb name="generate" default="1" description="Generates the startpage"/>
163     </verbs>
164
165     <body>
166       <List key="startspecial" table="content" limit="1"
167         selection="is_published=true and to_article_type=${articletype.startspecial}"
168         order="webdb_create desc, date desc"/>
169                                         
170       <List key="features" table="content" limit="10" 
171         selection="is_published=true and to_article_type=${articletype.feature}"
172         order="webdb_create desc, date desc"/>
173
174       <List key="newswire" table="content" limit="30"
175         selection="is_published=true and to_article_type=${articletype.newswire}"
176         order="webdb_create desc, date desc"/>
177         
178       <Language>
179         <Generate 
180             generator="/startpage.template" 
181             destination="${config.storageRoot}/${pathprefix}/index.shtml"/>
182       </Language>
183     </body>
184   </producer>  
185   
186 </producers>
187
188