I've cc'd the struts-menu-user list so we can get some more opinions.
I'm interested in this as well, especially since I might need this
functionality next week! My needs are a little different - I'm still
comfortable with using menu-config.xml to build my URLs (actually, to
just read Struts Forwards), but I'd like to allow parameters in them.
For instance, a menu item's URL might be:
/do/editUser?id={0}
And I'd like to somehow populate the {0} at run time. Possibly in the
JSP tag itself. Or maybe those could be named parameters - i.e.
/do/editUser?id=${userId} where I could pass this value in:
<menu:displayMenu name="ToDoListMenuFile">
<menu:set param="userId" value="<%=userForm.getId()%>"/>
</menu:displayMenu>
Or even better, use some JSTL lovin'
<menu:displayMenu name="ToDoListMenuFile">
<menu:set param="userId" value="${userForm.id}"/>
</menu:displayMenu>
It'd be easiest if the menu:displayMenu tag could read a parameter set
by JSTL:
<menu:displayMenu name="ToDoListMenuFile">
<c:set var="userId" value="${userForm.id}"/>
</menu:displayMenu>
Thoughts?
Matt
-----Original Message-----
From: Chad Skinner [mailto:[EMAIL PROTECTED]
Sent: Friday, September 19, 2003 10:59 AM
To: [EMAIL PROTECTED]
Subject: RE: Struts Menu Question
Matt,
Sorry, I keep getting tied up on projects and am finally getting a
little time to get back to this. Unfortunately, I don't entirely
understand how the struts menu works and a lot of this is very foreign
to me.
Honestly, I am not very familiar with the Digester, but from what I
understand Struts is loading the StrutsMenu plugin which calls the
digester and loads the menus. I don't know how efficient it would be,
but I am thinking one could extract the process of loading the menus
into an interface that had a single method. For example,
menuFactory.getMenus(). (This method may require the pageContext be
passed so that the Factory can access parameters to identify the user.)
For this to work I am thinking that you would have to create an optional
configuration parameter for the menuFactory within the menu-config.xml
file and make certain the menuConfig DTD had the menu element as
optional. Then once the digester is finished processing the
configuration file a check would be performed to see if the menuFactory
parameter is set. If it is set the MenuRepository would instantiate the
specified class and call its getMenus() method setting the result in the
menus FastHashMap.
If the menuFactory element is not found then the digester would have
parsed the configuration file as normal.
Also, I have not looked into the code for the permissions adapter, but
is it possible not to use one? For example, my MenuFactor class would
only return menus for the secified user.
Let me know if this makes sense or not,
Chad
>>> "Matt Raible" <[EMAIL PROTECTED]> 09/03/03 10:04AM >>>
This functionality does not currently exist. Although it has been
discussed on the mailing lists. Any ideas on how to implement this
functionality might help get it implemented faster.
Matt
-----Original Message-----
From: Chad Skinner [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 03, 2003 8:04 AM
To: [EMAIL PROTECTED]
Subject: Struts Menu Question
Matt,
Once again I was looking for information on struts, struts-menu
actually, and ran across your name and was wondering if you could point
me in the right direction. I have been looking for documentation, but am
not finding what I need. I see that the menus are configured through the
xml configuration file, but we have a portal that supplies a menu object
that contains more menu and link objects. Is it possible for me to write
a class that would convert these objects into something that struts menu
can interpret? If so which classes do I need to look at extending or
implementing.
Thanks,
Chad Skinner
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
struts-menu-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/struts-menu-user