[Lift] Re: Confirming guesses on Mapper

2008-12-04 Thread David Pollak
On Thu, Dec 4, 2008 at 2:41 PM, Derek Chen-Becker <[EMAIL PROTECTED]>wrote:

> OK, I see them now. I'm writing up a little section on sharding and these
> methods feel like they're not quite what I would want to use. Specifically,
> they're using different criteria for insert and retrieval, which makes it
> seem like things would get lost.  In the example posting I referenced
> earlier, you use the first character of the email address for insert but
> then the primary key for retrieval. It seems like you would want to use the
> email address for retrieval as well. Is there some magic going on in the
> code that I'm missing? If not, then perhaps we need to morph this into a
> trait on the field and use a MetaMapper def that points to that field as the
> connection arbiter. Maybe something like:
>
> trait ShardSelector[T, O <: Mapper[O]] extends MappedField[T,O] {
>   def selectConnection : PartialFunction[T,ConnectionIdentifier]
>
>   def connection = selectConnection(this.is)
> }
>
> And in Mapper:
>
> val shardField : Can[ShardSelector] = Empty
>
> Along with some appropriate hooks into the current code.
>
> Then you could do
>
> class MyUser extends Mapper[MyUser] {
>   object name extends MappedString(this) with ShardSelector {
> def selectConnection  = {
>   case n if n.charAt(0) < 'n' => dbAtoMConn
>   case _ => dbNtoZConn
> }
>   }
>
>   override val shardField = Full(name)
> }
>
> Thoughts?


All of the MetaMapper's find methods have corresponding findDBxxx
methods which accept a ConnectionIdentifier parameter.

class MyUser extends Mapper[MyUser] {
  object name extends MappedString(this)
  override def dbCalculateConnectionIdentifier = {
 case me => me.name.is match {
 case n if n.charAt(0) < 'n' => dbAtoMConn
  case _ => dbNtoZConn
 }
  }

Is how the shard should be selected.


>
>
> Derek
>
>
> On Thu, Dec 4, 2008 at 4:17 PM, David Pollak <
> [EMAIL PROTECTED]> wrote:
>
>>
>>
>> On Thu, Dec 4, 2008 at 2:05 PM, Derek Chen-Becker <[EMAIL PROTECTED]>wrote:
>>
>>> OK, one last question for today before I start hacking at the text: You
>>> mention some methods here for multiple databases with a single entity:
>>
>>
>> On KeyedMetaMapper, override:
>>  def dbSelectDBConnectionForFind: PartialFunction[Type,
>> ConnectionIdentifier] = Map.empty
>>
>> The ConnectionIdentifier defines which RDBMS to perform the query on.
>>
>> Also, on Mapper:
>>   def dbCalculateConnectionIdentifier: PartialFunction[A,
>> ConnectionIdentifier] = Map.empty
>>
>>
>>
>>
>>>
>>>
>>> http://groups.google.com/group/liftweb/msg/76c965c189a85103?pli=1
>>>
>>> But looking in the code I can't find those methods. Are they essentially
>>> gone now? You also mentioned something better than sharding but I haven't
>>> seen anything on the list (maybe I missed it).
>>>
>>> Thanks,
>>>
>>> Derek
>>>
>>>
>>> On Thu, Dec 4, 2008 at 4:01 PM, Derek Chen-Becker <[EMAIL PROTECTED]
>>> > wrote:
>>>
 Cool. I guess I'm editing my chapter this afternoon now :)


 On Thu, Dec 4, 2008 at 3:40 PM, David Pollak <
 [EMAIL PROTECTED]> wrote:

>
>
> On Thu, Dec 4, 2008 at 7:33 AM, Derek Chen-Becker <
> [EMAIL PROTECTED]> wrote:
>
>> I'm mostly done with the rough draft of our Record/Mapper chapter and
>> I wanted to clarify a few points to make sure that my reading of the docs
>> and code is accurate:
>>
>>1. ByRef appears to me to essentially be an old-style join (using
>>the where clause instead of join syntax). Is that accurate? Are there 
>> other
>>use cases?
>>
>>
> This allows you to compare two columns in the same row.  Because mapper
> does not allow for explicit joins or queries against more than one table 
> at
> once (with the exception of the In construct), there's no "old style join"
> stuff.
>
> I've also changed the Join() QueryParam to PreCache... which is more
> descriptive of what it does.
>
>
>>
>>1.
>>2. It looks like the only way to get distinct results would be to
>>use the findAllByPreparedStatement or findAllByInsecureSql methods. 
>> Is there
>>some other way to do this that I'm missing?
>>
>> Or perhaps the Distrinct() QueryParam I just added. :-)
>
>
>>
>>1.
>>2. The toForm method in Mapper has an overload that takes a
>>redoSnippet. What is the use case for this?
>>
>> So you can keep the current state around over the course of multiple
> form submissions when the validation fails.
>
>>
>>1. Will it be supported in Record or has that functionality been
>>folded into something else?
>>
>> I hope it will make it into Record/Field.
>
>>
>>1.
>>2. It appears that the functionality of the buildSet... methods in
>>MappedField has effectievly been replaced by the setFromAny in Field. 
>> Is
>>th

[Lift] Snapshot documentation not current any more

2008-12-04 Thread Joachim A.

Hi,
I use the generated API documentation almost every day - thanks a lot for 
that!

The documentation (http://scala-tools.org/mvnsites-snapshots/liftweb/lift-
webkit/scaladocs/index.html) used to be updated from trunk (I think :). The 
current pages are not current, newly added things like SHtml.autocomplet and 
the  Join/Prefect are missing. 

Would be great to have documentation updated from trunk again :)

Regards,
Joachim


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Confirming guesses on Mapper

2008-12-04 Thread Derek Chen-Becker
Sorry, I forgot to mention that this would have to hook into the QueryParams
code as well. I don't know if it could be made type safe in the sense that
omitting the shard field in the params would throw a compile error, but at
least the selection would be uniform.

Derek

On Thu, Dec 4, 2008 at 4:41 PM, Derek Chen-Becker <[EMAIL PROTECTED]>wrote:

> OK, I see them now. I'm writing up a little section on sharding and these
> methods feel like they're not quite what I would want to use. Specifically,
> they're using different criteria for insert and retrieval, which makes it
> seem like things would get lost.  In the example posting I referenced
> earlier, you use the first character of the email address for insert but
> then the primary key for retrieval. It seems like you would want to use the
> email address for retrieval as well. Is there some magic going on in the
> code that I'm missing? If not, then perhaps we need to morph this into a
> trait on the field and use a MetaMapper def that points to that field as the
> connection arbiter. Maybe something like:
>
> trait ShardSelector[T, O <: Mapper[O]] extends MappedField[T,O] {
>   def selectConnection : PartialFunction[T,ConnectionIdentifier]
>
>   def connection = selectConnection(this.is)
> }
>
> And in Mapper:
>
> val shardField : Can[ShardSelector] = Empty
>
> Along with some appropriate hooks into the current code.
>
> Then you could do
>
> class MyUser extends Mapper[MyUser] {
>   object name extends MappedString(this) with ShardSelector {
> def selectConnection  = {
>   case n if n.charAt(0) < 'n' => dbAtoMConn
>   case _ => dbNtoZConn
> }
>   }
>
>   override val shardField = Full(name)
> }
>
> Thoughts?
>
> Derek
>
>
> On Thu, Dec 4, 2008 at 4:17 PM, David Pollak <
> [EMAIL PROTECTED]> wrote:
>
>>
>>
>> On Thu, Dec 4, 2008 at 2:05 PM, Derek Chen-Becker <[EMAIL PROTECTED]>wrote:
>>
>>> OK, one last question for today before I start hacking at the text: You
>>> mention some methods here for multiple databases with a single entity:
>>
>>
>> On KeyedMetaMapper, override:
>>  def dbSelectDBConnectionForFind: PartialFunction[Type,
>> ConnectionIdentifier] = Map.empty
>>
>> The ConnectionIdentifier defines which RDBMS to perform the query on.
>>
>> Also, on Mapper:
>>   def dbCalculateConnectionIdentifier: PartialFunction[A,
>> ConnectionIdentifier] = Map.empty
>>
>>
>>
>>
>>>
>>>
>>> http://groups.google.com/group/liftweb/msg/76c965c189a85103?pli=1
>>>
>>> But looking in the code I can't find those methods. Are they essentially
>>> gone now? You also mentioned something better than sharding but I haven't
>>> seen anything on the list (maybe I missed it).
>>>
>>> Thanks,
>>>
>>> Derek
>>>
>>>
>>> On Thu, Dec 4, 2008 at 4:01 PM, Derek Chen-Becker <[EMAIL PROTECTED]
>>> > wrote:
>>>
 Cool. I guess I'm editing my chapter this afternoon now :)


 On Thu, Dec 4, 2008 at 3:40 PM, David Pollak <
 [EMAIL PROTECTED]> wrote:

>
>
> On Thu, Dec 4, 2008 at 7:33 AM, Derek Chen-Becker <
> [EMAIL PROTECTED]> wrote:
>
>> I'm mostly done with the rough draft of our Record/Mapper chapter and
>> I wanted to clarify a few points to make sure that my reading of the docs
>> and code is accurate:
>>
>>1. ByRef appears to me to essentially be an old-style join (using
>>the where clause instead of join syntax). Is that accurate? Are there 
>> other
>>use cases?
>>
>>
> This allows you to compare two columns in the same row.  Because mapper
> does not allow for explicit joins or queries against more than one table 
> at
> once (with the exception of the In construct), there's no "old style join"
> stuff.
>
> I've also changed the Join() QueryParam to PreCache... which is more
> descriptive of what it does.
>
>
>>
>>1.
>>2. It looks like the only way to get distinct results would be to
>>use the findAllByPreparedStatement or findAllByInsecureSql methods. 
>> Is there
>>some other way to do this that I'm missing?
>>
>> Or perhaps the Distrinct() QueryParam I just added. :-)
>
>
>>
>>1.
>>2. The toForm method in Mapper has an overload that takes a
>>redoSnippet. What is the use case for this?
>>
>> So you can keep the current state around over the course of multiple
> form submissions when the validation fails.
>
>>
>>1. Will it be supported in Record or has that functionality been
>>folded into something else?
>>
>> I hope it will make it into Record/Field.
>
>>
>>1.
>>2. It appears that the functionality of the buildSet... methods in
>>MappedField has effectievly been replaced by the setFromAny in Field. 
>> Is
>>this the case, or will those buildSet functions show back up in some
>>subclass of field (it seems like there was a lot of overlap there)
>>>

[Lift] Re: Confirming guesses on Mapper

2008-12-04 Thread Derek Chen-Becker
OK, I see them now. I'm writing up a little section on sharding and these
methods feel like they're not quite what I would want to use. Specifically,
they're using different criteria for insert and retrieval, which makes it
seem like things would get lost.  In the example posting I referenced
earlier, you use the first character of the email address for insert but
then the primary key for retrieval. It seems like you would want to use the
email address for retrieval as well. Is there some magic going on in the
code that I'm missing? If not, then perhaps we need to morph this into a
trait on the field and use a MetaMapper def that points to that field as the
connection arbiter. Maybe something like:

trait ShardSelector[T, O <: Mapper[O]] extends MappedField[T,O] {
  def selectConnection : PartialFunction[T,ConnectionIdentifier]

  def connection = selectConnection(this.is)
}

And in Mapper:

val shardField : Can[ShardSelector] = Empty

Along with some appropriate hooks into the current code.

Then you could do

class MyUser extends Mapper[MyUser] {
  object name extends MappedString(this) with ShardSelector {
def selectConnection  = {
  case n if n.charAt(0) < 'n' => dbAtoMConn
  case _ => dbNtoZConn
}
  }

  override val shardField = Full(name)
}

Thoughts?

Derek

On Thu, Dec 4, 2008 at 4:17 PM, David Pollak
<[EMAIL PROTECTED]>wrote:

