Hello Everyone, I was asked to post a message to this
list so as we could get more people involved in the
discussion. After posting my last message I realized
that non of you would know the background of the
original messages so I am posting them here. Sorry for
the length of this.
Chad Skinner
--------------------------------------
From: Chad Skinner
Sent: Friday, September 19, 2003 12:29 PM
To: matt raible
Subject: Re: Populating a MenuRepository from outside
themenu-config.xml file
I guess I would rather not reinvent the wheel, so
using the JSTL makes since to me; but on another note
I'd have to put some more thought into this.
There are a couple of things that are interesting
about this. First, it is my understanding that the
menus are created when the plugin initializes so the
menu urls would contain the variable definitions you
place in the configuration file. Consequenlty, would
you not have to modify the getter on the location
property of the MenuBase to perform the lookup or
translation of any variables it finds in it? If this
is the case a better solution may be to have a method
parseVariables(String aString) that would take a
string and search the page scopes for any matches
found in the string. Then the getters could be
modified to "return parseVariables( location )".
Side Question, is it possible to have a link as a top
level item in the menu?
For Example, we have the following menu structure:
GroupWise
Files
Forums
Forum 1
Forum 2
Groups
Group 1
Group 2
News
NewsSpread 1
NewsSpread 2
I need to know if it is possible to place the
GroupWise and Files links at the root of the menu? OR
is it possible to hide the link to the top level menu
and always have it open?
>>> "Matt Raible" <XXXXXXXXX> 09/19/03 12:48PM >>>
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
Sent: Friday, September 19, 2003 10:59 AM
To: matt raible
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 MenuFactory class would only
return menus for the secified user.
Let me know if this makes sense or not,
Chad
>>> "Matt Raible" <xxxxxxxxxxxx> 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-----
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