[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] 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
timo...@getintheloop.eu 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.



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 jim.barr...@gmail.com wrote:


 On Wed, Feb 17, 2010 at 10:08 AM, Tamer Rizk tsr...@gmail.com 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 timo...@getintheloop.eu
 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 je...@ingolfs.dk
  wrote:
  On Wed, Feb 17, 2010 at 3:40 PM, trizk tsr...@gmail.com 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] 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 mads...@gmail.com 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

  properties
    scala.version2.7.7/scala.version
  /properties

 ...

    dependency
       groupIdnet.liftweb/groupId
       artifactIdlift-mapper/artifactId
       version2.0-M1/version
    /dependency
    dependency
       groupIdnet.liftweb/groupId
       artifactIdlift-widgets/artifactId
       version2.0-M1/version
    /dependency
    dependency

 --
 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 har...@gmail.com 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] 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 dri...@gmail.com 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 har...@gmail.com 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] (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 anim...@gmail.com 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\testsbt
 G:\project\testset SCRIPT_DIR=G:\cygwin\home\
 G:\project\testjava -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\testsbt update
 G:\project\testset SCRIPT_DIR=G:\cygwin\home\
 G:\project\testjava -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] 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 anim...@gmail.com 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] 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 rao...@gmail.com 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] 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.
wallaby.po...@googlemail.com 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 dri...@gmail.com wrote:
 By default sitemap will only show submenus nearby the current page. You
 can show the entire expanded menu by using lift:Menu.builder
 expandAll=true /
 You should try navigating to the Author List page and ensure that the
 Author Test menu shows up then.
 -Ross
 On Jan 6, 2010, at 9:20 AM, Jean-Luc wrote:

 Hi liftweb-list !

 Happy New Year to all !

 Well, I have an issue with sitemap submenus.

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

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

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

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

 Is there a known issue or am I missing something ?

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


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


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


