support added for local additions to admin.properties
authorzapata <zapata>
Sat, 14 Dec 2002 15:54:58 +0000 (15:54 +0000)
committerzapata <zapata>
Sat, 14 Dec 2002 15:54:58 +0000 (15:54 +0000)
15 files changed:
bundles/admin_de.properties
bundles/admin_en.properties
bundles/admin_es.properties
etc/bundles/adminlocal.properties [new file with mode: 0755]
source/mir/misc/HTMLTemplateProcessor.java
source/mir/misc/MessageMethodModel.java
source/mir/servlet/ServletModule.java
source/mir/util/ResourceBundleGeneratorFunction.java
source/mircoders/servlet/ServletHelper.java
source/mircoders/servlet/ServletModuleProducer.java
templates/admin/comment.template
templates/admin/commentlist.template
templates/admin/content.template
templates/admin/contentlist.template
templates/admin/start_admin.template

index cb0e71e..d8ab36f 100755 (executable)
@@ -1,6 +1,6 @@
 ########## admin ##########
 # language: deutsch / german
-# $Id: admin_de.properties,v 1.20 2002/12/13 21:00:03 zapata Exp $
+# $Id: admin_de.properties,v 1.21 2002/12/14 15:55:23 zapata Exp $
 
 # general
 yes=ja
@@ -238,6 +238,7 @@ start.content.with_comments=mit internen kommentaren
 start.content.all=alle
 start.content.search=Suche
 
+start.allarticlesoftype=alle Artikel vom Typ {0}
 
 start.generate.title=MANUELL GENERIEREN
 start.generate.all.title=Alle Bereiche
@@ -320,6 +321,15 @@ head.logged_in=logged in
 foot.top=top
 
 
+# article types
+articletypes.openposting=Open posting
+articletypes.newswire=Newswire
+articletypes.feature=Feature
+articletypes.topicspecial=Themen special
+articletypes.startspecial=Startpage special
+
+
+
 ########## error ##########
 
 error.htmltitle=das system ist der fehler
index 4f1fd47..ecf1b36 100755 (executable)
@@ -1,6 +1,6 @@
 ########## admin ##########
 # language: english
-# $Id: admin_en.properties,v 1.28 2002/12/13 21:00:03 zapata Exp $
+# $Id: admin_en.properties,v 1.29 2002/12/14 15:55:23 zapata Exp $
 
 # general
 yes=yes
@@ -232,10 +232,6 @@ start.content.title=ARTICLES
 start.content.new=new article
 start.show=show
 
-start.content.newswire=newswire
-start.content.feature=feature
-start.content.topicspecial=topic-specials
-start.content.startspecial=startpage-specials
 start.content.hidden=hidden articles
 start.content.not_published=not (yet) published articles
 start.content.with_media=with media
@@ -244,6 +240,8 @@ start.content.with_comments=with internal comments
 start.content.all=all articles
 start.content.search=search
 
+start.allarticlesoftype=View all "{0}" articles
+
 
 start.producers.title=GENERATE MANUALLY
 start.producers.produceAllNew=Generate all new
@@ -345,7 +343,15 @@ head.logged_in=logged in
 foot.top=top
 
 
+# Article types
+articletypes.openposting=Open posting
+articletypes.newswire=Newswire
+articletypes.feature=Feature
+articletypes.topicspecial=Topic-special
+articletypes.startspecial=Startpage-special
 
+# Comment status values
+commentstatus.normal=Normal
 
 ########## error ##########
 
index 6feb736..4176ace 100755 (executable)
@@ -1,6 +1,6 @@
 ########## admin ##########
 # language: espanol / spanish
-# $Id: admin_es.properties,v 1.12 2002/12/13 21:00:03 zapata Exp $
+# $Id: admin_es.properties,v 1.13 2002/12/14 15:55:23 zapata Exp $
 
 # general
 yes=sí
@@ -179,6 +179,8 @@ login.language.qu=Quechua
 login.language.tr=Turkish
 login.submit=  Envíar
 
+
+
 # mediafolder
 mediafolder.htmltitle=carpeta de recursos mediáticos
 mediafolder.date=fecha
@@ -220,10 +222,7 @@ start.breaking.new=
 start.content.title=ARTICULOS
 start.content.new=nuevos artículos
 start.show=mostrar
-start.content.newswire=newswire
-start.content.feature=presentación
-start.content.topicspecial=especiales-por-tema
-start.content.startspecial=especiales-página-de-inicio
+
 start.content.not_published=artículos aun sin publicar
 start.content.with_media=con recursos mediáticos
 start.content.last_changes=últimos cambios
@@ -253,7 +252,9 @@ start.content.hidden=hidden articles                                # needs to b
 start.editfiles.title=EDIT FILES                                    # needs to be translated
 start.editfiles.include=Include files                               # needs to be translated
 
-start.superusermenu=Superuser menu (use with care!) # needs translation\r
+start.superusermenu=Superuser menu (use with care!) # needs translation
+
+start.allarticlesoftype=Todos articulos con type {0}\r
 
 
 
@@ -337,6 +338,13 @@ head.logged_in=est
 foot.top=arriba
 
 
+# article types
+articletypes.openposting=Envio abierto
+articletypes.newswire=Newswire
+articletypes.feature=Presentación
+articletypes.topicspecial=Especiale-por-tema
+articletypes.startspecial=Especiale-página-de-inicio
+
 
 
 ########## error ##########