>
>
> On Thu, Dec 4, 2008 at 2:05 PM, Derek Chen-Becker <[EMAIL PROTECTED]>wrote:
>
>> OK, one last question for today before I start hacking at the text: You
>> mention some methods here for multiple databases with a single entity:
>
>
> On KeyedMetaMapper, override:
>  def dbSelectDBConnectionForFind: PartialFunction[Type,
> ConnectionIdentifier] = Map.empty
>
> The ConnectionIdentifier defines which RDBMS to perform the query on.
>
> Also, on Mapper:
>   def dbCalculateConnectionIdentifier: PartialFunction[A,
> ConnectionIdentifier] = Map.empty
>
>
>
>
>>
>>
>> http://groups.google.com/group/liftweb/msg/76c965c189a85103?pli=1
>>
>> But looking in the code I can't find those methods. Are they essentially
>> gone now? You also mentioned something better than sharding but I haven't
>> seen anything on the list (maybe I missed it).
>>
>> Thanks,
>>
>> Derek
>>
>>
>> On Thu, Dec 4, 2008 at 4:01 PM, Derek Chen-Becker <[EMAIL PROTECTED]>wrote:
>>
>>> Cool. I guess I'm editing my chapter this afternoon now :)
>>>
>>>
>>> On Thu, Dec 4, 2008 at 3:40 PM, David Pollak <
>>> [EMAIL PROTECTED]> wrote:
>>>


 On Thu, Dec 4, 2008 at 7:33 AM, Derek Chen-Becker <
 [EMAIL PROTECTED]> wrote:

> I'm mostly done with the rough draft of our Record/Mapper chapter and I
> wanted to clarify a few points to make sure that my reading of the docs 
> and
> code is accurate:
>
>1. ByRef appears to me to essentially be an old-style join (using
>the where clause instead of join syntax). Is that accurate? Are there 
> other
>use cases?
>
>
 This allows you to compare two columns in the same row.  Because mapper
 does not allow for explicit joins or queries against more than one table at
 once (with the exception of the In construct), there's no "old style join"
 stuff.

 I've also changed the Join() QueryParam to PreCache... which is more
 descriptive of what it does.


>
>1.
>2. It looks like the only way to get distinct results would be to
>use the findAllByPreparedStatement or findAllByInsecureSql methods. Is 
> there
>some other way to do this that I'm missing?
>
> Or perhaps the Distrinct() QueryParam I just added. :-)


>
>1.
>2. The toForm method in Mapper has an overload that takes a
>redoSnippet. What is the use case for this?
>
> So you can keep the current state around over the course of multiple
 form submissions when the validation fails.

>
>1. Will it be supported in Record or has that functionality been
>folded into something else?
>
> I hope it will make it into Record/Field.

>
>1.
>2. It appears that the functionality of the buildSet... methods in
>MappedField has effectievly been replaced by the setFromAny in Field. 
> Is
>this the case, or will those buildSet functions show back up in some
>subclass of field (it seems like there was a lot of overlap there)
>
> buildSet is JDBC specific and radically improves performance in
 converting a JDBC column to something that can be put into a field.

>
>1.
>2. Am I reading correctly that Record no longer retains the orginal
>value of a field when it's changed, but rather just flags the field as
>dirty? (there are no is/was methods on Field)
>
> Probably... but there will be is/was on Field.  It's a very helpful
 construct.

>
>1.
>
> These last two make

[Lift] Re: Confirming guesses on Mapper

2008-12-04 Thread David Pollak
On Thu, Dec 4, 2008 at 2:05 PM, Derek Chen-Becker <[EMAIL PROTECTED]>wrote:

> OK, one last question for today before I start hacking at the text: You
> mention some methods here for multiple databases with a single entity:


On KeyedMetaMapper, override:
 def dbSelectDBConnectionForFind: PartialFunction[Type,
ConnectionIdentifier] = Map.empty

The ConnectionIdentifier defines which RDBMS to perform the query on.

Also, on Mapper:
  def dbCalculateConnectionIdentifier: PartialFunction[A,
ConnectionIdentifier] = Map.empty




>
>
> http://groups.google.com/group/liftweb/msg/76c965c189a85103?pli=1
>
> But looking in the code I can't find those methods. Are they essentially
> gone now? You also mentioned something better than sharding but I haven't
> seen anything on the list (maybe I missed it).
>
> Thanks,
>
> Derek
>
>
> On Thu, Dec 4, 2008 at 4:01 PM, Derek Chen-Becker <[EMAIL PROTECTED]>wrote:
>
>> Cool. I guess I'm editing my chapter this afternoon now :)
>>
>>
>> On Thu, Dec 4, 2008 at 3:40 PM, David Pollak <
>> [EMAIL PROTECTED]> wrote:
>>
>>>
>>>
>>> On Thu, Dec 4, 2008 at 7:33 AM, Derek Chen-Becker <[EMAIL PROTECTED]
>>> > wrote:
>>>
 I'm mostly done with the rough draft of our Record/Mapper chapter and I
 wanted to clarify a few points to make sure that my reading of the docs and
 code is accurate:

1. ByRef appears to me to essentially be an old-style join (using
the where clause instead of join syntax). Is that accurate? Are there 
 other
use cases?


>>> This allows you to compare two columns in the same row.  Because mapper
>>> does not allow for explicit joins or queries against more than one table at
>>> once (with the exception of the In construct), there's no "old style join"
>>> stuff.
>>>
>>> I've also changed the Join() QueryParam to PreCache... which is more
>>> descriptive of what it does.
>>>
>>>

1.
2. It looks like the only way to get distinct results would be to
use the findAllByPreparedStatement or findAllByInsecureSql methods. Is 
 there
some other way to do this that I'm missing?

 Or perhaps the Distrinct() QueryParam I just added. :-)
>>>
>>>

1.
2. The toForm method in Mapper has an overload that takes a
redoSnippet. What is the use case for this?

 So you can keep the current state around over the course of multiple
>>> form submissions when the validation fails.
>>>

1. Will it be supported in Record or has that functionality been
folded into something else?

 I hope it will make it into Record/Field.
>>>

1.
2. It appears that the functionality of the buildSet... methods in
MappedField has effectievly been replaced by the setFromAny in Field. Is
this the case, or will those buildSet functions show back up in some
subclass of field (it seems like there was a lot of overlap there)

 buildSet is JDBC specific and radically improves performance in
>>> converting a JDBC column to something that can be put into a field.
>>>

1.
2. Am I reading correctly that Record no longer retains the orginal
value of a field when it's changed, but rather just flags the field as
dirty? (there are no is/was methods on Field)

 Probably... but there will be is/was on Field.  It's a very helpful
>>> construct.
>>>

1.

 These last two make sense to me since it seems like duplicated effort
 for #4 and not much of a use case on #5 that I can think of. Any info or
 comments would be appreciated!
>>>
>>>
>>> Sure... wait a few minutes for my Distinct() checkin to make it to GitHub
>>>
>>>


 Thanks,

 Derek



>>>
>>>
>>> --
>>> Lift, the simply functional web framework http://liftweb.net
>>> Collaborative Task Management http://much4.us
>>> Follow me: http://twitter.com/dpp
>>> Git some: http://github.com/dpp
>>>
>>>
>>>
>>
>
> >
>


-- 
Lift, the simply functional web framework http://liftweb.net
Collaborative Task Management http://much4.us
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Confirming guesses on Mapper

2008-12-04 Thread Derek Chen-Becker
OK, one last question for today before I start hacking at the text: You
mention some methods here for multiple databases with a single entity:

http://groups.google.com/group/liftweb/msg/76c965c189a85103?pli=1

But looking in the code I can't find those methods. Are they essentially
gone now? You also mentioned something better than sharding but I haven't
seen anything on the list (maybe I missed it).

Thanks,

Derek

On Thu, Dec 4, 2008 at 4:01 PM, Derek Chen-Becker <[EMAIL PROTECTED]>wrote:

> Cool. I guess I'm editing my chapter this afternoon now :)
>
>
> On Thu, Dec 4, 2008 at 3:40 PM, David Pollak <
> [EMAIL PROTECTED]> wrote:
>
>>
>>
>> On Thu, Dec 4, 2008 at 7:33 AM, Derek Chen-Becker <[EMAIL PROTECTED]>wrote:
>>
>>> I'm mostly done with the rough draft of our Record/Mapper chapter and I
>>> wanted to clarify a few points to make sure that my reading of the docs and
>>> code is accurate:
>>>
>>>1. ByRef appears to me to essentially be an old-style join (using the
>>>where clause instead of join syntax). Is that accurate? Are there other 
>>> use
>>>cases?
>>>
>>>
>> This allows you to compare two columns in the same row.  Because mapper
>> does not allow for explicit joins or queries against more than one table at
>> once (with the exception of the In construct), there's no "old style join"
>> stuff.
>>
>> I've also changed the Join() QueryParam to PreCache... which is more
>> descriptive of what it does.
>>
>>
>>>
>>>1.
>>>2. It looks like the only way to get distinct results would be to use
>>>the findAllByPreparedStatement or findAllByInsecureSql methods. Is there
>>>some other way to do this that I'm missing?
>>>
>>> Or perhaps the Distrinct() QueryParam I just added. :-)
>>
>>
>>>
>>>1.
>>>2. The toForm method in Mapper has an overload that takes a
>>>redoSnippet. What is the use case for this?
>>>
>>> So you can keep the current state around over the course of multiple form
>> submissions when the validation fails.
>>
>>>
>>>1. Will it be supported in Record or has that functionality been
>>>folded into something else?
>>>
>>> I hope it will make it into Record/Field.
>>
>>>
>>>1.
>>>2. It appears that the functionality of the buildSet... methods in
>>>MappedField has effectievly been replaced by the setFromAny in Field. Is
>>>this the case, or will those buildSet functions show back up in some
>>>subclass of field (it seems like there was a lot of overlap there)
>>>
>>> buildSet is JDBC specific and radically improves performance in
>> converting a JDBC column to something that can be put into a field.
>>
>>>
>>>1.
>>>2. Am I reading correctly that Record no longer retains the orginal
>>>value of a field when it's changed, but rather just flags the field as
>>>dirty? (there are no is/was methods on Field)
>>>
>>> Probably... but there will be is/was on Field.  It's a very helpful
>> construct.
>>
>>>
>>>1.
>>>
>>> These last two make sense to me since it seems like duplicated effort for
>>> #4 and not much of a use case on #5 that I can think of. Any info or
>>> comments would be appreciated!
>>
>>
>> Sure... wait a few minutes for my Distinct() checkin to make it to GitHub
>>
>>
>>>
>>>
>>> Thanks,
>>>
>>> Derek
>>>
>>>
>>>
>>
>>
>> --
>> Lift, the simply functional web framework http://liftweb.net
>> Collaborative Task Management http://much4.us
>> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: lift-testkit/REST API test example code

2008-12-04 Thread Dano

Of course!  If it had teeth, it would have bit me.

I'll dig into that code.

Thanks David!!


Dano

On Dec 4, 1:06 pm, "David Pollak" <[EMAIL PROTECTED]>
wrote:
> Dan,
>
> In the Buy a Feature SVN repository, look in the stress_test directory.
> It's got code that uses the testkit.
>
> Thanks,
>
> David
>
>
>
> On Thu, Dec 4, 2008 at 10:26 AM, Dano <[EMAIL PROTECTED]> wrote:
>
> > Hello Fellow Lifters!
>
> > I am working on a set of REST APIs for a new Innovation Game and was
> > browsing around the lift group for advice on how this is done.
>
> > From one of dpp's posts, I gathered that lift-testkit is what I should
> > use.  Has anyone used lift-testkit to test REST api's or know of any
> > sample test code which could be used as a starting point?
>
> > Thanks very much in advance for any help.
>
> > Dan O.
>
> --
> Lift, the simply functional web frameworkhttp://liftweb.net
> Collaborative Task Managementhttp://much4.us
> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Confirming guesses on Mapper

2008-12-04 Thread Derek Chen-Becker
Cool. I guess I'm editing my chapter this afternoon now :)

On Thu, Dec 4, 2008 at 3:40 PM, David Pollak
<[EMAIL PROTECTED]>wrote:

