incubator-esme-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhir...@apache.org
Subject svn commit: r885701 - in /incubator/esme/trunk/server/src/main: resources/ESMEBase.properties scala/org/apache/esme/api/API2.scala scala/org/apache/esme/api/RestAPI.scala scala/org/apache/esme/api/TwitterAPI.scala scala/org/apache/esme/model/User.scala
Date Tue, 01 Dec 2009 09:38:22 GMT
Author: rhirsch
Date: Tue Dec  1 09:38:22 2009
New Revision: 885701

URL: http://svn.apache.org/viewvc?rev=885701&view=rev
Log:
[ESME-40] Static Texts in Resource File

Modified:
    incubator/esme/trunk/server/src/main/resources/ESMEBase.properties
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/api/API2.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/api/RestAPI.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/api/TwitterAPI.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/User.scala

Modified: incubator/esme/trunk/server/src/main/resources/ESMEBase.properties
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/resources/ESMEBase.properties?rev=885701&r1=885700&r2=885701&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/resources/ESMEBase.properties (original)
+++ incubator/esme/trunk/server/src/main/resources/ESMEBase.properties Tue Dec  1 09:38:22
2009
@@ -31,7 +31,7 @@
 
 base_urlstore_err_too_short=The minimum URL length is 3 characters
 
-base_user_msg_change=User %s changed profile.
+base_user_msg_change=User %s changed profile. Name: %s Image: %s
 base_user_msg_login=User %s logged in
 base_user_msg_welcome=Welcome %s
 base_user_ui_signup=Sign Up
@@ -82,6 +82,9 @@
 base_rest_api_err_not_logged_in=User wasn't logged in
 base_rest_api_err_missing_param=The '%s' parameter was missing
 base_rest_api_err_param_not_found=The %s wasn't found
+base_rest_api_err_param_no_tracking=Couldn't find tracking item
+base_rest_api_err_no_answer=Didn't get an answer
+base_rest_api_err_no_rest_actor=No REST actor
 
 base_conv_menu=Conversations
 

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/api/API2.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/api/API2.scala?rev=885701&r1=885700&r2=885701&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/api/API2.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/api/API2.scala Tue Dec  1 09:38:22
2009
@@ -177,9 +177,9 @@
       future.get(60L * 1000L)
 
     val ret: Box[Tuple3[Int,Map[String,String],Box[Elem]]] = 
-      for (act <- restActor.is ?~ "No REST actor";
+      for (act <- restActor.is ?~ S.?("base_rest_api_err_no_rest_actor");
 		   val ignore = act ! ListenFor(future, 0 seconds);
-           answer <- waitForAnswer ?~ "Didn't get an answer")
+           answer <- waitForAnswer ?~ S.?("base_rest_api_err_no_answer"))
       yield (200,Map(),Full(<messages>{answer.flatMap{ case (msg, reason) => msgToXml(msg)
}}</messages>))
 
     val r: Box[Tuple3[Int,Map[String,String],Box[Elem]]] =
@@ -358,7 +358,7 @@
       for (user <- User.currentUser ?~ S.?("base_rest_api_err_not_logged_in");
            id <- trackId ?~ S.?("base_rest_api_err_missing_param", "id");
            track <- Tracking.find(By(Tracking.id, id.toLong),
-                                  By(Tracking.user, user)) ?~ "Couldn't find tracking item")
+                                  By(Tracking.user, user)) ?~ S.?("base_rest_api_err_param_no_tracking"))
       yield {
         track.removed(true).save
         (200,Map(),Empty)

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=885701&r1=885700&r2=885701&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 Tue Dec 
1 09:38:22 2009
@@ -186,7 +186,7 @@
     for (user <- User.currentUser ?~ S.?("base_rest_api_err_not_logged_in");
          id <- S.param("trackid") ?~ S.?("base_rest_api_err_missing_param", "id");
          track <- Tracking.find(By(Tracking.id, id.toLong),
-                                By(Tracking.user, user)) ?~ "Couldn't find tracking item"
+                                By(Tracking.user, user)) ?~ S.?("base_rest_api_err_param_no_tracking")
     ) yield track.removed(true).save
 
     ret
@@ -275,9 +275,9 @@
       future.get(6L * 60L * 1000L)
 
     var r: Box[NodeSeq] = 
-    for (act <- restActor.is ?~ "No REST actor";
+    for (act <- restActor.is ?~ S.?("base_rest_api_err_no_rest_actor");
          val ignore = act ! ListenFor(future, 5 minutes);
-         answer <- waitForAnswer ?~ "Didn't get an answer")
+         answer <- waitForAnswer ?~ S.?("base_rest_api_err_no_answer"))
     yield answer.flatMap{ case (msg, reason) => msg.toXml % reason.attr}
 
     r

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/api/TwitterAPI.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/api/TwitterAPI.scala?rev=885701&r1=885700&r2=885701&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/api/TwitterAPI.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/api/TwitterAPI.scala Tue Dec
 1 09:38:22 2009
@@ -207,7 +207,7 @@
   }
   
   def userTimeline(userName: String): Box[TwitterResponse] = {
-    User.findFromWeb(userName).map(userTimeline) ?~ "User not found"
+    User.findFromWeb(userName).map(userTimeline) ?~ S.?("base_twitter_api_err_user_not_found")
   }
   
   def userTimeline(): Box[TwitterResponse] = {

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/User.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/User.scala?rev=885701&r1=885700&r2=885701&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/User.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/User.scala Tue Dec  1
09:38:22 2009
@@ -60,7 +60,9 @@
     Message.create.author(in.id).
     when(Helpers.timeNow.getTime).
     source("profile").
-    setTextAndTags("User " + in.nickname + " changed profile. Name: " + in.wholeName + ",
Image: " + in.imageUrl, Nil, Empty).
+    
+    setTextAndTags(S.?("base_user_msg_change", in.nickname, in.wholeName, in.imageUrl), Nil,
Empty).
+ //   setTextAndTags("User " + in.nickname + " changed profile. Name: " + in.wholeName +
", Image: " + in.imageUrl, Nil, Empty).
      foreach{ msg =>
       if (msg.save) {
         Distributor ! Distributor.AddMessageToMailbox(in.id, msg, ProfileReason(in.id))



Mime
View raw message