[Lift] Re: multiple forms on a page.

2010-01-06 Thread daiwhea
Thanks David. Here is my repository:

git://github.com/daiwhea/MapperBBS.git

In fact, I want to share this simple demo project for the newbies like
myself when the project completed.

On Jan 6, 11:42 am, David Pollak feeder.of.the.be...@gmail.com
wrote:
 The easiest thing to do is for you to post your project as a complete
 runnable whole to GitHub (just make a public repository).

 I'll clone the repository, fix the issue and you'll see the diff and have a
 running project.  Sound good?



 On Tue, Jan 5, 2010 at 6:32 PM, daiwhea daiw...@gmail.com wrote:

  On Jan 5, 10:18 pm, Naftoli Gugenheim naftoli...@gmail.com wrote:
  Just move var localNote ... to before def doReply() ...

  -

  Thanks Naftoli. It does save a reply to the db after I move var
  localNote to before def doReply(). But It will only save reply to the
  last note even when I try to reply to the note in the top section.

  So, in order to see what happend, I add lift:embed what=/templates-
  hidden/gbook/replyForm / no matter the note was replied or not.
  When the page loaded, I saw all the textareas in each reply form has
  the same reply content of the last note. But both those textareas and
  submit buttons have different names. Seems lift doesn't deal the
  embeded template content in the snippet properly as wished.

  I also test to add eager_eval=true to the list template as:
  lift:GuestBook.list eager_eval=true. But this won't help.

  Thanks for your time. You're so warmhearted. ^_^

   def replyNote(html: NodeSeq): NodeSeq = {

      val localNote = curListNote

     def doReply() = {
       localNote.save
      }

     bind(note, html,
       replyContent - SHtml.textarea(localNote.replyContent,
                                     localNote.replyContent(_)),
       submit - SHtml.submit(Reply, doReply)
     )
   }

    private def getReplyContent(item: GuestNote) = {
     if (item.repliedByAdmin == 0) {
        divpNot replied by admin/pp{item.replyContent}/
  plift:embed what=/templates-hidden/gbook/replyForm //div
     }
     else
        divp{Replied by admin at: +item.replyTime}/pp
  {item.replyContent}/plift:embed what=/templates-hidden/gbook/
  replyForm //div
   }

  --
  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.comliftweb%2bunsubscr...@googlegroups.com
  .
  For more options, visit this group at
 http://groups.google.com/group/liftweb?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.




Re: [Lift] How to remove manyTomany children?

2010-01-06 Thread Guillermo Acilu
But this will remove the entity as well, am I right?

On Jan 6, 2010, at 12:09 AM, Naftoli Gugenheim wrote:

 Just call .delete_! on the entity itself. It should automatically remove the 
 relationships.
 
 -
 GAmy_li...@me.com wrote:
 
 I would like to remove them from the database, not only the relationship.
 
 How should I do that?
 
 Thanks,
 
 
 On Jan 5, 2010, at 9:42 PM, Naftoli Gugenheim wrote:
 
 Are they not getting removed from the collection when you call clear, or are 
 they not getting deleted in the database when you call save?
 Also, are you trying to delete the actual entity? Clear and remove just 
 delete the relationship.
 
 -
 GAmy_li...@me.com wrote:
 
 It does not work either with the LongKeyedMapper.
 
 Am I doing something wrong?
 
 
 On Jan 5, 2010, at 7:25 PM, Guillermo Acilu wrote:
 
 It was the first thing I tried. But it does not work.
 
 I have run out of options now. I am going to try to add a LongKeyMapper to 
 see if the problem gets solved.
 
 
 
 On Jan 5, 2010, at 7:12 PM, Naftoli Gugenheim wrote:
 
 Can you try
 entry.childEntries.clear
 entry.save
 ?
 
 -
 GAmy_li...@me.com wrote:
 
 Hello guys,
 
 I have a table that has a many-to-many relationship with itself.
 
 I manage to add new entries to the relationship table using the 
 MapperManyToMany, but I cannot remove entries.
 
 This is the code I am using to remove:
 
 for (entryToRemove - entry.childEntries) {
 val indexOf = entry.childEntries.indexOf(entryToRemove)
 entry.childEntries.remove(indexOf)
 }
 entry.save
 
 This code is supposed to remove all the entries in the relationship table, 
 but it does nothing.
 
 The class I am using to define the ManyToMany table is an extension of 
 Mapper, not LongKeyedMapper. This is because I do not really need an extra 
 field just for the primary key. Could this be the problem?
 
 Any suggestions?
 
 Thanks in advance,
 
 GA
 
 --
 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.
 
 
 
 -- 
 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.
 
 
 
 -- 
 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.




Re: [Lift] Re: QueryParams and joins

2010-01-06 Thread Timothy Perrett
Remove the lift-core dependency and separately specify lift-webkit, lift-common 
and lift-util. That should resolve your issue... its probally a problem with 
the transitive dependencies in maven. 

Cheers, Tim

On 5 Jan 2010, at 22:17, Ross Mellgren wrote:

 It looks like you probably have some other dependencies somewhere or old jars 
 pointing to the old lift version.
 
 Please first try mvn clean jetty:run, and if that doesn't work, run mvn 
 dependency:tree to try and find where the other version of lift-webkit is 
 coming from. If you're still stuck, paste the output of dependency:tree 
 please!
 
 -Ross
 
 On Jan 5, 2010, at 4:06 PM, Mads Hartmann wrote:
 
 I really appreciate you taking the time to help me out.
 
 depedency now is:
   dependency
 groupIdnet.liftweb/groupId
 artifactIdlift-core/artifactId
 version1.1-M8/version
   /dependency
 
 It compiles just fine, but when i try to start the server i get the
 following error:
 
 ERROR - Failed to Boot
 java.lang.NoClassDefFoundError: net/liftweb/util/Box
  at java.lang.Class.forName0(Native Method)
  at java.lang.Class.forName(Class.java:169)
  at net.liftweb.http.DefaultBootstrap$.boot(LiftRules.scala:1260)
  at net.liftweb.http.provider.HTTPProvider$class.bootLift
 (HTTPProvider.scala:70)
  at net.liftweb.http.LiftFilter.bootLift(LiftServlet.scala:523)
  at net.liftweb.http.provider.servlet.ServletFilterProvider$class.init
 (ServletFilterProvider.scala:20)
  at net.liftweb.http.LiftFilter.init(LiftServlet.scala:523)
  at org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java:
 97)
  at org.mortbay.component.AbstractLifeCycle.start
 (AbstractLifeCycle.java:50)
  at org.mortbay.jetty.servlet.ServletHandler.initialize
 (ServletHandler.java:662)
  at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
  at org.mortbay.jetty.webapp.WebAppContext.startContext
 (WebAppContext.java:1250)
  at org.mortbay.jetty.handler.ContextHandler.doStart
 (ContextHandler.java:517)
  at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:
 467)
  at org.mortbay.jetty.plugin.Jetty6PluginWebAppContext.doStart
 (Jetty6PluginWebAppContext.java:115)
  at org.mortbay.component.AbstractLifeCycle.start
 (AbstractLifeCycle.java:50)
  at org.mortbay.jetty.handler.HandlerCollection.doStart
 (HandlerCollection.java:152)
  at org.mortbay.jetty.handler.ContextHandlerCollection.doStart
 (ContextHandlerCollection.java:156)
  at org.mortbay.component.AbstractLifeCycle.start
 (AbstractLifeCycle.java:50)
  at org.mortbay.jetty.handler.HandlerCollection.doStart
 (HandlerCollection.java:152)
  at org.mortbay.component.AbstractLifeCycle.start
 (AbstractLifeCycle.java:50)
  at org.mortbay.jetty.handler.HandlerWrapper.doStart
 (HandlerWrapper.java:130)
  at org.mortbay.jetty.Server.doStart(Server.java:224)
  at org.mortbay.component.AbstractLifeCycle.start
 (AbstractLifeCycle.java:50)
  at org.mortbay.jetty.plugin.Jetty6PluginServer.start
 (Jetty6PluginServer.java:132)
  at org.mortbay.jetty.plugin.AbstractJettyMojo.startJetty
 (AbstractJettyMojo.java:441)
  at org.mortbay.jetty.plugin.AbstractJettyMojo.execute
 (AbstractJettyMojo.java:383)
  at org.mortbay.jetty.plugin.AbstractJettyRunMojo.execute
 (AbstractJettyRunMojo.java:210)
  at org.mortbay.jetty.plugin.Jetty6RunMojo.execute(Jetty6RunMojo.java:
 184)
  at org.apache.maven.plugin.DefaultPluginManager.executeMojo
 (DefaultPluginManager.java:490)
  at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals
 (DefaultLifecycleExecutor.java:694)
  at
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal
 (DefaultLifecycleExecutor.java:569)
  at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal
 (DefaultLifecycleExecutor.java:539)
  at
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures
 (DefaultLifecycleExecutor.java:387)
  at
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments
 (DefaultLifecycleExecutor.java:348)
  at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute
 (DefaultLifecycleExecutor.java:180)
  at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
  at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
  at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
  at org.apache.maven.cli.compat.CompatibleMain.main
 (CompatibleMain.java:60)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke
 (NativeMethodAccessorImpl.java:39)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke
 (DelegatingMethodAccessorImpl.java:25)
  at java.lang.reflect.Method.invoke(Method.java:597)
  at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:
 315)
  at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
  

[Lift] Re: QueryParams and joins

2010-01-06 Thread Mads Hartmann
How would that dependency tag look? Right now it looks like this:

dependency
  groupIdnet.liftweb/groupId
  artifactIdlift-core/artifactId
  version1.1-M8/version
/dependency

On Jan 6, 10:06 am, Timothy Perrett timo...@getintheloop.eu wrote:
 Remove the lift-core dependency and separately specify lift-webkit, 
 lift-common and lift-util. That should resolve your issue... its probally a 
 problem with the transitive dependencies in maven.

 Cheers, Tim

 On 5 Jan 2010, at 22:17, Ross Mellgren wrote:



  It looks like you probably have some other dependencies somewhere or old 
  jars pointing to the old lift version.

  Please first try mvn clean jetty:run, and if that doesn't work, run mvn 
  dependency:tree to try and find where the other version of lift-webkit is 
  coming from. If you're still stuck, paste the output of dependency:tree 
  please!

  -Ross

  On Jan 5, 2010, at 4:06 PM, Mads Hartmann wrote:

  I really appreciate you taking the time to help me out.

  depedency now is:
    dependency
      groupIdnet.liftweb/groupId
      artifactIdlift-core/artifactId
      version1.1-M8/version
    /dependency

  It compiles just fine, but when i try to start the server i get the
  following error:

  ERROR - Failed to Boot
  java.lang.NoClassDefFoundError: net/liftweb/util/Box
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Class.java:169)
         at net.liftweb.http.DefaultBootstrap$.boot(LiftRules.scala:1260)
         at net.liftweb.http.provider.HTTPProvider$class.bootLift
  (HTTPProvider.scala:70)
         at net.liftweb.http.LiftFilter.bootLift(LiftServlet.scala:523)
         at 
  net.liftweb.http.provider.servlet.ServletFilterProvider$class.init
  (ServletFilterProvider.scala:20)
         at net.liftweb.http.LiftFilter.init(LiftServlet.scala:523)
         at org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java:
  97)
         at org.mortbay.component.AbstractLifeCycle.start
  (AbstractLifeCycle.java:50)
         at org.mortbay.jetty.servlet.ServletHandler.initialize
  (ServletHandler.java:662)
         at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
         at org.mortbay.jetty.webapp.WebAppContext.startContext
  (WebAppContext.java:1250)
         at org.mortbay.jetty.handler.ContextHandler.doStart
  (ContextHandler.java:517)
         at 
  org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:
  467)
         at org.mortbay.jetty.plugin.Jetty6PluginWebAppContext.doStart
  (Jetty6PluginWebAppContext.java:115)
         at org.mortbay.component.AbstractLifeCycle.start
  (AbstractLifeCycle.java:50)
         at org.mortbay.jetty.handler.HandlerCollection.doStart
  (HandlerCollection.java:152)
         at org.mortbay.jetty.handler.ContextHandlerCollection.doStart
  (ContextHandlerCollection.java:156)
         at org.mortbay.component.AbstractLifeCycle.start
  (AbstractLifeCycle.java:50)
         at org.mortbay.jetty.handler.HandlerCollection.doStart
  (HandlerCollection.java:152)
         at org.mortbay.component.AbstractLifeCycle.start
  (AbstractLifeCycle.java:50)
         at org.mortbay.jetty.handler.HandlerWrapper.doStart
  (HandlerWrapper.java:130)
         at org.mortbay.jetty.Server.doStart(Server.java:224)
         at org.mortbay.component.AbstractLifeCycle.start
  (AbstractLifeCycle.java:50)
         at org.mortbay.jetty.plugin.Jetty6PluginServer.start
  (Jetty6PluginServer.java:132)
         at org.mortbay.jetty.plugin.AbstractJettyMojo.startJetty
  (AbstractJettyMojo.java:441)
         at org.mortbay.jetty.plugin.AbstractJettyMojo.execute
  (AbstractJettyMojo.java:383)
         at org.mortbay.jetty.plugin.AbstractJettyRunMojo.execute
  (AbstractJettyRunMojo.java:210)
         at 
  org.mortbay.jetty.plugin.Jetty6RunMojo.execute(Jetty6RunMojo.java:
  184)
         at org.apache.maven.plugin.DefaultPluginManager.executeMojo
  (DefaultPluginManager.java:490)
         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals
  (DefaultLifecycleExecutor.java:694)
         at
  org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal
  (DefaultLifecycleExecutor.java:569)
         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal
  (DefaultLifecycleExecutor.java:539)
         at
  org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFai
   lures
  (DefaultLifecycleExecutor.java:387)
         at
  org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments
  (DefaultLifecycleExecutor.java:348)
         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute
  (DefaultLifecycleExecutor.java:180)
         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
         at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
         at org.apache.maven.cli.compat.CompatibleMain.main
  (CompatibleMain.java:60)
         at 

Re: [Lift] Re: QueryParams and joins

2010-01-06 Thread Indrajit Raychaudhuri

Mads,

Since you are using mapper, having dependency on lift-mapper should 
suffice. Other dependencies would be pulled in transitively.


So having this dependency tag should do.

dependency
  groupIdnet.liftweb/groupId
  artifactIdlift-mapper/artifactId
  version1.1-M8/version
/dependency

Cheers, Indrajit

On 06/01/10 2:39 PM, Mads Hartmann wrote:

How would that dependency tag look? Right now it looks like this:

dependency
   groupIdnet.liftweb/groupId
   artifactIdlift-core/artifactId
   version1.1-M8/version
 /dependency

On Jan 6, 10:06 am, Timothy Perretttimo...@getintheloop.eu  wrote:

Remove the lift-core dependency and separately specify lift-webkit, lift-common 
and lift-util. That should resolve your issue... its probally a problem with 
the transitive dependencies in maven.

Cheers, Tim

On 5 Jan 2010, at 22:17, Ross Mellgren wrote:




It looks like you probably have some other dependencies somewhere or old jars 
pointing to the old lift version.



Please first try mvn clean jetty:run, and if that doesn't work, run mvn 
dependency:tree to try and find where the other version of lift-webkit is 
coming from. If you're still stuck, paste the output of dependency:tree please!



-Ross



On Jan 5, 2010, at 4:06 PM, Mads Hartmann wrote:



I really appreciate you taking the time to help me out.



depedency now is:
   dependency
 groupIdnet.liftweb/groupId
 artifactIdlift-core/artifactId
 version1.1-M8/version
   /dependency



It compiles just fine, but when i try to start the server i get the
following error:



ERROR - Failed to Boot
java.lang.NoClassDefFoundError: net/liftweb/util/Box
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at net.liftweb.http.DefaultBootstrap$.boot(LiftRules.scala:1260)
at net.liftweb.http.provider.HTTPProvider$class.bootLift
(HTTPProvider.scala:70)
at net.liftweb.http.LiftFilter.bootLift(LiftServlet.scala:523)
at net.liftweb.http.provider.servlet.ServletFilterProvider$class.init
(ServletFilterProvider.scala:20)
at net.liftweb.http.LiftFilter.init(LiftServlet.scala:523)
at org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java:
97)
at org.mortbay.component.AbstractLifeCycle.start
(AbstractLifeCycle.java:50)
at org.mortbay.jetty.servlet.ServletHandler.initialize
(ServletHandler.java:662)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
at org.mortbay.jetty.webapp.WebAppContext.startContext
(WebAppContext.java:1250)
at org.mortbay.jetty.handler.ContextHandler.doStart
(ContextHandler.java:517)
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:
467)
at org.mortbay.jetty.plugin.Jetty6PluginWebAppContext.doStart
(Jetty6PluginWebAppContext.java:115)
at org.mortbay.component.AbstractLifeCycle.start
(AbstractLifeCycle.java:50)
at org.mortbay.jetty.handler.HandlerCollection.doStart
(HandlerCollection.java:152)
at org.mortbay.jetty.handler.ContextHandlerCollection.doStart
(ContextHandlerCollection.java:156)
at org.mortbay.component.AbstractLifeCycle.start
(AbstractLifeCycle.java:50)
at org.mortbay.jetty.handler.HandlerCollection.doStart
(HandlerCollection.java:152)
at org.mortbay.component.AbstractLifeCycle.start
(AbstractLifeCycle.java:50)
at org.mortbay.jetty.handler.HandlerWrapper.doStart
(HandlerWrapper.java:130)
at org.mortbay.jetty.Server.doStart(Server.java:224)
at org.mortbay.component.AbstractLifeCycle.start
(AbstractLifeCycle.java:50)
at org.mortbay.jetty.plugin.Jetty6PluginServer.start
(Jetty6PluginServer.java:132)
at org.mortbay.jetty.plugin.AbstractJettyMojo.startJetty
(AbstractJettyMojo.java:441)
at org.mortbay.jetty.plugin.AbstractJettyMojo.execute
(AbstractJettyMojo.java:383)
at org.mortbay.jetty.plugin.AbstractJettyRunMojo.execute
(AbstractJettyRunMojo.java:210)
at org.mortbay.jetty.plugin.Jetty6RunMojo.execute(Jetty6RunMojo.java:
184)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo
(DefaultPluginManager.java:490)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals
(DefaultLifecycleExecutor.java:694)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal
(DefaultLifecycleExecutor.java:569)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal
(DefaultLifecycleExecutor.java:539)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFai 
lures
(DefaultLifecycleExecutor.java:387)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments
(DefaultLifecycleExecutor.java:348)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute
(DefaultLifecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at 

Re: [Lift] Re: [lift] Lift based backend server subscribing via amqp

2010-01-06 Thread vishnu
hi
   well I'm mostly going by this stack overflow post.
http://stackoverflow.com/questions/1140448/what-orms-work-well-with-scala
In terms of our requirements, what we want from an orm is fairly basic.
Since we are not building a web application, we would want it decoupled from
any other parts of such a stack. (I heard mapper depends on the http
module?). We need most of the basic orm operations with ACID compliance,
preferably one that requires us to write as little code as possible and
includes transactionality as something we can depend upon. The database
we're currently looking at is Postgresql, so ideally the ORM should be
oblivious of whether or not the database is distributed.


I understand it's a bit vague. In terms of what we need right now, we need
ACID and

On Tue, Jan 5, 2010 at 6:39 PM, Timothy Perrett timo...@getintheloop.euwrote:

 In what way do you mean is mapper worth it?

 What kind of system is it? do you need ACID or BASE? What kind of load
 will the system be under? Do you need it to be distributed? You are
 not restricted to Mapper, you could use JPA or whatever persistence
 you want with lift.

 If you just want to make a pretty simple service tier, then sure, Lift
 will be fine. Akka works well when you need fault tolerance or
 distributed nodes etc etc

 Cheers, Tim

 On Jan 5, 3:34 am, vishnu path...@gmail.com wrote:
  well I'm not sure how to describe it differently. As you said it's only
  service tier. The truth is I dont know anything about Lift yet and Im
 just
  now running through some basic Scala books.
 
  I need a library with which to talk to rabbitmq as a subscriber that
 might
  work at a higher level than the default java api that comes with rabbitmq
  and ideally something that provides the same service for me talk to a
  database via scala. I haven't seen Akka before, so I'll take a look at
 that
  :). Would you say mapper is worth it?
 
  On Tue, Jan 5, 2010 at 2:23 AM, Timothy Perrett timo...@getintheloop.eu
 wrote:
 
 
 
   It depends on your use case... you don't really describe exactly what
 you
   want to do. Perhaps start by providing more detail? If you want service
 teir
   *only* though, its quite probable that akka would be a better fix.
 
   Cheers, Tim
 
   On 4 Jan 2010, at 20:30, Channing Walton wrote:
 
