Re: Newbie question: How do I use localization with deferred parsing?
Jacob Lauemøller <[email protected]>
| Newsgroups | gmane.comp.java.enhydra.barracuda.general |
|---|---|
| Message-ID | <[email protected]> |
Thanks a lot!
That got me a bit further but now I get a compile error. I have the files
LocalizationExample.java
LocalizationExample.html
LocalizationExample.properties
LocalizationExample_da.properties
When I run the localize task-def on the project, it (as expected) generates
the files
LocalizationExample_da.html
LocalizationExampleHTML.java
LocalizationExampleHTML_da.java
The problem is that LocalizationExampleHTML_da attempts to implement (!)
LocalizationExampleHTML which is a class. So, javac balks. The .xmlc files
generated contains
-implements LocalizationExampleHTML
which seems wrong. What am I missing?
TIA
Jacob
On Wednesday 13 August 2003 23:31, Jacob Kjome wrote:
> DefaultDOMLoader uses deferred parsing by default so you don't need to
> specify anything about the deferred parsing factory specifically. Just
> make sure you copy all the generated .html and .xmlc files that match up
> with your localized XMLC DOM classes to the same package as those DOM
> classes. Continue using DefaultDOMLoader like normal.
>
> Note that, optionally, if you want to specify resource directories for the
> deferred parsing factory, these can be specified in the web.xml with the
> same options as XMLCContext takes. You will have to apply the same
> scripting in the object repository assember to set this up, though....
>
> <!-- Set the default dom factory for the global instance of the default dom
> loader -->
> <object name="$this">
> <method name="getServletContext" return="$sc"/>
> </object>
> <object name="$df"
> class="org.enhydra.barracuda.core.util.dom.XMLCDeferredParsingDOMFactory">
> <!-- set the servlet context so that the dom factory can read
> web.xml context params -->
> <method name="setServletContext" arg1="$sc" />
> </object>
> <object class="org.enhydra.barracuda.core.util.dom.DefaultDOMLoader">
> <method name="getGlobalInstance" return="$dl" />
> </object>
> <object name="$dl">
> <method name="setDefaultDOMFactory" arg1="$df" />
> </object>
>
>
> Jake
>
> At 02:56 PM 8/13/2003 +0200, you wrote:
> >Hi,
> >
> >I'm investigating the localization facilities in Barracuda and need some
> >help.
> >How do I combine deferred parsing (XMLC re-load) with localization?
> >
> >I have both things running nicely but cannot seem to find the right way to
> >combine them.
> >
> >The localization example (HelloWorld4) in the Component Model Tutorial
> > uses the DefaultDOMLoader class to indicate the desired Locale when
> > creating the XMLC page object. However, the deferred parsing hints given
> > on the News and Status page tells me to use something along the lines of
> >
> >...
> >
> >if (xmlcFactory == null)
> >{
> > xmlcFactory = new XMLCDeferredParsingFactory(
> > new DocumentLoaderImpl(),
> > this.getClass().getClassLoader(),
> > new StreamXMLCLogger()
> > );
> >}
> >
> > SimpleExampleHTML page =
> > (SimpleExampleHTML)xmlcFactory.create(SimpleExampleHTML.class);
> >
> >How do I pass in the Locale in this case?
> >
> >TIA,
> >Jacob
> >
> >_______________________________________________
> >Barracuda mailing list
> >[email protected]
> >http://barracudamvc.org/lists/listinfo/barracuda
>
> _______________________________________________
> Barracuda mailing list
> [email protected]
> http://barracudamvc.org/lists/listinfo/barracuda