several updates:
authorzapata <zapata>
Wed, 25 Sep 2002 21:27:57 +0000 (21:27 +0000)
committerzapata <zapata>
Wed, 25 Sep 2002 21:27:57 +0000 (21:27 +0000)
- all the config options are now available from the producer templates
- the producers that need to be called after an open posting are now
  configurable from config.properties
- some misc. maintenance

source/config.properties-dist
source/mir/generator/FreemarkerGenerator.java
source/mir/misc/MirConfig.java
source/mir/producer/reader/ProducerConfigReader.java
source/mir/util/ParameterExpander.java
source/mir/util/StringRoutines.java
source/mircoders/global/ProducerEngine.java
source/mircoders/localizer/basic/MirBasicOpenPostingLocalizer.java
source/mircoders/localizer/basic/MirBasicProducerAssistantLocalizer.java

index d969257..9568f46 100755 (executable)
@@ -49,9 +49,13 @@ DirectOpenposting=yes
 
 Mir.Localizer=mircoders.localizer.basic.MirBasicLocalizer
 Mir.Localizer.Logfile=log/localizer.log
-Mir.Localizer.ProducerConfigFile=templates/producer/producers.xml
 
+# The location of the producer specifiations
+Mir.Localizer.ProducerConfigFile=templates/producer/producers.xml
 
+# Which producers need to be called after an article (resp. a comment) is posted
+Mir.Localizer.OpenPosting.ContentProducers= media.new;content.new;startpage.new;synchronization.run
+Mir.Localizer.OpenPosting.CommentProducers= content.new;synchronization.run
 
 #note that you can't make pdf's without making fo's
 GenerateFO=yes
@@ -346,58 +350,3 @@ ServletModule.Language.Logfile=log/mir.log
 ServletModule.Language.ConfirmTemplate=admin/confirm.template
 ServletModule.Language.ObjektTemplate=admin/language.template
 ServletModule.Language.ListTemplate=admin/languagelist.template
-
-
-#
-# producer-related configs below
-#
-
-Producer.ExtLinkName=extlink.gif
-Producer.IntLinkName=intlink.gif
-Producer.MailLinkName=maillink.gif
-Producer.Logfile=log/producer.log
-
-Producer.Navigation.Template=producer/navigation.template
-
-Producer.Content.Template=producer/content.template
-Producer.Content.Batchsize=10
-
-Producer.PrintableContent.Template=producer/printablecontent.template
-Producer.PrintableContent.html2foStyleSheetName=producer/html2fo.xsl
-
-Producer.Startseite.Template=producer/startseite.template
-Producer.Startseite.Entries=7
-Producer.Startseite.Pages=10
-Producer.Startseite.Termine=5
-
-Producer.Themen.Template=producer/themen.template
-Producer.Themen.Entries=7
-Producer.Themen.Pages=3
-
-Producer.Schwerpunkte.Template=producer/schwerpunkte.template
-Producer.Schwerpunkte.Entries=7
-Producer.Schwerpunkte.Pages=3
-
-Producer.Overview.MonthTemplate=producer/ov_month.template
-Producer.Overview.YearTemplate=producer/ov_year.template
-
-Producer.List.Template=producer/list.template
-Producer.TopicList.Template=producer/topiclist.template
-Producer.OpenPosting.Template=producer/openposting.template
-Producer.FeatureList.Template=producer/featurelist.template
-
-Producer.StartPage.Template=producer/startpage.template
-Producer.FeaturesRSS.Template=producer/featuresRSS.template
-Producer.StartPage.Items=10
-Producer.StartPage.Newswire=30
-
-
-# todo: do we need those?
-
-Xsl.Content=producer/content.xsl
-Xsl.Fo.Content=producer/frontpage_fo.xsl
-Xsl.StartPage=producer/index.xsl
-Xsl.TopicList=producer/topic.xsl
-Xsl.OpenList=producer/open.xsl
-Xsl.Wap=producer/wml2.xsl
-ClearXslCache=no
\ No newline at end of file
index 8dc0a67..11337f6 100755 (executable)
@@ -122,23 +122,24 @@ public class FreemarkerGenerator implements Generator {
 
     public TemplateModel get(String aKey) throws TemplateModelException {
       try {
-      if (!valuesCache.containsKey(aKey)) {
-        Object value = map.get(aKey);
+        if (!valuesCache.containsKey(aKey)) {
+          Object value = map.get(aKey);
 
-  if (value == null && !map.containsKey(aKey))
-      throw new TemplateModelException("MapAdapter: no key "+aKey+" available");
+          if (value == null && !map.containsKey(aKey)) {
+            throw new TemplateModelException("MapAdapter: no key "+aKey+" available");
+          }
 
-        valuesCache.put(aKey, makeAdapter(value));
-      }
+          valuesCache.put(aKey, makeAdapter(value));
+        }
 
-      return (TemplateModel) valuesCache.get(aKey);
-    }
-    catch (TemplateModelException e) {
-      throw e;
-    }
-    catch (Throwable t) {
-      throw new TemplateModelException(t.getMessage());
-    }
+        return (TemplateModel) valuesCache.get(aKey);
+      }
+      catch (TemplateModelException e) {
+        throw e;
+      }
+      catch (Throwable t) {
+        throw new TemplateModelException(t.getMessage());
+      }
     }
   }
 
