You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Norbert Sándor <pr...@hotmail.com> on 2004/06/16 20:00:50 UTC

Re: Tapestry Features / Skinning

Is this a "legal" way of skinning?
I mean: will this probably work in future releases?

Thanks,
Norbi

----- Original Message ----- 
From: "Karel Miarka" <ka...@issa.cz>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Thursday, May 27, 2004 10:54 AM
Subject: Re: Tapestry Features / Skinning


> Hi,
>
> there is another quite simple possibility of switching page templates at
> runtime:
>
> 1) define all template files you want to use in your page specification as
> context-assets, for example:
>
> <context-asset name="templateRO" path="/WEB-INF/DivisionRO.html"/>
> <context-asset name="templateRW" path="/WEB-INF/DivisionRW.html"/>
>
> 2) overwrite the getAsset() method in your page class, for example:
>
> public IAsset getAsset(String name) {
>   if (ITemplateSource.TEMPLATE_ASSET_NAME.equals(name)) {
>     String templateAssetName = "templateRO";
>     if (... canWrite ... ) {
>       templateAssetName = "templateRW";
>     }
>     return super.getAsset(templateAssetName);
>   }
>   return super.getAsset(name);
> }
>
> The only disadvantage of this approach, I see at the moment, is that with
> this configuration Spindle stops working with such templates saying
> "Tapestry can not see "DivisionRO.html" at runtime... I'm wondering if
this
> must be a reason for Spindle to stop offering XML hints (list of
components
> or attributes for them)?
>
> Best regards,
> Karel
>
>
>
> ---------------------------------------------------------------------
> 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: Tapestry Features / Skinning

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Jun 16, 2004, at 3:52 PM, Harish Krishnaswamy wrote:
> I was looking at Sitemesh recently for this purpose also although I 
> haven't gotten around to it yet. Nice to hear its kosher. Any problems 
> that we need to be aware of?

I'll report back after I've got it fully working in more detail.

It looks like there is a problem decorating login.jsp, sadly.... I 
think this is container dependent though (we're using JRun4).  I see 
SiteMesh documents saying this is broken without adding <dispatcher> 
elements to the filter mappings in web.xml - but that is a newer web 
spec than we are using.

	Erik


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


Re: Tapestry Features / Skinning

Posted by Harish Krishnaswamy <hk...@comcast.net>.
I was looking at Sitemesh recently for this purpose also although I 
haven't gotten around to it yet. Nice to hear its kosher. Any problems 
that we need to be aware of?

-Harish

Erik Hatcher wrote:

> Speaking of skinning.  Has anyone tried using SiteMesh with Tapestry?
>
> Because of the pain of getting J2EE form based login to work with 
> Tapestry along with a common border, we've given up on having a 
> login.application as a hack.  We're going to use a login.jsp.  This 
> morning I started experimenting with using SiteMesh to provide a 
> common border between Tapestry and JSP pages, and so far it looks 
> quite promising.  I had to build SiteMesh from CVS to get it to work 
> properly with Tapestry, but it now works quite nicely.
>
>     Erik
>
>
>
> On Jun 16, 2004, at 2:00 PM, Norbert Sándor wrote:
>
>> Is this a "legal" way of skinning?
>> I mean: will this probably work in future releases?
>>
>> Thanks,
>> Norbi
>>
>> ----- Original Message -----
>> From: "Karel Miarka" <ka...@issa.cz>
>> To: "Tapestry users" <ta...@jakarta.apache.org>
>> Sent: Thursday, May 27, 2004 10:54 AM
>> Subject: Re: Tapestry Features / Skinning
>>
>>
>>> Hi,
>>>
>>> there is another quite simple possibility of switching page 
>>> templates at
>>> runtime:
>>>
>>> 1) define all template files you want to use in your page 
>>> specification as
>>> context-assets, for example:
>>>
>>> <context-asset name="templateRO" path="/WEB-INF/DivisionRO.html"/>
>>> <context-asset name="templateRW" path="/WEB-INF/DivisionRW.html"/>
>>>
>>> 2) overwrite the getAsset() method in your page class, for example:
>>>
>>> public IAsset getAsset(String name) {
>>>   if (ITemplateSource.TEMPLATE_ASSET_NAME.equals(name)) {
>>>     String templateAssetName = "templateRO";
>>>     if (... canWrite ... ) {
>>>       templateAssetName = "templateRW";
>>>     }
>>>     return super.getAsset(templateAssetName);
>>>   }
>>>   return super.getAsset(name);
>>> }
>>>
>>> The only disadvantage of this approach, I see at the moment, is that 
>>> with
>>> this configuration Spindle stops working with such templates saying
>>> "Tapestry can not see "DivisionRO.html" at runtime... I'm wondering if
>>
>> this
>>
>>> must be a reason for Spindle to stop offering XML hints (list of
>>
>> components
>>
>>> or attributes for them)?
>>>
>>> Best regards,
>>> Karel
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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
>
>

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


Re: Tapestry Features / Skinning

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Jun 18, 2004, at 6:52 PM, Matt Raible wrote:
>
> On Jun 18, 2004, at 4:38 PM, Erik Hatcher wrote:
>
>> When will servlets and container managed security be pleasant to work 
>> with?  It just doesn't allow you to do the things real projects need, 
>> like remember me, and nicer ways to control the flow.  Geez.
>
> I've been successful in getting remember me to work with container 
> managed security  - so I wouldn't say its "impossible."  Difficult 
> yes, but not impossible. ;-)

I got it to work in our last project also, but it is an ugly and 
unsecure hack unfortunately.  It's a shame that J2EE security on the 
web tier is so difficult to work with, and also a shame that Tapestry 
has an even harder time working with it.  If there were more hours in 
my day, I'd spend time on fixing Tapestry to accommodate this better, 
unfortunately deadlines are approaching and a working system is needed 
now.  Thankfully "remember me" is not currently a requirement on the 
latest project.

	Erik


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


Re: Tapestry Features / Skinning

Posted by Matt Raible <li...@raibledesigns.com>.
On Jun 18, 2004, at 4:38 PM, Erik Hatcher wrote:

> When will servlets and container managed security be pleasant to work 
> with?  It just doesn't allow you to do the things real projects need, 
> like remember me, and nicer ways to control the flow.  Geez.

I've been successful in getting remember me to work with container 
managed security  - so I wouldn't say its "impossible."  Difficult yes, 
but not impossible. ;-)

Matt


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


Is anyone using hostforweb?

Posted by Joe Andolina <jo...@andomation.com>.
Hello,
	I'm having some trouble with my ISP, Hostforweb. Seems no matter
what I do my servlets just aren't mapping. Is anyone using this ISP for
their Tapestry deployment?

Joe


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


Re: Tapestry Features / Skinning

Posted by Colin Sampaleanu <co...@exis.com>.
Erik Hatcher wrote:

> On Jun 18, 2004, at 5:46 PM, Matt Raible wrote:
>
>> Erik - I'm glad you're heading down this path before me.  I know 
>> you'll figure out how to use both SiteMesh and form-based 
>> authentication with Tapestry.  Let me know once you've figured it out 
>> and I'll dive into learning more about Tapestry.  Skinning and 
>> security were the two Tapestry hurdles I was afraid of. ;-)
>
>
> Well, unfortunately JRun is prohibiting me from leverage SiteMesh.  My 
> initial trials of SiteMesh worked very well, and there are no problems 
> using it with Tapestry in my limited prototype.  However, JRun uses 
> server-side forwards to go to the login page, rather than a 
> client-side redirect like many other app. servers.  In servlet 2.3 
> (which is the latest supported version with JRun), filters aren't 
> necessarily applied to forwards or includes.  Googling for "jrun 
> sitemesh" gave me this:
>
>     http://www.atlassian.com/software/jira/docs/v2.6.1/servers/jrun4.html
>
> *sigh*
>
> So, I'm going to have to hack some solutions to share a border between 
> Tapestry and JSP.
>
> Tapestry and declarative container-based web security just don't mix 
> well.  I haven't found a good way to have a Tapestry-based login 
> page.  You can hack a login.application and /login mapping in web.xml, 
> but deep linking into a secured page like ?service=page/SecuredPage 
> causes the login application to (correctly) complain that there is no 
> SecuredPage in it.  I started to hack the engine to ignore such 
> things, but then requests come for assets too that need to be handled 
> specially.
>
> Howard, if you're listening, what advice do you have for this 
> scenario?  Are you going to tell me HiveMind will solve the problem?  :))
>
> For now, I've reverted to using web.xml login/error/exception page 
> handling to point to JSP pages.  I've extended the engine so that 
> activateExceptionPage simply throws a ServletException and I handled 
> it in an error.jsp (but I did use ExceptionAnalyzer there, and that 
> was a joy).
>
> When will servlets and container managed security be pleasant to work 
> with?  It just doesn't allow you to do the things real projects need, 
> like remember me, and nicer ways to control the flow.  Geez.

I've been using the Acegi Security Framework for Spring, the last while, 
instead of J2EE container security, and find it a lot more flexible and 
generally better all around. You may want to give it a try. Even if you 
don't want to use the Spring Framework generally, the security framework 
is quite usable by itself, with a Spring container there solely to 
provide config for the security stuff.

http://acegisecurity.sourceforge.net/

Regards,
Colin





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


Re: Tapestry Features / Skinning

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Jun 18, 2004, at 5:46 PM, Matt Raible wrote:
> Erik - I'm glad you're heading down this path before me.  I know 
> you'll figure out how to use both SiteMesh and form-based 
> authentication with Tapestry.  Let me know once you've figured it out 
> and I'll dive into learning more about Tapestry.  Skinning and 
> security were the two Tapestry hurdles I was afraid of. ;-)

Well, unfortunately JRun is prohibiting me from leverage SiteMesh.  My 
initial trials of SiteMesh worked very well, and there are no problems 
using it with Tapestry in my limited prototype.  However, JRun uses 
server-side forwards to go to the login page, rather than a client-side 
redirect like many other app. servers.  In servlet 2.3 (which is the 
latest supported version with JRun), filters aren't necessarily applied 
to forwards or includes.  Googling for "jrun sitemesh" gave me this:

	http://www.atlassian.com/software/jira/docs/v2.6.1/servers/jrun4.html

*sigh*

So, I'm going to have to hack some solutions to share a border between 
Tapestry and JSP.

Tapestry and declarative container-based web security just don't mix 
well.  I haven't found a good way to have a Tapestry-based login page.  
You can hack a login.application and /login mapping in web.xml, but 
deep linking into a secured page like ?service=page/SecuredPage causes 
the login application to (correctly) complain that there is no 
SecuredPage in it.  I started to hack the engine to ignore such things, 
but then requests come for assets too that need to be handled 
specially.

Howard, if you're listening, what advice do you have for this scenario? 
  Are you going to tell me HiveMind will solve the problem?  :))

For now, I've reverted to using web.xml login/error/exception page 
handling to point to JSP pages.  I've extended the engine so that 
activateExceptionPage simply throws a ServletException and I handled it 
in an error.jsp (but I did use ExceptionAnalyzer there, and that was a 
joy).

When will servlets and container managed security be pleasant to work 
with?  It just doesn't allow you to do the things real projects need, 
like remember me, and nicer ways to control the flow.  Geez.

	Erik


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


Re: Tapestry Features / Skinning

Posted by Matt Raible <li...@raibledesigns.com>.
Erik - I'm glad you're heading down this path before me.  I know you'll 
figure out how to use both SiteMesh and form-based authentication with 
Tapestry.  Let me know once you've figured it out and I'll dive into 
learning more about Tapestry.  Skinning and security were the two 
Tapestry hurdles I was afraid of. ;-)

Thanks - you da man!

Matt

On Jun 16, 2004, at 1:47 PM, Erik Hatcher wrote:

> Speaking of skinning.  Has anyone tried using SiteMesh with Tapestry?
>
> Because of the pain of getting J2EE form based login to work with 
> Tapestry along with a common border, we've given up on having a 
> login.application as a hack.  We're going to use a login.jsp.  This 
> morning I started experimenting with using SiteMesh to provide a 
> common border between Tapestry and JSP pages, and so far it looks 
> quite promising.  I had to build SiteMesh from CVS to get it to work 
> properly with Tapestry, but it now works quite nicely.
>
> 	Erik
>
>
>
> On Jun 16, 2004, at 2:00 PM, Norbert Sándor wrote:
>
>> Is this a "legal" way of skinning?
>> I mean: will this probably work in future releases?
>>
>> Thanks,
>> Norbi
>>
>> ----- Original Message -----
>> From: "Karel Miarka" <ka...@issa.cz>
>> To: "Tapestry users" <ta...@jakarta.apache.org>
>> Sent: Thursday, May 27, 2004 10:54 AM
>> Subject: Re: Tapestry Features / Skinning
>>
>>
>>> Hi,
>>>
>>> there is another quite simple possibility of switching page 
>>> templates at
>>> runtime:
>>>
>>> 1) define all template files you want to use in your page 
>>> specification as
>>> context-assets, for example:
>>>
>>> <context-asset name="templateRO" path="/WEB-INF/DivisionRO.html"/>
>>> <context-asset name="templateRW" path="/WEB-INF/DivisionRW.html"/>
>>>
>>> 2) overwrite the getAsset() method in your page class, for example:
>>>
>>> public IAsset getAsset(String name) {
>>>   if (ITemplateSource.TEMPLATE_ASSET_NAME.equals(name)) {
>>>     String templateAssetName = "templateRO";
>>>     if (... canWrite ... ) {
>>>       templateAssetName = "templateRW";
>>>     }
>>>     return super.getAsset(templateAssetName);
>>>   }
>>>   return super.getAsset(name);
>>> }
>>>
>>> The only disadvantage of this approach, I see at the moment, is that 
>>> with
>>> this configuration Spindle stops working with such templates saying
>>> "Tapestry can not see "DivisionRO.html" at runtime... I'm wondering 
>>> if
>> this
>>> must be a reason for Spindle to stop offering XML hints (list of
>> components
>>> or attributes for them)?
>>>
>>> Best regards,
>>> Karel
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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
>


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


