You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by lu...@centerparcs.com on 2004/06/17 16:05:22 UTC

More than one template per page depending on parameters




Hi all,

We are trying to figure out how to use our content management system (CMS)
together with Tapestry. The basic idea is to store Tapestry templates in
the CMS so content managers can edit and preview etc.

Part one: getting the templates from some other place, seems to work fine
using the ItemplateSourceDelegate hook.

Part two is more of a challenge. The contents of a specific template for a
page may actually be different depending on language (and other things, but
lets start with this one). In other words, internationalization is being
handled by the CMS.

For example the Start.html template for the Start.page may be different
depending on the current language settings. Tapestry of course does not
know about all of this and will cache every static bit of HTML in the
template (at least that is my current understanding) ...meaning only the
first language retrieved will ever be seen.

So to make this approach work it seems we will have to make Tapestry
understand that there are actually multiple Start pages, each with their
own template.

Has anyone done anything like this before, or have good ideas on how to
implement something like this in a clean way ?

Probably there will be more parameters than language only (in this case
leveraging the internationalistion stuff would be most straighforward I
guess), so it would be nice if the appoach would be general and also able
to handle these cases.

Any help is greatly appreciated.

Cheers, Luc.



Disclaimer

The information contained in this message and any attachments:

does not constitute an offer or an acceptance of an offer or a
representation or warranty, nor shall it form any part of a legally binding
contract;
has been compiled with care but no representation or warranty (express or
implied) is made as to its accuracy or completeness and no liability can be
accepted for any loss arising from the use of any of the information;
may include opinions or views, which unless expressly stated otherwise, are
not those of the company or any person in relation to whom the company
would have vicarious liability or responsibility;
is not guaranteed to be free from any so-called computer viruses and it is
strongly recommended that you check for such viruses before downloading it
to your computer equipment;
may include hypertext links to the sites of other companies or persons, the
content of which this company has no control over and accepts no liability
for;
is for the exclusive use of the addressee and may contain confidential,
privileged, work product immunity and/or non-disclosable information.  If
you are not the intended recipient and receive this message and any
attachments, you must not read, copy, transmit, disclose or otherwise use
any of them (or part of them) in any way (to do so may be unlawful) and we
would be grateful if you could inform us immediately of any such receipt
and subsequently entirely and permanently erase the message and any
attachments from your equipment.

E-mail is an informal method of communication and is subject to possible
data corruption.  For these reasons it will normally be inappropriate to
rely upon information contained in an e-mail without obtaining tangible
written confirmation of it.


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


Tomcat / Tapestry Question

Posted by James Sherwood <js...@romulin.com>.
Hello,
    I am using Tomcat(5.0.25) and Tapestry 3.0final
    I am trying to use a <filter> in my web.xml for Tomcat(5.0.25)
    I have the filter running the class but my question is this:
    Is there a way I can get the visit for this user from this class?

Basically I have a directory of files, and if you try to get a file from
this dirctory, I have to make sure you have access to that file.  So i
filtered that directory to a class, but I cant seem to get the visit to
check who the person is(they have logged in).

Thank you,
James



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


RE: More than one template per page depending on parameters

Posted by "Howard M. Lewis Ship" <hl...@comcast.net>.
I think there are a lot of possibilities, depending on how your content is organized.

First off, components and pages are not the only thing that can render.  You could create adaptor
objects around your content management data that implement IRender and are delegated to by the page.

More complicated would be to provide template source and specification source delegates that could
provide new templates and specs on the fly.

I've picture a system where you encode the id of you content into page name.  I.e., a page named
"Content$12345".  This will not be found normally, so your spec source delegate can fabricate a
ComponentSpecification for it, and your template source delegate can retrieve a template for it from
your content management system ... possibly transcoding the data stored there into text and
component references while its at it.

There are some issues related to caching of templates and specs that may be addressed in the APIs.

I think Tapestry is actually well suited to this kind of application, but you have to get under its
skin and break some of its rules (rules it exposed for you to break).

--
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Jakarta Tapestry
Creator, Jakarta HiveMind
http://howardlewisship.com


> -----Original Message-----
> From: luc.peerdeman@centerparcs.com 
> [mailto:luc.peerdeman@centerparcs.com] 
> Sent: Thursday, June 17, 2004 10:05 AM
> To: tapestry-user@jakarta.apache.org
> Subject: More than one template per page depending on parameters
> 
> 
> 
> 
> 
> 
> Hi all,
> 
> We are trying to figure out how to use our content management 
> system (CMS)
> together with Tapestry. The basic idea is to store Tapestry 
> templates in
> the CMS so content managers can edit and preview etc.
> 
> Part one: getting the templates from some other place, seems 
> to work fine
> using the ItemplateSourceDelegate hook.
> 
> Part two is more of a challenge. The contents of a specific 
> template for a
> page may actually be different depending on language (and 
> other things, but
> lets start with this one). In other words, 
> internationalization is being
> handled by the CMS.
> 
> For example the Start.html template for the Start.page may be 
> different
> depending on the current language settings. Tapestry of 
> course does not
> know about all of this and will cache every static bit of HTML in the
> template (at least that is my current understanding) 
> ...meaning only the
> first language retrieved will ever be seen.
> 
> So to make this approach work it seems we will have to make Tapestry
> understand that there are actually multiple Start pages, each 
> with their
> own template.
> 
> Has anyone done anything like this before, or have good ideas 
> on how to
> implement something like this in a clean way ?
> 
> Probably there will be more parameters than language only (in 
> this case
> leveraging the internationalistion stuff would be most 
> straighforward I
> guess), so it would be nice if the appoach would be general 
> and also able
> to handle these cases.
> 
> Any help is greatly appreciated.
> 
> Cheers, Luc.
> 
> 
> 
> Disclaimer
> 
> The information contained in this message and any attachments:
> 
> does not constitute an offer or an acceptance of an offer or a
> representation or warranty, nor shall it form any part of a 
> legally binding
> contract;
> has been compiled with care but no representation or warranty 
> (express or
> implied) is made as to its accuracy or completeness and no 
> liability can be
> accepted for any loss arising from the use of any of the information;
> may include opinions or views, which unless expressly stated 
> otherwise, are
> not those of the company or any person in relation to whom the company
> would have vicarious liability or responsibility;
> is not guaranteed to be free from any so-called computer 
> viruses and it is
> strongly recommended that you check for such viruses before 
> downloading it
> to your computer equipment;
> may include hypertext links to the sites of other companies 
> or persons, the
> content of which this company has no control over and accepts 
> no liability
> for;
> is for the exclusive use of the addressee and may contain 
> confidential,
> privileged, work product immunity and/or non-disclosable 
> information.  If
> you are not the intended recipient and receive this message and any
> attachments, you must not read, copy, transmit, disclose or 
> otherwise use
> any of them (or part of them) in any way (to do so may be 
> unlawful) and we
> would be grateful if you could inform us immediately of any 
> such receipt
> and subsequently entirely and permanently erase the message and any
> attachments from your equipment.
> 
> E-mail is an informal method of communication and is subject 
> to possible
> data corruption.  For these reasons it will normally be 
> inappropriate to
> rely upon information contained in an e-mail without 
> obtaining tangible
> written confirmation of it.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 


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