Re: [Lift] Re: [Lift committers] A Groovy welcome to James Strachan who has joined the Lift committers

2010-02-08 Thread Xuefeng Wu
I'm looking forward it.

On Tue, Feb 9, 2010 at 1:27 AM, James Strachan wrote:

> On 8 February 2010 17:16, David Pollak 
> wrote:
> > Folks,
> >
> > I'm wicked pleased that James Strachan has joined the Lift committers.
> I'm
> > looking forward to the cool stuff that James will add to Lift.
> >
> > Please join me in welcoming James!
>
> Thanks David!
>
> Now I just hope I can actually find something interesting to
> contribute after that welcome :)
>
> The first thing I was pondering about was a way of easily using
> Scalate templates if folks wanted to use, say, Scaml (like a Scala
> version of HAML) instead of the usual XML template files in Lift...
>
> http://scalate.fusesource.org/
>
> I know template engines can be like IDEs - very personal things and
> I'm totally happy for folks to use whatever template engine/markup
> floats their boat - I just figured a bit more choice for lifters might
> be a good thing?
>
> --
> James
> ---
> http://macstrac.blogspot.com/
>
> Open Source Integration
> http://fusesource.com/
>
> --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>
>


-- 
Scala中文社区:  http://groups.google.com/group/scalacn

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



Re: [Lift] Re: Handle Exception

2009-12-24 Thread Xuefeng Wu
It's helpful, thank you!


On Thu, Dec 24, 2009 at 7:03 PM, Marius  wrote:

> If you want a popup a dialog when an exception is thrown from an Ajax
> function you can do something like:
>
> import net.liftweb.http.js._
> import net.liftweb.http.js.jquery._
> import JqJsCmds._
> ...
>
> LiftRules.exceptionHandler.prepend {
>  case (mode, req, ex) => JavaScriptResponse(ModalDialog(Crap
> it failed.))
> }
>
> You can make you own logic to distinguish between exceptions thrown
> from Ajax requests or from snippet, either by some information from
> Req or some additional information from the exception itself or by
> some other means.
>
> Br's,
> Marius
>
> On Dec 24, 11:15 am, Xuefeng Wu  wrote:
> > Hi,
> > I have a question about exception handle in Lift.
> >
> > *How could I pop a error dialog except redirect?*
> > *
> > *
> > *Lift have LiftRules.exceptionHandler.prepend to handle exception.*
> > LiftRules.exceptionHandler.prepend {
> >   case (mode, state, ex) => RedirectResponse("/error")
> >   // how could I pop a error dialog?
> >  }
> >
> > And I found that Lift could handle exception from snippet , for example:
> >   def throwExceptionB(in: NodeSeq): NodeSeq = {
> > throw new RuntimeException("throw exception")
> > a(() => {Alert("Text throw exception")},
> >  Text("throw exception")
> > )
> >   }
> >
> > But I find lift didn't throw exception if it rise from lift inside:
> >def throwExceptionB(in: NodeSeq): NodeSeq = {
> > a(() => {throw new RuntimeException("throw exception");Alert("Test
> throw
> > exception")},
> >  Text("throw exception")
> > )
> >}
> > The exception will be printed at server side but not the client.
> > I think Lift should also could handle it.
> >
> > --
> > Scala中文社区:  http://groups.google.com/group/scalacn
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>
>
>


-- 
Scala中文社区:  http://groups.google.com/group/scalacn

--

You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




[Lift] Handle Exception

2009-12-24 Thread Xuefeng Wu
Hi,
I have a question about exception handle in Lift.

*How could I pop a error dialog except redirect?*
*
*
*Lift have LiftRules.exceptionHandler.prepend to handle exception.*
LiftRules.exceptionHandler.prepend {
  case (mode, state, ex) => RedirectResponse("/error")
  // how could I pop a error dialog?
 }



And I found that Lift could handle exception from snippet , for example:
  def throwExceptionB(in: NodeSeq): NodeSeq = {
throw new RuntimeException("throw exception")
a(() => {Alert("Text throw exception")},
 Text("throw exception")
)
  }


But I find lift didn't throw exception if it rise from lift inside:
   def throwExceptionB(in: NodeSeq): NodeSeq = {
a(() => {throw new RuntimeException("throw exception");Alert("Test throw
exception")},
 Text("throw exception")
)
   }
The exception will be printed at server side but not the client.
I think Lift should also could handle it.

-- 
Scala中文社区:  http://groups.google.com/group/scalacn

--

You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




Re: [Lift] Re: How do I go about implementing my own auth?

2009-12-24 Thread Xuefeng Wu
Yes, "authorize the editable text"

On Thu, Dec 24, 2009 at 4:06 PM, Marius  wrote:

> You can use various LocParams for the Loc-s defined in your SiteMap
> but I'm not sure I understand your question.
>
> What do you mean by "authorize the editable text" ?
>
> Br's,
> Marius
>
> On Dec 24, 6:54 am, Xuefeng Wu  wrote:
> > Could SiteMap authorize the editable text?
> > I use swappable some where and do not know how to authorize it.
> >
> >
> >
> > On Tue, Dec 8, 2009 at 5:38 AM, Marius  wrote:
> > > I'm not really sure why you're saying that SiteMap is out of the
> > > question. Note that SiteMap does NOT equate with the Menu. You can use
> > > SiteMap to define navigation rules, security semantics, etc. SiteMap
> > > is much more then just a menu.
> >
> > > But at the end of the day it's your choice.
> >
> > > Br's,
> > > Marius
> >
> > > On Dec 7, 11:32 pm, DMB  wrote:
> > > > SiteMap is out of the question. I don't need it at all on my site, by
> > > > design.
> > > > I like the way this is done in RoR: you can basically say:
> >
> > > > before_filter :authorize, :except => :login
> >
> > > > And it will call "authorize" for all top level methods in the
> > > > controller class except "login". Not that any of this is applicable
> in
> > > > Lift, but I like this very simple, declarative approach. The current
> > > > auth infrastructure in Lift requires quite a bit of head scratching
> > > > the second you try to do something "custom".
> >
> > > > On Dec 7, 11:25 am, Timothy Perrett  wrote:
> >
> > > > > Ok, lets step back... I really, really wouldnt use the built in
> auth
> > > stuff for forms... its sole purpose in life (and lift!) is for basic
> auth as
> > > per the HTTP RFCs. If you want basic auth, then thats fine, but i think
> the
> > > way you are subclassing HttpAuthentication is wrong for purpose.
> >
> > > > > If you want login, do one of two things:
> >
> > > > > - use SiteMap (IMHO, this is the most appropriate route)
> > > > > - create a custom rewrite / dispatcher combo
> >
> > > > > You could look at MegaProtoUser, but personally, i'm not a huge fan
> of
> > > that approach and prefer to craft my own. That being said, a lot of
> people
> > > use it and it saves a lot of time.
> >
> > > > > Cheers, Tim
> >
> > > > > On 7 Dec 2009, at 14:14, Marius wrote:
> >
> > > > > > On Dec 7, 1:09 pm, DMB  wrote:
> > > > > >> Basically here's what I want to accomplish:
> > > > > >> 1. I want the user to login through a simple form on /index.html
> -
> > > > > >> this is the only unprotected page on the site. User does not
> have a
> > > > > >> user name, the only field is a password.
> > > > > >> 2. I want to store the user role (along with some other state
> data)
> > > in
> > > > > >> the user session
> > > > > >> 3. If user tries to access any page other than index.html, I
> want to
> > > > > >> redirect to /index.html
> >
> > > > > >> After stumbling for a while due to scarcity of documentation, I
> have
> > > > > >> done the following:
> >
> > > > > >> In Boot.scala:
> >
> > > > > >> LiftRules.httpAuthProtectedResource.prepend {
> > > > > >> case ParsePath("index" :: Nil, "html", true, false)
> =>
> > > > > >> Empty
> > > > > >> case _ => Full(AuthRole("admin"))
> > > > > >> }
> >
> > > > > >> LiftRules.authentication = SessionAuthentication()
> >
> > > > > >> InSessionAuthentication.scala:
> >
> > > > > >> case class SessionAuthentication extends HttpAuthentication {
> >
> > > > > >> def verified_? = { case(req) => {
> > > > > >> // TODO: Prefetch from DB here
> > > > > >> true
> > > > > >> }
> > > > > >> }
> >
> > > > > >> }
> >
> > > > > 

Re: [Lift] Re: How do I go about implementing my own auth?

2009-12-23 Thread Xuefeng Wu
Could SiteMap authorize the editable text?
I use swappable some where and do not know how to authorize it.


On Tue, Dec 8, 2009 at 5:38 AM, Marius  wrote:

> I'm not really sure why you're saying that SiteMap is out of the
> question. Note that SiteMap does NOT equate with the Menu. You can use
> SiteMap to define navigation rules, security semantics, etc. SiteMap
> is much more then just a menu.
>
> But at the end of the day it's your choice.
>
> Br's,
> Marius
>
> On Dec 7, 11:32 pm, DMB  wrote:
> > SiteMap is out of the question. I don't need it at all on my site, by
> > design.
> > I like the way this is done in RoR: you can basically say:
> >
> > before_filter :authorize, :except => :login
> >
> > And it will call "authorize" for all top level methods in the
> > controller class except "login". Not that any of this is applicable in
> > Lift, but I like this very simple, declarative approach. The current
> > auth infrastructure in Lift requires quite a bit of head scratching
> > the second you try to do something "custom".
> >
> > On Dec 7, 11:25 am, Timothy Perrett  wrote:
> >
> > > Ok, lets step back... I really, really wouldnt use the built in auth
> stuff for forms... its sole purpose in life (and lift!) is for basic auth as
> per the HTTP RFCs. If you want basic auth, then thats fine, but i think the
> way you are subclassing HttpAuthentication is wrong for purpose.
> >
> > > If you want login, do one of two things:
> >
> > > - use SiteMap (IMHO, this is the most appropriate route)
> > > - create a custom rewrite / dispatcher combo
> >
> > > You could look at MegaProtoUser, but personally, i'm not a huge fan of
> that approach and prefer to craft my own. That being said, a lot of people
> use it and it saves a lot of time.
> >
> > > Cheers, Tim
> >
> > > On 7 Dec 2009, at 14:14, Marius wrote:
> >
> > > > On Dec 7, 1:09 pm, DMB  wrote:
> > > >> Basically here's what I want to accomplish:
> > > >> 1. I want the user to login through a simple form on /index.html -
> > > >> this is the only unprotected page on the site. User does not have a
> > > >> user name, the only field is a password.
> > > >> 2. I want to store the user role (along with some other state data)
> in
> > > >> the user session
> > > >> 3. If user tries to access any page other than index.html, I want to
> > > >> redirect to /index.html
> >
> > > >> After stumbling for a while due to scarcity of documentation, I have
> > > >> done the following:
> >
> > > >> In Boot.scala:
> >
> > > >> LiftRules.httpAuthProtectedResource.prepend {
> > > >> case ParsePath("index" :: Nil, "html", true, false) =>
> > > >> Empty
> > > >> case _ => Full(AuthRole("admin"))
> > > >> }
> >
> > > >> LiftRules.authentication = SessionAuthentication()
> >
> > > >> InSessionAuthentication.scala:
> >
> > > >> case class SessionAuthentication extends HttpAuthentication {
> >
> > > >> def verified_? = { case(req) => {
> > > >> // TODO: Prefetch from DB here
> > > >> true
> > > >> }
> > > >> }
> >
> > > >> }
> >
> > > >> It is my understanding that this should not ask for auth at all. In
> > > >> reality, it doesn't ask for auth on /index.html, but DOES ask for
> > > >> Basic auth (through a browser popup) on any other page.
> >
> > > >> What am I doing wrong, and how do I make it right?
> >
> > > > Your are seeing the browser's credentials popup because of :
> >
> > > >  def unauthorizedResponse: UnauthorizedResponse =
> UnauthorizedResponse
> > > > (realm)
> >
> > > > from HttpAuthentication trait. You can override this and subclass
> > > > UnauthorizedResponse with your own LiftResponse if you want other
> type
> > > > of response than 401. You can also protect your resources using
> > > > HttpAuthProtected LocParam that you can use when you specify your
> > > > SiteMap in the Loc construction.
> >
> > > > This is one approach.
> >
> > > > Another one, probably more suitable for login forms, is to look into
> > > > Mapper support for that (I think it's called MetaMegaProtoUser ? )
> >
> > > > --
> >
> > > > You received this message because you are subscribed to the Google
> Groups "Lift" group.
> > > > To post to this group, send email to lift...@googlegroups.com.
> > > > To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> > > > For more options, visit this group athttp://
> groups.google.com/group/liftweb?hl=en.
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>
>
>


-- 
Scala中文社区:  http://groups.google.com/group/scalacn

--

You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this gro

Re: [Lift] Re: Sitemap - rendering "title" attributes for the links

2009-12-21 Thread Xuefeng Wu
Sorry I misunderstand you.

And I do not know how to too.

Maybe you should use

instead of 


On Tue, Dec 22, 2009 at 11:29 AM, Alex Black  wrote:

> Hi Xuefeng,
>
> I'm using the default Lift Sitemap, so I don't think I can use either
> of your suggestions, or, I don't see how to use them.  The sitemap
> renders the links for me... I have seen how to set the class of the
> elements that it renders, but not how to add other attributes such as
> title.
>
> - Alex
>
> > You could add MetaData 'title' by Elem 's method '%'
> > some page % ("title" -> "what will happen when you
> click
> > on this
> > link")
> >
> > or use { }
> > some page
> >
> >
> >
> > On Mon, Dec 21, 2009 at 10:38 PM, Alex Black  wrote:
> > > Can someone point me in the right direction to get tooltips (title
> > > attributes) rendered in my sitemap?
> >
> > > I'd like to add text to each link, so they get rendered like this:
> >
> > > some page
> >
> > > thx
> >
> > > - Alex
> >
> > > --
> >
> > > You received this message because you are subscribed to the Google
> Groups
> > > "Lift" group.
> > > To post to this group, send email to lift...@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > > liftweb+unsubscr...@googlegroups.com
> 
> >
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/liftweb?hl=en.
> >
> > --
> > Scala中文社区:  http://groups.google.com/group/scalacn
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>
>
>


-- 
Scala中文社区:  http://groups.google.com/group/scalacn

--

You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




Re: [Lift] 280_port and yuicompressor problem

2009-12-21 Thread Xuefeng Wu
If you google "[yuicompressor:compress {execution: default}]" would find so
many information about this.
It's not caused by scala2.8 or lift.


On Tue, Dec 22, 2009 at 9:10 AM, Alan M  wrote:

> I just recently started tinkering around with 2.8.. actually a recent
> upgrade of Netbeans kind of necessitated it.. (the only Scala plugin
> for Netbeans 6.8 requires Scala 2.8.xxx, ughh).
>
> So most of my code is close anyway, except for anything that depends
> on specs.  But I had to get the 280_port of lift to compile locally
> for my web services.  When I try it fails very near the end with:
> ...
> [INFO] [yuicompressor:compress {execution: default}]
> [INFO]
> 
> [ERROR] FATAL ERROR
> [INFO]
> 
> [INFO] null
> [INFO]
> 
> [INFO] Trace
> java.lang.RuntimeException
>at
> com.yahoo.platform.yui.compressor.JavaScriptCompressor.printSourceNumber
> (JavaScriptCompressor.java:299)
>at com.yahoo.platform.yui.compressor.JavaScriptCompressor.parse
> (JavaScriptCompressor.java:335)
>at com.yahoo.platform.yui.compressor.JavaScriptCompressor.
> (JavaScriptCompressor.java:532)
>at net.sf.alchim.mojo.yuicompressor.YuiCompressorMojo.processFile
> (YuiCompressorMojo.java:178)
> ...
>
> I'm using maven 2.2.1 and Java 1.6.0.0 on Ubuntu.
>
> Any ideas?
>
> Alan
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>
>
>


-- 
Scala中文社区:  http://groups.google.com/group/scalacn

--

You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




Re: [Lift] Re: Catch file upload exceptions?

2009-12-21 Thread Xuefeng Wu
It's good way to handle exception.

And I think it's better that it could pop dialog to tell users what's wrong.


http://www.mail-archive.com/liftweb@googlegroups.com/msg03001.html
http://wiki.liftweb.net/index.php/HowTo_use_error_pages

On Tue, Dec 22, 2009 at 5:52 AM, Marius  wrote:

> Have you tried using in boot LiftRules.exceptionHandler.prepend
> (...)  ?
>
> Br's,
> Marius
>
> On Dec 21, 11:43 pm, tiro  wrote:
> > Hi,
> >
> > just wondering if anybody knows of a handy way to properly handle the
> > exceptions that are thrown when a user uploads a file that exceeds the
> > size limit (or who knows what else can happen)?
> >
> > The stack trace that I see in such a case is as follows -- and apart
> > from trying S.addAround I don't see a any place where one could insert
> > some exception handling:
> >
> > Message: org.apache.commons.fileupload.FileUploadBase
> > $SizeLimitExceededException: the request was rejected because its size
> > (7385713) exceeds the configured maximum (6291456)
> > org.apache.commons.fileupload.FileUploadBase
> > $FileItemIteratorImpl.(FileUploadBase.java:914)
> > org.apache.commons.fileupload.FileUploadBase.getItemIterator
> > (FileUploadBase.java:331)
> >
> > org.apache.commons.fileupload.servlet.ServletFileUpload.getItemIterator
> > (ServletFileUpload.java:148)
> >
> net.liftweb.http.provider.servlet.HTTPRequestServlet$$anon$1.
> > (HTTPRequestServlet.scala:110)
> > net.liftweb.http.provider.servlet.HTTPRequestServlet.extractFiles
> > (HTTPRequestServlet.scala:100)
> > net.liftweb.http.Req$$anonfun$5.apply(Req.scala:182)
> > net.liftweb.http.Req$$anonfun$5.apply(Req.scala:156)
> > net.liftweb.http.Req.x$17(Req.scala:351)
> > net.liftweb.http.Req.uploadedFiles(Req.scala:350)
> > net.liftweb.http.LiftSession.runParams(LiftSession.scala:306)
> >
> net.liftweb.http.LiftSession.processRequest(LiftSession.scala:492)
> > net.liftweb.http.LiftServlet.net$liftweb$http$LiftServlet$
> > $dispatchStatefulRequest(LiftServlet.scala:261)
> >
> net.liftweb.http.LiftServlet$$anonfun$3.apply(LiftServlet.scala:171)
> >
> net.liftweb.http.LiftServlet$$anonfun$3.apply(LiftServlet.scala:171)
> > net.liftweb.http.S$.net$liftweb$http$S$$wrapQuery(S.scala:974)
> >
> net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_nest2InnerInit$1$
> > $anonfun$apply$25.apply(S.scala:1114)
> > net.liftweb.http.S$.net$liftweb$http$S$$doAround(S.scala:911)
> > net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_nest2InnerInit
> > $1.apply(S.scala:1112)
> > net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:67)
> >
> net.liftweb.http.S$.net$liftweb$http$S$$_nest2InnerInit(S.scala:)
> >
> net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_innerInit$1$$anonfun
> > $apply$28$$anonfun$apply$29$$anonfun$apply$30$$anonfun$apply$31.apply
> > (S.scala:1133)
> > net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:67)
> >
> net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_innerInit$1$$anonfun
> > $apply$28$$anonfun$apply$29$$anonfun$apply$30.apply(S.scala:1132)
> > net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:67)
> >
> net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_innerInit$1$$anonfun
> > $apply$28$$anonfun$apply$29.apply(S.scala:1131)
> > net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:67)
> >
> net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_innerInit$1$$anonfun
> > $apply$28.apply(S.scala:1130)
> > net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:67)
> >
> net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_innerInit$1.apply
> > (S.scala:1129)
> > net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:67)
> > net.liftweb.http.S$.net$liftweb$http$S$$_innerInit(S.scala:1128)
> >
> net.liftweb.http.S$$anonfun$_init$1$$anonfun$apply$38$$anonfun$apply
> > $39$$anonfun$apply$40$$anonfun$apply$41$$anonfun$apply$42.apply
> > (S.scala:1175)
> > net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:67)
> >
> net.liftweb.http.S$$anonfun$_init$1$$anonfun$apply$38$$anonfun$apply
> > $39$$anonfun$apply$40$$anonfun$apply$41.apply(S.scala:1174)
> >
> net.liftweb.http.CoreRequestVarHandler$class.apply(Vars.scala:325)
> > net.liftweb.http.RequestVarHandler$.apply(Vars.scala:248)
> >
> net.liftweb.http.S$$anonfun$_init$1$$anonfun$apply$38$$anonfun$apply
> > $39$$anonfun$apply$40.apply(S.scala:1173)
> >
> net.liftweb.http.CoreRequestVarHandler$class.apply(Vars.scala:325)
> >
> net.liftweb.http.TransientRequestVarHandler$.apply(Vars.scala:252)
> >
> net.liftweb.http.S$$anonfun$_init$1$$anonfun$apply$38$$anonfun$apply
> > $39.apply(S.scala:1172)
> > net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:67)
> >
> net.liftweb.http.S$$anonfun$_init$1$$anonfun$apply$38.apply(S.scala:
> > 1171)
> > net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:67)
> > net.liftweb.http.S$$anonfun$_init$1.apply(S.scala:1170)
> >  

