[Lift] Re: Error message undecipherable

2009-04-21 Thread glenn

Charles,

Actually, no, it doesn't help.

The error appears to refer to the third parameter to bind:
button1 - button onclick={SHtml.ajaxCall(Str(Button1),ajaxFunc
_)}Press me/button

I suspect the compiler doesn't like this construct
  {SHtml.ajaxCall(Str (Button1),ajaxFunc _)} for the onclick
handler.

even though the call to SHtml.ajaxCall in the construct is correct -
at least
alone it doesn't generate any compiler errors.

If instead, I use onclick={alert('This is a test')}, everything
works fine.

Glenn...


On Apr 20, 3:40 pm, Charles F. Munat c...@munat.com wrote:
 There are three constructors for UnprefixedAttribute (used to add
 unprefixed attributes to XML elements).

 All three return an instance of scala.xml.MetaData (attributes are a
 subclass of MetaData).

 The first takes:

 a String,
 an Option containing a Seq of scala.xml.Nodes,
 and another piece of MetaData (you can string them together)

 The second constructor takes:

 a String,
 another String,
 and the MetaData

 The final option takes:

 A string,
 a Seq of scala.xml.Nodes,
 and the MetaData.

 What you are providing is:

 a java.lang.String,
 a tuple: (String, net.liftweb.http.js.JsExp),
 and the MetaData

 So you need to look at the ajaxCall method and figure out what you are
 doing wrong.

 Does this help?

 Chas.

 glenn wrote:
  When I try to compile the following code:

  bind(ex, xhtml, button1 - button onclick={SHtml.ajaxCall(Str
  (Button1),ajaxFunc _)}Press me/button
      )

   I get this error message:

  overloaded method constructor UnprefixedAttribute with alternatives
  (String,Option[Seq[scala.xml.Node]],scala.xml.MetaData)
  scala.xml.UnprefixedAttribute and
   (String,String,scala.xml.MetaData)scala.xml.UnprefixedAttribute and
  (String,Seq[scala.xml.Node],scala.xml.MetaData)
  scala.xml.UnprefixedAttribute cannot be applied to (java.lang.String,
  (String,
   net.liftweb.http.js.JsExp),scala.xml.MetaData)

  Can anyone decipher for me?

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

2009-04-21 Thread glenn

I found the problem. AjaxCall method returns a tuple, (String, JsExp).

So, I just needed to change onclick function to
  onclick={SHtml.ajaxCall(Str(Button1),ajaxFunc _)._2}

and all works as it should. I'm learning scala as I go along.




On Apr 20, 3:40 pm, Charles F. Munat c...@munat.com wrote:
 There are three constructors for UnprefixedAttribute (used to add
 unprefixed attributes to XML elements).

 All three return an instance of scala.xml.MetaData (attributes are a
 subclass of MetaData).

 The first takes:

 a String,
 an Option containing a Seq of scala.xml.Nodes,
 and another piece of MetaData (you can string them together)

 The second constructor takes:

 a String,
 another String,
 and the MetaData

 The final option takes:

 A string,
 a Seq of scala.xml.Nodes,
 and the MetaData.

 What you are providing is:

 a java.lang.String,
 a tuple: (String, net.liftweb.http.js.JsExp),
 and the MetaData

 So you need to look at the ajaxCall method and figure out what you are
 doing wrong.

 Does this help?

 Chas.

 glenn wrote:
  When I try to compile the following code:

  bind(ex, xhtml, button1 - button onclick={SHtml.ajaxCall(Str
  (Button1),ajaxFunc _)}Press me/button
      )

   I get this error message:

  overloaded method constructor UnprefixedAttribute with alternatives
  (String,Option[Seq[scala.xml.Node]],scala.xml.MetaData)
  scala.xml.UnprefixedAttribute and
   (String,String,scala.xml.MetaData)scala.xml.UnprefixedAttribute and
  (String,Seq[scala.xml.Node],scala.xml.MetaData)
  scala.xml.UnprefixedAttribute cannot be applied to (java.lang.String,
  (String,
   net.liftweb.http.js.JsExp),scala.xml.MetaData)

  Can anyone decipher for me?

--~--~-~--~~~---~--~~
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: developing Scala/Lift using Eclipse

2009-04-21 Thread g-man

Since Scala is a dialect of Java, and Lift is an extension of that, I
went the Netbeans route because NB is basically part of Java, and I am
happy so far:

- Netbeans is quicker to load than Eclipse, and doesn't create all
those zillions of files behind;
- Netbeams handles all the moving parts well, and Maven is happy;
- Lift and Scala are not that complex that you need any heavy lifting
for debugging (I have found) - it's mostly learning the Lift magic
about how to make the Derby db, Jetty, and Maven all work together.

I agree Eclipse has some nice features, but the light weight of
Netbeans tipped the scales for me...

Programming is fun again, thanks to Lift!


On Apr 20, 2:40 pm, kmed k...@meder.info wrote:
 Hello all,

 I just started learning Scala and came across Lift. I am using Eclipse
 Ganymede with the Scala-Plugin. How do I fully include the Lift-
 sources to navigate (Strg+Click) into the Lift-Classes?
 Currently Eclipse does not even understand the absolute _root_-package-
 thingy. It's pretty annoying if everything is red and only maven knows
 if it compiles correctly :(
 Any Hint?

 Thanks in advance,
 Kai

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



[Lift] Re: How to create dynamic table in response

2009-04-21 Thread pravin karne
i have already done with this,

But this is static page.no of rows in display table is fixed.
 but suppose i have collection of data with variable  size , and i want to
display that data in table (e.g list of employee with details).

So my concern is how i iterate over collection dynamically in lifts.(In JSP
these is support of JSTL(Tag libraries)  [e.g c:test,c:forEach,c:if,]

How can i do this in lift


On Mon, Apr 20, 2009 at 6:44 PM, Dmitry Lipovoi dmitry.lipo...@gmail.comwrote:


 Is it what you looking for?

 http://wiki.liftweb.net/index.php/Lift_View_First

 On Mon, Apr 20, 2009 at 4:37 PM, pravin pravinka...@gmail.com wrote:
 
  Hi,
  I want to create dynamic table into response.
  I have list of objects just i want to place them into table.
 
  Also i have to to place these rows conditionally.So i can use if
  else ,for loop in HTML code
 
 
  We can do this easily in JSP.(I am new to lift framework)
 
   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] id# based pages

2009-04-21 Thread harryh

I want the URLs for user profile pages on my site to be in the
following form:

http://mydomain.com/user/123

Where 123 is the user id. I'm having trouble figuring out how I can
add pages like this where the URL path does not correspond to the path
under webapp/

Help? This can't be very hard I'm sure.

-harryh, just getting started with lift


--~--~-~--~~~---~--~~
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] CRUDify and hidden fields?

2009-04-21 Thread Franz Bettag

Hey there,

is there any way to hide fields (createdOn/createdBy...) from CRUDify?

I was digging through the code since google didn't turn up anything
useful for this topic, but i didn't find anything (may be the lack of
my scala skill).

best regards

-franz

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



[Lift] Re: How to create dynamic table in response

2009-04-21 Thread pravin

i have already done with this,

But this is static page.no of rows in display table is fixed.
 but suppose i have collection of data with variable  size , and i
want to display that data in table (e.g list of employee with
details).

So my concern is how i iterate over collection dynamically in lifts.
(In JSP these is support of JSTL(Tag libraries)  [e.g
c:test,c:forEach,c:if,]

How can i do this in lift

On Apr 20, 6:14 pm, Dmitry Lipovoi dmitry.lipo...@gmail.com wrote:
 Is it what you looking for?

 http://wiki.liftweb.net/index.php/Lift_View_First

 On Mon, Apr 20, 2009 at 4:37 PM, pravin pravinka...@gmail.com wrote:

  Hi,
  I want to create dynamic table into response.
  I have list of objects just i want to place them into table.

  Also i have to to place these rows conditionally.So i can use if
  else ,for loop in HTML code

  We can do this easily in JSP.(I am new to lift framework)

   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: How to create dynamic table in response

2009-04-21 Thread Timothy Perrett

Hi there,

Read my article here: http://is.gd/sfyT

Lift does not use any html based iteration - read the binding article
and it will all make sense (just ask if it doesnt)

Cheers, Tim

On Apr 21, 7:19 am, pravin pravinka...@gmail.com wrote:
 i have already done with this,

 But this is static page.no of rows in display table is fixed.
  but suppose i have collection of data with variable  size , and i
 want to display that data in table (e.g list of employee with
 details).

 So my concern is how i iterate over collection dynamically in lifts.
 (In JSP these is support of JSTL(Tag libraries)  [e.g
 c:test,c:forEach,c:if,]

 How can i do this in lift

 On Apr 20, 6:14 pm, Dmitry Lipovoi dmitry.lipo...@gmail.com wrote:



  Is it what you looking for?

 http://wiki.liftweb.net/index.php/Lift_View_First

  On Mon, Apr 20, 2009 at 4:37 PM, pravin pravinka...@gmail.com wrote:

   Hi,
   I want to create dynamic table into response.
   I have list of objects just i want to place them into table.

   Also i have to to place these rows conditionally.So i can use if
   else ,for loop in HTML code

   We can do this easily in JSP.(I am new to lift framework)

    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: id# based pages

2009-04-21 Thread Timothy Perrett

You want to do something like this:

http://gist.github.com/99026

Tim

On Apr 21, 5:43 am, harryh har...@gmail.com wrote:
 I want the URLs for user profile pages on my site to be in the
 following form:

 http://mydomain.com/user/123

 Where 123 is the user id. I'm having trouble figuring out how I can
 add pages like this where the URL path does not correspond to the path
 under webapp/

 Help? This can't be very hard I'm sure.

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



[Lift] Re: How to create dynamic table in response

2009-04-21 Thread marius d.


Perhaps something like:

// in your markup

lift:TableFeed.build
table
  t:rows/
/table
/lift:TableFeed.build

// your snippet

class TableFeed {

val data = Item1 :: item2 :: Nil
val empty: NodeSeq = NodeSeq.Empty

def buildRows: NodeSeq = (empty /: data)((l, r) = l ++ trtd{r}/
td/tr)

def build(xhtml: NodeSeq) : NodeSeq = {

  bind(t, xhtml,
rows - buildRows
  )

}

}

On Apr 21, 9:19 am, pravin pravinka...@gmail.com wrote:
 i have already done with this,

 But this is static page.no of rows in display table is fixed.
  but suppose i have collection of data with variable  size , and i
 want to display that data in table (e.g list of employee with
 details).

 So my concern is how i iterate over collection dynamically in lifts.
 (In JSP these is support of JSTL(Tag libraries)  [e.g
 c:test,c:forEach,c:if,]

 How can i do this in lift

 On Apr 20, 6:14 pm, Dmitry Lipovoi dmitry.lipo...@gmail.com wrote:

  Is it what you looking for?

 http://wiki.liftweb.net/index.php/Lift_View_First

  On Mon, Apr 20, 2009 at 4:37 PM, pravin pravinka...@gmail.com wrote:

   Hi,
   I want to create dynamic table into response.
   I have list of objects just i want to place them into table.

   Also i have to to place these rows conditionally.So i can use if
   else ,for loop in HTML code

   We can do this easily in JSP.(I am new to lift framework)

    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: Minimal Authorization API for Lift

2009-04-21 Thread Timothy Perrett

Brett,

You are confusing things here - HttpAuthentication is just for Basic
and Digest auth, nothing else. MetaMegaProtoUser is a base class that
saves time when implementing mapper backed user systems. You are free
to use whatever you want of course...

SiteMap controls URL access and is wired up through application boot.
Can I suggest that you read the lift book, it will answer the vast
majority of your questions.

Cheers, Tim

On Apr 21, 12:19 am, BrettK br...@knightsofthenet.com wrote:
 Hello,

 I'm trying to integrate lift with CAS.
 It looks like I'll need to extend HttpAuthentication and
 UnauthorizedResponse. I looked at the OpenId sources though and they
 don't seem to extend or make reference to either of these traits.

 It appears I'll also need to implement MetaMegaProtoUser as well.
 MetaMegaProtoUser appears to contain code for defining all its own
 menus (including password change urls)  How is its sitemap method
 invoked? Why should the user class contain those functions? Why not at
 least a related template or snippet? I don't know enough to criticize
 but I'm certainly puzzled that these concerns weren't separated.
--~--~-~--~~~---~--~~
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 message undecipherable

2009-04-21 Thread marius d.

The reason for the tuple is Lift's garbage collection mechanism.
However due to some jQuery issues regarding namespaces, this mechanism
is not yet used instead a more generalized GC mechanism is today in
place.

Note that you also have SHtml.makeAjaxCall function that just returns
the JsExp.

Br's,
Marius

On Apr 21, 7:23 am, glenn gl...@exmbly.com wrote:
 I found the problem. AjaxCall method returns a tuple, (String, JsExp).

 So, I just needed to change onclick function to
   onclick={SHtml.ajaxCall(Str(Button1),ajaxFunc _)._2}

 and all works as it should. I'm learning scala as I go along.

 On Apr 20, 3:40 pm, Charles F. Munat c...@munat.com wrote:

  There are three constructors for UnprefixedAttribute (used to add
  unprefixed attributes to XML elements).

  All three return an instance of scala.xml.MetaData (attributes are a
  subclass of MetaData).

  The first takes:

  a String,
  an Option containing a Seq of scala.xml.Nodes,
  and another piece of MetaData (you can string them together)

  The second constructor takes:

  a String,
  another String,
  and the MetaData

  The final option takes:

  A string,
  a Seq of scala.xml.Nodes,
  and the MetaData.

  What you are providing is:

  a java.lang.String,
  a tuple: (String, net.liftweb.http.js.JsExp),
  and the MetaData

  So you need to look at the ajaxCall method and figure out what you are
  doing wrong.

  Does this help?

  Chas.

  glenn wrote:
   When I try to compile the following code:

   bind(ex, xhtml, button1 - button onclick={SHtml.ajaxCall(Str
   (Button1),ajaxFunc _)}Press me/button
       )

    I get this error message:

   overloaded method constructor UnprefixedAttribute with alternatives
   (String,Option[Seq[scala.xml.Node]],scala.xml.MetaData)
   scala.xml.UnprefixedAttribute and
    (String,String,scala.xml.MetaData)scala.xml.UnprefixedAttribute and
   (String,Seq[scala.xml.Node],scala.xml.MetaData)
   scala.xml.UnprefixedAttribute cannot be applied to (java.lang.String,
   (String,
    net.liftweb.http.js.JsExp),scala.xml.MetaData)

   Can anyone decipher for me?
--~--~-~--~~~---~--~~
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 message undecipherable

2009-04-21 Thread Charles F. Munat

Sorry, I should have been more explicit.

The UnprefixedAttribute is your onclick attribute. The first parameter 
(a string) is onclick. The third parambers (MetaData) is null. What 
you are passing is the second parameter, which can be a) an Option 
containing a Seq of scala.xml.Nodes, b) another String, or c) a Seq of 
scala.xml.Nodes.

The ajaxCall method you are providing as the middle parameter to 
UnprefixedAttribute returns (String, JsExp). This is a tuple, not an 
Option, a String, or a Seq of Nodes. Therefore, you are setting this up 
incorrectly.

So you need to look at ajaxCall and see how it is properly used.

Chas.

glenn wrote:
 Charles,
 
 Actually, no, it doesn't help.
 
 The error appears to refer to the third parameter to bind:
 button1 - button onclick={SHtml.ajaxCall(Str(Button1),ajaxFunc
 _)}Press me/button
 
 I suspect the compiler doesn't like this construct
   {SHtml.ajaxCall(Str (Button1),ajaxFunc _)} for the onclick
 handler.
 
 even though the call to SHtml.ajaxCall in the construct is correct -
 at least
 alone it doesn't generate any compiler errors.
 
 If instead, I use onclick={alert('This is a test')}, everything
 works fine.
 
 Glenn...
 
 
 On Apr 20, 3:40 pm, Charles F. Munat c...@munat.com wrote:
 There are three constructors for UnprefixedAttribute (used to add
 unprefixed attributes to XML elements).

 All three return an instance of scala.xml.MetaData (attributes are a
 subclass of MetaData).

 The first takes:

 a String,
 an Option containing a Seq of scala.xml.Nodes,
 and another piece of MetaData (you can string them together)

 The second constructor takes:

 a String,
 another String,
 and the MetaData

 The final option takes:

 A string,
 a Seq of scala.xml.Nodes,
 and the MetaData.

 What you are providing is:

 a java.lang.String,
 a tuple: (String, net.liftweb.http.js.JsExp),
 and the MetaData

 So you need to look at the ajaxCall method and figure out what you are
 doing wrong.

 Does this help?

 Chas.

 glenn wrote:
 When I try to compile the following code:
 bind(ex, xhtml, button1 - button onclick={SHtml.ajaxCall(Str
 (Button1),ajaxFunc _)}Press me/button
 )
  I get this error message:
 overloaded method constructor UnprefixedAttribute with alternatives
 (String,Option[Seq[scala.xml.Node]],scala.xml.MetaData)
 scala.xml.UnprefixedAttribute and
  (String,String,scala.xml.MetaData)scala.xml.UnprefixedAttribute and
 (String,Seq[scala.xml.Node],scala.xml.MetaData)
 scala.xml.UnprefixedAttribute cannot be applied to (java.lang.String,
 (String,
  net.liftweb.http.js.JsExp),scala.xml.MetaData)
 Can anyone decipher for me?
 
  

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

2009-04-21 Thread Charles F. Munat

Whoops. Should've checked this before I responded to the previous email. 
Glad you figured it out.

Chas.

glenn wrote:
 I found the problem. AjaxCall method returns a tuple, (String, JsExp).
 
 So, I just needed to change onclick function to
   onclick={SHtml.ajaxCall(Str(Button1),ajaxFunc _)._2}
 
 and all works as it should. I'm learning scala as I go along.
 
 
 
 
 On Apr 20, 3:40 pm, Charles F. Munat c...@munat.com wrote:
 There are three constructors for UnprefixedAttribute (used to add
 unprefixed attributes to XML elements).

 All three return an instance of scala.xml.MetaData (attributes are a
 subclass of MetaData).

 The first takes:

 a String,
 an Option containing a Seq of scala.xml.Nodes,
 and another piece of MetaData (you can string them together)

 The second constructor takes:

 a String,
 another String,
 and the MetaData

 The final option takes:

 A string,
 a Seq of scala.xml.Nodes,
 and the MetaData.

 What you are providing is:

 a java.lang.String,
 a tuple: (String, net.liftweb.http.js.JsExp),
 and the MetaData

 So you need to look at the ajaxCall method and figure out what you are
 doing wrong.

 Does this help?

 Chas.

 glenn wrote:
 When I try to compile the following code:
 bind(ex, xhtml, button1 - button onclick={SHtml.ajaxCall(Str
 (Button1),ajaxFunc _)}Press me/button
 )
  I get this error message:
 overloaded method constructor UnprefixedAttribute with alternatives
 (String,Option[Seq[scala.xml.Node]],scala.xml.MetaData)
 scala.xml.UnprefixedAttribute and
  (String,String,scala.xml.MetaData)scala.xml.UnprefixedAttribute and
 (String,Seq[scala.xml.Node],scala.xml.MetaData)
 scala.xml.UnprefixedAttribute cannot be applied to (java.lang.String,
 (String,
  net.liftweb.http.js.JsExp),scala.xml.MetaData)
 Can anyone decipher for me?
 
  

--~--~-~--~~~---~--~~
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: id# based pages

2009-04-21 Thread Charles F. Munat

Put this in your Boot.scala file inside the def Boot method:

val idRewriter: LiftRules.RewritePF = {
   case RewriteRequest(path @ ParsePath(user :: id :: _, _, _,_),
 _, _) = RewriteResponse(
   ParsePath(user :: index :: Nil, , true, false),
   Map(id - id :: path.wholePath.drop(2)
 .zipWithIndex.map(p = (param+(p._2 + 1)) - p._1) :_*)
   )
}

LiftRules.rewrite.prepend(idRewriter)

You can call it anything. Here it is called idRewriter.

The val idRewriter is set to a LiftRules Rewrite partial function. The 
case keyword matches the Req against the provided RewriteRequest. The 
first parameter is a ParsePath. path @ means you are matching against 
a piece of this ParsePath.

Here we match against /user/ with the first item in the list, user. 
Whatever comes after that is placed in the id variable. We don't care 
what comes after that, so the last item in the list is _.

The last three parts of the ParsePath are unimportant, thus the _, _, _. 
But if we wanted to, the first of those represents a suffix, so we could do:

path @ ParsePath(user :: id :: _, html, _, _)

if we wanted to match only against files with the extension html. The 
next parameter is a Boolean indicating whether the path is an absolute 
path. The final parameter is a Boolean indicating whether an end slash 
is required.

So if I've understood it correctly, then:

path @ ParsePath(user :: id :: _, html, false, false)

should only match against a file at user/id that ends in .html. Note 
that there is no leading slash (the path is relative) and there is no 
ending slash.

The remaining parameters in the RewriteRequest are the RequestType (e.g. 
GetRequest) and the HttpServletRequest itself. For example:

RewriteRequest(path @ ParsePath(user :: id :: _, _, _, _),
   PostRequest, _)

limits the matches to post requests.

When a matching request comes in, this partial function then writes a 
RewriteResponse which sends the request to the List(user, index, 
Nil) path (/user/index.html), and passes the id in as a parameter named 
id -- so you can access it via S.param(id).openOr() (that's what 
the Map part does). The wholePath.drop(2) part drops the user/index 
part. If you were matching against three directories (e.g. 
/admin/user/123), you'd drop(3).

