[Bese-devel] menu selection by user-friendly url

Kilian Sprotte kilian.sprotte at googlemail.com
Sat Sep 1 11:48:54 UTC 2007


Hi,

I would like to ask you for some help.

What I am trying to do is to have a parameter that allows me to
"automatically select from a menu".

Let's say I have this menu main page with some <ucw:a links on it.
When they are clicked, I call the desired component. It will replace
the menu page. Whenever it answers, we are back to the menu page. - So
far so good.

Now, what I would like to do is to have a dispatcher that reacts to a
url like this one:

http://localhost:8080/admin/?menuitem=admin-app-add-user

(where http://localhost:8080/admin/ would give me this menu page)

So, I am trying to have the entry-point be aware of the menuitem parameter:

(defentry-point "^(index.ucw|)$" (:application *admin-application*
					       :class regexp-dispatcher)
    (menuitem)
  (if menuitem
      (let ((symbol (intern (string-upcase menuitem) #.(find-package :lbnz))))
	(case symbol
	  (index (call 'admin-window))
	  (t (let ((c (make-instance 'admin-window)))
	       (setf (window.body c) (make-instance symbol)) ; ************
	       (call c)))))
      (call 'admin-window)))

As you can see on the line ************, I am trying to simulate the
link being pressed and so I am displaying the desired component
directly.

While this actually will display the component, the problem comes in,
when that component answers - it has not been called by the menu page.

I am wondering, whether there is an easy way to solve this - right
now, it seems to me that maybe I should write my own version of
call-component for this. (Similar to the call-component method where
the first arg is null.)

Any comments?

Best,
  Kilian

PS: Sorry there is one more question about update-url. (Although in
the above, I am not concerned yet with actually supplying the urls.)
While playing around with this a little bit - I have the impression
that "it always comes too late". (If I click on a link, I see the user
friendly url parameter that I would have wanted for the last page.)

There is this wiki tutorial - also there that seems to be a problem.



More information about the bese-devel mailing list