index 9db2176..042ff63 100755 (executable)
@@ -217,4 +217,8 @@ public class MirConfig extends Configuration {
     } catch (Throwable t) {}
   }
 
+  public static Map allSettings() {
+    return configHash;
+  }
+
 }
index 407eca6..7c87289 100755 (executable)
@@ -55,12 +55,11 @@ public class ProducerConfigReader {
     super();
   };
 
-  public void parseFile(String aFileName, ProducerNodeBuilderLibrary aBuilderLibrary, Map aProducerFactories) throws ConfigFailure {
+  public void parseFile(String aFileName, ProducerNodeBuilderLibrary aBuilderLibrary, Map aProducerFactories) throws ProducerConfigFailure {
     parseFile(aFileName, aBuilderLibrary, aProducerFactories, new Vector());
-
   }
 
-  public void parseFile(String aFileName, ProducerNodeBuilderLibrary aBuilderLibrary, Map aProducerFactories, List aUsedFiles) throws ConfigFailure {
+  public void parseFile(String aFileName, ProducerNodeBuilderLibrary aBuilderLibrary, Map aProducerFactories, List aUsedFiles) throws ProducerConfigFailure {
     try {
       builderLibrary = aBuilderLibrary;
       scriptedNodeBuilderLibrary = new ProducerNodeBuilderLibrary();
@@ -75,12 +74,11 @@ public class ProducerConfigReader {
       handler.includeFile(aFileName);
     }
     catch (Throwable e) {
-      if (e instanceof SAXParseException && ((SAXParseException) e).getException() instanceof ConfigFailure) {
-        throw (ConfigFailure) ((SAXParseException) e).getException();
+      if (e instanceof SAXParseException && ((SAXParseException) e).getException() instanceof ProducerConfigFailure) {
+        throw (ProducerConfigFailure) ((SAXParseException) e).getException();
       }
       else {
-        e.printStackTrace();
-        throw new ConfigFailure( e.getMessage() );
+        throw new ProducerConfigFailure( e );
       }
     }
   }
@@ -113,7 +111,7 @@ public class ProducerConfigReader {
       locator=aLocator;
     }
 
-    private void includeFile(String aFileName) throws ConfigFailure, SAXParseException, SAXException {
+    private void includeFile(String aFileName) throws ProducerConfigExc, ProducerConfigFailure, SAXParseException, SAXException {
       File file;
       SAXParser parser;
 
@@ -126,7 +124,7 @@ public class ProducerConfigReader {
         System.err.println("about to include "+file.getCanonicalPath());
 
         if (includeFileStack.contains(file.getCanonicalPath())) {
-          throw new ConfigFailure("recursive inclusion of file "+file.getCanonicalPath(), getLocatorDescription(locator));
+          throw new ProducerConfigExc("recursive inclusion of file "+file.getCanonicalPath());
         }
 
         usedFiles.add(file);
@@ -145,19 +143,19 @@ public class ProducerConfigReader {
         }
       }
       catch (ParserConfigurationException e) {
-        throw new ConfigFailure("Internal exception while including \""+aFileName+"\": "+e.getMessage(), e, getLocatorDescription(locator));
+        throw new ProducerConfigExc("Internal exception while including \""+aFileName+"\": "+e.getMessage());
       }
       catch (SAXParseException e) {
         throw e;
       }
-      catch (ConfigFailure e) {
+      catch (ProducerConfigFailure e) {
         throw e;
       }
       catch (FileNotFoundException e) {
-        throw new ConfigFailure("Include file \""+aFileName+"\" not found: "+e.getMessage(), e, getLocatorDescription(locator));
+        throw new ProducerConfigExc("Include file \""+aFileName+"\" not found: "+e.getMessage());
       }
       catch (IOException e) {
-        throw new ConfigFailure("unable to open include file \""+aFileName+"\": "+e.getMessage(), e, getLocatorDescription(locator));
+        throw new ProducerConfigExc("unable to open include file \""+aFileName+"\": "+e.getMessage());
       }
     }
 
@@ -170,7 +168,7 @@ public class ProducerConfigReader {
           String fileName=anAttributes.getValue("file");
 
           if (fileName==null) {
-            throw new ConfigFailure("include has no file attribute", getLocatorDescription(locator));
+            throw new ProducerConfigExc("include has no file attribute");
           }
 
           includeFile(fileName);
@@ -183,8 +181,10 @@ public class ProducerConfigReader {
           manager.pushHandler( manager.currentHandler().startElement(aQualifiedName, attributesMap) );
         }
       }
+      catch (ProducerConfigExc e) {
+        throw new SAXParseException(e.getMessage(), locator, new ProducerConfigExc("Config error at ["+getLocatorDescription(locator)+"]: "+e.getMessage()));
+      }
       catch (Exception e) {
-        e.printStackTrace(System.out);
         throw new SAXException(e);
       }
     }
@@ -202,8 +202,10 @@ public class ProducerConfigReader {
           }
         }
       }
+      catch (ProducerConfigExc e) {
+        throw new SAXParseException(e.getMessage(), locator, new ProducerConfigExc("Config error at ["+getLocatorDescription(locator)+"]: "+e.getMessage()));
+      }
       catch (Exception e) {
-        e.printStackTrace(System.out);
         throw new SAXException(e);
       }
     }
@@ -211,7 +213,7 @@ public class ProducerConfigReader {
     public void characters(char[] aBuffer, int aStart, int anEnd) throws SAXParseException {
       String text = new String(aBuffer, aStart, anEnd).trim();
       if ( text.length() > 0) {
-        throw new SAXParseException("Text not allowed", locator, new ConfigFailure("text not allowed", getLocatorDescription(locator)));
+        throw new SAXParseException("Text not allowed", locator, new ProducerConfigExc("Config error at ["+getLocatorDescription(locator)+"]: Text not allowed"));
       }
     }
 
@@ -391,14 +393,16 @@ public class ProducerConfigReader {
   }
 
   private final static String   PRODUCER_VERB_NAME_ATTRIBUTE = "name";
+  private final static String   PRODUCER_VERB_DESCRIPTION_ATTRIBUTE = "description";
   private final static String   PRODUCER_VERB_DEFAULT_ATTRIBUTE = "default";
   private final static String[] PRODUCER_VERB_REQUIRED_ATTRIBUTES = { PRODUCER_VERB_NAME_ATTRIBUTE };
-  private final static String[] PRODUCER_VERB_OPTIONAL_ATTRIBUTES = { PRODUCER_VERB_DEFAULT_ATTRIBUTE };
+  private final static String[] PRODUCER_VERB_OPTIONAL_ATTRIBUTES = { PRODUCER_VERB_DEFAULT_ATTRIBUTE, PRODUCER_VERB_DESCRIPTION_ATTRIBUTE };
 
   public class ProducerVerbsSectionHandler extends SectionHandler {
     private Map verbs;
     private String defaultVerb;
     private String currentVerb;
+    private String currentVerbDescription;
 
     public ProducerVerbsSectionHandler() {
       verbs = new HashMap();
@@ -422,6 +426,11 @@ public class ProducerConfigReader {
           defaultVerb = currentVerb;
         }
 
+        if (anAttributes.containsKey( PRODUCER_VERB_DESCRIPTION_ATTRIBUTE ))
+          currentVerbDescription = (String) anAttributes.get( PRODUCER_VERB_DESCRIPTION_ATTRIBUTE );
+        else
+          currentVerbDescription = "";
+
         return new ProducerNodeSectionHandler();
       }
       else throw new ProducerConfigExc("Only 'verb' tags allowed here, '" + aTag + "' encountered.");
index 96d1d66..96c7151 100755 (executable)
@@ -35,6 +35,7 @@ import multex.Failure;
 import multex.Exc;
 
 import java.util.*;
+import mir.generator.*;
 
 public class ParameterExpander {
   final static String NODE_SEPARATOR = ".";
@@ -552,14 +553,14 @@ public class ParameterExpander {
       return parseUntil(MAX_OPERATOR_LEVEL);
     }
 
-    private Object parseSet() {
+    private List parseList() {
       Token token;
       Object expression;
-      Set result = new HashSet();
+      List result = new Vector();
 
       token = scanner.scan();
       if (!(token instanceof LeftParenthesisToken)) {
-        throw new RuntimeException("( expected after in keyword");
+        throw new RuntimeException("( expected");
       }
 
       if (scanner.peek() instanceof RightParenthesisToken) {
@@ -592,6 +593,7 @@ public class ParameterExpander {
       Token token;
       Object currentValue = valueMap;
       Object qualifier;
+      List parameters;
 
       do {
         token = scanner.scan();
@@ -600,14 +602,17 @@ public class ParameterExpander {
           token = scanner.scan();
           if (!(token instanceof RightSquareBraceToken))
             throw new RuntimeException("] expected");
+
+          if (currentValue instanceof Map) {
+            currentValue = ((Map) currentValue).get(qualifier);
+          }
+          else {
+            throw new RuntimeException("cannot reference into anything other than a map");
+          }
         }
         else if (token instanceof IdentifierToken) {
           qualifier = ((IdentifierToken) token).getName();
-        }
-        else
-          throw new RuntimeException("fieldname or [ expected");
 
-        if (currentValue!=null) {
           if (currentValue instanceof Map) {
             currentValue = ((Map) currentValue).get(qualifier);
           }
@@ -615,14 +620,29 @@ public class ParameterExpander {
             throw new RuntimeException("cannot reference into anything other than a map");
           }
         }
-        else {
-          // throw? or allow null.null?
+        else if (token instanceof LeftParenthesisToken) {
+          if (currentValue instanceof Generator.GeneratorFunction) {
+            parameters = parseList();
+            try {
+              currentValue = ((Generator.GeneratorFunction) currentValue).perform(parameters);
+            }
+            catch (GeneratorExc t) {
+              throw new RuntimeException(t.getMessage());
+            }
+          }
+          else
+            throw new RuntimeException("not a function");
         }
+        else
+          throw new RuntimeException("fieldname or [ expected");
 
-        if (scanner.peek() instanceof PeriodToken)
-        {
-          scanner.scan();
+        if (scanner.peek() instanceof PeriodToken ||
+            scanner.peek() instanceof LeftSquareBraceToken ||
+            scanner.peek() instanceof LeftParenthesisToken) {
           done = false;
+
+          if (scanner.peek() instanceof PeriodToken)
+            scanner.scan();
         }
         else
           done = true;
@@ -666,7 +686,7 @@ public class ParameterExpander {
         scanner.scan();
 
         if (isINOperator(token)) {
-          value2 = parseSet();
+          value2 = parseList();
         }
         else {
           value2 = parseUntil(binaryOperatorLevel(token));
@@ -806,11 +826,11 @@ public class ParameterExpander {
 
     private Object expandOperatorExpression(Token aToken, Object aValue1, Object aValue2) {
       if (isINOperator(aToken)) {
-        if (!(aValue2 instanceof Set)) {
-          throw new RuntimeException("Internal error: set expected");
+        if (!(aValue2 instanceof List)) {
+          throw new RuntimeException("Internal error: List expected");
         }
 
-        Iterator i = ((Set) aValue2).iterator();
+        Iterator i = ((List) aValue2).iterator();
 
         while (i.hasNext()) {
           if (areEqual(aValue1, i.next()))
index 06ee501..b670ae3 100755 (executable)
@@ -32,6 +32,7 @@
 package mir.util;
 
 import java.util.*;
+import gnu.regexp.*;
 
 public class StringRoutines {
 
@@ -66,7 +67,6 @@ public class StringRoutines {
 
     do {
       nextPosition = indexOfCharacters(aText, CHARACTERS_TO_ESCAPE, position);
-      System.out.println("encodeHTML: "+ position + ":" + aText + " : " + nextPosition);
 
       if (nextPosition<0)
         nextPosition = aText.length();
@@ -86,4 +86,62 @@ public class StringRoutines {
 
     return result.toString();
   }
+
+  public static String performRegularExpressionReplacement(String aSource,
+      String aSearchExpression, String aReplacement) throws Exception {
+
+    RE regularExpression;
+
+    regularExpression = new RE(aSearchExpression);
+
+    return regularExpression.substituteAll(aSource, aReplacement);
+  }
+
+  public static boolean performRegularExpressionSearch(String aSource,
+      String aSearchExpression) throws REException {
+    RE regularExpression;
+
+    regularExpression = new RE(aSearchExpression);
+
+    return regularExpression.isMatch(aSource);
+  }
+
+/*
+  return StringUtil.createHTML(
+      StringUtil.deleteForbiddenTags(aText),
+      MirGlobal.getConfigProperty("Producer.ImageRoot"),
+      MirGlobal.getConfigProperty("Producer.MailLinkName"),
+      MirGlobal.getConfigProperty("Producer.ExtLinkName"),
+      MirGlobal.getConfigProperty("Producer.IntLinkName")
+  );
+ public static String createHTML(String content){
+         content=convertNewline2Break(content);
+         content=convertNewline2P(content);
+         content=createMailLinks(content);
+         content=createURLLinks(content);
+         return content;
+
+ public static String convertNewline2Break(String haystack) {
+         return re_newline2br.substituteAll(haystack,"$0<br />");
+ }
+
+ public static String convertNewline2P(String haystack) {
+                 return re_brbr2p.substituteAll(haystack,"\n</p><p>");
+ }
+
+ public static String createMailLinks(String haystack, String imageRoot, String mailImage) {
+         return re_mail.substituteAll(haystack,"<img src=\""+imageRoot+"/"+mailImage+"\" border=\"0\"/>&#160;<a href=\"mailto:$0\">$0</a>");
+ }
+
+ public static String createURLLinks(String haystack, String title, String imageRoot,String extImage) {
+         if (title == null) {
+                 return re_url.substituteAll(haystack,"<img src=\""+imageRoot+"/"+extImage+"\" border=\"0\"/>&#160;<a href=\"$0\">$0</a>");
+         } else {
+                 title = removeHTMLTags(title);
+                 return re_url.substituteAll(haystack,"<img src=\""+imageRoot+"/"+extImage+"\" border=\"0\"/>&#160;<a href=\"$0\">"+title+"</a>");
+         }
+ }
+
+ }
+*/
 }
\ No newline at end of file
index fba6c53..128a947 100755 (executable)
@@ -61,12 +61,23 @@ public class ProducerEngine {
   }
 
   public void addJob(String aProducerFactory, String aVerb) {
-// ML: TODO: should check if a similar job is already pending
     producerJobQueue.appendJob(new ProducerJob(aProducerFactory, aVerb));
     log.println(aProducerFactory+"."+aVerb+" added to queue");
     log.flush();
   }
 
+  public void addTask(ProducerTask aTask) {
+    addJob(aTask.getProducer(), aTask.getVerb());
+  }
+
+  public void addTasks(List aTasks) {
+    Iterator i = aTasks.iterator();
+
+    while (i.hasNext()) {
+      addTask((ProducerTask) i.next());
+    }
+  }
+
   public void printQueueStatus(PrintWriter aWriter) {
     Iterator iterator = producerJobQueue.makeJobListSnapshot().iterator();
     producerJobQueue.cleanupJobs();
@@ -200,4 +211,21 @@ public class ProducerEngine {
     }
   }
 
+  public static class ProducerTask {
+    private String producer;
+    private String verb;
+
+    public ProducerTask(String aProducer, String aVerb) {
+      producer = aProducer;
+      verb = aVerb;
+    }
+
+    public String getVerb() {
+      return verb;
+    }
+
+    public String getProducer() {
+      return producer;
+    }
+  }
 }
\ No newline at end of file
index 36f7f05..223aaa0 100755 (executable)
@@ -35,31 +35,35 @@ import java.util.*;
 import javax.servlet.http.*;
 
 import mir.misc.*;
+import mir.util.*;
 import mircoders.global.*;
 import mircoders.localizer.*;
 import mircoders.entity.*;
 
 public class MirBasicOpenPostingLocalizer implements MirOpenPostingLocalizer {
+  private List afterContentProducerTasks;
+  private List afterCommentProducerTasks;
+
   protected static Logfile logger = Logfile.getInstance( MirGlobal.getConfigProperty("Home") + "/" + MirGlobal.getConfigProperty("Mir.Localizer.Logfile"));
 
+  public MirBasicOpenPostingLocalizer() {
+    String contentProducers = MirGlobal.getConfigProperty("Mir.Localizer.OpenPosting.ContentProducers");
+    String commentProducers = MirGlobal.getConfigProperty("Mir.Localizer.OpenPosting.CommentProducers");
+
+    afterContentProducerTasks = parseProducerTaskList(contentProducers);
+    afterCommentProducerTasks = parseProducerTaskList(commentProducers);
+  }
+
   public void afterContentPosting() {
-    MirGlobal.producerEngine().addJob("media", "new");
-    MirGlobal.producerEngine().addJob("content", "new");
-    MirGlobal.producerEngine().addJob("startpage", "(default)");
-    MirGlobal.producerEngine().addJob("synchronization", "run");
-
-    MirGlobal.producerEngine().addJob("openposting", "new");
-    MirGlobal.producerEngine().addJob("topics", "new");
-    MirGlobal.producerEngine().addJob("synchronization", "run");
+    MirGlobal.producerEngine().addTasks(afterContentProducerTasks);
   }
 
   public void afterContentPosting(EntityContent aContent) {
     afterContentPosting();
   }
-  
+
   public void afterCommentPosting() {
-    MirGlobal.producerEngine().addJob("content", "new");
-    MirGlobal.producerEngine().addJob("synchronization", "run");
+    MirGlobal.producerEngine().addTasks(afterCommentProducerTasks);
   }
 
   public void afterCommentPosting(EntityComment aComment) {
@@ -71,4 +75,22 @@ public class MirBasicOpenPostingLocalizer implements MirOpenPostingLocalizer {
 
     return locale.getLanguage();
   }
+
+  protected List parseProducerTaskList(String aList) {
+    Iterator i;
+    List result = new Vector();
+
+    i = ParameterExpander.splitString(aList, ";").iterator();
+    while (i.hasNext()) {
+      String taskExpression = (String) i.next();
+      List parts = ParameterExpander.splitString(taskExpression, ".");
+
+      if (parts.size()!=2)
+        logger.printError("Invalid producer expression: '" + taskExpression + "'");
+      else
+        result.add(new ProducerEngine.ProducerTask((String) parts.get(0), (String) parts.get(1)));
+    }
+
+    return result;
+  }
 }
index 5a01041..3f46373 100755 (executable)
@@ -36,6 +36,7 @@ import java.io.*;
 import freemarker.template.utility.*;
 import mir.misc.*;
 import mir.entity.*;
+import mir.entity.adapter.*;
 import mir.util.*;
 import mircoders.module.*;
 import mircoders.storage.*;
@@ -46,11 +47,12 @@ public class MirBasicProducerAssistantLocalizer implements MirProducerAssistantL
   protected static Logfile logger = Logfile.getInstance( MirGlobal.getConfigProperty("Home") + "/" + MirGlobal.getConfigProperty("Mir.Localizer.Logfile"));
 
   public void initializeGenerationValueSet(Map aValueSet) {
-    // ML: these config settings will be included more beautifully as soon as the new config system is in place
+    Iterator i;
 
     Map configMap = new HashMap();
     Map utilityMap = new HashMap();
 
+// obsolete:
     configMap.put("producerDocRoot", MirGlobal.getConfigProperty("Producer.DocRoot"));
     configMap.put("storageRoot", MirGlobal.getConfigProperty("Producer.StorageRoot"));
     configMap.put("productionHost", MirGlobal.getConfigProperty("Producer.ProductionHost"));
@@ -64,7 +66,9 @@ public class MirBasicProducerAssistantLocalizer implements MirProducerAssistantL
     configMap.put("imagePath", MirGlobal.getConfigProperty("Producer.Image.Path"));
     configMap.put("mirVersion", MirGlobal.getConfigProperty("Mir.Version"));
     configMap.put("defEncoding", MirGlobal.getConfigProperty("Mir.DefaultEncoding"));
-    configMap.put("all", Configuration.getConfs());
+
+// "new":
+    configMap.putAll( MirConfig.allSettings() );
 
     utilityMap.put("compressWhitespace", new freemarker.template.utility.CompressWhitespace() );
     utilityMap.put("encodeHTML", new GeneratorHTMLFunctions.encodeHTMLGeneratorFunction());
@@ -79,13 +83,10 @@ public class MirBasicProducerAssistantLocalizer implements MirProducerAssistantL
     EntityList languageList=null;
 
     try {
-//      ModuleLinksImcs linksImcsModule = new ModuleLinksImcs(DatabaseLinksImcs.getInstance());
       ModuleTopics topicsModule = new ModuleTopics(DatabaseTopics.getInstance());
       ModuleLanguage languageModule = new ModuleLanguage(DatabaseLanguage.getInstance());
 
       topicList = topicsModule.getTopicsList();
-//      entityList = linksImcsModule.getByWhereClause("", "sortpriority, title", -1);
-//      parentList = linksImcsModule.getByWhereClause("to_parent_id=NULL", "sortpriority, title", -1);
       languageList = languageModule.getByWhereClause("", "id", -1);
     }
     catch (Throwable t) {
@@ -102,6 +103,20 @@ public class MirBasicProducerAssistantLocalizer implements MirProducerAssistantL
     articleTypeMap.put("feature", "2");
     articleTypeMap.put("topicspecial", "3");
     articleTypeMap.put("startspecial", "4");
+
+    try {
+      i = new EntityIteratorAdapter( "", "", 20, MirGlobal.localizer().dataModel().adapterModel(), "articleType"  );
+
+      while (i.hasNext()) {
+        EntityAdapter articleType = (EntityAdapter) i.next();
+
+        articleTypeMap.put(articleType.get("name"), articleType.get("id"));
+      }
+    }
+    catch (Throwable t) {
+      logger.printError("initializeGenerationValueSet: Exception "+t.getMessage());
+    }
+
     aValueSet.put("articletype", articleTypeMap);
   };