incubator-esme-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From esjew...@apache.org
Subject svn commit: r1023308 - in /incubator/esme/trunk/server/src/main: scala/org/apache/esme/actor/Distributor.scala scala/org/apache/esme/comet/PersonalTimeline.scala scala/org/apache/esme/comet/Timeline.scala webapp/templates-hidden/message.html
Date Sat, 16 Oct 2010 15:30:01 GMT
Author: esjewett
Date: Sat Oct 16 15:30:01 2010
New Revision: 1023308

URL: http://svn.apache.org/viewvc?rev=1023308&view=rev
Log:
[ESME-287] First round of refactoring to set up identically formatted comet timelines for
all message list displays. Partially complete, but passing all tests.

Added:
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/comet/PersonalTimeline.scala
Modified:
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/actor/Distributor.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/comet/Timeline.scala
    incubator/esme/trunk/server/src/main/webapp/templates-hidden/message.html

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/actor/Distributor.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/actor/Distributor.scala?rev=1023308&r1=1023307&r2=1023308&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/actor/Distributor.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/actor/Distributor.scala Sat
Oct 16 15:30:01 2010
@@ -51,9 +51,9 @@ object Distributor extends LiftActor {
         // toact ! UserActor.CreateMessage(text, tags,
         //                                when, metaData, source, inReplyTo, pool)
 		
-		forwardMessageTo(
-			UserActor.CreateMessage(text,tags,when,metaData,source,inReplyTo,pool),
-			toact)
+		    forwardMessageTo(
+			    UserActor.CreateMessage(text,tags,when,metaData,source,inReplyTo,pool),
+			      toact)
 
         toact ! text
 

Added: incubator/esme/trunk/server/src/main/scala/org/apache/esme/comet/PersonalTimeline.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/comet/PersonalTimeline.scala?rev=1023308&view=auto
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/comet/PersonalTimeline.scala
(added)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/comet/PersonalTimeline.scala
Sat Oct 16 15:30:01 2010
@@ -0,0 +1,41 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.esme.comet   
+
+import net.liftweb.common._    
+
+import org.apache.esme._
+import actor.Distributor
+import model._   
+
+class PersonalTimeline extends Timeline { 
+
+  override def localSetup() {
+    super.localSetup()
+    for (user <- User.currentUser) {
+      Distributor ! Distributor.Listen(user.id, this)
+      Distributor !? (2000, Distributor.LatestMessages(user.id, 40)) match {
+        case Full(msg: List[(Long,MailboxReason,Boolean)]) => messages = msg
+        case x =>
+      }
+    }
+  }     
+
+}
\ No newline at end of file

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/comet/Timeline.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/comet/Timeline.scala?rev=1023308&r1=1023307&r2=1023308&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/comet/Timeline.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/comet/Timeline.scala Sat Oct
16 15:30:01 2010
@@ -35,18 +35,11 @@ import lib._
 
 import java.text._
 
-class Timeline extends CometActor {
-  private var messages: List[(Long,MailboxReason,Boolean)] = Nil
+trait Timeline extends CometActor {
+  protected var messages: List[(Long,MailboxReason,Boolean)] = Nil
   
   override def localSetup() {
     super.localSetup()
-    for (user <- User.currentUser) {
-      Distributor ! Distributor.Listen(user.id, this)
-      Distributor !? (2000, Distributor.LatestMessages(user.id, 40)) match {
-        case Full(msg: List[(Long,MailboxReason,Boolean)]) => messages = msg
-        case x =>
-      }
-    }
   }
   
   override def localShutdown() {

Modified: incubator/esme/trunk/server/src/main/webapp/templates-hidden/message.html
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/webapp/templates-hidden/message.html?rev=1023308&r1=1023307&r2=1023308&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/webapp/templates-hidden/message.html (original)
+++ incubator/esme/trunk/server/src/main/webapp/templates-hidden/message.html Sat Oct 16 15:30:01
2010
@@ -101,7 +101,7 @@
 			</div>
 		<lift:UserSnip.resendScript/>
 		<!--updates-box -->
-		<lift:comet type="Timeline"/>
+		<lift:comet type="PersonalTimeline"/>
 		<div id="personal_timeline_messages">
 		
 			<div class="updates-box" id="message">



Mime
View raw message