> Can one run more than one weblocks in an instance?
No, but you can run multiple applications (i.e. what you get when
you run DEFWEBAPP) on one Weblocks instance, each with their own
hostname, port and URI prefix.
I think you need to run ENABLE-WEBAPP or something if you define
a webapp after the Weblocks server has been started. Or not, I'd
have to look it up. See also the :AUTOSTART argument to DEFWEBAPP.
Leslie
I hacked the clsql store demo to work with postmodern. I get data in the
grid. But I cant update the data, it looks like the submit button is not
firing. I tried to put breaks in all the places that I thought might
catch the event but I get nothing.
Is there a way to confirm that the button is not firing?
What would be the best way to go about debugging weblocks in general?
Regards
Phil
> I hacked the clsql store demo to work with postmodern. I get data in the
> grid. But I cant update the data, it looks like the submit button is not
> firing. I tried to put breaks in all the places that I thought might
> catch the event but I get nothing.
>
> Is there a way to confirm that the button is not firing?
You can trace handle-client-request to make sure it gets to the server.
> What would be the best way to go about debugging weblocks in general?
I have found tracing on the server side in combination with Firebug on the
client side to be an effective approach.
Leslie
I have a design question.
If you look at the clsql store demo there is a view for the employee
that includes the address and company. They achieve this because there
class has joins defined in it.
I dont have this type of join facility in postmodern's dao object. So I
created a view to display the data in the grid. I also made the edit
view only look at the employee table and not the employee-view. However
if I submit a new emplyee weblocks still thinks it should update the
employee-view (i think because of :data-class slot).
The question I have is how should I handle this in weblocks? Is there a
simple way to do this without rolling a postmodern specific grid
widget?
Or am I missing something?
Regards
Phil
I had a look at the elephant store and then realized that the address
and company can be classes on there own. something that escaped me
previously.
Hopefully it will not be to hair raising to loop throught the slots to
figure out which ones are indeed classes that need to be updated as well
or something in that line. (Updating the required foreign keys might be
only biggest issue.)
I have asked on the postmodern mailing list about something like that
and hopefully they can give me some pointers.
Any advise from this group would also be appreciated.
Once this is done the postmodern store is done. I will let he people on
the postmodern list have a look at the source before I pass it onto this
group.
Background info:
-Using the postmodern store and posmodern demo app:
-The data view displays the mixing values correctly.
-The values are displaid correctly in the edit view.
-I can persist companies and employees with its mixin objects.
-Delete of company works fine.
-Delete of employee does not work because delete-persistent-object is
passed a "blank" object becuase obtain-view-field-value returns a blank
object as far as I can see.
And that ladies and gentleman completest eh posmodern store.
In the following code I get the intial screen which takes me to the
login screen fine. The login screen fires the on-success function and
that function completes successfully but does not replace the the login
widget. What am I doing wrong??
;; Define callback function to initialize new sessions
(defun init-user-session (comp)
(with-flow comp
(yield #'initial-page)
(setf (widget-prefix-fn comp) #'render-header)
(yield (make-instance 'login
:on-login #'authenticate-user
:on-success #'layout-main-page
))))
(defun make-main-page ()
"Lays out the main page. It consists of a FLASH widget for showing
initial message, and a NAVIGATION widget with panes that hold
employees page and companies page."
(make-instance 'composite :widgets
(list
(make-instance 'flash :messages
(list "Welcome to weblocks demo - a
technology demonstration for a
continuations-based web
framework written in Common
Lisp."))
(make-navigation 'main-menu
'employees (make-employees-page)
'companies (make-companies-page)))))
This is a fork of the weblocks-dev repository while it is still under
heavy development. If you clone this repository you will have what you
need to run weblocks(not its dependencies) and the postmodern store.
There is a demo of the postmodern store under the examples directory.
(defview employee-element-form-view (:type form :inherit-from
'(:scaffold employee-element))
(^id :hidep t)
(company-name :present-as (..what must go here for readonly..)
(start-date :reader (compose #'format-date #'start-date))
(end-date :reader (compose #'format-date #'end-date))
)
There's no support for this right now but it's very easy to
implement.
Just add a READ-ONLY slot to class FORM-PRESENTATION and make
the implementations of RENDER-VIEW-FIELD-VALUE honor it by
adding the "disabled" attribute. After this you'll be able
to write
(field :present-as foo :read-only t)
in your view declaration.
For plain text input fields all of this can be done in formview.lisp.
The class for text fields is misnamed^Wcalled INPUT-PRESENTATION.
Leslie
I know it is supposed to be simple to whip up your own widgets and go on
with life but I have this nagging feeling that this would be
re-inventing the wheel.
What I propose is that we create a list of most often requested features
(simple stuff) for exiting widgets, stuff like the readonly for input
boxes etc.
Once we have a list like that agreed on we can ask for contributions
from people that have handled these scenarios in there own code already.
The more knowledgable weblocks hackers could maybe review the list of
contributions and make suggestions or comments that would be needed to
accept it into the dev tree.
We can then all contribute to getting these features cleaned up to go
into the dev.
I feel this way we can make a structured effort to improving the out of
the box usability of weblocks a lot.
What do you think? Is this a good idea?
I'm busy re-inventing or re-hacking some of these wheels. I hope to get to a
point by this weekend to have something that can be called a project to post,
built with Weblocs and GBBopen.
Cheers,
---Venkat.
Heh, you beat me to a wiki... I've just installed Tiki 4.
https://freedom.rayservers.com/
Tiki4 seems to have everything... perhaps we will have something like that in
Weblocks some day.
I've created a category Weblocks. Forums, Blogs, Wikis etc are supported.
The idea of installing this is for multiple projects that improve freedom...
freedom to code in Weblocks/Lisp.
Also, I'm not sure if this list is appropriate for a discussion of the Weblocks
application I am working on... I guess in the early days there will be a bunch
of posts. The name for the project is "Globalisles.net"... a network framework
for web applications in the hostile Web 3.0 environment I expect to see
worldwide. The leaked bill in the US Congress on ISPs enforcing copyright is
scary, idiotic and will encourage projects like the one I am contemplating.
Cheers,
---Venkat.