You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Michael Grundvig <mi...@electrotank.com> on 2006/06/23 18:27:21 UTC

Porting Existing Site To Tapestry

Hi all; I'm a recent convert to Tapestry and love it thus far! I am about to 
migrate a huge static site into Tapestry. The site is 
http://www.unityonline.org and runs more then 1000 pages and tons of images. 
When packaged down into a war using Maven2, it comes out at 250 megs. 
Because the existing site is static and I want the migration to be painless, 
I'm using friendly URLs. Additionally, I've created a servlet filter that 
maps all directory requests to an index page (ie. http://site.com/stuff 
becomes http://site.com/stuff/index.html). This seems to work great and 
allows Tapestry to handle directory-only requests. With these two things it 
looks like any static site can be ported directly into Tapestry without any 
modifications. Now for the questions:

1) How do I capture a Tapestry error that was caused by a missing page (a 
404). With friendly URLs enabled I get the nice Tapestry error page when 
someone uses an invalid page. I need this to go to the custom 404 page for 
the site.

2) Has anyone tried to port this large of a static site into Tapestry 
directly?

3) Anyone used a war this large before? It's my biggest by far.

Thanks!

Mike 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Porting Existing Site To Tapestry

Posted by "hv @ Fashion Content" <in...@fashioncontent.com>.
> Thanks for the exception code, that's most helpful. Where did you get it? 
> I'd like to be able to just look this type of thing up rather then bugging 
> everyone on the list about it.

There is a nice HiveDoc on the site under Framework -> Reports 
http://tapestry.apache.org/tapestry4/tapestry/hivedocs/index.html

To my knowledge there are very few how to examples though, so bugging the 
list is not such a bad idea if you can't figure out quite how to make the 
<contribution>.

Henrik 




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Porting Existing Site To Tapestry

Posted by Michael Grundvig <mi...@electrotank.com>.
Thanks for the exception code, that's most helpful. Where did you get it? 
I'd like to be able to just look this type of thing up rather then bugging 
everyone on the list about it.

As for the site, they do want to make it more dynamic. It seems the easiest 
approach is to bite the bullet and get it all ported over in one shot. 
Additionally, site maintenence is much simpler with Tapestry, we can use 
components to manage navigation, basic layout, etc. rather then having 1000 
navbars :)

Mike

----- Original Message ----- 
From: "Kevin Menard" <km...@servprise.com>
To: "Tapestry users" <us...@tapestry.apache.org>
Sent: Friday, June 23, 2006 11:34 AM
Subject: Re: Porting Existing Site To Tapestry


On Fri, 23 Jun 2006 12:27:21 -0400, Michael Grundvig
<mi...@electrotank.com> wrote:

> 1) How do I capture a Tapestry error that was caused by a missing page  (a 
> 404). With friendly URLs enabled I get the nice Tapestry error page  when 
> someone uses an invalid page. I need this to go to the custom 404  page 
> for the site.

You're going to want to make something like the following contributions to
HiveMind:

<contribution configuration-id="tapestry.InfrastructureOverrides">
   <property name="exceptionPresenter"
object="service:exceptionPresenter"/>
   </contribution>

<!-- Custom exception page. -->
   <service-point id="exceptionPresenter"
interface="org.apache.tapestry.error.ExceptionPresenter">
   <invoke-factory service-id="hivemind.BuilderFactory" model="singleton">
<construct class="com.servprise.www.services.ExceptionHandler">
<set-object property="exceptionPageName"
value="infrastructure:exceptionPageName"/>
<set-object property="requestExceptionReporter"
value="infrastructure:requestExceptionReporter"/>
<set-object property="responseRenderer"
value="infrastructure:responseRenderer"/>
<set-object property="debug" value="app-property:debug"/>
<set-object property="emailService" value="service:emailService"/>
</construct>
</invoke-factory>
   </service-point>

Replacing the service with your own class that implements
org.apache.tapestry.error.ExceptionPresenter.


> 2) Has anyone tried to port this large of a static site into Tapestry 
> directly?
>
> 3) Anyone used a war this large before? It's my biggest by far.

Out of curiosity, why are you converting a statice site to Tapestry?  It
seems counter-intuitive to me, unless your plan is to gradually make it
more dynamic.

-- 
Kevin



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Porting Existing Site To Tapestry

Posted by Kevin Menard <km...@servprise.com>.
On Fri, 23 Jun 2006 12:27:21 -0400, Michael Grundvig  
<mi...@electrotank.com> wrote:

> 1) How do I capture a Tapestry error that was caused by a missing page  
> (a 404). With friendly URLs enabled I get the nice Tapestry error page  
> when someone uses an invalid page. I need this to go to the custom 404  
> page for the site.

You're going to want to make something like the following contributions to  
HiveMind:

<contribution configuration-id="tapestry.InfrastructureOverrides">
   	<property name="exceptionPresenter"  
object="service:exceptionPresenter"/>
   </contribution>

<!-- Custom exception page. -->
   <service-point id="exceptionPresenter"  
interface="org.apache.tapestry.error.ExceptionPresenter">
   	<invoke-factory service-id="hivemind.BuilderFactory" model="singleton">
		<construct class="com.servprise.www.services.ExceptionHandler">
			<set-object property="exceptionPageName"  
value="infrastructure:exceptionPageName"/>
			<set-object property="requestExceptionReporter"  
value="infrastructure:requestExceptionReporter"/>
			<set-object property="responseRenderer"  
value="infrastructure:responseRenderer"/>
			<set-object property="debug" value="app-property:debug"/>
			<set-object property="emailService" value="service:emailService"/>
		</construct>
	</invoke-factory>
   </service-point>

Replacing the service with your own class that implements  
org.apache.tapestry.error.ExceptionPresenter.


> 2) Has anyone tried to port this large of a static site into Tapestry  
> directly?
>
> 3) Anyone used a war this large before? It's my biggest by far.

Out of curiosity, why are you converting a statice site to Tapestry?  It  
seems counter-intuitive to me, unless your plan is to gradually make it  
more dynamic.

-- 
Kevin



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org