[Lift] Re: execute code when browser is closed

2009-10-06 Thread Timothy Perrett
Hey jack,

As I said before, I think the design you have is wrong if your needing  
to code in a hacky way such as this. The way you articulate the  
justification for using shutdown almost certianly clarifies an  
incorrect design.

Personally I think you could use Ajax for this an have a much simpler  
design of system... I would tend to recomend using comet when you have  
some server side state that changes and needs update client side  
continually. Kinda feel it's hammer to crack a nut here, but perhaps  
that's just me.

Hope you get it sorted :-)

Cheers, Tim

Sent from my iPhone

On 6 Oct 2009, at 05:25, Jack Widman jack.wid...@gmail.com wrote:

 So I am using a snippet like this

  def go:NodeSeq = {
 var term:String = S.param(term).openOr()
 lift:surround with=default at=content
 lift:comet type=JoopComet name={term}
 auth:joop/auth:joop
 /lift:comet
 /lift:surround
   }

 And the term is indeed different each time. But I am still getting  
 the same results from two different browsers with different terms.

 On Tue, Oct 6, 2009 at 12:18 AM, Naftoli Gugenheim naftoli...@gmail.com 
  wrote:

 You are correct that Comet is a way to update information after the  
 page is loaded. I think there's a simpler way using ajax, but I  
 haven't explored those areas of Lift yet. But meanwhile you need to  
 have the xml specifying the comet actor be dynamic. So you need to  
 have that xml be generated by a snippet. A snippet is an XML to XML  
 function.


 -
 jackjack.wid...@gmail.com wrote:


 Let me start again. Maybe I am misunderstanding when Comet should be
 used. In my application, people search for web pages. I do a lot of
 processing for each resulting page. First I just display the links and
 then as the processing is finished, the links on the page are
 automatically modified with the data I just found for each link. This
 is all working fine.

 But, the session is being shared among all users so if I make one
 search in one browser, and then make another search from another
 browser, I get the results from the first browser.

 David suggested I name each CometActor differently. That is not
 working, though maybe I am not doing it right.

 On Oct 6, 12:01 am, Naftoli Gugenheim naftoli...@gmail.com wrote:
  What do you mean?
 
  -
 
  jackjack.wid...@gmail.com wrote:
 
  i guess you meant put the snippet right in the CometActor. Ok. Now  
 I'm
  getting it.
 
  On Oct 5, 11:46 pm, Jack Widman jack.wid...@gmail.com wrote:
 
 
 
   Sorry if this is a dumb question but in lift:comet type=Search
   name={searchString}/, what is searchString? This is in an html  
 file. I am
   obviously missing something.
 
   On Mon, Oct 5, 2009 at 2:40 PM, David Pollak
   feeder.of.the.be...@gmail.comwrote:
 
On Mon, Oct 5, 2009 at 10:27 AM, Jack Widman  
 jack.wid...@gmail.comwrote:
 
Understood. My intention is to send a ShutDown message to the  
 CometActor
when somebody closes the browser. I need this so that when  
 they visit the
page in a browser again, the CometActor is 'reset'.
 
First, there's no way to determine if the browser window is  
 closed.
 
Second, *DO NOT* send a ShutDown message to the CometActor.   
 This is an
internal Lift piece of housekeeping.  If you do this, you will  
 break stuff.
 Don't do it.  (There is a reason the message is not private,  
 but it should
not be used for this purpose.)
 
CometActors can be named:
 
lift:comet type=Search name={searchString}/
 
You can then have a separate CometActor for each  
 searchString.  Voila...
you get what you want.  Now, how do you make then CometActor  
 go away when
it's not being used anymore?
 
In your CometActor:
 override def lifespan: Box[TimeSpan] = Full(3 minutes)
 
That means if a CometActor does not appear on a page for 3  
 minutes, it's
removed from the session.  If the named CometActor is  
 requested again, a new
one will be created.
 
On Mon, Oct 5, 2009 at 1:18 PM, marius d.  
 marius.dan...@gmail.comwrote:
 
HTTP session termination does not equate with browser-close  
 event.
 
Br's,
Marius
 
On Oct 5, 3:22 pm, Jack Widman jack.wid...@gmail.com wrote:
 Yes, thats what I meant. Thanks
 
 On Mon, Oct 5, 2009 at 4:10 AM, Timothy Perrett
timo...@getintheloop.euwrote:
 
  But you can do it on session termination (which is what  
 you probably
  want):
 
   http://scala-tools.org/mvnsites-snapshots/liftweb/lift-webkit/scalado 
 ...
 
  Checkout the method:
 
  registerCleanupFunc
 
  Cheers, Tim
 
  On Oct 5, 8:54 am, Viktor Klang viktor.kl...@gmail.com  
 wrote:
   On Mon, Oct 5, 2009 at 6:50 AM, jack  
 jack.wid...@gmail.com
wrote:
 
I would like to call a function when the browser is  
 closed. How
do I
do this?
 
   You cannot reliably do this.
 
   --
   

[Lift] Re: log4j

2009-10-06 Thread Timothy Perrett
Looks like a good contender for a wiki article...

Cheers, Tim

Sent from my iPhone

On 6 Oct 2009, at 01:12, Derek Chen-Becker dchenbec...@gmail.com  
wrote:

 Changing the logging has to come at the very beginning of the boot  
 method. I'm using slf4j in a 1.0.2 project and it's working fine.  
 The very first line of my boot method is:

 LogBoot.loggerSetup = () = true

 which basically disables Lift setting up any logging (you'll have to  
 do your own configuration via xml or API). Try that and let me know  
 if you still have problems.

 Derek

 On Fri, Oct 2, 2009 at 3:02 PM, Christopher Mason  
 cjma...@gmail.com wrote:

 So, is this support only present post 1.0.2?  Cause in 1.0.2 it seems
 like log4j symbols are referenced before my Boot.boot() gets called
 (see below).  Also, what do you mean by Configure slf4j to use
 Slf4jLogBoot (doc says Note that slf4j back-end should be configured
 previously to use Slf4jLogBoot. which also doesn't make sense to
 me).Sorry I missed the Slf4jLogBoot class; I'm still learning how
 to use Intellij to properly navigate scala code.

 Thanks!

 -c

 java.lang.NoClassDefFoundError: org/apache/log4j/LogManager
at net.liftweb.util.LogBoot$.log4jIsConfigured$1(Log.scala:114)
 [massqc-1.3-foo-all.jar:na]
at net.liftweb.util.LogBoot$._log4JSetup(Log.scala:130)  
 [massqc-1.3-
 foo-all.jar:na]
at net.liftweb.util.LogBoot$$anonfun$2.apply(Log.scala:96)
 [massqc-1.3-foo-all.jar:na]
at net.liftweb.util.LogBoot$$anonfun$2.apply(Log.scala:96)
 [massqc-1.3-foo-all.jar:na]
at net.liftweb.util.LogBoot$.checkConfig(Log.scala:94)  
 [massqc-1.3-
 foo-all.jar:na]
at net.liftweb.util.LogBoot$.net$liftweb$util$LogBoot$$_logger
 (Log.scala:140) [massqc-1.3-foo-all.jar:na]
at net.liftweb.util.LogBoot$$anonfun$3.apply(Log.scala:142)
 [massqc-1.3-foo-all.jar:na]
at net.liftweb.util.LogBoot$$anonfun$3.apply(Log.scala:142)
 [massqc-1.3-foo-all.jar:na]
at net.liftweb.http.LiftRules$.init(LiftRules.scala:559)
 [massqc-1.3-foo-all.jar:na]
at net.liftweb.http.LiftRules$.clinit(LiftRules.scala)  
 [massqc-1.3-
 foo-all.jar:na]
at net.liftweb.http.LiftFilter.init(LiftServlet.scala:554)
 [massqc-1.3-foo-all.jar:na]
at org.eclipse.jetty.servlet.FilterHolder.doStart 
 (FilterHolder.java:
 74) [massqc-1.3-foo-all.jar:na]


 Also

 On Oct 2, 3:58 am, Indrajit Raychaudhuri indraj...@gmail.com wrote:
  You can of course use slf4j instead of log4j in your application.
 
  Quick steps:
 
  1. Exclude log4j from dependency tree by adding exclusion filter in
  lift-webkit dependency. POM should look something like this:
 
dependency
   groupIdnet.liftweb/groupId
   artifactIdlift-webkit/artifactId
   version1.1-SNAPSHOT/version
   exclusions
 exclusion
   groupIdlog4j/groupId
   artifactIdlog4j/artifactId
 /exclusion
   /exclusions
dependency
 
  2. Add slf4j, logback dependencies in POM
 
  3. Enable slf4j in Boot:
 
  Slf4jLogBoot.enable()
 
  4. Configure slf4j to use Slf4jLogBoot
 
  Cheers, Indrajit
 
  NB: net.liftweb.util.Slf4jLogBoot has a nice scaladoc with the above
  steps. You might wish to go through that as well :-)
 
  On 02/10/09 1:50 PM, Christopher Mason wrote:
 
 
 
   Is log4j a hard dependency to break?  It seems like you're using  
 slf4j
   most places, but then have some hard deps for configuration.  I'm
   using logback.  How hard would it be for me to remove the log4j  
 dep
   and replace with slf4j/logback.  (I have logback already  
 configured in
   my servlet container.)
 
   Thanks!
 
   -c




 

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



[Lift] Re: execute code when browser is closed

2009-10-06 Thread Jack Widman
I didn't mean to sound like I am justifying the way I am doing. I definitely
do not have a good feel for lift yet and  it feels hackey to me too. Part of
it is I'm rushing to get a demo done at the same time I am learning lift.
Thanks for your help.

On Tue, Oct 6, 2009 at 2:04 AM, Timothy Perrett timo...@getintheloop.euwrote:

 Hey jack,

 As I said before, I think the design you have is wrong if your needing to
 code in a hacky way such as this. The way you articulate the justification
 for using shutdown almost certianly clarifies an incorrect design.

 Personally I think you could use Ajax for this an have a much simpler
 design of system... I would tend to recomend using comet when you have some
 server side state that changes and needs update client side continually.
 Kinda feel it's hammer to crack a nut here, but perhaps that's just me.

 Hope you get it sorted :-)

 Cheers, Tim

 Sent from my iPhone

 On 6 Oct 2009, at 05:25, Jack Widman jack.wid...@gmail.com wrote:

 So I am using a snippet like this
  def go:NodeSeq = {
 var term:String = S.param(term).openOr()
 lift:surround with=default at=content
 lift:comet type=JoopComet name={term}
 auth:joop/auth:joop
 /lift:comet
 /lift:surround
   }

 And the term is indeed different each time. But I am still getting the same
 results from two different browsers with different terms.

 On Tue, Oct 6, 2009 at 12:18 AM, Naftoli Gugenheim naftoli...@gmail.com
 naftoli...@gmail.com wrote:


 You are correct that Comet is a way to update information after the page
 is loaded. I think there's a simpler way using ajax, but I haven't explored
 those areas of Lift yet. But meanwhile you need to have the xml specifying
 the comet actor be dynamic. So you need to have that xml be generated by a
 snippet. A snippet is an XML to XML function.


 -
 jack jack.wid...@gmail.comjack.wid...@gmail.com wrote:


 Let me start again. Maybe I am misunderstanding when Comet should be
 used. In my application, people search for web pages. I do a lot of
 processing for each resulting page. First I just display the links and
 then as the processing is finished, the links on the page are
 automatically modified with the data I just found for each link. This
 is all working fine.

 But, the session is being shared among all users so if I make one
 search in one browser, and then make another search from another
 browser, I get the results from the first browser.

 David suggested I name each CometActor differently. That is not
 working, though maybe I am not doing it right.

 On Oct 6, 12:01 am, Naftoli Gugenheim naftoli...@gmail.com wrote:
  What do you mean?
 
  -
 
  jackjack.wid...@gmail.com wrote:
 
  i guess you meant put the snippet right in the CometActor. Ok. Now I'm
  getting it.
 
  On Oct 5, 11:46 pm, Jack Widman jack.wid...@gmail.com wrote:
 
 
 
   Sorry if this is a dumb question but in lift:comet type=Search
   name={searchString}/, what is searchString? This is in an html file.
 I am
   obviously missing something.
 
   On Mon, Oct 5, 2009 at 2:40 PM, David Pollak
feeder.of.the.be...@gmail.comfeeder.of.the.be...@gmail.comwrote:
 
On Mon, Oct 5, 2009 at 10:27 AM, Jack Widman jack.wid...@gmail.com
 wrote:
 
Understood. My intention is to send a ShutDown message to the
 CometActor
when somebody closes the browser. I need this so that when they
 visit the
page in a browser again, the CometActor is 'reset'.
 
First, there's no way to determine if the browser window is closed.
 
Second, *DO NOT* send a ShutDown message to the CometActor.  This is
 an
internal Lift piece of housekeeping.  If you do this, you will break
 stuff.
 Don't do it.  (There is a reason the message is not private, but it
 should
not be used for this purpose.)
 
CometActors can be named:
 
lift:comet type=Search name={searchString}/
 
You can then have a separate CometActor for each searchString.
  Voila...
you get what you want.  Now, how do you make then CometActor go away
 when
it's not being used anymore?
 
In your CometActor:
 override def lifespan: Box[TimeSpan] = Full(3 minutes)
 
That means if a CometActor does not appear on a page for 3 minutes,
 it's
removed from the session.  If the named CometActor is requested
 again, a new
one will be created.
 
On Mon, Oct 5, 2009 at 1:18 PM, marius d. marius.dan...@gmail.com
 wrote:
 
HTTP session termination does not equate with browser-close event.
 
Br's,
Marius
 
On Oct 5, 3:22 pm, Jack Widman jack.wid...@gmail.com wrote:
 Yes, thats what I meant. Thanks
 
 On Mon, Oct 5, 2009 at 4:10 AM, Timothy Perrett
timo...@getintheloop.euwrote:
 
  But you can do it on session termination (which is what you
 probably
  want):
 
   http://scala-tools.org/mvnsites-snapshots/liftweb/lift-webkit/scalado.
 

[Lift] Re: log4j

2009-10-06 Thread Jeppe Nejsum Madsen

Derek Chen-Becker dchenbec...@gmail.com writes:

 Changing the logging has to come at the very beginning of the boot method.
 I'm using slf4j in a 1.0.2 project and it's working fine. The very first
 line of my boot method is:

 LogBoot.loggerSetup = () = true

 which basically disables Lift setting up any logging (you'll have to do your
 own configuration via xml or API). Try that and let me know if you still
 have problems.

 Derek

While this works in 1.0.x, I think you need 1.1.x to be able to remove
log4j from the classpath. More details here:

http://www.mail-archive.com/liftweb@googlegroups.com/msg09582.html

/Jeppe

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



[Lift] Re: execute code when browser is closed

2009-10-06 Thread Ross Mellgren

I'm pretty tired and I definitely did not try to compile this, but  
maybe something like this using plain ajax might be better? If the  
server cannot be contacted an alert box will pop up -- you can  
customize that behavior using AjaxContext and using that with  
SHtml.ajaxCall or jsonCall, I think.

-Ross



import scala.xml.NodeSeq
import net.liftweb.http.{S, SHtml, StatefulSnippet}
import net.liftweb.http.js.{JE, JsCmds}
import net.liftweb.util.Box.option2Box
import net.liftweb.util.TimeHelpers.intToTimeSpan

class Searcher extends StatefulSnippet
{
 // FIXME use something to keep track of already displayed results  
and only push updates
 var results: List[String] = Nil
 var done: Boolean

 def search(ns: NodeSeq): NodeSeq = S.param(term).map(term = {
 val resultsId = attr(id).openOr(search-results)

 // kick off some thread that updates results and done  
searching for term

 head{ JsCmds.Script(
 JsCmds.JsCrVar(updateResults, JE.AnonFunc 
(SHtml.ajaxInvoke(() = updateResults(resultsId))._2))
 JsCmds.After(5 seconds, JE.Call(updateResults))
 ) }/head ++
 div
 Searching for { term }
 div id={ resultsId } /
 /div
 })

 def updateResults(id: String): JsCmd =
 JsCmds.SetHtml(id, results.map(result = div{ result }/ 
div)) 
if (!done) {
 JsCmds.After(1 second, JE.Call(updateResults))
 } else {
JsCmds.Noop
 }


On Oct 6, 2009, at 2:07 AM, Jack Widman wrote:

 I didn't mean to sound like I am justifying the way I am doing. I  
 definitely do not have a good feel for lift yet and  it feels hackey  
 to me too. Part of it is I'm rushing to get a demo done at the same  
 time I am learning lift. Thanks for your help.

 On Tue, Oct 6, 2009 at 2:04 AM, Timothy Perrett timo...@getintheloop.eu 
  wrote:
 Hey jack,

 As I said before, I think the design you have is wrong if your  
 needing to code in a hacky way such as this. The way you articulate  
 the justification for using shutdown almost certianly clarifies an  
 incorrect design.

 Personally I think you could use Ajax for this an have a much  
 simpler design of system... I would tend to recomend using comet  
 when you have some server side state that changes and needs update  
 client side continually. Kinda feel it's hammer to crack a nut here,  
 but perhaps that's just me.

 Hope you get it sorted :-)

 Cheers, Tim

 Sent from my iPhone

 On 6 Oct 2009, at 05:25, Jack Widman jack.wid...@gmail.com wrote:

 So I am using a snippet like this

  def go:NodeSeq = {
 var term:String = S.param(term).openOr()
 lift:surround with=default at=content
 lift:comet type=JoopComet name={term}
 auth:joop/auth:joop
 /lift:comet
 /lift:surround
   }

 And the term is indeed different each time. But I am still getting  
 the same results from two different browsers with different terms.

 On Tue, Oct 6, 2009 at 12:18 AM, Naftoli Gugenheim naftoli...@gmail.com 
  wrote:

 You are correct that Comet is a way to update information after the  
 page is loaded. I think there's a simpler way using ajax, but I  
 haven't explored those areas of Lift yet. But meanwhile you need to  
 have the xml specifying the comet actor be dynamic. So you need to  
 have that xml be generated by a snippet. A snippet is an XML to XML  
 function.


 -
 jackjack.wid...@gmail.com wrote:


 Let me start again. Maybe I am misunderstanding when Comet should be
 used. In my application, people search for web pages. I do a lot of
 processing for each resulting page. First I just display the links  
 and
 then as the processing is finished, the links on the page are
 automatically modified with the data I just found for each link. This
 is all working fine.

 But, the session is being shared among all users so if I make one
 search in one browser, and then make another search from another
 browser, I get the results from the first browser.

 David suggested I name each CometActor differently. That is not
 working, though maybe I am not doing it right.

 On Oct 6, 12:01 am, Naftoli Gugenheim naftoli...@gmail.com wrote:
  What do you mean?
 
  -
 
  jackjack.wid...@gmail.com wrote:
 
  i guess you meant put the snippet right in the CometActor. Ok.  
 Now I'm
  getting it.
 
  On Oct 5, 11:46 pm, Jack Widman jack.wid...@gmail.com wrote:
 
 
 
   Sorry if this is a dumb question but in lift:comet type=Search
   name={searchString}/, what is searchString? This is in an html  
 file. I am
   obviously missing something.
 
   On Mon, Oct 5, 2009 at 2:40 PM, David Pollak
   feeder.of.the.be...@gmail.comwrote:
 
On Mon, Oct 5, 2009 at 10:27 AM, Jack Widman  
 jack.wid...@gmail.comwrote:
 
Understood. My intention is to send a ShutDown message to  
 the CometActor
when somebody closes the browser. I need this so that when  
 

[Lift] Re: YUI Compressor Fatal Error

2009-10-06 Thread David Bernard