Re: [Lift] Sitemap - rendering "title" attributes for the links

2009-12-21 Thread Xuefeng Wu
You could add MetaData 'title' by Elem 's method '%'
some page % ("title" -> "what will happen when you click
on this
link")

or use { }
some page

On Mon, Dec 21, 2009 at 10:38 PM, Alex Black  wrote:

> Can someone point me in the right direction to get tooltips (title
> attributes) rendered in my sitemap?
>
> I'd like to add text to each link, so they get rendered like this:
>
> some page
>
> thx
>
> - Alex
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>
>
>


-- 
Scala中文社区:  http://groups.google.com/group/scalacn

--

You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




Re: [Lift] Re: **Important** Announcing the Lift 2.0 branch

2009-12-20 Thread Xuefeng Wu
That's great that Lift2.0 is on Scala 2.8

On Mon, Dec 21, 2009 at 1:17 PM, Indrajit Raychaudhuri
wrote:

> Eventually, yes, Lift 2.0 would be on Scala 2.8. But that's not the only
> difference between Lift 1.0 and Lift 2.0.
>
> To follow the context, you might want to take a look at this thread:
>
> http://groups.google.com/group/liftweb/browse_thread/thread/479edef7700ccce6
> .
>
> Cheers, Indrajit
>
> On 21/12/09 8:22 AM, Xuefeng Wu wrote:
> > I mean that lift1.1 and lift2.0 may have the same futures,
> > But lift1.1 is for Scala2.7 and lift2.0 is for Scala2.8.
> > With Scala2.8 stable , the lift1.1 could not be enhanced.
> >
> > It's better than Lift2.0-Scala2.7 and Lift2.0-Scala2.8.
> >
> > And there're better explain why Lift2.0 and Lift1.1 if people ask what's
> > the different between Lift2.0 and Lift1.1?
> >
> > On Mon, Dec 21, 2009 at 9:31 AM, Randinn  > <mailto:rand...@gmail.com>> wrote:
> >
> > Why not with 2.8 just going to beta 2.0 my estimation is that 2.0
> will
> > be finished before
> >
> > On Dec 21, 12:03 pm, Xuefeng Wu  > <mailto:ben...@gmail.com>> wrote:
> >  > Why not release Lift2.0 with Scala2.8?
> >  >
> >  > On Mon, Dec 21, 2009 at 3:34 AM, Indrajit Raychaudhuri
> >  > mailto:indraj...@gmail.com>>wrote:
> >  >
> >  >
> >  >
> >  > > Okay Folks,
> >  >
> >  > > Lift 2.0 branch has shaped up enough for everybody to play with.
> >  > > Checkout the branch irc_wip_lift20 and get going! Just be aware
> > that
> >  > > it's still undergoing updated and changes incrementally and
> > there are
> >  > > few rough edges.
> >  >
> >  > > Key changes:
> >  >
> >  > > 1. The project tree has been restructured according to the
> proposal
> >  > > sent out earlier [1]. To summarize, we now have three top level
> >  > > projects (framework, archetypes and examples) each with
> independent
> >  > > build life-cycle. There are other additional infra projects
> > that are
> >  > > less to do with the actual code.
> >  >
> >  > > A quick summary of the top-level projects:
> >  >
> >  > > 1. Framework:
> >  > > The whole of Lift Framework that matter most to most. The usual
> >  > > modules (viz., lift-base, lift-persistence and lift-modules)
> > have got
> >  > > nested within. Therefore, from now on, building Lift framework
> > would
> >  > > mean just that. Doing a "git pull" or "git clone" as usual,
> > changing
> >  > > to framework directory and running "mvn install".
> >  >
> >  > > 2. Archetypes:
> >  > > The standard distributed archetypes. The archetypes help you
> > get quick
> >  > > started with a Lift based project. If you are not into building
> > maven
> >  > > archetypes, you can stay clear of this. But a quick probe is
> > welcome.
> >  >
> >  > > 3. Examples:
> >  > > All the Lift examples are grouped into this project. If you are
> >  > > generally interested in learning different techniques from
> examples
> >  > > you don't have to build the whole of Lift anymore. Well that
> > was still
> >  > > the case earlier, but now it's even more obvious. And it's true
> the
> >  > > other way round too, if you have to build Lift framework from
> > source,
> >  > > you don't have to build the examples along with it. Another
> > point: the
> >  > > examples won't be deployed on scala-tools maven repo anymore.
> Those
> >  > > war files up there serve no good purpose.
> >  >
> >  > > Everything now gets neatly tucked into their respective homes :)
> >  >
> >  > > Additional points that you should be aware of:
> >  >
> >  > > A. Availability on scala-tools repository:
> >  > > - Components of framework would be available
> >  > > - Components of archetypes would be available
> >  > > - Components of examples would *not* be available
> >  >
> >  > > B. Availability

Re: [Lift] Re: **Important** Announcing the Lift 2.0 branch

2009-12-20 Thread Xuefeng Wu
I mean that lift1.1 and lift2.0 may have the same futures,
But lift1.1 is for Scala2.7 and lift2.0 is for Scala2.8.
With Scala2.8 stable , the lift1.1 could not be enhanced.

It's better than Lift2.0-Scala2.7 and Lift2.0-Scala2.8.

And there're better explain why Lift2.0 and Lift1.1 if people ask what's the
different between Lift2.0 and Lift1.1?

On Mon, Dec 21, 2009 at 9:31 AM, Randinn  wrote:

> Why not with 2.8 just going to beta 2.0 my estimation is that 2.0 will
> be finished before
>
> On Dec 21, 12:03 pm, Xuefeng Wu  wrote:
> > Why not release Lift2.0 with Scala2.8?
> >
> > On Mon, Dec 21, 2009 at 3:34 AM, Indrajit Raychaudhuri
> > wrote:
> >
> >
> >
> > > Okay Folks,
> >
> > > Lift 2.0 branch has shaped up enough for everybody to play with.
> > > Checkout the branch irc_wip_lift20 and get going! Just be aware that
> > > it's still undergoing updated and changes incrementally and there are
> > > few rough edges.
> >
> > > Key changes:
> >
> > > 1. The project tree has been restructured according to the proposal
> > > sent out earlier [1]. To summarize, we now have three top level
> > > projects (framework, archetypes and examples) each with independent
> > > build life-cycle. There are other additional infra projects that are
> > > less to do with the actual code.
> >
> > > A quick summary of the top-level projects:
> >
> > > 1. Framework:
> > > The whole of Lift Framework that matter most to most. The usual
> > > modules (viz., lift-base, lift-persistence and lift-modules) have got
> > > nested within. Therefore, from now on, building Lift framework would
> > > mean just that. Doing a "git pull" or "git clone" as usual, changing
> > > to framework directory and running "mvn install".
> >
> > > 2. Archetypes:
> > > The standard distributed archetypes. The archetypes help you get quick
> > > started with a Lift based project. If you are not into building maven
> > > archetypes, you can stay clear of this. But a quick probe is welcome.
> >
> > > 3. Examples:
> > > All the Lift examples are grouped into this project. If you are
> > > generally interested in learning different techniques from examples
> > > you don't have to build the whole of Lift anymore. Well that was still
> > > the case earlier, but now it's even more obvious. And it's true the
> > > other way round too, if you have to build Lift framework from source,
> > > you don't have to build the examples along with it. Another point: the
> > > examples won't be deployed on scala-tools maven repo anymore. Those
> > > war files up there serve no good purpose.
> >
> > > Everything now gets neatly tucked into their respective homes :)
> >
> > > Additional points that you should be aware of:
> >
> > > A. Availability on scala-tools repository:
> > > - Components of framework would be available
> > > - Components of archetypes would be available
> > > - Components of examples would *not* be available
> >
> > > B. Availability on scala-tools Maven site:
> > > Site generated from framework would be the main content of scala-tools
> > > Maven site. Depending on how things go, we might even have a home of
> > > it's own athttp://dev.liftweb.net. (Separate proposal coming up)
> >
> > > C. Lift Parent Project Model:
> > > The top level pom.xml has moved to it's own home at resources/project-
> > > model. This would stay as a 'flyweight' project (as in boxing, not
> > > GoF) on it's own that would strictly control the common behavior,
> > > plugin dependencies, versions etc. for all the top level projects
> > > (framework, archetypes, examples). This would be deployed on scala-
> > > tools repository.
> >
> > > D. Lift Site Skin (WIP):
> > > I haven't started working on this yet. But the intent is to create a
> > > project site that is of some real value and serves as placeholder for
> > > mostly 'auto-generated' docs. See #B above.
> >
> > > E. Still pending:
> > > a. Migration to Scala 2.8 branch. Intend to have stable master created
> > > first with everything working as usual without being caught into Scala
> > > release cycle. Hopefully, this branch and '280_port' would merge soon!
> > > b. Higher quality site generation (See #B above, proposal coming up)
> > > c. Site skin 

Re: [Lift] **Important** Announcing the Lift 2.0 branch

2009-12-20 Thread Xuefeng Wu
Why not release Lift2.0 with Scala2.8?

On Mon, Dec 21, 2009 at 3:34 AM, Indrajit Raychaudhuri
wrote:

> Okay Folks,
>
> Lift 2.0 branch has shaped up enough for everybody to play with.
> Checkout the branch irc_wip_lift20 and get going! Just be aware that
> it's still undergoing updated and changes incrementally and there are
> few rough edges.
>
> Key changes:
>
> 1. The project tree has been restructured according to the proposal
> sent out earlier [1]. To summarize, we now have three top level
> projects (framework, archetypes and examples) each with independent
> build life-cycle. There are other additional infra projects that are
> less to do with the actual code.
>
> A quick summary of the top-level projects:
>
> 1. Framework:
> The whole of Lift Framework that matter most to most. The usual
> modules (viz., lift-base, lift-persistence and lift-modules) have got
> nested within. Therefore, from now on, building Lift framework would
> mean just that. Doing a "git pull" or "git clone" as usual, changing
> to framework directory and running "mvn install".
>
> 2. Archetypes:
> The standard distributed archetypes. The archetypes help you get quick
> started with a Lift based project. If you are not into building maven
> archetypes, you can stay clear of this. But a quick probe is welcome.
>
> 3. Examples:
> All the Lift examples are grouped into this project. If you are
> generally interested in learning different techniques from examples
> you don't have to build the whole of Lift anymore. Well that was still
> the case earlier, but now it's even more obvious. And it's true the
> other way round too, if you have to build Lift framework from source,
> you don't have to build the examples along with it. Another point: the
> examples won't be deployed on scala-tools maven repo anymore. Those
> war files up there serve no good purpose.
>
> Everything now gets neatly tucked into their respective homes :)
>
> Additional points that you should be aware of:
>
> A. Availability on scala-tools repository:
> - Components of framework would be available
> - Components of archetypes would be available
> - Components of examples would *not* be available
>
> B. Availability on scala-tools Maven site:
> Site generated from framework would be the main content of scala-tools
> Maven site. Depending on how things go, we might even have a home of
> it's own at http://dev.liftweb.net. (Separate proposal coming up)
>
> C. Lift Parent Project Model:
> The top level pom.xml has moved to it's own home at resources/project-
> model. This would stay as a 'flyweight' project (as in boxing, not
> GoF) on it's own that would strictly control the common behavior,
> plugin dependencies, versions etc. for all the top level projects
> (framework, archetypes, examples). This would be deployed on scala-
> tools repository.
>
> D. Lift Site Skin (WIP):
> I haven't started working on this yet. But the intent is to create a
> project site that is of some real value and serves as placeholder for
> mostly 'auto-generated' docs. See #B above.
>
> E. Still pending:
> a. Migration to Scala 2.8 branch. Intend to have stable master created
> first with everything working as usual without being caught into Scala
> release cycle. Hopefully, this branch and '280_port' would merge soon!
> b. Higher quality site generation (See #B above, proposal coming up)
> c. Site skin (See #D above)
> d. Hudson integration and better release management. So that certain
> steps in Committer release process [2] become automatic (waiting for
> merge to master and hudson maintenance)
> e. Having a nice README.md at the top level
> f. General spit and polish
>
> F: To be decided:
> a. Future of lift-core. (Separate mail coming)
> b. Relevance of OtherLicensedWorks.txt (repo distribution of javamail
> is now under CDDL and license automatically reflects in dependency
> page)
> c. Need for remove-trailings.sh (can be replaced by git pre-commit
> hook)
>
>
> [1]
> http://groups.google.com/group/liftweb/browse_thread/thread/450a3e741999b5df
> [2] http://wiki.github.com/dpp/liftweb/committer-release-process
>
> Feedbacks most welcome!
>
> Cheers, Indrajit
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>
>
>


-- 
Scala中文社区:  http://groups.google.com/group/scalacn

--

You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




Re: [Lift] Did the jQuery Datepicker ever get integrated into Lift?

2009-12-18 Thread Xuefeng Wu
I think it's not yet.
It's very useful that lift integrate all widget from http://jqueryui.com/ .
Do anyone have interesting in doing this?

On Fri, Dec 18, 2009 at 4:49 AM, Peter Robinett wrote:

> I see there was some discussion about it over a year ago[1], but I
> don't think it's be done. Is just dropping in the Javascript code the
> best way to go? If I do that, how do I bind to the form field(s) in my
> snippet code?
>
> Thanks!
>
> Peter
>
> [1]:
> http://groups.google.com/group/liftweb/browse_thread/thread/c8f3c39208770790/66e5b9cbf0ad3ad5
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>
>
>


-- 
Scala中文社区:  http://groups.google.com/group/scalacn

--

You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




Re: [Lift] Is this a defect at JqJsCmds.ModalDialog

2009-12-17 Thread Xuefeng Wu
OK, I found the JsObj is useful, Thanks.

On Thu, Dec 17, 2009 at 5:28 PM, Xuefeng Wu  wrote:

> Hi Alex,
>
> I found new ModalDialog(html: NodeSeq, css: Box[JsObj]),
>  the parameter 'css' type is JsObj instead of String.
>
> Could you tell me the reason?
>
> I'm working on a customer widgets and have the same case.
>
>
> On Thu, Dec 3, 2009 at 10:37 PM, Alex Boisvert wrote:
>
>> On Thu, Dec 3, 2009 at 12:40 AM, Xuefeng Wu  wrote:
>>
>>> Hi,
>>>
>>> When I use ModalDialog I want to setup the css but fail,
>>> My code would be:
>>> ModalDialog(someHtml, "top: '10px'")
>>>
>>> I found the ModalDialog code at Lift:
>>> class ModalDialog(html: NodeSeq, css: Box[String]) extends JsCmd {
>>> val toJsCmd = "jQuery.blockUI({ message: " +
>>> AltXML.toXML(Group(S.session.map(s =>
>>> s.fixHtml(s.processSurroundAndInclude("Modal Dialog",
>>> html))).openOr(html)), false, true, S.ieMode).encJs +
>>> (css.map(w => ",  css: '" + w + "' ").openOr("")) + "});"
>>>   }
>>>
>>> the css is wrap by " '  ' " ,
>>> but I found http://malsup.com/jquery/block/#demos
>>> the css is wraped by "{ }"
>>>
>>>
>>> Is this a defect at JqJsCmds.ModalDialog or I do something wrong?
>>>
>>
>> Yes, it looks like a bug.   I'm guessing the code may have been written
>> for BlockUI v1.x and that the API may have changed in 2.x.Please open a
>> ticket and I'll fix it.
>>
>> alex
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Lift" group.
>> To post to this group, send email to lift...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> liftweb+unsubscr...@googlegroups.com
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/liftweb?hl=en.
>>
>
>
>
> --
> Scala中文社区:  http://groups.google.com/group/scalacn
>



-- 
Scala中文社区:  http://groups.google.com/group/scalacn

--

You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




Re: [Lift] Is this a defect at JqJsCmds.ModalDialog

2009-12-17 Thread Xuefeng Wu
Hi Alex,

I found new ModalDialog(html: NodeSeq, css: Box[JsObj]),
 the parameter 'css' type is JsObj instead of String.

Could you tell me the reason?

I'm working on a customer widgets and have the same case.


On Thu, Dec 3, 2009 at 10:37 PM, Alex Boisvert wrote:

> On Thu, Dec 3, 2009 at 12:40 AM, Xuefeng Wu  wrote:
>
>> Hi,
>>
>> When I use ModalDialog I want to setup the css but fail,
>> My code would be:
>> ModalDialog(someHtml, "top: '10px'")
>>
>> I found the ModalDialog code at Lift:
>> class ModalDialog(html: NodeSeq, css: Box[String]) extends JsCmd {
>> val toJsCmd = "jQuery.blockUI({ message: " +
>> AltXML.toXML(Group(S.session.map(s =>
>> s.fixHtml(s.processSurroundAndInclude("Modal Dialog",
>> html))).openOr(html)), false, true, S.ieMode).encJs +
>> (css.map(w => ",  css: '" + w + "' ").openOr("")) + "});"
>>   }
>>
>> the css is wrap by " '  ' " ,
>> but I found http://malsup.com/jquery/block/#demos
>> the css is wraped by "{ }"
>>
>>
>> Is this a defect at JqJsCmds.ModalDialog or I do something wrong?
>>
>
> Yes, it looks like a bug.   I'm guessing the code may have been written for
> BlockUI v1.x and that the API may have changed in 2.x.Please open a
> ticket and I'll fix it.
>
> alex
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>



-- 
Scala中文社区:  http://groups.google.com/group/scalacn

--

You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




Re: [Lift] [ANN] Lift 1.1-M8

2009-12-16 Thread Xuefeng Wu
anyone will add the source.jar?

On Wed, Dec 16, 2009 at 3:33 AM, Jim McBeath  wrote:

> It looks like the source jars are missing from the M8 repository, at
> least for some of the libraries (for example,
> ).
>
> Are these perhaps located somewhere else now?  Or do they typically
> get added a bit later?
>
> --
> Jim
>
> On Mon, Dec 14, 2009 at 11:37:02AM -0800, David Pollak wrote:
> > Date: Mon, 14 Dec 2009 11:37:02 -0800
> > From: David Pollak 
> > To: liftweb 
> > Subject: [Lift] [ANN] Lift 1.1-M8
> >
> >The Lift Web Framework team is pleased to announce the lift-1.1-M8
> release!
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>
>
>


-- 
Scala中文社区:  http://groups.google.com/group/scalacn

--

You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




Re: [Lift] Re: Mapper <-> JObject bridge

2009-12-16 Thread Xuefeng Wu
Thanks, Joni.

On Wed, Dec 16, 2009 at 4:24 PM, Joni Freeman wrote:

> Hi,
>
> Yes, that's a way to convert JSON AST to string and vice versa. All
> functions in lift-json operate on AST instances. This is lets us post-
> and pre-process JSON in many ways before converting it to string. See
> for instance functions map, merge, diff, \, etc. defined in JsonAST
> (scaladocs still missing but will be provided before Lift 2.0 is
> released). Typical conversions might for instance remove some data
> from JSON, convert data types, change structure of resulting JSON and
> so on.
>
> I usually import all needed objects and their members. After that the
> code becomes a bit more concise (the cast is unfortunately needed
> since JSON comes from the wild and can be anything):
>
> def encodeAsJsonString(in: A) = compact(render(encodeAsJson(in)))
> def buildFromJsonString(json: String): A = buildFromJson(parse
> (json).asInstanceOf[JObject])
>
> Cheers Joni
>
>
> On 16 joulu, 09:03, Xuefeng Wu  wrote:
> > Hi,
> > I add two method to en/decode JObject/String
> >
> > def encodeAsJsonString(in: A): String =
> > Printer.compact(JsonAST.render(encodeAsJson(in)))
> > def buildFromJsonString(json: String): A =
> > buildFromJson(JsonParser.parse(json).asInstanceOf[JsonAST.JObject])
> >
> > Do there have better way?
> >
> > On Thu, Dec 3, 2009 at 5:15 AM, David Pollak
> > wrote:
> >
> >
> >
> > > Folks (HarryH -- this means you),
> >
> > > I've just checked in code on the dpp_issue_213 that does Mapper <->
> JObject
> > > bridging using the awesome lift-json library.
> >
> > > The methods on MetaMapper:
> > > protected def encodeAsJSON_! (toEncode: A): JsonAST.JObject
> > > protected def decodeFromJSON_!(json: JsonAST.JObject): A
> >
> > > Implement the bridge.  They are protected and have a _! in their name
> > > because they are *dangerous* in that data can be exposed on the JSON
> object
> > > that you might not want exposed and these methods should be used with
> > > extreme caution.
> >
> > > An example of usage can be found in the MapperSpecs:
> >
> > > object SampleModel extends SampleModel with KeyedMetaMapper[Long,
> > > SampleModel] {
> > >   def encodeAsJson(in: SampleModel): JsonAST.JObject =
> encodeAsJSON_!(in)
> > >   def buildFromJson(json: JsonAST.JObject): SampleModel =
> > > decodeFromJSON_!(json)
> > > }
> >
> > > class SampleModel extends KeyedMapper[Long, SampleModel] {
> > >   def getSingleton = SampleModel // what's the "meta" server
> > >   def primaryKeyField = id
> >
> > >   object id extends MappedLongIndex(this)
> > >   object firstName extends MappedString(this, 32)
> > >   object moose extends MappedNullableLong(this)
> > >   object notNull extends MappedString(this, 32) {
> > > override def dbNotNull_? = true
> > >   }
> >
> > >   def encodeAsJson(): JsonAST.JObject = SampleModel.encodeAsJson(this)
> > > }
> >
> > > So, you can use this mechanism to serialize a Mapper object to JSON,
> shovel
> > > the object into memcached and then pull it out, mutate a field and save
> the
> > > object back to the database (although connection identifier is lost, so
> if
> > > you are sharding your database, this will not work).
> >
> > > Please give it a try, give me feedback.  I'll put it on review board
> > > tomorrow after any feedback and get it into Lift.
> >
> > > Thanks,
> >
> > > David
> >
> > > --
> > > Lift, the simply functional web frameworkhttp://liftweb.net
> > > Beginning Scalahttp://www.apress.com/book/view/1430219890
> > > Follow me:http://twitter.com/dpp
> > > Surf the harmonics
> >
> > > --
> > > You received this message because you are subscribed to the Google
> Groups
> > > "Lift" group.
> > > To post to this group, send email to lift...@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > > liftweb+unsubscr...@googlegroups.com
> 
> >
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/liftweb?hl=en.
> >
> > --
> > Scala中文社区:  http://groups.google.com/group/scalacn
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>
>
>


-- 
Scala中文社区:  http://groups.google.com/group/scalacn

--

You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




Re: [Lift] Mapper <-> JObject bridge

2009-12-15 Thread Xuefeng Wu
Hi,
I add two method to en/decode JObject/String

def encodeAsJsonString(in: A): String =
Printer.compact(JsonAST.render(encodeAsJson(in)))
def buildFromJsonString(json: String): A =
buildFromJson(JsonParser.parse(json).asInstanceOf[JsonAST.JObject])

Do there have better way?



On Thu, Dec 3, 2009 at 5:15 AM, David Pollak
wrote:

> Folks (HarryH -- this means you),
>
> I've just checked in code on the dpp_issue_213 that does Mapper <-> JObject
> bridging using the awesome lift-json library.
>
> The methods on MetaMapper:
> protected def encodeAsJSON_! (toEncode: A): JsonAST.JObject
> protected def decodeFromJSON_!(json: JsonAST.JObject): A
>
> Implement the bridge.  They are protected and have a _! in their name
> because they are *dangerous* in that data can be exposed on the JSON object
> that you might not want exposed and these methods should be used with
> extreme caution.
>
> An example of usage can be found in the MapperSpecs:
>
> object SampleModel extends SampleModel with KeyedMetaMapper[Long,
> SampleModel] {
>   def encodeAsJson(in: SampleModel): JsonAST.JObject = encodeAsJSON_!(in)
>   def buildFromJson(json: JsonAST.JObject): SampleModel =
> decodeFromJSON_!(json)
> }
>
> class SampleModel extends KeyedMapper[Long, SampleModel] {
>   def getSingleton = SampleModel // what's the "meta" server
>   def primaryKeyField = id
>
>   object id extends MappedLongIndex(this)
>   object firstName extends MappedString(this, 32)
>   object moose extends MappedNullableLong(this)
>   object notNull extends MappedString(this, 32) {
> override def dbNotNull_? = true
>   }
>
>   def encodeAsJson(): JsonAST.JObject = SampleModel.encodeAsJson(this)
> }
>
>
> So, you can use this mechanism to serialize a Mapper object to JSON, shovel
> the object into memcached and then pull it out, mutate a field and save the
> object back to the database (although connection identifier is lost, so if
> you are sharding your database, this will not work).
>
> Please give it a try, give me feedback.  I'll put it on review board
> tomorrow after any feedback and get it into Lift.
>
> Thanks,
>
> David
>
>
> --
> Lift, the simply functional web framework http://liftweb.net
> Beginning Scala http://www.apress.com/book/view/1430219890
> Follow me: http://twitter.com/dpp
> Surf the harmonics
>
> --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>



-- 
Scala中文社区:  http://groups.google.com/group/scalacn

--

You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




Re: [Lift] How to revert json to lift model?

2009-12-15 Thread Xuefeng Wu
Hi David,

Thank you very much!

On Wed, Dec 16, 2009 at 1:40 AM, David Pollak  wrote:

>
>
> On Tue, Dec 15, 2009 at 4:37 AM, Xuefeng Wu  wrote:
>
>> Hi,
>>
>> I store the lift model to json, but cannot revert json to lift model, any
>> idea?
>>
>> For example:
>> My model:
>> class Book extends LongKeyedMapper[Book] with IdPK{
>> def getSingleton = Book
>>
>> object name extends MappedPoliteString(this, 125)
>> object desc extends MappedTextarea(this, 1320)
>>
>> }
>>
>> and to json by toJs:
>> bookjson = {"$lift_class": "book", "name": " The Definitive Guide to
>> Lift", "id": 1, "desc": " The Definitive Guide to Lift"}
>>
>> the lift model is not POJO, I don't how to revert json to lift model.
>>
>>
>> Could anyone give some suggest?
>>
>
> Please see the following methods in MetaMapper:
>
>   /**
>* This method will encode the instance as JSON.  It may reveal
>* data in fields that might otherwise be proprietary.  It should
>* be used with caution and only exposed as a public method
>* after a security review.
>*/
>   protected def encodeAsJSON_! (toEncode: A): JsonAST.JObject =
>
>   protected def decodeFromJSON_!(json: JsonAST.JObject): A =
>
> And this thread:
> http://groups.google.com/group/liftweb/browse_thread/thread/80e8b2e871a2a8d4/be8b6ae127267f8a?lnk=raot
>
> Thanks,
>
> David
>
>
>>
>>
>> --
>> Scala中文社区:  http://groups.google.com/group/scalacn
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Lift" group.
>> To post to this group, send email to lift...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> liftweb+unsubscr...@googlegroups.com
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/liftweb?hl=en.
>>
>
>
>
> --
> Lift, the simply functional web framework http://liftweb.net
> Beginning Scala http://www.apress.com/book/view/1430219890
> Follow me: http://twitter.com/dpp
> Surf the harmonics
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>



-- 
Scala中文社区:  http://groups.google.com/group/scalacn

--

You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




[Lift] How to revert json to lift model?

2009-12-15 Thread Xuefeng Wu
Hi,

I store the lift model to json, but cannot revert json to lift model, any
idea?

For example:
My model:
class Book extends LongKeyedMapper[Book] with IdPK{
def getSingleton = Book

object name extends MappedPoliteString(this, 125)
object desc extends MappedTextarea(this, 1320)

}

and to json by toJs:
bookjson = {"$lift_class": "book", "name": " The Definitive Guide to Lift",
"id": 1, "desc": " The Definitive Guide to Lift"}

the lift model is not POJO, I don't how to revert json to lift model.


Could anyone give some suggest?


-- 
Scala中文社区:  http://groups.google.com/group/scalacn

--

You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




Re: [Lift] Re: Lift and LDAP

2009-12-10 Thread Xuefeng Wu
I write a CAS SSO proxy, it's so easy if anyone read this article
<http://www.ja-sig.org/wiki/display/CAS/Proxy+CAS+Walkthrough>and It's java
way for lack of IO in Scala.


On Tue, Dec 1, 2009 at 9:18 AM, Xuefeng Wu  wrote:

> Thank you for your reply and I will try.
>
>
> On Mon, Nov 30, 2009 at 6:25 PM, Timothy Perrett 
> wrote:
>
>> Right now there are no plans to implement this, certainly not before
>> 2.0 (this is the first time anyone has asked for it) - if you need it
>> specifically, it probably wouldn't be too difficult to implement
>> within your own application.
>>
>> Cheers, Tim
>>
>> On Nov 30, 7:41 am, Xuefeng Wu  wrote:
>> > Such ashttp://code.google.com/p/rubycas-client/This CAS client library
>> is
>> > designed to work easily with Rails.
>> >
>> > I need a CAS SSO library with Rails.
>> >
>> > Thanks.
>> >
>> > On Sat, Nov 28, 2009 at 7:55 PM, Timothy Perrett <
>> timo...@getintheloop.eu>wrote:
>> >
>> >
>> >
>> >
>> >
>> > > What kind of integration do you want?
>> >
>> > > Cheers, Tim
>> >
>> > > On 28 Nov 2009, at 03:20, Xuefeng Wu wrote:
>> >
>> > > > Did anyone try to integrate with SSO?
>> >
>> > > > On Sat, Nov 28, 2009 at 12:37 AM, Marcin Jurczuk <
>> mjurc...@gmail.com>
>> > > wrote:
>> > > > That is amazing :)
>> >
>> > > > Probably I will need to bind to AD in near future, so this module is
>> > > > like fallen from heavens :)
>> >
>> > > > On 27 Lis, 15:11, TylerWeir  wrote:
>> > > > >http://jgoday.wordpress.com/2009/11/27/lift-ldap/
>> > > > > "One of the requisites to start using Lift at my work, was to use
>> LDAP
>> > > > > authentification.
>> > > > > So i wrote a little module lift-ldap for that and a sample app, it
>> was
>> > > > > damn simple!"
>> >
>> > >http://github.com/jgoday/lift-ldaphttp://github.com/jgoday/sample_lif.
>> ..
>> >
>> > > > --
>> >
>> > > > You received this message because you are subscribed to the Google
>> Groups
>> > > "Lift" group.
>> > > > To post to this group, send email to lift...@googlegroups.com.
>> > > > To unsubscribe from this group, send email to
>> > > liftweb+unsubscr...@googlegroups.com
>> >
>> > > .
>> > > > For more options, visit this group at
>> > >http://groups.google.com/group/liftweb?hl=en.
>> >
>> > > > --
>> > > > Scala中文社区:  http://groups.google.com/group/scalacn
>> >
>> > > > --
>> >
>> > > > You received this message because you are subscribed to the Google
>> Groups
>> > > "Lift" group.
>> > > > To post to this group, send email to lift...@googlegroups.com.
>> > > > To unsubscribe from this group, send email to
>> > > liftweb+unsubscr...@googlegroups.com
>> >
>> > > .
>> > > > For more options, visit this group at
>> > >http://groups.google.com/group/liftweb?hl=en.
>> >
>> > > --
>> >
>> > > You received this message because you are subscribed to the Google
>> Groups
>> > > "Lift" group.
>> > > To post to this group, send email to lift...@googlegroups.com.
>> > > To unsubscribe from this group, send email to
>> > > liftweb+unsubscr...@googlegroups.com
>> >
>> > > .
>> > > For more options, visit this group at
>> > >http://groups.google.com/group/liftweb?hl=en.
>> >
>> > --
>> > Scala中文社区:  http://groups.google.com/group/scalacn
>>
>> --
>>
>> You received this message because you are subscribed to the Google Groups
>> "Lift" group.
>> To post to this group, send email to lift...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> liftweb+unsubscr...@googlegroups.com
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/liftweb?hl=en.
>>
>>
>>
>
>
> --
> Scala中文社区:  http://groups.google.com/group/scalacn
>



-- 
Scala中文社区:  http://groups.google.com/group/scalacn

--

You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




Re: [Lift] Sharing data between snippet functions during a single HTTP request

2009-12-09 Thread Xuefeng Wu
That's great!
Thank you for your help.

On Thu, Dec 10, 2009 at 11:06 AM, David Pollak <
feeder.of.the.be...@gmail.com> wrote:

>
>
> On Wed, Dec 9, 2009 at 5:35 PM, Xuefeng Wu  wrote:
>
>> doCompetenceB render a button which user click and will pop a dialog for
>> create a competence.
>> *The competence have category property, I want this pop dialog know the
>> category which user already selected from the category tree.*
>>
>
> That doesn't explain how it's called.  English is a weak way to describe
> things.  The best way is a small, runnable example (mvn jetty:run) created
> as a public GitHub project.  I can fork it and make it work the right way
> for you.
>
>
>> *
>> *
>>
>> On Thu, Dec 10, 2009 at 7:19 AM, David Pollak <
>> feeder.of.the.be...@gmail.com> wrote:
>>
>>>
>>>
>>> On Mon, Dec 7, 2009 at 9:14 PM, Xuefeng Wu  wrote:
>>>
>>>> Hi David & Ross,
>>>>
>>>> Thank you for your help,
>>>> I understand RequestVar now, which muse be used in the same request.
>>>>
>>>> My case is that I have a tree and a separate button.
>>>> When use click the tree node, the separate button should know which node
>>>> is selected.
>>>>
>>>
>>> Without understanding how  def *doCompetenceB*(xhtml: NodeSeq,msg:
>>> String,competence: Competence): NodeSeq = { is called as part of the Ajax
>>> callback, I can't give you any advice.  Sorry.
>>>
>>>
>>>>
>>>> Right now I replace the separate button when use click the tree node and
>>>> it worked.
>>>> I don't want to use session and I think it's better not replace the
>>>> button.
>>>> But I don't have idea how to do.
>>>>
>>>> On Tue, Dec 8, 2009 at 12:49 PM, David Pollak <
>>>> feeder.of.the.be...@gmail.com> wrote:
>>>>
>>>>>
>>>>>
>>>>> On Mon, Dec 7, 2009 at 8:46 PM, Xuefeng Wu  wrote:
>>>>>
>>>>>> My current solution is that when user select a tree node, I replace
>>>>>> the add button dependence on the node.
>>>>>
>>>>>
>>>>> If you can create a very simple example of what you're trying to do, we
>>>>> can help you debug the actual, runnable code.
>>>>>
>>>>>
>>>>>>
>>>>>>
>>>>>> 2009/12/8 Xuefeng Wu 
>>>>>>
>>>>>> Hi Ross,
>>>>>>>
>>>>>>> Yes it's not in the same request.
>>>>>>>
>>>>>>> My case is:
>>>>>>> When user select a tree node, I want to store this nodeId and If user
>>>>>>> click a button to create a child node, I want to get the selected node.
>>>>>>>
>>>>>>> I use ModalDialog when user click the button to create now node.
>>>>>>>
>>>>>>> On Tue, Dec 8, 2009 at 11:50 AM, Ross Mellgren wrote:
>>>>>>>
>>>>>>>> I'm sorry, I'm having trouble following your code, I think too much
>>>>>>>> of the surrounding code and templates is missing for me to reason 
>>>>>>>> about why
>>>>>>>> you would have a problem.
>>>>>>>>
>>>>>>>> I set up a quick example app, so maybe the code from that will help
>>>>>>>> you. It is here:
>>>>>>>>
>>>>>>>> http://github.com/Dridus/test-rqvarlog
>>>>>>>>
>>>>>>>> If I understand you correctly, you're getting a log message like
>>>>>>>> this one:
>>>>>>>> WARN - RequestVar test.snippet.HelloWorld$myVar$_ was set but not
>>>>>>>> read
>>>>>>>>
>>>>>>>> This message is from the code I posted:
>>>>>>>>
>>>>>>>> package test.snippet
>>>>>>>>
>>>>>>>> import _root_.scala.xml.NodeSeq
>>>>>>>> import _root_.net.liftweb.http.RequestVar
>>>>>>>> import _root_.net.liftweb.util.Helpers
>>>>>>>> import Helpers._
>>>>>>>>
>>>>>>>> class HelloWorld {
>>>>

Re: [Lift] Sharing data between snippet functions during a single HTTP request

2009-12-09 Thread Xuefeng Wu
doCompetenceB render a button which user click and will pop a dialog for
create a competence.
*The competence have category property, I want this pop dialog know the
category which user already selected from the category tree.
*
On Thu, Dec 10, 2009 at 7:19 AM, David Pollak  wrote:

>
>
> On Mon, Dec 7, 2009 at 9:14 PM, Xuefeng Wu  wrote:
>
>> Hi David & Ross,
>>
>> Thank you for your help,
>> I understand RequestVar now, which muse be used in the same request.
>>
>> My case is that I have a tree and a separate button.
>> When use click the tree node, the separate button should know which node
>> is selected.
>>
>
> Without understanding how  def *doCompetenceB*(xhtml: NodeSeq,msg:
> String,competence: Competence): NodeSeq = { is called as part of the Ajax
> callback, I can't give you any advice.  Sorry.
>
>
>>
>> Right now I replace the separate button when use click the tree node and
>> it worked.
>> I don't want to use session and I think it's better not replace the
>> button.
>> But I don't have idea how to do.
>>
>> On Tue, Dec 8, 2009 at 12:49 PM, David Pollak <
>> feeder.of.the.be...@gmail.com> wrote:
>>
>>>
>>>
>>> On Mon, Dec 7, 2009 at 8:46 PM, Xuefeng Wu  wrote:
>>>
>>>> My current solution is that when user select a tree node, I replace the
>>>> add button dependence on the node.
>>>
>>>
>>> If you can create a very simple example of what you're trying to do, we
>>> can help you debug the actual, runnable code.
>>>
>>>
>>>>
>>>>
>>>> 2009/12/8 Xuefeng Wu 
>>>>
>>>> Hi Ross,
>>>>>
>>>>> Yes it's not in the same request.
>>>>>
>>>>> My case is:
>>>>> When user select a tree node, I want to store this nodeId and If user
>>>>> click a button to create a child node, I want to get the selected node.
>>>>>
>>>>> I use ModalDialog when user click the button to create now node.
>>>>>
>>>>> On Tue, Dec 8, 2009 at 11:50 AM, Ross Mellgren wrote:
>>>>>
>>>>>> I'm sorry, I'm having trouble following your code, I think too much of
>>>>>> the surrounding code and templates is missing for me to reason about why 
>>>>>> you
>>>>>> would have a problem.
>>>>>>
>>>>>> I set up a quick example app, so maybe the code from that will help
>>>>>> you. It is here:
>>>>>>
>>>>>> http://github.com/Dridus/test-rqvarlog
>>>>>>
>>>>>> If I understand you correctly, you're getting a log message like this
>>>>>> one:
>>>>>> WARN - RequestVar test.snippet.HelloWorld$myVar$_ was set but not read
>>>>>>
>>>>>> This message is from the code I posted:
>>>>>>
>>>>>> package test.snippet
>>>>>>
>>>>>> import _root_.scala.xml.NodeSeq
>>>>>> import _root_.net.liftweb.http.RequestVar
>>>>>> import _root_.net.liftweb.util.Helpers
>>>>>> import Helpers._
>>>>>>
>>>>>> class HelloWorld {
>>>>>> object myVar extends RequestVar[Int](0)
>>>>>>
>>>>>> def howdy(in: NodeSeq): NodeSeq = Helpers.bind("b", in, "time" ->
>>>>>> (new _root_.java.util.Date).toString)
>>>>>>
>>>>>> def increment(in: NodeSeq): NodeSeq = {
>>>>>> myVar.set(myVar.is + 1)
>>>>>> increment called
>>>>>> }
>>>>>>
>>>>>> def show(in: NodeSeq): NodeSeq = show called -- myVar.is {
>>>>>> myVar.is }
>>>>>> }
>>>>>>
>>>>>>
>>>>>> 
>>>>>> Welcome to your project!
>>>>>>  
>>>>>>   
>>>>>> Welcome to test-rqvarlog at 
>>>>>>   
>>>>>>
>>>>>>   
>>>>>>   
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>>
>>>>>> If I uncomment the line with HelloWorld.show in the template, the log
>>>>>> message goes away because myVar.is is called.

Re: [Lift] Re: highlight the lift notices in some seconds

2009-12-09 Thread Xuefeng Wu
created. http://github.com/dpp/liftweb/issues/#issue/235

<http://github.com/dpp/liftweb/issues/#issue/235>Thanks!


On Wed, Dec 9, 2009 at 10:04 PM, David Pollak  wrote:

> I think this particular use case is very interesting.  There should be a
> flexible (LiftRules or in the Msgs snippet) mechanism for making this
> behavior flexible... doing it for all users, doing it on a user-by-user
> basis.
>
> Please open a ticket at http://github.com/dpp/liftweb/issues referencing
> this thread and we'll add the feature.
>
> Thanks!
>
>
> On Wed, Dec 9, 2009 at 4:56 AM, Xuefeng Wu  wrote:
>
>> It's not make sense for my project.
>> I separate business  transaction from UI logic.
>> When create or update business model will occur notice or error,
>> and then do something for UI by the business transaction
>>
>> for example:
>> business:
>> def MyBusinessTransaction(v: String) : Option[MyModel] = {
>>   val myModel = MyModel.create.title(v)
>>   myModel.validate match {
>>   case Nil => {myModel.save();Some(myModel)}
>>   case xs => {S.error(xs);None}
>>   }
>> }
>>
>>
>> Snippet
>> def doSomething(): JsCmd = MyBusinessTransaction(v) match {
>> case Some(v) => //do something for UI, such as replace the old value
>> case None => //notice what's wrong. *I could code ** fadeOutErrors(5
>> seconds, 1 second) if want, but should I code every where?*
>> }
>>
>>
>> Or there're any other practice for separate business from UI?
>>
>>
>> On Wed, Dec 9, 2009 at 7:45 PM, Philippe Monnaie <
>> philippe.monn...@gmail.com> wrote:
>>
>>> You could try:
>>>
>>> object Config{
>>>  def error(xs) = {
>>> S.error(xs)
>>>    fadeOutErrors(5 seconds, 1 second)
>>>  }
>>> }
>>>
>>> and call Config.error(xs) instead of S.error(xs)
>>>
>>> or something similar. I'm sure someone can come up with a more elegant
>>> solution than this. Just the first thing that popped into my head.
>>>
>>> - Philippe
>>>
>>> On Tue, Dec 8, 2009 at 2:26 PM, Xuefeng Wu  wrote:
>>> > I think It's better I could configure it, but not code every where.
>>> > On Tue, Dec 8, 2009 at 9:23 PM, Marius 
>>> wrote:
>>> >>
>>> >> Yes you need to send down fadeOut... call
>>> >>
>>> >> def myFunc: JsCmd = {
>>> >>  // do some DB stuff
>>> >>  vmyMapper.validate match {
>>> >>case Nil => Noop
>>> >>case xs => S.error(xs); fadeOutErrors(5 seconds, 1 second)
>>> >>  }
>>> >>
>>> >> }
>>> >> On Dec 8, 3:01 pm, Xuefeng Wu  wrote:
>>> >> > Yes, I do something like
>>> >> >  // do the DB stuff
>>> >> >  vmyMapper.validate match {
>>> >> >case Nil =>
>>> >> >case xs => S.error(xs)
>>> >> > }
>>> >> >
>>> >> > But I should always add fadeOutErrors(5 seconds, 1 second)?
>>> >> >
>>> >> > I want lift highlight every error/notice information.
>>> >> >
>>> >> >
>>> >> >
>>> >> > On Tue, Dec 8, 2009 at 5:56 PM, Marius 
>>> wrote:
>>> >> > > Are you using field validate into an Ajax context or not? If not
>>> using
>>> >> > > something like:
>>> >> >
>>> >> > > def howdy = {
>>> >> > >S.error("howdy error")
>>> >> > >Hello there ++
>>> >> > >{Script(OnLoad(fadeOutErrors(5 seconds, 1 second)))}
>>> >> > >
>>> >> > >  }
>>> >> >
>>> >> > > from your snippet should be ok.
>>> >> >
>>> >> > > If you are using validate from an Ajax invocation, then you just
>>> need
>>> >> > > to return fadeOutErrors(5 seconds, 1 second) from your Ajax
>>> function.
>>> >> >
>>> >> > > So I guess your ajax function would looks something like:
>>> >> >
>>> >> > > def myDBAjax: JsCmd = {
>>> >> >
>>> >> > >  // do the DB stuff
>>> >> > >  val errors = myMapper.validate
>>

Re: [Lift] Re: highlight the lift notices in some seconds

2009-12-09 Thread Xuefeng Wu
Hello Marius,

I have an other question about S.error.
When I use: S.error("can not delete this department.")

I get:
try{jQuery("#lift__noticesContainer__").each(function(i) {this.innerHTML =
"Errorcan not delete. ";});} catch (e) {}

What I want this
try{jQuery("#*lift__noticesContainer___error*").each(function(i)
{this.innerHTML = "Errorcan not delete. ";});}
catch (e) {}

Why it's lift__noticesContainer__ but not lift__noticesContainer___error?

Did I miss something?



On Tue, Dec 8, 2009 at 9:23 PM, Marius  wrote:

> Yes you need to send down fadeOut... call
>
> def myFunc: JsCmd = {
>  // do some DB stuff
>  vmyMapper.validate match {
>case Nil => Noop
>case xs => S.error(xs); fadeOutErrors(5 seconds, 1 second)
>  }
>
> }
> On Dec 8, 3:01 pm, Xuefeng Wu  wrote:
> > Yes, I do something like
> >  // do the DB stuff
> >  vmyMapper.validate match {
> >case Nil =>
> >case xs => S.error(xs)
> > }
> >
> > But I should always add fadeOutErrors(5 seconds, 1 second)?
> >
> > I want lift highlight every error/notice information.
> >
> >
> >
> > On Tue, Dec 8, 2009 at 5:56 PM, Marius  wrote:
> > > Are you using field validate into an Ajax context or not? If not using
> > > something like:
> >
> > > def howdy = {
> > >S.error("howdy error")
> > >Hello there ++
> > >{Script(OnLoad(fadeOutErrors(5 seconds, 1 second)))}
> > >
> > >  }
> >
> > > from your snippet should be ok.
> >
> > > If you are using validate from an Ajax invocation, then you just need
> > > to return fadeOutErrors(5 seconds, 1 second) from your Ajax function.
> >
> > > So I guess your ajax function would looks something like:
> >
> > > def myDBAjax: JsCmd = {
> >
> > >  // do the DB stuff
> > >  val errors = myMapper.validate
> > >  S.error(errors)
> > >   fadeOutErrors(5 seconds, 1 second)
> > > }
> >
> > > Br's,
> > > Marius
> >
> > > On Dec 8, 10:53 am, Xuefeng Wu  wrote:
> > > > But I use field validate, the notice and error are wrap by lift.
> Should I
> > > > append fadeOutErrors(5 seconds, 1 second)?
> >
> > > > On Tue, Dec 8, 2009 at 4:50 PM, Marius 
> wrote:
> > > > > You don't need to configure anything in boot.
> >
> > > > > Assume this is an Ajax function:
> >
> > > > >  def howdy: JsCmd = {
> > > > >S.error("howdy error")
> > > > >fadeOutErrors(5 seconds, 1 second)
> > > > >  }
> >
> > > > >  ... in your snippet you can say:
> >
> > > > >  SHtml.a(Text("Click me")(howdy _)
> >
> > > > >  If you want to fade out errors in a page and not via Ajax you can
> > > > > use this:
> >
> > > > >  def howdy = {
> > > > >S.error("howdy error")
> > > > >Hello there ++
> > > > >{Script(OnLoad(fadeOutErrors(5 seconds, 1 second)))}
> > > > >
> > > > >  }
> >
> > > > >  which basically says after the page is rendered that after 5
> seconds
> > > > > the error notices will be faded out.
> >
> > > > > Br's,
> > > > > Marius
> >
> > > > > On Dec 8, 9:50 am, Xuefeng Wu  wrote:
> > > > > > Yes, it's my wanted.
> > > > > > How could I configure it at boot?
> >
> > > > > > On Tue, Dec 8, 2009 at 3:44 PM, Marius 
> > > wrote:
> > > > > > > Please see this:
> >
> > >http://groups.google.com/group/liftweb/browse_thread/thread/972562da2.
> > > > > ..
> >
> > > > > > > If you are using Ajax, notices could easily fade out.
> >
> > > > > > > Br's,
> > > > > > > Marius
> >
> > > > > > > On Dec 8, 8:02 am, Xuefeng Wu  wrote:
> > > > > > > > Hi,
> >
> > > > > > > > I want to highlight the lift notice and it will hide when
> > > > > timeout.
> > > > > > > > Should I code every request or only to config lift some
> where?
> >
> > > > > > > > For example:
> > > > > > > > When use put items into the shopping cart, highlight the
> items
> > >

Re: [Lift] Re: highlight the lift notices in some seconds

2009-12-09 Thread Xuefeng Wu
It's not make sense for my project.
I separate business  transaction from UI logic.
When create or update business model will occur notice or error,
and then do something for UI by the business transaction

for example:
business:
def MyBusinessTransaction(v: String) : Option[MyModel] = {
  val myModel = MyModel.create.title(v)
  myModel.validate match {
  case Nil => {myModel.save();Some(myModel)}
  case xs => {S.error(xs);None}
  }
}


Snippet
def doSomething(): JsCmd = MyBusinessTransaction(v) match {
case Some(v) => //do something for UI, such as replace the old value
case None => //notice what's wrong. *I could code ** fadeOutErrors(5
seconds, 1 second) if want, but should I code every where?*
}


Or there're any other practice for separate business from UI?


On Wed, Dec 9, 2009 at 7:45 PM, Philippe Monnaie  wrote:

> You could try:
>
> object Config{
>  def error(xs) = {
> S.error(xs)
>fadeOutErrors(5 seconds, 1 second)
>  }
> }
>
> and call Config.error(xs) instead of S.error(xs)
>
> or something similar. I'm sure someone can come up with a more elegant
> solution than this. Just the first thing that popped into my head.
>
> - Philippe
>
> On Tue, Dec 8, 2009 at 2:26 PM, Xuefeng Wu  wrote:
> > I think It's better I could configure it, but not code every where.
> > On Tue, Dec 8, 2009 at 9:23 PM, Marius  wrote:
> >>
> >> Yes you need to send down fadeOut... call
> >>
> >> def myFunc: JsCmd = {
> >>  // do some DB stuff
> >>  vmyMapper.validate match {
> >>case Nil => Noop
> >>case xs => S.error(xs); fadeOutErrors(5 seconds, 1 second)
> >>  }
> >>
> >> }
> >> On Dec 8, 3:01 pm, Xuefeng Wu  wrote:
> >> > Yes, I do something like
> >> >  // do the DB stuff
> >> >  vmyMapper.validate match {
> >> >case Nil =>
> >> >case xs => S.error(xs)
> >> > }
> >> >
> >> > But I should always add fadeOutErrors(5 seconds, 1 second)?
> >> >
> >> > I want lift highlight every error/notice information.
> >> >
> >> >
> >> >
> >> > On Tue, Dec 8, 2009 at 5:56 PM, Marius 
> wrote:
> >> > > Are you using field validate into an Ajax context or not? If not
> using
> >> > > something like:
> >> >
> >> > > def howdy = {
> >> > >S.error("howdy error")
> >> > >Hello there ++
> >> > >{Script(OnLoad(fadeOutErrors(5 seconds, 1 second)))}
> >> > >
> >> > >  }
> >> >
> >> > > from your snippet should be ok.
> >> >
> >> > > If you are using validate from an Ajax invocation, then you just
> need
> >> > > to return fadeOutErrors(5 seconds, 1 second) from your Ajax
> function.
> >> >
> >> > > So I guess your ajax function would looks something like:
> >> >
> >> > > def myDBAjax: JsCmd = {
> >> >
> >> > >  // do the DB stuff
> >> > >  val errors = myMapper.validate
> >> > >  S.error(errors)
> >> > >   fadeOutErrors(5 seconds, 1 second)
> >> > > }
> >> >
> >> > > Br's,
> >> > > Marius
> >> >
> >> > > On Dec 8, 10:53 am, Xuefeng Wu  wrote:
> >> > > > But I use field validate, the notice and error are wrap by lift.
> >> > > > Should I
> >> > > > append fadeOutErrors(5 seconds, 1 second)?
> >> >
> >> > > > On Tue, Dec 8, 2009 at 4:50 PM, Marius 
> >> > > > wrote:
> >> > > > > You don't need to configure anything in boot.
> >> >
> >> > > > > Assume this is an Ajax function:
> >> >
> >> > > > >  def howdy: JsCmd = {
> >> > > > >S.error("howdy error")
> >> > > > >fadeOutErrors(5 seconds, 1 second)
> >> > > > >  }
> >> >
> >> > > > >  ... in your snippet you can say:
> >> >
> >> > > > >  SHtml.a(Text("Click me")(howdy _)
> >> >
> >> > > > >  If you want to fade out errors in a page and not via Ajax you
> can
> >> > > > > use this:
> >> >
> >> > > > >  def howdy = {
> >> > > > >S.error("howdy erro

Re: [Lift] lift-stamped - Traits for logging changes MetaMapper-Records

2009-12-08 Thread Xuefeng Wu
That's great!

What's more,
I'm not sure whether every model need
creator/createDate,lastUpdator/lastUpdateDate?
I want to have a Action Log, which could record user activities.
Any model change history or change object could restore from action log

Did any one do something about this?


On Wed, Dec 9, 2009 at 10:33 AM, Franz Bettag  wrote:

> Hi guys,
>
> thanks to this great community i could finish a project today which i
> found worth to be made available public.
>
> The topic says it all, check it out at
> https://github.com/fbettag/lift-stamped/
>
> Tell me what you guys think!
>
> best regards
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>
>
>


-- 
Scala中文社区:  http://groups.google.com/group/scalacn

--

You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




Re: [Lift] Re: highlight the lift notices in some seconds

2009-12-08 Thread Xuefeng Wu
I think It's better I could configure it, but not code every where.

On Tue, Dec 8, 2009 at 9:23 PM, Marius  wrote:

> Yes you need to send down fadeOut... call
>
> def myFunc: JsCmd = {
>  // do some DB stuff
>  vmyMapper.validate match {
>case Nil => Noop
>case xs => S.error(xs); fadeOutErrors(5 seconds, 1 second)
>  }
>
> }
> On Dec 8, 3:01 pm, Xuefeng Wu  wrote:
> > Yes, I do something like
> >  // do the DB stuff
> >  vmyMapper.validate match {
> >case Nil =>
> >case xs => S.error(xs)
> > }
> >
> > But I should always add fadeOutErrors(5 seconds, 1 second)?
> >
> > I want lift highlight every error/notice information.
> >
> >
> >
> > On Tue, Dec 8, 2009 at 5:56 PM, Marius  wrote:
> > > Are you using field validate into an Ajax context or not? If not using
> > > something like:
> >
> > > def howdy = {
> > >S.error("howdy error")
> > >Hello there ++
> > >{Script(OnLoad(fadeOutErrors(5 seconds, 1 second)))}
> > >
> > >  }
> >
> > > from your snippet should be ok.
> >
> > > If you are using validate from an Ajax invocation, then you just need
> > > to return fadeOutErrors(5 seconds, 1 second) from your Ajax function.
> >
> > > So I guess your ajax function would looks something like:
> >
> > > def myDBAjax: JsCmd = {
> >
> > >  // do the DB stuff
> > >  val errors = myMapper.validate
> > >  S.error(errors)
> > >   fadeOutErrors(5 seconds, 1 second)
> > > }
> >
> > > Br's,
> > > Marius
> >
> > > On Dec 8, 10:53 am, Xuefeng Wu  wrote:
> > > > But I use field validate, the notice and error are wrap by lift.
> Should I
> > > > append fadeOutErrors(5 seconds, 1 second)?
> >
> > > > On Tue, Dec 8, 2009 at 4:50 PM, Marius 
> wrote:
> > > > > You don't need to configure anything in boot.
> >
> > > > > Assume this is an Ajax function:
> >
> > > > >  def howdy: JsCmd = {
> > > > >S.error("howdy error")
> > > > >fadeOutErrors(5 seconds, 1 second)
> > > > >  }
> >
> > > > >  ... in your snippet you can say:
> >
> > > > >  SHtml.a(Text("Click me")(howdy _)
> >
> > > > >  If you want to fade out errors in a page and not via Ajax you can
> > > > > use this:
> >
> > > > >  def howdy = {
> > > > >S.error("howdy error")
> > > > >Hello there ++
> > > > >{Script(OnLoad(fadeOutErrors(5 seconds, 1 second)))}
> > > > >
> > > > >  }
> >
> > > > >  which basically says after the page is rendered that after 5
> seconds
> > > > > the error notices will be faded out.
> >
> > > > > Br's,
> > > > > Marius
> >
> > > > > On Dec 8, 9:50 am, Xuefeng Wu  wrote:
> > > > > > Yes, it's my wanted.
> > > > > > How could I configure it at boot?
> >
> > > > > > On Tue, Dec 8, 2009 at 3:44 PM, Marius 
> > > wrote:
> > > > > > > Please see this:
> >
> > >http://groups.google.com/group/liftweb/browse_thread/thread/972562da2.
> > > > > ..
> >
> > > > > > > If you are using Ajax, notices could easily fade out.
> >
> > > > > > > Br's,
> > > > > > > Marius
> >
> > > > > > > On Dec 8, 8:02 am, Xuefeng Wu  wrote:
> > > > > > > > Hi,
> >
> > > > > > > > I want to highlight the lift notice and it will hide when
> > > > > timeout.
> > > > > > > > Should I code every request or only to config lift some
> where?
> >
> > > > > > > > For example:
> > > > > > > > When use put items into the shopping cart, highlight the
> items
> > > some
> > > > > > > seconds
> > > > > > > > to notice the user.
> >
> > > > > > > > --
> > > > > > > > Scala中文社区:  http://groups.google.com/group/scalacn
> >
> > > > > > > --
> >
> > > > > > > You received this message because you are subscribed to the
> Google
> > > > > Groups
> > >

Re: [Lift] Re: highlight the lift notices in some seconds

2009-12-08 Thread Xuefeng Wu
Yes, I do something like
 // do the DB stuff
 vmyMapper.validate match {
   case Nil =>
   case xs => S.error(xs)
}

But I should always add fadeOutErrors(5 seconds, 1 second)?

I want lift highlight every error/notice information.


On Tue, Dec 8, 2009 at 5:56 PM, Marius  wrote:

> Are you using field validate into an Ajax context or not? If not using
> something like:
>
> def howdy = {
>S.error("howdy error")
>Hello there ++
>{Script(OnLoad(fadeOutErrors(5 seconds, 1 second)))}
>
>  }
>
> from your snippet should be ok.
>
> If you are using validate from an Ajax invocation, then you just need
> to return fadeOutErrors(5 seconds, 1 second) from your Ajax function.
>
> So I guess your ajax function would looks something like:
>
> def myDBAjax: JsCmd = {
>
>  // do the DB stuff
>  val errors = myMapper.validate
>  S.error(errors)
>   fadeOutErrors(5 seconds, 1 second)
> }
>
>
> Br's,
> Marius
>
> On Dec 8, 10:53 am, Xuefeng Wu  wrote:
> > But I use field validate, the notice and error are wrap by lift. Should I
> > append fadeOutErrors(5 seconds, 1 second)?
> >
> >
> >
> > On Tue, Dec 8, 2009 at 4:50 PM, Marius  wrote:
> > > You don't need to configure anything in boot.
> >
> > > Assume this is an Ajax function:
> >
> > >  def howdy: JsCmd = {
> > >S.error("howdy error")
> > >fadeOutErrors(5 seconds, 1 second)
> > >  }
> >
> > >  ... in your snippet you can say:
> >
> > >  SHtml.a(Text("Click me")(howdy _)
> >
> > >  If you want to fade out errors in a page and not via Ajax you can
> > > use this:
> >
> > >  def howdy = {
> > >S.error("howdy error")
> > >Hello there ++
> > >{Script(OnLoad(fadeOutErrors(5 seconds, 1 second)))}
> > >
> > >  }
> >
> > >  which basically says after the page is rendered that after 5 seconds
> > > the error notices will be faded out.
> >
> > > Br's,
> > > Marius
> >
> > > On Dec 8, 9:50 am, Xuefeng Wu  wrote:
> > > > Yes, it's my wanted.
> > > > How could I configure it at boot?
> >
> > > > On Tue, Dec 8, 2009 at 3:44 PM, Marius 
> wrote:
> > > > > Please see this:
> >
> > > > >
> http://groups.google.com/group/liftweb/browse_thread/thread/972562da2.
> > > ..
> >
> > > > > If you are using Ajax, notices could easily fade out.
> >
> > > > > Br's,
> > > > > Marius
> >
> > > > > On Dec 8, 8:02 am, Xuefeng Wu  wrote:
> > > > > > Hi,
> >
> > > > > > I want to highlight the lift notice and it will hide when
> > > timeout.
> > > > > > Should I code every request or only to config lift some where?
> >
> > > > > > For example:
> > > > > > When use put items into the shopping cart, highlight the items
> some
> > > > > seconds
> > > > > > to notice the user.
> >
> > > > > > --
> > > > > > Scala中文社区:  http://groups.google.com/group/scalacn
> >
> > > > > --
> >
> > > > > You received this message because you are subscribed to the Google
> > > Groups
> > > > > "Lift" group.
> > > > > To post to this group, send email to lift...@googlegroups.com.
> > > > > To unsubscribe from this group, send email to
> > > > > liftweb+unsubscr...@googlegroups.com
> 
> >
> > > 
> 
> >
> >
> > > > > .
> > > > > For more options, visit this group at
> > > > >http://groups.google.com/group/liftweb?hl=en.
> >
> > > > --
> > > > Scala中文社区:  http://groups.google.com/group/scalacn
> >
> > > --
> >
> > > You received this message because you are subscribed to the Google
> Groups
> > > "Lift" group.
> > > To post to this group, send email to lift...@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > > liftweb+unsubscr...@googlegroups.com
> 
> >
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/liftweb?hl=en.
> >
> > --
> > Scala中文社区:  http://groups.google.com/group/scalacn
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>
>
>


-- 
Scala中文社区:  http://groups.google.com/group/scalacn

--

You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




Re: [Lift] Re: highlight the lift notices in some seconds

2009-12-08 Thread Xuefeng Wu
But I use field validate, the notice and error are wrap by lift. Should I
append fadeOutErrors(5 seconds, 1 second)?


On Tue, Dec 8, 2009 at 4:50 PM, Marius  wrote:

> You don't need to configure anything in boot.
>
> Assume this is an Ajax function:
>
>  def howdy: JsCmd = {
>S.error("howdy error")
>fadeOutErrors(5 seconds, 1 second)
>  }
>
>  ... in your snippet you can say:
>
>  SHtml.a(Text("Click me")(howdy _)
>
>  If you want to fade out errors in a page and not via Ajax you can
> use this:
>
>  def howdy = {
>S.error("howdy error")
>Hello there ++
>{Script(OnLoad(fadeOutErrors(5 seconds, 1 second)))}
>
>  }
>
>  which basically says after the page is rendered that after 5 seconds
> the error notices will be faded out.
>
>
> Br's,
> Marius
>
> On Dec 8, 9:50 am, Xuefeng Wu  wrote:
> > Yes, it's my wanted.
> > How could I configure it at boot?
> >
> >
> >
> > On Tue, Dec 8, 2009 at 3:44 PM, Marius  wrote:
> > > Please see this:
> >
> > >http://groups.google.com/group/liftweb/browse_thread/thread/972562da2.
> ..
> >
> > > If you are using Ajax, notices could easily fade out.
> >
> > > Br's,
> > > Marius
> >
> > > On Dec 8, 8:02 am, Xuefeng Wu  wrote:
> > > > Hi,
> >
> > > > I want to highlight the lift notice and it will hide when
> timeout.
> > > > Should I code every request or only to config lift some where?
> >
> > > > For example:
> > > > When use put items into the shopping cart, highlight the items some
> > > seconds
> > > > to notice the user.
> >
> > > > --
> > > > Scala中文社区:  http://groups.google.com/group/scalacn
> >
> > > --
> >
> > > You received this message because you are subscribed to the Google
> Groups
> > > "Lift" group.
> > > To post to this group, send email to lift...@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > > liftweb+unsubscr...@googlegroups.com
> 
> >
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/liftweb?hl=en.
> >
> > --
> > Scala中文社区:  http://groups.google.com/group/scalacn
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>
>
>


-- 
Scala中文社区:  http://groups.google.com/group/scalacn

--

You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




Re: [Lift] Re: highlight the lift notices in some seconds

2009-12-07 Thread Xuefeng Wu
Yes, it's my wanted.
How could I configure it at boot?

On Tue, Dec 8, 2009 at 3:44 PM, Marius  wrote:

> Please see this:
>
> http://groups.google.com/group/liftweb/browse_thread/thread/972562da2c40ce88/ea30455fc11d4e1f?hl=en&lnk=gst&q=notice+fade#ea30455fc11d4e1f
>
> If you are using Ajax, notices could easily fade out.
>
> Br's,
> Marius
>
> On Dec 8, 8:02 am, Xuefeng Wu  wrote:
> > Hi,
> >
> > I want to highlight the lift notice and it will hide when timeout.
> > Should I code every request or only to config lift some where?
> >
> > For example:
> > When use put items into the shopping cart, highlight the items some
> seconds
> > to notice the user.
> >
> > --
> > Scala中文社区:  http://groups.google.com/group/scalacn
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>
>
>


-- 
Scala中文社区:  http://groups.google.com/group/scalacn

--

You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




[Lift] highlight the lift notices in some seconds

2009-12-07 Thread Xuefeng Wu
Hi,

I want to highlight the lift notice and it will hide when timeout.
Should I code every request or only to config lift some where?

For example:
When use put items into the shopping cart, highlight the items some seconds
to notice the user.

-- 
Scala中文社区:  http://groups.google.com/group/scalacn

--

You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




Re: [Lift] Re: Fwd: Watch Foursquare Lift talk live from NY

2009-12-07 Thread Xuefeng Wu
6:30 p.m. the time zone is -8:00?

On Tue, Dec 8, 2009 at 12:58 PM, David Pollak  wrote:

>
>
> On Mon, Dec 7, 2009 at 8:50 PM, Mateo Barraza wrote:
>
>> I can't seem to be able to download the talk. Anyone else having problems?
>>
>
> Yeah...  n8han's uploading the video elsewhere... we'll send around an URL
> once we get one.
>
>
>>
>> M>
>>
>> On Mon, Dec 7, 2009 at 7:59 PM, Peter Robinett 
>> wrote:
>> > If you missed the talk you can download it from the same link. It's a
>> > good one.
>> >
>> > One thing mentioned briefly in the talk that I'd like to know more
>> > about is oAuth Server code. Is anyone working on that? How can I help?
>> >
>> > Peter
>> >
>> > On Dec 7, 3:16 pm, David Pollak  wrote:
>> >> -- Forwarded message --
>> >> From: Dave Briccetti 
>> >> Date: Mon, Dec 7, 2009 at 3:15 PM
>> >> Subject: Watch Foursquare Lift talk live from NY
>> >> To: Bay Area Scala Enthusiasts 
>> >>
>> >> http://www.justin.tv/n8han
>> >>
>> >> --
>> >>
>> >> You received this message because you are subscribed to the Google
>> Groups
>> >> "Bay Area Scala Enthusiasts" group.
>> >> To post to this group, send email to scala-b...@googlegroups.com.
>> >> To unsubscribe from this group, send email to
>> >> scala-base+unsubscr...@googlegroups.com
>> 
>> >
>> >> .
>> >> For more options, visit this group athttp://
>> groups.google.com/group/scala-base?hl=en.
>> >>
>> >> --
>> >> Lift, the simply functional web frameworkhttp://liftweb.net
>> >> Beginning Scalahttp://www.apress.com/book/view/1430219890
>> >> Follow me:http://twitter.com/dpp
>> >> Surf the harmonics
>> >
>> > --
>> >
>> > You received this message because you are subscribed to the Google
>> Groups "Lift" group.
>> > To post to this group, send email to lift...@googlegroups.com.
>> > To unsubscribe from this group, send email to
>> liftweb+unsubscr...@googlegroups.com
>> .
>> > For more options, visit this group at
>> http://groups.google.com/group/liftweb?hl=en.
>> >
>> >
>> >
>>
>> --
>>
>> You received this message because you are subscribed to the Google Groups
>> "Lift" group.
>> To post to this group, send email to lift...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> liftweb+unsubscr...@googlegroups.com
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/liftweb?hl=en.
>>
>>
>>
>
>
> --
> Lift, the simply functional web framework http://liftweb.net
> Beginning Scala http://www.apress.com/book/view/1430219890
>
> Follow me: http://twitter.com/dpp
> Surf the harmonics
>
> --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>



-- 
Scala中文社区:  http://groups.google.com/group/scalacn

--

You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




Re: [Lift] Sharing data between snippet functions during a single HTTP request

2009-12-07 Thread Xuefeng Wu
Hi David & Ross,

Thank you for your help,
I understand RequestVar now, which muse be used in the same request.

My case is that I have a tree and a separate button.
When use click the tree node, the separate button should know which node is
selected.

Right now I replace the separate button when use click the tree node and it
worked.
I don't want to use session and I think it's better not replace the button.
But I don't have idea how to do.

On Tue, Dec 8, 2009 at 12:49 PM, David Pollak  wrote:

>
>
> On Mon, Dec 7, 2009 at 8:46 PM, Xuefeng Wu  wrote:
>
>> My current solution is that when user select a tree node, I replace the
>> add button dependence on the node.
>
>
> If you can create a very simple example of what you're trying to do, we can
> help you debug the actual, runnable code.
>
>
>>
>>
>> 2009/12/8 Xuefeng Wu 
>>
>> Hi Ross,
>>>
>>> Yes it's not in the same request.
>>>
>>> My case is:
>>> When user select a tree node, I want to store this nodeId and If user
>>> click a button to create a child node, I want to get the selected node.
>>>
>>> I use ModalDialog when user click the button to create now node.
>>>
>>> On Tue, Dec 8, 2009 at 11:50 AM, Ross Mellgren  wrote:
>>>
>>>> I'm sorry, I'm having trouble following your code, I think too much of
>>>> the surrounding code and templates is missing for me to reason about why 
>>>> you
>>>> would have a problem.
>>>>
>>>> I set up a quick example app, so maybe the code from that will help you.
>>>> It is here:
>>>>
>>>> http://github.com/Dridus/test-rqvarlog
>>>>
>>>> If I understand you correctly, you're getting a log message like this
>>>> one:
>>>> WARN - RequestVar test.snippet.HelloWorld$myVar$_ was set but not read
>>>>
>>>> This message is from the code I posted:
>>>>
>>>> package test.snippet
>>>>
>>>> import _root_.scala.xml.NodeSeq
>>>> import _root_.net.liftweb.http.RequestVar
>>>> import _root_.net.liftweb.util.Helpers
>>>> import Helpers._
>>>>
>>>> class HelloWorld {
>>>> object myVar extends RequestVar[Int](0)
>>>>
>>>> def howdy(in: NodeSeq): NodeSeq = Helpers.bind("b", in, "time" ->
>>>> (new _root_.java.util.Date).toString)
>>>>
>>>> def increment(in: NodeSeq): NodeSeq = {
>>>> myVar.set(myVar.is + 1)
>>>>     increment called
>>>> }
>>>>
>>>> def show(in: NodeSeq): NodeSeq = show called -- myVar.is {
>>>> myVar.is }
>>>> }
>>>>
>>>>
>>>> 
>>>> Welcome to your project!
>>>>  
>>>>   
>>>> Welcome to test-rqvarlog at 
>>>>   
>>>>
>>>>   
>>>>   
>>>> 
>>>> 
>>>> 
>>>>
>>>> If I uncomment the line with HelloWorld.show in the template, the log
>>>> message goes away because myVar.is is called.
>>>>
>>>> If you are still getting the message, then that should mean that you are
>>>> not calling myVar.is in the same request.
>>>>
>>>> HTH,
>>>> -Ross
>>>>
>>>> On Dec 7, 2009, at 10:28 PM, Xuefeng Wu wrote:
>>>>
>>>> My code :
>>>>
>>>>
>>>> object CompetenceMgr {
>>>>
>>>>  Menu(Loc("Competence", List("competence", "index"), S.?("Competence"),
>>>> ifIsLoggedIn,
>>>>  ...
>>>>  Loc.Snippet("buildCompetenceDicRows", buildCompetenceDicRows),
>>>>Loc.Snippet("addCompetenceB", addCompetenceB),
>>>> 
>>>>
>>>> private object *_categoryId *extends RequestVar[Long](0)
>>>>
>>>> //build a competenceDic table
>>>>   def buildCompetenceDicRows(xhtml: NodeSeq): NodeSeq = {
>>>> ... ...
>>>> def *makeCategoryRow*(r: Category) = {
>>>>  .
>>>>def *categoryNode*: NodeSeq = {
>>>>def categoryNodeLinkId = "categoryNodeLinkId-" + r.id
>>>>def selectCategoryNode: JsCmd = {
>>>> * /

Re: [Lift] Sharing data between snippet functions during a single HTTP request

2009-12-07 Thread Xuefeng Wu
My current solution is that when user select a tree node, I replace the add
button dependence on the node.


2009/12/8 Xuefeng Wu 

> Hi Ross,
>
> Yes it's not in the same request.
>
> My case is:
> When user select a tree node, I want to store this nodeId and If user click
> a button to create a child node, I want to get the selected node.
>
> I use ModalDialog when user click the button to create now node.
>
> On Tue, Dec 8, 2009 at 11:50 AM, Ross Mellgren  wrote:
>
>> I'm sorry, I'm having trouble following your code, I think too much of the
>> surrounding code and templates is missing for me to reason about why you
>> would have a problem.
>>
>> I set up a quick example app, so maybe the code from that will help you.
>> It is here:
>>
>> http://github.com/Dridus/test-rqvarlog
>>
>> If I understand you correctly, you're getting a log message like this one:
>> WARN - RequestVar test.snippet.HelloWorld$myVar$_ was set but not read
>>
>> This message is from the code I posted:
>>
>> package test.snippet
>>
>> import _root_.scala.xml.NodeSeq
>> import _root_.net.liftweb.http.RequestVar
>> import _root_.net.liftweb.util.Helpers
>> import Helpers._
>>
>> class HelloWorld {
>> object myVar extends RequestVar[Int](0)
>>
>> def howdy(in: NodeSeq): NodeSeq = Helpers.bind("b", in, "time" -> (new
>> _root_.java.util.Date).toString)
>>
>> def increment(in: NodeSeq): NodeSeq = {
>> myVar.set(myVar.is + 1)
>> increment called
>> }
>>
>> def show(in: NodeSeq): NodeSeq = show called -- myVar.is {
>> myVar.is }
>> }
>>
>>
>> 
>> Welcome to your project!
>> 
>>   
>> Welcome to test-rqvarlog at 
>>   
>>
>>   
>>   
>> 
>> 
>> 
>>
>> If I uncomment the line with HelloWorld.show in the template, the log
>> message goes away because myVar.is is called.
>>
>> If you are still getting the message, then that should mean that you are
>> not calling myVar.is in the same request.
>>
>> HTH,
>> -Ross
>>
>> On Dec 7, 2009, at 10:28 PM, Xuefeng Wu wrote:
>>
>> My code :
>>
>>
>> object CompetenceMgr {
>>
>>  Menu(Loc("Competence", List("competence", "index"), S.?("Competence"),
>> ifIsLoggedIn,
>>  ...
>>  Loc.Snippet("buildCompetenceDicRows", buildCompetenceDicRows),
>>Loc.Snippet("addCompetenceB", addCompetenceB),
>> 
>>
>> private object *_categoryId *extends RequestVar[Long](0)
>>
>> //build a competenceDic table
>>   def buildCompetenceDicRows(xhtml: NodeSeq): NodeSeq = {
>> ... ...
>> def *makeCategoryRow*(r: Category) = {
>>  .
>>def *categoryNode*: NodeSeq = {
>>def categoryNodeLinkId = "categoryNodeLinkId-" + r.id
>>def selectCategoryNode: JsCmd = {
>> * //here: set the _categoryId, but didn't work*
>>   _categoryId.set(r.id.is)
>>  ... ..
>>}
>>  {a(() =>
>> selectCategoryNode, Text(r.title.is))}
>>}
>>>  id={categoeryId}>{categoryNode} % ("id" -> nodeId) %
>> ("class" -> nodeClass)
>> }
>> def *buildCategoryRows*: NodeSeq = {
>>   val resourceData = Category.categoriesTreeList
>>   (empty /: resourceData)((l, r) => l ++ *makeCategoryRow*(r))
>>   }
>>  *buildCategoryRows*
>>   }
>>
>>   //it's a button for create competence
>>  def *addCompetenceB*(xhtml: NodeSeq): NodeSeq = doCompetenceB(xhtml,"add
>> Competence",null)
>>  //a button for create or edit competence
>>   def *doCompetenceB*(xhtml: NodeSeq,msg: String,competence: Competence):
>> NodeSeq = {
>> a(() => {
>>   *//here I try to get the categoryId if it selected.*
>>   val catId: Long = _categoryId.is
>>  S.runTemplate(List("competence","_competence")).
>>  map(ns =>
>> ModalDialog(doCompetenceEditor(ns,catId,competence))) openOr
>>  Alert("Couldn't find _competence template")},
>>  Text(msg),"class" -> "button"
>>   )
>>   }
>>
>>
>>
>>
>> On Tue, Dec 8, 2

Re: [Lift] Sharing data between snippet functions during a single HTTP request

2009-12-07 Thread Xuefeng Wu
Hi Ross,

Yes it's not in the same request.

My case is:
When user select a tree node, I want to store this nodeId and If user click
a button to create a child node, I want to get the selected node.

I use ModalDialog when user click the button to create now node.

On Tue, Dec 8, 2009 at 11:50 AM, Ross Mellgren  wrote:

> I'm sorry, I'm having trouble following your code, I think too much of the
> surrounding code and templates is missing for me to reason about why you
> would have a problem.
>
> I set up a quick example app, so maybe the code from that will help you. It
> is here:
>
> http://github.com/Dridus/test-rqvarlog
>
> If I understand you correctly, you're getting a log message like this one:
> WARN - RequestVar test.snippet.HelloWorld$myVar$_ was set but not read
>
> This message is from the code I posted:
>
> package test.snippet
>
> import _root_.scala.xml.NodeSeq
> import _root_.net.liftweb.http.RequestVar
> import _root_.net.liftweb.util.Helpers
> import Helpers._
>
> class HelloWorld {
> object myVar extends RequestVar[Int](0)
>
> def howdy(in: NodeSeq): NodeSeq = Helpers.bind("b", in, "time" -> (new
> _root_.java.util.Date).toString)
>
> def increment(in: NodeSeq): NodeSeq = {
> myVar.set(myVar.is + 1)
> increment called
> }
>
> def show(in: NodeSeq): NodeSeq = show called -- myVar.is {
> myVar.is }
> }
>
>
> 
> Welcome to your project!
> 
>   
> Welcome to test-rqvarlog at 
>   
>
>   
>   
> 
> 
> 
>
> If I uncomment the line with HelloWorld.show in the template, the log
> message goes away because myVar.is is called.
>
> If you are still getting the message, then that should mean that you are
> not calling myVar.is in the same request.
>
> HTH,
> -Ross
>
> On Dec 7, 2009, at 10:28 PM, Xuefeng Wu wrote:
>
> My code :
>
>
> object CompetenceMgr {
>
>  Menu(Loc("Competence", List("competence", "index"), S.?("Competence"),
> ifIsLoggedIn,
>  ...
>  Loc.Snippet("buildCompetenceDicRows", buildCompetenceDicRows),
>Loc.Snippet("addCompetenceB", addCompetenceB),
> 
>
> private object *_categoryId *extends RequestVar[Long](0)
>
> //build a competenceDic table
>   def buildCompetenceDicRows(xhtml: NodeSeq): NodeSeq = {
> ... ...
> def *makeCategoryRow*(r: Category) = {
>  .
>def *categoryNode*: NodeSeq = {
>def categoryNodeLinkId = "categoryNodeLinkId-" + r.id
>def selectCategoryNode: JsCmd = {
> * //here: set the _categoryId, but didn't work*
>   _categoryId.set(r.id.is)
>  ... ..
>}
>  {a(() =>
> selectCategoryNode, Text(r.title.is))}
>}
>  id={categoeryId}>{categoryNode} % ("id" -> nodeId) %
> ("class" -> nodeClass)
> }
> def *buildCategoryRows*: NodeSeq = {
>   val resourceData = Category.categoriesTreeList
>   (empty /: resourceData)((l, r) => l ++ *makeCategoryRow*(r))
>   }
>  *buildCategoryRows*
>   }
>
>   //it's a button for create competence
>  def *addCompetenceB*(xhtml: NodeSeq): NodeSeq = doCompetenceB(xhtml,"add
> Competence",null)
>  //a button for create or edit competence
>   def *doCompetenceB*(xhtml: NodeSeq,msg: String,competence: Competence):
> NodeSeq = {
> a(() => {
>   *//here I try to get the categoryId if it selected.*
>   val catId: Long = _categoryId.is
>  S.runTemplate(List("competence","_competence")).
>  map(ns =>
> ModalDialog(doCompetenceEditor(ns,catId,competence))) openOr
>  Alert("Couldn't find _competence template")},
>  Text(msg),"class" -> "button"
>   )
>   }
>
>
>
>
> On Tue, Dec 8, 2009 at 11:02 AM, Ross Mellgren  wrote:
>
>> Well if you logically expected it to be read but it wasn't, it might
>> indicate a bug to you or help in diagnosis.
>>
>> I'm not sure I understand your reply fully -- when you added myId.is did
>> the log message go away? If not, could you post your code?
>>
>> -Ross
>>
>> On Dec 7, 2009, at 9:39 PM, Xuefeng Wu wrote:
>>
>> I use myId.is but get nothing.
>> I don't know what I could do with the information.
>>
>> On Tue, Dec 8, 2009 at 10:19 AM, Ross Mellgren  wrote:
>>
>>> I think that message is just infor

Re: [Lift] Sharing data between snippet functions during a single HTTP request

2009-12-07 Thread Xuefeng Wu
My code :


object CompetenceMgr {

 Menu(Loc("Competence", List("competence", "index"), S.?("Competence"),
ifIsLoggedIn,
 ...
 Loc.Snippet("buildCompetenceDicRows", buildCompetenceDicRows),
   Loc.Snippet("addCompetenceB", addCompetenceB),


private object *_categoryId *extends RequestVar[Long](0)

//build a competenceDic table
  def buildCompetenceDicRows(xhtml: NodeSeq): NodeSeq = {
... ...
def *makeCategoryRow*(r: Category) = {
 .
   def *categoryNode*: NodeSeq = {
   def categoryNodeLinkId = "categoryNodeLinkId-" + r.id
   def selectCategoryNode: JsCmd = {
* //here: set the _categoryId, but didn't work*
  _categoryId.set(r.id.is)
 ... ..
   }
 {a(() =>
selectCategoryNode, Text(r.title.is))}
   }
   {categoryNode} % ("id" -> nodeId) %
("class" -> nodeClass)
}
def *buildCategoryRows*: NodeSeq = {
  val resourceData = Category.categoriesTreeList
  (empty /: resourceData)((l, r) => l ++ *makeCategoryRow*(r))
  }
 *buildCategoryRows*
  }

  //it's a button for create competence
 def *addCompetenceB*(xhtml: NodeSeq): NodeSeq = doCompetenceB(xhtml,"add
Competence",null)
 //a button for create or edit competence
  def *doCompetenceB*(xhtml: NodeSeq,msg: String,competence: Competence):
NodeSeq = {
a(() => {
  *//here I try to get the categoryId if it selected.*
  val catId: Long = _categoryId.is
 S.runTemplate(List("competence","_competence")).
 map(ns => ModalDialog(doCompetenceEditor(ns,catId,competence)))
openOr
 Alert("Couldn't find _competence template")},
 Text(msg),"class" -> "button"
  )
  }




On Tue, Dec 8, 2009 at 11:02 AM, Ross Mellgren  wrote:

> Well if you logically expected it to be read but it wasn't, it might
> indicate a bug to you or help in diagnosis.
>
> I'm not sure I understand your reply fully -- when you added myId.is did
> the log message go away? If not, could you post your code?
>
> -Ross
>
> On Dec 7, 2009, at 9:39 PM, Xuefeng Wu wrote:
>
> I use myId.is but get nothing.
> I don't know what I could do with the information.
>
> On Tue, Dec 8, 2009 at 10:19 AM, Ross Mellgren  wrote:
>
>> I think that message is just informative, letting you know that you don't
>> seem to be using the request var fully (perhaps due to typo, or code
>> refactoring that made it unused, or something.)
>>
>> I think it'll go away if you access the variable somewhere using myId.is.
>>
>> -Ross
>>
>> On Dec 7, 2009, at 9:02 PM, Xuefeng Wu wrote:
>>
>> Hi ,
>>
>> When I use RequestVar get the message: RequestVar ... was set but not
>> read
>>
>> My code like this:
>> object MyMgr {
>>   ...
>>   Loc.Snippet("myFoo",myFoo)
>>  ...
>>object myId extends RequestVar[Long](0)
>>
>>def myFoo(xhtml: NodeSeq): NodeSeq = {
>> 
>> def selectNode = {
>>
>> myId .set(vId)
>>
>> }
>> 
>>bind("",xhtml,
>>  "node"->a(() => selectNode, Text(nodeName))
>> )
>>}
>>
>> }
>>
>> the RequestVar must be used at Class?
>>
>> On Sat, Nov 21, 2009 at 12:09 AM, Ross Mellgren  wrote:
>>
>>> RequestVar is the standard way of doing this. For example
>>>
>>> object MySharedInformation {
>>> object myData extends RequestVar[List[Thing]](loadThings)
>>> //   ^^^  ^^
>>> //Type of thing to store  How to initialize
>>> variable first time it's accessed
>>>
>>> private def loadThings: List[Thing] = ...
>>> }
>>>
>>> class Snippet1 {
>>> import MySharedInformation.myData
>>> def render(ns: NodeSeq): NodeSeq = {
>>> myData.is.map(thing => { ... })
>>> }
>>> }
>>>
>>> class Snippet2 {
>>> import MySharedInformation.myData
>>> ...
>>> }
>>>
>>> The lifetime of the value is during the current request processing and
>>> any AJAX calls related to it.
>>>
>>> If you really want to initialize it in a snippet, then use a Box with
>>> a RequestVar, like this:
>>>
>>> object MySharedI

Re: [Lift] Sharing data between snippet functions during a single HTTP request

2009-12-07 Thread Xuefeng Wu
I use myId.is but get nothing.
I don't know what I could do with the information.

On Tue, Dec 8, 2009 at 10:19 AM, Ross Mellgren  wrote:

> I think that message is just informative, letting you know that you don't
> seem to be using the request var fully (perhaps due to typo, or code
> refactoring that made it unused, or something.)
>
> I think it'll go away if you access the variable somewhere using myId.is.
>
> -Ross
>
> On Dec 7, 2009, at 9:02 PM, Xuefeng Wu wrote:
>
> Hi ,
>
> When I use RequestVar get the message: RequestVar ... was set but not
> read
>
> My code like this:
> object MyMgr {
>   ...
>   Loc.Snippet("myFoo",myFoo)
>  ...
>object myId extends RequestVar[Long](0)
>
>def myFoo(xhtml: NodeSeq): NodeSeq = {
> 
> def selectNode = {
>
> myId .set(vId)
>
> }
> 
>bind("",xhtml,
>  "node"->a(() => selectNode, Text(nodeName))
> )
>}
>
> }
>
> the RequestVar must be used at Class?
>
> On Sat, Nov 21, 2009 at 12:09 AM, Ross Mellgren  wrote:
>
>> RequestVar is the standard way of doing this. For example
>>
>> object MySharedInformation {
>> object myData extends RequestVar[List[Thing]](loadThings)
>> //   ^^^  ^^
>> //Type of thing to store  How to initialize
>> variable first time it's accessed
>>
>> private def loadThings: List[Thing] = ...
>> }
>>
>> class Snippet1 {
>> import MySharedInformation.myData
>> def render(ns: NodeSeq): NodeSeq = {
>> myData.is.map(thing => { ... })
>> }
>> }
>>
>> class Snippet2 {
>> import MySharedInformation.myData
>> ...
>> }
>>
>> The lifetime of the value is during the current request processing and
>> any AJAX calls related to it.
>>
>> If you really want to initialize it in a snippet, then use a Box with
>> a RequestVar, like this:
>>
>> object MySharedInformation {
>> object myData extends RequestVar[Box[List[Thing]]](Empty)
>> }
>>
>> class LoaderSnippet {
>> import MySharedInformation.myData
>> def render(ns: NodeSeq): NodeSeq = {
>> myData.set(Full(...))
>> }
>> }
>>
>> class ReaderSnippet {
>> import MySharedInformation.myData
>> def render(ns: NodeSeq): NodeSeq = {
>> // If the data has not been loaded, default to an empty list
>> val data = myData.is.openOr(Nil)
>> ...
>> }
>> }
>>
>> class OtherReaderSnippet {
>> import MySharedInformation.myData
>> def render(ns: NodeSeq): NodeSeq = {
>> // Do two entirely different things if the data has versus
>> has not been loaded
>> myData.is match {
>> case Full(data) => // do something when the data has been
>> loaded
>> case _ => // do something when the data has not been loaded
>> }
>> }
>> }
>>
>> HTH,
>> -Ross
>>
>>
>> On Nov 20, 2009, at 10:59 AM, Alex Black wrote:
>>
>> > I've got a template page, say foobar.html, that makes a number of
>> > calls to functions in a snippet, e.g. mysnippet.foo1, mysnippet.foo2,
>> > mysnippet.foo3.
>> >
>> > I'd like to do some initial work in foo1, e.g. retrieve some data and
>> > do some work on it, then in foo2 and foo3 display parts of that data.
>> >
>> > Whats the easiest way to do this? I think I misunderstood the lift
>> > book:
>> >
>> > "That means that for each request, Lift creates a new instance of the
>> > snippet class to execute. Any changes you make to instance variables
>> > will be discarded after the request is processed."
>> >
>> > I thought this meant that for a given HTTP request, there would be one
>> > (and only one) instance of my snippet, so I could call several of its
>> > methods and they could all access the snippet's member variables,
>> > which would then be discarded at the end of the request.
>> >
>> > Am I going about this wrong? should I only have one snippet function
>> > per template?
>> >
>> > Thx
>> >
>> > - Alex
>> >
>> > --
>> >
>> > You received this message because you are subscribed to the Google
>> 

Re: [Lift] Sharing data between snippet functions during a single HTTP request

2009-12-07 Thread Xuefeng Wu
Hi ,

When I use RequestVar get the message: RequestVar ... was set but not
read

My code like this:
object MyMgr {
  ...
  Loc.Snippet("myFoo",myFoo)
 ...
   object myId extends RequestVar[Long](0)

   def myFoo(xhtml: NodeSeq): NodeSeq = {

def selectNode = {

myId .set(vId)

}

   bind("",xhtml,
 "node"->a(() => selectNode, Text(nodeName))
)
   }

}

the RequestVar must be used at Class?

On Sat, Nov 21, 2009 at 12:09 AM, Ross Mellgren  wrote:

> RequestVar is the standard way of doing this. For example
>
> object MySharedInformation {
> object myData extends RequestVar[List[Thing]](loadThings)
> //   ^^^  ^^
> //Type of thing to store  How to initialize
> variable first time it's accessed
>
> private def loadThings: List[Thing] = ...
> }
>
> class Snippet1 {
> import MySharedInformation.myData
> def render(ns: NodeSeq): NodeSeq = {
> myData.is.map(thing => { ... })
> }
> }
>
> class Snippet2 {
> import MySharedInformation.myData
> ...
> }
>
> The lifetime of the value is during the current request processing and
> any AJAX calls related to it.
>
> If you really want to initialize it in a snippet, then use a Box with
> a RequestVar, like this:
>
> object MySharedInformation {
> object myData extends RequestVar[Box[List[Thing]]](Empty)
> }
>
> class LoaderSnippet {
> import MySharedInformation.myData
> def render(ns: NodeSeq): NodeSeq = {
> myData.set(Full(...))
> }
> }
>
> class ReaderSnippet {
> import MySharedInformation.myData
> def render(ns: NodeSeq): NodeSeq = {
> // If the data has not been loaded, default to an empty list
> val data = myData.is.openOr(Nil)
> ...
> }
> }
>
> class OtherReaderSnippet {
> import MySharedInformation.myData
> def render(ns: NodeSeq): NodeSeq = {
> // Do two entirely different things if the data has versus
> has not been loaded
> myData.is match {
> case Full(data) => // do something when the data has been
> loaded
> case _ => // do something when the data has not been loaded
> }
> }
> }
>
> HTH,
> -Ross
>
>
> On Nov 20, 2009, at 10:59 AM, Alex Black wrote:
>
> > I've got a template page, say foobar.html, that makes a number of
> > calls to functions in a snippet, e.g. mysnippet.foo1, mysnippet.foo2,
> > mysnippet.foo3.
> >
> > I'd like to do some initial work in foo1, e.g. retrieve some data and
> > do some work on it, then in foo2 and foo3 display parts of that data.
> >
> > Whats the easiest way to do this? I think I misunderstood the lift
> > book:
> >
> > "That means that for each request, Lift creates a new instance of the
> > snippet class to execute. Any changes you make to instance variables
> > will be discarded after the request is processed."
> >
> > I thought this meant that for a given HTTP request, there would be one
> > (and only one) instance of my snippet, so I could call several of its
> > methods and they could all access the snippet's member variables,
> > which would then be discarded at the end of the request.
> >
> > Am I going about this wrong? should I only have one snippet function
> > per template?
> >
> > Thx
> >
> > - Alex
> >
> > --
> >
> > You received this message because you are subscribed to the Google
> > Groups "Lift" group.
> > To post to this group, send email to lift...@googlegroups.com.
> > To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> > .
> > For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=
> > .
> >
> >
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=.
>
>
>


-- 
Scala中文社区:  http://groups.google.com/group/scalacn

--

You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




Re: [Lift] seeing JVM BUG(s) - cancelling interestOps==0

2009-12-07 Thread Xuefeng Wu
Hi David,
   Thank you for your reply.

On Mon, Dec 7, 2009 at 2:27 PM, David Pollak
wrote:

>
>
> On Sun, Dec 6, 2009 at 10:21 PM, Xuefeng Wu  wrote:
>
>> Hi,
>>
>> I always find the information from console:  seeing JVM BUG(s) -
>> cancelling interestOps==0
>>
>> What's the reason?
>>
>> I use jetty 6.1.21, and I'm afraid it will cause serious error if I deploy
>> the liftweb app in IBM WAS(WebSphere  App Server)
>>
>
> http://dev.eclipse.org/mhonarc/lists/jetty-commit/msg00154.html
>
> Looks like Jetty is detecting and working around a bug in the JVM:
> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6403933
>
>
>>
>> --
>> Scala中文社区:  http://groups.google.com/group/scalacn
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Lift" group.
>> To post to this group, send email to lift...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> liftweb+unsubscr...@googlegroups.com
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/liftweb?hl=en.
>>
>
>
>
> --
> Lift, the simply functional web framework http://liftweb.net
> Beginning Scala http://www.apress.com/book/view/1430219890
> Follow me: http://twitter.com/dpp
> Surf the harmonics
>
> --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>



-- 
Scala中文社区:  http://groups.google.com/group/scalacn

--

You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




[Lift] seeing JVM BUG(s) - cancelling interestOps==0

2009-12-06 Thread Xuefeng Wu
Hi,

I always find the information from console:  seeing JVM BUG(s) - cancelling
interestOps==0

What's the reason?

I use jetty 6.1.21, and I'm afraid it will cause serious error if I deploy
the liftweb app in IBM WAS(WebSphere  App Server)

-- 
Scala中文社区:  http://groups.google.com/group/scalacn

--

You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




Re: [Lift] Is this a defect at JqJsCmds.ModalDialog

2009-12-03 Thread Xuefeng Wu
http://github.com/dpp/liftweb/issues/#issue/218

Thanks

On Thu, Dec 3, 2009 at 10:37 PM, Alex Boisvert wrote:

> On Thu, Dec 3, 2009 at 12:40 AM, Xuefeng Wu  wrote:
>
>> Hi,
>>
>> When I use ModalDialog I want to setup the css but fail,
>> My code would be:
>> ModalDialog(someHtml, "top: '10px'")
>>
>> I found the ModalDialog code at Lift:
>> class ModalDialog(html: NodeSeq, css: Box[String]) extends JsCmd {
>> val toJsCmd = "jQuery.blockUI({ message: " +
>> AltXML.toXML(Group(S.session.map(s =>
>> s.fixHtml(s.processSurroundAndInclude("Modal Dialog",
>> html))).openOr(html)), false, true, S.ieMode).encJs +
>> (css.map(w => ",  css: '" + w + "' ").openOr("")) + "});"
>>   }
>>
>> the css is wrap by " '  ' " ,
>> but I found http://malsup.com/jquery/block/#demos
>> the css is wraped by "{ }"
>>
>>
>> Is this a defect at JqJsCmds.ModalDialog or I do something wrong?
>>
>
> Yes, it looks like a bug.   I'm guessing the code may have been written for
> BlockUI v1.x and that the API may have changed in 2.x.Please open a
> ticket and I'll fix it.
>
> alex
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>



-- 
Scala中文社区:  http://groups.google.com/group/scalacn

--

You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




[Lift] Is this a defect at JqJsCmds.ModalDialog

2009-12-03 Thread Xuefeng Wu
Hi,

When I use ModalDialog I want to setup the css but fail,
My code would be:
ModalDialog(someHtml, "top: '10px'")

I found the ModalDialog code at Lift:
class ModalDialog(html: NodeSeq, css: Box[String]) extends JsCmd {
val toJsCmd = "jQuery.blockUI({ message: " +
AltXML.toXML(Group(S.session.map(s =>
s.fixHtml(s.processSurroundAndInclude("Modal Dialog",
html))).openOr(html)), false, true, S.ieMode).encJs +
(css.map(w => ",  css: '" + w + "' ").openOr("")) + "});"
  }

the css is wrap by " '  ' " ,
but I found http://malsup.com/jquery/block/#demos
the css is wraped by "{ }"


Is this a defect at JqJsCmds.ModalDialog or I do something wrong?


-- 
Scala中文社区:  http://groups.google.com/group/scalacn

--

You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




Re: [Lift] Re: Lift and LDAP

2009-11-30 Thread Xuefeng Wu
Thank you for your reply and I will try.

On Mon, Nov 30, 2009 at 6:25 PM, Timothy Perrett wrote:

> Right now there are no plans to implement this, certainly not before
> 2.0 (this is the first time anyone has asked for it) - if you need it
> specifically, it probably wouldn't be too difficult to implement
> within your own application.
>
> Cheers, Tim
>
> On Nov 30, 7:41 am, Xuefeng Wu  wrote:
> > Such ashttp://code.google.com/p/rubycas-client/This CAS client library
> is
> > designed to work easily with Rails.
> >
> > I need a CAS SSO library with Rails.
> >
> > Thanks.
> >
> > On Sat, Nov 28, 2009 at 7:55 PM, Timothy Perrett <
> timo...@getintheloop.eu>wrote:
> >
> >
> >
> >
> >
> > > What kind of integration do you want?
> >
> > > Cheers, Tim
> >
> > > On 28 Nov 2009, at 03:20, Xuefeng Wu wrote:
> >
> > > > Did anyone try to integrate with SSO?
> >
> > > > On Sat, Nov 28, 2009 at 12:37 AM, Marcin Jurczuk  >
> > > wrote:
> > > > That is amazing :)
> >
> > > > Probably I will need to bind to AD in near future, so this module is
> > > > like fallen from heavens :)
> >
> > > > On 27 Lis, 15:11, TylerWeir  wrote:
> > > > >http://jgoday.wordpress.com/2009/11/27/lift-ldap/
> > > > > "One of the requisites to start using Lift at my work, was to use
> LDAP
> > > > > authentification.
> > > > > So i wrote a little module lift-ldap for that and a sample app, it
> was
> > > > > damn simple!"
> >
> > >http://github.com/jgoday/lift-ldaphttp://github.com/jgoday/sample_lif.
> ..
> >
> > > > --
> >
> > > > You received this message because you are subscribed to the Google
> Groups
> > > "Lift" group.
> > > > To post to this group, send email to lift...@googlegroups.com.
> > > > To unsubscribe from this group, send email to
> > > liftweb+unsubscr...@googlegroups.com
> >
> > > .
> > > > For more options, visit this group at
> > >http://groups.google.com/group/liftweb?hl=en.
> >
> > > > --
> > > > Scala中文社区:  http://groups.google.com/group/scalacn
> >
> > > > --
> >
> > > > You received this message because you are subscribed to the Google
> Groups
> > > "Lift" group.
> > > > To post to this group, send email to lift...@googlegroups.com.
> > > > To unsubscribe from this group, send email to
> > > liftweb+unsubscr...@googlegroups.com
> >
> > > .
> > > > For more options, visit this group at
> > >http://groups.google.com/group/liftweb?hl=en.
> >
> > > --
> >
> > > You received this message because you are subscribed to the Google
> Groups
> > > "Lift" group.
> > > To post to this group, send email to lift...@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > > liftweb+unsubscr...@googlegroups.com
> >
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/liftweb?hl=en.
> >
> > --
> > Scala中文社区:  http://groups.google.com/group/scalacn
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>
>
>


-- 
Scala中文社区:  http://groups.google.com/group/scalacn

--

You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




Re: [Lift] Re: Lift and LDAP

2009-11-29 Thread Xuefeng Wu
Such as http://code.google.com/p/rubycas-client/ This CAS client library is
designed to work easily with Rails.

I need a CAS SSO library with Rails.

Thanks.


On Sat, Nov 28, 2009 at 7:55 PM, Timothy Perrett wrote:

> What kind of integration do you want?
>
> Cheers, Tim
>
> On 28 Nov 2009, at 03:20, Xuefeng Wu wrote:
>
> > Did anyone try to integrate with SSO?
> >
> > On Sat, Nov 28, 2009 at 12:37 AM, Marcin Jurczuk 
> wrote:
> > That is amazing :)
> >
> > Probably I will need to bind to AD in near future, so this module is
> > like fallen from heavens :)
> >
> >
> > On 27 Lis, 15:11, TylerWeir  wrote:
> > > http://jgoday.wordpress.com/2009/11/27/lift-ldap/
> > > "One of the requisites to start using Lift at my work, was to use LDAP
> > > authentification.
> > > So i wrote a little module lift-ldap for that and a sample app, it was
> > > damn simple!"
> > >
> > >
> http://github.com/jgoday/lift-ldaphttp://github.com/jgoday/sample_lift_ldap
> >
> > --
> >
> > You received this message because you are subscribed to the Google Groups
> "Lift" group.
> > To post to this group, send email to lift...@googlegroups.com.
> > To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> > For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
> >
> >
> >
> >
> >
> > --
> > Scala中文社区:  http://groups.google.com/group/scalacn
> >
> > --
> >
> > You received this message because you are subscribed to the Google Groups
> "Lift" group.
> > To post to this group, send email to lift...@googlegroups.com.
> > To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> > For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>
>
>


-- 
Scala中文社区:  http://groups.google.com/group/scalacn

--

You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




Re: [Lift] Re: Lift and LDAP

2009-11-27 Thread Xuefeng Wu
Did anyone try to integrate with SSO?

On Sat, Nov 28, 2009 at 12:37 AM, Marcin Jurczuk  wrote:

> That is amazing :)
>
> Probably I will need to bind to AD in near future, so this module is
> like fallen from heavens :)
>
>
> On 27 Lis, 15:11, TylerWeir  wrote:
> > http://jgoday.wordpress.com/2009/11/27/lift-ldap/
> > "One of the requisites to start using Lift at my work, was to use LDAP
> > authentification.
> > So i wrote a little module lift-ldap for that and a sample app, it was
> > damn simple!"
> >
> >
> http://github.com/jgoday/lift-ldaphttp://github.com/jgoday/sample_lift_ldap
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>
>
>


-- 
Scala中文社区:  http://groups.google.com/group/scalacn

--

You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




Re: [Lift] Re: Devoxx 2009

2009-11-22 Thread Xuefeng Wu
Congratulations & Thank you for your great work!


On Sat, Nov 21, 2009 at 10:42 PM, Timothy Perrett
wrote:

> By the way, the slide from my presentation can be found here:
> http://is.gd/50jVi
>
> Cheers, tim
>
> On Nov 21, 3:37 pm, Timothy Perrett  wrote:
> > Folks,
> >
> > I got back from Devoxx late last night and thought I would just post
> > some thoughts and experiences from the event.
> >
> > Firstly, there was an awesome interest in Scala and Lift - my talk was
> > really busy (~550 people) and the general Scala Enthusiast BOF right
> > afterwards was packed.
> >
> > Myself, Bill Venners, Viktor Klang and Frank Sommers pretty much
> > represented a cross-section of Scala projects at the BOF and
> > throughout the whole week we were pretty much swamped with Scala
> > questions and interest. Lift was getting a lot of attention and was
> > even used by Oracle in the Devoxx keynote!!!
> >
> > Another event of note was when myself, viktor and john were sat in the
> > hotel reception hacking on Scala and showing it so some interested
> > people at around 10pm, the JavaPosse turned up and were like "wow, we
> > appear to have stumbled upon the Scala geeks" - they then proceeded to
> > join the hackfest which was über cool.
> >
> > All in all, a very very successful week and I think the above
> > mentioned group did an amazing job of raising the profile of Scala
> > even further; moreover, some of the Lift discussions were brilliant -
> > appeared to be a lot of people wanting to convert from Spring bean
> > hell ;-)
> >
> > We as a team should be made up with the awesome framework that has
> > been created here -- the next 12 months I believe will be somewhat of
> > a Scala / Lift golden age where we have the opportunity to really make
> > our mark on the industry.
> >
> > Congratulations everyone!
> >
> > Cheers, Tim
> >
> > PS: If you were at Devoxx and came to my talk, thanks for
> > attending :-)
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=.
>
>
>


-- 
Scala中文社区:  http://groups.google.com/group/scalacn

--

You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=.




[Lift] How to use TestRunner

2009-11-20 Thread Xuefeng Wu
Hello,

I'm working on lift testkit 1.1-M7 and want to write unit test.

I didn't find ReportFailure, TestKit at testing but found TestRunner
when use TestFramework.

I think it's interesting for mocking DB and web server, but I couldn't
find any help.

Could anyone explain it and give a demo how to use it?

--

You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=.




Re: [Lift] Jetty or Tomcat, Which web container is recommended to use to deploy the Lift app ?

2009-11-19 Thread Xuefeng Wu
Jetty is the better if you use Comet which support  jetty with
Continuations.

On Fri, Nov 20, 2009 at 9:35 AM, Neil.Lv  wrote:

> Hi all,
>
>  I have a silly question about the deploy.
>
>  Which web container is recommended to use to deploy the Lift app ?
> Jetty or Tomcat ?
>
>  I want to use the Comet to push the data in the app.
>
>  * Apache + Tomcat ?
>  * Apache + what  ?
>  * Nginx + what ?
>
>  Thanks for any suggestion !
>
> Cheers,
>  Neil
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=.
>
>
>


-- 
Scala中文社区:  http://groups.google.com/group/scalacn

--

You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=.




[Lift] Re: Novell Pulse, front end by Lift

2009-11-16 Thread Xuefeng Wu

awesome,
There's no flash?

On Nov 11, 2:14 pm, David LaPalomento  wrote:
> I'm glad to hear you like what you've seen so far with Pulse!  I don't
> think we could do half the stuff we're doing without Lift backing us
> up.  Stay tuned, we'll have more than a video to share with the group
> soon :)
>
> David
>
> On Nov 8, 3:54 pm, Timothy Perrett  wrote:
>
> > Kudos everyone - the fact that organisations are building saleable  
> > products on Lift is a testament to the quality of the platform so  
> > early on in its life; as a team we should take real pride in this :-)
>
> > Cheers, Tim
>
> > On 8 Nov 2009, at 18:06, David Pollak wrote:
>
> > > Folks,
>
> > > Last week,Novellannounced their new groupware product, 
> > > Pulse:http://www.novell.com/products/pulse/
>
> > > Pulse's UI was built with Lift.  If you have time to watch the demo,  
> > > it's very impressive... quite frankly, I was blown away... I didn't  
> > > think web browsers could do that, Lift or no.
>
> > > So, congrats to the Pulse team and congrats to the Lift community  
> > > for giving feedback that made Lift a platform that could build such  
> > > an app and congrats to the Lift committers to listening to community  
> > > feedback and building the Lift platform.
>
> > > Thanks,
>
> > > David
>
> > > --
> > > Lift, the simply functional web frameworkhttp://liftweb.net
> > > Beginning Scalahttp://www.apress.com/book/view/1430219890
> > > Follow me:http://twitter.com/dpp
> > > Surf the harmonics

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: How can call server 'ajax' function by my ajax code?

2009-10-30 Thread Xuefeng Wu

Thank you Jeppe,
It's great.

On Oct 31, 3:28 am, Jeppe Nejsum Madsen  wrote:
> Xuefeng Wu  writes:
> > I want call function on the server side form client.
> > such as:
> > HTML client:
> > $.("#myLink").click(function{
> >     //call server function
> > });
>
> > Server side:
> > def myFunction() :JsCmd = {
> >    JsRaw("alert("Ah~ you could call me from client directly!")")
> > }
>
> It looks like you want a link (  tag) that, when clicked makes an
> ajax call:
>
>  bind("select", in, "link" -> a(myFunction _, Text("My link")))
>
> If you need to generate the javascript precisely as written above (ie it
> is triggered by something not in Lift), I think you can use this:
>
> JqJE.Jq(JE.Str("#mylink")) >>
> JqJE.JqClick(JE.AnonFunc(ajaxCall(JE.Str("hey"), myFunction _)._2))
>
> /Jeppe

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: How can call server 'ajax' function by my ajax code?

2009-10-30 Thread Xuefeng Wu

I want call function on the server side form client.
such as:
HTML client:
$.("#myLink").click(function{
//call server function
});

Server side:
def myFunction() :JsCmd = {
   JsRaw("alert("Ah~ you could call me from client directly!")")
}



On Oct 30, 3:10 pm, Jeppe Nejsum Madsen  wrote:
> Xuefeng Wu  writes:
> > Or can I register   ajax event at server side?
>
> > On Oct 30, 10:24 am, Xuefeng Wu  wrote:
> >> Hi,
>
> >> There're many ajax* control in SHtml such as ajaxButton and they can
> >> call server function by 'liftAjax.lift_ajaxHandler
> >> ("F900890988391MRF=true", null, null, null); return false;' directly.
>
> >> My question is that how could I call server 'ajax' function by my ajax
> >> code? How could I know the function's "code" such as
> >> "F900890988391MRF", or I can custom the "code"?
>
> SHtml.ajaxCall will generate javascript that performs an ajax call that
> executes a function on the server side. You can use this as a starting
> point and build your client side javascript from this.
>
> /Jeppe

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: How can call server 'ajax' function by my ajax code?

2009-10-30 Thread Xuefeng Wu

I want call function on the server side form client.
such as:
HTML client:
$.("#myLink").click(function{
//call server function
});

Server side:
def myFunction() :JsCmd = {
   JsRaw("alert("Ah~ you could call me from client directly!")")
}

On Oct 30, 3:10 pm, Jeppe Nejsum Madsen  wrote:
> Xuefeng Wu  writes:
> > Or can I register   ajax event at server side?
>
> > On Oct 30, 10:24 am, Xuefeng Wu  wrote:
> >> Hi,
>
> >> There're many ajax* control in SHtml such as ajaxButton and they can
> >> call server function by 'liftAjax.lift_ajaxHandler
> >> ("F900890988391MRF=true", null, null, null); return false;' directly.
>
> >> My question is that how could I call server 'ajax' function by my ajax
> >> code? How could I know the function's "code" such as
> >> "F900890988391MRF", or I can custom the "code"?
>
> SHtml.ajaxCall will generate javascript that performs an ajax call that
> executes a function on the server side. You can use this as a starting
> point and build your client side javascript from this.
>
> /Jeppe

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: How can call server 'ajax' function by my ajax code?

2009-10-30 Thread Xuefeng Wu

Sorry, Could you demo this?

On Oct 30, 3:10 pm, Jeppe Nejsum Madsen  wrote:
> Xuefeng Wu  writes:
> > Or can I register   ajax event at server side?
>
> > On Oct 30, 10:24 am, Xuefeng Wu  wrote:
> >> Hi,
>
> >> There're many ajax* control in SHtml such as ajaxButton and they can
> >> call server function by 'liftAjax.lift_ajaxHandler
> >> ("F900890988391MRF=true", null, null, null); return false;' directly.
>
> >> My question is that how could I call server 'ajax' function by my ajax
> >> code? How could I know the function's "code" such as
> >> "F900890988391MRF", or I can custom the "code"?
>
> SHtml.ajaxCall will generate javascript that performs an ajax call that
> executes a function on the server side. You can use this as a starting
> point and build your client side javascript from this.
>
> /Jeppe

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: How can call server 'ajax' function by my ajax code?

2009-10-29 Thread Xuefeng Wu

Or can I register   ajax event at server side?

On Oct 30, 10:24 am, Xuefeng Wu  wrote:
> Hi,
>
> There're many ajax* control in SHtml such as ajaxButton and they can
> call server function by 'liftAjax.lift_ajaxHandler
> ("F900890988391MRF=true", null, null, null); return false;' directly.
>
> My question is that how could I call server 'ajax' function by my ajax
> code? How could I know the function's "code" such as
> "F900890988391MRF", or I can custom the "code"?
>
> Thank you!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: How to hidden the Menu Loc? This hidden attr doesn't work!

2009-10-29 Thread Xuefeng Wu

Menu(Loc("addBk2", List("edit_book"), "Edit book 2", Hidden,
IfLoggedIn)) ::  // Doesn't work
Hidden and ifLoggedIn are LocParam, I guess switch them and you could
get you want.
change to:
Menu(Loc("addBk2", List("edit_book"), "Edit book 2", IfLoggedIn,
Hidden)) ::


On Oct 30, 9:40 am, "Neil.Lv"  wrote:
> Hi all,
>
>    I have a question about the Loc , and How to hidden the Menu if the
> user is not a superuser ?
>
>    The code is :
>      The Edit book 1 always shows in the home page if the user doesn't
> login.
>      The Edit book 2 doesn't work both login in or not .
> ###
>   val IfLoggedIn = If(() => User.currentUser.isDefined, "You must be
> logged in")
>
>   ...
>   Menu(Loc("Home", List("index"), "Home")) ::
>   Menu(Loc("addBook", Link(List("edit_book"), false, "/book/
> edit_book"), "Edit book 1")) ::   //
>   Menu(Loc("addBk2", List("edit_book"), "Edit book 2", Hidden,
> IfLoggedIn)) ::  // Doesn't work
>   User.sitemap
> ###
>
>    Thanks for any help!
>
> Cheers,
>   Neil

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] How can call server 'ajax' function by my ajax code?

2009-10-29 Thread Xuefeng Wu

Hi,

There're many ajax* control in SHtml such as ajaxButton and they can
call server function by 'liftAjax.lift_ajaxHandler
("F900890988391MRF=true", null, null, null); return false;' directly.

My question is that how could I call server 'ajax' function by my ajax
code? How could I know the function's "code" such as
"F900890988391MRF", or I can custom the "code"?

Thank you!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] How to use DependencyFactory.inject ?

2009-10-24 Thread Xuefeng Wu

Hello,

I create now lift project from M6 and find
DependencyFactory.inject[Date] in HelloWorld.scala, but it don't work.

I can not find the date at page, did I miss something?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---