Re: [FMPP] newbie problem
Brought to you by:
ddekany
From: Daniel D. <dd...@fr...> - 2010-10-28 18:21:30
|
I'm not sure what do you expect and what's the difference compared to that. Some questions: - Why would you put templates into the "data" directory? - What's in Actions.xml? Is there any FreeMarker directives/interpolations in it? Or is it plain XML that you want to transform with the template? - You don't use the "include" variable anywhere Thursday, October 28, 2010, 3:05:44 PM, CsPéter wrote: > Hi! > > I'm newbie to fmpp and I couldn't make a front-end application work > so far. I hope someone can help me. > The ant build.xml looks like this (and works) : > > <!--freemarker--> > <target name="freemarker" description="Freemarker test" depends=""> > <taskdef name="freemarker" > classname="freemarker.ext.ant.FreemarkerXmlTask"> > <classpath> > <pathelement location="freemarker.jar" /> > </classpath> > </taskdef> > <mkdir dir="sql" /> > <freemarker basedir="${xml.dir}" destdir="${sql.dir}" > includes="Actions.xml" template="${templates.dir}/test2.ftl" /> > <!--freemarker basedir="${xml.dir}" destdir="${html.dir}" > includes="**/*.xml" template="${templates.dir}/test2.ftl" /--> > </target> > > My own ant task is this: > <!--excelgen--> > <target name="excelgen" description="Generates things" depends="jar"> > <taskdef name="excelgen" classname="ExcelGen" classpath="${classpath}"/> > <excelgen excels="excel1, excel2" ftls="elso.ftl" outputs="html" /> > </target> > > And my java file: > > public void execute() { > try { > File f = new File("C:/workspace/TOOLS/excelgen/"); > File basedir = new File("C:/workspace/TOOLS/excelgen/xml"); > File destdir = new File("C:/workspace/TOOLS/excelgen/sql"); > File include = new > File("C:/workspace/TOOLS/excelgen/xml/Actions.xml"); > File template = new File("C:/workspace/TOOLS/excelgen/templates/"); > > Settings s = new Settings(f); > s.add("sourceRoot", basedir.getAbsolutePath()); > s.add("outputRoot", destdir.getAbsolutePath()); > s.add("dataRoot", template.getAbsolutePath()); > s.execute(); > } catch (Exception e1) { > e1.printStackTrace(); > } > log(msg); > } > > The problem is, that it's just copies the Actions.xml file to the /sql directory. > > directory path: > TOOLS ------------xml/Actions.xml > -----------sql/ > ------------templates/test2.ftl > bulild.xml > > I have tried a lot of things including set the "modes" settings, > switching the directores and trying out new parameters (relative > paths, put all sources to one directory etc) but I couldn't make it work. > Thank you very much for any help. > > cheers, > Peter -- Best regards, Daniel Dekany |