fmpp-open Mailing List for FMPP: FreeMarker-based File PreProcessor
Brought to you by:
ddekany
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
(23) |
Aug
(4) |
Sep
(11) |
Oct
(7) |
Nov
|
Dec
(2) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(3) |
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
(5) |
Jul
|
Aug
|
Sep
(2) |
Oct
(9) |
Nov
(2) |
Dec
|
2005 |
Jan
(2) |
Feb
(9) |
Mar
|
Apr
(1) |
May
|
Jun
(11) |
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2006 |
Jan
(2) |
Feb
(14) |
Mar
(4) |
Apr
|
May
(6) |
Jun
(7) |
Jul
(7) |
Aug
|
Sep
(4) |
Oct
|
Nov
|
Dec
|
2007 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2009 |
Jan
(2) |
Feb
(2) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(10) |
Nov
|
Dec
(3) |
2010 |
Jan
(9) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
(2) |
Sep
|
Oct
(2) |
Nov
|
Dec
|
2012 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
From: Daniel D. <dd...@fr...> - 2012-05-22 21:27:42
|
Tuesday, May 22, 2012, 4:50:17 PM, Stefan Undorf wrote: > Hi fmpplers, > > I try to generate my menus dynamically and to activate the current menu item. So I use one directive > inside another but I do not know how to do it right. The following is taken from the example below: > > <#if outFile?index_of(m.item.link) != -1> <!-- m.item.link is undefined --> This is correct so far, although <#if outFile?cotains(m.item.link)> would be nicer. > <#if outFile?index_of(${m.item.link}) != -1> <!-- syntax error --> (It is an error since ${Expression} only makes sense put directly into static text or into a string literal. Elsewhere you can you just use Expression as is.) > Complete example: > > <#assign menus = [ > {"item": {"name": "Motive", "link": "motive.html"}}, > {"item": {"name": "Action", "link": "action.html"}}, (I assume there will be something else next to the "item" key in that map, or else that whole map could be eliminated, of course.) > ]> > <#if currentLanguage == "es"> > <#assign menus = [ > {"item": {"name": "Motivos", "link": "es/motive.html"}}, > {"item": {"name": "Acción", "link": "es/action.html"}}, > ]> > </#if> > <ul class="nav"> > <#list menus as m> > <li <#if outFile?index_of(m.item.link) != -1>class="active"</#if>> > <a href="${m.item.link}">${m.item.name}</a> > </li> > </#list> > </ul> > > How can I access the variable m.item.link in the #if? Just like you did. Furthermore your above example works for me. So, some of the items has no "link" in it or it's null. That's what the error message means. > Thanks, > Stefan -- Best regards, Daniel Dekany |
From: Stefan U. <su...@su...> - 2012-05-22 15:04:28
|
Hi fmpplers, I try to generate my menus dynamically and to activate the current menu item. So I use one directive inside another but I do not know how to do it right. The following is taken from the example below: <#if outFile?index_of(m.item.link) != -1> <!-- m.item.link is undefined --> <#if outFile?index_of(${m.item.link}) != -1> <!-- syntax error --> Complete example: <#assign menus = [ {"item": {"name": "Motive", "link": "motive.html"}}, {"item": {"name": "Action", "link": "action.html"}}, ]> <#if currentLanguage == "es"> <#assign menus = [ {"item": {"name": "Motivos", "link": "es/motive.html"}}, {"item": {"name": "Acción", "link": "es/action.html"}}, ]> </#if> <ul class="nav"> <#list menus as m> <li <#if outFile?index_of(m.item.link) != -1>class="active"</#if>> <a href="${m.item.link}">${m.item.name}</a> </li> </#list> </ul> How can I access the variable m.item.link in the #if? Thanks, Stefan |
From: Shelley, R. <Rya...@di...> - 2012-04-12 01:01:09
|
I ended up getting it to work with: String propStr = Interpreter.loadTdd(in, "ISO-8859-1"); Map propMap = Interpreter.evalAsHash(propStr); -Ryan From: "Shelley, Ryan" <Rya...@di...<mailto:Rya...@di...>> Reply-To: FMPP open discussion <fmp...@li...<mailto:fmp...@li...>> Date: Wed, 11 Apr 2012 16:32:10 -0700 To: "fmp...@li...<mailto:fmp...@li...>" <fmp...@li...<mailto:fmp...@li...>> Subject: [FMPP] Parsing TDD Files I'd like to use the TDD parsing functionality for reading properties files for my application. I've used FMPP for generating configuration files from templates, but I'd like to skip the generation stage, and use a TDD as the data source for run-time settings. Is this possible, or can I use a particular sub-library of FMPP to accomplish this? Thanks! -Ryan |
From: Shelley, R. <Rya...@di...> - 2012-04-11 23:50:53
|
I'd like to use the TDD parsing functionality for reading properties files for my application. I've used FMPP for generating configuration files from templates, but I'd like to skip the generation stage, and use a TDD as the data source for run-time settings. Is this possible, or can I use a particular sub-library of FMPP to accomplish this? Thanks! -Ryan |
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 |
From: CsPéter <le...@in...> - 2010-10-28 13:32:33
|
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.ftlbulild.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 |
From: Daniel D. <dd...@fr...> - 2010-08-10 07:25:16
|
I don't know anything concrete about this mater, but as far as I see, some YAML libraries expose YAML as JavaBeans, in which case FreeMarker marker can access them right now, and you don't need anything YAML-specific. If YAML is turned into some kind of YAML-specific nodes/entires (maybe JvYAML does that, I don't know) instead, just like W3C DOM nodes are wrapped, those could be too, but then someone needs to write the wrapper first... (Yes, that was what you were looking for.) Tuesday, August 10, 2010, 8:34:33 AM, Chris wrote: > > Hello, > > i'd like to use the freemarker tool in my RubyOnRails Application. > > In the App i have much YAML Files with Properties. > > Is there any way to use them with freemarker (or the cli version fmpp) ?!? > > I have used the fmpp tool in different projekt but only with properties > files.... and my google search give me no results to "yaml and freemarker" > :-) > > Thank you very much for your help!! > > lg > Chris -- Best regards, Daniel Dekany |
From: Chris <cb...@cb...> - 2010-08-10 06:52:43
|
Hello, i'd like to use the freemarker tool in my RubyOnRails Application. In the App i have much YAML Files with Properties. Is there any way to use them with freemarker (or the cli version fmpp) ?!? I have used the fmpp tool in different projekt but only with properties files.... and my google search give me no results to "yaml and freemarker" :-) Thank you very much for your help!! lg Chris -- View this message in context: http://freemarker.624813.n4.nabble.com/Freemarker-with-YAML-Files-tp2319361p2319361.html Sent from the fmpp-open mailing list archive at Nabble.com. |
From: Daniel D. <dd...@fr...> - 2010-07-19 13:52:06
|
Monday, July 19, 2010, 1:18:33 PM, jyothisree wrote: > I have a struts2 application ,where in the jsp page i have struts2 tag Note that this is the FMPP mailing-list, not the FreeMarker mailing-list. > checkbacklist ,which displays the list of checkboxes in a row ,i want to > display it in the column form , for that i have made changes in the > checkboxlist.flt file as > > <#if parameters.cssStyle?exists> > <#if "${parameters.cssStyle?html}" == "vertical"> The above line should be just: <#if parameters.cssStyle == "vertical"> Does the same but cleaner and faster... Also, the two #if could be united as <#if parameters.cssStyle?exists and parameters.cssStyle == "vertical"> which furthermore can be reduced to: <#if parameters.cssStyle!'' == "vertical"> > <#if itemCount%2==0> > <br><#rt/> > <#else> > </#if> > </#if> > </#if> > > In this i can display the way i want to display the checkboxes in 2 columns > ,but the problem is the checkboxes starting from the 2nd column are not in > the line > something like this > > 1 chkbox 2 chkbox > 3 chkbox 4 chkbox > 5 chkbox 5 chkbox > > i want it to be as > 1 chkbox 2 chkbox > 3 chkbox 4 chkbox > 5 chkbox 5 chkbox > > What do i do for the above code That's a HTML question, and so it has nothing to do wit FreeMarker. But you could use a HTML table, or div-s with fixed width and CSS floating. -- Best regards, Daniel Dekany |
From: jyothisree <a.j...@re...> - 2010-07-19 11:18:40
|
I have a struts2 application ,where in the jsp page i have struts2 tag checkbacklist ,which displays the list of checkboxes in a row ,i want to display it in the column form , for that i have made changes in the checkboxlist.flt file as <#if parameters.cssStyle?exists> <#if "${parameters.cssStyle?html}" == "vertical"> <#if itemCount%2==0> <br><#rt/> <#else> </#if> </#if> </#if> In this i can display the way i want to display the checkboxes in 2 columns ,but the problem is the checkboxes starting from the 2nd column are not in the line something like this 1 chkbox 2 chkbox 3 chkbox 4 chkbox 5 chkbox 5 chkbox i want it to be as 1 chkbox 2 chkbox 3 chkbox 4 chkbox 5 chkbox 5 chkbox What do i do for the above code -- View this message in context: http://freemarker.624813.n4.nabble.com/freemarker-in-struts2-application-tp2293826p2293826.html Sent from the fmpp-open mailing list archive at Nabble.com. |
From: alebu <al...@gm...> - 2010-01-09 12:45:51
|
Well, I tried to specify maven classpath and it looks like maven classpath includes my custom code, but FMPP still can not see it. While running maven build, ant-run prints it classpath and classes I need to have in FMPP are included. But Freemarker instance used by FMPP can't see them. I used Freemarker's new() modifier to create an object, like: <#assign AA="my.functionObject.full.ClassName"?new()> and got build error like: [fmpp] Task aborted: FMPP processing session failed. [fmpp] Caused by: freemarker.template.TemplateException: java.lang.ClassNotFoundException: my.functionObject.full.ClassName [fmpp] Caused by: java.lang.ClassNotFoundException: my.functionObject.full.ClassName In general, I wanted to add some custom complex logic into template environment. This time only as custom freemarker function, but if this strategy will work, then more logic will be possible to add. Constructing that object in beanshell also failed with ClassNotFoundException. It seems that FMPP freemarker instance classpath is not the same as is passed to FMPP itself, or Maven ant-run-plugin does not passes correct classpath. Is there any chances that such a behaviour will be fixed in the nearest furure? For those who interested, here is my configuration of maven ant run: <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-antrun-plugin</artifactId> <executions> <execution> <phase>prepare-package</phase> <configuration> <tasks> <property name="compile_classpath" refid="maven.compile.classpath"/> <echo message="compile classpath: ${compile_classpath}"/> <taskdef name="fmpp" classname="fmpp.tools.AntTask" classpathref="maven.compile.classpath" /> <fmpp sourceRoot="src/main/resources/fmpp" outputRoot="${project.build.directory}/fmpp-output"> <data> doc:xml(data/TRUTH.xml, {namespaceAware:false}) </data> <modes> ignore(**/*.bsh) ignore(data/**/*) execute(templates/MAIN.txt.ftl) </modes> </fmpp> </tasks> </configuration> <goals> <goal>run</goal> </goals> </execution> </executions> <dependencies> <dependency> <groupId>net.sourceforge.fmpp</groupId> <artifactId>fmpp</artifactId> <version>0.9.14</version> </dependency> </dependencies> </plugin> </plugins> </build> On Tue, Jan 5, 2010 at 3:22 PM, alebu <al...@gm...> wrote: > Defininion of custom ant tasks in maven-ant-run plugin is described > here: http://maven.apache.org/plugins/maven-antrun-plugin/examples/customTasks.html > In general, configuration looks like <taskdef name="myTask" > classname="com.acme.MyTask" classpathref="maven.plugin.classpath"/> > This 'maven.plugin.classpath' is defined by maven and is plugin > classpath. Perhaps I need to play with it to get what I want. At least > it worth to try. Thanks for hint! > > > On Tue, Jan 5, 2010 at 3:11 PM, Daniel Dekany <dd...@fr...> wrote: >> Tuesday, January 5, 2010, 12:06:59 PM, alebu wrote: >> >>> I think that under Ant. Maven-ant-run plugin allows to pass maven >>> classpath to Ant. At least that is stated in documentation. But I >>> can't find how to specify any class path to FMPP it self from ant. And >>> that is the problem. >> >> How did you define the fmpp task? Because it wouldn't work unless you >> have put it into the "Ant classpath" somehow. Can't you add your >> classes to the "Ant classpath" one the same way? (The Ant "taskdef" >> element has optional "classpath" and "classpathref" attributes, also I >> believe it supports nested "classpath" element too.) >> >>> I am thinking about possible maven FMPP plugin >>> but first I need to find some free time for it :( >> >>> On Tue, Jan 5, 2010 at 12:42 PM, Daniel Dekany <dd...@fr...> wrote: >>>> Tuesday, January 5, 2010, 9:47:26 AM, alebu wrote: >>>> >>>>> Thanks, I found this one be seeking discussion. Unfortunately, I am >>>>> not sure is it helpful, because I am running FMPP from Ant (actually >>>>> from maven using maven-ant-run plugin). >>>> >>>> This issue might not be FMPP-specific. Sounds like it's just about >>>> setting up the "class path" under Maven (or maybe under Ant). >>>> >>>>> So, I can't manipulate >>>>> classpath of fmpp, because I even have no installation of it, FMPP >>>>> code comes from maven repository. During the week, I will try to play >>>>> with it (now I am at work and have no access to code where I want to >>>>> apply such approach. In success I will write in this discussion. >>>>> >>>>> On Tue, Jan 5, 2010 at 10:41 AM, Daniel Dekany <dd...@fr...> wrote: >>>>>> Monday, January 4, 2010, 11:31:27 PM, Daniel Dekany wrote: >>>>>> >>>>>>> Monday, January 4, 2010, 9:20:18 PM, alebu wrote: >>>>>>> >>>>>>>> Hi all, >>>>>>>> How can I specify FMPP to include some compiled java code or jar files >>>>>>>> in the freemarker classpath? I need it because I want to use some of >>>>>>>> the functions written with java from freemarker templates and because >>>>>>>> FMPP instanciates freemarker instance, I can't affect a classpath it >>>>>>>> passes to it. >>>>>>> >>>>>>> This may helps: >>>>>>> http://thread.gmane.org/gmane.comp.text.fmpp/133/focus=138 >>>>>> >>>>>> Sorry, I mean this: >>>>>> http://article.gmane.org/gmane.comp.text.fmpp/135 >>>>>> >>>>>> >>>>>> -- >>>>>> Best regards, >>>>>> Daniel Dekany >>>>>> >>>>>> >>>>>> ------------------------------------------------------------------------------ >>>>>> This SF.Net email is sponsored by the Verizon Developer Community >>>>>> Take advantage of Verizon's best-in-class app development support >>>>>> A streamlined, 14 day to market process makes app distribution fast and easy >>>>>> Join now and get one step closer to millions of Verizon customers >>>>>> http://p.sf.net/sfu/verizon-dev2dev >>>>>> _______________________________________________ >>>>>> fmpp-open mailing list >>>>>> fmp...@li... >>>>>> https://lists.sourceforge.net/lists/listinfo/fmpp-open >>>>>> >>>>> >>>>> ------------------------------------------------------------------------------ >>>>> This SF.Net email is sponsored by the Verizon Developer Community >>>>> Take advantage of Verizon's best-in-class app development support >>>>> A streamlined, 14 day to market process makes app distribution fast and easy >>>>> Join now and get one step closer to millions of Verizon customers >>>>> http://p.sf.net/sfu/verizon-dev2dev >>>>> _______________________________________________ >>>>> fmpp-open mailing list >>>>> fmp...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/fmpp-open >>>>> >>>> >>>> -- >>>> Best regards, >>>> Daniel Dekany >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> This SF.Net email is sponsored by the Verizon Developer Community >>>> Take advantage of Verizon's best-in-class app development support >>>> A streamlined, 14 day to market process makes app distribution fast and easy >>>> Join now and get one step closer to millions of Verizon customers >>>> http://p.sf.net/sfu/verizon-dev2dev >>>> _______________________________________________ >>>> fmpp-open mailing list >>>> fmp...@li... >>>> https://lists.sourceforge.net/lists/listinfo/fmpp-open >>>> >>> >>> ------------------------------------------------------------------------------ >>> This SF.Net email is sponsored by the Verizon Developer Community >>> Take advantage of Verizon's best-in-class app development support >>> A streamlined, 14 day to market process makes app distribution fast and easy >>> Join now and get one step closer to millions of Verizon customers >>> http://p.sf.net/sfu/verizon-dev2dev >>> _______________________________________________ >>> fmpp-open mailing list >>> fmp...@li... >>> https://lists.sourceforge.net/lists/listinfo/fmpp-open >>> >> >> -- >> Best regards, >> Daniel Dekany >> >> >> ------------------------------------------------------------------------------ >> This SF.Net email is sponsored by the Verizon Developer Community >> Take advantage of Verizon's best-in-class app development support >> A streamlined, 14 day to market process makes app distribution fast and easy >> Join now and get one step closer to millions of Verizon customers >> http://p.sf.net/sfu/verizon-dev2dev >> _______________________________________________ >> fmpp-open mailing list >> fmp...@li... >> https://lists.sourceforge.net/lists/listinfo/fmpp-open >> > |
From: alebu <al...@gm...> - 2010-01-05 13:22:28
|
Defininion of custom ant tasks in maven-ant-run plugin is described here: http://maven.apache.org/plugins/maven-antrun-plugin/examples/customTasks.html In general, configuration looks like <taskdef name="myTask" classname="com.acme.MyTask" classpathref="maven.plugin.classpath"/> This 'maven.plugin.classpath' is defined by maven and is plugin classpath. Perhaps I need to play with it to get what I want. At least it worth to try. Thanks for hint! On Tue, Jan 5, 2010 at 3:11 PM, Daniel Dekany <dd...@fr...> wrote: > Tuesday, January 5, 2010, 12:06:59 PM, alebu wrote: > >> I think that under Ant. Maven-ant-run plugin allows to pass maven >> classpath to Ant. At least that is stated in documentation. But I >> can't find how to specify any class path to FMPP it self from ant. And >> that is the problem. > > How did you define the fmpp task? Because it wouldn't work unless you > have put it into the "Ant classpath" somehow. Can't you add your > classes to the "Ant classpath" one the same way? (The Ant "taskdef" > element has optional "classpath" and "classpathref" attributes, also I > believe it supports nested "classpath" element too.) > >> I am thinking about possible maven FMPP plugin >> but first I need to find some free time for it :( > >> On Tue, Jan 5, 2010 at 12:42 PM, Daniel Dekany <dd...@fr...> wrote: >>> Tuesday, January 5, 2010, 9:47:26 AM, alebu wrote: >>> >>>> Thanks, I found this one be seeking discussion. Unfortunately, I am >>>> not sure is it helpful, because I am running FMPP from Ant (actually >>>> from maven using maven-ant-run plugin). >>> >>> This issue might not be FMPP-specific. Sounds like it's just about >>> setting up the "class path" under Maven (or maybe under Ant). >>> >>>> So, I can't manipulate >>>> classpath of fmpp, because I even have no installation of it, FMPP >>>> code comes from maven repository. During the week, I will try to play >>>> with it (now I am at work and have no access to code where I want to >>>> apply such approach. In success I will write in this discussion. >>>> >>>> On Tue, Jan 5, 2010 at 10:41 AM, Daniel Dekany <dd...@fr...> wrote: >>>>> Monday, January 4, 2010, 11:31:27 PM, Daniel Dekany wrote: >>>>> >>>>>> Monday, January 4, 2010, 9:20:18 PM, alebu wrote: >>>>>> >>>>>>> Hi all, >>>>>>> How can I specify FMPP to include some compiled java code or jar files >>>>>>> in the freemarker classpath? I need it because I want to use some of >>>>>>> the functions written with java from freemarker templates and because >>>>>>> FMPP instanciates freemarker instance, I can't affect a classpath it >>>>>>> passes to it. >>>>>> >>>>>> This may helps: >>>>>> http://thread.gmane.org/gmane.comp.text.fmpp/133/focus=138 >>>>> >>>>> Sorry, I mean this: >>>>> http://article.gmane.org/gmane.comp.text.fmpp/135 >>>>> >>>>> >>>>> -- >>>>> Best regards, >>>>> Daniel Dekany >>>>> >>>>> >>>>> ------------------------------------------------------------------------------ >>>>> This SF.Net email is sponsored by the Verizon Developer Community >>>>> Take advantage of Verizon's best-in-class app development support >>>>> A streamlined, 14 day to market process makes app distribution fast and easy >>>>> Join now and get one step closer to millions of Verizon customers >>>>> http://p.sf.net/sfu/verizon-dev2dev >>>>> _______________________________________________ >>>>> fmpp-open mailing list >>>>> fmp...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/fmpp-open >>>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> This SF.Net email is sponsored by the Verizon Developer Community >>>> Take advantage of Verizon's best-in-class app development support >>>> A streamlined, 14 day to market process makes app distribution fast and easy >>>> Join now and get one step closer to millions of Verizon customers >>>> http://p.sf.net/sfu/verizon-dev2dev >>>> _______________________________________________ >>>> fmpp-open mailing list >>>> fmp...@li... >>>> https://lists.sourceforge.net/lists/listinfo/fmpp-open >>>> >>> >>> -- >>> Best regards, >>> Daniel Dekany >>> >>> >>> ------------------------------------------------------------------------------ >>> This SF.Net email is sponsored by the Verizon Developer Community >>> Take advantage of Verizon's best-in-class app development support >>> A streamlined, 14 day to market process makes app distribution fast and easy >>> Join now and get one step closer to millions of Verizon customers >>> http://p.sf.net/sfu/verizon-dev2dev >>> _______________________________________________ >>> fmpp-open mailing list >>> fmp...@li... >>> https://lists.sourceforge.net/lists/listinfo/fmpp-open >>> >> >> ------------------------------------------------------------------------------ >> This SF.Net email is sponsored by the Verizon Developer Community >> Take advantage of Verizon's best-in-class app development support >> A streamlined, 14 day to market process makes app distribution fast and easy >> Join now and get one step closer to millions of Verizon customers >> http://p.sf.net/sfu/verizon-dev2dev >> _______________________________________________ >> fmpp-open mailing list >> fmp...@li... >> https://lists.sourceforge.net/lists/listinfo/fmpp-open >> > > -- > Best regards, > Daniel Dekany > > > ------------------------------------------------------------------------------ > This SF.Net email is sponsored by the Verizon Developer Community > Take advantage of Verizon's best-in-class app development support > A streamlined, 14 day to market process makes app distribution fast and easy > Join now and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > _______________________________________________ > fmpp-open mailing list > fmp...@li... > https://lists.sourceforge.net/lists/listinfo/fmpp-open > |
From: Daniel D. <dd...@fr...> - 2010-01-05 13:12:05
|
Tuesday, January 5, 2010, 12:06:59 PM, alebu wrote: > I think that under Ant. Maven-ant-run plugin allows to pass maven > classpath to Ant. At least that is stated in documentation. But I > can't find how to specify any class path to FMPP it self from ant. And > that is the problem. How did you define the fmpp task? Because it wouldn't work unless you have put it into the "Ant classpath" somehow. Can't you add your classes to the "Ant classpath" one the same way? (The Ant "taskdef" element has optional "classpath" and "classpathref" attributes, also I believe it supports nested "classpath" element too.) > I am thinking about possible maven FMPP plugin > but first I need to find some free time for it :( > On Tue, Jan 5, 2010 at 12:42 PM, Daniel Dekany <dd...@fr...> wrote: >> Tuesday, January 5, 2010, 9:47:26 AM, alebu wrote: >> >>> Thanks, I found this one be seeking discussion. Unfortunately, I am >>> not sure is it helpful, because I am running FMPP from Ant (actually >>> from maven using maven-ant-run plugin). >> >> This issue might not be FMPP-specific. Sounds like it's just about >> setting up the "class path" under Maven (or maybe under Ant). >> >>> So, I can't manipulate >>> classpath of fmpp, because I even have no installation of it, FMPP >>> code comes from maven repository. During the week, I will try to play >>> with it (now I am at work and have no access to code where I want to >>> apply such approach. In success I will write in this discussion. >>> >>> On Tue, Jan 5, 2010 at 10:41 AM, Daniel Dekany <dd...@fr...> wrote: >>>> Monday, January 4, 2010, 11:31:27 PM, Daniel Dekany wrote: >>>> >>>>> Monday, January 4, 2010, 9:20:18 PM, alebu wrote: >>>>> >>>>>> Hi all, >>>>>> How can I specify FMPP to include some compiled java code or jar files >>>>>> in the freemarker classpath? I need it because I want to use some of >>>>>> the functions written with java from freemarker templates and because >>>>>> FMPP instanciates freemarker instance, I can't affect a classpath it >>>>>> passes to it. >>>>> >>>>> This may helps: >>>>> http://thread.gmane.org/gmane.comp.text.fmpp/133/focus=138 >>>> >>>> Sorry, I mean this: >>>> http://article.gmane.org/gmane.comp.text.fmpp/135 >>>> >>>> >>>> -- >>>> Best regards, >>>> Daniel Dekany >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> This SF.Net email is sponsored by the Verizon Developer Community >>>> Take advantage of Verizon's best-in-class app development support >>>> A streamlined, 14 day to market process makes app distribution fast and easy >>>> Join now and get one step closer to millions of Verizon customers >>>> http://p.sf.net/sfu/verizon-dev2dev >>>> _______________________________________________ >>>> fmpp-open mailing list >>>> fmp...@li... >>>> https://lists.sourceforge.net/lists/listinfo/fmpp-open >>>> >>> >>> ------------------------------------------------------------------------------ >>> This SF.Net email is sponsored by the Verizon Developer Community >>> Take advantage of Verizon's best-in-class app development support >>> A streamlined, 14 day to market process makes app distribution fast and easy >>> Join now and get one step closer to millions of Verizon customers >>> http://p.sf.net/sfu/verizon-dev2dev >>> _______________________________________________ >>> fmpp-open mailing list >>> fmp...@li... >>> https://lists.sourceforge.net/lists/listinfo/fmpp-open >>> >> >> -- >> Best regards, >> Daniel Dekany >> >> >> ------------------------------------------------------------------------------ >> This SF.Net email is sponsored by the Verizon Developer Community >> Take advantage of Verizon's best-in-class app development support >> A streamlined, 14 day to market process makes app distribution fast and easy >> Join now and get one step closer to millions of Verizon customers >> http://p.sf.net/sfu/verizon-dev2dev >> _______________________________________________ >> fmpp-open mailing list >> fmp...@li... >> https://lists.sourceforge.net/lists/listinfo/fmpp-open >> > > ------------------------------------------------------------------------------ > This SF.Net email is sponsored by the Verizon Developer Community > Take advantage of Verizon's best-in-class app development support > A streamlined, 14 day to market process makes app distribution fast and easy > Join now and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > _______________________________________________ > fmpp-open mailing list > fmp...@li... > https://lists.sourceforge.net/lists/listinfo/fmpp-open > -- Best regards, Daniel Dekany |
From: alebu <al...@gm...> - 2010-01-05 11:07:08
|
I think that under Ant. Maven-ant-run plugin allows to pass maven classpath to Ant. At least that is stated in documentation. But I can't find how to specify any class path to FMPP it self from ant. And that is the problem. I am thinking about possible maven FMPP plugin but first I need to find some free time for it :( On Tue, Jan 5, 2010 at 12:42 PM, Daniel Dekany <dd...@fr...> wrote: > Tuesday, January 5, 2010, 9:47:26 AM, alebu wrote: > >> Thanks, I found this one be seeking discussion. Unfortunately, I am >> not sure is it helpful, because I am running FMPP from Ant (actually >> from maven using maven-ant-run plugin). > > This issue might not be FMPP-specific. Sounds like it's just about > setting up the "class path" under Maven (or maybe under Ant). > >> So, I can't manipulate >> classpath of fmpp, because I even have no installation of it, FMPP >> code comes from maven repository. During the week, I will try to play >> with it (now I am at work and have no access to code where I want to >> apply such approach. In success I will write in this discussion. >> >> On Tue, Jan 5, 2010 at 10:41 AM, Daniel Dekany <dd...@fr...> wrote: >>> Monday, January 4, 2010, 11:31:27 PM, Daniel Dekany wrote: >>> >>>> Monday, January 4, 2010, 9:20:18 PM, alebu wrote: >>>> >>>>> Hi all, >>>>> How can I specify FMPP to include some compiled java code or jar files >>>>> in the freemarker classpath? I need it because I want to use some of >>>>> the functions written with java from freemarker templates and because >>>>> FMPP instanciates freemarker instance, I can't affect a classpath it >>>>> passes to it. >>>> >>>> This may helps: >>>> http://thread.gmane.org/gmane.comp.text.fmpp/133/focus=138 >>> >>> Sorry, I mean this: >>> http://article.gmane.org/gmane.comp.text.fmpp/135 >>> >>> >>> -- >>> Best regards, >>> Daniel Dekany >>> >>> >>> ------------------------------------------------------------------------------ >>> This SF.Net email is sponsored by the Verizon Developer Community >>> Take advantage of Verizon's best-in-class app development support >>> A streamlined, 14 day to market process makes app distribution fast and easy >>> Join now and get one step closer to millions of Verizon customers >>> http://p.sf.net/sfu/verizon-dev2dev >>> _______________________________________________ >>> fmpp-open mailing list >>> fmp...@li... >>> https://lists.sourceforge.net/lists/listinfo/fmpp-open >>> >> >> ------------------------------------------------------------------------------ >> This SF.Net email is sponsored by the Verizon Developer Community >> Take advantage of Verizon's best-in-class app development support >> A streamlined, 14 day to market process makes app distribution fast and easy >> Join now and get one step closer to millions of Verizon customers >> http://p.sf.net/sfu/verizon-dev2dev >> _______________________________________________ >> fmpp-open mailing list >> fmp...@li... >> https://lists.sourceforge.net/lists/listinfo/fmpp-open >> > > -- > Best regards, > Daniel Dekany > > > ------------------------------------------------------------------------------ > This SF.Net email is sponsored by the Verizon Developer Community > Take advantage of Verizon's best-in-class app development support > A streamlined, 14 day to market process makes app distribution fast and easy > Join now and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > _______________________________________________ > fmpp-open mailing list > fmp...@li... > https://lists.sourceforge.net/lists/listinfo/fmpp-open > |
From: Daniel D. <dd...@fr...> - 2010-01-05 10:43:02
|
Tuesday, January 5, 2010, 9:47:26 AM, alebu wrote: > Thanks, I found this one be seeking discussion. Unfortunately, I am > not sure is it helpful, because I am running FMPP from Ant (actually > from maven using maven-ant-run plugin). This issue might not be FMPP-specific. Sounds like it's just about setting up the "class path" under Maven (or maybe under Ant). > So, I can't manipulate > classpath of fmpp, because I even have no installation of it, FMPP > code comes from maven repository. During the week, I will try to play > with it (now I am at work and have no access to code where I want to > apply such approach. In success I will write in this discussion. > > On Tue, Jan 5, 2010 at 10:41 AM, Daniel Dekany <dd...@fr...> wrote: >> Monday, January 4, 2010, 11:31:27 PM, Daniel Dekany wrote: >> >>> Monday, January 4, 2010, 9:20:18 PM, alebu wrote: >>> >>>> Hi all, >>>> How can I specify FMPP to include some compiled java code or jar files >>>> in the freemarker classpath? I need it because I want to use some of >>>> the functions written with java from freemarker templates and because >>>> FMPP instanciates freemarker instance, I can't affect a classpath it >>>> passes to it. >>> >>> This may helps: >>> http://thread.gmane.org/gmane.comp.text.fmpp/133/focus=138 >> >> Sorry, I mean this: >> http://article.gmane.org/gmane.comp.text.fmpp/135 >> >> >> -- >> Best regards, >> Daniel Dekany >> >> >> ------------------------------------------------------------------------------ >> This SF.Net email is sponsored by the Verizon Developer Community >> Take advantage of Verizon's best-in-class app development support >> A streamlined, 14 day to market process makes app distribution fast and easy >> Join now and get one step closer to millions of Verizon customers >> http://p.sf.net/sfu/verizon-dev2dev >> _______________________________________________ >> fmpp-open mailing list >> fmp...@li... >> https://lists.sourceforge.net/lists/listinfo/fmpp-open >> > > ------------------------------------------------------------------------------ > This SF.Net email is sponsored by the Verizon Developer Community > Take advantage of Verizon's best-in-class app development support > A streamlined, 14 day to market process makes app distribution fast and easy > Join now and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > _______________________________________________ > fmpp-open mailing list > fmp...@li... > https://lists.sourceforge.net/lists/listinfo/fmpp-open > -- Best regards, Daniel Dekany |
From: alebu <al...@gm...> - 2010-01-05 08:47:41
|
Thanks, I found this one be seeking discussion. Unfortunately, I am not sure is it helpful, because I am running FMPP from Ant (actually from maven using maven-ant-run plugin). So, I can't manipulate classpath of fmpp, because I even have no installation of it, FMPP code comes from maven repository. During the week, I will try to play with it (now I am at work and have no access to code where I want to apply such approach. In success I will write in this discussion. On Tue, Jan 5, 2010 at 10:41 AM, Daniel Dekany <dd...@fr...> wrote: > Monday, January 4, 2010, 11:31:27 PM, Daniel Dekany wrote: > >> Monday, January 4, 2010, 9:20:18 PM, alebu wrote: >> >>> Hi all, >>> How can I specify FMPP to include some compiled java code or jar files >>> in the freemarker classpath? I need it because I want to use some of >>> the functions written with java from freemarker templates and because >>> FMPP instanciates freemarker instance, I can't affect a classpath it >>> passes to it. >> >> This may helps: >> http://thread.gmane.org/gmane.comp.text.fmpp/133/focus=138 > > Sorry, I mean this: > http://article.gmane.org/gmane.comp.text.fmpp/135 > > > -- > Best regards, > Daniel Dekany > > > ------------------------------------------------------------------------------ > This SF.Net email is sponsored by the Verizon Developer Community > Take advantage of Verizon's best-in-class app development support > A streamlined, 14 day to market process makes app distribution fast and easy > Join now and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > _______________________________________________ > fmpp-open mailing list > fmp...@li... > https://lists.sourceforge.net/lists/listinfo/fmpp-open > |
From: Daniel D. <dd...@fr...> - 2010-01-05 08:41:34
|
Monday, January 4, 2010, 11:31:27 PM, Daniel Dekany wrote: > Monday, January 4, 2010, 9:20:18 PM, alebu wrote: > >> Hi all, >> How can I specify FMPP to include some compiled java code or jar files >> in the freemarker classpath? I need it because I want to use some of >> the functions written with java from freemarker templates and because >> FMPP instanciates freemarker instance, I can't affect a classpath it >> passes to it. > > This may helps: > http://thread.gmane.org/gmane.comp.text.fmpp/133/focus=138 Sorry, I mean this: http://article.gmane.org/gmane.comp.text.fmpp/135 -- Best regards, Daniel Dekany |
From: Daniel D. <dd...@fr...> - 2010-01-04 22:31:40
|
Monday, January 4, 2010, 9:20:18 PM, alebu wrote: > Hi all, > How can I specify FMPP to include some compiled java code or jar files > in the freemarker classpath? I need it because I want to use some of > the functions written with java from freemarker templates and because > FMPP instanciates freemarker instance, I can't affect a classpath it > passes to it. This may helps: http://thread.gmane.org/gmane.comp.text.fmpp/133/focus=138 -- Best regards, Daniel Dekany |
From: alebu <al...@gm...> - 2010-01-04 20:20:26
|
Hi all, How can I specify FMPP to include some compiled java code or jar files in the freemarker classpath? I need it because I want to use some of the functions written with java from freemarker templates and because FMPP instanciates freemarker instance, I can't affect a classpath it passes to it. |
From: alebu <al...@gm...> - 2009-12-07 19:08:05
|
Thanks for superior answer! Maybe I will use FMPP as an example of those output tags implementation. On Mon, Dec 7, 2009 at 8:04 PM, Daniel Dekany <dd...@fr...> wrote: > Monday, December 7, 2009, 5:08:02 PM, alebu wrote: > >> Hi all, >> >> I need some guidelines about FMPP API. I am interested in collecting >> data for FMPP engine using my own code. In general, I only interested >> in those wanderfull tags, that allows to create multiple outputs from >> single template. The questions are: >> 1) What objects are responsible for actual generation part of code? > > Sorry, I don't understant the question. Could you be more specific? > Responsible for the generation of... what? > >> 2) How to configure them ? I was looking at code and I saw that >> TemplateEnvironment has some tags definitions, and Engine is using it >> somehow. >> >> 3) How to specify to search templates in classpath (it is important >> for me). > > Unfortunatelly that's not supported by FMPP... altough FreeMarker > itself can load template from classpath, but there is no public API in > FMPP to achieve that. Worst, it has a real reason that it hasn't: FMPP > directly uses java.io.File etc. to process the source directory (which > not only consist of templates, so I couldn't use FreeMarker's loader > anyway). Next time I write a preprocessor surely I will use some kind > of virtual file-system, but when I wrote FMPP, I just didn't need > that... and now, it would be quite a work to allow loading from non-fs > sources. Unless, you just want to #import/#include those > classloader-loaded templates, becaue via "freemarkerLinks" (see on > http://fmpp.sourceforge.net/settings.html) those templates can be > outside the source root directory. Currently even "freemarkerLinks" > only support plain files, but that wouldn't be a big deal to improve. > >> Also, if templates uses some macros and additional includes, >> then it must be specified too. It is probably more Freemarker >> question, but still... > > See above... FreeMarker has its own template loader mechanism... that > can do things that FMPP's own "loader" can't (and the other way > around). > >> In few words, i want to write a code that: >> 1) Takes some data (as freemarker content) > > What do you mean? FreeMarker has templates, and that's not "data", but > a "program". > >> 2) Instanciate FMPP Engine, configures it to use those tags and search >> templates and other Freemarker specific resources in classpath. >> >> 3) Processes data. Here I need to correctly handle output. >> >> Or maybe it is worth to somehow move those fmpp specific tags into >> freemarker environment? In this case, how can it be done? > > In general, if the approach of FMPP (that can be grasped from the > Qucik Start chapter) doesn't fit your task then don't use it. It's a > tool for a quite specific class of tasks... If yours differs (that I > don't know) FMPP will more in your way than it hellps, and you are > better of using pure FreeMarker. The FMPP tags are not necesarly easy > to extract as is, because they depend on FMPP... but then, you only > have to implement the tags that your application needs. You need > something similar that a certain FMPP tag, you can still peek into the > FMPP source code... Those output slitter tags you meantion are quite > trivial to implement. You will immediatelly see if you look at > FreeMarker. > >> General overview of solution will be fine for me, just point me please >> on the right directions (classes, execution chain, etc). >> >> Thanks in advance! > > -- > Best regards, > Daniel Dekany > > > ------------------------------------------------------------------------------ > Join us December 9, 2009 for the Red Hat Virtual Experience, > a free event focused on virtualization and cloud computing. > Attend in-depth sessions from your desk. Your couch. Anywhere. > http://p.sf.net/sfu/redhat-sfdev2dev > _______________________________________________ > fmpp-open mailing list > fmp...@li... > https://lists.sourceforge.net/lists/listinfo/fmpp-open > |
From: Daniel D. <dd...@fr...> - 2009-12-07 18:05:21
|
Monday, December 7, 2009, 5:08:02 PM, alebu wrote: > Hi all, > > I need some guidelines about FMPP API. I am interested in collecting > data for FMPP engine using my own code. In general, I only interested > in those wanderfull tags, that allows to create multiple outputs from > single template. The questions are: > 1) What objects are responsible for actual generation part of code? Sorry, I don't understant the question. Could you be more specific? Responsible for the generation of... what? > 2) How to configure them ? I was looking at code and I saw that > TemplateEnvironment has some tags definitions, and Engine is using it > somehow. > > 3) How to specify to search templates in classpath (it is important > for me). Unfortunatelly that's not supported by FMPP... altough FreeMarker itself can load template from classpath, but there is no public API in FMPP to achieve that. Worst, it has a real reason that it hasn't: FMPP directly uses java.io.File etc. to process the source directory (which not only consist of templates, so I couldn't use FreeMarker's loader anyway). Next time I write a preprocessor surely I will use some kind of virtual file-system, but when I wrote FMPP, I just didn't need that... and now, it would be quite a work to allow loading from non-fs sources. Unless, you just want to #import/#include those classloader-loaded templates, becaue via "freemarkerLinks" (see on http://fmpp.sourceforge.net/settings.html) those templates can be outside the source root directory. Currently even "freemarkerLinks" only support plain files, but that wouldn't be a big deal to improve. > Also, if templates uses some macros and additional includes, > then it must be specified too. It is probably more Freemarker > question, but still... See above... FreeMarker has its own template loader mechanism... that can do things that FMPP's own "loader" can't (and the other way around). > In few words, i want to write a code that: > 1) Takes some data (as freemarker content) What do you mean? FreeMarker has templates, and that's not "data", but a "program". > 2) Instanciate FMPP Engine, configures it to use those tags and search > templates and other Freemarker specific resources in classpath. > > 3) Processes data. Here I need to correctly handle output. > > Or maybe it is worth to somehow move those fmpp specific tags into > freemarker environment? In this case, how can it be done? In general, if the approach of FMPP (that can be grasped from the Qucik Start chapter) doesn't fit your task then don't use it. It's a tool for a quite specific class of tasks... If yours differs (that I don't know) FMPP will more in your way than it hellps, and you are better of using pure FreeMarker. The FMPP tags are not necesarly easy to extract as is, because they depend on FMPP... but then, you only have to implement the tags that your application needs. You need something similar that a certain FMPP tag, you can still peek into the FMPP source code... Those output slitter tags you meantion are quite trivial to implement. You will immediatelly see if you look at FreeMarker. > General overview of solution will be fine for me, just point me please > on the right directions (classes, execution chain, etc). > > Thanks in advance! -- Best regards, Daniel Dekany |
From: alebu <al...@gm...> - 2009-12-07 16:08:18
|
Hi all, I need some guidelines about FMPP API. I am interested in collecting data for FMPP engine using my own code. In general, I only interested in those wanderfull tags, that allows to create multiple outputs from single template. The questions are: 1) What objects are responsible for actual generation part of code? 2) How to configure them ? I was looking at code and I saw that TemplateEnvironment has some tags definitions, and Engine is using it somehow. 3) How to specify to search templates in classpath (it is important for me). Also, if templates uses some macros and additional includes, then it must be specified too. It is probably more Freemarker question, but still... In few words, i want to write a code that: 1) Takes some data (as freemarker content) 2) Instanciate FMPP Engine, configures it to use those tags and search templates and other Freemarker specific resources in classpath. 3) Processes data. Here I need to correctly handle output. Or maybe it is worth to somehow move those fmpp specific tags into freemarker environment? In this case, how can it be done? General overview of solution will be fine for me, just point me please on the right directions (classes, execution chain, etc). Thanks in advance! |
From: Daniel D. <dd...@fr...> - 2009-10-28 23:23:52
|
Wednesday, October 28, 2009, 6:39:16 PM, Shelley, Ryan wrote: > Well, what I really need is to be able to put my template and sources in > a JAR, and then in my .fmpp config files, reference them like: > > sources: classpath:/in/my/classpath/source.properties > inheritConfiguration: classpath:/in/my/classpath/template.properties Aha. Unfortunately that won't work. FreeMarker itself has no problem with classpath resources, but "by design" FMPP has, since it deals with files directly, no VFS abstraction or like. This thing was originally written to solve some dirty file preprocessing issues for me, and that was the quick way... /-: If it's really a big problem for you, you might consider using FreeMarker directly. If you depend on many FMPP features, that could be painful though. > or in the Ant Task, like: > > <fmpp sourceFile="classpath:/in/my/classpath/template.properties" > data="classpath:/in/my/classpath/data.properties" /> > Or > <fmpp configuration="classpath:/in/my/classpath/foobar.fmpp" > data="classpath:/in/my/classpath/data.properties" /> > > Then I can bundle my sources and templates in a JAR that can be read > when that JAR is loaded on the classpath, then run my Maven Ant Tasks > and have those resources found without having to give explicit > filesystem paths. > > Here's the scenario. I have two maven projects, one that builds a JAR > that contains resource files and some classes (say, an arbitrary Service > module), the second (say, a WAR Web App) depends on the first (the web > component uses the arbitrary Service module) and has a Maven Ant Run > FMPP task to generate some property files based upon the templates that > exist in the first project that configures the dependent Service for > that specific Web app. At the moment, my FMPP Ant Task takes a > filesystem path to the configuration file or the filesystem path to the > source and data files. > > Right now my Maven Ant Tasks, configuration files, etc all need > relative/absolute filesystem paths that may change between developer > environments (our source repo allows arbitrary folder mapping in > workspaces, so I can't guarantee another developer's project workspace > looks like mine). > > If it's not currently supported, that's fine, just want make sure I'm > not missing some functionality that's built in. And if not, maybe > (assuming I get some bandwidth), I could help contribute. Thanks! > > -Ryan > > -----Original Message----- > From: fmp...@li... > [mailto:fmp...@li...] On Behalf Of Daniel > Dekany > Sent: Wednesday, October 28, 2009 7:44 AM > To: FMPP open discussion > Subject: Re: [FMPP] FMPP SourceFile Classpath > > Wednesday, October 28, 2009, 2:39:00 AM, Daniel Dekany wrote: > >> Wednesday, October 28, 2009, 1:01:26 AM, Shelley, Ryan wrote: >> >>> Is it possible to supply a classpath to the sources and >>> inheritConfiguration directives within a FMPP configuration file? >> >> No, that's a Java concern. You have to set up the Java environment >> *before* calling FMPP. > > Which is not at all trivial to do for those who are not wrestled in > Java... so, here is the recipe: > > (a) Easy but dirty solution: Just drop the jar into $FMPP_HOME/lib, > and it will automatically see it, but only when you are using the > $FMPP_HOME/bin/fmpp shell script for running the FMPP projects. This > has global effect in the sense that all FMPP projects that are run > with $FMPP_HOME/bin/fmpp will see the extra jars added there. > > (b) The clean solution: Create a "lib" sub-directory in your FMPP > *project* directory, and drop the extra jar into there. Then, in the > same directory you should create a bash script (or .bat, on Windows) > that runs FMPP with your own custom class-path: > > On Linux/UN*X: > > java -cp > ./lib/yourExtra1.jar:./lib/yourExtra2.jar:$FMPP_HOME/lib/fmpp.jar > fmpp.tools.CommandLine > > On Windows: > > java -cp > .\lib\yourExtra1.jar;.\lib\yourExtra2.jar;%FMPP_HOME%\lib\fmpp.jar > fmpp.tools.CommandLine > > Note that the scrip assumes that the working directory is already your > project directory (you may need to "cd" into it as the first step in > the script). Also it assumes that you have an FMPP_HOME environment > variable; if you don't have it, not a problem, just replace it with a > concrete path in the above scripts (or better, define the environment > variable locally in the scrip). > > Yeah, someday I should invest into writing a native launcher app. that > does all the Java setup magic automatically... /-: > >>> Thanks! >>> >>> -Ryan > -- Best regards, Daniel Dekany |
From: Shelley, R. <Rya...@di...> - 2009-10-28 17:40:58
|
Well, what I really need is to be able to put my template and sources in a JAR, and then in my .fmpp config files, reference them like: sources: classpath:/in/my/classpath/source.properties inheritConfiguration: classpath:/in/my/classpath/template.properties or in the Ant Task, like: <fmpp sourceFile="classpath:/in/my/classpath/template.properties" data="classpath:/in/my/classpath/data.properties" /> Or <fmpp configuration="classpath:/in/my/classpath/foobar.fmpp" data="classpath:/in/my/classpath/data.properties" /> Then I can bundle my sources and templates in a JAR that can be read when that JAR is loaded on the classpath, then run my Maven Ant Tasks and have those resources found without having to give explicit filesystem paths. Here's the scenario. I have two maven projects, one that builds a JAR that contains resource files and some classes (say, an arbitrary Service module), the second (say, a WAR Web App) depends on the first (the web component uses the arbitrary Service module) and has a Maven Ant Run FMPP task to generate some property files based upon the templates that exist in the first project that configures the dependent Service for that specific Web app. At the moment, my FMPP Ant Task takes a filesystem path to the configuration file or the filesystem path to the source and data files. Right now my Maven Ant Tasks, configuration files, etc all need relative/absolute filesystem paths that may change between developer environments (our source repo allows arbitrary folder mapping in workspaces, so I can't guarantee another developer's project workspace looks like mine). If it's not currently supported, that's fine, just want make sure I'm not missing some functionality that's built in. And if not, maybe (assuming I get some bandwidth), I could help contribute. Thanks! -Ryan -----Original Message----- From: fmp...@li... [mailto:fmp...@li...] On Behalf Of Daniel Dekany Sent: Wednesday, October 28, 2009 7:44 AM To: FMPP open discussion Subject: Re: [FMPP] FMPP SourceFile Classpath Wednesday, October 28, 2009, 2:39:00 AM, Daniel Dekany wrote: > Wednesday, October 28, 2009, 1:01:26 AM, Shelley, Ryan wrote: > >> Is it possible to supply a classpath to the sources and >> inheritConfiguration directives within a FMPP configuration file? > > No, that's a Java concern. You have to set up the Java environment > *before* calling FMPP. Which is not at all trivial to do for those who are not wrestled in Java... so, here is the recipe: (a) Easy but dirty solution: Just drop the jar into $FMPP_HOME/lib, and it will automatically see it, but only when you are using the $FMPP_HOME/bin/fmpp shell script for running the FMPP projects. This has global effect in the sense that all FMPP projects that are run with $FMPP_HOME/bin/fmpp will see the extra jars added there. (b) The clean solution: Create a "lib" sub-directory in your FMPP *project* directory, and drop the extra jar into there. Then, in the same directory you should create a bash script (or .bat, on Windows) that runs FMPP with your own custom class-path: On Linux/UN*X: java -cp ./lib/yourExtra1.jar:./lib/yourExtra2.jar:$FMPP_HOME/lib/fmpp.jar fmpp.tools.CommandLine On Windows: java -cp .\lib\yourExtra1.jar;.\lib\yourExtra2.jar;%FMPP_HOME%\lib\fmpp.jar fmpp.tools.CommandLine Note that the scrip assumes that the working directory is already your project directory (you may need to "cd" into it as the first step in the script). Also it assumes that you have an FMPP_HOME environment variable; if you don't have it, not a problem, just replace it with a concrete path in the above scripts (or better, define the environment variable locally in the scrip). Yeah, someday I should invest into writing a native launcher app. that does all the Java setup magic automatically... /-: >> Thanks! >> >> -Ryan -- Best regards, Daniel Dekany ------------------------------------------------------------------------ ------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ fmpp-open mailing list fmp...@li... https://lists.sourceforge.net/lists/listinfo/fmpp-open |
From: Daniel D. <dd...@fr...> - 2009-10-28 14:54:39
|
Wednesday, October 28, 2009, 3:43:41 PM, Daniel Dekany wrote: > Wednesday, October 28, 2009, 2:39:00 AM, Daniel Dekany wrote: > >> Wednesday, October 28, 2009, 1:01:26 AM, Shelley, Ryan wrote: >> >>> Is it possible to supply a classpath to the sources and >>> inheritConfiguration directives within a FMPP configuration file? >> >> No, that's a Java concern. You have to set up the Java environment >> *before* calling FMPP. > > Which is not at all trivial to do for those who are not wrestled in > Java... so, here is the recipe: > > (a) Easy but dirty solution: Just drop the jar into $FMPP_HOME/lib, > and it will automatically see it, but only when you are using the > $FMPP_HOME/bin/fmpp shell script for running the FMPP projects. [snip] Or, fmpp.bat. Same thing... -- Best regards, Daniel Dekany |