X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=source%2Fmir%2Fmisc%2FHTMLTemplateProcessor.java;h=1abaae5d2b1b2b20545bae3c93b4503c22ec3fa6;hb=c6a2204d8d75293256fd17c07e54971d7672359a;hp=5a30e99012aa924e956e12d301b73ce6acfb2b9a;hpb=99423e2e02c89aff55d9086e72667699a86f6a27;p=mir.git diff --git a/source/mir/misc/HTMLTemplateProcessor.java b/source/mir/misc/HTMLTemplateProcessor.java index 5a30e990..1abaae5d 100755 --- a/source/mir/misc/HTMLTemplateProcessor.java +++ b/source/mir/misc/HTMLTemplateProcessor.java @@ -38,14 +38,25 @@ 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"); - actionRoot = docRoot + "/servlet/" + MirConfig.getProp("ServletName"); + //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/NadirAktuell"; + + actionRoot = docRoot + "/servlet/Mir"; + openAction = MirConfig.getProp("Producer.OpenAction"); productionHost = MirConfig.getProp("Producer.ProductionHost"); videoHost = MirConfig.getProp("Producer.VideoHost"); @@ -187,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)); @@ -204,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); @@ -215,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