incubator-esme-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhir...@apache.org
Subject svn commit: r827473 - in /incubator/esme/trunk/server/src/main: resources/ scala/org/apache/esme/lib/ scala/org/apache/esme/model/ webapp/auth_view/
Date Tue, 20 Oct 2009 14:06:45 GMT
Author: rhirsch
Date: Tue Oct 20 14:06:44 2009
New Revision: 827473

URL: http://svn.apache.org/viewvc?rev=827473&view=rev
Log:
[ESME-91] Add Create date to authorization token

Modified:
    incubator/esme/trunk/server/src/main/resources/ESMEBase.properties
    incubator/esme/trunk/server/src/main/resources/ESMEUI.properties
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/AuthMgr.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Action.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/AuthToken.scala
    incubator/esme/trunk/server/src/main/webapp/auth_view/index.html

Modified: incubator/esme/trunk/server/src/main/resources/ESMEBase.properties
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/resources/ESMEBase.properties?rev=827473&r1=827472&r2=827473&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/resources/ESMEBase.properties (original)
+++ incubator/esme/trunk/server/src/main/resources/ESMEBase.properties Tue Oct 20 14:06:44
2009
@@ -29,7 +29,7 @@
 
 base_urlstore_err_too_short=The minimum URL length is 3 characters
 
-base_user_msg_change=User %s changed profile. Name: %s, Image: %s.
+base_user_msg_change=User %s changed profile.
 base_user_msg_login=User %s logged in
 base_user_msg_welcome=Welcome %s
 base_user_ui_signup=Sign Up

Modified: incubator/esme/trunk/server/src/main/resources/ESMEUI.properties
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/resources/ESMEUI.properties?rev=827473&r1=827472&r2=827473&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/resources/ESMEUI.properties (original)
+++ incubator/esme/trunk/server/src/main/resources/ESMEUI.properties Tue Oct 20 14:06:44 2009
@@ -65,6 +65,7 @@
 ui_token_name=Name
 ui_token_list_title=Valid Tokens
 ui_token_list_token=Token 
+ui_token_list_create=Create date 
 ui_token_create_description=Description
 
 ui_user_list_title=Users

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/AuthMgr.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/AuthMgr.scala?rev=827473&r1=827472&r2=827473&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/AuthMgr.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/AuthMgr.scala Tue Oct 20
14:06:44 2009
@@ -40,6 +40,9 @@
 
 import scala.xml._
 
+import java.util.Date
+import java.text.{DateFormat,SimpleDateFormat}
+
 /**
  * Manage the sitemap and related snippets for Authentication Tokens
  */
@@ -55,6 +58,13 @@
   Nil
 
   object updateTokens extends RequestVar[() => JsCmd](() => Noop)
+  
+     //XXX display date, should we have a common dateFormat?
+    val dateFormat = new SimpleDateFormat("yyyy/MM/dd")
+    def getDateHtml(date: Date) : Text = date match {
+     case null => Text(S.?("base_pool_ui_empty_date"))
+     case d => Text(dateFormat.format(d))
+   }
 
   def displayTokens(in: NodeSeq): NodeSeq = {
     // get the span name to update
@@ -72,6 +82,7 @@
                       (lst => xs.flatMap(i => bind("item", lst,
                                                    "description" -> i.description.is,
                                                    "uniqueId" -> i.uniqueId.is,
+                                                   "createdDate" -> getDateHtml(i.createdDate),
                                                    "revoke" -> 
                                                    ((bt: NodeSeq) => 
                   ajaxButton(bt, () => {i.delete_! ; updateSpan()}))

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Action.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Action.scala?rev=827473&r1=827472&r2=827473&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Action.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Action.scala Tue Oct
20 14:06:44 2009
@@ -41,10 +41,15 @@
   private def notifyDistributor(in: Action) {
     Distributor ! Distributor.UpdateTrackingFor(in.user, 
                                                 Distributor.PerformTrackingType)
-    
-
   
   }
+  
+   override def create: Action = {
+    val ap = super.create
+    ap.createdDate(new Date())
+    ap
+  }
+
 
   override def afterSave = startStopActors _ :: super.afterSave
   

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/AuthToken.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/AuthToken.scala?rev=827473&r1=827472&r2=827473&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/AuthToken.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/AuthToken.scala Tue Oct
20 14:06:44 2009
@@ -23,10 +23,26 @@
 
 import net.liftweb._
 import mapper._
+import http._
 import util._
 
+import org.apache.esme._
+import lib._
+import org.apache.esme.actor._
+import external._
+
+import java.util.Calendar
+import java.util.Date
+import scala.xml.{Text, Node, Elem => XmlElem}
+
 object AuthToken extends AuthToken with LongKeyedMetaMapper[AuthToken] {
   // override def dbIndexes = Index(user, status) :: super.dbIndexes
+  
+     override def create: AuthToken = {
+    val ap = super.create
+    ap.createdDate(new Date())
+    ap
+  } 
 }
 
 class AuthToken extends LongKeyedMapper[AuthToken] {
@@ -36,9 +52,14 @@
   object id extends MappedLongIndex(this)
   object user extends MappedLongForeignKey(this, User)
   object description extends MappedPoliteString(this, 64)
+   //define createfields
+  object createdDate extends MappedDateTime(this)
+  
+
   
   object uniqueId extends MappedUniqueId(this, 32) {
     override def dbIndexed_? = true
+    
   }
 /*
 

Modified: incubator/esme/trunk/server/src/main/webapp/auth_view/index.html
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/webapp/auth_view/index.html?rev=827473&r1=827472&r2=827473&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/webapp/auth_view/index.html (original)
+++ incubator/esme/trunk/server/src/main/webapp/auth_view/index.html Tue Oct 20 14:06:44 2009
@@ -37,12 +37,14 @@
         <tr>
           <td halign="center"><b><lift:loc>ui_token_create_description</lift:loc></b></td>
           <td halign="center"><b><lift:loc>ui_token_list_token</lift:loc></b></td>
+          <td halign="center"><b><lift:loc>ui_token_list_create</lift:loc></b></td>
           <td halign="center"><b><lift:loc>ui_token_revoke</lift:loc></b></td>
         </tr>
         <disp:item>
           <tr>
             <td><item:description/></td>
             <td><item:uniqueId/></td>
+            <td><item:createdDate/></td>
             <td>
               <item:revoke><img src="/images/delete.png"/></item:revoke>
             </td>



Mime
View raw message