esme-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vdic...@apache.org
Subject svn commit: r804800 - /incubator/esme/trunk/server/src/main/scala/org/apache/esme/snippet/UserSnip.scala
Date Sun, 16 Aug 2009 22:58:10 GMT
Author: vdichev
Date: Sun Aug 16 22:58:10 2009
New Revision: 804800

URL: http://svn.apache.org/viewvc?rev=804800&view=rev
Log:
Attempt to fix bug where message posting from Web UI stops working after a while.

Modified:
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/snippet/UserSnip.scala

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/snippet/UserSnip.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/snippet/UserSnip.scala?rev=804800&r1=804799&r2=804800&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/snippet/UserSnip.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/snippet/UserSnip.scala Sun
Aug 16 22:58:10 2009
@@ -37,7 +37,8 @@
 
 import scala.xml.{NodeSeq, Text, Node}
 
-object JsonPoster extends SessionVar(S.buildJsonFunc{
+object JsonPoster extends JsonHandler{
+  def apply(in: Any): JsCmd = in match {
     case JsonCmd("post", _, map: Map[String, Any], _) =>
       println("Posting "+map)
       for (msgObj <- map.get("msg");
@@ -66,9 +67,10 @@
 
     case _ => Noop
   }
-)
+}
 
-object JsonResender extends SessionVar(S.buildJsonFunc{
+object JsonResender extends JsonHandler{
+  def apply(in: Any): JsCmd = in match {
     case JsonCmd("resend", _, map: Map[String, Any], _) =>
       for (msgId <- map.get("msg_id").map(toLong);
            user  <- User.currentUser)
@@ -78,7 +80,7 @@
 
     case _ => Noop
   }
-)
+}
 
 class UserSnip extends DispatchSnippet {
   def dispatch: DispatchIt = 
@@ -143,9 +145,9 @@
   
   def postScript(in: NodeSeq): NodeSeq =
   <xml:group>
-    {Script(JsonPoster.is._2)}
+    {Script(JsonPoster.jsCmd)}
     {Script(Function("post_msg", List(),
-                     JsonPoster.is._1("post",
+                     JsonPoster.call("post",
                                       JsObj("msg" -> ValById("textdude"),
                                             "tags" -> ValById("tagdude"),
                                             "access_pool" -> ValById("access_pool"),
@@ -160,9 +162,9 @@
   
   def resendScript(in: NodeSeq): NodeSeq = 
   <xml:group>
-    {Script(JsonResender.is._2)}
+    {Script(JsonResender.jsCmd)}
     {Script(Function("resend_msg", List("msg_id"),
-                     JsonResender.is._1("resend",
+                     JsonResender.call("resend",
                                         JsObj("msg_id" -> JsVar("msg_id")))
         ))
     }



Mime
View raw message