Sure can, just add this (could be a singleton if you're going to use
it on a lot of elements):

                public TemplateFactory getLaszloFactory(){
                        return new TemplateFactory(
                                        ResourceFinderClasspath.getInstance(), 
"lzx",
                                        TemplateFactory.CONFIGS_XML, 
"application/xml", ".lzx",
                                        new String[] { 
ValidationBuilder.TAG_ERRORS,
                                                        
ValidationBuilder.TAG_ERRORMESSAGE,
                                                        
TemplateFactory.TAG_LANG,
                                                        
TemplateFactory.TAG_OGNL_CONFIG,
                                                        
TemplateFactory.TAG_OGNL,
                                                        
TemplateFactory.TAG_GROOVY_CONFIG,
                                                        
TemplateFactory.TAG_GROOVY,
                                                        
TemplateFactory.TAG_JANINO_CONFIG,
                                                        
TemplateFactory.TAG_JANINO }, new String[] {
                                                        
ValidationBuilder.TAG_MARK,
                                                        
ValidationBuilder.TAG_ERRORS,
                                                        
TemplateFactory.TAG_CONFIG, TemplateFactory.TAG_L10N,
                                                        
TemplateFactory.TAG_RENDER }, BeanHandlerXml
                                                        .getInstance(), 
EncoderXml.getInstance(), null);                
                }                                               

Then use it with:

TemplateFactory templateFactory =  getLaszloFactory();
templateFactory.get("your.path.laszlofile");

or

getLaszloFactory().get("your.path.laszlofile");

Hopefully that's easy enough.

Cheers,
  Tyler

On 4/26/06, Alexey <[EMAIL PROTECTED]> wrote:
> Hi, Tyler.
>
>   Thank you for your help.
>   Does Rife allow to get templates with different extensions (i.e. not only 
> xml
>   but also lzx)? It will be confusing storing laszlo's lzx as xml files.
>
> Вы писали 26 апреля 2006 г., 17:17:13:
>
> > Check this URL:
>
> > http://rifers.org/wiki/display/RIFE/Localization+through+ResourceBundles
>
> > I'm not too familiar with how RIFE/Laszlo interact, but I know that
> > Laszlo uses XML to generate it's SWFs. There appears to be an errors
> > XML element being generated and sent to the lzx (this is assuming
> > you're following the RIFE/Laszlo sample). You could manually replace
> > the validationErrors text with a proper error and inject that to
> > Laszlo instead. Instead of using
> > validationBuilderXml.generateValidationErrors(), you would need to use
> > bean.getValidationErrors() then move through the list and generate
> > your errors based on the ValidationError's Identifier.
>
> > There might be an easier way, but that's what I came up with on a VERY
> > quick overview.
>
> > Let me know,
> >   Tyler
>
> > On 4/26/06, Alexey <[EMAIL PROTECTED]> wrote:
> >> Hi!
> >>
> >>    I have a problem with localizing validate messages. Built-in support for
> >>    validation in Rife works with method
> >>    validationBuilderXml.generateValidationErrors(Template, 
> >> ValidationErrors,
> >>    ..., ...).
> >>
> >>    But how can I get localized message strings of this errors to the
> >>    template (I use Laszlo)?
> >>
> >>    Seems like using this approach I can't even assign to XML template 
> >> anything
> >>    additional to let Laszlo know which message it needs to show and where.
> >>
> >>    Thank you for any help on this.
>
>
> --
> С уважением,
>  Alexey                          mailto:[EMAIL PROTECTED]
>
> _______________________________________________
> Rife-users mailing list
> [email protected]
> http://lists.uwyn.com/mailman/listinfo/rife-users
>
_______________________________________________
Rife-users mailing list
[email protected]
http://lists.uwyn.com/mailman/listinfo/rife-users

Reply via email to