incubator-esme-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r729762 - in /incubator/esme/trunk/server/src/main/scala: bootstrap/liftweb/ us/esme/actor/ us/esme/api/ us/esme/lib/ us/esme/model/ us/esme/snippet/ us/esme/view/
Date Sun, 28 Dec 2008 19:26:59 GMT
Author: dpp
Date: Sun Dec 28 11:26:58 2008
New Revision: 729762

URL: http://svn.apache.org/viewvc?rev=729762&view=rev
Log:
Keeping up to date with Lift

Modified:
    incubator/esme/trunk/server/src/main/scala/bootstrap/liftweb/Boot.scala
    incubator/esme/trunk/server/src/main/scala/us/esme/actor/Distributor.scala
    incubator/esme/trunk/server/src/main/scala/us/esme/actor/UserActor.scala
    incubator/esme/trunk/server/src/main/scala/us/esme/api/RestAPI.scala
    incubator/esme/trunk/server/src/main/scala/us/esme/lib/MsgFormat.scala
    incubator/esme/trunk/server/src/main/scala/us/esme/lib/MsgParser.scala
    incubator/esme/trunk/server/src/main/scala/us/esme/model/Action.scala
    incubator/esme/trunk/server/src/main/scala/us/esme/model/ExtSession.scala
    incubator/esme/trunk/server/src/main/scala/us/esme/model/Group.scala
    incubator/esme/trunk/server/src/main/scala/us/esme/model/Message.scala
    incubator/esme/trunk/server/src/main/scala/us/esme/model/Tracking.scala
    incubator/esme/trunk/server/src/main/scala/us/esme/model/UrlStore.scala
    incubator/esme/trunk/server/src/main/scala/us/esme/model/User.scala
    incubator/esme/trunk/server/src/main/scala/us/esme/snippet/UserSnip.scala
    incubator/esme/trunk/server/src/main/scala/us/esme/view/ActionView.scala
    incubator/esme/trunk/server/src/main/scala/us/esme/view/UserView.scala