Re: Tapestry Features / Skinning

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
Speaking of skinning.  Has anyone tried using SiteMesh with Tapestry?

Because of the pain of getting J2EE form based login to work with 
Tapestry along with a common border, we've given up on having a 
login.application as a hack.  We're going to use a login.jsp.  This 
morning I started experimenting with using SiteMesh to provide a common 
border between Tapestry and JSP pages, and so far it looks quite 
promising.  I had to build SiteMesh from CVS to get it to work properly 
with Tapestry, but it now works quite nicely.

	Erik



On Jun 16, 2004, at 2:00 PM, Norbert Sándor wrote:

> Is this a "legal" way of skinning?
> I mean: will this probably work in future releases?
>
> Thanks,
> Norbi
>
> ----- Original Message -----
> From: "Karel Miarka" <ka...@issa.cz>
> To: "Tapestry users" <ta...@jakarta.apache.org>
> Sent: Thursday, May 27, 2004 10:54 AM
> Subject: Re: Tapestry Features / Skinning
>
>
>> Hi,
>>
>> there is another quite simple possibility of switching page templates 
>> at
>> runtime:
>>
>> 1) define all template files you want to use in your page 
>> specification as
>> context-assets, for example:
>>
>> <context-asset name="templateRO" path="/WEB-INF/DivisionRO.html"/>
>> <context-asset name="templateRW" path="/WEB-INF/DivisionRW.html"/>
>>
>> 2) overwrite the getAsset() method in your page class, for example:
>>
>> public IAsset getAsset(String name) {
>>   if (ITemplateSource.TEMPLATE_ASSET_NAME.equals(name)) {
>>     String templateAssetName = "templateRO";
>>     if (... canWrite ... ) {
>>       templateAssetName = "templateRW";
>>     }
>>     return super.getAsset(templateAssetName);
>>   }
>>   return super.getAsset(name);
>> }
>>
>> The only disadvantage of this approach, I see at the moment, is that 
>> with
>> this configuration Spindle stops working with such templates saying
>> "Tapestry can not see "DivisionRO.html" at runtime... I'm wondering if
> this
>> must be a reason for Spindle to stop offering XML hints (list of
> components
>> or attributes for them)?
>>
>> Best regards,
>> Karel
>>
>>
>>
>> ---------------------------------------------------------------------
>> 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: Tapestry Features / Skinning

Posted by zengyi kid <ze...@yahoo.com.cn>.
that's good

Matt Raible <li...@raibledesigns.com> wrote: I'm pretty handy with CSS. I'll try to help if see any CSS-related
questions on this list. Of course, the easiest way to help with CSS is
to be able to actually *see* it - so it you can make your app publicly
available - I can help a lot more.

Matt

> -----Original Message-----
> From: Todd O'Bryan [mailto:toddobryan@mac.com] 
> Sent: Thursday, June 24, 2004 7:02 PM
> To: Tapestry users
> Subject: Re: Tapestry Features / Skinning
> 
> 
> DO IT!!!!
> 
> I thought about this myself. You could store the user's 
> preferred style 
> in the Visit object and just grab it from there for each page, with a 
> default, obviously.
> 
> Now I just have to get good at CSS...
> 
> Todd
> 
> On Jun 24, 2004, at 1:54 PM, Robert Zeigler wrote:
> 
> > I'm curious... everyone seems to be hitting the "skinning" idea from
> > the point of variable templates. But... ;) What if you hit 
> things from 
> > a different angle, namely css? Yes, I know css can have its 
> quirks. ;) 
> > But, if you take the time to put together a table-less 
> layout, based 
> > 100% on an external stylesheet, you can do some pretty neat things 
> > just by selecting a different stylesheet. A site that was a 
> real eye 
> > opener for me was: http://www.csszengarden.com.
> >
> > So, theoretically, it's possible to just dynamically grab a 
> different
> > stylesheet to skin your application. Granted, that's 
> theory. ;) But, 
> > I've started work on the searchable component repository I 
> brought up 
> > awhile back. One of my goals on this project is to do the 
> layout 100% 
> > in css. Eventually, I'm going to try to add support for user-based 
> > skins/styles. We'll see what happens but... any thoughts on this?
> >
> > Robert
> >
> > 
> ---------------------------------------------------------------------
> > 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




Software entities should be open for extension, but close for modification.


---------------------------------
Do You Yahoo!?
100兆邮箱够不够用?雅虎电邮自助扩容!

RE: Tapestry Features / Skinning

Posted by Matt Raible <li...@raibledesigns.com>.
I'm pretty handy with CSS.  I'll try to help if see any CSS-related
questions on this list.  Of course, the easiest way to help with CSS is
to be able to actually *see* it - so it you can make your app publicly
available - I can help a lot more.

Matt

> -----Original Message-----
> From: Todd O'Bryan [mailto:toddobryan@mac.com] 
> Sent: Thursday, June 24, 2004 7:02 PM
> To: Tapestry users
> Subject: Re: Tapestry Features / Skinning
> 
> 
> DO IT!!!!
> 
> I thought about this myself. You could store the user's 
> preferred style 
> in the Visit object and just grab it from there for each page, with a 
> default, obviously.
> 
> Now I just have to get good at CSS...
> 
> Todd
> 
> On Jun 24, 2004, at 1:54 PM, Robert Zeigler wrote:
> 
> > I'm curious... everyone seems to be hitting the "skinning" idea from
> > the point of variable templates. But... ;) What if you hit 
> things from 
> > a different angle, namely css? Yes, I know css can have its 
> quirks. ;) 
> > But, if you take the time to put together a table-less 
> layout, based 
> > 100% on an external stylesheet, you can do some pretty neat things 
> > just by selecting a different stylesheet. A site that was a 
> real eye 
> > opener for me was: http://www.csszengarden.com.
> >
> > So, theoretically, it's possible to just dynamically grab a 
> different
> > stylesheet to skin your application.  Granted, that's 
> theory. ;) But, 
> > I've started work on the searchable component repository I 
> brought up 
> > awhile back.  One of my goals on this project is to do the 
> layout 100% 
> > in css. Eventually, I'm going to try to add support for user-based 
> > skins/styles. We'll see what happens but... any thoughts on this?
> >
> > Robert
> >
> > 
> ---------------------------------------------------------------------
> > 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: Tapestry Features / Skinning

Posted by "Christopher M. DeBracy" <ch...@debracy.net>.
I'll try the Visit object today to see if that doesn't do the trick. Given
the stylesheet content is not really part of the page, hopefully you're
right and I just got caught up with my own tests and missed this.

> -----Original Message-----
> From: Todd O'Bryan [mailto:toddobryan@mac.com] 
> Sent: Thursday, June 24, 2004 10:24 PM
> To: Tapestry users
> Subject: Re: Tapestry Features / Skinning
> 
> 
> Remember that cached pages still have the right content depending on 
> the session (If you print the user name at the top of a page, it's 
> appropriate to each user.), so I think if you actually use an IAsset 
> everything should dynamically happen and you should get the 
> appropriate 
> stylesheet.
> 
> 
> Can someone who understands what page caching actually means 
> straighten 
> this out for us?
> 
> Todd
> 
> On Jun 24, 2004, at 11:10 PM, Christopher M. DeBracy wrote:
> 
> > No, right now I'm just tying the stylesheet to my @Border component.
> >
> > <html jwcid="@Shell" title="ognl:windowTitle" 
> > stylesheet="ognl:assets.stylesheet">
> >
> > So the stylesheet name is cached, not the stylesheet itself.
> >
> > If Tapestry allows session-specific pages, then your idea 
> would work.
> > Does
> > Tapestry allow this?
> >
> > My "list of stylesheets" question was part thinking out loud. From
> > playing
> > with Struts, there was a mechanism to create a map in the 
> config file 
> > and I
> > was wondering if Tapestry did the same thing - I just 
> didn't express 
> > it very
> > well. Your idea for listing the stylesheets from a directory would 
> > work just
> > fine.
> >
> > Chris
> >
> >> -----Original Message-----
> >> From: Todd O'Bryan [mailto:toddobryan@mac.com]
> >> Sent: Thursday, June 24, 2004 9:52 PM
> >> To: Tapestry users
> >> Subject: Re: Tapestry Features / Skinning
> >>
> >>
> >> I haven't been paying attention. Sorry. I'm trying to add 
> a teaching 
> >> certification in Spanish so that I can get paid for my Master's 
> >> degree. Long story. And I just bought a house. Anywho...
> >>
> >> Are you saying that if you have a
> >>
> >> <@Shell stylesheet="ognl:visit.stylesheet">
> >>
> >> where the Visit object has a getStylesheet() method that 
> returns some 
> >> kind of class implementing IAsset (probably a 
> ContextAsset), then the 
> >> stylesheet gets cached with the page and can't be updated.
> >>
> >> As to how to get a list of stylesheets, I think I'd load 
> them in the 
> >> Global on startup or periodically check to see if any stylesheet 
> >> files had been added. Create a stylesheet directory 
> somewhere in your
> >> project. Maybe create a Stylesheet object that implements 
> IAsset and
> >> has a name for the stylesheet in addition to the URL for its
> >> CSS file.
> >> In the Global, have a getStylesheets() method that returns all the
> >> stylesheets currently defined for the webapp. On the user 
> preference
> >> page, you could list all the stylesheets and let users 
> choose the one
> >> they prefer, which would set the Stylesheet in the Visit.
> >>
> >> Someone jump in if I'm being overly complicated, overly 
> simplistic, 
> >> or just ranting incoherently.
> >>
> >> Todd
> >>
> >> On Jun 24, 2004, at 9:44 PM, Christopher M. DeBracy wrote:
> >>
> >>> Todd,
> >>>
> >>> I'm not sure if that would work, because of page caching. 
> I'm toying 
> >>> with it now, but I defined the following in my Border.jwc:
> >>>
> >>>   <context-asset name="stylesheet1" path="css/style1.css"/>
> >>>   <context-asset name="stylesheet2" path="css/style2.css"/>
> >>>
> >>> I'm arbitrarily selecting one of these at startup. Now that
> >> stylesheet
> >>> name
> >>> is part of the cached page. I can do a reset and flush 
> the pages to 
> >>> select another, but have my previously reported 
> current-page cache 
> >>> problem appears.
> >>>
> >>> However, if I overwrite the filename at run-time, the stylesheet 
> >>> changes take effect since the name is the same as was cached.
> >>>
> >>> Perhaps Tapestry allows page pooling per session? If so, then you 
> >>> could choose on the fly. However, I haven't run across that.
> >>>
> >>> I'm making some progress, but as usual some questions are 
> answered 
> >>> while new ones appear. :)
> >>>
> >>> Speaking of which, any ideas as to the best mechanism to 
> define an 
> >>> array of stylesheets within a .page or .jwc file?
> >>>
> >>> Thanks.
> >>>
> >>> Chris
> >>>
> >>>> -----Original Message-----
> >>>> From: Todd O'Bryan [mailto:toddobryan@mac.com]
> >>>> Sent: Thursday, June 24, 2004 8:02 PM
> >>>> To: Tapestry users
> >>>> Subject: Re: Tapestry Features / Skinning
> >>>>
> >>>>
> >>>> DO IT!!!!
> >>>>
> >>>> I thought about this myself. You could store the user's 
> preferred 
> >>>> style in the Visit object and just grab it from there for
> >> each page,
> >>>> with a default, obviously.
> >>>>
> >>>> Now I just have to get good at CSS...
> >>>>
> >>>> Todd
> >>>>
> >>>> On Jun 24, 2004, at 1:54 PM, Robert Zeigler wrote:
> >>>>
> >>>>> I'm curious... everyone seems to be hitting the
> >> "skinning" idea from
> >>>>> the point of variable templates. But... ;) What if you hit
> >>>> things from
> >>>>> a different angle, namely css? Yes, I know css can have its
> >>>> quirks. ;)
> >>>>> But, if you take the time to put together a table-less
> >>>> layout, based
> >>>>> 100% on an external stylesheet, you can do some pretty
> >> neat things
> >>>>> just by selecting a different stylesheet. A site that was a
> >>>> real eye
> >>>>> opener for me was: http://www.csszengarden.com.
> >>>>>
> >>>>> So, theoretically, it's possible to just dynamically grab a
> >>>> different
> >>>>> stylesheet to skin your application.  Granted, that's
> >>>> theory. ;) But,
> >>>>> I've started work on the searchable component repository I
> >>>> brought up
> >>>>> awhile back.  One of my goals on this project is to do the
> >>>> layout 100%
> >>>>> in css. Eventually, I'm going to try to add support for
> >> user-based
> >>>>> skins/styles. We'll see what happens but... any 
> thoughts on this?
> >>>>>
> >>>>> Robert
> >>>>>
> >>>>>
> >>>>
> >> 
> ---------------------------------------------------------------------
> >>>>> 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
> >>>
> >>
> >>
> >> 
> ---------------------------------------------------------------------
> >> 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
> 
> 



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


