+
+ <!-- generates a count for each topic -->
+
+ <!-- TODO: add date limit when we actually are going live with this -->
+ <producer name="generateTopicCounts">
+ <verbs>
+ <verb name="doit" />
+ </verbs>
+ <body>
+ <FreeQuery key="topicCounts" query=" SELECT count(x.content_id) as count, t.title, t.filename FROM topic as t LEFT OUTER JOIN content_x_topic
+ as x ON (t.id=x.topic_id) LEFT OUTER JOIN content as c ON (c.id=x.content_id)
+ WHERE c.webdb_create > NOW()-'1 day'::interval AND t.archiv_url = 'Category' GROUP BY t.title , t.filename ORDER BY t.title"
+ type="set"/>
+ <Language>
+ <Generate generator="/topiccount.template"
+ destination="${config.storageRoot}/${pathprefix}/topiccount.html" />
+ </Language>
+ </body>
+ </producer>
+
+
+
+ <producer name="generateRandomTopics">
+ <verbs>
+ <verb name="doit" />
+ </verbs>
+ <body>
+ <Set key="counter" value="1"/>
+
+ <Enumerate key="category" table="topic t" extratables="topic t2"
+ selection="t.id=t2.id AND t.archiv_url = 'Subcategory' AND (SELECT count(*) from content_x_topic where topic_id = t.id) > 0" order="RANDOM()" limit="10">
+
+ <Log message="Getting Last 5 articles for category: ${category.title} - counter: ${counter}" />
+ <Define key="topictitle" value="${category.title}" />
+ <Define key="topicfile" value="${category.filename}" />
+
+ <List key="randomarticles" table="content"
+ selection ="id in (select content_id from content_x_topic where topic_id = ${category.id}) AND is_published=true" order="date DESC"
+ limit="3" />
+ <Language>
+ <Generate
+ generator="/randomcategory.template"
+ destination="${config.storageRoot}/${pathprefix}/randomcats/random${counter}.html" />
+ </Language>
+
+ <Set key="counter" value="counter+1" />
+ </Enumerate>
+ </body>
+ </producer>
+