Hi,
>> Template.process(...) would be removed, as it's not the duty of the
>> Template to create the Environment anymore.
>>
>> On the level of the more expert Environment API, this translates to
>> something like this:
>>
>> Environment env = new Environment(cfg, dataModel, out);
>> env.setLocale(aLocale);
>> env.setCustomLookupCondition(aLookupCondition);
>> ... // Addjust env further
>> env.loadMainTemplate(name); // After setting locale and customLookupCond!
>> env.process();
>> ... // Get back variables from env if you want
> This looks a lot clearer and more intuitive to me!
>
The last two lines do not seem intuitive for me. What do they do?
— Denis.
>>
>> You might notice that Environment now stores the
>> customLookupCondition, while in FM2 the Template stores it. Any
>> template loading from the Environment will happen with that condition
>> (and with env.locale, just as in FM2). In FM2 the
>> customLookupCondition is inherited from the Template that contains the
>> #import/#include statement, but if you think about it, the end results
>> is practically the same.
> Yeah, it's really cool concepts now. Very exciting!!
>
> Cheers,
>
> Woonsan
|