RE: Tapestry Features / Skinning

Posted by "Christopher M. DeBracy" <ch...@debracy.net>.
That helps. Tomorrow I'll get my head around the creation of a ContextAsset
so I can return it from Visit.

Thanks!

> -----Original Message-----
> From: Todd O'Bryan [mailto:toddobryan@mac.com]
> Sent: Friday, June 25, 2004 9:33 PM
> To: Tapestry users
> Subject: Re: Tapestry Features / Skinning
> 
> 
> Luckily, AbstractComponent has a getPage() method.
> 
> So,
> 
> stylesheet="ognl:page.visit.stylesheet"
> 
> should do the trick.
> 
> Todd
> 
> On Jun 25, 2004, at 10:24 PM, Christopher M. DeBracy wrote:
> 
> > Hey Todd,
> >
> > Unfortunately, I haven't had too much time today. However, I didn't 
> > want you to think I'd forgotten about this.
> >
> > Right now my Visit object extends BaseComponent so I can return an 
> > IAsset for the stylesheet in question. Where I'm stuck is:
> >
> > <html jwcid="@Shell" title="ognl:windowTitle"
> > stylesheet="ognl:visit.stylesheet">
> >
> > Since my Border component extends BaseComponent, the call to
> > getVisit() is
> > inaccessible.
> >
> > What's the best way to make the Visit.getStylesheet()
> method available
> > to
> > the Border component? I'm thinking that perhaps in the
> Border.jwc I can
> > declare a component that will bind to the visit class. Or
> am I barking
> > up
> > the wrong tree?
> >
> > I'm sure it's something simple and worse comes to worse, I'll work 
> > through it tomorrow.
> >
> > Thanks,
> >
> > Chris
> >
> >> -----Original Message-----
> >> From: Todd O'Bryan [mailto:toddobryan@mac.com]
> >> Sent: Thursday, June 24, 2004 10:24 PM
> >> To: Tapestry users
> >> Subject: Re: Tapestry Features / Skinning
> >>
> >>
> >> Remember that cached pages still have the right content
> depending on
> >> the session (If you print the user name at the top of a page, it's
> >> appropriate to each user.), so I think if you actually use 
> an IAsset
> >> everything should dynamically happen and you should get the
> >> appropriate stylesheet.
> >>
> >>
> >> Can someone who understands what page caching actually means
> >> straighten this out for us?
> >>
> >> Todd
> >>
> >> On Jun 24, 2004, at 11:10 PM, Christopher M. DeBracy wrote:
> >>
> >>> No, right now I'm just tying the stylesheet to my @Border
> component.
> >>>
> >>> <html jwcid="@Shell" title="ognl:windowTitle"
> >>> stylesheet="ognl:assets.stylesheet">
> >>>
> >>> So the stylesheet name is cached, not the stylesheet itself.
> >>>
> >>> If Tapestry allows session-specific pages, then your idea
> >> would work.
> >>> Does
> >>> Tapestry allow this?
> >>>
> >>> My "list of stylesheets" question was part thinking out
> loud. From
> >>> playing with Struts, there was a mechanism to create a map in the
> >> config file
> >>> and I
> >>> was wondering if Tapestry did the same thing - I just
> >> didn't express
> >>> it very
> >>> well. Your idea for listing the stylesheets from a
> directory would
> >>> work just fine.
> >>>
> >>> Chris
> >>>
> >>>> -----Original Message-----
> >>>> From: Todd O'Bryan [mailto:toddobryan@mac.com]
> >>>> Sent: Thursday, June 24, 2004 9:52 PM
> >>>> To: Tapestry users
> >>>> Subject: Re: Tapestry Features / Skinning
> >>>>
> >>>>
> >>>> I haven't been paying attention. Sorry. I'm trying to add
> >> a teaching
> >>>> certification in Spanish so that I can get paid for my Master's
> >>>> degree. Long story. And I just bought a house. Anywho...
> >>>>
> >>>> Are you saying that if you have a
> >>>>
> >>>> <@Shell stylesheet="ognl:visit.stylesheet">
> >>>>
> >>>> where the Visit object has a getStylesheet() method that
> >> returns some
> >>>> kind of class implementing IAsset (probably a
> >> ContextAsset), then the
> >>>> stylesheet gets cached with the page and can't be updated.
> >>>>
> >>>> As to how to get a list of stylesheets, I think I'd load
> >> them in the
> >>>> Global on startup or periodically check to see if any stylesheet
> >>>> files had been added. Create a stylesheet directory
> >> somewhere in your
> >>>> project. Maybe create a Stylesheet object that implements
> >> IAsset and
> >>>> has a name for the stylesheet in addition to the URL for its CSS
> >>>> file. In the Global, have a getStylesheets() method that returns 
> >>>> all the stylesheets currently defined for the webapp. On the user
> >> preference
> >>>> page, you could list all the stylesheets and let users
> >> choose the one
> >>>> they prefer, which would set the Stylesheet in the Visit.
> >>>>
> >>>> Someone jump in if I'm being overly complicated, overly
> >> simplistic,
> >>>> or just ranting incoherently.
> >>>>
> >>>> Todd
> >>>>
> >>>> On Jun 24, 2004, at 9:44 PM, Christopher M. DeBracy wrote:
> >>>>
> >>>>> Todd,
> >>>>>
> >>>>> I'm not sure if that would work, because of page caching.
> >> I'm toying
> >>>>> with it now, but I defined the following in my Border.jwc:
> >>>>>
> >>>>>   <context-asset name="stylesheet1" path="css/style1.css"/>
> >>>>>   <context-asset name="stylesheet2" path="css/style2.css"/>
> >>>>>
> >>>>> I'm arbitrarily selecting one of these at startup. Now that
> >>>> stylesheet
> >>>>> name
> >>>>> is part of the cached page. I can do a reset and flush
> >> the pages to
> >>>>> select another, but have my previously reported
> >> current-page cache
> >>>>> problem appears.
> >>>>>
> >>>>> However, if I overwrite the filename at run-time, the
> stylesheet
> >>>>> changes take effect since the name is the same as was cached.
> >>>>>
> >>>>> Perhaps Tapestry allows page pooling per session? If
> so, then you
> >>>>> could choose on the fly. However, I haven't run across that.
> >>>>>
> >>>>> I'm making some progress, but as usual some questions are
> >> answered
> >>>>> while new ones appear. :)
> >>>>>
> >>>>> Speaking of which, any ideas as to the best mechanism to
> >> define an
> >>>>> array of stylesheets within a .page or .jwc file?
> >>>>>
> >>>>> Thanks.
> >>>>>
> >>>>> Chris
> >>>>>
> >>>>>> -----Original Message-----
> >>>>>> From: Todd O'Bryan [mailto:toddobryan@mac.com]
> >>>>>> Sent: Thursday, June 24, 2004 8:02 PM
> >>>>>> To: Tapestry users
> >>>>>> Subject: Re: Tapestry Features / Skinning
> >>>>>>
> >>>>>>
> >>>>>> DO IT!!!!
> >>>>>>
> >>>>>> I thought about this myself. You could store the user's
> >> preferred
> >>>>>> style in the Visit object and just grab it from there for
> >>>> each page,
> >>>>>> with a default, obviously.
> >>>>>>
> >>>>>> Now I just have to get good at CSS...
> >>>>>>
> >>>>>> Todd
> >>>>>>
> >>>>>> On Jun 24, 2004, at 1:54 PM, Robert Zeigler wrote:
> >>>>>>
> >>>>>>> I'm curious... everyone seems to be hitting the
> >>>> "skinning" idea from
> >>>>>>> the point of variable templates. But... ;) What if you hit
> >>>>>> things from
> >>>>>>> a different angle, namely css? Yes, I know css can have its
> >>>>>> quirks. ;)
> >>>>>>> But, if you take the time to put together a table-less
> >>>>>> layout, based
> >>>>>>> 100% on an external stylesheet, you can do some pretty
> >>>> neat things
> >>>>>>> just by selecting a different stylesheet. A site that was a
> >>>>>> real eye
> >>>>>>> opener for me was: http://www.csszengarden.com.
> >>>>>>>
> >>>>>>> So, theoretically, it's possible to just dynamically grab a
> >>>>>> different
> >>>>>>> stylesheet to skin your application.  Granted, that's
> >>>>>> theory. ;) But,
> >>>>>>> I've started work on the searchable component repository I
> >>>>>> brought up
> >>>>>>> awhile back.  One of my goals on this project is to do the
> >>>>>> layout 100%
> >>>>>>> in css. Eventually, I'm going to try to add support for
> >>>> user-based
> >>>>>>> skins/styles. We'll see what happens but... any
> >> thoughts on this?
> >>>>>>>
> >>>>>>> Robert
> >>>>>>>
> >>>>>>>
> >>>>>>
> >>>>
> >> 
> ---------------------------------------------------------------------
> >>>>>>> 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
> >>>>>
> >>>>
> >>>>
> >>>>
> >> 
> ---------------------------------------------------------------------
> >>>> 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
> >>
> >>
> >
> >
> >
> > 
> ---------------------------------------------------------------------
> > 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: Tapestry Features / Skinning

Posted by Todd O'Bryan <to...@mac.com>.
Luckily, AbstractComponent has a getPage() method.

So,

stylesheet="ognl:page.visit.stylesheet"

should do the trick.

Todd

On Jun 25, 2004, at 10:24 PM, Christopher M. DeBracy wrote:

> Hey Todd,
>
> Unfortunately, I haven't had too much time today. However, I didn't 
> want you
> to think I'd forgotten about this.
>
> Right now my Visit object extends BaseComponent so I can return an 
> IAsset
> for the stylesheet in question. Where I'm stuck is:
>
> <html jwcid="@Shell" title="ognl:windowTitle"
> stylesheet="ognl:visit.stylesheet">
>
> Since my Border component extends BaseComponent, the call to 
> getVisit() is
> inaccessible.
>
> What's the best way to make the Visit.getStylesheet() method available 
> to
> the Border component? I'm thinking that perhaps in the Border.jwc I can
> declare a component that will bind to the visit class. Or am I barking 
> up
> the wrong tree?
>
> I'm sure it's something simple and worse comes to worse, I'll work 
> through
> it tomorrow.
>
> Thanks,
>
> Chris
>
>> -----Original Message-----
>> From: Todd O'Bryan [mailto:toddobryan@mac.com]
>> Sent: Thursday, June 24, 2004 10:24 PM
>> To: Tapestry users
>> Subject: Re: Tapestry Features / Skinning
>>
>>
>> Remember that cached pages still have the right content depending on
>> the session (If you print the user name at the top of a page, it's
>> appropriate to each user.), so I think if you actually use an IAsset
>> everything should dynamically happen and you should get the
>> appropriate
>> stylesheet.
>>
>>
>> Can someone who understands what page caching actually means
>> straighten
>> this out for us?
>>
>> Todd
>>
>> On Jun 24, 2004, at 11:10 PM, Christopher M. DeBracy wrote:
>>
>>> No, right now I'm just tying the stylesheet to my @Border component.
>>>
>>> <html jwcid="@Shell" title="ognl:windowTitle"
>>> stylesheet="ognl:assets.stylesheet">
>>>
>>> So the stylesheet name is cached, not the stylesheet itself.
>>>
>>> If Tapestry allows session-specific pages, then your idea
>> would work.
>>> Does
>>> Tapestry allow this?
>>>
>>> My "list of stylesheets" question was part thinking out loud. From
>>> playing
>>> with Struts, there was a mechanism to create a map in the
>> config file
>>> and I
>>> was wondering if Tapestry did the same thing - I just
>> didn't express
>>> it very
>>> well. Your idea for listing the stylesheets from a directory would
>>> work just
>>> fine.
>>>
>>> Chris
>>>
>>>> -----Original Message-----
>>>> From: Todd O'Bryan [mailto:toddobryan@mac.com]
>>>> Sent: Thursday, June 24, 2004 9:52 PM
>>>> To: Tapestry users
>>>> Subject: Re: Tapestry Features / Skinning
>>>>
>>>>
>>>> I haven't been paying attention. Sorry. I'm trying to add
>> a teaching
>>>> certification in Spanish so that I can get paid for my Master's
>>>> degree. Long story. And I just bought a house. Anywho...
>>>>
>>>> Are you saying that if you have a
>>>>
>>>> <@Shell stylesheet="ognl:visit.stylesheet">
>>>>
>>>> where the Visit object has a getStylesheet() method that
>> returns some
>>>> kind of class implementing IAsset (probably a
>> ContextAsset), then the
>>>> stylesheet gets cached with the page and can't be updated.
>>>>
>>>> As to how to get a list of stylesheets, I think I'd load
>> them in the
>>>> Global on startup or periodically check to see if any stylesheet
>>>> files had been added. Create a stylesheet directory
>> somewhere in your
>>>> project. Maybe create a Stylesheet object that implements
>> IAsset and
>>>> has a name for the stylesheet in addition to the URL for its
>>>> CSS file.
>>>> In the Global, have a getStylesheets() method that returns all the
>>>> stylesheets currently defined for the webapp. On the user
>> preference
>>>> page, you could list all the stylesheets and let users
>> choose the one
>>>> they prefer, which would set the Stylesheet in the Visit.
>>>>
>>>> Someone jump in if I'm being overly complicated, overly
>> simplistic,
>>>> or just ranting incoherently.
>>>>
>>>> Todd
>>>>
>>>> On Jun 24, 2004, at 9:44 PM, Christopher M. DeBracy wrote:
>>>>
>>>>> Todd,
>>>>>
>>>>> I'm not sure if that would work, because of page caching.
>> I'm toying
>>>>> with it now, but I defined the following in my Border.jwc:
>>>>>
>>>>>   <context-asset name="stylesheet1" path="css/style1.css"/>
>>>>>   <context-asset name="stylesheet2" path="css/style2.css"/>
>>>>>
>>>>> I'm arbitrarily selecting one of these at startup. Now that
>>>> stylesheet
>>>>> name
>>>>> is part of the cached page. I can do a reset and flush
>> the pages to
>>>>> select another, but have my previously reported
>> current-page cache
>>>>> problem appears.
>>>>>
>>>>> However, if I overwrite the filename at run-time, the stylesheet
>>>>> changes take effect since the name is the same as was cached.
>>>>>
>>>>> Perhaps Tapestry allows page pooling per session? If so, then you
>>>>> could choose on the fly. However, I haven't run across that.
>>>>>
>>>>> I'm making some progress, but as usual some questions are
>> answered
>>>>> while new ones appear. :)
>>>>>
>>>>> Speaking of which, any ideas as to the best mechanism to
>> define an
>>>>> array of stylesheets within a .page or .jwc file?
>>>>>
>>>>> Thanks.
>>>>>
>>>>> Chris
>>>>>
>>>>>> -----Original Message-----
>>>>>> From: Todd O'Bryan [mailto:toddobryan@mac.com]
>>>>>> Sent: Thursday, June 24, 2004 8:02 PM
>>>>>> To: Tapestry users
>>>>>> Subject: Re: Tapestry Features / Skinning
>>>>>>
>>>>>>
>>>>>> DO IT!!!!
>>>>>>
>>>>>> I thought about this myself. You could store the user's
>> preferred
>>>>>> style in the Visit object and just grab it from there for
>>>> each page,
>>>>>> with a default, obviously.
>>>>>>
>>>>>> Now I just have to get good at CSS...
>>>>>>
>>>>>> Todd
>>>>>>
>>>>>> On Jun 24, 2004, at 1:54 PM, Robert Zeigler wrote:
>>>>>>
>>>>>>> I'm curious... everyone seems to be hitting the
>>>> "skinning" idea from
>>>>>>> the point of variable templates. But... ;) What if you hit
>>>>>> things from
>>>>>>> a different angle, namely css? Yes, I know css can have its
>>>>>> quirks. ;)
>>>>>>> But, if you take the time to put together a table-less
>>>>>> layout, based
>>>>>>> 100% on an external stylesheet, you can do some pretty
>>>> neat things
>>>>>>> just by selecting a different stylesheet. A site that was a
>>>>>> real eye
>>>>>>> opener for me was: http://www.csszengarden.com.
>>>>>>>
>>>>>>> So, theoretically, it's possible to just dynamically grab a
>>>>>> different
>>>>>>> stylesheet to skin your application.  Granted, that's
>>>>>> theory. ;) But,
>>>>>>> I've started work on the searchable component repository I
>>>>>> brought up
>>>>>>> awhile back.  One of my goals on this project is to do the
>>>>>> layout 100%
>>>>>>> in css. Eventually, I'm going to try to add support for
>>>> user-based
>>>>>>> skins/styles. We'll see what happens but... any
>> thoughts on this?
>>>>>>>
>>>>>>> Robert
>>>>>>>
>>>>>>>
>>>>>>
>>>>
>> ---------------------------------------------------------------------
>>>>>>> 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
>>>>>
>>>>
>>>>
>>>>
>> ---------------------------------------------------------------------
>>>> 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
>>
>>
>
>
>
> ---------------------------------------------------------------------
> 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: Tapestry Features / Skinning

Posted by "Christopher M. DeBracy" <ch...@debracy.net>.
Hey Todd,

Unfortunately, I haven't had too much time today. However, I didn't want you
to think I'd forgotten about this.

Right now my Visit object extends BaseComponent so I can return an IAsset
for the stylesheet in question. Where I'm stuck is:

<html jwcid="@Shell" title="ognl:windowTitle"
stylesheet="ognl:visit.stylesheet">

Since my Border component extends BaseComponent, the call to getVisit() is
inaccessible. 

What's the best way to make the Visit.getStylesheet() method available to
the Border component? I'm thinking that perhaps in the Border.jwc I can
declare a component that will bind to the visit class. Or am I barking up
the wrong tree?

I'm sure it's something simple and worse comes to worse, I'll work through
it tomorrow.

Thanks,

Chris

> -----Original Message-----
> From: Todd O'Bryan [mailto:toddobryan@mac.com] 
> Sent: Thursday, June 24, 2004 10:24 PM
> To: Tapestry users
> Subject: Re: Tapestry Features / Skinning
> 
> 
> Remember that cached pages still have the right content depending on 
> the session (If you print the user name at the top of a page, it's 
> appropriate to each user.), so I think if you actually use an IAsset 
> everything should dynamically happen and you should get the 
> appropriate 
> stylesheet.
> 
> 
> Can someone who understands what page caching actually means 
> straighten 
> this out for us?
> 
> Todd
> 
> On Jun 24, 2004, at 11:10 PM, Christopher M. DeBracy wrote:
> 
> > No, right now I'm just tying the stylesheet to my @Border component.
> >
> > <html jwcid="@Shell" title="ognl:windowTitle" 
> > stylesheet="ognl:assets.stylesheet">
> >
> > So the stylesheet name is cached, not the stylesheet itself.
> >
> > If Tapestry allows session-specific pages, then your idea 
> would work.
> > Does
> > Tapestry allow this?
> >
> > My "list of stylesheets" question was part thinking out loud. From
> > playing
> > with Struts, there was a mechanism to create a map in the 
> config file 
> > and I
> > was wondering if Tapestry did the same thing - I just 
> didn't express 
> > it very
> > well. Your idea for listing the stylesheets from a directory would 
> > work just
> > fine.
> >
> > Chris
> >
> >> -----Original Message-----
> >> From: Todd O'Bryan [mailto:toddobryan@mac.com]
> >> Sent: Thursday, June 24, 2004 9:52 PM
> >> To: Tapestry users
> >> Subject: Re: Tapestry Features / Skinning
> >>
> >>
> >> I haven't been paying attention. Sorry. I'm trying to add 
> a teaching 
> >> certification in Spanish so that I can get paid for my Master's 
> >> degree. Long story. And I just bought a house. Anywho...
> >>
> >> Are you saying that if you have a
> >>
> >> <@Shell stylesheet="ognl:visit.stylesheet">
> >>
> >> where the Visit object has a getStylesheet() method that 
> returns some 
> >> kind of class implementing IAsset (probably a 
> ContextAsset), then the 
> >> stylesheet gets cached with the page and can't be updated.
> >>
> >> As to how to get a list of stylesheets, I think I'd load 
> them in the 
> >> Global on startup or periodically check to see if any stylesheet 
> >> files had been added. Create a stylesheet directory 
> somewhere in your
> >> project. Maybe create a Stylesheet object that implements 
> IAsset and
> >> has a name for the stylesheet in addition to the URL for its
> >> CSS file.
> >> In the Global, have a getStylesheets() method that returns all the
> >> stylesheets currently defined for the webapp. On the user 
> preference
> >> page, you could list all the stylesheets and let users 
> choose the one
> >> they prefer, which would set the Stylesheet in the Visit.
> >>
> >> Someone jump in if I'm being overly complicated, overly 
> simplistic, 
> >> or just ranting incoherently.
> >>
> >> Todd
> >>
> >> On Jun 24, 2004, at 9:44 PM, Christopher M. DeBracy wrote:
> >>
> >>> Todd,
> >>>
> >>> I'm not sure if that would work, because of page caching. 
> I'm toying 
> >>> with it now, but I defined the following in my Border.jwc:
> >>>
> >>>   <context-asset name="stylesheet1" path="css/style1.css"/>
> >>>   <context-asset name="stylesheet2" path="css/style2.css"/>
> >>>
> >>> I'm arbitrarily selecting one of these at startup. Now that
> >> stylesheet
> >>> name
> >>> is part of the cached page. I can do a reset and flush 
> the pages to 
> >>> select another, but have my previously reported 
> current-page cache 
> >>> problem appears.
> >>>
> >>> However, if I overwrite the filename at run-time, the stylesheet 
> >>> changes take effect since the name is the same as was cached.
> >>>
> >>> Perhaps Tapestry allows page pooling per session? If so, then you 
> >>> could choose on the fly. However, I haven't run across that.
> >>>
> >>> I'm making some progress, but as usual some questions are 
> answered 
> >>> while new ones appear. :)
> >>>
> >>> Speaking of which, any ideas as to the best mechanism to 
> define an 
> >>> array of stylesheets within a .page or .jwc file?
> >>>
> >>> Thanks.
> >>>
> >>> Chris
> >>>
> >>>> -----Original Message-----
> >>>> From: Todd O'Bryan [mailto:toddobryan@mac.com]
> >>>> Sent: Thursday, June 24, 2004 8:02 PM
> >>>> To: Tapestry users
> >>>> Subject: Re: Tapestry Features / Skinning
> >>>>
> >>>>
> >>>> DO IT!!!!
> >>>>
> >>>> I thought about this myself. You could store the user's 
> preferred 
> >>>> style in the Visit object and just grab it from there for
> >> each page,
> >>>> with a default, obviously.
> >>>>
> >>>> Now I just have to get good at CSS...
> >>>>
> >>>> Todd
> >>>>
> >>>> On Jun 24, 2004, at 1:54 PM, Robert Zeigler wrote:
> >>>>
> >>>>> I'm curious... everyone seems to be hitting the
> >> "skinning" idea from
> >>>>> the point of variable templates. But... ;) What if you hit
> >>>> things from
> >>>>> a different angle, namely css? Yes, I know css can have its
> >>>> quirks. ;)
> >>>>> But, if you take the time to put together a table-less
> >>>> layout, based
> >>>>> 100% on an external stylesheet, you can do some pretty
> >> neat things
> >>>>> just by selecting a different stylesheet. A site that was a
> >>>> real eye
> >>>>> opener for me was: http://www.csszengarden.com.
> >>>>>
> >>>>> So, theoretically, it's possible to just dynamically grab a
> >>>> different
> >>>>> stylesheet to skin your application.  Granted, that's
> >>>> theory. ;) But,
> >>>>> I've started work on the searchable component repository I
> >>>> brought up
> >>>>> awhile back.  One of my goals on this project is to do the
> >>>> layout 100%
> >>>>> in css. Eventually, I'm going to try to add support for
> >> user-based
> >>>>> skins/styles. We'll see what happens but... any 
> thoughts on this?
> >>>>>
> >>>>> Robert
> >>>>>
> >>>>>
> >>>>
> >> 
> ---------------------------------------------------------------------
> >>>>> 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
> >>>
> >>
> >>
> >> 
> ---------------------------------------------------------------------
> >> 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
> 
> 



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


Re: Tapestry Features / Skinning

Posted by Todd O'Bryan <to...@mac.com>.
Remember that cached pages still have the right content depending on 
the session (If you print the user name at the top of a page, it's 
appropriate to each user.), so I think if you actually use an IAsset 
everything should dynamically happen and you should get the appropriate 
stylesheet.


