preparing for a new logging framework
[mir.git] / templates-dist / producer / producers.xml
index 869db63..40cbb5f 100755 (executable)
@@ -1,3 +1,13 @@
+<!-- 
+  This XML file defines a set of producers intended for a typical indymedia 
+  site:
+    - a start page
+    - a navigational bar
+    - topic pages
+    - a newswire archive
+    - articles
+-->  
+
 <producers>
   <nodedefinition name="Language">
     <parameters>
@@ -7,6 +17,7 @@
     </parameters>
 
     <definition>
+      <List key="languages" table="language" selection="${languagecondition}" order="code"/>
       <Enumerate key="language" table="language" selection="${languagecondition}" order="code">
         <Resource bundle="${bundle}" key="lang" language="${language.code}"/>
         <Define key="pathprefix" value="${language.code}" />
   <producer name="articles">
     <verbs>
       <verb name="changed" default="1">
-        <Set key="verbcondition" value="' and (not is_produced)'"/>
+        <Define key="verbcondition" value=" and (not is_produced)"/>
         <Set key="limit" value="10"/>
       </verb>
       <verb name="all">
-        <Set key="verbcondition" value="''"/>
+        <Define key="verbcondition" value=""/>
         <Set key="limit" value="-1"/>
       </verb>
+
+      <verb name="sample">
+        <Define key="verbcondition" value=""/>
+        <Set key="limit" value="10"/>
+      </verb>
     </verbs>
     <body>
       <Enumerate key="article" table="content" selection="is_published='t' ${verbcondition}"
                   limit="limit" order="webdb_create desc, date desc">
         <Language>
           <Generate 
-              generator="/producer/article.template" 
-              destination="${config.storageRoot}/$pathprefix/${data.content.date.formatted.yyyy}/${data.content.date.formatted.MM}/${data.content.id}.shtml"/>
+              generator="/article.template" 
+              destination="${config.storageRoot}/${pathprefix}/${article.date.formatted.yyyy}/${article.date.formatted.MM}/${article.id}.shtml"/>
         </Language>
 
-        <MarkContent key="data.content"/>               
+        <MarkContent key="article"/>            
+
     <!-- uncomment the following if you want to make a pdf version of each article  -->
     <!-- also, you could move it up into the language tag and adjust the paths accordingly
          to make pdfs in each language -->
     <!-- PDFPreFormat splits up the text and mixes images in with it -->
     <!--<PDFPreFormat key="article.content" numLinesBetweenImages="3" charWidthCM="0.19" pixelWidthCM="0.035" contentAreaWidthCM="16" lineHeightCM="0.5" />-->
     <!-- Regular Generate Tag is used to produce an fo file(but using the split-up content -->
-    <!--<Generate generator="/producer/printablecontent.template" destination="${config.storageRoot}/${article.content.date.formatted.yyyy}/${article.content.date.formatted.MM}/${article.content.id}.fo"/>-->
+    <!--<Generate generator="/printablecontent.template" destination="${config.storageRoot}/${article.content.date.formatted.yyyy}/${article.content.date.formatted.MM}/${article.content.id}.fo"/>-->
     <!-- Finally, PDFGenerate turns the fo file into a pdf.  You could leave this step out 
     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-->
     <!--<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" />-->
+
+
       </Enumerate>
     </body>
   </producer>  
 
+  <producer name="stylesheet">
+    <verbs>
+      <verb name="generate" default="1" description="generates the style sheet"/>
+    </verbs>
+    <body>
+      <Language>
+        <Generate 
+            generator="/stylesheet.template" 
+            destination="${config.storageRoot}/${pathprefix}/style.css"/>
+      </Language>
+    </body>
+  </producer>
+
   <producer name="navigation">
     <verbs>
-      <verb name="generate" default="1"/>
+      <verb name="generate" default="1" description="generates the left column"/>
     </verbs>
     <body>
       <Language>
         <Generate 
-            generator="/producer/navigation.template" 
+            generator="/navigation.template" 
             destination="${config.storageRoot}/${pathprefix}/navigation.inc"/>
       </Language>
     </body>
                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})"
                order="webdb_create asc">
           <batches>
+            <Set key="filename" value="topic.filename ++ batch.current.identifier"/>
             <Language>
-              <Set key="filename" value="topic.filename ++ batch.current.identifier"/>
               <Generate 
-                  generator="/producer/topicpage.template" 
+                  generator="/topicpage.template" 
                   destination="${config.storageRoot}/${pathprefix}/${topic.filename}/${filename}.shtml"/>
             </Language>
           </batches>
     </body>
   </producer>
   
-  <producer name="archive">
+  <producer name="newswirearchive">
     <verbs>
       <verb name="new">
         <Set key="pages" value="3"/>
     <body> 
         <Batch key="articles" infokey="batch" table="content" 
                process="pages" batchsize="20" minbatchsize="10"
-               selection="is_published='1' and to_article_type in (${articletype.newswire}, ${articletype.feature})"
+               selection="is_published='1' and to_article_type in (${articletype.newswire})"
                order="webdb_create asc">
           <batches>
+            <Set key="filename" value="archive ++ batch.current.identifier"/>
             <Language>
-              <Set key="filename" value="archive ++ batch.current.identifier"/>
               <Generate 
-                  generator="/producer/archive.template" 
+                  generator="/archive.template" 
                   destination="${config.storageRoot}/${pathprefix}/archive/${filename}.shtml"/>
             </Language>
           </batches>
         
       <Language>
         <Generate 
-            generator="/producer/startpage.template" 
+            generator="/startpage.template" 
             destination="${config.storageRoot}/${pathprefix}/index.shtml"/>
       </Language>
     </body>