adding doc/comments
authorgrok <grok>
Sat, 13 Aug 2005 10:29:14 +0000 (10:29 +0000)
committergrok <grok>
Sat, 13 Aug 2005 10:29:14 +0000 (10:29 +0000)
etc/producer/producers.xml

index eefad24..ab2c27c 100755 (executable)
   <!-- "fr", etc.  -->
   <nodedefinition name="Language">
     <parameters>
+         <!-- by default, use all valid languages -->
+         <!-- 'ot' = "Other": used for translations.  -->
       <string name="languagecondition" defaultvalue="code != 'ot'"/>
+         <!-- prefix of bundles that contain language translations -->
+         <!-- this will be: etc/bundles/producer_xx.properties -->
       <string name="bundle" defaultvalue="bundles.producer" />
+         <!-- "sub": reference  to subnode of the calling node -->
       <node name="sub"/>    
     </parameters>
 
     <definition>
       <List key="languages" table="language" selection="${languagecondition}" order="code"/>
       <Enumerate key="language" table="language" selection="${languagecondition}" order="code">
+        <!-- The  Resource node defines a function that can be used -->
+        <!-- in expressions. The name of the function is given by the  -->
+        <!-- "key" parameter. So in this case, it's lang. One -->
+        <!-- can henceforth  use expressions like  ${lang("page.title")} to -->
+        <!-- refer to a bundle value.                                                                      -->
         <Resource bundle="${bundle}" key="lang" language="${language.code}"/>
         <Define key="pathprefix" value="${language.code}" />
         <Define key="languagepreference" value="${language.code}" />
+        <!-- This  <sub/> tag  is replaced  by the  node arguments  of this -->
+        <!-- "function". In other words, if  this function (nodedef) was   --> 
+        <!-- called this way: <Language>  <Generate ... > </Language> then -->  
+        <!-- the <sub/> tag is replaced by the <Generate ... > node.      -->
         <sub/>
+        <!-- This condition is meant  for sites where the startpage for, -->
+        <!-- say, english  prefer english translations  over non-english -->
+        <!-- originals. For those sites, an "original" startpage is also -->
+        <!-- generated,  which  always has  articles  in their  original -->
+        <!-- language.  A concrete example:                                                             -->
+               <!--                                                                                                                     -->
+        <!-- * say the site has languages english and german.            -->
+        <!-- * say article 1 was written in german                                              -->
+        <!-- * say article 2 was written in english, with a german              -->
+        <!--   translation                                               -->
+               <!--                                                                                                                     -->
+        <!-- Then the english startpage might  have article 1 in german  -->
+        <!-- and article 2 in english                                                                   -->
+               <!--                                                                                                                     -->
+        <!-- The german  startpage might have  article 1 in german  and  -->
+        <!-- the german translation of article 2                                                -->
+        <!--                                                                                                                    -->
+        <!-- The  Original startpage  might have  article 1  in  german  -->
+        <!-- and article 2 in english                                                                   -->
         <If condition="language.code=='en'">
           <then>
             <Define key="pathprefix" value="or" />
 
   <!-- This producer generates html  pages, as well as media and video   -->
   <!-- files for articles stored in the database.  -->
+
+  <!-- It's a  good example  of the use  of the "verb"  concept. The
+       "articles" producer (the  producer responsible for generating
+       article pages), can be called in 3 modes:
+       
+       *  changed, to  regenerate articles  with changes  (new ones,
+       recently  edited  ones,  or ones  with  added/removed/changed
+       comments/media). Note that in this case it will regenerate at
+       most 10 changes articles.
+       
+       * all, to regenerate all articles
+       
+       * sample to regenerate the 10 latest articles  -->
   <producer name="articles">
+    <!-- verbs define the different actions that may be done by  -->
+    <!-- this producer -->
     <verbs>
-      <!-- only generate articles that have not yet been generated  -->
+      <!-- only generate articles that have changed (including new article) -->
       <verb name="changed" default="1">
         <Define key="verbcondition" value="(not is_produced)"/>
         <Set key="limit" value="10"/>
       <!-- loop on all articles requested by the "verb"  -->
       <Enumerate key="article" table="content" selection="${verbcondition}"
                   limit="limit" order="webdb_create desc">
-        <!-- for each article, generate it's corresponding image files  -->
+        <!-- For each article, generate it's corresponding image files  -->
+        <!-- The  following  sql statements   select  images  that  are -->
+        <!-- associated  with  the   article  (either  directly  or -->
+        <!-- through comments). -->
         <Enumerate 
             key="media" table="image" 
             selection="exists (select * from content_x_media where media_id=images.id and content_id=${article.id})
                or      exists (select * from comment_x_media, comment
                            where comment_id = comment.id and media_id=images.id and comment.to_media=${article.id})"
             order="id desc">
-            
+           <!-- The  generateMedia  node  instructs  the   media  handler
+               associated  with the  media to  "reproduce" the  media. In
+               practice  this can mean  generate an  icon from  an image,
+               writing an  image from  the database to  the web  root, or
+               create an  m3u file or  so.  Media handling is  limited at
+               this  moment,  but a serious redesign is planned -->
            <GenerateMedia key="media" />
         </Enumerate>
         <!-- for each article, generate it's corresponding video files -->
             
            <GenerateMedia key="media" />
         </Enumerate>
-        <!-- for each article, generate it's corresponding other media files -->
+        <!-- for each article, generate it's corresponding other media files
+              (like pdf's)  -->
         <Enumerate 
             key="media" table="otherMedia" 
             selection="exists (select * from content_x_media where media_id=other_media.id and content_id=${article.id})
                 generator="/article.template" 
                 destination="${config.storageRoot}/${pathprefix}/${article.date.formatted.yyyy}/${article.date.formatted.MM}/${article.id}.shtml"/>
             </Language>
-             <!-- generate the languagebar -->
+             <!-- generate the article's languagebar -->
             <Generate 
               generator="/languagebar.template" 
               destination="${config.storageRoot}/languagebar/${article.to_original.date.formatted.yyyy}/${article.to_original.date.formatted.MM}/${article.to_original.id}.shtml"/>    
-             <!-- add article to the "search engine" index -->
+             <!-- add article to the "search engine" index (lucene) -->
              <IndexContent key="article" pathToIndex="${config['IndexPath']}"/>
           </then>
           <!-- if article is not published, remove it from the search index -->
             <UnIndexContent key="article" pathToIndex="${config['IndexPath']}"/>
           </else>
         </If>
-        <!-- mark the article as produced -->
+        <!-- mark (tag) the article as produced -->
         <MarkContent key="article"/>            
       </Enumerate>
     </body>
   </producer>  
 
-  <!-- generates the left column FIXME more doc?  -->
+  <!-- generates the left column  -->
   <producer name="navigation">
     <verbs>
       <verb name="generate" default="1" description="generates the left column"/>