cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Conal Tuohy" <>
Subject RE: why JXTG sucks? was: FreeMarker integration
Date Wed, 11 Aug 2004 06:25:26 GMT
> -----Original Message-----
> From: Leszek Gawron []

> assume you have a collection of Projects. Each project has a 
> project.description property. This property contains a string 
> that can 
> be parsed by a wiki parser and generate html out of it. How would you 
> implement that. Assume that your controller does NOT know what string 
> properties should be wikified as there are hundreds of this kind of 
> properties and you also have several orthogonal views which query 
> different model parts.

I think the idea is that your Java model should present these rich text properties in an already-parsed
form. Strictly speaking, you shouldn't have to _parse_ your Java model - just _access_ it.
This avoids computations in the view layer. If these properties have internal structure relevant
to the view, then the properties should be structured in the model (e.g.a DOM or some kind
of graph of Java beans, not just a String). That's the idea, anyway ... so proponents of JXTG
would tell you to add the parser to your model, not to the view templates. Otherwise, you
would be introducing aspects of your model into the view layer. 

I agree with Joerg that JXTG is already too powerful. Adding extra parsers etc to it may end
up turning it into XSP. 

As a practical suggestion, maybe you could instantiate a Wiki-parser in the controller script,
and pass it to the view template, as another aspect of the model.



View raw message