Modified: incubator/esme/trunk/server/src/main/scala/bootstrap/liftweb/Boot.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/bootstrap/liftweb/Boot.scala?rev=729762&r1=729761&r2=729762&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/bootstrap/liftweb/Boot.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/bootstrap/liftweb/Boot.scala Sun Dec 28 11:26:58
2008
@@ -136,7 +136,7 @@
 
 object RequestAnalyzer {
 
-  def analyze(req: Can[Req], time: Long, queries: List[(String, Long)]): Unit = {
+  def analyze(req: Box[Req], time: Long, queries: List[(String, Long)]): Unit = {
     val longQueries = (queries.filter(_._2 > 30))
     if (time > 50 || longQueries.?) {
       Log.info("Request "+req.map(_.uri).openOr("No Request")+
@@ -150,7 +150,7 @@
   private var poolSize = 0
   private val maxPoolSize = 4
   
-  private def createOne: Can[Connection] = try {
+  private def createOne: Box[Connection] = try {
     if (Props.getBool("use_prod_psql", false)) {
       Class.forName("org.postgresql.Driver")
       val dm = DriverManager.
@@ -179,7 +179,7 @@
     case e : Exception => e.printStackTrace; Empty
   }
   
-  def newConnection(name: ConnectionIdentifier): Can[Connection] = synchronized {
+  def newConnection(name: ConnectionIdentifier): Box[Connection] = synchronized {
     pool match {
       case Nil if poolSize < maxPoolSize => val ret = createOne
         poolSize = poolSize + 1

Modified: incubator/esme/trunk/server/src/main/scala/us/esme/actor/Distributor.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/us/esme/actor/Distributor.scala?rev=729762&r1=729761&r2=729762&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/us/esme/actor/Distributor.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/us/esme/actor/Distributor.scala Sun Dec 28
11:26:58 2008
@@ -89,9 +89,9 @@
 
   case class UserCreatedMessage(user: Long, text: String, tags: List[String],
                                 when: Long,
-                                metaData: Can[Elem],
+                                metaData: Box[Elem],
                                 source: String,
-                                replyTo: Can[Long])
+                                replyTo: Box[Long])
   case class AddMessageToMailbox(user: Long, message: Message, reason: MailboxReason)
   case class Listen(user: Long, who: Actor)
   case class Unlisten(user: Long, who: Actor)

Modified: incubator/esme/trunk/server/src/main/scala/us/esme/actor/UserActor.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/us/esme/actor/UserActor.scala?rev=729762&r1=729761&r2=729762&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/us/esme/actor/UserActor.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/us/esme/actor/UserActor.scala Sun Dec 28 11:26:58
2008
@@ -35,9 +35,9 @@
 object UserActor {
   private[actor] case class StartMeUp(user: Long)
   private[actor] case class CreateMessage(text: String, tags: List[String],
-                                          when: Long, metaData: Can[Elem],
+                                          when: Long, metaData: Box[Elem],
                                           source: String,
-                                          replyTo: Can[Long])
+                                          replyTo: Box[Long])
   private[actor] case class AddToMailbox(msg: Message, reason: MailboxReason)
   private[actor] case class Listen(who: Actor)
   private[actor] case class Unlisten(who: Actor)

Modified: incubator/esme/trunk/server/src/main/scala/us/esme/api/RestAPI.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/us/esme/api/RestAPI.scala?rev=729762&r1=729761&r2=729762&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/us/esme/api/RestAPI.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/us/esme/api/RestAPI.scala Sun Dec 28 11:26:58
2008
@@ -93,7 +93,7 @@
       deleteAction _
   }
 
-  def findAction: Can[Action] =
+  def findAction: Box[Action] =
   for (user <- User.currentUser ?~ "Not Logged In";
        id <- S.param("actionid") ?~ "id param not supplied";
        action <- Action.find(By(Action.user, user),
@@ -101,7 +101,7 @@
                              By(Action.removed, false))) yield action
 
   def addAction(): LiftResponse = {
-    val ret: Can[NodeSeq] =
+    val ret: Box[NodeSeq] =
     for (user <- User.currentUser ?~ "Not logged in";
          name <- S.param("name") ?~ "'name' param not supplied";
          test <- S.param("test") ?~ "'test' param not supplied";
@@ -114,7 +114,7 @@
   }
 
   def getActions(): LiftResponse = {
-    val ret: Can[NodeSeq] =
+    val ret: Box[NodeSeq] =
     for (user <- User.currentUser ?~ "Not logged in")
     yield user.performing.flatMap(_.toXml)
 
@@ -122,7 +122,7 @@
   }
 
   def enableAction(): LiftResponse = {
-    val ret: Can[Boolean] =
+    val ret: Box[Boolean] =
     for (action <- findAction;
          enabled <- S.param("enabled").map(toBoolean) ?~ "enabled param not supplied")
     yield action.disabled(!enabled).save
@@ -131,26 +131,26 @@
   }
 
   def deleteAction(): LiftResponse = {
-    val ret: Can[Boolean] =
+    val ret: Box[Boolean] =
     for (action <- findAction) 
     yield action.removed(true).save
     
     ret
   }
   
-  private def calcUser: Can[User] =
+  private def calcUser: Box[User] =
   S.param("user").flatMap(User.findFromWeb) or
   User.currentUser
   
   def getTracking(): LiftResponse = {
-    val ret: Can[NodeSeq] =
+    val ret: Box[NodeSeq] =
     for (user <- User.currentUser ?~ "Not logged in")
     yield Tracking.findAll(By(Tracking.user, user)).flatMap(_.toXml)
     ret
   }
 
   def getConversation(): LiftResponse = {
-    val ret: Can[NodeSeq] =
+    val ret: Box[NodeSeq] =
     for (user <- User.currentUser ?~ "Not logged in";
          id <- S.param("conversationid").map(toLong) ?~ "id param missing"
     ) yield <conversation id={id.toString}>{
@@ -162,7 +162,7 @@
   }
 
   def removeTracking(): LiftResponse = {
-    val ret: Can[Boolean] =
+    val ret: Box[Boolean] =
     for (user <- User.currentUser ?~ "Not logged in";
          id <- S.param("trackid") ?~ "id param missing";
          track <- Tracking.find(By(Tracking.id, id.toLong),
@@ -173,7 +173,7 @@
   }
 
   def addTracking(): LiftResponse = {
-    val ret: Can[Boolean] =
+    val ret: Box[Boolean] =
     for (user <- User.currentUser ?~ "Not logged in";
          toTrack <- (S.param("track") ?~ "No track param") if toTrack.trim.length >
0)
     yield
@@ -184,7 +184,7 @@
 
   def status(): LiftResponse =
   {
-    val ret: Can[NodeSeq] = User.currentUser.map(_.toXml)
+    val ret: Box[NodeSeq] = User.currentUser.map(_.toXml)
     ret
   }
 
@@ -192,22 +192,22 @@
   for (user <- User.findAll) yield user.toXml
 
 
-  def following(muser: Can[User])(): LiftResponse = {
-    val r: Can[NodeSeq] = for (user <- muser) yield
+  def following(muser: Box[User])(): LiftResponse = {
+    val r: Box[NodeSeq] = for (user <- muser) yield
     user.following().map(_.toXml)
     
     r
   }
   
-  def followers(muser: Can[User])(): LiftResponse = {
-    val r: Can[NodeSeq] = for (user <- muser) yield
+  def followers(muser: Box[User])(): LiftResponse = {
+    val r: Box[NodeSeq] = for (user <- muser) yield
     user.followers().map(_.toXml)
     
     r
   }
   
-  def performFollow(userName: Can[String])(): LiftResponse = {
-    val r: Can[Boolean] =
+  def performFollow(userName: Box[String])(): LiftResponse = {
+    val r: Box[Boolean] =
     for (user <- User.currentUser;
          userName <- userName;
          other <- User.findFromWeb(userName)
@@ -216,8 +216,8 @@
     r
   }
   
-  def performUnfollow(userName: Can[String])(): LiftResponse = {
-    val r: Can[Boolean] =
+  def performUnfollow(userName: Box[String])(): LiftResponse = {
+    val r: Box[Boolean] =
     for (user <- User.currentUser;
          userName <- userName;
          other <- User.findFromWeb(userName)
@@ -227,7 +227,7 @@
   }
 
   def login(): LiftResponse = {
-    val res: Can[Boolean] = if (User.loggedIn_?) Empty else
+    val res: Box[Boolean] = if (User.loggedIn_?) Empty else
     for (token <- S.param("token") ?~ "No 'token' param";
          auth <- AuthToken.find(By(AuthToken.uniqueId, token))
          ?~ "Token not found";
@@ -251,7 +251,7 @@
   def waitForMsgs(): LiftResponse = {
     val seq: Long = Helpers.nextNum
 
-    def waitForAnswer: Can[List[(Message, MailboxReason)]] = 
+    def waitForAnswer: Box[List[(Message, MailboxReason)]] = 
     receiveWithin(6L * 60L * 1000L) {
       case (s2, ret: List[(Message, MailboxReason)]) if s2 == seq =>
         Full(ret)
@@ -259,7 +259,7 @@
       case _ => Empty
     }
 
-    var r: Can[NodeSeq] = 
+    var r: Box[NodeSeq] = 
     for (act <- restActor.is ?~ "No REST actor";
          val ignore = act ! ListenFor(self, 5 minutes, seq);
          answer <- waitForAnswer ?~ "Didn't get an answer")
@@ -268,21 +268,21 @@
     r
   }
 
-  def sendMsgWithToken(req: Req): Can[LiftResponse] = {
+  def sendMsgWithToken(req: Req): Box[LiftResponse] = {
     for (token <- req.param("token");
          auth <- AuthToken.find(By(AuthToken.uniqueId, token));
          userId <- auth.user.can;
          ret <- sendMsg(Full(userId), req))  yield ret
   }
   
-  def sendMsg(theUser: Can[Long], params: HasParams): LiftResponse = {
-    val r: Can[Boolean] =
+  def sendMsg(theUser: Box[Long], params: HasParams): LiftResponse = {
+    val r: Box[Boolean] =
     for (user <- theUser ?~ "User not found";
          msg <- params.param("message") ?~ "Message not included")
     yield {
       val from: String = params.param("via") openOr "api"
 
-      val xml: Can[Elem] = params.param("metadata").flatMap(md =>
+      val xml: Box[Elem] = params.param("metadata").flatMap(md =>
         tryo(XML.loadString(md)))
 
       Distributor !
@@ -299,12 +299,12 @@
   }
 
   def getMsgs(): LiftResponse = {
-    val t: Can[NodeSeq] =
+    val t: Box[NodeSeq] =
     for (tagName <- S.param("tag");
          tag <- Tag.find(By(Tag.name, tagName)))
     yield tag.findMessages.map(_.toXml)
         
-    val r: Can[NodeSeq] = 
+    val r: Box[NodeSeq] = 
     t or (for (user <- calcUser ?~ "User not found";
                val lst = Mailbox.mostRecentMessagesFor(user.id, 40))
           yield lst.flatMap{ case (msg, why) => msg.toXml % why.attr})
@@ -317,7 +317,7 @@
     val numTags = (params.param("numTags") openOr "20").toInt
     val numMsgs = 40 //(params.param("numMsgs") openOr "40").toInt
 
-    val r: Can[NodeSeq] = 
+    val r: Box[NodeSeq] = 
     for (user <- calcUser ?~ "User not found";
          val lst = Mailbox.mostRecentMessagesFor(user.id, numMsgs).map(_._1))
     yield
@@ -344,15 +344,15 @@
     ret
   }
 
-  object restActor extends SessionVar[Can[RestActor]](Empty) {
-    override def cleanupFunc: Can[() => Unit] = Full(() => this.is.map(_ ! ByeBye))
+  object restActor extends SessionVar[Box[RestActor]](Empty) {
+    override def cleanupFunc: Box[() => Unit] = Full(() => this.is.map(_ ! ByeBye))
   }
   
 
   class RestActor extends Actor {
     private var userId: Long = _
     private var msgs: List[(Message, MailboxReason)] = Nil
-    private var listener: Can[(Actor, Long)] = Empty
+    private var listener: Box[(Actor, Long)] = Empty
     
     def act = loop {
       react {

Modified: incubator/esme/trunk/server/src/main/scala/us/esme/lib/MsgFormat.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/us/esme/lib/MsgFormat.scala?rev=729762&r1=729761&r2=729762&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/us/esme/lib/MsgFormat.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/us/esme/lib/MsgFormat.scala Sun Dec 28 11:26:58
2008
@@ -32,10 +32,10 @@
 object IsIE7 extends SessionVar[Boolean]({
     // "Firefox/3"
     // "MSIE 7"
-    def findUserAgent(in: List[(String, String)]): Can[String] =
+    def findUserAgent(in: List[(String, String)]): Box[String] =
     in.filter(_._1.equalsIgnoreCase("User-Agent")).map(_._2).firstOption
 
-  val r: Can[Boolean] =
+  val r: Box[Boolean] =
   for (session <- S.session;
        agent <- findUserAgent(session.initialHeaders)) yield
   agent.indexOf("MSIE 7") >= 0
@@ -49,12 +49,12 @@
   formatMsg(in, showReply, showConv, Empty)
 
   def formatMsg(in: Message, showReply: Boolean, showConv: Boolean,
-                inside: Can[() => NodeSeq]): NodeSeq =
+                inside: Box[() => NodeSeq]): NodeSeq =
   <div class="b-list">
     <table>
       <tr>
         <td class="image">{
-            val r: Can[NodeSeq] =
+            val r: Box[NodeSeq] =
             for (user <- in.author.obj;
                  image <- user.image if !IsIE7.is) yield <img src={image} alt={user.niceName}/>
 

Modified: incubator/esme/trunk/server/src/main/scala/us/esme/lib/MsgParser.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/us/esme/lib/MsgParser.scala?rev=729762&r1=729761&r2=729762&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/us/esme/lib/MsgParser.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/us/esme/lib/MsgParser.scala Sun Dec 28 11:26:58
2008
@@ -23,14 +23,14 @@
 import util._
 import mapper._
 import Helpers._
-import net.liftweb.util.{Failure => CanFailure}
+import net.liftweb.util.{Failure => BoxFailure}
 import scala.util.parsing.input.Reader
 import scala.xml.{XML, NodeSeq, Node, Text}
 import us.esme._
 import model._
 
 object MsgParser extends Parsers with ImplicitConversions with CombParserHelpers {
-  def parseMessage(in: String): Can[List[MsgInfo]] = begin(in) match {
+  def parseMessage(in: String): Box[List[MsgInfo]] = begin(in) match {
     case Success(xs, _) => Full(xs)
     case _ => Empty
   }
@@ -174,7 +174,7 @@
 
   lazy val EOF: Parser[Elem] = elem("EOF", isEof _)
 
-  def perform(in: String): Can[Performances] = _perform(in) match {
+  def perform(in: String): Box[Performances] = _perform(in) match {
     case Success(p, _) => Full(p)
     case _ => Empty
   }
@@ -192,7 +192,7 @@
     case name ~ _ ~ value => (name.mkString, value.mkString)
   }
 
-  def testMessage(in: String): Can[TestAction] = _testMessage(in) match {
+  def testMessage(in: String): Box[TestAction] = _testMessage(in) match {
     case Success(ta, _) => Full(ta)
     case _ => Empty
   }
@@ -297,7 +297,7 @@
     case re => StringAction(re.mkString)
   }
 
-  def validRegex(in: String): Can[Regex] = tryo(in.r)
+  def validRegex(in: String): Box[Regex] = tryo(in.r)
 
   lazy val testTag: Parser[TestAction] = whiteSpace ~ '#' ~> rep1(tagChar) <~ whiteSpace
^^ {
     case xs => HashAction(Tag.findOrCreate(xs.mkString).id, xs.mkString)

Modified: incubator/esme/trunk/server/src/main/scala/us/esme/model/Action.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/us/esme/model/Action.scala?rev=729762&r1=729761&r2=729762&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/us/esme/model/Action.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/us/esme/model/Action.scala Sun Dec 28 11:26:58
2008
@@ -147,7 +147,7 @@
   }
   import MsgParser._
 
-  def setTest(in: String): Can[Action] = testExpr(in) match {
+  def setTest(in: String): Box[Action] = testExpr(in) match {
     case Success(v, _) => Full(this.theTest(v.toStr))
     case Failure(m, _) => net.liftweb.util.Failure(m, Empty, Empty)
     case Error(m, _) => net.liftweb.util.Failure(m, Empty, Empty)
@@ -157,7 +157,7 @@
 
   def actionText = theAction.is
   
-  def setAction(in: String): Can[Action] = _perform(in) match {
+  def setAction(in: String): Box[Action] = _perform(in) match {
     case Success(_, _) => Full(this.theAction(in))
     case Failure(m, _) => net.liftweb.util.Failure(m, Empty, Empty)
     case Error(m, _) => net.liftweb.util.Failure(m, Empty, Empty)

Modified: incubator/esme/trunk/server/src/main/scala/us/esme/model/ExtSession.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/us/esme/model/ExtSession.scala?rev=729762&r1=729761&r2=729762&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/us/esme/model/ExtSession.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/us/esme/model/ExtSession.scala Sun Dec 28 11:26:58
2008
@@ -25,7 +25,7 @@
 
   def logUserIdIn(uid: String): Unit = User.logUserIdIn(uid)
 
-  def recoverUserId: Can[String] = User.currentUserId
+  def recoverUserId: Box[String] = User.currentUserId
 
   type UserType = User
 }

Modified: incubator/esme/trunk/server/src/main/scala/us/esme/model/Group.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/us/esme/model/Group.scala?rev=729762&r1=729761&r2=729762&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/us/esme/model/Group.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/us/esme/model/Group.scala Sun Dec 28 11:26:58
2008
@@ -24,7 +24,7 @@
 object Group extends Group with LongKeyedMetaMapper[Group] {
   override def dbTableName = "a_group" // define the DB table name
 
-  def findGroup(name: String): Can[Group] = find(By(this.name, name))
+  def findGroup(name: String): Box[Group] = find(By(this.name, name))
 }
 
 class Group extends LongKeyedMapper[Group] {

Modified: incubator/esme/trunk/server/src/main/scala/us/esme/model/Message.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/us/esme/model/Message.scala?rev=729762&r1=729761&r2=729762&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/us/esme/model/Message.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/us/esme/model/Message.scala Sun Dec 28 11:26:58
2008
@@ -320,7 +320,7 @@
     tags.map(x => x.split(" ").mkString("_")) mkString " "
   }
 
-  def setTextAndTags(in: String, tags: List[Tag], metaData: Can[Elem]): Can[Message] = {
+  def setTextAndTags(in: String, tags: List[Tag], metaData: Box[Elem]): Box[Message] = {
     MsgParser.parseMessage(in).map{
       lst =>
       val xml = <message><body>{

Modified: incubator/esme/trunk/server/src/main/scala/us/esme/model/Tracking.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/us/esme/model/Tracking.scala?rev=729762&r1=729761&r2=729762&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/us/esme/model/Tracking.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/us/esme/model/Tracking.scala Sun Dec 28 11:26:58
2008
@@ -84,7 +84,7 @@
       what(i2)
     }
 
-    def matcher: Can[TrackingMatcher] = {
+    def matcher: Box[TrackingMatcher] = {
       who.can match {
         case Full(whoId) =>
           Full(new PersonTrackingMatcher(id, whoId))

Modified: incubator/esme/trunk/server/src/main/scala/us/esme/model/UrlStore.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/us/esme/model/UrlStore.scala?rev=729762&r1=729761&r2=729762&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/us/esme/model/UrlStore.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/us/esme/model/UrlStore.scala Sun Dec 28 11:26:58
2008
@@ -28,7 +28,7 @@
       serve(id)
   }
 
-  private def serve(id: String)(): Can[LiftResponse] = 
+  private def serve(id: String)(): Box[LiftResponse] = 
   for (url <- find(By(uniqueId, id)))
   yield RedirectResponse(url.url)
 

Modified: incubator/esme/trunk/server/src/main/scala/us/esme/model/User.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/us/esme/model/User.scala?rev=729762&r1=729761&r2=729762&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/us/esme/model/User.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/us/esme/model/User.scala Sun Dec 28 11:26:58
2008
@@ -50,7 +50,7 @@
   }
 
 
-  def findFromWeb(uid: String): Can[User] = 
+  def findFromWeb(uid: String): Box[User] = 
   User.find(By(User.nickname, uid)) or User.find(uid)
 
   override def dbTableName = "users" // define the DB table name
@@ -65,7 +65,7 @@
   /**
    * The menu item for editing the user (make this "Empty" to disable)
    */
-  override def editUserMenuLoc: Can[Menu] =
+  override def editUserMenuLoc: Box[Menu] =
   Full(Menu(Loc("EditUser", editPath, "Profile", testLogginIn)))
   
   
@@ -108,7 +108,7 @@
       )
     }
     
-    def logUserIn(openid: Can[Identifier], fo: Can[VerificationResult], exp: Can[Exception]):
LiftResponse = {
+    def logUserIn(openid: Box[Identifier], fo: Box[VerificationResult], exp: Box[Exception]):
LiftResponse = {
       (openid, exp) match {
         case (Full(id), _) =>
           val user = User.findOrCreate(id.getIdentifier)
@@ -155,7 +155,7 @@
   
   def currentUser = User.currentUser
   
-  def postLogin(id: Can[Identifier],res: VerificationResult): Unit = {
+  def postLogin(id: Box[Identifier],res: VerificationResult): Unit = {
     id match {
       case Full(id) =>
         val user = User.findOrCreate(id.getIdentifier())

Modified: incubator/esme/trunk/server/src/main/scala/us/esme/snippet/UserSnip.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/us/esme/snippet/UserSnip.scala?rev=729762&r1=729761&r2=729762&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/us/esme/snippet/UserSnip.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/us/esme/snippet/UserSnip.scala Sun Dec 28 11:26:58
2008
@@ -34,9 +34,9 @@
 object JsonPoster extends SessionVar(S.buildJsonFunc{
     case JsonCmd("post", _, map: Map[String, Any], _) =>
       for (msgObj <- map.get("msg");
-           msg <- Can.isA(msgObj, classOf[String]).map(_.trim) if msg.length > 0;
+           msg <- Box.isA(msgObj, classOf[String]).map(_.trim) if msg.length > 0;
            tagObj <- map.get("tags");
-           tags <- Can.isA(tagObj, classOf[String]);
+           tags <- Box.isA(tagObj, classOf[String]);
            user <- User.currentUser) {
         
         val replyTo = map.get("reply-to").map(toLong) match {
@@ -79,7 +79,7 @@
   def userFmt(u: User): Node = 
   <li><a href={"/user/"+urlEncode(u.nickname.is)}>{u.niceName}</a> {u.firstName}
{u.lastName}</li>
 
-  def calcUser: Can[User] =
+  def calcUser: Box[User] =
   S.attr("userId").flatMap(s => User.find(toLong(s))) or User.currentUser
 
   def followers(in: NodeSeq): NodeSeq = 

Modified: incubator/esme/trunk/server/src/main/scala/us/esme/view/ActionView.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/us/esme/view/ActionView.scala?rev=729762&r1=729761&r2=729762&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/us/esme/view/ActionView.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/us/esme/view/ActionView.scala Sun Dec 28 11:26:58
2008
@@ -64,7 +64,7 @@
       val toSave = Action.create.name(nameText).user(user)
       DB.use(toSave.connectionIdentifier) {
         ignore =>
-        val act: Can[List[FieldError]] =
+        val act: Box[List[FieldError]] =
         for (a1 <- toSave.setAction(actionText);
              a2 <- a1.setTest(testText))
         yield a2.validate

Modified: incubator/esme/trunk/server/src/main/scala/us/esme/view/UserView.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/us/esme/view/UserView.scala?rev=729762&r1=729761&r2=729762&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/us/esme/view/UserView.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/us/esme/view/UserView.scala Sun Dec 28 11:26:58
2008
@@ -48,8 +48,8 @@
   Menu(Loc("userView", List("user_view", "index"), "View User", Hidden)) ::
   Nil
 
-  implicit def fToO(in: () => NodeSeq): Can[() => NodeSeq] = Full(in)
-  implicit def fToO2(in: Elem): Can[NodeSeq] = Full(in)
+  implicit def fToO(in: () => NodeSeq): Box[() => NodeSeq] = Full(in)
+  implicit def fToO2(in: Elem): Box[NodeSeq] = Full(in)
 
   val dispatch = 
   Map("index" -> index _,
@@ -58,7 +58,7 @@
       "all" -> allUsers _,
       "conversation" -> conversation _)
 
-  def conversation(): Can[NodeSeq] =   {
+  def conversation(): Box[NodeSeq] =   {
     val cid = S.param("cid").map(toLong).openOr(-1L)
 
     val msgs = Message.findAndPrime(By(Message.conversation, cid),
@@ -103,7 +103,7 @@
     </lift:surround>
   }
 
-  def index(): Can[NodeSeq] =
+  def index(): Box[NodeSeq] =
   (<lift:surround with="default" at="content">
       {
         val ui = for (uid <- S.param("uid");
@@ -204,7 +204,7 @@
       }
    </lift:surround>)
   
-  def search(): Can[NodeSeq] =
+  def search(): Box[NodeSeq] =
   for (user <- User.currentUser;
        term <- S.param("term")) yield
   <lift:surround with="default" at="content">
@@ -221,7 +221,7 @@
     </div>
   </lift:surround>
   
-  def displayTag(): Can[NodeSeq] =
+  def displayTag(): Box[NodeSeq] =
   (<lift:surround with="default" at="content">
       {
         val ui = for (tagText <- S.param("tag").map(_.trim);
@@ -243,7 +243,7 @@
       }
    </lift:surround>)
   
-  def allUsers(): Can[NodeSeq] = 
+  def allUsers(): Box[NodeSeq] = 
   <lift:surround with="default" at="content">
     <fieldset>
       <legend>Users</legend>



Mime
View raw message