diff --git a/etc/bundles/adminlocal.properties b/etc/bundles/adminlocal.properties
new file mode 100755 (executable)
index 0000000..7395e48
--- /dev/null
@@ -0,0 +1,3 @@
+# put your own local admin properties in this file
+# (like for custom article types)
+
index 7b4cef9..fb3b612 100755 (executable)
-/*
- * Copyright (C) 2001, 2002  The Mir-coders group
- *
- * This file is part of Mir.
- *
- * Mir is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * Mir is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Mir; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- * In addition, as a special exception, The Mir-coders gives permission to link
- * the code of this program with the com.oreilly.servlet library, any library
- * licensed under the Apache Software License, The Sun (tm) Java Advanced
- * Imaging library (JAI), The Sun JIMI library (or with modified versions of
- * the above that use the same license as the above), and distribute linked
- * combinations including the two.  You must obey the GNU General Public
- * License in all respects for all of the code used other than the above
- * mentioned libraries.  If you modify this file, you may extend this exception
- * to your version of the file, but you are not obligated to do so.  If you do
- * not wish to do so, delete this exception statement from your version.
- */
-
-package mir.misc;
-
-import freemarker.template.*;
-import mir.util.*;
-import mir.generator.*;
-import mir.entity.Entity;
-import mir.entity.EntityList;
-import mir.storage.StorageObjectException;
-import org.apache.struts.util.MessageResources;
-
-import javax.servlet.http.HttpServletResponse;
-import java.io.PrintWriter;
-import java.net.URLEncoder;
-import java.util.*;
-
-
-/**
- * Hilfsklasse zum Mergen von Template und Daten
- */
-public final class HTMLTemplateProcessor {
-
-    public static String templateDir;
-    private static FileTemplateCache templateCache;
-    private static Logfile theLog;
-    private static String docRoot;
-    private static String actionRoot;
-
-    static {
-        templateDir = MirConfig.getPropWithHome("HTMLTemplateProcessor.Dir");
-        templateCache = new FileTemplateCache(templateDir);
-        templateCache.setLoadingPolicy(templateCache.LOAD_ON_DEMAND);
-        // gone in freemarker 1.7.1: templateCache.startAutoUpdate();
-        theLog = Logfile.getInstance(MirConfig.getPropWithHome("HTMLTemplateProcessor.Logfile"));
-
-        docRoot = MirConfig.getProp("RootUri");
-        try {
-            actionRoot = docRoot + MirConfig.getProp("Producer.ActionServlet");
-        } catch (ConfigException ce) {
-            // if  Producer.ActionServlet is not set in the conf file
-            actionRoot = docRoot + "/Mir";
-        }
-    }
-
-    /**
-     * empty private constructor, to avoid instantiation
-     */
-    private HTMLTemplateProcessor() {
-    }
-
-
-    // process-methods to merge different datastructures
-    // with freemarker templates
-
-
-    /**
-     * Wandelt <code>anEntity</code> in freemarker-Struktur um, mischt die Daten mit
-     * Template <code>templateFilename</code> und gibt das Ergebnis an den PrintWriter
-     * <code>out</code>
-     *
-     * @param templateFilename
-     * @param anEntity
-     * @param out
-     * @exception HTMLParseException
-     */
-
-    public static void process(String templateFilename, Entity anEntity, PrintWriter out)
-            throws HTMLParseException {
-        if (anEntity == null)
-            throw new HTMLParseException("entity is empty!");
-        else
-            process(templateFilename, anEntity, out);
-    }
-
-
-    /**
-     * Wandelt Liste mit Entities <code>entList</code> in freemarker-Struktur um, mischt die Daten mit
-     * Template <code>templateFilename</code> und gibt das Ergebnis an den PrintWriter
-     * <code>out</code>
-     *
-     * @param templateFilename
-     * @param entList
-     * @param out
-     * @exception HTMLParseException
-     */
-    public static void process(HttpServletResponse res, String templateFilename,
-                               EntityList entList, PrintWriter out, Locale locale)
-            throws HTMLParseException {
-        process(res, templateFilename, entList, (String) null, (TemplateModelRoot) null, out, locale);
-    }
-
-    /**
-     * Wandelt Entitylist in freemarker-Struktur um, fügt <code>additionalModel</code>
-     * unter dem Namen <code>additionalModelName</code> ein und mischt die Daten mit
-     * Template <code>templateFilename</code> und gibt das Ergebnis an den PrintWriter
-     * <code>out</code>
-     *
-     * @param templateFilename
-     * @param entList
-     * @param additionalModelName
-     * @param additionalModel
-     * @param out
-     * @exception HTMLParseException
-     */
-    public static void process(HttpServletResponse res, String templateFilename,
-                               EntityList entList, String additionalModelName,
-                               TemplateModelRoot additionalModel, PrintWriter out,
-                               Locale locale)
-            throws HTMLParseException {
-
-        SimpleHash modelRoot = new SimpleHash();
-
-        if (entList == null) {
-            process(null, templateFilename, modelRoot, out, locale);
-        } else {
-            try {
-                modelRoot = makeSimpleHashWithEntitylistInfos(entList);
-
-                // Quickhack um mal ein Popup mit reinzunhemen ..
-                if (additionalModelName != null && additionalModel != null)
-                    modelRoot.put(additionalModelName, additionalModel);
-
-                process(res, templateFilename, modelRoot, out, locale);
-            } catch (StorageObjectException e) {
-                throw new HTMLParseException(e.toString());
-            }
-        }
-    }
-
-    /**
-     * Gibt Template <code>templateFilename</code> an den PrintWriter
-     * <code>out</code>
-     *
-     * @param templateFilename
-     * @param mergeData
-     * @param out
-     * @exception HTMLParseException
-     */
-    public static void process(String templateFilename, PrintWriter out,
-                               Locale locale)
-            throws HTMLParseException {
-        process(null, templateFilename, (TemplateModelRoot) null, out, locale);
-    }
-
-
-    /**
-     * Mischt die freemarker-Struktur <code>tmr</code> mit
-     * Template <code>templateFilename</code> und gibt das Ergebnis an den PrintWriter
-     * <code>out</code>
-     *
-     * @param templateFilename
-     * @param mergeData
-     * @param out
-     * @exception HTMLParseException
-     */
-    public static void process(HttpServletResponse res, String templateFilename,
-                               TemplateModelRoot tmr, PrintWriter out, Locale locale)
-            throws HTMLParseException {
-        process(res, templateFilename, tmr, null, out, locale, "bundles.admin");
-        // this method is
-    }
-
-    /**
-     * Mischt die freemarker-Struktur <code>tmr</code> mit
-     * Template <code>templateFilename</code> und gibt das Ergebnis an den PrintWriter
-     * <code>out</code>
-     *
-     * @param templateFilename
-     * @param mergeData
-     * @param out
-     * @exception HTMLParseException
-     */
-    public static void process(HttpServletResponse res, String templateFilename,
-                               TemplateModelRoot tmr, TemplateModelRoot extra,
-                               PrintWriter out, Locale locale, String bundles)
-            throws HTMLParseException {
-        if (out == null) throw new HTMLParseException("no outputstream");
-        Template tmpl = getTemplateFor(templateFilename);
-        if (tmpl == null) throw new HTMLParseException("no template: " + templateFilename);
-        if (tmr == null) tmr = new SimpleHash();
-
-        /** @todo  what is this for? (rk) */
-        String session = "";
-        if (res != null) {
-            session = res.encodeURL("");
-        }
-
-        SimpleHash configHash = new SimpleHash();
-
-        // pass the whole config hash to the templates
-        Enumeration en = MirConfig.getResourceKeys();
-        String key;
-        while (en.hasMoreElements()) {
-            key = (String) en.nextElement();
-            configHash.put(key, new SimpleScalar(MirConfig.getProp(key)));
-        }
-
-        // this does not come directly from the config file
-        configHash.put("docRoot", new SimpleScalar(docRoot));
-        configHash.put("actionRoot", new SimpleScalar(actionRoot + session));
-        configHash.put("now", new SimpleScalar(StringUtil.date2readableDateTime(new GregorianCalendar())));
-
-        // this conform to updated freemarker syntax
-        configHash.put("compressWhitespace", new freemarker.template.utility.CompressWhitespace());
-
-        SimpleHash utilityHash = new SimpleHash();
-        try {
-          utilityHash.put("compressWhitespace", new freemarker.template.utility.CompressWhitespace());
-          utilityHash.put("encodeURI", FreemarkerGenerator.makeAdapter(new GeneratorHTMLFunctions.encodeURIGeneratorFunction()));
-          utilityHash.put("encodeHTML", FreemarkerGenerator.makeAdapter(new GeneratorHTMLFunctions.encodeHTMLGeneratorFunction()));
-          utilityHash.put("isOdd", FreemarkerGenerator.makeAdapter(new GeneratorIntegerFunctions.isOddFunction()));
-          utilityHash.put("increment", FreemarkerGenerator.makeAdapter(new GeneratorIntegerFunctions.incrementFunction()));
-        }
-        catch (Throwable t) {
-          throw new HTMLParseException(t.getMessage());
-        }
-
-
-        SimpleHash outPutHash = new SimpleHash();
-
-        if (extra != null) {
-            outPutHash.put("extra", extra);
-            try {
-                while (((SimpleList) extra).hasNext()) {
-                    theLog.printDebugInfo(((SimpleList) extra).next().toString());
-                }
-            } catch (Exception e) {
-            }
-        }
-        outPutHash.put("data", tmr);
-        outPutHash.put("config", configHash);
-        outPutHash.put("utility", utilityHash);
-
-        MessageResources messages = MessageResources.getMessageResources(bundles);
-        outPutHash.put("lang", new MessageMethodModel(locale, messages));
-
-        tmpl.process(outPutHash, out);
-    }
-
-
-    /**
-     *   Converts Entity-List to SimpleList of SimpleHashes.
-     *   @param aList ist eine Liste von Entity
-     *   @return eine freemarker.template.SimpleList von SimpleHashes.
-     *
-     *    @deprecated EntityLists comply with TemplateListModel now.
-     */
-    public static SimpleList makeSimpleList(EntityList aList) throws StorageObjectException {
-        theLog.printWarning("## using deprecated makeSimpleList(entityList) - a waste of resources");
-        SimpleList simpleList = new SimpleList();
-        if (aList != null) {
-            for (int i = 0; i < aList.size(); i++) {
-                simpleList.add(aList.elementAt(i));
-            }
-        }
-        return simpleList;
-    }
-
-    /**
-     *  Konvertiert ein EntityList in ein freemarker.template.SimpleHash-Modell. Im Hash
-     *  sind die einzelnen Entities ueber ihre id zu erreichen.
-     *  @param aList ist die EntityList
-     *  @return SimpleHash mit den entsprechenden freemarker Daten
-     *
-     */
-    public static SimpleHash makeSimpleHash(EntityList aList) throws StorageObjectException {
-        SimpleHash simpleHash = new SimpleHash();
-        Entity currentEntity;
-
-        if (aList != null) {
-            for (int i = 0; i < aList.size(); i++) {
-                currentEntity = (Entity) aList.elementAt(i);
-                simpleHash.put(currentEntity.getId(), currentEntity);
-            }
-        }
-        return simpleHash;
-    }
-
-    /**
-     *  Konvertiert ein Hashtable mit den keys und values als String
-     *  in ein freemarker.template.SimpleHash-Modell
-     *  @param mergeData der HashMap mit den String / String Daten
-     *  @return SimpleHash mit den entsprechenden freemarker Daten
-     *
-     */
-    public static SimpleHash makeSimpleHash(HashMap mergeData) {
-        SimpleHash modelRoot = new SimpleHash();
-        String aField;
-        if (mergeData != null) {
-            Set set = mergeData.keySet();
-            Iterator it = set.iterator();
-            for (int i = 0; i < set.size(); i++) {
-                aField = (String) it.next();
-                modelRoot.put(aField, (String) mergeData.get(aField));
-            }
-        }
-        return modelRoot;
-    }
-
-
-    /**
-     * Converts EntityList in SimpleHash and adds additional information
-     * to the returned SimpleHash
-     *
-     * @param entList
-     * @return SimpleHash returns SimpleHash with the converted EntityList plus
-     *        additional Data about the list.
-     * @exception StorageObjectException
-     */
-
-    public static SimpleHash makeSimpleHashWithEntitylistInfos(EntityList entList) throws StorageObjectException {
-        SimpleHash modelRoot = new SimpleHash();
-        if (entList != null) {
-            modelRoot.put("contentlist", entList);
-            modelRoot.put("count", new SimpleScalar((new Integer(entList.getCount())).toString()));
-            if (entList.getWhere() != null) {
-                modelRoot.put("where", new SimpleScalar(entList.getWhere()));
-                modelRoot.put("where_encoded", new SimpleScalar(URLEncoder.encode(entList.getWhere())));
-            }
-            if (entList.getOrder() != null) {
-                modelRoot.put("order", new SimpleScalar(entList.getOrder()));
-                modelRoot.put("order_encoded", new SimpleScalar(URLEncoder.encode(entList.getOrder())));
-            }
-            modelRoot.put("from", new SimpleScalar((new Integer(entList.getFrom())).toString()));
-            modelRoot.put("to", new SimpleScalar((new Integer(entList.getTo())).toString()));
-
-            if (entList.hasNextBatch())
-                modelRoot.put("next", new SimpleScalar((new Integer(entList.getNextBatch())).toString()));
-            if (entList.hasPrevBatch())
-                modelRoot.put("prev", new SimpleScalar((new Integer(entList.getPrevBatch())).toString()));
-        }
-        return modelRoot;
-    }
-
-    /**
-     * Private methods to get template from a templateFilename
-     * @param templateFilename
-     * @return Template
-     * @exception HTMLParseException
-     */
-    private static Template getTemplateFor(String templateFilename) throws HTMLParseException {
-        Template returnTemplate = null;
-        if (templateFilename != null)
-            returnTemplate = (Template) templateCache.getItem(templateFilename, "template");
-
-
-        if (returnTemplate == null) {
-            theLog.printError("CACHE (ERR): Unknown template: " + templateFilename);
-            throw new HTMLParseException("Templatefile: " + templateFilename + " not found.");
-        }
-
-        return returnTemplate;
-    }
-
-    public static void stopAutoUpdate() {
-        templateCache.stopAutoUpdate();
-        templateCache = null;
-    }
-
-}
+/*\r
+ * Copyright (C) 2001, 2002  The Mir-coders group\r
+ *\r
+ * This file is part of Mir.\r
+ *\r
+ * Mir is free software; you can redistribute it and/or modify\r
+ * it under the terms of the GNU General Public License as published by\r
+ * the Free Software Foundation; either version 2 of the License, or\r
+ * (at your option) any later version.\r
+ *\r
+ * Mir is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with Mir; if not, write to the Free Software\r
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
+ *\r
+ * In addition, as a special exception, The Mir-coders gives permission to link\r
+ * the code of this program with the com.oreilly.servlet library, any library\r
+ * licensed under the Apache Software License, The Sun (tm) Java Advanced\r
+ * Imaging library (JAI), The Sun JIMI library (or with modified versions of\r
+ * the above that use the same license as the above), and distribute linked\r
+ * combinations including the two.  You must obey the GNU General Public\r
+ * License in all respects for all of the code used other than the above\r
+ * mentioned libraries.  If you modify this file, you may extend this exception\r
+ * to your version of the file, but you are not obligated to do so.  If you do\r
+ * not wish to do so, delete this exception statement from your version.\r
+ */\r
+\r
+package mir.misc;\r
+\r
+import freemarker.template.*;\r
+import mir.util.*;\r
+import mir.generator.*;\r
+import mir.entity.Entity;\r
+import mir.entity.EntityList;\r
+import mir.storage.StorageObjectException;\r
+import org.apache.struts.util.MessageResources;\r
+\r
+import javax.servlet.http.HttpServletResponse;\r
+import java.io.PrintWriter;\r
+import java.net.URLEncoder;\r
+import java.util.*;\r
+\r
+\r
+/**\r
+ * Hilfsklasse zum Mergen von Template und Daten\r
+ */\r
+public final class HTMLTemplateProcessor {\r
+\r
+  public static String templateDir;\r
+  private static FileTemplateCache templateCache;\r
+  private static Logfile theLog;\r
+  private static String docRoot;\r
+  private static String actionRoot;\r
+\r
+  static {\r
+    templateDir = MirConfig.getPropWithHome("HTMLTemplateProcessor.Dir");\r
+    templateCache = new FileTemplateCache(templateDir);\r
+    templateCache.setLoadingPolicy(templateCache.LOAD_ON_DEMAND);\r
+    // gone in freemarker 1.7.1: templateCache.startAutoUpdate();\r
+    theLog = Logfile.getInstance(MirConfig.getPropWithHome(\r
+        "HTMLTemplateProcessor.Logfile"));\r
+\r
+    docRoot = MirConfig.getProp("RootUri");\r
+    try {\r
+      actionRoot = docRoot + MirConfig.getProp("Producer.ActionServlet");\r
+    }\r
+    catch (ConfigException ce) {\r
+      // if  Producer.ActionServlet is not set in the conf file\r
+      actionRoot = docRoot + "/Mir";\r
+    }\r
+  }\r
+\r
+  /**\r
+   * empty private constructor, to avoid instantiation\r
+   */\r
+  private HTMLTemplateProcessor() {\r
+  }\r
+\r
+  // process-methods to merge different datastructures\r
+  // with freemarker templates\r
+\r
+  /**\r
+       * Wandelt <code>anEntity</code> in freemarker-Struktur um, mischt die Daten mit\r
+   * Template <code>templateFilename</code> und gibt das Ergebnis an den PrintWriter\r
+   * <code>out</code>\r
+   *\r
+   * @param templateFilename\r
+   * @param anEntity\r
+   * @param out\r
+   * @exception HTMLParseException\r
+   */\r
+\r
+  public static void process(String templateFilename, Entity anEntity,\r
+                             PrintWriter out) throws HTMLParseException {\r
+    if (anEntity == null)\r
+      throw new HTMLParseException("entity is empty!");\r
+    else\r
+      process(templateFilename, anEntity, out);\r
+  }\r
+\r
+  /**\r
+   * Wandelt Liste mit Entities <code>entList</code> in freemarker-Struktur um, mischt die Daten mit\r
+   * Template <code>templateFilename</code> und gibt das Ergebnis an den PrintWriter\r
+   * <code>out</code>\r
+   *\r
+   * @param templateFilename\r
+   * @param entList\r
+   * @param out\r
+   * @exception HTMLParseException\r
+   */\r
+  public static void process(HttpServletResponse res, String templateFilename,\r
+   EntityList entList, PrintWriter out, Locale locale) throws HTMLParseException {\r
+    process(res, templateFilename, entList, (String)null, (TemplateModelRoot)null,\r
+            out, locale);\r
+  }\r
+\r
+  /**\r
+   * Wandelt Entitylist in freemarker-Struktur um, fügt <code>additionalModel</code>\r
+       * unter dem Namen <code>additionalModelName</code> ein und mischt die Daten mit\r
+   * Template <code>templateFilename</code> und gibt das Ergebnis an den PrintWriter\r
+   * <code>out</code>\r
+   *\r
+   * @param templateFilename\r
+   * @param entList\r
+   * @param additionalModelName\r
+   * @param additionalModel\r
+   * @param out\r
+   * @exception HTMLParseException\r
+   */\r
+  public static void process(HttpServletResponse res, String templateFilename,\r
+                             EntityList entList, String additionalModelName,\r
+                             TemplateModelRoot additionalModel, PrintWriter out,\r
+                             Locale locale) throws HTMLParseException {\r
+\r
+    SimpleHash modelRoot = new SimpleHash();\r
+\r
+    if (entList == null) {\r
+      process(null, templateFilename, modelRoot, out, locale);\r
+    }\r
+    else {\r
+      try {\r
+        modelRoot = makeSimpleHashWithEntitylistInfos(entList);\r
+\r
+        // Quickhack um mal ein Popup mit reinzunhemen ..\r
+        if (additionalModelName != null && additionalModel != null)\r
+          modelRoot.put(additionalModelName, additionalModel);\r
+\r
+        process(res, templateFilename, modelRoot, out, locale);\r
+      }\r
+      catch (StorageObjectException e) {\r
+        throw new HTMLParseException(e.toString());\r
+      }\r
+    }\r
+  }\r
+\r
+  /**\r
+   * Gibt Template <code>templateFilename</code> an den PrintWriter\r
+   * <code>out</code>\r
+   *\r
+   * @param templateFilename\r
+   * @param mergeData\r
+   * @param out\r
+   * @exception HTMLParseException\r
+   */\r
+  public static void process(String templateFilename, PrintWriter out,\r
+                             Locale locale) throws HTMLParseException {\r
+    process(null, templateFilename, (TemplateModelRoot)null, out, locale);\r
+  }\r
+\r
+  /**\r
+   * Mischt die freemarker-Struktur <code>tmr</code> mit\r
+   * Template <code>templateFilename</code> und gibt das Ergebnis an den PrintWriter\r
+   * <code>out</code>\r
+   *\r
+   * @param templateFilename\r
+   * @param mergeData\r
+   * @param out\r
+   * @exception HTMLParseException\r
+   */\r
+  public static void process(HttpServletResponse res, String templateFilename,\r
+                             TemplateModelRoot tmr, PrintWriter out,\r
+                             Locale locale) throws HTMLParseException {\r
+    process(res, templateFilename, tmr, null, out, locale);\r
+  }\r
+\r
+  public static void process(HttpServletResponse res, String templateFilename,\r
+                             TemplateModelRoot tmr, TemplateModelRoot extra,\r
+                             PrintWriter out, Locale locale) throws HTMLParseException {\r
+    process(res, templateFilename, tmr, extra, out, locale, "bundles.adminlocal", "bundles.admin");\r
+  }\r
+\r
+  public static void process(HttpServletResponse res, String templateFilename,\r
+       TemplateModelRoot tmr, TemplateModelRoot extra, PrintWriter out,\r
+       Locale locale, String bundles) throws HTMLParseException {\r
+    process(res, templateFilename, tmr, extra, out, locale, bundles, null);\r
+  }\r
+\r
+  /**\r
+   * Mischt die freemarker-Struktur <code>tmr</code> mit\r
+   * Template <code>templateFilename</code> und gibt das Ergebnis an den PrintWriter\r
+   * <code>out</code>\r
+   *\r
+   * @param templateFilename\r
+   * @param mergeData\r
+   * @param out\r
+   * @exception HTMLParseException\r
+   */\r
+  public static void process(HttpServletResponse res, String templateFilename,\r
+                             TemplateModelRoot tmr, TemplateModelRoot extra,\r
+                             PrintWriter out, Locale locale, String bundles,\r
+                             String bundles2) throws\r
+      HTMLParseException {\r
+    if (out == null)\r
+      throw new HTMLParseException("no outputstream");\r
+    Template tmpl = getTemplateFor(templateFilename);\r
+    if (tmpl == null)\r
+      throw new HTMLParseException("no template: " + templateFilename);\r
+    if (tmr == null)\r
+      tmr = new SimpleHash();\r
+\r
+      /** @todo  what is this for? (rk) */\r
+    String session = "";\r
+    if (res != null) {\r
+      session = res.encodeURL("");\r
+    }\r
+\r
+    SimpleHash configHash = new SimpleHash();\r
+\r
+    // pass the whole config hash to the templates\r
+    Enumeration en = MirConfig.getResourceKeys();\r
+    String key;\r
+    while (en.hasMoreElements()) {\r
+      key = (String) en.nextElement();\r
+      configHash.put(key, new SimpleScalar(MirConfig.getProp(key)));\r
+    }\r
+\r
+    // this does not come directly from the config file\r
+    configHash.put("docRoot", new SimpleScalar(docRoot));\r
+    configHash.put("actionRoot", new SimpleScalar(actionRoot + session));\r
+    configHash.put("now",\r
+                   new SimpleScalar(StringUtil.date2readableDateTime(new GregorianCalendar())));\r
+\r
+    // this conform to updated freemarker syntax\r
+    configHash.put("compressWhitespace",\r
+                   new freemarker.template.utility.CompressWhitespace());\r
+\r
+    SimpleHash utilityHash = new SimpleHash();\r
+    try {\r
+      utilityHash.put("compressWhitespace",\r
+                      new freemarker.template.utility.CompressWhitespace());\r
+      utilityHash.put("encodeURI",\r
+                      FreemarkerGenerator.makeAdapter(new GeneratorHTMLFunctions.\r
+          encodeURIGeneratorFunction()));\r
+      utilityHash.put("encodeHTML",\r
+                      FreemarkerGenerator.makeAdapter(new GeneratorHTMLFunctions.\r
+          encodeHTMLGeneratorFunction()));\r
+      utilityHash.put("isOdd",\r
+                      FreemarkerGenerator.makeAdapter(new GeneratorIntegerFunctions.\r
+          isOddFunction()));\r
+      utilityHash.put("increment",\r
+                      FreemarkerGenerator.makeAdapter(new GeneratorIntegerFunctions.\r
+          incrementFunction()));\r
+    }\r
+    catch (Throwable t) {\r
+      throw new HTMLParseException(t.getMessage());\r
+    }\r
+\r
+    SimpleHash outPutHash = new SimpleHash();\r
+\r
+    if (extra != null) {\r
+      outPutHash.put("extra", extra);\r
+      try {\r
+        while ( ( (SimpleList) extra).hasNext()) {\r
+          theLog.printDebugInfo( ( (SimpleList) extra).next().toString());\r
+        }\r
+      }\r
+      catch (Exception e) {\r
+      }\r
+    }\r
+    outPutHash.put("data", tmr);\r
+    outPutHash.put("config", configHash);\r
+    outPutHash.put("utility", utilityHash);\r
+\r
+    MessageResources messages = MessageResources.getMessageResources(bundles);\r
+    if (bundles2!=null) {\r
+      outPutHash.put("lang", new MessageMethodModel(locale, MessageResources.getMessageResources(bundles), MessageResources.getMessageResources(bundles2)));\r
+    }\r
+    else {\r
+      outPutHash.put("lang", new MessageMethodModel(locale, MessageResources.getMessageResources(bundles)));\r
+    }\r
+\r
+    tmpl.process(outPutHash, out);\r
+  }\r
+\r
+  /**\r
+   *   Converts Entity-List to SimpleList of SimpleHashes.\r
+   *   @param aList ist eine Liste von Entity\r
+   *   @return eine freemarker.template.SimpleList von SimpleHashes.\r
+   *\r
+   *    @deprecated EntityLists comply with TemplateListModel now.\r
+   */\r
+  public static SimpleList makeSimpleList(EntityList aList) throws\r
+      StorageObjectException {\r
+    theLog.printWarning(\r
+        "## using deprecated makeSimpleList(entityList) - a waste of resources");\r
+    SimpleList simpleList = new SimpleList();\r
+    if (aList != null) {\r
+      for (int i = 0; i < aList.size(); i++) {\r
+        simpleList.add(aList.elementAt(i));\r
+      }\r
+    }\r
+    return simpleList;\r
+  }\r
+\r
+  /**\r
+   *  Konvertiert ein EntityList in ein freemarker.template.SimpleHash-Modell. Im Hash\r
+   *  sind die einzelnen Entities ueber ihre id zu erreichen.\r
+   *  @param aList ist die EntityList\r
+   *  @return SimpleHash mit den entsprechenden freemarker Daten\r
+   *\r
+   */\r
+  public static SimpleHash makeSimpleHash(EntityList aList) throws\r
+      StorageObjectException {\r
+    SimpleHash simpleHash = new SimpleHash();\r
+    Entity currentEntity;\r
+\r
+    if (aList != null) {\r
+      for (int i = 0; i < aList.size(); i++) {\r
+        currentEntity = (Entity) aList.elementAt(i);\r
+        simpleHash.put(currentEntity.getId(), currentEntity);\r
+      }\r
+    }\r
+    return simpleHash;\r
+  }\r
+\r
+  /**\r
+   *  Konvertiert ein Hashtable mit den keys und values als String\r
+   *  in ein freemarker.template.SimpleHash-Modell\r
+   *  @param mergeData der HashMap mit den String / String Daten\r
+   *  @return SimpleHash mit den entsprechenden freemarker Daten\r
+   *\r
+   */\r
+  public static SimpleHash makeSimpleHash(HashMap mergeData) {\r
+    SimpleHash modelRoot = new SimpleHash();\r
+    String aField;\r
+    if (mergeData != null) {\r
+      Set set = mergeData.keySet();\r
+      Iterator it = set.iterator();\r
+      for (int i = 0; i < set.size(); i++) {\r
+        aField = (String) it.next();\r
+        modelRoot.put(aField, (String) mergeData.get(aField));\r
+      }\r
+    }\r
+    return modelRoot;\r
+  }\r
+\r
+  /**\r
+   * Converts EntityList in SimpleHash and adds additional information\r
+   * to the returned SimpleHash\r
+   *\r
+   * @param entList\r
+   * @return SimpleHash returns SimpleHash with the converted EntityList plus\r
+   *        additional Data about the list.\r
+   * @exception StorageObjectException\r
+   */\r
+\r
+  public static SimpleHash makeSimpleHashWithEntitylistInfos(EntityList entList) throws\r
+      StorageObjectException {\r
+    SimpleHash modelRoot = new SimpleHash();\r
+    if (entList != null) {\r
+      modelRoot.put("contentlist", entList);\r
+      modelRoot.put("count",\r
+                    new SimpleScalar( (new Integer(entList.getCount())).toString()));\r
+      if (entList.getWhere() != null) {\r
+        modelRoot.put("where", new SimpleScalar(entList.getWhere()));\r
+        modelRoot.put("where_encoded",\r
+                      new SimpleScalar(URLEncoder.encode(entList.getWhere())));\r
+      }\r
+      if (entList.getOrder() != null) {\r
+        modelRoot.put("order", new SimpleScalar(entList.getOrder()));\r
+        modelRoot.put("order_encoded",\r
+                      new SimpleScalar(URLEncoder.encode(entList.getOrder())));\r
+      }\r
+      modelRoot.put("from",\r
+                    new SimpleScalar( (new Integer(entList.getFrom())).toString()));\r
+      modelRoot.put("to",\r
+                    new SimpleScalar( (new Integer(entList.getTo())).toString()));\r
+\r
+      if (entList.hasNextBatch())\r
+        modelRoot.put("next",\r
+                      new SimpleScalar( (new Integer(entList.getNextBatch())).\r
+                                       toString()));\r
+      if (entList.hasPrevBatch())\r
+        modelRoot.put("prev",\r
+                      new SimpleScalar( (new Integer(entList.getPrevBatch())).\r
+                                       toString()));\r
+    }\r
+    return modelRoot;\r
+  }\r
+\r
+  /**\r
+   * Private methods to get template from a templateFilename\r
+   * @param templateFilename\r
+   * @return Template\r
+   * @exception HTMLParseException\r
+   */\r
+  private static Template getTemplateFor(String templateFilename) throws\r
+      HTMLParseException {\r
+    Template returnTemplate = null;\r
+    if (templateFilename != null)\r
+      returnTemplate = (Template) templateCache.getItem(templateFilename,\r
+          "template");\r
+\r
+    if (returnTemplate == null) {\r
+      theLog.printError("CACHE (ERR): Unknown template: " + templateFilename);\r
+      throw new HTMLParseException("Templatefile: " + templateFilename +\r
+                                   " not found.");\r
+    }\r
+\r
+    return returnTemplate;\r
+  }\r
+\r
+  public static void stopAutoUpdate() {\r
+    templateCache.stopAutoUpdate();\r
+    templateCache = null;\r
+  }\r
+\r
+}
\ No newline at end of file
index b33f18b..b97d42c 100755 (executable)
-/*
- * Copyright (C) 2001, 2002  The Mir-coders group
- *
- * This file is part of Mir.
- *
- * Mir is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * Mir is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Mir; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- * In addition, as a special exception, The Mir-coders gives permission to link
- * the code of this program with the com.oreilly.servlet library, any library
- * licensed under the Apache Software License, The Sun (tm) Java Advanced
- * Imaging library (JAI), The Sun JIMI library (or with modified versions of
- * the above that use the same license as the above), and distribute linked
- * combinations including the two.  You must obey the GNU General Public
- * License in all respects for all of the code used other than the above
- * mentioned libraries.  If you modify this file, you may extend this exception
- * to your version of the file, but you are not obligated to do so.  If you do
- * not wish to do so, delete this exception statement from your version.
- */
-
-package mir.misc;
-
-import freemarker.template.SimpleScalar;
-import freemarker.template.TemplateMethodModel;
-import freemarker.template.TemplateModel;
-import org.apache.struts.util.MessageResources;
-
-import java.util.List;
-import java.util.Locale;
-
-/**
- * A FreeMarker <code>TemplateMethodModel</code> that provides access to a
- * Struts <code>MessageResources</code>, for use in Interantionalized templates.
- *
- * @author Kellan <kellan@protest.net>
- */
-
-public class MessageMethodModel implements TemplateMethodModel {
-
-    /**
-     * The perferred locale for this instance of MessageMethod.
-     */
-    private Locale locale;
-
-    /**
-     * The MessageResources to query, a single instance shared for
-     * the lifetime of servlet.
-     */
-    private MessageResources messages;
-
-
-    /**
-     * Construct a MessageMethod that uses the JVM's default locale.
-     *
-     * @param message The MessageResources object to query
-     */
-    public MessageMethodModel(MessageResources messages) {
-        this(null, messages);
-    }
-
-    /**
-     * Construct a MessageMethod
-     *
-     * @param locale a Locale object, persumably initialized
-     *               from users Accept-Language header field
-     *
-     * @param message The MessageResources object to query
-     */
-    public MessageMethodModel(Locale locale, MessageResources messages) {
-        this.locale = locale;
-        this.messages = messages;
-    }
-
-
-    /**
-     * Takes the first argument as a resource key, then looks up
-     * a string in the MessagesResources, based on that key, and the Locale
-     *
-     * TODO: error messages should be i18n :)
-     *
-     * @param arguments List passed in by FM, first arguement is a string used as the key
-     *                  all subsequent arguments are used as described in MessageResources
-     *                  (they are filled into the placehoders of the string being returned)
-     */
-    public TemplateModel exec(List arguments) {
-        if (arguments != null) {
-            String key = (String) arguments.get(0);
-            arguments.remove(0);
-            String mesg = messages.getMessage(locale, key, arguments.toArray());
-
-            if (mesg == null) {
-                return new SimpleScalar(errUnknownTag+key);
-            }
-            return new SimpleScalar(mesg);
-        }
-        else {
-            return missingKeyScalar;
-        }
-    }
-
-    // i'm not real clear on how this is used - kellan :)
-    public boolean isEmpty() {
-        if (messages == null)
-            return true;
-        else
-            return false;
-    }
-
-    private static String errUnknownTag = "MESSAGE NOT FOUND: ";
-    private static String missingKey = "MESSAGE CALL WITHOUT KEY";
-    private static SimpleScalar missingKeyScalar =
-            new SimpleScalar(missingKey);
-}
+/*\r
+ * Copyright (C) 2001, 2002  The Mir-coders group\r
+ *\r
+ * This file is part of Mir.\r
+ *\r
+ * Mir is free software; you can redistribute it and/or modify\r
+ * it under the terms of the GNU General Public License as published by\r
+ * the Free Software Foundation; either version 2 of the License, or\r
+ * (at your option) any later version.\r
+ *\r
+ * Mir is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with Mir; if not, write to the Free Software\r
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
+ *\r
+ * In addition, as a special exception, The Mir-coders gives permission to link\r
+ * the code of this program with the com.oreilly.servlet library, any library\r
+ * licensed under the Apache Software License, The Sun (tm) Java Advanced\r
+ * Imaging library (JAI), The Sun JIMI library (or with modified versions of\r
+ * the above that use the same license as the above), and distribute linked\r
+ * combinations including the two.  You must obey the GNU General Public\r
+ * License in all respects for all of the code used other than the above\r
+ * mentioned libraries.  If you modify this file, you may extend this exception\r
+ * to your version of the file, but you are not obligated to do so.  If you do\r
+ * not wish to do so, delete this exception statement from your version.\r
+ */\r
+\r
+package mir.misc;\r
+\r
+import freemarker.template.SimpleScalar;\r
+import freemarker.template.TemplateMethodModel;\r
+import freemarker.template.TemplateModel;\r
+import org.apache.struts.util.MessageResources;\r
+\r
+import java.util.List;\r
+import java.util.Locale;\r
+\r
+/**\r
+ * A FreeMarker <code>TemplateMethodModel</code> that provides access to a\r
+ * Struts <code>MessageResources</code>, for use in Interantionalized templates.\r
+ *\r
+ * @author Kellan <kellan@protest.net>\r
+ */\r
+\r
+public class MessageMethodModel implements TemplateMethodModel {\r
+\r
+  /**\r
+   * The perferred locale for this instance of MessageMethod.\r
+   */\r
+  private Locale locale;\r
+\r
+  /**\r
+   * The MessageResources to query, a single instance shared for\r
+   * the lifetime of servlet.\r
+   */\r
+  private MessageResources messages;\r
+  private MessageResources messages2;\r
+\r
+\r
+  /**\r
+   * Construct a MessageMethod that uses the JVM's default locale.\r
+   *\r
+   * @param message The MessageResources object to query\r
+   */\r
+  public MessageMethodModel(MessageResources messages) {\r
+    this(null, messages);\r
+  }\r
+\r
+  /**\r
+   * Construct a MessageMethod\r
+   *\r
+   * @param locale a Locale object, persumably initialized\r
+   *               from users Accept-Language header field\r
+   *\r
+   * @param message The MessageResources object to query\r
+   */\r
+  public MessageMethodModel(Locale aLocale, MessageResources aMessages) {\r
+    this(aLocale, aMessages, null);\r
+  }\r
+\r
+  public MessageMethodModel(Locale aLocale, MessageResources aMessages,\r
+                            MessageResources aMessages2) {\r
+    locale = aLocale;\r
+    messages = aMessages;\r
+    messages2 = aMessages2;\r
+  }\r
+\r
+  /**\r
+   * Takes the first argument as a resource key, then looks up\r
+   * a string in the MessagesResources, based on that key, and the Locale\r
+   *\r
+   * TODO: error messages should be i18n :)\r
+   *\r
+   * @param arguments List passed in by FM, first arguement is a string used as the key\r
+   *                  all subsequent arguments are used as described in MessageResources\r
+   *                  (they are filled into the placehoders of the string being returned)\r
+   */\r
+  public TemplateModel exec(List arguments) {\r
+    if (arguments != null) {\r
+      String key = (String) arguments.get(0);\r
+      arguments.remove(0);\r
+      String mesg = null;\r
+\r
+      if (messages!=null)\r
+        mesg = messages.getMessage(locale, key, arguments.toArray());\r
+\r
+      if (mesg == null && messages2!=null) {\r
+        mesg = messages2.getMessage(locale, key, arguments.toArray());\r
+      }\r
+\r
+      if (mesg == null) {\r
+        return new SimpleScalar(errUnknownTag + key);\r
+      }\r
+      return new SimpleScalar(mesg);\r
+    }\r
+    else {\r
+      return missingKeyScalar;\r
+    }\r
+  }\r
+\r
+  // i'm not real clear on how this is used - kellan :)\r
+  public boolean isEmpty() {\r
+    if (messages == null)\r
+      return true;\r
+    else\r
+      return false;\r
+  }\r
+\r
+  private static String errUnknownTag = "MESSAGE NOT FOUND: ";\r
+  private static String missingKey = "MESSAGE CALL WITHOUT KEY";\r
+  private static SimpleScalar missingKeyScalar = new SimpleScalar(missingKey);\r
+}\r
index e2e1d2a..f3f008b 100755 (executable)
@@ -322,8 +322,8 @@ public abstract class ServletModule {
     if (rtm == null) rtm = new SimpleHash();
     try {
       PrintWriter out = res.getWriter();
-      HTMLTemplateProcessor.process(res, templateFilename, rtm, popups, out,
-                                    getLocale(req), "bundles.admin");
+      HTMLTemplateProcessor.process(res, templateFilename, rtm, popups, out, getLocale(req));
+
       // we default to admin bundles here, which is not exactly beautiful...
       // but this whole producer stuff is going to be rewritten soon.
       // ServletModuleOpenIndy overwrites deliver() to use open bundles
index a44a61f..356a140 100755 (executable)
@@ -37,12 +37,24 @@ import org.apache.struts.util.MessageResources;
 import mir.generator.*;
 
 public class ResourceBundleGeneratorFunction implements Generator.GeneratorFunction {
-  private MessageResources messages;
+  private List messages;
   private Locale locale;
 
   public ResourceBundleGeneratorFunction(Locale aLocale, MessageResources aMessages) {
-    this.locale = aLocale;
-    this.messages = aMessages;
+    this(aLocale, new MessageResources[] {aMessages} );
+  }
+
+  public ResourceBundleGeneratorFunction(Locale aLocale, MessageResources aMessages1, MessageResources aMessages2) {
+    this(aLocale, new MessageResources[] {aMessages1, aMessages2} );
+  }
+
+  public ResourceBundleGeneratorFunction(Locale aLocale, MessageResources[] aMessages) {
+    locale = aLocale;
+    messages = new Vector();
+
+    for(int i=0; i<aMessages.length; i++) {
+      this.messages.add(aMessages[i]);
+    }
   }
 
   public Object perform(List aParameters) throws GeneratorExc {
@@ -56,7 +68,11 @@ public class ResourceBundleGeneratorFunction implements Generator.GeneratorFunct
 
     String key = (String) aParameters.get(0);
     extraParameters.remove(0);
-    String message = messages.getMessage(locale, key, extraParameters.toArray());
+
+    String message=null;
+    Iterator i = messages.iterator();
+    while (i.hasNext() && message==null)
+      message = ((MessageResources) i.next()).getMessage(locale, key, extraParameters.toArray());
 
     if (message == null) {
       return new String("??" + key + "??");
index 205ac8b..6f43fcb 100755 (executable)
@@ -20,13 +20,14 @@ public class ServletHelper {
 
   static Map makeGenerationData(Locale aLocale) throws ServletModuleException {
     try {
-      MessageResources messages;
       Map result = new HashMap();
 
       MirGlobal.localizer().producerAssistant().initializeGenerationValueSet(result);
-      messages = MessageResources.getMessageResources("bundles.admin");
 
-      result.put( "lang", new ResourceBundleGeneratorFunction( aLocale, messages));
+      result.put( "lang",
+          new ResourceBundleGeneratorFunction( aLocale,
+                  MessageResources.getMessageResources("bundles.adminlocal"),
+                  MessageResources.getMessageResources("bundles.admin")));
 
       return result;
     }
index 0edf50d..400cd55 100755 (executable)
@@ -105,10 +105,7 @@ public class ServletModuleProducer extends ServletModule
     try {
       generator = MirGlobal.localizer().generators().makeAdminGeneratorLibrary().makeGenerator("producerqueue.template");
 
-      generationData = new HashMap();
-      MirGlobal.localizer().producerAssistant().initializeGenerationValueSet(generationData);
-
-      generationData.put( "lang", new ResourceBundleGeneratorFunction( getLocale(aRequest), MessageResources.getMessageResources("bundles.admin")));
+      generationData = ServletHelper.makeGenerationData(getLocale(aRequest));
       generationData.put( "thisurl", "module=Producer&do=showProducerQueueStatus");
 
       producersData = new Vector();
index b375c85..a9c2213 100755 (executable)
@@ -36,7 +36,7 @@
           <td>
             <select name="to_comment_status">
               <list extra.comment_status_values as a>
-                <option value="${a.key}" <if (a.key == data.to_comment_status)>selected</if>>${a.value}</option>
+                <option value="${a.key}" <if (a.key == data.to_comment_status)>selected</if>>${lang("commentstatus."+a.value)}</option>
               </list>
             </select>
           </td>
index 151a381..cd1f62d 100755 (executable)
                </td>
     
         <td>
-          ${lang("comment.article")}
-          <a href="${config.actionRoot}?module=Content&do=edit&id=${entry.to_content.id}">
-            ${utility.encodeHTML(entry.to_content.title)}
-          </a>
-          <br>
-            <a name="${entry.id}"></a>
-          <if entry.status>${entry.status.name} - </if> <b>${entry.title}</b><br>
-
-          <if entry.creator>${lang("comment.creator")}: ${entry.creator}<br></if>
-          <span class="small">${entry.description}</span>
-          <if entry.main_url><br>URL: ${entry.main_url}</if>
-          <br><a href="${config.actionRoot}?module=Comment&do=edit&id=${entry.id}">${lang("edit")}</a>
-          <if entry.operations>|</if>
-          
-                           <list entry.operations as op>
-                             [<a href="${config.actionRoot}?module=Localizer&do=commentoperation&operation=${op}&id=${entry.id}&returnurl=${utility.encodeURI(thisurl + "#" + entry.id)}">${op}</a>]
-                           </list>
-
+          <span class="small">
+            ${lang("comment.article")}
+            <a href="${config.actionRoot}?module=Content&do=edit&id=${entry.to_content.id}">
+              ${utility.encodeHTML(entry.to_content.title)}
+            </a>
+            <br>
+              <a name="${entry.id}"></a>
+              <span class="x-small">
+                <if entry.status>${lang("commentstatus." + entry.status.name)} - </if> 
+              </span>
+                <b>${entry.title}</b><br>
+  
+            <if entry.creator>${lang("comment.creator")}: ${entry.creator}<br></if>
+            <span class="small">${entry.description}</span>
+            <if entry.main_url><br>URL: ${entry.main_url}</if>
+            <br><a href="${config.actionRoot}?module=Comment&do=edit&id=${entry.id}">${lang("edit")}</a>
+            <if entry.operations>|</if>
+            
+                           <list entry.operations as op>
+                             [<a href="${config.actionRoot}?module=Localizer&do=commentoperation&operation=${op}&id=${entry.id}&returnurl=${utility.encodeURI(thisurl + "#" + entry.id)}">${op}</a>]
+                           </list>
+                         </span>
         </td>
   
         <td>
index bf3403c..8a22e04 100755 (executable)
@@ -79,7 +79,7 @@
             <td>
               <select name="to_article_type">
                 <list extra.articletypePopupData as a>
-                  <option value="${a.key}" <if (a.key == data.to_article_type)>selected</if>>${a.value}</option>
+                  <option value="${a.key}" <if (a.key == data.to_article_type)>selected</if>>${lang("articletypes."+a.value)}</option>
                 </list>
               </select>
             </td>
index 86e7922..acc7d0f 100755 (executable)
@@ -36,7 +36,7 @@
              <span class="small">
                <b>
                <span class="x-small">
-            ${entry.article_type.name} -
+            ${lang("articletypes." + entry.article_type.name)} -
                            </span>
                ${entry.title}
                            </b><br>
index 1088ace..625cf30 100755 (executable)
@@ -49,7 +49,7 @@
                        <b>${lang("start.show")}:</b><br>
       <list data.articletypes as a>
                        <img src="${config.docRoot}/img/pointgris.gif" border=0>&nbsp;
-                       <a href="${config.actionRoot}?module=Content&do=list&where=is_published%3d'1'%20and%20to_article_type%3D${a.id}&order=webdb_create%20desc">${a.name}</a><br>
+                       <a href="${config.actionRoot}?module=Content&do=list&where=is_published%3d'1'%20and%20to_article_type%3D${a.id}&order=webdb_create%20desc">${lang("start.allarticlesoftype", lang("articletypes."+a.name))}</a><br>
       </list>
 
       <br>