incubator-esme-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vdic...@apache.org
Subject svn commit: r885288 - in /incubator/esme/trunk/server/src/main: scala/org/apache/esme/lib/ webapp/info_view/ webapp/templates-hidden/
Date Sun, 29 Nov 2009 23:11:27 GMT
Author: vdichev
Date: Sun Nov 29 23:11:26 2009
New Revision: 885288

URL: http://svn.apache.org/viewvc?rev=885288&view=rev
Log:
ESME-94 Common view for conversation/streams

Modified:
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/ConversationMgr.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/StreamMgr.scala
    incubator/esme/trunk/server/src/main/webapp/info_view/conversation.html
    incubator/esme/trunk/server/src/main/webapp/info_view/streams.html
    incubator/esme/trunk/server/src/main/webapp/templates-hidden/timeline.html

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/ConversationMgr.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/ConversationMgr.scala?rev=885288&r1=885287&r2=885288&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/ConversationMgr.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/ConversationMgr.scala Sun
Nov 29 23:11:26 2009
@@ -56,19 +56,18 @@
 
   def displayConversation(in: NodeSeq): NodeSeq = {
 
+    val jsId = "timeline_messages"                  
+
     val cid = S.param("cid").map(toLong).openOr(-1L)
 
     val msgs = Message.findAndPrime(By(Message.conversation, cid),
                                     OrderBy(Message.id, Descending))
 
-    msgs match {
-      case Nil => NodeSeq.Empty
-      case xs => bind("disp", in,
-                      "item" -> 
-                      (lst => xs.flatMap(i => bind("item", lst,
-                                                   "text" -> i.digestedXHTML,
-                                                   ))))
-    }
+    Script(
+      OnLoad(JsCrVar(jsId, JsArray(
+          msgs.map(m => JsObj(("message", m.asJs)) ) :_*)) &
+      JsFunc("displayMessages", JsVar(jsId), jsId).cmd)
+    )
 
   }
 

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=885288&r1=885287&r2=885288&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 Sun Nov
29 23:11:26 2009
@@ -93,24 +93,15 @@
       val query = poolsQuery :::
                   resentQuery :::
                   List[QueryParam[Message]](OrderBy(Message.id, Descending), MaxRows(40))

-                  
-      //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("")),
-                                                     "text" -> i.digestedXHTML,
-                                                     "date" -> dateFormatter.format(i.getWhen)
-                ))))
-      }
+
+      val jsId = "timeline_messages"                  
+      val msgs = Message.findAll(query: _*)
+      Script(
+        OnLoad(JsCrVar(jsId, JsArray(
+            msgs.map(m => JsObj(("message", m.asJs)) ) :_*)) &
+        JsFunc("displayMessages", JsVar(jsId), jsId).cmd)
+      )
+      
     }
     def updateSpan(): JsCmd = SetHtml(spanName, doRender())
 

Modified: incubator/esme/trunk/server/src/main/webapp/info_view/conversation.html
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/webapp/info_view/conversation.html?rev=885288&r1=885287&r2=885288&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/webapp/info_view/conversation.html (original)
+++ incubator/esme/trunk/server/src/main/webapp/info_view/conversation.html Sun Nov 29 23:11:26
2009
@@ -1,16 +1,12 @@
 <lift:surround with="default" at="content">
+    <script src="/scripts/display_messages.js" type="text/javascript"/>
     <fieldset>
         <legend>
             <lift:loc>ui_default_conversation</lift:loc>
         </legend>
-        <lift:displayConversation>
-            <disp:item>
-                <ul>
-                    <li>
-                        <item:text/>
-                    </li>
-                </ul>
-            </disp:item>
-        </lift:displayConversation>
+        <div class="b-list">
+            <lift:displayConversation/>
+            <lift:embed what="templates-hidden/timeline"/>
+        </div>
     </fieldset>
 </lift:surround>
\ No newline at end of file

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=885288&r1=885287&r2=885288&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 Sun Nov 29 23:11:26
2009
@@ -12,6 +12,7 @@
     </script>
     <script type="text/javascript" src="../scripts/esme_table_sorter.js">
     </script>
+    <script src="/scripts/display_messages.js" type="text/javascript"/>
     <div class="demo">
         <div class="ui-tabs ui-widget ui-widget-content ui-corner-all" id="tabs">
             <ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header
ui-corner-all">
@@ -30,38 +31,10 @@
                         the main snippet
                         -->
                     </lift:ignore>
-                    <lift:displayStream the_id="StreamSpan">
-                        <table id="esme-table" class="tablesorter">
-                            <thead>
-                                <tr>
-                                    <th>
-                                        <lift:loc>ui_streams_author</lift:loc>
-                                    </th>
-                                    <th>
-                                        <lift:loc>ui_streams_text</lift:loc>
-                                    </th>
-                                    <th>
-                                        <lift:loc>ui_streams_date</lift:loc>
-                                    </th>
-                                </tr>
-                            </thead>
-                            <tbody>
-                                <disp:item>
-                                    <tr>
-                                        <td>
-                                            <item:author/>
-                                        </td>
-                                        <td>
-                                            <item:text/>
-                                        </td>
-                                        <td>
-                                            <item:date/>
-                                        </td>
-                                    </tr>
-                                </disp:item>
-                            </tbody>
-                        </table>
-                    </lift:displayStream>
+                    <div class="b-list">
+                        <lift:displayStream the_id="StreamSpan"/>
+                        <lift:embed what="templates-hidden/timeline"/>
+                    </div>
                 </span>
             </div>
             <div class="ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide"
id="tabs-2">

Modified: incubator/esme/trunk/server/src/main/webapp/templates-hidden/timeline.html
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/webapp/templates-hidden/timeline.html?rev=885288&r1=885287&r2=885288&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/webapp/templates-hidden/timeline.html (original)
+++ incubator/esme/trunk/server/src/main/webapp/templates-hidden/timeline.html Sun Nov 29
23:11:26 2009
@@ -1,4 +1,4 @@
-<table>
+<table id="esme-table" class="tablesorter">
     <thead>
         <tr>
             <th>



Mime
View raw message