Does this help?

Chas.

harryh wrote:
 I want the URLs for user profile pages on my site to be in the
 following form:
 
 http://mydomain.com/user/123
 
 Where 123 is the user id. I'm having trouble figuring out how I can
 add pages like this where the URL path does not correspond to the path
 under webapp/
 
 Help? This can't be very hard I'm sure.
 
 -harryh, just getting started with lift
 
 
  

--~--~-~--~~~---~--~~
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: id# based pages

2009-04-21 Thread Timothy Perrett

Personal preference, but I dont like that zip map style... id always
use specific paramaters as per my exampe - they you know exactly what
your going to get when you call S.param(thing) in your snippet code.

Tim

On Apr 21, 12:22 pm, Charles F. Munat c...@munat.com wrote:
 Put this in your Boot.scala file inside the def Boot method:

 val idRewriter: LiftRules.RewritePF = {
    case RewriteRequest(path @ ParsePath(user :: id :: _, _, _,_),
      _, _) = RewriteResponse(
            ParsePath(user :: index :: Nil, , true, false),
            Map(id - id :: path.wholePath.drop(2)
              .zipWithIndex.map(p = (param+(p._2 + 1)) - p._1) :_*)
    )

 }

 LiftRules.rewrite.prepend(idRewriter)

 You can call it anything. Here it is called idRewriter.

 The val idRewriter is set to a LiftRules Rewrite partial function. The
 case keyword matches the Req against the provided RewriteRequest. The
 first parameter is a ParsePath. path @ means you are matching against
 a piece of this ParsePath.

 Here we match against /user/ with the first item in the list, user.
 Whatever comes after that is placed in the id variable. We don't care
 what comes after that, so the last item in the list is _.

 The last three parts of the ParsePath are unimportant, thus the _, _, _.
 But if we wanted to, the first of those represents a suffix, so we could do:

 path @ ParsePath(user :: id :: _, html, _, _)

 if we wanted to match only against files with the extension html. The
 next parameter is a Boolean indicating whether the path is an absolute
 path. The final parameter is a Boolean indicating whether an end slash
 is required.

 So if I've understood it correctly, then:

 path @ ParsePath(user :: id :: _, html, false, false)

 should only match against a file at user/id that ends in .html. Note
 that there is no leading slash (the path is relative) and there is no
 ending slash.

 The remaining parameters in the RewriteRequest are the RequestType (e.g.
 GetRequest) and the HttpServletRequest itself. For example:

 RewriteRequest(path @ ParsePath(user :: id :: _, _, _, _),
    PostRequest, _)

 limits the matches to post requests.

 When a matching request comes in, this partial function then writes a
 RewriteResponse which sends the request to the List(user, index,
 Nil) path (/user/index.html), and passes the id in as a parameter named
 id -- so you can access it via S.param(id).openOr() (that's what
 the Map part does). The wholePath.drop(2) part drops the user/index
 part. If you were matching against three directories (e.g.
 /admin/user/123), you'd drop(3).

 Does this help?

 Chas.



 harryh wrote:
  I want the URLs for user profile pages on my site to be in the
  following form:

 http://mydomain.com/user/123

  Where 123 is the user id. I'm having trouble figuring out how I can
  add pages like this where the URL path does not correspond to the path
  under webapp/

  Help? This can't be very hard I'm sure.

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



[Lift] Re: How to create dynamic table in response

2009-04-21 Thread pravin

but there is case ,
suppose, whether a particular row is  present depends on some
condition, leading to code like this :

%for(int a=0;acollection.size();a++){ //start loop
%

% if(condition)%// check
of condition
  trtd.../td/tr
% else{ %
   trtd.../td/tr
 %}   // if else block
closed
} // loop closed
%

we can do this in JSP ,what will be the corresponding code in lift

Sorry for such basic question but i am from JSP background and new to
lift

Thanks in advance





On Apr 21, 1:25 pm, marius d. marius.dan...@gmail.com wrote:
 Perhaps something like:

 // in your markup

 lift:TableFeed.build
 table
   t:rows/
 /table
 /lift:TableFeed.build

 // your snippet

 class TableFeed {

 val data = Item1 :: item2 :: Nil
 val empty: NodeSeq = NodeSeq.Empty

 def buildRows: NodeSeq = (empty /: data)((l, r) = l ++ trtd{r}/
 td/tr)

 def build(xhtml: NodeSeq) : NodeSeq = {

   bind(t, xhtml,
     rows - buildRows
   )

 }
 }

 On Apr 21, 9:19 am, pravin pravinka...@gmail.com wrote:

  i have already done with this,

  But this is static page.no of rows in display table is fixed.
   but suppose i have collection of data with variable  size , and i
  want to display that data in table (e.g list of employee with
  details).

  So my concern is how i iterate over collection dynamically in lifts.
  (In JSP these is support of JSTL(Tag libraries)  [e.g
  c:test,c:forEach,c:if,]

  How can i do this in lift

  On Apr 20, 6:14 pm, Dmitry Lipovoi dmitry.lipo...@gmail.com wrote:

   Is it what you looking for?

  http://wiki.liftweb.net/index.php/Lift_View_First

   On Mon, Apr 20, 2009 at 4:37 PM, pravin pravinka...@gmail.com wrote:

Hi,
I want to create dynamic table into response.
I have list of objects just i want to place them into table.

Also i have to to place these rows conditionally.So i can use if
else ,for loop in HTML code

We can do this easily in JSP.(I am new to lift framework)

 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: How to create dynamic table in response

2009-04-21 Thread marius d.

def buildRows: NodeSeq = (empty /: data)((l, r) = l ++ trtd{r}/
td/tr)

is just an example that shows that you have full programmatic control
for generating rows.

such as:

def buildRows: NodeSeq = (empty /: data)((l, r) = l ++ (if
(condition) trtd{r}/td/tr else ))

There are many ways to do it ... this is just an example. You can also
use chooseTemplate ... which you can find examples in the sites/
example application (see CountGame)

Br's,
Marius

On Apr 21, 1:57 pm, pravin pravinka...@gmail.com wrote:
 but there is case ,
 suppose, whether a particular row is  present depends on some
 condition, leading to code like this :

 %for(int a=0;acollection.size();a++){                 //start loop
 %

 % if(condition)%                                            // check
 of condition
       trtd.../td/tr
 % else{ %
        trtd.../td/tr
  %}                                               // if else block
 closed}                                                     // loop closed

 %

 we can do this in JSP ,what will be the corresponding code in lift

 Sorry for such basic question but i am from JSP background and new to
 lift

 Thanks in advance

 On Apr 21, 1:25 pm, marius d. marius.dan...@gmail.com wrote:

  Perhaps something like:

  // in your markup

  lift:TableFeed.build
  table
    t:rows/
  /table
  /lift:TableFeed.build

  // your snippet

  class TableFeed {

  val data = Item1 :: item2 :: Nil
  val empty: NodeSeq = NodeSeq.Empty

  def buildRows: NodeSeq = (empty /: data)((l, r) = l ++ trtd{r}/
  td/tr)

  def build(xhtml: NodeSeq) : NodeSeq = {

    bind(t, xhtml,
      rows - buildRows
    )

  }
  }

  On Apr 21, 9:19 am, pravin pravinka...@gmail.com wrote:

   i have already done with this,

   But this is static page.no of rows in display table is fixed.
    but suppose i have collection of data with variable  size , and i
   want to display that data in table (e.g list of employee with
   details).

   So my concern is how i iterate over collection dynamically in lifts.
   (In JSP these is support of JSTL(Tag libraries)  [e.g
   c:test,c:forEach,c:if,]

   How can i do this in lift

   On Apr 20, 6:14 pm, Dmitry Lipovoi dmitry.lipo...@gmail.com wrote:

Is it what you looking for?

   http://wiki.liftweb.net/index.php/Lift_View_First

On Mon, Apr 20, 2009 at 4:37 PM, pravin pravinka...@gmail.com wrote:

 Hi,
 I want to create dynamic table into response.
 I have list of objects just i want to place them into table.

 Also i have to to place these rows conditionally.So i can use if
 else ,for loop in HTML code

 We can do this easily in JSP.(I am new to lift framework)

  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: Can't get applications to run in Jetty

2009-04-21 Thread Julian Howarth


On Apr 21, 12:56 pm, Timothy Perrett timo...@getintheloop.eu wrote:
 Can you try with maven 2.0.9...

I've now switched to maven 2.0.9 but the error is exactly the same as
before. I removed the directories and reran the mvn archetype:generate
command. This was successful again. It was the jetty command that
failed again.

 Also, I think your java version would be 6
 for the JRE, but 1.5.0 for the JDK that ships with OSX?

I'm fairly confident that the Java JDK is set to 1.6 as I've been
using it for 6 months. Both java -version and javac -version give
1.6.0_07 as the version number. My JAVA_HOME is also set there.


 Cheers, Tim

 On 21/04/2009 11:29, Julian Howarth howar...@freenet.co.uk wrote:



  I'm getting started with Lift and am trying to run the examples from
  the Exploring Lift book but get errors when I try to run the
  application on Jetty. I have also tried following the examples from
  Getting Started Guide and the wiki, but always end up with similar
  errors.

  So I run:

  mvn archetype:generate -U  -DarchetypeGroupId=net.liftweb  -
  DarchetypeArtifactId=lift-archetype-blank  -DarchetypeVersion=1.0  -
  DremoteRepositories=http://scala-tools.org/repo-releases -
  DgroupId=demo.helloworld  -DartifactId=helloworld  -Dversion=1.0

  confirm the defaults and get a build success message at the end. I
  then run:

  cd helloworld
  mvn jetty:run

  and get the following:

  [INFO] Scanning for projects...
  [INFO]
  
  [INFO] Building helloworld
  [INFO]    task-segment: [jetty:run]
  [INFO]
  
  [INFO] Preparing jetty:run
  [INFO] [resources:resources]
  [WARNING] Using platform encoding (MacRoman 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 2 source files to /Users/julian/NetBeansProjects/
  lifttest/helloworld/target/classes
  [WARNING] Exception in thread main java.lang.ClassFormatError:
  Unknown constant tag 84 in class file scala/tools/nsc/transform/
  TypingTransformers$TypingTransformer
  [WARNING]  at java.lang.ClassLoader.defineClass1(Native Method)
  [WARNING]  at java.lang.ClassLoader.defineClass(ClassLoader.java:675)
  [WARNING]  at java.security.SecureClassLoader.defineClass
  (SecureClassLoader.java:124)
  [WARNING]  at java.net.URLClassLoader.defineClass(URLClassLoader.java:
  260)
  [WARNING]  at java.net.URLClassLoader.access$000(URLClassLoader.java:
  56)
  [WARNING]  at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
  [WARNING]  at java.security.AccessController.doPrivileged(Native
  Method)
  [WARNING]  at java.net.URLClassLoader.findClass(URLClassLoader.java:
  188)
  [WARNING]  at java.lang.ClassLoader.loadClass(ClassLoader.java:316)
  [WARNING]  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:
  288)
  [WARNING]  at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
  [WARNING]  at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:
  374)
  [WARNING]  at java.lang.ClassLoader.defineClass1(Native Method)
  [WARNING]  at java.lang.ClassLoader.defineClass(ClassLoader.java:675)
  [WARNING]  at java.security.SecureClassLoader.defineClass
  (SecureClassLoader.java:124)
  [WARNING]  at java.net.URLClassLoader.defineClass(URLClassLoader.java:
  260)
  [WARNING]  at java.net.URLClassLoader.access$000(URLClassLoader.java:
  56)
  [WARNING]  at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
  [WARNING]  at java.security.AccessController.doPrivileged(Native
  Method)
  [WARNING]  at java.net.URLClassLoader.findClass(URLClassLoader.java:
  188)
  [WARNING]  at java.lang.ClassLoader.loadClass(ClassLoader.java:316)
  [WARNING]  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:
  288)
  [WARNING]  at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
  [WARNING]  at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:
  374)
  [WARNING]  at scala.tools.nsc.Global.superAccessors(Global.scala:287)
  [WARNING]  at scala.tools.nsc.Global.builtInPhaseDescriptors
  (Global.scala:403)
  [WARNING]  at scala.tools.nsc.plugins.Plugins
  $class.computePhaseDescriptors(Plugins.scala:154)
  [WARNING]  at scala.tools.nsc.Global.computePhaseDescriptors
  (Global.scala:34)
  [WARNING]  at scala.tools.nsc.Global.phaseDescriptors(Global.scala:
  442)
  [WARNING]  at scala.tools.nsc.Global$Run.init(Global.scala:490)
  [WARNING]  at scala.tools.nsc.Main$.process(Main.scala:72)
  [WARNING]  at scala.tools.nsc.Main$.main(Main.scala:87)
  [WARNING]  at scala.tools.nsc.Main.main(Main.scala)
  [INFO]
  

[Lift] Re: Can't get applications to run in Jetty

2009-04-21 Thread David Bernard
hi,

Can you run (and report the output) :
mvn compile -Dmaven.scala.displayCmd=true

/davidB

On Tue, Apr 21, 2009 at 14:22, Julian Howarth howar...@freenet.co.ukwrote:



 On Apr 21, 12:56 pm, Timothy Perrett timo...@getintheloop.eu wrote:
  Can you try with maven 2.0.9...

 I've now switched to maven 2.0.9 but the error is exactly the same as
 before. I removed the directories and reran the mvn archetype:generate
 command. This was successful again. It was the jetty command that
 failed again.

  Also, I think your java version would be 6
  for the JRE, but 1.5.0 for the JDK that ships with OSX?

 I'm fairly confident that the Java JDK is set to 1.6 as I've been
 using it for 6 months. Both java -version and javac -version give
 1.6.0_07 as the version number. My JAVA_HOME is also set there.

 
  Cheers, Tim
 
  On 21/04/2009 11:29, Julian Howarth howar...@freenet.co.uk wrote:
 
 
 
   I'm getting started with Lift and am trying to run the examples from
   the Exploring Lift book but get errors when I try to run the
   application on Jetty. I have also tried following the examples from
   Getting Started Guide and the wiki, but always end up with similar
   errors.
 
   So I run:
 
   mvn archetype:generate -U  -DarchetypeGroupId=net.liftweb  -
   DarchetypeArtifactId=lift-archetype-blank  -DarchetypeVersion=1.0  -
   DremoteRepositories=http://scala-tools.org/repo-releases -
   DgroupId=demo.helloworld  -DartifactId=helloworld  -Dversion=1.0
 
   confirm the defaults and get a build success message at the end. I
   then run:
 
   cd helloworld
   mvn jetty:run
 
   and get the following:
 
   [INFO] Scanning for projects...
   [INFO]
  
 
   [INFO] Building helloworld
   [INFO]task-segment: [jetty:run]
   [INFO]
  
 
   [INFO] Preparing jetty:run
   [INFO] [resources:resources]
   [WARNING] Using platform encoding (MacRoman 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 2 source files to /Users/julian/NetBeansProjects/
   lifttest/helloworld/target/classes
   [WARNING] Exception in thread main java.lang.ClassFormatError:
   Unknown constant tag 84 in class file scala/tools/nsc/transform/
   TypingTransformers$TypingTransformer
   [WARNING]  at java.lang.ClassLoader.defineClass1(Native Method)
   [WARNING]  at java.lang.ClassLoader.defineClass(ClassLoader.java:675)
   [WARNING]  at java.security.SecureClassLoader.defineClass
   (SecureClassLoader.java:124)
   [WARNING]  at java.net.URLClassLoader.defineClass(URLClassLoader.java:
   260)
   [WARNING]  at java.net.URLClassLoader.access$000(URLClassLoader.java:
   56)
   [WARNING]  at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
   [WARNING]  at java.security.AccessController.doPrivileged(Native
   Method)
   [WARNING]  at java.net.URLClassLoader.findClass(URLClassLoader.java:
   188)
   [WARNING]  at java.lang.ClassLoader.loadClass(ClassLoader.java:316)
   [WARNING]  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:
   288)
   [WARNING]  at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
   [WARNING]  at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:
   374)
   [WARNING]  at java.lang.ClassLoader.defineClass1(Native Method)
   [WARNING]  at java.lang.ClassLoader.defineClass(ClassLoader.java:675)
   [WARNING]  at java.security.SecureClassLoader.defineClass
   (SecureClassLoader.java:124)
   [WARNING]  at java.net.URLClassLoader.defineClass(URLClassLoader.java:
   260)
   [WARNING]  at java.net.URLClassLoader.access$000(URLClassLoader.java:
   56)
   [WARNING]  at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
   [WARNING]  at java.security.AccessController.doPrivileged(Native
   Method)
   [WARNING]  at java.net.URLClassLoader.findClass(URLClassLoader.java:
   188)
   [WARNING]  at java.lang.ClassLoader.loadClass(ClassLoader.java:316)
   [WARNING]  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:
   288)
   [WARNING]  at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
   [WARNING]  at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:
   374)
   [WARNING]  at scala.tools.nsc.Global.superAccessors(Global.scala:287)
   [WARNING]  at scala.tools.nsc.Global.builtInPhaseDescriptors
   (Global.scala:403)
   [WARNING]  at scala.tools.nsc.plugins.Plugins
   $class.computePhaseDescriptors(Plugins.scala:154)
   [WARNING]  at scala.tools.nsc.Global.computePhaseDescriptors
   (Global.scala:34)
   [WARNING]  at scala.tools.nsc.Global.phaseDescriptors(Global.scala:
   442)
   [WARNING]  at 

[Lift] Re: How to create dynamic table in response

2009-04-21 Thread pravin karne
I got that example also solution for my problem
Thanks Marius for u r valuable pointer

one more question ,how can i run these sites/
example applications.

I have created the jar file from given pom.xml.
but i am not able to run that jar file. could u please tell that?

Thanks


On Tue, Apr 21, 2009 at 5:49 PM, marius d. marius.dan...@gmail.com wrote:


 def buildRows: NodeSeq = (empty /: data)((l, r) = l ++ trtd{r}/
 td/tr)

 is just an example that shows that you have full programmatic control
 for generating rows.

 such as:

 def buildRows: NodeSeq = (empty /: data)((l, r) = l ++ (if
 (condition) trtd{r}/td/tr else ))

 There are many ways to do it ... this is just an example. You can also
 use chooseTemplate ... which you can find examples in the sites/
 example application (see CountGame)

 Br's,
 Marius

 On Apr 21, 1:57 pm, pravin pravinka...@gmail.com wrote:
  but there is case ,
  suppose, whether a particular row is  present depends on some
  condition, leading to code like this :
 
  %for(int a=0;acollection.size();a++){ //start loop
  %
 
  % if(condition)%// check
  of condition
trtd.../td/tr
  % else{ %
 trtd.../td/tr
   %}   // if else block
  closed} // loop
 closed
 
  %
 
  we can do this in JSP ,what will be the corresponding code in lift
 
  Sorry for such basic question but i am from JSP background and new to
  lift
 
  Thanks in advance
 
  On Apr 21, 1:25 pm, marius d. marius.dan...@gmail.com wrote:
 
   Perhaps something like:
 
   // in your markup
 
   lift:TableFeed.build
   table
 t:rows/
   /table
   /lift:TableFeed.build
 
   // your snippet
 
   class TableFeed {
 
   val data = Item1 :: item2 :: Nil
   val empty: NodeSeq = NodeSeq.Empty
 
   def buildRows: NodeSeq = (empty /: data)((l, r) = l ++ trtd{r}/
   td/tr)
 
   def build(xhtml: NodeSeq) : NodeSeq = {
 
 bind(t, xhtml,
   rows - buildRows
 )
 
   }
   }
 
   On Apr 21, 9:19 am, pravin pravinka...@gmail.com wrote:
 
i have already done with this,
 
But this is static page.no of rows in display table is fixed.
 but suppose i have collection of data with variable  size , and i
want to display that data in table (e.g list of employee with
details).
 
