Return-Path: Delivered-To: apmail-incubator-esme-commits-archive@minotaur.apache.org Received: (qmail 12579 invoked from network); 16 Oct 2010 15:30:58 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 16 Oct 2010 15:30:58 -0000 Received: (qmail 20364 invoked by uid 500); 16 Oct 2010 15:30:58 -0000 Delivered-To: apmail-incubator-esme-commits-archive@incubator.apache.org Received: (qmail 20325 invoked by uid 500); 16 Oct 2010 15:30:58 -0000 Mailing-List: contact esme-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: esme-dev@incubator.apache.org Delivered-To: mailing list esme-commits@incubator.apache.org Received: (qmail 20317 invoked by uid 99); 16 Oct 2010 15:30:58 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 16 Oct 2010 15:30:58 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 16 Oct 2010 15:30:57 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id D5E752388993; Sat, 16 Oct 2010 15:30:01 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: esme-commits@incubator.apache.org From: esjewett@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20101016153001.D5E752388993@eris.apache.org> 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 @@ - +