Maybe Akka would be better for you?http://akkasource.org/
Akka has an AMQP module which abstracts AMQP Producer and Consumer
 as
Actors.
 
Channing
 
vishnu-11 wrote:
 
Hi
  I'm trying to use lift to right a back end for a system that
communicates via AMQP. The idea is to have a bunch of (threads?,
processes? actors?) that subscribe to some queues on a queueing
 system
and react to various messages by contacting various third party
systems and persisting messages to a database.
 
I was wondering firstly if it makes sense to use lift, or if it
 makes
more sense to pull various parts out of lift and use them?
 
Additionally, looking at the lift amqp code, it seems to be a little
out of date, especially with regard to amqp. Does anyone know if
 there
has been any active work on this segment?
 
--
 
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.comliftweb%2bunsubscr...@googlegroups.com
 liftweb%2bunsubscr...@googlegroups.comliftweb%252bunsubscr...@googlegroups.com
   .
For more options, visit this group at
   http://groups.google.com/group/liftweb?hl=en.
 
--
View this message in context:
  http://old.nabble.com/Lift-based-backend-server-subscribing-via-amqp-.
 ..
Sent from the liftweb mailing list archive at Nabble.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.comliftweb%2bunsubscr...@googlegroups.com
 liftweb%2bunsubscr...@googlegroups.comliftweb%252bunsubscr...@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.comliftweb%2bunsubscr...@googlegroups.com
 liftweb%2bunsubscr...@googlegroups.comliftweb%252bunsubscr...@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
 

[Lift] Re: QueryParams and joins

2010-01-06 Thread Mads Hartmann
Again, I really appreciate you guys helping me out :)

@Indrajit I just tried with the dependency you declared as the only
lift related dependency. I get the following error.

dependency
  groupIdnet.liftweb/groupId
  artifactIdlift-mapper/artifactId
  version1.1-M8/version
/dependency

[INFO] Nothing to compile - all classes are up to date
[INFO] [scala:compile {execution: default}]
[INFO] Checking for multiple versions of scala
[WARNING] Multiple versions of scala libraries detected!
[INFO] includes = [**/*.scala,**/*.java,]
[INFO] excludes = []
[INFO] /Users/Mads/Projects/scalableKvidr2/src/main/scala:-1: info:
compiling

