lift

How do I idiomatically handle null checks from within Scala/Lift ?

Even with the prevalence of the Box and Option monads, we still have to check for null values here and there. The best I've come up with so far is by using the Box#!! method: (Box !! possiblyNull).map(_.toString).openOr("") Is there a better way to do this? I tried using Box's apply method: Box(possiblyNull).map(_.toString).openOr("...

scala lift actor, error: type mismatch;

Greetings I'm using the scala version 2.8.0 and version 2.1 of lift to compile my project with maven I mark the following error: error: type mismatch; [INFO] required: **scala.actors.Actor** [INFO] Auctioneer !? AddListener(**this**, this.itemId) match { [INFO] ^ error: type mismatch; [INFO] requ...

error: not found: value Auctioneer (LiftActor)

Greetings I have the following class package org.developerworks.comet import net.liftweb.http._ import net.liftweb.common.Full import net.liftweb.http.S._ import net.liftweb.http.SHtml._ import net.liftweb.http.js.JsCmd import net.liftweb.http.js.JsCmds._ import net.liftweb.http.js.JE._ import net.liftweb.util.Helpers._ import net.lif...

Lift mapper afterCreate before afterSave

Hi, do you know why afterCreate methods are not invoked after creating the object? Look at this code: val c = Company.create println(">>> After create") c.save Which produces: c: com.subeli.officebook.model.Company = 0 >>> After create create packages create packages save packages The Company model looks like this: object Company...

Scala Lift: How to wrap REST responses into an XML root element?

Hi, I'm doing a project to test Scala and Lift at my company, atm I'm implementing a REST API that shoves XML around. I saw that there is an XMLApiHelper that offers the createTag method that encapsulates the responses in a root element. So I did this object RestAPI extends RestHelper with XMLApiHelper { serve { … } … def ...

How do I convert Array[Node] to NodeSeq?

I'm trying to integrate a Lift application into some existing Java code. In one of my snippets, I have an Array of Java objects that I need to map that into a NodeSeq. I can get an Array of Node's, but not a NodeSeq. (At least, not in very functional-looking way). import scala.xml.NodeSeq // pretend this is code I can't do anything ...