incubator-esme-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhir...@apache.org
Subject svn commit: r897123 - /incubator/esme/trunk/server/src/main/scala/org/apache/esme/api/RestAPI.scala
Date Fri, 08 Jan 2010 07:39:32 GMT
Author: rhirsch
Date: Fri Jan  8 07:39:31 2010
New Revision: 897123

URL: http://svn.apache.org/viewvc?rev=897123&view=rev
Log:
Fix SendMessagewithToken problem

Modified:
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/api/RestAPI.scala

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/api/RestAPI.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/api/RestAPI.scala?rev=897123&r1=897122&r2=897123&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/api/RestAPI.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/api/RestAPI.scala Fri Jan 
8 07:39:31 2010
@@ -48,8 +48,13 @@
 
 object RestAPI extends XMLApiHelper {
   val logger: Logger = Logger.getLogger("org.apache.esme.api")
+  logger.setLevel(Level.INFO)
 
+  private val fakeSession = new LiftSession("/", "fakeSession", Empty)
+  
+ 
   def dispatch: LiftRules.DispatchPF = {
+    
     case Req("api" :: "status" :: Nil, "", GetRequest) => status
     case Req("api" :: "login" :: Nil, "", PostRequest) => login
     case Req("api" :: "logout" :: Nil, "", GetRequest) => logout
@@ -247,6 +252,7 @@
   }
 
   def login(): LiftResponse = {
+   
     val res: Box[Boolean] = if (User.loggedIn_?) Empty else
     for (token <- S.param("token") ?~ S.?("base_rest_api_err_missing_param", "token");
          auth <- AuthToken.find(By(AuthToken.uniqueId, token))
@@ -292,8 +298,8 @@
   
   def sendMsg(theUser: Box[Long], params: HasParams): LiftResponse = {
     val r: Box[Boolean] =
-    for (user <- theUser ?~ S.?("base_rest_api_err_param_not_found", "User");
-         msg <- params.param("message") ?~ S.?("base_rest_api_err_missing_param", "message"))
+    for (user <- theUser ?~ "User parameter is missing";
+         msg <- params.param("message") ?~ "message parameter is missing")
     yield {
       val from: String = params.param("via") openOr "api"
       val pool = for (poolName <- params.param("pool");



Mime
View raw message