Weblocks in production

46 views
Skip to first unread message

nunb

unread,
Jun 24, 2010, 10:55:42 PM6/24/10
to weblocks

Thought I'd share a short video of weblocks being used in production.

Annoying commentary version: http://www.youtube.com/watch?v=kZf3-fbZB3Q
Blissfully silent version: http://vimeo.com/12829609

I forgot to add the gridedit search example and a map example, I'll
put up a separate video for that.

Leslie P. Polzer

unread,
Jun 25, 2010, 6:56:55 AM6/25/10
to webl...@googlegroups.com

> Thought I'd share a short video of weblocks being used in production.
>
> Annoying commentary version: http://www.youtube.com/watch?v=kZf3-fbZB3Q
> Blissfully silent version: http://vimeo.com/12829609

Pretty amazing what you did there! I wonder whether you could write
up a short document detailing your experiences as well as what
worked for you and what did not.

So this is fully-enabled production software now?


> I forgot to add the gridedit search example and a map example, I'll
> put up a separate video for that.

Looking forward to it!

Here's another new site using Weblocks: http://www.oddsknockout.com/

Leslie

nunb

unread,
Jun 25, 2010, 11:31:59 AM6/25/10
to weblocks
Errata:

0. I got the videos mixed up. The vimeo's the commentary version and
the youtube is the silent.

1. When I said that in the flash uploader "hunchentoot is not
involved" that is incorrect. I meant that Weblocks is not involved,
instead, a utility fn. sets up a hunchentoot handler.
Leslie modified hunchentoot to deal with the non-standard way the
Adobe Flash UA does multipart mime. The upload button is included in a
very simple way (shown below).

The upload widget is inserted into the form (this snippet is from a
let binding), and everything follows from that. The gray box you see
around upload buttons is because I run SafariBlock,
which blocks flash embeds until they're clicked on by the user.

(upload-button (make-instance 'history-flow-upload
:multi-upload :div-style :upload-handler (curry #'lagru-claim-
trampoline.multiple-uploader a-claim history)
:name "lagru-docupload" :file-types *claim-history-types*
:button-message "Allega" :datatable-container-id "for-yui-table"
:parent-container (dom-id widget)
:claim a-claim :upload-complete-js (make-action-string
(f_%
(mark-dirty documents-widget)))))

The sequence of functions called by the trampoline/uploader is at
paste.lisp.org http://paste.lisp.org/+2EAI

Since the trampoline/uploader is called outside of weblocks, using
something like (authenticatedp) inside the trampoline, or anything
called from it, leads to an error.

