alebu | 7 Dec 17:08 2009
Picon

Using FMPP Output Tags separately

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!

------------------------------------------------------------------------------
(Continue reading)

Daniel Dekany | 7 Dec 19:04 2009
Picon

Re: Using FMPP Output Tags separately

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
(Continue reading)

alebu | 7 Dec 20:07 2009
Picon

Re: Using FMPP Output Tags separately

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 <ddekany <at> freemail.hu> 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
(Continue reading)


Gmane