checking in inits simple topicpage as well as the producer to generate topic pages
authormtopper <mtopper>
Wed, 20 Jul 2005 22:42:12 +0000 (22:42 +0000)
committermtopper <mtopper>
Wed, 20 Jul 2005 22:42:12 +0000 (22:42 +0000)
etc/producer/producers.xml
etc/producer/topicpage.template

index 189b366..0d27c6a 100755 (executable)
   </producer>
 
 
+<producer name="topicpages">
+
+   <verbs>
+      <verb name="new" description="latest 3 of every topic">
+         <Set key="_topics" value="-1"/>
+         <Set key="pages" value="3"/>
+      </verb>
+      <verb name="all" description="all pages of all topics">
+         <Set key="_topics" value="-1"/>
+         <Set key="pages" value="-1"/>
+      </verb>
+      <verb name="sample" description="latest 4 of first 2 topics">
+         <Set key="_topics" value="2"/>
+         <Set key="pages" value="4"/>
+      </verb>
+   </verbs>
+
+   <body>
+      <Enumerate key="topic" table="topic" limit="_topics">
+         <Define key="docSuffix" value=".html"/>
+         <Define key="storageSuffix" value=".html"/>
+
+         <List key="special" table="content c"
+            selection="c.is_published='1' and c.to_article_type = ${articletype.topicspecial} and c.id=cxt.content_id and cxt.topic_id = ${topic.id}"
+            order = "webdb_create desc" limit="1"
+            extratables="content_x_topic cxt"/>
+
+         <Batch key="articles" infokey="batch" table="content c"
+               process="pages" batchsize="20" minbatchsize="10"
+               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}"
+               order="webdb_create asc" extratables="content_x_topic cxt">
+            <batches>
+               <Define key="archivetitle" value="${topic.title}"/>
+               <Define key="archivefilename" value="${topic.filename}"/>
+               <Define key="pagePrefix" value="index"/>
+               <Define key="storagePrefix" value="${config[&quot;Producer.StorageRoot&quot;]}/${topic.filename}/${pagePrefix}"/>
+               <Define key="docPrefix" value="${config[&quot;Producer.DocRoot&quot;]}${pagePrefix}"/>
+               <If condition="(batch.current.index!=batch.first.index)">
+                  <then>
+                     <Define key="previouspageurl"
+                             value="index${batch.previous.identifier}.html" />
+                  </then>
+                  <else>
+                     <Define key="previouspageurl" value="" />
+                  </else>
+               </If>
+               <If condition="(batch.current.index!=batch.last.index)">
+                  <then>
+                     <Define key="nextpageurl"
+                             value="index${batch.next.identifier}.html" />
+                  </then>
+                  <else>
+                     <Define key="nextpageurl" value="" />
+                  </else>
+               </If>
+               <Generate
+                     generator="topicpage.template"
+                     destination="${storagePrefix}${batch.current.identifier}${storageSuffix}"/>
+            </batches>
+         </Batch>
+      </Enumerate>
+   </body>
+
+</producer>
 
 
 
