Re: [Lift] BSON support in lift-json

2010-03-05 Thread Tim Nelson
I definitely agree with keeping the BSON code separate or possibly
having a strict JSON mode.

Tim

On Fri, Mar 5, 2010 at 12:13 PM, Timothy Perrett
 wrote:
> Probably a sub-ordinate module would be preferable... one  that builds on the 
> lift-json stuff and doesn't pollute the "normal" JSON usage.
>
> Joni, what are your thoughts?
>
> Cheers, Tim
>
> On 5 Mar 2010, at 17:59, Tim Nelson wrote:
>
>> I finally had the opportunity to look into the couchdb code and I must
>> say it is rather impressive.
>>
>> I would like to utilize the code in JSONRecord.scala in scamongo [1].
>> However, MongoDB uses a variation of JSON they call BSON, which they
>> actually just published a spec [2] for, due to interest outside of
>> MongoDB. Basically, it adds support for date, ObjectId [3], binary
>> data, regular expressions, and code (JavaScript) data types.
>>
>> My question is, what would it take to add support to lift-json for
>> these other data types? Is this even feasible?
>>
>> Thanks,
>> Tim
>>
>>
>> [1] http://github.com/eltimn/scamongo
>> [2] http://bsonspec.org/
>> [3] http://www.mongodb.org/display/DOCS/Object+IDs
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "Lift" group.
>> To post to this group, send email to lift...@googlegroups.com.
>> To unsubscribe from this group, send email to 
>> liftweb+unsubscr...@googlegroups.com.
>> For more options, visit this group at 
>> http://groups.google.com/group/liftweb?hl=en.
>>
>>
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to 
> liftweb+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/liftweb?hl=en.
>
>

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



[Lift] BSON support in lift-json

2010-03-05 Thread Tim Nelson
I finally had the opportunity to look into the couchdb code and I must
say it is rather impressive.

I would like to utilize the code in JSONRecord.scala in scamongo [1].
However, MongoDB uses a variation of JSON they call BSON, which they
actually just published a spec [2] for, due to interest outside of
MongoDB. Basically, it adds support for date, ObjectId [3], binary
data, regular expressions, and code (JavaScript) data types.

My question is, what would it take to add support to lift-json for
these other data types? Is this even feasible?

Thanks,
Tim


[1] http://github.com/eltimn/scamongo
[2] http://bsonspec.org/
[3] http://www.mongodb.org/display/DOCS/Object+IDs

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



Re: [Lift] setuid

2010-02-17 Thread Tim Nelson
Tamer,

If you really want to run jetty on port 80, I would suggest using the
iptables technique[1]. I used it before and it's pretty easy to get
working and doesn't require jetty to run as root.

Tim

[1] http://docs.codehaus.org/display/JETTY/port80

On Wed, Feb 17, 2010 at 11:25 AM, Jim Barrows  wrote:
>
>
> On Wed, Feb 17, 2010 at 10:08 AM, Tamer Rizk  wrote:
>>
>> I am using Apache as a reverse proxy forwarding traffic to Jetty on port
>> 8181. I am under the impression that a slight performance benefit offered by
>> Apache would be offset by the bottleneck arising from double request
>> handling (resulting in a reduction of throughput in comparison to direct
>> requests to Jetty).
>
> Depends on what you serve a lot of.  If it's anything but the page (i.e.
> css, js, png, img, etc etc), then you'll see better performance with Apache
> in front then jetty by itself.  On the other hand, if you're serving mostly
> dynamic pages, then you won't see as much of a performance boost.
>
> However, ultimately, you're going to be better off putting Apache/Nginx in
> front.  the performance concerns vs horizontal scaling options doing so are
> minor.  A web server in front of the application server model allows you to
> easily add application servers to the mix.  Running an application server
> alone won't do that.
>
> As with any talk of optimization, you should do it only when you have a
> problem.
>
>>
>> Thus, I would like the option to remove Apache down the road. In either
>> case I would not want Jetty running as root. At this point its just an
>> experiment, so I will try out a production scenario with Jetty server in the
>> hopes that the issue with missing org.mortbay.setuid.SetUIDServer is due to
>> building with Maven and using the plugin. Please let me know if you have a
>> reason to believe otherwise. Thanks to all.
>
> I've never heard of a way to get a command line from the Java VM.  The VM
> doesn't really work that way, and so gives you a layer of protection you
> don't have with a native app.
> http://math.hws.edu/eck/cs124/javanotes4/c9/s1.html is a nice summary of
> why.  While Scala is not Java, it does run in the Java VM, using the compile
> Java Byte Code.
>
>
>>
>> Best,
>> Tamer
>>
>> On Wed, Feb 17, 2010 at 5:16 PM, Timothy Perrett 
>> wrote:
>>>
>>> I would recommend using Nginx or similar up front and using a reverse
>>> proxy setup - it is the most optiomal solution as Nginx can handle a vast
>>> number more connections than Jetty so it makes scaling your app easier on a
>>> single machine.
>>>
>>> Cheers, Tim
>>>
>>> On 17 Feb 2010, at 15:11, Jeppe Nejsum Madsen wrote:
>>>
>>> > On Wed, Feb 17, 2010 at 4:07 PM, Jeppe Nejsum Madsen 
>>> > wrote:
>>> >> On Wed, Feb 17, 2010 at 3:40 PM, trizk  wrote:
>>> >
>>> > Ok, just reread your post and saw you want to run Jetty on port 80.
>>> > I've not tried this,I usually run a frontend (such as nginx) in front.
>>> > Not sure how the different distros support this ootb.
>>> >
>>> > The point about Maven still applies though :-)
>>> >
>>> > /Jeppe
>>> >
>>> > --
>>> > You received this message because you are subscribed to the Google
>>> > Groups "Lift" group.
>>> > To post to this group, send email to lift...@googlegroups.com.
>>> > To unsubscribe from this group, send email to
>>> > liftweb+unsubscr...@googlegroups.com.
>>> > For more options, visit this group at
>>> > http://groups.google.com/group/liftweb?hl=en.
>>> >
>>> >
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Lift" group.
>>> To post to this group, send email to lift...@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> liftweb+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/liftweb?hl=en.
>>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Lift" group.
>> To post to this group, send email to lift...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> liftweb+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/liftweb?hl=en.
>
>
>
> --
> James A Barrows
>
> --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>

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



Re: [Lift] Re: lifecycle callbacks in record

2010-02-11 Thread Tim Nelson
At some point I would love to. I'm not sure it's quite ready for that
yet though.

As soon as I finish the project I'm working on, I hope to be able to
spend some more time on it. There are still some things that I haven't
implemented and I want to look closer at the code you wrote for
couch-db and maybe utilize that.

Tim

On Thu, Feb 11, 2010 at 4:25 PM, Ross Mellgren  wrote:
> Hey Tim (Nelson),
>
> Have you thought about bringing scamongo in as part of Lift?
>
> -Ross
>
> On Feb 11, 2010, at 5:24 PM, Tim Nelson wrote:
>
>> You should note that only the save and delete callbacks have been
>> implemented, but I haven't tested them.
>>
>> If you have other requirements, let me know and I can look into it and
>> any feedback is welcome.
>>
>> Tim aka http://wiki.github.com/eltimn/
>>
>> On Thu, Feb 11, 2010 at 4:17 PM, harryh  wrote:
>>>> Yeah that would be a bit of a problem!! Out of interest, what Record 
>>>> backend are you trying to use?
>>>
>>> http://wiki.github.com/eltimn/scamongo/
>>>
>>> Which needs some work (I have a fork on my local machine that I'm
>>> tinkering with), but mostly seems to be getting the job done.
>>>
>>> -harryh
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups 
>>> "Lift" group.
>>> To post to this group, send email to lift...@googlegroups.com.
>>> To unsubscribe from this group, send email to 
>>> liftweb+unsubscr...@googlegroups.com.
>>> For more options, visit this group at 
>>> http://groups.google.com/group/liftweb?hl=en.
>>>
>>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "Lift" group.
>> To post to this group, send email to lift...@googlegroups.com.
>> To unsubscribe from this group, send email to 
>> liftweb+unsubscr...@googlegroups.com.
>> For more options, visit this group at 
>> http://groups.google.com/group/liftweb?hl=en.
>>
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to 
> liftweb+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/liftweb?hl=en.
>
>

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



Re: [Lift] Re: lifecycle callbacks in record

2010-02-11 Thread Tim Nelson
You should note that only the save and delete callbacks have been
implemented, but I haven't tested them.

If you have other requirements, let me know and I can look into it and
any feedback is welcome.

Tim aka http://wiki.github.com/eltimn/

On Thu, Feb 11, 2010 at 4:17 PM, harryh  wrote:
>> Yeah that would be a bit of a problem!! Out of interest, what Record backend 
>> are you trying to use?
>
> http://wiki.github.com/eltimn/scamongo/
>
> Which needs some work (I have a fork on my local machine that I'm
> tinkering with), but mostly seems to be getting the job done.
>
> -harryh
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to 
> liftweb+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/liftweb?hl=en.
>
>

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



Re: [Lift] Problems with SBT

2010-02-11 Thread Tim Nelson
sbt doesn't look at POMs. You need to create Project file and add the
dependencies in there.

The example in the following is a little old, but it shows what you need
http://code.google.com/p/simple-build-tool/wiki/WebApplicationExample

Here's an updated example:
import sbt._

class HelloLiftProject(info: ProjectInfo) extends DefaultWebProject(info)
{
  val lift = "net.liftweb" % "lift-webkit" % "2.0-M1" % "compile"
  val jetty6 = "org.mortbay.jetty" % "jetty" % "6.1.14" % "test"

  // required because Ivy doesn't pull repositories from poms
  val smackRepo = "m2-repository-smack" at "http://maven.reucon.com/public";
}

Tim

On Thu, Feb 11, 2010 at 10:24 AM, Mads Hartmann  wrote:
> Hello everyone,
> I was hoping I could get some help with an SBT error I'm getting:
>
> [error] /Users/Mads/Dev/logicOfScientificDiscovery/src/main/scala/
> sidewayscoding/model/Discovery.scala:7: not found: value net
> [error] import net.liftweb._
> [error]        ^
> [error] /Users/Mads/Dev/logicOfScientificDiscovery/src/main/scala/
> sidewayscoding/model/Discovery.scala:19: wrong number of arguments for
> constructor Object: ()java.lang.Object
> [error]         object description extends MappedTextarea(this, 600)
> [error]
>
> 
>
> [error] 94 errors found
>
> It looks like it doesn't import lift,
>
> build.properties
>
> #Project properties
> #Tue Feb 02 14:29:05 CET 2010
> project.organization=sidewayscoding
> project.name=LogicOfScientificDiscovery
> sbt.version=0.5.6
> project.version=1.0
> scala.version=2.7.7
> project.initialize=false
>
> pom.xm
>
>  
>    2.7.7
>  
>
> ...
>
>    
>       net.liftweb
>       lift-mapper
>       2.0-M1
>    
>    
>       net.liftweb
>       lift-widgets
>       2.0-M1
>    
>    
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to 
> liftweb+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/liftweb?hl=en.
>
>

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



Re: [Lift] Re: (ISSUE) How to use the sbt with lift project ?

2010-01-30 Thread Tim Nelson
The lift-core dependency brings in every single lift module, even if
you aren't using them. I'd suggest you only use the ones you need,
instead. Also, I don't think the servlet dependency is necessary
anymore.

Try this for your project file:

import sbt._

class MyWebProject(info: ProjectInfo) extends DefaultWebProject(info)
{
  val liftVersion = "2.0-M1"

  val liftwebkit = "net.liftweb" % "lift-webkit" % liftVersion %
"compile->default"
  val liftmapper = "net.liftweb" % "lift-mapper" % liftVersion %
"compile->default"

  val jetty6 = "org.mortbay.jetty" % "jetty" % "6.1.22" % "test->default"

  // required because Ivy doesn't pull repositories from poms
  val smackRepo = "m2-repository-smack" at "http://maven.reucon.com/public";
}

This assumes you are using mapper. If not, you can remove that line.
You may also need to add other lift modules if you are using any of
them.

Note that mapper will actually bring in webkit for you, so it's
actually redundant in the example above, but I prefer to explicitly
set it.

Hth,
Tim

On Sat, Jan 30, 2010 at 11:04 AM, Neil.Lv  wrote:
> Hi,
>
>  Lift version is: 2.0-M1, i deleted all the files in the G:/Documents
> and Settings/Ruby/.ivy2/ directory but get these errors too.
>
> #
> [warn]  ::
> [warn]  ::          UNRESOLVED DEPENDENCIES         ::
> [warn]  ::
> [warn]  :: com.rabbitmq#amqp-client;1.7.0: not found
> [warn]  ::
> [info]
> [warn] :: problems summary ::
> [warn]  WARNINGS
> [warn]          module not found: com.rabbitmq#amqp-client;1.7.0
> [warn]   local: tried
> [warn]    G:/Documents and Settings/Ruby/.ivy2/local/com.rabbitmq/amqp-
> client/1.7.0/ivys/ivy.xml
> [warn]    -- artifact com.rabbitmq#amqp-client;1.7.0!amqp-client.jar:
> [warn]    G:/Documents and Settings/Ruby/.ivy2/local/com.rabbitmq/amqp-
> client/1.7.0/jars/amqp-client.jar
> [warn]   m2-repository-smack: tried
> [warn]    
> http://maven.reucon.com/public/com/rabbitmq/amqp-client/1.7.0/amqp-client-1.7.0.pom
> [warn]    -- artifact com.rabbitmq#amqp-client;1.7.0!amqp-client.jar:
> [warn]    
> http://maven.reucon.com/public/com/rabbitmq/amqp-client/1.7.0/amqp-client-1.7.0.jar
> [warn]   public: tried
> [warn]    
> http://repo1.maven.org/maven2/com/rabbitmq/amqp-client/1.7.0/amqp-client-1.7.0.pom
> [warn]    -- artifact com.rabbitmq#amqp-client;1.7.0!amqp-client.jar:
> [warn]    
> http://repo1.maven.org/maven2/com/rabbitmq/amqp-client/1.7.0/amqp-client-1.7.0.jar
> [warn]   Scala-Tools Maven2 Repository: tried
> [warn]    
> http://scala-tools.org/repo-releases/com/rabbitmq/amqp-client/1.7.0/amqp-client-1.7.0.pom
> [warn]    -- artifact com.rabbitmq#amqp-client;1.7.0!amqp-client.jar:
> [warn]    
> http://scala-tools.org/repo-releases/com/rabbitmq/amqp-client/1.7.0/amqp-client-1.7.0.jar
> [warn]          ::
> [warn]          ::          UNRESOLVED DEPENDENCIES         ::
> [warn]          ::
> [warn]          :: com.rabbitmq#amqp-client;1.7.0: not found
> [warn]          ::
> [info]
> [info] :: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS
> [info] == update ==
> [error] Error running update: unresolved dependency: com.rabbitmq#amqp-
> client;1.7.0: not found
> #
>
> import sbt._
>
> class MyProject(info: ProjectInfo) extends DefaultWebProject(info)
> {
>  val lift = "net.liftweb" % "lift-core" % "2.0-M1" % "compile-
>>default"
>  val jetty6 = "org.mortbay.jetty" % "jetty" % "6.1.22" % "test-
>>default"
>  val servlet = "javax.servlet" % "servlet-api" % "2.5" % "provided-
>>default"
>  val specs = "org.scala-tools.testing" % "specs" % "1.6.1" % "test-
>>default"
>
>  // required because Ivy doesn't pull repositories from poms
>  val smackRepo = "m2-repository-smack" at "http://maven.reucon.com/
> public"
> }
>
> 
>
>  Thanks,
>
> Cheers,
>  Neil
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to 
> liftweb+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/liftweb?hl=en.
>
>

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



