[Lift] Re: Removing Scala Actors from Lift

2009-09-29 Thread Tobias Daub

Hi David,

Could you give some short step-by-step guide, how to change the most 
important stuff in case of compilation errors that are caused because of 
this? Maybe that would safe some time afterwards.

I'm thinking about to start my application exclusively with -o to make 
sure that no updates are applied.good or bad?

thanks

 Folks,

 Given the continued instability of Scala Actors, I've decided to 
 remove them from Lift.

 Specifically, I'm migrating CometActors to sit on top of Lift's 
 Actors.  But, you'll also be able to use Akka Actors to power Lift's 
 CometActors.  Specifically, I'm working with Jonas to make sure that 
 we share a common interface to Actors.

 I've gotten Lift nearly completely migrated over to Lift's Actors on 
 the dpp_wip_actorize branch.  See 
 http://github.com/dpp/liftweb/tree/dpp_wip_actorize

 There will be some breaking changes to your applications.  Specifically:

 * Box will be moved to a new package, net.liftweb.base (this is
   where the interface for Actors will live as well)
 * If you make any assumptions about your CometActors being Scala
   Actors (e.g., using linking), you will have to rewrite this code
 * Some methods in Lift that currently take Scala Actors as
   parameters will take Lift Actors (e.g., ActorPing)

 There will be a parallel Maven repository with the new Lift Actor 
 stuff in it so you will be able to build you apps against the new code 
 before the official switch-over.

 Milestone 6 (which should be out next week) will be based on the 
 existing Actor model.  After we get feedback from the community about 
 the new Actor stuff, we will switch -SNAPSHOT over to the new Actor stuff.

 Questions, thoughts, or comments?

 Thanks,

 David



 -- 
 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] table does not exist

2009-09-19 Thread Tobias Daub

Lifters,

I defined the table that caused the error and I listet the meta object 
in Schemifier.schemify(...) inside Boot.scala. Are there any other 
reason, that might cause this error?
Besides that, I've the impression, that sometimes, somethings work, and 
then after some compilations they don't (without changing anything that 
relats to it)..I'm using Netbeans 6.7 on Ubuntu 8.04are there 
any known problems, API breaks whatever?

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] Lift runtime error

2009-09-19 Thread Tobias Daub
Hey Lifters,

I overrode the toString method of a foreign key field, to make 
decisions, on what to return, nothing special. When I remove the if/else 
(Order.scala, line 65 ff.) and return directly the result, no error 
occurs! I append the source as attachment.

Further on, I've a similar error to one I already got (and solved with 
David's help). Initializing a foreign key field, with a value that 
doesn't exist at compile time. In line 45 ff. in file Order.scala is the 
solution, on how to do that. But this doesn't work for line 76 (same 
file). Why? What I do now, just to have the ability to test some things, 
is to comment out line 76 before I compile first (create all other 
tables) and then uncomment it and restart the application. Then it 
works, but if I don't do that, I get the error that table/view 
TRADESTATUS doesn't exist.

thanks alot in advance!

Here is the error that is forced through the if/else in line 65 ff. in 
file Order.scala.
---

Exception occured while processing /limitorder/list

Message: java.lang.AbstractMethodError: 
org.tobster.model.LimitOrder.tradeTypeName2()Ljava/lang/String;
org.tobster.model.Order$tradeType$.toString(Order.scala:71)
net.liftweb.mapper.MappedField$class.asHtml(MappedField.scala:645)
net.liftweb.mapper.MappedLong.asHtml(MappedLong.scala:223)

net.liftweb.mapper.CRUDify$$anon$1$$anonfun$doRows$1$1$$anonfun$doRowItem$1$1.apply(CRUDify.scala:469)

net.liftweb.mapper.CRUDify$$anon$1$$anonfun$doRows$1$1$$anonfun$doRowItem$1$1.apply(CRUDify.scala:469)
scala.List.flatMap(List.scala:1132)

net.liftweb.mapper.CRUDify$$anon$1$$anonfun$doRows$1$1.doRowItem$1(CRUDify.scala:468)

net.liftweb.mapper.CRUDify$$anon$1$$anonfun$doRows$1$1$$anonfun$apply$7.apply(CRUDify.scala:471)

net.liftweb.mapper.CRUDify$$anon$1$$anonfun$doRows$1$1$$anonfun$apply$7.apply(CRUDify.scala:471)

net.liftweb.util.BindHelpers$FuncBindParam.calcValue(BindHelpers.scala:218)

net.liftweb.util.BindHelpers$$anonfun$bind$2$$anonfun$in_bind$1$1$$anonfun$apply$24.apply(BindHelpers.scala:433)

net.liftweb.util.BindHelpers$$anonfun$bind$2$$anonfun$in_bind$1$1$$anonfun$apply$24.apply(BindHelpers.scala:426)
net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)

net.liftweb.util.BindHelpers$$anonfun$bind$2$$anonfun$in_bind$1$1.apply(BindHelpers.scala:425)

net.liftweb.util.BindHelpers$$anonfun$bind$2$$anonfun$in_bind$1$1.apply(BindHelpers.scala:424)
scala.Seq$class.flatMap(Seq.scala:294)
scala.xml.NodeSeq.flatMap(NodeSeq.scala:34)

net.liftweb.util.BindHelpers$$anonfun$bind$2.in_bind$1(BindHelpers.scala:424)

net.liftweb.util.BindHelpers$$anonfun$bind$2$$anonfun$in_bind$1$1.apply(BindHelpers.scala:444)

net.liftweb.util.BindHelpers$$anonfun$bind$2$$anonfun$in_bind$1$1.apply(BindHelpers.scala:424)
scala.Seq$class.flatMap(Seq.scala:294)
scala.xml.NodeSeq.flatMap(NodeSeq.scala:34)

net.liftweb.util.BindHelpers$$anonfun$bind$2.in_bind$1(BindHelpers.scala:424)

net.liftweb.util.BindHelpers$$anonfun$bind$2.apply(BindHelpers.scala:449)

net.liftweb.util.BindHelpers$$anonfun$bind$2.apply(BindHelpers.scala:409)
net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
net.liftweb.util.BindHelpers$class.bind(BindHelpers.scala:409)
net.liftweb.util.Helpers$.bind(Helpers.scala:29)
net.liftweb.util.BindHelpers$class.bind(BindHelpers.scala:380)
net.liftweb.util.Helpers$.bind(Helpers.scala:29)

net.liftweb.mapper.CRUDify$$anon$1$$anonfun$doRows$1$1.apply(CRUDify.scala:471)

net.liftweb.mapper.CRUDify$$anon$1$$anonfun$doRows$1$1.apply(CRUDify.scala:467)
scala.List.flatMap(List.scala:1132)
net.liftweb.mapper.CRUDify$$anon$1.doRows$1(CRUDify.scala:466)

net.liftweb.mapper.CRUDify$$anon$1$$anonfun$doCrudAll$2.apply(CRUDify.scala:486)

net.liftweb.mapper.CRUDify$$anon$1$$anonfun$doCrudAll$2.apply(CRUDify.scala:486)

net.liftweb.util.BindHelpers$FuncBindParam.calcValue(BindHelpers.scala:218)

net.liftweb.util.BindHelpers$$anonfun$bind$2$$anonfun$in_bind$1$1$$anonfun$apply$24.apply(BindHelpers.scala:433)

net.liftweb.util.BindHelpers$$anonfun$bind$2$$anonfun$in_bind$1$1$$anonfun$apply$24.apply(BindHelpers.scala:426)
net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)

net.liftweb.util.BindHelpers$$anonfun$bind$2$$anonfun$in_bind$1$1.apply(BindHelpers.scala:425)

net.liftweb.util.BindHelpers$$anonfun$bind$2$$anonfun$in_bind$1$1.apply(BindHelpers.scala:424)
scala.Seq$class.flatMap(Seq.scala:294)
scala.xml.NodeSeq.flatMap(NodeSeq.scala:34)

net.liftweb.util.BindHelpers$$anonfun$bind$2.in_bind$1(BindHelpers.scala:424)

net.liftweb.util.BindHelpers$$anonfun$bind$2$$anonfun$in_bind$1$1.apply(BindHelpers.scala:444)

net.liftweb.util.BindHelpers$$anonfun$bind$2$$anonfun$in_bind$1$1.apply(BindHelpers.scala:424)

[Lift] Re: table does not exist

2009-09-19 Thread Tobias Daub

Hi David,

I did a mvn clean before, but that didn't changed anything. My pom.xml 
file says: Scala 2.7.5, Lift 1.1-M5.

thanks.


 On Sat, Sep 19, 2009 at 5:32 AM, Tobias Daub hannes.flo...@gmx.li 
 mailto:hannes.flo...@gmx.li wrote:


 Lifters,

 I defined the table that caused the error and I listet the meta object
 in Schemifier.schemify(...) inside Boot.scala. Are there any other
 reason, that might cause this error?


 No.
  

 Besides that, I've the impression, that sometimes, somethings
 work, and
 then after some compilations they don't (without changing anything
 that
 relats to it)..I'm using Netbeans 6.7 on Ubuntu 8.04are there
 any known problems, API breaks whatever?


 No.

 The only thing I'd suggest is doing mvn clean whenever you make a 
 non-trivial change as changes in traits don't roll up automatically to 
 the classes that extend the traits using Maven.
  


 thanks





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

 


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



[Lift] Re: table does not exist

2009-09-19 Thread Tobias Daub

Hey David,

I don't know what I did differently, but now, after the 5th mvn clean, 
the problem disappeard. Really don't know why, or what happened. Sorry 
for bothering you.

Thanks!
 This is strange... please create a project that demonstrates this, 
 post the project to GitHub and open a Lift ticket referencing the 
 project and this thread and we'll fix the problem.

 On Sat, Sep 19, 2009 at 11:06 AM, Tobias Daub hannes.flo...@gmx.li 
 mailto:hannes.flo...@gmx.li wrote:


 Hi David,

 I did a mvn clean before, but that didn't changed anything. My pom.xml
 file says: Scala 2.7.5, Lift 1.1-M5.

 thanks.
 
 
  On Sat, Sep 19, 2009 at 5:32 AM, Tobias Daub
 hannes.flo...@gmx.li mailto:hannes.flo...@gmx.li
  mailto:hannes.flo...@gmx.li mailto:hannes.flo...@gmx.li wrote:
 
 
  Lifters,
 
  I defined the table that caused the error and I listet the
 meta object
  in Schemifier.schemify(...) inside Boot.scala. Are there any
 other
  reason, that might cause this error?
 
 
  No.
 
 
  Besides that, I've the impression, that sometimes, somethings
  work, and
  then after some compilations they don't (without changing
 anything
  that
  relats to it)..I'm using Netbeans 6.7 on Ubuntu
 8.04are there
  any known problems, API breaks whatever?
 
 
  No.
 
  The only thing I'd suggest is doing mvn clean whenever you make a
  non-trivial change as changes in traits don't roll up
 automatically to
  the classes that extend the traits using Maven.
 
 
 
  thanks
 
 
 
 
 
  --
  Lift, the simply functional web framework http://liftweb.net
  Beginning Scala http://www.apress.com/book/view/1430219890
  Follow me: http://twitter.com/dpp
  Git some: http://github.com/dpp
 
  






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

 


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



[Lift] Re: table does not exist

2009-09-19 Thread Tobias Daub

I don't think soI'm using Ubuntu:-)

I just saw, that I got a little bit confused, because I wrote two mails. 
And the thing is, that the problem with if/else in override def toString 
now works fine. But there's still this one lelf. So I still get the 
table/view doesn't exist error, when I first start after I wiped out the 
entire database.

thanks.
 Could this be a case of jvm on windows locking some files?

 Cheers, Indrajit

 On Sep 19, 11:38 pm, Tobias Daub hannes.flo...@gmx.li wrote:
   
 Hey David,

 I don't know what I did differently, but now, after the 5th mvn clean,
 the problem disappeard. Really don't know why, or what happened. Sorry
 for bothering you.

 Thanks!



 
 This is strange... please create a project that demonstrates this,
 post the project to GitHub and open a Lift ticket referencing the
 project and this thread and we'll fix the problem.
   
 On Sat, Sep 19, 2009 at 11:06 AM, Tobias Daub hannes.flo...@gmx.li
 mailto:hannes.flo...@gmx.li wrote:
   
 Hi David,
   
 I did a mvn clean before, but that didn't changed anything. My pom.xml
 file says: Scala 2.7.5, Lift 1.1-M5.
   
 thanks.
   
  On Sat, Sep 19, 2009 at 5:32 AM, Tobias Daub
 hannes.flo...@gmx.li mailto:hannes.flo...@gmx.li
  mailto:hannes.flo...@gmx.li mailto:hannes.flo...@gmx.li wrote:
   
  Lifters,
   
  I defined the table that caused the error and I listet the
 meta object
  in Schemifier.schemify(...) inside Boot.scala. Are there any
 other
  reason, that might cause this error?
   
  No.
   
  Besides that, I've the impression, that sometimes, somethings
  work, and
  then after some compilations they don't (without changing
 anything
  that
  relats to it)..I'm using Netbeans 6.7 on Ubuntu
 8.04are there
  any known problems, API breaks whatever?
   
  No.
   
  The only thing I'd suggest is doing mvn clean whenever you make a
  non-trivial change as changes in traits don't roll up
 automatically to
  the classes that extend the traits using Maven.
   
  thanks
   
  --
  Lift, the simply functional web frameworkhttp://liftweb.net
  Beginning Scalahttp://www.apress.com/book/view/1430219890
  Follow me:http://twitter.com/dpp
  Git some:http://github.com/dpp
   
 --
 Lift, the simply functional web frameworkhttp://liftweb.net
 Beginning Scalahttp://www.apress.com/book/view/1430219890
 Follow me:http://twitter.com/dpp
 Git some:http://github.com/dpp
   
 
   


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



[Lift] Re: Still getting nuts with getting/setting foreign key fields

2009-09-17 Thread Tobias Daub

David,

That makes much more sense, but I just didn't found it anywhere to do it 
like this...good to know!

thanks!


 On Wed, Sep 16, 2009 at 10:58 AM, Tobias Daub hannes.flo...@gmx.li 
 mailto:hannes.flo...@gmx.li wrote:


 Hey Lifters,

 Simple problem, but kind of difficult solution:

 I've a foreign key field, e.g. myField. I want to get the id of
 the field.

 So I wrote a method inside the class:

 def getMyFieldId = myField.obj.map(_.id.is http://id.is) openOr 0L


 // why load the object and ask for its id when you already know the id?

 def getMyFieldId = myField.is
  


 IDs always start with one, right?

 But I get zero back! Why? I definitely know that this foreign key
 exists, because I can print another field value from the foreign key
 object inside some form...? That doesn't make any sense to me.

 thanks and sorry for always asking the same questions.





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

 


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



[Lift] Article about Lift on heise.de

2009-09-16 Thread Tobias Daub

Just found it during my daily look on the site

http://www.heise.de/developer/Lift-Vehikel-zum-naechsten-Web-Framework-Level--/artikel/145143

--~--~-~--~~~---~--~~
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] Still getting nuts with getting/setting foreign key fields

2009-09-16 Thread Tobias Daub

Hey Lifters,

Simple problem, but kind of difficult solution:

I've a foreign key field, e.g. myField. I want to get the id of the field.

So I wrote a method inside the class:

def getMyFieldId = myField.obj.map(_.id.is) openOr 0L

IDs always start with one, right?

But I get zero back! Why? I definitely know that this foreign key 
exists, because I can print another field value from the foreign key 
object inside some form...? That doesn't make any sense to me.

thanks and sorry for always asking the same questions.

--~--~-~--~~~---~--~~
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: No Navigation Defined in menu snippet

2009-07-06 Thread Tobias Daub

Don't know if this is an accident, but since yesterday I'm getting this 
error too (and I didn't touched Boot.scala)?


 I have two webapps, hosted on the same server:
 http://lsug.org/main/
 http://lsug.org/stage/

 Problem is, the menu works just fine on the stage site, but not on the 
 main site.
 Which is odd, as these sites should be identical.  I just renamed 
 stage.war to main.war and let tomcat auto-deploy it

 The site is using tomcat 6 via apache 2 (with mod_jk proxying)
 The problem also appears if I access tomcat directly (i.e. not via apache)

 Is this a known issue?

 


--~--~-~--~~~---~--~~
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] Trigger object creation to send message to actor

2009-07-06 Thread Tobias Daub

Hi List,

I wanna send a message to an Actor everytime a new row is created in a 
specific table. The Actor is responsible to refresh a HTML page and 
display all the items from the table.

How do I do 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: howto do simple calculation with MappedInt

2009-07-05 Thread Tobias Daub
here are the two files, thanks!
 Send me the file and I'll debug it.

 On Fri, Jul 3, 2009 at 3:06 AM, Tobias Daub hannes.flo...@gmx.li 
 mailto:hannes.flo...@gmx.li wrote:


 Thanks Dave, but still getting this error:

 
 /home/wacky/NetBeansProjects/virtualMarket/src/main/scala/org/tobster/model/Order.scala:51:
 error: value lotValue is not a member of Long
override def _toForm = Full(p{Order.this.lots *
 Order.this.marketPlace.lotValue}/p)


 What is the explanation for this behavior?

 thanks
 
 
  On Sun, Jun 21, 2009 at 6:38 AM, Tobias Daub
 hannes.flo...@gmx.li mailto:hannes.flo...@gmx.li
  mailto:hannes.flo...@gmx.li mailto:hannes.flo...@gmx.li wrote:
 
 
  I'm stucked again with the simple things
 
  I've a trait that extends BaseLongKeyedMapper and I wanna
 add a field
  (currentCost) that does some calculation. Nothing special.
 Here's
  the code:
 
  /*
   * Order.scala
   *
   * To change this template, choose Tools | Template Manager
   * and open the template in the editor.
   */
 
  package org.tobster.model
 
  import net.liftweb._
  import mapper._
  import http._
  import SHtml._
  import util._
  import model._
 
  /* Describes a general order.  */
  trait Order extends BaseLongKeyedMapper{
 
 /* The number of lots this order has */
 object lots extends MappedInt(this.asInstanceOf[MapperType])
 
 /* The person who owns the order */
 object owner extends
  MappedLongForeignKey(this.asInstanceOf[MapperType], User){
 
 // hides this field in the CRUDify list/create forms
 override def dbDisplay_? = false
 
 //set the default value to the current logged in user (at
  creation time)
 override def defaultValue =
 User.currentUser.map(_.id.is http://id.is
  http://id.is) openOr 0L
 }
 
 /* The market place where the order belongs to  */
 object marketPlace extends
  MappedLongForeignKey(this.asInstanceOf[MapperType],
  MarketPlaceMetaObj){
 override def _toForm = Full(SHtml.selectObj[MarketPlace](
 
  MarketPlaceMetaObj.findAll.map(mp
  = (mp, mp.name.is http://mp.name.is http://mp.name.is)),
   obj,
   (mp: MarketPlace) =
 apply(mp)))
 }
 
 /* The basic trade types are: BUY and SELL */
 object tradeType extends
  MappedLongForeignKey(this.asInstanceOf[MapperType],
 TradeTypeMetaObj){
 override def _toForm = Full(SHtml.selectObj[TradeType](
 TradeTypeMetaObj.findAll.map(t = (t,
 t.name.is http://t.name.is
  http://t.name.is)),
 obj,
 (t: TradeType) = apply(t)))
 }
 
 
 object currentCost extends
  MappedInt(this.asInstanceOf[MapperType]){
 override def _toForm = Full(p{this.lots *
  this.marketPlace.lotValue}/p)
 
 
 
  Try:
  override def _toForm = Full(p{Order.this.lots *
  Order.this.marketPlace.lotValue}/p)
 
 
 
 
 }
 
  }
 
  I get the following compiler error:
 
  [WARNING]
 
 
 /home/wacky/workspace_VirtuelleBoerse/virtualMarket/src/main/scala/org/tobster/model/Order.scala:51:
  error: value lots is not a member of Int
  [WARNING] override def _toForm = Full(p{this.lots *
  this.marketPlace.lotValue}/p)
  [WARNING]  ^
  [WARNING] one error found
 
  The field marketPlace.lotValue is of type MappedInt as well
 as the
  field
  lots.
 
  I tried things like this.lots.is http://this.lots.is
 http://this.lots.is or
  this.lots.i_is_! but without
  success. I ran out of ideas...
 
 
  thanks.
 
 
 
 
 
  --
  Lift, the simply functional web framework http://liftweb.net
  Beginning Scala http://www.apress.com/book/view/1430219890
  Follow me: http://twitter.com/dpp
  Git some: http://github.com/dpp
 
  






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

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post

[Lift] Re: howto do simple calculation with MappedInt

2009-07-03 Thread Tobias Daub

Thanks Dave, but still getting this error:

/home/wacky/NetBeansProjects/virtualMarket/src/main/scala/org/tobster/model/Order.scala:51:
 
error: value lotValue is not a member of Long
override def _toForm = Full(p{Order.this.lots * 
Order.this.marketPlace.lotValue}/p)


What is the explanation for this behavior?

thanks


 On Sun, Jun 21, 2009 at 6:38 AM, Tobias Daub hannes.flo...@gmx.li 
 mailto:hannes.flo...@gmx.li wrote:


 I'm stucked again with the simple things

 I've a trait that extends BaseLongKeyedMapper and I wanna add a field
 (currentCost) that does some calculation. Nothing special. Here's
 the code:

 /*
  * Order.scala
  *
  * To change this template, choose Tools | Template Manager
  * and open the template in the editor.
  */

 package org.tobster.model

 import net.liftweb._
 import mapper._
 import http._
 import SHtml._
 import util._
 import model._

 /* Describes a general order.  */
 trait Order extends BaseLongKeyedMapper{

/* The number of lots this order has */
object lots extends MappedInt(this.asInstanceOf[MapperType])

/* The person who owns the order */
object owner extends
 MappedLongForeignKey(this.asInstanceOf[MapperType], User){

// hides this field in the CRUDify list/create forms
override def dbDisplay_? = false

//set the default value to the current logged in user (at
 creation time)
override def defaultValue = User.currentUser.map(_.id.is
 http://id.is) openOr 0L
}

/* The market place where the order belongs to  */
object marketPlace extends
 MappedLongForeignKey(this.asInstanceOf[MapperType],
 MarketPlaceMetaObj){
override def _toForm = Full(SHtml.selectObj[MarketPlace](
  MarketPlaceMetaObj.findAll.map(mp
 = (mp, mp.name.is http://mp.name.is)),
  obj,
  (mp: MarketPlace) = apply(mp)))
}

/* The basic trade types are: BUY and SELL */
object tradeType extends
 MappedLongForeignKey(this.asInstanceOf[MapperType], TradeTypeMetaObj){
override def _toForm = Full(SHtml.selectObj[TradeType](
TradeTypeMetaObj.findAll.map(t = (t, t.name.is
 http://t.name.is)),
obj,
(t: TradeType) = apply(t)))
}


object currentCost extends
 MappedInt(this.asInstanceOf[MapperType]){
override def _toForm = Full(p{this.lots *
 this.marketPlace.lotValue}/p)



 Try:
 override def _toForm = Full(p{Order.this.lots * 
 Order.this.marketPlace.lotValue}/p)

  


}

 }

 I get the following compiler error:

 [WARNING]
 
 /home/wacky/workspace_VirtuelleBoerse/virtualMarket/src/main/scala/org/tobster/model/Order.scala:51:
 error: value lots is not a member of Int
 [WARNING] override def _toForm = Full(p{this.lots *
 this.marketPlace.lotValue}/p)
 [WARNING]  ^
 [WARNING] one error found

 The field marketPlace.lotValue is of type MappedInt as well as the
 field
 lots.

 I tried things like this.lots.is http://this.lots.is or
 this.lots.i_is_! but without
 success. I ran out of ideas...


 thanks.





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

 


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



[Lift] howto do simple calculation with MappedInt

2009-06-21 Thread Tobias Daub

I'm stucked again with the simple things

I've a trait that extends BaseLongKeyedMapper and I wanna add a field 
(currentCost) that does some calculation. Nothing special. Here's the code:

/*
 * Order.scala
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package org.tobster.model

import net.liftweb._
import mapper._
import http._
import SHtml._
import util._
import model._

/* Describes a general order.  */
trait Order extends BaseLongKeyedMapper{

/* The number of lots this order has */
object lots extends MappedInt(this.asInstanceOf[MapperType])

/* The person who owns the order */
object owner extends 
MappedLongForeignKey(this.asInstanceOf[MapperType], User){
 
// hides this field in the CRUDify list/create forms
override def dbDisplay_? = false
   
//set the default value to the current logged in user (at 
creation time)
override def defaultValue = User.currentUser.map(_.id.is) openOr 0L
}

/* The market place where the order belongs to  */
object marketPlace extends 
MappedLongForeignKey(this.asInstanceOf[MapperType], MarketPlaceMetaObj){
override def _toForm = Full(SHtml.selectObj[MarketPlace](
  MarketPlaceMetaObj.findAll.map(mp 
= (mp, mp.name.is)),
  obj,
  (mp: MarketPlace) = apply(mp)))
}

/* The basic trade types are: BUY and SELL */   
object tradeType extends 
MappedLongForeignKey(this.asInstanceOf[MapperType], TradeTypeMetaObj){
override def _toForm = Full(SHtml.selectObj[TradeType](
TradeTypeMetaObj.findAll.map(t = (t, t.name.is)),
obj,
(t: TradeType) = apply(t)))
}
   
   
object currentCost extends MappedInt(this.asInstanceOf[MapperType]){
override def _toForm = Full(p{this.lots * 
this.marketPlace.lotValue}/p)
}
   
}

I get the following compiler error:

[WARNING] 
/home/wacky/workspace_VirtuelleBoerse/virtualMarket/src/main/scala/org/tobster/model/Order.scala:51:
 
error: value lots is not a member of Int
[WARNING] override def _toForm = Full(p{this.lots * 
this.marketPlace.lotValue}/p)
[WARNING]  ^
[WARNING] one error found

The field marketPlace.lotValue is of type MappedInt as well as the field 
lots.

I tried things like this.lots.is or this.lots.i_is_! but without 
success. I ran out of ideas...


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: selectObj again

2009-06-19 Thread Tobias Daub

Hi Dave,

thanks again! But I can't find any documentation about the selectType 
method. I looked at the API docs on the website, but in SHtml the 
selectType method didn't exist!? Even inside the sources from SHtml on 
github selectType wasn't there

Can you tell me how to use and maybe a short code snippet?


thanks and sorry for wasting your time...



 Try:  SHtml.selectType[TradeType]()

 On Thu, Jun 18, 2009 at 6:30 AM, Tobias Daub hannes.flo...@gmx.li 
 mailto:hannes.flo...@gmx.li wrote:


 Hi There,

 I'm still having problems with the selectObj method.

 Here's the code:

 */* The basic trade types are: BUY and SELL */
object tradeType extends
 MappedLongForeignKey(this.asInstanceOf[MapperType], TradeTypeMetaObj){

override def _toForm = Full(SHtml.selectObj
  (List(

 (TradeTypeMetaObj.findAll(By(TradeTypeMetaObj.name, BUY)),
 kaufen),

 (TradeTypeMetaObj.findAll(By(TradeTypeMetaObj.name,
 SELL)),verkaufen)),

 Full(TradeTypeMetaObj.findAll(By(TradeTypeMetaObj.name, BUY))),
   (t: TradeType) = set(t))
  )
}*



 and here's the compiler error:


 [INFO] Compiling 1 source files to
 /home/wacky/workspace_VirtuelleBoerse/virtualMarket/target/classes
 [WARNING]
 
 /home/wacky/workspace_VirtuelleBoerse/virtualMarket/src/main/scala/org/tobster/model/Order.scala:50:
 error: value set is not a member of Long
 [WARNING](t: TradeType) = set(t))
 [WARNING]  ^
 [WARNING] one error found


 What do I've to do, to store the selected object in the corresponding
 table.


 thanks





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

 


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



[Lift] Re: selectObj again

2009-06-19 Thread Tobias Daub

Thanks Dave!

I modified the code a little bit:

object tradeType extends 
MappedLongForeignKey(this.asInstanceOf[MapperType], TradeTypeMetaObj){
 
override def _toForm = Full(SHtml.selectObj[TradeType]
  (List(

(TradeTypeMetaObj.findAll(By(TradeTypeMetaObj.name, BUY))(0), kaufen),

(TradeTypeMetaObj.findAll(By(TradeTypeMetaObj.name, SELL))(0), 
verkaufen)),
   
Full(TradeTypeMetaObj.findAll(By(TradeTypeMetaObj.name, BUY))(0)),
   (t: TradeType) = set(t))
  )
}


But I still get the same compiler error! Seems like I've to use some 
other method instead of set()? I discovered the set() method in one of 
the tutorials/Lift Book

any ideas?

thanks


 On Fri, Jun 19, 2009 at 6:10 AM, Tobias Daub hannes.flo...@gmx.li 
 mailto:hannes.flo...@gmx.li wrote:


 Hi Dave,

 thanks again! But I can't find any documentation about the selectType
 method. I looked at the API docs on the website, but in SHtml the
 selectType method didn't exist!? Even inside the sources from SHtml on
 github selectType wasn't there

 Can you tell me how to use and maybe a short code snippet?


 Sorry... I typed this when I was wicked tired and my brain fired 
 wrong. :-(

 SHtml.selectObj[TradeType](...)

 You have to give the compiler a hint about the type of the list.
  




 thanks and sorry for wasting your time...



  Try:  SHtml.selectType[TradeType]()
 
  On Thu, Jun 18, 2009 at 6:30 AM, Tobias Daub
 hannes.flo...@gmx.li mailto:hannes.flo...@gmx.li
  mailto:hannes.flo...@gmx.li mailto:hannes.flo...@gmx.li wrote:
 
 
  Hi There,
 
  I'm still having problems with the selectObj method.
 
  Here's the code:
 
  */* The basic trade types are: BUY and SELL */
 object tradeType extends
  MappedLongForeignKey(this.asInstanceOf[MapperType],
 TradeTypeMetaObj){
 
 override def _toForm = Full(SHtml.selectObj
   (List(
 
  (TradeTypeMetaObj.findAll(By(TradeTypeMetaObj.name, BUY)),
  kaufen),
 
  (TradeTypeMetaObj.findAll(By(TradeTypeMetaObj.name,
  SELL)),verkaufen)),
 
  Full(TradeTypeMetaObj.findAll(By(TradeTypeMetaObj.name,
 BUY))),
(t: TradeType) = set(t))
   )
 }*
 
 
 
  and here's the compiler error:
 
 
  [INFO] Compiling 1 source files to
 
 /home/wacky/workspace_VirtuelleBoerse/virtualMarket/target/classes
  [WARNING]
 
 
 /home/wacky/workspace_VirtuelleBoerse/virtualMarket/src/main/scala/org/tobster/model/Order.scala:50:
  error: value set is not a member of Long
  [WARNING](t: TradeType)
 = set(t))
  [WARNING]  ^
  [WARNING] one error found
 
 
  What do I've to do, to store the selected object in the
 corresponding
  table.
 
 
  thanks
 
 
 
 
 
  --
  Lift, the simply functional web framework http://liftweb.net
  Beginning Scala http://www.apress.com/book/view/1430219890
  Follow me: http://twitter.com/dpp
  Git some: http://github.com/dpp
 
  






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

 


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



[Lift] Re: selectObj again

2009-06-19 Thread Tobias Daub

David,

thanks a lot. That was exactly what I was looking for, I think I would 
never had figured this out by myself!

thanks!


 Tobias,

 Please see 
 http://github.com/dpp/lift_1_1_sample/blob/selectObj/src/main/scala/com/liftcode/model/SelectTrait.scala

 I think this does what you want it to.

 Please let me know if it doesn't.

 Thanks,

 David

 On Fri, Jun 19, 2009 at 9:32 AM, Tobias Daub hannes.flo...@gmx.li 
 mailto:hannes.flo...@gmx.li wrote:


 Thanks Dave!

 I modified the code a little bit:

 object tradeType extends
 MappedLongForeignKey(this.asInstanceOf[MapperType], TradeTypeMetaObj){

override def _toForm = Full(SHtml.selectObj[TradeType]
  (List(

 (TradeTypeMetaObj.findAll(By(TradeTypeMetaObj.name, BUY))(0),
 kaufen),

 (TradeTypeMetaObj.findAll(By(TradeTypeMetaObj.name, SELL))(0),
 verkaufen)),

 Full(TradeTypeMetaObj.findAll(By(TradeTypeMetaObj.name, BUY))(0)),
   (t: TradeType) = set(t))
  )
 }


 But I still get the same compiler error! Seems like I've to use some
 other method instead of set()? I discovered the set() method in one of
 the tutorials/Lift Book

 any ideas?

 thanks
 
 
  On Fri, Jun 19, 2009 at 6:10 AM, Tobias Daub
 hannes.flo...@gmx.li mailto:hannes.flo...@gmx.li
  mailto:hannes.flo...@gmx.li mailto:hannes.flo...@gmx.li wrote:
 
 
  Hi Dave,
 
  thanks again! But I can't find any documentation about the
 selectType
  method. I looked at the API docs on the website, but in
 SHtml the
  selectType method didn't exist!? Even inside the sources
 from SHtml on
  github selectType wasn't there
 
  Can you tell me how to use and maybe a short code snippet?
 
 
  Sorry... I typed this when I was wicked tired and my brain fired
  wrong. :-(
 
  SHtml.selectObj[TradeType](...)
 
  You have to give the compiler a hint about the type of the list.
 
 
 
 
 
  thanks and sorry for wasting your time...
 
 
 
   Try:  SHtml.selectType[TradeType]()
  
   On Thu, Jun 18, 2009 at 6:30 AM, Tobias Daub
  hannes.flo...@gmx.li mailto:hannes.flo...@gmx.li
 mailto:hannes.flo...@gmx.li mailto:hannes.flo...@gmx.li
   mailto:hannes.flo...@gmx.li mailto:hannes.flo...@gmx.li
 mailto:hannes.flo...@gmx.li mailto:hannes.flo...@gmx.li wrote:
  
  
   Hi There,
  
   I'm still having problems with the selectObj method.
  
   Here's the code:
  
   */* The basic trade types are: BUY and SELL */
  object tradeType extends
   MappedLongForeignKey(this.asInstanceOf[MapperType],
  TradeTypeMetaObj){
  
  override def _toForm = Full(SHtml.selectObj
(List(
  
   (TradeTypeMetaObj.findAll(By(TradeTypeMetaObj.name,
 BUY)),
   kaufen),
  
   (TradeTypeMetaObj.findAll(By(TradeTypeMetaObj.name,
   SELL)),verkaufen)),
  
   Full(TradeTypeMetaObj.findAll(By(TradeTypeMetaObj.name,
  BUY))),
 (t: TradeType) =
 set(t))
)
  }*
  
  
  
   and here's the compiler error:
  
  
   [INFO] Compiling 1 source files to
  
 
 /home/wacky/workspace_VirtuelleBoerse/virtualMarket/target/classes
   [WARNING]
  
 
 
 /home/wacky/workspace_VirtuelleBoerse/virtualMarket/src/main/scala/org/tobster/model/Order.scala:50:
   error: value set is not a member of Long
   [WARNING](t:
 TradeType)
  = set(t))
   [WARNING]
  ^
   [WARNING] one error found
  
  
   What do I've to do, to store the selected object in the
  corresponding
   table.
  
  
   thanks
  
  
  
  
  
   --
   Lift, the simply functional web framework http://liftweb.net
   Beginning Scala http://www.apress.com/book/view/1430219890
   Follow me: http://twitter.com/dpp
   Git some: http://github.com/dpp
  
   
 
 
 
 
 
 
  --
  Lift, the simply functional web framework http://liftweb.net
  Beginning Scala http://www.apress.com/book/view/1430219890
  Follow me: http://twitter.com/dpp
  Git

[Lift] Error during sign-up

2009-06-18 Thread Tobias Daub

Hi There,

I just got this error when I tried to sign-up a new user with the 
default interface.

thanks

--

Exception occured while processing /user_mgt/sign_up

Message: java.lang.AbstractMethodError: 
org.tobster.model.User$.addlQueryParams()Lnet/liftweb/mapper/MetaMapper$addlQueryParams$;

net.liftweb.mapper.MetaMapper$$anonfun$findMapFieldDb$1.apply(MetaMapper.scala:299)

net.liftweb.mapper.MetaMapper$$anonfun$findMapFieldDb$1.apply(MetaMapper.scala:298)
net.liftweb.mapper.DB$.use(DB.scala:317)
net.liftweb.mapper.MetaMapper$class.findMapFieldDb(MetaMapper.scala:297)
org.tobster.model.User$.findMapFieldDb(User.scala:9)
net.liftweb.mapper.MetaMapper$class.findMapDb(MetaMapper.scala:293)
org.tobster.model.User$.findMapDb(User.scala:9)
net.liftweb.mapper.MetaMapper$class.findAll(MetaMapper.scala:259)
org.tobster.model.User$.findAll(User.scala:9)
net.liftweb.mapper.MappedString.valUnique(MappedString.scala:173)
net.liftweb.mapper.ProtoUser$email$$anonfun$1.apply(ProtoUser.scala:61)
net.liftweb.mapper.ProtoUser$email$$anonfun$1.apply(ProtoUser.scala:61)

net.liftweb.mapper.MappedField$$anonfun$validate$1.apply(MappedField.scala:557)

net.liftweb.mapper.MappedField$$anonfun$validate$1.apply(MappedField.scala:553)
scala.List.flatMap(List.scala:1132)
net.liftweb.mapper.MappedField$class.validate(MappedField.scala:553)
net.liftweb.mapper.MappedEmail.validate(MappedEmail.scala:34)
net.liftweb.mapper.MetaMapper$$anonfun$11.apply(MetaMapper.scala:522)
net.liftweb.mapper.MetaMapper$$anonfun$11.apply(MetaMapper.scala:522)
scala.List.flatMap(List.scala:1132)

net.liftweb.mapper.MetaMapper$class.runValidationList(MetaMapper.scala:522)
org.tobster.model.User$.runValidationList(User.scala:9)
net.liftweb.mapper.MetaMapper$class.validate(MetaMapper.scala:536)
org.tobster.model.User$.validate(User.scala:9)
net.liftweb.mapper.Mapper$$anonfun$validate$1.apply(Mapper.scala:105)
net.liftweb.mapper.Mapper$$anonfun$validate$1.apply(Mapper.scala:105)
net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
net.liftweb.mapper.Safe$.runSafe(Safe.scala:44)
net.liftweb.mapper.Mapper$class.runSafe(Mapper.scala:50)
org.tobster.model.User.runSafe(User.scala:24)
net.liftweb.mapper.Mapper$class.validate(Mapper.scala:104)
org.tobster.model.User.validate(User.scala:24)

net.liftweb.mapper.MetaMegaProtoUser$class.testSignup$1(ProtoUser.scala:340)

net.liftweb.mapper.MetaMegaProtoUser$$anonfun$innerSignup$1$1.apply(ProtoUser.scala:360)

net.liftweb.mapper.MetaMegaProtoUser$$anonfun$innerSignup$1$1.apply(ProtoUser.scala:360)
net.liftweb.http.S$NFuncHolder$$anonfun$apply$49.apply(S.scala:1695)
net.liftweb.http.S$NFuncHolder$$anonfun$apply$49.apply(S.scala:1695)
scala.List.map(List.scala:812)
net.liftweb.http.S$NFuncHolder.apply(S.scala:1695)

net.liftweb.http.LiftSession$$anonfun$buildFunc$1$2.apply(LiftSession.scala:339)

net.liftweb.http.LiftSession$$anonfun$6$$anonfun$apply$19.apply(LiftSession.scala:354)

net.liftweb.http.LiftSession$$anonfun$6$$anonfun$apply$19.apply(LiftSession.scala:354)
scala.List.map(List.scala:812)
net.liftweb.http.LiftSession$$anonfun$6.apply(LiftSession.scala:354)
net.liftweb.http.LiftSession$$anonfun$6.apply(LiftSession.scala:343)
scala.List.flatMap(List.scala:1132)
net.liftweb.http.LiftSession.runParams(LiftSession.scala:343)
net.liftweb.http.LiftSession.processRequest(LiftSession.scala:543)

net.liftweb.http.LiftServlet.net$liftweb$http$LiftServlet$$dispatchStatefulRequest(LiftServlet.scala:239)
net.liftweb.http.LiftServlet$$anonfun$2.apply(LiftServlet.scala:155)
net.liftweb.http.LiftServlet$$anonfun$2.apply(LiftServlet.scala:155)
net.liftweb.http.S$.net$liftweb$http$S$$wrapQuery(S.scala:908)

net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_nest2InnerInit$1$$anonfun$apply$18.apply(S.scala:1026)
net.liftweb.http.S$.net$liftweb$http$S$$doAround(S.scala:845)

net.liftweb.http.S$$anonfun$net$liftweb$http$S$$doAround$1.apply(S.scala:846)

net.liftweb.mapper.DB$$anon$1.net$liftweb$mapper$DB$$anon$$doWith(DB.scala:117)

net.liftweb.mapper.DB$$anon$1$$anonfun$net$liftweb$mapper$DB$$anon$$doWith$1.apply(DB.scala:118)

net.liftweb.mapper.DB$$anon$1$$anonfun$net$liftweb$mapper$DB$$anon$$doWith$1.apply(DB.scala:118)
net.liftweb.mapper.DB$.use(DB.scala:317)

net.liftweb.mapper.DB$$anon$1.net$liftweb$mapper$DB$$anon$$doWith(DB.scala:118)
net.liftweb.mapper.DB$$anon$1.apply(DB.scala:124)
net.liftweb.http.S$.net$liftweb$http$S$$doAround(S.scala:846)


[Lift] error during sign-up (solved)

2009-06-18 Thread Tobias Daub

Sorry,

After I did mvn clean install it was ok.

thanks anyway




--~--~-~--~~~---~--~~
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] selectObj again

2009-06-18 Thread Tobias Daub

Hi There,

I'm still having problems with the selectObj method.

Here's the code:

*/* The basic trade types are: BUY and SELL */
object tradeType extends 
MappedLongForeignKey(this.asInstanceOf[MapperType], TradeTypeMetaObj){
 
override def _toForm = Full(SHtml.selectObj
  (List(

(TradeTypeMetaObj.findAll(By(TradeTypeMetaObj.name, BUY)), kaufen),

(TradeTypeMetaObj.findAll(By(TradeTypeMetaObj.name, SELL)),verkaufen)),
   
Full(TradeTypeMetaObj.findAll(By(TradeTypeMetaObj.name, BUY))),
   (t: TradeType) = set(t))
  )
}*



and here's the compiler error:


[INFO] Compiling 1 source files to 
/home/wacky/workspace_VirtuelleBoerse/virtualMarket/target/classes
[WARNING] 
/home/wacky/workspace_VirtuelleBoerse/virtualMarket/src/main/scala/org/tobster/model/Order.scala:50:
 
error: value set is not a member of Long
[WARNING](t: TradeType) = set(t))
[WARNING]  ^
[WARNING] one error found


What do I've to do, to store the selected object in the corresponding 
table.


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: Develop / Production System

2009-06-16 Thread Tobias Daub

Ok, thanks.

Well, with the pom.xml file it was a little bit strange. I had to change 
the Lift version to do the mvn clean install and then change it back. 
I've no idea why, but it was the only things that helped.


 Maven stores project dependencies in a repository (by default, its 
 called .m2). When you move a Lift application from one system to 
 another, the repository on the new system may need to be updated, 
 hence your requirement to do a mvn clean install.

 Don't know what you changed on the pom.xml (if you have any hard coded 
 paths, you might have to change them).

 On Tue, Jun 16, 2009 at 2:41 AM, Tobias Daub hannes.flo...@gmx.li 
 mailto:hannes.flo...@gmx.li wrote:


 Hi There,

 I would like to know whats the best way to move an existing Lift
 installation from one system to another. I ask this, because I had
 some
 problems after I just copied the whole directory (I had to edit the
 pom.xml file and do mvn clean install).


 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] using selectObj

2009-05-25 Thread Tobias Daub

Hi Lifters,

I attempted to modify a MappedLongForeignKey field in my class to 
display itself as a drop-down menu.

I wanna select objects from another database table, therefore I used 
SHtml.selectObj. Here's the code:

object tradeType extends 
MappedLongForeignKey(this.asInstanceOf[MapperType], TradeTypeMetaObj){
 
  override def _toForm = 
Full(selectObj(List((TradeTypeMetaObj.findAll(By(TradeTypeMetaObj.name, 
BUY)), BUY),
 
(TradeTypeMetaObj.findAll(By(TradeTypeMetaObj.name, SELL)), SELL)),
 Full(is.toString),
 (f: TradeType) = 
set(f.toString)))
}


I have some problems with the three parameters for selectObj. I don't 
understand the two examples (one in the Lift book, p. 53, 4.1.10 
selectObj, the other one in the getting started tutorial, p. 18, 2.10 
Updating the priority and desc fields). In both examples they use 
lists of some data, instead of Lists-Of-Tuples, which is the official 
way mentioned in the documentation of the selectObj method in the book.

I think the first parameter should be OK, at least the compiler doesn't 
complain about it. The second parameter is as far as I understood it, 
the entry that should be selected by default. But I don't really know, 
what the third one, the function object awaits from me.

As you can see, the list only contains two objects. I wanna display 
BUY for the first one and SELL for the second one. Depending on what 
the user selects, the corresponding object should be stored in the 
tradeType field. There are only two rows/instances in the TradeType 
table, one for BUY and one for SELL.


thanks in advance...


--~--~-~--~~~---~--~~
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: set currentUser as owner

2009-05-22 Thread Tobias Daub

Hi Dave,

thanks, after doing the mvn clean the error disappeared. But now I 
still have a type error:

error: type mismatch;
[WARNING]  found   : Any
[WARNING]  required: Long
[WARNING] override def defaultValue = User.currentUserId openOr 0L
[WARNING]^
[WARNING] one error found


Seems like the openOr doesn't work...,? Because it should than return 
the 0L, or? Therefor, I wrote a method:

def checkIfUserAvailable(usr: Any) = usr match{
  case l: Long = l
  case a: Any = 0L
}

and invoked it like this:

override def defaultValue = checkIfUserAvailable(User.currentUserId)

I can compile this, but when I run it, seems like every item/order I 
create has the same UserId, because all users can see all items/orders.

thanks.

 This is our old friend, Scala defect 715... closed for 2.8.0:
 https://lampsvn.epfl.ch/trac/scala/ticket/715

 Please do a mvn clean jetty:run and all should be good.

 On May 21, 7:08 am, Tobias Daub hannes.flo...@gmx.li wrote:
   
 Hi Dave,

 The thing with

 User.currentUserId openOr 0L

 didn't worked as well.

 I attached the source file that contains the trait that I mix into my
 class .

 
 Can you post a code sample and the error?
   
 Warning: JAVA_HOME environment variable is not set.
 [INFO] Scanning for projects...
 [INFO] Searching repository for plugin with prefix: 'jetty'.
 [INFO]
 
 [INFO] Building virtualMarket
 [INFO]task-segment: [jetty:run]
 [INFO]
 
 [INFO] Preparing jetty:run
 [INFO] [resources:resources]
 [WARNING] Using platform encoding (UTF-8 actually) to copy filtered
 resources, i.e. build is platform dependent!
 [INFO] Copying 0 resource
 [INFO] [yuicompressor:compress {execution: default}]
 [INFO] nb warnings: 0, nb errors: 0
 [INFO] [compiler:compile]
 [INFO] Nothing to compile - all classes are up to date
 [INFO] [scala:compile {execution: default}]
 [INFO] Checking for multiple versions of scala
 [INFO] Compiling 1 source files to /home/tobs/virtualMarket/target/classes
 [WARNING] Exception in thread main java.lang.RuntimeException:
 malformed Scala signature of User at 13749; reference type _1 of none
 refers to nonexisting symbol.
 [WARNING] at
 scala.tools.nsc.symtab.classfile.UnPickler$UnPickle.errorBadSignature(UnPickler.scala:762)
 [WARNING] at
 scala.tools.nsc.symtab.classfile.UnPickler$UnPickle.scala$tools$nsc$symtab$classfile$UnPickler$UnPickle$$readSymbol(UnPickler.scala:172)
 [WARNING] at
 scala.tools.nsc.symtab.classfile.UnPickler$UnPickle$$anonfun$scala$tools$nsc$symtab$classfile$UnPickler$UnPickle$$readSymbolRef$1.apply(UnPickler.scala:714)
 [WARNING] at
 scala.tools.nsc.symtab.classfile.UnPickler$UnPickle$$anonfun$scala$tools$nsc$symtab$classfile$UnPickler$UnPickle$$readSymbolRef$1.apply(UnPickler.scala:714)
 [WARNING] at
 scala.tools.nsc.symtab.classfile.UnPickler$UnPickle.scala$tools$nsc$symtab$classfile$UnPickler$UnPickle$$at(UnPickler.scala:139)
 [WARNING] at
 scala.tools.nsc.symtab.classfile.UnPickler$UnPickle.scala$tools$nsc$symtab$classfile$UnPickler$UnPickle$$readSymbolRef(UnPickler.scala:714)
 [WARNING] at
 scala.tools.nsc.symtab.classfile.UnPickler$UnPickle.scala$tools$nsc$symtab$classfile$UnPickler$UnPickle$$readType(UnPickler.scala:254)
 [WARNING] at
 scala.tools.nsc.symtab.classfile.UnPickler$UnPickle$$anonfun$scala$tools$nsc$symtab$classfile$UnPickler$UnPickle$$readTypeRef$1.apply(UnPickler.scala:715)
 [WARNING] at
 scala.tools.nsc.symtab.classfile.UnPickler$UnPickle$$anonfun$scala$tools$nsc$symtab$classfile$UnPickler$UnPickle$$readTypeRef$1.apply(UnPickler.scala:715)
 [WARNING] at
 scala.tools.nsc.symtab.classfile.UnPickler$UnPickle.scala$tools$nsc$symtab$classfile$UnPickler$UnPickle$$at(UnPickler.scala:139)
 [WARNING] at
 scala.tools.nsc.symtab.classfile.UnPickler$UnPickle.scala$tools$nsc$symtab$classfile$UnPickler$UnPickle$$readTypeRef(UnPickler.scala:715)
 [WARNING] at
 scala.tools.nsc.symtab.classfile.UnPickler$UnPickle$$anonfun$3.apply(UnPickler.scala:255)
 [WARNING] at
 scala.tools.nsc.symtab.classfile.UnPickler$UnPickle$$anonfun$3.apply(UnPickler.scala:255)
 [WARNING] at
 scala.tools.nsc.symtab.classfile.PickleBuffer.until(PickleBuffer.scala:127)
 [WARNING] at
 scala.tools.nsc.symtab.classfile.UnPickler$UnPickle.scala$tools$nsc$symtab$classfile$UnPickler$UnPickle$$readType(UnPickler.scala:255)
 [WARNING] at
 scala.tools.nsc.symtab.classfile.UnPickler$UnPickle$$anonfun$scala$tools$nsc$symtab$classfile$UnPickler$UnPickle$$readTypeRef$1.apply(UnPickler.scala:715)
 [WARNING] at
 scala.tools.nsc.symtab.classfile.UnPickler$UnPickle$$anonfun$scala$tools$nsc$symtab$classfile$UnPickler$UnPickle$$readTypeRef$1.apply(UnPickler.scala:715)
 [WARNING] at
 scala.tools.nsc.symtab.classfile.UnPickler$UnPickle.scala$tools

[Lift] Re: set currentUser as owner

2009-05-21 Thread Tobias Daub
] at 
scala.tools.nsc.Global$GlobalPhase$$anonfun$run$1.apply(Global.scala:246)
[WARNING] at scala.Iterator$class.foreach(Iterator.scala:414)
[WARNING] at 
scala.collection.mutable.ListBuffer$$anon$1.foreach(ListBuffer.scala:266)
[WARNING] at scala.tools.nsc.Global$GlobalPhase.run(Global.scala:246)
[WARNING] at scala.tools.nsc.Global$Run.compileSources(Global.scala:574)
[WARNING] at scala.tools.nsc.Global$Run.compile(Global.scala:667)
[WARNING] at scala.tools.nsc.Main$.process(Main.scala:73)
[WARNING] at scala.tools.nsc.Main$.main(Main.scala:87)
[WARNING] at scala.tools.nsc.Main.main(Main.scala)
[INFO] 

[ERROR] BUILD FAILURE
[INFO] 

[INFO] command line returned non-zero value:1
[INFO] 

[INFO] For more information, run Maven with the -e switch
[INFO] 

[INFO] Total time: 32 seconds
[INFO] Finished at: Thu May 21 16:01:45 CEST 2009
[INFO] Final Memory: 15M/30M
[INFO] 




 try:

 object owner extends MappedLongForeignKey(this, User) {
   override def defaultValue = User.currentUserId openOr 0L
 }

thanks


 On Wed, May 20, 2009 at 5:38 PM, Tobias Daub hannes.flo...@gmx.li 
 mailto:hannes.flo...@gmx.li wrote:


 Hello Lifters,

 I wanted to override the defaultValue of my owner field, to always set
 it to the currentUser. I cannot compile this, because I get an error
 (what I kind of understand). During compilation, there's no
 currentUser
 so this function call has to be delayed somehow, but how?

 The definition of the owner field is inside a trait, is this a
 additional reason for this error?


 thanks!





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

 


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

/*
 * Order.scala
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package org.tobster.model

import net.liftweb._
import mapper._
import http._
import SHtml._
import util._
import model._

/* Describes a general order.  */
trait Order extends BaseLongKeyedMapper{

/* The number of lots this order has */
object lots extends MappedInt(this.asInstanceOf[MapperType])

/* The person who owns the order */
object owner extends MappedLongForeignKey(this.asInstanceOf[MapperType], User){
  
// hides this field in the CRUDify list/create forms
override def dbDisplay_? = false

override def defaultValue = User.currentUser
//override def defaultValue = User.currentUserId openOr 0L

}

/* The market place where the order belongs to  */
object marketPlace extends MappedLongForeignKey(this.asInstanceOf[MapperType], MarketPlaceMetaObj)

/* There are different types of orders, e.g. Limit Order, Market Order etc. */
object orderType extends MappedLongForeignKey(this.asInstanceOf[MapperType], OrderTypeMetaObj)

/* The basic trade types are: BUY and SELL */
object tradeType extends MappedLongForeignKey(this.asInstanceOf[MapperType], TradeTypeMetaObj){
  
  // override def _toForm = SHtml.selectObj( ... )
  
}
   

// def currentValue = this.lots * this.marketPlace.lotValue

}


[Lift] set currentUser as owner

2009-05-20 Thread Tobias Daub

Hello Lifters,

I wanted to override the defaultValue of my owner field, to always set 
it to the currentUser. I cannot compile this, because I get an error 
(what I kind of understand). During compilation, there's no currentUser 
so this function call has to be delayed somehow, but how?

The definition of the owner field is inside a trait, is this a 
additional reason for this error?


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: more CRUDify

2009-05-06 Thread Tobias Daub
CrudType is a type parameter, or? Its not the class nor companion object 
that mixes in CRUDify...? Because I tried that, too. I got a compiler 
error anyway = error: not found: type CrudType

Does the owner field belong to CRUDify? I got a bit confused, because 
I added such a field to my class by hand.

The link from the API docs is dead:
http://scala-tools.org/scaladocs/liftweb/1.0/net/liftweb/mapper/CRUDify.CrudType.html


thanks



David Pollak schrieb:


 On Tue, May 5, 2009 at 12:35 PM, Tobias Daub hannes.flo...@gmx.li 
 mailto:hannes.flo...@gmx.li wrote:


 Hello List,

 I've some more questions about CRUDify! The sources aren't helping
 me so
 much and I really miss some more comments! (sorry)

 1.) I wanna change the behaviour for listing items, e.g. I only want
 to list items that belong to the logged in user. Is there any method I
 can override (def showAllMenuLoc: Box[Menu]) ? How?



 override def findForListParams: List[QueryParam[CrudType]] = 
 By(CrudType.owner, User.currentUser) :: super.findForListParams

  




 2.) Is there any chance to tell an object that it should display
 itself
 as a drop-down menu? There is something similar in the ToDo tutorial
 with the priority field, but I couldn't adapt it. What if I wanna
 display items in the drop-down menu that are from another database
 table
 (I wanna select entries from there). The priority field only contains
 integer values


 You can override the _toForm method on the field that you want to 
 display as a select.

 See SHtml.selectObj()  This will allow you to display a selection of 
 objects.

 If you need more of a detailed description, please post the 
 MappedField that you want displayed as a drop-down and we can work 
 through the code together.

 Thanks,

 David
  


 thanks





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

 

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



[Lift] more CRUDify

2009-05-05 Thread Tobias Daub

Hello List,

I've some more questions about CRUDify! The sources aren't helping me so 
much and I really miss some more comments! (sorry)

1.) I wanna change the behaviour for listing items, e.g. I only want 
to list items that belong to the logged in user. Is there any method I 
can override (def showAllMenuLoc: Box[Menu]) ? How?


2.) Is there any chance to tell an object that it should display itself 
as a drop-down menu? There is something similar in the ToDo tutorial 
with the priority field, but I couldn't adapt it. What if I wanna 
display items in the drop-down menu that are from another database table 
(I wanna select entries from there). The priority field only contains 
integer values


thanks

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



[Lift] Re: override def editMenuLocParams

2009-04-28 Thread Tobias Daub
My pom.xml file says 1.1-SNAPSHOT and I changed it to scala version 
2.7.4 and did a mvn -U clean install again. But I still get the same 
error.?






David Pollak schrieb:


 On Sun, Apr 26, 2009 at 1:11 PM, Tobias Daub hannes.flo...@gmx.li 
 mailto:hannes.flo...@gmx.li wrote:


 Hi There,

 I've got a compiler error when I tried to override those new CRUDify
 methods.

 value editMenuLocParams is not a member of
 org.tobster.model.LimitOrder
 with
 net.liftweb.mapper.KeyedMetaMapper[Long,org.tobster.model.LimitOrder]
 with ScalaObject

 I tried it with showAllMenuLocParams too, and got the same error.

 The class LimitOrder extends CRUDify and mixes in another traid. I did
 mvn -U clean install and several mvn -U jetty:run and created
 a new
 project and copied the sources in there, but still got the same error.
 Seems to me that my local version wasn't updated to 1.1, or?


 Does your pom.xml file list Lift 1.0 or 1.1-SNAPSHOT?
  




 thanks.





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

 

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



[Lift] override def editMenuLocParams

2009-04-26 Thread Tobias Daub

Hi There,

I've got a compiler error when I tried to override those new CRUDify 
methods.

value editMenuLocParams is not a member of org.tobster.model.LimitOrder 
with 
net.liftweb.mapper.KeyedMetaMapper[Long,org.tobster.model.LimitOrder] 
with ScalaObject

I tried it with showAllMenuLocParams too, and got the same error.

The class LimitOrder extends CRUDify and mixes in another traid. I did 
mvn -U clean install and several mvn -U jetty:run and created a new 
project and copied the sources in there, but still got the same error. 
Seems to me that my local version wasn't updated to 1.1, or?


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: CRUDifying a model

2009-04-22 Thread Tobias Daub

Hi Dave,

First, is this 1.1 version already in the repository, will maven 
automatically get it?

Second, where do I have to override those methods, in the class that 
extends Mapper or in the companion object?

Can you give a short code sample how to override, please.

thanks.


 I've added new CRUDify stuff for 1.1 (Hudson is building right now).

 There are 4 methods that you can override:
   def showAllMenuLocParams: List[Loc.LocParam] = Nil
   def createMenuLocParams: List[Loc.LocParam] = Nil
   def viewMenuLocParams: List[Loc.LocParam] = Nil
   def editMenuLocParams: List[Loc.LocParam] = Nil

 Just put additional LocParams in these lists (e.g., If(), Unless()) 
 and you can set access control.

 Thanks,

 David


 On Thu, Apr 16, 2009 at 5:51 AM, Tobias Daub hannes.flo...@gmx.li 
 mailto:hannes.flo...@gmx.li wrote:


 Hi Dave,

 Can you please give a short example, how to hide those List/Create
 entries from the sitemap, when a user is not logged in? I already
 had a
 glimpse at the chapter about the sitemap from the book, but I'm
 missing
 some more detailed sample code...

 thanks
 Tobias
  In Boot.scala, when you're constructing the menu, put MyModel.menu
  (which returns a List[Menu]) in the list of menu items.
 
  On Sun, Apr 12, 2009 at 3:16 PM, ari arimat...@gmail.com
 mailto:arimat...@gmail.com
  mailto:arimat...@gmail.com mailto:arimat...@gmail.com wrote:
 
 
  I have a model defined with the CRUDify trait.  I'm under the
  impression that I need to add something to the sitemap for the
  crudified pages to be available, and that defining my model with
  CRUDify should create some basic UI and addition pages for
 my model.
  Basically, given a model x with crudify, what do I have to
 do to get
  the model accessible over the web with a minimum of fuss?
 
  Thanks.
 
 
 
 
 
  --
  Lift, the simply functional web framework http://liftweb.net
  Beginning Scala http://www.apress.com/book/view/1430219890
  Follow me: http://twitter.com/dpp
  Git some: http://github.com/dpp
 
  






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

 


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



[Lift] Re: CRUDifying a model

2009-04-19 Thread Tobias Daub

Do I understand it right..before I had to do this access stuff in 
Boot.scala. But those new methods I've to override directly in the 
companion object of the class that inherits from CRUDify? Is that right?

I dont need to edit anything in Boot.scala.?

thanks
 I've added new CRUDify stuff for 1.1 (Hudson is building right now).

 There are 4 methods that you can override:
   def showAllMenuLocParams: List[Loc.LocParam] = Nil
   def createMenuLocParams: List[Loc.LocParam] = Nil
   def viewMenuLocParams: List[Loc.LocParam] = Nil
   def editMenuLocParams: List[Loc.LocParam] = Nil

 Just put additional LocParams in these lists (e.g., If(), Unless()) 
 and you can set access control.

 Thanks,

 David


 On Thu, Apr 16, 2009 at 5:51 AM, Tobias Daub hannes.flo...@gmx.li 
 mailto:hannes.flo...@gmx.li wrote:


 Hi Dave,

 Can you please give a short example, how to hide those List/Create
 entries from the sitemap, when a user is not logged in? I already
 had a
 glimpse at the chapter about the sitemap from the book, but I'm
 missing
 some more detailed sample code...

 thanks
 Tobias
  In Boot.scala, when you're constructing the menu, put MyModel.menu
  (which returns a List[Menu]) in the list of menu items.
 
  On Sun, Apr 12, 2009 at 3:16 PM, ari arimat...@gmail.com
 mailto:arimat...@gmail.com
  mailto:arimat...@gmail.com mailto:arimat...@gmail.com wrote:
 
 
  I have a model defined with the CRUDify trait.  I'm under the
  impression that I need to add something to the sitemap for the
  crudified pages to be available, and that defining my model with
  CRUDify should create some basic UI and addition pages for
 my model.
  Basically, given a model x with crudify, what do I have to
 do to get
  the model accessible over the web with a minimum of fuss?
 
  Thanks.
 
 
 
 
 
  --
  Lift, the simply functional web framework http://liftweb.net
  Beginning Scala http://www.apress.com/book/view/1430219890
  Follow me: http://twitter.com/dpp
  Git some: http://github.com/dpp
 
  






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

 


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



[Lift] Re: CRUDifying a model

2009-04-16 Thread Tobias Daub

Hi Dave,

Can you please give a short example, how to hide those List/Create 
entries from the sitemap, when a user is not logged in? I already had a 
glimpse at the chapter about the sitemap from the book, but I'm missing 
some more detailed sample code...

thanks
Tobias
 In Boot.scala, when you're constructing the menu, put MyModel.menu 
 (which returns a List[Menu]) in the list of menu items.

 On Sun, Apr 12, 2009 at 3:16 PM, ari arimat...@gmail.com 
 mailto:arimat...@gmail.com wrote:


 I have a model defined with the CRUDify trait.  I'm under the
 impression that I need to add something to the sitemap for the
 crudified pages to be available, and that defining my model with
 CRUDify should create some basic UI and addition pages for my model.
 Basically, given a model x with crudify, what do I have to do to get
 the model accessible over the web with a minimum of fuss?

 Thanks.





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

 


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



[Lift] create todo item during boot

2009-04-15 Thread Tobias Daub

Hi There,

I wanna have some kind of standard todo item, that should always be 
there (in the database). I Don't want to create that todo item manually 
by hand, instead I want to create it during boot. Means I wanna check 
everytime when Lift is started, if it already exists and if not, it'll 
be created.

I know that this doesn't make any sense for todo items, but I need it 
for something else.

In which source file should I do that?

thanks
Tobias

--~--~-~--~~~---~--~~
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: create todo item during boot

2009-04-15 Thread Tobias Daub

Yeah, I though about that too, but I couln't find an appropriate place 
in the code where to hook in.


 You can probably do that in you Lift Boot class after you DB
 connections are setup etc.


 Br's,
 Marius

 On Apr 15, 6:55 pm, Tobias Daub hannes.flo...@gmx.li wrote:
   
 Hi There,

 I wanna have some kind of standard todo item, that should always be
 there (in the database). I Don't want to create that todo item manually
 by hand, instead I want to create it during boot. Means I wanna check
 everytime when Lift is started, if it already exists and if not, it'll
 be created.

 I know that this doesn't make any sense for todo items, but I need it
 for something else.

 In which source file should I do that?

 thanks
 Tobias
 
 
   


--~--~-~--~~~---~--~~
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: create todo item during boot

2009-04-15 Thread Tobias Daub

Dave,

thanks alot man!

cheers
Tobias
 Dude... it's the magic of dbAddTable in the MetaMapper object:

 in object ToDo... add:

 override def dbAddTable = Full(populate _)
  
 private def populate {
 ToDo.create.().save
 }

 When Schemifier adds a table, it will invoke the function specified by 
 dbAddTable and that's a perfect place to add the default ToDo item.

 On Wed, Apr 15, 2009 at 9:09 AM, marius d. marius.dan...@gmail.com 
 mailto:marius.dan...@gmail.com wrote:


 You can probably do that in you Lift Boot class after you DB
 connections are setup etc.


 Br's,
 Marius

 On Apr 15, 6:55 pm, Tobias Daub hannes.flo...@gmx.li
 mailto:hannes.flo...@gmx.li wrote:
  Hi There,
 
  I wanna have some kind of standard todo item, that should
 always be
  there (in the database). I Don't want to create that todo item
 manually
  by hand, instead I want to create it during boot. Means I wanna
 check
  everytime when Lift is started, if it already exists and if not,
 it'll
  be created.
 
  I know that this doesn't make any sense for todo items, but I
 need it
  for something else.
 
  In which source file should I do that?
 
  thanks
  Tobias




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

 


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



[Lift] convention how to name classes in snippet package

2009-04-13 Thread Tobias Daub

Hi There,

Is there any convention about how to name classes in the snippet package.

In the ToDo example the snippet that corresponds to the ToDo Model was 
named TD which is maybe not the best name.

Would it be possible to prefix the class name with something, e.g. 
ToDoFactory? Factory is probably not a really good name as well...

thanks
Tobias

--~--~-~--~~~---~--~~
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] nice tutorial

2009-04-08 Thread Tobias Daub

Hi There,

I don't know if somebody already found this, but I think its nice and 
helpful, too.

http://www.ibm.com/developerworks/ajax/tutorials/wa-aj-comet/

Tobias

--~--~-~--~~~---~--~~
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: Howto re-initialize database

2009-04-08 Thread Tobias Daub

Thanks, that helped!

If I want to create some initial items in a table when lift is started 
first, where is a good point to do that?

I had a look a Boot.scala but couldn't find an entry point.

Tobias
 Right, sorry about that.

 On Apr 6, 10:01 am, Derek Chen-Becker dchenbec...@gmail.com wrote:
   
 Actually, Derby doesn't have an in-memory mode 
 (http://db.apache.org/derby/faq.html#in_memory), and saves the data to disk
 by default. The JDBC connection URL determines the directory that Derby
 saves stuff in. In the ToDo app I believe it's lift_example, which should
 be in your project root directory. You can just delete that directory and it
 wipes the DB.

 Derek



 On Mon, Apr 6, 2009 at 5:53 AM, TylerWeir tyler.w...@gmail.com wrote:

 
 The default setup uses Apache Derby[1], which is an in-memory db.
   
 You are free to use other DBs, most commonly used would be MySQL and
 PostgreSQL, although there are others.
 Take a look here,
 http://wiki.liftweb.net/index.php?title=Cheat_Sheet#Connection_String...
   
 [1]http://db.apache.org/derby/
   
 On Apr 6, 3:25 am, Tobias Daub hannes.flo...@gmx.li wrote:
   
 Hi Derek,
 
 This was something that confused me a bit, too. Which kind of database
 is Lift using? Its not mentioned at all in the tutorial, or?
 
 I just know it from Turbogears, that they had a tool that could play
 with the underlying database and do stuff like delete all tables and
 create new empty ones. With Grok its really easy to create a new empty
 database, too.
 
 I think this is really helpful for testing, because you dont have waste
 so much time with doing it manually.
 
 I just asked, because I thought maybe there's something similar to do so.
 
 thanks
 Tobias
 
 If you're talking about one of the archetypes (using Derby), just
 delete the Derby directory in your project root. Otherwise, you could
 look at the destroyTables_!! method on Schemifier. Could you give some
 more details?
   
 Derek
   
 On Sun, Apr 5, 2009 at 1:06 PM, Tobias Daub hannes.flo...@gmx.li
 mailto:hannes.flo...@gmx.li wrote:
   
 Hi There,
   
 How can I initialize the database again, e.g. to have all tables
   
 emtpy
   
 again?
   
 Do I have to modify Boot.scala?
   
 thanks
 Tobias
   
 
   


--~--~-~--~~~---~--~~
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: Howto re-initialize database

2009-04-06 Thread Tobias Daub

Hi Derek,

This was something that confused me a bit, too. Which kind of database 
is Lift using? Its not mentioned at all in the tutorial, or?

I just know it from Turbogears, that they had a tool that could play 
with the underlying database and do stuff like delete all tables and 
create new empty ones. With Grok its really easy to create a new empty 
database, too.

I think this is really helpful for testing, because you dont have waste 
so much time with doing it manually.

I just asked, because I thought maybe there's something similar to do so.

thanks
Tobias
 If you're talking about one of the archetypes (using Derby), just 
 delete the Derby directory in your project root. Otherwise, you could 
 look at the destroyTables_!! method on Schemifier. Could you give some 
 more details?

 Derek

 On Sun, Apr 5, 2009 at 1:06 PM, Tobias Daub hannes.flo...@gmx.li 
 mailto:hannes.flo...@gmx.li wrote:


 Hi There,

 How can I initialize the database again, e.g. to have all tables emtpy
 again?

 Do I have to modify Boot.scala?

 thanks
 Tobias




 


--~--~-~--~~~---~--~~
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] Howto re-initialize database

2009-04-05 Thread Tobias Daub

Hi There,

How can I initialize the database again, e.g. to have all tables emtpy 
again?

Do I have to modify Boot.scala?

thanks
Tobias

--~--~-~--~~~---~--~~
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] newbie question: using ajaxText() to get integer from form

2009-04-04 Thread Tobias Daub

Hi There,

 From the ToDo tutorial I got this code:

private def desc(td: ToDo, reDraw: () = JsCmd) =
 swappable(span{td.desc}/span,
 span{ajaxText(td.desc,
 v = {td.desc(v).save; reDraw()})}
 /span)


What if I've a numeric field, e.g. td.num and I want to view/edit it?

I got to the point that I modified the code to look like this:

span{ajaxText(td.num.toString,
 v = {td.desc(v).save; reDraw()})}
 /span)


But I still get another compile error, that tells me, that it awaits 
String instead of Int.

What do I've to change here? I tried some things with toString() too, 
but all didn't worked.

v = {td.num(v).save; reDraw()})}


thanks
Tobias

--~--~-~--~~~---~--~~
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: Tutorial No Schemify in Boot.scala

2009-03-17 Thread Tobias Daub

Hi Eric,

By the way, is there any documentation about the different maven2 
lift-archetype-something options?

I wanted to setup a lift project that has the login stuff already 
included, but since I didn't know why, I used the ToDo project and 
modified it.

Are there other solutions?

thanks
Tobias
 Jeff,

 I am assuming that you are referring to Starting with Lift by
 Chen-Becker, Danciu, Pollak, and Weir.

 Chapter 1 introduces a simple application that is created from
 lift-archetype-blank and has no support for databases. In Chapter 2,
 that application is thrown away and a new application is created with
 lift-archetype-basic which does have support for databases.

 I think you are still trying to use a lift-archetype-blank application
 when following along with examples that require a lift-archetype-basic
 application.

 Hope this helps.
 Eric

 On Wed, Mar 4, 2009 at 9:12 PM, jeff.chen.gr...@gmail.com
 jeff.chen.gr...@gmail.com wrote:
   
 Hi All - I am new and pardon me if this is really a naive question. I
 am following GetStartedGuide and working on the todo app. However in
 2.4, I cannot find the Schemifier statement in the Boot.scala file.
 Did I miss anything? I also didn't find the part on how to connect
 Lift with a backend database.

 Thanks,
 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: Change default port 8080

2009-03-16 Thread Tobias Daub

A google search didnt't helpedthanks anyway!


 mvn -Djetty.port= jetty:run

 A google search would tell you this as well.

 On Mar 15, 2:37 pm, Tobias Daub hannes.flo...@gmx.li wrote:
   
 Hi Folks,

 Does anybody know how I can change the default port 8080?

 thanks!
 Tobias
 
 
   


--~--~-~--~~~---~--~~
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] Change default port 8080

2009-03-15 Thread Tobias Daub

Hi Folks,

Does anybody know how I can change the default port 8080?

thanks!
Tobias

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

2009-03-09 Thread Tobias Daub

To get syntax highlighting and all that stuff in Netbeans go to:

http://wiki.netbeans.org/Scala#section-Scala-1.GetStartedWithNetBeans6.5


 Good evening, I´ve been looking at Lift, did a bit of command line but
 I want to use it in Netbeans, unfortunately the only google results
 about Lift, Scala, and Netbeans are gone (404) even the Scala netbeans
 Wiki 404´s. Is there a tut I can look at?

 
   


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