yuicompressor 2.3.x doesn't work with openjdk
(https://bugs.launchpad.net/ubuntu/+source/openjdk-6/+bug/287035)
But it seems that yuicompressor 2.4.2 works
(http://www.electrictoolbox.com/minify-javascript-css-yui-compressor/)

It's a long time I didn't update yuicompressor-maven-plugin. I'll
deploy a new version latter this week.

/davidB

On Tue, Oct 6, 2009 at 02:19, Ross Mellgren dri...@gmail.com wrote:
 According to his version number he's running ubuntu and that particular
 version corresponds to jaunty jackalope (9.04)
 Unless he spliced that package into debian or something else.
 -Ross
 On Oct 5, 2009, at 8:06 PM, David Pollak wrote:

 d...@david-desktop:~/Desktop/liftweb/examples/example$ java -version
 Picked up JAVA_TOOL_OPTIONS: -Xmx1024M
 java version 1.6.0_0
 OpenJDK  Runtime Environment (build 1.6.0_0-b11)
 OpenJDK Client VM (build 1.6.0_0-b11, mixed mode, sharing)
 d...@david-desktop:~/Desktop/liftweb/examples/example$

 I'm running on Ubuntu 8.04 with the OpenJDK installation.

 I get compilation failures on about half the runs.  They appear to be
 random.

 Scala Actors do not work (I'm not trying to throw gasoline on any fires,
 just reporting what I'm seeing) when powering Lift's comet stuff.  However,
 Lift Actors do work.

 I'm not seeing any explicit issues with other libraries.

 What OS are you running under your OpenJDK installation?

 On Mon, Oct 5, 2009 at 1:10 PM, Peter Robinett pe...@bubblefoundry.com
 wrote:

 Ross, I am using OpenJDK:
 $ java -version
 java version 1.6.0_0
 OpenJDK Runtime Environment (IcedTea6 1.4.1) (6b14-1.4.1-0ubuntu11)
 OpenJDK 64-Bit Server VM (build 14.0-b08, mixed mode)

 Is it possible to use YUI Compressor at all with OpenJDK?

 Peter

 On Oct 5, 7:32 pm, Ross Mellgren dri...@gmail.com wrote:
  I thought someone mentioned this a little while ago and it was due to
  OpenJDK (and only related to the YUI compressor)?
 
  -Ross
 
  On Oct 5, 2009, at 1:25 PM, jon wrote:
 
 
 
   Is there a syntax problem in one of your javascript files?
 
   On Oct 5, 1:23 pm, Peter Robinett pe...@bubblefoundry.com wrote:
   Hi all,
 
   I've been compiling and running my Lift app on my personal machine
   without any problems but when I try to run it on another machine
   (where it had previously worked), I am getting fatal YUI Compressor
   errors.
 
   Not knowing YUI Compressor or how Lift and Maven use it (but willing
   to learn!), I'd appreciate any tips on how to get it to work again.
 
   Thanks in advance,
   Peter Robinett
 
   PS I thought I already posted a version of this message but I don't
   see it on the Groups site. My apologies if this message is a
   duplicate.
 
   $ mvn jetty:run
   [INFO] Scanning for projects...
   [INFO] Searching repository for plugin with prefix: 'jetty'.
   [INFO]
  
   
   [INFO] Building server
   [INFO]    task-segment: [jetty:run]
   [INFO]
  
   
   [INFO] Preparing jetty:run
   [INFO] [resources:resources]
   [INFO] Using default encoding to copy filtered resources.
   [INFO] [yuicompressor:compress {execution: default}]
   [INFO] equalnetworks.css (267b) - equalnetworks.css (197b)[73%]
   [INFO] dashboard.css (5511b) - dashboard.css (4478b)[81%]
   [INFO] jquery.tooltip.css (172b) - jquery.tooltip.css (145b)[84%]
   [INFO]
  
   
   [ERROR] FATAL ERROR
   [INFO]
  
   
   [INFO] null
   [INFO]
  
   
   [INFO] Trace
   java.lang.RuntimeException
           at
  
   com.yahoo.platform.yui.compressor.JavaScriptCompressor.printSourceNumber
   (JavaScriptCompressor.java:299)
           at
   com.yahoo.platform.yui.compressor.JavaScriptCompressor.parse
   (JavaScriptCompressor.java:335)
           at
   com.yahoo.platform.yui.compressor.JavaScriptCompressor.init
   (JavaScriptCompressor.java:532)
           at
   net.sf.alchim.mojo.yuicompressor.YuiCompressorMojo.processFile
   (YuiCompressorMojo.java:178)
           at net.sf.alchim.mojo.yuicompressor.MojoSupport.processDir
   (MojoSupport.java:151)
           at net.sf.alchim.mojo.yuicompressor.MojoSupport.execute
   (MojoSupport.java:105)
           at org.apache.maven.plugin.DefaultPluginManager.executeMojo
   (DefaultPluginManager.java:451)
           at
   org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals
   (DefaultLifecycleExecutor.java:558)
           at
  
   org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycl
    e
   (DefaultLifecycleExecutor.java:499)
           at
  
   org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkProjectLifecycle
   (DefaultLifecycleExecutor.java:924)
           at
   org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkLifecycle
   

[Lift] Re: execute code when browser is closed

2009-10-06 Thread Naftoli Gugenheim

As Tim said, but in different words.
Use Comet when changed state needs to be *pushed* from the server.
Use Ajax when you need to asynchronously *pull* data from the server.
 

-
Ross Mellgrendri...@gmail.com wrote:


I'm pretty tired and I definitely did not try to compile this, but  
maybe something like this using plain ajax might be better? If the  
server cannot be contacted an alert box will pop up -- you can  
customize that behavior using AjaxContext and using that with  
SHtml.ajaxCall or jsonCall, I think.

-Ross



import scala.xml.NodeSeq
import net.liftweb.http.{S, SHtml, StatefulSnippet}
import net.liftweb.http.js.{JE, JsCmds}
import net.liftweb.util.Box.option2Box
import net.liftweb.util.TimeHelpers.intToTimeSpan

class Searcher extends StatefulSnippet
{
 // FIXME use something to keep track of already displayed results  
and only push updates
 var results: List[String] = Nil
 var done: Boolean

 def search(ns: NodeSeq): NodeSeq = S.param(term).map(term = {
 val resultsId = attr(id).openOr(search-results)

 // kick off some thread that updates results and done  
searching for term

 head{ JsCmds.Script(
 JsCmds.JsCrVar(updateResults, JE.AnonFunc 
(SHtml.ajaxInvoke(() = updateResults(resultsId))._2))
 JsCmds.After(5 seconds, JE.Call(updateResults))
 ) }/head ++
 div
 Searching for { term }
 div id={ resultsId } /
 /div
 })

 def updateResults(id: String): JsCmd =
 JsCmds.SetHtml(id, results.map(result = div{ result }/ 
div)) 
if (!done) {
 JsCmds.After(1 second, JE.Call(updateResults))
 } else {
JsCmds.Noop
 }


On Oct 6, 2009, at 2:07 AM, Jack Widman wrote:

 I didn't mean to sound like I am justifying the way I am doing. I  
 definitely do not have a good feel for lift yet and  it feels hackey  
 to me too. Part of it is I'm rushing to get a demo done at the same  
 time I am learning lift. Thanks for your help.

 On Tue, Oct 6, 2009 at 2:04 AM, Timothy Perrett timo...@getintheloop.eu 
  wrote:
 Hey jack,

 As I said before, I think the design you have is wrong if your  
 needing to code in a hacky way such as this. The way you articulate  
 the justification for using shutdown almost certianly clarifies an  
 incorrect design.

 Personally I think you could use Ajax for this an have a much  
 simpler design of system... I would tend to recomend using comet  
 when you have some server side state that changes and needs update  
 client side continually. Kinda feel it's hammer to crack a nut here,  
 but perhaps that's just me.

 Hope you get it sorted :-)

 Cheers, Tim

 Sent from my iPhone

 On 6 Oct 2009, at 05:25, Jack Widman jack.wid...@gmail.com wrote:

 So I am using a snippet like this

  def go:NodeSeq = {
 var term:String = S.param(term).openOr()
 lift:surround with=default at=content
 lift:comet type=JoopComet name={term}
 auth:joop/auth:joop
 /lift:comet
 /lift:surround
   }

 And the term is indeed different each time. But I am still getting  
 the same results from two different browsers with different terms.

 On Tue, Oct 6, 2009 at 12:18 AM, Naftoli Gugenheim naftoli...@gmail.com 
  wrote:

 You are correct that Comet is a way to update information after the  
 page is loaded. I think there's a simpler way using ajax, but I  
 haven't explored those areas of Lift yet. But meanwhile you need to  
 have the xml specifying the comet actor be dynamic. So you need to  
 have that xml be generated by a snippet. A snippet is an XML to XML  
 function.


 -
 jackjack.wid...@gmail.com wrote:


 Let me start again. Maybe I am misunderstanding when Comet should be
 used. In my application, people search for web pages. I do a lot of
 processing for each resulting page. First I just display the links  
 and
 then as the processing is finished, the links on the page are
 automatically modified with the data I just found for each link. This
 is all working fine.

 But, the session is being shared among all users so if I make one
 search in one browser, and then make another search from another
 browser, I get the results from the first browser.

 David suggested I name each CometActor differently. That is not
 working, though maybe I am not doing it right.

 On Oct 6, 12:01 am, Naftoli Gugenheim naftoli...@gmail.com wrote:
  What do you mean?
 
  -
 
  jackjack.wid...@gmail.com wrote:
 
  i guess you meant put the snippet right in the CometActor. Ok.  
 Now I'm
  getting it.
 
  On Oct 5, 11:46 pm, Jack Widman jack.wid...@gmail.com wrote:
 
 
 
   Sorry if this is a dumb question but in lift:comet type=Search
   name={searchString}/, what is searchString? This is in an html  
 file. I am
   obviously missing something.
 
   On Mon, Oct 5, 2009 at 2:40 PM, David Pollak
   

[Lift] Re: Help!

2009-10-06 Thread David Bernard

To create a war :
mvn package

To deploy (outline), (war are bundles that need a WebApp server to run
(eg : jetty, tomcat, glassfish, jboss,...):
# install jetty on your server (not maven)
## start jetty
## try http://jetty.host:jetty.port/  (eg: http://127.0.0.1:8080/)
## stop
# put your .war into the jetty/webapp dir
## start jetty
## try http://jetty.host:jetty.port/mywebapp (mywebapp is the basename
of your .war, if you don't want context (mywebapp prefix, named your
war ROOT.war)
# optional tweak the jetty configuration (read the jetty doc)

FYI : Tim Perret is working on solution to create standalone jar with
jetty embedded (search in the mailing-list)

If you don't use Comet, you could try the winstone-maven-plugin to
create a runnable jar

/davidB

On Tue, Oct 6, 2009 at 05:31, jack jack.wid...@gmail.com wrote:

 never mind.
 deploy-war, not run-war
 (been working too hard)

 On Oct 5, 11:09 pm, Jack Widman jack.wid...@gmail.com wrote:
 I meant to say jetty:run-war

 On Mon, Oct 5, 2009 at 10:52 PM, jack jack.wid...@gmail.com wrote:

  Is mvn jetty:run supposed to creat the war file? I want to upload a
  war file and just run it, not create another one. How do I do that?

 --
 Jack
 


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



[Lift] Why fields are declared as 'object' with Mapper/Record?

2009-10-06 Thread Oleg G.

Sorry if its a stupid question, but why?

I like the idea very much and trying to understand all the aspects.
Fields declared as 'objects' can't be overridden. Is it intended? If
so why?

Consider following oversimplified example:
  trait Field
  trait Prop1
  trait Prop2
  trait Prop3

  class Person {
val name = new Field with Prop1 with Prop2
  }

  class CustomPerson extends Person {
override val name = new Field with Prop1 with Prop2 with Prop3
  }

Is there something wrong?

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



[Lift] Re: lift nearly inaccessible for newby

2009-10-06 Thread Stefan Langer
Not ment as a offence but you are in way over your head!
A couple of things:
1. You say you are a non-programmer but I assume you do understand Scala? Or
else it is pointless to use Lift as it is based on the Scala language and
relies heavily on its features. Knowledge of Java is also a plus cause some
of the libs are not available in Scala but only in Java and it is better to
know Java in order to understand the libraries.
2. You do have experience with websites? Complex web applications? If not
then I suggest you start by doing a simple static page for your design to
get to know the technics you are trying to use or you get yourself a
programmer/webdesinger to do it for you. If you are not willing to learn
about the technical details you will get in big trouble later on and I mean
trouble that can actually cost you money.
3. If the above points do not seem valid for you then please get
professional help
4. If you are not scared by the above points and you are willing to invest
then I suggest getting some example code and starting to disect that.
Take a look at http://github.com/tjweir/pocketchangeapp which is a complete
demo app in lift
and take a look at http://github.com/tjweir/liftbook for a liftbook that is
available freely.

Regards and good luck on your project

Stefan

2009/10/5 koveen liep...@xs4all.nl


 hi Naftoli,

 thanks for your interest.

 On Oct 5, 10:50 pm, Naftoli Gugenheim naftoli...@gmail.com wrote:
  Being a non-programmer, and additionally not having a Java background,
  which framework are you comparing Lift to when you say it's not easy?
  :)

 First I read a book about rails, explaining things from the start, I
 did watch quite a lot of nice video's on the web explaining some basic
 tricks with Rails. I think it is a system that is easy to start with
 but I became nervous about recurring issues about scaling, the
 integration of Rails and Merb and had the idea, maybe wrong, that it
 was a system too much in transition.

 I read part of the tutorial of Lift, installed it on my computer using
 Maven, but in a way I got lost.

 Then I partially read a book about Wicket. I like the system very
 much, especially one trick exited me: the Ajaxfallbacklink in which a
 link worked in a simple way when javasript is disabled , but at the
 same time has some Ajax functionality when Javascript is enabled on
 the users system. I liked this feature very much, but the integration
 with a database is not an integral part of the Wicket-system and can
 be acquired via a Wicket-Spring-Hibernate combination. This seemed too
 much for me to get into as a starter.

 That's how I came back to Lift. I need a stable database-connection.
 You need one when you hope that people will be paying some, even
 small, amount of money for your service.

  Can you clarify: Is this going to be a site, or a back end to a mobile
  app that sits on the phone?

 I just want to make a site

 But I hope it is clear I am not here to criticise anybody, it is just
 that often I feel this system is way over my head. Maybe that will
 change.

 thanks

 Ko


 
  On Mon, Oct 5, 2009 at 2:32 PM, koveen liep...@xs4all.nl wrote:
 
   Hi,
 
   Being a no-programmer and having no Java-background
   I'd like to have mentioned that Lift really isn't an easy framework.
   Having said that, I will try to read my way into this system and try
   to solve the problems I encounter.
 
   I have one question.
 
   I would like to establish a login method where a visitor of my site
   (to be) could be accepted as a valid user, based on the info the
   server receives when the visitor enters the site.
 
   In my case it will be a site for mobile phones and some mobile phone
   operators will provide me with the telephone-number of the user once
   she enters. Once a user has paid for the service,  this number alone
   should be enough to make the visitior into a valid user. Without
   needing to log in.
 
   I have read the following on:http://demo.liftweb.net/ws
 
   t's easy to dispatch incoming HTTP requests.
   In your Boot class create a PartialFunction
   that matches a pattern related to the incoming request and
   then create a short-lived controller to service the request.
 
   This code matches all the requests to /webservices/ and
   assigns the stuff in '' to the variable c.  Then
   the code attempts to find a public method with that name on
   the controller.  If the method exists, it's invoked and Lift
   processes the result.
 
   I assume I will have to write my own  public method and place it
   where??? in the direcory webservices.?
 
   Maven didn't  include such a directory in my project set-up, so I
   assume this  webservices are on an external server and that I will
   have torefer to and  extend an existing function. Am I correct in
   this? and is there an exemple of how to write such a method.
 
   I would be really happy to make some progress, and any help is
   welcome.
 
   Thanks,
 
   Ko
 
 

 



[Lift] Re: YUI Compressor Fatal Error

2009-10-06 Thread Peter Robinett

Thanks, all. While David Bernard's plan to update the maven plugin is
very welcome, the fact that Scala Actors don't work for Comet actors
suggests that I should switch to the Sun JVM.

Peter

On Oct 6, 8:50 am, David Bernard david.bernard...@gmail.com wrote:
 yuicompressor 2.3.x doesn't work with openjdk
 (https://bugs.launchpad.net/ubuntu/+source/openjdk-6/+bug/287035)
 But it seems that yuicompressor 2.4.2 works
 (http://www.electrictoolbox.com/minify-javascript-css-yui-compressor/)

 It's a long time I didn't update yuicompressor-maven-plugin. I'll
 deploy a new version latter this week.

 /davidB

 On Tue, Oct 6, 2009 at 02:19, Ross Mellgren dri...@gmail.com wrote:
  According to his version number he's running ubuntu and that particular
  version corresponds to jaunty jackalope (9.04)
  Unless he spliced that package into debian or something else.
  -Ross
  On Oct 5, 2009, at 8:06 PM, David Pollak wrote:

  d...@david-desktop:~/Desktop/liftweb/examples/example$ java -version
  Picked up JAVA_TOOL_OPTIONS: -Xmx1024M
  java version 1.6.0_0
  OpenJDK  Runtime Environment (build 1.6.0_0-b11)
  OpenJDK Client VM (build 1.6.0_0-b11, mixed mode, sharing)
  d...@david-desktop:~/Desktop/liftweb/examples/example$

  I'm running on Ubuntu 8.04 with the OpenJDK installation.

  I get compilation failures on about half the runs.  They appear to be
  random.

  Scala Actors do not work (I'm not trying to throw gasoline on any fires,
  just reporting what I'm seeing) when powering Lift's comet stuff.  However,
  Lift Actors do work.

  I'm not seeing any explicit issues with other libraries.

  What OS are you running under your OpenJDK installation?

  On Mon, Oct 5, 2009 at 1:10 PM, Peter Robinett pe...@bubblefoundry.com
  wrote:

  Ross, I am using OpenJDK:
  $ java -version
  java version 1.6.0_0
  OpenJDK Runtime Environment (IcedTea6 1.4.1) (6b14-1.4.1-0ubuntu11)
  OpenJDK 64-Bit Server VM (build 14.0-b08, mixed mode)

  Is it possible to use YUI Compressor at all with OpenJDK?

  Peter

  On Oct 5, 7:32 pm, Ross Mellgren dri...@gmail.com wrote:
   I thought someone mentioned this a little while ago and it was due to
   OpenJDK (and only related to the YUI compressor)?

   -Ross

   On Oct 5, 2009, at 1:25 PM, jon wrote:

Is there a syntax problem in one of your javascript files?

On Oct 5, 1:23 pm, Peter Robinett pe...@bubblefoundry.com wrote:
Hi all,

I've been compiling and running my Lift app on my personal machine
without any problems but when I try to run it on another machine
(where it had previously worked), I am getting fatal YUI Compressor
errors.

Not knowing YUI Compressor or how Lift and Maven use it (but willing
to learn!), I'd appreciate any tips on how to get it to work again.

Thanks in advance,
Peter Robinett

PS I thought I already posted a version of this message but I don't
see it on the Groups site. My apologies if this message is a
duplicate.

$ mvn jetty:run
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'jetty'.
[INFO]


[INFO] Building server
[INFO]    task-segment: [jetty:run]
[INFO]


[INFO] Preparing jetty:run
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [yuicompressor:compress {execution: default}]
[INFO] equalnetworks.css (267b) - equalnetworks.css (197b)[73%]
[INFO] dashboard.css (5511b) - dashboard.css (4478b)[81%]
[INFO] jquery.tooltip.css (172b) - jquery.tooltip.css (145b)[84%]
[INFO]


[ERROR] FATAL ERROR
[INFO]


[INFO] null
[INFO]


[INFO] Trace
java.lang.RuntimeException
        at

com.yahoo.platform.yui.compressor.JavaScriptCompressor.printSourceNumber
(JavaScriptCompressor.java:299)
        at
com.yahoo.platform.yui.compressor.JavaScriptCompressor.parse
(JavaScriptCompressor.java:335)
        at
com.yahoo.platform.yui.compressor.JavaScriptCompressor.init
(JavaScriptCompressor.java:532)
        at
net.sf.alchim.mojo.yuicompressor.YuiCompressorMojo.processFile
(YuiCompressorMojo.java:178)
        at net.sf.alchim.mojo.yuicompressor.MojoSupport.processDir
(MojoSupport.java:151)
        at net.sf.alchim.mojo.yuicompressor.MojoSupport.execute
(MojoSupport.java:105)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo
(DefaultPluginManager.java:451)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals
(DefaultLifecycleExecutor.java:558)
        at


[Lift] Re: How to share request scope data among snippets in Lift

2009-10-06 Thread Viktor Klang
On Tue, Oct 6, 2009 at 12:01 AM, Kevin Wright kev.lee.wri...@googlemail.com
 wrote:


 On Mon, Oct 5, 2009 at 10:54 PM, Jack Widman jack.wid...@gmail.com
 wrote:
  I'm not sure English is Turing Complete. Also not sure how prominent it
 will
  be in 50 years ... :)

 Nor I, but I'm certain that Turing was (Queen's) English complete... :)


Didn't the Queen's England like have him castrated for being homosexual as
well?

http://en.wikipedia.org/wiki/Alan_Turing#Conviction_for_gross_indecency



  On Mon, Oct 5, 2009 at 5:51 PM, David Pollak 
 feeder.of.the.be...@gmail.com
  wrote:
 
 
  On Mon, Oct 5, 2009 at 9:35 AM, Timothy Perrett timo...@getintheloop.eu
 
  wrote:
 
  Call me old fashioned, but good ol' English seems to be quite
  prevalent these days ;-)
 
  Is this the Queen's English? ;-)
 
 
  On 5 Oct 2009, at 17:02, Jack Widman wrote:
 
   Why don't we make Esperanto the official Lift language?
 
 
 
 
 
 
  --
  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
 
 
 
 
 
  --
  Jack
 
  
 

 



-- 
Viktor Klang

Blog: klangism.blogspot.com
Twttr: viktorklang

Lift Committer - liftweb.com
AKKA Committer - akkasource.org
Cassidy - github.com/viktorklang/Cassidy.git
SoftPub founder: http://groups.google.com/group/softpub

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



[Lift] Re: Possible lift-json bug in Xml.toJson

2009-10-06 Thread Joni Freeman

Hi,

I fixed this but it will slip M6. You can build a fixed version from
branch if you need it now. Please see the changeset 'Scala XML
support...':

http://github.com/dpp/liftweb/commits/joni_wip_xml

Cheers Joni

On Oct 5, 9:22 pm, harryh har...@gmail.com wrote:
 Xml.toJson (in M5) is converting this:

 iconhttp://harryh.org/img/icons/foo.png/icon

 to this:

 JField(icon, JObject(Nil))

 Is there some special handling of URLs going on here that might be
 causing me problems?

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



[Lift] Overriding date/time formatting

2009-10-06 Thread Dirk Louwers

Hi,

After having toyed around with Scala and recently Lift for a few weeks
I have a question. To avoid jumping to conclusions let me first
explain what I am trying to achieve:

I am not happy with the way MappedDateTime parses strings and formats
dates by default. I want to be able to change these parsers/formatters
globally and/or on a per mapper field basis.

Here is what I did:

By looking at the sourcecode I noticed that following MappedDateTime
ultimately this depends on internetDateFormatter, dateFormatter and
toInternetDate inside TimeHelpers. Since I don't know how to change
the dependency of MappedDateTime on TimeHelpers to a subclass of
TimeHelpers I decided to break the dependency by subclassing
MappedDateTime and overriding _toForm and setFromAny and have my
setFromAny call a modified toDate that in turn depends on a custom
function to parse a string to a date. This function:
1) Tries to use a specifically definded DateFormat on the field
2) Tries to get a dateformat from a localized bundle
3) Falls back to the SHORT date format of the JVM locale.

