On Wed, Apr 16, 2008 at 12:33 PM, Mike Kienenberger <[EMAIL PROTECTED]>
wrote:
> Another alternative to option 1 is to #parse($fileName) or
> #include($fileName).
> You can specify filename externally. This is probably the best
> solution so long as the contents of the file included can be included
> "as-is".
>
The only problem with this solution is that you cannot do something like
this:
faces-config-base.xml
<faces-config>
<application>
<!-- custom code -->
</application>
</faces-config>
and include only the application part (what I want because is more clear for
the developer). I have implemented option 1, anyway, using #parse or
#include is also available.
Right now generation of faces-config, .tld (or any config file you want),
component classes and tag classes works. Now I'm doing some big tests (use
it in myfaces 1.1 and generate faces-config, .tld, and tag classes, then
probe it on tomahawk generating all the stuff).
The only part that I want to enhance of this plugin is that is very common
that component generation can be done fully (an example is
javax.faces.component.html classes minus HtmlDataTable). The question is how
to add the definition of this component without creating a .java file and
annotations or doclets to do it (maybe do a part that use groovy .....). My
first idea is create a package scope .java class like _HtmlCommandButton and
add the needed stuff, but this file is included by the compiler to the jar
(does not a big problem, since has not side effects). So I'm looking a
cleaner way to do this.
suggestions are welcome
regards
Leonardo Uribe
> On 4/9/08, Leonardo Uribe <[EMAIL PROTECTED]> wrote:
> > Hi
> >
> > I have another design question. I have finished tag class generation
> using
> > velocity, and right now I'm working on generation of component classes,
> but
> > later I want to use this tool for generate faces-config.xml and
> taglib.tld
> > files too.
> >
> > The problem is that in some point it is necessary to let the user define
> > files like faces-config-base.xml and taglib-base.xml, to add some
> content
> > inside the generated file (or in other words merge this files).
> >
> > 1. One option is use velocity like this:
> >
> > <faces-config>
> > $customContentFromFacesConfigBase
> >
> > <!-- generated xml content -->
> >
> > </faces-config>
> >
> > 2. But another solution is try to merge this files with some xml tool.
> >
> > 3. Other solution is provide what we want to insert what we need to add
> on
> > the template that are readed from
> > mylib/src/main/resources/META-INF/templateForFacesConfig.vm
> >
> > What option could be better? If no suggestions I will go with option 3
> (the
> > easy the better, but option 1 sound good too).
> >
> > regards
> >
> > Leonardo Uribe
> >
> >
>