[INFO] Compiling 8 source files to /Users/Mads/Projects/scalableKvidr2/
target/classes at 1262776620713
[ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/bootstrap/
liftweb/Boot.scala:52: error: not found: value Full
[INFO]   Full(() = LiftRules.jsArtifacts.show(ajax-loader).cmd)
[INFO]   ^
[ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/bootstrap/
liftweb/Boot.scala:58: error: not found: value Full
[INFO]   Full(() = LiftRules.jsArtifacts.hide(ajax-loader).cmd)
[INFO]   ^
[ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/bootstrap/
liftweb/Boot.scala:60: error: type mismatch;
[INFO]  found   : (javax.servlet.http.HttpServletRequest) = Unit
[INFO]  required: (net.liftweb.http.provider.HTTPRequest) = Any
[INFO] LiftRules.early.append(makeUtf8)
[INFO]^
[ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/bootstrap/
liftweb/Boot.scala:79: error: not found: value Full
[INFO]  Full(dm)
[INFO]  ^
[ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/bootstrap/
liftweb/Boot.scala:81: error: not found: value Empty
[INFO]  case e : Exception = e.printStackTrace; Empty
[INFO]   ^
[ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/
scalableKvidr/snippet/TagsSnippets.scala:28: error: not found: value
Full
[INFO]   case Full(param) = param
[INFO]^
[ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/
scalableKvidr/snippet/TagsSnippets.scala:28: error: missing arguments
for method param in object S;
[INFO] follow this method with `_' if you want to treat it as a
partially applied function
[INFO]   case Full(param) = param
[INFO]   ^
[ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/
scalableKvidr/snippet/TagsSnippets.scala:29: error: not found: value
Empty
[ERROR]   case Empty = error
[INFO]^
[ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/
scalableKvidr/snippet/TagsSnippets.scala:30: error: not found: value
Failure
[ERROR]   case Failure(msg, _, _) = error
[INFO]^
[ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/
scalableKvidr/snippet/TagsSnippets.scala:41: error: not found: value
Full
[INFO]   case Full(xhtml) = xhtml
[INFO]^
[ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/
scalableKvidr/snippet/TagsSnippets.scala:41: error: not found: value
xhtml
[INFO]   case Full(xhtml) = xhtml
[INFO]   ^
[ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/
scalableKvidr/snippet/TagsSnippets.scala:42: error: not found: value
Empty
[ERROR]   case Empty = strongError/strong
[INFO]^
[ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/
scalableKvidr/snippet/TagsSnippets.scala:43: error: not found: value
Failure
[ERROR]   case Failure(msg, _, _) = strongError/strong
[INFO]^
[ERROR] 13 errors found
[INFO]

[ERROR] BUILD ERROR
[INFO]

[INFO] wrap: org.apache.commons.exec.ExecuteException: Process exited
with an error: 1(Exit value: 1)

On Jan 6, 10:15 am, Indrajit Raychaudhuri indraj...@gmail.com wrote:
 Mads,

 Since you are using mapper, having dependency on lift-mapper should
 suffice. Other dependencies would be pulled in transitively.

 So having this dependency tag should do.

 dependency
    groupIdnet.liftweb/groupId
    artifactIdlift-mapper/artifactId
    version1.1-M8/version
 /dependency

 Cheers, Indrajit

 On 06/01/10 2:39 PM, Mads Hartmann wrote:



  How would that dependency tag look? Right now it looks like this:

  dependency
         groupIdnet.liftweb/groupId
         artifactIdlift-core/artifactId
         version1.1-M8/version
       /dependency

  On Jan 6, 10:06 am, Timothy Perretttimo...@getintheloop.eu  wrote:
  Remove the lift-core dependency and separately specify lift-webkit, 
  lift-common and lift-util. That should resolve your issue... its probally 
  a problem with the transitive dependencies in maven.

  Cheers, Tim

  On 5 Jan 2010, at 22:17, Ross Mellgren wrote:

  It looks like you probably have some other dependencies somewhere or old 
  jars pointing to the old lift version.

  

Re: [Lift] Lift on Atmosphere

2010-01-06 Thread Jonas Bonér
Akka has excellent Atmosphere support. Akka can be used with Lift.
http://doc.akkasource.org/comet

2010/1/6 paksegu paks...@gmail.com:
 Hello World.
 I am a Lift beginner and I would like to know if anyone has
 successfully succeeded in running Lift on Atmosphere: 
 https://atmosphere.dev.java.net
 thanks.

 --
 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.







-- 
Jonas Bonér

twitter: @jboner
blog:http://jonasboner.com
work:   http://scalablesolutions.se
code:   http://github.com/jboner
code:   http://akkasource.org
also:http://letitcrash.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.




Re: [Lift] Re: QueryParams and joins

2010-01-06 Thread Indrajit Raychaudhuri

Mads,
Can you please send me the pom.xml?

Cheers, Indrajit

On 06/01/10 4:50 PM, Mads Hartmann wrote:

Again, I really appreciate you guys helping me out :)

@Indrajit I just tried with the dependency you declared as the only
lift related dependency. I get the following error.

dependency
   groupIdnet.liftweb/groupId
   artifactIdlift-mapper/artifactId
   version1.1-M8/version
/dependency

[INFO] Nothing to compile - all classes are up to date
[INFO] [scala:compile {execution: default}]
[INFO] Checking for multiple versions of scala
[WARNING] Multiple versions of scala libraries detected!
[INFO] includes = [**/*.scala,**/*.java,]
[INFO] excludes = []
[INFO] /Users/Mads/Projects/scalableKvidr2/src/main/scala:-1: info:
compiling

[INFO] Compiling 8 source files to /Users/Mads/Projects/scalableKvidr2/
target/classes at 1262776620713
[ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/bootstrap/
liftweb/Boot.scala:52: error: not found: value Full
[INFO]   Full(() =  LiftRules.jsArtifacts.show(ajax-loader).cmd)
[INFO]   ^
[ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/bootstrap/
liftweb/Boot.scala:58: error: not found: value Full
[INFO]   Full(() =  LiftRules.jsArtifacts.hide(ajax-loader).cmd)
[INFO]   ^
[ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/bootstrap/
liftweb/Boot.scala:60: error: type mismatch;
[INFO]  found   : (javax.servlet.http.HttpServletRequest) =  Unit
[INFO]  required: (net.liftweb.http.provider.HTTPRequest) =  Any
[INFO] LiftRules.early.append(makeUtf8)
[INFO]^
[ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/bootstrap/
liftweb/Boot.scala:79: error: not found: value Full
[INFO]  Full(dm)
[INFO]  ^
[ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/bootstrap/
liftweb/Boot.scala:81: error: not found: value Empty
[INFO]  case e : Exception =  e.printStackTrace; Empty
[INFO]   ^
[ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/
scalableKvidr/snippet/TagsSnippets.scala:28: error: not found: value
Full
[INFO]   case Full(param) =  param
[INFO]^
[ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/
scalableKvidr/snippet/TagsSnippets.scala:28: error: missing arguments
for method param in object S;
[INFO] follow this method with `_' if you want to treat it as a
partially applied function
[INFO]   case Full(param) =  param
[INFO]   ^
[ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/
scalableKvidr/snippet/TagsSnippets.scala:29: error: not found: value
Empty
[ERROR]   case Empty =  error
[INFO]^
[ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/
scalableKvidr/snippet/TagsSnippets.scala:30: error: not found: value
Failure
[ERROR]   case Failure(msg, _, _) =  error
[INFO]^
[ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/
scalableKvidr/snippet/TagsSnippets.scala:41: error: not found: value
Full
[INFO]   case Full(xhtml) =  xhtml
[INFO]^
[ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/
scalableKvidr/snippet/TagsSnippets.scala:41: error: not found: value
xhtml
[INFO]   case Full(xhtml) =  xhtml
[INFO]   ^
[ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/
scalableKvidr/snippet/TagsSnippets.scala:42: error: not found: value
Empty
[ERROR]   case Empty =  strongError/strong
[INFO]^
[ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/
scalableKvidr/snippet/TagsSnippets.scala:43: error: not found: value
Failure
[ERROR]   case Failure(msg, _, _) =  strongError/strong
[INFO]^
[ERROR] 13 errors found
[INFO]

[ERROR] BUILD ERROR
[INFO]

[INFO] wrap: org.apache.commons.exec.ExecuteException: Process exited
with an error: 1(Exit value: 1)

On Jan 6, 10:15 am, Indrajit Raychaudhuriindraj...@gmail.com  wrote:

Mads,

Since you are using mapper, having dependency on lift-mapper should
suffice. Other dependencies would be pulled in transitively.

So having this dependency tag should do.

dependency
groupIdnet.liftweb/groupId
artifactIdlift-mapper/artifactId
version1.1-M8/version
/dependency

Cheers, Indrajit

On 06/01/10 2:39 PM, Mads Hartmann wrote:




How would that dependency tag look? Right now it looks like this:



dependency
groupIdnet.liftweb/groupId
artifactIdlift-core/artifactId
version1.1-M8/version
  /dependency



On Jan 6, 10:06 am, Timothy Perretttimo...@getintheloop.euwrote:

Remove the lift-core dependency and separately specify lift-webkit, lift-common 
and lift-util. That should resolve your issue... its probally a problem with 
the transitive dependencies in maven.



Cheers, Tim



On 5 Jan 2010, at 22:17, Ross Mellgren wrote:



It looks 

Re: [Lift] Lift on Atmosphere

2010-01-06 Thread Timothy Perrett
paksegu,

Lift does have better comet support than Atmosphere, but it depends what your 
use case is and what you specifically want to do. If you chose to run lift with 
atmosphere you'd essentially be loosing out on some of lift's best features. As 
jonas says, Akka does indeed use Atmosphere to good effect, but its a different 
tool, for a different job IMHO (although you can run them in tandem if your use 
case dictates that need).

So, lets try to add some clarity here by ascertaining what exactly you want to 
do... before this turns into a my comet is better than your comet flame war 
;-)

Cheers, Tim

On 6 Jan 2010, at 11:29, Jonas Bonér wrote:

 Akka has excellent Atmosphere support. Akka can be used with Lift.
 http://doc.akkasource.org/comet
 
 2010/1/6 paksegu paks...@gmail.com:
 Hello World.
 I am a Lift beginner and I would like to know if anyone has
 successfully succeeded in running Lift on Atmosphere: 
 https://atmosphere.dev.java.net
 thanks.
 
 --
 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.
 
 
 
 
 
 
 
 -- 
 Jonas Bonér
 
 twitter: @jboner
 blog:http://jonasboner.com
 work:   http://scalablesolutions.se
 code:   http://github.com/jboner
 code:   http://akkasource.org
 also:http://letitcrash.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.
 
 

-- 
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] Re: QueryParams and joins

2010-01-06 Thread Mads Hartmann
Sure thing, here it is:

project xmlns=http://maven.apache.org/POM/4.0.0; xmlns:xsi=http://
www.w3.org/2001/XMLSchema-instance xsi:schemaLocation=http://
maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd;
  modelVersion4.0.0/modelVersion
  groupIdscalableKvidr/groupId
  artifactIdscalableKvidr/artifactId
  version1.0-SNAPSHOT/version
  packagingwar/packaging
  namescalableKvidr/name
  inceptionYear2007/inceptionYear
  properties
scala.version2.7.3/scala.version
  /properties

  repositories
repository
  idscala-tools.org/id
  nameScala-Tools Maven2 Repository/name
  urlhttp://scala-tools.org/repo-releases/url
/repository
  /repositories

  pluginRepositories
pluginRepository
  idscala-tools.org/id
  nameScala-Tools Maven2 Repository/name
  urlhttp://scala-tools.org/repo-releases/url
/pluginRepository
  /pluginRepositories

  dependencies
dependency
  groupIdorg.scala-lang/groupId
  artifactIdscala-library/artifactId
  version${scala.version}/version
/dependency
dependency
   groupIdnet.liftweb/groupId
   artifactIdlift-mapper/artifactId
   version1.1-M8/version
/dependency
!--
dependency
  groupIdnet.liftweb/groupId
  artifactIdlift-core/artifactId
  version1.1-M8/version
/dependency--
dependency
  groupIdorg.apache.derby/groupId
  artifactIdderby/artifactId
  version10.4.2.0/version
/dependency
dependency
  groupIdmysql/groupId
  artifactIdmysql-connector-java/artifactId
  version5.0.8/version
/dependency
dependency
  groupIdjavax.servlet/groupId
  artifactIdservlet-api/artifactId
  version2.5/version
  scopeprovided/scope
/dependency
dependency
  groupIdjunit/groupId
  artifactIdjunit/artifactId
  version4.5/version
  scopetest/scope
/dependency
dependency
  groupIdorg.mortbay.jetty/groupId
  artifactIdjetty/artifactId
  version[6.1.6,)/version
  scopetest/scope
/dependency
!-- for LiftConsole --
dependency
  groupIdorg.scala-lang/groupId
  artifactIdscala-compiler/artifactId
  version${scala.version}/version
  scopetest/scope
/dependency
  /dependencies

  build
sourceDirectorysrc/main/scala/sourceDirectory
testSourceDirectorysrc/test/scala/testSourceDirectory
plugins
  plugin
groupIdorg.scala-tools/groupId
artifactIdmaven-scala-plugin/artifactId
executions
  execution
goals
  goalcompile/goal
  goaltestCompile/goal
/goals
  /execution
/executions
configuration
  scalaVersion${scala.version}/scalaVersion
/configuration
  /plugin
  plugin
groupIdorg.mortbay.jetty/groupId
artifactIdmaven-jetty-plugin/artifactId
configuration
  contextPath//contextPath
  scanIntervalSeconds5/scanIntervalSeconds
  stopPort8080/stopPort
  stopKey8080/stopKey
/configuration
  /plugin
  plugin
groupIdnet.sf.alchim/groupId
artifactIdyuicompressor-maven-plugin/artifactId
executions
  execution
goals
  goalcompress/goal
/goals
  /execution
/executions
configuration
  nosuffixtrue/nosuffix
/configuration
  /plugin
  plugin
groupIdorg.apache.maven.plugins/groupId
artifactIdmaven-eclipse-plugin/artifactId
configuration
  downloadSourcestrue/downloadSources
  excludes
excludeorg.scala-lang:scala-library/exclude
  /excludes
  classpathContainers
 
classpathContainerch.epfl.lamp.sdt.launching.SCALA_CONTAINER/
classpathContainer
  /classpathContainers
  projectnatures
java.lang.Stringch.epfl.lamp.sdt.core.scalanature/
java.lang.String
java.lang.Stringorg.eclipse.jdt.core.javanature/
java.lang.String
  /projectnatures
  buildcommands
java.lang.Stringch.epfl.lamp.sdt.core.scalabuilder/
java.lang.String
  /buildcommands
/configuration
  /plugin
/plugins
  /build
  reporting
plugins
  plugin
groupIdorg.scala-tools/groupId
artifactIdmaven-scala-plugin/artifactId
configuration
  scalaVersion${scala.version}/scalaVersion
/configuration
  /plugin
/plugins
  /reporting
/project


On Jan 6, 12:31 pm, Indrajit Raychaudhuri indraj...@gmail.com wrote:
 Mads,
 Can you please send me the pom.xml?

 Cheers, Indrajit

 On 06/01/10 4:50 PM, Mads Hartmann wrote:



  Again, I really appreciate you guys helping me out :)

  @Indrajit I just tried with the dependency you declared as the only
  lift related dependency. I get the following error.

  dependency
     groupIdnet.liftweb/groupId
     artifactIdlift-mapper/artifactId
     

Re: [Lift] Re: QueryParams and joins

2010-01-06 Thread Jeppe Nejsum Madsen
Mads Hartmann mads...@gmail.com writes:

 Again, I really appreciate you guys helping me out :)

 @Indrajit I just tried with the dependency you declared as the only
 lift related dependency. I get the following error.

 dependency
   groupIdnet.liftweb/groupId
   artifactIdlift-mapper/artifactId
   version1.1-M8/version
 /dependency

Note, Lift 1.1 is not source compatible with 1.0. You need to change
your code (in a few places) Specifically, it seems you need to add

import net.liftweb.common._

to Boot.scala

/Jeppe
-- 
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] Re: QueryParams and joins

2010-01-06 Thread Mads Hartmann
Aha! It almost compiles now. There's just one last error:

[INFO] Compiling 8 source files to /Users/Mads/Projects/scalableKvidr2/
target/classes at 1262780161026
[ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/bootstrap/
liftweb/Boot.scala:61: error: type mismatch;
[INFO]  found   : (javax.servlet.http.HttpServletRequest) = Unit
[INFO]  required: (net.liftweb.http.provider.HTTPRequest) = Any
[INFO] LiftRules.early.append(makeUtf8)
[INFO]^
[ERROR] one error found

On Jan 6, 12:59 pm, Jeppe Nejsum Madsen je...@ingolfs.dk wrote:
 Mads Hartmann mads...@gmail.com writes:
  Again, I really appreciate you guys helping me out :)

  @Indrajit I just tried with the dependency you declared as the only
  lift related dependency. I get the following error.

  dependency
    groupIdnet.liftweb/groupId
    artifactIdlift-mapper/artifactId
    version1.1-M8/version
  /dependency

 Note, Lift 1.1 is not source compatible with 1.0. You need to change
 your code (in a few places) Specifically, it seems you need to add

 import net.liftweb.common._

 to Boot.scala

 /Jeppe
-- 
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: QueryParams and joins

2010-01-06 Thread Indrajit Raychaudhuri

Ok, few points:

1. Full, Box etc. have a different package location now. Ensure import 
net.liftweb.common._ wherever you have Full, Box etc.


2. scala.version should be 2.7.7
scala.version2.7.7/scala.version

3. scala-library dependency is redundant. You can remove that.

4. This shouldn't affect your compilation either. jetty version range 
should be [6.1.6,7.0)

version[6.1.6,7.0)/version

Cheers, Indrajit

On 06/01/10 5:20 PM, Mads Hartmann wrote:

Sure thing, here it is:

project xmlns=http://maven.apache.org/POM/4.0.0; xmlns:xsi=http://
www.w3.org/2001/XMLSchema-instance xsi:schemaLocation=http://
maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd;
   modelVersion4.0.0/modelVersion
   groupIdscalableKvidr/groupId
   artifactIdscalableKvidr/artifactId
   version1.0-SNAPSHOT/version
   packagingwar/packaging
   namescalableKvidr/name
   inceptionYear2007/inceptionYear
   properties
 scala.version2.7.3/scala.version
   /properties

   repositories
 repository
   idscala-tools.org/id
   nameScala-Tools Maven2 Repository/name
   urlhttp://scala-tools.org/repo-releases/url
 /repository
   /repositories

   pluginRepositories
 pluginRepository
   idscala-tools.org/id
   nameScala-Tools Maven2 Repository/name
   urlhttp://scala-tools.org/repo-releases/url
 /pluginRepository
   /pluginRepositories

   dependencies
 dependency
   groupIdorg.scala-lang/groupId
   artifactIdscala-library/artifactId
   version${scala.version}/version
 /dependency
 dependency
groupIdnet.liftweb/groupId
artifactIdlift-mapper/artifactId
version1.1-M8/version
 /dependency
 !--
 dependency
   groupIdnet.liftweb/groupId
   artifactIdlift-core/artifactId
   version1.1-M8/version
 /dependency--
 dependency
   groupIdorg.apache.derby/groupId
   artifactIdderby/artifactId
   version10.4.2.0/version
 /dependency
 dependency
groupIdmysql/groupId
artifactIdmysql-connector-java/artifactId
version5.0.8/version
/dependency
 dependency
   groupIdjavax.servlet/groupId
   artifactIdservlet-api/artifactId
   version2.5/version
   scopeprovided/scope
 /dependency
 dependency
   groupIdjunit/groupId
   artifactIdjunit/artifactId
   version4.5/version
   scopetest/scope
 /dependency
 dependency
   groupIdorg.mortbay.jetty/groupId
   artifactIdjetty/artifactId
   version[6.1.6,)/version
   scopetest/scope
 /dependency
 !-- for LiftConsole --
 dependency
   groupIdorg.scala-lang/groupId
   artifactIdscala-compiler/artifactId
   version${scala.version}/version
   scopetest/scope
 /dependency
   /dependencies

   build
 sourceDirectorysrc/main/scala/sourceDirectory
 testSourceDirectorysrc/test/scala/testSourceDirectory
 plugins
   plugin
 groupIdorg.scala-tools/groupId
 artifactIdmaven-scala-plugin/artifactId
 executions
   execution
 goals
   goalcompile/goal
   goaltestCompile/goal
 /goals
   /execution
 /executions
 configuration
   scalaVersion${scala.version}/scalaVersion
 /configuration
   /plugin
   plugin
 groupIdorg.mortbay.jetty/groupId
 artifactIdmaven-jetty-plugin/artifactId
 configuration
   contextPath//contextPath
   scanIntervalSeconds5/scanIntervalSeconds
   stopPort8080/stopPort
   stopKey8080/stopKey
 /configuration
   /plugin
   plugin
 groupIdnet.sf.alchim/groupId
 artifactIdyuicompressor-maven-plugin/artifactId
 executions
   execution
 goals
   goalcompress/goal
 /goals
   /execution
 /executions
 configuration
   nosuffixtrue/nosuffix
 /configuration
   /plugin
   plugin
 groupIdorg.apache.maven.plugins/groupId
 artifactIdmaven-eclipse-plugin/artifactId
 configuration
   downloadSourcestrue/downloadSources
   excludes
 excludeorg.scala-lang:scala-library/exclude
   /excludes
   classpathContainers

classpathContainerch.epfl.lamp.sdt.launching.SCALA_CONTAINER/
classpathContainer
   /classpathContainers
   projectnatures
 java.lang.Stringch.epfl.lamp.sdt.core.scalanature/
java.lang.String
 java.lang.Stringorg.eclipse.jdt.core.javanature/
java.lang.String
   /projectnatures
   buildcommands
 java.lang.Stringch.epfl.lamp.sdt.core.scalabuilder/
java.lang.String
   /buildcommands
 /configuration
   /plugin
 /plugins
   /build
   reporting
 plugins
   plugin
 groupIdorg.scala-tools/groupId
 artifactIdmaven-scala-plugin/artifactId
 

[Lift] Re: QueryParams and joins

2010-01-06 Thread Mads Hartmann
And the boot file looks like this:

package bootstrap.liftweb

import _root_.net.liftweb.util._
import _root_.net.liftweb.http._
import _root_.net.liftweb.sitemap._
import _root_.net.liftweb.sitemap.Loc._
import Helpers._
import _root_.net.liftweb.mapper.{DB, ConnectionManager, Schemifier,
DefaultConnectionIdentifier, ConnectionIdentifier}
import _root_.java.sql.{Connection, DriverManager}
import _root_.scalableKvidr.model._
import _root_.javax.servlet.http.{HttpServletRequest}
import net.liftweb.common._

/**
  * A class that's instantiated early and run.  It allows the
application
  * to modify lift's environment
  */
class Boot {
  def boot {
if (!DB.jndiJdbcConnAvailable_?)
  DB.defineConnectionManager(DefaultConnectionIdentifier,
DBVendor)

// where to search snippet
LiftRules.addToPackages(scalableKvidr)
Schemifier.schemify(true, Log.infoF _, User, Tag, Tweet, TagUser)

// Build SiteMap
 val entries = Menu(Loc(forside, List(index), Forside)) ::

Menu(Loc(Alle_Kategorier, List(allcategories), Alle
Kategorier)) ::

Menu(Loc(Brugere, List(bruger), Brugere)) ::

Menu(Loc(Tilmeld, List(tilmeld), Tilmeld)) ::

Menu(Loc(Hvad Er Kvidr?, List(hvad_er_kvidr), Hvad Er
Kvidr?)) ::

Menu(Loc(kategori, List(category), Kategori,
Hidden)) ::
Nil
LiftRules.setSiteMap(SiteMap(entries:_*))

// Rewrite rules, rules! ;)
LiftRules.rewrite.append {

  case RewriteRequest(
   ParsePath(List(kategori,tag),_,_,_),_,_) =
   RewriteResponse(category :: Nil, Map(tag - tag))
  /*case RewriteRequest(
   ParsePath(List(kategori,alle),_,_,_),_,_) =
   RewriteResponse(allcategories :: Nil)*/

}

/*
 * Show the spinny image when an Ajax call starts
 */
LiftRules.ajaxStart =
  Full(() = LiftRules.jsArtifacts.show(ajax-loader).cmd)

/*
 * Make the spinny image go away when it ends
 */
LiftRules.ajaxEnd =
  Full(() = LiftRules.jsArtifacts.hide(ajax-loader).cmd)

LiftRules.early.append(makeUtf8)

S.addAround(DB.buildLoanWrapper)
  }

  /**
   * Force the request to be UTF-8
   */

  private def makeUtf8(req: HttpServletRequest) {
req.setCharacterEncoding(UTF-8)
  }

}
object DBVendor extends ConnectionManager {
 def newConnection(name : ConnectionIdentifier) = {
   try {
 Class.forName(com.mysql.jdbc.Driver)
 val dm = DriverManager.getConnection(jdbc:mysql://localhost:8889/
databaseinformationhere)
 Full(dm)
   } catch {
 case e : Exception = e.printStackTrace; Empty
   }
 }
 def releaseConnection(conn: Connection) {conn.close}
}





On Jan 6, 1:17 pm, Mads Hartmann mads...@gmail.com wrote:
 Aha! It almost compiles now. There's just one last error:

 [INFO] Compiling 8 source files to /Users/Mads/Projects/scalableKvidr2/
 target/classes at 1262780161026
 [ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/bootstrap/
 liftweb/Boot.scala:61: error: type mismatch;
 [INFO]  found   : (javax.servlet.http.HttpServletRequest) = Unit
 [INFO]  required: (net.liftweb.http.provider.HTTPRequest) = Any
 [INFO]     LiftRules.early.append(makeUtf8)
 [INFO]                            ^
 [ERROR] one error found

 On Jan 6, 12:59 pm, Jeppe Nejsum Madsen je...@ingolfs.dk wrote:



  Mads Hartmann mads...@gmail.com writes:
   Again, I really appreciate you guys helping me out :)

   @Indrajit I just tried with the dependency you declared as the only
   lift related dependency. I get the following error.

   dependency
     groupIdnet.liftweb/groupId
     artifactIdlift-mapper/artifactId
     version1.1-M8/version
   /dependency

  Note, Lift 1.1 is not source compatible with 1.0. You need to change
  your code (in a few places) Specifically, it seems you need to add

  import net.liftweb.common._

  to Boot.scala

  /Jeppe
-- 
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] Re: QueryParams and joins

2010-01-06 Thread Mads Hartmann
@Indrajit Raychaudhuri, I've applied your changes

On Jan 6, 1:22 pm, Mads Hartmann mads...@gmail.com wrote:
 And the boot file looks like this:

 package bootstrap.liftweb

 import _root_.net.liftweb.util._
 import _root_.net.liftweb.http._
 import _root_.net.liftweb.sitemap._
 import _root_.net.liftweb.sitemap.Loc._
 import Helpers._
 import _root_.net.liftweb.mapper.{DB, ConnectionManager, Schemifier,
 DefaultConnectionIdentifier, ConnectionIdentifier}
 import _root_.java.sql.{Connection, DriverManager}
 import _root_.scalableKvidr.model._
 import _root_.javax.servlet.http.{HttpServletRequest}
 import net.liftweb.common._

 /**
   * A class that's instantiated early and run.  It allows the
 application
   * to modify lift's environment
   */
 class Boot {
   def boot {
     if (!DB.jndiJdbcConnAvailable_?)
       DB.defineConnectionManager(DefaultConnectionIdentifier,
 DBVendor)

     // where to search snippet
     LiftRules.addToPackages(scalableKvidr)
     Schemifier.schemify(true, Log.infoF _, User, Tag, Tweet, TagUser)

     // Build SiteMap
      val entries = Menu(Loc(forside, List(index), Forside)) ::
                                                                         
 Menu(Loc(Alle_Kategorier, List(allcategories), Alle
 Kategorier)) ::
                                                                         
 Menu(Loc(Brugere, List(bruger), Brugere)) ::
                                                                         
 Menu(Loc(Tilmeld, List(tilmeld), Tilmeld)) ::
                                                                         
 Menu(Loc(Hvad Er Kvidr?, List(hvad_er_kvidr), Hvad Er
 Kvidr?)) ::
                                                                         
 Menu(Loc(kategori, List(category), Kategori,
 Hidden)) ::
                                                                         Nil
     LiftRules.setSiteMap(SiteMap(entries:_*))

     // Rewrite rules, rules! ;)
     LiftRules.rewrite.append {

       case RewriteRequest(
            ParsePath(List(kategori,tag),_,_,_),_,_) =
            RewriteResponse(category :: Nil, Map(tag - tag))
       /*case RewriteRequest(
            ParsePath(List(kategori,alle),_,_,_),_,_) =
            RewriteResponse(allcategories :: Nil)*/

     }

     /*
      * Show the spinny image when an Ajax call starts
      */
     LiftRules.ajaxStart =
       Full(() = LiftRules.jsArtifacts.show(ajax-loader).cmd)

     /*
      * Make the spinny image go away when it ends
      */
     LiftRules.ajaxEnd =
       Full(() = LiftRules.jsArtifacts.hide(ajax-loader).cmd)

     LiftRules.early.append(makeUtf8)

     S.addAround(DB.buildLoanWrapper)
   }

   /**
    * Force the request to be UTF-8
    */

   private def makeUtf8(req: HttpServletRequest) {
     req.setCharacterEncoding(UTF-8)
   }

 }

 object DBVendor extends ConnectionManager {
  def newConnection(name : ConnectionIdentifier) = {
    try {
      Class.forName(com.mysql.jdbc.Driver)
      val dm = DriverManager.getConnection(jdbc:mysql://localhost:8889/
 databaseinformationhere)
      Full(dm)
    } catch {
      case e : Exception = e.printStackTrace; Empty
    }
  }
  def releaseConnection(conn: Connection) {conn.close}

 }

 On Jan 6, 1:17 pm, Mads Hartmann mads...@gmail.com wrote:



  Aha! It almost compiles now. There's just one last error:

  [INFO] Compiling 8 source files to /Users/Mads/Projects/scalableKvidr2/
  target/classes at 1262780161026
  [ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/bootstrap/
  liftweb/Boot.scala:61: error: type mismatch;
  [INFO]  found   : (javax.servlet.http.HttpServletRequest) = Unit
  [INFO]  required: (net.liftweb.http.provider.HTTPRequest) = Any
  [INFO]     LiftRules.early.append(makeUtf8)
  [INFO]                            ^
  [ERROR] one error found

  On Jan 6, 12:59 pm, Jeppe Nejsum Madsen je...@ingolfs.dk wrote:

   Mads Hartmann mads...@gmail.com writes:
Again, I really appreciate you guys helping me out :)

@Indrajit I just tried with the dependency you declared as the only
lift related dependency. I get the following error.

dependency
  groupIdnet.liftweb/groupId
  artifactIdlift-mapper/artifactId
  version1.1-M8/version
/dependency

   Note, Lift 1.1 is not source compatible with 1.0. You need to change
   your code (in a few places) Specifically, it seems you need to add

   import net.liftweb.common._

   to Boot.scala

   /Jeppe
-- 
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] Re: QueryParams and joins

2010-01-06 Thread Mads Hartmann
It compiles and works now! :)

Thanks a lot for your help everyone

On Jan 6, 1:29 pm, Mads Hartmann mads...@gmail.com wrote:
 @Indrajit Raychaudhuri, I've applied your changes

 On Jan 6, 1:22 pm, Mads Hartmann mads...@gmail.com wrote:



  And the boot file looks like this:

  package bootstrap.liftweb

  import _root_.net.liftweb.util._
  import _root_.net.liftweb.http._
  import _root_.net.liftweb.sitemap._
  import _root_.net.liftweb.sitemap.Loc._
  import Helpers._
  import _root_.net.liftweb.mapper.{DB, ConnectionManager, Schemifier,
  DefaultConnectionIdentifier, ConnectionIdentifier}
  import _root_.java.sql.{Connection, DriverManager}
  import _root_.scalableKvidr.model._
  import _root_.javax.servlet.http.{HttpServletRequest}
  import net.liftweb.common._

  /**
    * A class that's instantiated early and run.  It allows the
  application
    * to modify lift's environment
    */
  class Boot {
    def boot {
      if (!DB.jndiJdbcConnAvailable_?)
        DB.defineConnectionManager(DefaultConnectionIdentifier,
  DBVendor)

      // where to search snippet
      LiftRules.addToPackages(scalableKvidr)
      Schemifier.schemify(true, Log.infoF _, User, Tag, Tweet, TagUser)

      // Build SiteMap
       val entries = Menu(Loc(forside, List(index), Forside)) ::
                                                                          
  Menu(Loc(Alle_Kategorier, List(allcategories), Alle
  Kategorier)) ::
                                                                          
  Menu(Loc(Brugere, List(bruger), Brugere)) ::
                                                                          
  Menu(Loc(Tilmeld, List(tilmeld), Tilmeld)) ::
                                                                          
  Menu(Loc(Hvad Er Kvidr?, List(hvad_er_kvidr), Hvad Er
  Kvidr?)) ::
                                                                          
  Menu(Loc(kategori, List(category), Kategori,
  Hidden)) ::
                                                                          Nil
      LiftRules.setSiteMap(SiteMap(entries:_*))

      // Rewrite rules, rules! ;)
      LiftRules.rewrite.append {

        case RewriteRequest(
             ParsePath(List(kategori,tag),_,_,_),_,_) =
             RewriteResponse(category :: Nil, Map(tag - tag))
        /*case RewriteRequest(
             ParsePath(List(kategori,alle),_,_,_),_,_) =
             RewriteResponse(allcategories :: Nil)*/

      }

      /*
       * Show the spinny image when an Ajax call starts
       */
      LiftRules.ajaxStart =
        Full(() = LiftRules.jsArtifacts.show(ajax-loader).cmd)

      /*
       * Make the spinny image go away when it ends
       */
      LiftRules.ajaxEnd =
        Full(() = LiftRules.jsArtifacts.hide(ajax-loader).cmd)

      LiftRules.early.append(makeUtf8)

      S.addAround(DB.buildLoanWrapper)
    }

    /**
     * Force the request to be UTF-8
     */

    private def makeUtf8(req: HttpServletRequest) {
      req.setCharacterEncoding(UTF-8)
    }

  }

  object DBVendor extends ConnectionManager {
   def newConnection(name : ConnectionIdentifier) = {
     try {
       Class.forName(com.mysql.jdbc.Driver)
       val dm = DriverManager.getConnection(jdbc:mysql://localhost:8889/
  databaseinformationhere)
       Full(dm)
     } catch {
       case e : Exception = e.printStackTrace; Empty
     }
   }
   def releaseConnection(conn: Connection) {conn.close}

  }

  On Jan 6, 1:17 pm, Mads Hartmann mads...@gmail.com wrote:

   Aha! It almost compiles now. There's just one last error:

   [INFO] Compiling 8 source files to /Users/Mads/Projects/scalableKvidr2/
   target/classes at 1262780161026
   [ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/bootstrap/
   liftweb/Boot.scala:61: error: type mismatch;
   [INFO]  found   : (javax.servlet.http.HttpServletRequest) = Unit
   [INFO]  required: (net.liftweb.http.provider.HTTPRequest) = Any
   [INFO]     LiftRules.early.append(makeUtf8)
   [INFO]                            ^
   [ERROR] one error found

   On Jan 6, 12:59 pm, Jeppe Nejsum Madsen je...@ingolfs.dk wrote:

Mads Hartmann mads...@gmail.com writes:
 Again, I really appreciate you guys helping me out :)

 @Indrajit I just tried with the dependency you declared as the only
 lift related dependency. I get the following error.

 dependency
   groupIdnet.liftweb/groupId
   artifactIdlift-mapper/artifactId
   version1.1-M8/version
 /dependency

Note, Lift 1.1 is not source compatible with 1.0. You need to change
your code (in a few places) Specifically, it seems you need to add

import net.liftweb.common._

to Boot.scala

/Jeppe
-- 
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 

Re: [Lift] Lift on Atmosphere

2010-01-06 Thread Paul Sandoz


On Jan 6, 2010, at 12:49 PM, Timothy Perrett wrote:


paksegu,

Lift does have better comet support than Atmosphere, but it depends  
what your use case is and what you specifically want to do. If you  
chose to run lift with atmosphere you'd essentially be loosing out  
on some of lift's best features. As jonas says, Akka does indeed use  
Atmosphere to good effect, but its a different tool, for a different  
job IMHO (although you can run them in tandem if your use case  
dictates that need).


So, lets try to add some clarity here by ascertaining what exactly  
you want to do... before this turns into a my comet is better than  
your comet flame war ;-)




How does Lift achieve portability across the various Comet APIs  
supported by Web/App servers?


Would i be right in assuming that currently only Jetty is supported? [*]

If so the Atmosphere Comet Portable Runtime may be of benefit.

Paul.

[*] I had a quick look at the lift source and specifically looked at  
net.liftweb.http.provider.servlet.HTTPRequestServlet.



Cheers, Tim

On 6 Jan 2010, at 11:29, Jonas Bonér wrote:


Akka has excellent Atmosphere support. Akka can be used with Lift.
http://doc.akkasource.org/comet

2010/1/6 paksegu paks...@gmail.com:

Hello World.
I am a Lift beginner and I would like to know if anyone has
successfully succeeded in running Lift on Atmosphere: 
https://atmosphere.dev.java.net
thanks.

--
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 
.









--
Jonas Bonér

twitter: @jboner
blog:http://jonasboner.com
work:   http://scalablesolutions.se
code:   http://github.com/jboner
code:   http://akkasource.org
also:http://letitcrash.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 
.





--
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.




Re: [Lift] Lift on Atmosphere

2010-01-06 Thread Timothy Perrett
Yes, if you constantly change containers, then there is value in Atmosphere for 
that as it does leverage the native APIs for the container. We [lift] are 
waiting for servlet 3.0 to standardise the comet API - whilst its debatable if 
that will prove as an api standardisation solution, it should level the playing 
field somewhat - right now the different containers are all doing different 
things in different ways. 

Essentially lift uses special classes within Jetty (the continuation API) to 
make comet scalable... there is nothing stopping comet working in other 
containers with lift, the only restriction is that it does not use the native 
container API so it's essentially thread based - to that end, if you have a lot 
of connections things could get sticky. 

Lift has things that Atmosphere does not have (yet) like the multiplex support, 
and object delta'ing... perhaps other comet frameworks will get this in the 
future, but right now, using Jetty is not a deal breaker for most of our users. 
I guess its only really an issue if you have a heavy investment in something 
that is not jetty. However, I would stress that lift is an excellent framework 
even if your not using comet and that would of course deploy without any issues 
in any container. 

I actually had a discussion with Jean-Francois at Devoxx this year about 
Atmosphere and Lift ;-)

Cheers, Tim



On 6 Jan 2010, at 12:40, Paul Sandoz wrote:

 
 On Jan 6, 2010, at 12:49 PM, Timothy Perrett wrote:
 
 paksegu,
 
 Lift does have better comet support than Atmosphere, but it depends what 
 your use case is and what you specifically want to do. If you chose to run 
 lift with atmosphere you'd essentially be loosing out on some of lift's best 
 features. As jonas says, Akka does indeed use Atmosphere to good effect, but 
 its a different tool, for a different job IMHO (although you can run them in 
 tandem if your use case dictates that need).
 
 So, lets try to add some clarity here by ascertaining what exactly you want 
 to do... before this turns into a my comet is better than your comet flame 
 war ;-)
 
 
 How does Lift achieve portability across the various Comet APIs supported by 
 Web/App servers?
 
 Would i be right in assuming that currently only Jetty is supported? [*]
 
 If so the Atmosphere Comet Portable Runtime may be of benefit.
 
 Paul.
 
 [*] I had a quick look at the lift source and specifically looked at 
 net.liftweb.http.provider.servlet.HTTPRequestServlet.
 
 Cheers, Tim
 
 On 6 Jan 2010, at 11:29, Jonas Bonér wrote:
 
 Akka has excellent Atmosphere support. Akka can be used with Lift.
 http://doc.akkasource.org/comet
 
 2010/1/6 paksegu paks...@gmail.com:
 Hello World.
 I am a Lift beginner and I would like to know if anyone has
 successfully succeeded in running Lift on Atmosphere: 
 https://atmosphere.dev.java.net
 thanks.
 
 --
 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.
 
 
 
 
 
 
 
 -- 
 Jonas Bonér
 
 twitter: @jboner
 blog:http://jonasboner.com
 work:   http://scalablesolutions.se
 code:   http://github.com/jboner
 code:   http://akkasource.org
 also:http://letitcrash.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.
 
 
 
 -- 
 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.
 
 

-- 
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] issue with sitemap submenus ?

2010-01-06 Thread Jean-Luc
Hi liftweb-list !

Happy New Year to all !

Well, I have an issue with sitemap submenus.

Using the following code :
val entries = SiteMap(Menu(Loc(Home, index :: Nil , ?(Home))),
  Menu(Loc(Authors, authors :: list :: Nil, ?(Author
List)),
*   Menu(Loc(Test, authors :: test :: Nil,
?(Author Test,*
  Menu(Loc(Add Author, authors :: add :: Nil, ?(Add
Author), Hidden)),
  Menu(Loc(Books, books :: list :: Nil, ?(Book List))),
  Menu(Loc(Add Book, books :: add :: Nil, ?(Add Book),
Hidden)),
  Menu(Loc(BookSearch, books :: search :: Nil, ?(Book
Search

Expected result :
- the menu is displayed and a Author Test entry is present
*  Home
*  Author List
*   * Author Test*
*  Book List
*  Book Search

Current result :
- the menu is displayed but no Author Test entry is present
*  Home
*  Author List
*  Book List
*  Book Search

Before the last mvn -U xxx my submenis where displayed correctly.

Is there a known issue or am I missing something ?

To reproduce the problem :
- http://github.com/jlcanela/scalajpademo
- change Boot.scala (line 53) and use the modified entries sitemap


-- 
Jean-Luc Canela
jlcane...@gmail.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.



Re: [Lift] Lift on Atmosphere

2010-01-06 Thread David Pollak
On Wed, Jan 6, 2010 at 5:23 AM, Timothy Perrett timo...@getintheloop.euwrote:

 Yes, if you constantly change containers, then there is value in Atmosphere
 for that as it does leverage the native APIs for the container. We [lift]
 are waiting for servlet 3.0 to standardise the comet API - whilst its
 debatable if that will prove as an api standardisation solution, it should
 level the playing field somewhat - right now the different containers are
 all doing different things in different ways.


Marius is actively working on an abstraction of the thread dropping so that
other containers that use different APIs can be plugged into Lift (or vice
versa) because the Servlet 3.0 spec is taking forever.



 Essentially lift uses special classes within Jetty (the continuation API)
 to make comet scalable... there is nothing stopping comet working in other
 containers with lift, the only restriction is that it does not use the
 native container API so it's essentially thread based - to that end, if you
 have a lot of connections things could get sticky.

 Lift has things that Atmosphere does not have (yet) like the multiplex
 support, and object delta'ing... perhaps other comet frameworks will get
 this in the future, but right now, using Jetty is not a deal breaker for
 most of our users. I guess its only really an issue if you have a heavy
 investment in something that is not jetty. However, I would stress that lift
 is an excellent framework even if your not using comet and that would of
 course deploy without any issues in any container.


As Tim points out, Lift has a number of advantages in its Comet support:

   - Multiplexing -- you can have many Comet components on a given page and
   they all talk over a single long poll.  You can see this at
   http://demo.liftweb.com.  Both the clock and the chat component are
   Comet.  Neither piece of code was special or required knowledge of the
   other.
   - Connection saturation detection -- Lift will avoid connection
   saturation by only allowing a single long poll to be active at once.  If a
   second connection (this is tunable and it's on my to-do list to make it
   browser tunable as Chrome has more than 2 connections per server) is opened
   from the browser, Lift will automatically terminate the long poll.
   - DNS wildcard support -- To avoid the connection saturation issue, you
   can have the long poll done on a DNS wildcarded server and tune the long
   poll connection termination logic.  This allows many different browser tabs
   to have open long polls.  The server name is automatically changed on each
   page reload and the actual client-side and server-side components are
   unchanged (that means the app developer doesn't have to worry about this
   part of the plumbing.)





 I actually had a discussion with Jean-Francois at Devoxx this year about
 Atmosphere and Lift ;-)

 Cheers, Tim



 On 6 Jan 2010, at 12:40, Paul Sandoz wrote:

 
  On Jan 6, 2010, at 12:49 PM, Timothy Perrett wrote:
 
  paksegu,
 
  Lift does have better comet support than Atmosphere, but it depends what
 your use case is and what you specifically want to do. If you chose to run
 lift with atmosphere you'd essentially be loosing out on some of lift's best
 features. As jonas says, Akka does indeed use Atmosphere to good effect, but
 its a different tool, for a different job IMHO (although you can run them in
 tandem if your use case dictates that need).
 
  So, lets try to add some clarity here by ascertaining what exactly you
 want to do... before this turns into a my comet is better than your comet
 flame war ;-)
 
 
  How does Lift achieve portability across the various Comet APIs supported
 by Web/App servers?
 
  Would i be right in assuming that currently only Jetty is supported? [*]
 
  If so the Atmosphere Comet Portable Runtime may be of benefit.
 
  Paul.
 
  [*] I had a quick look at the lift source and specifically looked at
 net.liftweb.http.provider.servlet.HTTPRequestServlet.
 
  Cheers, Tim
 
  On 6 Jan 2010, at 11:29, Jonas Bonér wrote:
 
  Akka has excellent Atmosphere support. Akka can be used with Lift.
  http://doc.akkasource.org/comet
 
  2010/1/6 paksegu paks...@gmail.com:
  Hello World.
  I am a Lift beginner and I would like to know if anyone has
  successfully succeeded in running Lift on Atmosphere:
 https://atmosphere.dev.java.net
  thanks.
 
  --
  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.comliftweb%2bunsubscr...@googlegroups.com
 .
  For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=en.
 
 
 
 
 
 
 
  --
  Jonas Bonér
 
  twitter: @jboner
  blog:http://jonasboner.com
  work:   http://scalablesolutions.se
  code:   http://github.com/jboner
  code:   http://akkasource.org
  also:http://letitcrash.com
  --
  You 

Re: [Lift] Re: Lift based backend server subscribing via amqp

2010-01-06 Thread vishnu
Hi Timothy
could you point me to the right place to download it? Is there a maven
repository to which it gets automatically uploaded?

On Tue, Jan 5, 2010 at 6:36 PM, Timothy Perrett timo...@getintheloop.euwrote:

 Pushed to master - will be in hudson jars in a few hours.

 Cheers, Tim

 On Jan 5, 10:06 am, Timothy Perrett timo...@getintheloop.eu wrote:
  http://github.com/dpp/liftweb/issues/#issue/270
 
  Fixed and on review board.
 
  Cheers, Tim
 
  On Jan 5, 8:57 am, Timothy Perrett timo...@getintheloop.eu wrote:
 
 
 
   We don't accept patches for legal reasons. However, I will upgrade the

   module today for you - giving a similar result.
 
   Cheers, Tim
 
   Sent from my iPhone
 
   On 5 Jan 2010, at 04:29, Franz Bettag fr...@bett.ag wrote:
 
Hey guys,
 
i've just updated the amqp code. I started a pull request on github
but that seems *not* to be the proper way *smirking @dpp's auto-
reply*.
 
Anyway here is the patch. The problem was that in version 1.5.0 of
rabbitmq's library, the ticket-stuff was removed.
 
diff --git a/lift-modules/lift-amqp/pom.xml b/lift-modules/lift-amqp/
pom.xml
index 9f4c1d5..424be0e 100644
--- a/lift-modules/lift-amqp/pom.xml
+++ b/lift-modules/lift-amqp/pom.xml
@@ -32,6 +32,15 @@
  /parent
  artifactIdlift-amqp/artifactId
 
+  repositories
+repository
+  idnexus.griddynamics.net/id
+  nameNexus Maven2 Repository/name
+  urlhttps://nexus.griddynamics.net/nexus/content/groups/
public/url
+/repository
+  /repositories
+
+
  !-- properties/ --
 
  !--
@@ -55,8 +64,8 @@
/dependency
dependency
  groupIdcom.rabbitmq/groupId
-  artifactIdrabbitmq-client/artifactId
-  version1.3.0/version
+  artifactIdamqp-client/artifactId
+  version1.7.0/version
/dependency
  /dependencies
 
diff --git a/lift-modules/lift-amqp/src/main/scala/net/liftweb/amqp/
AMQPDispatcher.scala b/lift-modules/lift-amqp/src/main/scala/net/
liftweb/amqp/AMQPDispatcher.scala
index 26bca73..96c66c9 100644
--- a/lift-modules/lift-amqp/src/main/scala/net/liftweb/amqp/
AMQPDispatcher.scala
+++ b/lift-modules/lift-amqp/src/main/scala/net/liftweb/amqp/
AMQPDispatcher.scala
@@ -91,7 +91,7 @@ abstract class AMQPDispatcher[T](cf:
ConnectionFactory, host: String, port: Int)
class SerializedConsumer[T](channel: Channel, a: LiftActor) extends
DefaultConsumer(channel) {
  override def handleDelivery(tag: String, env: Envelope, props:
AMQP.BasicProperties, body: Array[Byte]) {
val routingKey = env.getRoutingKey
-val contentType = props.contentType
+val contentType = props.getContentType
val deliveryTag = env.getDeliveryTag
val in = new ObjectInputStream(new ByteArrayInputStream(body))
val t = in.readObject.asInstanceOf[T];
@@ -109,14 +109,12 @@ class SerializedConsumer[T](channel: Channel,
 a:
LiftActor) extends DefaultConsu
class ExampleSerializedAMQPDispatcher[T](factory: ConnectionFactory,
host: String, port: Int)
extends AMQPDispatcher[T](factory, host, port) {
  override def configure(channel: Channel) {
-// Get the ticket.
-val ticket = channel.accessRequest(/data)
// Set up the exchange and queue
-channel.exchangeDeclare(ticket, mult, direct)
-channel.queueDeclare(ticket, mult_queue)
-channel.queueBind(ticket, mult_queue, mult, routeroute)
+channel.exchangeDeclare(mult, direct)
+channel.queueDeclare(mult_queue)
+channel.queueBind(mult_queue, mult, routeroute)
// Use the short version of the basicConsume method for
convenience.
-channel.basicConsume(ticket, mult_queue, false, new
SerializedConsumer(channel, this))
+channel.basicConsume(mult_queue, false, new SerializedConsumer
(channel, this))
  }
}
 
diff --git a/lift-modules/lift-amqp/src/main/scala/net/liftweb/amqp/
AMQPSender.scala b/lift-modules/lift-amqp/src/main/scala/net/liftweb/
amqp/AMQPSender.scala
index 2c60ed6..dc29a2a 100644
--- a/lift-modules/lift-amqp/src/main/scala/net/liftweb/amqp/
AMQPSender.scala
+++ b/lift-modules/lift-amqp/src/main/scala/net/liftweb/amqp/
AMQPSender.scala
@@ -14,11 +14,6 @@ import _root_.java.io.ObjectOutputStream
abstract class AMQPSender[T](cf: ConnectionFactory, host: String,
port: Int, exchange: String, routingKey: String) extends LiftActor {
  val conn = cf.newConnection(host, port)
  val channel = conn.createChannel()
-  val ticket = configure(channel)
-  /**
-   * Override this to use your own AMQP queue/exchange with the
 given
channel.
-   */
-  def configure(channel: Channel): Int
 
  def send(msg: T) {
// Now write an object to a byte array and shove it across the
wire.
@@ -26,7 

Re: [Lift] Lift on Atmosphere

2010-01-06 Thread Paul Sandoz


On Jan 6, 2010, at 3:22 PM, David Pollak wrote:




On Wed, Jan 6, 2010 at 5:23 AM, Timothy Perrett timo...@getintheloop.eu 
 wrote:
Yes, if you constantly change containers, then there is value in  
Atmosphere for that as it does leverage the native APIs for the  
container. We [lift] are waiting for servlet 3.0 to standardise the  
comet API - whilst its debatable if that will prove as an api  
standardisation solution, it should level the playing field somewhat  
- right now the different containers are all doing different things  
in different ways.


Marius is actively working on an abstraction of the thread dropping  
so that other containers that use different APIs can be plugged into  
Lift (or vice versa) because the Servlet 3.0 spec is taking forever.


OK. Servlet 3.0 spec is now finalized, meaning there is at least one  
implementation (in GlassFish v3) but i guess it may take time for  
others to arrive.


Are the async features of Servlet 3.0 sufficient for lift's  
requirements?






Essentially lift uses special classes within Jetty (the continuation  
API) to make comet scalable... there is nothing stopping comet  
working in other containers with lift, the only restriction is that  
it does not use the native container API so it's essentially thread  
based - to that end, if you have a lot of connections things could  
get sticky.


Lift has things that Atmosphere does not have (yet) like the  
multiplex support, and object delta'ing... perhaps other comet  
frameworks will get this in the future, but right now, using Jetty  
is not a deal breaker for most of our users. I guess its only really  
an issue if you have a heavy investment in something that is not  
jetty. However, I would stress that lift is an excellent framework  
even if your not using comet and that would of course deploy without  
any issues in any container.


As Tim points out, Lift has a number of advantages in its Comet  
support:
Multiplexing -- you can have many Comet components on a given page  
and they all talk over a single long poll.  You can see this at http://demo.liftweb.com 
.  Both the clock and the chat component are Comet.  Neither piece  
of code was special or required knowledge of the other.
Connection saturation detection -- Lift will avoid connection  
saturation by only allowing a single long poll to be active at  
once.  If a second connection (this is tunable and it's on my to-do  
list to make it browser tunable as Chrome has more than 2  
connections per server) is opened from the browser, Lift will  
automatically terminate the long poll.
DNS wildcard support -- To avoid the connection saturation issue,  
you can have the long poll done on a DNS wildcarded server and tune  
the long poll connection termination logic.  This allows many  
different browser tabs to have open long polls.  The server name is  
automatically changed on each page reload and the actual client-side  
and server-side components are unchanged (that means the app  
developer doesn't have to worry about this part of the plumbing.)




I am not suggesting Atmosphere can or should be utilized as a  
replacement for the useful features you enumerate. I think the area  
where Atmosphere can provide value to lift is scalable async support  
for many Web/App servers.


Paul.
-- 

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 based backend server subscribing via amqp

2010-01-06 Thread Timothy Perrett
http://scala-tools.org/repo-snapshots/net/liftweb/lift-amqp/1.1-SNAPSHOT/



On 6 Jan 2010, at 14:36, vishnu wrote:

 Hi Timothy
 could you point me to the right place to download it? Is there a maven 
 repository to which it gets automatically uploaded?
 
 On Tue, Jan 5, 2010 at 6:36 PM, Timothy Perrett timo...@getintheloop.eu 
 wrote:
 Pushed to master - will be in hudson jars in a few hours.
 
 Cheers, Tim
 
 On Jan 5, 10:06 am, Timothy Perrett timo...@getintheloop.eu wrote:
  http://github.com/dpp/liftweb/issues/#issue/270
 
  Fixed and on review board.
 
  Cheers, Tim
 
  On Jan 5, 8:57 am, Timothy Perrett timo...@getintheloop.eu wrote:
 
 
 
   We don't accept patches for legal reasons. However, I will upgrade the  
   module today for you - giving a similar result.
 
   Cheers, Tim
 
   Sent from my iPhone
 
   On 5 Jan 2010, at 04:29, Franz Bettag fr...@bett.ag wrote:
 
Hey guys,
 
i've just updated the amqp code. I started a pull request on github
but that seems *not* to be the proper way *smirking @dpp's auto-
reply*.
 
Anyway here is the patch. The problem was that in version 1.5.0 of
rabbitmq's library, the ticket-stuff was removed.
 
diff --git a/lift-modules/lift-amqp/pom.xml b/lift-modules/lift-amqp/
pom.xml
index 9f4c1d5..424be0e 100644
--- a/lift-modules/lift-amqp/pom.xml
+++ b/lift-modules/lift-amqp/pom.xml
@@ -32,6 +32,15 @@
  /parent
  artifactIdlift-amqp/artifactId
 
+  repositories
+repository
+  idnexus.griddynamics.net/id
+  nameNexus Maven2 Repository/name
+  urlhttps://nexus.griddynamics.net/nexus/content/groups/
public/url
+/repository
+  /repositories
+
+
  !-- properties/ --
 
  !--
@@ -55,8 +64,8 @@
/dependency
dependency
  groupIdcom.rabbitmq/groupId
-  artifactIdrabbitmq-client/artifactId
-  version1.3.0/version
+  artifactIdamqp-client/artifactId
+  version1.7.0/version
/dependency
  /dependencies
 
diff --git a/lift-modules/lift-amqp/src/main/scala/net/liftweb/amqp/
AMQPDispatcher.scala b/lift-modules/lift-amqp/src/main/scala/net/
liftweb/amqp/AMQPDispatcher.scala
index 26bca73..96c66c9 100644
--- a/lift-modules/lift-amqp/src/main/scala/net/liftweb/amqp/
AMQPDispatcher.scala
+++ b/lift-modules/lift-amqp/src/main/scala/net/liftweb/amqp/
AMQPDispatcher.scala
@@ -91,7 +91,7 @@ abstract class AMQPDispatcher[T](cf:
ConnectionFactory, host: String, port: Int)
class SerializedConsumer[T](channel: Channel, a: LiftActor) extends
DefaultConsumer(channel) {
  override def handleDelivery(tag: String, env: Envelope, props:
AMQP.BasicProperties, body: Array[Byte]) {
val routingKey = env.getRoutingKey
-val contentType = props.contentType
+val contentType = props.getContentType
val deliveryTag = env.getDeliveryTag
val in = new ObjectInputStream(new ByteArrayInputStream(body))
val t = in.readObject.asInstanceOf[T];
@@ -109,14 +109,12 @@ class SerializedConsumer[T](channel: Channel, a:
LiftActor) extends DefaultConsu
class ExampleSerializedAMQPDispatcher[T](factory: ConnectionFactory,
host: String, port: Int)
extends AMQPDispatcher[T](factory, host, port) {
  override def configure(channel: Channel) {
-// Get the ticket.
-val ticket = channel.accessRequest(/data)
// Set up the exchange and queue
-channel.exchangeDeclare(ticket, mult, direct)
-channel.queueDeclare(ticket, mult_queue)
-channel.queueBind(ticket, mult_queue, mult, routeroute)
+channel.exchangeDeclare(mult, direct)
+channel.queueDeclare(mult_queue)
+channel.queueBind(mult_queue, mult, routeroute)
// Use the short version of the basicConsume method for
convenience.
-channel.basicConsume(ticket, mult_queue, false, new
SerializedConsumer(channel, this))
+channel.basicConsume(mult_queue, false, new SerializedConsumer
(channel, this))
  }
}
 
diff --git a/lift-modules/lift-amqp/src/main/scala/net/liftweb/amqp/
AMQPSender.scala b/lift-modules/lift-amqp/src/main/scala/net/liftweb/
amqp/AMQPSender.scala
index 2c60ed6..dc29a2a 100644
--- a/lift-modules/lift-amqp/src/main/scala/net/liftweb/amqp/
AMQPSender.scala
+++ b/lift-modules/lift-amqp/src/main/scala/net/liftweb/amqp/
AMQPSender.scala
@@ -14,11 +14,6 @@ import _root_.java.io.ObjectOutputStream
abstract class AMQPSender[T](cf: ConnectionFactory, host: String,
port: Int, exchange: String, routingKey: String) extends LiftActor {
  val conn = cf.newConnection(host, port)
  val channel = conn.createChannel()
-  val ticket = configure(channel)
-  /**
-   * Override this to use your own AMQP queue/exchange with the given
channel.
-   */
-  def configure(channel: Channel): Int

Re: [Lift] issue with sitemap submenus ?

2010-01-06 Thread Ross Mellgren
By default sitemap will only show submenus nearby the current page. You can 
show the entire expanded menu by using lift:Menu.builder expandAll=true /

You should try navigating to the Author List page and ensure that the Author 
Test menu shows up then.

-Ross

On Jan 6, 2010, at 9:20 AM, Jean-Luc wrote:

 Hi liftweb-list ! 
 
 Happy New Year to all ! 
 
 Well, I have an issue with sitemap submenus. 
 
 Using the following code : 
 val entries = SiteMap(Menu(Loc(Home, index :: Nil , ?(Home))),
   Menu(Loc(Authors, authors :: list :: Nil, ?(Author 
 List)),
Menu(Loc(Test, authors :: test :: Nil, 
 ?(Author Test,
   Menu(Loc(Add Author, authors :: add :: Nil, ?(Add 
 Author), Hidden)),
   Menu(Loc(Books, books :: list :: Nil, ?(Book List))),
   Menu(Loc(Add Book, books :: add :: Nil, ?(Add Book), 
 Hidden)),
   Menu(Loc(BookSearch, books :: search :: Nil, ?(Book 
 Search
 
 Expected result : 
 - the menu is displayed and a Author Test entry is present 
 *  Home
 *  Author List
* Author Test
 *  Book List
 *  Book Search
 
 Current result : 
 - the menu is displayed but no Author Test entry is present
 *  Home
 *  Author List
 *  Book List
 *  Book Search
 
 Before the last mvn -U xxx my submenis where displayed correctly. 
 
 Is there a known issue or am I missing something ? 
 
 To reproduce the problem : 
 - http://github.com/jlcanela/scalajpademo
 - change Boot.scala (line 53) and use the modified entries sitemap
 
 
 -- 
 Jean-Luc Canela
 jlcane...@gmail.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.

-- 

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 based backend server subscribing via amqp

2010-01-06 Thread Naftoli Gugenheim
Yes it's in maven. See the github wiki.

-
vishnupath...@gmail.com wrote:

Hi Timothy
could you point me to the right place to download it? Is there a maven
repository to which it gets automatically uploaded?

On Tue, Jan 5, 2010 at 6:36 PM, Timothy Perrett timo...@getintheloop.euwrote:

 Pushed to master - will be in hudson jars in a few hours.

 Cheers, Tim

 On Jan 5, 10:06 am, Timothy Perrett timo...@getintheloop.eu wrote:
  http://github.com/dpp/liftweb/issues/#issue/270
 
  Fixed and on review board.
 
  Cheers, Tim
 
  On Jan 5, 8:57 am, Timothy Perrett timo...@getintheloop.eu wrote:
 
 
 
   We don't accept patches for legal reasons. However, I will upgrade the

   module today for you - giving a similar result.
 
   Cheers, Tim
 
   Sent from my iPhone
 
   On 5 Jan 2010, at 04:29, Franz Bettag fr...@bett.ag wrote:
 
Hey guys,
 
i've just updated the amqp code. I started a pull request on github
but that seems *not* to be the proper way *smirking @dpp's auto-
reply*.
 
Anyway here is the patch. The problem was that in version 1.5.0 of
rabbitmq's library, the ticket-stuff was removed.
 
diff --git a/lift-modules/lift-amqp/pom.xml b/lift-modules/lift-amqp/
pom.xml
index 9f4c1d5..424be0e 100644
--- a/lift-modules/lift-amqp/pom.xml
+++ b/lift-modules/lift-amqp/pom.xml
@@ -32,6 +32,15 @@
  /parent
  artifactIdlift-amqp/artifactId
 
+  repositories
+repository
+  idnexus.griddynamics.net/id
+  nameNexus Maven2 Repository/name
+  urlhttps://nexus.griddynamics.net/nexus/content/groups/
public/url
+/repository
+  /repositories
+
+
  !-- properties/ --
 
  !--
@@ -55,8 +64,8 @@
/dependency
dependency
  groupIdcom.rabbitmq/groupId
-  artifactIdrabbitmq-client/artifactId
-  version1.3.0/version
+  artifactIdamqp-client/artifactId
+  version1.7.0/version
/dependency
  /dependencies
 
diff --git a/lift-modules/lift-amqp/src/main/scala/net/liftweb/amqp/
AMQPDispatcher.scala b/lift-modules/lift-amqp/src/main/scala/net/
liftweb/amqp/AMQPDispatcher.scala
index 26bca73..96c66c9 100644
--- a/lift-modules/lift-amqp/src/main/scala/net/liftweb/amqp/
AMQPDispatcher.scala
+++ b/lift-modules/lift-amqp/src/main/scala/net/liftweb/amqp/
AMQPDispatcher.scala
@@ -91,7 +91,7 @@ abstract class AMQPDispatcher[T](cf:
ConnectionFactory, host: String, port: Int)
class SerializedConsumer[T](channel: Channel, a: LiftActor) extends
DefaultConsumer(channel) {
  override def handleDelivery(tag: String, env: Envelope, props:
AMQP.BasicProperties, body: Array[Byte]) {
val routingKey = env.getRoutingKey
-val contentType = props.contentType
+val contentType = props.getContentType
val deliveryTag = env.getDeliveryTag
val in = new ObjectInputStream(new ByteArrayInputStream(body))
val t = in.readObject.asInstanceOf[T];
@@ -109,14 +109,12 @@ class SerializedConsumer[T](channel: Channel,
 a:
LiftActor) extends DefaultConsu
class ExampleSerializedAMQPDispatcher[T](factory: ConnectionFactory,
host: String, port: Int)
extends AMQPDispatcher[T](factory, host, port) {
  override def configure(channel: Channel) {
-// Get the ticket.
-val ticket = channel.accessRequest(/data)
// Set up the exchange and queue
-channel.exchangeDeclare(ticket, mult, direct)
-channel.queueDeclare(ticket, mult_queue)
-channel.queueBind(ticket, mult_queue, mult, routeroute)
+channel.exchangeDeclare(mult, direct)
+channel.queueDeclare(mult_queue)
+channel.queueBind(mult_queue, mult, routeroute)
// Use the short version of the basicConsume method for
convenience.
-channel.basicConsume(ticket, mult_queue, false, new
SerializedConsumer(channel, this))
+channel.basicConsume(mult_queue, false, new SerializedConsumer
(channel, this))
  }
}
 
diff --git a/lift-modules/lift-amqp/src/main/scala/net/liftweb/amqp/
AMQPSender.scala b/lift-modules/lift-amqp/src/main/scala/net/liftweb/
amqp/AMQPSender.scala
index 2c60ed6..dc29a2a 100644
--- a/lift-modules/lift-amqp/src/main/scala/net/liftweb/amqp/
AMQPSender.scala
+++ b/lift-modules/lift-amqp/src/main/scala/net/liftweb/amqp/
AMQPSender.scala
@@ -14,11 +14,6 @@ import _root_.java.io.ObjectOutputStream
abstract class AMQPSender[T](cf: ConnectionFactory, host: String,
port: Int, exchange: String, routingKey: String) extends LiftActor {
  val conn = cf.newConnection(host, port)
  val channel = conn.createChannel()
-  val ticket = configure(channel)
-  /**
-   * Override this to use your own AMQP queue/exchange with the
 given
channel.
-   */
-  def configure(channel: Channel): Int
 
  def 

[Lift] Re: SessionVars in different snippets

2010-01-06 Thread greekscala
Hello,

I dont have to use SessionVars until now, but in near future.
But I had the same problem in mind.

Is there not a central place to get the user session with all the
values stored?

I think it is ugly to have sessionVars spread all over my code.

with best regards

On 5 Jan., 18:13, Naftoli Gugenheim naftoli...@gmail.com wrote:
 Each SessionVar is distinct. Create one -- it can be global -- and use it in 
 both snippets.

 -

 michallchen...@gmail.com wrote:

 I have two snippets Login and Profile, and I want to read same object
 stored in session, when I use SessionVar it create two different
 object:

 object user extends SessionVar[Box[User]](Empty) // same in two
 snippets

 When I set this object in Login.scala :

  val usr = User.find(By(User.login,login))
 user.set(usr)

 in Profile it's still Empty

 why?

 --

 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.




Re: [Lift] Lift on Atmosphere

2010-01-06 Thread David Pollak
On Wed, Jan 6, 2010 at 7:17 AM, Paul Sandoz paul.san...@sun.com wrote:


 On Jan 6, 2010, at 3:22 PM, David Pollak wrote:



 On Wed, Jan 6, 2010 at 5:23 AM, Timothy Perrett 
 timo...@getintheloop.euwrote:

 Yes, if you constantly change containers, then there is value in
 Atmosphere for that as it does leverage the native APIs for the container.
 We [lift] are waiting for servlet 3.0 to standardise the comet API - whilst
 its debatable if that will prove as an api standardisation solution, it
 should level the playing field somewhat - right now the different containers
 are all doing different things in different ways.


 Marius is actively working on an abstraction of the thread dropping so that
 other containers that use different APIs can be plugged into Lift (or vice
 versa) because the Servlet 3.0 spec is taking forever.


 OK. Servlet 3.0 spec is now finalized, meaning there is at least one
 implementation (in GlassFish v3) but i guess it may take time for others to
 arrive.

 Are the async features of Servlet 3.0 sufficient for lift's requirements?


Yes and it will be supported by the work Marius is currently doing.







 Essentially lift uses special classes within Jetty (the continuation API)
 to make comet scalable... there is nothing stopping comet working in other
 containers with lift, the only restriction is that it does not use the
 native container API so it's essentially thread based - to that end, if you
 have a lot of connections things could get sticky.

 Lift has things that Atmosphere does not have (yet) like the multiplex
 support, and object delta'ing... perhaps other comet frameworks will get
 this in the future, but right now, using Jetty is not a deal breaker for
 most of our users. I guess its only really an issue if you have a heavy
 investment in something that is not jetty. However, I would stress that lift
 is an excellent framework even if your not using comet and that would of
 course deploy without any issues in any container.


 As Tim points out, Lift has a number of advantages in its Comet support:

- Multiplexing -- you can have many Comet components on a given page
and they all talk over a single long poll.  You can see this at
http://demo.liftweb.com.  Both the clock and the chat component are
Comet.  Neither piece of code was special or required knowledge of the
other.
- Connection saturation detection -- Lift will avoid connection
saturation by only allowing a single long poll to be active at once.  If a
second connection (this is tunable and it's on my to-do list to make it
browser tunable as Chrome has more than 2 connections per server) is opened
from the browser, Lift will automatically terminate the long poll.
- DNS wildcard support -- To avoid the connection saturation issue, you
can have the long poll done on a DNS wildcarded server and tune the long
poll connection termination logic.  This allows many different browser tabs
to have open long polls.  The server name is automatically changed on each
page reload and the actual client-side and server-side components are
unchanged (that means the app developer doesn't have to worry about this
part of the plumbing.)



 I am not suggesting Atmosphere can or should be utilized as a replacement
 for the useful features you enumerate. I think the area where Atmosphere can
 provide value to lift is scalable async support for many Web/App servers.


To date, the large Lift comet users have been using Jetty with success.  If
there is demand for Lift's Comet support on non-Servlet 3.0 platforms, we'll
look into Atmosphere integration.

Thanks,

David



 Paul.

 --
 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.comliftweb%2bunsubscr...@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.



[Lift] Fwd: [scala-announce] Call for Papers Reminder: The First Scala Workshop - Scala Days 2010

2010-01-06 Thread David Pollak
-- Forwarded message --
From: Antonio Cunei antonio.cu...@epfl.ch
Date: Wed, Jan 6, 2010 at 7:35 AM
Subject: [scala-announce] Call for Papers Reminder: The First Scala Workshop
- Scala Days 2010
To: scala-annou...@listes.epfl.ch, Scala list sc...@listes.epfl.ch



The First Scala Workshop



Call for Papers
---

Scala is a general purpose programming language designed to express
common programming patterns in a concise, elegant, and type-safe
way. It smoothly integrates features of object-oriented and
functional languages.

This workshop is a forum for researchers and practitioners to share
new ideas and results of interest to the Scala community. The first
workshop will be held at EPFL in Lausanne, Switzerland, on Thursday
15 April 2010, co-located with Scala Days 2010 (15-16 April).

We seek papers on topics related to Scala, including (but not
limited to):

1. Language design and implementation -- language extensions,
optimization, and performance evaluation.

2. Library design and implementation patterns for extending Scala --
embedded domain-specific languages, combining language features,
generic and meta-programming.

3.Formal techniques for Scala-like programs -- formalizations of the
language, type system, and semantics, formalizing proposed language
extensions and variants, dependent object types, type and effect
systems.

4. Concurrent and distributed programming -- libraries, frameworks,
language extensions, programming paradigms: (Actors, STM, ...),
performance evaluation, experimental results.

5. Safety and reliability -- pluggable type systems, contracts,
static analysis and verification, runtime monitoring.

6. Tools -- development environments, debuggers, refactoring
tools, testing frameworks.

7. Case studies, experience reports, and pearls


Important Dates
---

Submission: Friday, Jan 15, 2010 (24:00 in Apia, Samoa)
Notification:   Monday, Feb 15, 2010
Final revision: Monday, Mar 15, 2010
Workshop:   Thursday, Apr 15, 2010


Submission Guidelines
-

Submitted papers should describe new ideas, experimental results, or
projects related to Scala. In order to encourage lively discussion,
submitted papers may describe work in progress. All papers will be
judged on a combination of correctness, significance, novelty,
clarity, and interest to the community.

Submissions must be in English and at most 12 pages total length in
the standard ACM SIGPLAN two-column conference format (10pt).
No formal proceedings will be published, but there will be a webpage
linking to all accepted papers. The workshop also welcomes short papers.

The papers can be submitted at the Scala Workshop EasyChair website,
http://www.easychair.org/conferences/?conf=days2010

Details about the Scala Days 2010 event will be available shortly
after the submission deadline at http://www.scala-lang.org/days2010


Program Committee
-

Ian Clarke, Uprizer Labs
William Cook, UT Austin
Adriaan Moors, KU Leuven
Martin Odersky, EPFL (chair)
Kunle Olukotun, Stanford University
David Pollak, Liftweb
Lex Spoon, Google



-- 
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.



Re: [Lift] Re: SessionVars in different snippets

2010-01-06 Thread David Pollak
On Wed, Jan 6, 2010 at 8:31 AM, greekscala hellectro...@gmail.com wrote:

 Hello,

 I dont have to use SessionVars until now, but in near future.
 But I had the same problem in mind.

 Is there not a central place to get the user session with all the
 values stored?


In Java-land you can get/put values into the session.  This has all the
disadvantages of SessionVars and more.  First, your keys (the names of your
things) are strewn all over your code, but they are just Strings so if you
change a name, you have to look through all your source code for the same
String to change the key.  This is no different than having the SessionVar
declarations all over your code.  Second, the get/put mechanism is not
type-safe.  You can associate anything with a key and when you pull it out,
you better hope that both the putter and the getter agree on what the type
should be.  On the other hand, SessionVars are type safe.  Third, with the
get/put mechanism, you have to roll your own is the value set? logic
(which might be null-based or some other mechanism might be used), where as
with SessionVars, you have the lazy creation logic built right into the
SessionVar.

So, if you'd like to propose a mechanism that somehow centralizes the access
to session-related information and doesn't suffer from the above issues, I'm
all ears.

Thanks,

David


 I think it is ugly to have sessionVars spread all over my code.

 with best regards

 On 5 Jan., 18:13, Naftoli Gugenheim naftoli...@gmail.com wrote:
  Each SessionVar is distinct. Create one -- it can be global -- and use it
 in both snippets.
 
  -
 
  michallchen...@gmail.com wrote:
 
  I have two snippets Login and Profile, and I want to read same object
  stored in session, when I use SessionVar it create two different
  object:
 
  object user extends SessionVar[Box[User]](Empty) // same in two
  snippets
 
  When I set this object in Login.scala :
 
   val usr = User.find(By(User.login,login))
  user.set(usr)
 
  in Profile it's still Empty
 
  why?
 
  --
 
  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.comliftweb%2bunsubscr...@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.comliftweb%2bunsubscr...@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.



[Lift] Example project -- Image gallery

2010-01-06 Thread Jim Wise
I've put the image gallery code I've been working on up at:

 http://github.com/jimwise/shared

as a runnable project, both in hope that it will be useful to other
people learning lift, and in hope of some (gentle) pointers as to what I
could do better with this.

Oh, one caveat -- I've set Jetty to run on port 9080 within this code,
so use accordingly when playing with this.

This code, building on David Pollak's image upload example, provides an
image gallery with support for uploading, renaming, categorizing and
deleting images, as well as browsing uploaded images by category.

This is still very much a work in progress -- next steps from where I'm
sitting are:

  a.) some corner cases of form validation -- don't allow categories to
  be created with a '/' in their name, as this breaks the URL
  rewrites

  b.) Ajax, Ajax, Ajax

  c.) make it easier to use this within a larger project -- this is
  already split into a separate package hierarchy from the
  surrounding project, but I'd like to follow the ProtoUser stuff
  in, eg, providing a canned Sitemap fragment for a surrounding
  project to use.

  d.) require a logged in user to upload or edit, but anyone can view
  (easy enough to add -- I've done it in other code -- but I haven't
  done it here)

  e.) reduce the number of queries this makes -- it's not too heavy, but
  some convenience functions encapsulating joins could still save some.

Anyway, I'd love any thoughts on what I could be doing differently here,
and hope this helps anyone else who is, like me, just starting out with
lift.

-- 
Jim Wise
jw...@draga.com


pgpOv3lbCKD7M.pgp
Description: PGP signature


Re: [Lift] Re: SessionVars in different snippets

2010-01-06 Thread Alex Boisvert
I don't know if it's a common practice but I usually keep all my SessionVars
in the same module (aka singleton object) for easy access:

/** All session variables */
object Session {
  private def currentWeekReq = S.param(currentWeek).map(Week.parse(_))
  object currentWeek extends SessionVar[Week](currentWeekReq openOr
(Week())) {
override def is = currentWeekReq openOr super.is
  }
  object latestEntry extends SessionVar(latestEntry)
  object editEntry   extends SessionVar(editEntry)
  object failedEntry extends SessionVar(failedEntry)
  /* etc... */
}

then I just import Session._ wherever needed.

alex

On Wed, Jan 6, 2010 at 11:31 AM, greekscala hellectro...@gmail.com wrote:

 Hello,

 I dont have to use SessionVars until now, but in near future.
 But I had the same problem in mind.

 Is there not a central place to get the user session with all the
 values stored?

 I think it is ugly to have sessionVars spread all over my code.

 with best regards

 On 5 Jan., 18:13, Naftoli Gugenheim naftoli...@gmail.com wrote:
  Each SessionVar is distinct. Create one -- it can be global -- and use it
 in both snippets.
 
  -
 
  michallchen...@gmail.com wrote:
 
  I have two snippets Login and Profile, and I want to read same object
  stored in session, when I use SessionVar it create two different
  object:
 
  object user extends SessionVar[Box[User]](Empty) // same in two
  snippets
 
  When I set this object in Login.scala :
 
   val usr = User.find(By(User.login,login))
  user.set(usr)
 
  in Profile it's still Empty
 
  why?
 
  --
 
  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.comliftweb%2bunsubscr...@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.comliftweb%2bunsubscr...@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.



Re: [Lift] Example project -- Image gallery

2010-01-06 Thread David Pollak
Thanks for sharing!

Double thanks for spelling my last name correctly!!

On Wed, Jan 6, 2010 at 9:12 AM, Jim Wise jw...@draga.com wrote:

 I've put the image gallery code I've been working on up at:

 http://github.com/jimwise/shared

 as a runnable project, both in hope that it will be useful to other
 people learning lift, and in hope of some (gentle) pointers as to what I
 could do better with this.

 Oh, one caveat -- I've set Jetty to run on port 9080 within this code,
 so use accordingly when playing with this.

 This code, building on David Pollak's image upload example, provides an
 image gallery with support for uploading, renaming, categorizing and
 deleting images, as well as browsing uploaded images by category.

 This is still very much a work in progress -- next steps from where I'm
 sitting are:

  a.) some corner cases of form validation -- don't allow categories to
  be created with a '/' in their name, as this breaks the URL
  rewrites

  b.) Ajax, Ajax, Ajax

  c.) make it easier to use this within a larger project -- this is
  already split into a separate package hierarchy from the
  surrounding project, but I'd like to follow the ProtoUser stuff
  in, eg, providing a canned Sitemap fragment for a surrounding
  project to use.

  d.) require a logged in user to upload or edit, but anyone can view
  (easy enough to add -- I've done it in other code -- but I haven't
  done it here)

  e.) reduce the number of queries this makes -- it's not too heavy, but
  some convenience functions encapsulating joins could still save some.

 Anyway, I'd love any thoughts on what I could be doing differently here,
 and hope this helps anyone else who is, like me, just starting out with
 lift.

 --
Jim Wise
jw...@draga.com




-- 
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.



[Lift] Thanks for the all the help so far...

2010-01-06 Thread Alex Black
I've been a member of this group for a little while now and I wanted
to thank everyone for your help so far! Hopefully I'll be able to
start helping back in the future as I get more experienced with
Lift.

We've found Lift to be a great tool, and being able to get help from
the community has really helped, saved us hours of crawling around in
the dark :)

We just launched our site yesterday, running on Lift: http://snapsort.com.
Today its just got one feature: you can compare two digital cameras to
see the differences.  Our plan is to do personalized product
recommendation, similar to a real-time personalized consumer reports.

- 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.




Re: [Lift] Re: multiple forms on a page.

2010-01-06 Thread David Pollak
On Wed, Jan 6, 2010 at 12:13 AM, daiwhea daiw...@gmail.com wrote:

 Thanks David. Here is my repository:

 git://github.com/daiwhea/MapperBBS.git

 In fact, I want to share this simple demo project for the newbies like
 myself when the project completed.


Thanks.  I've committed fixes to http://github.com/dpp/MapperBBS

Basically, rather than doing the var thing and snippet thing, I just loaded
and bound the template.  It gets the job done and I prefer to explicitly
bind things and keeping state on the stack rather than in a var.



 On Jan 6, 11:42 am, David Pollak feeder.of.the.be...@gmail.com
 wrote:
  The easiest thing to do is for you to post your project as a complete
  runnable whole to GitHub (just make a public repository).
 
  I'll clone the repository, fix the issue and you'll see the diff and have
 a
  running project.  Sound good?
 
 
 
  On Tue, Jan 5, 2010 at 6:32 PM, daiwhea daiw...@gmail.com wrote:
 
   On Jan 5, 10:18 pm, Naftoli Gugenheim naftoli...@gmail.com wrote:
   Just move var localNote ... to before def doReply() ...
 
   -
 
   Thanks Naftoli. It does save a reply to the db after I move var
   localNote to before def doReply(). But It will only save reply to the
   last note even when I try to reply to the note in the top section.
 
   So, in order to see what happend, I add lift:embed what=/templates-
   hidden/gbook/replyForm / no matter the note was replied or not.
   When the page loaded, I saw all the textareas in each reply form has
   the same reply content of the last note. But both those textareas and
   submit buttons have different names. Seems lift doesn't deal the
   embeded template content in the snippet properly as wished.
 
   I also test to add eager_eval=true to the list template as:
   lift:GuestBook.list eager_eval=true. But this won't help.
 
   Thanks for your time. You're so warmhearted. ^_^
 
def replyNote(html: NodeSeq): NodeSeq = {
 
   val localNote = curListNote
 
  def doReply() = {
localNote.save
   }
 
  bind(note, html,
replyContent - SHtml.textarea(localNote.replyContent,
  localNote.replyContent(_)),
submit - SHtml.submit(Reply, doReply)
  )
}
 
 private def getReplyContent(item: GuestNote) = {
  if (item.repliedByAdmin == 0) {
 divpNot replied by admin/pp{item.replyContent}/
   plift:embed what=/templates-hidden/gbook/replyForm //div
  }
  else
 divp{Replied by admin at: +item.replyTime}/pp
   {item.replyContent}/plift:embed what=/templates-hidden/gbook/
   replyForm //div
}
 
   --
   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.comliftweb%2bunsubscr...@googlegroups.com
 liftweb%2bunsubscr...@googlegroups.comliftweb%252bunsubscr...@googlegroups.com
 
   .
   For more options, visit this group at
  http://groups.google.com/group/liftweb?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.comliftweb%2bunsubscr...@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.



Re: [Lift] Thanks for the all the help so far...

2010-01-06 Thread David Pollak
Glad to help and congratulation on launching your site!

On Wed, Jan 6, 2010 at 9:34 AM, Alex Black a...@alexblack.ca wrote:

 I've been a member of this group for a little while now and I wanted
 to thank everyone for your help so far! Hopefully I'll be able to
 start helping back in the future as I get more experienced with
 Lift.

 We've found Lift to be a great tool, and being able to get help from
 the community has really helped, saved us hours of crawling around in
 the dark :)

 We just launched our site yesterday, running on Lift: http://snapsort.com.
 Today its just got one feature: you can compare two digital cameras to
 see the differences.  Our plan is to do personalized product
 recommendation, similar to a real-time personalized consumer reports.

 - 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.comliftweb%2bunsubscr...@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.



[Lift] Re: Lift on Atmosphere

2010-01-06 Thread Marius


On Jan 6, 6:44 pm, David Pollak feeder.of.the.be...@gmail.com wrote:
 On Wed, Jan 6, 2010 at 7:17 AM, Paul Sandoz paul.san...@sun.com wrote:

  On Jan 6, 2010, at 3:22 PM, David Pollak wrote:

  On Wed, Jan 6, 2010 at 5:23 AM, Timothy Perrett 
  timo...@getintheloop.euwrote:

  Yes, if you constantly change containers, then there is value in
  Atmosphere for that as it does leverage the native APIs for the container.
  We [lift] are waiting for servlet 3.0 to standardise the comet API - whilst
  its debatable if that will prove as an api standardisation solution, it
  should level the playing field somewhat - right now the different 
  containers
  are all doing different things in different ways.

  Marius is actively working on an abstraction of the thread dropping so that
  other containers that use different APIs can be plugged into Lift (or vice
  versa) because the Servlet 3.0 spec is taking forever.

  OK. Servlet 3.0 spec is now finalized, meaning there is at least one
  implementation (in GlassFish v3) but i guess it may take time for others to
  arrive.

  Are the async features of Servlet 3.0 sufficient for lift's requirements?

 Yes and it will be supported by the work Marius is currently doing.





  Essentially lift uses special classes within Jetty (the continuation API)
  to make comet scalable... there is nothing stopping comet working in other
  containers with lift, the only restriction is that it does not use the
  native container API so it's essentially thread based - to that end, if you
  have a lot of connections things could get sticky.

  Lift has things that Atmosphere does not have (yet) like the multiplex
  support, and object delta'ing... perhaps other comet frameworks will get
  this in the future, but right now, using Jetty is not a deal breaker for
  most of our users. I guess its only really an issue if you have a heavy
  investment in something that is not jetty. However, I would stress that 
  lift
  is an excellent framework even if your not using comet and that would of
  course deploy without any issues in any container.

  As Tim points out, Lift has a number of advantages in its Comet support:

     - Multiplexing -- you can have many Comet components on a given page
     and they all talk over a single long poll.  You can see this at
     http://demo.liftweb.com.  Both the clock and the chat component are
     Comet.  Neither piece of code was special or required knowledge of the
     other.
     - Connection saturation detection -- Lift will avoid connection
     saturation by only allowing a single long poll to be active at once.  If 
  a
     second connection (this is tunable and it's on my to-do list to make it
     browser tunable as Chrome has more than 2 connections per server) is 
  opened
     from the browser, Lift will automatically terminate the long poll.
     - DNS wildcard support -- To avoid the connection saturation issue, you
     can have the long poll done on a DNS wildcarded server and tune the long
     poll connection termination logic.  This allows many different browser 
  tabs
     to have open long polls.  The server name is automatically changed on 
  each
     page reload and the actual client-side and server-side components are
     unchanged (that means the app developer doesn't have to worry about this
     part of the plumbing.)

  I am not suggesting Atmosphere can or should be utilized as a replacement
  for the useful features you enumerate. I think the area where Atmosphere can
  provide value to lift is scalable async support for many Web/App servers.

 To date, the large Lift comet users have been using Jetty with success.  If
 there is demand for Lift's Comet support on non-Servlet 3.0 platforms, we'll
 look into Atmosphere integration.


With the suspend/resume decoupling/abstraction that is in progress
(the first phase is done and awaiting committer's approval on
reviewboard) should be quite easy to allow such integration. Next step
is to implement Jetty 7 support.


 Thanks,

 David



  Paul.

  --
  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.comliftweb%2bunsubscr...@googlegroups.com
  .
  For more options, visit this group at
 http://groups.google.com/group/liftweb?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.




[Lift] Re: Thanks for the all the help so far...

2010-01-06 Thread Marius
I love how the site looks like. VERY cool job !

Br's,
Marius

On Jan 6, 7:34 pm, Alex Black a...@alexblack.ca wrote:
 I've been a member of this group for a little while now and I wanted
 to thank everyone for your help so far! Hopefully I'll be able to
 start helping back in the future as I get more experienced with
 Lift.

 We've found Lift to be a great tool, and being able to get help from
 the community has really helped, saved us hours of crawling around in
 the dark :)

 We just launched our site yesterday, running on Lift:http://snapsort.com.
 Today its just got one feature: you can compare two digital cameras to
 see the differences.  Our plan is to do personalized product
 recommendation, similar to a real-time personalized consumer reports.

 - 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.




Re: [Lift] Mapper question / autogenerate some number

2010-01-06 Thread Julian Backes
Does really nobody know something about my problem? Something like this 
is not possible at the moment is also ok... :-)


Am 03.01.10 22:46, schrieb Julian Backes:

Hi,

I have the following problem:
For simplicity, assume I want to store users in the database. Before
storing a user the first time in the database (using someNewUser.save),
I want to create a special unique number for this user (which we need in
our company) and store this number together with the new user. This
number is based on several values and some of them need to be read from
the database.
My first idea was to add something to beforeCreate in the meta object
but I'm not sure how to do the computation of the number together with
the save operation in one transaction (which is absolutely necessary)?
And are there better places to do this?
I read something about putting the whole request in one transaction but
this is not what I want. I'm currently only using the Mapper stuff
(because I want a pure scala ORM) and not the whole Lift framework.

Thanks in advance,
Julian

--

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] Re: SessionVars in different snippets

2010-01-06 Thread greekscala
Hello,

David I like the SessionVar Idea and the type safety.
But as Alex suggests, can I define an object with the fields?

I think now when I am writing this I think I understand it more :D
I thought it is not possible to have one object that stores the
values.
But the SessionVar knows what user is requesting a value right?

Because SessionVars were always defined inside the snippet class
I thought the SessionVar gets the context from the snippet class




On 6 Jan., 18:13, Alex Boisvert alex.boisv...@gmail.com wrote:
 I don't know if it's a common practice but I usually keep all my SessionVars
 in the same module (aka singleton object) for easy access:

 /** All session variables */
 object Session {
   private def currentWeekReq = S.param(currentWeek).map(Week.parse(_))
   object currentWeek extends SessionVar[Week](currentWeekReq openOr
 (Week())) {
     override def is = currentWeekReq openOr super.is
   }
   object latestEntry extends SessionVar(latestEntry)
   object editEntry   extends SessionVar(editEntry)
   object failedEntry extends SessionVar(failedEntry)
   /* etc... */

 }

 then I just import Session._ wherever needed.

 alex

 On Wed, Jan 6, 2010 at 11:31 AM, greekscala hellectro...@gmail.com wrote:
  Hello,

  I dont have to use SessionVars until now, but in near future.
  But I had the same problem in mind.

  Is there not a central place to get the user session with all the
  values stored?

  I think it is ugly to have sessionVars spread all over my code.

  with best regards

  On 5 Jan., 18:13, Naftoli Gugenheim naftoli...@gmail.com wrote:
   Each SessionVar is distinct. Create one -- it can be global -- and use it
  in both snippets.

   -

   michallchen...@gmail.com wrote:

   I have two snippets Login and Profile, and I want to read same object
   stored in session, when I use SessionVar it create two different
   object:

   object user extends SessionVar[Box[User]](Empty) // same in two
   snippets

   When I set this object in Login.scala :

    val usr = User.find(By(User.login,login))
   user.set(usr)

   in Profile it's still Empty

   why?

   --

   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.comliftweb%2bunsubscr...@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.comliftweb%2bunsubscr...@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.




Re: [Lift] Re: SessionVars in different snippets

2010-01-06 Thread Ross Mellgren
SessionVars have an internal name which is an identifier unique to the 
SessionVar, not any surrounding context, so you can place the anywhere.

-Ross

On Jan 6, 2010, at 1:51 PM, greekscala wrote:

 Hello,
 
 David I like the SessionVar Idea and the type safety.
 But as Alex suggests, can I define an object with the fields?
 
 I think now when I am writing this I think I understand it more :D
 I thought it is not possible to have one object that stores the
 values.
 But the SessionVar knows what user is requesting a value right?
 
 Because SessionVars were always defined inside the snippet class
 I thought the SessionVar gets the context from the snippet class
 
 
 
 
 On 6 Jan., 18:13, Alex Boisvert alex.boisv...@gmail.com wrote:
 I don't know if it's a common practice but I usually keep all my SessionVars
 in the same module (aka singleton object) for easy access:
 
 /** All session variables */
 object Session {
   private def currentWeekReq = S.param(currentWeek).map(Week.parse(_))
   object currentWeek extends SessionVar[Week](currentWeekReq openOr
 (Week())) {
 override def is = currentWeekReq openOr super.is
   }
   object latestEntry extends SessionVar(latestEntry)
   object editEntry   extends SessionVar(editEntry)
   object failedEntry extends SessionVar(failedEntry)
   /* etc... */
 
 }
 
 then I just import Session._ wherever needed.
 
 alex
 
 On Wed, Jan 6, 2010 at 11:31 AM, greekscala hellectro...@gmail.com wrote:
 Hello,
 
 I dont have to use SessionVars until now, but in near future.
 But I had the same problem in mind.
 
 Is there not a central place to get the user session with all the
 values stored?
 
 I think it is ugly to have sessionVars spread all over my code.
 
 with best regards
 
 On 5 Jan., 18:13, Naftoli Gugenheim naftoli...@gmail.com wrote:
 Each SessionVar is distinct. Create one -- it can be global -- and use it
 in both snippets.
 
 -
 
 michallchen...@gmail.com wrote:
 
 I have two snippets Login and Profile, and I want to read same object
 stored in session, when I use SessionVar it create two different
 object:
 
 object user extends SessionVar[Box[User]](Empty) // same in two
 snippets
 
 When I set this object in Login.scala :
 
  val usr = User.find(By(User.login,login))
 user.set(usr)
 
 in Profile it's still Empty
 
 why?
 
 --
 
 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.comliftweb%2bunsubscr...@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.comliftweb%2bunsubscr...@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.
 
 

-- 
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 question / autogenerate some number

2010-01-06 Thread Jim Barrows
You can use mapper by itself.  There's a dependency on lift webkit I
believe.  There might be some other issues, as i don't if anyone is using it
that way.
As for the number, are you talking about a userId?  Why would you think you
can't set an arbitrary field in Mapper?


On Wed, Jan 6, 2010 at 11:11 AM, Julian Backes
julianbac...@googlemail.comwrote:

 Does really nobody know something about my problem? Something like this is
 not possible at the moment is also ok... :-)

 Am 03.01.10 22:46, schrieb Julian Backes:

 Hi,

 I have the following problem:
 For simplicity, assume I want to store users in the database. Before
 storing a user the first time in the database (using someNewUser.save),
 I want to create a special unique number for this user (which we need in
 our company) and store this number together with the new user. This
 number is based on several values and some of them need to be read from
 the database.
 My first idea was to add something to beforeCreate in the meta object
 but I'm not sure how to do the computation of the number together with
 the save operation in one transaction (which is absolutely necessary)?
 And are there better places to do this?
 I read something about putting the whole request in one transaction but
 this is not what I want. I'm currently only using the Mapper stuff
 (because I want a pure scala ORM) and not the whole Lift framework.

 Thanks in advance,
 Julian

 --

 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.comliftweb%2bunsubscr...@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.comliftweb%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=en.






-- 
James A Barrows
-- 

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 question / autogenerate some number

2010-01-06 Thread Julian Backes

Thanks for your answer!!


You can use mapper by itself.  There's a dependency on lift webkit I
believe.  There might be some other issues, as i don't if anyone is
using it that way.

This is perfectly working


As for the number, are you talking about a userId?  Why would you think
you can't set an arbitrary field in Mapper?
no, it is not a userId, just think of it as some string. Let's call it 
userSpecialString for the moment. I know that I can set some field but 
my problem is that when *storing a new user in the database*, the system 
should:


1) start transaction
2) generate special number/string from database
3) set userSpecialString to this generated thing
4) store new user in the database
5) end transaction

Steps 2-4 are no problem. My problem is how to do this in one 
transaction (steps 1 and 5) and where the best place is so that steps 
1-5 automatically happen when calling newUser.save()


Julian




On Wed, Jan 6, 2010 at 11:11 AM, Julian Backes
julianbac...@googlemail.com mailto:julianbac...@googlemail.com wrote:

Does really nobody know something about my problem? Something like
this is not possible at the moment is also ok... :-)

Am 03.01.10 22:46, schrieb Julian Backes:

Hi,

I have the following problem:
For simplicity, assume I want to store users in the database. Before
storing a user the first time in the database (using
someNewUser.save),
I want to create a special unique number for this user (which we
need in
our company) and store this number together with the new user. This
number is based on several values and some of them need to be
read from
the database.
My first idea was to add something to beforeCreate in the meta
object
but I'm not sure how to do the computation of the number
together with
the save operation in one transaction (which is absolutely
necessary)?
And are there better places to do this?
I read something about putting the whole request in one
transaction but
this is not what I want. I'm currently only using the Mapper stuff
(because I want a pure scala ORM) and not the whole Lift framework.

Thanks in advance,
Julian

--

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
mailto:liftweb@googlegroups.com.
To unsubscribe from this group, send email to
liftweb+unsubscr...@googlegroups.com
mailto:liftweb%2bunsubscr...@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 liftweb@googlegroups.com
mailto:liftweb@googlegroups.com.
To unsubscribe from this group, send email to
liftweb+unsubscr...@googlegroups.com
mailto:liftweb%2bunsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/liftweb?hl=en.






--
James A Barrows



--
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.




Re: [Lift] Mapper question / autogenerate some number

2010-01-06 Thread Jim Barrows
On Wed, Jan 6, 2010 at 12:15 PM, Julian Backes
julianbac...@googlemail.comwrote:

 Thanks for your answer!!


  You can use mapper by itself.  There's a dependency on lift webkit I
 believe.  There might be some other issues, as i don't if anyone is
 using it that way.

 This is perfectly working


  As for the number, are you talking about a userId?  Why would you think
 you can't set an arbitrary field in Mapper?

 no, it is not a userId, just think of it as some string. Let's call it
 userSpecialString for the moment. I know that I can set some field but my
 problem is that when *storing a new user in the database*, the system
 should:

 1) start transaction
 2) generate special number/string from database
 3) set userSpecialString to this generated thing
 4) store new user in the database
 5) end transaction


