Re: using templates with XMLC

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

You are looking for the functionality provided by the new XMLC-2.2 deferred 
parsing.  You can access this functionality either via the custom 
XMLCDeferredParsingDOMFactory as the default DOMFactory implementation for 
the DefaultDOMLoader or you can use XMLCContext provided by XMLC.

Now, one question I have for you is whether you are interested in only XMLC 
and not necessarily Barracuda or are you also interested in Barracuda?  I 
guess I could infer you interest in Barracuda given that you posted to the 
Barracuda list, but you only asked about XMLC which is the default view 
technology used by Barracuda.  If you are only interested in XMLC, then 
XMLCContext is what you are looking for.  If you want to use Barracuda on 
top of that, then using the DefaultDOMLoader with the custom DOMFactory is 
your best bet.

For an XMLC only example showing off Deferred Parsing, see the Tomcat 
example in the XMLC-2.2beta1 release or the latest CVS.  Get this all at:
http://debian-sf.objectweb.org/projects/xmlc/


I really need to write up some stuff on how to enable deferred parsing for 
Barracuda...which is essentially the same as for XMLCContext as far as the 
web.xml configuration goes.  Both contrib apps are compiled with deferred 
parsing and modifying the .html files at runtime will result in being able 
to immediately reload and see the changes in your page.  The one caveat 
right now is that all the .html and .xmlc files are copied to the same 
package as the compiled XMLC classes.  This means that in order to modify 
the templates, you need to go into WEB-INF/classes/.... to modify the 
templates.  There is actually another way that I just enabled in the latest 
CVS where you can provide alternate resource paths to a location outside 
the webapp.  I'll try to work up a demo of that to show off the functionality.

In the meantime, you can be assured that XMLC does indeed provide the 
functionality you are looking for!

BTW, you can also use Barracuda's BTemplate to do templating of markup 
without breaking the markup's rules.  There is no proprietary scripting 
language or anything.  Everything is done in "id" or "class" 
attributes.  Very slick stuff.

If you have other more specific questions, don't hesitate to ask.

Jake


At 04:00 PM 6/9/2003 -0700, you wrote:
>I've been becoming more and more interested in using XMLC to replace our 
>wad o'JSP and custom tags.  One thing I like about Struts' custom tags is 
>the templating system.  Its very nice to be able to make a change to a 
>template .jsp and have it applied across the entire site.
>One problem with maintaining static HTML pages is that you don't have the 
>HTML template to help you out so you have to make changes by hand to every 
>page in the site.  I'm wondering if this is also a problem with XMLC.  It 
>seems that XMLC wouldn't have any trouble stuffing values into a template, 
>but what about the HTML people working on the pages?  Do they still need 
>to make changes to each page to see them when developing?  If so is there 
>a solution to this problem?
>   Any thoughts?
>   Thanks,
>     -Wannabe XMLC user
>
>_______________________________________________
>Barracuda mailing list
>[email protected]
>http://barracudamvc.org/lists/listinfo/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.