You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@esme.apache.org by es...@apache.org on 2010/11/17 23:46:33 UTC
svn commit: r1036266 - in /incubator/esme/trunk/server/src/main:
scala/org/apache/esme/comet/ scala/org/apache/esme/lib/
scala/org/apache/esme/snippet/ webapp/info_view/ webapp/scripts/
webapp/templates-hidden/
Author: esjewett
Date: Wed Nov 17 22:46:32 2010
New Revision: 1036266
URL: http://svn.apache.org/viewvc?rev=1036266&view=rev
Log:
[ESME-287] [ESME-289] Update stream display to use standard timeline format and to use comet updates(for real-time streams). No real-time updates for resent filter type. Moved most of the snippet code from lib/StreamMgr.scala to snippets/StreamDisplay.scala.
Added:
incubator/esme/trunk/server/src/main/scala/org/apache/esme/comet/StreamTimeline.scala
incubator/esme/trunk/server/src/main/scala/org/apache/esme/snippet/StreamDisplay.scala
incubator/esme/trunk/server/src/main/webapp/templates-hidden/timeline_stream.html
Removed:
incubator/esme/trunk/server/src/main/webapp/scripts/esme_streams.js
Modified:
incubator/esme/trunk/server/src/main/scala/org/apache/esme/comet/PublicTimeline.scala
incubator/esme/trunk/server/src/main/scala/org/apache/esme/comet/TagTimeline.scala
incubator/esme/trunk/server/src/main/scala/org/apache/esme/comet/Timeline.scala
incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/StreamMgr.scala
incubator/esme/trunk/server/src/main/webapp/info_view/streams.html
incubator/esme/trunk/server/src/main/webapp/scripts/display_messages_top.js
incubator/esme/trunk/server/src/main/webapp/templates-hidden/message_core.html
Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/comet/PublicTimeline.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/comet/PublicTimeline.scala?rev=1036266&r1=1036265&r2=1036266&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/comet/PublicTimeline.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/comet/PublicTimeline.scala Wed Nov 17 22:46:32 2010
@@ -36,17 +36,19 @@ import lib._
import java.text._
-class PublicTimeline extends CometActor {
- private var messages: List[Long] = Nil
- private var lastRender = millis
- private var scheduled = false
+class PublicTimeline extends Timeline {
+
+ val jsId = "public_timeline_messages"
+
+ protected var lastRender = millis
+ protected var scheduled = false
override def localSetup() {
super.localSetup()
Distributor ! Distributor.PublicTimelineListeners(this)
messages = Message.findAll(By(Message.pool, Empty),
OrderBy(Message.id, Descending),
- MaxRows(40)).map(_.id.is)
+ MaxRows(40)).map( m => (m.id.is, NoReason, false))
}
override def localShutdown() {
@@ -54,16 +56,11 @@ class PublicTimeline extends CometActor
Distributor ! Distributor.PublicTimelineUnlisteners(this)
}
- def render = {
+ override def render = {
lastRender = millis
- scheduled = false
- val msgMap = Message.findMessages(messages)
- val toDisplay = messages.flatMap(msgMap.get)
- val jsId = "public_timeline_messages";
-
- OnLoad(JsCrVar(jsId, JsArray(
- toDisplay.map(m => JsObj(("message", m.asJs)) ) :_*)) &
- JsFunc("displayMessages", JsVar(jsId), jsId).cmd)
+ scheduled = false
+
+ super.render
}
override def lowPriority = {
@@ -72,7 +69,7 @@ class PublicTimeline extends CometActor
case Distributor.NewMessage(msg) =>
if (!msg.pool.defined_?)
- messages = (msg.id.is :: messages).take(40)
+ messages = ((msg.id.is, NoReason, false) :: messages).take(40)
if ((millis - lastRender) < 30000L) {
if (!scheduled) {
Added: incubator/esme/trunk/server/src/main/scala/org/apache/esme/comet/StreamTimeline.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/comet/StreamTimeline.scala?rev=1036266&view=auto
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/comet/StreamTimeline.scala (added)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/comet/StreamTimeline.scala Wed Nov 17 22:46:32 2010
@@ -0,0 +1,184 @@
+/**
+ * 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 net.liftweb.mapper._
+import net.liftweb.http._
+import net.liftweb.util.ActorPing
+import net.liftweb.util.Helpers._
+import scala.xml._
+
+import js._
+import JsCmds._
+import JE._
+
+import org.apache.esme._
+import actor.{Distributor}
+import model._
+
+class StreamTimeline extends PublicTimeline {
+
+ var currentResender = StreamTimeline.AnyResender
+ var currentPool = StreamTimeline.PublicPool
+ var filterResender = false
+ var filterPool = false
+
+ override def localSetup() {
+ super.localSetup()
+ StreamTimeline.register(this)
+ }
+
+ override def localShutdown() {
+ super.localShutdown()
+ StreamTimeline.unregister(this)
+ }
+
+ override val jsId = "stream_timeline_messages"
+
+ override def lifespan = Full(TimeSpan(300000))
+
+ override def highPriority = {
+ case SetPool(pool) => {
+ pool match {
+ case p:AccessPool => currentPool = p.id.is
+ case _ => currentPool = StreamTimeline.PublicPool
+ }
+
+ if(filterPool) {
+ messages = getMessages
+ clearMessages = true
+ this ! ForceRender
+ }
+ }
+
+ case SetResender(user) => {
+ user match {
+ case u:User => currentResender = u.id.is
+ case _ => currentResender = StreamTimeline.AnyResender
+ }
+
+ if(filterResender) {
+ messages = getMessages
+ clearMessages = true
+ this ! ForceRender
+ }
+ }
+
+ case FilterPool(on) => {
+ filterPool = on
+ messages = getMessages
+ clearMessages = true
+ this ! ForceRender
+ }
+
+ case FilterResender(on) => {
+ filterResender = on
+ messages = getMessages
+ clearMessages = true
+ this ! ForceRender
+ }
+ }
+
+ override def lowPriority = {
+ case ForceRender =>
+ reRender(false)
+
+ case Distributor.NewMessage(msg) =>
+
+ // If we are filtering on pools, only take the message if it is in
+ // the pool currently in the filter.
+ //
+ // Unfortunately we don't currently have a way to filter incoming
+ // messages based on resender. So if the resender filter is checked
+ // we just drop all messages.
+
+ if (
+ ((filterPool && msg.pool == currentPool) || !filterPool) &&
+ !filterResender
+ )
+ messages = ((msg.id.is, NoReason, false) :: messages).take(40)
+
+ if ((millis - lastRender) < 30000L) {
+ if (!scheduled) {
+ scheduled = true
+ ActorPing.schedule(this, ForceRender, 30000L)
+ }
+ }
+ else reRender(false)
+ }
+
+ def getMessages:List[(Long,MailboxReason,Boolean)] = {
+
+ val AnyResender = User.id.defaultValue
+ val PublicPool = AccessPool.id.defaultValue
+
+ val user = User.currentUser
+
+ val resentQuery =
+ if (filterResender == false) Nil
+ else {
+ val queryParam = currentResender match {
+ case AnyResender => NotBy(Mailbox.resentBy, Empty)
+ case id => By(Mailbox.resentBy, id)
+ }
+ List(In(Message.id,Mailbox.message,By(Mailbox.user, user), queryParam))
+ }
+
+ val poolsQuery =
+ if (filterPool == false) Nil
+ else List(currentPool match {
+ case PublicPool => By(Message.pool, Empty)
+ case id => By(Message.pool, id)
+ })
+
+ val query = poolsQuery :::
+ resentQuery :::
+ List[QueryParam[Message]](OrderBy(Message.id, Descending), MaxRows(40))
+
+ Message.findAll(query: _*).map( m =>
+ (m.id.is, NoReason, false)
+ )
+ }
+}
+
+object StreamTimeline {
+ val AnyResender = User.id.defaultValue
+ val PublicPool = AccessPool.id.defaultValue
+
+ private var timelines:Map[Box[String],StreamTimeline] = Map()
+
+ def register(timeline:StreamTimeline) {
+ timelines = timelines + (timeline.name -> timeline)
+ }
+
+ def unregister(timeline:StreamTimeline) {
+ timelines = timelines - timeline.name
+ }
+
+ def find(name:String):Box[StreamTimeline] = {
+ timelines.get(Full(name))
+ }
+}
+
+case class SetPool(pool:Any)
+case class SetResender(user:Any)
+case class FilterPool(on:Boolean)
+case class FilterResender(on:Boolean)
\ No newline at end of file
Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/comet/TagTimeline.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/comet/TagTimeline.scala?rev=1036266&r1=1036265&r2=1036266&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/comet/TagTimeline.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/comet/TagTimeline.scala Wed Nov 17 22:46:32 2010
@@ -39,7 +39,7 @@ class TagTimeline extends Timeline {
for(t <- tag) {
Distributor ! Distributor.ListenObject(t, this)
- messages = t.findMessages().map(m => (m.id.is, NoReason, false)).take(40)
+ messages = t.findMessages().take(40).map(m => (m.id.is, NoReason, false))
}
}
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=1036266&r1=1036265&r2=1036266&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 Wed Nov 17 22:46:32 2010
@@ -36,10 +36,13 @@ import lib._
import java.text._
trait Timeline extends CometActor {
- protected var messages: List[(Long,MailboxReason,Boolean)] = Nil
- protected val jsId: String
+ protected var messages: List[(Long,MailboxReason,Boolean)] = Nil
+ protected var clearMessages: Boolean = false
+ protected val jsId: String
- override def localSetup() {
+ override def defaultPrefix = Full("timeline")
+
+ override def localSetup() {
super.localSetup()
}
@@ -49,15 +52,30 @@ trait Timeline extends CometActor {
def render = {
val msgMap = Message.findMessages(messages map {_._1})
- val toDisplay =
- for ((id, reason, resent) <- messages;
- msg <- msgMap.get(id))
- yield (msg, reason, resent)
+ val toDisplay = for ((id, reason, resent) <- messages;
+ msg <- msgMap.get(id))
+ yield (msg, reason, resent)
+
+ // Only clear messages if someone has demanded a complete reset by setting the flag
+ def clearFunc:JsCmd = if(clearMessages) {
+ clearMessages = false
+ JsFunc("clearMessages", jsId).cmd
+ } else {
+ Run("")
+ }
- OnLoad(JsCrVar(jsId, JsArray(
- toDisplay.map{case (msg, reason, resent) =>
+ OnLoad(
+ clearFunc &
+ JsCrVar(jsId, JsArray(
+ filter(toDisplay).map{case (msg, reason, resent) =>
JsObj(("message",msg.asJs),("reason",reason.asJs), ("resent",resent))
} :_*)) &
- JsFunc("displayMessages", JsVar(jsId), jsId).cmd)
+ JsFunc("displayMessages", JsVar(jsId), jsId).cmd
+ )
+ }
+
+ // If we need to filter out some messages on display, override this method.
+ def filter(msgs:List[(Message,MailboxReason,Boolean)]):List[(Message,MailboxReason,Boolean)] = {
+ msgs
}
}
Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/StreamMgr.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/StreamMgr.scala?rev=1036266&r1=1036265&r2=1036266&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/StreamMgr.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/StreamMgr.scala Wed Nov 17 22:46:32 2010
@@ -18,7 +18,9 @@
*/
package org.apache.esme.lib
-import java.text.SimpleDateFormat
+import java.text.SimpleDateFormat
+
+import org.apache.esme.liftwebext.SHtml._
import net.liftweb._
import http._
@@ -39,16 +41,16 @@ import util._
import common._
import Helpers._
-import model._
+import model._
+import snippet.StreamDisplay
import scala.xml._
/**
* Manage the sitemap and related snippets for Streams
- */
+ */
+
object StreamMgr {
- val AnyResender = User.id.defaultValue
- val PublicPool = AccessPool.id.defaultValue
def loggedIn_? = User.loggedIn_?
@@ -56,165 +58,7 @@ object StreamMgr {
val menuItems =
Menu(Loc("streams", List("info_view", "streams"), S.?("base_streams_menu"), ifIsLoggedIn,
- Loc.Snippet("displayStream", displayStream),
- Loc.Snippet("streamFilters", streamFilters))) ::
+ Loc.Snippet("stream_display", StreamDisplay.display))) ::
Nil
- object updateStream extends RequestVar[() => JsCmd](() => Noop)
- object resenderId extends RequestVar[Long](AnyResender)
- object filterResent_? extends RequestVar[Boolean](false)
- object poolId extends RequestVar[Long](PublicPool)
- object filterPools_? extends RequestVar[Boolean](false)
- object spanName extends RequestVar[String]("StreamSpan")
- object displayStreamNodes extends RequestVar[NodeSeq](Text(""))
-
- def updateSpan(): JsCmd = SetHtml(spanName, doRender(displayStreamNodes))
-
- // bind the dynamic content to the incoming nodeseq
- def doRender(in: NodeSeq): NodeSeq = {
- // get the current user
- val user = User.currentUser
-
- val resentQuery =
- if (filterResent_?.is == false) Nil
- else {
- val queryParam = resenderId.is match {
- case AnyResender => NotBy(Mailbox.resentBy, Empty)
- case id => By(Mailbox.resentBy, id)
- }
- List(In(Message.id,Mailbox.message,By(Mailbox.user, user), queryParam))
- }
-
- val poolsQuery =
- if (filterPools_?.is == false) Nil
- else List(poolId.is match {
- case PublicPool => By(Message.pool, Empty)
- case id => By(Message.pool, id)
- })
-
- val query = poolsQuery :::
- resentQuery :::
- List[QueryParam[Message]](OrderBy(Message.id, Descending), MaxRows(10))
-
- def profileImage(u: User): NodeSeq = {
- var imageUrl = u.imageUrl.toString
- if (imageUrl.length > 0)
- <img width="30px" src={imageUrl}/>
- else
- <img width="30px" src="/images/avatar.jpg"/>
- }
-
- //XXX copy from lib.UserMgr
- def nicknameWithProfileLink(u: User): NodeSeq = {
- <a href={"/user/" + urlEncode(u.nickname.is)}>{u.niceName}</a>
- }
-
- val dateFormatter = new SimpleDateFormat("yyyy/MM/dd HH:mm")
-
-
- Message.findAll(query: _*) match {
- case Nil => NodeSeq.Empty
- case xs => bind("disp", in,
- "item" ->
- (lst => xs.flatMap(i => bind("item", lst,
- "author" -> i.author.obj.map(nicknameWithProfileLink).openOr(Text("")),
- "imageUrl" -> i.author.obj.map(profileImage).openOr(Text("")),
- "text" -> i.getBody,
- "date" -> dateFormatter.format(i.getWhen)
- ))))
- }
- }
-
-
- def displayStream(in: NodeSeq): NodeSeq = {
-
- updateStream.set(updateSpan)
- displayStreamNodes.set(in)
-
- doRender(in)
- }
-
- def streamFilters(in: NodeSeq): NodeSeq = {
-
- import org.apache.esme.model.AccessPool
- import net.liftweb.common.Empty
- val resenderInput = "resender_input"
- val poolInput = "pool_input"
- val filterResentInput = "filter_resent_input"
- val filterPoolsInput = "filter_pools_input"
- val user = User.currentUser
-
- var resender = AnyResender
- var pool = PublicPool
- var filterResent = false
- var filterPools = false
-
- val following = (AnyResender.toString, S.?("base_streams_resend_any")) ::
- (user match {
- case Full(u) => u.following.map(u => (u.id.is.toString, u.nickname.is) )
- case _ => Nil
- })
-
- val pools = (PublicPool.toString, S.?("base_streams_pool_default")) ::
- (user match {
- case Full(u)=> Privilege.findViewablePools(u.id).map(
- p => (p.toString, AccessPool.find(p).get.getName)).toList
- case _ => Nil
- })
-
- def redisplay(): JsCmd = {
- resenderId.set(resender)
- poolId.set(pool)
- filterResent_?.set(filterResent)
- filterPools_?.set(filterPools)
- updateStream()
- }
-
- /*
- bind("main", in,
- "resent" -> ajaxSelect(following,
- Empty,
- u => {resender = u.toLong
- redisplay()},
- "id" -> resenderInput),
- "pools" -> ajaxSelect(pools,
- Empty,
- p => {pool = p.toLong
- redisplay()},
- "id" -> poolInput),
- "filterResent" -> ajaxCheckbox(false,
- r_? => {filterResent = r_?
- redisplay()},
- "id" -> filterResentInput),
- "filterPools" -> ajaxCheckbox(false,
- p_? => {filterPools = p_?
- redisplay()},
- "id" -> filterPoolsInput)
- )
- */
-
- import org.apache.esme.liftwebext.SHtml._
- bind("main", in,
- "resent" -> ajaxSortedSelect(following,
- true,
- Empty,
- u => {resender = u.toLong
- redisplay()},
- "id" -> resenderInput),
- "pools" -> ajaxSortedSelect(pools,
- true,
- Empty,
- p => {pool = p.toLong
- redisplay()},
- "id" -> poolInput),
- "filterResent" -> ajaxCheckbox(false,
- r_? => {filterResent = r_?
- redisplay()},
- "id" -> filterResentInput),
- "filterPools" -> ajaxCheckbox(false,
- p_? => {filterPools = p_?
- redisplay()},
- "id" -> filterPoolsInput)
- )
- }
}
Added: incubator/esme/trunk/server/src/main/scala/org/apache/esme/snippet/StreamDisplay.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/snippet/StreamDisplay.scala?rev=1036266&view=auto
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/snippet/StreamDisplay.scala (added)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/snippet/StreamDisplay.scala Wed Nov 17 22:46:32 2010
@@ -0,0 +1,124 @@
+/**
+ * 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.snippet
+
+import org.apache.esme.liftwebext.SHtml._
+
+import org.apache.esme._
+import model._
+import lib.MessageUtils
+import org.apache.esme.actor._
+import org.apache.esme.comet._
+
+import net.liftweb._
+import http._
+import js._
+import js.jquery._
+import http.jquery._
+import JqJsCmds._
+import JsCmds._
+import SHtml._
+import JE._
+import util._
+import common._
+import Helpers._
+
+import mapper._
+
+import scala.xml.{NodeSeq, Text}
+import java.util.Date
+
+object StreamDisplay {
+
+ val AnyResender = User.id.defaultValue
+ val PublicPool = AccessPool.id.defaultValue
+
+ val resenderInput = "resender_input"
+ val poolInput = "pool_input"
+ val filterResentInput = "filter_resent_input"
+ val filterPoolsInput = "filter_pools_input"
+
+ val following = (AnyResender.toString, S.?("base_streams_resend_any")) ::
+ (User.currentUser match {
+ case Full(u) => u.following.map(u => (u.id.is.toString, u.nickname.is) )
+ case _ => Nil
+ })
+
+ val pools = (PublicPool.toString, S.?("base_streams_pool_default")) ::
+ (User.currentUser match {
+ case Full(u)=> Privilege.findViewablePools(u.id).map(
+ p => (p.toString, AccessPool.find(p).get.getName)).toList
+ case _ => Nil
+ })
+
+ def display(in: NodeSeq): NodeSeq = {
+
+ val name = randomString(20)
+
+ def cometTimeline:NodeSeq = <lift:comet type="StreamTimeline" name={ name } />
+
+ lazy val timelineActor = StreamTimeline.find(name)
+
+ bind("stream", in,
+ "cometTimeline" -> cometTimeline,
+
+ "resent" -> ajaxSortedSelect(following, true, Empty,
+ u => {
+ for {
+ ta <- timelineActor
+ } {
+ ta ! SetResender(User.find(u.toLong).openOr(AnyResender))
+ }
+ Run("")
+ },
+ "id" -> resenderInput),
+
+ "pools" -> ajaxSortedSelect(pools, true, Empty,
+ p => {
+ for {
+ ta <- timelineActor
+ } {
+ ta ! SetPool(AccessPool.find(p).openOr(PublicPool))
+ }
+
+ Run("")
+ },
+ "id" -> poolInput),
+
+ "filterResent" -> ajaxCheckbox(false,
+ r_? => {
+ for(ta <- timelineActor) {
+ ta ! FilterResender(r_?)
+ }
+ Run("")
+ },
+ "id" -> filterResentInput),
+
+ "filterPools" -> ajaxCheckbox(false,
+ p_? => {
+ for(ta <- timelineActor) {
+ ta ! FilterPool(p_?)
+ }
+ Run("")
+ },
+ "id" -> filterPoolsInput)
+ )
+ }
+}
Modified: incubator/esme/trunk/server/src/main/webapp/info_view/streams.html
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/webapp/info_view/streams.html?rev=1036266&r1=1036265&r2=1036266&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/webapp/info_view/streams.html (original)
+++ incubator/esme/trunk/server/src/main/webapp/info_view/streams.html Wed Nov 17 22:46:32 2010
@@ -18,62 +18,41 @@
-->
<lift:surround with="base" at="left">
<link rel="stylesheet" type="text/css" href="../style/style.css"/>
- <lift:TableSorterSnip/>
- <div id="back-header">
- <h1><b><lift:loc>ui_streams_manage</lift:loc></b></h1>
-
- <!---CONTENT BOX-->
- <div class="container-streams">
- <div class="StreamUI">
- <lift:streamFilters>
- <table class="tablesorter" >
- <thead>
- <tr>
- <th class="tipelement" title="These are users that you follow">
- <lift:loc>ui_streams_filter_resender</lift:loc> <main:resent/>
- </th>
- <th align="center" class="tipelement" title="Filter by messages that have been resent by those you follow. ">
- <lift:loc>ui_streams_resent_active</lift:loc> <main:filterResent/>
- </th>
- <th class="tipelement" title="These are pools in which you are a member">
- <lift:loc>ui_streams_filter_pool</lift:loc> <main:pools/>
- </th>
- <th align="center">
- <lift:loc>ui_streams_pool_active</lift:loc> <main:filterPools/>
- </th>
- </tr>
- </thead>
- </table>
- </lift:streamFilters>
- </div>
- <div class ="stream_body">
- <table id="esme-table" class="tablesorter">
- <thead>
- <tr>
- <th></th>
- <th><lift:loc>ui_user_list_nickname</lift:loc></th>
- <th><lift:loc>ui_user_list_last_message</lift:loc></th>
- <th><lift:loc>ui_user_list_last_message_date</lift:loc></th>
- </tr>
- </thead>
- <tbody id="StreamSpan">
- <lift:displayStream>
- <disp:item>
- <tr class="user_row">
- <td><item:imageUrl/></td>
- <td>
- <div class="user_name">
- <item:author/>
- </div>
- </td>
- <td class="user_message"><item:text/></td>
- <td><item:date/></td>
- </tr>
- </disp:item>
- </lift:displayStream>
- </tbody>
- </table>
- </div>
- </div>
- </div>
+ <lift:TableSorterSnip/>
+ <lift:stream_display>
+ <div id="back-header">
+ <h1><b><lift:loc>ui_streams_manage</lift:loc></b></h1>
+ <lift:embed what="templates-hidden/message_update_box"/>
+ </div>
+ <div class="container-aux">
+ <div class="StreamUI">
+ <table class="tablesorter" >
+ <thead>
+ <tr>
+ <th class="tipelement" title="These are users that you follow">
+ <lift:loc>ui_streams_filter_resender</lift:loc> <stream:resent/>
+ </th>
+ <th align="center" class="tipelement" title="Filter by messages that have been resent by those you follow. ">
+ <lift:loc>ui_streams_resent_active</lift:loc> <stream:filterResent/>
+ </th>
+ <th class="tipelement" title="These are pools in which you are a member">
+ <lift:loc>ui_streams_filter_pool</lift:loc> <stream:pools/>
+ </th>
+ <th align="center">
+ <lift:loc>ui_streams_pool_active</lift:loc> <stream:filterPools/>
+ </th>
+ </tr>
+ </thead>
+ </table>
+ </div>
+ <div id="stream_timeline_messages">
+ <head>
+ <script src="../scripts/display_messages_top.js" type="text/javascript"/>
+ <script src="../scripts/pretty.js" type="text/javascript"/>
+ </head>
+ <stream:cometTimeline />
+ <lift:embed what="templates-hidden/message_core"/>
+ </div>
+ </div>
+ </lift:stream_display>
</lift:surround>
\ No newline at end of file
Modified: incubator/esme/trunk/server/src/main/webapp/scripts/display_messages_top.js
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/webapp/scripts/display_messages_top.js?rev=1036266&r1=1036265&r2=1036266&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/webapp/scripts/display_messages_top.js (original)
+++ incubator/esme/trunk/server/src/main/webapp/scripts/display_messages_top.js Wed Nov 17 22:46:32 2010
@@ -67,6 +67,10 @@ function searchMe()
var resendFunction = function(id){
resend_msg(id);
clearResend("resend_" + id );
+}
+
+function clearMessages(elementId) {
+ jQuery('.updates-box').not("#message").remove();
}
function displayMessages(msgArray, elementId)
Modified: incubator/esme/trunk/server/src/main/webapp/templates-hidden/message_core.html
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/webapp/templates-hidden/message_core.html?rev=1036266&r1=1036265&r2=1036266&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/webapp/templates-hidden/message_core.html (original)
+++ incubator/esme/trunk/server/src/main/webapp/templates-hidden/message_core.html Wed Nov 17 22:46:32 2010
@@ -17,38 +17,36 @@
under the License. *
-->
-<div>
+<div class="updates-box" id="message">
<head>
<script src="../scripts/display_messages_top.js" type="text/javascript" />
- <script src="../scripts/pretty.js" type="text/javascript" />
+ <script src="../scripts/pretty.js" type="text/javascript" />
</head>
- <div class="updates-box" id="message">
- <div class="avatar">
- <img id="avatar" width="40px"/>
- </div> <!--end avatar-->
- <div class="update2">
+ <div class="avatar">
+ <img id="avatar" width="40px"/>
+ </div> <!--end avatar-->
+ <div class="update2">
- <div class="info2">
- <a href="" id="author"/>
- <div id="msgbody"/>
- <div class="supp_data_class" id="supp_data"/>
- </div> <!--end info2-->
+ <div class="info2">
+ <a href="" id="author"/>
+ <div id="msgbody"/>
+ <div class="supp_data_class" id="supp_data"/>
+ </div> <!--end info2-->
- <div class="actions">
- <a href="#" id="resend">
- <lift:loc>ui_messages_message_label_resend</lift:loc>
- </a><span id="resend">| </span>
- <a href="#" id="reply">
- <lift:loc>ui_messages_message_label_reply</lift:loc>
- </a>
- <span id="conversation">| </span>
- <a id="conversation">
- <lift:loc>ui_messages_message_label_conversation</lift:loc>
- </a>
- </div> <!--end actions-->
- </div> <!--end update2-->
+ <div class="actions">
+ <a href="#" id="resend">
+ <lift:loc>ui_messages_message_label_resend</lift:loc>
+ </a><span id="resend">| </span>
+ <a href="#" id="reply">
+ <lift:loc>ui_messages_message_label_reply</lift:loc>
+ </a>
+ <span id="conversation">| </span>
+ <a id="conversation">
+ <lift:loc>ui_messages_message_label_conversation</lift:loc>
+ </a>
+ </div> <!--end actions-->
+ </div> <!--end update2-->
- </div> <!--end updates-box-->
-</div>
+</div>
Added: incubator/esme/trunk/server/src/main/webapp/templates-hidden/timeline_stream.html
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/webapp/templates-hidden/timeline_stream.html?rev=1036266&view=auto
==============================================================================
--- incubator/esme/trunk/server/src/main/webapp/templates-hidden/timeline_stream.html (added)
+++ incubator/esme/trunk/server/src/main/webapp/templates-hidden/timeline_stream.html Wed Nov 17 22:46:32 2010
@@ -0,0 +1,27 @@
+<!--
+ 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. *
+-->
+
+<div id="stream_timeline_messages">
+ <head>
+ <script src="../scripts/display_messages_top.js" type="text/javascript"/>
+ <script src="../scripts/pretty.js" type="text/javascript"/>
+ </head>
+ <stream:cometTimeline />
+ <lift:embed what="templates-hidden/message_core"/>
+</div>