In this previous question:
http://old.nabble.com/%28Newbie-Question%29-How-to-do-simple-transaction-with-mapper--td26191398.html

I find the following:
import net.liftweb.*mapper*.{DB, DefaultConnectionIdentifier}
DB.use(DefaultConnectionIdentifier) { conn =
  conn.setAutoCommit(false)
  ... // CRUDs
  if(success) conn.commit
  else conn.rollback
  conn.setAutoCommit(true)
}

Have you tried something like this?


 Steps 2-4 are no problem. My problem is how to do this in one transaction
 (steps 1 and 5) and where the best place is so that steps 1-5 automatically
 happen when calling newUser.save()

 Julian



 On Wed, Jan 6, 2010 at 11:11 AM, Julian Backes
 julianbac...@googlemail.com mailto:julianbac...@googlemail.com wrote:

Does really nobody know something about my problem? Something like
this is not possible at the moment is also ok... :-)

Am 03.01.10 22:46, schrieb Julian Backes:

Hi,

I have the following problem:
For simplicity, assume I want to store users in the database.
 Before
storing a user the first time in the database (using
someNewUser.save),
I want to create a special unique number for this user (which we
need in
our company) and store this number together with the new user. This
number is based on several values and some of them need to be
read from
the database.
My first idea was to add something to beforeCreate in the meta
object
but I'm not sure how to do the computation of the number
together with
the save operation in one transaction (which is absolutely
necessary)?
And are there better places to do this?
I read something about putting the whole request in one
transaction but
this is not what I want. I'm currently only using the Mapper stuff
(because I want a pure scala ORM) and not the whole Lift framework.

