Re: Dynamically populating tile lists at runtime for menus - Is it possible?

2003-10-02 Thread Caroline Lauferon
another possibility would be to define a new bean (here, Onglet) with an attribute 
roles. In the layout, you verifiy if the role you are in is contained in the roles 
attribute before displaying the onglet. 
Here is a extract of a tiles definition using it: 

putList name=listeOnglets

bean classtype=XXX.Onglet

set-property property=id value=Perso/

set-property property=text value=Perso/

set-property property=roles value=guichet, ingenierie/

set-property property=link value=pagePersoFiltreService.do/

/bean

bean classtype=XXX.Onglet

set-property property=id value=Groupe/

set-property property=text value=Groupe/

set-property property=roles value=guichet, ingenierie/

set-property property=link value=pageGroupeFiltreService.do/

/bean



It works great. Hope it helps!

Caroline



RE: Dynamically populating tile lists at runtime for menus - Is it possible?

2003-10-01 Thread Fedor Smirnoff
I am not using putList myself but if you looking to dynamically
construct complex tiles have you looked into UrlController?
 
http://jakarta.apache.org/struts/api/org/apache/struts/tiles/UrlControll
er.html

http://www.lifl.fr/~dumoulin/tiles/tilesAdvancedFeatures.pdf


Hope it helps
Fedor

-Original Message-
From: Joanne L Corless [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, October 01, 2003 8:00 AM
To: [EMAIL PROTECTED]
Subject: Dynamically populating tile lists at runtime for menus - Is it
possible?

Hi,

I am in the process of building a Struts/Tiles application that needs to
be
able to dynamically construct menu lists when the user logs in.

For instance a user may belong to the base user role, therefore a single
tab should be displayed but he could also belong to an admin role,
therefore 2 tabs need to be displayed.

Is there a way of building the

  putList name=tabList
  item value=Doc Home link=/index.jsp /
  .
  .
  .
  .
  .
/putList

dynamically?

All the documentation I have found so far seems to suggest that all
these
lists need to be predefined, however I want to be able to retrieve the
item's from a database within a Struts action as the number of
combinations
of  list items could run into the hundreds.

Regards


Joanne Corless

CSC Computer Sciences Limited
(   Office +44 (0)1772 318025
( Mobile +44 (0)7767 656588
* email [EMAIL PROTECTED]


Based at: CSC, Alliance House, Library Road, Chorley, Lancs, PR6 7EN
CSC Computer Sciences Limited: Registered in England, No. 963578.
Registered office: Royal Pavilion, Wellesley Road, Aldershot, Hampshire,
GU11 1PZ.






This is a PRIVATE message. If you are not the intended recipient, please
delete without copying and kindly advise us by e-mail of the mistake in
delivery. NOTE: Regardless of content, this e-mail shall not operate to
bind CSC to any order or other contract unless pursuant to explicit
written
agreement or government initiative expressly permitting the use of
e-mail
for such purpose.








-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Dynamically populating tile lists at runtime for menus - Is it possible?

2003-10-01 Thread Jason Lea
The docs show that item doesn't accept a role attribute, and the add 
tag does but not in a definiton so I don't think you can.

I have a menu  tile that is displayed on every page.

I use the logic:present to check user roles, and display items 
depending on that.

logic:present role=admin
  span class=menuitemhtml:link forward=admin 
titleKey=admin.titlebean:message key=admin.menu //html:link/span
/logic:present

logic:present role=a_user
  ...
/logic:present
... (general links that any user can access, don't have to be logged in)

Your other option might be to use a tile controller to generate the list.

Joanne L Corless wrote:
Hi,

I am in the process of building a Struts/Tiles application that needs to be
able to dynamically construct menu lists when the user logs in.
For instance a user may belong to the base user role, therefore a single
tab should be displayed but he could also belong to an admin role,
therefore 2 tabs need to be displayed.
Is there a way of building the

  putList name=tabList
  item value=Doc Home link=/index.jsp /
  .
  .
  .
  .
  .
/putList
dynamically?

All the documentation I have found so far seems to suggest that all these
lists need to be predefined, however I want to be able to retrieve the
item's from a database within a Struts action as the number of combinations
of  list items could run into the hundreds.
Regards

Joanne Corless

CSC Computer Sciences Limited
(   Office +44 (0)1772 318025
( Mobile +44 (0)7767 656588
* email [EMAIL PROTECTED]
Based at: CSC, Alliance House, Library Road, Chorley, Lancs, PR6 7EN
CSC Computer Sciences Limited: Registered in England, No. 963578.
Registered office: Royal Pavilion, Wellesley Road, Aldershot, Hampshire,
GU11 1PZ.




This is a PRIVATE message. If you are not the intended recipient, please
delete without copying and kindly advise us by e-mail of the mistake in
delivery. NOTE: Regardless of content, this e-mail shall not operate to
bind CSC to any order or other contract unless pursuant to explicit written
agreement or government initiative expressly permitting the use of e-mail
for such purpose.





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



--
Jason Lea
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]