2. When I say "nothing is done with javascript" I mean of course, that
the `DSL' we write in does not include javascript, but behind the
scenes javascript is certainly in use. And, using parenscript,
one can easily embed the javascript DSL within lisp anyway.

For example, the delete buttons are created as follows:

(:td :align "center"
(unless (is-state widget :readonly)
(render-icon-link
(f_% (setf (brokr-of (brokerage-of co)) nil)
(mark-dirty widget))
"delete"
"Rimuova intermediario")))

And a clickable number value that turns into an input field:

(:div :class "percentage-value two"
(render-widget
(make-instance 'enter-clicker
:width 1.8 :input-class "percentage-input"
:suffix " %"
:text (premium-%-of brokr)
:clicker-parent widget
:change-fn
(lambda (newtext)
(let ((prem-% (string->currency-number newtext)))
(setf (premium-%-of brokr) prem-%)
(mark-dirty widget)
prem-%)))))

Both the above are from the table titled "Riassunto contabile".

Other than CSS, pretty much everything else is within lisp, and
frankly, though it may be bad practice, adding a :style attribute
inside cl-who/lisp is the fastest and most reliable
way to achieve almost anything CSS related. Next time we're going to
use Haml/Sass or similar for sure.

nunb

unread,
Jun 25, 2010, 11:34:16 AM6/25/10
to weblocks
> So this is fully-enabled production software now?

Yes. A few bits need to be added (UI for shutting down and restarting)
though.

> Here's another new site using Weblocks:http://www.oddsknockout.com/

That's nice! How long did it take to program, and what is the data
feed? (ie, database-backed, http request's that populate data etc.)

Warren Lynn

unread,
Jun 27, 2010, 11:06:47 AM6/27/10
to weblocks
Very impressive work and thanks for sharing.

Do you mind sharing how you implemented those dynamic forms? Namely,
the displaying of different input fields according to the drop down
selection.

For your reference, I asked a similar question before and here is the
thread:
http://groups.google.com/group/weblocks/browse_thread/thread/9322be69b27c08fc

Thanks a lot.

Nandan Bagchee

unread,
Jun 27, 2010, 3:48:18 PM6/27/10
to webl...@googlegroups.com
> Do you mind sharing how you implemented those dynamic forms? Namely,
> the displaying of different input fields according to the drop down
> selection.

We use templated forms. When this was discussed in #weblocks there was some opposition as this was considered "not the right way" to go, although my personal opinion is that since templating is used in almost all other web frameworks, why not make it an option with weblocks?  

Essentially all my forms consist of html fragments where weblocks' defview fields are baked in using standard html-template syntax:

Eg (skipping all the table, div definitions):

  <div id="dann"> 
<label class="desc_nobold">Telefono</label>
<!-- TMPL_VAR complainant-phone --> </td>

Now the defview needs to only contain the field complainant-phone, and using the id "dann" one can hide and show different parts of the form (IOW, do grouping of fields).

In addition, using this mechanism, views can contain other widgets (but it is very kludgey atm).

> For your reference, I asked a similar question before and here is the

In that thread, I said:

 I can't suggest this approach (though it works) because it all depends on using 
templated form views(which is why I can easily identify the divs that need 
to be hidden or shown, something that's hard to do with regular form-views; 
divs also serve as a unit of grouping, grouping is also handled well by the 
wizard-form)  
 
I also posted code to show what the defview looked like.

How much of a hard requirement is hiding/showing of fields for your app? Does wizard form not suffice for the moment? Some others have opted to do the form-handling outside of weblocks, iirc. If that suits you, perhaps you can use something like inputex/yui? 

In our case, we use so many forms that we pretty much chose weblocks for its declarative form handling. Unfortunately the defview syntax didn't cover several common needs, eg grouping of fields, dynamism of various sorts etc. -- our solution is kludgey and unfit for inclusion in weblocks though.

Leslie P. Polzer

unread,
Jun 27, 2010, 4:43:52 PM6/27/10
to webl...@googlegroups.com

Nandan Bagchee wrote:

> We use templated forms. When this was discussed in #weblocks there was some
> opposition as this was considered "not the right way" to go, although my
> personal opinion is that since templating is used in almost all other web
> frameworks, why not make it an option with weblocks?

Not sure about #weblocks, but I've always been in favor of the inclusion
of this template stuff.

It's just that no proper patch has been submitted yet.

Warren Lynn

unread,
Jun 29, 2010, 10:35:48 AM6/29/10
to weblocks
Thanks again for your explanation, and sorry for my ignorance here (I
am no expert on either CL or Web dev):

1. The template will help you generate the form, but still I am
confused how that helps you hide/show the fields according the actions
on another field?
2. Where is this wizard-form? Is it built into weblocks? I could not
find anything about it.

It is not a "hard" requirement for me to have this functionality, but
I just think this is such a common use case and being able to do it
will help make my life a lot easier.

Thanks.

Leslie P. Polzer

unread,
Jun 29, 2010, 12:54:31 PM6/29/10
to webl...@googlegroups.com

Warren Lynn wrote:

> 2. Where is this wizard-form? Is it built into weblocks? I could not
> find anything about it.

Search the group for `wizard' or take a look at src/widgets/wizard.lisp
right away.


> It is not a "hard" requirement for me to have this functionality, but
> I just think this is such a common use case and being able to do it
> will help make my life a lot easier.

Agreed, it would be great to have this functionality built into Weblocks.

Leslie


Leslie P. Polzer

unread,
Jun 29, 2010, 12:57:14 PM6/29/10
to weblocks
On Jun 25, 5:34 pm, nunb <nandan.bagc...@gmail.com> wrote:

