</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["Producer.StorageRoot"]}/${topic.filename}/${pagePrefix}"/>
- <Define key="docPrefix" value="${config["Producer.DocRoot"]}${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>