velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Kienenberger <mkien...@alaska.net>
Subject Re: Tiles definitions without tiles-defs.xml
Date Tue, 07 Dec 2004 02:53:18 GMT
"Anthony E. Carlos" <anthony@digitalphenom.com> wrote:
> Thanks so much for the response. I'll look into how Tiles works on the 
> jsp side and see if it can be duplicated in Velocity. I consider myself 
> an intermediate level guy, so I don't know if my patches would be worth 
> anything.
> 
> The problem I'm trying to overcome is that I have content creators (not 
> web programmers) who need to be able to create pages. I'd like them to 
> use Tiles because I'm (I'm the programmer) using Tiles and if I update 
> a Tile, it would be great for the whole site to be updated. The problem 
> is that I want to avoid having content creators touch tiles-defs.xml or 
> struts-config.xml, or have to reload/restart Tomcat.
> 
> In "Struts in Action," page 329, Husted writes that the body-wrap 
> deployment for Tiles is appropriate to avoid creating an extra tile. 
> His example uses insert and put tags to create the definition on the 
> fly. Since this doesn't currently work with Velocity, I'm using 
> Velocity's #parse() directive to simulate some of the tiles stuff. It's 
> a little bit messy, but I think it will work.

Have you considered just using the VelocityLayoutServlet and dumping tiles?

I started my project a year ago using Tiles, but quickly switched over to 
using VelocityLayoutServlet and haven't regretted it.
Our web designer has been able to easily do everything he wants with VLS.   
I'd be curious to know what functionality you'd lose by doing this.

We use something that boils down to the following as our layout template,

<html>
	<head>
	</head>

	<body>
#parse($header)

#parse($leftSideMenu)

#parse($body)

#parse($footer)
	</body>
<html>


We use a version of Ted Husted's ViewAction class which just takes struts 
parameters and puts them into the velocity context (very trivial class).  I 
can't remember if it's included (or just mentioned) in "Struts In Action", 
but I can put it up on the Wiki if it's not already there.

I do let my web designer manage a struts-config-presentation.xml file, but 
he only makes minor changes in it.
An example entry is as follows.  He generally just updates the title parts.  
Anything that's not specifically defined uses the global defaults specified 
at the top of the config file.

		<action path="/vm/Logout"
		 type="us_ok_deq_wqdata.http.ViewAction"
		 validate="false"
		 
parameter="IsExternal;ShouldShowReturnToLastPageLink;Title;leftSideMenu;loginPanel;header;body;footer;bartitle">

		   <forward name="Title" path="Logged out GV E-Bill" />
		   <forward name="bartitle" path="Logged out GV E-Bill" />
		   <forward name="body" path="/WEB-INF/pages/Logout.vm" />
		</action>

-Mike


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Mime
View raw message