Thanks in advance,
Julian

--

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
mailto:liftweb@googlegroups.com.

To unsubscribe from this group, send email to

 liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com

 mailto:liftweb%2bunsubscr...@googlegroups.comliftweb%252bunsubscr...@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 liftweb@googlegroups.com
mailto:liftweb@googlegroups.com.

To unsubscribe from this group, send email to

 liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com

 mailto:liftweb%2bunsubscr...@googlegroups.comliftweb%252bunsubscr...@googlegroups.com
 .

For more options, visit this group at
http://groups.google.com/group/liftweb?hl=en.






 --
 James A Barrows



 --
 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.comliftweb%2bunsubscr...@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.comliftweb%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=en.






-- 
James A Barrows
-- 

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 

[Lift] JAX-RS (Lift on Atmosphere)

2010-01-06 Thread Ransford Segu-Baffoe
Hopefully I am not asking unnecessary questions but there are question that are 
popping in my head. How does JAX-RS fits into Lift considering that they are 
both web frameworks; could framework like Jersey benefit from Lifts template's 
mechanicism at the very least?
-- 
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] Lift on Atmosphere

2010-01-06 Thread Paul Sandoz

On Jan 6, 2010, at 5:44 PM, David Pollak wrote:


I am not suggesting Atmosphere can or should be utilized as a  
replacement for the useful features you enumerate. I think the area  
where Atmosphere can provide value to lift is scalable async support  
for many Web/App servers.


