This demonstrates how to build a simple Blog Server in WebVelocity 1.1 in 3 methods and 5 minutes.
This demonstrates how to build a simple Blog Server in WebVelocity 1.1 in 3 methods and 5 minutes. The code for this demonstration is:
PostViewUI
renderActionsOn: html super renderActionsOn: html. html button class: #comment; callback: [self addComment]; with: 'Comment'. addComment | comment | comment := Comment new. (self call: (CommentEditUI on: comment)) ifTrue: [comment bePersistent. object comments add: comment. object commitUnitOfWork]PostListUI
renderDetailsOn: html | sorted | sorted := SortedCollection sortBlock: [:a :b | a created >= b created]. sorted addAll: self objects. sorted do: [:each | html anchor callback: [self call: (PostViewUI on: each)]; with: each title. html text: ' -- ', each created printString. html paragraph: [html text: each content]. html horizontalRule]
If you have trouble viewing that directly, you can click here to download the video directly. If you need the video in a Windows Media format, then download that here.