Here is what I would like to know:

1) Is there a way to have Lift use a TimeHelpers subclass without
having to subclass stuff that depends on it?
2) Does anyone have suggestions how to improve/invalidate my approach?

Just checking to see if I am on the right path or making this
needlessly hard.
Thanks in advance for any response.

Best,

Dirk Louwers




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



[Lift] Re: Help!

2009-10-06 Thread Jack Widman
Thanks David. The command I was trying to remember was deploy-war but I kept
using run-war. The names are not quite precise. run-war should be called
build-and-run-war, and deploy-war is really run-with-war. If those names
were not so horribly long, that is.

On Tue, Oct 6, 2009 at 3:05 AM, David Bernard david.bernard...@gmail.comwrote:


 To create a war :
 mvn package

 To deploy (outline), (war are bundles that need a WebApp server to run
 (eg : jetty, tomcat, glassfish, jboss,...):
 # install jetty on your server (not maven)
 ## start jetty
 ## try http://jetty.host:jetty.port/  (eg: http://127.0.0.1:8080/)
 ## stop
 # put your .war into the jetty/webapp dir
 ## start jetty
 ## try http://jetty.host:jetty.port/mywebapp (mywebapp is the basename
 of your .war, if you don't want context (mywebapp prefix, named your
 war ROOT.war)
 # optional tweak the jetty configuration (read the jetty doc)

 FYI : Tim Perret is working on solution to create standalone jar with
 jetty embedded (search in the mailing-list)

 If you don't use Comet, you could try the winstone-maven-plugin to
 create a runnable jar

 /davidB

 On Tue, Oct 6, 2009 at 05:31, jack jack.wid...@gmail.com wrote:
 
  never mind.
  deploy-war, not run-war
  (been working too hard)
 
  On Oct 5, 11:09 pm, Jack Widman jack.wid...@gmail.com wrote:
  I meant to say jetty:run-war
 
  On Mon, Oct 5, 2009 at 10:52 PM, jack jack.wid...@gmail.com wrote:
 
   Is mvn jetty:run supposed to creat the war file? I want to upload a
   war file and just run it, not create another one. How do I do that?
 
  --
  Jack
  
 

 



-- 
Jack

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



[Lift] Re: Why fields are declared as 'object' with Mapper/Record?

2009-10-06 Thread Dirk Louwers

Well, I am only a beginner myself but here are my 2 cents:

- My guess is that they are declared as inner objects to make it
possible to reach certain global field properties through the
companion MetaMapper object.
- As far as I know traits cannot be directly instantiated, only
extended or mixed in.

Dirk Louwers

On Oct 6, 8:38 am, Oleg G. ojo...@gmail.com wrote:
 Sorry if its a stupid question, but why?

 I like the idea very much and trying to understand all the aspects.
 Fields declared as 'objects' can't be overridden. Is it intended? If
 so why?

 Consider following oversimplified example:
   trait Field
   trait Prop1
   trait Prop2
   trait Prop3

   class Person {
     val name = new Field with Prop1 with Prop2
   }

   class CustomPerson extends Person {
     override val name = new Field with Prop1 with Prop2 with Prop3
   }

 Is there something wrong?

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



[Lift] Binding a snippet in a comet actor?

2009-10-06 Thread Somindra Bhattacharya

Hi Everyone,

I have a comet actor that binds XHTML. The XHTML corresponds to a
snippet:

XHTML for comet actor -

  lift:comet type=RCActor
Act:act /
  /lift:comet

When the comet actor receives a certain message, the render method of
the comet actor binds the following XHTML -

lift:Discuss.invite form=post
   elem:submit /
/lift:Discuss.invite

The Discuss snippet's invite method definition is:

  def invite(xhtml: NodeSeq): NodeSeq =
  {

 def handleSubmit() =
 {
Log.info(GOT A SUBMIT IN INVITE)
 }

 bind(elem, xhtml,
 submit - submit(Click, () = handleSubmit()))
  }

The page does not contain this form when it is first loaded. When the
actor receives a certain message, it binds the XHTML (Discuss.invite)
to the page and the form and the submit button are rendered
properly.

However, when I click on the submit button, the handleSubmit method
is not called. Instead, the browser displays a page with the text
window.location=/.
If I use the browser back button and re-visit the page with the comet
actor, the submit button works (i.e., handleSubmit() is called and I
can see the info log).

Is this approach legal? Is there a way to make a form submit if it
was not originally part of the page?

Thanks,
Som

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



[Lift] Re: Need two classes to inherit from one model, database design and view issues

2009-10-06 Thread Jim Barrows



On Oct 2, 7:55 pm, Dave davidtgoldb...@gmail.com wrote:
 Hi all-

 I posted this on stackoverflow but I figure its probably relevant here
 too.  I checked out the post with David and Steve Yen corresponding
 but I am still at a loss and am curious if any progress has been made
 in this direction.  So, here goes.  I am creating a website which will
 need two types of users: students and providers. In a traditional java
 setting I would create a user class (or interface) and then create two
 classes which inherited from the user. Is this the best course in
 scala too, using the extends and with modifiers? If that is indeed
 the best way (which I suspect it is), what the best way to map this in
 the DB? Would it be best to keep a type column and then have it set
 to one or the other?  Etc.

A student is not a kind of user, nor is a provider.  They are roles
that a user plays in your system.
While your business rules may state that this is not possible, it is
possible in the real world.  That's what's best to model, since
business rules can change quite easily.
I can even make an argument that Person has user as role, and that
there are two types of users.


 The second question is how to work with the view. The display will be
 very different depending on which type of user one is and so I figure
 there will be some serious routing logic involved or at least logic
 built into snippets in the view.

Why not use 3 directories, one for common stuff, one for the provider
and one for the student.
Reduces the number of if statements that way.


 I guess the overarching question is: Is there a preferred way to go
 about doing this (like a recipe in rails or some such), or am I kind
 of out on my own?

 Thanks

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



[Lift] How can I pass the result of Xml.toJson to JsonResponse

2009-10-06 Thread glenn

I want to pass the result of Xml.toJson to JsonResponse. How can I do
that, when JsonResponse takes a JsExp as
a parameter, not a JValue.

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



[Lift] Re: Why fields are declared as 'object' with Mapper/Record?

2009-10-06 Thread Kris Nuttycombe

One major reason for the inner object pattern is that when you have
a singleton object extending a trait, it is possible for the trait to
reflect upon that object's class to obtain information like the name
of the field. You'll see this pattern used throughout Lift (AnyVar
subclasses RequestVar and SessionVar *must* be instantiated as objects
- if you do something like this:

class StringRequestVar(x: = String) extends RequestVar[String](x)

object MyState {
   val v1 = new StringRequestVar(foo)
   val v2 = new StringRequestVar(bar)
}

then v2 will actually stomp on v1 at instantiation, and any assignment
to v1 will stomp on v2 and vice versa.

(I don't really care for this pattern either, but understand the
justification for it.)

Kris


On Tue, Oct 6, 2009 at 12:38 AM, Oleg G. ojo...@gmail.com wrote:

 Sorry if its a stupid question, but why?

 I like the idea very much and trying to understand all the aspects.
 Fields declared as 'objects' can't be overridden. Is it intended? If
 so why?

 Consider following oversimplified example:
  trait Field
  trait Prop1
  trait Prop2
  trait Prop3

  class Person {
    val name = new Field with Prop1 with Prop2
  }

  class CustomPerson extends Person {
    override val name = new Field with Prop1 with Prop2 with Prop3
  }

 Is there something wrong?

 


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



[Lift] Re: Why fields are declared as 'object' with Mapper/Record?

2009-10-06 Thread David Pollak
On Tue, Oct 6, 2009 at 7:52 AM, Kris Nuttycombe
kris.nuttyco...@gmail.comwrote:


 One major reason for the inner object pattern is that when you have
 a singleton object extending a trait, it is possible for the trait to
 reflect upon that object's class to obtain information like the name
 of the field. You'll see this pattern used throughout Lift (AnyVar
 subclasses RequestVar and SessionVar *must* be instantiated as objects
 - if you do something like this:

 class StringRequestVar(x: = String) extends RequestVar[String](x)

 object MyState {
   val v1 = new StringRequestVar(foo)
   val v2 = new StringRequestVar(bar)
 }

 then v2 will actually stomp on v1 at instantiation, and any assignment
 to v1 will stomp on v2 and vice versa.

 (I don't really care for this pattern either, but understand the
 justification for it.)


I don't care for the pattern, but it comes from Scala history... so

In the days of Scala 2.3, an inner object had different class and method
visibility than a val instantiated in the same way.  So, if you had:

object foo extends Object {  def bar = You can call me
}

You could call bar.  However:

val foo = new Object {  def bar = You can't call me
}

foo would be an Object, not visible as a subclass of Object.  So, that's the
first reason for object vs. val.

The second reason is that it's possible to disambiguate:

object foo extends MappedString(this, 32)

from

var foo: MappedString[OtherThing] = _

It may be possible to disambiguate these now, but in the 2.3 days, it
wasn't.

In terms of the RequestVar stuff, the RequestVar and SessionVar generates
its unique name (so it knows how to put itself in a unique place in backing
store) based on its class and each SessionVar and RequestVar have a unique
class name based on being a subclass of RequestVar rather than an instance
of RequestVar.

Hope this help.

Thanks,

David





 Kris


 On Tue, Oct 6, 2009 at 12:38 AM, Oleg G. ojo...@gmail.com wrote:
 
  Sorry if its a stupid question, but why?
 
  I like the idea very much and trying to understand all the aspects.
  Fields declared as 'objects' can't be overridden. Is it intended? If
  so why?
 
  Consider following oversimplified example:
   trait Field
   trait Prop1
   trait Prop2
   trait Prop3
 
   class Person {
 val name = new Field with Prop1 with Prop2
   }
 
   class CustomPerson extends Person {
 override val name = new Field with Prop1 with Prop2 with Prop3
   }
 
  Is there something wrong?
 
  
 

 



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



[Lift] Re: How can I pass the result of Xml.toJson to JsonResponse

2009-10-06 Thread David Pollak
Please open a ticket for this.  We need to get the rest of Lift playing well
with Joni's excellent JSON library.

On Tue, Oct 6, 2009 at 7:43 AM, glenn gl...@exmbly.com wrote:


 I want to pass the result of Xml.toJson to JsonResponse. How can I do
 that, when JsonResponse takes a JsExp as
 a parameter, not a JValue.

 Glenn
 



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



[Lift] Re: lift nearly inaccessible for newby

2009-10-06 Thread Jim Barrows



On Oct 6, 12:52 am, Stefan Langer mailtolan...@googlemail.com wrote:
 Not ment as a offence but you are in way over your head!

While I agree. Linus Torvalds was in much the same place.  He has
to somewhere :)

 A couple of things:
 1. You say you are a non-programmer but I assume you do understand Scala? Or
 else it is pointless to use Lift as it is based on the Scala language and
 relies heavily on its features. Knowledge of Java is also a plus cause some
 of the libs are not available in Scala but only in Java and it is better to
 know Java in order to understand the libraries.
 2. You do have experience with websites? Complex web applications? If not
 then I suggest you start by doing a simple static page for your design to
 get to know the technics you are trying to use or you get yourself a
 programmer/webdesinger to do it for you. If you are not willing to learn
 about the technical details you will get in big trouble later on and I mean
 trouble that can actually cost you money.
 3. If the above points do not seem valid for you then please get
 professional help
 4. If you are not scared by the above points and you are willing to invest
 then I suggest getting some example code and starting to disect that.
 Take a look athttp://github.com/tjweir/pocketchangeappwhich is a complete
 demo app in lift
 and take a look athttp://github.com/tjweir/liftbookfor a liftbook that is
 available freely.

 Regards and good luck on your project

 Stefan

 2009/10/5 koveen liep...@xs4all.nl



  hi Naftoli,

  thanks for your interest.

  On Oct 5, 10:50 pm, Naftoli Gugenheim naftoli...@gmail.com wrote:
   Being a non-programmer, and additionally not having a Java background,
   which framework are you comparing Lift to when you say it's not easy?
   :)

  First I read a book about rails, explaining things from the start, I
  did watch quite a lot of nice video's on the web explaining some basic
  tricks with Rails. I think it is a system that is easy to start with
  but I became nervous about recurring issues about scaling, the
  integration of Rails and Merb and had the idea, maybe wrong, that it
  was a system too much in transition.

  I read part of the tutorial of Lift, installed it on my computer using
  Maven, but in a way I got lost.

  Then I partially read a book about Wicket. I like the system very
  much, especially one trick exited me: the Ajaxfallbacklink in which a
  link worked in a simple way when javasript is disabled , but at the
  same time has some Ajax functionality when Javascript is enabled on
  the users system. I liked this feature very much, but the integration
  with a database is not an integral part of the Wicket-system and can
  be acquired via a Wicket-Spring-Hibernate combination. This seemed too
  much for me to get into as a starter.

  That's how I came back to Lift. I need a stable database-connection.
  You need one when you hope that people will be paying some, even
  small, amount of money for your service.

   Can you clarify: Is this going to be a site, or a back end to a mobile
   app that sits on the phone?

  I just want to make a site

  But I hope it is clear I am not here to criticise anybody, it is just
  that often I feel this system is way over my head. Maybe that will
  change.

  thanks

  Ko

   On Mon, Oct 5, 2009 at 2:32 PM, koveen liep...@xs4all.nl wrote:

Hi,

Being a no-programmer and having no Java-background
I'd like to have mentioned that Lift really isn't an easy framework.
Having said that, I will try to read my way into this system and try
to solve the problems I encounter.

I have one question.

I would like to establish a login method where a visitor of my site
(to be) could be accepted as a valid user, based on the info the
server receives when the visitor enters the site.

In my case it will be a site for mobile phones and some mobile phone
operators will provide me with the telephone-number of the user once
she enters. Once a user has paid for the service,  this number alone
should be enough to make the visitior into a valid user. Without
needing to log in.

I have read the following on:http://demo.liftweb.net/ws

t's easy to dispatch incoming HTTP requests.
In your Boot class create a PartialFunction
that matches a pattern related to the incoming request and
then create a short-lived controller to service the request.

This code matches all the requests to /webservices/ and
assigns the stuff in '' to the variable c.  Then
the code attempts to find a public method with that name on
the controller.  If the method exists, it's invoked and Lift
processes the result.

I assume I will have to write my own  public method and place it
where??? in the direcory webservices.?

Maven didn't  include such a directory in my project set-up, so I
assume this  webservices are on an external server and that I will
have torefer to 

[Lift] What am I doing wrong?

2009-10-06 Thread Rick R
I have added a mapping of game_state to the DispatchSnippet GameState.
This works for game_state.list, but fails for game_state.addGame,
shown below.
What did I screw up this time?


WARN - Snippet Failure: SnippetFailure(/ -
ParsePath(List(index),,true,false),Full(game_store.addGame),Stateful
Snippet: Dispatch Not Matched)


lift:surround with=default at=content
  lift:game_store.list
  div id=game_list
ul
  game:list
 ligame:idgid/game:id game:namegname/game:name/li
  /game:list
/ul
  /div
  /lift:game_store.list
  lift:game_store.addGame form=post
div
  hr/
p
  Create a new game:
/p
pName
  game:nomName/game:nom
/p
p
  game:submit
buttonCreate/button
  /game:submit
/p
/div
  /lift:game_store.addGame

/lift:surround




class Boot {
  def boot {
// where to search snippet
LiftRules.addToPackages(com.redlemurgames)

LiftRules.snippetDispatch.append(
  Map(game_store - GameStore)
)

val entries = Menu(Loc(Home, List(index), Home)) :: Nil
LiftRules.setSiteMap(SiteMap(entries:_*))

  }


object GameStore extends DispatchSnippet {

  private val gameMap = new HashMap[String, Game]

  def dispatch = {
case list = list
  }

  def list(html: NodeSeq) : NodeSeq =
bind(game, html,
   list - gameMap.values.toList.flatMap
{ gm = bind(game, html, id - Text(gm.getId), name
- Text(gm.getName) ) }
)


  def addGame(form: NodeSeq) : NodeSeq = {
val id = randomString(12)
var gname : String = 


def checkAndSave(): Unit =  if (gname.isEmpty)
   {  S.error(String cannot be
empty) ; S.mapSnippet(game_store.add, doBind) }
   {  val ngame = new Game(id, gname,
new HashSet[(String, Actor)]);
  gameMap += id - ngame;
  ngame ! Init();
  S.notice(Added + ngame.getName) }


def doBind(form: NodeSeq) : NodeSeq = {
  println(doBind was called)
  bind(game, form,
   nom - text(gname, gname = _),
   submit - submit(New, checkAndSave))
}
doBind(form)
  }

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



[Lift] Re: Why fields are declared as 'object' with Mapper/Record?

2009-10-06 Thread Tim Nelson
On Tue, Oct 6, 2009 at 10:10 AM, David Pollak feeder.of.the.be...@gmail.com
 wrote:


 I don't care for the pattern, but it comes from Scala history... so

 In the days of Scala 2.3, an inner object had different class and method
 visibility than a val instantiated in the same way.  So, if you had:

 object foo extends Object {   def bar = You can call me
 }

 You could call bar.  However:

 val foo = new Object {   def bar = You can't call me
 }

 foo would be an Object, not visible as a subclass of Object.  So, that's
 the first reason for object vs. val.

 The second reason is that it's possible to disambiguate:

 object foo extends MappedString(this, 32)

 from

 var foo: MappedString[OtherThing] = _

 It may be possible to disambiguate these now, but in the 2.3 days, it
 wasn't.



It sounds like both reasons for using objects are legacy related. Is there
any reason (other than time constraints) to not update the Record framework
to take advantage of the newer language features?

Tim

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



[Lift] Re: lift nearly inaccessible for newby

2009-10-06 Thread TylerWeir

On Oct 6, 3:52 am, Stefan Langer mailtolan...@googlemail.com wrote:
 Not ment as a offence but you are in way over your head!

This is a case of running before walking I think.

Ko, web app development encompasses *many* aspects, and jumping in
with a Functional/OO hybrid language based framework may not be the
best idea if you're looking to hit the ground running.

Tyler

 A couple of things:
 1. You say you are a non-programmer but I assume you do understand Scala? Or
 else it is pointless to use Lift as it is based on the Scala language and
 relies heavily on its features. Knowledge of Java is also a plus cause some
 of the libs are not available in Scala but only in Java and it is better to
 know Java in order to understand the libraries.
 2. You do have experience with websites? Complex web applications? If not
 then I suggest you start by doing a simple static page for your design to
 get to know the technics you are trying to use or you get yourself a
 programmer/webdesinger to do it for you. If you are not willing to learn
 about the technical details you will get in big trouble later on and I mean
 trouble that can actually cost you money.
 3. If the above points do not seem valid for you then please get
 professional help
 4. If you are not scared by the above points and you are willing to invest
 then I suggest getting some example code and starting to disect that.
 Take a look athttp://github.com/tjweir/pocketchangeappwhich is a complete
 demo app in lift
 and take a look athttp://github.com/tjweir/liftbookfor a liftbook that is
 available freely.

 Regards and good luck on your project

 Stefan

 2009/10/5 koveen liep...@xs4all.nl



  hi Naftoli,

  thanks for your interest.

  On Oct 5, 10:50 pm, Naftoli Gugenheim naftoli...@gmail.com wrote:
   Being a non-programmer, and additionally not having a Java background,
   which framework are you comparing Lift to when you say it's not easy?
   :)

  First I read a book about rails, explaining things from the start, I
  did watch quite a lot of nice video's on the web explaining some basic
  tricks with Rails. I think it is a system that is easy to start with
  but I became nervous about recurring issues about scaling, the
  integration of Rails and Merb and had the idea, maybe wrong, that it
  was a system too much in transition.

  I read part of the tutorial of Lift, installed it on my computer using
  Maven, but in a way I got lost.

  Then I partially read a book about Wicket. I like the system very
  much, especially one trick exited me: the Ajaxfallbacklink in which a
  link worked in a simple way when javasript is disabled , but at the
  same time has some Ajax functionality when Javascript is enabled on
  the users system. I liked this feature very much, but the integration
  with a database is not an integral part of the Wicket-system and can
  be acquired via a Wicket-Spring-Hibernate combination. This seemed too
  much for me to get into as a starter.

  That's how I came back to Lift. I need a stable database-connection.
  You need one when you hope that people will be paying some, even
  small, amount of money for your service.

   Can you clarify: Is this going to be a site, or a back end to a mobile
   app that sits on the phone?

  I just want to make a site

  But I hope it is clear I am not here to criticise anybody, it is just
  that often I feel this system is way over my head. Maybe that will
  change.

  thanks

  Ko

   On Mon, Oct 5, 2009 at 2:32 PM, koveen liep...@xs4all.nl wrote:

Hi,

Being a no-programmer and having no Java-background
I'd like to have mentioned that Lift really isn't an easy framework.
Having said that, I will try to read my way into this system and try
to solve the problems I encounter.

I have one question.

I would like to establish a login method where a visitor of my site
(to be) could be accepted as a valid user, based on the info the
server receives when the visitor enters the site.

In my case it will be a site for mobile phones and some mobile phone
operators will provide me with the telephone-number of the user once
she enters. Once a user has paid for the service,  this number alone
should be enough to make the visitior into a valid user. Without
needing to log in.

I have read the following on:http://demo.liftweb.net/ws

t's easy to dispatch incoming HTTP requests.
In your Boot class create a PartialFunction
that matches a pattern related to the incoming request and
then create a short-lived controller to service the request.

This code matches all the requests to /webservices/ and
assigns the stuff in '' to the variable c.  Then
the code attempts to find a public method with that name on
the controller.  If the method exists, it's invoked and Lift
processes the result.

I assume I will have to write my own  public method and place it
where??? in the direcory webservices.?


[Lift] Re: How can I pass the result of Xml.toJson to JsonResponse

2009-10-06 Thread harryh

For now I am doing this.  It's not so bad.

def xmlToJson(xml: Elem): JsExp = {
  val json = Xml.toJson(xml) map {
// some mappings specific to my json needs
  }
  JsRaw(Printer.compact(render(json))
}

JsonResponse(xmlToJson(xml))

On Oct 6, 11:17 am, David Pollak feeder.of.the.be...@gmail.com
wrote:
 Please open a ticket for this.  We need to get the rest of Lift playing well
 with Joni's excellent JSON library.

 On Tue, Oct 6, 2009 at 7:43 AM, glenn gl...@exmbly.com wrote:

  I want to pass the result of Xml.toJson to JsonResponse. How can I do
  that, when JsonResponse takes a JsExp as
  a parameter, not a JValue.

  Glenn

 --
 Lift, the simply functional web frameworkhttp://liftweb.net
 Beginning Scalahttp://www.apress.com/book/view/1430219890
 Follow me:http://twitter.com/dpp
 Surf the harmonics
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: What am I doing wrong?

2009-10-06 Thread Ross Mellgren

You are using a dispatch snippet, which means the name after . in  
the lift tag is passed to the dispatch method of your snippet, rather  
than using reflection to find a method with the same name. So, you  
need to add:

case addGame = addGame

to your def dispatch

-Ross

On Oct 6, 2009, at 11:19 AM, Rick R wrote:

 I have added a mapping of game_state to the DispatchSnippet  
 GameState. This works for game_state.list, but fails for  
 game_state.addGame, shown below.
 What did I screw up this time?


 WARN - Snippet Failure: SnippetFailure(/ - ParsePath(List 
 (index),,true,false),Full(game_store.addGame),Stateful Snippet:  
 Dispatch Not Matched)



 lift:surround with=default at=content

   lift:game_store.list
   div id=game_list

 ul
   game:list
ligame:idgid/game:id game:namegname/game:name/li

   /game:list
 /ul
   /div

   /lift:game_store.list
   lift:game_store.addGame form=post

 div
   hr/
 p

 Create a new game:
 /p
 pName

 game:nomName/game:nom
 /p

   p
   game:submit
 buttonCreate/button

 /game:submit
 /p
 /div

   /lift:game_store.addGame

 /lift:surround





 class Boot {
   def boot {
 // where to search snippet

 LiftRules.addToPackages(com.redlemurgames)

 LiftRules.snippetDispatch.append(

   Map(game_store - GameStore)
 )


 val entries = Menu(Loc(Home, List(index), Home)) :: Nil

 LiftRules.setSiteMap(SiteMap(entries:_*))


   }


 object GameStore extends DispatchSnippet {

   private val gameMap = new HashMap[String, Game]


   def dispatch = {
 case list = list

   }

   def list(html: NodeSeq) : NodeSeq =

 bind(game, html,
  list - gameMap.values.toList.flatMap

 { gm = bind(game, html, id - Text(gm.getId),  
 name - Text(gm.getName) ) }

 )


   def addGame(form: NodeSeq) : NodeSeq = {

 val id = randomString(12)
 var gname : String = 



 def checkAndSave(): Unit =  if (gname.isEmpty)

{  S.error(String cannot be  
 empty) ; S.mapSnippet(game_store.add, doBind) }

{  val ngame = new Game(id,  
 gname, new HashSet[(String, Actor)]);

   gameMap += id - ngame;
   ngame ! Init();

   S.notice(Added +  
 ngame.getName) }



 def doBind(form: NodeSeq) : NodeSeq = {

   println(doBind was called)
   bind(game, form,

nom - text(gname, gname = _),

submit - submit(New, checkAndSave))

 }
 doBind(form)
   }

 


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



[Lift] Re: How can I pass the result of Xml.toJson to JsonResponse

2009-10-06 Thread glenn

Sounds like it might work for me. What package and class
is render found in.

Glenn

On Oct 6, 8:47 am, harryh har...@gmail.com wrote:
 For now I am doing this.  It's not so bad.

 def xmlToJson(xml: Elem): JsExp = {
   val json = Xml.toJson(xml) map {
     // some mappings specific to my json needs
   }
   JsRaw(Printer.compact(render(json))

 }

 JsonResponse(xmlToJson(xml))

 On Oct 6, 11:17 am, David Pollak feeder.of.the.be...@gmail.com
 wrote:

  Please open a ticket for this.  We need to get the rest of Lift playing well
  with Joni's excellent JSON library.

  On Tue, Oct 6, 2009 at 7:43 AM, glenn gl...@exmbly.com wrote:

   I want to pass the result of Xml.toJson to JsonResponse. How can I do
   that, when JsonResponse takes a JsExp as
   a parameter, not a JValue.

   Glenn

  --
  Lift, the simply functional web frameworkhttp://liftweb.net
  Beginning Scalahttp://www.apress.com/book/view/1430219890
  Follow me:http://twitter.com/dpp
  Surf the harmonics
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: lift-json and attributes

2009-10-06 Thread harryh

 This is a feature request and I just committed an implementation to my
 branch.

This looks great.  If there is anyway it could get committed to master
in time for M6 (which is coming out any day now right?) that would be
very very helpful to me.

Thanks for your work on this stuff Joni!

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



[Lift] Re: How can I pass the result of Xml.toJson to JsonResponse

2009-10-06 Thread glenn

Never mind, I found it.

Glenn

On Oct 6, 9:02 am, glenn gl...@exmbly.com wrote:
 Sounds like it might work for me. What package and class
 is render found in.

 Glenn

 On Oct 6, 8:47 am, harryh har...@gmail.com wrote:

  For now I am doing this.  It's not so bad.

  def xmlToJson(xml: Elem): JsExp = {
    val json = Xml.toJson(xml) map {
      // some mappings specific to my json needs
    }
    JsRaw(Printer.compact(render(json))

  }

  JsonResponse(xmlToJson(xml))

  On Oct 6, 11:17 am, David Pollak feeder.of.the.be...@gmail.com
  wrote:

   Please open a ticket for this.  We need to get the rest of Lift playing 
   well
   with Joni's excellent JSON library.

   On Tue, Oct 6, 2009 at 7:43 AM, glenn gl...@exmbly.com wrote:

I want to pass the result of Xml.toJson to JsonResponse. How can I do
that, when JsonResponse takes a JsExp as
a parameter, not a JValue.

Glenn

   --
   Lift, the simply functional web frameworkhttp://liftweb.net
   Beginning Scalahttp://www.apress.com/book/view/1430219890
   Follow me:http://twitter.com/dpp
   Surf the harmonics
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: lift-json and attributes

2009-10-06 Thread David Pollak
On Tue, Oct 6, 2009 at 9:03 AM, harryh har...@gmail.com wrote:


  This is a feature request and I just committed an implementation to my
  branch.

 This looks great.  If there is anyway it could get committed to master
 in time for M6 (which is coming out any day now right?) that would be
 very very helpful to me.


Sorry.  We froze on Sunday. :-(


 Thanks for your work on this stuff Joni!

 -harryh
 



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



[Lift] Re: lift nearly inaccessible for newby

2009-10-06 Thread David Pollak
We try to make Lift accessible to a wide range of folks who want to build
web sites.  However, there are lower-bounds on what we can do.  By and
large, PHP is a great place to start in terms of mapping simple HTTP
requests into simple web pages with a little RDBMS storage.
Personally, I don't think Lift is materially more complex than Rails,
although Rails' documentation and examples are worlds better than Lift's
(this is not a put-down of the excellent work done by the whole community
and Marius, Derek, and Tyler specifically, but a simple indication of being
4-5 years behind Rails in terms of adoption.)

So, Lift may not be the right thing for the original poster.  Maybe it will
be in two years.

Sorry.

On Tue, Oct 6, 2009 at 12:52 AM, Stefan Langer
mailtolan...@googlemail.comwrote:

 Not ment as a offence but you are in way over your head!
 A couple of things:
 1. You say you are a non-programmer but I assume you do understand Scala?
 Or else it is pointless to use Lift as it is based on the Scala language and
 relies heavily on its features. Knowledge of Java is also a plus cause some
 of the libs are not available in Scala but only in Java and it is better to
 know Java in order to understand the libraries.
 2. You do have experience with websites? Complex web applications? If not
 then I suggest you start by doing a simple static page for your design to
 get to know the technics you are trying to use or you get yourself a
 programmer/webdesinger to do it for you. If you are not willing to learn
 about the technical details you will get in big trouble later on and I mean
 trouble that can actually cost you money.
 3. If the above points do not seem valid for you then please get
 professional help
 4. If you are not scared by the above points and you are willing to invest
 then I suggest getting some example code and starting to disect that.
 Take a look at http://github.com/tjweir/pocketchangeapp which is a
 complete demo app in lift
 and take a look at http://github.com/tjweir/liftbook for a liftbook that
 is available freely.

 Regards and good luck on your project

 Stefan

 2009/10/5 koveen liep...@xs4all.nl


 hi Naftoli,

 thanks for your interest.

 On Oct 5, 10:50 pm, Naftoli Gugenheim naftoli...@gmail.com wrote:
  Being a non-programmer, and additionally not having a Java background,
  which framework are you comparing Lift to when you say it's not easy?
  :)

 First I read a book about rails, explaining things from the start, I
 did watch quite a lot of nice video's on the web explaining some basic
 tricks with Rails. I think it is a system that is easy to start with
 but I became nervous about recurring issues about scaling, the
 integration of Rails and Merb and had the idea, maybe wrong, that it
 was a system too much in transition.

 I read part of the tutorial of Lift, installed it on my computer using
 Maven, but in a way I got lost.

 Then I partially read a book about Wicket. I like the system very
 much, especially one trick exited me: the Ajaxfallbacklink in which a
 link worked in a simple way when javasript is disabled , but at the
 same time has some Ajax functionality when Javascript is enabled on
 the users system. I liked this feature very much, but the integration
 with a database is not an integral part of the Wicket-system and can
 be acquired via a Wicket-Spring-Hibernate combination. This seemed too
 much for me to get into as a starter.

 That's how I came back to Lift. I need a stable database-connection.
 You need one when you hope that people will be paying some, even
 small, amount of money for your service.

  Can you clarify: Is this going to be a site, or a back end to a mobile
  app that sits on the phone?

 I just want to make a site

 But I hope it is clear I am not here to criticise anybody, it is just
 that often I feel this system is way over my head. Maybe that will
 change.

 thanks

 Ko


 
  On Mon, Oct 5, 2009 at 2:32 PM, koveen liep...@xs4all.nl wrote:
 
   Hi,
 
   Being a no-programmer and having no Java-background
   I'd like to have mentioned that Lift really isn't an easy framework.
   Having said that, I will try to read my way into this system and try
   to solve the problems I encounter.
 
   I have one question.
 
   I would like to establish a login method where a visitor of my site
   (to be) could be accepted as a valid user, based on the info the
   server receives when the visitor enters the site.
 
   In my case it will be a site for mobile phones and some mobile phone
   operators will provide me with the telephone-number of the user once
   she enters. Once a user has paid for the service,  this number alone
   should be enough to make the visitior into a valid user. Without
   needing to log in.
 
   I have read the following on:http://demo.liftweb.net/ws
 
   t's easy to dispatch incoming HTTP requests.
   In your Boot class create a PartialFunction
   that matches a pattern related to the incoming request and
   then create a 

[Lift] Re: Why fields are declared as 'object' with Mapper/Record?

2009-10-06 Thread David Pollak
On Tue, Oct 6, 2009 at 8:20 AM, Tim Nelson tnell...@gmail.com wrote:


 On Tue, Oct 6, 2009 at 10:10 AM, David Pollak 
 feeder.of.the.be...@gmail.com wrote:


 I don't care for the pattern, but it comes from Scala history... so

 In the days of Scala 2.3, an inner object had different class and method
 visibility than a val instantiated in the same way.  So, if you had:

 object foo extends Object {   def bar = You can call me
 }

 You could call bar.  However:

 val foo = new Object {   def bar = You can't call me
 }

 foo would be an Object, not visible as a subclass of Object.  So, that's
 the first reason for object vs. val.

 The second reason is that it's possible to disambiguate:

 object foo extends MappedString(this, 32)

 from

 var foo: MappedString[OtherThing] = _

 It may be possible to disambiguate these now, but in the 2.3 days, it
 wasn't.



 It sounds like both reasons for using objects are legacy related.


Generally, yes.  I haven't dived into the reflection-based layout or the
Scala-related reflection stuff in 2.8 deeply enough to say that we could do
a val-based Record implementation.


 Is there any reason (other than time constraints) to not update the Record
 framework to take advantage of the newer language features?

 Tim

 



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



[Lift] Re: [SOLVED] Image submit buttons

2009-10-06 Thread Chris

I understand this is solved, would you care to shine some light on
making an image a button with lift?
either making a button with the image as an icon, or making an image
that is made form my snippet.

Thanks



On Sep 24, 3:52 pm, Indrajit Raychaudhuri indraj...@gmail.com wrote:
 One more trick learned at the cost of somebody's joy! Thanks Tim.

 On 24/09/09 9:53 PM, Timothy Perrett wrote:



  It appears that placing a hidden field at the end of the form with the
  right function binding solves the issue.
  Its far from ideal, but ironically appears to be what Microsoft do
  with .NET to work around IE issues.

  The joys of IE!

  Cheers, Tim

  On Sep 24, 9:41 am, Timothy Perretttimo...@getintheloop.eu  wrote:
  Actually scrap that - any solution to makeimagesubmit buttons work
  in IE and lift would be good :-)

  Cheers, Tim

  On Sep 24, 9:19 am, Timothy Perretttimo...@getintheloop.eu  wrote:

  Guys,

  IE8 brings with it a whole new lot of joy and:

  input type=image /

  Does not act as a submitbutton. According to the interweb, this will
  fix it:

  buttontype=submitimg src=whatever.jpg //button

  As I need to exectute the submit function in my lift snippet - how can
  i get around this with the current implementation? Seems like we need
  a SHtml.button(contentNodeSeq, callback _)

  Thoughts?

  Cheers, Tim



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



[Lift] Override the display names for (Mega)ProtoUser

2009-10-06 Thread Heiko Seeberger
Hi,
It is not possible to localize or override the display names for
(Mega)ProtoUser's first name, last name and time zone. This is because it is
determined by ??(First Name) and analogous, with First Name (with a
blank) not a valid key for a PropertyResourceBundle.

Am I missing something? Or should I file a bug?

Heiko

My job: weiglewilczek.com
My blog: heikoseeberger.name
Follow me: twitter.com/hseeberger
OSGi on Scala: scalamodules.org
Lift, the simply functional web framework: liftweb.net

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



[Lift] RESTful JSON server that supports jQuery or JSONP callback

2009-10-06 Thread Juan M Uys

Hi Lifters,

I'm building a REST server and a separate stand-alone DHTML client
which won't necessarily be hosted on the same server. Some browsers do
not support cross site Ajax, hence JSONP (i.e. callback support).

My DHTML client now makes calls like the following, using jQuery:

snip
GET /api/version.json?callback=C_1254838856015= HTTP/1.1
Host: localhost:8080
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US;
rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3
Accept: */*
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Cookie: JSESSIONID=13k8ykwq2u2w6
/snip

I need to know if I need to build manual support in for the callback:
* grab the token 'C'
* generate a JsCmd named 'C' with my JSON response as parameter (It
will be great if someone can suggest which parts of the Lift API to
use for this)
* send it back to the client (as an extra parameter to the original
JSON, or on it's own?)

It doesn't seem like Lift automatically picks up on ?callback= (it's
not a standard, so - understandable), and my response looks like this:

snip
HTTP/1.1 200 OK
Content-Length: 16
Content-Type: application/json
X-Lift-Version: 1.1-SNAPSHOT
Server: Jetty(6.1.21)

{version: 1}
/snip

The above response is generated by:

snip
def version(): Box[APIResponse] = {
Full(
  Right(
Map(version -
  Map(version - APIHelper.getParam(api.version))
)
  )
)
  }
/snip

...where APIResponse is borrowed from TwitterResponse (from the skittr example).

Another problem I have is that Firefox complains about invalid label
for the above response, so I think wrapping it up in a callback will
fix it.

Here's an answer related to PHP for this issue:
http://stackoverflow.com/questions/790910/jquery-getjson-to-external-php-page/790931#790931

Thanks,

-- 
juan
+44 7702 783 956

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



[Lift] Re: Why fields are declared as 'object' with Mapper/Record?

2009-10-06 Thread Oleg G.

Thanks for all the answers and especially for David's clarification.
It would be really cool to upgrade the 'keeping the meaning with the
bytes' thing (http://blog.lostlake.org/index.php?/archives/19-Keeping-
the-meaning-with-the-bytes.html) to allow extension/customization.

 Generally, yes.  I haven't dived into the reflection-based layout or the
 Scala-related reflection stuff in 2.8 deeply enough to say that we could do
 a val-based Record implementation.

  Is there any reason (other than time constraints) to not update the Record
  framework to take advantage of the newer language features?

  Tim

 --
 Lift, the simply functional web frameworkhttp://liftweb.net
 Beginning Scalahttp://www.apress.com/book/view/1430219890
 Follow me:http://twitter.com/dpp
 Surf the harmonics

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



[Lift] Re: lift nearly inaccessible for newby

2009-10-06 Thread koveen

Stefan,

thanks for your reply. :)

to anwser your questions: I have no experience with Java and I only
made some very simple static websites, years ago. I will try to listen
to you and try to make a very simple website with Lift. But if -IF-
I've succeeded in doing that, I hope you will excuse me when I'll come
back to ask again the -too complex- question in my mail.

I am not sure if what you are referring to if you mention the
professional help I should get, but Yes! I am not really happy trying
things out that don't seem to work for me up till now. So shrink or
programmer, any help is welcome! (For now I think I will experiment
with some simple things on my own)

I know the online liftbook, and I am reading it. I bought the
Beginning Scala book from David Pollak, and haven't read that much
yet, but I will.

Cheers,

Ko





On Oct 6, 11:52 am, Stefan Langer mailtolan...@googlemail.com wrote:
 Not ment as a offence but you are in way over your head!
 A couple of things:
 1. You say you are a non-programmer but I assume you do understand Scala? Or
 else it is pointless to use Lift as it is based on the Scala language and
 relies heavily on its features. Knowledge of Java is also a plus cause some
 of the libs are not available in Scala but only in Java and it is better to
 know Java in order to understand the libraries.
 2. You do have experience with websites? Complex web applications? If not
 then I suggest you start by doing a simple static page for your design to
 get to know the technics you are trying to use or you get yourself a
 programmer/webdesinger to do it for you. If you are not willing to learn
 about the technical details you will get in big trouble later on and I mean
 trouble that can actually cost you money.
 3. If the above points do not seem valid for you then please get
 professional help
 4. If you are not scared by the above points and you are willing to invest
 then I suggest getting some example code and starting to disect that.
 Take a look athttp://github.com/tjweir/pocketchangeappwhich is a complete
 demo app in lift
 and take a look athttp://github.com/tjweir/liftbookfor a liftbook that is
 available freely.

 Regards and good luck on your project

 Stefan

 2009/10/5 koveen liep...@xs4all.nl



  hi Naftoli,

  thanks for your interest.

  On Oct 5, 10:50 pm, Naftoli Gugenheim naftoli...@gmail.com wrote:
   Being a non-programmer, and additionally not having a Java background,
   which framework are you comparing Lift to when you say it's not easy?
   :)

  First I read a book about rails, explaining things from the start, I
  did watch quite a lot of nice video's on the web explaining some basic
  tricks with Rails. I think it is a system that is easy to start with
  but I became nervous about recurring issues about scaling, the
  integration of Rails and Merb and had the idea, maybe wrong, that it
  was a system too much in transition.

  I read part of the tutorial of Lift, installed it on my computer using
  Maven, but in a way I got lost.

  Then I partially read a book about Wicket. I like the system very
  much, especially one trick exited me: the Ajaxfallbacklink in which a
  link worked in a simple way when javasript is disabled , but at the
  same time has some Ajax functionality when Javascript is enabled on
  the users system. I liked this feature very much, but the integration
  with a database is not an integral part of the Wicket-system and can
  be acquired via a Wicket-Spring-Hibernate combination. This seemed too
  much for me to get into as a starter.

  That's how I came back to Lift. I need a stable database-connection.
  You need one when you hope that people will be paying some, even
  small, amount of money for your service.

   Can you clarify: Is this going to be a site, or a back end to a mobile
   app that sits on the phone?

  I just want to make a site

  But I hope it is clear I am not here to criticise anybody, it is just
  that often I feel this system is way over my head. Maybe that will
  change.

  thanks

  Ko

   On Mon, Oct 5, 2009 at 2:32 PM, koveen liep...@xs4all.nl wrote:

Hi,

Being a no-programmer and having no Java-background
I'd like to have mentioned that Lift really isn't an easy framework.
Having said that, I will try to read my way into this system and try
to solve the problems I encounter.

I have one question.

I would like to establish a login method where a visitor of my site
(to be) could be accepted as a valid user, based on the info the
server receives when the visitor enters the site.

In my case it will be a site for mobile phones and some mobile phone
operators will provide me with the telephone-number of the user once
she enters. Once a user has paid for the service,  this number alone
should be enough to make the visitior into a valid user. Without
needing to log in.

I have read the following on:http://demo.liftweb.net/ws

t's easy to dispatch 

[Lift] Re: [scala] EclipseLink?

2009-10-06 Thread Meredith Gregory
Dear Ismael,

i got buried under some other work and forgot to thank you for this note. If
you look further down on the web page you referenced you will see that the
pom.xml snippets they include have the characters escaped as you suggested.
i cut and pasted these into my pom.xml for my experiments and the download
failed.

Best wishes,

--greg

On Mon, Sep 28, 2009 at 9:07 PM, Ismael Juma mli...@juma.me.uk wrote:

 On Mon, 2009-09-28 at 13:53 -0700, Meredith Gregory wrote:
  Dear Ismael,
 
  Thanks. i knew about that and tried it. My version of maven barf'ed on
  the download url and so it didn't work for me. i would much prefer not
  to have to ferret out and maintain the jar myself. ;-)

 That's probably because you didn't escape the characters in the XML, the
 following works:


 http://www.eclipse.org/downloads/download.php?r=1amp;nf=1amp;file=/rt/eclipselink/maven.repo

 Best,
 Ismael




-- 
L.G. Meredith
Managing Partner
Biosimilarity LLC
1219 NW 83rd St
Seattle, WA 98117

+1 206.650.3740

http://biosimilarity.blogspot.com

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



[Lift] Re: Why fields are declared as 'object' with Mapper/Record?

2009-10-06 Thread David Pollak
On Tue, Oct 6, 2009 at 9:50 AM, Oleg G. ojo...@gmail.com wrote:


 Thanks for all the answers and especially for David's clarification.
 It would be really cool to upgrade the 'keeping the meaning with the
 bytes' thing (http://blog.lostlake.org/index.php?/archives/19-Keeping-
 the-meaning-with-the-bytes.html) to allow extension/customization.


What kind of extensions/customizations?

MappedXXX can all be subclassed, extended and customized.



  Generally, yes.  I haven't dived into the reflection-based layout or the
  Scala-related reflection stuff in 2.8 deeply enough to say that we could
 do
  a val-based Record implementation.
 
   Is there any reason (other than time constraints) to not update the
 Record
   framework to take advantage of the newer language features?
 
   Tim
 
  --
  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

 



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



[Lift] How to suppress / override / escape context path rewriting?

2009-10-06 Thread Ross Mellgren

I'm deploying a Lift application into JBoss as another WAR alongside  
the rest of our application in a separate WAR, and I'm running into  
problems with the context path rewriting. I've deployed my WAR with an  
appropriate jboss-web.xml file which sets the context path to /myapp,  
and now I'd like to construct relative URLs that go out to the other  
WAR, e.g.

a href=/mainapp/homeHome/a

but Lift rewrites anything starting with / to have the context path,  
so instead I get

a href=/myapp/mainapp/homeHome/a

This is mostly the right thing, and I don't really want to disable it  
globally (especially because then the /ajax_request paths and so on  
would probably go wrong), but I'd really like a way to escape it. The  
only ways so far I've found are:

1) Use /../mainapp/home, which rewrites to /myapp/../mainapp/home,  
which comes out right but seems pretty freaking ugly and depends on my  
context path only having one segment
2) Use fully-qualified URLs. This has the problem that I can't easily  
construct these URLs in templates without having some kind of snippet  
that expands it for me.

What I'd ideally like is some special syntax to escape context  
rewriting (e.g. //mainapp/home, or something else), or some guidance  
on how people usually accomplish this and so on.

Any ideas? I'm using 1.1-SNAPSHOT.

-Ross


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



[Lift] Re: YUI Compressor Fatal Error

2009-10-06 Thread David Pollak
On Tue, Oct 6, 2009 at 1:39 AM, Peter Robinett pe...@bubblefoundry.comwrote:


 Thanks, all. While David Bernard's plan to update the maven plugin is
 very welcome, the fact that Scala Actors don't work for Comet actors
 suggests that I should switch to the Sun JVM.


Keep in mind I was on Ubuntu 8.04 (granted this is the LTS version).

I'll try on 9.04 today.



 Peter

 On Oct 6, 8:50 am, David Bernard david.bernard...@gmail.com wrote:
  yuicompressor 2.3.x doesn't work with openjdk
  (https://bugs.launchpad.net/ubuntu/+source/openjdk-6/+bug/287035)
  But it seems that yuicompressor 2.4.2 works
  (http://www.electrictoolbox.com/minify-javascript-css-yui-compressor/)
 
  It's a long time I didn't update yuicompressor-maven-plugin. I'll
  deploy a new version latter this week.
 
  /davidB
 
  On Tue, Oct 6, 2009 at 02:19, Ross Mellgren dri...@gmail.com wrote:
   According to his version number he's running ubuntu and that particular
   version corresponds to jaunty jackalope (9.04)
   Unless he spliced that package into debian or something else.
   -Ross
   On Oct 5, 2009, at 8:06 PM, David Pollak wrote:
 
   d...@david-desktop:~/Desktop/liftweb/examples/example$ java -version
   Picked up JAVA_TOOL_OPTIONS: -Xmx1024M
   java version 1.6.0_0
   OpenJDK  Runtime Environment (build 1.6.0_0-b11)
   OpenJDK Client VM (build 1.6.0_0-b11, mixed mode, sharing)
   d...@david-desktop:~/Desktop/liftweb/examples/example$
 
   I'm running on Ubuntu 8.04 with the OpenJDK installation.
 
   I get compilation failures on about half the runs.  They appear to be
   random.
 
   Scala Actors do not work (I'm not trying to throw gasoline on any
 fires,
   just reporting what I'm seeing) when powering Lift's comet stuff.
 However,
   Lift Actors do work.
 
   I'm not seeing any explicit issues with other libraries.
 
   What OS are you running under your OpenJDK installation?
 
   On Mon, Oct 5, 2009 at 1:10 PM, Peter Robinett 
 pe...@bubblefoundry.com
   wrote:
 
   Ross, I am using OpenJDK:
   $ java -version
   java version 1.6.0_0
   OpenJDK Runtime Environment (IcedTea6 1.4.1) (6b14-1.4.1-0ubuntu11)
   OpenJDK 64-Bit Server VM (build 14.0-b08, mixed mode)
 
   Is it possible to use YUI Compressor at all with OpenJDK?
 
   Peter
 
   On Oct 5, 7:32 pm, Ross Mellgren dri...@gmail.com wrote:
I thought someone mentioned this a little while ago and it was due
 to
OpenJDK (and only related to the YUI compressor)?
 
-Ross
 
On Oct 5, 2009, at 1:25 PM, jon wrote:
 
 Is there a syntax problem in one of your javascript files?
 
 On Oct 5, 1:23 pm, Peter Robinett pe...@bubblefoundry.com
 wrote:
 Hi all,
 
 I've been compiling and running my Lift app on my personal
 machine
 without any problems but when I try to run it on another machine
 (where it had previously worked), I am getting fatal YUI
 Compressor
 errors.
 
 Not knowing YUI Compressor or how Lift and Maven use it (but
 willing
 to learn!), I'd appreciate any tips on how to get it to work
 again.
 
 Thanks in advance,
 Peter Robinett
 
 PS I thought I already posted a version of this message but I
 don't
 see it on the Groups site. My apologies if this message is a
 duplicate.
 
 $ mvn jetty:run
 [INFO] Scanning for projects...
 [INFO] Searching repository for plugin with prefix: 'jetty'.
 [INFO]
 

 
 [INFO] Building server
 [INFO]task-segment: [jetty:run]
 [INFO]
 

 
 [INFO] Preparing jetty:run
 [INFO] [resources:resources]
 [INFO] Using default encoding to copy filtered resources.
 [INFO] [yuicompressor:compress {execution: default}]
 [INFO] equalnetworks.css (267b) - equalnetworks.css (197b)[73%]
 [INFO] dashboard.css (5511b) - dashboard.css (4478b)[81%]
 [INFO] jquery.tooltip.css (172b) - jquery.tooltip.css
 (145b)[84%]
 [INFO]
 

 
 [ERROR] FATAL ERROR
 [INFO]
 

 
 [INFO] null
 [INFO]
 

 
 [INFO] Trace
 java.lang.RuntimeException
 at
 

 com.yahoo.platform.yui.compressor.JavaScriptCompressor.printSourceNumber
 (JavaScriptCompressor.java:299)
 at
 com.yahoo.platform.yui.compressor.JavaScriptCompressor.parse
 (JavaScriptCompressor.java:335)
 at
 com.yahoo.platform.yui.compressor.JavaScriptCompressor.init
 (JavaScriptCompressor.java:532)
 at
 net.sf.alchim.mojo.yuicompressor.YuiCompressorMojo.processFile
 (YuiCompressorMojo.java:178)
 at
 net.sf.alchim.mojo.yuicompressor.MojoSupport.processDir
 (MojoSupport.java:151)
 at 

[Lift] Re: lift nearly inaccessible for newby

2009-10-06 Thread TylerWeir



On Oct 6, 12:31 pm, David Pollak feeder.of.the.be...@gmail.com
wrote:
 We try to make Lift accessible to a wide range of folks who want to build
 web sites.  However, there are lower-bounds on what we can do.  By and
 large, PHP is a great place to start in terms of mapping simple HTTP

I was going to suggest CakePHP as I've got non-dev friends to use with
with reasonable success.
http://cakephp.org/

 requests into simple web pages with a little RDBMS storage.
 Personally, I don't think Lift is materially more complex than Rails,
 although Rails' documentation and examples are worlds better than Lift's

In volume or in quality? Both?

Given how busy everyone is, I'll put this out there and maybe some
with time/energy will pick it up.

Mike Ash is an excellent Cocoa/ObjC dev and has a series of articles
he posts on Fridays, Friday QA.
http://www.mikeash.com/?page=pyblog/

I see something like this being an enormous benefit to Lift devs.  And
in addition to QA, maybe a Recipe day, Recipe for CRUD Recipe for
Comet Recipe for X

I would really like to do this, but I don't have the time to make it
be of any quality and I'd prefer not to put out something that is
merely one step up from junk.

Maybe a thread where people get to guide us to an example app.

Personal Opinion:
To be fair to Lift commit team, there is quite a bit of example code
online for people to check out, but I'm not convinced they are
actually looking at it.  Given the number of questions that come in
that are easily solved with a Google Search, I don't know how pumping
out more and more docs and examples will help, as it seems largely
ignored.

We went through the same issue with Cocos2d-iPhone:
http://www.cocos2d-iphone.org/forum/topic/1564
The source code people must download to build a game comes with about
100 examples and people still ignore it.

So we're not dealing with a Lift-specific issue I don't think, but we
are dealing with a difficult one.

Ty



 (this is not a put-down of the excellent work done by the whole community
 and Marius, Derek, and Tyler specifically, but a simple indication of being
 4-5 years behind Rails in terms of adoption.)

 So, Lift may not be the right thing for the original poster.  Maybe it will
 be in two years.

 Sorry.

 On Tue, Oct 6, 2009 at 12:52 AM, Stefan Langer
 mailtolan...@googlemail.comwrote:



  Not ment as a offence but you are in way over your head!
  A couple of things:
  1. You say you are a non-programmer but I assume you do understand Scala?
  Or else it is pointless to use Lift as it is based on the Scala language and
  relies heavily on its features. Knowledge of Java is also a plus cause some
  of the libs are not available in Scala but only in Java and it is better to
  know Java in order to understand the libraries.
  2. You do have experience with websites? Complex web applications? If not
  then I suggest you start by doing a simple static page for your design to
  get to know the technics you are trying to use or you get yourself a
  programmer/webdesinger to do it for you. If you are not willing to learn
  about the technical details you will get in big trouble later on and I mean
  trouble that can actually cost you money.
  3. If the above points do not seem valid for you then please get
  professional help
  4. If you are not scared by the above points and you are willing to invest
  then I suggest getting some example code and starting to disect that.
  Take a look athttp://github.com/tjweir/pocketchangeappwhich is a
  complete demo app in lift
  and take a look athttp://github.com/tjweir/liftbookfor a liftbook that
  is available freely.

  Regards and good luck on your project

  Stefan

  2009/10/5 koveen liep...@xs4all.nl

  hi Naftoli,

  thanks for your interest.

  On Oct 5, 10:50 pm, Naftoli Gugenheim naftoli...@gmail.com wrote:
   Being a non-programmer, and additionally not having a Java background,
   which framework are you comparing Lift to when you say it's not easy?
   :)

  First I read a book about rails, explaining things from the start, I
  did watch quite a lot of nice video's on the web explaining some basic
  tricks with Rails. I think it is a system that is easy to start with
  but I became nervous about recurring issues about scaling, the
  integration of Rails and Merb and had the idea, maybe wrong, that it
  was a system too much in transition.

  I read part of the tutorial of Lift, installed it on my computer using
  Maven, but in a way I got lost.

  Then I partially read a book about Wicket. I like the system very
  much, especially one trick exited me: the Ajaxfallbacklink in which a
  link worked in a simple way when javasript is disabled , but at the
  same time has some Ajax functionality when Javascript is enabled on
  the users system. I liked this feature very much, but the integration
  with a database is not an integral part of the Wicket-system and can
  be acquired via a Wicket-Spring-Hibernate combination. This seemed too
  

[Lift] Re: Why fields are declared as 'object' with Mapper/Record?

2009-10-06 Thread Oleg G.

As i said before i'm not sure that i'm getting the whole picture and
maybe my initial question is incorrect in its root. Still:

Suppose i have a Person class declared with Mapper/Record and i want
to reuse the class and all the code associated with it in another
module/project. My first thought was to extend the Person class and
override some of its fields by mixing in some additional traits (see
my simplified example code in the initial message). But i noticed that
inner objects cannot be overriden (its not obvious for me but i can
get it if i dig it).

So how do i reuse Mapper/Record based code if i need to extend/
customize the data structures?

On Oct 6, 11:59 pm, David Pollak feeder.of.the.be...@gmail.com
wrote:
 On Tue, Oct 6, 2009 at 9:50 AM, Oleg G. ojo...@gmail.com wrote:

  Thanks for all the answers and especially for David's clarification.
  It would be really cool to upgrade the 'keeping the meaning with the
  bytes' thing (http://blog.lostlake.org/index.php?/archives/19-Keeping-
  the-meaning-with-the-bytes.html) to allow extension/customization.

 What kind of extensions/customizations?

 MappedXXX can all be subclassed, extended and customized.

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



[Lift] Re: What am I doing wrong?

2009-10-06 Thread Rick R
Geez. I knew I was overlooking something stupid. Thanks for your help.



On Tue, Oct 6, 2009 at 11:49 AM, Ross Mellgren dri...@gmail.com wrote:


 You are using a dispatch snippet, which means the name after . in
 the lift tag is passed to the dispatch method of your snippet, rather
 than using reflection to find a method with the same name. So, you
 need to add:

 case addGame = addGame

 to your  def dispatch

 -Ross

 On Oct 6, 2009, at 11:19 AM, Rick R wrote:

  I have added a mapping of game_state to the DispatchSnippet
  GameState. This works for game_state.list, but fails for
  game_state.addGame, shown below.
  What did I screw up this time?
 
 
  WARN - Snippet Failure: SnippetFailure(/ - ParsePath(List
  (index),,true,false),Full(game_store.addGame),Stateful Snippet:
  Dispatch Not Matched)
 
 
 
  lift:surround with=default at=content
 
lift:game_store.list
div id=game_list
 
  ul
game:list
 ligame:idgid/game:id game:namegname/game:name/li
 
/game:list
  /ul
/div
 
/lift:game_store.list
lift:game_store.addGame form=post
 
  div
hr/
  p
 
  Create a new game:
  /p
  pName
 
  game:nomName/game:nom
  /p
 
p
game:submit
  buttonCreate/button
 
  /game:submit
  /p
  /div
 
/lift:game_store.addGame
 
  /lift:surround
 
 
 
 
 
  class Boot {
def boot {
  // where to search snippet
 
  LiftRules.addToPackages(com.redlemurgames)
 
  LiftRules.snippetDispatch.append(
 
Map(game_store - GameStore)
  )
 
 
  val entries = Menu(Loc(Home, List(index), Home)) :: Nil
 
  LiftRules.setSiteMap(SiteMap(entries:_*))
 
 
}
 
 
  object GameStore extends DispatchSnippet {
 
private val gameMap = new HashMap[String, Game]
 
 
def dispatch = {
  case list = list
 
}
 
def list(html: NodeSeq) : NodeSeq =
 
  bind(game, html,
   list - gameMap.values.toList.flatMap
 
  { gm = bind(game, html, id - Text(gm.getId),
  name - Text(gm.getName) ) }
 
  )
 
 
def addGame(form: NodeSeq) : NodeSeq = {
 
  val id = randomString(12)
  var gname : String = 
 
 
 
  def checkAndSave(): Unit =  if (gname.isEmpty)
 
 {  S.error(String cannot be
  empty) ; S.mapSnippet(game_store.add, doBind) }
 
 {  val ngame = new Game(id,
  gname, new HashSet[(String, Actor)]);
 
gameMap += id - ngame;
ngame ! Init();
 
S.notice(Added +
  ngame.getName) }
 
 
 
  def doBind(form: NodeSeq) : NodeSeq = {
 
println(doBind was called)
bind(game, form,
 
 nom - text(gname, gname = _),
 
 submit - submit(New, checkAndSave))
 
  }
  doBind(form)
}
 
  


 


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



[Lift] Re: RESTful JSON server that supports jQuery or JSONP callback

2009-10-06 Thread opyate

Sorry - APIResponse code not borrowed from skittr, but ESME (http://
incubator.apache.org/esme/)
Thus, depending on your call's extension (.json or .xml) you can serve
the response in the required format.

Anyhoo, back to the question... :-)

Thanks,
Juan

On Oct 6, 5:48 pm, Juan M Uys opy...@gmail.com wrote:
 Hi Lifters,

 I'm building a REST server and a separate stand-alone DHTML client
 which won't necessarily be hosted on the same server. Some browsers do
 not support cross site Ajax, hence JSONP (i.e. callback support).

 My DHTML client now makes calls like the following, using jQuery:

 snip
 GET /api/version.json?callback=C_1254838856015= HTTP/1.1
 Host: localhost:8080
 User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US;
 rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3
 Accept: */*
 Accept-Language: en-us,en;q=0.5
 Accept-Encoding: gzip,deflate
 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
 Keep-Alive: 300
 Connection: keep-alive
 Cookie: JSESSIONID=13k8ykwq2u2w6
 /snip

 I need to know if I need to build manual support in for the callback:
 * grab the token 'C'
 * generate a JsCmd named 'C' with my JSON response as parameter (It
 will be great if someone can suggest which parts of the Lift API to
 use for this)
 * send it back to the client (as an extra parameter to the original
 JSON, or on it's own?)

 It doesn't seem like Lift automatically picks up on ?callback= (it's
 not a standard, so - understandable), and my response looks like this:

 snip
 HTTP/1.1 200 OK
 Content-Length: 16
 Content-Type: application/json
 X-Lift-Version: 1.1-SNAPSHOT
 Server: Jetty(6.1.21)

 {version: 1}
 /snip

 The above response is generated by:

 snip
 def version(): Box[APIResponse] = {
     Full(
       Right(
         Map(version -
           Map(version - APIHelper.getParam(api.version))
         )
       )
     )
   }
 /snip

 ...where APIResponse is borrowed from TwitterResponse (from the skittr 
 example).

 Another problem I have is that Firefox complains about invalid label
 for the above response, so I think wrapping it up in a callback will
 fix it.

 Here's an answer related to PHP for this 
 issue:http://stackoverflow.com/questions/790910/jquery-getjson-to-external-...

 Thanks,

 --
 juan
 +44 7702 783 956

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



[Lift] Re: lift nearly inaccessible for newby

2009-10-06 Thread koveen

David,

no need to appologise! I think you do all necessary to clarify issues
at hand and defend the interests of the lift community!
And I am very happy with the liftbook too! But yes I've spent two
weekends to try to accomplish some simple task and failed.

And because of that, indeed it has crossed my mind to refer back to
Rails, only because I really liked to watch those 256 video's in which
Ryan Bates explaines some small detail. (I didn't watch them all)

It would feel like a failure to me to change to back to Rails, because
I have more confidence in Lift.

But for a beginner it is not easy.

Ko



On Oct 6, 8:31 pm, David Pollak feeder.of.the.be...@gmail.com wrote:
 We try to make Lift accessible to a wide range of folks who want to build
 web sites.  However, there are lower-bounds on what we can do.  By and
 large, PHP is a great place to start in terms of mapping simple HTTP
 requests into simple web pages with a little RDBMS storage.
 Personally, I don't think Lift is materially more complex than Rails,
 although Rails' documentation and examples are worlds better than Lift's
 (this is not a put-down of the excellent work done by the whole community
 and Marius, Derek, and Tyler specifically, but a simple indication of being
 4-5 years behind Rails in terms of adoption.)

 So, Lift may not be the right thing for the original poster.  Maybe it will
 be in two years.

 Sorry.

 On Tue, Oct 6, 2009 at 12:52 AM, Stefan Langer
 mailtolan...@googlemail.comwrote:



  Not ment as a offence but you are in way over your head!
  A couple of things:
  1. You say you are a non-programmer but I assume you do understand Scala?
  Or else it is pointless to use Lift as it is based on the Scala language and
  relies heavily on its features. Knowledge of Java is also a plus cause some
  of the libs are not available in Scala but only in Java and it is better to
  know Java in order to understand the libraries.
  2. You do have experience with websites? Complex web applications? If not
  then I suggest you start by doing a simple static page for your design to
  get to know the technics you are trying to use or you get yourself a
  programmer/webdesinger to do it for you. If you are not willing to learn
  about the technical details you will get in big trouble later on and I mean
  trouble that can actually cost you money.
  3. If the above points do not seem valid for you then please get
  professional help
  4. If you are not scared by the above points and you are willing to invest
  then I suggest getting some example code and starting to disect that.
  Take a look athttp://github.com/tjweir/pocketchangeappwhich is a
  complete demo app in lift
  and take a look athttp://github.com/tjweir/liftbookfor a liftbook that
  is available freely.

  Regards and good luck on your project

  Stefan

  2009/10/5 koveen liep...@xs4all.nl

  hi Naftoli,

  thanks for your interest.

  On Oct 5, 10:50 pm, Naftoli Gugenheim naftoli...@gmail.com wrote:
   Being a non-programmer, and additionally not having a Java background,
   which framework are you comparing Lift to when you say it's not easy?
   :)

  First I read a book about rails, explaining things from the start, I
  did watch quite a lot of nice video's on the web explaining some basic
  tricks with Rails. I think it is a system that is easy to start with
  but I became nervous about recurring issues about scaling, the
  integration of Rails and Merb and had the idea, maybe wrong, that it
  was a system too much in transition.

  I read part of the tutorial of Lift, installed it on my computer using
  Maven, but in a way I got lost.

  Then I partially read a book about Wicket. I like the system very
  much, especially one trick exited me: the Ajaxfallbacklink in which a
  link worked in a simple way when javasript is disabled , but at the
  same time has some Ajax functionality when Javascript is enabled on
  the users system. I liked this feature very much, but the integration
  with a database is not an integral part of the Wicket-system and can
  be acquired via a Wicket-Spring-Hibernate combination. This seemed too
  much for me to get into as a starter.

  That's how I came back to Lift. I need a stable database-connection.
  You need one when you hope that people will be paying some, even
  small, amount of money for your service.

   Can you clarify: Is this going to be a site, or a back end to a mobile
   app that sits on the phone?

  I just want to make a site

  But I hope it is clear I am not here to criticise anybody, it is just
  that often I feel this system is way over my head. Maybe that will
  change.

  thanks

  Ko

   On Mon, Oct 5, 2009 at 2:32 PM, koveen liep...@xs4all.nl wrote:

Hi,

Being a no-programmer and having no Java-background
I'd like to have mentioned that Lift really isn't an easy framework.
Having said that, I will try to read my way into this system and try
to solve the problems I encounter.

I have one 

[Lift] Re: Why fields are declared as 'object' with Mapper/Record?

2009-10-06 Thread Naftoli Gugenheim

I want to raise another related point.
Currently all mapped fields have to be passed this. Is there a way to not 
require it?
Can Mapper or Record use an implicit object etc. to fill in this?
Or could there be an inner derived class that knows its parent, like I recently 
did for ModelView? In other words, e.g., a MappedString that is a member of 
Mapper and derived from the real MappedString. This option is less optimal 
because (1) it's possible it will break code, although not necessarily, and (2) 
it cannnot be extended to a MappedField defined outside of lift-mapper. A 
similar approach that solves #2 is traits that can be mixed into a Mapper 
containing these MappedField subclasses, but it has the disadvantage of 
requiring more traits to be mixed in.
In any case, although it is now possible to access members of an anonymous 
class, doesn't it currently use reflection? So maybe this is dependent on that 
being improved.
On the other hand the advantage of vals is that they don't have to be lazy, 
thus eliminating all the reflection necessary to get the list of fields.
To go off topic, maybe it would make sense, in order to allow either vals or 
objects *or JPA entities*, a base trait that defines the ability to get 
information about fields. A JPA subtrait could use JPA APIs, while the main 
Lift subtrait could either use reflection to get the objects, or use eager vals 
that populate the entities knowledge of them directly.


-
David Pollakfeeder.of.the.be...@gmail.com wrote:

On Tue, Oct 6, 2009 at 8:20 AM, Tim Nelson tnell...@gmail.com wrote:


 On Tue, Oct 6, 2009 at 10:10 AM, David Pollak 
 feeder.of.the.be...@gmail.com wrote:


 I don't care for the pattern, but it comes from Scala history... so

 In the days of Scala 2.3, an inner object had different class and method
 visibility than a val instantiated in the same way.  So, if you had:

 object foo extends Object {   def bar = You can call me
 }

 You could call bar.  However:

 val foo = new Object {   def bar = You can't call me
 }

 foo would be an Object, not visible as a subclass of Object.  So, that's
 the first reason for object vs. val.

 The second reason is that it's possible to disambiguate:

 object foo extends MappedString(this, 32)

 from

 var foo: MappedString[OtherThing] = _

 It may be possible to disambiguate these now, but in the 2.3 days, it
 wasn't.



 It sounds like both reasons for using objects are legacy related.


Generally, yes.  I haven't dived into the reflection-based layout or the
Scala-related reflection stuff in 2.8 deeply enough to say that we could do
a val-based Record implementation.


 Is there any reason (other than time constraints) to not update the Record
 framework to take advantage of the newer language features?

 Tim

 



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



[Lift] Re: lift nearly inaccessible for newby

2009-10-06 Thread Timothy Perrett

Ko,

Id echo DPP's comments... if you are a real beginer then perhaps
consider PHP as it will provide you with a quicker route to market.
Lift is a great bit of software engineering, but parts of it are
truley non-trival and will no doubt be completely inappropriate for a
beginner... hell, we have people come to this community from a JEE
background and still struggle with certain aspects of lift :-)

Tyler,

100% take on what you are saying - it makes sense of course; this is
something that has troubled me for a while and I think the main issue
is actually just an organisational one. I believe if we can
restructure the site to make stuff easier to find that will improve
the signal-noise ratio on this list.

I've been liaising with some institutions about getting some student
help / donation of time to redesign the site, and im making slow but
steady progress. I hope that if we can find the right person, they can
help us re-organize and re-factor what we have for the good of the
community .

Cheers, Tim


On Oct 6, 6:40 pm, koveen liep...@xs4all.nl wrote:
 David,

 no need to appologise! I think you do all necessary to clarify issues
 at hand and defend the interests of the lift community!
 And I am very happy with the liftbook too! But yes I've spent two
 weekends to try to accomplish some simple task and failed.

 And because of that, indeed it has crossed my mind to refer back to
 Rails, only because I really liked to watch those 256 video's in which
 Ryan Bates explaines some small detail. (I didn't watch them all)

 It would feel like a failure to me to change to back to Rails, because
 I have more confidence in Lift.

 But for a beginner it is not easy.

 Ko

 On Oct 6, 8:31 pm, David Pollak feeder.of.the.be...@gmail.com wrote:



  We try to make Lift accessible to a wide range of folks who want to build
  web sites.  However, there are lower-bounds on what we can do.  By and
  large, PHP is a great place to start in terms of mapping simple HTTP
  requests into simple web pages with a little RDBMS storage.
  Personally, I don't think Lift is materially more complex than Rails,
  although Rails' documentation and examples are worlds better than Lift's
  (this is not a put-down of the excellent work done by the whole community
  and Marius, Derek, and Tyler specifically, but a simple indication of being
  4-5 years behind Rails in terms of adoption.)

  So, Lift may not be the right thing for the original poster.  Maybe it will
  be in two years.

  Sorry.

  On Tue, Oct 6, 2009 at 12:52 AM, Stefan Langer
  mailtolan...@googlemail.comwrote:

   Not ment as a offence but you are in way over your head!
   A couple of things:
   1. You say you are a non-programmer but I assume you do understand Scala?
   Or else it is pointless to use Lift as it is based on the Scala language 
   and
   relies heavily on its features. Knowledge of Java is also a plus cause 
   some
   of the libs are not available in Scala but only in Java and it is better 
   to
   know Java in order to understand the libraries.
   2. You do have experience with websites? Complex web applications? If not
   then I suggest you start by doing a simple static page for your design to
   get to know the technics you are trying to use or you get yourself a
   programmer/webdesinger to do it for you. If you are not willing to learn
   about the technical details you will get in big trouble later on and I 
   mean
   trouble that can actually cost you money.
   3. If the above points do not seem valid for you then please get
   professional help
   4. If you are not scared by the above points and you are willing to invest
   then I suggest getting some example code and starting to disect that.
   Take a look athttp://github.com/tjweir/pocketchangeappwhichis a
   complete demo app in lift
   and take a look athttp://github.com/tjweir/liftbookfora liftbook that
   is available freely.

   Regards and good luck on your project

   Stefan

   2009/10/5 koveen liep...@xs4all.nl

   hi Naftoli,

   thanks for your interest.

   On Oct 5, 10:50 pm, Naftoli Gugenheim naftoli...@gmail.com wrote:
Being a non-programmer, and additionally not having a Java background,
which framework are you comparing Lift to when you say it's not easy?
:)

   First I read a book about rails, explaining things from the start, I
   did watch quite a lot of nice video's on the web explaining some basic
   tricks with Rails. I think it is a system that is easy to start with
   but I became nervous about recurring issues about scaling, the
   integration of Rails and Merb and had the idea, maybe wrong, that it
   was a system too much in transition.

   I read part of the tutorial of Lift, installed it on my computer using
   Maven, but in a way I got lost.

   Then I partially read a book about Wicket. I like the system very
   much, especially one trick exited me: the Ajaxfallbacklink in which a
   link worked in a simple way when javasript is disabled , but at 

[Lift] Re: lift nearly inaccessible for newby

2009-10-06 Thread marius d.

Ko,

You are in an interesting position :) ... Personally if I would be in
your place I would not start with PHP. I would probably start
understanding Java servlets and the horrible and crappy JSP's. Then I
would try to understand Java not only as a language but also as a
platform. Then I would start with Scala. David's book Beginning
Scala is an excellent material. Then or maybe in parallel with that
dig in Lift.

I'm sure you realise there are lots of things for you to digest, but
by all means don't let this stop you. Lift and Scala are just great
and definitely worth the effort.


Br's,
Marius

On Oct 5, 9:32 pm, koveen liep...@xs4all.nl wrote:
 Hi,

 Being a no-programmer and having no Java-background
 I'd like to have mentioned that Lift really isn't an easy framework.
 Having said that, I will try to read my way into this system and try
 to solve the problems I encounter.

 I have one question.

 I would like to establish a login method where a visitor of my site
 (to be) could be accepted as a valid user, based on the info the
 server receives when the visitor enters the site.

 In my case it will be a site for mobile phones and some mobile phone
 operators will provide me with the telephone-number of the user once
 she enters. Once a user has paid for the service,  this number alone
 should be enough to make the visitior into a valid user. Without
 needing to log in.

 I have read the following on:http://demo.liftweb.net/ws

 t's easy to dispatch incoming HTTP requests.
 In your Boot class create a PartialFunction
 that matches a pattern related to the incoming request and
 then create a short-lived controller to service the request.

 This code matches all the requests to /webservices/ and
 assigns the stuff in '' to the variable c.  Then
 the code attempts to find a public method with that name on
 the controller.  If the method exists, it's invoked and Lift
 processes the result.

 I assume I will have to write my own  public method and place it
 where??? in the direcory webservices.?

 Maven didn't  include such a directory in my project set-up, so I
 assume this  webservices are on an external server and that I will
 have torefer to and  extend an existing function. Am I correct in
 this? and is there an exemple of how to write such a method.

 I would be really happy to make some progress, and any help is
 welcome.

 Thanks,

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



[Lift] Re: lift nearly inaccessible for newby

2009-10-06 Thread Randinn

Hello koveen,

I'll tell you some of my experiences with Lift/Scala to give you some
idea. I learned to code basic and some what they called then Machine
Language on a Commodore Vic 20 and a 64 oh so long ago, I learned a
bit of C then gave it up. I learned a bit of PHP since then but that's
it. I'm learning Scala/Lift because I want to, not for a particular
site I want to make. If you are determined to learn it there are some
things you need to understand then.

 OOP is the very first, if you do not have an understanding of Object
Orientated Programming then you'll not see why the code is written the
way it is. I would suggest learning what Functional Programming is as
well as you will be dealing with it to a lesser degree. You need to
learn the basics of Java (what classes are, whats an interface, etc.)
as they will be referenced because it is assumed you already know
these.

You have something most of the others here do not have, pre-conceived
notions, the same Java programmers that do know the basics are also
constrained a bit by that knowledge. Scala has differences from Java
that they have to overcome to learn the language.

What I suggest is if you have a site you have to make soon do it in
something else and study Scala more, if not then readas many of the
Scala books you can find (Davids is a great book and the lift book is
a great basic book) Martin's book I'd suggest getting as he has
definitions of Java terms and explains some of the Java basics.
Anyway, good luck.



On Oct 7, 4:40 am, koveen liep...@xs4all.nl wrote:
 David,

 no need to appologise! I think you do all necessary to clarify issues
 at hand and defend the interests of the lift community!
 And I am very happy with the liftbook too! But yes I've spent two
 weekends to try to accomplish some simple task and failed.

 And because of that, indeed it has crossed my mind to refer back to
 Rails, only because I really liked to watch those 256 video's in which
 Ryan Bates explaines some small detail. (I didn't watch them all)

 It would feel like a failure to me to change to back to Rails, because
 I have more confidence in Lift.

 But for a beginner it is not easy.

 Ko

 On Oct 6, 8:31 pm, David Pollak feeder.of.the.be...@gmail.com wrote:

  We try to make Lift accessible to a wide range of folks who want to build
  web sites.  However, there are lower-bounds on what we can do.  By and
  large, PHP is a great place to start in terms of mapping simple HTTP
  requests into simple web pages with a little RDBMS storage.
  Personally, I don't think Lift is materially more complex than Rails,
  although Rails' documentation and examples are worlds better than Lift's
  (this is not a put-down of the excellent work done by the whole community
  and Marius, Derek, and Tyler specifically, but a simple indication of being
  4-5 years behind Rails in terms of adoption.)

  So, Lift may not be the right thing for the original poster.  Maybe it will
  be in two years.

  Sorry.

  On Tue, Oct 6, 2009 at 12:52 AM, Stefan Langer
  mailtolan...@googlemail.comwrote:

   Not ment as a offence but you are in way over your head!
   A couple of things:
   1. You say you are a non-programmer but I assume you do understand Scala?
   Or else it is pointless to use Lift as it is based on the Scala language 
   and
   relies heavily on its features. Knowledge of Java is also a plus cause 
   some
   of the libs are not available in Scala but only in Java and it is better 
   to
   know Java in order to understand the libraries.
   2. You do have experience with websites? Complex web applications? If not
   then I suggest you start by doing a simple static page for your design to
   get to know the technics you are trying to use or you get yourself a
   programmer/webdesinger to do it for you. If you are not willing to learn
   about the technical details you will get in big trouble later on and I 
   mean
   trouble that can actually cost you money.
   3. If the above points do not seem valid for you then please get
   professional help
   4. If you are not scared by the above points and you are willing to invest
   then I suggest getting some example code and starting to disect that.
   Take a look athttp://github.com/tjweir/pocketchangeappwhichis a
   complete demo app in lift
   and take a look athttp://github.com/tjweir/liftbookfora liftbook that
   is available freely.

   Regards and good luck on your project

   Stefan

   2009/10/5 koveen liep...@xs4all.nl

   hi Naftoli,

   thanks for your interest.

   On Oct 5, 10:50 pm, Naftoli Gugenheim naftoli...@gmail.com wrote:
Being a non-programmer, and additionally not having a Java background,
which framework are you comparing Lift to when you say it's not easy?
:)

   First I read a book about rails, explaining things from the start, I
   did watch quite a lot of nice video's on the web explaining some basic
   tricks with Rails. I think it is a system that is easy to start with
   but I became 

[Lift] Naming CometActors

2009-10-06 Thread Jack Widman
So if give a  CometActor a static name, say Other, then every request will
get the same running instance of the CometActor. But if I name it
dynamically, say with a random string, each request will get its own
instance of the CometActor. Right?
-- 
Jack

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



[Lift] Re: lift nearly inaccessible for newby

2009-10-06 Thread Randinn

For the large part, I agree, the level of questions even I know is
geingt a bit too much, and the amount of patience you all use
answering them even though you know you just answered that a week ago
is commendable. That said you commiters don't have time to waste
answering those questions, that's what we are for :) and it is
happening. There are people here that are not commiters that are
answering those questions and others. I've been a lurker here for over
a year and even I am answering an occasional answer.

Maybe writing what you understand into the Wiki should be promoted
more, mention it on the title pages of lift, maybe even bring in a
commiter or two in with the express idea they are working on the Docs/
wiki. Bring in some support crew so the commiters only have to worry
about committing :)

 Personal Opinion:
 To be fair to Lift commit team, there is quite a bit of example code
 online for people to check out, but I'm not convinced they are
 actually looking at it.  Given the number of questions that come in
 that are easily solved with a Google Search, I don't know how pumping
 out more and more docs and examples will help, as it seems largely
 ignored.



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



[Lift] Goat Rodeo

2009-10-06 Thread Tim Dion

Hi All,

Can anyone tell me how Goat Rodeo is coming along? I am interested in
working on a transaction processing engine. Can anyone tell me how to
contribute to this project. By the way, I have worked done a lot of
work with GemStone, which is a Transactional Memory based Object
Oriented Database and application engine written in Smalltalk.


   Thanks,

Tim Dion

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



[Lift] Re: Goat Rodeo

2009-10-06 Thread David Pollak
Tim,
Goat Rodeo is #5 on my priority list, but #'s 1-3 have been consuming all my
time.  I've committed to a Goat Rodeo preso at November BASE (Bay Area
Scala Enthusiasts), so it's gotta bubble up.

When I've got enough stuff out of my head and into code, I'll be happy to
invite collaborators.  Also, if you have a project in mind and requirements,
that would help as well.

Thanks,

David

On Tue, Oct 6, 2009 at 12:41 PM, Tim Dion tim_d...@yahoo.com wrote:


 Hi All,

 Can anyone tell me how Goat Rodeo is coming along? I am interested in
 working on a transaction processing engine. Can anyone tell me how to
 contribute to this project. By the way, I have worked done a lot of
 work with GemStone, which is a Transactional Memory based Object
 Oriented Database and application engine written in Smalltalk.


   Thanks,

Tim Dion

 



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



[Lift] Re: What am I doing wrong?

2009-10-06 Thread Ross Mellgren

In your bind, you don't capture the nodes inside games:show, so the  
inner bind is binding the same nodes as the outer bind.

Change:

bind(games, html,
  show - gameMap.values.toList.flatMap 

to:

bind(games, html,
  show - { (html: NodeSeq) = gameMap.values.toList.flatMap ...


Here is a working version: http://github.com/Dridus/rickr-lift-test

-Ross

On Oct 6, 2009, at 3:28 PM, Rick R wrote:

 My clipboard seems to have broken, so I'm attaching the index.html


 On Tue, Oct 6, 2009 at 2:57 PM, Ross Mellgren dri...@gmail.com  
 wrote:
 I'd have to see your revised template, since I don't see games:show  
 there, but this error indicates that you're not within a bind --  
 usually because you're not in a snippet when you think you are, or  
 when you're using a bound prefix inside some other bind. What does  
 your template look like?

 -Ross



 On Oct 6, 2009, at 2:47 PM, Rick R wrote:

 Actually.. I'm running into a similar problem, this time it is  
 dispatching correctly, but failing when rendering games.show.

 XML Parsing Error: prefix not bound to a namespace
 Location: http://localhost:8080/
 Line Number 20, Column 7:  games:show
  --^

   def dispatch = {
 case list = list
 case add = addGame
   }

   def list(html: NodeSeq) : NodeSeq =
 bind(games, html,
show - gameMap.values.toList.flatMap
 { gm = bind(game, html, id - Text(gm.getId),  
 name - Text(gm.getName) ) }




 On Tue, Oct 6, 2009 at 1:21 PM, Rick R rick.richard...@gmail.com  
 wrote:
 Geez. I knew I was overlooking something stupid. Thanks for your  
 help.



 On Tue, Oct 6, 2009 at 11:49 AM, Ross Mellgren dri...@gmail.com  
 wrote:

 You are using a dispatch snippet, which means the name after . in
 the lift tag is passed to the dispatch method of your snippet, rather
 than using reflection to find a method with the same name. So, you
 need to add:

 case addGame = addGame

 to your  def dispatch

 -Ross

 On Oct 6, 2009, at 11:19 AM, Rick R wrote:

  I have added a mapping of game_state to the DispatchSnippet
  GameState. This works for game_state.list, but fails for
  game_state.addGame, shown below.
  What did I screw up this time?
 
 
  WARN - Snippet Failure: SnippetFailure(/ - ParsePath(List
  (index),,true,false),Full(game_store.addGame),Stateful Snippet:
  Dispatch Not Matched)
 
 
 
  lift:surround with=default at=content
 
lift:game_store.list
div id=game_list
 
  ul
game:list
 ligame:idgid/game:id game:namegname/game:name/li
 
/game:list
  /ul
/div
 
/lift:game_store.list
lift:game_store.addGame form=post
 
  div
hr/
  p
 
  Create a new game:
  /p
  pName
 
  game:nomName/game:nom
  /p
 
p
game:submit
  buttonCreate/button
 
  /game:submit
  /p
  /div
 
/lift:game_store.addGame
 
  /lift:surround
 
 
 
 
 
  class Boot {
def boot {
  // where to search snippet
 
  LiftRules.addToPackages(com.redlemurgames)
 
  LiftRules.snippetDispatch.append(
 
Map(game_store - GameStore)
  )
 
 
  val entries = Menu(Loc(Home, List(index), Home)) :: Nil
 
  LiftRules.setSiteMap(SiteMap(entries:_*))
 
 
}
 
 
  object GameStore extends DispatchSnippet {
 
private val gameMap = new HashMap[String, Game]
 
 
def dispatch = {
  case list = list
 
}
 
def list(html: NodeSeq) : NodeSeq =
 
  bind(game, html,
   list - gameMap.values.toList.flatMap
 
  { gm = bind(game, html, id - Text(gm.getId),
  name - Text(gm.getName) ) }
 
  )
 
 
def addGame(form: NodeSeq) : NodeSeq = {
 
  val id = randomString(12)
  var gname : String = 
 
 
 
  def checkAndSave(): Unit =  if (gname.isEmpty)
 
 {  S.error(String cannot be
  empty) ; S.mapSnippet(game_store.add, doBind) }
 
 {  val ngame = new Game(id,
  gname, new HashSet[(String, Actor)]);
 
gameMap += id - ngame;
ngame ! Init();
 
S.notice(Added +
  ngame.getName) }
 
 
 
  def doBind(form: NodeSeq) : NodeSeq = {
 
println(doBind was called)
bind(game, form,
 
 nom - text(gname, gname = _),
 
 submit - submit(New, checkAndSave))
 
  }
  doBind(form)
}
 
  


 




 index.html


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

[Lift] Re: lift nearly inaccessible for newby

2009-10-06 Thread Stefan Langer
I didn't want to discourage you I just wanted to be honest and please do
come back with any question you have as we learn by asking. But at the same
time as was said in this thread already take the time to expriment and use
the resources that are there (google and the like) to come up with the
answers yourself. As you do this you will start to understand stuff more and
more and things will get easier.

With the professional help I simply ment that if you have a short time to
market then you will not get happy with experimenting and you might consider
paying someone (a professional) or finding someone who will do it for you
since the other way is going to cost you a lot of time.

About what David Pollak said:
I think he does a great job designing and maintaining lift but I still think
without knowing Scala it is virtually impossible to come to grips with Lift
no matter how easy it is to set it up.
Learning a programming language with no programming background is quite a
job, and in my opinion well worth it, but a long term commitment is
required.

About the comment with Rails... not too sure if Rails or Lift is easier or
they are the same. I have experience with Rails and I love the Ruby syntax
which I think is a tad better then Scalas so I find Rails still a tad easier
but that is because of lack of experience with Lift.
If I wouldn't take Lift serious I wouldn't be here and spend my time
learning it. I just do not want you to think that you can simply grab lift
and understand it immediately.

One more thing about the documentation of Lift. The biggest problem I had
when starting was that there is no easy link to a workable Lift demo except
for the maven archetype and that is just not complex enough for learning
purposes. Thank god to github and the likes the applications to checkout are
getting more. Still I think it would be great if the Lift website had a
download for an application like the Java PetStore or the like for beginners
to study.
Befor anyone thinks I'm starting a rant here this is just a suggestion and
if I can find the time besides all the other pet projects of mine ;) I might
just start a demo app.

Regards
Stefan

2009/10/6 koveen liep...@xs4all.nl


 Stefan,

 thanks for your reply. :)

 to anwser your questions: I have no experience with Java and I only
 made some very simple static websites, years ago. I will try to listen
 to you and try to make a very simple website with Lift. But if -IF-
 I've succeeded in doing that, I hope you will excuse me when I'll come
 back to ask again the -too complex- question in my mail.

 I am not sure if what you are referring to if you mention the
 professional help I should get, but Yes! I am not really happy trying
 things out that don't seem to work for me up till now. So shrink or
 programmer, any help is welcome! (For now I think I will experiment
 with some simple things on my own)

 I know the online liftbook, and I am reading it. I bought the
 Beginning Scala book from David Pollak, and haven't read that much
 yet, but I will.

 Cheers,

 Ko





 On Oct 6, 11:52 am, Stefan Langer mailtolan...@googlemail.com wrote:
  Not ment as a offence but you are in way over your head!
  A couple of things:
  1. You say you are a non-programmer but I assume you do understand Scala?
 Or
  else it is pointless to use Lift as it is based on the Scala language and
  relies heavily on its features. Knowledge of Java is also a plus cause
 some
  of the libs are not available in Scala but only in Java and it is better
 to
  know Java in order to understand the libraries.
  2. You do have experience with websites? Complex web applications? If not
  then I suggest you start by doing a simple static page for your design to
  get to know the technics you are trying to use or you get yourself a
  programmer/webdesinger to do it for you. If you are not willing to learn
  about the technical details you will get in big trouble later on and I
 mean
  trouble that can actually cost you money.
  3. If the above points do not seem valid for you then please get
  professional help
  4. If you are not scared by the above points and you are willing to
 invest
  then I suggest getting some example code and starting to disect that.
  Take a look athttp://github.com/tjweir/pocketchangeappwhich is a
 complete
  demo app in lift
  and take a look athttp://github.com/tjweir/liftbookfor a liftbook that
 is
  available freely.
 
  Regards and good luck on your project
 
  Stefan
 
  2009/10/5 koveen liep...@xs4all.nl
 
 
 
   hi Naftoli,
 
   thanks for your interest.
 
   On Oct 5, 10:50 pm, Naftoli Gugenheim naftoli...@gmail.com wrote:
Being a non-programmer, and additionally not having a Java
 background,
which framework are you comparing Lift to when you say it's not easy?
:)
 
   First I read a book about rails, explaining things from the start, I
   did watch quite a lot of nice video's on the web explaining some basic
   tricks with Rails. I think it is a system 

[Lift] Re: Why fields are declared as 'object' with Mapper/Record?

2009-10-06 Thread Stefan Scott

I hope I don't wander too far off-topic here as I wend my way to the
question at the end of this post (would it be useful to look at
something like the OWL/SWRL web ontology and rule languages for
liftweb?).

I tend to generalize/abstract a lot - so if anyone with a theoretical
bent is willing to peruse the following, I would appreciate any
feedback as to whether it could be applicable to liftweb.

Basically I just want to wonder out loud here whether support in
liftweb for some of the specific ideas referenced in this thread
(particularly the keeping the meaning with the bytes thing) could be
helped along by looking at some possibly related theoretical work
being done involving contexts and policies for web services, eg here:

http://www.csee.umbc.edu/swpw/papers/
PDF! - http://www.csee.umbc.edu/swpw/papers/denker.pdf

Some of this admittedly theoretical work from this particular
conference is being implemented in machine-executable languages (eg,
Maude) which are also fortunately quite close to Scala, thanks to
Scala's support for both the functional and the object-oriented
programming paradigms. (Maude is similar to Haskell and ML, which are
sometimes also compared to Scala.)

This means that it might be quite straightforward to map any needed
portions of this related theoretical work on policies and contexts for
web services from languages such as Maude to liftweb in a fairly
straightforward manner.


((Full disclosure: Maude is one of the few languages I know and use,
eg for conceptual data modeling of entity-relationship databases:

http://www.springerlink.com/content/35gxk6g83vn6q648/

I mention this mainly to show that although I'm still a relative
newbie when it comes to web frameworks - particularly regarding
security - I do have some background in specification of databases
with contraints which I hope could somehow be applicable to database-
oriented programming in liftweb.))


I was intrigued by the 2006 post by DP mentioned upthread:

http://blog.lostlake.org/index.php?/archives/19-Keeping-the-meaning-with-the-bytes.html

where he suggests some excellent web framework design principles:

- The semantic meaning of fields on objects should be retained
throughout the field's life.

- Conversion to a semantic-free format (String, double, etc.) should
be done as late in the field's life-cycle (e.g., a String returned
from 'render as HTML') as possible.

- Every field of every object {should} be semantically meaningful.

- - getSSN() returns an object of SSN class that derives from
Taxpayer class that derives from SensitiveIndentifyingInformation
class.

- - the toHtml() method on the SSN class returns '***-**-' unless
the context in which the SSN is being accessed has permissions /
grants permissions to see more.

- All pieces of the object are defined in a central place.


It would just seem that the above-postulated central place could be
(built using some of the rich facilities provided by) Scala's type
system itself - perhaps even neatly packaged into a kind of liftweb
MOP (meta object protocol, like CLOS added to Lisp), or presented as
a DSL (domain-specific language).


The road from design-time to run-time is of course a sequence of
stages where abstraction is concretized and type info is erased - as
we move from an SSN, to a String, and eventually to a bunch of pixels
on the screen.

I would think that the line could be drawn so that the web framework
always knows that something is an SSN. I don't know enough about
JVMs to understand if or when this kind of type info is eventually
erased - but I understand that it's important that a level of
abstraction should be provided to the end-programmer using a web
framework where this type info is always available, enabling centrally
specified policies to make the web app just do the right thing
depending on the particular context.


Coming back to the problem of providing a completely general framework
for specifying policies and contexts: Would any of the theoretical
papers from, say, this conference:

http://www.csee.umbc.edu/swpw/papers/

provide any useful pointers as to how to approach this?

I'm not sure if the implementation languages there seem too ivory-
tower, or the conceptual languages there sound too designed by
committee (eg, OWL/SWRL), in the eyes of liftweb committers and
programmers who might be quite understandably up to their necks in
hands-on issues like cross-site scripting attacks etc. But formal,
theoretical stuff can have its place, since:

(a) Scala itself is based on a rigorous theoretical, formal foundation

(b) tools supporting checking of programs written in commercial/
industrial languages (eg, Erlang) are now being written in formal/
academic languages (eg, Maude):

(WARNING - PS file!) 
http://www-i2.informatik.rwth-aachen.de/old/Staff/Current/neuhaeusser/publications/wrla06.ps


And Scala's fuctional/object-oriented paradigms and very rich type
system (making Scala very close to many formal/academic 

[Lift] Re: Why fields are declared as 'object' with Mapper/Record?

2009-10-06 Thread David Pollak
On Tue, Oct 6, 2009 at 10:16 AM, Oleg G. ojo...@gmail.com wrote:


 As i said before i'm not sure that i'm getting the whole picture and
 maybe my initial question is incorrect in its root. Still:

 Suppose i have a Person class declared with Mapper/Record and i want
 to reuse the class and all the code associated with it in another
 module/project. My first thought was to extend the Person class and
 override some of its fields by mixing in some additional traits (see
 my simplified example code in the initial message). But i noticed that
 inner objects cannot be overriden (its not obvious for me but i can
 get it if i dig it).


You can't do this.  There was a Scala language feature that would have
allowed this (overriding an object) but it hasn't made the cut for 2.7 or
2.8.



 So how do i reuse Mapper/Record based code if i need to extend/
 customize the data structures?


Unfortunately, you can't.  Once you've got a field defined, there's nothing
you can do to change it in a subclass.



 On Oct 6, 11:59 pm, David Pollak feeder.of.the.be...@gmail.com
 wrote:
  On Tue, Oct 6, 2009 at 9:50 AM, Oleg G. ojo...@gmail.com wrote:
 
   Thanks for all the answers and especially for David's clarification.
   It would be really cool to upgrade the 'keeping the meaning with the
   bytes' thing (http://blog.lostlake.org/index.php?/archives/19-Keeping-
   the-meaning-with-the-bytes.html) to allow extension/customization.
 
  What kind of extensions/customizations?
 
  MappedXXX can all be subclassed, extended and customized.

 



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



[Lift] Re: maven and jetty

2009-10-06 Thread MarkChance

I use mvn -Djetty.port=8090 jetty:run
It builds the war and then runs jetty.  If you leave it running and re-
build the war, say in your IDE, the Jetty generally restarts
automatically.

HTH, Mark

On Oct 5, 8:44 pm, Jack Widman jack.wid...@gmail.com wrote:
 Well it seems that mvn run-war is creating the war and overriding the one I
 just uploaded. How do I just run with a given war and not create the war.


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



[Lift] Re: maven and jetty

2009-10-06 Thread Jack Widman
I thought run uses classes and run-war uses the war. no?

On Tue, Oct 6, 2009 at 4:54 PM, MarkChance mark.cha...@gmail.com wrote:


 I use mvn -Djetty.port=8090 jetty:run
 It builds the war and then runs jetty.  If you leave it running and re-
 build the war, say in your IDE, the Jetty generally restarts
 automatically.

 HTH, Mark

 On Oct 5, 8:44 pm, Jack Widman jack.wid...@gmail.com wrote:
  Well it seems that mvn run-war is creating the war and overriding the one
 I
  just uploaded. How do I just run with a given war and not create the war.
 

 



-- 
Jack

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



[Lift] Re: Overriding date/time formatting

2009-10-06 Thread Jeppe Nejsum Madsen

Dirk Louwers dirk.louw...@stormlantern.nl writes:

 Hi,

 After having toyed around with Scala and recently Lift for a few weeks
 I have a question. To avoid jumping to conclusions let me first
 explain what I am trying to achieve:

 I am not happy with the way MappedDateTime parses strings and formats
 dates by default. I want to be able to change these parsers/formatters
 globally and/or on a per mapper field basis.

 Here is what I did:

 By looking at the sourcecode I noticed that following MappedDateTime
 ultimately this depends on internetDateFormatter, dateFormatter and
 toInternetDate inside TimeHelpers. Since I don't know how to change
 the dependency of MappedDateTime on TimeHelpers to a subclass of
 TimeHelpers I decided to break the dependency by subclassing
 MappedDateTime and overriding _toForm and setFromAny and have my
 setFromAny call a modified toDate that in turn depends on a custom
 function to parse a string to a date. This function:
 1) Tries to use a specifically definded DateFormat on the field
 2) Tries to get a dateformat from a localized bundle
 3) Falls back to the SHORT date format of the JVM locale.

 Here is what I would like to know:

 1) Is there a way to have Lift use a TimeHelpers subclass without
 having to subclass stuff that depends on it?
 2) Does anyone have suggestions how to improve/invalidate my approach?

 Just checking to see if I am on the right path or making this
 needlessly hard.
 Thanks in advance for any response.