To date, the large Lift comet users have been using Jetty with  
success.  If there is demand for Lift's Comet support on non-Servlet  
3.0 platforms, we'll look into Atmosphere integration.




OK!

Paul.
-- 

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] JAX-RS (Lift on Atmosphere)

2010-01-06 Thread David Pollak
On Wed, Jan 6, 2010 at 11:31 AM, Ransford Segu-Baffoe paks...@gmail.comwrote:

 Hopefully I am not asking unnecessary questions but there are question that
 are popping in my head. How does JAX-RS fits into Lift considering that they
 are both web frameworks; could framework like Jersey benefit from Lifts
 template's mechanicism at the very least?


There's Jersey - Lift integration already:
http://n2.nabble.com/Lift-support-for-Jersey-checked-into-trunk-td3007414.html

And if Jim Strachan would just sign the Lift paperwork, he could roll the
Jersey support right into Lift proper... ;-)



 --
 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.comliftweb%2bunsubscr...@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.



Re: [Lift] Mapper question / autogenerate some number

2010-01-06 Thread David Pollak
On Wed, Jan 6, 2010 at 11:25 AM, Jim Barrows jim.barr...@gmail.com wrote:



 On Wed, Jan 6, 2010 at 12:15 PM, Julian Backes 
 julianbac...@googlemail.com wrote:

 Thanks for your answer!!


  You can use mapper by itself.  There's a dependency on lift webkit I
 believe.  There might be some other issues, as i don't if anyone is
 using it that way.

 This is perfectly working


  As for the number, are you talking about a userId?  Why would you think
 you can't set an arbitrary field in Mapper?

 no, it is not a userId, just think of it as some string. Let's call it
 userSpecialString for the moment. I know that I can set some field but my
 problem is that when *storing a new user in the database*, the system
 should:

 1) start transaction
 2) generate special number/string from database
 3) set userSpecialString to this generated thing
 4) store new user in the database
 5) end transaction


