You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "Auradkar, Rajendra V." <RV...@stthomas.edu> on 2004/02/24 19:05:21 UTC

Customization of view applications

Has anyone used Tapestry in applications where the model and controller
elements remain the same but the view components are dynamic and
customizable by user (similar to portals).  If so, what approach(s) were
used?  How were the controller/model components re-used.  I am getting
muddled up in the architectural issues here.  Can the HTML templates be
generated dynamically?  If so, how?  If they cannot be generated
dynamically, then what?  Sorry if I am being too generic.  The basis of my
question was, has anyone used Tapestry for applications where the
customization/changes happen only on the HTML template side.
 
Thanks in advance,
Raj Auradkar
 


Re: Customization of view applications

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Feb 24, 2004, at 1:05 PM, Auradkar, Rajendra V. wrote:
>  Can the HTML templates be
> generated dynamically?  If so, how?

Oh my yes!

ITemplateSourceDelegate is your friend.  There is an extension point to  
specify this.  I rarely read the docs and rely on the source as the  
definitive answer, but Google'd this up that mentions more details:

	http://jakarta.apache.org/tapestry/doc/TapestryUsersGuide/ 
configuration.extensions.html

>   If they cannot be generated
> dynamically, then what?  Sorry if I am being too generic.  The basis  
> of my
> question was, has anyone used Tapestry for applications where the
> customization/changes happen only on the HTML template side.

Tapestry is very flexible and dynamic.

	Erik


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


Re: Customization of view applications

Posted by Fernando Donati <fe...@donati.com.br>.
Thanks Harish, that's precisely what I meant. I heard about people successfuly using locale as well, but didn't think that was very appropriate. I do believe that in this case css is the way to go.

cheers

fernando

On Fri, 27 Feb 2004 10:37:16 -0500, Harish Krishnaswamy <hk...@comcast.net> escreveu:

> De: Harish Krishnaswamy <hk...@comcast.net>
> Data: Fri, 27 Feb 2004 10:37:16 -0500
> Para: Tapestry users <ta...@jakarta.apache.org>
> Assunto: Re: Customization of view applications
> 
> 
> 
> Erik Hatcher wrote:
> 
> > On Feb 27, 2004, at 8:28 AM, Harish Krishnaswamy wrote:
> >
> >>>> However, depending on what you're trying to do, this may not work 
> >>>> as you expected. I tried developing an application that made use of 
> >>>> this, so the users could pick different skins to see the website 
> >>>> and ran into some very serious cache issues.
> >>>
> >>>
> >>>
> >>> Could you elaborate on the serious cache issues you encountered?
> >>>
> >>> As I understand it, you are responsible for template caching if you 
> >>> roll your own ITemplateSourceDelegate, which seems reasonable to me.
> >>
> >>
> >> I think he means the page cache.
> >
> >
> > I'm not understanding what the problem is in this situation.  Could 
> > you elaborate?
> 
> The template is parsed once on page load and cached in the page. So 
> changing the skin on the fly would render random skins depending on 
> which page instance was retrieved from the pool. Although may not be 
> appropriate, I have heard people use the locale for skinning successfully.
> 
> -Harish
> 
> >
> > Thanks,
> >     Erik
> >
> >
> >
> > ---------------------------------------------------------------------
> > 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
> 
> 
> 
> 

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


Re: Customization of view applications

Posted by Harish Krishnaswamy <hk...@comcast.net>.
 From what I see there are two parts to it - parsing and loading. The 
template source is simply responsible for parsing the template and 
providing the raw tokens. Its the loader (BaseComponentTemplateLoader) 
that is responsible for scanning the parsed tokens and loading and 
inserting the implicit components into the appropriate place. This 
certainly seem like a responsibility of the component itself although I 
don't see why the component cannot delegate the caching based on some 
skin-key may be? I have to see how the locale stuff works, probably 
something similar would work in this situation too.

-Harish

Erik Hatcher wrote:

> On Feb 27, 2004, at 10:37 AM, Harish Krishnaswamy wrote:
>
>>> I'm not understanding what the problem is in this situation.  Could 
>>> you elaborate?
>>
>>
>> The template is parsed once on page load and cached in the page. So 
>> changing the skin on the fly would render random skins depending on 
>> which page instance was retrieved from the pool. Although may not be 
>> appropriate, I have heard people use the locale for skinning 
>> successfully.
>
>
> Harish - thanks for that clear explanation.
>
> Yikes, though!  I guess I've not seen this as I have page caching 
> disabled for development.  How can this be adjusted though?  It would 
> be nice if at least ITemplateSourceDelegate templates do not get 
> cached automatically and that gets deferred to my own implementation 
> however I choose.  An ITemplateSourceDelegate is responsible for the 
> parsing already, so why not the caching?
>
> I'll look at the internals of this myself so I can understand it.
>
>     Erik
>
>
> ---------------------------------------------------------------------
> 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


Re: Customization of view applications

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Feb 27, 2004, at 10:37 AM, Harish Krishnaswamy wrote:
>> I'm not understanding what the problem is in this situation.  Could 
>> you elaborate?
>
> The template is parsed once on page load and cached in the page. So 
> changing the skin on the fly would render random skins depending on 
> which page instance was retrieved from the pool. Although may not be 
> appropriate, I have heard people use the locale for skinning 
> successfully.