So my concern is how i iterate over collection dynamically in lifts.
(In JSP these is support of JSTL(Tag libraries)  [e.g
c:test,c:forEach,c:if,]
 
How can i do this in lift
 
On Apr 20, 6:14 pm, Dmitry Lipovoi dmitry.lipo...@gmail.com wrote:
 
 Is it what you looking for?
 
http://wiki.liftweb.net/index.php/Lift_View_First
 
 On Mon, Apr 20, 2009 at 4:37 PM, pravin pravinka...@gmail.com
 wrote:
 
  Hi,
  I want to create dynamic table into response.
  I have list of objects just i want to place them into table.
 
  Also i have to to place these rows conditionally.So i can use if
  else ,for loop in HTML code
 
  We can do this easily in JSP.(I am new to lift framework)
 
   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: Can't get applications to run in Jetty

2009-04-21 Thread Timothy Perrett


Can you try with maven 2.0.9... Also, I think your java version would be 6
for the JRE, but 1.5.0 for the JDK that ships with OSX?

Cheers, Tim

On 21/04/2009 11:29, Julian Howarth howar...@freenet.co.uk wrote:

 
 I'm getting started with Lift and am trying to run the examples from
 the Exploring Lift book but get errors when I try to run the
 application on Jetty. I have also tried following the examples from
 Getting Started Guide and the wiki, but always end up with similar
 errors.
 
 So I run:
 
 mvn archetype:generate -U  -DarchetypeGroupId=net.liftweb  -
 DarchetypeArtifactId=lift-archetype-blank  -DarchetypeVersion=1.0  -
 DremoteRepositories=http://scala-tools.org/repo-releases  -
 DgroupId=demo.helloworld  -DartifactId=helloworld  -Dversion=1.0
 
 confirm the defaults and get a build success message at the end. I
 then run:
 
 cd helloworld
 mvn jetty:run
 
 and get the following:
 
 [INFO] Scanning for projects...
 [INFO]
 
 [INFO] Building helloworld
 [INFO]task-segment: [jetty:run]
 [INFO]
 
 [INFO] Preparing jetty:run
 [INFO] [resources:resources]
 [WARNING] Using platform encoding (MacRoman 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 2 source files to /Users/julian/NetBeansProjects/
 lifttest/helloworld/target/classes
 [WARNING] Exception in thread main java.lang.ClassFormatError:
 Unknown constant tag 84 in class file scala/tools/nsc/transform/
 TypingTransformers$TypingTransformer
 [WARNING]  at java.lang.ClassLoader.defineClass1(Native Method)
 [WARNING]  at java.lang.ClassLoader.defineClass(ClassLoader.java:675)
 [WARNING]  at java.security.SecureClassLoader.defineClass
 (SecureClassLoader.java:124)
 [WARNING]  at java.net.URLClassLoader.defineClass(URLClassLoader.java:
 260)
 [WARNING]  at java.net.URLClassLoader.access$000(URLClassLoader.java:
 56)
 [WARNING]  at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
 [WARNING]  at java.security.AccessController.doPrivileged(Native
 Method)
 [WARNING]  at java.net.URLClassLoader.findClass(URLClassLoader.java:
 188)
 [WARNING]  at java.lang.ClassLoader.loadClass(ClassLoader.java:316)
 [WARNING]  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:
 288)
 [WARNING]  at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
 [WARNING]  at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:
 374)
 [WARNING]  at java.lang.ClassLoader.defineClass1(Native Method)
 [WARNING]  at java.lang.ClassLoader.defineClass(ClassLoader.java:675)
 [WARNING]  at java.security.SecureClassLoader.defineClass
 (SecureClassLoader.java:124)
 [WARNING]  at java.net.URLClassLoader.defineClass(URLClassLoader.java:
 260)
 [WARNING]  at java.net.URLClassLoader.access$000(URLClassLoader.java:
 56)
 [WARNING]  at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
 [WARNING]  at java.security.AccessController.doPrivileged(Native
 Method)
 [WARNING]  at java.net.URLClassLoader.findClass(URLClassLoader.java:
 188)
 [WARNING]  at java.lang.ClassLoader.loadClass(ClassLoader.java:316)
 [WARNING]  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:
 288)
 [WARNING]  at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
 [WARNING]  at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:
 374)
 [WARNING]  at scala.tools.nsc.Global.superAccessors(Global.scala:287)
 [WARNING]  at scala.tools.nsc.Global.builtInPhaseDescriptors
 (Global.scala:403)
 [WARNING]  at scala.tools.nsc.plugins.Plugins
 $class.computePhaseDescriptors(Plugins.scala:154)
 [WARNING]  at scala.tools.nsc.Global.computePhaseDescriptors
 (Global.scala:34)
 [WARNING]  at scala.tools.nsc.Global.phaseDescriptors(Global.scala:
 442)
 [WARNING]  at scala.tools.nsc.Global$Run.init(Global.scala:490)
 [WARNING]  at scala.tools.nsc.Main$.process(Main.scala:72)
 [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: 5 seconds
 [INFO] Finished at: Tue Apr 21 11:00:36 BST 2009
 [INFO] Final Memory: 27M/64M
 [INFO]
 
 
 

[Lift] Can't get applications to run in Jetty

2009-04-21 Thread Julian Howarth

I'm getting started with Lift and am trying to run the examples from
the Exploring Lift book but get errors when I try to run the
application on Jetty. I have also tried following the examples from
Getting Started Guide and the wiki, but always end up with similar
errors.

So I run:

mvn archetype:generate -U  -DarchetypeGroupId=net.liftweb  -
DarchetypeArtifactId=lift-archetype-blank  -DarchetypeVersion=1.0  -
DremoteRepositories=http://scala-tools.org/repo-releases  -
DgroupId=demo.helloworld  -DartifactId=helloworld  -Dversion=1.0

confirm the defaults and get a build success message at the end. I
then run:

cd helloworld
mvn jetty:run

and get the following:

[INFO] Scanning for projects...
[INFO]

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

[INFO] Preparing jetty:run
[INFO] [resources:resources]
[WARNING] Using platform encoding (MacRoman 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 2 source files to /Users/julian/NetBeansProjects/
lifttest/helloworld/target/classes
[WARNING] Exception in thread main java.lang.ClassFormatError:
Unknown constant tag 84 in class file scala/tools/nsc/transform/
TypingTransformers$TypingTransformer
[WARNING]   at java.lang.ClassLoader.defineClass1(Native Method)
[WARNING]   at java.lang.ClassLoader.defineClass(ClassLoader.java:675)
[WARNING]   at java.security.SecureClassLoader.defineClass
(SecureClassLoader.java:124)
[WARNING]   at java.net.URLClassLoader.defineClass(URLClassLoader.java:
260)
[WARNING]   at java.net.URLClassLoader.access$000(URLClassLoader.java:
56)
[WARNING]   at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
[WARNING]   at java.security.AccessController.doPrivileged(Native
Method)
[WARNING]   at java.net.URLClassLoader.findClass(URLClassLoader.java:
188)
[WARNING]   at java.lang.ClassLoader.loadClass(ClassLoader.java:316)
[WARNING]   at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:
288)
[WARNING]   at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
[WARNING]   at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:
374)
[WARNING]   at java.lang.ClassLoader.defineClass1(Native Method)
[WARNING]   at java.lang.ClassLoader.defineClass(ClassLoader.java:675)
[WARNING]   at java.security.SecureClassLoader.defineClass
(SecureClassLoader.java:124)
[WARNING]   at java.net.URLClassLoader.defineClass(URLClassLoader.java:
260)
[WARNING]   at java.net.URLClassLoader.access$000(URLClassLoader.java:
56)
[WARNING]   at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
[WARNING]   at java.security.AccessController.doPrivileged(Native
Method)
[WARNING]   at java.net.URLClassLoader.findClass(URLClassLoader.java:
188)
[WARNING]   at java.lang.ClassLoader.loadClass(ClassLoader.java:316)
[WARNING]   at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:
288)
[WARNING]   at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
[WARNING]   at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:
374)
[WARNING]   at scala.tools.nsc.Global.superAccessors(Global.scala:287)
[WARNING]   at scala.tools.nsc.Global.builtInPhaseDescriptors
(Global.scala:403)
[WARNING]   at scala.tools.nsc.plugins.Plugins
$class.computePhaseDescriptors(Plugins.scala:154)
[WARNING]   at scala.tools.nsc.Global.computePhaseDescriptors
(Global.scala:34)
[WARNING]   at scala.tools.nsc.Global.phaseDescriptors(Global.scala:
442)
[WARNING]   at scala.tools.nsc.Global$Run.init(Global.scala:490)
[WARNING]   at scala.tools.nsc.Main$.process(Main.scala:72)
[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: 5 seconds
[INFO] Finished at: Tue Apr 21 11:00:36 BST 2009
[INFO] Final Memory: 27M/64M
[INFO]


There's probably something obvious that I'm doing wrong, or have setup
wrong but I've no idea what. Anyone have any ideas?

I'm using maven 2.1.0 on a Mac with 

[Lift] Stuck at Getting started

2009-04-21 Thread Ann

I've got these errors when tried examples from getting started, when I
run mvn jetty:run I get:



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

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

[INFO] Preparing jetty:run
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [yuicompressor:compress {execution: default}]
[INFO] nb warnings: 0, nb errors: 0
Downloading: 
http://scala-tools.org/repo-releases/org/igniterealtime/smack/smack/3.1.0/smack-3.1.0.pom
Downloading: 
http://repo1.maven.org/maven2/org/igniterealtime/smack/smack/3.1.0/smack-3.1.0.pom
Downloading: 
http://scala-tools.org/repo-releases/org/igniterealtime/smack/smackx/3.1.0/smackx-3.1.0.pom
Downloading: 
http://repo1.maven.org/maven2/org/igniterealtime/smack/smackx/3.1.0/smackx-3.1.0.pom
[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 2 source files to /home/ann/work/liftweb/todo/target/
classes
[WARNING] /home/ann/work/liftweb/todo/src/main/scala/com/liftworkshop/
snippet/TD.scala:33: error: ')' expected but '.' found.
[WARNING]   ~priority~ - todo.priority.toForm,
[WARNING] ^
[WARNING] /home/ann/work/liftweb/todo/src/main/scala/com/liftworkshop/
snippet/TD.scala:38: error: block must end in result expression, not
in definition
[WARNING]  }
[WARNING]  ^
[WARNING] /home/ann/work/liftweb/todo/src/main/scala/com/liftworkshop/
model/ToDo.scala:29: error: ')' expected but integer literal found.
[WARNING] valMinLen(3, ~Description must be 3 characters~) _ ::
super.validations
[WARNING]   ^
[WARNING] three errors found
[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: 7 seconds
[INFO] Finished at: Tue Apr 21 16:14:53 EEST 2009
[INFO] Final Memory: 16M/124M

--~--~-~--~~~---~--~~
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: Stuck at Getting started

2009-04-21 Thread bradford

Hi Ann,

I believe the is a problem with the document converting quotes to
tildas.  You will need to manually go through the code and replace ~
with .

Hope this helps,
Bradford

On Apr 21, 9:16 am, Ann ann.cu...@gmail.com wrote:
 I've got these errors when tried examples from getting started, when I
 run mvn jetty:run I get:

 [INFO] Scanning for projects...
 [INFO] Searching repository for plugin with prefix: 'jetty'.
 [INFO]
 
 [INFO] Building todo
 [INFO]    task-segment: [jetty:run]
 [INFO]
 
 [INFO] Preparing jetty:run
 [INFO] [resources:resources]
 [INFO] Using default encoding to copy filtered resources.
 [INFO] [yuicompressor:compress {execution: default}]
 [INFO] nb warnings: 0, nb errors: 0
 Downloading:http://scala-tools.org/repo-releases/org/igniterealtime/smack/smack/3...
 Downloading:http://repo1.maven.org/maven2/org/igniterealtime/smack/smack/3.1.0/sm...
 Downloading:http://scala-tools.org/repo-releases/org/igniterealtime/smack/smackx/...
 Downloading:http://repo1.maven.org/maven2/org/igniterealtime/smack/smackx/3.1.0/s...
 [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 2 source files to /home/ann/work/liftweb/todo/target/
 classes
 [WARNING] /home/ann/work/liftweb/todo/src/main/scala/com/liftworkshop/
 snippet/TD.scala:33: error: ')' expected but '.' found.
 [WARNING]       ~priority~ - todo.priority.toForm,
 [WARNING]                         ^
 [WARNING] /home/ann/work/liftweb/todo/src/main/scala/com/liftworkshop/
 snippet/TD.scala:38: error: block must end in result expression, not
 in definition
 [WARNING]  }
 [WARNING]  ^
 [WARNING] /home/ann/work/liftweb/todo/src/main/scala/com/liftworkshop/
 model/ToDo.scala:29: error: ')' expected but integer literal found.
 [WARNING]     valMinLen(3, ~Description must be 3 characters~) _ ::
 super.validations
 [WARNING]                                       ^
 [WARNING] three errors found
 [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: 7 seconds
 [INFO] Finished at: Tue Apr 21 16:14:53 EEST 2009
 [INFO] Final Memory: 16M/124M
--~--~-~--~~~---~--~~
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: Can't get applications to run in Jetty

2009-04-21 Thread Julian Howarth

Ha! Upgrading the JDK is easier said than done. 1.6.0_07 *is* the
latest version as far as macs are concerned. Is there a way of
specifying a version of scala that is compatible with that JDK
version?

On Apr 21, 1:54 pm, David Bernard david.bernard...@gmail.com wrote:
 Thanks, I resquest it, just to check which version of java is used to run
 scalac.
 IMHO the problem is that scala was compiled with a more recent version of
 java than your = ClassVersionNumber unknown by your jdk and the .class

 try to upgrade your jdk.

 On Tue, Apr 21, 2009 at 14:38, Julian Howarth howar...@freenet.co.ukwrote:



   mvn compile -Dmaven.scala.displayCmd=true
  [INFO] Scanning for projects...
  [INFO]
  
  [INFO] Building helloworld
  [INFO]    task-segment: [compile]
  [INFO]
  
  [INFO] [resources:resources]
  [INFO] Using default encoding to copy filtered resources.
  [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 2 source files to /Users/julian/NetBeansProjects/
  lifttest/helloworld/target/classes
  [INFO] cmd:  /System/Library/Frameworks/JavaVM.framework/Versions/
  1.6.0/Home/bin/java -classpath /Users/julian/.m2/repository/org/scala-
  lang/scala-compiler/2.7.3/scala-compiler-2.7.3.jar:/Users/julian/.m2/
  repository/org/scala-lang/scala-library/2.7.3/scala-library-2.7.3.jar -
  Xbootclasspath/a:/Users/julian/.m2/repository/org/scala-lang/scala-
  library/2.7.3/scala-library-2.7.3.jar scala.tools.nsc.Main -classpath /
  Users/julian/NetBeansProjects/lifttest/helloworld/target/classes:/
  Users/julian/.m2/repository/org/scala-lang/scala-library/2.7.3/scala-
  library-2.7.3.jar:/Users/julian/.m2/repository/net/liftweb/lift-util/
  1.0/lift-util-1.0.jar:/Users/julian/.m2/repository/log4j/log4j/1.2.14/
  log4j-1.2.14.jar:/Users/julian/.m2/repository/javax/mail/mail/1.4/
  mail-1.4.jar:/Users/julian/.m2/repository/javax/activation/activation/
  1.1/activation-1.1.jar:/Users/julian/.m2/repository/commons-httpclient/
  commons-httpclient/3.1/commons-httpclient-3.1.jar:/Users/julian/.m2/
  repository/commons-logging/commons-logging/1.0.4/commons-
  logging-1.0.4.jar:/Users/julian/.m2/repository/commons-codec/commons-
  codec/1.3/commons-codec-1.3.jar:/Users/julian/.m2/repository/commons-
  fileupload/commons-fileupload/1.2.1/commons-fileupload-1.2.1.jar:/
  Users/julian/.m2/repository/commons-collections/commons-collections/
  3.2.1/commons-collections-3.2.1.jar:/Users/julian/.m2/repository/net/
  liftweb/lift-webkit/1.0/lift-webkit-1.0.jar:/Users/julian/.m2/
  repository/net/liftweb/lift-mapper/1.0/lift-mapper-1.0.jar:/Users/
  julian/.m2/repository/javax/servlet/servlet-api/2.5/servlet-
  api-2.5.jar -d /Users/julian/NetBeansProjects/lifttest/helloworld/
  target/classes /Users/julian/NetBeansProjects/lifttest/helloworld/src/
  main/scala/bootstrap/liftweb/Boot.scala /Users/julian/NetBeansProjects/
  lifttest/helloworld/src/main/scala/demo/helloworld/snippet/
  HelloWorld.scala
  [WARNING] Exception in thread main java.lang.ClassFormatError:
  Unknown constant tag 84 in class file scala/tools/nsc/transform/
  TypingTransformers$TypingTransformer
  [WARNING]       at java.lang.ClassLoader.defineClass1(Native Method)
  [WARNING]       at java.lang.ClassLoader.defineClass(ClassLoader.java:675)
  [WARNING]       at java.security.SecureClassLoader.defineClass
  (SecureClassLoader.java:124)
  [WARNING]       at java.net.URLClassLoader.defineClass(URLClassLoader.java:
  260)
  [WARNING]       at java.net.URLClassLoader.access$000(URLClassLoader.java:
  56)
  [WARNING]       at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
  [WARNING]       at java.security.AccessController.doPrivileged(Native
  Method)
  [WARNING]       at java.net.URLClassLoader.findClass(URLClassLoader.java:
  188)
  [WARNING]       at java.lang.ClassLoader.loadClass(ClassLoader.java:316)
  [WARNING]       at
  sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:
  288)
  [WARNING]       at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
  [WARNING]       at
  java.lang.ClassLoader.loadClassInternal(ClassLoader.java:
  374)
  [WARNING]       at java.lang.ClassLoader.defineClass1(Native Method)
  [WARNING]       at java.lang.ClassLoader.defineClass(ClassLoader.java:675)
  [WARNING]       at java.security.SecureClassLoader.defineClass
  (SecureClassLoader.java:124)
  [WARNING]       at java.net.URLClassLoader.defineClass(URLClassLoader.java:
  260)
  [WARNING]       at java.net.URLClassLoader.access$000(URLClassLoader.java:
  56)
  [WARNING]       at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
  [WARNING]       at 

[Lift] Re: Can't get applications to run in Jetty

2009-04-21 Thread Timothy Perrett


Im working on Mac and have no problems at all:

:~ timperrett$ $JAVA_HOME
-bash: /Library/Java/Home: is a directory
:~ timperrett$ java -version
java version 1.5.0_16
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16-b06-284)
Java HotSpot(TM) Client VM (build 1.5.0_16-133, mixed mode, sharing)

You should also have this JAVA_HOME right?

Cheers, Tim

On 21/04/2009 14:40, Julian Howarth howar...@freenet.co.uk wrote:

 
 Ha! Upgrading the JDK is easier said than done. 1.6.0_07 *is* the
 latest version as far as macs are concerned. Is there a way of
 specifying a version of scala that is compatible with that JDK
 version?
 
 On Apr 21, 1:54 pm, David Bernard david.bernard...@gmail.com wrote:
 Thanks, I resquest it, just to check which version of java is used to run
 scalac.
 IMHO the problem is that scala was compiled with a more recent version of
 java than your = ClassVersionNumber unknown by your jdk and the .class
 
 try to upgrade your jdk.
 
 On Tue, Apr 21, 2009 at 14:38, Julian Howarth howar...@freenet.co.ukwrote:
 
 
 
 mvn compile -Dmaven.scala.displayCmd=true
 [INFO] Scanning for projects...
 [INFO]
 
 [INFO] Building helloworld
 [INFO]    task-segment: [compile]
 [INFO]
 
 [INFO] [resources:resources]
 [INFO] Using default encoding to copy filtered resources.
 [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 2 source files to /Users/julian/NetBeansProjects/
 lifttest/helloworld/target/classes
 [INFO] cmd:  /System/Library/Frameworks/JavaVM.framework/Versions/
 1.6.0/Home/bin/java -classpath /Users/julian/.m2/repository/org/scala-
 lang/scala-compiler/2.7.3/scala-compiler-2.7.3.jar:/Users/julian/.m2/
 repository/org/scala-lang/scala-library/2.7.3/scala-library-2.7.3.jar -
 Xbootclasspath/a:/Users/julian/.m2/repository/org/scala-lang/scala-
 library/2.7.3/scala-library-2.7.3.jar scala.tools.nsc.Main -classpath /
 Users/julian/NetBeansProjects/lifttest/helloworld/target/classes:/
 Users/julian/.m2/repository/org/scala-lang/scala-library/2.7.3/scala-
 library-2.7.3.jar:/Users/julian/.m2/repository/net/liftweb/lift-util/
 1.0/lift-util-1.0.jar:/Users/julian/.m2/repository/log4j/log4j/1.2.14/
 log4j-1.2.14.jar:/Users/julian/.m2/repository/javax/mail/mail/1.4/
 mail-1.4.jar:/Users/julian/.m2/repository/javax/activation/activation/
 1.1/activation-1.1.jar:/Users/julian/.m2/repository/commons-httpclient/
 commons-httpclient/3.1/commons-httpclient-3.1.jar:/Users/julian/.m2/
 repository/commons-logging/commons-logging/1.0.4/commons-
 logging-1.0.4.jar:/Users/julian/.m2/repository/commons-codec/commons-
 codec/1.3/commons-codec-1.3.jar:/Users/julian/.m2/repository/commons-
 fileupload/commons-fileupload/1.2.1/commons-fileupload-1.2.1.jar:/
 Users/julian/.m2/repository/commons-collections/commons-collections/
 3.2.1/commons-collections-3.2.1.jar:/Users/julian/.m2/repository/net/
 liftweb/lift-webkit/1.0/lift-webkit-1.0.jar:/Users/julian/.m2/
 repository/net/liftweb/lift-mapper/1.0/lift-mapper-1.0.jar:/Users/
 julian/.m2/repository/javax/servlet/servlet-api/2.5/servlet-
 api-2.5.jar -d /Users/julian/NetBeansProjects/lifttest/helloworld/
 target/classes /Users/julian/NetBeansProjects/lifttest/helloworld/src/
 main/scala/bootstrap/liftweb/Boot.scala /Users/julian/NetBeansProjects/
 lifttest/helloworld/src/main/scala/demo/helloworld/snippet/
 HelloWorld.scala
 [WARNING] Exception in thread main java.lang.ClassFormatError:
 Unknown constant tag 84 in class file scala/tools/nsc/transform/
 TypingTransformers$TypingTransformer
 [WARNING]       at java.lang.ClassLoader.defineClass1(Native Method)
 [WARNING]       at java.lang.ClassLoader.defineClass(ClassLoader.java:675)
 [WARNING]       at java.security.SecureClassLoader.defineClass
 (SecureClassLoader.java:124)
 [WARNING]       at java.net.URLClassLoader.defineClass(URLClassLoader.java:
 260)
 [WARNING]       at java.net.URLClassLoader.access$000(URLClassLoader.java:
 56)
 [WARNING]       at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
 [WARNING]       at java.security.AccessController.doPrivileged(Native
 Method)
 [WARNING]       at java.net.URLClassLoader.findClass(URLClassLoader.java:
 188)
 [WARNING]       at java.lang.ClassLoader.loadClass(ClassLoader.java:316)
 [WARNING]       at
 sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:
 288)
 [WARNING]       at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
 [WARNING]       at
 java.lang.ClassLoader.loadClassInternal(ClassLoader.java:
 374)
 [WARNING]       at java.lang.ClassLoader.defineClass1(Native Method)
 [WARNING]       at java.lang.ClassLoader.defineClass(ClassLoader.java:675)
 [WARNING]       

[Lift] Is Lift the right tool for us?

2009-04-21 Thread Jeppe Nejsum Madsen
Hello,

I've been lurking on this list for a while and trying out small things with
Lift/Scala but thought I would ask the more experienced people around here
before digging much deeper. First some background:

I've been writing webapps for well over a decade using all kind of
tools/languages ranging from Perl/PHP to ASP/.Net/Java (but never Python or
Ruby in any significant way). The last 5 years I've mostly focused on
Java/JEE. Over time I've, like many of you probably, grown tired of the
verbose java syntax and the xml bloat that seems to be required to get any
kind of real-life system up and running.

I'll soon be starting on a new project where I can choose the entire
technology stack and I'm currently evaulating the options. The app will not
be a new Web 2.0 social platform used by millions, but rather a more boring
business-type app with lots of data entry and interactive reporting  :-) But
it will have to stable, fast, easy to use (ie will probably need lots of
Ajax functionality) as well as integrate with many external parties.

One of the primary parameters for choosing a language/framework is speed of
development. I know Rails excel in this and may be the sweet spot for an app
like ours, but 1) I don't know ruby that well and 2) I've tried RoR and it
never really clicked with me while I can easily see how you can create
something, fast. Python/Django is another option I'll be looking at.