index d30b89f..de1635c 100755 (executable)
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
+<?xml version="1.0"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 Transitional//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
-  <meta http-equiv="Content-Type" content="text/html; charset=${config["Mir.DefaultHTMLCharset"]}">
-    <title>${config["Mir.Name"]} | ${topic.title}</title>
-  <meta name="keywords" content="${lang("general.keywords")}">
-  <meta name="description" content="${topic.description}">
-  <meta name="dc:title" content="${topic.title}">
-  <meta name="dc:creator" content="">
-  <meta name="dc:subject" content="${topic.title}">
-  <meta name="dc:description" content="${topic.title}">
-  <meta name="dc:publisher" content="">
-  <meta name="dc:date" content="${config.now.formatted.dc}">
-  <meta name="dc:language" content="${language.code}">
-  <meta name="dc:coverage" content="">
-  <meta name="dc:rights" content="">
-  <meta http-equiv="expires" content="599">
-  <meta http-equiv="pragma" content="no-cache">
-  <style type="text/css">
-    body, h1, h2, h3, h4, h5, h6, p, li, dt, dd, div, td, blockquote, div, span
-                   {font-family:'Lucida Grande', Verdana, Geneva, Lucida, Arial, Helvetica, sans-serif;}
-    a              {text-decoration:none;}
-    #searchfield   {font-size: 12px; width:113px; height:16px;  background-color:#aaaaaa;}
-    #searchselect  {font-size: 12px; width:120px; height:22px;  background-color:#aaaaaa;}
-    #searchbutton  {font-size: 12px; width:120px; height:20px; background-color:#aaaaaa; text-align: right;}
-  </style>
+      <title>${config["Mir.Name"]} | ${config.now.format("dd.MM.yyyy HH:mm")}</title>
+
+   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+   <meta http-equiv="expires" content="599" />
+
+   <meta name="generator" content="mir-cms" />
+   <meta name="author" content="" />
+   <meta name="keywords" content="your, Keywords, here" />
+   <meta name="description" content="describe this page" />
+   <meta name="date" content="${config.now.formatted.dc}" />
+
+   <meta name="DC.type" content="Collection" />
+   <meta name="DC.format" content="text/html" />
+   <meta name="DC.title" lang="en" content="${archivetitle}" />
+   <meta name="DC.creator" content="" />
+   <meta name="DC.subject" lang="en" content="" />
+   <meta name="DC.description" content="" />
+   <meta name="DC.publisher" content="${config["Mir.Name"]}" />
+   <meta name="DC.date" content="${config.now.formatted.dc}" />
+   <meta name="DC.language" content="en" />
+   <meta name="DC.coverage" scheme="DCTERMS.TGN" content="World" />
+   <meta name="DC.rights" scheme="DCTERMS.URI" content="" />
+
+   <meta name="robots" content="index" />
+   <meta name="robots" content="follow" />
+
+   <link rel="stylesheet"           type="text/css" href="../style/apple/site.css" title="apple" />
+   <link rel="alternate stylesheet" type="text/css" href="../style/cindy/site.css" title="cindy" />
+   <link rel="alternate stylesheet" type="text/css" href="../style/fade/site.css" title="fade" />
+
+   <script type="text/javascript" src="../script/scripts.js"></script>
+   <script type="text/javascript" src="../script/styleswitcher.js"></script>
 </head>
 