>
>
> On Thu, Dec 4, 2008 at 7:33 AM, Derek Chen-Becker <[EMAIL PROTECTED]>wrote:
>
>> I'm mostly done with the rough draft of our Record/Mapper chapter and I
>> wanted to clarify a few points to make sure that my reading of the docs and
>> code is accurate:
>>
>>1. ByRef appears to me to essentially be an old-style join (using the
>>where clause instead of join syntax). Is that accurate? Are there other 
>> use
>>cases?
>>
>>
> This allows you to compare two columns in the same row.  Because mapper
> does not allow for explicit joins or queries against more than one table at
> once (with the exception of the In construct), there's no "old style join"
> stuff.
>
> I've also changed the Join() QueryParam to PreCache... which is more
> descriptive of what it does.
>
>
>>
>>1.
>>2. It looks like the only way to get distinct results would be to use
>>the findAllByPreparedStatement or findAllByInsecureSql methods. Is there
>>some other way to do this that I'm missing?
>>
>> Or perhaps the Distrinct() QueryParam I just added. :-)
>
>
>>
>>1.
>>2. The toForm method in Mapper has an overload that takes a
>>redoSnippet. What is the use case for this?
>>
>> So you can keep the current state around over the course of multiple form
> submissions when the validation fails.
>
>>
>>1. Will it be supported in Record or has that functionality been
>>folded into something else?
>>
>> I hope it will make it into Record/Field.
>
>>
>>1.
>>2. It appears that the functionality of the buildSet... methods in
>>MappedField has effectievly been replaced by the setFromAny in Field. Is
>>this the case, or will those buildSet functions show back up in some
>>subclass of field (it seems like there was a lot of overlap there)
>>
>> buildSet is JDBC specific and radically improves performance in converting
> a JDBC column to something that can be put into a field.
>
>>
>>1.
>>2. Am I reading correctly that Record no longer retains the orginal
>>value of a field when it's changed, but rather just flags the field as
>>dirty? (there are no is/was methods on Field)
>>
>> Probably... but there will be is/was on Field.  It's a very helpful
> construct.
>
>>
>>1.
>>
>> These last two make sense to me since it seems like duplicated effort for
>> #4 and not much of a use case on #5 that I can think of. Any info or
>> comments would be appreciated!
>
>
> Sure... wait a few minutes for my Distinct() checkin to make it to GitHub
>
>
>>
>>
>> Thanks,
>>
>> Derek
>>
>>
>>
>
>
> --
> Lift, the simply functional web framework http://liftweb.net
> Collaborative Task Management http://much4.us
> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: lift-testkit/REST API test example code

2008-12-04 Thread Dano

Hi Tyler,

Thanks for your response.

The closest code to what I am looking for is under the sites/example/
src/test area.  Under this area, the WikiUsages.scala code is a nice
example of how to test a web page.  It uses a jwebunit WebTester class
to browse the page and perform tests on it.

Since I have a REST API, I am looking for a way to do http operations
where I can specify URL params and test what is returned. WebTester
does not fit this use.  However, I just need to find a class to
replace WebTester in the WikiUsages.scala code and I should be good to
go.

You have given me a good start and I'll keep searching.

Thanks.


Dano

On Dec 4, 12:34 pm, TylerWeir <[EMAIL PROTECTED]> wrote:
> Hey Dano,
>
> For getting examples of how to write tests, the main tree has a bunch
> of tests in it:http://github.com/dpp/liftweb/tree/master/lift/src/test
> andhttp://github.com/dpp/liftweb/tree/master/sites/example/src/test/
>
> Poke around and you'll see that most of the tests are Specs
> +Scalacheck.
>
> Answer your question?
>
> On Dec 4, 1:26 pm, Dano <[EMAIL PROTECTED]> wrote:
>
> > Hello Fellow Lifters!
>
> > I am working on a set of REST APIs for a new Innovation Game and was
> > browsing around the lift group for advice on how this is done.
>
> > From one of dpp's posts, I gathered that lift-testkit is what I should
> > use.  Has anyone used lift-testkit to test REST api's or know of any
> > sample test code which could be used as a starting point?
>
> > Thanks very much in advance for any help.
>
> > Dan O.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Confirming guesses on Mapper

2008-12-04 Thread David Pollak
On Thu, Dec 4, 2008 at 7:33 AM, Derek Chen-Becker <[EMAIL PROTECTED]>wrote:

> I'm mostly done with the rough draft of our Record/Mapper chapter and I
> wanted to clarify a few points to make sure that my reading of the docs and
> code is accurate:
>
>1. ByRef appears to me to essentially be an old-style join (using the
>where clause instead of join syntax). Is that accurate? Are there other use
>cases?
>
>
This allows you to compare two columns in the same row.  Because mapper does
not allow for explicit joins or queries against more than one table at once
(with the exception of the In construct), there's no "old style join" stuff.

I've also changed the Join() QueryParam to PreCache... which is more
descriptive of what it does.


>
>1.
>2. It looks like the only way to get distinct results would be to use
>the findAllByPreparedStatement or findAllByInsecureSql methods. Is there
>some other way to do this that I'm missing?
>
> Or perhaps the Distrinct() QueryParam I just added. :-)


>
>1.
>2. The toForm method in Mapper has an overload that takes a
>redoSnippet. What is the use case for this?
>
> So you can keep the current state around over the course of multiple form
submissions when the validation fails.

>
>1. Will it be supported in Record or has that functionality been folded
>into something else?
>
> I hope it will make it into Record/Field.

>
>1.
>2. It appears that the functionality of the buildSet... methods in
>MappedField has effectievly been replaced by the setFromAny in Field. Is
>this the case, or will those buildSet functions show back up in some
>subclass of field (it seems like there was a lot of overlap there)
>
> buildSet is JDBC specific and radically improves performance in converting
a JDBC column to something that can be put into a field.

>
>1.
>2. Am I reading correctly that Record no longer retains the orginal
>value of a field when it's changed, but rather just flags the field as
>dirty? (there are no is/was methods on Field)
>
> Probably... but there will be is/was on Field.  It's a very helpful
construct.

>
>1.
>
> These last two make sense to me since it seems like duplicated effort for
> #4 and not much of a use case on #5 that I can think of. Any info or
> comments would be appreciated!


Sure... wait a few minutes for my Distinct() checkin to make it to GitHub


>
>
> Thanks,
>
> Derek
>
> >
>


-- 
Lift, the simply functional web framework http://liftweb.net
Collaborative Task Management http://much4.us
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: lift-testkit/REST API test example code

2008-12-04 Thread David Pollak
Dan,

In the Buy a Feature SVN repository, look in the stress_test directory.
It's got code that uses the testkit.

Thanks,

David

On Thu, Dec 4, 2008 at 10:26 AM, Dano <[EMAIL PROTECTED]> wrote:

>
> Hello Fellow Lifters!
>
> I am working on a set of REST APIs for a new Innovation Game and was
> browsing around the lift group for advice on how this is done.
>
> From one of dpp's posts, I gathered that lift-testkit is what I should
> use.  Has anyone used lift-testkit to test REST api's or know of any
> sample test code which could be used as a starting point?
>
> Thanks very much in advance for any help.
>
> Dan O.
> >
>


-- 
Lift, the simply functional web framework http://liftweb.net
Collaborative Task Management http://much4.us
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: How does lift wrap the templates

2008-12-04 Thread David Pollak
On Thu, Dec 4, 2008 at 12:38 PM, Marius <[EMAIL PROTECTED]> wrote:

>
>
>
> On Dec 4, 10:29 pm, "David Pollak" <[EMAIL PROTECTED]>
> wrote:
> > On Thu, Dec 4, 2008 at 12:24 PM, Marius <[EMAIL PROTECTED]> wrote:
> >
> > > Unless I'm missing something LiftRules.addTemplateBefore should
> > > suffice. Lift (see findVisibleTemplate which is called before
> > > processSurroundAndInclude) will look for your template so your Pf can
> > > return it virtually from anywhere.
> >
> > However, findVisibleTemplate is not called by the mechanism that looks up
> > the surround template. :-(
>
> Any particular reason not to? ... seems like it is at least as
> appropriate as LiftRules.viewDispatch.It would boil down to
> findAnyTemplate logic isn't it? .. but then again is there some sort
> of redundancy between templates Pf and viewDispatch ? .. which would
> have higher precedence?


The issue is that TemplatePF does its lookup based on a Req... the request.
This makes sense because you may want to look things up based on an incoming
request including the path, the postfix, etc.  On the other hand,
findTemplate is called with a path... a List[String] because it's no longer
part of the Req, but being called by something beyond the Req.  I tried to
unify the two constructs about a month ago and found use cases in my code
for both constructs... thus they are both in Lift and serve their own
purpose.


>
>
> >
> >
> >
> >
> >
> > > Br's,
> > > Marius
> >
> > > On Dec 4, 10:10 pm, "Derek Chen-Becker" <[EMAIL PROTECTED]> wrote:
> > > > Ahh. What would make this really simple is if LiftRules.finder was a
> PF
> > > > instead of a straight def, since LiftRules.finder is what actually
> tries
> > > to
> > > > locate the template using ClassLoader.getResourceAsStream currently.
> In
> > > the
> > > > meantime, you might have luck with LiftRules.liftTagProcessing. You
> can
> > > > define your own PF that handles surround specially. In particular,
> I'd
> > > look
> > > > at processSurroundElement (and the related findAndMerge and
> processBind)
> > > in
> > > > LiftSession.scala.
> >
> > > > Derek
> >
> > > > On Thu, Dec 4, 2008 at 1:27 PM, Tim Perrett <[EMAIL PROTECTED]>
> > > wrote:
> >
> > > > > I am indeed talking about lift:surround :)
> >
> > > > > I see processSurroundAndInclude and what it does, but what i really
> > > > > want to do it set the content of the surround dynamically (from a
> > > > > layout i'll store in the DB)
> >
> > > > > How would one go about doing this?
> >
> > > > > Cheers
> >
> > > > > Tim
> >
> > > > > On Dec 4, 7:01 pm, "Derek Chen-Becker" <[EMAIL PROTECTED]>
> wrote:
> > > > > > Are you talking about  tags? Those are handled in
> > > > > > LiftSession.processSurroundAndInclude, line 697. Here's some
> example
> > > code
> > > > > > for a utility method from an old app that uses it in some
> DispatchPFs
> > > I
> > > > > was
> > > > > > running:
> >
> > > > > >   def process (xhtml : NodeSeq) : XmlResponse = {
> > > > > > val data =  > > > > > at="content">{xhtml}
> > > > > > XmlResponse({
> > > > > > S.session.open_!.processSurroundAndInclude(S.uri,data)})
> > > > > >   }
> >
> > > > > > Derek
> >
> > > > > > On Thu, Dec 4, 2008 at 12:50 PM, Tim Perrett <
> [EMAIL PROTECTED]>
> > > > > wrote:
> >
> > > > > > > Hey guys,
> >
> > > > > > > Within lift, I cant seem to find where the content returned
> from
> > > > > > > whatever template mech then gets bound to the layout content?
> >
> > > > > > > Can someone point me in the right direction?
> >
> > > > > > > Cheers
> >
> > > > > > > Tim
> >
> > --
> > Lift, the simply functional web frameworkhttp://liftweb.net
> > Collaborative Task Managementhttp://much4.us
> > Follow me:http://twitter.com/dpp
> > Git some:http://github.com/dpp
> >
>


-- 
Lift, the simply functional web framework http://liftweb.net
Collaborative Task Management http://much4.us
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: How does lift wrap the templates

2008-12-04 Thread Marius



On Dec 4, 10:29 pm, "David Pollak" <[EMAIL PROTECTED]>
wrote:
> On Thu, Dec 4, 2008 at 12:24 PM, Marius <[EMAIL PROTECTED]> wrote:
>
> > Unless I'm missing something LiftRules.addTemplateBefore should
> > suffice. Lift (see findVisibleTemplate which is called before
> > processSurroundAndInclude) will look for your template so your Pf can
> > return it virtually from anywhere.
>
> However, findVisibleTemplate is not called by the mechanism that looks up
> the surround template. :-(

Any particular reason not to? ... seems like it is at least as
appropriate as LiftRules.viewDispatch.It would boil down to
findAnyTemplate logic isn't it? .. but then again is there some sort
of redundancy between templates Pf and viewDispatch ? .. which would
have higher precedence?

>
>
>
>
>
> > Br's,
> > Marius
>
> > On Dec 4, 10:10 pm, "Derek Chen-Becker" <[EMAIL PROTECTED]> wrote:
> > > Ahh. What would make this really simple is if LiftRules.finder was a PF
> > > instead of a straight def, since LiftRules.finder is what actually tries
> > to
> > > locate the template using ClassLoader.getResourceAsStream currently. In
> > the
> > > meantime, you might have luck with LiftRules.liftTagProcessing. You can
> > > define your own PF that handles surround specially. In particular, I'd
> > look
> > > at processSurroundElement (and the related findAndMerge and processBind)
> > in
> > > LiftSession.scala.
>
> > > Derek
>
> > > On Thu, Dec 4, 2008 at 1:27 PM, Tim Perrett <[EMAIL PROTECTED]>
> > wrote:
>
> > > > I am indeed talking about lift:surround :)
>
> > > > I see processSurroundAndInclude and what it does, but what i really
> > > > want to do it set the content of the surround dynamically (from a
> > > > layout i'll store in the DB)
>
> > > > How would one go about doing this?
>
> > > > Cheers
>
> > > > Tim
>
> > > > On Dec 4, 7:01 pm, "Derek Chen-Becker" <[EMAIL PROTECTED]> wrote:
> > > > > Are you talking about  tags? Those are handled in
> > > > > LiftSession.processSurroundAndInclude, line 697. Here's some example
> > code
> > > > > for a utility method from an old app that uses it in some DispatchPFs
> > I
> > > > was
> > > > > running:
>
> > > > >   def process (xhtml : NodeSeq) : XmlResponse = {
> > > > >     val data =  > > > > at="content">{xhtml}
> > > > >     XmlResponse({
> > > > > S.session.open_!.processSurroundAndInclude(S.uri,data)})
> > > > >   }
>
> > > > > Derek
>
> > > > > On Thu, Dec 4, 2008 at 12:50 PM, Tim Perrett <[EMAIL PROTECTED]>
> > > > wrote:
>
> > > > > > Hey guys,
>
> > > > > > Within lift, I cant seem to find where the content returned from
> > > > > > whatever template mech then gets bound to the layout content?
>
> > > > > > Can someone point me in the right direction?
>
> > > > > > Cheers
>
> > > > > > Tim
>
> --
> Lift, the simply functional web frameworkhttp://liftweb.net
> Collaborative Task Managementhttp://much4.us
> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: How does lift wrap the templates

2008-12-04 Thread Derek Chen-Becker
Cool, I missed the viewDispatch call in findAnyTemplate. As always, you're
one step ahead :)

Derek

On Thu, Dec 4, 2008 at 2:28 PM, David Pollak
<[EMAIL PROTECTED]>wrote:

>
>
> On Thu, Dec 4, 2008 at 11:27 AM, Tim Perrett <[EMAIL PROTECTED]> wrote:
>
>>
>> I am indeed talking about lift:surround :)
>>
>> I see processSurroundAndInclude and what it does, but what i really
>> want to do it set the content of the surround dynamically (from a
>> layout i'll store in the DB)
>>
>> How would one go about doing this?
>
>
> All Lift views are looked up via the LiftRule.viewDispatch.  You can put a
> partial function via LiftRules.appendViewDispatch to match your template.
> Lift will expect a LiftView which is a trait that can do the RDBMS lookup.
>
>
>>
>>
>> Cheers
>>
>> Tim
>>
>>
>>
>> On Dec 4, 7:01 pm, "Derek Chen-Becker" <[EMAIL PROTECTED]> wrote:
>> > Are you talking about  tags? Those are handled in
>> > LiftSession.processSurroundAndInclude, line 697. Here's some example
>> code
>> > for a utility method from an old app that uses it in some DispatchPFs I
>> was
>> > running:
>> >
>> >   def process (xhtml : NodeSeq) : XmlResponse = {
>> > val data = > > at="content">{xhtml}
>> > XmlResponse({
>> > S.session.open_!.processSurroundAndInclude(S.uri,data)})
>> >   }
>> >
>> > Derek
>> >
>> > On Thu, Dec 4, 2008 at 12:50 PM, Tim Perrett <[EMAIL PROTECTED]>
>> wrote:
>> >
>> > > Hey guys,
>> >
>> > > Within lift, I cant seem to find where the content returned from
>> > > whatever template mech then gets bound to the layout content?
>> >
>> > > Can someone point me in the right direction?
>> >
>> > > Cheers
>> >
>> > > Tim
>>
>>
>
>
> --
> Lift, the simply functional web framework http://liftweb.net
> Collaborative Task Management http://much4.us
> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: lift-testkit/REST API test example code

2008-12-04 Thread TylerWeir

Hey Dano,

For getting examples of how to write tests, the main tree has a bunch
of tests in it:
http://github.com/dpp/liftweb/tree/master/lift/src/test
and
http://github.com/dpp/liftweb/tree/master/sites/example/src/test/

Poke around and you'll see that most of the tests are Specs
+Scalacheck.

Answer your question?

On Dec 4, 1:26 pm, Dano <[EMAIL PROTECTED]> wrote:
> Hello Fellow Lifters!
>
> I am working on a set of REST APIs for a new Innovation Game and was
> browsing around the lift group for advice on how this is done.
>
> From one of dpp's posts, I gathered that lift-testkit is what I should
> use.  Has anyone used lift-testkit to test REST api's or know of any
> sample test code which could be used as a starting point?
>
> Thanks very much in advance for any help.
>
> Dan O.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: DB connection not closed?

2008-12-04 Thread David Pollak
Joachim,

I've put code into 0.10-SNAPSHOT that will emit JNDI get/release (close)
debug information if you've got your log level set to debug.

Please run the code and see what's happening.  Alternatively, if you could
put together a simple example of the problem so that I can reproduce it
locally, I'll give it a try.

Thanks,

David

On Thu, Dec 4, 2008 at 1:41 AM, Joachim A. <[EMAIL PROTECTED]>wrote:

> Hi,
> I have a lift application running in a tomcat container (using
> 0.10-SNAPSHOT)
> using a MySQL database. Tomcat is setup to provide connections via JNDI.
>
> It runs very well. But now it has happened twice that the connection to
> MySQL
> fails. In the log appears a section which says that the connection to the
> database was never released.
> I guess this is not normal for Lift :)  I assumed that DB.use() takes care
> of
> that.
>
> What am I doing wrong with the DB handling? How can I make sure that the
> connections get closed?
>
>
> I attached the relevant part with the stacktrace.
> bootstrap.liftweb.TransactionalWrapper is a wrapper to enable transactions
> with the DB, it has been given to my by David P. on this list (the code
> same
> as DB.buildLoanWrapper, I think).
>
> Thanks a lot for you help,
> Joachim
>
> >
>
> INFO   | jvm 1| 2008/12/03 05:23:56 | DBCP object created 2008-12-02
> 03:10:41 by the following code was never closed:
> INFO   | jvm 1| 2008/12/03 05:23:56 | java.lang.Exception
> INFO   | jvm 1| 2008/12/03 05:23:56 |   at
> org.apache.tomcat.dbcp.dbcp.AbandonedTrace.setStackTrace(AbandonedTrace.java:160)
> INFO   | jvm 1| 2008/12/03 05:23:56 |   at
> org.apache.tomcat.dbcp.dbcp.AbandonedObjectPool.borrowObject(AbandonedObjectPool.java:86)
> INFO   | jvm 1| 2008/12/03 05:23:56 |   at
> org.apache.tomcat.dbcp.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:96)
> INFO   | jvm 1| 2008/12/03 05:23:56 |   at
> org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
> INFO   | jvm 1| 2008/12/03 05:23:56 |   at
> net.liftweb.mapper.DB$$anonfun$3$$anonfun$apply$3.apply(DB.scala:82)
> INFO   | jvm 1| 2008/12/03 05:23:56 |   at
> net.liftweb.mapper.DB$$anonfun$3$$anonfun$apply$3.apply(DB.scala:81)
> INFO   | jvm 1| 2008/12/03 05:23:56 |   at
> net.liftweb.util.ControlHelpers$class.tryo(ControlHelpers.scala:39)
> INFO   | jvm 1| 2008/12/03 05:23:56 |   at
> net.liftweb.util.Helpers$.tryo(Helpers.scala:29)
> INFO   | jvm 1| 2008/12/03 05:23:56 |   at
> net.liftweb.util.ControlHelpers$class.tryo(ControlHelpers.scala:53)
> INFO   | jvm 1| 2008/12/03 05:23:56 |   at
> net.liftweb.util.Helpers$.tryo(Helpers.scala:29)
> INFO   | jvm 1| 2008/12/03 05:23:56 |   at
> net.liftweb.mapper.DB$$anonfun$3.apply(DB.scala:81)
> INFO   | jvm 1| 2008/12/03 05:23:56 |   at
> net.liftweb.mapper.DB$$anonfun$3.apply(DB.scala:84)
> INFO   | jvm 1| 2008/12/03 05:23:56 |   at
> net.liftweb.util.EmptyCan.openOr(Can.scala:314)
> INFO   | jvm 1| 2008/12/03 05:23:56 |   at
> net.liftweb.mapper.DB$.newConnection(DB.scala:80)
> INFO   | jvm 1| 2008/12/03 05:23:56 |   at
> net.liftweb.mapper.DB$.getConnection(DB.scala:117)
> INFO   | jvm 1| 2008/12/03 05:23:56 |   at
> net.liftweb.mapper.DB$.use(DB.scala:271)
> INFO   | jvm 1| 2008/12/03 05:23:56 |   at
> bootstrap.liftweb.TransactionalWrapper$$anon$1.apply(TransactionalWrapper.scala:31)
> INFO   | jvm 1| 2008/12/03 05:23:56 |   at
> net.liftweb.http.S$.net$liftweb$http$S$$doAround(S.scala:377)
> INFO   | jvm 1| 2008/12/03 05:23:56 |   at
> net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_nest2InnerInit$1.apply(S.scala:455)
> INFO   | jvm 1| 2008/12/03 05:23:56 |   at
> net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:31)
> INFO   | jvm 1| 2008/12/03 05:23:56 |   at
> net.liftweb.http.S$.net$liftweb$http$S$$_nest2InnerInit(S.scala:454)
> INFO   | jvm 1| 2008/12/03 05:23:56 |   at
> net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_innerInit$1$$anonfun$apply$18$$anonfun$apply$19$$anonfun$apply$20$$anonfun$apply$21$$anonfun$apply$22.apply(S.scala:474)
> INFO   | jvm 1| 2008/12/03 05:23:56 |   at
> net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:31)
> INFO   | jvm 1| 2008/12/03 05:23:56 |   at
> net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_innerInit$1$$anonfun$apply$18$$anonfun$apply$19$$anonfun$apply$20$$anonfun$apply$21.apply(S.scala:473)
> INFO   | jvm 1| 2008/12/03 05:23:56 |   at
> net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:31)
> INFO   | jvm 1| 2008/12/03 05:23:56 |   at
> net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_innerInit$1$$anonfun$apply$18$$anonfun$apply$19$$anonfun$apply$20.apply(S.scala:472)
> INFO   | jvm 1| 2008/12/03 05:23:56 |   at
> net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:31)
> INFO   | jvm 1| 2008/12/03 05:23:56 |   at
> net.liftwe

[Lift] Re: How does lift wrap the templates

2008-12-04 Thread David Pollak
On Thu, Dec 4, 2008 at 12:24 PM, Marius <[EMAIL PROTECTED]> wrote:

>
> Unless I'm missing something LiftRules.addTemplateBefore should
> suffice. Lift (see findVisibleTemplate which is called before
> processSurroundAndInclude) will look for your template so your Pf can
> return it virtually from anywhere.


