esme-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vdic...@apache.org
Subject svn commit: r823956 - in /incubator/esme/trunk/server/src/main: scala/bootstrap/liftweb/Boot.scala scala/org/apache/esme/lib/ConversationMgr.scala webapp/info_view/conversation.html
Date Sat, 10 Oct 2009 21:40:15 GMT
Author: vdichev
Date: Sat Oct 10 21:40:14 2009
New Revision: 823956

URL: http://svn.apache.org/viewvc?rev=823956&view=rev
Log:
no comment

Added:
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/ConversationMgr.scala 
 (with props)
    incubator/esme/trunk/server/src/main/webapp/info_view/conversation.html   (with props)
Modified:
    incubator/esme/trunk/server/src/main/scala/bootstrap/liftweb/Boot.scala

Modified: incubator/esme/trunk/server/src/main/scala/bootstrap/liftweb/Boot.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/bootstrap/liftweb/Boot.scala?rev=823956&r1=823955&r2=823956&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/bootstrap/liftweb/Boot.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/bootstrap/liftweb/Boot.scala Sat Oct 10 21:40:14
2009
@@ -97,7 +97,7 @@
 
       case RewriteRequest(ParsePath("conversation" :: cid :: Nil, "", _, _),
                           _, _) =>
-        RewriteResponse(List("user_view", "conversation"), Map("cid" -> cid))
+        RewriteResponse(List("info_view", "conversation"), Map("cid" -> cid))
 
       case RewriteRequest(ParsePath("search" :: term :: Nil,"", _,_), _, _) =>
         RewriteResponse( List("user_view", "search"), Map("term" -> term))
@@ -115,7 +115,6 @@
     val entries = Menu(Loc("Home", List("index"), "Home")) ::
     Menu(Loc("user", List("info_view", "user"), "User Info", Hidden,
       Loc.Snippet("user_info", TagDisplay.userInfo))) ::
-    Menu(Loc("conv", List("user_view", "conversation"), "Conversation", Hidden)) ::
     Menu(Loc("about", List("static", "about"), "About", Hidden)) ::
     Menu(Loc("tag", List("info_view", "tag"), "Tag", Hidden, Loc.Snippet("tag_display", TagDisplay.display)))
::
     Menu(Loc("search", List("user_view", "search"), "Search", Hidden)) ::
@@ -131,7 +130,8 @@
     ActionMgr.menuItems :::
     AuthMgr.menuItems :::
     AccessPoolMgr.menuItems :::
-    StreamMgr.menuItems
+    StreamMgr.menuItems :::
+    ConversationMgr.menuItems
 
     LiftRules.setSiteMap(SiteMap(entries:_*))
 

Added: 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=823956&view=auto
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/ConversationMgr.scala (added)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/ConversationMgr.scala Sat
Oct 10 21:40:14 2009
@@ -0,0 +1,74 @@
+/**
+ * Copyright 2008-2009 WorldWide Conferencing, LLC
+ *
+ * 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.lib
+
+import net.liftweb._
+import http._
+import SHtml._
+import js._
+import JsCmds._
+import JE._
+
+import sitemap._
+import Loc._
+
+import mapper._
+
+import util._
+import Helpers._
+
+import model._
+
+import scala.xml._
+
+/**
+ * Manage the sitemap and related snippets for Conversations
+ */
+object ConversationMgr {
+  def loggedIn_? = User.loggedIn_?
+
+  val ifIsLoggedIn = If(loggedIn_? _, strFuncToFailMsg(() => S.?("You must be logged in")))
+
+  val menuItems =
+  Menu(Loc("conversation", List("info_view", "conversation"), "Manage Conversations", ifIsLoggedIn,
+           Loc.Snippet("displayConversation", displayConversation))) ::
+  Nil
+
+  def displayConversation(in: NodeSeq): NodeSeq = {
+
+    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,
+                                                   ))))
+    }
+
+  }
+
+}
\ No newline at end of file

Propchange: incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/ConversationMgr.scala
------------------------------------------------------------------------------
    svn:executable = *

Added: 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=823956&view=auto
==============================================================================
--- incubator/esme/trunk/server/src/main/webapp/info_view/conversation.html (added)
+++ incubator/esme/trunk/server/src/main/webapp/info_view/conversation.html Sat Oct 10 21:40:14
2009
@@ -0,0 +1,14 @@
+<lift:surround with="default" at="content">
+    <fieldset>
+      <legend>Conversation</legend>
+      <lift:displayConversation>
+        <disp:item>
+          <ul>
+            <li><item:text/></li>
+          </ul>
+        </disp:item>
+      </lift:displayConversation>
+    </fieldset>
+
+</lift:surround>
+

Propchange: incubator/esme/trunk/server/src/main/webapp/info_view/conversation.html
------------------------------------------------------------------------------
    svn:executable = *



Mime
View raw message