-<body bgcolor="#dddddd" marginwidth="0" marginheight="0" leftmargin="0" topmargin="0" link="#003399" alink="#cc0033" vlink="#660033" >
-
-<table border="0" cellpadding="0" cellspacing="0" width="100%">
-  <tr>
-    <td valign="top">
-      <table cellpadding="0" cellspacing="0" border="0" width="100%" bgcolor="#cc0033">
-        <tr>
-          <td><a href="${config["Producer.DocRoot"]}/${language.code}/"><img src="${config["Producer.DocRoot"]}/img/logo.gif" width="120" height="120" alt="((i))" border="0"></a></td>
-        </tr>
-      </table>
-      <table cellpadding="4" cellspacing="0" border="0" width="100%" bgcolor="#cc0033">
-        <tr>
-          <td><a href="${config["Producer.DocRoot"]}/${language.code}/">&nbsp;<font color="#dddddd" size="-1"><b>${lang("general.start")}</b></font></a></td>
-        </tr>
-      </table>
-      <br>
-      <!--#include virtual="../navigation.inc" -->
-    </td>
-    <td valign="top" width="100%">
-      <table cellpadding="4" cellspacing="0" border="0" width="100%" bgcolor="#cc0033">
-        <tr>
-          <td>
-            &nbsp;&nbsp;
-            <font color="#dddddd" size="-1"><b>
-          <a href="${config["Producer.DocRoot"]}/${language.code}/static/mission.shtml"><font color="#dddddd">${lang("general.menu.missionStatement")}&nbsp;&gt;&gt;</font></a> &nbsp;
-          <a href="${config["Producer.DocRoot"]}/${language.code}/static/moderation.shtml"><font color="#dddddd">${lang("general.menu.moderation")}&nbsp;&gt;&gt;</font></a>  &nbsp;
-          <a href="${config["Producer.DocRoot"]}/${language.code}/static/support.shtml"><font color="#dddddd">${lang("general.menu.support")}&nbsp;&gt;&gt;</font></a>  &nbsp;
-          <a href="${config["Producer.DocRoot"]}/${language.code}/static/mailinglists.shtml"><font color="#dddddd">${lang("general.menu.mailinglists")}&nbsp;&gt;&gt;</font></a> &nbsp;
-          <a href="${config["Producer.DocRoot"]}/${language.code}/static/participate.shtml"><font color="#dddddd">${lang("general.menu.participate")}&nbsp;&gt;&gt;</font></a>
-            </b></font>
-          </td>
-        </tr>
-      </table>
-      <table cellpadding="0" cellspacing="0" border="0" width="100%">
-        <tr>
-          <td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
-          <td width="100%">
-            <br>
-            <br>
-            <font color="#cc0033" size="+2"><b>${topic.title}</b></font>
-            <br>
-            <br>
-          </td>
-          <td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
-          <td valign="top">&nbsp;
-          </td>
-          <td>
-          &nbsp;&nbsp;&nbsp;&nbsp;
-          </td>
-        </tr>
-        <tr>
-          <td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
-          <td>
-            <br>
-              <!--- topic-special ---> <comment></comment>
-                               <if (batch.current.index==batch.first.index)>
-                               <list special as ss>
-                                 <assign sorig=ss.to_original> 
-                                 <if languagepreference>
-                                   <assign s=ss.to_translation(languagepreference)>
-                                 <else>
-                                   <assign s=ss>
-                                 </if>
-
-                   <table width="100%" border="0" cellspacing="0" cellpadding="10" bgcolor="#eeeeee"><tr><td>
-                       <p><font size="+2">
-                       <a href="${config["Producer.DocRoot"]}/${language.code}/${s.date.formatted["yyyy'/'MM"]}/${s.id}.shtml"><b>${s.title}</b></a>
-                       </font><br>
-                          <font size="-2">${sorig.creator} <if sorig.id!=s.id>(${lang("general.translatedby", s.creator)})</if><if s.creator || sorig.creator>, </if> ${sorig.creationdate.formatted["dd-MM-yyyy - HH:mm"]}</font></p>
-                       <p><font size="-1">
-                        <if sorig.to_media_audio >
-                          <img align="left" vspace="4" hspace="8"
-                            src="${config["Producer.DocRoot"]}/img/${sorig.to_media_audio[0]["big_icon"]}">
-                        </if>
-                        <if sorig.to_media_video >
-                          <img align="left" vspace="4" hspace="8"
-                            src="${config["Producer.DocRoot"]}/img/${sorig.to_media_video[0]["big_icon"]}">
-                        </if>
-                        <if sorig.to_media_other >
-                          <img align="left" vspace="4" hspace="8"
-                             src="${config["Producer.DocRoot"]}/img/${sorig.to_media_other[0]["big_icon"]}">
-                        </if>
-                        <if sorig.to_media_images >
-                          <img align="left" vspace="4" hspace="8"
-                            src="${sorig.to_media_images[0]["icon_path"]}"
-                            width="${sorig.to_media_images[0]["icon_width"]}"
-                            height="${sorig.to_media_images[0]["icon_height"]}"
-                            border=0 alt="${sorig.to_media_images[0]["title"]}">
-                        </if>
-                        ${s.description_parsed}
-                    <br clear="all">
-                    <a href="${config["Producer.DocRoot"]}/${language.code}${s.publish_path}${s.id}.shtml"><b>${lang("general.readmore")} &gt;&gt;</b></a>
-                    </font></p>
-
-                   </td></tr></table>
-                </list>
-                               </if>
-              <!--- /topic-special --->
-
-              <!--- articles ---> <comment></comment>
-                <list articles as a>
-                 <assign aorig=a.to_original>
-               <if languagepreference>
-                 <assign i=a.to_translation(languagepreference)>
-               <else>
-                 <assign i=a>
-               </if>
-
-                  <p><font size="+1">
-                  <a href="${config["Producer.DocRoot"]}/${language.code}/${i.date.formatted["yyyy'/'MM"]}/${i.id}.shtml"><b>${i.title}</b></a>
-                  </font><br>
-                     <font size="-2">${aorig.creator} <if aorig.id!=i.id>(${lang("general.translatedby", i.creator)})</if><if i.creator || aorig.creator>, </if> ${aorig.creationdate.formatted["dd-MM-yyyy - HH:mm"]}</font></p>
-                  <p><font size="-1">
-                  <if aorig.to_media_audio >
-                  <img align="left" vspace="4" hspace="8"
-                       src="${config["Producer.DocRoot"]}/img/${aorig.to_media_audio[0]["big_icon"]}">
-                  </if>
-                  <if aorig.to_media_video >
-                  <img align="left" vspace="4" hspace="8"
-                       src="${config["Producer.DocRoot"]}/img/${aorig.to_media_video[0]["big_icon"]}">
-                  </if>
-                  <if aorig.to_media_other >
-                  <img align="left" vspace="4" hspace="8"
-                       src="${config["Producer.DocRoot"]}/img/${aorig.to_media_other[0]["big_icon"]}">
-                  </if>
-                  <if aorig.to_media_images >
-                  <img align="left" vspace="4" hspace="8"
-                       src="${aorig.to_media_images[0]["icon_path"]}"
-                       width="${aorig.to_media_images[0]["icon_width"]}"
-                       height="${aorig.to_media_images[0]["icon_height"]}"
-                       border=0 alt="${aorig.to_media_images[0]["title"]}">
-                  </if>
-                  ${i.description_parsed}
-                  <br clear="all">
-                  <a href="${config["Producer.DocRoot"]}/${language.code}${i.publish_path}${i.id}.shtml"><b>${lang("general.readmore")} &gt;&gt;</b></a>
-                  </font></p>
-
-                  <br>
-                </list>
-              <!--- /articles --->
-
-
-          </td>
-          <td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
-          <td valign="top">
-                       &nbsp;
-          </td>
-          <td>
-          &nbsp;&nbsp;&nbsp;&nbsp;
-          </td>
-        </tr>
-      </table>
-    </td>
-  </tr>
-
-<!-- the rest -->
-  <tr>
-  <td>&nbsp;</td>
-  <table width="100%">
-                       <!--- Page Navigation --->
-               <tr><td colspan="4" bgcolor="#CCCCCC"><br></td></tr>
-               <tr>
-                       <td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
-                       <td align="left" valign="top">
-                         <if batch.current.index!=batch.first.index>
-                <a href="${docPrefix}${batch.previous.identifier}${docSuffix}"><font><b>&lt;&lt; ${lang("general.page.prefix")} ${batch.previous.index}</b></font></a>
-              </if>
-              <if batch.current.index!=batch.first.index && batch.current.index!=batch.last.index>
-                |
-              </if>
-              <if batch.next>
-                <a href="${docPrefix}${batch.next.identifier}${docSuffix}"><font><b>${lang("general.page.prefix")} ${batch.next.index} &gt;&gt;</b></font></a>
-              </if>
-                       </td>
-                       <td>
-                       &nbsp;
-                       </td>
-                       <td align="right" valign="top">
-                       <!--#include virtual="${docPrefix}nav${docSuffix}" -->
-                       </td>
-                       <td>&nbsp;<br><br><br></td>
-               </tr>
-  </table>
-
-
-  </tr>
-</table>
+<body id="archivepage">
+
+<div id="archivetitle">
+   <a id="logo" href="../index.html"></a>
+   <div id="head">
+      <h1>mir-site</h1>
+      <ul>
+         <li><a href="static/item01.html">Item I</a></li>
+         <li><a href="static/item02.html">Item II</a></li>
+         <li><a href="static/item03.html">Item III</a></li>
+         <li><a href="static/item04.html">Item VI</a></li>
+         <li><a href="${config["Producer.OpenAction"]}?do=opensession&amp;sessiontype=article&amp;language=en">Publish</a></li>
+      </ul>
+   </div>
+</div>
+
+<div id="archivebody">
+
+<div id="left">
+
+   <ul class="navlist">
+      <li class="navlisthead">Topics</li>
+      <list topics as t>
+         <li>
+            <a href="../${t.filename}/index.html" title="${t.description}">
+               ${t.title}
+            </a>
+         </li>
+      </list>
+   </ul>
+
+   <p>
+      <a href="http://validator.w3.org/check?uri=referer">Valid XHTML</a>
+      <br/>
+      <a class="right" href="http://jigsaw.w3.org/css-validator">Valid CSS</a>
+   </p>
+
+
+</div>
+
+<div id="archiveright">
+   <div id="archivename">
+      <h2>
+         ${archivetitle}
+      </h2>
+      <div class="collapslink">
+
+         <switch archivetitle>
+            <case "Features">
+               <a href="../xml/main-features.rss" title="RSS-Feed"><span class="xmlbutton">XML</span></a> &nbsp;<break>
+            <case "Newswire">
+               <a href="../xml/main-newswire.rss" title="RSS-Feed"><span class="xmlbutton">XML</span></a> &nbsp;<break>
+            <case "Video"><case "Audio"><case "Images"><break>
+            <default>
+               <a href="../xml/${archivefilename}-newswire.rss" title="RSS-Feed"><span class="xmlbutton">XML</span></a> &nbsp;
+         </switch>
+
+         <script type="text/javascript">
+            <!--
+               stylename = "abstract";
+               document.write('<a href="javascript:collapsexpand(stylename);" title="Collaps / Expand">-|+</a>')
+            //-->
+         </script>
+      </div>
+   </div>
+
+   <if (batch.current.index==batch.first.index)>
+      <list special as s>
+         <div class="listpagespecial">
+            <h3>
+               <a href="../${s.date.formatted["yyyy'/'MM"]}/${s.id}.html"">${utility.encodeXML(s.title)}</a>
+            </h3>
+            <div class="byline">
+               ${utility.encodeXML(s.creator)} - ${s.creationdate.formatted["dd-MM-yyyy - HH:mm"]}
+            </div>
+            <div class="abstract">
+               <if s.to_media_images >
+                  <img class="imageicon" src="../${s.to_media_images[0]["icon_path"]}"
+                     width="${s.to_media_images[0]["icon_width"]}"
+                     height="${s.to_media_images[0]["icon_height"]}"
+                     alt="Image"
+                     title="${utility.encodeXML(s.to_media_images[0]["title"])}" />
+               </if>
+               <if s.to_media_audio >
+                     <img class="mediaicon" src="../img/${s.to_media_audio[0]["big_icon"]}"
+                        title="Audio-File" />
+               </if>
+               <if s.to_media_video >
+                  <img class="mediaicon" src="../img/${s.to_media_video[0]["big_icon"]}"
+                     title="Video-File" />
+               </if>
+               <if s.to_media_other >
+                  <img class="mediaicon" src="../img/${s.to_media_other[0]["big_icon"]}"
+                     title="Other Media" />
+               </if>
+               ${s.description_parsed}
+            </div>
+         </div>
+      </list>
+   </if>
+
+   <list articles as a>
+      <div class="listpageitem">
+         <h4>
+            <a href="../${a.date.formatted["yyyy'/'MM"]}/${a.id}.html">${utility.encodeXML(a.title)}</a>
+         </h4>
+         <div class="byline">
+               ${utility.encodeXML(a.creator)} | ${a.creationdate.formatted["dd-MM-yyyy - HH:mm"]}
+         </div>
+         <div class="abstract">
+            <if a.to_media_images >
+               <img class="imageicon" src="../${a.to_media_images[0]["icon_path"]}"
+                  width="${a.to_media_images[0]["icon_width"]}"
+                  height="${a.to_media_images[0]["icon_height"]}"
+                  alt="Image"
+                  title="${utility.encodeXML(a.to_media_images[0]["title"])}" />
+            </if>
+            <if a.to_media_audio >
+                  <img class="mediaicon" src="../img/${a.to_media_audio[0]["big_icon"]}"
+                     title="Audio-File" />
+            </if>
+            <if a.to_media_video >
+               <img class="mediaicon" src="../img/${a.to_media_video[0]["big_icon"]}"
+                  title="Video-File" />
+            </if>
+            <if a.to_media_other >
+               <img class="mediaicon" src="../img/${a.to_media_other[0]["big_icon"]}"
+                  title="Other Media" />
+            </if>
+            ${a.description_parsed}
+         </div>
+      </div>
+   </list>
+
+   <div id="footernav">
+      <div id="footernavleft">
+         <form action="">
+            <select size="1" name="Auswahl"
+               onchange="Go(this.form.Auswahl.options[this.form.Auswahl.options.selectedIndex].value)"
+               class="navform">
+               <option value="nothing">Choose Page</option>
+            <list batch.all as b>
+               <option value="${docPrefix}${b.identifier}${docSuffix}">${b.index}</option>
+            </list>
+               <option value="../index.html">STARTPAGE</option>
+            </select>
+         </form>
+      </div>
+      <div id="footernavright">
+         <if nextpageurl!="">
+            <a href="${nextpageurl}">&lt; old</a>
+         </if>
+         ${batch.current.index} of ${batch.first.index}
+         <if previouspageurl!="">
+            <a href="${previouspageurl}">new &gt;</a>
+         </if>
+      </div>
+   </div>
+
+</div>
+
+</div> <!-- end #archivebody -->
 </body>
-</html>
+</html>
\ No newline at end of file