I don't know Lift/Scala either but I've always liked the clean, simple
syntax of SML (did a fair share of SML programming back in the CS classes
:-), so FP is not uncommon to me (but a bit rusty). And I do like the JVM as
platform.

So some of the questions I have to the community is this:

- How long time does it take for experienced developers to be 1) Productive
and 2) Be hyperproducive :-) if we assume we'll start from scratch?
- How about new members to a team already knowledgable about Lift/Scala?
It's not likely we'll be able to hire lots of experienced Lift developers in
the near future :-)
- How is the productivity compared to say Rails  Django for database driven
apps requiring lots of Ajax?
- Is Lift ready for production use? While our project is not mission
critical requiring 5+ nines, it is not a consumer product either. Downtime
will hurt. I've read David's statement that he will do a lot to support
production installations, which is a very nice commitment. I know this
depends on the app architecture, but would be nice to get some
- Any input on Mapper/Record vs JPA for persistence?

But basically any experience from using Lift on real, substantial projects
is welcome.

/Jeppe

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



[Lift] Re: Stuck at Getting started

2009-04-21 Thread Derek Chen-Becker
I fixed this in the HTML generation script but we're not yet building the
site from GitHub. We should have this fixed soon.

Derek

On Tue, Apr 21, 2009 at 7:26 AM, bradford fingerm...@gmail.com wrote:


 Hi Ann,

 I believe the is a problem with the document converting quotes to
 tildas.  You will need to manually go through the code and replace ~
 with .

 Hope this helps,
 Bradford

 On Apr 21, 9:16 am, Ann ann.cu...@gmail.com wrote:
  I've got these errors when tried examples from getting started, when I
  run mvn jetty:run I get:
 
  [INFO] Scanning for projects...
  [INFO] Searching repository for plugin with prefix: 'jetty'.
  [INFO]
  
  [INFO] Building todo
  [INFO]task-segment: [jetty:run]
  [INFO]
  
  [INFO] Preparing jetty:run
  [INFO] [resources:resources]
  [INFO] Using default encoding to copy filtered resources.
  [INFO] [yuicompressor:compress {execution: default}]
  [INFO] nb warnings: 0, nb errors: 0
  Downloading:
 http://scala-tools.org/repo-releases/org/igniterealtime/smack/smack/3...
  Downloading:
 http://repo1.maven.org/maven2/org/igniterealtime/smack/smack/3.1.0/sm...
  Downloading:
 http://scala-tools.org/repo-releases/org/igniterealtime/smack/smackx/...
  Downloading:
 http://repo1.maven.org/maven2/org/igniterealtime/smack/smackx/3.1.0/s...
  [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 2 source files to /home/ann/work/liftweb/todo/target/
  classes
  [WARNING] /home/ann/work/liftweb/todo/src/main/scala/com/liftworkshop/
  snippet/TD.scala:33: error: ')' expected but '.' found.
  [WARNING]   ~priority~ - todo.priority.toForm,
  [WARNING] ^
  [WARNING] /home/ann/work/liftweb/todo/src/main/scala/com/liftworkshop/
  snippet/TD.scala:38: error: block must end in result expression, not
  in definition
  [WARNING]  }
  [WARNING]  ^
  [WARNING] /home/ann/work/liftweb/todo/src/main/scala/com/liftworkshop/
  model/ToDo.scala:29: error: ')' expected but integer literal found.
  [WARNING] valMinLen(3, ~Description must be 3 characters~) _ ::
  super.validations
  [WARNING]   ^
  [WARNING] three errors found
  [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: 7 seconds
  [INFO] Finished at: Tue Apr 21 16:14:53 EEST 2009
  [INFO] Final Memory: 16M/124M
 


--~--~-~--~~~---~--~~
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] Avoiding polling when using Comet. Reverse AJAX

2009-04-21 Thread przemek.pokrywka

Hello,

Is is possible to use Comet in Liftweb without frequent polling by
Browser?
When I sniffed traffic between my browser (FF3) and demo app (Comet
chat example), I observed a regular stream of HTTP GETs.

Przemek

--~--~-~--~~~---~--~~
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: Can't get applications to run in Jetty

2009-04-21 Thread Julian Howarth

I've switched to my Linux box with maven 2.1.0 and Java 1.6.0_13,
followed the same steps and it all works as intended. So whatever is
wrong is something to do with the particular setup on my mac.

Julian


On Apr 21, 2:45 pm, Timothy Perrett timo...@getintheloop.eu wrote:
 Im working on Mac and have no problems at all:

 :~ timperrett$ $JAVA_HOME
 -bash: /Library/Java/Home: is a directory
 :~ timperrett$ java -version
 java version 1.5.0_16
 Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16-b06-284)
 Java HotSpot(TM) Client VM (build 1.5.0_16-133, mixed mode, sharing)

 You should also have this JAVA_HOME right?

 Cheers, Tim

 On 21/04/2009 14:40, Julian Howarth howar...@freenet.co.uk wrote:



  Ha! Upgrading the JDK is easier said than done. 1.6.0_07 *is* the
  latest version as far as macs are concerned. Is there a way of
  specifying a version of scala that is compatible with that JDK
  version?

  On Apr 21, 1:54 pm, David Bernard david.bernard...@gmail.com wrote:
  Thanks, I resquest it, just to check which version of java is used to run
  scalac.
  IMHO the problem is that scala was compiled with a more recent version of
  java than your = ClassVersionNumber unknown by your jdk and the .class

  try to upgrade your jdk.

  On Tue, Apr 21, 2009 at 14:38, Julian Howarth 
  howar...@freenet.co.ukwrote:

  mvn compile -Dmaven.scala.displayCmd=true
  [INFO] Scanning for projects...
  [INFO]
  
  [INFO] Building helloworld
  [INFO]    task-segment: [compile]
  [INFO]
  
  [INFO] [resources:resources]
  [INFO] Using default encoding to copy filtered resources.
  [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 2 source files to /Users/julian/NetBeansProjects/
  lifttest/helloworld/target/classes
  [INFO] cmd:  /System/Library/Frameworks/JavaVM.framework/Versions/
  1.6.0/Home/bin/java -classpath /Users/julian/.m2/repository/org/scala-
  lang/scala-compiler/2.7.3/scala-compiler-2.7.3.jar:/Users/julian/.m2/
  repository/org/scala-lang/scala-library/2.7.3/scala-library-2.7.3.jar -
  Xbootclasspath/a:/Users/julian/.m2/repository/org/scala-lang/scala-
  library/2.7.3/scala-library-2.7.3.jar scala.tools.nsc.Main -classpath /
  Users/julian/NetBeansProjects/lifttest/helloworld/target/classes:/
  Users/julian/.m2/repository/org/scala-lang/scala-library/2.7.3/scala-
  library-2.7.3.jar:/Users/julian/.m2/repository/net/liftweb/lift-util/
  1.0/lift-util-1.0.jar:/Users/julian/.m2/repository/log4j/log4j/1.2.14/
  log4j-1.2.14.jar:/Users/julian/.m2/repository/javax/mail/mail/1.4/
  mail-1.4.jar:/Users/julian/.m2/repository/javax/activation/activation/
  1.1/activation-1.1.jar:/Users/julian/.m2/repository/commons-httpclient/
  commons-httpclient/3.1/commons-httpclient-3.1.jar:/Users/julian/.m2/
  repository/commons-logging/commons-logging/1.0.4/commons-
  logging-1.0.4.jar:/Users/julian/.m2/repository/commons-codec/commons-
  codec/1.3/commons-codec-1.3.jar:/Users/julian/.m2/repository/commons-
  fileupload/commons-fileupload/1.2.1/commons-fileupload-1.2.1.jar:/
  Users/julian/.m2/repository/commons-collections/commons-collections/
  3.2.1/commons-collections-3.2.1.jar:/Users/julian/.m2/repository/net/
  liftweb/lift-webkit/1.0/lift-webkit-1.0.jar:/Users/julian/.m2/
  repository/net/liftweb/lift-mapper/1.0/lift-mapper-1.0.jar:/Users/
  julian/.m2/repository/javax/servlet/servlet-api/2.5/servlet-
  api-2.5.jar -d /Users/julian/NetBeansProjects/lifttest/helloworld/
  target/classes /Users/julian/NetBeansProjects/lifttest/helloworld/src/
  main/scala/bootstrap/liftweb/Boot.scala /Users/julian/NetBeansProjects/
  lifttest/helloworld/src/main/scala/demo/helloworld/snippet/
  HelloWorld.scala
  [WARNING] Exception in thread main java.lang.ClassFormatError:
  Unknown constant tag 84 in class file scala/tools/nsc/transform/
  TypingTransformers$TypingTransformer
  [WARNING]       at java.lang.ClassLoader.defineClass1(Native Method)
  [WARNING]       at java.lang.ClassLoader.defineClass(ClassLoader.java:675)
  [WARNING]       at java.security.SecureClassLoader.defineClass
  (SecureClassLoader.java:124)
  [WARNING]       at 
  java.net.URLClassLoader.defineClass(URLClassLoader.java:
  260)
  [WARNING]       at java.net.URLClassLoader.access$000(URLClassLoader.java:
  56)
  [WARNING]       at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
  [WARNING]       at java.security.AccessController.doPrivileged(Native
  Method)
  [WARNING]       at java.net.URLClassLoader.findClass(URLClassLoader.java:
  188)
  [WARNING]       at java.lang.ClassLoader.loadClass(ClassLoader.java:316)
  [WARNING]       at
  

[Lift] Re: class hierarchy with models

2009-04-21 Thread glenn

I'm not sure if this will work as intended, but I'm trying.

Here's a Company class(and its object) that inherits an Address trait:

object Company extends Company with LongKeyedMetaMapper[Company]{

  override def fieldOrder = List(name, line1.asInstanceOf,
 line2.asInstanceOf,
city.asInstanceOf, state.asInstanceOf, postalCode.asInstanceOf)
}

class Company extends LongKeyedMapper[Company] with Address[Company]
with IdPK  {

  def getSingleton = Company
  object name extends MappedString(this, 100)

}

Address is defined as follows:

trait Address[OwnerType : LongKeyedMapper[OwnerType]] {
  def owner = this.asInstanceOf

  object line1 extends MappedString(owner, 100){
override def displayName = Address1
  }

  object line2 extends MappedString(owner, 50){
override def displayName = Address2
  }

  object city extends MappedString(owner, 50){
override def displayName = City
  }

  object state extends MappedState(owner) {
override def displayName = State
  }

  object mc extends MappedCountry[OwnerType](owner){
override def dbColumnName = country_enum
override def defaultValue = Countries.USA
  }

  object postalCode extends MappedPostalCode[OwnerType](owner, mc)

}

Glenn Silverman


On Apr 1, 2:21 am, Tobias Daub hannes.flo...@gmx.li wrote:
 Hi There,

 I'm new to Scala and Lift and still feeling a little bit lost.

 In case of the ToDo example from the Getting started guide: Would it be
 possible to make a more specialized version of a ToDo item that inherits
 from the existing one?

 This is more a general question aboutinheritancefrom Lift models,
 because I've to design some more complexclasshierarchy, where its
 really necessary to have stupid classes that can be specialized later on.

 Apply the same rules aboutinheritance, traits, etc. to Lift models,
 too. Can I do all the stuff that I can do with normal classes?

 Thanks alot!
 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] Demo doesn't work

2009-04-21 Thread Ernst Bauernfeind

Hello,
just wanted to say that demo.liftweb.com doesn't work (502 Bad Gateway
nginx/0.6.32).
I'm very excited about Scala and Lift, so i would be very happy to see
demos, above all the comet chat example.
greets

--~--~-~--~~~---~--~~
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: Stuck at Getting started

2009-04-21 Thread Ann

Thank you.
But is it a problem in documentation or is it in scala library? (I'm
new to scala so I don't know if it's possible to use ~ instead of )

On Apr 21, 4:26 pm, bradford fingerm...@gmail.com wrote:
 Hi Ann,

 I believe the is a problem with the document converting quotes to
 tildas.  You will need to manually go through the code and replace ~
 with .

 Hope this helps,
 Bradford

 On Apr 21, 9:16 am, Ann ann.cu...@gmail.com wrote:

  I've got these errors when tried examples from getting started, when I
  run mvn jetty:run I get:

  [INFO] Scanning for projects...
  [INFO] Searching repository for plugin with prefix: 'jetty'.
  [INFO]
  
  [INFO] Building todo
  [INFO]    task-segment: [jetty:run]
  [INFO]
  
  [INFO] Preparing jetty:run
  [INFO] [resources:resources]
  [INFO] Using default encoding to copy filtered resources.
  [INFO] [yuicompressor:compress {execution: default}]
  [INFO] nb warnings: 0, nb errors: 0
  Downloading:http://scala-tools.org/repo-releases/org/igniterealtime/smack/smack/3...
  Downloading:http://repo1.maven.org/maven2/org/igniterealtime/smack/smack/3.1.0/sm...
  Downloading:http://scala-tools.org/repo-releases/org/igniterealtime/smack/smackx/...
  Downloading:http://repo1.maven.org/maven2/org/igniterealtime/smack/smackx/3.1.0/s...
  [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 2 source files to /home/ann/work/liftweb/todo/target/
  classes
  [WARNING] /home/ann/work/liftweb/todo/src/main/scala/com/liftworkshop/
  snippet/TD.scala:33: error: ')' expected but '.' found.
  [WARNING]       ~priority~ - todo.priority.toForm,
  [WARNING]                         ^
  [WARNING] /home/ann/work/liftweb/todo/src/main/scala/com/liftworkshop/
  snippet/TD.scala:38: error: block must end in result expression, not
  in definition
  [WARNING]  }
  [WARNING]  ^
  [WARNING] /home/ann/work/liftweb/todo/src/main/scala/com/liftworkshop/
  model/ToDo.scala:29: error: ')' expected but integer literal found.
  [WARNING]     valMinLen(3, ~Description must be 3 characters~) _ ::
  super.validations
  [WARNING]                                       ^
  [WARNING] three errors found
  [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: 7 seconds
  [INFO] Finished at: Tue Apr 21 16:14:53 EEST 2009
  [INFO] Final Memory: 16M/124M

--~--~-~--~~~---~--~~
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: Stuck at Getting started

2009-04-21 Thread Ann

Is it why liftweb.com is down for more than 2 hours? It says to me
Lift has a problem

Sorry! This site is experiencing technical difficulties.

Try waiting a few minutes and reloading.

(Can't contact the database server: Access denied for user
'wikiuser'@'localhost' (using password: YES) (localhost))

If no, then you should look what's wrong with the site.

On Apr 21, 5:44 pm, Derek Chen-Becker dchenbec...@gmail.com wrote:
 I fixed this in the HTML generation script but we're not yet building the
 site from GitHub. We should have this fixed soon.

 Derek

 On Tue, Apr 21, 2009 at 7:26 AM, bradford fingerm...@gmail.com wrote:

  Hi Ann,

  I believe the is a problem with the document converting quotes to
  tildas.  You will need to manually go through the code and replace ~
  with .

  Hope this helps,
  Bradford

  On Apr 21, 9:16 am, Ann ann.cu...@gmail.com wrote:
   I've got these errors when tried examples from getting started, when I
   run mvn jetty:run I get:

   [INFO] Scanning for projects...
   [INFO] Searching repository for plugin with prefix: 'jetty'.
   [INFO]
   
   [INFO] Building todo
   [INFO]    task-segment: [jetty:run]
   [INFO]
   
   [INFO] Preparing jetty:run
   [INFO] [resources:resources]
   [INFO] Using default encoding to copy filtered resources.
   [INFO] [yuicompressor:compress {execution: default}]
   [INFO] nb warnings: 0, nb errors: 0
   Downloading:
 http://scala-tools.org/repo-releases/org/igniterealtime/smack/smack/3...
   Downloading:
 http://repo1.maven.org/maven2/org/igniterealtime/smack/smack/3.1.0/sm...
   Downloading:
 http://scala-tools.org/repo-releases/org/igniterealtime/smack/smackx/...
   Downloading:
 http://repo1.maven.org/maven2/org/igniterealtime/smack/smackx/3.1.0/s...
   [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 2 source files to /home/ann/work/liftweb/todo/target/
   classes
   [WARNING] /home/ann/work/liftweb/todo/src/main/scala/com/liftworkshop/
   snippet/TD.scala:33: error: ')' expected but '.' found.
   [WARNING]       ~priority~ - todo.priority.toForm,
   [WARNING]                         ^
   [WARNING] /home/ann/work/liftweb/todo/src/main/scala/com/liftworkshop/
   snippet/TD.scala:38: error: block must end in result expression, not
   in definition
   [WARNING]  }
   [WARNING]  ^
   [WARNING] /home/ann/work/liftweb/todo/src/main/scala/com/liftworkshop/
   model/ToDo.scala:29: error: ')' expected but integer literal found.
   [WARNING]     valMinLen(3, ~Description must be 3 characters~) _ ::
   super.validations
   [WARNING]                                       ^
   [WARNING] three errors found
   [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: 7 seconds
   [INFO] Finished at: Tue Apr 21 16:14:53 EEST 2009
   [INFO] Final Memory: 16M/124M

--~--~-~--~~~---~--~~
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: Avoiding polling when using Comet. Reverse AJAX

2009-04-21 Thread marius d.

Comet is also known as long polling especially when browsers are
involved. That's because:

1. When timeout occurs  ... after x seconds/minutes client needs to re-
establish connection
2. Client reconnects after response is provided by server

But what is the problem with long pooling if a request is done every x
minutes (if server does not have any message for this client)?

Br's,
Marius

On Apr 21, 5:35 pm, przemek.pokrywka przemyslaw.pokry...@gmail.com
wrote:
 Hello,

 Is is possible to use Comet in Liftweb without frequent polling by
 Browser?
 When I sniffed traffic between my browser (FF3) and demo app (Comet
 chat example), I observed a regular stream of HTTP GETs.

 Przemek
--~--~-~--~~~---~--~~
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: Can't get applications to run in Jetty

2009-04-21 Thread David Pollak
It looks like you were editing some of the files with Eclipse which uses a
different version of Scala than does Lift.  If you try mvn clean jetty:run
on your Mac, all should be good.

On Tue, Apr 21, 2009 at 8:08 AM, Julian Howarth howar...@freenet.co.ukwrote:


 I've switched to my Linux box with maven 2.1.0 and Java 1.6.0_13,
 followed the same steps and it all works as intended. So whatever is
 wrong is something to do with the particular setup on my mac.

 Julian


 On Apr 21, 2:45 pm, Timothy Perrett timo...@getintheloop.eu wrote:
  Im working on Mac and have no problems at all:
 
  :~ timperrett$ $JAVA_HOME
  -bash: /Library/Java/Home: is a directory
  :~ timperrett$ java -version
  java version 1.5.0_16
  Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16-b06-284)
  Java HotSpot(TM) Client VM (build 1.5.0_16-133, mixed mode, sharing)
 
  You should also have this JAVA_HOME right?
 
  Cheers, Tim
 
  On 21/04/2009 14:40, Julian Howarth howar...@freenet.co.uk wrote:
 
 
 
   Ha! Upgrading the JDK is easier said than done. 1.6.0_07 *is* the
   latest version as far as macs are concerned. Is there a way of
   specifying a version of scala that is compatible with that JDK
   version?
 
   On Apr 21, 1:54 pm, David Bernard david.bernard...@gmail.com wrote:
   Thanks, I resquest it, just to check which version of java is used to
 run
   scalac.
   IMHO the problem is that scala was compiled with a more recent version
 of
   java than your = ClassVersionNumber unknown by your jdk and the
 .class
 
   try to upgrade your jdk.
 
   On Tue, Apr 21, 2009 at 14:38, Julian Howarth howar...@freenet.co.uk
 wrote:
 
   mvn compile -Dmaven.scala.displayCmd=true
   [INFO] Scanning for projects...
   [INFO]
  
 
   [INFO] Building helloworld
   [INFO]task-segment: [compile]
   [INFO]
  
 
   [INFO] [resources:resources]
   [INFO] Using default encoding to copy filtered resources.
   [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 2 source files to /Users/julian/NetBeansProjects/
   lifttest/helloworld/target/classes
   [INFO] cmd:  /System/Library/Frameworks/JavaVM.framework/Versions/
   1.6.0/Home/bin/java -classpath
 /Users/julian/.m2/repository/org/scala-
   lang/scala-compiler/2.7.3/scala-compiler-2.7.3.jar:/Users/julian/.m2/
   repository/org/scala-lang/scala-library/2.7.3/scala-library-2.7.3.jar
 -
   Xbootclasspath/a:/Users/julian/.m2/repository/org/scala-lang/scala-
   library/2.7.3/scala-library-2.7.3.jar scala.tools.nsc.Main -classpath
 /
   Users/julian/NetBeansProjects/lifttest/helloworld/target/classes:/
   Users/julian/.m2/repository/org/scala-lang/scala-library/2.7.3/scala-
   library-2.7.3.jar:/Users/julian/.m2/repository/net/liftweb/lift-util/
  
 1.0/lift-util-1.0.jar:/Users/julian/.m2/repository/log4j/log4j/1.2.14/
   log4j-1.2.14.jar:/Users/julian/.m2/repository/javax/mail/mail/1.4/
  
 mail-1.4.jar:/Users/julian/.m2/repository/javax/activation/activation/
  
 1.1/activation-1.1.jar:/Users/julian/.m2/repository/commons-httpclient/
   commons-httpclient/3.1/commons-httpclient-3.1.jar:/Users/julian/.m2/
   repository/commons-logging/commons-logging/1.0.4/commons-
   logging-1.0.4.jar:/Users/julian/.m2/repository/commons-codec/commons-
   codec/1.3/commons-codec-1.3.jar:/Users/julian/.m2/repository/commons-
   fileupload/commons-fileupload/1.2.1/commons-fileupload-1.2.1.jar:/
   Users/julian/.m2/repository/commons-collections/commons-collections/
   3.2.1/commons-collections-3.2.1.jar:/Users/julian/.m2/repository/net/
   liftweb/lift-webkit/1.0/lift-webkit-1.0.jar:/Users/julian/.m2/
   repository/net/liftweb/lift-mapper/1.0/lift-mapper-1.0.jar:/Users/
   julian/.m2/repository/javax/servlet/servlet-api/2.5/servlet-
   api-2.5.jar -d /Users/julian/NetBeansProjects/lifttest/helloworld/
   target/classes
 /Users/julian/NetBeansProjects/lifttest/helloworld/src/
   main/scala/bootstrap/liftweb/Boot.scala
 /Users/julian/NetBeansProjects/
   lifttest/helloworld/src/main/scala/demo/helloworld/snippet/
   HelloWorld.scala
   [WARNING] Exception in thread main java.lang.ClassFormatError:
   Unknown constant tag 84 in class file scala/tools/nsc/transform/
   TypingTransformers$TypingTransformer
   [WARNING]   at java.lang.ClassLoader.defineClass1(Native Method)
   [WARNING]   at
 java.lang.ClassLoader.defineClass(ClassLoader.java:675)
   [WARNING]   at java.security.SecureClassLoader.defineClass
   (SecureClassLoader.java:124)
   [WARNING]   at
 java.net.URLClassLoader.defineClass(URLClassLoader.java:
   260)
   [WARNING]   at
 java.net.URLClassLoader.access$000(URLClassLoader.java:
   56)
  

[Lift] Re: Is Lift the right tool for us?

2009-04-21 Thread David Pollak
On Tue, Apr 21, 2009 at 7:12 AM, Jeppe Nejsum Madsen je...@ingolfs.dkwrote:

 Hello,

 I've been lurking on this list for a while and trying out small things with
 Lift/Scala but thought I would ask the more experienced people around here
 before digging much deeper. First some background:

 I've been writing webapps for well over a decade using all kind of
 tools/languages ranging from Perl/PHP to ASP/.Net/Java (but never Python or
 Ruby in any significant way). The last 5 years I've mostly focused on
 Java/JEE. Over time I've, like many of you probably, grown tired of the
 verbose java syntax and the xml bloat that seems to be required to get any
 kind of real-life system up and running.

 I'll soon be starting on a new project where I can choose the entire
 technology stack and I'm currently evaulating the options. The app will not
 be a new Web 2.0 social platform used by millions, but rather a more boring
 business-type app with lots of data entry and interactive reporting  :-) But
 it will have to stable, fast, easy to use (ie will probably need lots of
 Ajax functionality) as well as integrate with many external parties.

 One of the primary parameters for choosing a language/framework is speed of
 development. I know Rails excel in this and may be the sweet spot for an app
 like ours, but 1) I don't know ruby that well and 2) I've tried RoR and it
 never really clicked with me while I can easily see how you can create
 something, fast. Python/Django is another option I'll be looking at.

 I don't know Lift/Scala either but I've always liked the clean, simple
 syntax of SML (did a fair share of SML programming back in the CS classes
 :-), so FP is not uncommon to me (but a bit rusty). And I do like the JVM as
 platform.

 So some of the questions I have to the community is this:

 - How long time does it take for experienced developers to be 1) Productive
 and 2) Be hyperproducive :-) if we assume we'll start from scratch?


1 - About a month
2 - About 3 months



 - How about new members to a team already knowledgable about Lift/Scala?
 It's not likely we'll be able to hire lots of experienced Lift developers in
 the near future :-)


The same as for RoR or DJango.  Your curve will be similar.  New language,
new framework.  The plus is that you don't have to worry about operations
because Lift deploys as a WAR file.  Learning Capistrano for Rails is
non-trivial.


 - How is the productivity compared to say Rails  Django for database
 driven apps requiring lots of Ajax?


Better.  Lift's Ajax and JavaScript abstractions are worlds better that
Rails and Django.  Lift abstracts away the HTTP request/response cycle.
 Rails puts you in the heart of it.  With Lift, you need not define 3
separate files to handle a single Ajax request.



 - Is Lift ready for production use?


Yes.  Lift apps are in productions (and have been for  1 year) at companies
including SAP, Enthiosys, and other places.  More Lift apps are coming
online every day and companies that you've heard of (e.g., Siemens).


 While our project is not mission critical requiring 5+ nines, it is not a
 consumer product either. Downtime will hurt. I've read David's statement
 that he will do a lot to support production installations, which is a very
 nice commitment. I know this depends on the app architecture, but would be
 nice to get some
 - Any input on Mapper/Record vs JPA for persistence?


Depends on your app.

Thanks,

David



 But basically any experience from using Lift on real, substantial projects
 is welcome.

 /Jeppe

 



-- 
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] anybody looked at the 280north stuff?

2009-04-21 Thread Raoul Duke

http://280north.com/blog/2009/02/announcing-atlas/

i'm curious how it really pans out.

sincerely.

--~--~-~--~~~---~--~~
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] Welcome Heiko Seeberger to the Lift committers

2009-04-21 Thread David Pollak
Folks,
I'm pleased to announce that Heiko Seeberger has joined the Lift commiters.
 I'm expecting cool OSGi related stuff to be in Lift very soon.

Please join me in welcoming him.

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
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: anybody looked at the 280north stuff?

2009-04-21 Thread David Pollak
On Tue, Apr 21, 2009 at 10:42 AM, Raoul Duke rao...@gmail.com wrote:


 http://280north.com/blog/2009/02/announcing-atlas/

 i'm curious how it really pans out.


I looked at it a year ago and helped them out in terms of choosing licenses
and business models.  Have not had a chance since to look at it. :-(




 sincerely.

 



-- 
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: CRUDify and hidden fields?

2009-04-21 Thread David Pollak
Franz,
In the createdOn field:

object createdOn extends MappedLong(this) {
  override def dbDisplay_? = false
}

This will exclude the field from display.

Does this help?

Thanks,

David

On Mon, Apr 20, 2009 at 7:19 PM, Franz Bettag i...@fbettag.de wrote:


 Hey there,

 is there any way to hide fields (createdOn/createdBy...) from CRUDify?

 I was digging through the code since google didn't turn up anything
 useful for this topic, but i didn't find anything (may be the lack of
 my scala skill).

 best regards

 -franz

 



-- 
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: CRUDify and hidden fields?

2009-04-21 Thread Franz Bettag

Idea 8 doesn't even list that in the Override List, in addition it
doesn't work.
Maybe it's because i use it in a trait?

import java.util.Date
import model._
import net.liftweb.mapper._

trait TimeStamped[OwnerType : Stamped[OwnerType]] {
  this: Stamped[OwnerType] =

  private val thisTyped = this.asInstanceOf[MapperType]

  object createdOn extends MappedDateTime(thisTyped) with
LifecycleCallbacks {
override def beforeCreate = this(new Date)
override def dbDisplay_? = false
  }
  object updatedOn extends MappedDateTime(thisTyped) with
LifecycleCallbacks {
override def beforeCreate = this(new Date)
override def beforeUpdate = this(new Date)
override def dbDisplay_? = false
  }
}

On 21 Apr., 20:05, David Pollak feeder.of.the.be...@gmail.com wrote:
 Franz,
 In the createdOn field:

 object createdOn extends MappedLong(this) {
   override def dbDisplay_? = false

 }

 This will exclude the field from display.

 Does this help?

 Thanks,

 David



 On Mon, Apr 20, 2009 at 7:19 PM, Franz Bettag i...@fbettag.de wrote:

  Hey there,

  is there any way to hide fields (createdOn/createdBy...) from CRUDify?

  I was digging through the code since google didn't turn up anything
  useful for this topic, but i didn't find anything (may be the lack of
  my scala skill).

  best regards

  -franz

 --
 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: CRUDify and hidden fields?

2009-04-21 Thread David Pollak
On Tue, Apr 21, 2009 at 11:27 AM, Franz Bettag i...@fbettag.de wrote:


 Idea 8 doesn't even list that in the Override List, in addition it
 doesn't work.
 Maybe it's because i use it in a trait?


I don't think so.  Here's code that compiles just fine:

class User extends MegaProtoUser[User] {
  def getSingleton = User // what's the meta server

  // define an additional field for a personal essay
  object textArea extends MappedTextarea(this, 2048) {
override def textareaRows  = 10
override def textareaCols = 50
override def displayName = Personal Essay

  override def dbDisplay_? = false
  }
}





 import java.util.Date
 import model._
 import net.liftweb.mapper._

 trait TimeStamped[OwnerType : Stamped[OwnerType]] {
  this: Stamped[OwnerType] =

  private val thisTyped = this.asInstanceOf[MapperType]

  object createdOn extends MappedDateTime(thisTyped) with
 LifecycleCallbacks {
override def beforeCreate = this(new Date)
override def dbDisplay_? = false
  }
  object updatedOn extends MappedDateTime(thisTyped) with
 LifecycleCallbacks {
override def beforeCreate = this(new Date)
override def beforeUpdate = this(new Date)
override def dbDisplay_? = false
   }
 }

 On 21 Apr., 20:05, David Pollak feeder.of.the.be...@gmail.com wrote:
  Franz,
  In the createdOn field:
 
  object createdOn extends MappedLong(this) {
override def dbDisplay_? = false
 
  }
 
  This will exclude the field from display.
 
  Does this help?
 
  Thanks,
 
  David
 
 
 
  On Mon, Apr 20, 2009 at 7:19 PM, Franz Bettag i...@fbettag.de wrote:
 
   Hey there,
 
   is there any way to hide fields (createdOn/createdBy...) from CRUDify?
 
   I was digging through the code since google didn't turn up anything
   useful for this topic, but i didn't find anything (may be the lack of
   my scala skill).
 
   best regards
 
   -franz
 
  --
  Lift, the simply functional web frameworkhttp://liftweb.net
  Beginning Scalahttp://www.apress.com/book/view/1430219890
  Follow me:http://twitter.com/dpp
  Git some:http://github.com/dpp

 



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

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



[Lift] Re: ajax form that submits multiple values?

2009-04-21 Thread David Pollak
Howdy,
This is a bug in how Ajax forms are submitted (it's a browser-level bug.)

The submit button is not serialized as part of the thing that's sent to the
server.

I'd suggest the following:

 submit - SHtml.hidden(Add user, processEntryAdd) ++ input
type=submit value=Add User/

Thanks,

David


On Mon, Apr 20, 2009 at 5:05 AM, ivan ivan.se...@gmail.com wrote:




 I am just getting started with lift and I am now trying to change a
 normal form to an ajax form but the method processEntryAdd is never
 called.

 def addUser(xhtml : Group) : NodeSeq = {

var firstName = 
var lastName = 

def processEntryAdd() {
Log.info(processEntryAdd:  + firstName + ,  + lastName)
}

SHtml.ajaxForm(
bind(entry, xhtml,
 firstName - SHtml.text(firstName,
 (x) = {
 Log.info(Setting firstName to  + x);
 firstName = x
 }),
 lastName - SHtml.text(lastName,
 (x) = {
 Log.info(Setting lastName to  + x);
 lastName = x
 }),
 submit - SHtml.submit(Add user, processEntryAdd),
))
 }

 Any idea how to achieve what I am trying to do, or why the code above
 doesn't work. The values of the two form fields are submitted when the
 button is pressed and the two local variables firstName and lastName
 are set but the function associated with SHtml.submit isn't called.

 Thanks!

 PS
 I also asked this question here:

 http://stackoverflow.com/questions/760097/scala-lift-framework-ajax-form-that-submits-multiple-values

 



-- 
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: id# based pages

2009-04-21 Thread Charles F. Munat

Actually, after following the link in your email, I think I like your 
style better, too.

David, is there an advantage to the zipped style?

Chas.

Timothy Perrett wrote:
 Personal preference, but I dont like that zip map style... id always
 use specific paramaters as per my exampe - they you know exactly what
 your going to get when you call S.param(thing) in your snippet code.
 
 Tim
 
 On Apr 21, 12:22 pm, Charles F. Munat c...@munat.com wrote:
 Put this in your Boot.scala file inside the def Boot method:

 val idRewriter: LiftRules.RewritePF = {
case RewriteRequest(path @ ParsePath(user :: id :: _, _, _,_),
  _, _) = RewriteResponse(
ParsePath(user :: index :: Nil, , true, false),
Map(id - id :: path.wholePath.drop(2)
  .zipWithIndex.map(p = (param+(p._2 + 1)) - p._1) :_*)
)

 }

 LiftRules.rewrite.prepend(idRewriter)

 You can call it anything. Here it is called idRewriter.

 The val idRewriter is set to a LiftRules Rewrite partial function. The
 case keyword matches the Req against the provided RewriteRequest. The
 first parameter is a ParsePath. path @ means you are matching against
 a piece of this ParsePath.

 Here we match against /user/ with the first item in the list, user.
 Whatever comes after that is placed in the id variable. We don't care
 what comes after that, so the last item in the list is _.

 The last three parts of the ParsePath are unimportant, thus the _, _, _.
 But if we wanted to, the first of those represents a suffix, so we could do:

 path @ ParsePath(user :: id :: _, html, _, _)

 if we wanted to match only against files with the extension html. The
 next parameter is a Boolean indicating whether the path is an absolute
 path. The final parameter is a Boolean indicating whether an end slash
 is required.

 So if I've understood it correctly, then:

 path @ ParsePath(user :: id :: _, html, false, false)

 should only match against a file at user/id that ends in .html. Note
 that there is no leading slash (the path is relative) and there is no
 ending slash.

 The remaining parameters in the RewriteRequest are the RequestType (e.g.
 GetRequest) and the HttpServletRequest itself. For example:

 RewriteRequest(path @ ParsePath(user :: id :: _, _, _, _),
PostRequest, _)

 limits the matches to post requests.

 When a matching request comes in, this partial function then writes a
 RewriteResponse which sends the request to the List(user, index,
 Nil) path (/user/index.html), and passes the id in as a parameter named
 id -- so you can access it via S.param(id).openOr() (that's what
 the Map part does). The wholePath.drop(2) part drops the user/index
 part. If you were matching against three directories (e.g.
 /admin/user/123), you'd drop(3).

 Does this help?

 Chas.



 harryh wrote:
 I want the URLs for user profile pages on my site to be in the
 following form:
 http://mydomain.com/user/123
 Where 123 is the user id. I'm having trouble figuring out how I can
 add pages like this where the URL path does not correspond to the path
 under webapp/
 Help? This can't be very hard I'm sure.
 -harryh, just getting started with lift
  

--~--~-~--~~~---~--~~
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-21 Thread David Pollak
On Sun, Apr 19, 2009 at 3:44 AM, Tobias Daub hannes.flo...@gmx.li wrote:


 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.?


You need to add the MyObject.menu to the SiteMap list and everything else
comes along automatically.



 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
 
  


 



-- 
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: developing Scala/Lift using Eclipse

2009-04-21 Thread Lee Mighdoll
I've played a bit with both netbeans 6.7m2 and eclipse 3.4.2 with the 2.7.3
plugin.  I'm currently using eclipse, but I've found it to be fairly
tempermental... I often have to manually do a clean build to get correct
error messages, or reload the file in the editor, and stepping through the
debugger ping pongs up and down a bit.  But when eclipse works, the
turnaround time to restart a lift application is less than five seconds, and
the debugger generally works well.  I'm hoping that the 2.7.4 version of
eclipse will be better.

I had some trouble debugging with netbeans -- I couldn't set scala
breakpoints in some places for example.

The netbeans javascript code editor is the best I've used so far.  Aptana
provides a nice (free) javascript debugging environment for eclipse.

Lee

On Tue, Apr 21, 2009 at 10:16 AM, Kai M. k...@meder.info wrote:




 On Apr 21, 7:10 am, Lee Mighdoll leemighd...@gmail.com wrote:
  On my version, I see a bunch of libraries that start out M2_REPO, and if
 I
  scroll the library window to the right I see that M2_REPO is successfully
  resolved to: - /home/lee/.m2/repository... If you don't see the libraries
  resolved correctly to your repository, Add Variable ..  Configure
  Variables..., gives you the chance to set the M2_REPO.

 thanks alot for this fact. indeed the var was not set. however, after
 setting it up, eclipse does not show any import-errors but i still can
 not navigate into the sources nor do a proper build.
 switching to netbeans right now... i really hope it wont get eclipse-
 like PITA

 +42 for eclipse-screencast ;)

 thanks!
 kai

 


--~--~-~--~~~---~--~~
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: CRUDify and hidden fields?

2009-04-21 Thread Franz Bettag

My fault, mvn clean and restarting jetty made it work. i guess mvn
scala:cc didn't work that well.

On 21 Apr., 20:27, Franz Bettag i...@fbettag.de wrote:
 Idea 8 doesn't even list that in the Override List, in addition it
 doesn't work.
 Maybe it's because i use it in a trait?

 import java.util.Date
 import model._
 import net.liftweb.mapper._

 trait TimeStamped[OwnerType : Stamped[OwnerType]] {
   this: Stamped[OwnerType] =

   private val thisTyped = this.asInstanceOf[MapperType]

   object createdOn extends MappedDateTime(thisTyped) with
 LifecycleCallbacks {
     override def beforeCreate = this(new Date)
     override def dbDisplay_? = false
   }
   object updatedOn extends MappedDateTime(thisTyped) with
 LifecycleCallbacks {
     override def beforeCreate = this(new Date)
     override def beforeUpdate = this(new Date)
     override def dbDisplay_? = false
   }

 }

 On 21 Apr., 20:05, David Pollak feeder.of.the.be...@gmail.com wrote:

  Franz,
  In the createdOn field:

  object createdOn extends MappedLong(this) {
    override def dbDisplay_? = false

  }

  This will exclude the field from display.

  Does this help?

  Thanks,

  David

  On Mon, Apr 20, 2009 at 7:19 PM, Franz Bettag i...@fbettag.de wrote:

   Hey there,

   is there any way to hide fields (createdOn/createdBy...) from CRUDify?

   I was digging through the code since google didn't turn up anything
   useful for this topic, but i didn't find anything (may be the lack of
   my scala skill).

   best regards

   -franz

  --
  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: CRUDify and hidden fields?

2009-04-21 Thread Franz Bettag

My old answer seems somehow to have gotten delayed, it was a problem
with mvn scala:cc. mvn clean and mvn compile fixed that.

Sorry for that.

The effect is almost what i was looking for ;) i was looking for
something like override def _toForm = Nil.. In the Listing the data
should be display, but of course it shouldn't be possible to change it
in the forms.

Besides overriding (which didn't work that well), i tried def
readOnly_? = true which had no effect

On 21 Apr., 20:31, David Pollak feeder.of.the.be...@gmail.com wrote:
 On Tue, Apr 21, 2009 at 11:27 AM, Franz Bettag i...@fbettag.de wrote:

  Idea 8 doesn't even list that in the Override List, in addition it
  doesn't work.
  Maybe it's because i use it in a trait?

 I don't think so.  Here's code that compiles just fine:

 class User extends MegaProtoUser[User] {
   def getSingleton = User // what's the meta server

   // define an additional field for a personal essay
   object textArea extends MappedTextarea(this, 2048) {
     override def textareaRows  = 10
     override def textareaCols = 50
     override def displayName = Personal Essay

   override def dbDisplay_? = false
   }



 }

  import java.util.Date
  import model._
  import net.liftweb.mapper._

  trait TimeStamped[OwnerType : Stamped[OwnerType]] {
   this: Stamped[OwnerType] =

   private val thisTyped = this.asInstanceOf[MapperType]

   object createdOn extends MappedDateTime(thisTyped) with
  LifecycleCallbacks {
     override def beforeCreate = this(new Date)
     override def dbDisplay_? = false
   }
   object updatedOn extends MappedDateTime(thisTyped) with
  LifecycleCallbacks {
     override def beforeCreate = this(new Date)
     override def beforeUpdate = this(new Date)
     override def dbDisplay_? = false
    }
  }

  On 21 Apr., 20:05, David Pollak feeder.of.the.be...@gmail.com wrote:
   Franz,
   In the createdOn field:

   object createdOn extends MappedLong(this) {
     override def dbDisplay_? = false

   }

   This will exclude the field from display.

   Does this help?

   Thanks,

   David

   On Mon, Apr 20, 2009 at 7:19 PM, Franz Bettag i...@fbettag.de wrote:

Hey there,

is there any way to hide fields (createdOn/createdBy...) from CRUDify?

I was digging through the code since google didn't turn up anything
useful for this topic, but i didn't find anything (may be the lack of
my scala skill).

best regards

-franz

   --
   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: Is Lift the right tool for us?

2009-04-21 Thread Jeppe Nejsum Madsen
Thanks for the swift reponse. A few comments inline

On Tue, Apr 21, 2009 at 7:51 PM, David Pollak feeder.of.the.be...@gmail.com
 wrote:

[...]


 I don't know Lift/Scala either but I've always liked the clean, simple
 syntax of SML (did a fair share of SML programming back in the CS classes
 :-), so FP is not uncommon to me (but a bit rusty). And I do like the JVM as
 platform.

 So some of the questions I have to the community is this:

 - How long time does it take for experienced developers to be 1)
 Productive and 2) Be hyperproducive :-) if we assume we'll start from
 scratch?


 1 - About a month
 2 - About 3 months


This is encouraging!




 - How about new members to a team already knowledgable about Lift/Scala?
 It's not likely we'll be able to hire lots of experienced Lift developers in
 the near future :-)


 The same as for RoR or DJango.  Your curve will be similar.  New language,
 new framework.  The plus is that you don't have to worry about operations
 because Lift deploys as a WAR file.  Learning Capistrano for Rails is
 non-trivial.


 - How is the productivity compared to say Rails  Django for database
 driven apps requiring lots of Ajax?


 Better.  Lift's Ajax and JavaScript abstractions are worlds better that
 Rails and Django.  Lift abstracts away the HTTP request/response cycle.
  Rails puts you in the heart of it.  With Lift, you need not define 3
 separate files to handle a single Ajax request.


Yes, the Rails way seem a bit cumbersome (but does provide a quick bang for
the buck out the box). I've yet to fully understand how this works in Lift
(Scala code still doesn't look very clean to me. Maybe that's just an
acquired taste?)

[...]

- Any input on Mapper/Record vs JPA for persistence?


 Depends on your app.


Ok, will get back to this when I've got some more details...

/Jeppe

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



[Lift] Re: Is Lift the right tool for us?

2009-04-21 Thread Jeppe Nejsum Madsen
On Tue, Apr 21, 2009 at 9:01 PM, Charles F. Munat c...@munat.com wrote:


 Yeah, it's always nice to get some... :-)

 As a former Rails developer, I'll say this: I don't think I'm yet quite
 as fast in Lift as I was in Rails, but I'm getting there. A lot of this
 has had to do with switching mindset from Ruby to a more Java-ish approach.


Do you think you'll surpass your Rails speed? If yes, can you explain what
elements contribute to this?


 For you, as a Java developer, I think you'll find the reverse true. With
 Scala, you can continue to use the same Java libraries and tools that
 you've used before. I think you'll learn Lift very quickly, and whenever
 you're stuck, you'll have all that Java background to fall back on.


My thoughts exactly :-) I know I will not use Java for this project so I'm
willing to take a small hit initially. But staying on the JVM at least
provides som firm ground wrt to deployment, ops, runtime, tuning etc.

If your project is more than a simple app (as I'm certain it is), I
 would go with JPA. Record is not ready yet, and Mapper is pretty
 limited. For example, AFAIK Mapper doesn't do many-to-many associations.
 I've had a lot of success with JPA/Hibernate, and it's getting pretty
 solid in Lift now -- there are even Maven archetypes for it.


 I've yet to dig into Mapper/Record. What are the main benefits of these
(besides the obvious simplicity you get when not needing to use JPA)?


 Lift is more than ready for production use. I've been using it in
 production for more than six months.


Nice! Any numbers you can share (users, tables, data, transactions etc)?


/Jeppe

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



[Lift] Moving to streaming upload API

2009-04-21 Thread Tim Perrett

Guys,

I've been taking a close look at the way lift handles uploads. Right
now were putting the entire thing (upload) into memory. This, IMO, is
not a good look. I managed to crash my whole laptop as Jetty scrabbled
for memory to store a massive upload I was trying.

Looking at the commons upload API it appears it has pretty good
support for streaming:

http://commons.apache.org/fileupload/streaming.html

Can we not rework the upload support in Req.scala to use a streaming
methodology instead? A sweet by-product will be easily able to do
CometActor based upload progress bars ;-)

Thoughts?

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



[Lift] Re: Moving to streaming upload API

2009-04-21 Thread David Pollak
Let's add it to the 1.1 backlog and see where we get.  It might work out
well for the refactoring of Req due to the coding of portlets, etc.

On Tue, Apr 21, 2009 at 12:28 PM, Tim Perrett timo...@getintheloop.euwrote:


 Guys,

 I've been taking a close look at the way lift handles uploads. Right
 now were putting the entire thing (upload) into memory. This, IMO, is
 not a good look. I managed to crash my whole laptop as Jetty scrabbled
 for memory to store a massive upload I was trying.

 Looking at the commons upload API it appears it has pretty good
 support for streaming:

 http://commons.apache.org/fileupload/streaming.html

 Can we not rework the upload support in Req.scala to use a streaming
 methodology instead? A sweet by-product will be easily able to do
 CometActor based upload progress bars ;-)

 Thoughts?

 Cheers, Tim
 



-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
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: Moving to streaming upload API

2009-04-21 Thread Derek Chen-Becker
I would vote for adding streaming and leaving the choice to the user.

Derek

On Tue, Apr 21, 2009 at 1:28 PM, Tim Perrett timo...@getintheloop.euwrote:


 Guys,

 I've been taking a close look at the way lift handles uploads. Right
 now were putting the entire thing (upload) into memory. This, IMO, is
 not a good look. I managed to crash my whole laptop as Jetty scrabbled
 for memory to store a massive upload I was trying.

 Looking at the commons upload API it appears it has pretty good
 support for streaming:

 http://commons.apache.org/fileupload/streaming.html

 Can we not rework the upload support in Req.scala to use a streaming
 methodology instead? A sweet by-product will be easily able to do
 CometActor based upload progress bars ;-)

 Thoughts?

 Cheers, Tim
 


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



[Lift] Re: Is Lift the right tool for us?

2009-04-21 Thread Clemens Oertel

 If your project is more than a simple app (as I'm certain it is), I
 would go with JPA. Record is not ready yet, and Mapper is pretty
 limited. For example, AFAIK Mapper doesn't do many-to-many  
 associations.
 I've had a lot of success with JPA/Hibernate, and it's getting pretty
 solid in Lift now -- there are even Maven archetypes for it.

  I've yet to dig into Mapper/Record. What are the main benefits of  
 these (besides the obvious simplicity you get when not needing to  
 use JPA)?


Here's my experience: I started out with mapper for my current  
project, and ended up overriding/rewriting most of the functionality,  
to make it work for my (maybe unusual) requirements. I have pretty  
much duplicated the entire mapper class/trait hierarchy, bit by bit.  
For example, Mapper does not like dealing with null values for types  
that are not nullable in Scala. Mapper has, for example, 0 hard-coded  
as default value for int's for which no value is given. No  
insurmountable obstacles, but things might take more work than one  
thinks initially. There's just no free lunch.

Since mapper combines so many aspects, it might take a considerable  
amount of effort to isolate concerns when switching from mapper to JPA  
or similar.

I will be switching to JPA in the next two weeks.

Best,
Clemens


--~--~-~--~~~---~--~~
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: Stuck at Getting started

2009-04-21 Thread Derek Chen-Becker
It's documentation. For some reason, the tex4ht translator is putting ~
where there should be quotes. The ~ character is a valid character within
Scala code, but it doesn't have the meaning that we're using here.

Derek

On Tue, Apr 21, 2009 at 11:12 AM, Ann ann.cu...@gmail.com wrote:


 Thank you.
 But is it a problem in documentation or is it in scala library? (I'm
 new to scala so I don't know if it's possible to use ~ instead of )

 On Apr 21, 4:26 pm, bradford fingerm...@gmail.com wrote:
  Hi Ann,
 
  I believe the is a problem with the document converting quotes to
  tildas.  You will need to manually go through the code and replace ~
  with .
 
  Hope this helps,
  Bradford
 
  On Apr 21, 9:16 am, Ann ann.cu...@gmail.com wrote:
 
   I've got these errors when tried examples from getting started, when I
   run mvn jetty:run I get:
 
   [INFO] Scanning for projects...
   [INFO] Searching repository for plugin with prefix: 'jetty'.
   [INFO]
  
 
   [INFO] Building todo
   [INFO]task-segment: [jetty:run]
   [INFO]
  
 
   [INFO] Preparing jetty:run
   [INFO] [resources:resources]
   [INFO] Using default encoding to copy filtered resources.
   [INFO] [yuicompressor:compress {execution: default}]
   [INFO] nb warnings: 0, nb errors: 0
   Downloading:
 http://scala-tools.org/repo-releases/org/igniterealtime/smack/smack/3...
   Downloading:
 http://repo1.maven.org/maven2/org/igniterealtime/smack/smack/3.1.0/sm...
   Downloading:
 http://scala-tools.org/repo-releases/org/igniterealtime/smack/smackx/...
   Downloading:
 http://repo1.maven.org/maven2/org/igniterealtime/smack/smackx/3.1.0/s...
   [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 2 source files to /home/ann/work/liftweb/todo/target/
   classes
   [WARNING] /home/ann/work/liftweb/todo/src/main/scala/com/liftworkshop/
   snippet/TD.scala:33: error: ')' expected but '.' found.
   [WARNING]   ~priority~ - todo.priority.toForm,
   [WARNING] ^
   [WARNING] /home/ann/work/liftweb/todo/src/main/scala/com/liftworkshop/
   snippet/TD.scala:38: error: block must end in result expression, not
   in definition
   [WARNING]  }
   [WARNING]  ^
   [WARNING] /home/ann/work/liftweb/todo/src/main/scala/com/liftworkshop/
   model/ToDo.scala:29: error: ')' expected but integer literal found.
   [WARNING] valMinLen(3, ~Description must be 3 characters~) _ ::
   super.validations
   [WARNING]   ^
   [WARNING] three errors found
   [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: 7 seconds
   [INFO] Finished at: Tue Apr 21 16:14:53 EEST 2009
   [INFO] Final Memory: 16M/124M

 


--~--~-~--~~~---~--~~
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 documentation -- Attention newcomers (and everyone else)!

2009-04-21 Thread Charles F. Munat

I am charged with coming up with a site map/information architecture for 
our hopefully-soon-to-be-updated wiki.

What would most benefit you on a documentation wiki? What sorts of 
things are you having the most problems with?

Please submit suggestions for a wiki outline, as well as any other ideas 
you have. For example, ideas on wiki structure are welcome. You could 
even suggest your own outline.

Please participate! Yes, you, lurker! We want to know what you need.

I'll collect all the ideas this weekend, consolidate them, and present a 
suggested outline (road map) for the documentation wiki.

Thanks!

Yes! If you are reading this, then I am talking to you. Speak up.

Chas.

--~--~-~--~~~---~--~~
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: Moving to streaming upload API

2009-04-21 Thread Timothy Perrett

+1, having the choice would be good. Seems like it would be simple to
add it to LiftRules for user configuration.

@dpp What other re-factoring of Req did you have in mind? Id have a
poke about with the streaming stuff but I get the impression it might
be a bit wasted depending on what you have planned ahead?

Cheers, Tim

On Apr 21, 8:31 pm, Derek Chen-Becker dchenbec...@gmail.com wrote:
 I would vote for adding streaming and leaving the choice to the user.

 Derek

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



[Lift] Re: [Lift committers] Welcome Heiko Seeberger to the Lift committers

2009-04-21 Thread Derek Chen-Becker
Welcome aboard, Heiko!

On Tue, Apr 21, 2009 at 11:56 AM, David Pollak 
feeder.of.the.be...@gmail.com wrote:

 Folks,
 I'm pleased to announce that Heiko Seeberger has joined the Lift commiters.
  I'm expecting cool OSGi related stuff to be in Lift very soon.

 Please join me in welcoming him.

 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
 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: developing Scala/Lift using Eclipse

2009-04-21 Thread Derek Chen-Becker
Eclipse has been on and off with me. The new version definitely works
better, but I write code against Maven projects with nested modules and that
combination seems to make everything fairly unhappy. I get weird error
messages like _root_ does not exist that go away if I stop and restart
Eclipse.

Derek

On Tue, Apr 21, 2009 at 1:03 PM, Lee Mighdoll leemighd...@gmail.com wrote:

 I've played a bit with both netbeans 6.7m2 and eclipse 3.4.2 with the 2.7.3
 plugin.  I'm currently using eclipse, but I've found it to be fairly
 tempermental... I often have to manually do a clean build to get correct
 error messages, or reload the file in the editor, and stepping through the
 debugger ping pongs up and down a bit.  But when eclipse works, the
 turnaround time to restart a lift application is less than five seconds, and
 the debugger generally works well.  I'm hoping that the 2.7.4 version of
 eclipse will be better.

 I had some trouble debugging with netbeans -- I couldn't set scala
 breakpoints in some places for example.

 The netbeans javascript code editor is the best I've used so far.  Aptana
 provides a nice (free) javascript debugging environment for eclipse.

 Lee


 On Tue, Apr 21, 2009 at 10:16 AM, Kai M. k...@meder.info wrote:




 On Apr 21, 7:10 am, Lee Mighdoll leemighd...@gmail.com wrote:
  On my version, I see a bunch of libraries that start out M2_REPO, and if
 I
  scroll the library window to the right I see that M2_REPO is
 successfully
  resolved to: - /home/lee/.m2/repository... If you don't see the
 libraries
  resolved correctly to your repository, Add Variable ..  Configure
  Variables..., gives you the chance to set the M2_REPO.

 thanks alot for this fact. indeed the var was not set. however, after
 setting it up, eclipse does not show any import-errors but i still can
 not navigate into the sources nor do a proper build.
 switching to netbeans right now... i really hope it wont get eclipse-
 like PITA

 +42 for eclipse-screencast ;)

 thanks!
 kai




 


--~--~-~--~~~---~--~~
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: developing Scala/Lift using Eclipse

2009-04-21 Thread Timothy Perrett

The main one i've come across is that whole jetty WebAppContext which
I dont seem to be able to get rid of did anyone find a solution
for that?

Cheers, Tim

On Apr 21, 8:45 pm, Derek Chen-Becker dchenbec...@gmail.com wrote:
 Eclipse has been on and off with me. The new version definitely works
 better, but I write code against Maven projects with nested modules and that
 combination seems to make everything fairly unhappy. I get weird error
 messages like _root_ does not exist that go away if I stop and restart
 Eclipse.

 Derek



 On Tue, Apr 21, 2009 at 1:03 PM, Lee Mighdoll leemighd...@gmail.com wrote:
  I've played a bit with both netbeans 6.7m2 and eclipse 3.4.2 with the 2.7.3
  plugin.  I'm currently using eclipse, but I've found it to be fairly
  tempermental... I often have to manually do a clean build to get correct
  error messages, or reload the file in the editor, and stepping through the
  debugger ping pongs up and down a bit.  But when eclipse works, the
  turnaround time to restart a lift application is less than five seconds, and
  the debugger generally works well.  I'm hoping that the 2.7.4 version of
  eclipse will be better.

  I had some trouble debugging with netbeans -- I couldn't set scala
  breakpoints in some places for example.

  The netbeans javascript code editor is the best I've used so far.  Aptana
  provides a nice (free) javascript debugging environment for eclipse.

  Lee

  On Tue, Apr 21, 2009 at 10:16 AM, Kai M. k...@meder.info wrote:

  On Apr 21, 7:10 am, Lee Mighdoll leemighd...@gmail.com wrote:
   On my version, I see a bunch of libraries that start out M2_REPO, and if
  I
   scroll the library window to the right I see that M2_REPO is
  successfully
   resolved to: - /home/lee/.m2/repository... If you don't see the
  libraries
   resolved correctly to your repository, Add Variable ..  Configure
   Variables..., gives you the chance to set the M2_REPO.

  thanks alot for this fact. indeed the var was not set. however, after
  setting it up, eclipse does not show any import-errors but i still can
  not navigate into the sources nor do a proper build.
  switching to netbeans right now... i really hope it wont get eclipse-
  like PITA

  +42 for eclipse-screencast ;)

  thanks!
  kai
--~--~-~--~~~---~--~~
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: Is Lift the right tool for us?

2009-04-21 Thread Timothy Perrett


I too used to do a lot of rails dev... Granted my lift apps take me
*slightly* longer to produce, but only by a bit. However, they do take a lot
less time to deploy and maintain because my platform is not leaking like the
proverbial rusty bucket ;-)

Cheers, Tim

On 21/04/2009 20:15, Jeppe Nejsum Madsen je...@ingolfs.dk wrote:

 As a former Rails developer, I'll say this: I don't think I'm yet quite
 as fast in Lift as I was in Rails, but I'm getting there. A lot of this
 has had to do with switching mindset from Ruby to a more Java-ish approach.
 
 Do you think you'll surpass your Rails speed? If yes, can you explain what
 elements contribute to this?



--~--~-~--~~~---~--~~
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: Is Lift the right tool for us?

2009-04-21 Thread Charles F. Munat

Jeppe Nejsum Madsen wrote:

 Do you think you'll surpass your Rails speed? If yes, can you explain 
 what elements contribute to this?

I'm not sure, but I think so. Then again, it's difficult to say, because 
I'm doing more. There is definitely a bit less boilerplate for me with 
Lift, but not as much less as I'd like. One of the things I'm slowly 
working on is some best practices to reduce that boilerplate.

But I build apps very differently in Lift than I did in Rails. Not just 
because Lift is different. Mostly, it's because I've refined my ideas 
and new libraries have made things easier.

Where Lift sometimes slows me down is usually because I'm learning a 
Java library. For example, JAI has wasted a lot of my time to do 
something that I did fairly quickly with RMagick in Rails. But I can do 
a lot more with JAI once I have it down. That's the tradeoff, I guess.

In Rails I wrote an extensive library of CRUD functionality that I used 
to build CRUD apps very quickly. My views were reduced to a few lines of 
code, controllers even more so. For example, a controller that had 350 
lines of code was reduced to around 12 lines. A view that had 200 lines 
became 20 lines. That really made things fast.

I hope to do the same for Lift eventually (if someone else hasn't done 
it first), but in the meantime, I'm not quite as fast.

 For you, as a Java developer, I think you'll find the reverse true. With
 Scala, you can continue to use the same Java libraries and tools that
 you've used before. I think you'll learn Lift very quickly, and whenever
 you're stuck, you'll have all that Java background to fall back on.
 
 
 My thoughts exactly :-) I know I will not use Java for this project so 
 I'm willing to take a small hit initially. But staying on the JVM at 
 least provides som firm ground wrt to deployment, ops, runtime, tuning etc.

Oh, you'd be surprised how handy having access to Java at any time is. 
You get all the benefits of Scala's syntax, but you can use pretty much 
anything out there that's Java -- without writing any Java. That's 
probably what persuaded me to try Lift more than anything else. I hate 
Java's verbosity (and all those damn XML files). But I love its speed 
and stability and the huge amount of code out there.

 If your project is more than a simple app (as I'm certain it is), I
 would go with JPA. Record is not ready yet, and Mapper is pretty
 limited. For example, AFAIK Mapper doesn't do many-to-many associations.
 I've had a lot of success with JPA/Hibernate, and it's getting pretty
 solid in Lift now -- there are even Maven archetypes for it.
 
  I've yet to dig into Mapper/Record. What are the main benefits of these 
 (besides the obvious simplicity you get when not needing to use JPA)?

I don't find Mapper any simpler than JPA, just different. You do get 
some stuff for free, but it doesn't ever seem to be what I need.

Record is another matter. I haven't even looked at it yet, but from what 
I hear it bundles in oodles of goodness. I'm psyched. And I think you'll 
be able to use it with JPA... could be wrong about that, though.

 
 Lift is more than ready for production use. I've been using it in
 production for more than six months.
 
 
 Nice! Any numbers you can share (users, tables, data, transactions etc)?

Funny thing: I have no idea. I build sites for clients and I've never 
concerned myself with traffic. I don't think any of them are very high 
traffic, though. Maybe a few thousand hits a day. Maybe more.

But David Pollak has done some amazing stuff, so check with him on that.


Chas.

--~--~-~--~~~---~--~~
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: Moving to streaming upload API

2009-04-21 Thread Charles F. Munat

Uploads have remained quite mysterious and difficult for me. I'm all for 
anything that makes it easier to do them. Less memory usage is good, too.

Chas.

Tim Perrett wrote:
 Guys,
 
 I've been taking a close look at the way lift handles uploads. Right
 now were putting the entire thing (upload) into memory. This, IMO, is
 not a good look. I managed to crash my whole laptop as Jetty scrabbled
 for memory to store a massive upload I was trying.
 
 Looking at the commons upload API it appears it has pretty good
 support for streaming:
 
 http://commons.apache.org/fileupload/streaming.html
 
 Can we not rework the upload support in Req.scala to use a streaming
 methodology instead? A sweet by-product will be easily able to do
 CometActor based upload progress bars ;-)
 
 Thoughts?
 
 Cheers, Tim
  

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



[Lift] Re: Is Lift the right tool for us?

2009-04-21 Thread Derek Chen-Becker
On Tue, Apr 21, 2009 at 1:53 PM, Charles F. Munat c...@munat.com wrote:


 In Rails I wrote an extensive library of CRUD functionality that I used
 to build CRUD apps very quickly. My views were reduced to a few lines of
 code, controllers even more so. For example, a controller that had 350
 lines of code was reduced to around 12 lines. A view that had 200 lines
 became 20 lines. That really made things fast.

 I hope to do the same for Lift eventually (if someone else hasn't done
 it first), but in the meantime, I'm not quite as fast.


This kind of support is one of our goals with Record. There's still some
mismatch between the way that JPA sees the world and the way that Record
sees the world, but I'm confident that we can find some way to get them
playing together nicely.

Derek

--~--~-~--~~~---~--~~
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: developing Scala/Lift using Eclipse

2009-04-21 Thread Miles Sabin

On Tue, Apr 21, 2009 at 8:45 PM, Derek Chen-Becker
dchenbec...@gmail.com wrote:
 Eclipse has been on and off with me. The new version definitely works
 better, but I write code against Maven projects with nested modules and that
 combination seems to make everything fairly unhappy. I get weird error
 messages like _root_ does not exist that go away if I stop and restart

I'm going to be doing on Lift development with Eclipse at the Scala
Lift Off, so I guess I'm going to be finding out all about these
issues.

But, for my immediate enlightenment, if Eclipse doesn't work well with
Maven nested modules and does (apparently?) work well with non-nested
modules, then why don't you just use non-nested modules?

Cheers,


Miles

-- 
Miles Sabin
tel: +44 (0)7813 944 528
skype:  milessabin
http://twitter.com/milessabin

--~--~-~--~~~---~--~~
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: developing Scala/Lift using Eclipse

2009-04-21 Thread Miles Sabin

I wrote:
 I'm going to be doing on Lift development with Eclipse at the Scala
 Lift Off

Let me try that again ...

I'm going to be doing a presentation on Lift development with Eclipse
at the Scala Lift Off.

Cheers,


Miles

-- 
Miles Sabin
tel: +44 (0)7813 944 528
skype:  milessabin
http://twitter.com/milessabin

--~--~-~--~~~---~--~~
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: developing Scala/Lift using Eclipse

2009-04-21 Thread Derek Chen-Becker
First off, I don't want to come off as whining. I know you've put some
tremendous effort into this and it shows. The new version (I'm actually
using 2.8.0_blahblah), especially the new JDT weaving makes things generally
a pleasure. The weird part for me is that with nested modules it sometimes
works flawlessly. Right now I fired up Eclipse and the nested module that
yesterday showed 112 errors is completely clean. The other weird issue that
I sometimes get is the unhandled event loop, where I'll type and suddenly
the window stops responding to keyboard input. If I close the source file
and reopen it then things work again.

As for nested modules, I use them because then I can issue a single mvn
install in the top-level project and it builds all 8-10 modules at once. In
particular, Lift uses nested modules.

Derek

On Tue, Apr 21, 2009 at 1:59 PM, Miles Sabin mi...@milessabin.com wrote:


 On Tue, Apr 21, 2009 at 8:45 PM, Derek Chen-Becker
 dchenbec...@gmail.com wrote:
  Eclipse has been on and off with me. The new version definitely works
  better, but I write code against Maven projects with nested modules and
 that
  combination seems to make everything fairly unhappy. I get weird error
  messages like _root_ does not exist that go away if I stop and restart

 I'm going to be doing on Lift development with Eclipse at the Scala
 Lift Off, so I guess I'm going to be finding out all about these
 issues.

 But, for my immediate enlightenment, if Eclipse doesn't work well with
 Maven nested modules and does (apparently?) work well with non-nested
 modules, then why don't you just use non-nested modules?

 Cheers,


 Miles

 --
 Miles Sabin
 tel: +44 (0)7813 944 528
 skype:  milessabin
 http://twitter.com/milessabin

 


--~--~-~--~~~---~--~~
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: Moving to streaming upload API

2009-04-21 Thread David Pollak
On Tue, Apr 21, 2009 at 12:38 PM, Timothy Perrett
timo...@getintheloop.euwrote:


 +1, having the choice would be good. Seems like it would be simple to
 add it to LiftRules for user configuration.

 @dpp What other re-factoring of Req did you have in mind? Id have a
 poke about with the streaming stuff but I get the impression it might
 be a bit wasted depending on what you have planned ahead?


HttpServletRequest has to be put in a Box and a few other things.

I'm not sure how to do the streaming upload, so this is not a promise to get
it into 1.1




 Cheers, Tim

 On Apr 21, 8:31 pm, Derek Chen-Becker dchenbec...@gmail.com wrote:
  I would vote for adding streaming and leaving the choice to the user.
 
  Derek

 



-- 
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: developing Scala/Lift using Eclipse

2009-04-21 Thread Miles Sabin

On Tue, Apr 21, 2009 at 9:10 PM, Derek Chen-Becker
dchenbec...@gmail.com wrote:
 First off, I don't want to come off as whining. I know you've put some
 tremendous effort into this and it shows. The new version (I'm actually
 using 2.8.0_blahblah), especially the new JDT weaving makes things generally
 a pleasure. The weird part for me is that with nested modules it sometimes
 works flawlessly. Right now I fired up Eclipse and the nested module that
 yesterday showed 112 errors is completely clean. The other weird issue that
 I sometimes get is the unhandled event loop, where I'll type and suddenly
 the window stops responding to keyboard input. If I close the source file
 and reopen it then things work again.

Unhandled event loop exceptions are an indication that something has
gone badly wrong in the UI part of the Scala IDE. When that happens
it'd help if you could check the Eclipse Error Log view and/or the
main Eclipse log file and create a ticket on Trac for it.

 As for nested modules, I use them because then I can issue a single mvn
 install in the top-level project and it builds all 8-10 modules at once. In
 particular, Lift uses nested modules.

OK, so then in the list of items for the Eclipse Tooling for Lift
what we really need is support for Maven nested modules? Or is this
something which should have generic Maven support?

Cheers,


Miles

-- 
Miles Sabin
tel: +44 (0)7813 944 528
skype:  milessabin
http://twitter.com/milessabin

--~--~-~--~~~---~--~~
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: CRUDify and hidden fields?

2009-04-21 Thread David Pollak
On Tue, Apr 21, 2009 at 11:50 AM, Franz Bettag i...@fbettag.de wrote:


 My old answer seems somehow to have gotten delayed, it was a problem
 with mvn scala:cc. mvn clean and mvn compile fixed that.

 Sorry for that.

 The effect is almost what i was looking for ;) i was looking for
 something like override def _toForm = Nil.. In the Listing the data
 should be display, but of course it shouldn't be possible to change it
 in the forms.

 Besides overriding (which didn't work that well), i tried def
 readOnly_? = true which had no effect


I just added dbIncludeInForm_? If you set that to false, the field will be
included in display, but not in input forms.




 On 21 Apr., 20:31, David Pollak feeder.of.the.be...@gmail.com wrote:
  On Tue, Apr 21, 2009 at 11:27 AM, Franz Bettag i...@fbettag.de wrote:
 
   Idea 8 doesn't even list that in the Override List, in addition it
   doesn't work.
   Maybe it's because i use it in a trait?
 
  I don't think so.  Here's code that compiles just fine:
 
  class User extends MegaProtoUser[User] {
def getSingleton = User // what's the meta server
 
// define an additional field for a personal essay
object textArea extends MappedTextarea(this, 2048) {
  override def textareaRows  = 10
  override def textareaCols = 50
  override def displayName = Personal Essay
 
override def dbDisplay_? = false
}
 
 
 
  }
 
   import java.util.Date
   import model._
   import net.liftweb.mapper._
 
   trait TimeStamped[OwnerType : Stamped[OwnerType]] {
this: Stamped[OwnerType] =
 
private val thisTyped = this.asInstanceOf[MapperType]
 
object createdOn extends MappedDateTime(thisTyped) with
   LifecycleCallbacks {
  override def beforeCreate = this(new Date)
  override def dbDisplay_? = false
}
object updatedOn extends MappedDateTime(thisTyped) with
   LifecycleCallbacks {
  override def beforeCreate = this(new Date)
  override def beforeUpdate = this(new Date)
  override def dbDisplay_? = false
 }
   }
 
   On 21 Apr., 20:05, David Pollak feeder.of.the.be...@gmail.com wrote:
Franz,
In the createdOn field:
 
object createdOn extends MappedLong(this) {
  override def dbDisplay_? = false
 
}
 
This will exclude the field from display.
 
Does this help?
 
Thanks,
 
David
 
On Mon, Apr 20, 2009 at 7:19 PM, Franz Bettag i...@fbettag.de
 wrote:
 
 Hey there,
 
 is there any way to hide fields (createdOn/createdBy...) from
 CRUDify?
 
 I was digging through the code since google didn't turn up anything
 useful for this topic, but i didn't find anything (may be the lack
 of
 my scala skill).
 
 best regards
 
 -franz
 
--
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

 



-- 
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: Why can eclipse never find: org.mortbay.jetty.webapp.WebAppContext

2009-04-21 Thread David Pollak
Please make it so.

On Sun, Apr 19, 2009 at 1:59 PM, Timothy Perrett timo...@getintheloop.euwrote:


 Hey Heiko,

 This was my feeling - im aware that class does not exist in version
 7... I guess my point was do we need to change the lift-archetype so
 that it explicitly defines jetty 6? It seems that this would smooth
 the curve for newbies :-)

 Cheers, Tim

 On Apr 19, 9:50 pm, Heiko Seeberger heiko.seeber...@googlemail.com
 wrote:
  You need to change the Version range for Jetty in the POM: No version 7!
 

 



-- 
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: Object typecast to Mapper

2009-04-21 Thread David Pollak
Amit,
Class.forName(...) is called reflection in Scala/Java land.  It allows you
to get a class based on a String.  You can then create a new instance of the
class with the newInstance() method.  However, what you get is an instance
of Object... and you have to case it into something else before using it.

In Java, there's only one way to cast things:

Object o = someClass.newInstance();
FooBar fb = (FooBar) o;

In Scala, there are two ways to cast (one is safer and less verbose, the
other is intentionally more verbose):

val a: AnyRef = someClass.newInstance
val fb: FooBar = a.asInstanceOf[FooBar]

or (the radically better way)
a match {
  case fb: FooBar = ...
  case _ = ...
}

Hope this helps.

Thanks,

David


On Mon, Apr 20, 2009 at 4:41 AM, Amit Kumar Verma cdac.a...@gmail.comwrote:


 Hi All,

 This is a sample function for making an object from string at run
 time. Here we are not casting the object but creating one. I wanted
 the same thing for casting the object.

 public static Object bindObject(Class className) {
Object objOutput = null;
try {
String sClassName = className.getPackage().getName().concat
 (.Wrap.concat(className.getSimpleName()));
objOutput = Class.forName(sClassName.replaceFirst
 (com.vtech, com.vtech.appxtension)).newInstance();
} catch (Exception e) {
try {
objOutput = Class.forName(className.getName
 ()).newInstance();
} catch (Exception e1) {
e1.printStackTrace();
}
}

return objOutput;
}


 Thanks to all for kind support..
 Amit Kumar Verma

 On Apr 18, 8:51 pm, Timothy Perrett timo...@getintheloop.eu wrote:
  So your talking about reflection right? Take a look at scala Manifests
  (which aide getting round type erasure) - other than that scala supports
 all
  the normal reflection tooling that Java does.
 
  Tim
 
  On 18/04/2009 06:56, Amit Kumar Verma cdac.a...@gmail.com wrote:
 
   Scala is a static language, so the class for casting must be known at
   compile time.  It's not possible to construct a String at runtime and
   cast
   an object into a class represented by that String. 
 
   But we use this feature in Java for casting the objects.

 



-- 
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: CRUDify and hidden fields?

2009-04-21 Thread Franz Bettag

awesome! thank you very much!

On 21 Apr., 22:29, David Pollak feeder.of.the.be...@gmail.com wrote:
 On Tue, Apr 21, 2009 at 11:50 AM, Franz Bettag i...@fbettag.de wrote:

  My old answer seems somehow to have gotten delayed, it was a problem
  with mvn scala:cc. mvn clean and mvn compile fixed that.

  Sorry for that.

  The effect is almost what i was looking for ;) i was looking for
  something like override def _toForm = Nil.. In the Listing the data
  should be display, but of course it shouldn't be possible to change it
  in the forms.

  Besides overriding (which didn't work that well), i tried def
  readOnly_? = true which had no effect

 I just added dbIncludeInForm_? If you set that to false, the field will be
 included in display, but not in input forms.





  On 21 Apr., 20:31, David Pollak feeder.of.the.be...@gmail.com wrote:
   On Tue, Apr 21, 2009 at 11:27 AM, Franz Bettag i...@fbettag.de wrote:

Idea 8 doesn't even list that in the Override List, in addition it
doesn't work.
Maybe it's because i use it in a trait?

   I don't think so.  Here's code that compiles just fine:

   class User extends MegaProtoUser[User] {
     def getSingleton = User // what's the meta server

     // define an additional field for a personal essay
     object textArea extends MappedTextarea(this, 2048) {
       override def textareaRows  = 10
       override def textareaCols = 50
       override def displayName = Personal Essay

     override def dbDisplay_? = false
     }

   }

import java.util.Date
import model._
import net.liftweb.mapper._

trait TimeStamped[OwnerType : Stamped[OwnerType]] {
 this: Stamped[OwnerType] =

 private val thisTyped = this.asInstanceOf[MapperType]

 object createdOn extends MappedDateTime(thisTyped) with
LifecycleCallbacks {
   override def beforeCreate = this(new Date)
   override def dbDisplay_? = false
 }
 object updatedOn extends MappedDateTime(thisTyped) with
LifecycleCallbacks {
   override def beforeCreate = this(new Date)
   override def beforeUpdate = this(new Date)
   override def dbDisplay_? = false
  }
}

On 21 Apr., 20:05, David Pollak feeder.of.the.be...@gmail.com wrote:
 Franz,
 In the createdOn field:

 object createdOn extends MappedLong(this) {
   override def dbDisplay_? = false

 }

 This will exclude the field from display.

 Does this help?

 Thanks,

 David

 On Mon, Apr 20, 2009 at 7:19 PM, Franz Bettag i...@fbettag.de
  wrote:

  Hey there,

  is there any way to hide fields (createdOn/createdBy...) from
  CRUDify?

  I was digging through the code since google didn't turn up anything
  useful for this topic, but i didn't find anything (may be the lack
  of
  my scala skill).

  best regards

  -franz

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

 --
 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: Mocking multiple models in a Snippet

2009-04-21 Thread erik.karls...@iki.fi

 No worries. If you don't mind, please share whatever you end up with on the
 list so that others can benefit :)

Sure! It is nothing fancy but here is what I did (some simple code to
show):

Snippet code:
...
class TeamSnippet {

  def list(html: NodeSeq):NodeSeq = {

val team = getTeamModel()
val user = getUserModel()

if (user.currentUser.isEmpty) {
  throw new Exception(Should be logged in to use
TeamSnippet.list)
}

val teams:List[Team] = team.findByUser(user.currentUser.open_!)

teams.flatMap(item =
  bind(team, html,
   name - span{item.name}/span))
  }

  protected def getTeamModel():MetaTeam = Team
  protected def getUserModel():MetaUser = User
}
...

and the specs unti test:

object myTeamSnippetTestObj extends Specification with Mockito
{
  TeamSnippet should {
return current user's teams if 'list' method is called in {

  val teamDbMock = mock[MetaTeam]
  val userDbMock = mock[MetaUser]

  val currentUser = new User()
  val t1 = new Team
  val t2 = new Team

  t1.name(TeamName1)
  t2.name(TeamName2)

  teamDbMock.findByUser(currentUser) returns List(t1, t2)
  userDbMock.currentUser returns Box(currentUser)

  val teamSnippet = new TeamSnippet() {
override protected def getTeamModel(): MetaTeam = teamDbMock
override protected def getUserModel(): MetaUser = userDbMock
  }

  val nodeSeq = tdteam:name//td

  val response = teamSnippet.list(nodeSeq)
  response must notBeNull
  val tds = response \\ td

  tds mustNotBe(Nil)

  tds.length mustBe 2
  tds(0).child(0).text must beEqualTo(TeamName1)
  tds(1).child(0).text must beEqualTo(TeamName2)
}
  }
}

The point is to create traits that wraps the model's functions and
then mock those interfaces. Basic stuff ;)

- Erik


 Derek

 On Sun, Apr 19, 2009 at 3:15 AM, erik.karls...@iki.fi 

 erik.b.karls...@gmail.com wrote:

  Hi,

  Thanks for the idea. Actually I probably just had a bad day when when
  I sent this question. I tried to create mocks for those object classes
  (ClassName.type) but naturally I should create mocks for the trait of
  those model classes.

  For E2E testing I have been thinking something similar that you
  proposed.

  Thanks for the help!

  - Erik

  On Apr 19, 8:59 am, Derek Chen-Becker dchenbec...@gmail.com wrote:
   That should be ...to determine how to set up...

   On Sat, Apr 18, 2009 at 11:59 PM, Derek Chen-Becker
   dchenbec...@gmail.comwrote:

Would using the run mode to determine to set up a Derby or HSQL DB for
  test
purposes in your Boot class work? Usually I use this method combined
  with
DBUnit to load test data.

Derek

On Fri, Apr 17, 2009 at 3:43 PM, erik.karls...@iki.fi 
erik.b.karls...@gmail.com wrote:

Hi,

I'm a little bit puzzled about the problem of mocking multiple models
in one class.  My problem is following:

I have a snippet that uses two models. To be able to test the snippet
I would need to create Mock objects for both of those models and
especially for the object part of the model (to able to mock those
find, create etc. methods).

Now I'm wondering how to actually do that in liftscala.  I think my
brain is still thinking too much in C++/Java because my old ways
didn't really work :)

Thanks beforehand for any help!

- Erik

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



[Lift] Re: Why can eclipse never find: org.mortbay.jetty.webapp.WebAppContext

2009-04-21 Thread Timothy Perrett

Just pushed this change - archetypes now work seamlessly.

Cheers, Tim

On Apr 21, 9:30 pm, David Pollak feeder.of.the.be...@gmail.com
wrote:
 Please make it so.

--~--~-~--~~~---~--~~
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: CRUDify and hidden fields?

2009-04-21 Thread David Pollak
On Tue, Apr 21, 2009 at 2:04 PM, Franz Bettag i...@fbettag.de wrote:


 One last stupid rookie question.. i've checked out lift from github,
 ran mvn compile (which showed success on everything), now i am kinda
 stuck. what's the best practice to get rolling from here?


You don't need to do that.

Maven will download the latest from the scala-tools.org repository (if you
build your project with mvn -U Maven will always look to update the JAR
files)

You don't need the Lift sources.

If you want to look through/change the Lift source, when you do an mvn clean
install, Maven puts the JAR files that you built in your local Maven
repsitory and those become the most up to date.



 



-- 
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] scalar queries in Lift/JPA

2009-04-21 Thread Charles F. Munat

Anyone have a quick example of how to run a scalar query in JPA? I can't 
find anything in the JPA demo.

I have this query:

select t.answer, count(distinct answer) from Vote t where t.poll = :poll 
order by t.answer

but how do I call it? I normally do:

Model.createNamedQuery[...](findVoteCountAnswersByPoll, poll - 
poll).findAll

But what is the type? And how do I get the results back out?

I know I did this once before somewhere, but I can't remember where and 
I can't find it.

Thanks!

Chas.

--~--~-~--~~~---~--~~
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: CRUDify and hidden fields?

2009-04-21 Thread Franz Bettag

I've done it myself! ;)

Just for reference, i modified pom.xml and ran mvn deploy. now i am
running my own maven2 repository for that purpose.

On 21 Apr., 23:04, Franz Bettag i...@fbettag.de wrote:
 One last stupid rookie question.. i've checked out lift from github,
 ran mvn compile (which showed success on everything), now i am kinda
 stuck. what's the best practice to get rolling from here?
--~--~-~--~~~---~--~~
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: ajax form that submits multiple values?

2009-04-21 Thread ivan

Hi and thanks!