-- 
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
hipertrac...@gmail.com 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
 (NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.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 d.sztwio...@gmail.com 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 timo...@getintheloop.eu 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 tnell...@gmail.com 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 d.sztwio...@gmail.com 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 d.sztwio...@gmail.com 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 joseph.h...@gmail.com 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=gstq=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:


 plugin
  groupIdorg.mortbay.jetty/groupId
    artifactIdmaven-jetty-plugin/artifactId
    configuration
       contextPath//contextPath
       scanIntervalSeconds5/scanIntervalSeconds
    /configuration
    dependencies
        dependency
          groupIdorg.apache.derby/groupId
          artifactIdderby/artifactId
          version10.4.2.0/version
        /dependency
    /dependencies
 /plugin


 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 scopeprovided/scope 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 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 anim...@gmail.com 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 tnell...@gmail.com 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 anim...@gmail.com 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 anim...@gmail.com 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 anim...@gmail.com 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 anim...@gmail.com wrote:

   Btw, there is the error message when the server is started.
###
scala.MatchError: ConnectionIdentifier(lift)
###

On Dec 6, 1:47 pm, Neil.Lv anim...@gmail.com 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 
  athttp://groups.google.com/group/liftweb?hl=en.

 --

 You received this message because you

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: 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 timo...@getintheloop.eu 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 tnell...@gmail.com 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:

 button type=submit class=button positive
   img src=css/blueprint/plugins/buttons/icons/tick.png alt=/ Save
 /button

 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:

button type=submit class=button positive
  img src=css/blueprint/plugins/buttons/icons/tick.png alt=/ Save
/button

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 chinasmile...@gmail.com 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 timo...@getintheloop.eu 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 chinasmile...@gmail.com 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.comliftweb%2bunsubscr...@googlegroups.com
   .
   For more options, visit this group athttp://
 groups.google.com/group/liftweb?hl=en
   .- 隐藏被引用文字 -
 
  - 显示引用的文字 -

 --

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




--

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




Re: [Lift] 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 har...@gmail.com 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.comliftweb%2bunsubscr...@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, chris.huis...@gmail.com 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 /a ^
 :97:1: '' not allowed in attrib value/p^
 :98:1: '' not allowed in attrib value/td^
 :99:1: '' not allowed in attrib valuetd valign=top width=70%^
 :99:27: whitespace expectedtd valign=top width=70% ^
 :99:27: '' expected instead of '%'td valign=top width=70% ^
 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.MarkupParser$class.content1(MarkupParser.scala:481)
 at 

[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 feeder.of.the.be...@gmail.com
 wrote:


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

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

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

 You could call bar.  However:

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

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

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

 object foo extends MappedString(this, 32)

 from

 var foo: MappedString[OtherThing] = _

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



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

Tim

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



[Lift] Re: JSONParse.parse and List[Any]

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

dependency
   groupIdnet.liftweb/groupId
 artifactIdlift-json/artifactId
   version1.1-SNAPSHOT/version
 /dependency

Tim

On Fri, Oct 2, 2009 at 11:17 AM, Peter Robinett pe...@bubblefoundry.comwrote:


 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 feeder.of.the.be...@gmail.com 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 pe...@bubblefoundry.com
 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: lift-json serialization

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

On Thu, Sep 24, 2009 at 2:21 AM, Joni Freeman freeman.j...@gmail.comwrote:


 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 tnell...@gmail.com 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 run...@gmail.com 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 mondraym...@gmail.com 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 feeder.of.the.be...@gmail.com
  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 new_branch_name
   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]
  
 
   [INFO] Building Lift
   [INFO]task-segment: [clean, install]
   [INFO]
  
 
   [INFO] artifact org.scala-tools:maven-scala-plugin: checking for
 updates
   from 

[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 jack.wid...@gmail.com 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:   body
  11:
  12:   !--FIXME - comet type: Full(com.authoritude.snippet.Clock) name:
 Full(Other) Not Found --
  13: clk:timeMissing Clock/clk:time
  14:
  15:
  16:   script type=text/javascript

 On Tue, Sep 15, 2009 at 8:32 AM, Jack Widman jack.wid...@gmail.comwrote:

 Here is the complete code for my Clock example
 *class*

 import scala.xml._
 import net.liftweb.http.S
 import net.liftweb.http.CometActor
 import net.liftweb.http.SessionVar
 import net.liftweb.util._
 import _root_.scala.xml._
 import _root_.net.liftweb.util.Helpers._
 import scala.actors._




 class Clock extends CometActor {
   override def defaultPrefix = Full(clk)

   def render = bind(time - timeSpan)

   def timeSpan = (span id=time{timeNow}/span)

   ActorPing.schedule(this, Tick, 1L)

   override def lowPriority :
   PartialFunction[Any, Unit] = {
 case Tick = {
   partialUpdate(SetHtml(time,
 Text(timeNow.toString)))
   ActorPing.schedule(this,Tick, 1L)
 }
   }
 }

 case object Tick

 *markup - (I have also tried it with just *type=Clock since the package
 is in my Boot class)

 lift:surround with=default at=content
   lift:comet type=com.authoritude.snippet.Clock name=Other
 clk:timeMissing Clock/clk:time
   /lift:comet
 /lift:surround


 On Tue, Sep 15, 2009 at 8:25 AM, Jack Widman jack.wid...@gmail.comwrote:

 The package is correct. Here is the error
 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:   body
  11:
  12:   !--FIXME - comet type: Full(com.authoritude.snippet.Clock) name:
 Full(Other) Not Found --
  13: clk:timeMissing Clock/clk:time
  14:
  15:
  16:   script type=text/javascript
 I tried it both with the full class name and just Clock. I get the same
 error in both cases.
 Its seems to be saying clk is an undeclared namespace?


 On Tue, Sep 15, 2009 at 4:46 AM, Timothy Perrett
 timo...@getintheloop.eu wrote:


 Its telling you that the class Clock could not be found - if i were
 you, check the package definitions on the clock class to make sure its
 in the right namespace.

 Cheers, Tim

 On Sep 15, 3:38 am, jack jack.wid...@gmail.com wrote:
  I compiled the comet Clock app and used the following markup
 
  lift:surround with=default at=content
lift:comet type=Clock name=Other
  clk:timeMissing Clock/clk:time
/lift:comet
  /lift:surround
 
  I also used the standard default.html
 
  When I ran it, I got the error
 
  XML parsing failed: syntax error (Line: 13, Character: 4)
 
  Error:undeclared XML namespace prefix used in attribute name
  Specification:http://www.w3.org/TR/xml-names11/#nsc-NSDeclared
   10:   body
   11:
   12:   !--FIXME - comet type: Full(Clock) name: Full(Other) Not Found
  --
   13: clk:timeMissing Clock/clk:time
   14:
   15:
   16:   script type=text/javascript
 
  Any ideas?





 


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



[Lift] Re: how 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 geo...@mattandgeorge.com 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 josemariar...@gmail.com 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 jonhoff...@gmail.com 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 gl...@exmbly.com 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: 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 paulabraham...@googlemail.comwrote:


 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 titlelift:Menu.title//title in the
 head 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 dchenbec...@gmail.com 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 paulabraham...@googlemail.com
 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 paulabraham...@googlemail.com wrote:
Same thing happens, i.e. I get No Navigation Defined. and no title.
 
On 6 Aug, 20:38, Naftoli Gugenheim naftoli...@gmail.com 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.
 
 -
 
 pabrahampaulabraham...@googlemail.com 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
 
 head
 ...
 titleLift:Menu.title//title
 ...
 /head
 body
 ...
 lift:Menu.builder li_item:class=active/
 
 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: 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 paulabraham...@googlemail.comwrote:


 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: 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 agile.act...@gmail.com 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-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 no...@thewordnerd.info 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(LiftServlet.scala:555)
      at 

[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 tnell...@gmail.com 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 no...@thewordnerd.info 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

[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 agile.act...@gmail.comwrote:


 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 xavi@gmail.com 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 McKennaagile.act...@gmail.com
 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
   html xmlns=http://www.w3.org/1999/xhtml;
   body
Hello Friends!
   /body
   /html
 
   b) at src/main/webapp/test.html
   html xmlns=http://www.w3.org/1999/xhtml;
   body
Hello Friends!
   /body
   /html
 
   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 naftoli...@gmail.com wrote:
   No, sorry, I assumed you were talking about Exploring Lift. Just
 import net.liftweb.util.Helpers._
 
   -
 
   Jeff McKennaagile.act...@gmail.com wrote:
 
   I assume you mean in the wiki.
   J
 
   On Jul 21, 3:36 pm, Naftoli Gugenheim naftoli...@gmail.com wrote:
 
Check the section A Note on Standard Imports. Helpers has a bunch
 of implicits.
 
-
 
Jeff McKennaagile.act...@gmail.com 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+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 =
lift:surround with=default at=content
  div id=formBox{ super.changePasswordXhtml }/div
/lift:surround

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 jon.klei...@usit.uio.no 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:

 ?xml version=1.0 encoding=UTF-8?
 !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://
 www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
 form action=/user_mgt/change_password method=post
tabletrtd colspan=2Change Password/td/tr
  trtdOld password/tdtdinput name=F178147327358EIZ
 type=password value= //td/tr
  trtdNew password/tdtdinput name=F178147327359TLB
 type=password value= //td/tr
  trtdNew password (repeat)/tdtdinput
 name=F178147327359TLB type=password value= //td/tr
  trtdnbsp;/tdtdinput name=F178147337360QVW
 type=submit value=Change //td/tr

/table
 /form

 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:

web-app

  filter
filter-nameLiftFilter/filter-name
display-nameLift Filter/display-name
descriptionThe Filter that intercepts lift calls/description
filter-classnet.liftweb.http.LiftFilter/filter-class
  /filter

  filter-mapping
filter-nameLiftFilter/filter-name
url-pattern/*/url-pattern
  /filter-mapping

  servlet
servlet-nameH2Console/servlet-name
servlet-classorg.h2.server.web.WebServlet/servlet-class
load-on-startup1/load-on-startup
  /servlet
  servlet-mapping
servlet-nameH2Console/servlet-name
url-pattern/console/*/url-pattern
  /servlet-mapping

/web-app

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 naftoli...@gmail.comwrote:

 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 Wassj...@folktunefinder.com 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 naftoli...@gmail.com 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 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
-~--~~~~--~~--~--~---