Harish - thanks for that clear explanation.

Yikes, though!  I guess I've not seen this as I have page caching 
disabled for development.  How can this be adjusted though?  It would 
be nice if at least ITemplateSourceDelegate templates do not get cached 
automatically and that gets deferred to my own implementation however I 
choose.  An ITemplateSourceDelegate is responsible for the parsing 
already, so why not the caching?

I'll look at the internals of this myself so I can understand it.

	Erik


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


Re: Customization of view applications

Posted by Harish Krishnaswamy <hk...@comcast.net>.

Erik Hatcher wrote:

> On Feb 27, 2004, at 8:28 AM, Harish Krishnaswamy wrote:
>
>>>> However, depending on what you're trying to do, this may not work 
>>>> as you expected. I tried developing an application that made use of 
>>>> this, so the users could pick different skins to see the website 
>>>> and ran into some very serious cache issues.
>>>
>>>
>>>
>>> Could you elaborate on the serious cache issues you encountered?
>>>
>>> As I understand it, you are responsible for template caching if you 
>>> roll your own ITemplateSourceDelegate, which seems reasonable to me.
>>
>>
>> I think he means the page cache.
>
>
> I'm not understanding what the problem is in this situation.  Could 
> you elaborate?

The template is parsed once on page load and cached in the page. So 
changing the skin on the fly would render random skins depending on 
which page instance was retrieved from the pool. Although may not be 
appropriate, I have heard people use the locale for skinning successfully.

-Harish

>
> Thanks,
>     Erik
>
>
>
> ---------------------------------------------------------------------
> 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


Re: Customization of view applications

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Feb 27, 2004, at 8:28 AM, Harish Krishnaswamy wrote:
>>> However, depending on what you're trying to do, this may not work as 
>>> you expected. I tried developing an application that made use of 
>>> this, so the users could pick different skins to see the website and 
>>> ran into some very serious cache issues.
>>
>>
>> Could you elaborate on the serious cache issues you encountered?
>>
>> As I understand it, you are responsible for template caching if you 
>> roll your own ITemplateSourceDelegate, which seems reasonable to me.
>
> I think he means the page cache.

I'm not understanding what the problem is in this situation.  Could you 
elaborate?

Thanks,
	Erik



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


Re: Customization of view applications

Posted by Harish Krishnaswamy <hk...@comcast.net>.

Erik Hatcher wrote:

> On Feb 27, 2004, at 7:04 AM, Fernando Donati wrote:
>
>> As Erik pointed out, there is an application extension that allows 
>> you to define a component's template, ITemplateSourceDelegate.
>>
>> However, depending on what you're trying to do, this may not work as 
>> you expected. I tried developing an application that made use of 
>> this, so the users could pick different skins to see the website and 
>> ran into some very serious cache issues.
>
>
> Could you elaborate on the serious cache issues you encountered?
>
> As I understand it, you are responsible for template caching if you 
> roll your own ITemplateSourceDelegate, which seems reasonable to me.

I think he means the page cache.

>
> Thanks,   
>     Erik
>
>
> ---------------------------------------------------------------------
> 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


Re: Customization of view applications

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Feb 27, 2004, at 7:04 AM, Fernando Donati wrote:
> As Erik pointed out, there is an application extension that allows you 
> to define a component's template, ITemplateSourceDelegate.
>
> However, depending on what you're trying to do, this may not work as 
> you expected. I tried developing an application that made use of this, 
> so the users could pick different skins to see the website and ran 
> into some very serious cache issues.

Could you elaborate on the serious cache issues you encountered?

As I understand it, you are responsible for template caching if you 
roll your own ITemplateSourceDelegate, which seems reasonable to me.

Thanks,	
	Erik


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


Re: Customization of view applications

Posted by Fernando Donati <fe...@donati.com.br>.
As Erik pointed out, there is an application extension that allows you 
to define a component's template, ITemplateSourceDelegate.

However, depending on what you're trying to do, this may not work as 
you expected. I tried developing an application that made use of this, 
so the users could pick different skins to see the website and ran into 
some very serious cache issues.

I was only saved when someone in this list showed me the light of css 
design (http://www.csszengarden.com), which allows you to do the same 
thing in a very elegant way.

cheers,

fernando

On Tuesday, February 24, 2004, at 03:05  PM, Auradkar, Rajendra V. 
wrote:

> Has anyone used Tapestry in applications where the model and controller
> elements remain the same but the view components are dynamic and
> customizable by user (similar to portals).  If so, what approach(s) 
> were
> used?  How were the controller/model components re-used.  I am getting
> muddled up in the architectural issues here.  Can the HTML templates be
> generated dynamically?  If so, how?  If they cannot be generated
> dynamically, then what?  Sorry if I am being too generic.  The basis 
> of my
> question was, has anyone used Tapestry for applications where the
> customization/changes happen only on the HTML template side.
>
> Thanks in advance,
> Raj Auradkar
>
>
> ---------------------------------------------------------------------
> 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