File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tiles question

 
Alvin chew
Ranch Hand
Posts: 834
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, the below is part of tiles definition on tile-defs.xml



now, because header page is actually menu section , and the menu is customize, means we allow user customize the menu , and finally assign to specify person based on the customized menu ,

if i already define definition in tiles as mentioned above, how to i override this definition by replace different header ?

i know it should be put the extends as below :



so, is that means i need to edit the tile-def.xml ? any other way to solve this problem ?

thank you !
[ February 23, 2005: Message edited by: Alvin chew ]
 
Ken Loh
Ranch Hand
Posts: 190
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it a problem to edit tiles-def.xml in your case ? You can have have your definition for "manager layout" in another file, provided you declare it in your struts-config.xml, the same way you declare tiles-defs.xml.

If my guess is right you could enter:



Originally posted by Alvin chew:
hi, the below is part of tiles definition on tile-defs.xml



now, because header page is actually menu section , and the menu is customize, means we allow user customize the menu , and finally assign to specify person based on the customized menu ,

if i already define definition in tiles as mentioned above, how to i override this definition by replace different header ?

i know it should be put the extends as below :



so, is that means i need to edit the tile-def.xml ? any other way to solve this problem ?

thank you !

[ February 23, 2005: Message edited by: Alvin chew ]
 
Alvin chew
Ranch Hand
Posts: 834
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you ken for reply , my problem actually simple ..if i make a web menu component which allow each user can have their own menu(something like tree menu), and the different menu will locate into header.jsp, so my component suppose to have many different header.jsp for each user.

now, if i predefine in tile-def.xml, it would be fine, because we can use some concept like inheritance to write it into tile-def.xml ,

my problem is assume we have one default set of definition in tile-def.xml, now if new definition need to be add into tile-def.xml, what i suppose to do ? do i need to write it into tile-def.xml or any other way to make new definition inherit the predefine definition ? if yes, can i simply using xml parser to write it to tile-def.xml ? so we need to restart the tomcat everytime?
 
Ken Loh
Ranch Hand
Posts: 190
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think I must first find out if I understand you correctly.

Are you saying that your menu can be personalized by your user ? And it is rendered dynamically according to data from a datasource ?

Personally, I think tiles provides layouts where component tiles can be dynamically rendered. If I were in your case, I would generalize the possible forms the menu could manifest itself, and then create tiles definition for each of the generalized menu. I would then create an Action subclass that will forward to the right generalized menu accordingly.

Then, I would enter decision making logics in the JSPs that are component tiles within each definition.

This would be what I would do in your position.

Originally posted by Alvin chew:
thank you ken for reply , my problem actually simple ..if i make a web menu component which allow each user can have their own menu(something like tree menu), and the different menu will locate into header.jsp, so my component suppose to have many different header.jsp for each user.

now, if i predefine in tile-def.xml, it would be fine, because we can use some concept like inheritance to write it into tile-def.xml ,

my problem is assume we have one default set of definition in tile-def.xml, now if new definition need to be add into tile-def.xml, what i suppose to do ? do i need to write it into tile-def.xml or any other way to make new definition inherit the predefine definition ? if yes, can i simply using xml parser to write it to tile-def.xml ? so we need to restart the tomcat everytime?
 
Alvin chew
Ranch Hand
Posts: 834
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i see ...thanks ken ...your suggestion is good ...i will think over it
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic