[Lift] Bug in the examples

2009-11-01 Thread Petter Egesund

Hi, we have just started looking at Lift and are considering using it
in our next project.

We have started by looking at the examples. It seems to be a bug with
the autocomplete example? No suggestions seems to show up in any of my
browsers.

http://demo.liftweb.net/ajax

Cheers,

Petter

--~--~-~--~~~---~--~~
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: Error mvn install on lift-actor

2009-11-01 Thread Indrajit Raychaudhuri

Parser failing for sure.
Hope your local repo isn't corrupt by some chance.

/IRC

On 01/11/09 9:24 AM, Naftoli Gugenheim wrote:
 What could be wrong?


 C:\dev\gitrepo\liftweb\lift-base\lift-actormvn -e install
 + Error stacktraces are turned on.
 [INFO] Scanning for projects...
 WAGON_VERSION: 1.0-beta-2
 [INFO]
 
 [INFO] Building Lift Actor
 [INFO]task-segment: [install]
 [INFO]
 
 [INFO] [resources:resources]
 [INFO] Using 'UTF-8' encoding to copy filtered resources.
 [INFO] skip non existing resourceDirectory
 C:\dev\gitrepo\liftweb\lift-base\lift-actor\src\main\resources
 [INFO] [scala:compile {execution: scala-compile}]
 [INFO] Checking for multiple versions of scala
 [INFO] includes = [**/*.scala,**/*.java,]
 [INFO] excludes = []
 [INFO] Compiling 0 source files to
 C:\dev\gitrepo\liftweb\lift-base\lift-actor\target\classes
 [INFO] Nothing to compile - all classes are up to date
 [INFO] [compiler:compile]
 [INFO] Nothing to compile - all classes are up to date
 [INFO] [resources:testResources]
 [INFO] Using 'UTF-8' encoding to copy filtered resources.
 [INFO] skip non existing resourceDirectory
 C:\dev\gitrepo\liftweb\lift-base\lift-actor\src\test\resources
 [INFO] [scala:testCompile {execution: scala-testCompile}]
 [INFO] Checking for multiple versions of scala
 [INFO] includes = [**/*.scala,**/*.java,]
 [INFO] excludes = []
 [WARNING] No source files found.
 [INFO] [compiler:testCompile]
 [INFO] No sources to compile
 [INFO] [surefire:test]
 [INFO] Surefire report directory:
 C:\dev\gitrepo\liftweb\lift-base\lift-actor\target\surefire-reports

 ---
   T E S T S
 ---
 There are no tests to run.

 Results :

 Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

 [INFO] [jar:jar]
 [INFO] Building jar:
 C:\dev\gitrepo\liftweb\lift-base\lift-actor\target\lift-actor-1.1-SNAPSHOT.jar
 [INFO] [source:jar-no-fork {execution: default}]
 [INFO] [bundle:bundle {execution: default-bundle}]
 [INFO] [install:install]
 [INFO] Installing
 C:\dev\gitrepo\liftweb\lift-base\lift-actor\target\lift-actor-1.1-SNAPSHOT.jar
 to
 C:\Users\Naftoli\.m2\repository\net\liftweb\lift-actor\1.1-SNAPSHOT\lift-actor-1.1-SNAPSHOT.jar
 [INFO]
 
 [ERROR] BUILD ERROR
 [INFO]
 
 [INFO] Error installing artifact's metadata: Error installing metadata:
 Error updating group repository metadata

 only whitespace content allowed before start tag and not \u0 (position:
 START_DOCUMENT seen \u0... @1:1)
 [INFO]
 
 [INFO] Trace
 org.apache.maven.lifecycle.LifecycleExecutionException: Error installing
 artifact's metadata: Error installing metadata: Error updating group
 repository metadata
  at
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:703)
  at
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:540)
  at
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:519)
  at
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371)
  at
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:332)
  at
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181)
  at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
  at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
  at org.apache.maven.cli.MavenCli.main(MavenCli.java:356)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  at
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  at java.lang.reflect.Method.invoke(Method.java:597)
  at
 org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
  at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
  at
 org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
  at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
 Caused by: org.apache.maven.plugin.MojoExecutionException: Error
 installing artifact's metadata: Error installing metadata: Error
 updating group repository metadata
  at
 org.apache.maven.plugin.install.InstallMojo.execute(InstallMojo.java:143)
  at
 org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:483)
 

[Lift] Re: Error mvn install on lift-actor

2009-11-01 Thread Josh Suereth
It looks like the pom is in a different encoding then maven expects.  That's
a fun issue!  I would check maven's JIRA to see if someone else has reported
this issue and has a workaround.

Who is deploying/configuring Lift's POM files?   Are you using UTF-8 or
UTF-16 encoding?   In either case, I would check the pom.xml for lift-actors
in your local repo.  Pull it up in a text editor that will show you all
characters and switch encodings.


- Josh

On Sat, Oct 31, 2009 at 10:54 PM, Naftoli Gugenheim naftoli...@gmail.comwrote:

 What could be wrong?


 C:\dev\gitrepo\liftweb\lift-base\lift-actormvn -e install
 + Error stacktraces are turned on.
 [INFO] Scanning for projects...
 WAGON_VERSION: 1.0-beta-2
 [INFO]
 
 [INFO] Building Lift Actor
 [INFO]task-segment: [install]
 [INFO]
 
 [INFO] [resources:resources]
 [INFO] Using 'UTF-8' encoding to copy filtered resources.
 [INFO] skip non existing resourceDirectory
 C:\dev\gitrepo\liftweb\lift-base\lift-actor\src\main\resources
 [INFO] [scala:compile {execution: scala-compile}]
 [INFO] Checking for multiple versions of scala
 [INFO] includes = [**/*.scala,**/*.java,]
 [INFO] excludes = []
 [INFO] Compiling 0 source files to
 C:\dev\gitrepo\liftweb\lift-base\lift-actor\target\classes
 [INFO] Nothing to compile - all classes are up to date
 [INFO] [compiler:compile]
 [INFO] Nothing to compile - all classes are up to date
 [INFO] [resources:testResources]
 [INFO] Using 'UTF-8' encoding to copy filtered resources.
 [INFO] skip non existing resourceDirectory
 C:\dev\gitrepo\liftweb\lift-base\lift-actor\src\test\resources
 [INFO] [scala:testCompile {execution: scala-testCompile}]
 [INFO] Checking for multiple versions of scala
 [INFO] includes = [**/*.scala,**/*.java,]
 [INFO] excludes = []
 [WARNING] No source files found.
 [INFO] [compiler:testCompile]
 [INFO] No sources to compile
 [INFO] [surefire:test]
 [INFO] Surefire report directory:
 C:\dev\gitrepo\liftweb\lift-base\lift-actor\target\surefire-reports

 ---
  T E S T S
 ---
 There are no tests to run.

 Results :

 Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

 [INFO] [jar:jar]
 [INFO] Building jar:
 C:\dev\gitrepo\liftweb\lift-base\lift-actor\target\lift-actor-1.1-SNAPSHOT.jar
 [INFO] [source:jar-no-fork {execution: default}]
 [INFO] [bundle:bundle {execution: default-bundle}]
 [INFO] [install:install]
 [INFO] Installing
 C:\dev\gitrepo\liftweb\lift-base\lift-actor\target\lift-actor-1.1-SNAPSHOT.jar
 to
 C:\Users\Naftoli\.m2\repository\net\liftweb\lift-actor\1.1-SNAPSHOT\lift-actor-1.1-SNAPSHOT.jar
 [INFO]
 
 [ERROR] BUILD ERROR
 [INFO]
 
 [INFO] Error installing artifact's metadata: Error installing metadata:
 Error updating group repository metadata

 only whitespace content allowed before start tag and not \u0 (position:
 START_DOCUMENT seen \u0... @1:1)
 [INFO]
 
 [INFO] Trace
 org.apache.maven.lifecycle.LifecycleExecutionException: Error installing
 artifact's metadata: Error installing metadata: Error updating group
 repository metadata
 at
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:703)
 at
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:540)
 at
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:519)
 at
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371)
 at
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:332)
 at
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181)
 at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
 at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
 at org.apache.maven.cli.MavenCli.main(MavenCli.java:356)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at
 org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
 at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
 at
 org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
 at 

[Lift] Re: LiftTicket and AJAX

2009-11-01 Thread Marius

I think it would be great to have the editable in SHtml.

On Nov 1, 1:43 am, Derek Chen-Becker dchenbec...@gmail.com wrote:
 I have at least two different pieces of functionality here. The main
 workhorse is the AjaxUtils.editable method that actually generates the
 dynamic div. I was thinking that this might be good to put in SHtml (albeit
 with a different name). I also have the AjaxEditableField trait which mixes
 into a MappedField to provide a specialized asHtml, but I was thinking that
 maybe I should provide a trait that you could add to a Mapper that defines a
 list of fields that will be AJAXified, so that you can control which ones
 are editable via asHtml. I think I also need to add a boolean function
 parameter that lets you control whether the field becomes editable or not,
 so that you could easily tie it to a Loc.If or some other access control
 mechanism. Thoughts?

 Derek

 On Sat, Oct 31, 2009 at 8:08 AM, David Pollak feeder.of.the.be...@gmail.com

  wrote:
  Very cool!

  On Fri, Oct 30, 2009 at 4:44 PM, Derek Chen-Becker 
  dchenbec...@gmail.comwrote:

  I just committed some code for AJAX-editable fields that I think might be
  useful as a part of LiftWeb. Basically, if you've seen how ReviewBoard
  handles field editing, this is the same thing. It's a trait that can be
  mixed into any MappedField and as soon as M7 is release and I can merge the
  new ajaxForm postSubmit code into master, I'll have a demo that will work
  out of the box. If you're interested, take a look at it in GitHub:

 http://github.com/dchenbecker/LiftTicket/blob/master/src/main/scala/o...

  Constructive criticism would be appreciated.

  Derek

  --
  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: Error mvn install on lift-actor

2009-11-01 Thread Indrajit Raychaudhuri

Josh,

Of late, I have deploying/configuring Lift's POM files.
Have been using UTF-8 all along.

I have encountered this earlier while parsing XMLs (unrelated to Lift, 
Maven). Don't recall how it got fixed :(

In this case, probably causes could be:
- different encoding of pom
- different line-ending (those pesky ^M)
- local repo corruption (can happen with failed/incomplete download of 
dependencies)

Cheers, Indrajit


On 01/11/09 7:04 PM, Josh Suereth wrote:
 It looks like the pom is in a different encoding then maven expects.
 That's a fun issue!  I would check maven's JIRA to see if someone else
 has reported this issue and has a workaround.

 Who is deploying/configuring Lift's POM files?   Are you using UTF-8 or
 UTF-16 encoding?   In either case, I would check the pom.xml for
 lift-actors in your local repo.  Pull it up in a text editor that will
 show you all characters and switch encodings.


 - Josh

 On Sat, Oct 31, 2009 at 10:54 PM, Naftoli Gugenheim
 naftoli...@gmail.com mailto:naftoli...@gmail.com wrote:

 What could be wrong?


 C:\dev\gitrepo\liftweb\lift-base\lift-actormvn -e install
 + Error stacktraces are turned on.
 [INFO] Scanning for projects...
 WAGON_VERSION: 1.0-beta-2
 [INFO]
 
 [INFO] Building Lift Actor
 [INFO]task-segment: [install]
 [INFO]
 
 [INFO] [resources:resources]
 [INFO] Using 'UTF-8' encoding to copy filtered resources.
 [INFO] skip non existing resourceDirectory
 C:\dev\gitrepo\liftweb\lift-base\lift-actor\src\main\resources
 [INFO] [scala:compile {execution: scala-compile}]
 [INFO] Checking for multiple versions of scala
 [INFO] includes = [**/*.scala,**/*.java,]
 [INFO] excludes = []
 [INFO] Compiling 0 source files to
 C:\dev\gitrepo\liftweb\lift-base\lift-actor\target\classes
 [INFO] Nothing to compile - all classes are up to date
 [INFO] [compiler:compile]
 [INFO] Nothing to compile - all classes are up to date
 [INFO] [resources:testResources]
 [INFO] Using 'UTF-8' encoding to copy filtered resources.
 [INFO] skip non existing resourceDirectory
 C:\dev\gitrepo\liftweb\lift-base\lift-actor\src\test\resources
 [INFO] [scala:testCompile {execution: scala-testCompile}]
 [INFO] Checking for multiple versions of scala
 [INFO] includes = [**/*.scala,**/*.java,]
 [INFO] excludes = []
 [WARNING] No source files found.
 [INFO] [compiler:testCompile]
 [INFO] No sources to compile
 [INFO] [surefire:test]
 [INFO] Surefire report directory:
 C:\dev\gitrepo\liftweb\lift-base\lift-actor\target\surefire-reports

 ---
   T E S T S
 ---
 There are no tests to run.

 Results :

 Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

 [INFO] [jar:jar]
 [INFO] Building jar:
 
 C:\dev\gitrepo\liftweb\lift-base\lift-actor\target\lift-actor-1.1-SNAPSHOT.jar
 [INFO] [source:jar-no-fork {execution: default}]
 [INFO] [bundle:bundle {execution: default-bundle}]
 [INFO] [install:install]
 [INFO] Installing
 
 C:\dev\gitrepo\liftweb\lift-base\lift-actor\target\lift-actor-1.1-SNAPSHOT.jar
 to
 
 C:\Users\Naftoli\.m2\repository\net\liftweb\lift-actor\1.1-SNAPSHOT\lift-actor-1.1-SNAPSHOT.jar
 [INFO]
 
 [ERROR] BUILD ERROR
 [INFO]
 
 [INFO] Error installing artifact's metadata: Error installing
 metadata: Error updating group repository metadata

 only whitespace content allowed before start tag and not \u0
 (position: START_DOCUMENT seen \u0... @1:1)
 [INFO]
 
 [INFO] Trace
 org.apache.maven.lifecycle.LifecycleExecutionException: Error
 installing artifact's metadata: Error installing metadata: Error
 updating group repository metadata
  at
 
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:703)
  at
 
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:540)
  at
 
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:519)
  at
 
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371)
  at
 
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:332)
  at
 
 

[Lift] Scala Lift Off East

2009-11-01 Thread Bryan

I'm waiting for a ride to Union Station, so I thought I'd use this  
time to discuss some of the questions and concerns I heard about lift  
at the recent Scala Lift Off East.

Personally, I did not attend any of the lift sessions, so I'm  
definitely leaving a lot out.  I like lift and its community, so I  
want to make sure these points get mentioned.

1.  There were a handful of lift sessions called, but no active  
committers at the unconference to go into depth about a given topic.   
That could be why most of the sessions were about using lift in  
particular environments, such as clustered and under GAE.

2.  With the above said, much praise did go out to the lift community  
for their responsiveness to develop feature requests and fix bugs.

3.  There was interest -- myself included -- to learn more about Record.

4.  I heard a few discussions concerning the use of Sessions.  They  
wanted to know how this impacted scalability.

5.  Just an observation:  I was surprised to learn that many people at  
the conference had never used maven before.

6. Users discussed that lift was very fast to develop in.  One group  
there mentioned that they used lift to replace an existing PHP app.   
Another user held a session on how his company used lift to create its  
website in under 90 days. -- I hope I got that right.

--Bryan

Sent from my iPhone

--~--~-~--~~~---~--~~
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: Error mvn install on lift-actor

2009-11-01 Thread Naftoli Gugenheim

It can't be the POM -- it built it. It just couldn't install it. I wonder if 
it's related to the new structure. I emptied .m2/repository/new/liftweb and it 
seems to be working now.
Thanks.

-
Josh Suerethjoshua.suer...@gmail.com wrote:

It looks like the pom is in a different encoding then maven expects.  That's
a fun issue!  I would check maven's JIRA to see if someone else has reported
this issue and has a workaround.

Who is deploying/configuring Lift's POM files?   Are you using UTF-8 or
UTF-16 encoding?   In either case, I would check the pom.xml for lift-actors
in your local repo.  Pull it up in a text editor that will show you all
characters and switch encodings.


- Josh

On Sat, Oct 31, 2009 at 10:54 PM, Naftoli Gugenheim naftoli...@gmail.comwrote:

 What could be wrong?


 C:\dev\gitrepo\liftweb\lift-base\lift-actormvn -e install
 + Error stacktraces are turned on.
 [INFO] Scanning for projects...
 WAGON_VERSION: 1.0-beta-2
 [INFO]
 
 [INFO] Building Lift Actor
 [INFO]task-segment: [install]
 [INFO]
 
 [INFO] [resources:resources]
 [INFO] Using 'UTF-8' encoding to copy filtered resources.
 [INFO] skip non existing resourceDirectory
 C:\dev\gitrepo\liftweb\lift-base\lift-actor\src\main\resources
 [INFO] [scala:compile {execution: scala-compile}]
 [INFO] Checking for multiple versions of scala
 [INFO] includes = [**/*.scala,**/*.java,]
 [INFO] excludes = []
 [INFO] Compiling 0 source files to
 C:\dev\gitrepo\liftweb\lift-base\lift-actor\target\classes
 [INFO] Nothing to compile - all classes are up to date
 [INFO] [compiler:compile]
 [INFO] Nothing to compile - all classes are up to date
 [INFO] [resources:testResources]
 [INFO] Using 'UTF-8' encoding to copy filtered resources.
 [INFO] skip non existing resourceDirectory
 C:\dev\gitrepo\liftweb\lift-base\lift-actor\src\test\resources
 [INFO] [scala:testCompile {execution: scala-testCompile}]
 [INFO] Checking for multiple versions of scala
 [INFO] includes = [**/*.scala,**/*.java,]
 [INFO] excludes = []
 [WARNING] No source files found.
 [INFO] [compiler:testCompile]
 [INFO] No sources to compile
 [INFO] [surefire:test]
 [INFO] Surefire report directory:
 C:\dev\gitrepo\liftweb\lift-base\lift-actor\target\surefire-reports

 ---
  T E S T S
 ---
 There are no tests to run.

 Results :

 Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

 [INFO] [jar:jar]
 [INFO] Building jar:
 C:\dev\gitrepo\liftweb\lift-base\lift-actor\target\lift-actor-1.1-SNAPSHOT.jar
 [INFO] [source:jar-no-fork {execution: default}]
 [INFO] [bundle:bundle {execution: default-bundle}]
 [INFO] [install:install]
 [INFO] Installing
 C:\dev\gitrepo\liftweb\lift-base\lift-actor\target\lift-actor-1.1-SNAPSHOT.jar
 to
 C:\Users\Naftoli\.m2\repository\net\liftweb\lift-actor\1.1-SNAPSHOT\lift-actor-1.1-SNAPSHOT.jar
 [INFO]
 
 [ERROR] BUILD ERROR
 [INFO]
 
 [INFO] Error installing artifact's metadata: Error installing metadata:
 Error updating group repository metadata

 only whitespace content allowed before start tag and not \u0 (position:
 START_DOCUMENT seen \u0... @1:1)
 [INFO]
 
 [INFO] Trace
 org.apache.maven.lifecycle.LifecycleExecutionException: Error installing
 artifact's metadata: Error installing metadata: Error updating group
 repository metadata
 at
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:703)
 at
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:540)
 at
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:519)
 at
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371)
 at
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:332)
 at
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181)
 at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
 at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
 at org.apache.maven.cli.MavenCli.main(MavenCli.java:356)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at
 

[Lift] Re: Error mvn install on lift-actor

2009-11-01 Thread David Pollak
Yeah, I do rm -rf ~/.m2 about once a week.  Usually on Monday mornings just
before I go make myself some tea.

On Sun, Nov 1, 2009 at 7:55 AM, Naftoli Gugenheim naftoli...@gmail.comwrote:


 It can't be the POM -- it built it. It just couldn't install it. I wonder
 if it's related to the new structure. I emptied .m2/repository/new/liftweb
 and it seems to be working now.
 Thanks.

 -
 Josh Suerethjoshua.suer...@gmail.com wrote:

 It looks like the pom is in a different encoding then maven expects.
  That's
 a fun issue!  I would check maven's JIRA to see if someone else has
 reported
 this issue and has a workaround.

 Who is deploying/configuring Lift's POM files?   Are you using UTF-8 or
 UTF-16 encoding?   In either case, I would check the pom.xml for
 lift-actors
 in your local repo.  Pull it up in a text editor that will show you all
 characters and switch encodings.


 - Josh

 On Sat, Oct 31, 2009 at 10:54 PM, Naftoli Gugenheim naftoli...@gmail.com
 wrote:

  What could be wrong?
 
 
  C:\dev\gitrepo\liftweb\lift-base\lift-actormvn -e install
  + Error stacktraces are turned on.
  [INFO] Scanning for projects...
  WAGON_VERSION: 1.0-beta-2
  [INFO]
  
  [INFO] Building Lift Actor
  [INFO]task-segment: [install]
  [INFO]
  
  [INFO] [resources:resources]
  [INFO] Using 'UTF-8' encoding to copy filtered resources.
  [INFO] skip non existing resourceDirectory
  C:\dev\gitrepo\liftweb\lift-base\lift-actor\src\main\resources
  [INFO] [scala:compile {execution: scala-compile}]
  [INFO] Checking for multiple versions of scala
  [INFO] includes = [**/*.scala,**/*.java,]
  [INFO] excludes = []
  [INFO] Compiling 0 source files to
  C:\dev\gitrepo\liftweb\lift-base\lift-actor\target\classes
  [INFO] Nothing to compile - all classes are up to date
  [INFO] [compiler:compile]
  [INFO] Nothing to compile - all classes are up to date
  [INFO] [resources:testResources]
  [INFO] Using 'UTF-8' encoding to copy filtered resources.
  [INFO] skip non existing resourceDirectory
  C:\dev\gitrepo\liftweb\lift-base\lift-actor\src\test\resources
  [INFO] [scala:testCompile {execution: scala-testCompile}]
  [INFO] Checking for multiple versions of scala
  [INFO] includes = [**/*.scala,**/*.java,]
  [INFO] excludes = []
  [WARNING] No source files found.
  [INFO] [compiler:testCompile]
  [INFO] No sources to compile
  [INFO] [surefire:test]
  [INFO] Surefire report directory:
  C:\dev\gitrepo\liftweb\lift-base\lift-actor\target\surefire-reports
 
  ---
   T E S T S
  ---
  There are no tests to run.
 
  Results :
 
  Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
 
  [INFO] [jar:jar]
  [INFO] Building jar:
 
 C:\dev\gitrepo\liftweb\lift-base\lift-actor\target\lift-actor-1.1-SNAPSHOT.jar
  [INFO] [source:jar-no-fork {execution: default}]
  [INFO] [bundle:bundle {execution: default-bundle}]
  [INFO] [install:install]
  [INFO] Installing
 
 C:\dev\gitrepo\liftweb\lift-base\lift-actor\target\lift-actor-1.1-SNAPSHOT.jar
  to
 
 C:\Users\Naftoli\.m2\repository\net\liftweb\lift-actor\1.1-SNAPSHOT\lift-actor-1.1-SNAPSHOT.jar
  [INFO]
  
  [ERROR] BUILD ERROR
  [INFO]
  
  [INFO] Error installing artifact's metadata: Error installing metadata:
  Error updating group repository metadata
 
  only whitespace content allowed before start tag and not \u0 (position:
  START_DOCUMENT seen \u0... @1:1)
  [INFO]
  
  [INFO] Trace
  org.apache.maven.lifecycle.LifecycleExecutionException: Error installing
  artifact's metadata: Error installing metadata: Error updating group
  repository metadata
  at
 
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:703)
  at
 
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:540)
  at
 
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:519)
  at
 
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371)
  at
 
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:332)
  at
 
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181)
  at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
  at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
  at org.apache.maven.cli.MavenCli.main(MavenCli.java:356)
  at 

[Lift] camelCase to snake_case

2009-11-01 Thread aw

I am using Lift-Mapper with Oracle.  Oracle is a case-insensitive
database.  For Hibernate projects, I have used the Enhanced Naming
Convention to translate Java camelCase to a more Oracle friendly
snake_case.  I am interested in doing the same thing with Lift Mapper/
Record.

In the mean time, I need to override dbTableName and dbColumnName, but
I'd like to avoid that and just agree on the convention.

I could imagine that the Database Provider would maintain a flag to
say whether the database is case sensitive or not, and then based on
that flag, would pass either the camelCase directly (for case
sensitive), or snake_case(camelCase) (for case insensitive).

(Or, does this functionality already exist and I just haven't
configured it properly?)
--~--~-~--~~~---~--~~
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: camelCase to snake_case

2009-11-01 Thread Naftoli Gugenheim

Probably not too hard to do on your own via a trait: the trait should extend 
MappedField, override dbColumnName, and calculate it based on getClass.

-
awanth...@whitford.com wrote:


I am using Lift-Mapper with Oracle.  Oracle is a case-insensitive
database.  For Hibernate projects, I have used the Enhanced Naming
Convention to translate Java camelCase to a more Oracle friendly
snake_case.  I am interested in doing the same thing with Lift Mapper/
Record.

In the mean time, I need to override dbTableName and dbColumnName, but
I'd like to avoid that and just agree on the convention.

I could imagine that the Database Provider would maintain a flag to
say whether the database is case sensitive or not, and then based on
that flag, would pass either the camelCase directly (for case
sensitive), or snake_case(camelCase) (for case insensitive).

(Or, does this functionality already exist and I just haven't
configured it properly?)


--~--~-~--~~~---~--~~
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: camelCase to snake_case

2009-11-01 Thread David Pollak
It's not currently a feature, but please open a ticket
http://github.com/dpp/liftweb/issues .  We'll get it into M8

On Sun, Nov 1, 2009 at 10:55 AM, aw anth...@whitford.com wrote:


 I am using Lift-Mapper with Oracle.  Oracle is a case-insensitive
 database.  For Hibernate projects, I have used the Enhanced Naming
 Convention to translate Java camelCase to a more Oracle friendly
 snake_case.  I am interested in doing the same thing with Lift Mapper/
 Record.

 In the mean time, I need to override dbTableName and dbColumnName, but
 I'd like to avoid that and just agree on the convention.

 I could imagine that the Database Provider would maintain a flag to
 say whether the database is case sensitive or not, and then based on
 that flag, would pass either the camelCase directly (for case
 sensitive), or snake_case(camelCase) (for case insensitive).

 (Or, does this functionality already exist and I just haven't
 configured it properly?)
 



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

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



[Lift] Re: camelCase to snake_case

2009-11-01 Thread Jeppe Nejsum Madsen

Naftoli Gugenheim naftoli...@gmail.com writes:

 Probably not too hard to do on your own via a trait: the trait should extend 
 MappedField, override dbColumnName, and calculate it based on getClass.

While this works, I think it is too tedious to do on all classes and
fields.  I think a better approach would be to make the Connection
naming aware and just do the right thing (tm) based an the specified
naming convention

/Jepppe

--~--~-~--~~~---~--~~
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: camelCase to snake_case

2009-11-01 Thread David Pollak
On Sun, Nov 1, 2009 at 1:04 PM, Jeppe Nejsum Madsen je...@ingolfs.dkwrote:


 Naftoli Gugenheim naftoli...@gmail.com writes:

  Probably not too hard to do on your own via a trait: the trait should
 extend MappedField, override dbColumnName, and calculate it based on
 getClass.

 While this works, I think it is too tedious to do on all classes and
 fields.  I think a better approach would be to make the Connection
 naming aware and just do the right thing (tm) based an the specified
 naming convention


Acually, I'm going to do it based on a single function in MapperRules.



 /Jepppe

 



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

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



[Lift] Re: camelCase to snake_case

2009-11-01 Thread aw

Thank you.  I will open an Issue for this.  I was reluctant to do it
thinking that it was a user issue.  ;-)

On Nov 1, 11:57 am, David Pollak feeder.of.the.be...@gmail.com
wrote:
 It's not currently a feature, but please open a 
 tickethttp://github.com/dpp/liftweb/issues.  We'll get it into M8

--~--~-~--~~~---~--~~
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] List of Users

2009-11-01 Thread Randinn

I'm trying to generate a list of users onto the screen but am unable
to see the model here's me code so far

package com.scalalist.project.snippet

import com.scalalist.project.model.User
import net.liftweb.util.BindHelpers._
import scala.xml._


class ListUser {

def list(html: NodeSeq) : NodeSeq = {
toShow.flatMap(item =
bind(user, html,
 firstName - user.firstName,
 lastName - user.lastName,
 email - user.email,
 locale - user.locale,
 timezone - user.timezone,
 FuncAttrBindParam(view_href, _ =
   Text(view/+ (user.primaryKeyField)),href),
 FuncAttrBindParam(edit_href, _ =
   Text(edit/+ (user.primaryKeyField)),href),
 FuncAttrBindParam(delete_href, _ =
   Text(delete/+ (user.primaryKeyField)),href)
)
)
}

private def toShow =
User.findAll();

}

__

lift:surround with=default at=content
  table
 thead
tr
thFirst Name/th
thLast Name/th
thEmail/th
thLocale/th
thTimezone/th
thView/th
thEdit/th
thDelete/th
/tr
  /thead

  tbody class=stripeMe
  lift:ListUser.list 
tduser:firstName//td
tduser:lastName//td
tduser:email//td
tduser:locale/
  tduser:timezone//td
  tda user:view_href=View/a/td
  tda user:edit_href=Edit/a/td
  tda user:delete_href=Delete/a/td
  /tr
  /lift:ListUser.list
  /tbody
  /table
/lift:surround


How can I get it to see the model objects? I've noticed ModelView
would that be a better way?
--~--~-~--~~~---~--~~
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: List of Users

2009-11-01 Thread David Pollak
On Sun, Nov 1, 2009 at 2:00 PM, Randinn rand...@gmail.com wrote:


 I'm trying to generate a list of users onto the screen but am unable
 to see the model here's me code so far

 package com.scalalist.project.snippet

 import com.scalalist.project.model.User
 import net.liftweb.util.BindHelpers._
 import scala.xml._


 class ListUser {

def list(html: NodeSeq) : NodeSeq = {
toShow.flatMap(item =


This should read:

toShow.flatMap(user =


bind(user, html,
 firstName - user.firstName,
 lastName - user.lastName,
 email - user.email,
 locale - user.locale,
 timezone - user.timezone,
 FuncAttrBindParam(view_href, _ =
   Text(view/+ (user.primaryKeyField)),href),
 FuncAttrBindParam(edit_href, _ =
   Text(edit/+ (user.primaryKeyField)),href),
 FuncAttrBindParam(delete_href, _ =
   Text(delete/+ (user.primaryKeyField)),href)
)
)
}

private def toShow =
User.findAll();

 }

 __

 lift:surround with=default at=content
  table
 thead
tr
thFirst Name/th
thLast Name/th
thEmail/th
thLocale/th
thTimezone/th
thView/th
thEdit/th
thDelete/th
/tr
  /thead

  tbody class=stripeMe
  lift:ListUser.list 
tduser:firstName//td
tduser:lastName//td
tduser:email//td
tduser:locale/
  tduser:timezone//td
  tda user:view_href=View/a/td
  tda user:edit_href=Edit/a/td
  tda user:delete_href=Delete/a/td
  /tr
  /lift:ListUser.list
  /tbody
  /table
 /lift:surround


 How can I get it to see the model objects? I've noticed ModelView
 would that be a better way?
 



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

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



[Lift] Re: List of Users

2009-11-01 Thread Randinn

Doh!, very sorry about that.

On Nov 2, 11:14 am, David Pollak feeder.of.the.be...@gmail.com
wrote:
 On Sun, Nov 1, 2009 at 2:00 PM, Randinn rand...@gmail.com wrote:

  I'm trying to generate a list of users onto the screen but am unable
  to see the model here's me code so far

  package com.scalalist.project.snippet

  import com.scalalist.project.model.User
  import net.liftweb.util.BindHelpers._
  import scala.xml._

  class ListUser {

     def list(html: NodeSeq) : NodeSeq = {
         toShow.flatMap(item =

 This should read:

 toShow.flatMap(user =



             bind(user, html,
                  firstName - user.firstName,
                  lastName - user.lastName,
                  email - user.email,
                  locale - user.locale,
                  timezone - user.timezone,
                  FuncAttrBindParam(view_href, _ =
                    Text(view/+ (user.primaryKeyField)),href),
                  FuncAttrBindParam(edit_href, _ =
                    Text(edit/+ (user.primaryKeyField)),href),
                  FuncAttrBindParam(delete_href, _ =
                    Text(delete/+ (user.primaryKeyField)),href)
             )
         )
     }

     private def toShow =
         User.findAll();

  }

  __

  lift:surround with=default at=content
   table
      thead
         tr
             thFirst Name/th
             thLast Name/th
             thEmail/th
             thLocale/th
             thTimezone/th
             thView/th
             thEdit/th
             thDelete/th
         /tr
       /thead

       tbody class=stripeMe
           lift:ListUser.list 
             tduser:firstName//td
             tduser:lastName//td
             tduser:email//td
             tduser:locale/
                   tduser:timezone//td
                   tda user:view_href=View/a/td
                   tda user:edit_href=Edit/a/td
                   tda user:delete_href=Delete/a/td
               /tr
           /lift:ListUser.list
       /tbody
   /table
  /lift:surround

  How can I get it to see the model objects? I've noticed ModelView
  would that be a better way?

 --
 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: Error mvn install on lift-actor

2009-11-01 Thread Josh Suereth
There's something just wrong about this

On Sun, Nov 1, 2009 at 10:06 AM, David Pollak feeder.of.the.be...@gmail.com
 wrote:

 Yeah, I do rm -rf ~/.m2 about once a week.  Usually on Monday mornings just
 before I go make myself some tea.


 On Sun, Nov 1, 2009 at 7:55 AM, Naftoli Gugenheim naftoli...@gmail.comwrote:


 It can't be the POM -- it built it. It just couldn't install it. I wonder
 if it's related to the new structure. I emptied .m2/repository/new/liftweb
 and it seems to be working now.
 Thanks.

 -
 Josh Suerethjoshua.suer...@gmail.com wrote:

 It looks like the pom is in a different encoding then maven expects.
  That's
 a fun issue!  I would check maven's JIRA to see if someone else has
 reported
 this issue and has a workaround.

 Who is deploying/configuring Lift's POM files?   Are you using UTF-8 or
 UTF-16 encoding?   In either case, I would check the pom.xml for
 lift-actors
 in your local repo.  Pull it up in a text editor that will show you all
 characters and switch encodings.


 - Josh

 On Sat, Oct 31, 2009 at 10:54 PM, Naftoli Gugenheim naftoli...@gmail.com
 wrote:

  What could be wrong?
 
 
  C:\dev\gitrepo\liftweb\lift-base\lift-actormvn -e install
  + Error stacktraces are turned on.
  [INFO] Scanning for projects...
  WAGON_VERSION: 1.0-beta-2
  [INFO]
  
  [INFO] Building Lift Actor
  [INFO]task-segment: [install]
  [INFO]
  
  [INFO] [resources:resources]
  [INFO] Using 'UTF-8' encoding to copy filtered resources.
  [INFO] skip non existing resourceDirectory
  C:\dev\gitrepo\liftweb\lift-base\lift-actor\src\main\resources
  [INFO] [scala:compile {execution: scala-compile}]
  [INFO] Checking for multiple versions of scala
  [INFO] includes = [**/*.scala,**/*.java,]
  [INFO] excludes = []
  [INFO] Compiling 0 source files to
  C:\dev\gitrepo\liftweb\lift-base\lift-actor\target\classes
  [INFO] Nothing to compile - all classes are up to date
  [INFO] [compiler:compile]
  [INFO] Nothing to compile - all classes are up to date
  [INFO] [resources:testResources]
  [INFO] Using 'UTF-8' encoding to copy filtered resources.
  [INFO] skip non existing resourceDirectory
  C:\dev\gitrepo\liftweb\lift-base\lift-actor\src\test\resources
  [INFO] [scala:testCompile {execution: scala-testCompile}]
  [INFO] Checking for multiple versions of scala
  [INFO] includes = [**/*.scala,**/*.java,]
  [INFO] excludes = []
  [WARNING] No source files found.
  [INFO] [compiler:testCompile]
  [INFO] No sources to compile
  [INFO] [surefire:test]
  [INFO] Surefire report directory:
  C:\dev\gitrepo\liftweb\lift-base\lift-actor\target\surefire-reports
 
  ---
   T E S T S
  ---
  There are no tests to run.
 
  Results :
 
  Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
 
  [INFO] [jar:jar]
  [INFO] Building jar:
 
 C:\dev\gitrepo\liftweb\lift-base\lift-actor\target\lift-actor-1.1-SNAPSHOT.jar
  [INFO] [source:jar-no-fork {execution: default}]
  [INFO] [bundle:bundle {execution: default-bundle}]
  [INFO] [install:install]
  [INFO] Installing
 
 C:\dev\gitrepo\liftweb\lift-base\lift-actor\target\lift-actor-1.1-SNAPSHOT.jar
  to
 
 C:\Users\Naftoli\.m2\repository\net\liftweb\lift-actor\1.1-SNAPSHOT\lift-actor-1.1-SNAPSHOT.jar
  [INFO]
  
  [ERROR] BUILD ERROR
  [INFO]
  
  [INFO] Error installing artifact's metadata: Error installing metadata:
  Error updating group repository metadata
 
  only whitespace content allowed before start tag and not \u0 (position:
  START_DOCUMENT seen \u0... @1:1)
  [INFO]
  
  [INFO] Trace
  org.apache.maven.lifecycle.LifecycleExecutionException: Error installing
  artifact's metadata: Error installing metadata: Error updating group
  repository metadata
  at
 
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:703)
  at
 
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:540)
  at
 
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:519)
  at
 
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371)
  at
 
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:332)
  at
 
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181)
  at
 org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
  at 

[Lift] Re: Possible bug in xml to json conversion

2009-11-01 Thread Jonathan Ferguson
Thanks for the update Joni and sorry for not getting back sooner. I'll try
the code change you've suggested. Should I open a bug for the final example?

Cheers

Jono


2009/10/28 Joni Freeman freeman.j...@gmail.com


 Hi Jonathan,

 Current toJson conversion does not support this case very well. The
 transformation rule is such that from each leaf XML element a JSON
 field is generated.

 statsfoo/stats -
 stats:foo

 And if that leaf element contains attributes we do not convert it
 automatically to JSON object as you expected. Instead, another field
 at same level is created:

 stats count=0foo/stats -
 stats:foo
 count:0

 In your case the leaf node is empty, therefore you will get a field
 with null value:

 stats count=0/stats -
 stats:null
 count:0

 You can fix this for instance by postprocessing the generated JSON. In
 this case it is a bit involved and verbose (example below fixes
 'stats' element, similar conversion is required for 'messages'
 element):

 val json = toJson(xml1) map {
  case JField(count, JString(count)) = JObject(JField(count, JInt
 (count.toInt)) :: Nil) // lift to object
  case JField(stats, _) = JNothing // remove null field
  case x = x
 } map {
  case JField(count, x: JObject) = JField(stats, x) // rename
 field count to stats
  case x = x
 }

 Note, the conversion rule which you expected is a perfectly valid
 conversion too. The rationale behind the current rule is that it never
 makes conversions which changes resulting JSON structure when
 attributes are missing. It is therefore more predictable. This blog
 post summarizes some other valid conversion rules
 http://onwebdevelopment.blogspot.com/2008/05/converting-xml-to-json.html

 We could add support for other conversion rules if there's a strong
 pressure to do so. But my current preference is to use a simple rule
 and then handle corner cases using transformation pipelines (using
 'map' function).

 PS. The very last example you gave contains a bug which I try to nail
 down today. XML is parsed differently when all elements are in same
 line. Thanks for good examples!

 Cheers Joni

 On 28 loka, 09:24, Jonathan Ferguson j...@spiralarm.com wrote:
  Depending on the structure of the XML, attributes and child elements
  are being lost. This can be seen in example 4, where the attribute
  expiry_date and the child element status have been dropped.
 
  It would also appear when XML is being converted to JSON attributes
  are being flattened to elements. I'm not sure if this is expected or
  not, this can be seen in examples  1,2  3. The child
  element status with attribute count is converted to two attributes
  status with a value of null and count with the correct value.
 
  To test I added the following before the closing brace of
  XmlExamplesTest.scala in lift-json.
 
  Is this a bug or my error ?
 
  Cheers
  Jono
 
  P.S I've noticed this could be related to the thread Possible lift-
  json bug in Xml.toJson
 http://groups.google.com/group/liftweb/browse_thread/thread/47c581d63...
 
  /* Test  */
 
import scala.xml.Node
 
   def xml2Json(xml:Node):String = {
  val json = toJson(xml)
  compact(render(json))
}
 
XML to JSON Example with multiple attributes, multiple nested
  elements  in  {  xml2Json(xml1) mustEqual expected1 }
XML to JSON Example with multiple attributes, multiple nested
  elements   in  {  xml2Json(xml2) mustEqual expected2 }
XML to JSON Example with one attribute,  multiple nested elements
   in  {  xml2Json(xml3) mustEqual expected3 }
XML to JSON Example with one attribute, one nested element  in
  {  xml2Json(xml4) mustEqual expected4 }
 
  val xml1 = message expiry_date=20091126 text=text
  word=ant self=mestats count=0/statsmessages href=https://
  domain.com/message/ant/messages/message
  val expected1 = {message:{expiry_date:
  20091126,text:text,word:ant,self:me,stats:{count:
  0},messages:{href:https://domain.com/message/ant}}};
  val actual1 = {message:
 
 {expiry_date:20091126,word:ant,text:text,self:me,stats:null,count:0,messages:null,href:https://
  domain.com/message/ant}}
 
  val xml2 = message expiry_date=20091126 text=text
  word=ant self=mestats count=0/statsmessages href=https://
  domain.com/message/ant/messages/message
  val expected2 = {message:{expiry_date:
  20091126,text:text,word:ant,self:me,stats:{count:
  0},messages:{href:https://domain.com/message/ant}}};
  val actual2  = {message:
 
 {expiry_date:20091126,word:ant,text:text,self:me,stats:null,count:0,messages:null,href:https://
  domain.com/message/ant}}
 
  val xml3  = message expiry_date=20091126stats count=0/
  statsmessages href=https://domain.com/message/ant;/messages/
  message
  val expected3  = {message:{expiry_date:20091126,stats:
  {count:0},messages:{href:https://domain.com/message/ant}}};
  val actual3  = {message:
 
 {expiry_date:20091126,stats:null,count:0,messages:null,href:https://
  domain.com/message/ant}}
 
  val xml4