> > Here's another new site using Weblocks:http://www.oddsknockout.com/
>
> That's nice! How long did it take to program, and what is the data
> feed? (ie, database-backed, http request's that populate data etc.)

We're using GBBopen as database, Drakma to get RSS feeds and
S-XML to parse them.

The UI took us about one work-intensive month to get to this point
(CSS
guy and me) and the backend a couple of months.

Both are still being worked on heavily.

Leslie

Nandan Bagchee

unread,
Jun 29, 2010, 9:43:00 PM6/29/10
to webl...@googlegroups.com
The UI took us about one work-intensive month to get to this point
(CSS guy and me) and the backend a couple of months.

Both are still being worked on heavily.

Are there plans to do a lot of forms handling in your app?
 

Leslie P. Polzer

unread,
Jun 30, 2010, 4:51:13 AM6/30/10
to webl...@googlegroups.com

Not sure about that yet, maybe. Why do you ask?

Nandan Bagchee

unread,
Jun 30, 2010, 5:07:59 AM6/30/10
to webl...@googlegroups.com

> Are there plans to do a lot of forms handling in your app?

Not sure about that yet, maybe. Why do you ask?

Curiousity :-)

But mostly because iirc you did not use defview and friends for Thanandar, whereas for our project we thought declarative forms handling was a big win, and so used defview extensively.

Leslie P. Polzer

unread,
Jun 30, 2010, 5:15:33 AM6/30/10
to webl...@googlegroups.com

Nandan Bagchee wrote:

> But mostly because iirc you did not use defview and friends for Thanandar,

Oh, I did. DEFVIEW (or some dynamic equivalent of it) is necessary to build
forms in a hassle-free (though as of now not optimal) way.

On the other hand I think they're more hindering than helping when it comes
to table and data views, especially when you need lots of special
annotations there.

Leslie

Nandan Bagchee

unread,
Jun 30, 2010, 9:55:08 AM6/30/10
to webl...@googlegroups.com
> But mostly because iirc you did not use defview and friends for Thanandar,

Oh, I did. DEFVIEW (or some dynamic equivalent of it) is necessary to build
forms in a hassle-free (though as of now not optimal) way.


My bad, I had thought you were using an alternate mechanism.
 
On the other hand I think they're more hindering than helping when it comes
to table and data views, especially when you need lots of special
annotations there.

In what types of tables do you think they're a hindrance? 

As for data-views, in our experience, that was the simplest and most useful use-case, it's the form and tables that needed more massaging for our purposes..

 

Leslie P. Polzer

unread,
Jun 30, 2010, 10:19:51 AM6/30/10
to weblocks
On Jun 30, 3:55 pm, Nandan Bagchee <nandan.bagc...@gmail.com> wrote:

> In what types of tables do you think they're a hindrance?

Ones that require a lot of dynamic stuff, like action links in table
cells
that close over the current object or some other object.

Using defview-anon or manually creating the view/presentation/parser
objects is one way to do it, but it's far more cumbersome than just
writing your own.

Another thing where this is pretty annoying is when you need to add
custom attributes to table cells or rows.

Leslie

Rayservers

unread,
Jun 30, 2010, 11:11:05 AM6/30/10
to webl...@googlegroups.com

The underlying GBBopen platform is being extended for distributed encrypted
persistence with metered main memory and disk storage (nodes sell their
storage), metered messaging (nodes offer to route messages or data), ACID
updates for critical data (99% is not needed to be ACID)... critical data will
never die, digital cash, routing, etc. See various rants I've posted.

The platform (not the customer specific stuff) will be released as open
source... in the meantime, improvements are being posted to Weblocks
and GBBopen.

The platform will enable distributed intelligent agents, p2p anon storage and
messaging, etc. All Web 4.0 thinking. Smart phone apps to giant servers, i.e.
ARM to 64 bit monster machines with blazing main memory searches.

http://freedom.rayservers.com/Web+4.0

We are writing a 100% lisp crypto layer, extending and/or replacing ironclad.

We have some well qualified paid developers, anyone who wants to join in can
join, prove their worth, and get paid to write lisp.

Anyone who wants commercial development of their project on this platform can
get in touch. The project will impact every major field of client-server
thinking, from web to voip to cell phone to email/text messaging to BGP peering
to accounting, to crm and inventory management to money and payment systems, as
well as electronic trading platforms. The project proceeds on commercial demand
so get in touch.

Cheers,

---Venkat.

http://www.rayservers.com/contact

p.s. I sent this earlier, but it never posted. I did it from t-bird...
this time the post is from the gmail interface.

Reply all
Reply to author
Forward
0 new messages