if you do the query in beforeCreate, it will be part of the current
transaction... the transactional scope is created by the time beforeCreate
is called.



 In this previous question:
 http://old.nabble.com/%28Newbie-Question%29-How-to-do-simple-transaction-with-mapper--td26191398.html

 I find the following:
 import net.liftweb.*mapper*.{DB, DefaultConnectionIdentifier}
 DB.use(DefaultConnectionIdentifier) { conn =
   conn.setAutoCommit(false)
   ... // CRUDs
   if(success) conn.commit
   else conn.rollback
   conn.setAutoCommit(true)
 }

 Have you tried something like this?


 Steps 2-4 are no problem. My problem is how to do this in one transaction
 (steps 1 and 5) and where the best place is so that steps 1-5 automatically
 happen when calling newUser.save()

 Julian



 On Wed, Jan 6, 2010 at 11:11 AM, Julian Backes
 julianbac...@googlemail.com mailto:julianbac...@googlemail.com
 wrote:

Does really nobody know something about my problem? Something like
this is not possible at the moment is also ok... :-)

Am 03.01.10 22:46, schrieb Julian Backes:

Hi,

I have the following problem:
For simplicity, assume I want to store users in the database.
 Before
storing a user the first time in the database (using
someNewUser.save),
I want to create a special unique number for this user (which we
need in
our company) and store this number together with the new user.
 This
number is based on several values and some of them need to be
read from
the database.
My first idea was to add something to beforeCreate in the meta
object
but I'm not sure how to do the computation of the number
together with
the save operation in one transaction (which is absolutely
necessary)?
And are there better places to do this?
I read something about putting the whole request in one
transaction but
this is not what I want. I'm currently only using the Mapper stuff
(because I want a pure scala ORM) and not the whole Lift
 framework.

Thanks in advance,
Julian

--

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
mailto:liftweb@googlegroups.com.