Can someone who understands what page caching actually means straighten 
this out for us?

Todd

On Jun 24, 2004, at 11:10 PM, Christopher M. DeBracy wrote:

> No, right now I'm just tying the stylesheet to my @Border component.
>
> <html jwcid="@Shell" title="ognl:windowTitle"
> stylesheet="ognl:assets.stylesheet">
>
> So the stylesheet name is cached, not the stylesheet itself.
>
> If Tapestry allows session-specific pages, then your idea would work. 
> Does
> Tapestry allow this?
>
> My "list of stylesheets" question was part thinking out loud. From 
> playing
> with Struts, there was a mechanism to create a map in the config file 
> and I
> was wondering if Tapestry did the same thing - I just didn't express 
> it very
> well. Your idea for listing the stylesheets from a directory would 
> work just
> fine.
>
> Chris
>
>> -----Original Message-----
>> From: Todd O'Bryan [mailto:toddobryan@mac.com]
>> Sent: Thursday, June 24, 2004 9:52 PM
>> To: Tapestry users
>> Subject: Re: Tapestry Features / Skinning
>>
>>
>> I haven't been paying attention. Sorry. I'm trying to add a teaching
>> certification in Spanish so that I can get paid for my
>> Master's degree.
>> Long story. And I just bought a house. Anywho...
>>
>> Are you saying that if you have a
>>
>> <@Shell stylesheet="ognl:visit.stylesheet">
>>
>> where the Visit object has a getStylesheet() method that returns some
>> kind of class implementing IAsset (probably a ContextAsset), then the
>> stylesheet gets cached with the page and can't be updated.
>>
>> As to how to get a list of stylesheets, I think I'd load them in the
>> Global on startup or periodically check to see if any
>> stylesheet files
>> had been added. Create a stylesheet directory somewhere in your
>> project. Maybe create a Stylesheet object that implements IAsset and
>> has a name for the stylesheet in addition to the URL for its
>> CSS file.
>> In the Global, have a getStylesheets() method that returns all the
>> stylesheets currently defined for the webapp. On the user preference
>> page, you could list all the stylesheets and let users choose the one
>> they prefer, which would set the Stylesheet in the Visit.
>>
>> Someone jump in if I'm being overly complicated, overly
>> simplistic, or
>> just ranting incoherently.
>>
>> Todd
>>
>> On Jun 24, 2004, at 9:44 PM, Christopher M. DeBracy wrote:
>>
>>> Todd,
>>>
>>> I'm not sure if that would work, because of page caching. I'm toying
>>> with it
>>> now, but I defined the following in my Border.jwc:
>>>
>>>   <context-asset name="stylesheet1" path="css/style1.css"/>
>>>   <context-asset name="stylesheet2" path="css/style2.css"/>
>>>
>>> I'm arbitrarily selecting one of these at startup. Now that
>> stylesheet
>>> name
>>> is part of the cached page. I can do a reset and flush the pages to
>>> select
>>> another, but have my previously reported current-page cache problem
>>> appears.
>>>
>>> However, if I overwrite the filename at run-time, the stylesheet
>>> changes
>>> take effect since the name is the same as was cached.
>>>
>>> Perhaps Tapestry allows page pooling per session? If so, then you
>>> could choose on the fly. However, I haven't run across that.
>>>
>>> I'm making some progress, but as usual some questions are answered
>>> while new
>>> ones appear. :)
>>>
>>> Speaking of which, any ideas as to the best mechanism to define an
>>> array of
>>> stylesheets within a .page or .jwc file?
>>>
>>> Thanks.
>>>
>>> Chris
>>>
>>>> -----Original Message-----
>>>> From: Todd O'Bryan [mailto:toddobryan@mac.com]
>>>> Sent: Thursday, June 24, 2004 8:02 PM
>>>> To: Tapestry users
>>>> Subject: Re: Tapestry Features / Skinning
>>>>
>>>>
>>>> DO IT!!!!
>>>>
>>>> I thought about this myself. You could store the user's preferred
>>>> style in the Visit object and just grab it from there for
>> each page,
>>>> with a default, obviously.
>>>>
>>>> Now I just have to get good at CSS...
>>>>
>>>> Todd
>>>>
>>>> On Jun 24, 2004, at 1:54 PM, Robert Zeigler wrote:
>>>>
>>>>> I'm curious... everyone seems to be hitting the
>> "skinning" idea from
>>>>> the point of variable templates. But... ;) What if you hit
>>>> things from
>>>>> a different angle, namely css? Yes, I know css can have its
>>>> quirks. ;)
>>>>> But, if you take the time to put together a table-less
>>>> layout, based
>>>>> 100% on an external stylesheet, you can do some pretty
>> neat things
>>>>> just by selecting a different stylesheet. A site that was a
>>>> real eye
>>>>> opener for me was: http://www.csszengarden.com.
>>>>>
>>>>> So, theoretically, it's possible to just dynamically grab a
>>>> different
>>>>> stylesheet to skin your application.  Granted, that's
>>>> theory. ;) But,
>>>>> I've started work on the searchable component repository I
>>>> brought up
>>>>> awhile back.  One of my goals on this project is to do the
>>>> layout 100%
>>>>> in css. Eventually, I'm going to try to add support for
>> user-based
>>>>> skins/styles. We'll see what happens but... any thoughts on this?
>>>>>
>>>>> Robert
>>>>>
>>>>>
>>>>
>> ---------------------------------------------------------------------
>>>>> 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
>>>
>>
>>
>> ---------------------------------------------------------------------
>> 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: Tapestry Features / Skinning

Posted by "Christopher M. DeBracy" <ch...@debracy.net>.
No, right now I'm just tying the stylesheet to my @Border component.

<html jwcid="@Shell" title="ognl:windowTitle"
stylesheet="ognl:assets.stylesheet">

So the stylesheet name is cached, not the stylesheet itself.

If Tapestry allows session-specific pages, then your idea would work. Does
Tapestry allow this?

My "list of stylesheets" question was part thinking out loud. From playing
with Struts, there was a mechanism to create a map in the config file and I
was wondering if Tapestry did the same thing - I just didn't express it very
well. Your idea for listing the stylesheets from a directory would work just
fine.

Chris

> -----Original Message-----
> From: Todd O'Bryan [mailto:toddobryan@mac.com] 
> Sent: Thursday, June 24, 2004 9:52 PM
> To: Tapestry users
> Subject: Re: Tapestry Features / Skinning
> 
> 
> I haven't been paying attention. Sorry. I'm trying to add a teaching 
> certification in Spanish so that I can get paid for my 
> Master's degree. 
> Long story. And I just bought a house. Anywho...
> 
> Are you saying that if you have a
> 
> <@Shell stylesheet="ognl:visit.stylesheet">
> 
> where the Visit object has a getStylesheet() method that returns some 
> kind of class implementing IAsset (probably a ContextAsset), then the 
> stylesheet gets cached with the page and can't be updated.
> 
> As to how to get a list of stylesheets, I think I'd load them in the 
> Global on startup or periodically check to see if any 
> stylesheet files 
> had been added. Create a stylesheet directory somewhere in your 
> project. Maybe create a Stylesheet object that implements IAsset and 
> has a name for the stylesheet in addition to the URL for its 
> CSS file. 
> In the Global, have a getStylesheets() method that returns all the 
> stylesheets currently defined for the webapp. On the user preference 
> page, you could list all the stylesheets and let users choose the one 
> they prefer, which would set the Stylesheet in the Visit.
> 
> Someone jump in if I'm being overly complicated, overly 
> simplistic, or 
> just ranting incoherently.
> 
> Todd
> 
> On Jun 24, 2004, at 9:44 PM, Christopher M. DeBracy wrote:
> 
> > Todd,
> >
> > I'm not sure if that would work, because of page caching. I'm toying
> > with it
> > now, but I defined the following in my Border.jwc:
> >
> >   <context-asset name="stylesheet1" path="css/style1.css"/>
> >   <context-asset name="stylesheet2" path="css/style2.css"/>
> >
> > I'm arbitrarily selecting one of these at startup. Now that 
> stylesheet
> > name
> > is part of the cached page. I can do a reset and flush the pages to 
> > select
> > another, but have my previously reported current-page cache problem 
> > appears.
> >
> > However, if I overwrite the filename at run-time, the stylesheet
> > changes
> > take effect since the name is the same as was cached.
> >
> > Perhaps Tapestry allows page pooling per session? If so, then you 
> > could choose on the fly. However, I haven't run across that.
> >
> > I'm making some progress, but as usual some questions are answered
> > while new
> > ones appear. :)
> >
> > Speaking of which, any ideas as to the best mechanism to define an
> > array of
> > stylesheets within a .page or .jwc file?
> >
> > Thanks.
> >
> > Chris
> >
> >> -----Original Message-----
> >> From: Todd O'Bryan [mailto:toddobryan@mac.com]
> >> Sent: Thursday, June 24, 2004 8:02 PM
> >> To: Tapestry users
> >> Subject: Re: Tapestry Features / Skinning
> >>
> >>
> >> DO IT!!!!
> >>
> >> I thought about this myself. You could store the user's preferred 
> >> style in the Visit object and just grab it from there for 
> each page, 
> >> with a default, obviously.
> >>
> >> Now I just have to get good at CSS...
> >>
> >> Todd
> >>
> >> On Jun 24, 2004, at 1:54 PM, Robert Zeigler wrote:
> >>
> >>> I'm curious... everyone seems to be hitting the 
> "skinning" idea from 
> >>> the point of variable templates. But... ;) What if you hit
> >> things from
> >>> a different angle, namely css? Yes, I know css can have its
> >> quirks. ;)
> >>> But, if you take the time to put together a table-less
> >> layout, based
> >>> 100% on an external stylesheet, you can do some pretty 
> neat things 
> >>> just by selecting a different stylesheet. A site that was a
> >> real eye
> >>> opener for me was: http://www.csszengarden.com.
> >>>
> >>> So, theoretically, it's possible to just dynamically grab a
> >> different
> >>> stylesheet to skin your application.  Granted, that's
> >> theory. ;) But,
> >>> I've started work on the searchable component repository I
> >> brought up
> >>> awhile back.  One of my goals on this project is to do the
> >> layout 100%
> >>> in css. Eventually, I'm going to try to add support for 
> user-based 
> >>> skins/styles. We'll see what happens but... any thoughts on this?
> >>>
> >>> Robert
> >>>
> >>>
> >> 
> ---------------------------------------------------------------------
> >>> 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
> >
> 
> 
> ---------------------------------------------------------------------
> 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: Tapestry Features / Skinning

Posted by Todd O'Bryan <to...@mac.com>.
I haven't been paying attention. Sorry. I'm trying to add a teaching 
certification in Spanish so that I can get paid for my Master's degree. 
Long story. And I just bought a house. Anywho...

Are you saying that if you have a

<@Shell stylesheet="ognl:visit.stylesheet">

where the Visit object has a getStylesheet() method that returns some 
kind of class implementing IAsset (probably a ContextAsset), then the 
stylesheet gets cached with the page and can't be updated.

As to how to get a list of stylesheets, I think I'd load them in the 
Global on startup or periodically check to see if any stylesheet files 
had been added. Create a stylesheet directory somewhere in your 
project. Maybe create a Stylesheet object that implements IAsset and 
has a name for the stylesheet in addition to the URL for its CSS file. 
In the Global, have a getStylesheets() method that returns all the 
stylesheets currently defined for the webapp. On the user preference 
page, you could list all the stylesheets and let users choose the one 
they prefer, which would set the Stylesheet in the Visit.

Someone jump in if I'm being overly complicated, overly simplistic, or 
just ranting incoherently.

Todd

On Jun 24, 2004, at 9:44 PM, Christopher M. DeBracy wrote:

> Todd,
>
> I'm not sure if that would work, because of page caching. I'm toying 
> with it
> now, but I defined the following in my Border.jwc:
>
>   <context-asset name="stylesheet1" path="css/style1.css"/>
>   <context-asset name="stylesheet2" path="css/style2.css"/>
>
> I'm arbitrarily selecting one of these at startup. Now that stylesheet 
> name
> is part of the cached page. I can do a reset and flush the pages to 
> select
> another, but have my previously reported current-page cache problem 
> appears.
>
> However, if I overwrite the filename at run-time, the stylesheet 
> changes
> take effect since the name is the same as was cached.
>
> Perhaps Tapestry allows page pooling per session? If so, then you could
> choose on the fly. However, I haven't run across that.
>
> I'm making some progress, but as usual some questions are answered 
> while new
> ones appear. :)
>
> Speaking of which, any ideas as to the best mechanism to define an 
> array of
> stylesheets within a .page or .jwc file?
>
> Thanks.
>
> Chris
>
>> -----Original Message-----
>> From: Todd O'Bryan [mailto:toddobryan@mac.com]
>> Sent: Thursday, June 24, 2004 8:02 PM
>> To: Tapestry users
>> Subject: Re: Tapestry Features / Skinning
>>
>>
>> DO IT!!!!
>>
>> I thought about this myself. You could store the user's
>> preferred style
>> in the Visit object and just grab it from there for each page, with a
>> default, obviously.
>>
>> Now I just have to get good at CSS...
>>
>> Todd
>>
>> On Jun 24, 2004, at 1:54 PM, Robert Zeigler wrote:
>>
>>> I'm curious... everyone seems to be hitting the "skinning" idea from
>>> the point of variable templates. But... ;) What if you hit
>> things from
>>> a different angle, namely css? Yes, I know css can have its
>> quirks. ;)
>>> But, if you take the time to put together a table-less
>> layout, based
>>> 100% on an external stylesheet, you can do some pretty neat things
>>> just by selecting a different stylesheet. A site that was a
>> real eye
>>> opener for me was: http://www.csszengarden.com.
>>>
>>> So, theoretically, it's possible to just dynamically grab a
>> different
>>> stylesheet to skin your application.  Granted, that's
>> theory. ;) But,
>>> I've started work on the searchable component repository I
>> brought up
>>> awhile back.  One of my goals on this project is to do the
>> layout 100%
>>> in css. Eventually, I'm going to try to add support for user-based
>>> skins/styles. We'll see what happens but... any thoughts on this?
>>>
>>> Robert
>>>
>>>
>> ---------------------------------------------------------------------
>>> 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
>


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


RE: Tapestry Features / Skinning

Posted by "Christopher M. DeBracy" <ch...@debracy.net>.
Great. Thanks, I'll give that a try tomorrow. If all goes well I'll post the
relevant code for you to play with.

> -----Original Message-----
> From: Robert Zeigler [mailto:rdzeigle@u.arizona.edu] 
> Sent: Saturday, June 26, 2004 10:22 PM
> To: Tapestry users
> Subject: Re: Tapestry Features / Skinning
> 
> 
> String path = //code to get proper path,eg. from visit
> return new ContextAsset(
>      new ContextResourceLocation(
>          this
>           .getPage()
>           .getRequestCycle()
>           .getRequestContext()
>           .getServlet()
>           .getServletContext(),
>          path),
>      null);
> 
> 
> Robert
> 
> Christopher M. DeBracy wrote:
> > How are you building the ContextAsset? I keep getting pulled off on 
> > other thing and haven't had a chance to finish that part yet.
> > 
> > 
> >>-----Original Message-----
> >>From: Robert Zeigler [mailto:rdzeigle@u.arizona.edu]
> >>Sent: Saturday, June 26, 2004 5:34 PM
> >>To: Tapestry users
> >>Subject: Re: Tapestry Features / Skinning
> >>
> >>
> >>Ok, I'm toying around with this a bit now, finally... got
> >>this app to a 
> >>point where I could at least start testing some of the 
> >>components, and 
> >>perhaps a few of the pages. ;) So, here's what I did to test 
> >>the idea of 
> >>varying stylesheets works fine...
> >>In my Border component jwc:
> >>...
> >><binding name="stylesheet" expression="stylesheet"/>
> >>
> >>in the Border.java file:
> >>public IAsset getStylesheet() {
> >>...
> >>}
> >>
> >>The getStylesheet method returns a context asset. Eventually,
> >>it will be 
> >>hooked to a user preferred stylesheet. For testing purposes, 
> >>I defined a 
> >>persistent property "useDefaultStyle" that alternates between 
> >>true and 
> >>false each click. if it's true, it returns the only real 
> >>stylesheet for 
> >>the app. If it's false, it returns a context asset pointing 
> >>to an empty 
> >>.css file. It works fine. =) Every other click, I get 
> style, and the 
> >>"off" clicks, I get no styling. ;)
> >>
> >>Robert
> >>
> >>Christopher M. DeBracy wrote:
> >>
> >>>Todd,
> >>>
> >>>I'm not sure if that would work, because of page caching.
> >>
> >>I'm toying
> >>
> >>>with it now, but I defined the following in my Border.jwc:
> >>>
> >>>  <context-asset name="stylesheet1" path="css/style1.css"/>  
> >>> <context-asset name="stylesheet2" path="css/style2.css"/>
> >>>
> >>>I'm arbitrarily selecting one of these at startup. Now that
> >>
> >>stylesheet
> >>
> >>>name is part of the cached page. I can do a reset and flush
> >>
> >>the pages
> >>
> >>>to select another, but have my previously reported
> >>
> >>current-page cache
> >>
> >>>problem appears.
> >>>
> >>>However, if I overwrite the filename at run-time, the stylesheet
> >>>changes take effect since the name is the same as was cached.
> >>>
> >>>Perhaps Tapestry allows page pooling per session? If so, then you
> >>>could choose on the fly. However, I haven't run across that.
> >>>
> >>>I'm making some progress, but as usual some questions are answered
> >>>while new ones appear. :)
> >>>
> >>>Speaking of which, any ideas as to the best mechanism to define an
> >>>array of stylesheets within a .page or .jwc file?
> >>>
> >>>Thanks.
> >>>
> >>>Chris
> >>
> >>------------------------------------------------------------
> ---------
> >>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
> 
> 
> 



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


RE: Tapestry Features / Skinning

Posted by "Christopher M. DeBracy" <ch...@debracy.net>.
Robert,

It's now working. Thanks for the ContextAsset help. BTW, What does the
<binding> buy you? Currently I'm not using that.

My Border.html contains the following @Shell:

<html jwcid="@Shell" title="ognl:windowTitle" stylesheet="ognl:stylesheet">

In my Border.java I build the Iasset based on the style sheet path/name:

    public IAsset getStylesheet()
    {
        IPage page = getPage();
        Visit visit = (Visit)page.getVisit();
        String stylesheet = visit.getStylesheet();
        return new ContextAsset(
            new ContextResourceLocation(
            this
            .getPage()
            .getRequestCycle()
            .getRequestContext()
            .getServlet()
            .getServletContext(),
            stylesheet),
            null);
    }

Like you, I'm testing by alternating between two style sheets. 

My Visit.java:

public class Visit {

    private static int counter = 0;

    public String getStylesheet() {

        String sheet;
        ++counter;

        if (counter % 2 == 0)
            sheet = "/css/style.css";
        else
            sheet = "/css/style-red.css";

        return sheet;
    }
}

Ultimately I'll add a setStylesheet that stores the name either in the Visit
or Global object, depending on whether the admin controls layout or I allow
the user to make that choice.

Now I need to dive into CSS and start working on some layouts. :)

Thanks all for the help.

Chris

> -----Original Message-----
> From: Robert Zeigler [mailto:rdzeigle@u.arizona.edu] 
> Sent: Saturday, June 26, 2004 10:22 PM
> To: Tapestry users
> Subject: Re: Tapestry Features / Skinning
> 
> 
> String path = //code to get proper path,eg. from visit
> return new ContextAsset(
>      new ContextResourceLocation(
>          this
>           .getPage()
>           .getRequestCycle()
>           .getRequestContext()
>           .getServlet()
>           .getServletContext(),
>          path),
>      null);
> 
> 
> Robert
> 
> Christopher M. DeBracy wrote:
> > How are you building the ContextAsset? I keep getting pulled off on 
> > other thing and haven't had a chance to finish that part yet.
> > 
> > 
> >>-----Original Message-----
> >>From: Robert Zeigler [mailto:rdzeigle@u.arizona.edu]
> >>Sent: Saturday, June 26, 2004 5:34 PM
> >>To: Tapestry users
> >>Subject: Re: Tapestry Features / Skinning
> >>
> >>
> >>Ok, I'm toying around with this a bit now, finally... got
> >>this app to a 
> >>point where I could at least start testing some of the 
> >>components, and 
> >>perhaps a few of the pages. ;) So, here's what I did to test 
> >>the idea of 
> >>varying stylesheets works fine...
> >>In my Border component jwc:
> >>...
> >><binding name="stylesheet" expression="stylesheet"/>
> >>
> >>in the Border.java file:
> >>public IAsset getStylesheet() {
> >>...
> >>}
> >>
> >>The getStylesheet method returns a context asset. Eventually,
> >>it will be 
> >>hooked to a user preferred stylesheet. For testing purposes, 
> >>I defined a 
> >>persistent property "useDefaultStyle" that alternates between 
> >>true and 
> >>false each click. if it's true, it returns the only real 
> >>stylesheet for 
> >>the app. If it's false, it returns a context asset pointing 
> >>to an empty 
> >>.css file. It works fine. =) Every other click, I get 
> style, and the 
> >>"off" clicks, I get no styling. ;)
> >>
> >>Robert
> >>
> >>Christopher M. DeBracy wrote:
> >>
> >>>Todd,
> >>>
> >>>I'm not sure if that would work, because of page caching.
> >>
> >>I'm toying
> >>
> >>>with it now, but I defined the following in my Border.jwc:
> >>>
> >>>  <context-asset name="stylesheet1" path="css/style1.css"/>  
> >>> <context-asset name="stylesheet2" path="css/style2.css"/>
> >>>
> >>>I'm arbitrarily selecting one of these at startup. Now that
> >>
> >>stylesheet
> >>
> >>>name is part of the cached page. I can do a reset and flush
> >>
> >>the pages
> >>
> >>>to select another, but have my previously reported
> >>
> >>current-page cache
> >>
> >>>problem appears.
> >>>
> >>>However, if I overwrite the filename at run-time, the stylesheet
> >>>changes take effect since the name is the same as was cached.
> >>>
> >>>Perhaps Tapestry allows page pooling per session? If so, then you
> >>>could choose on the fly. However, I haven't run across that.
> >>>
> >>>I'm making some progress, but as usual some questions are answered
> >>>while new ones appear. :)
> >>>
> >>>Speaking of which, any ideas as to the best mechanism to define an
> >>>array of stylesheets within a .page or .jwc file?
> >>>
> >>>Thanks.
> >>>
> >>>Chris
> >>
> >>------------------------------------------------------------
> ---------
> >>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
> 
> 
> 



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


Re: Tapestry Features / Skinning

Posted by Robert Zeigler <rd...@u.arizona.edu>.
String path = //code to get proper path,eg. from visit
return new ContextAsset(
     new ContextResourceLocation(
         this
          .getPage()
          .getRequestCycle()
          .getRequestContext()
          .getServlet()
          .getServletContext(),
         path),
     null);


Robert

Christopher M. DeBracy wrote:
> How are you building the ContextAsset? I keep getting pulled off on other
> thing and haven't had a chance to finish that part yet. 
> 
> 
>>-----Original Message-----
>>From: Robert Zeigler [mailto:rdzeigle@u.arizona.edu] 
>>Sent: Saturday, June 26, 2004 5:34 PM
>>To: Tapestry users
>>Subject: Re: Tapestry Features / Skinning
>>
>>
>>Ok, I'm toying around with this a bit now, finally... got 
>>this app to a 
>>point where I could at least start testing some of the 
>>components, and 
>>perhaps a few of the pages. ;) So, here's what I did to test 
>>the idea of 
>>varying stylesheets works fine...
>>In my Border component jwc:
>>...
>><binding name="stylesheet" expression="stylesheet"/>
>>
>>in the Border.java file:
>>public IAsset getStylesheet() {
>>...
>>}
>>
>>The getStylesheet method returns a context asset. Eventually, 
>>it will be 
>>hooked to a user preferred stylesheet. For testing purposes, 
>>I defined a 
>>persistent property "useDefaultStyle" that alternates between 
>>true and 
>>false each click. if it's true, it returns the only real 
>>stylesheet for 
>>the app. If it's false, it returns a context asset pointing 
>>to an empty 
>>.css file. It works fine. =) Every other click, I get style, and the 
>>"off" clicks, I get no styling. ;)
>>
>>Robert
>>
>>Christopher M. DeBracy wrote:
>>
>>>Todd,
>>>
>>>I'm not sure if that would work, because of page caching. 
>>
>>I'm toying 
>>
>>>with it now, but I defined the following in my Border.jwc:
>>>
>>>  <context-asset name="stylesheet1" path="css/style1.css"/>
>>>  <context-asset name="stylesheet2" path="css/style2.css"/>
>>>
>>>I'm arbitrarily selecting one of these at startup. Now that 
>>
>>stylesheet 
>>
>>>name is part of the cached page. I can do a reset and flush 
>>
>>the pages 
>>
>>>to select another, but have my previously reported 
>>
>>current-page cache 
>>
>>>problem appears.
>>>
>>>However, if I overwrite the filename at run-time, the stylesheet 
>>>changes take effect since the name is the same as was cached.
>>>
>>>Perhaps Tapestry allows page pooling per session? If so, then you 
>>>could choose on the fly. However, I haven't run across that.
>>>
>>>I'm making some progress, but as usual some questions are answered 
>>>while new ones appear. :)
>>>
>>>Speaking of which, any ideas as to the best mechanism to define an 
>>>array of stylesheets within a .page or .jwc file?
>>>
>>>Thanks.
>>>
>>>Chris
>>
>>---------------------------------------------------------------------
>>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: Tapestry Features / Skinning