However, findVisibleTemplate is not called by the mechanism that looks up
the surround template. :-(


>
>
> Br's,
> Marius
>
> On Dec 4, 10:10 pm, "Derek Chen-Becker" <[EMAIL PROTECTED]> wrote:
> > Ahh. What would make this really simple is if LiftRules.finder was a PF
> > instead of a straight def, since LiftRules.finder is what actually tries
> to
> > locate the template using ClassLoader.getResourceAsStream currently. In
> the
> > meantime, you might have luck with LiftRules.liftTagProcessing. You can
> > define your own PF that handles surround specially. In particular, I'd
> look
> > at processSurroundElement (and the related findAndMerge and processBind)
> in
> > LiftSession.scala.
> >
> > Derek
> >
> > On Thu, Dec 4, 2008 at 1:27 PM, Tim Perrett <[EMAIL PROTECTED]>
> wrote:
> >
> > > I am indeed talking about lift:surround :)
> >
> > > I see processSurroundAndInclude and what it does, but what i really
> > > want to do it set the content of the surround dynamically (from a
> > > layout i'll store in the DB)
> >
> > > How would one go about doing this?
> >
> > > Cheers
> >
> > > Tim
> >
> > > On Dec 4, 7:01 pm, "Derek Chen-Becker" <[EMAIL PROTECTED]> wrote:
> > > > Are you talking about  tags? Those are handled in
> > > > LiftSession.processSurroundAndInclude, line 697. Here's some example
> code
> > > > for a utility method from an old app that uses it in some DispatchPFs
> I
> > > was
> > > > running:
> >
> > > >   def process (xhtml : NodeSeq) : XmlResponse = {
> > > > val data =  > > > at="content">{xhtml}
> > > > XmlResponse({
> > > > S.session.open_!.processSurroundAndInclude(S.uri,data)})
> > > >   }
> >
> > > > Derek
> >
> > > > On Thu, Dec 4, 2008 at 12:50 PM, Tim Perrett <[EMAIL PROTECTED]>
> > > wrote:
> >
> > > > > Hey guys,
> >
> > > > > Within lift, I cant seem to find where the content returned from
> > > > > whatever template mech then gets bound to the layout content?
> >
> > > > > Can someone point me in the right direction?
> >
> > > > > Cheers
> >
> > > > > Tim
> >
>


-- 
Lift, the simply functional web framework http://liftweb.net
Collaborative Task Management http://much4.us
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: How does lift wrap the templates

2008-12-04 Thread David Pollak
On Thu, Dec 4, 2008 at 11:27 AM, Tim Perrett <[EMAIL PROTECTED]> wrote:

>
> I am indeed talking about lift:surround :)
>
> I see processSurroundAndInclude and what it does, but what i really
> want to do it set the content of the surround dynamically (from a
> layout i'll store in the DB)
>
> How would one go about doing this?


All Lift views are looked up via the LiftRule.viewDispatch.  You can put a
partial function via LiftRules.appendViewDispatch to match your template.
Lift will expect a LiftView which is a trait that can do the RDBMS lookup.


>
>
> Cheers
>
> Tim
>
>
>
> On Dec 4, 7:01 pm, "Derek Chen-Becker" <[EMAIL PROTECTED]> wrote:
> > Are you talking about  tags? Those are handled in
> > LiftSession.processSurroundAndInclude, line 697. Here's some example code
> > for a utility method from an old app that uses it in some DispatchPFs I
> was
> > running:
> >
> >   def process (xhtml : NodeSeq) : XmlResponse = {
> > val data =  > at="content">{xhtml}
> > XmlResponse({
> > S.session.open_!.processSurroundAndInclude(S.uri,data)})
> >   }
> >
> > Derek
> >
> > On Thu, Dec 4, 2008 at 12:50 PM, Tim Perrett <[EMAIL PROTECTED]>
> wrote:
> >
> > > Hey guys,
> >
> > > Within lift, I cant seem to find where the content returned from
> > > whatever template mech then gets bound to the layout content?
> >
> > > Can someone point me in the right direction?
> >
> > > Cheers
> >
> > > Tim
> >
>


-- 
Lift, the simply functional web framework http://liftweb.net
Collaborative Task Management http://much4.us
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: How does lift wrap the templates

2008-12-04 Thread Marius

Unless I'm missing something LiftRules.addTemplateBefore should
suffice. Lift (see findVisibleTemplate which is called before
processSurroundAndInclude) will look for your template so your Pf can
return it virtually from anywhere.

Br's,
Marius

On Dec 4, 10:10 pm, "Derek Chen-Becker" <[EMAIL PROTECTED]> wrote:
> Ahh. What would make this really simple is if LiftRules.finder was a PF
> instead of a straight def, since LiftRules.finder is what actually tries to
> locate the template using ClassLoader.getResourceAsStream currently. In the
> meantime, you might have luck with LiftRules.liftTagProcessing. You can
> define your own PF that handles surround specially. In particular, I'd look
> at processSurroundElement (and the related findAndMerge and processBind) in
> LiftSession.scala.
>
> Derek
>
> On Thu, Dec 4, 2008 at 1:27 PM, Tim Perrett <[EMAIL PROTECTED]> wrote:
>
> > I am indeed talking about lift:surround :)
>
> > I see processSurroundAndInclude and what it does, but what i really
> > want to do it set the content of the surround dynamically (from a
> > layout i'll store in the DB)
>
> > How would one go about doing this?
>
> > Cheers
>
> > Tim
>
> > On Dec 4, 7:01 pm, "Derek Chen-Becker" <[EMAIL PROTECTED]> wrote:
> > > Are you talking about  tags? Those are handled in
> > > LiftSession.processSurroundAndInclude, line 697. Here's some example code
> > > for a utility method from an old app that uses it in some DispatchPFs I
> > was
> > > running:
>
> > >   def process (xhtml : NodeSeq) : XmlResponse = {
> > >     val data =  > > at="content">{xhtml}
> > >     XmlResponse({
> > > S.session.open_!.processSurroundAndInclude(S.uri,data)})
> > >   }
>
> > > Derek
>
> > > On Thu, Dec 4, 2008 at 12:50 PM, Tim Perrett <[EMAIL PROTECTED]>
> > wrote:
>
> > > > Hey guys,
>
> > > > Within lift, I cant seem to find where the content returned from
> > > > whatever template mech then gets bound to the layout content?
>
> > > > Can someone point me in the right direction?
>
> > > > 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: How does lift wrap the templates

2008-12-04 Thread Derek Chen-Becker
Ahh. What would make this really simple is if LiftRules.finder was a PF
instead of a straight def, since LiftRules.finder is what actually tries to
locate the template using ClassLoader.getResourceAsStream currently. In the
meantime, you might have luck with LiftRules.liftTagProcessing. You can
define your own PF that handles surround specially. In particular, I'd look
at processSurroundElement (and the related findAndMerge and processBind) in
LiftSession.scala.

Derek

On Thu, Dec 4, 2008 at 1:27 PM, Tim Perrett <[EMAIL PROTECTED]> wrote:

>
> I am indeed talking about lift:surround :)
>
> I see processSurroundAndInclude and what it does, but what i really
> want to do it set the content of the surround dynamically (from a
> layout i'll store in the DB)
>
> How would one go about doing this?
>
> Cheers
>
> Tim
>
>
>
> On Dec 4, 7:01 pm, "Derek Chen-Becker" <[EMAIL PROTECTED]> wrote:
> > Are you talking about  tags? Those are handled in
> > LiftSession.processSurroundAndInclude, line 697. Here's some example code
> > for a utility method from an old app that uses it in some DispatchPFs I
> was
> > running:
> >
> >   def process (xhtml : NodeSeq) : XmlResponse = {
> > val data =  > at="content">{xhtml}
> > XmlResponse({
> > S.session.open_!.processSurroundAndInclude(S.uri,data)})
> >   }
> >
> > Derek
> >
> > On Thu, Dec 4, 2008 at 12:50 PM, Tim Perrett <[EMAIL PROTECTED]>
> wrote:
> >
> > > Hey guys,
> >
> > > Within lift, I cant seem to find where the content returned from
> > > whatever template mech then gets bound to the layout content?
> >
> > > Can someone point me in the right direction?
> >
> > > 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: How does lift wrap the templates

2008-12-04 Thread Tim Perrett

I am indeed talking about lift:surround :)

