Re: Barracuda: XML Template Example

Jacob Kjome <[email protected]>
Newsgroups gmane.comp.java.enhydra.barracuda.general
Message-ID <[email protected]>
Hi Simon,

You might want to take a look at the HelloWorld3 tutorial.  Make sure you 
look at it on your own machine rather than trying to run in on the 
enhydra.org server.  Things are broken there.

Jake

At 10:59 AM 12/2/2002 +0100, you wrote:
>hi,
>
>I am trying to introduce Barracuda into my existing system which
>generates a generic markup language (XML) which will then be tranformed
>by a proxy (using XSLT) into the appropriate ML based on the requestors
>device type.
>
>Using the HTML templates is no problem as there are many examples
>available but I am missing the point somewhere when I try to use XML
>templates.
>
>I am getting XMLC to generate the appropriate code from my XML template,
>although when I attempt to bind the Node (id="MainScreen") it is not
>being returned. I have also noticed in the Barracuda log that my
>templates are still being treated as HTML is someway.
>
>As you can see, I am lost :-)
>
>Are there any examples out there of how to handle XML content using
>XMLObject? That would help me enourmously!!!
>
>
>Here is an extract from where things go wrong at the moment.
>
>class RenderMainScreenHandler extends DefaultBaseEventListener {
>   public void handleViewEvent(ViewEventContext context)
>           throws EventException, ServletException, IOException {
>...
>...
>...
>MainScreenXML page =(MainScreenXML)
>    DefaultDOMLoader.getGlobalInstance().getDOM(MainScreenXML.class,
>    locale);
>
>Node node = page.getDocument().getElementById("MainScreen");
>BTemplate templateComp = new BTemplate(new
>GenericScreenModel(strScreenName));
>
>templateComp.setView(new DefaultTemplateView(node));
>
>try {
>         templateComp.render(new DefaultViewContext(context));
>} catch (RenderException re) {
>         logger.warn(strScreenName + " Render failed. Reason: "+re);
>}
>
>new DefaultDOMWriter().write(page, context.getResponse());
>}
>}
>
>
>
>Thanks!
>
>Simon Wilks
>
>
>_______________________________________________
>Barracuda mailing list
>[email protected]
>http://www.enhydra.org/mailman/listinfo.cgi/barracuda
>FAQ - http://www.jguru.com/faq/Barracuda
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.