You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Miller, John" <jm...@litle.com> on 2006/03/02 15:30:04 UTC

Changing Tiles definition based on user role

Hi, 

 

I have used tiles basic functionality for some time both in Struts and
JSF/MyFaces env. What I am trying to do is set my tiles definition based
on user role so I would have two tiles defined the same, but based on
user role the correct one would be rendered. 

For example

 

            <definition name="/faces/reports/testreport.tiles"
extends="report" role="oldCustomer" >

                        <put name="content" value="/jsp/oldContent"/>

            </definition>

            <definition name="/faces/reports/testreport.tiles"
extends="report" role="newCustomer">

                        <put name="content" value="/jsp/newContent"/>

            </definition>

 

 

I have seen some documentation that makes it sound like this is
possible, but haven't gotten it to work. If anyone has experience in
doing this or can offer some direction it would be appreciated. Also, I
don't think this should make a difference, but I am using the myfaces
JspTilesViewHandlerImpl, I haven't tried this in a pure stuts/tiles env.
Thanks 
 
 
 
NOTICE:  This message, including all attachments transmitted with it, is for the use of the addressee only. It may contain proprietary, confidential and/or legally privileged information belonging to Litle & Co. No confidentiality or privilege is waived or lost by any mistransmission. If you are not the intended recipient, you must not, directly or indirectly, use, disclose, distribute, print or copy any part of this message.  If you believe you have received this message in error, please delete it and all copies of it from your system and notify the sender immediately by reply e-mail.  Thank you. 

Re: Changing Tiles definition based on user role

Posted by Antonio Petrelli <br...@tariffenet.it>.
Miller, John ha scritto:
> Hi, 
>
>  
>
> I have used tiles basic functionality for some time both in Struts and
> JSF/MyFaces env. What I am trying to do is set my tiles definition based
> on user role so I would have two tiles defined the same, but based on
> user role the correct one would be rendered. 
>   

You could use Dimensions for displaying different Tiles definitions 
depending on the user role-device pair (obviously if you use only one 
device, you will display different Tiles definitions depending only on 
the user role ;-) )
http://mutidimensions.sf.net/
Ciao
Antonio

P.S. For the rest of the list... it is not spam what I am sending though 
it could seem as it is! ;-)

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


Re: Changing Tiles definition based on user role

Posted by Zoran Avtarovski <zo...@conads.com>.
We were after something similar. Have you had a look at Dimensions
http://mutidimensions.sf.net/

We're still in the process of building but it looks like what you are after.

Z.

> On 3/2/06, Miller, John <jm...@litle.com> wrote:
> 
> I have used tiles basic functionality for some time both in Struts and
>> JSF/MyFaces env. What I am trying to do is set my tiles definition based
>> on user role so I would have two tiles defined the same, but based on
>> user role the correct one would be rendered.
> 
> 
> I haven't tried it, but it seems to me you would have two _different_ Tiles
> definitions, and the page would include both, but only one of them would
> ever be displayed.  (Assuming the roles are mutually exclusive.)
> 
> Have you looked at the debug log when your tiles config is processed?  I
> wouldn't be surprised if the second definition for the same name is just
> replacing the first definition.  By 'not working' do you mean that only the
> newCustomer tile gets displayed?  Or nothing?
> 
> --
> Wendy



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


Re: Changing Tiles definition based on user role

Posted by Wendy Smoak <ws...@gmail.com>.
On 3/2/06, Miller, John <jm...@litle.com> wrote:

I have used tiles basic functionality for some time both in Struts and
> JSF/MyFaces env. What I am trying to do is set my tiles definition based
> on user role so I would have two tiles defined the same, but based on
> user role the correct one would be rendered.


I haven't tried it, but it seems to me you would have two _different_ Tiles
definitions, and the page would include both, but only one of them would
ever be displayed.  (Assuming the roles are mutually exclusive.)

Have you looked at the debug log when your tiles config is processed?  I
wouldn't be surprised if the second definition for the same name is just
replacing the first definition.  By 'not working' do you mean that only the
newCustomer tile gets displayed?  Or nothing?

--
Wendy