Kilian Sprotte | 1 Sep 13:48 2007

menu selection by user-friendly url

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)) ; ************
(Continue reading)

Marco Baringer | 4 Sep 06:00 2007
Picon

New patches to arnesi_dev: 3-Sep-2007


Mon Sep  3 04:52:09 EDT 2007  attila.lendvai <at> gmail.com
  * added assert to warn that defgeneric/cc does not walk the :method entries

    M ./src/call-cc/generic-functions.lisp +1

An updated tarball of arnesi_dev's source can be downloaded here:
http://common-lisp.net/project/bese/tarballs/arnesi_dev-20070903.tar.gz

Darcsweb URL:
http://uncommon-web.com/darcsweb/darcsweb.cgi?r=arnesi_dev;a=summary
Yarek Kowalik | 4 Sep 06:30 2007
Picon

Error in the 'Counter' example

Hi!

Today I downloaded the ucw-boxset to try it out for the first time.  Got it up and running on sbcl on Ubuntu (AMD X2 64 bit OS).  The 'Counter' example gives me the  error below.  Can you help me resolve this?

Thanks

Yarek

(SIGNAL #<SIMPLE-ERROR {1004D14491}>)

Description (SIGNAL #<SIMPLE-ERROR {1004D14491}>)
Locals NameValue
SB-DEBUG::ARG-0 1
SB-DEBUG::ARG-1 #<SIMPLE-ERROR {1004D14491}>
Source ERROR error opening #P"/home/asf/tmp/sbcl- 1.0/src/code/cold-error.lisp": No such file or directory

[ + ] (ERROR "There is no class named ~S.")

Description (ERROR "There is no class named ~S.")
Locals NameValue
SB-DEBUG::ARG-0 2
SB-DEBUG::ARG-1 "There is no class named ~S."
Source ERROR error opening #P"/home/asf/tmp/sbcl-1.0/src/code/cold-error.lisp": No such file or directory

[ + ] (SB-PCL::FIND-CLASS-FROM-CELL IT.BESE.UCW-USER::I...

Description (SB-PCL::FIND-CLASS-FROM-CELL IT.BESE.UCW-USER::INEXISTENT-COMPONENT-FOOBAR NIL T)
Locals NameValue
SB-PCL::CELL NIL
SB-PCL::ERRORP T
SYMBOL IT.BESE.UCW-USER::INEXISTENT-COMPONENT-FOOBAR
Source ERROR Cannot find source location for: #<COMPILED-CODE-LOCATION (SB-C::HAIRY-ARG-PROCESSOR SB-PCL::FIND-CLASS-FROM-CELL)>

[ + ] ((SB-PCL::FAST-METHOD MAKE-INSTANCE (SYMBOL)) #<u...

Description ((SB-PCL::FAST-METHOD MAKE-INSTANCE (SYMBOL)) #<unused argument> #<unused argument> IT.BESE.UCW-USER::INEXISTENT-COMPONENT-FOOBAR)
Locals NameValue
CLASS IT.BESE.UCW-USER::INEXISTENT-COMPONENT-FOOBAR
SB-PCL::INITARGS NIL
Source ERROR Cannot find source location for: #<COMPILED-CODE-LOCATION (SB-C::VARARGS-ENTRY (SB-PCL::FAST-METHOD MAKE-INSTANCE (SYMBOL)))>

[ + ] ((LAMBDA (IT.BESE.ARNESI:ARGUMENTS )) (IT.BESE.UCW...

Description
((LAMBDA (IT.BESE.ARNESI:ARGUMENTS)) (IT.BESE.UCW-USER::INEXISTENT-COMPONENT-FOOBAR))
Locals
Name
Value
SB-DEBUG::ARG-0
(IT.BESE.UCW-USER::INEXISTENT-COMPONENT-FOOBAR)

Source
LOCATION (FILE /home/yarek/lisp/ucw-boxset/dependencies/arnesi_dev/src/call-cc/apply.lisp) (POSITION 1435) (SNIPPET defmethod evaluate/cc ((func free-application-form) lex-env dyn-env k) (cond ((eql 'call/cc (operator func)) (evaluate/cc (make-instance 'free-application-form :operator 'funcall )

[ + ] (IT.BESE.ARNESI::DRIVE-INTERPRETER/CC #<CLOSURE (L...

Description
(IT.BESE.ARNESI::DRIVE-INTERPRETER/CC #<CLOSURE (LAMBDA #) {1004D13659}>)
Locals
Name
Value
SB-DEBUG::ARG-0
#<CLOSURE (LAMBDA NIL) {1004D13659}>

Source
LOCATION (FILE /home/yarek/lisp/ucw-boxset/dependencies/arnesi_dev/src/call-cc/interpreter.lisp) (POSITION 3365) (SNIPPET defun drive-interpreter/cc (code) (catch 'done (loop for thunk = code then (funcall thunk)))) (defmacro let/cc (k &body body) `(call/cc (lambda (,k) , <at> body))) (defmacro retk () `(let/cc k k)) (defmacro klambda ((&optional (value (gensym) value)

[ + ] ((SB-PCL::FAST-METHOD IT.BESE.UCW::HANDLER-HANDLE ...

Description
((SB-PCL::FAST-METHOD IT.BESE.UCW::HANDLER-HANDLE (IT.BESE.UCW::ACTION-HANDLER IT.BESE.UCW:STANDARD-APPLICATION IT.BESE.UCW::STANDARD-REQUEST-CONTEXT T)) #<unavailable argument> #<unavailable argument> #<unavailable argument> #<IT.BESE.UCW:COOKIE-SESSION-APPLICATION "/" {10026D9291}> #<IT.BESE.UCW-USER::COOKIE-SESSION-APPLICATION-REQUEST-CONTEXT {1004CE9701}> (#<CLOSURE # {10044C99B9}> "error.ucw"))
Locals
Name
Value
SB-DEBUG::ARG-0
:<NOT-AVAILABLE>
SB-DEBUG::ARG-1
:<NOT-AVAILABLE>
SB-DEBUG::ARG-2
:<NOT-AVAILABLE>
SB-DEBUG::ARG-3
#<IT.BESE.UCW:COOKIE-SESSION-APPLICATION "/" {10026D9291}>
SB-DEBUG::ARG-4
#<IT.BESE.UCW-USER::COOKIE-SESSION-APPLICATION-REQUEST-CONTEXT {1004CE9701}>
SB-DEBUG::ARG-5
(#<CLOSURE (LAMBDA NIL) {10044C99B9}> "error.ucw")

Source
LOCATION (FILE /home/yarek/lisp/ucw-boxset/ucw_dev/src/rerl/standard-dispatcher.lisp) (POSITION 6324) (SNIPPET defmethod handler-handle ((handler action-handler) (application standard-application) (context standard-request-context) matcher-result) (let ((action (car matcher-result))) (ucw.rerl.dispatcher.info "ACTION-HANDLER, handling act)

[ + ] ((SB-PCL::FAST-METHOD IT.BESE.UCW::DISPATCH (IT....

Description
((SB-PCL::FAST-METHOD IT.BESE.UCW::DISPATCH (IT.BESE.UCW::ABSTRACT-DISPATCHER IT.BESE.UCW:STANDARD-APPLICATION IT.BESE.UCW::STANDARD-REQUEST-CONTEXT)) #<unavailable argument> #<unavailable argument> #<IT.BESE.UCW:URL-DISPATCHER "error.ucw" {10043EAAE1}> #<IT.BESE.UCW:COOKIE-SESSION-APPLICATION "/" {10026D9291}> #<IT.BESE.UCW-USER::COOKIE-SESSION-APPLICATION-REQUEST-CONTEXT {1004CE9701}>)
Locals
Name
Value
SB-DEBUG::ARG-0
:<NOT-AVAILABLE>
SB-DEBUG::ARG-1
:<NOT-AVAILABLE>
SB-DEBUG::ARG-2
#<IT.BESE.UCW:URL-DISPATCHER "error.ucw" {10043EAAE1}>
SB-DEBUG::ARG-3
#<IT.BESE.UCW:COOKIE-SESSION-APPLICATION "/" {10026D9291}>
SB-DEBUG::ARG-4
#<IT.BESE.UCW-USER::COOKIE-SESSION-APPLICATION-REQUEST-CONTEXT {1004CE9701}>

Source
LOCATION (FILE /home/yarek/lisp/ucw-boxset/ucw_dev/src/rerl/standard-dispatcher.lisp) (POSITION 12018) (SNIPPET defmethod dispatch ((dispatcher abstract-dispatcher) (application standard-application) (context standard-request-context)) (let ((result (multiple-value-list (matcher-match dispatcher application context)))) (when (and (listp result)

[ + ] ((SB-PCL::FAST-METHOD IT.BESE.UCW::SERVICE (IT.B...

Description
((SB-PCL::FAST-METHOD IT.BESE.UCW::SERVICE (IT.BESE.UCW:STANDARD-APPLICATION IT.BESE.UCW::REQUEST-CONTEXT)) #<unavailable argument> #<unavailable argument> #<IT.BESE.UCW:COOKIE-SESSION-APPLICATION "/" {10026D9291}> #<IT.BESE.UCW-USER::COOKIE-SESSION-APPLICATION-REQUEST-CONTEXT {1004CE9701}>)
Locals
Name
Value
SB-DEBUG::ARG-0
:<NOT-AVAILABLE>
SB-DEBUG::ARG-1
:<NOT-AVAILABLE>
SB-DEBUG::ARG-2
#<IT.BESE.UCW:COOKIE-SESSION-APPLICATION "/" {10026D9291}>
SB-DEBUG::ARG-3
#<IT.BESE.UCW-USER::COOKIE-SESSION-APPLICATION-REQUEST-CONTEXT {1004CE9701}>

Source
LOCATION (FILE /home/yarek/lisp/ucw-boxset/ucw_dev/src/rerl/standard- application.lisp) (POSITION 2965) (SNIPPET defmethod service ((app standard-application) (context request-context)) "Service a request for this application. The CONTEXT is inspected and session is either created (if an existing one can not be found), or retrieved form the application's session t)

[ + ] ((SB-PCL::FAST-METHOD IT.BESE.UCW::HANDLE-REQUEST ...

Description
((SB-PCL::FAST-METHOD IT.BESE.UCW::HANDLE-REQUEST (IT.BESE.UCW:STANDARD-SERVER IT.BESE.UCW:REQUEST IT.BESE.UCW:RESPONSE)) #<unavailable argument> #<unavailable argument> #<IT.BESE.UCW:STANDARD-SERVER IT.BESE.UCW:MULTITHREAD-HTTPD-BACKEND 2 {10041E5931}> #<IT.BESE.UCW::HTTPD-REQUEST {1004CD4211}> #<IT.BESE.UCW::HTTPD-RESPONSE {1004CD9B11}>)
Locals
Name
Value
SB-DEBUG::ARG-0
:<NOT-AVAILABLE>
SB-DEBUG::ARG-1
:<NOT-AVAILABLE>
SB-DEBUG::ARG-2
#<IT.BESE.UCW:STANDARD-SERVER IT.BESE.UCW:MULTITHREAD-HTTPD-BACKEND 2 {10041E5931}>
SB-DEBUG::ARG-3
#<IT.BESE.UCW::HTTPD-REQUEST {1004CD4211}>
SB-DEBUG::ARG-4
#<IT.BESE.UCW::HTTPD-RESPONSE {1004CD9B11}>

Source
LOCATION (FILE /home/yarek/lisp/ucw-boxset/ucw_dev/src/rerl/standard-server.lisp) (POSITION 2765) (SNIPPET defmethod handle-request ((server standard-server) (request request) (response response)) "Service REQUEST and create a response in RESPONSE. This method creates the catch tag abort-request and a res)

[ + ] ((SB-PCL::FAST-METHOD IT.BESE.UCW::HANDLE-REQUEST ...

Description
((SB-PCL::FAST-METHOD IT.BESE.UCW::HANDLE-REQUEST (IT.BESE.UCW:HTTPD-BACKEND IT.BESE.UCW::HTTPD-REQUEST IT.BESE.UCW::HTTPD-RESPONSE)) #<unavailable argument> #<unavailable argument> #<IT.BESE.UCW:MULTITHREAD-HTTPD-BACKEND {1003A33331}> #<IT.BESE.UCW::HTTPD-REQUEST {1004CD4211}> #<IT.BESE.UCW::HTTPD-RESPONSE {1004CD9B11}>)
Locals
Name
Value
SB-DEBUG::ARG-0
:<NOT-AVAILABLE>
SB-DEBUG::ARG-1
:<NOT-AVAILABLE>
SB-DEBUG::ARG-2
#<IT.BESE.UCW:MULTITHREAD-HTTPD-BACKEND {1003A33331}>
SB-DEBUG::ARG-3
#<IT.BESE.UCW::HTTPD-REQUEST {1004CD4211}>
SB-DEBUG::ARG-4
#<IT.BESE.UCW::HTTPD-RESPONSE {1004CD9B11}>

Source
LOCATION (FILE /home/yarek/lisp/ucw-boxset/ucw_dev/src/backend/httpd.lisp) (POSITION 1930) (SNIPPET defmethod handle-request ((backend httpd-backend) (request httpd-request) (response httpd-response)) (ucw.backend.info "Handling request for ~S from ~S" (raw-uri request) (peer-address request)) (or (handle-request (server backend) request response) )

[ + ] (IT.BESE.UCW::HTTPD-WORKER-LOOP/HANDLE #<IT.BESE....

Description
(IT.BESE.UCW::HTTPD-WORKER-LOOP/HANDLE #<IT.BESE.UCW::HTTPD-WORKER {1005D66991}> #<IT.BESE.UCW:MULTITHREAD-HTTPD-BACKEND {1003A33331}> #<IT.BESE.UCW::PENDING-REQUEST {1004C9CAD1}>)
Locals
Name
Value
SB-DEBUG::ARG-0
#<IT.BESE.UCW::HTTPD-WORKER {1005D66991}>
SB-DEBUG::ARG-1
#<IT.BESE.UCW:MULTITHREAD-HTTPD-BACKEND {1003A33331}>
SB-DEBUG::ARG-2
#<IT.BESE.UCW::PENDING-REQUEST {1004C9CAD1}>

Source
LOCATION (FILE /home/yarek/lisp/ucw-boxset/ucw_dev/src/backend/multithread-httpd.lisp) (POSITION 8064) (SNIPPET defun httpd-worker-loop/handle (worker backend pending-request) (let ((stream (network-stream pending-request))) (flet ((abort-worker (condition) (break) (ignore-errors (ucw.backend.error "Error in worker loop)

[ + ] (IT.BESE.UCW::HTTPD-WORKER-LOOP #<IT.BESE.UCW::HTT...

Description
(IT.BESE.UCW::HTTPD-WORKER-LOOP #<IT.BESE.UCW::HTTPD-WORKER {1005D66991}>)
Locals
Name
Value
SB-DEBUG::ARG-0
#<IT.BESE.UCW::HTTPD-WORKER {1005D66991}>

Source
LOCATION (FILE /home/yarek/lisp/ucw-boxset/ucw_dev/src/backend/multithread-httpd.lisp) (POSITION 9692) (SNIPPET defun httpd-worker-loop (worker) (loop (receive ((shutdown) (return-from httpd-worker-loop nil)) ((connection ?backend ?pending-request) (unless (stop-flag worker) (httpd-worker-loop/handle worker ?backend ?pending-re)

[ + ] ((LAMBDA ()))

Description
((LAMBDA ()))
Locals
None.
Source
ERROR error opening #P"/home/asf/tmp/sbcl- 1.0/src/code/target-thread.lisp": No such file or directory

[ + ] ("foreign function: call_into_lisp")

Description
("foreign function: call_into_lisp")
Locals
None.
Source
ERROR The value #<SB-DI::BOGUS-DEBUG-FUN "foreign function: call_into_lisp"> is not of type SB-DI::COMPILED-DEBUG-FUN.

[ + ] ("foreign function: new_thread_trampoline")






_______________________________________________
bese-devel mailing list
bese-devel <at> common-lisp.net
http://common-lisp.net/cgi-bin/mailman/listinfo/bese-devel
Marco Baringer | 6 Sep 06:20 2007
Picon

New patches to parenscript: 5-Sep-2007


Thu Aug  2 15:13:43 EDT 2007  attila.lendvai <at> gmail.com
  * fix rebind (in the obsolete ucw parenscript repo)

    M ./src/js.lisp -5 +4

An updated tarball of parenscript's source can be downloaded here:
http://common-lisp.net/project/ucw/tarballs/parenscript-20070905.tar.gz

Darcsweb URL:
http://uncommon-web.com/darcsweb/darcsweb.cgi?r=parenscript;a=summary
Marco Baringer | 6 Sep 06:30 2007
Picon

New patches to ucw_ajax: 5-Sep-2007


Wed Sep  5 10:09:11 EDT 2007  attila.lendvai <at> gmail.com
  * Added in-restored-rendering-environment

    M ./src/components/ajax.lisp +5
    M ./src/packages.lisp +1

Thu Aug 30 20:52:37 EDT 2007  attila.lendvai <at> gmail.com
  * <ucw:localized just got smarter

    M ./src/l10n/l10n.lisp -12 +25

An updated tarball of ucw_ajax's source can be downloaded here:
http://common-lisp.net/project/ucw/tarballs/ucw_ajax-20070905.tar.gz

Darcsweb URL:
http://uncommon-web.com/darcsweb/darcsweb.cgi?r=ucw_ajax;a=summary
Ties Stuij | 6 Sep 14:27 2007
Picon

*current-form* and call-in-restored-rendering-environment problems

I encountered two seperate problems with the latest ucw_ajax:

The first one is about this call action before method. It seems to me
that it is letting ucw think that the to be called component is a
form, and subsequently tells all calls to install-action-js in that
links component to put a:   formsToSubmit : [ '<form>' ] }); into the
javascript. Which then throws me into the debugger.

(defmethod call-action :around ((action ajax-action) application session frame)
  (let ((form (creation-time-current-form-of action)))
    (if (and form
             (parent form))
        (let ((*current-form* form))
          (ucw.rerl.actions.dribble "Restored *CURRENT-FORM* to ~A
from CALL-ACTION of AJAX-ACTION" *current-form*)
          (call-next-method))
        (call-next-method))))

Commenting it out works for me but i am to un-knowledgeable about
ucw-ajax to fix what this fixes.

furthermore when clicking an ajax link, i'm thrown into the debugger
with as message:
 There is no applicable method for the generic function
  #<STANDARD-GENERIC-FUNCTION IT.BESE.UCW:CALL-IN-RENDERING-ENVIRONMENT

Apparently render-nearest-ajax-component can't find a component which
is an ajax-component-mixin. Is this a new thing, that to be rendered
components must be ajax-component-mixin's or am i barking up the wrong
tree here. FYI all goes well in this area untill the

* Added call-in-restored-rendering-environment; renamed to
call-in-rendering-environment

patch.

/Ties
Attila Lendvai | 6 Sep 15:10 2007
Picon

Re: *current-form* and call-in-restored-rendering-environment problems

> I encountered two seperate problems with the latest ucw_ajax:
>
> The first one is about this call action before method. It seems to me
> that it is letting ucw think that the to be called component is a
> form, and subsequently tells all calls to install-action-js in that
> links component to put a:   formsToSubmit : [ '<form>' ] }); into the
> javascript. Which then throws me into the debugger.
>
> (defmethod call-action :around ((action ajax-action) application session frame)
>   (let ((form (creation-time-current-form-of action)))
>     (if (and form
>              (parent form))
>         (let ((*current-form* form))
>           (ucw.rerl.actions.dribble "Restored *CURRENT-FORM* to ~A
> from CALL-ACTION of AJAX-ACTION" *current-form*)
>           (call-next-method))
>         (call-next-method))))

the long story behind this is that i've refactored ajax stuff to work
based on a the new call-in-rendering-environment infrastructure. this
is a way to give a chance to components to restore their rendering
environment at various situations which includes the execution of
actions and the partial ajax rendering. this makes the action lambdas
behave more like continuations in that their dynamic environment can
be restored when needed (this is mostly a requirement by user code,
but the *current-form* special is also used by ucw).

the ajax rendering seems to work fine, and i'm using it in quite
complex situations.

the former hasn't been made yet, but instead an older form-specific
hackish solution is still in place that restores the rendering time
*current-form* when the actions are executed. this should be fixed
soon, but i need to think a little more about its interaction with
other stuff.

the idea is that if you register an action from inside a form
component wrapper, then it automatically submits the closest wrapping
form when the action is triggered. you can override this with the
forms-to-submit/forms-to-abandon args of the action.

> Commenting it out works for me but i am to un-knowledgeable about
> ucw-ajax to fix what this fixes.
>
>
> furthermore when clicking an ajax link, i'm thrown into the debugger
> with as message:
>  There is no applicable method for the generic function
>   #<STANDARD-GENERIC-FUNCTION IT.BESE.UCW:CALL-IN-RENDERING-ENVIRONMENT

it would be helpful if you could paste which arguments it was tried to
be called with.

> Apparently render-nearest-ajax-component can't find a component which
> is an ajax-component-mixin. Is this a new thing, that to be rendered
> components must be ajax-component-mixin's or am i barking up the wrong
> tree here. FYI all goes well in this area untill the

make sure you are using the proper register-action form. if you use
register-ajax-action, then your component must have an ajax-renderable
component somwhere among its parents. this contract may be broken also
by not updating the parent slot of some components properly.
(:component t option for component slots does that automatically)

> * Added call-in-restored-rendering-environment; renamed to
> call-in-rendering-environment
>
> patch.

but this doesn't sound too good.

looking at the code it could happen when you have a single
ajax-component in the parent chain and it's either the toplevel
component or its parent slot is nil. and an ajax action is triggered
in this situation.

i've pushed a fix that makes ajax rendering more tolerant for this
situation. this may solve the second problem.

hth,

--

-- 
 attila
Marco Baringer | 7 Sep 06:30 2007
Picon

New patches to ucw_ajax: 6-Sep-2007


Thu Sep  6 09:03:55 EDT 2007  attila.lendvai <at> gmail.com
  * fix: make render-nearest-ajax-component more tolerant for toplevel/detached ajax component setups

    M ./src/components/ajax.lisp -5 +6

An updated tarball of ucw_ajax's source can be downloaded here:
http://common-lisp.net/project/ucw/tarballs/ucw_ajax-20070906.tar.gz

Darcsweb URL:
http://uncommon-web.com/darcsweb/darcsweb.cgi?r=ucw_ajax;a=summary
Attila Lendvai | 9 Sep 12:22 2007
Picon

Re: "wrap" attribute in ucw_ajax textarea field

> I found it useful to be able to specify the wrap attribute in textareas in
> my forms.  The attached mini diff seems to work fine for that purpose.
> Maybe the powers that be would like to include it in the official repo.

pushed, thanks.

--

-- 
 attila
Marco Baringer | 10 Sep 06:30 2007
Picon

New patches to ucw_ajax: 9-Sep-2007


Sun Sep  9 05:54:48 EDT 2007  attila.lendvai <at> gmail.com
  * Added wrap for textarea. Patch by Sasha Kovar.

    M ./src/components/form.lisp -2 +4

Sat Sep  8 20:26:33 EDT 2007  attila.lendvai <at> gmail.com
  * add missing cl-ppcre dependency to the asd

    M ./ucw.asd -3 +3

An updated tarball of ucw_ajax's source can be downloaded here:
http://common-lisp.net/project/ucw/tarballs/ucw_ajax-20070909.tar.gz

Darcsweb URL:
http://uncommon-web.com/darcsweb/darcsweb.cgi?r=ucw_ajax;a=summary

Gmane