I see processSurroundAndInclude and what it does, but what i really
want to do it set the content of the surround dynamically (from a
layout i'll store in the DB)

How would one go about doing this?

Cheers

Tim



On Dec 4, 7:01 pm, "Derek Chen-Becker" <[EMAIL PROTECTED]> wrote:
> Are you talking about  tags? Those are handled in
> LiftSession.processSurroundAndInclude, line 697. Here's some example code
> for a utility method from an old app that uses it in some DispatchPFs I was
> running:
>
>   def process (xhtml : NodeSeq) : XmlResponse = {
>     val data =  at="content">{xhtml}
>     XmlResponse({
> S.session.open_!.processSurroundAndInclude(S.uri,data)})
>   }
>
> Derek
>
> On Thu, Dec 4, 2008 at 12:50 PM, Tim Perrett <[EMAIL PROTECTED]> wrote:
>
> > Hey guys,
>
> > Within lift, I cant seem to find where the content returned from
> > whatever template mech then gets bound to the layout content?
>
> > Can someone point me in the right direction?
>
> > 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: How does lift wrap the templates

2008-12-04 Thread Derek Chen-Becker
Are you talking about  tags? Those are handled in
LiftSession.processSurroundAndInclude, line 697. Here's some example code
for a utility method from an old app that uses it in some DispatchPFs I was
running:

  def process (xhtml : NodeSeq) : XmlResponse = {
val data = {xhtml}
XmlResponse({
S.session.open_!.processSurroundAndInclude(S.uri,data)})
  }


Derek

On Thu, Dec 4, 2008 at 12:50 PM, Tim Perrett <[EMAIL PROTECTED]> wrote:

>
> Hey guys,
>
> Within lift, I cant seem to find where the content returned from
> whatever template mech then gets bound to the layout content?
>
> Can someone point me in the right direction?
>
> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Mapper's BySql not "validated"?

2008-12-04 Thread Derek Chen-Becker
Sorry, I thought Hudson would update the docs and it was still showing it
without the parameter. Should have checked the source :(

Derek

On Thu, Dec 4, 2008 at 12:08 PM, David Pollak <[EMAIL PROTECTED]
> wrote:

>
>
> On Thu, Dec 4, 2008 at 6:46 AM, Derek Chen-Becker <[EMAIL PROTECTED]>wrote:
>
>> Another follow up on the SQL validation; OrderBySql needs the audit as
>> well. As a test, the following SQL fragment works in PostgreSQL:
>>
>
> I added the validation to OrderBySql yesterday.
>
>
>>
>> val stmt = conn.createStatement()
>> stmt.executeQuery("select * from members order by userid; create table
>> dummy (id serial primary key);")
>>
>> It throws an exception about multiple results being returned, but it still
>> creates the table.
>>
>> Derek
>>
>>
>> On Wed, Dec 3, 2008 at 4:11 PM, David Pollak <
>> [EMAIL PROTECTED]> wrote:
>>
>>>
>>>
>>> On Wed, Dec 3, 2008 at 3:09 PM, Derek Chen-Becker <[EMAIL PROTECTED]
>>> > wrote:
>>>
 Another thing I noticed is that Mapper doesn't seem to support a DECIMAL
 type, which is very useful in financial applications (among others). I'm
 writing a custom one for both Mapper and Record in the book, would anyone 
 be
 interested in seeing those make it into the library? Besides the fields
 themselves I can update the Driver classes to add a decimalColumnType def.
>>>
>>>
>>> Yes, please.
>>>
>>>


 Derek

 On Wed, Dec 3, 2008 at 4:05 PM, David Pollak <
 [EMAIL PROTECTED]> wrote:

>
>
> On Wed, Dec 3, 2008 at 2:27 PM, Derek Chen-Becker <
> [EMAIL PROTECTED]> wrote:
>
>> I was just wondering why the BySql QueryParam doesn't require the
>> IHaveValidatedThisSql case class. Looking at the source it seems that it
>> could be just as vulnerable to some shenanigans, although admittedly I'm 
>> not
>> an expert on SQL injection attacks.
>
>
> It probably is.  I'll fix it.  Good to see your eyeballs and frontal
> lobes helping to clean the code!
>
>
>>
>>
>> Derek
>>
>>
>>
>
>
> --
> Lift, the simply functional web framework http://liftweb.net
> Collaborative Task Management http://much4.us
> Follow me: http://twitter.com/dpp
> Git some: http://github.com/dpp
>
>
>



>>>
>>>
>>> --
>>> Lift, the simply functional web framework http://liftweb.net
>>> Collaborative Task Management http://much4.us
>>> Follow me: http://twitter.com/dpp
>>> Git some: http://github.com/dpp
>>>
>>>
>>>
>>
>>
>>
>
>
> --
> Lift, the simply functional web framework http://liftweb.net
> Collaborative Task Management http://much4.us
> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] How does lift wrap the templates

2008-12-04 Thread Tim Perrett

Hey guys,

Within lift, I cant seem to find where the content returned from
whatever template mech then gets bound to the layout content?

Can someone point me in the right direction?

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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] lift-testkit/REST API test example code

2008-12-04 Thread Dano

Hello Fellow Lifters!

I am working on a set of REST APIs for a new Innovation Game and was
browsing around the lift group for advice on how this is done.

>From one of dpp's posts, I gathered that lift-testkit is what I should
use.  Has anyone used lift-testkit to test REST api's or know of any
sample test code which could be used as a starting point?

Thanks very much in advance for any help.

Dan O.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Mapper's BySql not "validated"?

2008-12-04 Thread David Pollak
On Thu, Dec 4, 2008 at 6:46 AM, Derek Chen-Becker <[EMAIL PROTECTED]>wrote:

> Another follow up on the SQL validation; OrderBySql needs the audit as
> well. As a test, the following SQL fragment works in PostgreSQL:
>

I added the validation to OrderBySql yesterday.


>
> val stmt = conn.createStatement()
> stmt.executeQuery("select * from members order by userid; create table
> dummy (id serial primary key);")
>
> It throws an exception about multiple results being returned, but it still
> creates the table.
>
> Derek
>
>
> On Wed, Dec 3, 2008 at 4:11 PM, David Pollak <
> [EMAIL PROTECTED]> wrote:
>
>>
>>
>> On Wed, Dec 3, 2008 at 3:09 PM, Derek Chen-Becker <[EMAIL PROTECTED]>wrote:
>>
>>> Another thing I noticed is that Mapper doesn't seem to support a DECIMAL
>>> type, which is very useful in financial applications (among others). I'm
>>> writing a custom one for both Mapper and Record in the book, would anyone be
>>> interested in seeing those make it into the library? Besides the fields
>>> themselves I can update the Driver classes to add a decimalColumnType def.
>>
>>
>> Yes, please.
>>
>>
>>>
>>>
>>> Derek
>>>
>>> On Wed, Dec 3, 2008 at 4:05 PM, David Pollak <
>>> [EMAIL PROTECTED]> wrote:
>>>


 On Wed, Dec 3, 2008 at 2:27 PM, Derek Chen-Becker <
 [EMAIL PROTECTED]> wrote:

> I was just wondering why the BySql QueryParam doesn't require the
> IHaveValidatedThisSql case class. Looking at the source it seems that it
> could be just as vulnerable to some shenanigans, although admittedly I'm 
> not
> an expert on SQL injection attacks.


 It probably is.  I'll fix it.  Good to see your eyeballs and frontal
 lobes helping to clean the code!


>
>
> Derek
>
>
>


 --
 Lift, the simply functional web framework http://liftweb.net
 Collaborative Task Management http://much4.us
 Follow me: http://twitter.com/dpp
 Git some: http://github.com/dpp



>>>
>>>
>>>
>>
>>
>> --
>> Lift, the simply functional web framework http://liftweb.net
>> Collaborative Task Management http://much4.us
>> Follow me: http://twitter.com/dpp
>> Git some: http://github.com/dpp
>>
>>
>>
>
> >
>


-- 
Lift, the simply functional web framework http://liftweb.net
Collaborative Task Management http://much4.us
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: noob question: working with scala 2.7.2

2008-12-04 Thread Harshad RJ
Josh,

Worked like a "charm". Thanks a lot!

(maven looks like voodoo to me. I am just glad I am not expected to dance
around my laptop and poke a wax model of a mouse)

On Thu, Dec 4, 2008 at 8:01 PM, Josh Suereth <[EMAIL PROTECTED]>wrote:

> Here's your issue:
>
> [INFO] Archetype repository missing. Using the one from
> [net.liftweb:lift-archetype-
> blank:RELEASE -> http://scala-tools.org/repo-releases] found in catalog
> internal
>
>
> It's not pulling from the snapshot repository.
>
> Try using archetype:create instead of archetype:generate.   (The generate
> goal is from the new alpha of the archetype plugin and I don't htink it uses
> the -DremoteRepositories property).
>
>
> -Josh
>
>
> On Thu, Dec 4, 2008 at 9:21 AM, Harshad RJ <[EMAIL PROTECTED]> wrote:
>
>>
>>
>> On Thu, Dec 4, 2008 at 6:39 PM, David Bernard <[EMAIL PROTECTED]
>> > wrote:
>>
>>>
>>> It's the correct server.
>>>
>>> Could you retry (the command from the initial mail) with "-e" argument
>>> at end (to print error + stackstrace) ?
>>
>>
>>
>> Here is the whole trace:
>> ~/local/apache-maven-2.0.9/bin/mvn archetype:generate -U
>> \  > ~/w/lift <
>> -DarchetypeGroupId=net.liftweb \
>> -DarchetypeArtifactId=lift-archetype-blank \
>> -DarchetypeVersion=0.10-SNAPSHOT \
>> -DremoteRepositories=http://scala-tools.org/repo-snapshots \
>> -DgroupId=foogroup -DartifactId=foo -e
>> Warning: JAVA_HOME environment variable is not set.
>> + Error stacktraces are turned on.
>> [INFO] Scanning for projects...
>> [INFO] Searching repository for plugin with prefix: 'archetype'.
>> [INFO] org.apache.maven.plugins: checking for updates from central
>> [INFO] org.codehaus.mojo: checking for updates from central
>> [INFO] artifact org.apache.maven.plugins:maven-archetype-plugin: checking
>> for updates from central
>> [INFO]
>> 
>> [INFO] Building Maven Default Project
>> [INFO]task-segment: [archetype:generate] (aggregator-style)
>> [INFO]
>> 
>> [INFO] Preparing archetype:generate
>> [INFO] No goals needed for project - skipping
>> [INFO] Setting property: classpath.resource.loader.class =>
>> 'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'.
>> [INFO] Setting property: velocimacro.messages.on => 'false'.
>> [INFO] Setting property: resource.loader => 'classpath'.
>> [INFO] Setting property: resource.manager.logwhenfound => 'false'.
>> [INFO] [archetype:generate]
>> [INFO] Generating project in Interactive mode
>>  [INFO] Archetype repository missing. Using the one from
>> [net.liftweb:lift-archetype-blank:RELEASE ->
>> http://scala-tools.org/repo-releases] found in catalog internal
>> [INFO] snapshot net.liftweb:lift-archetype-blank:0.10-SNAPSHOT: checking
>> for updates from lift-archetype-blank-repo
>> Downloading:
>> http://scala-tools.org/repo-releases/net/liftweb/lift-archetype-blank/0.10-SNAPSHOT/lift-archetype-blank-0.10-SNAPSHOT.jar
>> [INFO]
>> 
>> [ERROR] BUILD FAILURE
>> [INFO]
>> 
>> [INFO] The desired archetype does not exist
>> (net.liftweb:lift-archetype-blank:0.10-SNAPSHOT)
>> [INFO]
>> 
>> [INFO] Trace
>> org.apache.maven.BuildFailureException: The desired archetype does not
>> exist (net.liftweb:lift-archetype-blank:0.10-SNAPSHOT)
>> at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:579)
>> at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:512)
>> at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:482)
>> at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
>> at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:227)
>> at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
>> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
>> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
>> at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>> at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>> at java.lang.reflect.Method.invoke(Method.java:597)
>> at
>> org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>> at org.codehaus.classworlds.Launcher.launc

[Lift] Confirming guesses on Mapper

2008-12-04 Thread Derek Chen-Becker
I'm mostly done with the rough draft of our Record/Mapper chapter and I
wanted to clarify a few points to make sure that my reading of the docs and
code is accurate:

   1. ByRef appears to me to essentially be an old-style join (using the
   where clause instead of join syntax). Is that accurate? Are there other use
   cases?
   2. It looks like the only way to get distinct results would be to use the
   findAllByPreparedStatement or findAllByInsecureSql methods. Is there some
   other way to do this that I'm missing?
   3. The toForm method in Mapper has an overload that takes a redoSnippet.
   What is the use case for this? Will it be supported in Record or has that
   functionality been folded into something else?
   4. It appears that the functionality of the buildSet... methods in
   MappedField has effectievly been replaced by the setFromAny in Field. Is
   this the case, or will those buildSet functions show back up in some
   subclass of field (it seems like there was a lot of overlap there)
   5. Am I reading correctly that Record no longer retains the orginal value
   of a field when it's changed, but rather just flags the field as dirty?
   (there are no is/was methods on Field)

These last two make sense to me since it seems like duplicated effort for #4
and not much of a use case on #5 that I can think of. Any info or comments
would be appreciated!

Thanks,

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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Mapper's BySql not "validated"?

2008-12-04 Thread Derek Chen-Becker
Another follow up on the SQL validation; OrderBySql needs the audit as well.
As a test, the following SQL fragment works in PostgreSQL:

val stmt = conn.createStatement()
stmt.executeQuery("select * from members order by userid; create table dummy
(id serial primary key);")

It throws an exception about multiple results being returned, but it still
creates the table.

Derek

On Wed, Dec 3, 2008 at 4:11 PM, David Pollak
<[EMAIL PROTECTED]>wrote:

>
>
> On Wed, Dec 3, 2008 at 3:09 PM, Derek Chen-Becker <[EMAIL PROTECTED]>wrote:
>
>> Another thing I noticed is that Mapper doesn't seem to support a DECIMAL
>> type, which is very useful in financial applications (among others). I'm
>> writing a custom one for both Mapper and Record in the book, would anyone be
>> interested in seeing those make it into the library? Besides the fields
>> themselves I can update the Driver classes to add a decimalColumnType def.
>
>
> Yes, please.
>
>
>>
>>
>> Derek
>>
>> On Wed, Dec 3, 2008 at 4:05 PM, David Pollak <
>> [EMAIL PROTECTED]> wrote:
>>
>>>
>>>
>>> On Wed, Dec 3, 2008 at 2:27 PM, Derek Chen-Becker <[EMAIL PROTECTED]
>>> > wrote:
>>>
 I was just wondering why the BySql QueryParam doesn't require the
 IHaveValidatedThisSql case class. Looking at the source it seems that it
 could be just as vulnerable to some shenanigans, although admittedly I'm 
 not
 an expert on SQL injection attacks.
>>>
>>>
>>> It probably is.  I'll fix it.  Good to see your eyeballs and frontal
>>> lobes helping to clean the code!
>>>
>>>


 Derek



>>>
>>>
>>> --
>>> Lift, the simply functional web framework http://liftweb.net
>>> Collaborative Task Management http://much4.us
>>> Follow me: http://twitter.com/dpp
>>> Git some: http://github.com/dpp
>>>
>>>
>>>
>>
>>
>>
>
>
> --
> Lift, the simply functional web framework http://liftweb.net
> Collaborative Task Management http://much4.us
> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: noob question: working with scala 2.7.2

2008-12-04 Thread Josh Suereth
Here's your issue:

[INFO] Archetype repository missing. Using the one from
[net.liftweb:lift-archetype-blank:RELEASE ->
http://scala-tools.org/repo-releases] found in catalog internal


It's not pulling from the snapshot repository.

Try using archetype:create instead of archetype:generate.   (The generate
goal is from the new alpha of the archetype plugin and I don't htink it uses
the -DremoteRepositories property).


-Josh


On Thu, Dec 4, 2008 at 9:21 AM, Harshad RJ <[EMAIL PROTECTED]> wrote:

>
>
> On Thu, Dec 4, 2008 at 6:39 PM, David Bernard <[EMAIL PROTECTED]>wrote:
>
>>
>> It's the correct server.
>>
>> Could you retry (the command from the initial mail) with "-e" argument
>> at end (to print error + stackstrace) ?
>
>
>
> Here is the whole trace:
> ~/local/apache-maven-2.0.9/bin/mvn archetype:generate -U
> \  > ~/w/lift <
> -DarchetypeGroupId=net.liftweb \
> -DarchetypeArtifactId=lift-archetype-blank \
> -DarchetypeVersion=0.10-SNAPSHOT \
> -DremoteRepositories=http://scala-tools.org/repo-snapshots \
> -DgroupId=foogroup -DartifactId=foo -e
> Warning: JAVA_HOME environment variable is not set.
> + Error stacktraces are turned on.
> [INFO] Scanning for projects...
> [INFO] Searching repository for plugin with prefix: 'archetype'.
> [INFO] org.apache.maven.plugins: checking for updates from central
> [INFO] org.codehaus.mojo: checking for updates from central
> [INFO] artifact org.apache.maven.plugins:maven-archetype-plugin: checking
> for updates from central
> [INFO]
> 
> [INFO] Building Maven Default Project
> [INFO]task-segment: [archetype:generate] (aggregator-style)
> [INFO]
> 
> [INFO] Preparing archetype:generate
> [INFO] No goals needed for project - skipping
> [INFO] Setting property: classpath.resource.loader.class =>
> 'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'.
> [INFO] Setting property: velocimacro.messages.on => 'false'.
> [INFO] Setting property: resource.loader => 'classpath'.
> [INFO] Setting property: resource.manager.logwhenfound => 'false'.
> [INFO] [archetype:generate]
> [INFO] Generating project in Interactive mode
> [INFO] Archetype repository missing. Using the one from
> [net.liftweb:lift-archetype-blank:RELEASE ->
> http://scala-tools.org/repo-releases] found in catalog internal
> [INFO] snapshot net.liftweb:lift-archetype-blank:0.10-SNAPSHOT: checking
> for updates from lift-archetype-blank-repo
> Downloading:
> http://scala-tools.org/repo-releases/net/liftweb/lift-archetype-blank/0.10-SNAPSHOT/lift-archetype-blank-0.10-SNAPSHOT.jar
> [INFO]
> 
> [ERROR] BUILD FAILURE
> [INFO]
> 
> [INFO] The desired archetype does not exist
> (net.liftweb:lift-archetype-blank:0.10-SNAPSHOT)
> [INFO]
> 
> [INFO] Trace
> org.apache.maven.BuildFailureException: The desired archetype does not
> exist (net.liftweb:lift-archetype-blank:0.10-SNAPSHOT)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:579)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:512)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:482)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:227)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
> at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
> at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
> at
> org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
> at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> Caused by: org.apache.maven.plugin.MojoFailureException: The desired
> archetype does not exist (net.liftweb:lift-archetype-blank:0.10-SNAPSHOT)
> at
> org.apache.maven.archetype.

