Re: [Freemarker-devel] Re: An idea: Starting a new 'freemarker-libs' project on sourceforge.
Generates text that depends on changing data (like dynamic HTML).
Brought to you by:
revusky
From: Jonathan R. <re...@gm...> - 2006-05-09 12:58:28
|
Daniel Dekany wrote: > Tuesday, May 9, 2006, 8:48:04 AM, Leos Literak wrote: > > >>Jonathan Revusky wrote: >> >>>We have really not succeeded quite as much as we hoped in terms of the >>>basic "FTL macro library" concept. Well, speaking for myself, when I did >>>all that work a few years ago of implementing namespaces and such, I >>>really envisioned a repository of generally useful FTL macro libraries >>>emerging from user donations. >> >>Well, I will review my templates to see if there is anything worth, >>which would make sense to contribute. If I find something, I will >>post it. > > > Something that is badly needed IMO, is that "dump" macro, that prints > how the data-model (or a variable of it) looks as a tree. (Someone of > yours has already contributed that to the project, but I told it need > to be improved because at its current state there was a too high > potential of showing misleading information, which is then worse than > showing nothing.) > > My other note to this topic is that you can't write serious macro > libraries (like a widget library) without knowing some details about > how the enclosing Web Application Framework works. Or often, without > the enclosing Web Application Framework is aware of the macro library. > As an example look at JSF. It goes far beyond defining a View > technology, and it has to. You see, the events has to be dispatched to > the components somehow and like. So my instinct says that while > writing macro libraries like that RTF generator library or the dump > macro is possible, writing more powerful things, like *good* Web form > handling or "widgets" can rather only be done in the Web Application > Framework. Maybe the stuff can be written in a way that it can be used > easily with many frameworks, but it still can't be written as purely > as an FTL library. I actually take as a given that most significant libraries would have some part that are java code. In any case, some things are better implemented via the TemplateTransformModel, and that is java code. But also, a library might need some java objects that get exposed on the page. But anyway, I don't see a freemarker-libs thing as exclusively a repository of ftl code. It would be ftl and java code. > It will have to be plugged into the frameworks > somehow. And also note that the more concrete task you try to solve > with an FTL library, the more chance that you will duplicate > functionality of frameworks, or do something that's against the > philosophy of frameworks. It's no so surprising, because FreeMarker > (unlike JSP) meant to be just a View technology. It has no access to > the Controller things, unless the frameworks explicitly gives access > to that. > > >>Btw I don't think it is neccessary to have separate SF project. >>I don't see any advantage of it, just less visibility. Together >>both projects have higher SF activity, which may convince new users >>that this project is vital. > > > BTW note that we do have an FTL library section on our home-page for a > long time. Just it's almost empty. > Well, if things had happened as projected or desired, over the last few years, people would have donated macro libraries, and the page would have gradually filled up. But that hasn't happened. So I say that if we do want this to happen, we have to try something different. Oh, and what about the docgen stuff? Maybe we could break that out finally and that could seed a freemarker-libs project. JR |