Sounds like you're using 1.0? In 1.1-SNAPSHOT, date/time
parsing/formatting is done in LiftRules.parseDate/formatDate and can be
changed. Not quite per field flexibility though

I think that this is also not locale specific (ie. per request), but
haven't looked too closely at this yet

/Jeppe

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



[Lift] Re: maven and jetty

2009-10-06 Thread Timothy Perrett
Correct. :run uses the stuff under src/main/webapp vs :run-war that  
uses what is bundled in the war (surprise surprise!)

This should all be explained in the maven-jetty-plugin docs as this is  
not something lift specific by any means.

Cheers, Tim

Sent from my iPhone

On 6 Oct 2009, at 21:57, Jack Widman jack.wid...@gmail.com wrote:

 I thought run uses classes and run-war uses the war. no?

 On Tue, Oct 6, 2009 at 4:54 PM, MarkChance mark.cha...@gmail.com  
 wrote:

 I use mvn -Djetty.port=8090 jetty:run
 It builds the war and then runs jetty.  If you leave it running and  
 re-
 build the war, say in your IDE, the Jetty generally restarts
 automatically.

 HTH, Mark

 On Oct 5, 8:44 pm, Jack Widman jack.wid...@gmail.com wrote:
  Well it seems that mvn run-war is creating the war and overriding  
 the one I
  just uploaded. How do I just run with a given war and not create  
 the war.
 





 -- 
 Jack

 

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