[Lift] Re: noob question: working with scala 2.7.2

2008-12-04 Thread Harshad RJ
On Thu, Dec 4, 2008 at 6:39 PM, David Bernard <[EMAIL PROTECTED]>wrote:

>
> It's the correct server.
>
> Could you retry (the command from the initial mail) with "-e" argument
> at end (to print error + stackstrace) ?



Here is the whole trace:
~/local/apache-maven-2.0.9/bin/mvn archetype:generate -U
\  > ~/w/lift <
-DarchetypeGroupId=net.liftweb \
-DarchetypeArtifactId=lift-archetype-blank \
-DarchetypeVersion=0.10-SNAPSHOT \
-DremoteRepositories=http://scala-tools.org/repo-snapshots \
-DgroupId=foogroup -DartifactId=foo -e
Warning: JAVA_HOME environment variable is not set.
+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'archetype'.
[INFO] org.apache.maven.plugins: checking for updates from central
[INFO] org.codehaus.mojo: checking for updates from central
[INFO] artifact org.apache.maven.plugins:maven-archetype-plugin: checking
for updates from central
[INFO]

[INFO] Building Maven Default Project
[INFO]task-segment: [archetype:generate] (aggregator-style)
[INFO]

[INFO] Preparing archetype:generate
[INFO] No goals needed for project - skipping
[INFO] Setting property: classpath.resource.loader.class =>
'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'.
[INFO] Setting property: velocimacro.messages.on => 'false'.
[INFO] Setting property: resource.loader => 'classpath'.
[INFO] Setting property: resource.manager.logwhenfound => 'false'.
[INFO] [archetype:generate]
[INFO] Generating project in Interactive mode
[INFO] Archetype repository missing. Using the one from
[net.liftweb:lift-archetype-blank:RELEASE ->
http://scala-tools.org/repo-releases] found in catalog internal
[INFO] snapshot net.liftweb:lift-archetype-blank:0.10-SNAPSHOT: checking for
updates from lift-archetype-blank-repo
Downloading:
http://scala-tools.org/repo-releases/net/liftweb/lift-archetype-blank/0.10-SNAPSHOT/lift-archetype-blank-0.10-SNAPSHOT.jar
[INFO]

[ERROR] BUILD FAILURE
[INFO]

[INFO] The desired archetype does not exist
(net.liftweb:lift-archetype-blank:0.10-SNAPSHOT)
[INFO]

[INFO] Trace
org.apache.maven.BuildFailureException: The desired archetype does not exist
(net.liftweb:lift-archetype-blank:0.10-SNAPSHOT)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:579)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:512)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:482)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:227)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at
org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoFailureException: The desired
archetype does not exist (net.liftweb:lift-archetype-blank:0.10-SNAPSHOT)
at
org.apache.maven.archetype.mojos.CreateProjectFromArchetypeMojo.execute(CreateProjectFromArchetypeMojo.java:201)
at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
... 16 more
[INFO]

[INFO] Total time: 32 seconds
[INFO] Finished at: Thu Dec 04 19:53:00 IST 2008
[INFO] Final Memory: 11M/28M
[INFO]


-- 
Harshad RJ
http://hrj.wikidot.com

--~--~-~--~~~---~--~~
Yo

[Lift] Re: noob question: working with scala 2.7.2

2008-12-04 Thread Harshad RJ
On Thu, Dec 4, 2008 at 5:40 PM, Tim Perrett <[EMAIL PROTECTED]> wrote:

>
>
>
> Regarding my previous note with the maven command, can you check the
> pom.xml
> of the generated project and tell us if  is 2.7.1 or 2.7.2 ?
>

It is 2.7.1.

These are the the choices I made (interactively):

 Choose archetype:
1: http://scala-tools.org/ -> scala-archetype-simple (A simple scala
project)
2: http://scala-tools.org/ -> lift-archetype-blank (A blank/empty liftweb
project)
3: http://scala-tools.org/ -> lift-archetype-basic (A basic liftweb project
(with DB, css, ...))
Choose a number:  (1/2/3): 2
Downloading:
http://scala-tools.org/repo-releases/net/liftweb/lift-archetype-blank/0.9/lift-archetype-blank-0.9.jar
10K downloaded
Define value for groupId: : foo
Define value for artifactId: : foohello
Define value for version:  1.0-SNAPSHOT: :
Define value for package:  foo: :
Confirm properties configuration:
groupId: foo
artifactId: foohello
version: 1.0-SNAPSHOT
package: foo
 Y: : Y


-- 
Harshad RJ
http://hrj.wikidot.com

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



[Lift] Re: noob question: working with scala 2.7.2

2008-12-04 Thread David Bernard

It's the correct server.

Could you retry (the command from the initial mail) with "-e" argument
at end (to print error + stackstrace) ?

On Thu, Dec 4, 2008 at 13:10, Tim Perrett <[EMAIL PROTECTED]> wrote:
>
>
> Pinging scala-tools.org works no worries for me. It does appear that
> liberty.harpoon.me points to that server as well. No biggy tho, 2 domains
> pointing to the same server that is.
>
> Regarding my previous note with the maven command, can you check the pom.xml
> of the generated project and tell us if  is 2.7.1 or 2.7.2 ?
>
> Thanks
>
> Tim
>
> On 04/12/2008 11:51, "Harshad RJ" <[EMAIL PROTECTED]> wrote:
>
>> Ping gives me this somewhat suspicious result (harpoon.me ?)
>>
>> PING scala-tools.org   (64.27.11.180
>>  ) 56(84) bytes of data.
>> 64 bytes from liberty.harpoon.me (64.27.11.180  ):
>> icmp_seq=1 ttl=50 time=281 ms
>>
>> Do you guys get the same? I am sorry if this is getting off-topic for Lift,
>> but I am stuck miserably right now.
>>
>> Btw, I don't have any proxies of any sort.
>>
>>
>> On Thu, Dec 4, 2008 at 4:56 PM, David Bernard <[EMAIL PROTECTED]>
>> wrote:
>>>
>>> I don't know what is the exact pbs (can't reproduce with the cmdline
>>> you provided).
>>> The scala-tools.org   has migrate IP last week which
>>> ip do you have ?
>>> Do you use a proxy or a maven repository proxy ?
>>>
>
>
>
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: noob question: working with scala 2.7.2

2008-12-04 Thread Tim Perrett


Pinging scala-tools.org works no worries for me. It does appear that
liberty.harpoon.me points to that server as well. No biggy tho, 2 domains
pointing to the same server that is.

Regarding my previous note with the maven command, can you check the pom.xml
of the generated project and tell us if  is 2.7.1 or 2.7.2 ?

Thanks

Tim

On 04/12/2008 11:51, "Harshad RJ" <[EMAIL PROTECTED]> wrote:

> Ping gives me this somewhat suspicious result (harpoon.me ?)
> 
> PING scala-tools.org   (64.27.11.180
>  ) 56(84) bytes of data.
> 64 bytes from liberty.harpoon.me (64.27.11.180  ):
> icmp_seq=1 ttl=50 time=281 ms
> 
> Do you guys get the same? I am sorry if this is getting off-topic for Lift,
> but I am stuck miserably right now.
> 
> Btw, I don't have any proxies of any sort.
> 
> 
> On Thu, Dec 4, 2008 at 4:56 PM, David Bernard <[EMAIL PROTECTED]>
> wrote:
>> 
>> I don't know what is the exact pbs (can't reproduce with the cmdline
>> you provided).
>> The scala-tools.org   has migrate IP last week which
>> ip do you have ?
>> Do you use a proxy or a maven repository proxy ?
>> 



--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: noob question: working with scala 2.7.2

2008-12-04 Thread Harshad RJ
Ping gives me this somewhat suspicious result (harpoon.me ?)

PING scala-tools.org (64.27.11.180) 56(84) bytes of data.
64 bytes from liberty.harpoon.me (64.27.11.180): icmp_seq=1 ttl=50 time=281
ms

Do you guys get the same? I am sorry if this is getting off-topic for Lift,
but I am stuck miserably right now.

Btw, I don't have any proxies of any sort.


On Thu, Dec 4, 2008 at 4:56 PM, David Bernard <[EMAIL PROTECTED]>wrote:

>
> I don't know what is the exact pbs (can't reproduce with the cmdline
> you provided).
> The scala-tools.org has migrate IP last week which ip do you have ?
> Do you use a proxy or a maven repository proxy ?
>
>
-- 
Harshad RJ
http://hrj.wikidot.com

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



[Lift] Re: noob question: working with scala 2.7.2

2008-12-04 Thread David Bernard

On Thu, Dec 4, 2008 at 10:52, Harshad RJ <[EMAIL PROTECTED]> wrote:
>
>
> On Thu, Dec 4, 2008 at 3:02 PM, David Bernard <[EMAIL PROTECTED]>
> wrote:
>>
>> On Thu, Dec 4, 2008 at 09:22, Harshad RJ <[EMAIL PROTECTED]> wrote:
>> > That's strange!
>> >
>> > I did see those tips on blowing away ~/.m2, and in fact, I had started
>> > with
>> > a clean Fedora install.
>> >
>> > For extra measure, I tried removing ~/.m2 now, and I still get the same
>> > error...
>> >
>> > One thing I notice is that, at this location:
>> >
>> > http://scala-tools.org/repo-snapshots/net/liftweb/lift-archetype-blank/0.10-SNAPSHOT/
>> >
>> > ... I cann't see any
>> > lift-archetype-blank-0.10-SNAPSHOT.jar
>> >
>> > which is the file maven is looking for.
>> >
>> > There are a couple of similarly named files such as
>> > lift-archetype-blank-0.10-20081124.173443-167-sources.jar
>> >
>> > Is that how it is supposed to be?
>>
>> maven could store SNAPSHOT in two way (configuration of the project):
>> * one jar SNAPSHOT
>> * several jar SNAPSHOT replace by timestamp, in this case maven use
>> metadata to find the right one
>
>
> Ah, thanks for the info.
>
> What else can I try?
>
> I am using Fedora 9, with scala 2.7.2, openjdk, maven 2.0.9.
>
> Btw, I have been using lift + maven + scala 2.7.1 for quite some time
> without any problems.

I don't know what is the exact pbs (can't reproduce with the cmdline
you provided).
The scala-tools.org has migrate IP last week which ip do you have ?
Do you use a proxy or a maven repository proxy ?

>
>
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] DB connection not closed?

2008-12-04 Thread Joachim A.
Hi,
I have a lift application running in a tomcat container (using 0.10-SNAPSHOT) 
using a MySQL database. Tomcat is setup to provide connections via JNDI.

It runs very well. But now it has happened twice that the connection to MySQL 
fails. In the log appears a section which says that the connection to the 
database was never released.
I guess this is not normal for Lift :)  I assumed that DB.use() takes care of 
that.

What am I doing wrong with the DB handling? How can I make sure that the 
connections get closed?


I attached the relevant part with the stacktrace. 
bootstrap.liftweb.TransactionalWrapper is a wrapper to enable transactions 
with the DB, it has been given to my by David P. on this list (the code same 
as DB.buildLoanWrapper, I think).