That helps and now the form is submitted and the function
'processEntryAdd' is called. But I would like to have something like:

 submit2 - SHtml.ajaxButton(Add user - 2, () = {
processEntryAdd
SetHtml(userList, lift:embed what=listaKorisnika/) 
DisplayMessage(message1, spanDodan korisnik/span, 3
seconds, 2 seconds)
}

I would like to have a part of the page rerendered (SetHtml and
DisplayMessage) but that piece of code doesn't work.

I must say that I like lift, but coming from a JSF background some
things seam harder to do at least until i have working code (than it
looks easier and cleaner) but getting to that point is sometimes a bit
hard :)

Is this with ajax forms a known bug? Is there some more info on it?
Plans to work on fixing it, I might try fixing it myself if pointed in
the right direction.

Thanks again for helping. :)

On Apr 21, 8:47 pm, David Pollak feeder.of.the.be...@gmail.com
wrote:
 Howdy,
 This is a bug in how Ajax forms are submitted (it's a browser-level bug.)

 The submit button is not serialized as part of the thing that's sent to the
 server.

 I'd suggest the following:

  submit - SHtml.hidden(Add user, processEntryAdd) ++ input
 type=submit value=Add User/

 Thanks,

 David


--~--~-~--~~~---~--~~
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: developing Scala/Lift using Eclipse

2009-04-21 Thread Kai M.

sorry for taking over this thread again...
I tried NetBeans and it does not work any better. No JavaDocs, no
Sources, nothing. I tried to download all sources/javadocs menu-
item, etc about a dozen times..
I even got maven to work via runProject but of course there seems no
way to enable jvm-debugging via netbeans.

Just 5 minutes ago I found this mvn eclipse:eclipse -DdownloadSources
-DdownloadJavadocs=true command,
which does not work either:
import _root_.net.liftweb.util._
import _root_.net.liftweb.http._
import _root_.net.liftweb.sitemap._
import _root_.net.liftweb.sitemap.Loc._
are all broken...

PLEASE, is there any full description on how-to-configure-eclipse to
get
- full lift+scala sources
- full javadoc
- use the latest RC1 scala release
- some simple maven-automation

i am really willing to learn scala+lift but currently it's really
plain PITA.
I never needed several days to set up a new development environment,
thats kind of frustrating...

thanks a lot for your effort,
kai

--~--~-~--~~~---~--~~
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: scalar queries in Lift/JPA

2009-04-21 Thread Derek Chen-Becker
I think that the type would be Array[Any] and you'll get one String and Int
for each row.

Derek

On Tue, Apr 21, 2009 at 3:37 PM, Charles F. Munat c...@munat.com wrote:


 Anyone have a quick example of how to run a scalar query in JPA? I can't
 find anything in the JPA demo.

 I have this query:

 select t.answer, count(distinct answer) from Vote t where t.poll = :poll
 order by t.answer

 but how do I call it? I normally do:

 Model.createNamedQuery[...](findVoteCountAnswersByPoll, poll -
 poll).findAll

 But what is the type? And how do I get the results back out?

 I know I did this once before somewhere, but I can't remember where and
 I can't find it.

 Thanks!

 Chas.

 


--~--~-~--~~~---~--~~
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: Can't get applications to run in Jetty

2009-04-21 Thread Julian Howarth

On Apr 21, 6:41 pm, David Pollak feeder.of.the.be...@gmail.com
wrote:
 It looks like you were editing some of the files with Eclipse which uses a
 different version of Scala than does Lift.  

I haven't edited any of the files - all I've run are the 2 maven
commands from an initially empty directory

 If you try mvn clean jetty:run
 on your Mac, all should be good.

Same result as before I'm afraid:

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

[INFO] Building helloworld
[INFO]task-segment: [clean, jetty:run]
[INFO]

[INFO] [clean:clean]
[INFO] Deleting directory /Users/julian/NetBeansProjects/lifttest/
helloworld/target
[INFO] Preparing jetty:run
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[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 2 source files to /Users/julian/NetBeansProjects/
lifttest/helloworld/target/classes
[WARNING] Exception in thread main java.lang.ClassFormatError:
Unknown constant tag 84 in class file scala/tools/nsc/transform/
TypingTransformers$TypingTransformer
[WARNING]   at java.lang.ClassLoader.defineClass1(Native Method)
[WARNING]   at java.lang.ClassLoader.defineClass(ClassLoader.java:675)
[WARNING]   at java.security.SecureClassLoader.defineClass
(SecureClassLoader.java:124)
[WARNING]   at java.net.URLClassLoader.defineClass(URLClassLoader.java:
260)
[WARNING]   at java.net.URLClassLoader.access$000(URLClassLoader.java:
56)
[WARNING]   at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
[WARNING]   at java.security.AccessController.doPrivileged(Native
Method)
[WARNING]   at java.net.URLClassLoader.findClass(URLClassLoader.java:
188)
[WARNING]   at java.lang.ClassLoader.loadClass(ClassLoader.java:316)
[WARNING]   at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:
288)
[WARNING]   at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
[WARNING]   at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:
374)
[WARNING]   at java.lang.ClassLoader.defineClass1(Native Method)
[WARNING]   at java.lang.ClassLoader.defineClass(ClassLoader.java:675)
[WARNING]   at java.security.SecureClassLoader.defineClass
(SecureClassLoader.java:124)
[WARNING]   at java.net.URLClassLoader.defineClass(URLClassLoader.java:
260)
[WARNING]   at java.net.URLClassLoader.access$000(URLClassLoader.java:
56)
[WARNING]   at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
[WARNING]   at java.security.AccessController.doPrivileged(Native
Method)
[WARNING]   at java.net.URLClassLoader.findClass(URLClassLoader.java:
188)
[WARNING]   at java.lang.ClassLoader.loadClass(ClassLoader.java:316)
[WARNING]   at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:
288)
[WARNING]   at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
[WARNING]   at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:
374)
[WARNING]   at scala.tools.nsc.Global.superAccessors(Global.scala:287)
[WARNING]   at scala.tools.nsc.Global.builtInPhaseDescriptors
(Global.scala:403)
[WARNING]   at scala.tools.nsc.plugins.Plugins
$class.computePhaseDescriptors(Plugins.scala:154)
[WARNING]   at scala.tools.nsc.Global.computePhaseDescriptors
(Global.scala:34)
[WARNING]   at scala.tools.nsc.Global.phaseDescriptors(Global.scala:
442)
[WARNING]   at scala.tools.nsc.Global$Run.init(Global.scala:490)
[WARNING]   at scala.tools.nsc.Main$.process(Main.scala:72)
[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: 6 seconds
[INFO] Finished at: Tue Apr 21 23:09:46 BST 2009
[INFO] Final Memory: 22M/53M
[INFO]




 On Tue, Apr 21, 2009 at 8:08 AM, Julian Howarth howar...@freenet.co.ukwrote:



  I've switched to my Linux box with maven 2.1.0 and Java 1.6.0_13,
  followed the same steps and it all works as intended. So whatever is
  wrong is something to do with the particular setup on my mac.

  Julian

  On Apr 21, 2:45 pm, 

[Lift] Re: Can't get applications to run in Jetty

2009-04-21 Thread David Pollak
One final thing... try:

rm -rf ~/.m2/repositories

There may be a corrupted JAR file in your Maven repository.

On Tue, Apr 21, 2009 at 3:13 PM, Julian Howarth howar...@freenet.co.ukwrote:


 On Apr 21, 6:41 pm, David Pollak feeder.of.the.be...@gmail.com
 wrote:
  It looks like you were editing some of the files with Eclipse which uses
 a
  different version of Scala than does Lift.

 I haven't edited any of the files - all I've run are the 2 maven
 commands from an initially empty directory

  If you try mvn clean jetty:run
  on your Mac, all should be good.

 Same result as before I'm afraid:

  mvn clean jetty:run
 [INFO] Scanning for projects...
 [INFO] Searching repository for plugin with prefix: 'jetty'.
 [INFO]
 
 [INFO] Building helloworld
 [INFO]task-segment: [clean, jetty:run]
 [INFO]
 
 [INFO] [clean:clean]
 [INFO] Deleting directory /Users/julian/NetBeansProjects/lifttest/
 helloworld/target
 [INFO] Preparing jetty:run
 [INFO] [resources:resources]
 [INFO] Using default encoding to copy filtered resources.
 [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 2 source files to /Users/julian/NetBeansProjects/
 lifttest/helloworld/target/classes
 [WARNING] Exception in thread main java.lang.ClassFormatError:
 Unknown constant tag 84 in class file scala/tools/nsc/transform/
 TypingTransformers$TypingTransformer
 [WARNING]   at java.lang.ClassLoader.defineClass1(Native Method)
 [WARNING]   at java.lang.ClassLoader.defineClass(ClassLoader.java:675)
 [WARNING]   at java.security.SecureClassLoader.defineClass
 (SecureClassLoader.java:124)
 [WARNING]   at java.net.URLClassLoader.defineClass(URLClassLoader.java:
 260)
 [WARNING]   at java.net.URLClassLoader.access$000(URLClassLoader.java:
 56)
 [WARNING]   at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
 [WARNING]   at java.security.AccessController.doPrivileged(Native
 Method)
 [WARNING]   at java.net.URLClassLoader.findClass(URLClassLoader.java:
 188)
 [WARNING]   at java.lang.ClassLoader.loadClass(ClassLoader.java:316)
 [WARNING]   at
 sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:
 288)
 [WARNING]   at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
 [WARNING]   at
 java.lang.ClassLoader.loadClassInternal(ClassLoader.java:
 374)
 [WARNING]   at java.lang.ClassLoader.defineClass1(Native Method)
 [WARNING]   at java.lang.ClassLoader.defineClass(ClassLoader.java:675)
 [WARNING]   at java.security.SecureClassLoader.defineClass
 (SecureClassLoader.java:124)
 [WARNING]   at java.net.URLClassLoader.defineClass(URLClassLoader.java:
 260)
 [WARNING]   at java.net.URLClassLoader.access$000(URLClassLoader.java:
 56)
 [WARNING]   at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
 [WARNING]   at java.security.AccessController.doPrivileged(Native
 Method)
 [WARNING]   at java.net.URLClassLoader.findClass(URLClassLoader.java:
 188)
 [WARNING]   at java.lang.ClassLoader.loadClass(ClassLoader.java:316)
 [WARNING]   at
 sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:
 288)
 [WARNING]   at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
 [WARNING]   at
 java.lang.ClassLoader.loadClassInternal(ClassLoader.java:
 374)
 [WARNING]   at scala.tools.nsc.Global.superAccessors(Global.scala:287)
 [WARNING]   at scala.tools.nsc.Global.builtInPhaseDescriptors
 (Global.scala:403)
 [WARNING]   at scala.tools.nsc.plugins.Plugins
 $class.computePhaseDescriptors(Plugins.scala:154)
 [WARNING]   at scala.tools.nsc.Global.computePhaseDescriptors
 (Global.scala:34)
 [WARNING]   at scala.tools.nsc.Global.phaseDescriptors(Global.scala:
 442)
 [WARNING]   at scala.tools.nsc.Global$Run.init(Global.scala:490)
 [WARNING]   at scala.tools.nsc.Main$.process(Main.scala:72)
 [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: 6 seconds
 [INFO] Finished at: Tue Apr 21 23:09:46 BST 2009
 [INFO] Final Memory: 22M/53M
 [INFO]
 


 
  On Tue, Apr 21, 

[Lift] Lift and Bespin... a new way to develop web apps...

2009-04-21 Thread David Pollak
Folks,

I spent an hour with Dion Almaer http://almaer.com/blog/ yesterday.  Dion
is one of the guys behind Bespin https://bespin.mozilla.com/.

Dion and I blocked out how Lift, when running in developer mode, could
expose data via JSON giving Bespin information about the Lift app and
read/write capabilities on the Lift app source files.  Combined with the
scala:cc Maven command and JavaRebel, we can get code updated without a full
build cycle.  Further, I've got some ideas about how to dynamically bind
JSON requests that should intersect nicely with the dynamic nature of
things.

The Bespin folks are working on a GUI builder called Thunderclap.  Dion and
I want to make it so that building GUI apps with Bespin and Lift is as
simple as wiring up applications in OS X's Interface Builder.  The initial
goal is to be able to build a chat application and then collaborate with
another developer on expanding the chat application while chatting with the
other developer in the already running chat application.

More news as it becomes available.

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
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: developing Scala/Lift using Eclipse

2009-04-21 Thread Derek Chen-Becker
I'll open a ticket in Trac for the errors I'm seeing. I'm actually getting a
different error now: Build compiler (scalac) crashed. I'm happy to open
tickets but I'm never sure if I'm duping :(. For what it's worth I'm getting
a similar error to what I was getting earlier in a project that is a simple
Maven project with no modules. I have the following code:

import _root_.java.sql._
import _root_.org.slf4j._

And the Maven Dependencies shows the slf4j jars, but I get the error that
slf4j is not a member of package org. If I do a Project-Clean... then the
error goes away but I still have a pink squiggly in the code.

Thanks,

Derek

On Tue, Apr 21, 2009 at 2:28 PM, Miles Sabin mi...@milessabin.com wrote:


 On Tue, Apr 21, 2009 at 9:10 PM, Derek Chen-Becker
 dchenbec...@gmail.com wrote:
  First off, I don't want to come off as whining. I know you've put some
  tremendous effort into this and it shows. The new version (I'm actually
  using 2.8.0_blahblah), especially the new JDT weaving makes things
 generally
  a pleasure. The weird part for me is that with nested modules it
 sometimes
  works flawlessly. Right now I fired up Eclipse and the nested module that
  yesterday showed 112 errors is completely clean. The other weird issue
 that
  I sometimes get is the unhandled event loop, where I'll type and
 suddenly
  the window stops responding to keyboard input. If I close the source file
  and reopen it then things work again.

 Unhandled event loop exceptions are an indication that something has
 gone badly wrong in the UI part of the Scala IDE. When that happens
 it'd help if you could check the Eclipse Error Log view and/or the
 main Eclipse log file and create a ticket on Trac for it.

  As for nested modules, I use them because then I can issue a single mvn
  install in the top-level project and it builds all 8-10 modules at once.
 In
  particular, Lift uses nested modules.

 OK, so then in the list of items for the Eclipse Tooling for Lift
 what we really need is support for Maven nested modules? Or is this
 something which should have generic Maven support?

 Cheers,


 Miles

 --
 Miles Sabin
 tel: +44 (0)7813 944 528
 skype:  milessabin
 http://twitter.com/milessabin

 


--~--~-~--~~~---~--~~
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: developing Scala/Lift using Eclipse

2009-04-21 Thread Miles Sabin

On Wed, Apr 22, 2009 at 12:31 AM, Derek Chen-Becker
dchenbec...@gmail.com wrote:
 I'll open a ticket in Trac for the errors I'm seeing. I'm actually getting a
 different error now: Build compiler (scalac) crashed.

That would typically (tho' not invariably) suggest a scalac bug which
can be reproduced on the command line rather than an Eclipse problem.
Do you get a successful command line build?

Cheers,


Miles

-- 
Miles Sabin
tel: +44 (0)7813 944 528
skype:  milessabin
http://twitter.com/milessabin

--~--~-~--~~~---~--~~
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: scalar queries in Lift/JPA

2009-04-21 Thread Charles F. Munat

I was thinking tuples, but that didn't work. I'll try your suggestion. 
BTW, for anyone reading along, I forgot the group by clause in the query 
below.

Chas.

Derek Chen-Becker wrote:
 I think that the type would be Array[Any] and you'll get one String and 
 Int for each row.
 
 Derek
 
 On Tue, Apr 21, 2009 at 3:37 PM, Charles F. Munat c...@munat.com 
 mailto:c...@munat.com wrote:
 
 
 Anyone have a quick example of how to run a scalar query in JPA? I can't
 find anything in the JPA demo.
 
 I have this query:
 
 select t.answer, count(distinct answer) from Vote t where t.poll = :poll
 order by t.answer
 
 but how do I call it? I normally do:
 
 Model.createNamedQuery[...](findVoteCountAnswersByPoll, poll -
 poll).findAll
 
 But what is the type? And how do I get the results back out?
 
 I know I did this once before somewhere, but I can't remember where and
 I can't find it.
 
 Thanks!
 
 Chas.
 
 
 
 
  

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



[Lift] Re: Lift and Bespin... a new way to develop web apps...

2009-04-21 Thread TylerWeir

o m g.

This is going to be sick!

On Apr 21, 7:07 pm, David Pollak feeder.of.the.be...@gmail.com
wrote:
 Folks,

 I spent an hour with Dion Almaer http://almaer.com/blog/ yesterday.  Dion
 is one of the guys behind Bespin https://bespin.mozilla.com/.

 Dion and I blocked out how Lift, when running in developer mode, could
 expose data via JSON giving Bespin information about the Lift app and
 read/write capabilities on the Lift app source files.  Combined with the
 scala:cc Maven command and JavaRebel, we can get code updated without a full
 build cycle.  Further, I've got some ideas about how to dynamically bind
 JSON requests that should intersect nicely with the dynamic nature of
 things.

 The Bespin folks are working on a GUI builder called Thunderclap.  Dion and
 I want to make it so that building GUI apps with Bespin and Lift is as
 simple as wiring up applications in OS X's Interface Builder.  The initial
 goal is to be able to build a chat application and then collaborate with
 another developer on expanding the chat application while chatting with the
 other developer in the already running chat application.

 More news as it becomes available.

 Thanks,

 David

 --
 Lift, the simply functional web frameworkhttp://liftweb.net
 Beginning Scalahttp://www.apress.com/book/view/1430219890
 Follow me:http://twitter.com/dpp
 Git some:http://github.com/dpp
--~--~-~--~~~---~--~~
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: developing Scala/Lift using Eclipse

2009-04-21 Thread Derek Chen-Becker
Generally, yes, but I'll confirm the next time I get the error.

Thanks,

Derek

On Tue, Apr 21, 2009 at 5:35 PM, Miles Sabin mi...@milessabin.com wrote:


 On Wed, Apr 22, 2009 at 12:31 AM, Derek Chen-Becker
 dchenbec...@gmail.com wrote:
  I'll open a ticket in Trac for the errors I'm seeing. I'm actually
 getting a
  different error now: Build compiler (scalac) crashed.

 That would typically (tho' not invariably) suggest a scalac bug which
 can be reproduced on the command line rather than an Eclipse problem.
 Do you get a successful command line build?

 Cheers,


 Miles

 --
 Miles Sabin
 tel: +44 (0)7813 944 528
 skype:  milessabin
 http://twitter.com/milessabin

 


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



[Lift] Re: Lift and Bespin... a new way to develop web apps...

2009-04-21 Thread Warren Henning

On Tue, Apr 21, 2009 at 4:07 PM, David Pollak
feeder.of.the.be...@gmail.com wrote:
 and then collaborate with
 another developer on expanding the chat application while chatting with the
 other developer in the already running chat application.

That would be so god damn awesome.

Is Bespin something else that other enlightened frameworks could
integrate with, as well?

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



[Lift] Re: Lift and Bespin... a new way to develop web apps...

2009-04-21 Thread Peter Bliznak
now this looks impressive!
can't wait.





From: David Pollak feeder.of.the.be...@gmail.com
To: liftweb liftweb@googlegroups.com
Sent: Tuesday, April 21, 2009 7:07:24 PM
Subject: [Lift] Lift and Bespin... a new way to develop web apps...

Folks,

I spent an hour with Dion Almaer yesterday.  Dion is one of the guys behind 
Bespin.

Dion and I blocked out how Lift, when running in developer mode, could expose 
data via JSON giving Bespin information about the Lift app and read/write 
capabilities on the Lift app source files.  Combined with the scala:cc Maven 
command and JavaRebel, we can get code updated without a full build cycle.  
Further, I've got some ideas about how to dynamically bind JSON requests that 
should intersect nicely with the dynamic nature of things.

The Bespin folks are working on a GUI builder called Thunderclap.  Dion and I 
want to make it so that building GUI apps with Bespin and Lift is as simple as 
wiring up applications in OS X's Interface Builder.  The initial goal is to be 
able to build a chat application and then collaborate with another developer on 
expanding the chat application while chatting with the other developer in the 
already running chat application.

More news as it becomes available.

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
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] Binding Radio Button

2009-04-21 Thread sailormoo...@gmail.com

Hello:

var sex = M
val sex_map = Map(Male-M, Female-F)

bind(entry, xhtml,
  sex   - SHtml.radio(sex_map.keys.toList, Empty,
sex = _),
)

I don't know why I would get an exception like this:
Thanks for the help

[WARNING] D:\\snippet\UserEntryController.scala:52: error:
overloaded method value bind with alternatives
(String,net.liftweb.util.Box[(scala.xml.NodeSeq) =
scala.xml.NodeSeq],net.liftweb.util.Box[(scala.xml.PrefixedAttribute)
=
scala.xml.MetaData],scala.xml.NodeSeq,net.liftweb.util.Helpers.BindParam*)
scala.xml.NodeSeq and
(String,scala.xml.NodeSeq,net.liftweb.util.Helpers.BindParam*)
scala.xml.NodeSeq cannot be applied to
java.lang.String,scala.xml.Group,net.liftweb.util.Helpers.TheBindParam,net.liftweb.util.Helpers.TheBindParam,net.liftweb.util.Helpers.TheBindParam,net.liftweb.util.Helpers.TheBindParam,net.liftweb.util.Helpers.TheBindParam,net.liftweb.util.Helpers.TheBindParam,
(String, net.liftweb.http.SHtml.ChoiceHolder
[String]),net.liftweb.util.Helpers.TheBindParam)
[WARNING] bind(entry, xhtml,
[WARNING] ^
[WARNING] one error found

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