From 6a5286a1e7f2db55a7d312bb9b1ef40453b3612d Mon Sep 17 00:00:00 2001 From: zapata Date: Wed, 1 May 2002 04:33:14 +0000 Subject: [PATCH] - made a producer for startpages per topic --- source/mir/entity/EntityBrowser.java | 1 - source/mir/util/ParameterExpander.java | 104 +++++++++++++++++++++ source/mircoders/global/MirGlobal.java | 2 +- .../localizer/MirCachingLocalizerDecorator.java | 46 +++++++++ .../localizer/MirProducerToolLocalizer.java | 3 + .../localizer/basic/MirBasicProducerLocalizer.java | 26 ++++-- .../basic/MirBasicProducerToolLocalizer.java | 25 +++++ source/mircoders/producer/ContentProducer.java | 65 ++++++------- .../mircoders/producer/ContentProducerFactory.java | 17 ++-- source/mircoders/producer/NullProducer.java | 15 +++ source/mircoders/producer/NullProducerFactory.java | 26 ++++++ source/mircoders/producer/ScriptCallProducer.java | 6 +- source/mircoders/producer/StartPageProducer.java | 12 +-- .../producer/TopicStartPageProducerFactory.java | 93 ++++++++++++++++++ 14 files changed, 371 insertions(+), 70 deletions(-) create mode 100755 source/mir/util/ParameterExpander.java create mode 100755 source/mircoders/localizer/MirCachingLocalizerDecorator.java create mode 100755 source/mircoders/producer/NullProducer.java create mode 100755 source/mircoders/producer/NullProducerFactory.java create mode 100755 source/mircoders/producer/TopicStartPageProducerFactory.java diff --git a/source/mir/entity/EntityBrowser.java b/source/mir/entity/EntityBrowser.java index 192ee14b..aa3f3cc5 100755 --- a/source/mir/entity/EntityBrowser.java +++ b/source/mir/entity/EntityBrowser.java @@ -40,7 +40,6 @@ public class EntityBrowser { } } - public boolean hasNext() throws StorageObjectException { if (position>=currentBatch.size() && currentBatch.hasNextBatch()) { readNextBatch(); diff --git a/source/mir/util/ParameterExpander.java b/source/mir/util/ParameterExpander.java new file mode 100755 index 00000000..bb677d75 --- /dev/null +++ b/source/mir/util/ParameterExpander.java @@ -0,0 +1,104 @@ +package mir.util; + +import java.util.*; + +public class ParameterExpander { + + final static String DEFAULT_KEY = "(default)"; + final static String NODE_SEPARATOR = "."; + + private static List splitString(String aString, String aSeparator) { + List result= new Vector(); + int previousPosition = 0; + int position; + int endOfNamePosition; + + while ((position = aString.indexOf(aSeparator, previousPosition))>=0) { + result.add(aString.substring(previousPosition, position)); + previousPosition = position + aSeparator.length(); + } + + result.add(aString.substring(previousPosition, aString.length())); + + return result; + } + + public static String findValueForKey(Map aMap, String aKey) throws Exception { + Object node; + Iterator i; + List parts = splitString(aKey, NODE_SEPARATOR); + String location = ""; + + node = aMap; + + i = parts.iterator(); + + while(i.hasNext()) { + String part = (String) i.next(); + + if (!(node instanceof Map)) { + throw new Exception( "Can't expand key " + aKey + ": " + location + " is not a map" ); + } + + node = ((Map) node).get(part); + + if (location.length()>0) { + location=location + NODE_SEPARATOR; + } + + location = location + part; + + if (node == null) { + throw new Exception( "Can't expand key " + aKey + ": "+ location + " does not exist" ); + } + } + + if (node instanceof Map) { + node = ((Map) node).get(DEFAULT_KEY); + } + + if (!(node instanceof String)) + throw new Exception( "Can't expand key " + aKey + ": "+ location + " is not a string but a " + node.getClass().getName() ); + + return (String) node; + } + + public static String expandExpression(Map aMap, String anExpression) throws Exception { + int previousPosition = 0; + int position; + int endOfNamePosition; + StringBuffer result = new StringBuffer(); + + while ((position=anExpression.indexOf("$", previousPosition))>=0) { + result.append(anExpression.substring(previousPosition, position)); + + if (position>=anExpression.length()-1) { + result.append(anExpression.substring(position, anExpression.length())); + previousPosition=anExpression.length(); + } + else + { + if (anExpression.charAt(position+1) == '{') { + endOfNamePosition=anExpression.indexOf('}', position); + if (endOfNamePosition>=0) { + result.append(findValueForKey(aMap, anExpression.substring(position+2, endOfNamePosition))); + previousPosition=endOfNamePosition+1; + } + else { + throw new Exception("Missing } in " + anExpression); + } + } + else + { + previousPosition=position+2; + result.append(anExpression.charAt(position+1)); + } + } + } + result.append(anExpression.substring(previousPosition, anExpression.length())); + + return result.toString(); + } +} + + diff --git a/source/mircoders/global/MirGlobal.java b/source/mircoders/global/MirGlobal.java index bd235564..cbbea021 100755 --- a/source/mircoders/global/MirGlobal.java +++ b/source/mircoders/global/MirGlobal.java @@ -13,7 +13,7 @@ public class MirGlobal { public static MirLocalizer localizer() { if (localizer == null ) { - localizer = new MirBasicLocalizer(); + localizer = new MirCachingLocalizerDecorator(new MirBasicLocalizer()); } return localizer; diff --git a/source/mircoders/localizer/MirCachingLocalizerDecorator.java b/source/mircoders/localizer/MirCachingLocalizerDecorator.java new file mode 100755 index 00000000..8b16b056 --- /dev/null +++ b/source/mircoders/localizer/MirCachingLocalizerDecorator.java @@ -0,0 +1,46 @@ +package mircoders.localizer; + +public class MirCachingLocalizerDecorator implements MirLocalizer { + private MirLocalizer localizer; + private MirProducerLocalizer producerLocalizer; + private MirGeneratorLocalizer generatorLocalizer; + private MirOpenPostingLocalizer openPostingsLocalizer; + private MirProducerToolLocalizer producerToolLocalizer; + + public MirCachingLocalizerDecorator(MirLocalizer aLocalizer) { + localizer = aLocalizer; + } + + public MirProducerLocalizer producers() { + if (producerLocalizer==null) { + producerLocalizer = localizer.producers(); + } + + return producerLocalizer; + } + + public MirGeneratorLocalizer generators() { + if (generatorLocalizer==null) { + generatorLocalizer = localizer.generators(); + } + + return generatorLocalizer; + } + + public MirOpenPostingLocalizer openPostings() { + if (openPostingsLocalizer==null) { + openPostingsLocalizer = localizer.openPostings(); + } + + return openPostingsLocalizer; + } + + public MirProducerToolLocalizer producerTool() { + if (producerToolLocalizer==null) { + producerToolLocalizer = localizer.producerTool(); + } + + return producerToolLocalizer; + } + +} \ No newline at end of file diff --git a/source/mircoders/localizer/MirProducerToolLocalizer.java b/source/mircoders/localizer/MirProducerToolLocalizer.java index 3fa3d8c1..8bebd115 100755 --- a/source/mircoders/localizer/MirProducerToolLocalizer.java +++ b/source/mircoders/localizer/MirProducerToolLocalizer.java @@ -1,4 +1,7 @@ package mircoders.localizer; +import java.util.*; + public interface MirProducerToolLocalizer { + public void initializeGenerationValueSet(Map aValueSet); } diff --git a/source/mircoders/localizer/basic/MirBasicProducerLocalizer.java b/source/mircoders/localizer/basic/MirBasicProducerLocalizer.java index 00c1f0e3..c5cacee7 100755 --- a/source/mircoders/localizer/basic/MirBasicProducerLocalizer.java +++ b/source/mircoders/localizer/basic/MirBasicProducerLocalizer.java @@ -24,19 +24,27 @@ public class MirBasicProducerLocalizer implements MirProducerLocalizer { new ContentProducerFactory( MirGlobal.getConfigProperty("Producer.Content.Template"), "bundles.admin", - MirGlobal.getConfigProperty("Producer.StorageRoot"), - ".shtml", + MirGlobal.getConfigProperty("Producer.StorageRoot") + "/${contentyear}/${contentmonth}/${contentid}.shtml", Integer.parseInt(MirGlobal.getConfigProperty("Producer.Content.Batchsize")))); } protected void setupStartPageFactory(CompositeProducerFactory aStartPageFactory) { aStartPageFactory.addFactory( new StartPageProducerFactory( - MirGlobal.getConfigProperty("Producer.StartPage.Template"), - "bundles.admin", - MirGlobal.getConfigProperty("Producer.StorageRoot") + "/index.shtml", - MirGlobal.getConfigIntegerProperty("Producer.StartPage.Items"), - MirGlobal.getConfigIntegerProperty("Producer.StartPage.Newswire"))); + MirGlobal.getConfigProperty("Producer.StartPage.Template"), + "bundles.admin", + MirGlobal.getConfigProperty("Producer.StorageRoot") + "/index.shtml", + MirGlobal.getConfigIntegerProperty("Producer.StartPage.Items"), + MirGlobal.getConfigIntegerProperty("Producer.StartPage.Newswire"))); + + + aStartPageFactory.addFactory( + new TopicStartPageProducerFactory( + MirGlobal.getConfigProperty("Producer.StartPage.Template"), + "bundles.admin", + MirGlobal.getConfigProperty("Producer.StorageRoot") + "/${filename}index.shtml", + MirGlobal.getConfigIntegerProperty("Producer.StartPage.Items"), + MirGlobal.getConfigIntegerProperty("Producer.StartPage.Newswire"))); } protected void setupSynchronizationFactory(CompositeProducerFactory aSynchronizationFactory) { @@ -67,11 +75,11 @@ public class MirBasicProducerLocalizer implements MirProducerLocalizer { setupSynchronizationFactory(factory); aFactoriesMap.put("synchronization", factory); - aFactoriesMap.put("oldstartpage", new OldProducerAdapterFactory(new ProducerStartPage())); + + aFactoriesMap.put("images", new OldProducerAdapterFactory(new ProducerImages())); aFactoriesMap.put("navigation", new OldProducerAdapterFactory(new ProducerNavigation())); aFactoriesMap.put("openposting", new OldProducerAdapterFactory(new ProducerOpenPosting())); aFactoriesMap.put("topics", new OldProducerAdapterFactory(new ProducerTopics())); - }; } diff --git a/source/mircoders/localizer/basic/MirBasicProducerToolLocalizer.java b/source/mircoders/localizer/basic/MirBasicProducerToolLocalizer.java index a04bff99..1780124b 100755 --- a/source/mircoders/localizer/basic/MirBasicProducerToolLocalizer.java +++ b/source/mircoders/localizer/basic/MirBasicProducerToolLocalizer.java @@ -1,6 +1,31 @@ package mircoders.localizer.basic; +import java.util.*; +import freemarker.template.utility.*; +import mir.misc.*; import mircoders.localizer.*; +import mircoders.global.*; public class MirBasicProducerToolLocalizer implements MirProducerToolLocalizer { + + public void initializeGenerationValueSet(Map aValueSet) { + // ML: these config settings will be included more beautifully as soon as the new config system is in place + + Map configMap = new HashMap(); + + configMap.put("producerDocRoot", MirGlobal.getConfigProperty("Producer.DocRoot")); + configMap.put("storageRoot", MirGlobal.getConfigProperty("Producer.StorageRoot")); + configMap.put("productionHost", MirGlobal.getConfigProperty("Producer.ProductionHost")); + configMap.put("openAction", MirGlobal.getConfigProperty("Producer.OpenAction")); + configMap.put("docRoot", MirGlobal.getConfigProperty("RootUri")); + configMap.put("now", StringUtil.date2readableDateTime(new GregorianCalendar())); + configMap.put("videoHost", MirGlobal.getConfigProperty("Producer.Video.Host")); + configMap.put("audioHost", MirGlobal.getConfigProperty("Producer.Audio.Host")); + configMap.put("imageHost", MirGlobal.getConfigProperty("Producer.Image.Host")); + configMap.put("imagePath", MirGlobal.getConfigProperty("Producer.Image.Path")); + configMap.put("mirVersion", MirGlobal.getConfigProperty("Mir.Version")); + configMap.put("compressWhitespace", new freemarker.template.utility.CompressWhitespace() ); + + aValueSet.put("config", configMap); + }; } diff --git a/source/mircoders/producer/ContentProducer.java b/source/mircoders/producer/ContentProducer.java index 428331b4..5790063a 100755 --- a/source/mircoders/producer/ContentProducer.java +++ b/source/mircoders/producer/ContentProducer.java @@ -3,6 +3,7 @@ package mircoders.producer; import java.io.*; import java.util.*; +import mir.util.*; import mir.misc.*; import mir.entity.*; import mir.producer.*; @@ -21,8 +22,8 @@ public class ContentProducer implements mir.producer.Producer { private String generatorIdentifier; private String resourceBundle; - private String outputFilePrefix; - private String outputFilePostfix; + private String outputFileExpression; + EntityBrowser browser; @@ -30,51 +31,32 @@ public class ContentProducer implements mir.producer.Producer { EntityBrowser aBrowser, String aGeneratorIdentifier, String aResourceBundle, - String anOutputFilePrefix, - String anOutputFilePostfix) { + String anOutputFileExpression) { browser = aBrowser; - generatorIdentifier=aGeneratorIdentifier; - resourceBundle=aResourceBundle; - outputFilePrefix=anOutputFilePrefix; - outputFilePostfix=anOutputFilePostfix; + generatorIdentifier = aGeneratorIdentifier; + resourceBundle = aResourceBundle; + outputFileExpression = anOutputFileExpression; } public void produce( PrintWriter aLogger ) throws ProducerException { EntityContent content; - Map configMap = new HashMap(); Map generationValues = new HashMap(); Map dataMap = new HashMap(); String fileName; - - - configMap.put("producerDocRoot", MirGlobal.getConfigProperty("Producer.DocRoot")); - configMap.put("storageRoot", MirGlobal.getConfigProperty("Producer.StorageRoot")); - configMap.put("productionHost", MirGlobal.getConfigProperty("Producer.ProductionHost")); - configMap.put("openAction", MirGlobal.getConfigProperty("Producer.OpenAction")); - configMap.put("docRoot", MirGlobal.getConfigProperty("RootUri")); - configMap.put("now", StringUtil.date2readableDateTime(new GregorianCalendar())); - configMap.put("videoHost", MirGlobal.getConfigProperty("Producer.Video.Host")); - configMap.put("audioHost", MirGlobal.getConfigProperty("Producer.Audio.Host")); - configMap.put("imageHost", MirGlobal.getConfigProperty("Producer.Image.Host")); - configMap.put("imagePath", MirGlobal.getConfigProperty("Producer.Image.Path")); - configMap.put("mirVersion", MirGlobal.getConfigProperty("Mir.Version")); - configMap.put("compressWhitespace", new freemarker.template.utility.CompressWhitespace() ); - generationValues.put("config", configMap); + MirGlobal.localizer().producerTool().initializeGenerationValueSet(generationValues); MessageResources messages = MessageResources.getMessageResources(resourceBundle); generationValues.put("lang", new MessageMethodModel(null, messages) ); generationValues.put("data", dataMap); - - try { Generator generator = MirGlobal.localizer().generators().makeGenerator(generatorIdentifier); - aLogger.println("ContentProducer.produce:
"); - aLogger.println("generatorIdentifier = " + generatorIdentifier + "
"); + aLogger.println("ContentProducer.produce:"); + aLogger.println("generatorIdentifier = " + generatorIdentifier); while (browser.hasNext()) { content = (EntityContent) browser.next(); @@ -82,11 +64,16 @@ public class ContentProducer implements mir.producer.Producer { String date = content.getValue("date"); - fileName = outputFilePrefix + "/" + - date.substring(0,4) + "/" + date.substring(4,6) + "/" + - content.getValue("id") + outputFilePostfix; + // ML: this will be done more elegantly soon! + dataMap.put("contentmonth", date.substring(4,6)); + dataMap.put("contentyear", date.substring(0,4)); + dataMap.put("contentid", content.getValue("id")); + + aLogger.println("unparsed fileName = " + outputFileExpression); + + fileName = ParameterExpander.expandExpression(dataMap, outputFileExpression); - aLogger.println("fileName = " + fileName + "
"); + aLogger.println("fileName = " + fileName); try { File file = new File(fileName); @@ -99,31 +86,31 @@ public class ContentProducer implements mir.producer.Producer { FileWriter fileWriter = new FileWriter(file); PrintWriter printWriter = new PrintWriter(fileWriter); - aLogger.println("generating: " + fileName + "
"); + aLogger.println("generating: " + fileName); generator.generate(printWriter, generationValues, aLogger); printWriter.close(); fileWriter.close(); content.setProduced(true); - aLogger.println("done generating: " + fileName + "
"); + aLogger.println("done generating: " + fileName); } catch (Exception e) { - aLogger.println("exception while generating " + fileName + ":
"); - aLogger.println(e.getMessage() + "
"); + aLogger.println("exception while generating " + fileName + ":"); + aLogger.println(e.getMessage()); e.printStackTrace(aLogger); aLogger.flush(); } } } catch (Exception e) { - aLogger.println("exception while generating:
"); - aLogger.println(e.getMessage() + "
"); + aLogger.println("exception while generating:"); + aLogger.println(e.getMessage()); e.printStackTrace(aLogger); aLogger.flush(); } - aLogger.println("ContentProducer.produce: done
"); + aLogger.println("ContentProducer.produce: done"); } diff --git a/source/mircoders/producer/ContentProducerFactory.java b/source/mircoders/producer/ContentProducerFactory.java index 048b2d65..94b437f6 100755 --- a/source/mircoders/producer/ContentProducerFactory.java +++ b/source/mircoders/producer/ContentProducerFactory.java @@ -8,22 +8,18 @@ import mircoders.storage.*; public class ContentProducerFactory implements ProducerFactory { private String generatorIdentifier; private String resourceBundle; - private String outputFilePrefix; - private String outputFilePostfix; + private String outputFileNameExpression; private int batchSize; -// ML: extra selection needed for article types public ContentProducerFactory( String aGeneratorIdentifier, String aResourceBundle, - String anOutputFilePrefix, - String anOutputFilePostfix, + String anOutputFileNameExpression, int aBatchSize) { - generatorIdentifier=aGeneratorIdentifier; - resourceBundle=aResourceBundle; - outputFilePrefix=anOutputFilePrefix; - outputFilePostfix=anOutputFilePostfix; + generatorIdentifier = aGeneratorIdentifier; + resourceBundle = aResourceBundle; + outputFileNameExpression = anOutputFileNameExpression; batchSize=aBatchSize; } @@ -45,8 +41,7 @@ public class ContentProducerFactory implements ProducerFactory { batchSize), generatorIdentifier, resourceBundle, - outputFilePrefix, - outputFilePostfix + outputFileNameExpression ); } catch (Exception e) { throw new ProducerException(e); diff --git a/source/mircoders/producer/NullProducer.java b/source/mircoders/producer/NullProducer.java new file mode 100755 index 00000000..7ebb7682 --- /dev/null +++ b/source/mircoders/producer/NullProducer.java @@ -0,0 +1,15 @@ +package mircoders.producer; + +import java.io.*; +import mir.producer.*; + +public class NullProducer implements mir.producer.Producer { + public NullProducer() { + } + + public void produce( PrintWriter aLogger ) throws ProducerException { + } +} + + + diff --git a/source/mircoders/producer/NullProducerFactory.java b/source/mircoders/producer/NullProducerFactory.java new file mode 100755 index 00000000..60240e93 --- /dev/null +++ b/source/mircoders/producer/NullProducerFactory.java @@ -0,0 +1,26 @@ +package mircoders.producer; + +import java.io.*; +import java.util.*; +import mir.producer.*; + +public class NullProducerFactory implements ProducerFactory { + List verbs; + + public NullProducerFactory() { + verbs = new Vector(); + } + + public void addVerb(String aVerb) { + verbs.add(aVerb); + } + + public mir.producer.Producer makeProducer(String aVerb) { + return new NullProducer(); + } + + + public Iterator verbs() { + return verbs.iterator(); + } +} diff --git a/source/mircoders/producer/ScriptCallProducer.java b/source/mircoders/producer/ScriptCallProducer.java index dc598a46..e17087a6 100755 --- a/source/mircoders/producer/ScriptCallProducer.java +++ b/source/mircoders/producer/ScriptCallProducer.java @@ -16,15 +16,15 @@ public class ScriptCallProducer implements mir.producer.Producer { Process process; int returnValue; - aLogger.println("Executing " + script + ":
"); + aLogger.println("Executing " + script + ":"); try { process = Runtime.getRuntime().exec(script); returnValue = process.waitFor(); - aLogger.println("Terminated successfully, return value = " + returnValue + ".
"); + aLogger.println("Terminated successfully, return value = " + returnValue + "."); } catch (Throwable e) { - aLogger.println("Exception has occurred: " + e.getMessage() + ":
"); + aLogger.println("Exception has occurred: " + e.getMessage() + ":"); e.printStackTrace(aLogger); throw new ProducerException(e); } diff --git a/source/mircoders/producer/StartPageProducer.java b/source/mircoders/producer/StartPageProducer.java index 8371b00d..e08595d1 100755 --- a/source/mircoders/producer/StartPageProducer.java +++ b/source/mircoders/producer/StartPageProducer.java @@ -82,22 +82,22 @@ public class StartPageProducer implements mir.producer.Producer { Generator generator = MirGlobal.localizer().generators().makeGenerator(generatorIdentifier); - aLogger.println("StartPageProducer.produce:
"); - aLogger.println("generatorIdentifier = " + generatorIdentifier + "
"); + aLogger.println("StartPageProducer.produce:"); + aLogger.println("generatorIdentifier = " + generatorIdentifier); File file = new File(outputFile); FileWriter fileWriter = new FileWriter(file); PrintWriter printWriter = new PrintWriter(fileWriter); - aLogger.println("generating: " + outputFile + "
"); + aLogger.println("generating: " + outputFile); generator.generate(printWriter, generationValues, aLogger); printWriter.close(); fileWriter.close(); - aLogger.println("done
"); + aLogger.println("done"); } catch (Exception e) { - aLogger.println("exception while generating " + outputFile + ":
"); - aLogger.println(e.getMessage() + "
"); + aLogger.println("exception while generating " + outputFile + ":"); + aLogger.println(e.getMessage()); e.printStackTrace(aLogger); aLogger.flush(); } diff --git a/source/mircoders/producer/TopicStartPageProducerFactory.java b/source/mircoders/producer/TopicStartPageProducerFactory.java new file mode 100755 index 00000000..af9e4ebf --- /dev/null +++ b/source/mircoders/producer/TopicStartPageProducerFactory.java @@ -0,0 +1,93 @@ +package mircoders.producer; + +import java.util.*; +import mir.entity.*; +import mir.producer.*; +import mir.util.*; +import mircoders.storage.*; +import mircoders.module.*; +import mircoders.entity.*; + + +public class TopicStartPageProducerFactory implements ProducerFactory { + private String generatorIdentifier; + private String resourceBundle; + private String outputFileNameExpression; + private int nrNewswireItems; + private int nrFeatures; + + public TopicStartPageProducerFactory( + String aGeneratorIdentifier, + String aResourceBundle, + String anOutputFileNameExpression, + int aNrFeatures, + int aNrNewswireItems) { + + generatorIdentifier = aGeneratorIdentifier; + resourceBundle = aResourceBundle; + outputFileNameExpression = anOutputFileNameExpression; + nrFeatures = aNrFeatures; + nrNewswireItems = aNrNewswireItems; + } + + + public mir.producer.Producer makeProducer(String aVerb) throws ProducerException { + CompositeProducer result = new CompositeProducer(); + Map values = new HashMap(); + + try { + ModuleContent contentModule = new ModuleContent(DatabaseContent.getInstance()); + ModuleTopics topicsModule = new ModuleTopics(DatabaseTopics.getInstance()); + ModuleBreaking breakingModule = new ModuleBreaking(DatabaseBreaking.getInstance()); + + EntityBrowser topicBrowser = new EntityBrowser( + DatabaseTopics.getInstance(), + "", + "", + 100); + + while (topicBrowser.hasNext()) { + Entity topic = (Entity) topicBrowser.next(); + values.put("title", topic.getValue("title")); + values.put("filename", topic.getValue("filename")); + values.put("main_url", topic.getValue("main_url")); + values.put("archiv_url", topic.getValue("archiv_url")); + + + // ML: ok, this is way to low-level for this place: + String orderBy = "webdb_create desc"; + String topicSelection = "exists (select * from content_x_topic where content_id=content.id and topic_id='"+topic.getValue("id")+"')"; + String featureWhereClause = "is_published='1' and to_article_type='2' and "+topicSelection; + String newsWireWhereClause = "is_published='1' and to_article_type='1' and "+topicSelection; + + result.addProducer( + + // "exists (select * from content_x_topic where content_id=content.id and topic_id="+topic.getValue("id") + new StartPageProducer( + generatorIdentifier, + resourceBundle, + ParameterExpander.expandExpression(values, outputFileNameExpression), + contentModule.getContent(newsWireWhereClause, orderBy, 0,nrNewswireItems), + contentModule.getContent(featureWhereClause, orderBy, 0,nrFeatures), + topicsModule .getTopicsList(), + breakingModule.getBreakingNews())); + } + + return result; + + + } + catch (Throwable e) { + throw new ProducerException(e); + } + }; + + public Iterator verbs() { + Vector verbList = new Vector(); + + verbList.add("all"); + + return verbList.iterator(); + }; +} + -- 2.11.0