Thanks a lot for you help,
Joachim

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---

INFO   | jvm 1| 2008/12/03 05:23:56 | DBCP object created 2008-12-02 
03:10:41 by the following code was never closed:
INFO   | jvm 1| 2008/12/03 05:23:56 | java.lang.Exception
INFO   | jvm 1| 2008/12/03 05:23:56 |   at 
org.apache.tomcat.dbcp.dbcp.AbandonedTrace.setStackTrace(AbandonedTrace.java:160)
INFO   | jvm 1| 2008/12/03 05:23:56 |   at 
org.apache.tomcat.dbcp.dbcp.AbandonedObjectPool.borrowObject(AbandonedObjectPool.java:86)
INFO   | jvm 1| 2008/12/03 05:23:56 |   at 
org.apache.tomcat.dbcp.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:96)
INFO   | jvm 1| 2008/12/03 05:23:56 |   at 
org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
INFO   | jvm 1| 2008/12/03 05:23:56 |   at 
net.liftweb.mapper.DB$$anonfun$3$$anonfun$apply$3.apply(DB.scala:82)
INFO   | jvm 1| 2008/12/03 05:23:56 |   at 
net.liftweb.mapper.DB$$anonfun$3$$anonfun$apply$3.apply(DB.scala:81)
INFO   | jvm 1| 2008/12/03 05:23:56 |   at 
net.liftweb.util.ControlHelpers$class.tryo(ControlHelpers.scala:39)
INFO   | jvm 1| 2008/12/03 05:23:56 |   at 
net.liftweb.util.Helpers$.tryo(Helpers.scala:29)
INFO   | jvm 1| 2008/12/03 05:23:56 |   at 
net.liftweb.util.ControlHelpers$class.tryo(ControlHelpers.scala:53)
INFO   | jvm 1| 2008/12/03 05:23:56 |   at 
net.liftweb.util.Helpers$.tryo(Helpers.scala:29)
INFO   | jvm 1| 2008/12/03 05:23:56 |   at 
net.liftweb.mapper.DB$$anonfun$3.apply(DB.scala:81)
INFO   | jvm 1| 2008/12/03 05:23:56 |   at 
net.liftweb.mapper.DB$$anonfun$3.apply(DB.scala:84)
INFO   | jvm 1| 2008/12/03 05:23:56 |   at 
net.liftweb.util.EmptyCan.openOr(Can.scala:314)
INFO   | jvm 1| 2008/12/03 05:23:56 |   at 
net.liftweb.mapper.DB$.newConnection(DB.scala:80)
INFO   | jvm 1| 2008/12/03 05:23:56 |   at 
net.liftweb.mapper.DB$.getConnection(DB.scala:117)
INFO   | jvm 1| 2008/12/03 05:23:56 |   at 
net.liftweb.mapper.DB$.use(DB.scala:271)
INFO   | jvm 1| 2008/12/03 05:23:56 |   at 
bootstrap.liftweb.TransactionalWrapper$$anon$1.apply(TransactionalWrapper.scala:31)
INFO   | jvm 1| 2008/12/03 05:23:56 |   at 
net.liftweb.http.S$.net$liftweb$http$S$$doAround(S.scala:377)
INFO   | jvm 1| 2008/12/03 05:23:56 |   at 
net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_nest2InnerInit$1.apply(S.scala:455)
INFO   | jvm 1| 2008/12/03 05:23:56 |   at 
net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:31)
INFO   | jvm 1| 2008/12/03 05:23:56 |   at 
net.liftweb.http.S$.net$liftweb$http$S$$_nest2InnerInit(S.scala:454)
INFO   | jvm 1| 2008/12/03 05:23:56 |   at 
net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_innerInit$1$$anonfun$apply$18$$anonfun$apply$19$$anonfun$apply$20$$anonfun$apply$21$$anonfun$apply$22.apply(S.scala:474)
INFO   | jvm 1| 2008/12/03 05:23:56 |   at 
net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:31)
INFO   | jvm 1| 2008/12/03 05:23:56 |   at 
net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_innerInit$1$$anonfun$apply$18$$anonfun$apply$19$$anonfun$apply$20$$anonfun$apply$21.apply(S.scala:473)
INFO   | jvm 1| 2008/12/03 05:23:56 |   at 
net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:31)
INFO   | jvm 1| 2008/12/03 05:23:56 |   at 
net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_innerInit$1$$anonfun$apply$18$$anonfun$apply$19$$anonfun$apply$20.apply(S.scala:472)
INFO   | jvm 1| 2008/12/03 05:23:56 |   at 
net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:31)
INFO   | jvm 1| 2008/12/03 05:23:56 |   at 
net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_innerInit$1$$anonfun$apply$18$$anonfun$apply$19.apply(S.scala:471)
INFO   | jvm 1| 2008/12

[Lift] Re: a plea for documentation

2008-12-04 Thread philip

Hi,

Actually my mind keeps flipping between SEAM and Liftweb, for months.

Today my feeling is I should focus on the JPA for my project in Java
using seam generate, then to take the JPA across to the Liftweb
environment and to program my website in Liftweb. Since my database is
big, nearly 100 tables in mysql. Of course torn between doing it
completely in SEAM or using JPA/Liftweb.

The great thing about Liftweb is the community is going good now - and
I guess my quesitons will get answered, also I would tend to
contribute back to the community. As opposed to completely doing it in
SEAM, sure there's documentation, but I wouldn't be contributing back.
Also I like Scala and I like where Liftweb is going.

Anyway, just thoughts, Philip


On Nov 30, 4:34 pm, philip <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I also agree with David that I'm very excited to use Lift and have
> great enthusiasm about it, and I play around with it now and then, but
> I'm reluctant to use it on my big project until my understanding is at
> a point of strong confidence. So like a weight lifter, I'm in
> training.
> When I compare it to SEAM, SEAM is also complex but there is so much
> documentation I won't get stuck so I'm willing to use it on the big
> project.
>
> Thanks, Philip
>
> On Nov 27, 10:15 am, "David Stein" <[EMAIL PROTECTED]> wrote:
>
>
>
> > On Wed, Nov 26, 2008 at 3:10 PM, David Pollak
>
> > <[EMAIL PROTECTED]> wrote:
> > > If you've been following the threads then you've seen that I'm devoting 
> > > the
> > > next 4 months to Lift 1.0 and documentation. What more do you want?  What
> > > are you planning to contribute to the process other than complaining that
> > > it's somehow not enough?
>
> > Oops.  My apologies for being so irritable.  Funny, my girlfriend has
> > also been complaining about me this week, so maybe I'm just oblivious
> > to how I come across!
>
> > I definitely didn't mean to imply that we need more from the
> > committers, per se, but I might suggest that a highly effective use of
> > their time would be to document the API before writing books, which
> > could take months.  Documenting the API is probably 15 hours tops, and
> > with 6-12 committers it's not a lot overall.  With the API documented,
> > many of us bewildered folks on the sidelines could step up and write
> > tutorials and sample projects.
>
> > I have a little egg on my face because I don't think I gave a thorough
> > read-through of the book.  I started looking at a few chapters a while
> > ago, but they were more outlines at the time.  Somehow I missed the
> > chapters which are actually pretty comprehensive, like the one on JPA.
> >  Very much looking forward to this!
>
> > Sorry again, and please ignore me as necessary,
> > DS

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: noob question: working with scala 2.7.2

2008-12-04 Thread Harshad RJ
On Thu, Dec 4, 2008 at 3:02 PM, David Bernard <[EMAIL PROTECTED]>wrote:

>
> On Thu, Dec 4, 2008 at 09:22, Harshad RJ <[EMAIL PROTECTED]> wrote:
> > That's strange!
> >
> > I did see those tips on blowing away ~/.m2, and in fact, I had started
> with
> > a clean Fedora install.
> >
> > For extra measure, I tried removing ~/.m2 now, and I still get the same
> > error...
> >
> > One thing I notice is that, at this location:
> >
> http://scala-tools.org/repo-snapshots/net/liftweb/lift-archetype-blank/0.10-SNAPSHOT/
> >
> > ... I cann't see any
> > lift-archetype-blank-0.10-SNAPSHOT.jar
> >
> > which is the file maven is looking for.
> >
> > There are a couple of similarly named files such as
> > lift-archetype-blank-0.10-20081124.173443-167-sources.jar
> >
> > Is that how it is supposed to be?
>
> maven could store SNAPSHOT in two way (configuration of the project):
> * one jar SNAPSHOT
> * several jar SNAPSHOT replace by timestamp, in this case maven use
> metadata to find the right one
>


Ah, thanks for the info.

What else can I try?

I am using Fedora 9, with scala 2.7.2, openjdk, maven 2.0.9.

Btw, I have been using lift + maven + scala 2.7.1 for quite some time
without any problems.

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: noob question: working with scala 2.7.2

2008-12-04 Thread Harshad RJ
On Thu, Dec 4, 2008 at 2:35 PM, Tim Perrett <[EMAIL PROTECTED]> wrote:

>
> Guys,
>
> Personally, I wouldnt bother with those long commands, I find there
> impossible to remember! Try:
>
> mvn archetype:generate -DarchetypeCatalog=http://scala-tools.org/


This sort-of worked. It did create the project, but invoking "mvn jetty:run"
has started  a download of scala 2.7.1 (among other 2.7.1 related stuff)

I have a hunch it is not going to work.


-- 
Harshad RJ
http://hrj.wikidot.com

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



[Lift] Re: noob question: working with scala 2.7.2

2008-12-04 Thread David Bernard

On Thu, Dec 4, 2008 at 09:22, Harshad RJ <[EMAIL PROTECTED]> wrote:
> That's strange!
>
> I did see those tips on blowing away ~/.m2, and in fact, I had started with
> a clean Fedora install.
>
> For extra measure, I tried removing ~/.m2 now, and I still get the same
> error...
>
> One thing I notice is that, at this location:
> http://scala-tools.org/repo-snapshots/net/liftweb/lift-archetype-blank/0.10-SNAPSHOT/
>
> ... I cann't see any
> lift-archetype-blank-0.10-SNAPSHOT.jar
>
> which is the file maven is looking for.
>
> There are a couple of similarly named files such as
> lift-archetype-blank-0.10-20081124.173443-167-sources.jar
>
> Is that how it is supposed to be?

maven could store SNAPSHOT in two way (configuration of the project):
* one jar SNAPSHOT
* several jar SNAPSHOT replace by timestamp, in this case maven use
metadata to find the right one

>
>
> On Thu, Dec 4, 2008 at 1:16 PM, Erick Fleming <[EMAIL PROTECTED]> wrote:
>>
>> I tried your command on my machine and all went well.  You might want to
>> try and blow away your entire maven repository ~/.m2
>>
>> This was a problem discussed last week after 2.7.2 was released.
>
>
> --
> Harshad RJ
> http://hrj.wikidot.com
>
> >
>

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



[Lift] Re: noob question: working with scala 2.7.2

2008-12-04 Thread Tim Perrett

Guys,

Personally, I wouldnt bother with those long commands, I find there
impossible to remember! Try:

mvn archetype:generate -DarchetypeCatalog=http://scala-tools.org/

This will present you with an interactive shell - just answer the
questions and it will create a skeleton project for you.

You will also benefit from reading this:

http://liftweb.net/index.php/Maven_Mini_Guide

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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: noob question: working with scala 2.7.2

2008-12-04 Thread Harshad RJ
That's strange!

I did see those tips on blowing away ~/.m2, and in fact, I had started with
a clean Fedora install.

For extra measure, I tried removing ~/.m2 now, and I still get the same
error...

One thing I notice is that, at this location:
http://scala-tools.org/repo-snapshots/net/liftweb/lift-archetype-blank/0.10-SNAPSHOT/

... I cann't see any
lift-archetype-blank-0.10-SNAPSHOT.jar

which is the file maven is looking for.

There are a couple of similarly named files such as
lift-archetype-blank-0.10-20081124.173443-167-sources.jar

Is that how it is supposed to be?


On Thu, Dec 4, 2008 at 1:16 PM, Erick Fleming <[EMAIL PROTECTED]> wrote:

> I tried your command on my machine and all went well.  You might want to
> try and blow away your entire maven repository ~/.m2
>
> This was a problem discussed last week after 2.7.2 was released.
>
>

-- 
Harshad RJ
http://hrj.wikidot.com

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