X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=source%2Fmir%2Fmisc%2FHTMLTemplateProcessor.java;h=1abaae5d2b1b2b20545bae3c93b4503c22ec3fa6;hb=c6a2204d8d75293256fd17c07e54971d7672359a;hp=56747aa4e87d87450f02be634959eba932130312;hpb=946bbc8871091973fa2524b650dcf53ea31befd1;p=mir.git diff --git a/source/mir/misc/HTMLTemplateProcessor.java b/source/mir/misc/HTMLTemplateProcessor.java index 56747aa4..1abaae5d 100755 --- a/source/mir/misc/HTMLTemplateProcessor.java +++ b/source/mir/misc/HTMLTemplateProcessor.java @@ -38,20 +38,21 @@ public final class HTMLTemplateProcessor { // init static { - + /** @todo either in the above block or here :) //rk */ templateDir = MirConfig.getPropWithHome("HTMLTemplateProcessor.Dir"); templateCache = new FileTemplateCache(templateDir); templateCache.setLoadingPolicy(templateCache.LOAD_ON_DEMAND); - templateCache.startAutoUpdate(); + // gone in freemarker 1.7.1 + // templateCache.startAutoUpdate(); + theLog = Logfile.getInstance(MirConfig.getPropWithHome("HTMLTemplateProcessor.Logfile")); docRoot = MirConfig.getProp("RootUri"); - theLog=Logfile.getInstance("HTMLTemplateProcessor"); //the quick hack is back in effect as it was more broken than ever before // -mh // sorry: nadir back in town, i have to debug the mirbase.jar in the // nadir evironment. from my point of coding, this needs an urgent // fixxx. // yeah, from my point too - tob. - //actionRoot = docRoot + "/servlet/" + MirConfig.getProp("ServletName"); + //actionRoot = docRoot + "/servlet/" + MirConfig.getProp("ServletName"); //actionRoot = docRoot + "/servlet/NadirAktuell"; actionRoot = docRoot + "/servlet/Mir"; @@ -68,7 +69,7 @@ public final class HTMLTemplateProcessor { /** * empty private constructor, to avoid instantiation */ - private HTMLTemplateProcessor () {} + private HTMLTemplateProcessor () { } // process-methods to merge different datastructures @@ -197,6 +198,10 @@ public final class HTMLTemplateProcessor { session=res.encodeURL(""); } + /** @todo why do we double those? should be cleaned up and + * statically initialized, we do not need to assemble a config + * hash everytime we give out a page, only exception is + * date "now" // rk */ // put standard configuration into tempalteRootmodel SimpleHash configHash = new SimpleHash(); configHash.put("docroot", new SimpleScalar(producerDocRoot)); @@ -214,6 +219,8 @@ public final class HTMLTemplateProcessor { tmr.put("videoHost", new SimpleScalar(videoHost)); tmr.put("audioHost", new SimpleScalar(audioHost)); tmr.put("imageHost", new SimpleScalar(imageHost)); + // this conform to updated freemarker syntax + tmr.put("compressWhitespace", new freemarker.template.utility.CompressWhitespace() ); tmr.put("config", configHash); tmpl.process(tmr, out); @@ -225,13 +232,16 @@ public final class HTMLTemplateProcessor { * 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