Lift and Cappuccino integration... a first step

43 views
Skip to first unread message

David Pollak

unread,
Sep 3, 2009, 6:10:41 PM9/3/09
to objec...@googlegroups.com, liftweb
Folks,

Hearkening back to my NextStep days, I took a dive into Cappuccino today.  Yep... Obj-J is just like Obj-C and Cappuccino faithfully captures AppKit goodness.

I've integrated Lift with Cappuccino.  The integration points are as follows:
  1. A Lift application serves the Cappuccino application.  This means that one could mix a "web style" Lift based app with a could of "app style" Cappuccino-based application pages.
  2. Cappuccino can initiate calls to Lift via Ajax.  The call from Cap looks like: performAjaxCall([input stringValue]); where there's been a binding a Lift JSON message handler to the performAjaxCall function.  The binding looks like:
    Script(
        Function("performAjaxCall", List("param"), JsonVar.is._1("hello", JsVar("param"))) &
        JsonVar.is._2)
  3. Lift can initiate calls into a Cappuccino app via Lift's Comet support.  Here's the Lift code that's necessary to create a clock that ticks every 3 seconds in the Cap app:
      override def highPriority = {
        case 'Ping =>
          partialUpdate(currentTime)
          ActorPing.schedule(this, 'Ping , 3 seconds)
      }

      def currentTime: JsCmd = JsRaw("clockCallback("+(""+now).encJs+");")
    Plus the following line that must appear in the page that contains the Cap app:
    <lift:comet type="Clock"/>
A running version of the Lift/Cappuccino integrated app can be found at http://frothy.liftweb.net/

The source can be found at http://github.com/dpp/Frothy/tree/master  (please don't laugh at/vomit on my ObjJ code... it's been 15 years since I did ObjC).

Thanks,

David

--
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Git some: http://github.com/dpp

jkleiser

unread,
Sep 4, 2009, 11:07:46 AM9/4/09
to Cappuccino & Objective-J
Very interesting David! I've found the clean looking application like
style of Cappuccino very attractive, but I've been worried by the very
low Blog and News activity for Cappuccino the last months. Did
somebody get a flat tire?
/Jon

On Sep 4, 12:10 am, David Pollak <feeder.of.the.be...@gmail.com>
wrote:
> Folks,
>
> Hearkening back to my NextStep days, I took a dive into Cappuccino today.
> Yep... Obj-J is just like Obj-C and Cappuccino faithfully captures AppKit
> goodness.
>
> I've integrated Lift with Cappuccino.  The integration points are as
> follows:
>
>    1. A Lift application serves the Cappuccino application.  This means that
>    one could mix a "web style" Lift based app with a could of "app style"
>    Cappuccino-based application pages.
>    2. Cappuccino can initiate calls to Lift via Ajax.  The call from Cap
>    looks like: performAjaxCall([input stringValue]); where there's been a
>    binding a Lift JSON message handler to the performAjaxCall function.  The
>    binding looks like:
>    Script(
>        Function("performAjaxCall", List("param"), JsonVar.is._1("hello",
>    JsVar("param"))) &
>        JsonVar.is._2)
>    3. Lift can initiate calls into a Cappuccino app via Lift's Comet
>    support.  Here's the Lift code that's necessary to create a clock that ticks
>    every 3 seconds in the Cap app:
>      override def highPriority = {
>        case 'Ping =>
>          partialUpdate(currentTime)
>          ActorPing.schedule(this, 'Ping , 3 seconds)
>      }
>
>      def currentTime: JsCmd = JsRaw("clockCallback("+(""+now).encJs+");")
>    Plus the following line that must appear in the page that contains the
>    Cap app:
>    <lift:comet type="Clock"/>
>
> A running version of the Lift/Cappuccino integrated app can be found athttp://frothy.liftweb.net/
>
> The source can be found athttp://github.com/dpp/Frothy/tree/master (please
> don't laugh at/vomit on my ObjJ code... it's been 15 years since I did
> ObjC).
>
> Thanks,
>
> David
>
> --
> Lift, the simply functional web frameworkhttp://liftweb.net
> Beginning Scalahttp://www.apress.com/book/view/1430219890

Jay

unread,
Sep 4, 2009, 1:59:03 PM9/4/09
to Cappuccino & Objective-J
I think everyone's just heads down writing code. Lots of things have
improved recently, notably a brand new CPTableView among other things.

Just my observations though, fwiw...

jay

Brad Hutchins

unread,
Sep 4, 2009, 2:15:54 PM9/4/09
to objec...@googlegroups.com
As is mine.  I mean they are re-implementing entire libraries, testing performance, transfer changes over to Atlas to see if it breaks, working on Atlas. 

At this time I would like to point out FOWA 2009 London (which 280 North went to last year) in 26 days.  And most likely they want to have "X" amount done before going.  With hopefully an announcement for an Atlas Beta program.

So As time bears down on them they have to keep at it.

Howard Lewis Ship

unread,
Sep 4, 2009, 6:43:42 PM9/4/09
to objec...@googlegroups.com
I'm doing a talk on Cappuccino at NFJS Seattle this month; I'm far from an expert but I have a dusty memory of AppKit coding (from around 95) so it's gradually coming back.

I hope that Atlas comes along soon, it's a key missing piece for Cappuccino.
--
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to learn how I can get you up and productive in Tapestry fast!

Jérôme Denanot

unread,
Sep 9, 2009, 6:26:33 AM9/9/09
to objec...@googlegroups.com
I found that link ;-)

http://events.carsonified.com/fowa/2009/london/schedule

Then, comming October, 1, 12am !

"Trust us, it's going to blow your mind :)"

2009/9/5 Howard Lewis Ship <hls...@gmail.com>
Reply all
Reply to author
Forward
0 new messages