Re: [Lift] (ISSUE) How to use the sbt with lift project ?

2010-01-30 Thread Tim Nelson
The jetty val you are overriding is an internal val that you shouldn't
be doing anything with. If you change that line to:

val jetty6 = "org.mortbay.jetty" % "jetty" % "6.1.22" % "test->default"

That part should work.

Tim

On Sat, Jan 30, 2010 at 12:14 AM, Neil.Lv  wrote:
> Hi all,
>
>   How to use the sbt with lift project ?
>
>   I try to use the sbt and get this errors, Does anybody know what's
> wrong with it ?
>
>   Maybe i missing something else ?
>
>   Here is the log:
>
> #
>
> I create this file like this in the build directory.
> G:\project\test\project\build\TestProject.scala
>
> import sbt._
> class TestProject(info: ProjectInfo) extends DefaultWebProject(info)
> {
>  override lazy val jetty = "org.mortbay.jetty" % "jetty" % "6.1.22" %
> "test->default"
> }
>
> #
> G:\project\test>sbt
> G:\project\test>set SCRIPT_DIR=G:\cygwin\home\
> G:\project\test>java -Xmx64M -jar "G:\cygwin\home\sbt-
> launcher-0.5.6.jar"
>
> Project does not exist, create new project? (y/N/s) : y
> Name: test
> Organization []:
> Version [1.0]:
> Scala version [2.7.7]:
> sbt version [0.5.6]:
> :: retrieving :: sbt#boot
>        confs: [default]
>        2 artifacts copied, 0 already retrieved (9911kB/625ms)
> :: retrieving :: sbt#boot
>        confs: [default]
>        3 artifacts copied, 0 already retrieved (3409kB/547ms)
> [success] Successfully initialized directory structure.
> [info] Building project test 1.0 using sbt.DefaultProject
> [info]    with sbt 0.5.6 and Scala 2.7.7
> [info] No actions specified, interactive session started. Execute
> 'help' for more information.
>>
>
>   1:  Get this error when use sbt update command
>
> G:\project\test>sbt update
> G:\project\test>set SCRIPT_DIR=G:\cygwin\home\
> G:\project\test>java -Xmx64M -jar "G:\cygwin\home\sbt-
> launcher-0.5.6.jar" update
>
> [error] G:\project\test\project\build\TestProject.scala:5: error
> overriding lazy value jetty in class BasicWebScalaP
> roject of type TestProject.this.Task;
> [error]  value jetty needs `override' modifier
> [error]   val jetty = "org.mortbay.jetty" % "jetty" % "6.1.22" % "test-
>>default"
>
> -  2:  When I add the override in the definition, and get this
> error.
>
> [error] G:\project\test\project\build\TestProject.scala:5: error
> overriding lazy value jetty in class BasicWebScalaP
> roject of type TestProject.this.Task;
> [error]  value jetty must be declared lazy to override a concrete lazy
> value
> [error]   override val jetty = "org.mortbay.jetty" % "jetty" %
> "6.1.22" % "test->default"
> [error]                ^
> [error] one error found
> Compilation unsuccessful.
>
> -  3:  Add lazy into the statement and get this error.
>
> [error] G:\project\test\project\build\TestProject.scala:5: error
> overriding lazy value jetty in class BasicWebScalaP
> roject of type TestProject.this.Task;
> [error]  lazy value jetty has incompatible type sbt.ModuleID
> [error]   override lazy val jetty = "org.mortbay.jetty" % "jetty" %
> "6.1.22" % "test->default"
>
> #
>
>  Thanks for any help!
>
> Cheers,
>  Neil
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to 
> liftweb+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/liftweb?hl=en.
>
>

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



Re: [Lift] intro mvn critique

2010-01-22 Thread Tim Nelson
I've been meaning to do this for awhile:

http://dl.dropbox.com/u/1154284/lift-mvn.html

Feel free to add this to the main Lift site.

Tim

On Thu, Jan 21, 2010 at 6:35 PM, Raoul Duke  wrote:
>> I wish, but no.  I've written my own shell script.
>
> ugh.
>
> could the html verison perhaps be improved to not have extra blank
> lines which prevent me from successfully copy and pasting it into my
> shell? :-)
>
> http://liftweb.net/docs/getting_started/mod_master.html#x1-40001.2
>
> sincerely.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to 
> liftweb+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/liftweb?hl=en.
>
>

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



Re: [Lift] Re: 1.1: children of menu items do not appear

2010-01-16 Thread Tim Nelson
Did you "clean" out your code before you updated? I don't use maven,
so I'm not sure of the exact command, but that seems to come up a lot
on this list.

If you indeed did clean out the code before updating, then I'm afraid
I'm not sure how to help you further. I've only used mappper a little
and crudify never.

If you manually put in a menu location, does that work? That should
narrow down if it's crudify related or not.

Tim

On Sat, Jan 16, 2010 at 10:38 AM, Joachim A.
 wrote:
> Tim,
> thank you for your reply.
> I've updated updated to 2.0-SNAPSHOT now. The submenu items still do
> not appear, though.
>
> Do I need to set some options or is it still the bug you mentioned?
>
> Regards,
> Joachim
>
> On Jan 16, 4:36 pm, Tim Nelson  wrote:
>> There was a bug that's been fixed. I suggest you use the newest
>> version, which is 2.0-SNAPSHOT. 1.1 was renamed 2.0 last week.
>>
>> Tim
>>
>> On Sat, Jan 16, 2010 at 6:59 AM, Joachim A.
>>
>>
>>
>>  wrote:
>> > Hi,
>> > I've been away from Lift for quite a time. At the moment I work on an old
>> > project and am in the progress to update to the current 1.1-SNAPSHOT .
>> > I have to say that getting used to Lift again was very quick and easy.
>>
>> > In 1.0 this worked and showed a top-level menu item and submenu items if
>> > you've clicked on it:
>> >        Menu(Loc("admin_newsletter", List("newsletter"), 
>> > S.?("menu.newsletters"),
>> > testUserNotSuper), Newsletter.menus: _*) ::
>>
>> > In 1.1 the submenu items do not appear. "Newsletter" uses Crudify.
>>
>> > I've tried  the expandAll attribute for Menu.builder but this did not work.
>>
>> > I'd appreciate some hints where to look,
>>
>> > Best regards,
>> > Joachim
>>
>> > --
>> > You received this message because you are subscribed to the Google Groups 
>> > "Lift" group.
>> > To post to this group, send email to lift...@googlegroups.com.
>> > To unsubscribe from this group, send email to 
>> > liftweb+unsubscr...@googlegroups.com.
>> > For more options, visit this group 
>> > athttp://groups.google.com/group/liftweb?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to 
> liftweb+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/liftweb?hl=en.
>
>
>
>
-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




Re: [Lift] 1.1: children of menu items do not appear

2010-01-16 Thread Tim Nelson
There was a bug that's been fixed. I suggest you use the newest
version, which is 2.0-SNAPSHOT. 1.1 was renamed 2.0 last week.

Tim

On Sat, Jan 16, 2010 at 6:59 AM, Joachim A.
 wrote:
> Hi,
> I've been away from Lift for quite a time. At the moment I work on an old
> project and am in the progress to update to the current 1.1-SNAPSHOT .
> I have to say that getting used to Lift again was very quick and easy.
>
> In 1.0 this worked and showed a top-level menu item and submenu items if
> you've clicked on it:
>        Menu(Loc("admin_newsletter", List("newsletter"), 
> S.?("menu.newsletters"),
> testUserNotSuper), Newsletter.menus: _*) ::
>
> In 1.1 the submenu items do not appear. "Newsletter" uses Crudify.
>
> I've tried  the expandAll attribute for Menu.builder but this did not work.
>
> I'd appreciate some hints where to look,
>
> Best regards,
> Joachim
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to 
> liftweb+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/liftweb?hl=en.
>
>
>
>
-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




Re: [Lift] issue with sitemap submenus ?

2010-01-07 Thread Tim Nelson
I just noticed the same problem ("nearby" submenus are not displaying)
using 1.1-SNAPSHOT. If I switch to M8 the submenus appear as they
should.

Was there a change in the way this works?

Tim

On Wed, Jan 6, 2010 at 9:59 AM, Ross Mellgren  wrote:
> By default sitemap will only show submenus "nearby" the current page. You
> can show the entire expanded menu by using  expandAll="true />
> You should try navigating to the "Author List" page and ensure that the
> "Author Test" menu shows up then.
> -Ross
> On Jan 6, 2010, at 9:20 AM, Jean-Luc wrote:
>
> Hi liftweb-list !
>
> Happy New Year to all !
>
> Well, I have an issue with sitemap submenus.
>
> Using the following code :
>     val entries = SiteMap(Menu(Loc("Home", "index" :: Nil , ?("Home"))),
>               Menu(Loc("Authors", "authors" :: "list" :: Nil, ?("Author
> List")),
>    Menu(Loc("Test", "authors" :: "test" :: Nil,
> ?("Author Test",
>               Menu(Loc("Add Author", "authors" :: "add" :: Nil, ?("Add
> Author"), Hidden)),
>               Menu(Loc("Books", "books" :: "list" :: Nil, ?("Book List"))),
>               Menu(Loc("Add Book", "books" :: "add" :: Nil, ?("Add Book"),
> Hidden)),
>               Menu(Loc("BookSearch", "books" :: "search" :: Nil, ?("Book
> Search"
>
> Expected result :
> - the menu is displayed and a "Author Test" entry is present
>     *  Home
>     *  Author List
>    * Author Test
>     *  Book List
>     *  Book Search
>
> Current result :
> - the menu is displayed but no "Author Test" entry is present
>     *  Home
>     *  Author List
>     *  Book List
>     *  Book Search
>
> Before the last mvn -U xxx my submenis where displayed correctly.
>
> Is there a known issue or am I missing something ?
>
> To reproduce the problem :
> - http://github.com/jlcanela/scalajpademo
> - change Boot.scala (line 53) and use the modified "entries" sitemap
>
>
> --
> Jean-Luc Canela
> jlcane...@gmail.com
> --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>
>
-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




Re: [Lift] Problem with creating new project

2010-01-03 Thread Tim Nelson
I'm no maven expert, but I think you need to use generate instead of
create. See the warning halfway down, before the stack trace.

[INFO] [archetype:create {execution: default-cli}]
[WARNING] This goal is deprecated. Please use mvn archetype:generate
instead

Try:

$  mvn archetype:generate -U  \
...

That may not solve your problem, but it's a place to start.

Tim

On Sat, Jan 2, 2010 at 10:15 PM, Jaroslaw Zabiello
 wrote:
> I cannot create a new project because of  "Embedded error: The META-
> INF/maven/archetype.xml descriptor cannot be found.
>
> I use Mac OS-X 10.6.2, MacPorts and Scala 2.7.7 final.
>
> $ scala -version
> Scala code runner version 2.7.7.final -- Copyright 2002-2009, LAMP/
> EPFL
>
> $ mvn -version
> Apache Maven 2.2.1 (r801777; 2009-08-06 20:16:01+0100)
> Java version: 1.6.0_17
> Java home: /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/
> Home
> Default locale: pl_PL, platform encoding: MacCentralEurope
> OS name: "mac os x" version: "10.6.2" arch: "x86_64" Family: "mac"
>
> $  mvn archetype:create -U  \
>>   -DarchetypeGroupId=net.liftweb \
>>   -DarchetypeArtifactId=lift-archetype-blank \
>>   -DarchetypeVersion=1.1-SNAPSHOT \
>>   -DremoteRepositories=http://scala-tools.org/repo-snapshots  \
>>   -DgroupId=com.mapp -DartifactId=mapp -e
>
>
> + Error stacktraces are turned on.
> [INFO] Scanning for projects...
> [INFO] Searching repository for plugin with prefix: 'archetype'.
> [INFO] org.apache.maven.plugins: checking for updates from central
> [INFO] org.codehaus.mojo: checking for updates from central
> [INFO] artifact org.apache.maven.plugins:maven-archetype-plugin:
> checking for updates from central
> [INFO]
> 
> [INFO] Building Maven Default Project
> [INFO]    task-segment: [archetype:create] (aggregator-style)
> [INFO]
> 
> [INFO] Setting property: classpath.resource.loader.class =>
> 'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'.
> [INFO] Setting property: velocimacro.messages.on => 'false'.
> [INFO] Setting property: resource.loader => 'classpath'.
> [INFO] Setting property: resource.manager.logwhenfound => 'false'.
> [INFO] [archetype:create {execution: default-cli}]
> [WARNING] This goal is deprecated. Please use mvn archetype:generate
> instead
> [INFO] Defaulting package to group ID: com.mapp
> [INFO] We are using command line specified remote repositories:
> http://scala-tools.org/repo-snapshots
> [INFO] snapshot net.liftweb:lift-archetype-blank:1.1-SNAPSHOT:
> checking for updates from id0
> Downloading:
> http://scala-tools.org/repo-snapshots/net/liftweb/lift-archetype-blank/1.1-SNAPSHOT/lift-archetype-blank-1.1-SNAPSHOT.jar
> [INFO]
> 
> [INFO] Using following parameters for creating OldArchetype: lift-
> archetype-blank:1.1-SNAPSHOT
> [INFO]
> 
> [INFO] Parameter: groupId, Value: com.mapp
> [INFO] Parameter: packageName, Value: com.mapp
> [INFO] Parameter: package, Value: com.mapp
> [INFO] Parameter: artifactId, Value: mapp
> [INFO] Parameter: basedir, Value: /Users/zbiru
> [INFO] Parameter: version, Value: 1.0-SNAPSHOT
> [INFO]
> 
> [ERROR] BUILD ERROR
> [INFO]
> 
> [INFO] Error creating from archetype
>
> Embedded error: The META-INF/maven/archetype.xml descriptor cannot be
> found.
> [INFO]
> 
> [INFO] Trace
> org.apache.maven.lifecycle.LifecycleExecutionException: Error creating
> from archetype
>        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals
> (DefaultLifecycleExecutor.java:719)
>        at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal
> (DefaultLifecycleExecutor.java:569)
>        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal
> (DefaultLifecycleExecutor.java:539)
>        at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures
> (DefaultLifecycleExecutor.java:387)
>        at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments
> (DefaultLifecycleExecutor.java:284)
>        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute
> (DefaultLifecycleExecutor.java:180)
>        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
>        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
>        at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
>        at org.apache.maven.cli.compat.CompatibleMain.main
> (CompatibleMain.java:60)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at sun.reflect.NativeMethodAccessorImpl.invoke
>

Re: [Lift] Re: How to disable XHTML?

2009-12-15 Thread Tim Nelson
You need to remove the if guard on the first case match and change the
second parameter you are passing to Req. The second param is for the
context. Try this:

LiftRules.determineContentType = {
  case (Full(Req("location" :: "maps" :: "testmap" :: Nil, _,
GetRequest)), Full(accept)) => "text/html; charset=utf-8"
  case _ => "application/xhtml+xml; charset=utf-8"
}

Tim

On Tue, Dec 15, 2009 at 6:09 AM, Tweek  wrote:
> It still dosn't work :(
>
> this is path to my html file, which is using google maps api: ./
> location/maps/testmap.html
>
> i put in my Boot.scala file this code:
>
>        LiftRules.determineContentType = {
>            case (Full(Req("location" :: "maps" :: "testmap" :: Nil,
> "html", GetRequest)), Full(accept))
>                if LiftRules.useXhtmlMimeType &&
> accept.toLowerCase.contains("application/xhtml+xml") =>
>                "text/html; charset=utf-8"
>            case _ => "application/xhtml+xml; charset=utf-8"
>        }
>
> i can't disable XHTML in whole projcet becouse then i'm losing
> functionality like jquery datepicker etc.
>
> Could You tell me what i did wrong?
>
> Thanks
>
> On 15 Gru, 10:38, Timothy Perrett  wrote:
>> You need to put it in your Boot.scala file.
>>
>> determineContentType is of PartialFunction[(Box[Req], Box[String]), String] 
>> type - this means that you can match on particular paths:
>>
>>     LiftRules.determineContentType = {
>>       case (Full(Req("some" :: "path" :: Nil, "pdf", GetRequest)), 
>> Full(accept))
>>         if LiftRules.useXhtmlMimeType && 
>> accept.toLowerCase.contains("application/xhtml+xml") =>
>>             "application/xhtml+xml; charset=utf-8"
>>       case _ => "text/html; charset=utf-8"
>>     }
>>
>> Cheers, Tim
>>
>> On 15 Dec 2009, at 07:58, Tweek wrote:
>>
>> > Thanks for answer Tim.
>>
>> > I know it will be a nooby question, but how i need to define this
>> > site, where i don't want XHTML ?
>>
>> > On 14 Gru, 12:30, Tim Nelson  wrote:
>> >> You can use LiftRules.determineContentType to do this. Here is a
>> >> sample from my project:
>>
>> >> LiftRules.determineContentType = {
>> >>   case (_, Full(accept)) if LiftRules.useXhtmlMimeType &&
>> >> accept.toLowerCase.contains("application/xhtml+xml") =>
>> >>         "application/xhtml+xml; charset=utf-8"
>> >>   case _ => "text/html; charset=utf-8"
>>
>> >> }
>>
>> >> Tim
>>
>> >> On Mon, Dec 14, 2009 at 3:59 AM, Tweek  wrote:
>> >>> Hi Guys
>>
>> >>> Is it possible todisableXHTMLonly in one html file?
>>
>> >>> When i put
>> >>> "LiftRules.useXhtmlMimeType = false"
>> >>>  in Boot.scala then i'll swich this off in whole project.
>>
>> >>> Is any other place to put this line?
>>
>> >>> Thanks.
>>
>> >>> --
>>
>> >>> You received this message because you are subscribed to the Google 
>> >>> Groups "Lift" group.
>> >>> To post to this group, send email to lift...@googlegroups.com.
>> >>> To unsubscribe from this group, send email to 
>> >>> liftweb+unsubscr...@googlegroups.com.
>> >>> For more options, visit this group 
>> >>> athttp://groups.google.com/group/liftweb?hl=en.
>>
>> > --
>>
>> > You received this message because you are subscribed to the Google Groups 
>> > "Lift" group.
>> > To post to this group, send email to lift...@googlegroups.com.
>> > To unsubscribe from this group, send email to 
>> > liftweb+unsubscr...@googlegroups.com.
>> > For more options, visit this group 
>> > athttp://groups.google.com/group/liftweb?hl=en.
>
> --
>
> You received this message because you are subscribed to the Google Groups 
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to 
> liftweb+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/liftweb?hl=en.
>
>
>

--

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




Re: [Lift] How to disable XHTML?

2009-12-14 Thread Tim Nelson
You can use LiftRules.determineContentType to do this. Here is a
sample from my project:

LiftRules.determineContentType = {
  case (_, Full(accept)) if LiftRules.useXhtmlMimeType &&
accept.toLowerCase.contains("application/xhtml+xml") =>
"application/xhtml+xml; charset=utf-8"
  case _ => "text/html; charset=utf-8"
}

Tim

On Mon, Dec 14, 2009 at 3:59 AM, Tweek  wrote:
> Hi Guys
>
> Is it possible to disable XHTML only in one html file?
>
> When i put
> "LiftRules.useXhtmlMimeType = false"
>  in Boot.scala then i'll swich this off in whole project.
>
> Is any other place to put this line?
>
> Thanks.
>
> --
>
> You received this message because you are subscribed to the Google Groups 
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to 
> liftweb+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/liftweb?hl=en.
>
>
>

--

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




Re: [Lift] Jetty/Derby, unable to redeploy hot changes (FIXED)

2009-12-13 Thread Tim Nelson
I had the same problem while using H2. I solved it by disposing the db
connections when the servlet is destroyed. I wrote a gist about it
here:
http://gist.github.com/166687

I don't think I've ever seen your solution, which might be a better
way to handle it.

Tim

On Sun, Dec 13, 2009 at 3:41 PM, joseph hirn  wrote:
> I just started looking into lift today but I ran into an issue where I
> could not make hot changes to class files without having to restart
> jetty because Derby would complain it was already bound. I was
> searching around on here and found this issue:
> http://groups.google.com/group/liftweb/browse_thread/thread/9dcf84464dc07cce/c0cadcc4e6a3b472?lnk=gst&q=Another+instance+of+Derby#c0cadcc4e6a3b472
>
> I've had simlilar issues with embedded libraries before and I was able
> to resolve this issue by making derby a dependency in jetty rather
> than of the app like so:
>
>
> 
>  org.mortbay.jetty
>    maven-jetty-plugin
>    
>       /
>       5
>    
>    
>        
>          org.apache.derby
>          derby
>          10.4.2.0
>        
>    
> 
>
>
> Not only does this make Jetty manage Derby so redeploying will not
> create a new Derby instance but it also keeps the app database
> independent. You can then either remove Derby as a regular dependency
> or put it as provided so that Maven will not package it
> in your warfile.
>
> Is anyone else having this issue? Should I open a ticket in the issue
> tracker for the archetype? Maybe everyone knows to do this but it was
> annoying for a first timer like me who just started with the
> archetype, especially after the annoyance that archetype:generate menu
> generates an old archetype and won't upgrade to v1.0.
>
> Thanks!
>
> --
>
> You received this message because you are subscribed to the Google Groups 
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to 
> liftweb+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/liftweb?hl=en.
>
>
>

--

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




Re: [Lift] Re: How to configure two database connection in Lift?

2009-12-06 Thread Tim Nelson
I did some more digging and got a sample app to work. You can see the code here:
http://github.com/eltimn/lift_1_1_sample

There are 2 things I had to do. The first is to pass in the DbId when
calling Schemifier;

Schemifier.schemify(true, Log.infoF _, OneDB, User)
Schemifier.schemify(true, Log.infoF _, TwoDB, Dog)

This was the cause of the NPE earlier.

The second thing I did was to create 2 separate DBVendor objects. I
could not get this to work with one that matches on the
ConnectionIdentifier, like the example in The Lift Book. I didn't dig
into why this wasn't working, so it could be the way the code is
written.

DB.defineConnectionManager(OneDB, DBVendor_1)
DB.defineConnectionManager(TwoDB, DBVendor_2)

Tim

--

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




Re: [Lift] Re: How to configure two database connection in Lift?

2009-12-06 Thread Tim Nelson
I think there might be a problem with the way you are specifying which
db to use in your mapper classes. Here's the relevant text from the
The Lift Book:

dbSelect... is used to find an instance by primary key, and takes a
partial function (typically a match clause) to determine which
connection to use.

dbCalculate... is used when a new instance is created to decide where
to store the new instance.

Those 2 methods are used for sharding. Are you sharding? If not I
think you just want to override dbDefaultConnectionIdentifier

Tim

On Sun, Dec 6, 2009 at 6:01 AM, Neil.Lv  wrote:
>
>  If i remove the  DB.defineConnectionManager
> (DefaultConnectionIdentifier, DBVendor)
>
>  This error message occurs.
> ###
> java.lang.NullPointerException: Looking for Connection Identifier
> ConnectionIden
> tifier(lift) but failed to find either a JNDI data source with the
> name lift or
> a lift connection manager with the correct name
> ###
>
> Cheers,
>  Neil
>
>
> On Dec 6, 7:54 pm, Tim Nelson  wrote:
>> Hi,
>>
>> This line configures the database connections:
>>
>> DB.defineConnectionManager(DefaultConnectionIdentifier,
>> DBVendor)
>>
>> This is using only the DefaultConnectionIdentifier, which you don't
>> want to use. You want to change this to use your 2 defined
>> identifiers. Ie:
>>
>> DB.defineConnectionManager(OneDB, DBVendor)
>> DB.defineConnectionManager(TwoDB, DBVendor)
>>
>> Tim
>>
>> On Sun, Dec 6, 2009 at 4:17 AM, Neil.Lv  wrote:
>>
>> > Here is the db url,
>>
>> > db.url1=jdbc:mysql://localhost:3306/blog1
>> > db.url2=jdbc:mysql://localhost:3306/blog2
>>
>> > Cheers,
>> >  Neil
>>
>> > On Dec 6, 4:00 pm, "Neil.Lv"  wrote:
>> >> In the Boot.scala
>> >> ###
>> >> class Boot {
>> >>   def boot {
>> >>     if (!DB.jndiJdbcConnAvailable_?)
>> >>       DB.defineConnectionManager(DefaultConnectionIdentifier,
>> >> DBVendor)
>> >>     ...
>> >>   }
>>
>> >> }
>>
>> >> object WahDB extends ConnectionIdentifier {
>> >>   def jndiName = "one"}
>>
>> >> object WahereDB extends ConnectionIdentifier {
>> >>   def jndiName = "two"
>>
>> >> }
>>
>> >> object DBVendor extends ConnectionManager {
>> >>   ...
>> >>   private def createOne(name: ConnectionIdentifier): Box[Connection] =
>> >> try {
>> >>     val dbUrl1: String = Props.get("db.url1") openOr
>> >>     "jdbc:derby:lift_example;create=true"
>>
>> >>     val dbUrl2: String = Props.get("db.url2") openOr
>> >>     "jdbc:derby:lift_example;create=true"
>>
>> >>     var dbUrl: String = dbUrl1
>>
>> >>     try{
>> >>            name match {
>> >>                   case One => {
>> >>                         dbUrl = dbUrl1
>> >>                   }
>> >>                   case Two => {
>> >>                     dbUrl = dbUrl2
>> >>                   }
>> >>                   case lift => {
>> >>                     dbUrl = dbUrl1
>> >>                   }
>> >>            }
>> >>     } catch {
>> >>       case e : Exception => e.printStackTrace; Empty
>> >>     }
>> >>    ...
>> >>   }
>> >>   ...
>>
>> >> }
>>
>> >> In the every models:
>> >> class User extends MegaProtoUser[User] {
>> >>   def getSingleton = User // what's the "meta" server
>>
>> >>   ...
>>
>> >>   override def dbCalculateConnectionIdentifier = {  //
>> >> ## dbCalculateConnectionIdentifier
>> >>     case _ => One
>> >>   }
>>
>> >> }
>>
>> >> class Blog extends LongKeyedMapper[Item] with IdPK {
>> >>   def getSingleton = Blog // what's the "meta" server
>>
>> >>   ...
>>
>> >>   override def dbCalculateConnectionIdentifier = {  //
>> >> ## dbCalculateConnectionIdentifier
>> >>     case _ => Two
>> >>   }}
>>
>> >> ###
>>
>> >> I add the "override def dbCalculateConnectionIdentifier" method in
>> >> every models
>>
>> >> But everytime it uses the d

Re: [Lift] Re: How to configure two database connection in Lift?

2009-12-06 Thread Tim Nelson
Hi,

This line configures the database connections:

DB.defineConnectionManager(DefaultConnectionIdentifier,
DBVendor)

This is using only the DefaultConnectionIdentifier, which you don't
want to use. You want to change this to use your 2 defined
identifiers. Ie:

DB.defineConnectionManager(OneDB, DBVendor)
DB.defineConnectionManager(TwoDB, DBVendor)

Tim


On Sun, Dec 6, 2009 at 4:17 AM, Neil.Lv  wrote:
>
> Here is the db url,
>
> db.url1=jdbc:mysql://localhost:3306/blog1
> db.url2=jdbc:mysql://localhost:3306/blog2
>
> Cheers,
>  Neil
>
> On Dec 6, 4:00 pm, "Neil.Lv"  wrote:
>> In the Boot.scala
>> ###
>> class Boot {
>>   def boot {
>>     if (!DB.jndiJdbcConnAvailable_?)
>>       DB.defineConnectionManager(DefaultConnectionIdentifier,
>> DBVendor)
>>     ...
>>   }
>>
>> }
>>
>> object WahDB extends ConnectionIdentifier {
>>   def jndiName = "one"}
>>
>> object WahereDB extends ConnectionIdentifier {
>>   def jndiName = "two"
>>
>> }
>>
>> object DBVendor extends ConnectionManager {
>>   ...
>>   private def createOne(name: ConnectionIdentifier): Box[Connection] =
>> try {
>>     val dbUrl1: String = Props.get("db.url1") openOr
>>     "jdbc:derby:lift_example;create=true"
>>
>>     val dbUrl2: String = Props.get("db.url2") openOr
>>     "jdbc:derby:lift_example;create=true"
>>
>>     var dbUrl: String = dbUrl1
>>
>>     try{
>>            name match {
>>                   case One => {
>>                         dbUrl = dbUrl1
>>                   }
>>                   case Two => {
>>                     dbUrl = dbUrl2
>>                   }
>>                   case lift => {
>>                     dbUrl = dbUrl1
>>                   }
>>            }
>>     } catch {
>>       case e : Exception => e.printStackTrace; Empty
>>     }
>>    ...
>>   }
>>   ...
>>
>> }
>>
>> In the every models:
>> class User extends MegaProtoUser[User] {
>>   def getSingleton = User // what's the "meta" server
>>
>>   ...
>>
>>   override def dbCalculateConnectionIdentifier = {  //
>> ## dbCalculateConnectionIdentifier
>>     case _ => One
>>   }
>>
>> }
>>
>> class Blog extends LongKeyedMapper[Item] with IdPK {
>>   def getSingleton = Blog // what's the "meta" server
>>
>>   ...
>>
>>   override def dbCalculateConnectionIdentifier = {  //
>> ## dbCalculateConnectionIdentifier
>>     case _ => Two
>>   }}
>>
>> ###
>>
>> I add the "override def dbCalculateConnectionIdentifier" method in
>> every models
>>
>> But everytime it uses the database One, never uses the database Two.
>>
>> Thanks very much!
>>
>> Cheers,
>>   Neil
>>
>> On Dec 6, 3:02 pm, "Neil.Lv"  wrote:
>>
>> >   The two databases that have different structure of the tables, such
>> > as two applications databases.
>>
>> > Cheers,
>> >   Neil
>>
>> > On Dec 6, 2:38 pm, "Neil.Lv"  wrote:
>>
>> > >    Btw, there is the error message when the server is started.
>> > > ###
>> > > scala.MatchError: ConnectionIdentifier(lift)
>> > > ###
>>
>> > > On Dec 6, 1:47 pm, "Neil.Lv"  wrote:
>>
>> > > > Hi all,
>>
>> > > >   I want to use two databases, but i don't know how to configure it.
>>
>> > > >   Does anybody know that how to configure two database connection in
>> > > > Lift?
>>
>> > > > 1:
>> > > >   I add two ConnectionIdentifier in the Boot.class
>> > > > ###
>> > > > object OneDB extends ConnectionIdentifier {
>>
>> > > >   def jndiName = "one"
>>
>> > > > }
>>
>> > > > object TwoDB extends ConnectionIdentifier {
>>
>> > > >   def jndiName = "two"
>>
>> > > > }
>>
>> > > > ###
>>
>> > > > 2: In the User model
>>
>> > > >    How can i write the code in the method,
>> > > > ###
>> > > >   override def dbCalculateConnectionIdentifier = {
>> > > >     Two
>> > > >   }
>> > > > ###
>>
>> > > >   Thanks for any suggestion!
>>
>> > > > Cheers,
>> > > >   Neil
>
> --
>
> You received this message because you are subscribed to the Google Groups 
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to 
> liftweb+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/liftweb?hl=en.
>
>
>

--

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




Re: [Lift] Re: Button tag for submit

2009-12-05 Thread Tim Nelson
That works, thanks.

It still would be nice to have a SHtml.button method that would do
this for me. So I wouldn't have to have a hidden field on all of my
forms, but this works for now.

Thanks,
Tim

On Fri, Dec 4, 2009 at 7:37 PM, Timothy Perrett  wrote:
> Absolutely nothing stopping you doing that. See my previous post on
> this matter:
>
> http://groups.google.com/group/liftweb/browse_thread/thread/72cb7312ca87795f
>
> Cheers, Tim
>
> On Dec 5, 12:52 am, Tim Nelson  wrote:
>> Is there a way to use a button tag for submitting forms?
>>
>> It would be nice to be able to use the blueprint buttons plugin which
>> requires the following:
>>
>> 
>>    Save
>> 
>>
>> Thanks,
>> Tim
>
> --
>
> You received this message because you are subscribed to the Google Groups 
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to 
> liftweb+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/liftweb?hl=en.
>
>
>

--

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




[Lift] Button tag for submit

2009-12-04 Thread Tim Nelson
Is there a way to use a button tag for submitting forms?

It would be nice to be able to use the blueprint buttons plugin which
requires the following:


   Save


Thanks,
Tim

--

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




Re: [Lift] Re: how does lift work with redis?

2009-11-25 Thread Tim Nelson
I haven't used redis at all but it looks like they have a jdbc driver that
you might be able to use with mapper. It doesn't support all jdbc
functionality but it might work well enough for your needs.

If that doesn't work you could either use the jredis java client code
directly inside lift or use the record framework which is meant to be a
mapper like framework for generic (ie nosql ) dbs. It, however, requires a
back end implementation for each db system. Currently there is no back-end
implementation for redis, so one would need to be written for it.

Tim

On Wed, Nov 25, 2009 at 2:13 PM, surfman  wrote:

> Thanks. Does it mean I may not use lift mapper and I have to write
> everything for database manipulation?
>
> regards,
>
> surfman
>
>
> On 11月24日, 下午5时12分, Timothy Perrett  wrote:
> > There is no out of the box implementation. You could write a record
> > back end though - it depends on the features you want I guess.
> >
> > Cheers, Tim
> >
> > Sent from my iPhone
> >
> > On 24 Nov 2009, at 22:00, surfman  wrote:
> >
> >
> >
> > > Is there anything I could learn on how lift works with redis database?
> > > Thanks.
> >
> > > --
> >
> > > You received this message because you are subscribed to the Google
> > > Groups "Lift" group.
> > > To post to this group, send email to lift...@googlegroups.com.
> > > To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> > > .
> > > For more options, visit this group athttp://
> groups.google.com/group/liftweb?hl=en
> > > .- 隐藏被引用文字 -
> >
> > - 显示引用的文字 -
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>
>
>

--

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




Re: [Lift] intro to lift-json?

2009-11-19 Thread Tim Nelson
Have you seen the readme file?

http://github.com/dpp/liftweb/tree/master/lift-base/lift-json/

On Thu, Nov 19, 2009 at 2:20 PM, harryh  wrote:

> Is there a basic intro to lift-json floating around anywhere?  I'm
> having a bit of trouble getting started with a couple basic things.
> For example if a have a JObject that corresponds to:
>
> {
>  "foo" : {
>"bar" : 999
>  }
> }
>
> How do I get the 999 (as an int) out of the JObject?  I'm sure this is
> simple, just a bit confused on the basics.
>
> -harryh
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=.
>
>
>

--

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




[Lift] Re: PCDataXmlParser

2009-11-16 Thread Tim Nelson
Hi

On Mon, Nov 16, 2009 at 12:02 PM, David Pollak <
feeder.of.the.be...@gmail.com> wrote:

>
>
> On Sun, Nov 15, 2009 at 11:24 PM,  wrote:
>
>> Hello,
>>
>> I am a newby to both scala and lift. Now that that's out of the way I'm
>> wondering how to properly use PCDataXmlParser to read and parse html.
>
>
> PXDataXmlParser requires well formed XML.  It is an XML parser.
>
> There are plenty of Java libraries that parse HTML.  Please use one of
> those for parsing stuff that's not known to be well formed XML.
>

I would suggest you start here:
http://www.hars.de/2009/01/html-as-xml-in-scala.html

I implemented this last week and it works well.


>
>
>
>> I pull data from a restful service by doing the following:
>>
>> [code]
>> import dispatch._
>> import Http._
>>
>> import net.liftweb.util._;
>> import scala.xml._;
>>
>> def upcDatabase(): Box[NodeSeq] = {
>> val http = new Http
>> var stream: String = "";
>> http("http://www.upcdatabase.com/item/0606949324124"; >- (arg => stream =
>> arg))
>> stream;
>> PCDataXmlParser(stream);
>> }
>>
>> val feedXML: Box[NodeSeq] = upcDatabase;
>> [/code]
>>
>> when doing this I get the following exception:
>>
>> [exception]
>> INF: [console logger] dispatch: GET
>> http://www.upcdatabase.com/item/0606949324124
>> log4j:WARN No appenders could be found for logger
>> (org.apache.http.impl.conn.SingleClientConnManager).
>> log4j:WARN Please initialize the log4j system properly.
>> :96:5: '<' not allowed in attrib value  ^
>> :97:1: '<' not allowed in attrib value^
>> :98:1: '<' not allowed in attrib value^
>> :99:1: '<' not allowed in attrib value^
>> :99:27: whitespace expected ^
>> :99:27: '>' expected instead of '%' ^
>> Exception in thread "main" java.lang.ExceptionInInitializerError
>> at
>> ca.ctrlspace.loveItHateItWeb.xml.UpcDatabaseFeed.main(UpcDatabaseFeed.scala)
>> Caused by: java.lang.RuntimeException: FATAL
>> at scala.Predef$.error(Predef.scala:76)
>> at scala.xml.parsing.MarkupParser$class.xToken(MarkupParser.scala:267)
>> at net.liftweb.util.PCDataXmlParser.xToken(PCDataMarkupParser.scala:91)
>> at scala.xml.parsing.MarkupParser$class.element1(MarkupParser.scala:680)
>> at net.liftweb.util.PCDataXmlParser.element1(PCDataMarkupParser.scala:91)
>> at scala.xml.parsing.MarkupParser$class.content1(MarkupParser.scala:481)
>> at net.liftweb.util.PCDataXmlParser.content1(PCDataMarkupParser.scala:91)
>> at scala.xml.parsing.MarkupParser$class.content(MarkupParser.scala:505)
>> at net.liftweb.util.PCDataXmlParser.content(PCDataMarkupParser.scala:91)
>> at scala.xml.parsing.MarkupParser$class.element1(MarkupParser.scala:682)
>> at net.liftweb.util.PCDataXmlParser.element1(PCDataMarkupParser.scala:91)
>> at scala.xml.parsing.MarkupParser$class.content1(MarkupParser.scala:481)
>> at net.liftweb.util.PCDataXmlParser.content1(PCDataMarkupParser.scala:91)
>> at scala.xml.parsing.MarkupParser$class.content(MarkupParser.scala:505)
>> at net.liftweb.util.PCDataXmlParser.content(PCDataMarkupParser.scala:91)
>> at scala.xml.parsing.MarkupParser$class.element1(MarkupParser.scala:682)
>> at net.liftweb.util.PCDataXmlParser.element1(PCDataMarkupParser.scala:91)
>> at scala.xml.parsing.MarkupParser$class.content1(MarkupParser.scala:481)
>> at net.liftweb.util.PCDataXmlParser.content1(PCDataMarkupParser.scala:91)
>> at scala.xml.parsing.MarkupParser$class.content(MarkupParser.scala:505)
>> at net.liftweb.util.PCDataXmlParser.content(PCDataMarkupParser.scala:91)
>> at scala.xml.parsing.MarkupParser$class.element1(MarkupParser.scala:682)
>> at net.liftweb.util.PCDataXmlParser.element1(PCDataMarkupParser.scala:91)
>> at scala.xml.parsing.MarkupParser$class.content1(MarkupParser.scala:481)
>> at net.liftweb.util.PCDataXmlParser.content1(PCDataMarkupParser.scala:91)
>> at scala.xml.parsing.MarkupParser$class.content(MarkupParser.scala:505)
>> at net.liftweb.util.PCDataXmlParser.content(PCDataMarkupParser.scala:91)
>> at scala.xml.parsing.MarkupParser$class.element1(MarkupParser.scala:682)
>> at net.liftweb.util.PCDataXmlParser.element1(PCDataMarkupParser.scala:91)
>> at scala.xml.parsing.MarkupParser$class.content1(MarkupParser.scala:481)
>> at net.liftweb.util.PCDataXmlParser.content1(PCDataMarkupParser.scala:91)
>> at scala.xml.parsing.MarkupParser$class.content(MarkupParser.scala:505)
>> at net.liftweb.util.PCDataXmlParser.content(PCDataMarkupParser.scala:91)
>> at scala.xml.parsing.MarkupParser$class.element1(MarkupParser.scala:682)
>> at net.liftweb.util.PCDataXmlParser.element1(PCDataMarkupParser.scala:91)
>> at scala.xml.parsing.MarkupParser$class.content1(MarkupParser.scala:481)
>> at net.liftweb.util.PCDataXmlParser.content1(PCDataMarkupParser.scala:91)
>> at scala.xml.parsing.MarkupParser$class.content(MarkupParser.scala:505)
>> at net.liftweb.util.PCDataXmlParser.content(PCDataMarkupParser.scala:91)
>> at scala.xml.parsing.MarkupParser$class.element1(MarkupParser.scala:682)
>> at net.liftweb.util.PCDataXmlParser.element1(PCDataMarkupParser.scala:91)
>> at scala.xml.parsing.Ma

[Lift] Re: record framework questions

2009-11-05 Thread Tim Nelson
Sounds good. Thanks again.

On Thu, Nov 5, 2009 at 5:47 PM, David Pollak
wrote:

>
>
> On Thu, Nov 5, 2009 at 3:39 PM, Tim Nelson  wrote:
>
>> Thanks David. Ticket has been filed:
>> http://github.com/dpp/liftweb/issues/#issue/162
>>
>> Regarding my last question about stability of the record files; I'm trying
>> to decide if I should use the record framework and the back end
>> implementation I wrote to build my website or if I should use the more basic
>> framework I wrote. My main concern is having to make changes to my
>> implementation if the record files are modified. Not that I'm against
>> changes, I just want to plan ahead as much as possible.
>>
>> I realize that changes will always be a possibility and that you probably
>> won't know more until you actually write the other back end implementations,
>> I just want to get a sense of how you currently feel about them and what, if
>> any, plans you have for the record framework in general.
>
>
> The most important driver of Record is people using it.  Tim has been doing
> some stuff with it.  If you start using it actively, you'll be the guy
> driving a lot of the changes.
>
>
>>
>>
>> Thanks,
>> 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: record framework questions

2009-11-05 Thread Tim Nelson
Thanks David. Ticket has been filed:
http://github.com/dpp/liftweb/issues/#issue/162

Regarding my last question about stability of the record files; I'm trying
to decide if I should use the record framework and the back end
implementation I wrote to build my website or if I should use the more basic
framework I wrote. My main concern is having to make changes to my
implementation if the record files are modified. Not that I'm against
changes, I just want to plan ahead as much as possible.

I realize that changes will always be a possibility and that you probably
won't know more until you actually write the other back end implementations,
I just want to get a sense of how you currently feel about them and what, if
any, plans you have for the record framework in general.

Thanks,
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] record framework questions

2009-11-04 Thread Tim Nelson

I have been working on a back end implementation for Record that uses
MongoDB and I have a couple of quick questions;

Is there a reason that valMinLen and valMaxLen were not copied into
StringField?

TimeZoneField has a companion object that has a list of the available
time zones, it would be nice to have a similar companion object for
LocaleField.

How stable are the current Record, MetaRecord and Field* files? Are
there any plans to make any changes to these?

Thanks,
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: 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  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: JSONParse.parse and List[Any]

2009-10-02 Thread Tim Nelson
Add this below the lift-core dependency:


   net.liftweb
 lift-json
   1.1-SNAPSHOT
 

Tim

On Fri, Oct 2, 2009 at 11:17 AM, Peter Robinett wrote:

>
> Thanks, David. Unfortunately, I get errors that net.liftweb.json does
> not exist. I imagine this is a configuration problem with my pom.xml,
> which is here: http://gist.github.com/199860. Could you or someone
> else conversant in Maven give me some tips to how to make sure I get
> lift-json?
>
> Thanks,
> Peter
>
> On Oct 2, 2:26 pm, David Pollak  wrote:
> > Peter,
> >
> > I'd suggest using the stuff in lift-json.  It's a much faster, richer way
> to
> > use JSON.
> >
> > Thanks,
> >
> > David
> >
> > On Thu, Oct 1, 2009 at 4:31 PM, Peter Robinett  >wrote:
> >
> >
> >
> >
> >
> > > Hi all,
> >
> > > Building off of a previous thread[1], I'm trying to parse a POST
> > > request that contains JSON data. Specifically, I expect a JSON array
> > > of JSON objects representing Packet model data and want to have a List
> > > [Packet] at the end.
> >
> > > I am trying the following:
> > > val packets = for {
> > >JSONPackets <- req.param("packets")
> > >packet <- JSONParser.parse(JSONPackets)
> > >nodeId <- packet.param("node")
> > >node <- nodeId.toLong
> > > } yield {
> > >val packet = Packet.create.node(node)
> > >packet.save
> > >packet
> > > }
> >
> > > The problem is that JSONParser.parse returns a List[Any], so packet is
> > > of type Any. I can try to convert packet to a Map with
> > > packet.asInstanceOf[Map[String, String]], but this seems to just push
> > > my type problems to the next line of code. I'm having a hard time
> > > getting to the point where I have the Map[String, String] from which I
> > > know I can extract values to create Packets, so I would appreciate
> > > suggestions on how to do this.
> >
> > > This all seems quite complicated and I wonder if I'm missing an easier
> > > way to do this. Is JSONParse the way to go, or should I switch to
> > > Joni's lift-json stuff? I'm using 1.1-M5 but would be willing to
> > > switch to 1.1-SNAPSHOT...
> >
> > > Thanks for your help.
> >
> > > Peter Robinett
> >
> > > [1]
> > >http://groups.google.com/group/liftweb/browse_thread/thread/5ffe64492.
> ..
> > > [2]http://groups.google.com/group/liftweb/msg/c0103375623f788f
> >
> > --
> > 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: Unwarranted dependencies in lift-record

2009-09-29 Thread Tim Nelson
Aren't most of the dependencies that Record relies on coming from the RDBMS
code?

Would it make sense to move that code to a separate module
(lift-record-rdbms)?

I don't like all of the dependencies that Record relies on because I'm not
using the RDBMS code, I'm using a custom Record back end.

It would be nice to have Record a completely separate module, but I think at
least moving the RDBMS and therefore the Mapper dependency to a separate
module would be very easy and remove most of the dependencies.

Tim

On Tue, Sep 29, 2009 at 8:01 AM, Timothy Perrett wrote:

>
> This is my point - record should be more abstract... we dont want it
> depending on all that stuff its pointless.
>
> @dpp or @marius... what are your thoughts?
>
> Cheers, Tim
>
> On 29 Sep 2009, at 12:44, Indrajit Raychaudhuri wrote:
>
> >
> > lift-record depends on lift-mapper and since lift-mapper is heavily
> > dependent on lift-webkit, lift-record ends up depending on lift-webkit
> > as well.
> >
> > So at the moment, lift-record would end up depending on lift-webkit
> > (and
> > lift-widget!) indirectly even if you remove reference to lift-webkit
> > (superfluous) from lift-record pom.
> >
> > lift-widget part is simpler (just one reference in MappedInt, intend
> > to
> > take up later if somebody else don't beat me) but lift-webkit looks
> > lot
> > of work.
> >
> > Cheers, Indrajit
> >
> >
> > On 29/09/09 3:12 PM, Timothy Perrett wrote:
> >>
> >> Guys,
> >>
> >> I just noticed that lift-record depends on lift-webket because of
> >> some
> >> calls to S... IMHO, we need to remove this because thats simply too
> >> tight a coupling between the webkit and an abstract persistence
> >> interface like record.
> >>
> >> For instance, one record abstraction I wrote isn't even used in
> >> webapps...
> >>
> >> 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] Re: lift-json serialization

2009-09-24 Thread Tim Nelson
Excellent. Thanks.

On Thu, Sep 24, 2009 at 2:21 AM, Joni Freeman wrote:

>
> Tim,
>
> Extracted function is now in master. I renamed it as 'decompose' since
> it decomposes case class into JSON AST.
>
> Thanks again, Joni
>
> On Sep 21, 6:52 pm, Tim Nelson  wrote:
> > First of all thanks for a great library. I'm finding lift-json quite
> useful
> > in my current project.
> >
> > I have a use case where I need to convert a case class into a JObject.
> The
> > code is there, but it's wrapped inside the Serialization object. So, I
> took
> > the liberty of moving the serialize method to the Extraction object and
> made
> > it publicly accessible. You can see my changes here:
> >
> > http://github.com/eltimn/liftweb/commit/30310f4800b2aeb880b246e99dc79...
> >
> > It doesn't affect the current API at all and all tests passed. What do
> you
> > think?
> >
> > Feel free to move it wherever you think it should be. As long as it's
> > publicly accessible, I'll be happy.
> >
> > Thanks,
> > 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] lift-json serialization

2009-09-21 Thread Tim Nelson
First of all thanks for a great library. I'm finding lift-json quite useful
in my current project.

I have a use case where I need to convert a case class into a JObject. The
code is there, but it's wrapped inside the Serialization object. So, I took
the liberty of moving the serialize method to the Extraction object and made
it publicly accessible. You can see my changes here:

http://github.com/eltimn/liftweb/commit/30310f4800b2aeb880b246e99dc79031d0373d08

It doesn't affect the current API at all and all tests passed. What do you
think?

Feel free to move it wherever you think it should be. As long as it's
publicly accessible, I'll be happy.

Thanks,
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: Pain Building Lift

2009-09-20 Thread Tim Nelson
The appendices were not included in the printed book. You can get them
online here:
http://www.apress.com/book/downloadfile/4390

Also, they are included in the os version of the book:
http://groups.google.com/group/the-lift-book

Tim

On Sun, Sep 20, 2009 at 7:44 AM, runt  wrote:

>
> Thank you all for the responses.
>
> I try and build everything from source - and no it is not always easy
> but I like doing it. I sudo'd because I was in /usr/local/src - on my
> machine this did require sudo. I had already played around with lift
> using the maven commands and from the Eclipse IDE - this is well
> documented online and in the books I have bought. Did the hello world
> thing (from your book Derek, p.s. where are the Appendixes? Seriously
> I can't find them in the copy I paid for from Apress), then tried to
> build from source...
>
> And this is an example where an idiot compiling from source is evil -
> the problem was path related. Running java -version reports the 1.6
> java I downloaded and installed from sun. Running mvn -version shows
> otherwise (on my mac now as I had this light bulb moment at home)
>
> myee-riris-macbook-pro:liftweb runt$ /opt/apache-maven-2.2.1/bin/mvn -
> version
> Apache Maven 2.2.1 (r801777; 2009-08-07 05:16:01+1000)
> Java version: 1.5.0_16
> Java home: /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/
> Home
> Default locale: en_US, platform encoding: MacRoman
> OS name: "mac os x" version: "10.5.8" arch: "i386" Family: "unix"
>
> Fixed the path to use my 1.6 java. Can now build successfully, and
> have been checking it out. Happiness++.
>
> My apologies for spamming you with my stupidity. Take pleasure in
> knowing said stupidity is immortalised on the web.
>
> On Sep 20, 6:06 am, mond ray mond  wrote:
> > Ha - beat you ;-)
> >
> > [INFO]
> > 
> > [INFO] BUILD SUCCESSFUL
> > [INFO]
> > 
> > [INFO] Total time: 7 minutes 56 seconds
> > [INFO] Finished at: Sat Sep 19 22:02:30 CEST 2009
> > [INFO] Final Memory: 47M/85M
> > [INFO]
> > 
> > bash-3.2$
> >
> > Must have been the 'clean'.  My missus says I should tidy up more
> > often too!
> >
> > Thanks for the support
> >
> > Best regards
> >
> > Ray
> >
> > On Sep 19, 7:03 pm, David Pollak 
> > wrote:
> >
> > > On my Mac OS X box:
> >
> > > pony:liftweb dpp$ mvn -version
> > > Maven version: 2.0.9
> > > Java version: 1.6.0_15
> > > OS name: "mac os x" version: "10.6" arch: "i386" Family: "mac"
> > > pony:liftweb dpp$
> >
> > > Here's the build log:
> >
> > > pony:~ dpp$ cd tmp/
> > > pony:tmp dpp$ git clone git://github.com/dpp/liftweb.git
> > > Initialized empty Git repository in /Users/dpp/tmp/liftweb/.git/
> > > remote: Counting objects: 35122, done.
> > > remote: Compressing objects: 100% (12807/12807), done.
> > > remote: Total 35122 (delta 14036), reused 34877 (delta 13857)
> > > Receiving objects: 100% (35122/35122), 18.53 MiB | 907 KiB/s, done.
> > > Resolving deltas: 100% (14036/14036), done.
> > > pony:tmp dpp$ cd liftweb/
> > > pony:liftweb dpp$ git tag
> > > 0.10
> > > 0.9
> > > 1.0
> > > 1.0.1
> > > 1.0.2
> > > 1.1-M1
> > > 1.1-M3
> > > 1.1-M4
> > > 1.1-M5
> > > bonded_to_rev_121_baf_dpp
> > > buy_a_feature_svn_130
> > > igo_1_0
> > > innovation_games_oneline_1_0
> > > osgi01
> > > teched08_demo_jam
> > > pony:liftweb dpp$ git checout 1.0.2
> > > git: 'checout' is not a git-command. See 'git --help'.
> >
> > > Did you mean this?
> > > checkout
> > > pony:liftweb dpp$ git checkout 1.0.2
> > > Note: moving to '1.0.2' which isn't a local branch
> > > If you want to create a new branch from this checkout, you may do so
> > > (now or later) by using -b with the checkout command again. Example:
> > >   git checkout -b 
> > > HEAD is now at eb3efbd... [release] prepare 1.0.2
> > > pony:liftweb dpp$ mvn clean install
> > > [INFO] Scanning for projects...
> > > [INFO] Reactor build order:
> > > [INFO]   Lift
> > > [INFO]   Lift Utils
> > > [INFO]   Lift WebKit
> > > [INFO]   Lift Mapper
> > > [INFO]   Lift Machine
> > > [INFO]   Lift Record
> > > [INFO]   Lift Textile
> > > [INFO]   Lift Facebook
> > > [INFO]   Lift AMQP
> > > [INFO]   Lift XMPP
> > > [INFO]   Lift Widgets
> > > [INFO]   Lift OpenID
> > > [INFO]   Lift OAuth
> > > [INFO]   Lift PayPal
> > > [INFO]   Lift TestKit
> > > [INFO]   Lift Core (full lift)
> > > [INFO]   Lift Sites
> > > [INFO]   Lift Example
> > > [INFO]   Skittr Example
> > > [INFO]   HelloLift example application
> > > [INFO]   HelloDarwin tutorial application
> > > [INFO]   JPA Demo Master
> > > [INFO]   JPADemo-spa
> > > [INFO]   JPADemo-web
> > > [INFO]   HTTP Authentication example
> > > [INFO]   lift-archetype-blank
> > > [INFO]   lift-archetype-basic
> > > WAGON_VERSION: 1.0-beta-2
> > > [INFO]
> > >
> ---

[Lift] Re: trouble with comet Clock example

2009-09-15 Thread Tim Nelson
Comet classes are supposed to go in the comet folder. It looks like you have
it in your snippet folder. Did you try putting the clock class in the comet
folder?

On Tue, Sep 15, 2009 at 7:34 AM, Jack Widman  wrote:

> And here is the error again:
> Error!
> XML parsing failed
>
> XML parsing failed: syntax error (Line: 13, Character: 4)
>
> Reparse document as HTML
> Error:undeclared XML namespace prefix used in attribute name
> Specification:http://www.w3.org/TR/xml-names11/#nsc-NSDeclared
>  10:   
>  11:
>  12:   
>  13: Missing Clock
>  14:
>  15:
>  16:   

[Lift] Re: how do you set system properties in lift?

2009-09-08 Thread Tim Nelson
You need to set system properties:

System.setProperty("mail.smtp.starttls.enable","true");
System.setProperty("mail.smtp.host", host)
System.setProperty("mail.smtp.port", "587")
System.setProperty("mail.smtp.auth", "true")
Mailer.authenticator = Full(new Authenticator {
override def getPasswordAuthentication =
new PasswordAuthentication(user, password)
})

Tim

On Tue, Sep 8, 2009 at 12:03 PM, george  wrote:

>
> say I wanted to change the port / host that the Mailer uses.
>
> how would I go about that?
>
> 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: Logging sql queries generated by Mapper

2009-09-04 Thread Tim Nelson
Someone recently posted this to the wiki:

http://wiki.github.com/dpp/liftweb/how-to-configure-logging

On Fri, Sep 4, 2009 at 9:03 AM, José María  wrote:

>
> Hi,
>
> I'm new to JAVA as platform, I want to see the sql queries generated
> by Mapper queries. I've been reading the LiftWeb book but logging
> appears only as an appendix at the end and it doesn't tell you
> how to configure the Log system.
>
> Should I use Log4J config? Where should I put the configuration files?
>
> 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: h2 web console

2009-08-12 Thread Tim Nelson
That actually starts up a webserver that serves the H2 console servlet.
Alternatively, you can just use the servlet inside your existing app,
without having to start a separate web server.

http://gist.github.com/19

Also, if you're using H2, you might want to try their built-in connection
pool.

http://gist.github.com/166687

Tim

On Wed, Aug 12, 2009 at 1:14 PM, jon  wrote:

>
> Hi,
>
> For those using h2, you can make a call to the following function from
> boot to start up a web console while you're running in development
> mode:
>
>  def startH2WebConsole = {
>if (Props.mode == Props.RunModes.Development) {
>  import _root_.org.h2.server.web.WebServer
>  import _root_.org.h2.tools.Server
>  import _root_.org.h2.util.StartBrowser
>  val webServer = new WebServer()
>  val server  = new Server(webServer, Array("-webPort", "0"))
>  server.start
>  DBVendor.newConnection(DefaultConnectionIdentifier).map
> (c=>StartBrowser.openURL(webServer.addSession(c)))
>}
>  }
>
> - Jon
> >
>

--~--~-~--~~~---~--~~
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: makeUtf8 and HttpServletRequest broken in new build???

2009-08-10 Thread Tim Nelson
There were changes made to remove the requirement for lift to run in a
servlet container. See:

http://groups.google.com/group/liftweb/browse_thread/thread/a3486a7b9e9ffa40


On Mon, Aug 10, 2009 at 11:49 AM, glenn  wrote:

>
> I just got a type mismatch found error in LiftRules.early.append
> (makeUtf8) in Boot.scala.
>
> It's now looking for an net.liftweb.http.provider.HTTPRequest instead
> of a javax.servlet.http.HttpServletRequest.
>
> Is this a new change, and if so, where is the
> net.liftweb.http.provider package?
>
> 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: URL rewriting woes

2009-08-07 Thread Tim Nelson
Paul,

The basic problem here is that whatever you put in the RewiteResponse must
be in your SiteMap. So, to get a url like /customer/list/1 to be rewritten
to /cust.html?page=1

you would need:

Menu(Loc("Customers",
"cust"::Nil, "Customers"))

in your SiteMap. Doing this however means that your menu link will be /cust
and you would have to manually generate your links.

I am running into this same "problem" and haven't figured out how to handle
it yet.

Tim

On Fri, Aug 7, 2009 at 11:28 AM, pabraham wrote:

>
> Hello again,
>
> I've been looking at the article on URL rewriting at [1] and am having
> a problem getting a URL rewrite to work.
>
> My sitemap contains Menu(Loc("Customers",
> "customer"::"list"::"1"::Nil, "Customers")), so clicking on Customers
> gives a link to /customer/list/1.
>
> My rewrite is:
>LiftRules.rewrite.append {
>  case RewriteRequest(ParsePath("customer"::"list"::page::Nil, _,
> _, _), _, _) =>
>  RewriteResponse("cust" :: Nil, Map("page" -> page))
>}
>
> so clicking on /customer/list/1 should show cust.html and give me a
> "page" parameter.  The cust.html file exists.
>
> Unfortunately I get "The Requested URL /customer/list/1 was not found
> on this server".
>
> Do I need to do anything else to get this to work?
>
> Paul.
>
> [1] http://wiki.github.com/dpp/liftweb/about-url-rewriting
>
> >
>

--~--~-~--~~~---~--~~
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: SiteMap gives "No Navigation Defined."

2009-08-07 Thread Tim Nelson
It appears that the listing in the book is wrong. The behavior you are
describing is as expected. The first parameter is the name (acts as an id)
of the link, while the 3rd param is the text that is displayed in the menu.
Here is the relevant snippet in the source:

/**
   * Create a Loc (Location) instance
   *
   * @param name -- the name of the location.  This must be unique across
your entire sitemap.
   * It's used to look up a menu item in order to create a link to the menu
on a page.
   * @param link -- the Link to the page
   * @param text -- the text to display when the link is displayed
   * @param params -- access test, title calculation, etc.
   *
   */
  def apply(theName: String,
theLink: Link[NullLocParams],
theText: LinkText[NullLocParams],
theParams: LocParam*): Loc[NullLocParams] =

Tim

On Fri, Aug 7, 2009 at 6:31 AM, pabraham wrote:

>
> Yes, I realise I was a bit unclear, and got myself a bit confused
> about when things were working and when they weren't.  I had been
> changing Boot.scala, running "mvn compile" and letting "mvn jetty:run"
> pick up the changes.
>
> I have now changed the way I'm approaching this to:
>
> vi Boot.scala
> mvn clean jetty:run
> (browse to localhost:8080)
> Ctrl+C (to stop jetty)
>
> By doing this I know I'm starting from a clean sheet each time.
>
> Now on to the SiteMap.
>
> My default.html contains  in the
>  section.
>
> First attempt:
>
> Boot.scala contains val entries = Menu(Loc("Home", "index"::Nil,
> "Home")) :: Menu(Loc("Customers", "customer"::Nil, "Customers")) ::
> Nil
>
> When I run this, the site map is shown as "Home", "Customers" and my
> home page has a title of "Home" and my customers page has a title of
> "Customers".  To me this is expected behaviour.
>
> Second attempt:
>
> Boot.scala contains val entries = Menu(Loc("Home Page", "index"::Nil,
> "Home")) :: Menu(Loc("Customers", "customer"::Nil, "Customers")) ::
> Nil
>
> When I run this, the site map is shown as "Home", "Customers" and my
> home page has a title of "Home" and my customers page has a title of
> "Customers".  I'm not expecting this as the PDF book (page ~62,
> listing 5.12) suggests that the title of my home page should become
> "Home Page".
>
> Third attempt:
>
> Boot.scala contains val entries = Menu(Loc("Home", "index"::Nil, "Home
> Page")) :: Menu(Loc("Customers", "customer"::Nil, "Customers")) :: Nil
>
> When I run this, the site map is shown as "Home Page", "Customers" and
> my home page has a title of "Home Page" and my customers page has a
> title of "Customers".  I'm not expecting this.
>
> So my question now is this: can I get the title of my page to be
> different from the title in the site map?
>
> Thanks everyone for your help so far.
>
> Paul.
>
>
>
>
> On Aug 6, 9:55 pm, Derek Chen-Becker  wrote:
> > So it's working correctly, or it's still broken? "same thing doesn't
> happen"
> > is a bit unclear ;)
> >
> > Derek
> >
> > On Thu, Aug 6, 2009 at 1:56 PM, pabraham  >wrote:
> >
> >
> >
> > > Actually, same thing doesn't happen.  If I change the third argument,
> > > I get this as the title in my browser as well as the link in the site
> > > map.
> >
> > > On 6 Aug, 20:51, pabraham  wrote:
> > > > Same thing happens, i.e. I get "No Navigation Defined." and no title.
> >
> > > > On 6 Aug, 20:38, Naftoli Gugenheim  wrote:
> >
> > > > > Not sure why you're getting no nav, but I think you want to change
> the
> > > other Home - the first string is the id of the link.
> >
> > > > > -
> >
> > > > > pabraham wrote:
> >
> > > > > Hello there,
> >
> > > > > I've been looking at SiteMap and trying to get it to give me a page
> > > > > title, based on the SiteMap section in the Lift book (PDF version).
> > > > > Here's how I've tried.
> >
> > > > > Boot.scala
> >
> > > > > // Build SiteMap
> > > > > val entries = Menu(Loc("Home", "index"::Nil, "Home")) :: Nil
> > > > > LiftRules.setSiteMap(SiteMap(entries:_*))
> >
> > > > > default.html
> >
> > > > > 
> > > > > ...
> > > > > 
> > > > > ...
> > > > > 
> > > > > 
> > > > > ...
> > > > > 
> >
> > > > > This works fine, and gives me "Home" as the title of my page.
> >
> > > > > Now I actually want a different title, so I change the Loc bit to
> Loc
> > > > > ("abcdefg", "index"::Nil, "Home") and get "No Navigation Defined."
> >
> > > > > What am I doing wrong here?
> >
> > > > > 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
-~--~~~~--~~--~--~---



[Lift] Re: Where do I place a default.props file for use by Boot?

2009-08-05 Thread Tim Nelson
Try src/main/resources/props

On Wed, Aug 5, 2009 at 7:19 PM, Jeff McKenna  wrote:

>
> Newbee:
> I have a default.props file that I was able to read once.  I seem to
> have lost the incantation.
> Where do I put it.  I thought src/resouces would work.  But boot can
> not see to read the file.
> Any suggestions?
> >
>

--~--~-~--~~~---~--~~
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: Another backtrace on reload

2009-08-02 Thread Tim Nelson
David,

I actually use java rebel and don't auto reload jetty, but you still need to
re-start it sometimes. Anyway, I just start jetty in batch mode (using sbt),
so it's not really an issue. The situation got me thinking about a shutdown
hook and I was just curious if there was something like that. Thanks for
pointing that out.

Tim

On Sun, Aug 2, 2009 at 9:02 AM, David Pollak
wrote:

> Tim,
>
> Please take a look at LiftRules.unloadHooks.  These functions will be
> executed when the servlet is unloading.
>
> With that being said, I'd suggest not using Jetty's auto-restart feature.
> If you do, please use an external RDBMS (I find Postgres to be the best)
> rather than Derby.
>
> Thanks,
>
> David
>
>
> On Sat, Aug 1, 2009 at 9:07 AM, Tim Nelson  wrote:
>
>>
>> I just read your original post and that error is exactly what I was
>> referring to in my last post. The problem is, by default, the database
>> shuts down when the jvm shuts down. So, if you want to dynamically
>> restart jetty, you need a way to shutdown the db if the jvm is not
>> shutown. You can do as I described in my last post, using sbt, but
>> there are other options. I'm not sure if that will work with mvn.
>>
>> H2 comes with a DbStarter [1] ServletContextListener that will start
>> up and shutdown the db. It can also start up a tcp server, if you need
>> that. However, it requires you to specify the db url, user, and pass
>> as context-params. Which is a show stopper for me.
>>
>> There is only one line in DbStarter that one would really need and
>> that is a sql statement that is sent to the db. This code is in the
>> contextDestroyed method. So, if there is a way in Lift to call some
>> code when the servlet context is destroyed, then one could put that
>> sql statement there and manually shutdown the db.
>>
>> I realize you use Derby, but I'm guessing that it works similarly.
>>
>> So, Lifters, is there a way to call some code when the context is
>> destroyed? Or, is there another way to accomplish this?
>>
>> [1]
>> http://code.google.com/p/h2database/source/browse/trunk/h2/src/main/org/h2/server/web/DbStarter.java
>>
>> On Aug 1, 10:25 am, Tim Nelson  wrote:
>> > I was having the same problems using jetty's hot deploy with ~ prepare-
>> > webapp in sbt so I switched to using JavaRebel. It works much better
>> > and I haven't had any problems with reloading since. I don't think
>> > there's any info on the sbt site about jrebel, but it's real easy to
>> > get set up. Just install it and get a license (free for scala use)
>> > from them at:http://www.zeroturnaround.com/scala-license/
>> >
>> > Then change your sbt script to:
>> > java -Xmx256M -noverify -javaagent:/path/to/javarebel-2.0.2/
>> > javarebel.jar -jar `dirname $0`/sbt-launcher-0.5.1.jar "$@"
>> >
>> > I did run into a problem using an embedded H2 database, which may or
>> > may not occur with Derby, when using jetty-run/jetty-stop from the sbt
>> > prompt. What happens is jetty-stop does not shutdown the jvm, so H2
>> > doesn't shut down. To get around this I use "sbt jetty" directly in
>> > the terminal, that way when you stop it, the jvm shuts down and the db
>> > with it. I then have a second terminal that I open an sbt prompt in
>> > and use ~ prepare-webapp.
>> >
>> > For me, this setup has worked much better.
>> >
>> > Tim
>> >
>> > On Aug 1, 9:39 am, "Nolan Darilek"  wrote:
>> >
>> > > Wondering if anyone has gotten a chance to take a look at this? Life
>> got
>> > > busy, and since my Lift projects aren't commercial just yet, they went
>> > > on the back burner. But I'm still seeing this.
>> >
>> > > Also, not sure how I missed this question, but I don't think SBT is
>> > > undeploying the app before redeploying. Should it be? Maybe this is an
>> > > SBT rather than a Lift issue?
>> >
>> > > Here is a partial transcript of an SBT session, not sure if these are
>> > > the same errors. It involves me making a code change, at which point
>> > > ~prepare-webapp picks it up and redeploys. I then get an error, try
>> > > stopping and relaunching Jetty and get another. Also, after that
>> point,
>> > > I can't access the web app unless I completely restart SBT. Sorry for
>> > > the ANSI escape sequences in this.
>> >
>> > > If this

[Lift] Re: Another backtrace on reload

2009-08-01 Thread Tim Nelson

I just read your original post and that error is exactly what I was
referring to in my last post. The problem is, by default, the database
shuts down when the jvm shuts down. So, if you want to dynamically
restart jetty, you need a way to shutdown the db if the jvm is not
shutown. You can do as I described in my last post, using sbt, but
there are other options. I'm not sure if that will work with mvn.

H2 comes with a DbStarter [1] ServletContextListener that will start
up and shutdown the db. It can also start up a tcp server, if you need
that. However, it requires you to specify the db url, user, and pass
as context-params. Which is a show stopper for me.

There is only one line in DbStarter that one would really need and
that is a sql statement that is sent to the db. This code is in the
contextDestroyed method. So, if there is a way in Lift to call some
code when the servlet context is destroyed, then one could put that
sql statement there and manually shutdown the db.

I realize you use Derby, but I'm guessing that it works similarly.

So, Lifters, is there a way to call some code when the context is
destroyed? Or, is there another way to accomplish this?

[1] 
http://code.google.com/p/h2database/source/browse/trunk/h2/src/main/org/h2/server/web/DbStarter.java

On Aug 1, 10:25 am, Tim Nelson  wrote:
> I was having the same problems using jetty's hot deploy with ~ prepare-
> webapp in sbt so I switched to using JavaRebel. It works much better
> and I haven't had any problems with reloading since. I don't think
> there's any info on the sbt site about jrebel, but it's real easy to
> get set up. Just install it and get a license (free for scala use)
> from them at:http://www.zeroturnaround.com/scala-license/
>
> Then change your sbt script to:
> java -Xmx256M -noverify -javaagent:/path/to/javarebel-2.0.2/
> javarebel.jar -jar `dirname $0`/sbt-launcher-0.5.1.jar "$@"
>
> I did run into a problem using an embedded H2 database, which may or
> may not occur with Derby, when using jetty-run/jetty-stop from the sbt
> prompt. What happens is jetty-stop does not shutdown the jvm, so H2
> doesn't shut down. To get around this I use "sbt jetty" directly in
> the terminal, that way when you stop it, the jvm shuts down and the db
> with it. I then have a second terminal that I open an sbt prompt in
> and use ~ prepare-webapp.
>
> For me, this setup has worked much better.
>
> Tim
>
> On Aug 1, 9:39 am, "Nolan Darilek"  wrote:
>
> > Wondering if anyone has gotten a chance to take a look at this? Life got
> > busy, and since my Lift projects aren't commercial just yet, they went
> > on the back burner. But I'm still seeing this.
>
> > Also, not sure how I missed this question, but I don't think SBT is
> > undeploying the app before redeploying. Should it be? Maybe this is an
> > SBT rather than a Lift issue?
>
> > Here is a partial transcript of an SBT session, not sure if these are
> > the same errors. It involves me making a code change, at which point
> > ~prepare-webapp picks it up and redeploys. I then get an error, try
> > stopping and relaunching Jetty and get another. Also, after that point,
> > I can't access the web app unless I completely restart SBT. Sorry for
> > the ANSI escape sequences in this.
>
> > If this is an SBT issue then I'll gladly take it to that list. Thanks
> > for looking into this!
>
> > ERROR - Failed to Boot
> > java.lang.IllegalStateException: Cannot modify after boot.
> >      at net.liftweb.http.RulesSeq$class.safe_$qmark(LiftRules.scala:1056)
> >      at net.liftweb.http.RulesSeq$class.prepend(LiftRules.scala:1063)
> >      at net.liftweb.http.RulesSeq$$anon$5.prepend(LiftRules.scala:1043)
> >      at net.liftweb.http.LiftFilter.preBoot(LiftServlet.scala:564)
> >      at net.liftweb.http.LiftFilter.bootLift(LiftServlet.scala:555)
> >      at net.liftweb.http.LiftFilter.init(LiftServlet.scala:530)
> >      at
> > org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java:97)
> >      at
> > org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
> >      at
> > org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:620)
>
> >      at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
> >      at
> > org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1234)
>
> >      at
> > org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
> >      at
> > org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:460)
> >      at
> > org.mortbay.component.AbstractLifeCycle.start(Abstra

[Lift] Re: Another backtrace on reload

2009-08-01 Thread Tim Nelson

I was having the same problems using jetty's hot deploy with ~ prepare-
webapp in sbt so I switched to using JavaRebel. It works much better
and I haven't had any problems with reloading since. I don't think
there's any info on the sbt site about jrebel, but it's real easy to
get set up. Just install it and get a license (free for scala use)
from them at:
http://www.zeroturnaround.com/scala-license/

Then change your sbt script to:
java -Xmx256M -noverify -javaagent:/path/to/javarebel-2.0.2/
javarebel.jar -jar `dirname $0`/sbt-launcher-0.5.1.jar "$@"

I did run into a problem using an embedded H2 database, which may or
may not occur with Derby, when using jetty-run/jetty-stop from the sbt
prompt. What happens is jetty-stop does not shutdown the jvm, so H2
doesn't shut down. To get around this I use "sbt jetty" directly in
the terminal, that way when you stop it, the jvm shuts down and the db
with it. I then have a second terminal that I open an sbt prompt in
and use ~ prepare-webapp.

For me, this setup has worked much better.

Tim

On Aug 1, 9:39 am, "Nolan Darilek"  wrote:
> Wondering if anyone has gotten a chance to take a look at this? Life got
> busy, and since my Lift projects aren't commercial just yet, they went
> on the back burner. But I'm still seeing this.
>
> Also, not sure how I missed this question, but I don't think SBT is
> undeploying the app before redeploying. Should it be? Maybe this is an
> SBT rather than a Lift issue?
>
> Here is a partial transcript of an SBT session, not sure if these are
> the same errors. It involves me making a code change, at which point
> ~prepare-webapp picks it up and redeploys. I then get an error, try
> stopping and relaunching Jetty and get another. Also, after that point,
> I can't access the web app unless I completely restart SBT. Sorry for
> the ANSI escape sequences in this.
>
> If this is an SBT issue then I'll gladly take it to that list. Thanks
> for looking into this!
>
> ERROR - Failed to Boot
> java.lang.IllegalStateException: Cannot modify after boot.
>      at net.liftweb.http.RulesSeq$class.safe_$qmark(LiftRules.scala:1056)
>      at net.liftweb.http.RulesSeq$class.prepend(LiftRules.scala:1063)
>      at net.liftweb.http.RulesSeq$$anon$5.prepend(LiftRules.scala:1043)
>      at net.liftweb.http.LiftFilter.preBoot(LiftServlet.scala:564)
>      at net.liftweb.http.LiftFilter.bootLift(LiftServlet.scala:555)
>      at net.liftweb.http.LiftFilter.init(LiftServlet.scala:530)
>      at
> org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java:97)
>      at
> org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
>      at
> org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:620)
>
>      at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
>      at
> org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1234)
>
>      at
> org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
>      at
> org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:460)
>      at
> org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
>      at
> sbt.LazyJettyRun$$anonfun$sbt$LazyJettyRun$$reload$6.apply(WebApp.scala:198)
>
>      at
> sbt.LazyJettyRun$$anonfun$sbt$LazyJettyRun$$reload$6.apply(WebApp.scala:198)
>
>      at scala.List.foreach(List.scala:841)
>      at sbt.LazyJettyRun$.sbt$LazyJettyRun$$reload(WebApp.scala:198)
>      at sbt.LazyJettyRun$$anon$1.filesChanged(WebApp.scala:124)
>      at org.mortbay.util.Scanner.reportBulkChanges(Scanner.java:486)
>      at org.mortbay.util.Scanner.reportDifferences(Scanner.java:352)
>      at org.mortbay.util.Scanner.scan(Scanner.java:280)
>      at org.mortbay.util.Scanner$1.run(Scanner.java:232)
>      at java.util.TimerThread.mainLoop(Timer.java:512)
>      at java.util.TimerThread.run(Timer.java:462)
>  [0m[ [0minfo [0m]  [0mReload complete. [0m
>  [0m[ [0minfo [0m]  [0mCompilation successful. [0m
>  [0m[ [0minfo [0m]  [0m  Post-analysis: 17 classes. [0m
>  [0m[ [0minfo [0m]  [34m== compile == [0m
>  [0m[ [0minfo [0m]  [34m [0m
>  [0m[ [0minfo [0m]  [34m== prepare-webapp == [0m
>  [0m[ [0minfo [0m]  [34m== prepare-webapp == [0m
>  [0m[ [32msuccess [0m]  [0mSuccessful. [0m
>  [0m[ [0minfo [0m]  [0m [0m
>  [0m[ [0minfo [0m]  [0mTotal time: 10 s [0m
> Waiting for source changes... (press any key to interrupt)
>  [0m[ [0minfo [0m]  [0mReloading web application... [0m
>  [0m[ [0minfo [0m]  [0mNO JSP Support for /, did not find
> org.apache.jasper.servlet.JspServlet [0m
> ERROR - Failed to Boot
> java.lang.IllegalStateException: Cannot modify after boot.
>      at net.liftweb.http.RulesSeq$class.safe_$qmark(LiftRules.scala:1056)
>      at net.liftweb.http.RulesSeq$class.prepend(LiftRules.scala:1063)
>      at net.liftweb.http.RulesSeq$$anon$5.prepend(LiftRules.scala:1043)
>      at net.liftweb.http.LiftFilter.preBoot(LiftServlet.scala:564)
>      at net.liftweb.http.LiftFilter.bootLift(LiftServle

[Lift] Re: Newbee question

2009-07-22 Thread Tim Nelson
That would be the one. I looked for that the other day and didn't see it.

On Wed, Jul 22, 2009 at 8:47 AM, Timothy Perrett wrote:

>
> You mean like the one on the left hand side of the home page titled "The
> Lift Book"? ;-)
>
> Cheers, Tim
>
> On 22/07/2009 14:06, "Tim Nelson"  wrote:
>
> > @Lift coders: Is there a reason there is no link anywhere on the
> liftweb.net
> > <http://liftweb.net>  site to the Lift Book?
>
>
>
> >
>

--~--~-~--~~~---~--~~
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: Newbee question

2009-07-22 Thread Tim Nelson
You might want to check out the Lift Book:
http://groups.google.com/group/the-lift-book

@Lift coders: Is there a reason there is no link anywhere on the
liftweb.netsite to the Lift Book?

Tim

On Tue, Jul 21, 2009 at 11:29 PM, Jeff McKenna wrote:

>
> Xavi,
> That helps considerably.  Like you indicated, I still can not get .../
> test/ to find index without specifying it directly.
> Now I can go on with the tutorial.
> BTW. I am interested in how you found the better syntax to use.  I
> have been unable to find anything that describes a Loc except in the
> most cursory and not very useful manner and nothing that describes
> what the parameters actually mean.  It seems like examples are the
> only way to learn.  Perhaps this a new programming style: Programming
> by Wandering Around
> :-)
> Thanks again.
> Jeff
>
> On Jul 21, 7:44 pm, Xavi Ramirez  wrote:
> > Try renaming src/main/webapp/test.html to src/main/webapp/test1.html.
> > For some reason, I couldn't get test.html to show up, but test1.html
> > seems to work just fine.
> >
> > Also, try defining you sitemap using this syntax instead:
> >val entries = Menu(Loc("Home", List("index"), "Home")) ::
> >  Menu(Loc("Test1", List("test1"), "Test Page1")) ::
> >  Menu(Loc("Test2", List("test", "test"), "Test
> > Page2")) :: Nil
> >LiftRules.setSiteMap(SiteMap(pages:_*))
> >
> > Hope this helps!
> >
> > -Xavi
> >
> > On Tue, Jul 21, 2009 at 8:45 PM, Jeff McKenna
> wrote:
> >
> > > Hum.  I changed the
> > > import.Helpers._
> > > to
> > >import _root_.net.liftweb.util.Helpers._
> > > No change.
> > > I kept trying things to try to match the intent of the tutorial
> > > Here is my latest one
> > >val entries = Menu(Loc("Home", List("index"), "Home")) ::
> > >Menu(Loc("Test", List("/test/test"),
> "Test Page")) ::
> > > User.sitemap
> > > This compiles and continues to run 8080/
> > > But it does not run 8080/test/test.
> >
> > > I have the following files in place:
> > > a) at src/main/webapp/test/test.html
> > > http://www.w3.org/1999/xhtml";>
> > > 
> > >  Hello Friends!
> > > 
> > > 
> >
> > > b) at src/main/webapp/test.html
> > > http://www.w3.org/1999/xhtml";>
> > > 
> > >  Hello Friends!
> > > 
> > > 
> >
> > > I have changed the second Men item above to be "/test" or "/test/" or /
> > > test/test" and I always get the same error:
> > >  The Requested URL /test/test.html was not found on this server
> >
> > > I am stumped.
> >
> > > On Jul 21, 5:06 pm, Naftoli Gugenheim  wrote:
> > >> No, sorry, I assumed you were talking about Exploring Lift. Just
> import net.liftweb.util.Helpers._
> >
> > >> -
> >
> > >> Jeff McKenna wrote:
> >
> > >> I assume you mean in the wiki.
> > >> J
> >
> > >> On Jul 21, 3:36 pm, Naftoli Gugenheim  wrote:
> >
> > >> > Check the section "A Note on Standard Imports." Helpers has a bunch
> of implicits.
> >
> > >> > -
> >
> > >> > Jeff McKenna wrote:
> >
> > >> > I am just running the liftwebapp tutorial and am running into a
> > >> > confusion.
> > >> > In section 2.1 a mechanism to extend the sitemap by changing a line
> in
> > >> > Boot.scala
> > >> > val entries = Menu(Loc("Home", "/", "Home")) :: Menu(Loc("Test",
> "/
> > >> > test", "Test Page")) :: User.sitemap
> >
> > >> > When I do this, I get the following error when I run 'mvn jetty:run'
> > >> > ...
> > >> > [INFO] [scala:compile {execution: default}]
> > >> > [INFO] Checking for multiple versions of scala
> > >> > [INFO] Compiling 1 source files to /Users/jmckenna/Lift/hello-lift/
> > >> > target/classes
> > >> > [INFO] use java command with args in file forced : false
> > >> > /Users/jmckenna/Lift/hello-lift/src/main/scala/bootstrap/liftweb/
> > >> > Boot.scala:28: error: type mismatch;
> > >> >  found   : java.lang.String("/test")
> > >> >  required: net.liftweb.sitemap.Loc.Link
> > >> > [net.liftweb.sitemap.NullLocParams]
> > >> > Menu(Loc("Test", "/test", "Test Page")) ::
> User.sitemap
> > >> >  ^
> > >> > one error found
> > >> > [INFO]
> > >> >
> 
> > >> > [ERROR] BUILD FAILURE
> > >> > ...
> > >> > I kind of hope that tutorials work.  :-)  I tried a bunch of
> different
> > >> > ways to concatenate the menus but nothing seems to fix things up.  I
> > >> > used List(...) in place of the strings and removed the compilation
> > >> > errors.  But the site does not see the test directory. The error is:
> > >> > The Requested URL /test/ was not found on this server
> > >> > Any suggestions?
> > >> > Jeff
>
> >
>

--~--~-~--~~~---~--~~
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+u

[Lift] Re: PocketChange app. problems

2009-07-20 Thread Tim Nelson
The screenWrap option is there, it's just not being used. Instead of having
to override each page, you could replace the existing code with the
following(in model.User):
 // Spruce up the forms a bit
  override def loginXhtml =
  { super.loginXhtml }

  override def signupXhtml(user: User) =
  { super.signupXhtml(user) }

  override def changePasswordXhtml =
  { super.changePasswordXhtml }

  override def screenWrap = Full(
)

On Mon, Jul 20, 2009 at 11:53 AM, Tim Nelson  wrote:

> I just saw that the other day. The problem is those pages aren't being
> wrapped by the default template. In newer versions of Lift there is a
> default screenWrap, but 1.0 doesn't seem to have it.
> In order to add the wrapper, you need to add lines similar to the following
> to com.pocketchangeapp.model.User.scala
>
> override def changePasswordXhtml =
> 
>   { super.changePasswordXhtml }
> 
>
> That "fixes" the change password
> page. You'll need to look at the source of ProtoUser to see the other page 
> names:
>
> http://scala-tools.org/scaladocs/liftweb/1.0/
>
>
> On Mon, Jul 20, 2009 at 11:22 AM, Jon  wrote:
>
>>
>> Hello,
>>
>> I checked out the PocketChange app. like this:
>> git clone git://github.com/tjweir/pocketchangeapp.git
>>
>> When I run it, log in, and click on the "Change Password" link,
>> Firefox says "This XML file does not appear to have any style
>> information associated with it. The document tree is shown below."
>> The source I get looks like this:
>>
>> 
>> > www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
>> 
>>Change Password
>>  Old password> type="password" value="" />
>>  New password> type="password" value="" />
>>  New password (repeat)> name="F178147327359TLB" type="password" value="" />
>>   > type="submit" value="Change" />
>>
>>
>> 
>>
>> The same problem happens when I click on the "Edit User" link.
>>
>> I'm running the standard Lift 1.0 (on a Mac), except that I just had
>> to replace the included maven with maven 2.2.0, since the included one
>> suddenly gave me this message:
>> The plugin 'org.apache.maven.plugins:maven-jetty-plugin' does not
>> exist ...
>>
>> The PocketChange problems also occurred with the included maven.
>>
>> Sincerely,
>>
>> Jon Kleiser
>>
>> >>
>>
>

--~--~-~--~~~---~--~~
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: PocketChange app. problems

2009-07-20 Thread Tim Nelson
I just saw that the other day. The problem is those pages aren't being
wrapped by the default template. In newer versions of Lift there is a
default screenWrap, but 1.0 doesn't seem to have it.
In order to add the wrapper, you need to add lines similar to the following
to com.pocketchangeapp.model.User.scala

override def changePasswordXhtml =

  { super.changePasswordXhtml }


That "fixes" the change password
page. You'll need to look at the source of ProtoUser to see the other
page names:

http://scala-tools.org/scaladocs/liftweb/1.0/


On Mon, Jul 20, 2009 at 11:22 AM, Jon  wrote:

>
> Hello,
>
> I checked out the PocketChange app. like this:
> git clone git://github.com/tjweir/pocketchangeapp.git
>
> When I run it, log in, and click on the "Change Password" link,
> Firefox says "This XML file does not appear to have any style
> information associated with it. The document tree is shown below."
> The source I get looks like this:
>
> 
>  www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> 
>Change Password
>  Old password type="password" value="" />
>  New password type="password" value="" />
>  New password (repeat) name="F178147327359TLB" type="password" value="" />
>    type="submit" value="Change" />
>
>
> 
>
> The same problem happens when I click on the "Edit User" link.
>
> I'm running the standard Lift 1.0 (on a Mac), except that I just had
> to replace the included maven with maven 2.2.0, since the included one
> suddenly gave me this message:
> The plugin 'org.apache.maven.plugins:maven-jetty-plugin' does not
> exist ...
>
> The PocketChange problems also occurred with the included maven.
>
> Sincerely,
>
> Jon Kleiser
>
> >
>

--~--~-~--~~~---~--~~
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: Unique constraint

2009-07-03 Thread Tim Nelson
H2 has a great console servlet that you can use to connect to any jdbc
compliant database and I just figured out how to configure it to work with
lift.

Assuming you already have H2 as a dependency, just add a mapping to the
servlet in your web.xml. Mine looks like this:



  
LiftFilter
Lift Filter
The Filter that intercepts lift calls
net.liftweb.http.LiftFilter
  

  
LiftFilter
/*
  

  
H2Console
org.h2.server.web.WebServlet
1
  
  
H2Console
/console/*
  



Then you need to add a rule to LiftRules.liftRequest using the following
line in boot:

LiftRules.liftRequest.append({case r if (r.path.partPath match {case
"console" :: _ => true case _ => false}) => false})

That basically allows all requests that start with "console" to be ignored
by lift and passed thru to the servlet.

I am actually using PostgreSQL, but I prefer using this to pgAdmin or other
SQL tools.

Tim


On Fri, Jul 3, 2009 at 3:25 PM, Naftoli Gugenheim wrote:

> Okay. What about two fields in a unique constraint, e.g. first+last?Also,
> my H2 databased generated by schemifying allowed me to insert rows that had
> duplicate primary keys (or at least they're supposed to be primary keys).
> I'm using LongKeyedMapper ... with IdPK. Am I missing something?
> Anyone know how to read constraints in H2, meaning get it to to tell me
> what constraints/indexes exists?
> Thanks!
>
>
> On Thu, Jul 2, 2009 at 9:50 AM, Calen Pennington <
> calen.penning...@gmail.com> wrote:
>
>>
>> I actually had the same question last night. I didn't see the
>> valUnique on mapped string. However, it seems like a better way to do
>> this would be to change the Schemifier::ensureIndexes (line 260 in
>> Schemifier.scala) to do "CREATE UNIQUE INDEX" on request. Is there a
>> known reason why this is hard, or is it just that no one has taken the
>> time to do it yet? If it's the latter (and if I can figure out what's
>> going wrong with my attempts to build lift from source), I hope to
>> take a stab at it in the next day or two.
>>
>> -Cale
>>
>> On Thu, Jul 2, 2009 at 7:21 AM, Joe Wass wrote:
>> >
>> > Yes for MappedString, valUnique .
>> >
>> >
>> http://scala-tools.org/scaladocs/liftweb/1.0/net/liftweb/mapper/MappedString.html
>> >
>> > Joe
>> >
>> >
>> >
>> > On Jul 2, 7:55 am, Naftoli Gugenhem  wrote:
>> >> Does lift have any way to specify a unique constraint on a field, via
>> schemify (or validation)?
>> >> If not, how complex would it be to implement?
>> >
>> > >
>> >
>>
>>
>>
>
> >
>

--~--~-~--~~~---~--~~
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: Stax

2009-06-24 Thread Tim Nelson
I think they use Gant. http://gant.codehaus.org/

On Wed, Jun 24, 2009 at 3:10 PM, fan...@gmail.com  wrote:

>
> Tim Nelson a écrit :
> [...]
> > I did install their SDK and from what I can tell it's basically some
> > Groovy scripts that use Ant + Ivy.
>
> Gradle perhaps ? http://www.gradle.org/
>
>
> --
> Francois Armand
> http://fanf42.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: Stax

2009-06-24 Thread Tim Nelson
Although it's not in the docs, they do have a Lift 1.0 template that's at:
http://stax-downloads.s3.amazonaws.com/app-templates/0.3/lift-1.0.zip

This is normally downloaded automatically by their SDK, but you can download
it directly if you want to see what's in it without installing the SDK.

I don't see any reason that one couldn't make a new Maven archetype that is
Stax compatible.

However, it appears that, currently, you are required to use their SDK to
deploy apps. This was intentional on their part as they were worried users
would be turned off if they tried to load existing apps and had problems
with them, since there are certain limitations. There are problems with
Grails apps at the moment because it has it's own build system that
conflicts with Stax's SDK and they are working on an API that would allow
using a separate build system that calls the Stax API for deployment. This
would probably allow for a Maven plugin to be built for deploying Stax apps.

There's more details in this post from their forum:
http://developer.stax.net/forum/topics/grails-help-me-and-i-can-help

I did install their SDK and from what I can tell it's basically some Groovy
scripts that use Ant + Ivy.

Tim

On Wed, Jun 24, 2009 at 11:43 AM, David Pollak <
feeder.of.the.be...@gmail.com> wrote:

>
>
> On Wed, Jun 24, 2009 at 9:02 AM, Timothy Perrett 
> wrote:
>
>>
>> Agreed - this does really look very good... DPP, do you know how they
>> are doing the generation of applications? I guess they must have some
>> templating system and im just wondering if its something like our
>> existing archetypes and if they could be modified to become "stax
>> compatible" or whatever.
>
>
> I don't know, but this is a good question to ask them.
>
>
>>
>>
>> Cheers, Tim
>>
>> On Jun 24, 3:03 pm, "marius d."  wrote:
>> > Would be neat to have a Lift application template when creating a new
>> > stax app. And the fact they are using Amazon EC2 is really great.
>> >
>> > Br's,
>> > Marius
>> >
>> > On Jun 24, 4:53 pm, David Pollak 
>> > wrote:
>> >
>> >
>> >
>> > > Folks,
>> > > The folks in the ESME project have been hosting demo versions of ESME
>> onhttp://stax.net/
>> >
>> > > I had the pleasure of speaking with the CEO of
>> > > Stax yesterday.  I really like his vision of where he wants to take
>> > > Stax.  Plus, I think that Stax offers everything that GAE offers plus
>> > > a lot more flexibility and potential future growth.
>> >
>> > > One of the things I'm not so good with is figuring out the details of
>> > > what is needed for a given technology to be useful for an audience as
>> > > broad as the Lift community... I don't know what kinds of things are
>> > > necessary to have on the toolchain.
>> >
>> > > Could a few of you play with Stax and put together a list of stuff
>> you'd
>> > > like to see in Stax with respect to Lift.  Having that list will help
>> guide
>> > > the Stax folks to making Lift support even better.
>> >
>> > > Thanks,
>> >
>> > > David
>> >
>> > > --
>> > > Lift, the simply functional web frameworkhttp://liftweb.net
>> > > Beginning Scalahttp://www.apress.com/book/view/1430219890
>> > > Follow me:http://twitter.com/dpp
>> > > Git some:http://github.com/dpp
>>
>>
>
>
> --
> Lift, the simply functional web framework http://liftweb.net
> Beginning Scala http://www.apress.com/book/view/1430219890
>
> Follow me: http://twitter.com/dpp
> Git some: http://github.com/dpp
>
> >
>

--~--~-~--~~~---~--~~
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: Cheap Hosting

2009-06-15 Thread Tim Nelson
You might want to also look into Mosso's Cloud Servers. They use Slicehosts'
technology (Slicehost was purchased by rackspace, which owns mosso), but
don't package the bandwidth in the price. If you have small bandwidth needs,
it will be a little cheaper.
Another alternative is mor.ph. It is a PaaS that has JavaEE as a choice. You
just upload your WAR and off you go. I haven't tried this with a Lift app
yet, but it should work.

On Mon, Jun 15, 2009 at 8:28 AM, Jeremy Day  wrote:

> Mark,
>
> It is my understanding (and this could be incorrect, of course) that you
> can do whatever you want on a Slicehost Slice.  You can install whatever
> Java applications you like.  You have total control.
>
> Jeremy
>
>
> On Mon, Jun 15, 2009 at 8:02 AM, Mark Lynn  wrote:
>
>>
>> Thanks. That is certainly very reasonable and VPS hosting is definitely a
>> possibility. I guess what I am asking is whether there is shared hosting in
>> the Java realm where you can also install Scala and LIft? I'm assuming the
>> answer is not yet, but I thought I would ask.
>>
>>  Mark Lynn
>>
>>
>> On Jun 14, 2009, at 11:56 PM, David Pollak wrote:
>>
>> Mark,
>> You should be able to host a moderately trafficked site (400 unique
>> visitors an hour) with a $20 slicehost.com account.
>>
>> Thanks,
>>
>> David
>>
>> On Sun, Jun 14, 2009 at 4:40 PM, Mark Lynn  wrote:
>>
>>>
>>>
>>> I have a web app that I am doing free for a charitable organization
>>> that is sensitive to hosting costs. I would like to make it my first
>>> Lift app since it is pretty straight-forward - simple database and
>>> will probably just use Mapper. Most of my previous experience is with
>>> Rails projects or projects that were hosted internally so I don't have
>>> much experience with java hosting services. Does anyone have a
>>> recommendation for an inexpensive hosting option where I can use scala/
>>> lift? With Rails or PHP I can find stuff for as little as $5/mth.
>>>
>>> Mark Lynn
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>
>>
>> --
>> Lift, the simply functional web framework http://liftweb.net
>> Beginning Scala http://www.apress.com/book/view/1430219890
>> Follow me: http://twitter.com/dpp
>> Git some: http://github.com/dpp
>>
>>
>>
>>
>>
>>
>>
>
> >
>

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