[Lift] Re: maven and jetty

2009-10-06 Thread Jack Widman
I am picking up a very subtle insinuation that that question was too easy
for this forum. I agree whole heartedly. Won't do it again. My next question
is - Is P=NP?  No wait, thats not appropriate.

On Tue, Oct 6, 2009 at 5:07 PM, Timothy Perrett timo...@getintheloop.euwrote:

 Correct. :run uses the stuff under src/main/webapp vs :run-war that uses
 what is bundled in the war (surprise surprise!)

 This should all be explained in the maven-jetty-plugin docs as this is not
 something lift specific by any means.

 Cheers, Tim

 Sent from my iPhone

 On 6 Oct 2009, at 21:57, Jack Widman jack.wid...@gmail.com wrote:

 I thought run uses classes and run-war uses the war. no?

 On Tue, Oct 6, 2009 at 4:54 PM, MarkChance  mark.cha...@gmail.com
 mark.cha...@gmail.com wrote:


 I use mvn -Djetty.port=8090 jetty:run
 It builds the war and then runs jetty.  If you leave it running and re-
 build the war, say in your IDE, the Jetty generally restarts
 automatically.

 HTH, Mark

 On Oct 5, 8:44 pm, Jack Widman jack.wid...@gmail.com wrote:
  Well it seems that mvn run-war is creating the war and overriding the
 one I
  just uploaded. How do I just run with a given war and not create the
 war.
 





 --
 Jack



 



-- 
Jack

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



[Lift] Re: Override the display names for (Mega)ProtoUser

2009-10-06 Thread Jeppe Nejsum Madsen

Heiko Seeberger heiko.seeber...@googlemail.com writes:

 Hi,
 It is not possible to localize or override the display names for
 (Mega)ProtoUser's first name, last name and time zone. This is because it is
 determined by ??(First Name) and analogous, with First Name (with a
 blank) not a valid key for a PropertyResourceBundle.

 Am I missing something? Or should I file a bug?

I think you're missing something :-)

I had the same issue. Some studying of
http://java.sun.com/j2se/1.4.2/docs/api/java/util/Properties.html#load%28java.io.InputStream%29

leads to this explanation: The key contains all of the characters in the line 
starting
with the first non-white space character and up to, but not including,
the first unescaped '=', ':', or white space character other than a line
terminator. All of these key termination characters may be included in
the key by escaping them with a preceding backslash character


And, while not very intuitive, this works for me:

First\ Name = Fornavn
Last\ Name = Efternavn

/Jeppe

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



[Lift] Re: [scala] EclipseLink?

2009-10-06 Thread Meredith Gregory
Dear Ismael,

Prompted by this thread i did some digging and saw that in the attempt to
move from hibernate to toplink to eclipselink i had not consistently
switched from toplink to eclipselink. So, i'm now getting the download to
work. Thanks again. BTW, i wonder if you know whether eclipselink has
equivalents to the maven-hibernate targets for generating ddl and such.

Best wishes,

--greg

On Tue, Oct 6, 2009 at 1:25 PM, Ismael Juma mli...@juma.me.uk wrote:

 On Tue, 2009-10-06 at 09:47 -0700, Meredith Gregory wrote:
  Dear Ismael,
 
  i got buried under some other work and forgot to thank you for this
  note. If you look further down on the web page you referenced you will
  see that the pom.xml snippets they include have the characters escaped
  as you suggested. i cut and pasted these into my pom.xml for my
  experiments and the download failed.

 That is strange as I have been using that repository for many months
 now.

 Ismael




-- 
L.G. Meredith
Managing Partner
Biosimilarity LLC
1219 NW 83rd St
Seattle, WA 98117

+1 206.650.3740

http://biosimilarity.blogspot.com

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



[Lift] Bind with a map collection

2009-10-06 Thread rstradling

Hello everyone,
I have the following code...
case class item(name : String)
class demo {
  def exampleFour(xhtml : NodeSeq) : NodeSeq = {
val map = Map(Test - List(item(1), item(2), item(3)),
  Vehicles - List(item(Bike), item(Automobile))
  )
val articles = List(
article(A bunch of text, List(tag(Health),
tag(Hurt))),
article(BODY, List(tag(Coming)))
)
map.flatMap(a = bind(a, xhtml,
  body - Text(a._1),
  tags - a._2.flatMap(t =
bind(t, chooseTemplate(tag, list, xhtml),
  name - Text(t.name))
)
  )
)
  }
}

And I get this error message...
C:\Java\helloworld\src\main\scala\demo\helloworld\snippet\demo.scala:
46: error: type mismatch;
 found   : Iterable[scala.xml.Node]
 required: scala.xml.NodeSeq