Posted by "Christopher M. DeBracy" <ch...@debracy.net>.
How are you building the ContextAsset? I keep getting pulled off on other
thing and haven't had a chance to finish that part yet. 

> -----Original Message-----
> From: Robert Zeigler [mailto:rdzeigle@u.arizona.edu] 
> Sent: Saturday, June 26, 2004 5:34 PM
> To: Tapestry users
> Subject: Re: Tapestry Features / Skinning
> 
> 
> Ok, I'm toying around with this a bit now, finally... got 
> this app to a 
> point where I could at least start testing some of the 
> components, and 
> perhaps a few of the pages. ;) So, here's what I did to test 
> the idea of 
> varying stylesheets works fine...
> In my Border component jwc:
> ...
> <binding name="stylesheet" expression="stylesheet"/>
> 
> in the Border.java file:
> public IAsset getStylesheet() {
> ...
> }
> 
> The getStylesheet method returns a context asset. Eventually, 
> it will be 
> hooked to a user preferred stylesheet. For testing purposes, 
> I defined a 
> persistent property "useDefaultStyle" that alternates between 
> true and 
> false each click. if it's true, it returns the only real 
> stylesheet for 
> the app. If it's false, it returns a context asset pointing 
> to an empty 
> .css file. It works fine. =) Every other click, I get style, and the 
> "off" clicks, I get no styling. ;)
> 
> Robert
> 
> Christopher M. DeBracy wrote:
> > Todd,
> > 
> > I'm not sure if that would work, because of page caching. 
> I'm toying 
> > with it now, but I defined the following in my Border.jwc:
> > 
> >   <context-asset name="stylesheet1" path="css/style1.css"/>
> >   <context-asset name="stylesheet2" path="css/style2.css"/>
> > 
> > I'm arbitrarily selecting one of these at startup. Now that 
> stylesheet 
> > name is part of the cached page. I can do a reset and flush 
> the pages 
> > to select another, but have my previously reported 
> current-page cache 
> > problem appears.
> > 
> > However, if I overwrite the filename at run-time, the stylesheet 
> > changes take effect since the name is the same as was cached.
> > 
> > Perhaps Tapestry allows page pooling per session? If so, then you 
> > could choose on the fly. However, I haven't run across that.
> > 
> > I'm making some progress, but as usual some questions are answered 
> > while new ones appear. :)
> > 
> > Speaking of which, any ideas as to the best mechanism to define an 
> > array of stylesheets within a .page or .jwc file?
> > 
> > Thanks.
> > 
> > Chris
> 
> ---------------------------------------------------------------------
> 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: Tapestry Features / Skinning

Posted by Robert Zeigler <rd...@u.arizona.edu>.
Ok, I'm toying around with this a bit now, finally... got this app to a 
point where I could at least start testing some of the components, and 
perhaps a few of the pages. ;) So, here's what I did to test the idea of 
varying stylesheets works fine...
In my Border component jwc:
...
<binding name="stylesheet" expression="stylesheet"/>

in the Border.java file:
public IAsset getStylesheet() {
...
}

The getStylesheet method returns a context asset. Eventually, it will be 
hooked to a user preferred stylesheet. For testing purposes, I defined a 
persistent property "useDefaultStyle" that alternates between true and 
false each click. if it's true, it returns the only real stylesheet for 
the app. If it's false, it returns a context asset pointing to an empty 
.css file. It works fine. =) Every other click, I get style, and the 
"off" clicks, I get no styling. ;)

Robert

Christopher M. DeBracy wrote:
> Todd,
> 
> I'm not sure if that would work, because of page caching. I'm toying with it
> now, but I defined the following in my Border.jwc:
> 
>   <context-asset name="stylesheet1" path="css/style1.css"/>
>   <context-asset name="stylesheet2" path="css/style2.css"/>
> 
> I'm arbitrarily selecting one of these at startup. Now that stylesheet name
> is part of the cached page. I can do a reset and flush the pages to select
> another, but have my previously reported current-page cache problem appears.
> 
> However, if I overwrite the filename at run-time, the stylesheet changes
> take effect since the name is the same as was cached.
> 
> Perhaps Tapestry allows page pooling per session? If so, then you could
> choose on the fly. However, I haven't run across that.
> 
> I'm making some progress, but as usual some questions are answered while new
> ones appear. :)
> 
> Speaking of which, any ideas as to the best mechanism to define an array of
> stylesheets within a .page or .jwc file?
> 
> Thanks.
> 
> Chris

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


RE: Tapestry Features / Skinning

Posted by "Christopher M. DeBracy" <ch...@debracy.net>.
Todd,

I'm not sure if that would work, because of page caching. I'm toying with it
now, but I defined the following in my Border.jwc:

  <context-asset name="stylesheet1" path="css/style1.css"/>
  <context-asset name="stylesheet2" path="css/style2.css"/>

I'm arbitrarily selecting one of these at startup. Now that stylesheet name
is part of the cached page. I can do a reset and flush the pages to select
another, but have my previously reported current-page cache problem appears.

However, if I overwrite the filename at run-time, the stylesheet changes
take effect since the name is the same as was cached.

Perhaps Tapestry allows page pooling per session? If so, then you could
choose on the fly. However, I haven't run across that.

I'm making some progress, but as usual some questions are answered while new
ones appear. :)

Speaking of which, any ideas as to the best mechanism to define an array of
stylesheets within a .page or .jwc file?

Thanks.

Chris

> -----Original Message-----
> From: Todd O'Bryan [mailto:toddobryan@mac.com] 
> Sent: Thursday, June 24, 2004 8:02 PM
> To: Tapestry users
> Subject: Re: Tapestry Features / Skinning
> 
> 
> DO IT!!!!
> 
> I thought about this myself. You could store the user's 
> preferred style 
> in the Visit object and just grab it from there for each page, with a 
> default, obviously.
> 
> Now I just have to get good at CSS...
> 
> Todd
> 
> On Jun 24, 2004, at 1:54 PM, Robert Zeigler wrote:
> 
> > I'm curious... everyone seems to be hitting the "skinning" idea from
> > the point of variable templates. But... ;) What if you hit 
> things from 
> > a different angle, namely css? Yes, I know css can have its 
> quirks. ;) 
> > But, if you take the time to put together a table-less 
> layout, based 
> > 100% on an external stylesheet, you can do some pretty neat things 
> > just by selecting a different stylesheet. A site that was a 
> real eye 
> > opener for me was: http://www.csszengarden.com.
> >
> > So, theoretically, it's possible to just dynamically grab a 
> different
> > stylesheet to skin your application.  Granted, that's 
> theory. ;) But, 
> > I've started work on the searchable component repository I 
> brought up 
> > awhile back.  One of my goals on this project is to do the 
> layout 100% 
> > in css. Eventually, I'm going to try to add support for user-based 
> > skins/styles. We'll see what happens but... any thoughts on this?
> >
> > Robert
> >
> > 
> ---------------------------------------------------------------------
> > 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: Tapestry Features / Skinning

Posted by Todd O'Bryan <to...@mac.com>.
DO IT!!!!

I thought about this myself. You could store the user's preferred style 
in the Visit object and just grab it from there for each page, with a 
default, obviously.

Now I just have to get good at CSS...

Todd

On Jun 24, 2004, at 1:54 PM, Robert Zeigler wrote:

> I'm curious... everyone seems to be hitting the "skinning" idea from 
> the point of variable templates. But... ;) What if you hit things from 
> a different angle, namely css? Yes, I know css can have its quirks. ;) 
> But, if you take the time to put together a table-less layout, based 
> 100% on an external stylesheet, you can do some pretty neat things 
> just by selecting a different stylesheet. A site that was a real eye 
> opener for me was: http://www.csszengarden.com.
>
> So, theoretically, it's possible to just dynamically grab a different 
> stylesheet to skin your application.  Granted, that's theory. ;) But, 
> I've started work on the searchable component repository I brought up 
> awhile back.  One of my goals on this project is to do the layout 100% 
> in css. Eventually, I'm going to try to add support for user-based 
> skins/styles. We'll see what happens but... any thoughts on this?
>
> Robert
>
> ---------------------------------------------------------------------
> 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: Tapestry Features / Skinning

Posted by "Christopher M. DeBracy" <ch...@debracy.net>.
I intend to combine both templates and stylesheets. :) The technique for
swapping on will work with the other just as well.

The combo of layout and stylesheets should be great.

> -----Original Message-----
> From: Robert Zeigler [mailto:rdzeigle@u.arizona.edu]
> Sent: Thursday, June 24, 2004 12:54 PM
> To: Tapestry users
> Subject: Re: Tapestry Features / Skinning
> 
> 
> I'm curious... everyone seems to be hitting the "skinning"
> idea from the 
> point of variable templates. But... ;) What if you hit things from a 
> different angle, namely css? Yes, I know css can have its quirks. ;) 
> But, if you take the time to put together a table-less layout, based 
> 100% on an external stylesheet, you can do some pretty neat 
> things just 
> by selecting a different stylesheet. A site that was a real 
> eye opener 
> for me was: http://www.csszengarden.com.
> 
> So, theoretically, it's possible to just dynamically grab a different
> stylesheet to skin your application.  Granted, that's theory. ;) But, 
> I've started work on the searchable component repository I brought up 
> awhile back.  One of my goals on this project is to do the 
> layout 100% 
> in css. Eventually, I'm going to try to add support for user-based 
> skins/styles. We'll see what happens but... any thoughts on this?
> 
> Robert
> 
> ---------------------------------------------------------------------
> 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: Tapestry Features / Skinning

Posted by Robert Zeigler <rd...@u.arizona.edu>.
I'm curious... everyone seems to be hitting the "skinning" idea from the 
point of variable templates. But... ;) What if you hit things from a 
different angle, namely css? Yes, I know css can have its quirks. ;) 
But, if you take the time to put together a table-less layout, based 
100% on an external stylesheet, you can do some pretty neat things just 
by selecting a different stylesheet. A site that was a real eye opener 
for me was: http://www.csszengarden.com.

So, theoretically, it's possible to just dynamically grab a different 
stylesheet to skin your application.  Granted, that's theory. ;) But, 
I've started work on the searchable component repository I brought up 
awhile back.  One of my goals on this project is to do the layout 100% 
in css. Eventually, I'm going to try to add support for user-based 
skins/styles. We'll see what happens but... any thoughts on this?

Robert

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


Re: Tapestry Features / Skinning, alternatives

Posted by Henrik Vendelbo <hv...@bluprints.com>.
Personally I dont like the way Border is typically used, instead I have my
own version of the Shell component.

My version of the Shell is able to pick a stylesheet depending on browser
type and actual user logged in. As for
adding such things as navigation bar, menu and footer I have other
components responsible for that, and using them
( <span jwcid="@MyFooter"/>) in each page is not much of an issue, and
definately makes static page testing much more valuable.

If I had to pick a template on the fly I would make a new service that did
it.

----- Original Message ----- 
From: "Christopher M. DeBracy" <ch...@debracy.net>
To: "'Tapestry users'" <ta...@jakarta.apache.org>
Sent: Thursday, June 24, 2004 12:15 PM
Subject: RE: Tapestry Features / Skinning


Don't be sorry. The alternative would be for me to use <context-asset
name="$template" path="/path/TemplateToUse.html"/>, though I suspect even if
I changed the template name and did the reset I'd still be in the same
situation.

At this point, if I place this link on a page that I don't care about
staying cached, such as an admin page, then the skinning will work
beautifully. I had posted to see if someone had a thought as to what I might
be doing wrong. It's a minor limitation that I can work around, though I'll
happily try something different if there's a suggestion.

Being able to swap layouts and stylesheets on the fly can be rather useful
in some situations.

Thanks!

Chris

