From: Kal A. <ka...@te...> - 2004-10-11 18:30:08
|
On Mon, 2004-10-11 at 18:57, Christoph Froehlich wrote: > Hi Kal > > thanks for the quick fix. It works now... until I reach > > org.tm4j.topicmap.utils.extractors.AssociationGroupsExtractor$DefaultAssociationGroupComparator.compare(AssociationGroupsExtractor.java:149) > > where another NullPointer waits. I fixed this one myself and could > either commit the fix or send you a patch, just as you prefer. > Feel free to commit the fix - I guess that it is probably an untyped association or untyped role case that I didn't catch in the code. > Beside of this last NPE, batch.xml now runs successfully and produces a > lot of html files. > > Unfortunately there is one more problem with the default skin. > The "topicref"-macro in "utils.vm" constantly produces the following > loglines: > Mon Oct 11 19:39:11 CEST 2004 [warn] > org.apache.velocity.runtime.exception.ReferenceException: reference : > template = associations.vm [line 2,column 29] : ${filename.fn($topic)} > is not a valid reference. > > Therefor all links from index.html to any topic detail page refer to the > unresolved string "$filename.fn($topic).html". > You need to create the filename object. You can do this by adding the following line to topicmap.vm: #set ($filename = $factory.create("org.tm4j.vtl.extractors.FileNameExtractor")) The factory variable should be initialised by the toolbox.xml. Actually it probably makes sense for FileNameExtractor to implement the Velocity ViewTool interface so that you can load it in the toolbox.xml. But for now, add that line to topicmap.vm as a workaround. > I haven't got deep enough into tm4Web to know where I should start to > look for the missing reference. Do you have a hint for me? > In general, any variables set by #set in topicmap.vm or setup.vm are available when processing the whole topic map. Any variables set in topic.vm or any of the templates it calls are available only for the processing of that topic. The toolbox.xml allows you to choose the scope of a variable. If the <scope> element content is "request" then the tool is initialised once for each page generated. If the <scope> element content is application then the tool is initialised once at the start of processing and the same instance is available to every page. Hope this helps! Cheers, Kal -- Kal Ahmed <ka...@te...> techquila |