map.flatMap(a = bind(a, xhtml,
^
one error found

I am not sure how to get around this.  I realize I have different
types but am not sure how they are related and how to convert one to
the other.  I googled for some answers and found stuff related to
Scala 2.8 but am not sure that applies to my situation.

I am using Scala 2.7.5 and Lift 1.1-M5.

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



[Lift] Re: Bind with a map collection

2009-10-06 Thread David Pollak
try tacking a .toList on after the flatMap() expression.

On Tue, Oct 6, 2009 at 3:19 PM, rstradling ryanstradl...@gmail.com wrote:


 Hello everyone,
 I have the following code...
 case class item(name : String)
 class demo {
  def exampleFour(xhtml : NodeSeq) : NodeSeq = {
val map = Map(Test - List(item(1), item(2), item(3)),
  Vehicles - List(item(Bike), item(Automobile))
  )
val articles = List(
article(A bunch of text, List(tag(Health),
 tag(Hurt))),
article(BODY, List(tag(Coming)))
)
map.flatMap(a = bind(a, xhtml,
  body - Text(a._1),
  tags - a._2.flatMap(t =
bind(t, chooseTemplate(tag, list, xhtml),
  name - Text(t.name))
)
  )
)
  }
 }

 And I get this error message...
 C:\Java\helloworld\src\main\scala\demo\helloworld\snippet\demo.scala:
 46: error: type mismatch;
  found   : Iterable[scala.xml.Node]
  required: scala.xml.NodeSeq
map.flatMap(a = bind(a, xhtml,
^
 one error found

 I am not sure how to get around this.  I realize I have different
 types but am not sure how they are related and how to convert one to
 the other.  I googled for some answers and found stuff related to
 Scala 2.8 but am not sure that applies to my situation.

 I am using Scala 2.7.5 and Lift 1.1-M5.

 Thanks for the help.
 



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



[Lift] Re: Bind with a map collection

2009-10-06 Thread Naftoli Gugenheim

Or toSeq instead of toList. And if it still doesn't work surround it with 
NodeSeq.fromSeq(toSeq)

-
David Pollakfeeder.of.the.be...@gmail.com wrote:

try tacking a .toList on after the flatMap() expression.

On Tue, Oct 6, 2009 at 3:19 PM, rstradling ryanstradl...@gmail.com wrote:


 Hello everyone,
 I have the following code...
 case class item(name : String)
 class demo {
  def exampleFour(xhtml : NodeSeq) : NodeSeq = {
val map = Map(Test - List(item(1), item(2), item(3)),
  Vehicles - List(item(Bike), item(Automobile))
  )
val articles = List(
article(A bunch of text, List(tag(Health),
 tag(Hurt))),
article(BODY, List(tag(Coming)))
)
map.flatMap(a = bind(a, xhtml,
  body - Text(a._1),
  tags - a._2.flatMap(t =
bind(t, chooseTemplate(tag, list, xhtml),
  name - Text(t.name))
)
  )
)
  }
 }

 And I get this error message...
 C:\Java\helloworld\src\main\scala\demo\helloworld\snippet\demo.scala:
 46: error: type mismatch;
  found   : Iterable[scala.xml.Node]
  required: scala.xml.NodeSeq
map.flatMap(a = bind(a, xhtml,
^
 one error found

 I am not sure how to get around this.  I realize I have different
 types but am not sure how they are related and how to convert one to
 the other.  I googled for some answers and found stuff related to
 Scala 2.8 but am not sure that applies to my situation.

 I am using Scala 2.7.5 and Lift 1.1-M5.

 Thanks for the help.
 



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



[Lift] Re: Binding a snippet in a comet actor?

2009-10-06 Thread Naftoli Gugenheim

What about an Ajax form?

On Tue, Oct 6, 2009 at 9:52 AM, Somindra  Bhattacharya
somind...@gmail.com wrote:

 Hi Everyone,

 I have a comet actor that binds XHTML. The XHTML corresponds to a
 snippet:

 XHTML for comet actor -

  lift:comet type=RCActor
    Act:act /
  /lift:comet

 When the comet actor receives a certain message, the render method of
 the comet actor binds the following XHTML -

    lift:Discuss.invite form=post
       elem:submit /
    /lift:Discuss.invite

 The Discuss snippet's invite method definition is:

  def invite(xhtml: NodeSeq): NodeSeq =
  {

     def handleSubmit() =
     {
        Log.info(GOT A SUBMIT IN INVITE)
     }

     bind(elem, xhtml,
         submit - submit(Click, () = handleSubmit()))
  }

 The page does not contain this form when it is first loaded. When the
 actor receives a certain message, it binds the XHTML (Discuss.invite)
 to the page and the form and the submit button are rendered
 properly.

 However, when I click on the submit button, the handleSubmit method
 is not called. Instead, the browser displays a page with the text
 window.location=/.
 If I use the browser back button and re-visit the page with the comet
 actor, the submit button works (i.e., handleSubmit() is called and I
 can see the info log).

 Is this approach legal? Is there a way to make a form submit if it
 was not originally part of the page?

 Thanks,
 Som

 


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



[Lift] Re: Need two classes to inherit from one model, database design and view issues

2009-10-06 Thread Naftoli Gugenheim

Here's some code I used when two tables share some fields and their
Mappers can share a base trait. I have Fields which have difference
Types, some of which reference lookup tables.

trait BaseLookupTable[T:LongKeyedMapper[T]] {this: T =
  object field extends LongMappedMapper(this: T, Field)
  object label extends MappedString(this: T, 100)
}

class LookupTable extends LongKeyedMapper[LookupTable] with
BaseLookupTable[LookupTable] with IdPK {
  def getSingleton = LookupTable
  object sort extends MappedInt(this)
}
object LookupTable extends LookupTable with LongKeyedMetaMapper[LookupTable]

class RangeLookupTable extends LongKeyedMapper[RangeLookupTable] with
BaseLookupTable[RangeLookupTable] with IdPK {
  def getSingleton = RangeLookupTable
  object value extends MappedInt(this)
}
object RangeLookupTable extends RangeLookupTable with
LongKeyedMetaMapper[RangeLookupTable]



And here's how I get the lookup table for a given type.

class Field extends LongKeyedMapper[Field] with IdPK {
  def getSingleton = Field
  ...
  object fieldType extends MappedEnum(this, Field.Types)
}
object Field extends Field with LongKeyedMetaMapper[Field] {
  ...
  object Types extends Enumeration {
val Boolean = Value(Checkbox)
val Int = Value(Number)
val Lookup = Value(General Lookup)
val RangeLookup = Value(Range Lookup)

def lookupTable(v: Field.Types.Value): Option[BaseLookupTable[T]
forSome{type T :net.liftweb.mapper.Mapper[T]}] = v match {
  case Lookup = Some(LookupTable)
  case RangeLookup = Some(RangeLookupTable)
  case _ = None
}
  }
}


On Tue, Oct 6, 2009 at 10:15 AM, Jim Barrows jim.barr...@gmail.com wrote:



 On Oct 2, 7:55 pm, Dave davidtgoldb...@gmail.com wrote:
 Hi all-

 I posted this on stackoverflow but I figure its probably relevant here
 too.  I checked out the post with David and Steve Yen corresponding
 but I am still at a loss and am curious if any progress has been made
 in this direction.  So, here goes.  I am creating a website which will
 need two types of users: students and providers. In a traditional java
 setting I would create a user class (or interface) and then create two
 classes which inherited from the user. Is this the best course in
 scala too, using the extends and with modifiers? If that is indeed
 the best way (which I suspect it is), what the best way to map this in
 the DB? Would it be best to keep a type column and then have it set
 to one or the other?  Etc.

 A student is not a kind of user, nor is a provider.  They are roles
 that a user plays in your system.
 While your business rules may state that this is not possible, it is
 possible in the real world.  That's what's best to model, since
 business rules can change quite easily.
 I can even make an argument that Person has user as role, and that
 there are two types of users.


 The second question is how to work with the view. The display will be
 very different depending on which type of user one is and so I figure
 there will be some serious routing logic involved or at least logic
 built into snippets in the view.

 Why not use 3 directories, one for common stuff, one for the provider
 and one for the student.
 Reduces the number of if statements that way.


 I guess the overarching question is: Is there a preferred way to go
 about doing this (like a recipe in rails or some such), or am I kind
 of out on my own?

 Thanks

 


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



[Lift] Re: How can I pass the result of Xml.toJson to JsonResponse

2009-10-06 Thread Naftoli Gugenheim

Which modules will be dependent on lift-json?


On Tue, Oct 6, 2009 at 11:17 AM, David Pollak
feeder.of.the.be...@gmail.com wrote:
 Please open a ticket for this.  We need to get the rest of Lift playing well
 with Joni's excellent JSON library.

 On Tue, Oct 6, 2009 at 7:43 AM, glenn gl...@exmbly.com wrote:

 I want to pass the result of Xml.toJson to JsonResponse. How can I do
 that, when JsonResponse takes a JsExp as
 a parameter, not a JValue.

 Glenn




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



[Lift] Re: How to suppress / override / escape context path rewriting?

2009-10-06 Thread Derek Chen-Becker
I don't know of any way to do this currently. If no one else has any ideas,
I would open an issue.

Derek

On Tue, Oct 6, 2009 at 11:07 AM, Ross Mellgren dri...@gmail.com wrote:


 I'm deploying a Lift application into JBoss as another WAR alongside
 the rest of our application in a separate WAR, and I'm running into
 problems with the context path rewriting. I've deployed my WAR with an
 appropriate jboss-web.xml file which sets the context path to /myapp,
 and now I'd like to construct relative URLs that go out to the other
 WAR, e.g.

 a href=/mainapp/homeHome/a

 but Lift rewrites anything starting with / to have the context path,
 so instead I get

 a href=/myapp/mainapp/homeHome/a

 This is mostly the right thing, and I don't really want to disable it
 globally (especially because then the /ajax_request paths and so on
 would probably go wrong), but I'd really like a way to escape it. The
 only ways so far I've found are:

 1) Use /../mainapp/home, which rewrites to /myapp/../mainapp/home,
 which comes out right but seems pretty freaking ugly and depends on my
 context path only having one segment
 2) Use fully-qualified URLs. This has the problem that I can't easily
 construct these URLs in templates without having some kind of snippet
 that expands it for me.

 What I'd ideally like is some special syntax to escape context
 rewriting (e.g. //mainapp/home, or something else), or some guidance
 on how people usually accomplish this and so on.

 Any ideas? I'm using 1.1-SNAPSHOT.

 -Ross


 


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



[Lift] Re: How can I pass the result of Xml.toJson to JsonResponse

2009-10-06 Thread David Pollak
On Tue, Oct 6, 2009 at 5:13 PM, Naftoli Gugenheim naftoli...@gmail.comwrote:


 Which modules will be dependent on lift-json?


lift-webkit




 On Tue, Oct 6, 2009 at 11:17 AM, David Pollak
 feeder.of.the.be...@gmail.com wrote:
  Please open a ticket for this.  We need to get the rest of Lift playing
 well
  with Joni's excellent JSON library.
 
  On Tue, Oct 6, 2009 at 7:43 AM, glenn gl...@exmbly.com wrote:
 
  I want to pass the result of Xml.toJson to JsonResponse. How can I do
  that, when JsonResponse takes a JsExp as
  a parameter, not a JValue.
 
  Glenn
 
 
 
 
  --
  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
 
  
 

 



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



[Lift] Re: lift nearly inaccessible for newby

2009-10-06 Thread Naftoli Gugenheim

Maybe there should be a Wiki page filled with links for more
information, like How To: Get more information. It would be nice if
it (and the article titled Home--maybe it should have a better
name?) could somehow be the first article in the list.


On Tue, Oct 6, 2009 at 4:10 PM, Stefan Langer
mailtolan...@googlemail.com wrote:
 I didn't want to discourage you I just wanted to be honest and please do
 come back with any question you have as we learn by asking. But at the same
 time as was said in this thread already take the time to expriment and use
 the resources that are there (google and the like) to come up with the
 answers yourself. As you do this you will start to understand stuff more and
 more and things will get easier.

 With the professional help I simply ment that if you have a short time to
 market then you will not get happy with experimenting and you might consider
 paying someone (a professional) or finding someone who will do it for you
 since the other way is going to cost you a lot of time.

 About what David Pollak said:
 I think he does a great job designing and maintaining lift but I still think
 without knowing Scala it is virtually impossible to come to grips with Lift
 no matter how easy it is to set it up.
 Learning a programming language with no programming background is quite a
 job, and in my opinion well worth it, but a long term commitment is
 required.

 About the comment with Rails... not too sure if Rails or Lift is easier or
 they are the same. I have experience with Rails and I love the Ruby syntax
 which I think is a tad better then Scalas so I find Rails still a tad easier
 but that is because of lack of experience with Lift.
 If I wouldn't take Lift serious I wouldn't be here and spend my time
 learning it. I just do not want you to think that you can simply grab lift
 and understand it immediately.

 One more thing about the documentation of Lift. The biggest problem I had
 when starting was that there is no easy link to a workable Lift demo except
 for the maven archetype and that is just not complex enough for learning
 purposes. Thank god to github and the likes the applications to checkout are
 getting more. Still I think it would be great if the Lift website had a
 download for an application like the Java PetStore or the like for beginners
 to study.
 Befor anyone thinks I'm starting a rant here this is just a suggestion and
 if I can find the time besides all the other pet projects of mine ;) I might
 just start a demo app.

 Regards
 Stefan

 2009/10/6 koveen liep...@xs4all.nl

 Stefan,

 thanks for your reply. :)

 to anwser your questions: I have no experience with Java and I only
 made some very simple static websites, years ago. I will try to listen
 to you and try to make a very simple website with Lift. But if -IF-
 I've succeeded in doing that, I hope you will excuse me when I'll come
 back to ask again the -too complex- question in my mail.

 I am not sure if what you are referring to if you mention the
 professional help I should get, but Yes! I am not really happy trying
 things out that don't seem to work for me up till now. So shrink or
 programmer, any help is welcome! (For now I think I will experiment
 with some simple things on my own)

 I know the online liftbook, and I am reading it. I bought the
 Beginning Scala book from David Pollak, and haven't read that much
 yet, but I will.

 Cheers,

 Ko





 On Oct 6, 11:52 am, Stefan Langer mailtolan...@googlemail.com wrote:
  Not ment as a offence but you are in way over your head!
  A couple of things:
  1. You say you are a non-programmer but I assume you do understand
  Scala? Or
  else it is pointless to use Lift as it is based on the Scala language
  and
  relies heavily on its features. Knowledge of Java is also a plus cause
  some
  of the libs are not available in Scala but only in Java and it is better
  to
  know Java in order to understand the libraries.
  2. You do have experience with websites? Complex web applications? If
  not
  then I suggest you start by doing a simple static page for your design
  to
  get to know the technics you are trying to use or you get yourself a
  programmer/webdesinger to do it for you. If you are not willing to learn
  about the technical details you will get in big trouble later on and I
  mean
  trouble that can actually cost you money.
  3. If the above points do not seem valid for you then please get
  professional help
  4. If you are not scared by the above points and you are willing to
  invest
  then I suggest getting some example code and starting to disect that.
  Take a look athttp://github.com/tjweir/pocketchangeappwhich is a
  complete
  demo app in lift
  and take a look athttp://github.com/tjweir/liftbookfor a liftbook that
  is
  available freely.
 
  Regards and good luck on your project
 
  Stefan
 
  2009/10/5 koveen liep...@xs4all.nl
 
 
 
   hi Naftoli,
 
   thanks for your interest.
 
   On Oct 5, 10:50 pm, Naftoli Gugenheim 

[Lift] Re: Why fields are declared as 'object' with Mapper/Record?

2009-10-06 Thread Naftoli Gugenheim

What you can do if I'm not mistaken, although not as good, is define
in a base trait,
def myField: MappedXXX ...
and give different concrete object implementations. This way you have
a common type that guarantees the field.


On Tue, Oct 6, 2009 at 4:54 PM, David Pollak
feeder.of.the.be...@gmail.com wrote:


 On Tue, Oct 6, 2009 at 10:16 AM, Oleg G. ojo...@gmail.com wrote:

 As i said before i'm not sure that i'm getting the whole picture and
 maybe my initial question is incorrect in its root. Still:

 Suppose i have a Person class declared with Mapper/Record and i want
 to reuse the class and all the code associated with it in another
 module/project. My first thought was to extend the Person class and
 override some of its fields by mixing in some additional traits (see
 my simplified example code in the initial message). But i noticed that
 inner objects cannot be overriden (its not obvious for me but i can
 get it if i dig it).

 You can't do this.  There was a Scala language feature that would have
 allowed this (overriding an object) but it hasn't made the cut for 2.7 or
 2.8.


 So how do i reuse Mapper/Record based code if i need to extend/
 customize the data structures?

 Unfortunately, you can't.  Once you've got a field defined, there's nothing
 you can do to change it in a subclass.


 On Oct 6, 11:59 pm, David Pollak feeder.of.the.be...@gmail.com
 wrote:
  On Tue, Oct 6, 2009 at 9:50 AM, Oleg G. ojo...@gmail.com wrote:
 
   Thanks for all the answers and especially for David's clarification.
   It would be really cool to upgrade the 'keeping the meaning with the
   bytes' thing (http://blog.lostlake.org/index.php?/archives/19-Keeping-
   the-meaning-with-the-bytes.html) to allow extension/customization.
 
  What kind of extensions/customizations?
 
  MappedXXX can all be subclassed, extended and customized.





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



[Lift] Re: Overriding date/time formatting

2009-10-06 Thread Naftoli Gugenheim

Also more flexibility should be coming soon if I'm not mistaken. I
think there's a ticket and Derek is planning on working on it.

On Tue, Oct 6, 2009 at 4:59 PM, Jeppe Nejsum Madsen je...@ingolfs.dk wrote:

 Dirk Louwers dirk.louw...@stormlantern.nl writes:

 Hi,

 After having toyed around with Scala and recently Lift for a few weeks
 I have a question. To avoid jumping to conclusions let me first
 explain what I am trying to achieve:

 I am not happy with the way MappedDateTime parses strings and formats
 dates by default. I want to be able to change these parsers/formatters
 globally and/or on a per mapper field basis.

 Here is what I did:

 By looking at the sourcecode I noticed that following MappedDateTime
 ultimately this depends on internetDateFormatter, dateFormatter and
 toInternetDate inside TimeHelpers. Since I don't know how to change
 the dependency of MappedDateTime on TimeHelpers to a subclass of
 TimeHelpers I decided to break the dependency by subclassing
 MappedDateTime and overriding _toForm and setFromAny and have my
 setFromAny call a modified toDate that in turn depends on a custom
 function to parse a string to a date. This function:
 1) Tries to use a specifically definded DateFormat on the field
 2) Tries to get a dateformat from a localized bundle
 3) Falls back to the SHORT date format of the JVM locale.

 Here is what I would like to know:

 1) Is there a way to have Lift use a TimeHelpers subclass without
 having to subclass stuff that depends on it?
 2) Does anyone have suggestions how to improve/invalidate my approach?

 Just checking to see if I am on the right path or making this
 needlessly hard.
 Thanks in advance for any response.

 Sounds like you're using 1.0? In 1.1-SNAPSHOT, date/time
 parsing/formatting is done in LiftRules.parseDate/formatDate and can be
 changed. Not quite per field flexibility though

 I think that this is also not locale specific (ie. per request), but
 haven't looked too closely at this yet

 /Jeppe

 


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



[Lift] Re: Git wiki formatting

2009-10-06 Thread Naftoli Gugenheim

Anyone? Please?

On Mon, Oct 5, 2009 at 5:13 PM, Naftoli Gugenheim naftoli...@gmail.com wrote:
 Can someone please fix the formatting on
 http://wiki.github.com/dpp/liftweb/example-paginating-mapper-based-snippets-with-sortable-headers
 ?
 Thanks!


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



[Lift] Re: Git wiki formatting

2009-10-06 Thread Naftoli Gugenheim
Great, thanks!One line had been unindented, so I fixed that. I didn't reread
it too closely but it looks good.


On Tue, Oct 6, 2009 at 10:20 PM, Bryan germ...@gmail.com wrote:


 I added a blank line before the pre element.  It looks good now.
 Please verify.

 --Bryan

 On Tue, Oct 6, 2009 at 9:03 PM, Naftoli Gugenheim naftoli...@gmail.com
 wrote:
 
  Anyone? Please?
 
  On Mon, Oct 5, 2009 at 5:13 PM, Naftoli Gugenheim naftoli...@gmail.com
 wrote:
  Can someone please fix the formatting on
 
 http://wiki.github.com/dpp/liftweb/example-paginating-mapper-based-snippets-with-sortable-headers
  ?
  Thanks!
 
 
  
 

 


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



[Lift] Re: Override the display names for (Mega)ProtoUser

2009-10-06 Thread Heiko Seeberger
Jeppe,
You are my hero ;-)

Thanks,

Heiko

2009/10/6 Jeppe Nejsum Madsen je...@ingolfs.dk


 Heiko Seeberger heiko.seeber...@googlemail.com writes:

  Hi,
  It is not possible to localize or override the display names for
  (Mega)ProtoUser's first name, last name and time zone. This is because it
 is
  determined by ??(First Name) and analogous, with First Name (with a
  blank) not a valid key for a PropertyResourceBundle.
 
  Am I missing something? Or should I file a bug?

 I think you're missing something :-)

 I had the same issue. Some studying of

 http://java.sun.com/j2se/1.4.2/docs/api/java/util/Properties.html#load%28java.io.InputStream%29

 leads to this explanation: The key contains all of the characters in the
 line starting
 with the first non-white space character and up to, but not including,
 the first unescaped '=', ':', or white space character other than a line
 terminator. All of these key termination characters may be included in
 the key by escaping them with a preceding backslash character


 And, while not very intuitive, this works for me:

 First\ Name = Fornavn
 Last\ Name = Efternavn

 /Jeppe

 


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



[Lift] Mapper SQL issues w/ Oracle

2009-10-06 Thread pbridger

Hi all,

I've noticed a couple of SQL-generation problems when using lift
(1.0.2) with oracle (10.2, and using latest drivers).

Firstly, schemify fails on adding a column to a model:
INFO - ALTER TABLE table_name ADD COLUMN label VARCHAR(1000)
ERROR - Failed to Boot
java.sql.SQLException: ORA-00904: : invalid identifier

The correct syntax for this in oracle is:
ALTER TABLE table_name ADD label VARCHAR(1000)

Is this due to the oracle drivers not handling jdbc-standard sql?


Secondly, a CRUDify generated object list generates ORA-00933: SQL
command not properly ended.
What's the best way to log SQL executed by mapper?


Thanks!
Paul

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