To unsubscribe from this group, send email to

 liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com

 mailto:liftweb%2bunsubscr...@googlegroups.comliftweb%252bunsubscr...@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 liftweb@googlegroups.com
mailto:liftweb@googlegroups.com.

To unsubscribe from this group, send email to

 liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com

 mailto:liftweb%2bunsubscr...@googlegroups.comliftweb%252bunsubscr...@googlegroups.com
 .

For more options, visit this group at
http://groups.google.com/group/liftweb?hl=en.






 --
 James A Barrows



 --
 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.comliftweb%2bunsubscr...@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.comliftweb%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=en.






 --
 James A Barrows


 --

Re: [Lift] Re: SessionVars in different snippets

2010-01-06 Thread David Pollak
On Wed, Jan 6, 2010 at 10:51 AM, greekscala hellectro...@gmail.com wrote:

 Hello,

 David I like the SessionVar Idea and the type safety.
 But as Alex suggests, can I define an object with the fields?


Sure.



 I think now when I am writing this I think I understand it more :D
 I thought it is not possible to have one object that stores the
 values.
 But the SessionVar knows what user is requesting a value right?


Yes.  SessionVar and RequestVar are type-safe front ends to session-scoped
or logical request-scoped backing store.



 Because SessionVars were always defined inside the snippet class
 I thought the SessionVar gets the context from the snippet class


I rarely define my SessionVars inside snippets... I usually make them
top-level scope.  I like Alex's idiom as well.






 On 6 Jan., 18:13, Alex Boisvert alex.boisv...@gmail.com wrote:
  I don't know if it's a common practice but I usually keep all my
 SessionVars
  in the same module (aka singleton object) for easy access:
 
  /** All session variables */
  object Session {
private def currentWeekReq = S.param(currentWeek).map(Week.parse(_))
object currentWeek extends SessionVar[Week](currentWeekReq openOr
  (Week())) {
  override def is = currentWeekReq openOr super.is
}
object latestEntry extends SessionVar(latestEntry)
object editEntry   extends SessionVar(editEntry)
object failedEntry extends SessionVar(failedEntry)
/* etc... */
 
  }
 
  then I just import Session._ wherever needed.
 
  alex
 
  On Wed, Jan 6, 2010 at 11:31 AM, greekscala hellectro...@gmail.com
 wrote:
   Hello,
 
   I dont have to use SessionVars until now, but in near future.
   But I had the same problem in mind.
 
   Is there not a central place to get the user session with all the
   values stored?
 
   I think it is ugly to have sessionVars spread all over my code.
 
   with best regards
 
   On 5 Jan., 18:13, Naftoli Gugenheim naftoli...@gmail.com wrote:
Each SessionVar is distinct. Create one -- it can be global -- and
 use it
   in both snippets.
 
-
 
michallchen...@gmail.com wrote:
 
I have two snippets Login and Profile, and I want to read same object
stored in session, when I use SessionVar it create two different
object:
 
object user extends SessionVar[Box[User]](Empty) // same in two
snippets
 
When I set this object in Login.scala :
 
 val usr = User.find(By(User.login,login))
user.set(usr)
 
in Profile it's still Empty
 
why?
 
--
 
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.comliftweb%2bunsubscr...@googlegroups.com
 liftweb%2bunsubscr...@googlegroups.comliftweb%252bunsubscr...@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.comliftweb%2bunsubscr...@googlegroups.com
 liftweb%2bunsubscr...@googlegroups.comliftweb%252bunsubscr...@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.comliftweb%2bunsubscr...@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.



Re: [Lift] Mapper question / autogenerate some number

2010-01-06 Thread Julian Backes

In this previous question:
http://old.nabble.com/%28Newbie-Question%29-How-to-do-simple-transaction-with-mapper--td26191398.html

I find the following:
import net.liftweb.*mapper*.{DB, DefaultConnectionIdentifier}
 DB.use(DefaultConnectionIdentifier) { conn =
   conn.setAutoCommit(false)
   ... // CRUDs
   if(success) conn.commit
   else conn.rollback
   conn.setAutoCommit(true)
 }

Have you tried something like this?
I read that post but I still have the problem that I don't know where to 
integrate this. Override the save() function of the user mapper class? 
Or override the save() function of the meta user mapper class? Or add 
something to the beforeCreate() handlers? This last case 
(beforeCreate()) does not work in my opinion because I cannot start a 
transaction there that wraps the whole create process...
-- 
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 question / autogenerate some number

2010-01-06 Thread Julian Backes

if you do the query in beforeCreate, it will be part of the current
transaction... the transactional scope is created by the time
beforeCreate is called.
Does that mean that the whole create process is already in one 
transaction? That would be great :-)
-- 
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] JAX-RS (Lift on Atmosphere)

2010-01-06 Thread Timothy Perrett

I think you mean James Strachen ;-)


On 6 Jan 2010, at 20:47, David Pollak wrote:

 There's Jersey - Lift integration already: 
 http://n2.nabble.com/Lift-support-for-Jersey-checked-into-trunk-td3007414.html
 
 And if Jim Strachan would just sign the Lift paperwork, he could roll the 
 Jersey support right into Lift proper... ;-)
  

-- 

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 question / autogenerate some number

2010-01-06 Thread David Pollak
On Wed, Jan 6, 2010 at 1:06 PM, Julian Backes
julianbac...@googlemail.comwrote:

 if you do the query in beforeCreate, it will be part of the current
 transaction... the transactional scope is created by the time
 beforeCreate is called.

 Does that mean that the whole create process is already in one transaction?
 That would be great :-)


Yes.



 --
 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.comliftweb%2bunsubscr...@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.



Re: [Lift] JAX-RS (Lift on Atmosphere)

2010-01-06 Thread David Pollak
On Wed, Jan 6, 2010 at 1:18 PM, Ransford Segu-Baffoe paks...@gmail.comwrote:

 Thanks, I just received Beginning Scala And chapter 2 covering the Scala
 syntax is great and very helpful.


Glad you're enjoying it.



 - Original Message -
 From: David Pollak feeder.of.the.be...@gmail.com
 To: liftweb@googlegroups.com
 Sent: Wednesday, January 6, 2010 3:47:58 PM GMT -05:00 US/Canada Eastern
 Subject: [Lift] JAX-RS (Lift on Atmosphere)





 On Wed, Jan 6, 2010 at 11:31 AM, Ransford Segu-Baffoe  paks...@gmail.com 
 wrote:


 Hopefully I am not asking unnecessary questions but there are question that
 are popping in my head. How does JAX-RS fits into Lift considering that they
 are both web frameworks; could framework like Jersey benefit from Lifts
 template's mechanicism at the very least?


 There's Jersey - Lift integration already:
 http://n2.nabble.com/Lift-support-for-Jersey-checked-into-trunk-td3007414.html

 And if Jim Strachan would just sign the Lift paperwork, he could roll the
 Jersey support right into Lift proper... ;-)



 --
 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.comliftweb%2bunsubscr...@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.comliftweb%2bunsubscr...@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.comliftweb%2bunsubscr...@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.



[Lift] Re: Lift on Atmosphere

2010-01-06 Thread Timothy Perrett
Guys,

I just had a private mail from JF, so Im relaying it onto the list (as
per his wishes - for some reason he cannot post).

== from JF ==

Salut,

 On Jan 6, 2010, at 12:49 PM, Timothy Perrett wrote:
 Lift does have better comet support than Atmosphere,

:-)

 but it depends
 what your use case is and what you specifically want to do. If you
 chose to run lift with atmosphere you'd essentially be loosing out
 on some of lift's best features. As jonas says, Akka does indeed use
 Atmosphere to good effect, but its a different tool, for a different
 job IMHO (although you can run them in tandem if your use case
 dictates that need).

 So, lets try to add some clarity here by ascertaining what exactly
 you want to do... before this turns into a my comet is better than
 your comet flame war ;-)

 How does Lift achieve portability across the various Comet APIs
supported by Web/App servers?

 Would i be right in assuming that currently only Jetty is supported? [*]


Indeed, this is what I've worked on and what is in the sandbox right
now, e.g Lift could scale *only* on Jetty as only Jetty allow freeing
the calling thread from blocking when suspending (Jetty Continuation).
When deployed on Tomcat, Jetty Continuation block a thread until the
response gets resumed. It may not be an issue for some applications,
but
technically it is still better to avoid blocking a thread.

The idea would be to use Atmosphere CPR to remove that limitation and
instead use Atmosphere so if deployed on Tomcat, Tomcat AOI will be
used. If on Jetty, Continuation will still be used under the hood. And
Atmosphere also support Servlet 3.0 so Lift would get it for free.

I think both community can benefit from the work. Eventually
Atmosphere
will also support Websocket, which is something Lift may decide to
support.


 If so the Atmosphere Comet Portable Runtime may be of benefit.

Indeed.

A+

-- Jeanfrancois


== end from JF ==

Cheers, Tim

On Jan 6, 7:49 pm, Paul Sandoz paul.san...@sun.com wrote:
 On Jan 6, 2010, at 5:44 PM, David Pollak wrote:



  I am not suggesting Atmosphere can or should be utilized as a  
  replacement for the useful features you enumerate. I think the area  
  where Atmosphere can provide value to lift is scalable async support  
  for many Web/App servers.

  To date, the large Lift comet users have been using Jetty with  
  success.  If there is demand for Lift's Comet support on non-Servlet  
  3.0 platforms, we'll look into Atmosphere integration.

 OK!

 Paul.
-- 
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] Re: SessionVars in different snippets

2010-01-06 Thread greekscala
Everything is alright then :D!

with best regards

On 6 Jan., 22:00, David Pollak feeder.of.the.be...@gmail.com wrote:
 On Wed, Jan 6, 2010 at 10:51 AM, greekscala hellectro...@gmail.com wrote:
  Hello,

  David I like the SessionVar Idea and the type safety.
  But as Alex suggests, can I define an object with the fields?

 Sure.



  I think now when I am writing this I think I understand it more :D
  I thought it is not possible to have one object that stores the
  values.
  But the SessionVar knows what user is requesting a value right?

 Yes.  SessionVar and RequestVar are type-safe front ends to session-scoped
 or logical request-scoped backing store.



  Because SessionVars were always defined inside the snippet class
  I thought the SessionVar gets the context from the snippet class

 I rarely define my SessionVars inside snippets... I usually make them
 top-level scope.  I like Alex's idiom as well.





  On 6 Jan., 18:13, Alex Boisvert alex.boisv...@gmail.com wrote:
   I don't know if it's a common practice but I usually keep all my
  SessionVars
   in the same module (aka singleton object) for easy access:

   /** All session variables */
   object Session {
     private def currentWeekReq = S.param(currentWeek).map(Week.parse(_))
     object currentWeek extends SessionVar[Week](currentWeekReq openOr
   (Week())) {
       override def is = currentWeekReq openOr super.is
     }
     object latestEntry extends SessionVar(latestEntry)
     object editEntry   extends SessionVar(editEntry)
     object failedEntry extends SessionVar(failedEntry)
     /* etc... */

   }

   then I just import Session._ wherever needed.

   alex

   On Wed, Jan 6, 2010 at 11:31 AM, greekscala hellectro...@gmail.com
  wrote:
Hello,

I dont have to use SessionVars until now, but in near future.
But I had the same problem in mind.

Is there not a central place to get the user session with all the
values stored?

I think it is ugly to have sessionVars spread all over my code.

with best regards

On 5 Jan., 18:13, Naftoli Gugenheim naftoli...@gmail.com wrote:
 Each SessionVar is distinct. Create one -- it can be global -- and
  use it
in both snippets.

 -

 michallchen...@gmail.com wrote:

 I have two snippets Login and Profile, and I want to read same object
 stored in session, when I use SessionVar it create two different
 object:

 object user extends SessionVar[Box[User]](Empty) // same in two
 snippets

 When I set this object in Login.scala :

  val usr = User.find(By(User.login,login))
 user.set(usr)

 in Profile it's still Empty

 why?

 --

 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.comliftweb%2bunsubscr...@googlegroups.com
  liftweb%2bunsubscr...@googlegroups.comliftweb%252bunsubscr...@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.comliftweb%2bunsubscr...@googlegroups.com
  liftweb%2bunsubscr...@googlegroups.comliftweb%252bunsubscr...@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.comliftweb%2bunsubscr...@googlegroups.com
  .
  For more options, visit this group at
 http://groups.google.com/group/liftweb?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.




[Lift] Re: Example project -- Image gallery

2010-01-06 Thread Neil.Lv
  Thanks for sharing this, it's very useful and helpful to us
(beginner).

Cheers,
  Neil

On Jan 7, 1:20 am, David Pollak feeder.of.the.be...@gmail.com wrote:
 Thanks for sharing!

 Double thanks for spelling my last name correctly!!



 On Wed, Jan 6, 2010 at 9:12 AM, Jim Wise jw...@draga.com wrote:
  I've put the image gallery code I've been working on up at:

 http://github.com/jimwise/shared

  as a runnable project, both in hope that it will be useful to other
  people learning lift, and in hope of some (gentle) pointers as to what I
  could do better with this.

  Oh, one caveat -- I've set Jetty to run on port 9080 within this code,
  so use accordingly when playing with this.

  This code, building on David Pollak's image upload example, provides an
  image gallery with support for uploading, renaming, categorizing and
  deleting images, as well as browsing uploaded images by category.

  This is still very much a work in progress -- next steps from where I'm
  sitting are:

   a.) some corner cases of form validation -- don't allow categories to
   be created with a '/' in their name, as this breaks the URL
   rewrites

   b.) Ajax, Ajax, Ajax

   c.) make it easier to use this within a larger project -- this is
   already split into a separate package hierarchy from the
   surrounding project, but I'd like to follow the ProtoUser stuff
   in, eg, providing a canned Sitemap fragment for a surrounding
   project to use.

   d.) require a logged in user to upload or edit, but anyone can view
   (easy enough to add -- I've done it in other code -- but I haven't
   done it here)

   e.) reduce the number of queries this makes -- it's not too heavy, but
   some convenience functions encapsulating joins could still save some.

  Anyway, I'd love any thoughts on what I could be doing differently here,
  and hope this helps anyone else who is, like me, just starting out with
  lift.

  --
 Jim Wise
 jw...@draga.com

 --
 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.




[Lift] Re: multiple forms on a page.

2010-01-06 Thread daiwhea
Thanks David. It works as wished now. ^_^

On Jan 7, 1:51 am, David Pollak feeder.of.the.be...@gmail.com wrote:
 On Wed, Jan 6, 2010 at 12:13 AM, daiwhea daiw...@gmail.com wrote:
  Thanks David. Here is my repository:

  git://github.com/daiwhea/MapperBBS.git

  In fact, I want to share this simple demo project for the newbies like
  myself when the project completed.

 Thanks.  I've committed fixes tohttp://github.com/dpp/MapperBBS

 Basically, rather than doing the var thing and snippet thing, I just loaded
 and bound the template.  It gets the job done and I prefer to explicitly
 bind things and keeping state on the stack rather than in a var.





  On Jan 6, 11:42 am, David Pollak feeder.of.the.be...@gmail.com
  wrote:
   The easiest thing to do is for you to post your project as a complete
   runnable whole to GitHub (just make a public repository).

   I'll clone the repository, fix the issue and you'll see the diff and have
  a
   running project.  Sound good?

   On Tue, Jan 5, 2010 at 6:32 PM, daiwhea daiw...@gmail.com wrote:

On Jan 5, 10:18 pm, Naftoli Gugenheim naftoli...@gmail.com wrote:
Just move var localNote ... to before def doReply() ...

-

Thanks Naftoli. It does save a reply to the db after I move var
localNote to before def doReply(). But It will only save reply to the
last note even when I try to reply to the note in the top section.

So, in order to see what happend, I add lift:embed what=/templates-
hidden/gbook/replyForm / no matter the note was replied or not.
When the page loaded, I saw all the textareas in each reply form has
the same reply content of the last note. But both those textareas and
submit buttons have different names. Seems lift doesn't deal the
embeded template content in the snippet properly as wished.

I also test to add eager_eval=true to the list template as:
lift:GuestBook.list eager_eval=true. But this won't help.

Thanks for your time. You're so warmhearted. ^_^

 def replyNote(html: NodeSeq): NodeSeq = {

    val localNote = curListNote

   def doReply() = {
     localNote.save
    }

   bind(note, html,
     replyContent - SHtml.textarea(localNote.replyContent,
                                   localNote.replyContent(_)),
     submit - SHtml.submit(Reply, doReply)
   )
 }

  private def getReplyContent(item: GuestNote) = {
   if (item.repliedByAdmin == 0) {
      divpNot replied by admin/pp{item.replyContent}/
plift:embed what=/templates-hidden/gbook/replyForm //div
   }
   else
      divp{Replied by admin at: +item.replyTime}/pp
{item.replyContent}/plift:embed what=/templates-hidden/gbook/
replyForm //div
 }

--
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.comliftweb%2bunsubscr...@googlegroups.com
  liftweb%2bunsubscr...@googlegroups.comliftweb%252bunsubscr...@googlegroups.com

.
For more options, visit this group at
   http://groups.google.com/group/liftweb?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.comliftweb%2bunsubscr...@googlegroups.com
  .
  For more options, visit this group at
 http://groups.google.com/group/liftweb?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.




[Lift] problems with file upload inside modal

2010-01-06 Thread stephanos
Hi guys,

I'm stuck with this problem for a few days now and need help. I want
users to be able to upload a ZIP file. When I embed this functionality
directly in the page it works flawlessly - but I need to put it into a
modal and that's were the trouble starts.

When I submit the form it executes correctly but it prints (!) the
response to the browser:
   try{jQuery(#lift__noticesContainer__).each(function(i)
{this.innerHTML = div class=\success\ulliThanks for the
upload!/li/ul /div;});} catch (e) {}

The code looks right but it shouldn't print to the screen. What am I
doing wrong?

#
My current progress (using M8):

HTML:
lift:SourceUpload form=post multipart=true
fieldset style=width: 90%; margin: 0 auto
strongAt first/strong select the zip file upload:file/

br/br/
and strongthen/strong push
input type=submit value=upload!/
/fieldset
/lift:SourceUpload

CODE:
def request(in: NodeSeq) =   // opens file upload modal
ajaxButton(in, () = S.runTemplate(List(/katas/share)).
   map(ns = ModalDialog(ns)) openOr Alert(Internal
error: Couldn't find template!))

def render(in: NodeSeq): NodeSeq = bind(upload, file -
SHtml.fileUpload(processFile _))


Cheers,
Stephan
-- 
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.