> -----Original Message-----
> From: Karel Miarka [mailto:kajism@issa.cz]
> Sent: Thursday, June 24, 2004 2:25 AM
> To: Tapestry users
> Subject: Re: Tapestry Features / Skinning
>
>
> I was playing with this only for a while when I was wondering
> if it is better to have two separate templates for readOnly
> item detail and writable item detail. Finaly I have decided
> to use just one template with conditional statements
> according to user's rights. So I have even not realized that
> the "skinning" approach I have suggested is problematic due
> to the template caching. Sorry for the confusion.
>
> Karel
>
> ----- Original Message ----- 
> From: "Christopher M. DeBracy" <ch...@debracy.net>
> To: "'Tapestry users'" <ta...@jakarta.apache.org>
> Sent: Thursday, June 24, 2004 1:06 AM
> Subject: RE: Tapestry Features / Skinning
>
>
> I've tried Karel's suggestion for selecting templates on the
> fly and it works well - the first time, anyway. Once cached
> the template remains in memory. I can flush it by calling the
> service=reset and configuring the JVM to enable the reset
> service, but that opens up the app to much heartache as
> indicated in the code comments.
>
> To clear the cache I added the following code to one of my pages:
>
> ((IEngineServiceView) getPage().getEngine()).clearCachedData();
>
> This works but with the small side effect that the page I'm
> currently on when I click the link does not get flushed. I
> even tried calling the reset service afterwards to cycle to a
> different (home) page and start the session over again.
>
> I can live with this limitation, but I'm wondering what I'm
> missing to make this work cleanly.
>
> Thanks,
>
> Chris
>
> > -----Original Message-----
> > From: Norbert Sándor [mailto:programozas@hotmail.com]
> > Sent: Wednesday, June 16, 2004 1:01 PM
> > To: Tapestry users
> > Subject: Re: Tapestry Features / Skinning
> >
> >
> > Is this a "legal" way of skinning?
> > I mean: will this probably work in future releases?
> >
> > Thanks,
> > Norbi
> >
> > ----- Original Message -----
> > From: "Karel Miarka" <ka...@issa.cz>
> > To: "Tapestry users" <ta...@jakarta.apache.org>
> > Sent: Thursday, May 27, 2004 10:54 AM
> > Subject: Re: Tapestry Features / Skinning
> >
> >
> > > Hi,
> > >
> > > there is another quite simple possibility of switching page
> > templates
> > > at
> > > runtime:
> > >
> > > 1) define all template files you want to use in your page
> > > specification as context-assets, for example:
> > >
> > > <context-asset name="templateRO"
> path="/WEB-INF/DivisionRO.html"/>
> > > <context-asset name="templateRW" path="/WEB-INF/DivisionRW.html"/>
> > >
> > > 2) overwrite the getAsset() method in your page class,
> for example:
> > >
> > > public IAsset getAsset(String name) {
> > >   if (ITemplateSource.TEMPLATE_ASSET_NAME.equals(name)) {
> > >     String templateAssetName = "templateRO";
> > >     if (... canWrite ... ) {
> > >       templateAssetName = "templateRW";
> > >     }
> > >     return super.getAsset(templateAssetName);
> > >   }
> > >   return super.getAsset(name);
> > > }
> > >
> > > The only disadvantage of this approach, I see at the
> > moment, is that
> > > with this configuration Spindle stops working with such templates
> > > saying "Tapestry can not see "DivisionRO.html" at runtime... I'm
> > > wondering if
> > this
> > > must be a reason for Spindle to stop offering XML hints (list of
> > components
> > > or attributes for them)?
> > >
> > > Best regards,
> > > Karel
> > >
> > >
> > >
> > >
> >
> ---------------------------------------------------------------------
> > > 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
>
>
>
>
>
> ---------------------------------------------------------------------
> 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: Tapestry Features / Skinning

Posted by "Christopher M. DeBracy" <ch...@debracy.net>.
Don't be sorry. The alternative would be for me to use <context-asset
name="$template" path="/path/TemplateToUse.html"/>, though I suspect even if
I changed the template name and did the reset I'd still be in the same
situation.

At this point, if I place this link on a page that I don't care about
staying cached, such as an admin page, then the skinning will work
beautifully. I had posted to see if someone had a thought as to what I might
be doing wrong. It's a minor limitation that I can work around, though I'll
happily try something different if there's a suggestion.

Being able to swap layouts and stylesheets on the fly can be rather useful
in some situations.

Thanks!

Chris

> -----Original Message-----
> From: Karel Miarka [mailto:kajism@issa.cz] 
> Sent: Thursday, June 24, 2004 2:25 AM
> To: Tapestry users
> Subject: Re: Tapestry Features / Skinning
> 
> 
> I was playing with this only for a while when I was wondering 
> if it is better to have two separate templates for readOnly 
> item detail and writable item detail. Finaly I have decided 
> to use just one template with conditional statements 
> according to user's rights. So I have even not realized that 
> the "skinning" approach I have suggested is problematic due 
> to the template caching. Sorry for the confusion.
> 
> Karel
> 
> ----- Original Message ----- 
> From: "Christopher M. DeBracy" <ch...@debracy.net>
> To: "'Tapestry users'" <ta...@jakarta.apache.org>
> Sent: Thursday, June 24, 2004 1:06 AM
> Subject: RE: Tapestry Features / Skinning
> 
> 
> I've tried Karel's suggestion for selecting templates on the 
> fly and it works well - the first time, anyway. Once cached 
> the template remains in memory. I can flush it by calling the 
> service=reset and configuring the JVM to enable the reset 
> service, but that opens up the app to much heartache as 
> indicated in the code comments.
> 
> To clear the cache I added the following code to one of my pages:
> 
> ((IEngineServiceView) getPage().getEngine()).clearCachedData();
> 
> This works but with the small side effect that the page I'm 
> currently on when I click the link does not get flushed. I 
> even tried calling the reset service afterwards to cycle to a 
> different (home) page and start the session over again.
> 
> I can live with this limitation, but I'm wondering what I'm 
> missing to make this work cleanly.
> 
> Thanks,
> 
> Chris
> 
> > -----Original Message-----
> > From: Norbert Sándor [mailto:programozas@hotmail.com]
> > Sent: Wednesday, June 16, 2004 1:01 PM
> > To: Tapestry users
> > Subject: Re: Tapestry Features / Skinning
> >
> >
> > Is this a "legal" way of skinning?
> > I mean: will this probably work in future releases?
> >
> > Thanks,
> > Norbi
> >
> > ----- Original Message -----
> > From: "Karel Miarka" <ka...@issa.cz>
> > To: "Tapestry users" <ta...@jakarta.apache.org>
> > Sent: Thursday, May 27, 2004 10:54 AM
> > Subject: Re: Tapestry Features / Skinning
> >
> >
> > > Hi,
> > >
> > > there is another quite simple possibility of switching page
> > templates
> > > at
> > > runtime:
> > >
> > > 1) define all template files you want to use in your page 
> > > specification as context-assets, for example:
> > >
> > > <context-asset name="templateRO" 
> path="/WEB-INF/DivisionRO.html"/> 
> > > <context-asset name="templateRW" path="/WEB-INF/DivisionRW.html"/>
> > >
> > > 2) overwrite the getAsset() method in your page class, 
> for example:
> > >
> > > public IAsset getAsset(String name) {
> > >   if (ITemplateSource.TEMPLATE_ASSET_NAME.equals(name)) {
> > >     String templateAssetName = "templateRO";
> > >     if (... canWrite ... ) {
> > >       templateAssetName = "templateRW";
> > >     }
> > >     return super.getAsset(templateAssetName);
> > >   }
> > >   return super.getAsset(name);
> > > }
> > >
> > > The only disadvantage of this approach, I see at the
> > moment, is that
> > > with this configuration Spindle stops working with such templates 
> > > saying "Tapestry can not see "DivisionRO.html" at runtime... I'm 
> > > wondering if
> > this
> > > must be a reason for Spindle to stop offering XML hints (list of
> > components
> > > or attributes for them)?
> > >
> > > Best regards,
> > > Karel
> > >
> > >
> > >
> > >
> > 
> ---------------------------------------------------------------------
> > > 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
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> 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: Tapestry Features / Skinning

Posted by Karel Miarka <ka...@issa.cz>.
I was playing with this only for a while when I was wondering if it is
better to have two separate templates for readOnly item detail and writable
item detail. Finaly I have decided to use just one template with conditional
statements according to user's rights. So I have even not realized that the
"skinning" approach I have suggested is problematic due to the template
caching. Sorry for the confusion.

Karel

----- Original Message ----- 
From: "Christopher M. DeBracy" <ch...@debracy.net>
To: "'Tapestry users'" <ta...@jakarta.apache.org>
Sent: Thursday, June 24, 2004 1:06 AM
Subject: RE: Tapestry Features / Skinning


I've tried Karel's suggestion for selecting templates on the fly and it
works well - the first time, anyway. Once cached the template remains in
memory. I can flush it by calling the service=reset and configuring the JVM
to enable the reset service, but that opens up the app to much heartache as
indicated in the code comments.

To clear the cache I added the following code to one of my pages:

((IEngineServiceView) getPage().getEngine()).clearCachedData();

This works but with the small side effect that the page I'm currently on
when I click the link does not get flushed. I even tried calling the reset
service afterwards to cycle to a different (home) page and start the session
over again.

I can live with this limitation, but I'm wondering what I'm missing to make
this work cleanly.

Thanks,

Chris

> -----Original Message-----
> From: Norbert Sándor [mailto:programozas@hotmail.com]
> Sent: Wednesday, June 16, 2004 1:01 PM
> To: Tapestry users
> Subject: Re: Tapestry Features / Skinning
>
>
> Is this a "legal" way of skinning?
> I mean: will this probably work in future releases?
>
> Thanks,
> Norbi
>
> ----- Original Message -----
> From: "Karel Miarka" <ka...@issa.cz>
> To: "Tapestry users" <ta...@jakarta.apache.org>
> Sent: Thursday, May 27, 2004 10:54 AM
> Subject: Re: Tapestry Features / Skinning
>
>
> > Hi,
> >
> > there is another quite simple possibility of switching page
> templates
> > at
> > runtime:
> >
> > 1) define all template files you want to use in your page
> > specification as context-assets, for example:
> >
> > <context-asset name="templateRO" path="/WEB-INF/DivisionRO.html"/>
> > <context-asset name="templateRW" path="/WEB-INF/DivisionRW.html"/>
> >
> > 2) overwrite the getAsset() method in your page class, for example:
> >
> > public IAsset getAsset(String name) {
> >   if (ITemplateSource.TEMPLATE_ASSET_NAME.equals(name)) {
> >     String templateAssetName = "templateRO";
> >     if (... canWrite ... ) {
> >       templateAssetName = "templateRW";
> >     }
> >     return super.getAsset(templateAssetName);
> >   }
> >   return super.getAsset(name);
> > }
> >
> > The only disadvantage of this approach, I see at the
> moment, is that
> > with this configuration Spindle stops working with such templates
> > saying "Tapestry can not see "DivisionRO.html" at runtime... I'm
> > wondering if
> this
> > must be a reason for Spindle to stop offering XML hints (list of
> components
> > or attributes for them)?
> >
> > Best regards,
> > Karel
> >
> >
> >
> >
> ---------------------------------------------------------------------
> > 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





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


RE: Tapestry Features / Skinning

Posted by "Christopher M. DeBracy" <ch...@debracy.net>.
I've tried Karel's suggestion for selecting templates on the fly and it
works well - the first time, anyway. Once cached the template remains in
memory. I can flush it by calling the service=reset and configuring the JVM
to enable the reset service, but that opens up the app to much heartache as
indicated in the code comments.

To clear the cache I added the following code to one of my pages:

((IEngineServiceView) getPage().getEngine()).clearCachedData();

This works but with the small side effect that the page I'm currently on
when I click the link does not get flushed. I even tried calling the reset
service afterwards to cycle to a different (home) page and start the session
over again.

I can live with this limitation, but I'm wondering what I'm missing to make
this work cleanly.

Thanks,

Chris

> -----Original Message-----
> From: Norbert Sándor [mailto:programozas@hotmail.com]
> Sent: Wednesday, June 16, 2004 1:01 PM
> To: Tapestry users
> Subject: Re: Tapestry Features / Skinning
> 
> 
> Is this a "legal" way of skinning?
> I mean: will this probably work in future releases?
> 
> Thanks,
> Norbi
> 
> ----- Original Message -----
> From: "Karel Miarka" <ka...@issa.cz>
> To: "Tapestry users" <ta...@jakarta.apache.org>
> Sent: Thursday, May 27, 2004 10:54 AM
> Subject: Re: Tapestry Features / Skinning
> 
> 
> > Hi,
> >
> > there is another quite simple possibility of switching page
> templates
> > at
> > runtime:
> >
> > 1) define all template files you want to use in your page
> > specification as context-assets, for example:
> >
> > <context-asset name="templateRO" path="/WEB-INF/DivisionRO.html"/>
> > <context-asset name="templateRW" path="/WEB-INF/DivisionRW.html"/>
> >
> > 2) overwrite the getAsset() method in your page class, for example:
> >
> > public IAsset getAsset(String name) {
> >   if (ITemplateSource.TEMPLATE_ASSET_NAME.equals(name)) {
> >     String templateAssetName = "templateRO";
> >     if (... canWrite ... ) {
> >       templateAssetName = "templateRW";
> >     }
> >     return super.getAsset(templateAssetName);
> >   }
> >   return super.getAsset(name);
> > }
> >
> > The only disadvantage of this approach, I see at the
> moment, is that
> > with this configuration Spindle stops working with such templates
> > saying "Tapestry can not see "DivisionRO.html" at runtime... I'm 
> > wondering if
> this
> > must be a reason for Spindle to stop offering XML hints (list of
> components
> > or attributes for them)?
> >
> > Best regards,
> > Karel
> >
> >
> >
> > 
> ---------------------------------------------------------------------
> > 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