[Lift] Re: what provides classpath/jquery.js?

2010-01-09 Thread Marius
It is given by LiftRules.resourceServerPath. Resources places in /src/
resources/toserve fodler are not served by container, but they are
served by Lift. There is a ResourceServer class that manages that. if
you put your own resources here you need to call ResourceServer.allow
(in your boot) and grant access to those resources. This is a security
related mechanism.

Br's,
Marius

On Jan 9, 3:38 am, harmanjd harma...@gmail.com wrote:
 I am working through the StartingWithLift document and saw that the
 page includes /classpath/jquery.js.

 Is that something that jetty supplies, or is that supplied by the lift
 framework?  I didn't see that path mapped in the Boot class or
 anything.

 Thanks,

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




[Lift] Re: Lift AuthRoles, httpAuthProtectedResource

2010-01-09 Thread Marius
Ok, the changes are on review board.

Br's,
Marius

On Jan 8, 11:36 pm, Marius marius.dan...@gmail.com wrote:
 On Jan 8, 10:58 pm, David Pollak feeder.of.the.be...@gmail.com
 wrote:

  On Fri, Jan 8, 2010 at 12:55 PM, Marius marius.dan...@gmail.com wrote:
   I definitely agree for httpAuthProctectedResource to take a Req
   instead of a ParsePath even this is a breaking change but I doubt that
   many people are using this yet. I could implement this tomorrow if
   this is fine with everyone.

  We've got code-slush on Sunday so we can do testing before Wednesday's
  2.0-M1 release so as long as it gets in before Sunday, I'm cool.

  Tim -- Is this going to mess with any of your existing code?

  Hmmm... how about adding a ParsePath.unapply(req: Req) that would make sure
  we had source compatibility?

 We would have that but it looks a bit hacky to me.



   Br's,
   Marius

   On Jan 8, 10:28 pm, David Pollak feeder.of.the.be...@gmail.com
   wrote:
On Fri, Jan 8, 2010 at 12:21 PM, Ethan Jewett esjew...@gmail.com
   wrote:
 David,

 For my use case (where pretty much the entire API is authenticated
 anyway), I would be perfectly fine if there was a second signature
 that tested a Req before the dispatch, allowing me to do my
 authorization code at that point. (And if the full State was available
 at this point, that'd be great, but I realize the difficulties with
 that.)

 I can think of use cases where a resource should be readable
 (GetRequest) without authentication but writable (Post/PutRequest)
 only with authentication  authorization. The API for a public wiki,
 for example. These use-cases will require httpAuthProtectedResource to
 take a Req instead of a ParsePath.

 Currently my implementation is to just dispense with the whole thing
 and deal with authorization in the stateful dispatch table by putting
 the authorization check matches before the application code matches.
 However, the only thing stopping a line-switch from ruining my
 authorization scheme right now is my unit tests, and I'd prefer if
 there were a solution that guaranteed evaluation of the authorization
 checks before the application code.

Having auth guaranteed before the app code is hit is the right answer.

Let's wait for Marius to give his thoughts as he was instrumental in the
Auth code (and will probably own whatever implementation we settle on).

 Thanks for taking the time to look at this!
 Ethan

 On Fri, Jan 8, 2010 at 1:28 PM, David Pollak
 feeder.of.the.be...@gmail.com wrote:
  Ethan,

  This is a very interesting issue.

  You're right the Req (uest) instance is not available at the time of
   the
  auth call.  Normally, the Req object is available in S(tate), but S
   the S
  context is not entered at the time of the auth.

  So, I think we have two choices:

  Change up the signature of httpAuthProctectedResource to have a Req
 instead
  of the ParsePath
  Have a second signature that's tested with a Req

  The former is cleaner, but breaks people's code.  The latter is
   uglier
 but
  gives the functionality that you're looking for.

  Anyone have any thoughts of breakage vs. lack-of-elegance?

  Thanks,

  David

  On Fri, Jan 8, 2010 at 9:45 AM, Ethan Jewett esjew...@gmail.com
   wrote:

  Hi all,

  Let me preface this by saying that I'm learning Lift, so I'm a
  relative newbie. Please be gentle.

  I'm struggling to figure out a good way to do role-based
   authorization
  natively in Lift. Based on examples in the Lift book, the wiki, and
  reading the Lift source, I've gotten to

  val roles = AuthRole(super-admin,
   AuthRole(admin,
     AuthRole(user)
   ),
     AuthRole(integration-admin)
  )

  LiftRules.httpAuthProtectedResource.prepend {
   case ParsePath(api2 :: users :: _, _, _, _) =
  roles.getRoleByName(integration-admin)
  }

  This is with the intention of introducing Lift-based roles into the
  ESME code base, starting with the API. (ESME is an enterprise
  micro-messaging system:
 http://cwiki.apache.org/confluence/display/ESME/Index)

  There are two issues with this approach:

  1. Because LiftRules.httpAuthProtectedResource takes ParsePath() as
  its match instead of Req(), I can't require a different role for a
  GetRequest vs. a PostRequest, for example. This is a requirement 
  for
   a
  pure resource-oriented (RESTful) approach, since we'll often want 
  to
  authorize users to read on a resource (GetRequest), but not
  write/change it (Post/Put/DeleteRequest).

  2. It appears to require use of HTTP basic or digest authentication
   in
  order to assign a role to a user (using userRoles). We don't
   currently
  want to use either. (For our API we're currently using a 
  

[Lift] Can't find JS in /classpath/

2010-01-09 Thread Mads Hartmann
Hello everyone
I'm having a problem with one of the javascript files that lift
includes in the header with the path /classpath/... I'm using the
autocomplete widget and it's outputing all the right code, but it
can't find js file:

script type=text/javascript src=/classpath/autocomplete/
jquery.autocomplete.js/script

It can find the jquery.js file located at /classpath/ though.

-- info from the server ---
INFO - Service request (GET) / took 1779 Milliseconds
INFO - Service request (GET) /classpath/jquery.js took 44 Milliseconds
INFO - Service request (GET) /classpath/json.js took 5 Milliseconds
INFO - Service request (GET) /classpath/autocomplete/
jquery.autocomplete.js took 1 Milliseconds
INFO - Service request (GET) /classpath/autocomplete/
jquery.autocomplete.css took 1 Milliseconds
INFO - Service request (GET) /ajax_request/liftAjax.js took 110
Milliseconds
INFO - Service request (GET) /favicon.ico took 65 Milliseconds
-- info from the server ends ---

Does anyone know how to solve this one?

Thanks again,
Mads Hartmann Jensen


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




[Lift] Re: problems with file upload inside modal

2010-01-09 Thread stephanos
Okay, this took my a while (new to git/github) - but here is my
stripped down version of the problem:
http://github.com/stephanos/liftweb-fileupload-modal-issue/

Hope it helps :-)

On Jan 7, 8:14 pm, David Pollak feeder.of.the.be...@gmail.com wrote:
 Stephanos,

 It would be ideal if you could put up a quick project on GitHub that
 demonstrates the problem.  Having reproducible code helps us solve problems
 faster.  Any chance you could do that?

 Thanks,

 David

 On Wed, Jan 6, 2010 at 11:17 PM, stephanos 
 stephan.beh...@googlemail.comwrote:



  Hi guys,

  I'm stuck with this problem for a few days now and need help. I want
  users to be able to upload a ZIP file. When I embed this functionality
  directly in the page it works flawlessly - but I need to put it into a
  modal and that's were the trouble starts.

  When I submit the form it executes correctly but it prints (!) the
  response to the browser:
    try{jQuery(#lift__noticesContainer__).each(function(i)
  {this.innerHTML = div class=\success\ulliThanks for the
  upload!/li/ul /div;});} catch (e) {}

  The code looks right but it shouldn't print to the screen. What am I
  doing wrong?

  #
  My current progress (using M8):

  HTML:
     lift:SourceUpload form=post multipart=true
         fieldset style=width: 90%; margin: 0 auto
             strongAt first/strong select the zip file upload:file/

             br/br/
             and strongthen/strong push
             input type=submit value=upload!/
         /fieldset
     /lift:SourceUpload

  CODE:
     def request(in: NodeSeq) =   // opens file upload modal
         ajaxButton(in, () = S.runTemplate(List(/katas/share)).
                    map(ns = ModalDialog(ns)) openOr Alert(Internal
  error: Couldn't find template!))

     def render(in: NodeSeq): NodeSeq = bind(upload, file -
  SHtml.fileUpload(processFile _))
     

  Cheers,
  Stephan

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

 --
 Lift, the simply functional web frameworkhttp://liftweb.net
 Beginning Scalahttp://www.apress.com/book/view/1430219890
 Follow me:http://twitter.com/dpp
 Surf the harmonics
-- 
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




[Lift] Re: Can't find JS in /classpath/

2010-01-09 Thread Mads Hartmann
Wohoo, I solved this one myself, success! ;)

You have to add AutoComplete.init() somewhere in your boot.scala file

On Jan 9, 10:05 am, Mads Hartmann mads...@gmail.com wrote:
 Hello everyone
 I'm having a problem with one of the javascript files that lift
 includes in the header with the path /classpath/... I'm using the
 autocomplete widget and it's outputing all the right code, but it
 can't find js file:

 script type=text/javascript src=/classpath/autocomplete/
 jquery.autocomplete.js/script

 It can find the jquery.js file located at /classpath/ though.

 -- info from the server ---
 INFO - Service request (GET) / took 1779 Milliseconds
 INFO - Service request (GET) /classpath/jquery.js took 44 Milliseconds
 INFO - Service request (GET) /classpath/json.js took 5 Milliseconds
 INFO - Service request (GET) /classpath/autocomplete/
 jquery.autocomplete.js took 1 Milliseconds
 INFO - Service request (GET) /classpath/autocomplete/
 jquery.autocomplete.css took 1 Milliseconds
 INFO - Service request (GET) /ajax_request/liftAjax.js took 110
 Milliseconds
 INFO - Service request (GET) /favicon.ico took 65 Milliseconds
 -- info from the server ends ---

 Does anyone know how to solve this one?

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




[Lift] Re: Lift AuthRoles, httpAuthProtectedResource

2010-01-09 Thread Timothy Perrett
David,

Thanks for considering me - right now, the breakage is so small and
only affects one, small app in production that is soon going to be
swallowed by something else i've just written so its a non-issue for
me right now.

Go for it :-)

Cheers, Tim

On Jan 8, 8:58 pm, David Pollak feeder.of.the.be...@gmail.com wrote:
 On Fri, Jan 8, 2010 at 12:55 PM, Marius marius.dan...@gmail.com wrote:
  I definitely agree for httpAuthProctectedResource to take a Req
  instead of a ParsePath even this is a breaking change but I doubt that
  many people are using this yet. I could implement this tomorrow if
  this is fine with everyone.

 We've got code-slush on Sunday so we can do testing before Wednesday's
 2.0-M1 release so as long as it gets in before Sunday, I'm cool.

 Tim -- Is this going to mess with any of your existing code?

 Hmmm... how about adding a ParsePath.unapply(req: Req) that would make sure
 we had source compatibility?







  Br's,
  Marius

  On Jan 8, 10:28 pm, David Pollak feeder.of.the.be...@gmail.com
  wrote:
   On Fri, Jan 8, 2010 at 12:21 PM, Ethan Jewett esjew...@gmail.com
  wrote:
David,

For my use case (where pretty much the entire API is authenticated
anyway), I would be perfectly fine if there was a second signature
that tested a Req before the dispatch, allowing me to do my
authorization code at that point. (And if the full State was available
at this point, that'd be great, but I realize the difficulties with
that.)

I can think of use cases where a resource should be readable
(GetRequest) without authentication but writable (Post/PutRequest)
only with authentication  authorization. The API for a public wiki,
for example. These use-cases will require httpAuthProtectedResource to
take a Req instead of a ParsePath.

Currently my implementation is to just dispense with the whole thing
and deal with authorization in the stateful dispatch table by putting
the authorization check matches before the application code matches.
However, the only thing stopping a line-switch from ruining my
authorization scheme right now is my unit tests, and I'd prefer if
there were a solution that guaranteed evaluation of the authorization
checks before the application code.

   Having auth guaranteed before the app code is hit is the right answer.

   Let's wait for Marius to give his thoughts as he was instrumental in the
   Auth code (and will probably own whatever implementation we settle on).

Thanks for taking the time to look at this!
Ethan

On Fri, Jan 8, 2010 at 1:28 PM, David Pollak
feeder.of.the.be...@gmail.com wrote:
 Ethan,

 This is a very interesting issue.

 You're right the Req (uest) instance is not available at the time of
  the
 auth call.  Normally, the Req object is available in S(tate), but S
  the S
 context is not entered at the time of the auth.

 So, I think we have two choices:

 Change up the signature of httpAuthProctectedResource to have a Req
instead
 of the ParsePath
 Have a second signature that's tested with a Req

 The former is cleaner, but breaks people's code.  The latter is
  uglier
but
 gives the functionality that you're looking for.

 Anyone have any thoughts of breakage vs. lack-of-elegance?

 Thanks,

 David

 On Fri, Jan 8, 2010 at 9:45 AM, Ethan Jewett esjew...@gmail.com
  wrote:

 Hi all,

 Let me preface this by saying that I'm learning Lift, so I'm a
 relative newbie. Please be gentle.

 I'm struggling to figure out a good way to do role-based
  authorization
 natively in Lift. Based on examples in the Lift book, the wiki, and
 reading the Lift source, I've gotten to

 val roles = AuthRole(super-admin,
  AuthRole(admin,
    AuthRole(user)
  ),
    AuthRole(integration-admin)
 )

 LiftRules.httpAuthProtectedResource.prepend {
  case ParsePath(api2 :: users :: _, _, _, _) =
 roles.getRoleByName(integration-admin)
 }

 This is with the intention of introducing Lift-based roles into the
 ESME code base, starting with the API. (ESME is an enterprise
 micro-messaging system:
http://cwiki.apache.org/confluence/display/ESME/Index)

 There are two issues with this approach:

 1. Because LiftRules.httpAuthProtectedResource takes ParsePath() as
 its match instead of Req(), I can't require a different role for a
 GetRequest vs. a PostRequest, for example. This is a requirement for
  a
 pure resource-oriented (RESTful) approach, since we'll often want to
 authorize users to read on a resource (GetRequest), but not
 write/change it (Post/Put/DeleteRequest).

 2. It appears to require use of HTTP basic or digest authentication
  in
 order to assign a role to a user (using userRoles). We don't
  currently
 want to use either. (For our API we're currently using a token-based
 login with 

[Lift] Re: Can't find JS in /classpath/

2010-01-09 Thread Timothy Perrett
Right - as a wider note, all the widgets follow this init in boot
pattern.

Cheers, Tim

On Jan 9, 9:15 am, Mads Hartmann mads...@gmail.com wrote:
 Wohoo, I solved this one myself, success! ;)

 You have to add AutoComplete.init() somewhere in your boot.scala file

 On Jan 9, 10:05 am, Mads Hartmann mads...@gmail.com wrote:



  Hello everyone
  I'm having a problem with one of the javascript files that lift
  includes in the header with the path /classpath/... I'm using the
  autocomplete widget and it's outputing all the right code, but it
  can't find js file:

  script type=text/javascript src=/classpath/autocomplete/
  jquery.autocomplete.js/script

  It can find the jquery.js file located at /classpath/ though.

  -- info from the server ---
  INFO - Service request (GET) / took 1779 Milliseconds
  INFO - Service request (GET) /classpath/jquery.js took 44 Milliseconds
  INFO - Service request (GET) /classpath/json.js took 5 Milliseconds
  INFO - Service request (GET) /classpath/autocomplete/
  jquery.autocomplete.js took 1 Milliseconds
  INFO - Service request (GET) /classpath/autocomplete/
  jquery.autocomplete.css took 1 Milliseconds
  INFO - Service request (GET) /ajax_request/liftAjax.js took 110
  Milliseconds
  INFO - Service request (GET) /favicon.ico took 65 Milliseconds
  -- info from the server ends ---

  Does anyone know how to solve this one?

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




[Lift] Ajax button + submitting a form

2010-01-09 Thread Adam Warski
Hello,

I have a regular form, which is submitted with a POST (no AJAX here yet). The 
form contains a list, to which you can add and remove elements using AJAX. So 
the add and remove buttons are:

add - ajaxButton(Add element, () = { elements += new Element; reDraw })

The reDraw method is a SetHtml for the whole form. Now this almost works, 
with the exception that when I press the add button all other changes in the 
form are discarded, as the form is not submitted. So, when the button is 
pressed, I would need to submit the form using ajax and execute a given 
function on the server. In the archives I found SHtml.submitAjaxForm(formId) 
method, which I guess does what I need, but I don't know how to combine it with 
an ajaxButton?

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




Re: [Lift] 280_port builds against Scala 2.8 Beta1 RC7

2010-01-09 Thread Heiko Seeberger
David,

2010/1/8 David Pollak feeder.of.the.be...@gmail.com

Did you smoke test the lift-examples/example app?


Now I did ;-) Looks good.

The reason I did not before is, that some modules and a lot of tests are
commented out. So was lift-widgets which is a dependency of
lift-examples/example. Now I fixed lift-widgets (there was only one little
adjustment in a test case), added it to the build and then fixed the example
app.

Hence the statement Lift builds against 2.8 is only partially true, because
a lot of things are not included. But I am optimistic that out coverage is
large enough and we won't experience any severe issues when porting the
rest.

Heiko

My job: weiglewilczek.com
My blog: heikoseeberger.name
Follow me: twitter.com/hseeberger
OSGi on Scala: scalamodules.org
Lift, the simply functional web framework: liftweb.net
-- 

You received this message because you are subscribed to the Google Groups "Lift" group.

To post to this group, send email to lift...@googlegroups.com.

To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.



Re: [Lift] Minor breaking changes -- LiftRules.getResourceAsStream and LiftRules.finder

2010-01-09 Thread Alex Boisvert
This change has now been pushed to master.

LiftRules.finder() has been removed since it offered (unsafe) duplicate
functionality.

cheers,
alex


On Mon, Jan 4, 2010 at 4:03 PM, Alex Boisvert alex.boisv...@gmail.comwrote:

 Instead of:


 LiftRules.getResourceAsStream(name: String): Box[InputStream]

 I'd suggest:


 LiftRules.doWithResource[T](name: String)(f: InputStream = T): Box[T].

 And if you need laziness, you could use one of the usual suspects: lazy
 val, unapplied function, FatLazy, etc.

 alex



 On Thu, Dec 31, 2009 at 3:48 PM, David Pollak 
 feeder.of.the.be...@gmail.com wrote:

 Folks,

 I've changed LiftRules.getResourceAsStream and LiftRules.finder to return
 Box[Applier[InputStream]] rather than Box[InputStream].

 Applier has a single method, apply[T] which takes an InputStream = T and
 insures the InputStream is closed.

 This change is unlikely to impact much code out there, but does make sure
 that InputStreams are closed.

 If any of the folks out there that name things better than I do (at least
 I didn't call it Apply_A_Tron), please feel free to suggest name changes,
 variance changes, etc.

 Thanks,

 David

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

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



-- 

You received this message because you are subscribed to the Google Groups "Lift" group.

To post to this group, send email to lift...@googlegroups.com.

To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.



[Lift] Re: Ajax button + submitting a form

2010-01-09 Thread greekscala
Hello,

I have a similar use case. For an AjaxForm you have to write:
  SHtml.ajaxForm(
  bind(mytags, xml,
   // binding to your tags ...

submit - SHtml.submit(do it, save),
  ) ++ SHtml.hidden(save)
)

You dont need to have a form element in your templates for this to
work
because ajaxForm will wrap the result of the bind method.

For my listelements checkbox, I attach to the checkbox a function,
that adds an Id and the
checkbox value to a ListBuffer[(Boolean, String)]. (checked and not
checked boxes are submittet)

Then I filter the List for the selected values a do what I have to do
with them.
I the above code example, my save method does some db stuff and then
returning
a JsCmds.SetHtml(an html id, some html/snippet nodeseq) for a
redraw.

Hope this helps a little

with best regards

On 9 Jan., 10:48, Adam Warski a...@warski.org wrote:
 Hello,

 I have a regular form, which is submitted with a POST (no AJAX here yet). The 
 form contains a list, to which you can add and remove elements using AJAX. So 
 the add and remove buttons are:

 add - ajaxButton(Add element, () = { elements += new Element; reDraw })

 The reDraw method is a SetHtml for the whole form. Now this almost works, 
 with the exception that when I press the add button all other changes in 
 the form are discarded, as the form is not submitted. So, when the button is 
 pressed, I would need to submit the form using ajax and execute a given 
 function on the server. In the archives I found SHtml.submitAjaxForm(formId) 
 method, which I guess does what I need, but I don't know how to combine it 
 with an ajaxButton?

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




[Lift] Performance related question

2010-01-09 Thread greekscala
Hello everyone,

I am surprised about the few code I have written and the effect I
get :)

I would like to know if this workflow can be optimized:

I my snippet method I findAnyTemplate() my xml fragments and
assigning them
to vals.

Then I have little functions that bind content with the above xml
fragments and return
the resulting NodeSeq, so I can do easy an SetHtml and return the new
content with
ajax.

I find this way very easy. So I can have many little fragments, load
them bind content
and return them via ajax.

Is it ok to load the fragments and save them in vals? Or can I do a
findAnyTemplate()
all the time? Or should I have snippets methods for this fragments and
let lift do the
snippet method calling?

with best regards

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




[Lift] Re: Performance related question

2010-01-09 Thread Marius
Are you using vals mainly for the purpose of caching ?

I think it is ok to call findAnyTemplates (without using vals) as
templates are cached (in production mode)

Br's,
Marius

On Jan 9, 5:29 pm, greekscala hellectro...@gmail.com wrote:
 Hello everyone,

 I am surprised about the few code I have written and the effect I
 get :)

 I would like to know if this workflow can be optimized:

 I my snippet method I findAnyTemplate() my xml fragments and
 assigning them
 to vals.

 Then I have little functions that bind content with the above xml
 fragments and return
 the resulting NodeSeq, so I can do easy an SetHtml and return the new
 content with
 ajax.

 I find this way very easy. So I can have many little fragments, load
 them bind content
 and return them via ajax.

 Is it ok to load the fragments and save them in vals? Or can I do a
 findAnyTemplate()
 all the time? Or should I have snippets methods for this fragments and
 let lift do the
 snippet method calling?

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




[Lift] Re: Performance related question

2010-01-09 Thread greekscala
Hello Marius,

yes it is more intended for caching. Ok so I can remove this vals from
my code.
Any other simple performance rules that one should be aware of for
Lift?

witth best regards

On 9 Jan., 16:38, Marius marius.dan...@gmail.com wrote:
 Are you using vals mainly for the purpose of caching ?

 I think it is ok to call findAnyTemplates (without using vals) as
 templates are cached (in production mode)

 Br's,
 Marius

 On Jan 9, 5:29 pm, greekscala hellectro...@gmail.com wrote:

  Hello everyone,

  I am surprised about the few code I have written and the effect I
  get :)

  I would like to know if this workflow can be optimized:

  I my snippet method I findAnyTemplate() my xml fragments and
  assigning them
  to vals.

  Then I have little functions that bind content with the above xml
  fragments and return
  the resulting NodeSeq, so I can do easy an SetHtml and return the new
  content with
  ajax.

  I find this way very easy. So I can have many little fragments, load
  them bind content
  and return them via ajax.

  Is it ok to load the fragments and save them in vals? Or can I do a
  findAnyTemplate()
  all the time? Or should I have snippets methods for this fragments and
  let lift do the
  snippet method calling?

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




[Lift] Re: Performance related question

2010-01-09 Thread greekscala
Like, makes it sense to cache a fragment xml when building a list so I
dont have to call findAnyTemplate all the time?

On 9 Jan., 17:31, greekscala hellectro...@gmail.com wrote:
 Hello Marius,

 yes it is more intended for caching. Ok so I can remove this vals from
 my code.
 Any other simple performance rules that one should be aware of for
 Lift?

 witth best regards

 On 9 Jan., 16:38, Marius marius.dan...@gmail.com wrote:

  Are you using vals mainly for the purpose of caching ?

  I think it is ok to call findAnyTemplates (without using vals) as
  templates are cached (in production mode)

  Br's,
  Marius

  On Jan 9, 5:29 pm, greekscala hellectro...@gmail.com wrote:

   Hello everyone,

   I am surprised about the few code I have written and the effect I
   get :)

   I would like to know if this workflow can be optimized:

   I my snippet method I findAnyTemplate() my xml fragments and
   assigning them
   to vals.

   Then I have little functions that bind content with the above xml
   fragments and return
   the resulting NodeSeq, so I can do easy an SetHtml and return the new
   content with
   ajax.

   I find this way very easy. So I can have many little fragments, load
   them bind content
   and return them via ajax.

   Is it ok to load the fragments and save them in vals? Or can I do a
   findAnyTemplate()
   all the time? Or should I have snippets methods for this fragments and
   let lift do the
   snippet method calling?

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




[Lift] Re: Performance related question

2010-01-09 Thread Marius
You could do that too ... but the way I see it it would be more a
functional decision rather then a performance best practice. In some
cases you could consider lift:embed instead of programmatic
findAnyTemplate. It really depends on your design, preferences of
doing things etc.

Br's,
Marius

On Jan 9, 7:08 pm, greekscala hellectro...@gmail.com wrote:
 Like, makes it sense to cache a fragment xml when building a list so I
 dont have to call findAnyTemplate all the time?

 On 9 Jan., 17:31, greekscala hellectro...@gmail.com wrote:

  Hello Marius,

  yes it is more intended for caching. Ok so I can remove this vals from
  my code.
  Any other simple performance rules that one should be aware of for
  Lift?

  witth best regards

  On 9 Jan., 16:38, Marius marius.dan...@gmail.com wrote:

   Are you using vals mainly for the purpose of caching ?

   I think it is ok to call findAnyTemplates (without using vals) as
   templates are cached (in production mode)

   Br's,
   Marius

   On Jan 9, 5:29 pm, greekscala hellectro...@gmail.com wrote:

Hello everyone,

I am surprised about the few code I have written and the effect I
get :)

I would like to know if this workflow can be optimized:

I my snippet method I findAnyTemplate() my xml fragments and
assigning them
to vals.

Then I have little functions that bind content with the above xml
fragments and return
the resulting NodeSeq, so I can do easy an SetHtml and return the new
content with
ajax.

I find this way very easy. So I can have many little fragments, load
them bind content
and return them via ajax.

Is it ok to load the fragments and save them in vals? Or can I do a
findAnyTemplate()
all the time? Or should I have snippets methods for this fragments and
let lift do the
snippet method calling?

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




Re: [Lift] Re: Performance related question

2010-01-09 Thread David Pollak
On Sat, Jan 9, 2010 at 9:08 AM, greekscala hellectro...@gmail.com wrote:

 Like, makes it sense to cache a fragment xml when building a list so I
 dont have to call findAnyTemplate all the time?


Keep in mind that in production mode, Lift caches templates so
findAnyTemplate is a hash table lookup as long as your template is in cache.



 On 9 Jan., 17:31, greekscala hellectro...@gmail.com wrote:
  Hello Marius,
 
  yes it is more intended for caching. Ok so I can remove this vals from
  my code.
  Any other simple performance rules that one should be aware of for
  Lift?
 
  witth best regards
 
  On 9 Jan., 16:38, Marius marius.dan...@gmail.com wrote:
 
   Are you using vals mainly for the purpose of caching ?
 
   I think it is ok to call findAnyTemplates (without using vals) as
   templates are cached (in production mode)
 
   Br's,
   Marius
 
   On Jan 9, 5:29 pm, greekscala hellectro...@gmail.com wrote:
 
Hello everyone,
 
I am surprised about the few code I have written and the effect I
get :)
 
I would like to know if this workflow can be optimized:
 
I my snippet method I findAnyTemplate() my xml fragments and
assigning them
to vals.
 
Then I have little functions that bind content with the above xml
fragments and return
the resulting NodeSeq, so I can do easy an SetHtml and return the new
content with
ajax.
 
I find this way very easy. So I can have many little fragments, load
them bind content
and return them via ajax.
 
Is it ok to load the fragments and save them in vals? Or can I do a
findAnyTemplate()
all the time? Or should I have snippets methods for this fragments
 and
let lift do the
snippet method calling?
 
with best regards

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






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

You received this message because you are subscribed to the Google Groups "Lift" group.

To post to this group, send email to lift...@googlegroups.com.

To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.



Re: [Lift] 280_port builds against Scala 2.8 Beta1 RC7

2010-01-09 Thread David Pollak
On Sat, Jan 9, 2010 at 5:57 AM, Heiko Seeberger 
heiko.seeber...@googlemail.com wrote:

 David,

 2010/1/8 David Pollak feeder.of.the.be...@gmail.com

 Did you smoke test the lift-examples/example app?


 Now I did ;-) Looks good.

 The reason I did not before is, that some modules and a lot of tests are
 commented out. So was lift-widgets which is a dependency of
 lift-examples/example. Now I fixed lift-widgets (there was only one little
 adjustment in a test case), added it to the build and then fixed the example
 app.

 Hence the statement Lift builds against 2.8 is only partially true,
 because a lot of things are not included. But I am optimistic that out
 coverage is large enough and we won't experience any severe issues when
 porting the rest.


Yeah... now that 2.8 Beta1 is out, we'll need to finish porting Lift over.



 Heiko

 My job: weiglewilczek.com
 My blog: heikoseeberger.name
 Follow me: twitter.com/hseeberger
 OSGi on Scala: scalamodules.org
 Lift, the simply functional web framework: liftweb.net

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




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

You received this message because you are subscribed to the Google Groups "Lift" group.

To post to this group, send email to lift...@googlegroups.com.

To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.



Re: [Lift] Minor breaking changes -- LiftRules.getResourceAsStream and LiftRules.finder

2010-01-09 Thread David Pollak
On Sat, Jan 9, 2010 at 6:31 AM, Alex Boisvert alex.boisv...@gmail.comwrote:

 This change has now been pushed to master.

 LiftRules.finder() has been removed since it offered (unsafe) duplicate
 functionality.


Excellent!  Thanks!



 cheers,
 alex


 On Mon, Jan 4, 2010 at 4:03 PM, Alex Boisvert alex.boisv...@gmail.comwrote:

 Instead of:


 LiftRules.getResourceAsStream(name: String): Box[InputStream]

 I'd suggest:


 LiftRules.doWithResource[T](name: String)(f: InputStream = T): Box[T].

 And if you need laziness, you could use one of the usual suspects: lazy
 val, unapplied function, FatLazy, etc.

 alex



 On Thu, Dec 31, 2009 at 3:48 PM, David Pollak 
 feeder.of.the.be...@gmail.com wrote:

 Folks,

 I've changed LiftRules.getResourceAsStream and LiftRules.finder to return
 Box[Applier[InputStream]] rather than Box[InputStream].

 Applier has a single method, apply[T] which takes an InputStream = T and
 insures the InputStream is closed.

 This change is unlikely to impact much code out there, but does make sure
 that InputStreams are closed.

 If any of the folks out there that name things better than I do (at least
 I didn't call it Apply_A_Tron), please feel free to suggest name changes,
 variance changes, etc.

 Thanks,

 David

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

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




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




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

You received this message because you are subscribed to the Google Groups "Lift" group.

To post to this group, send email to lift...@googlegroups.com.

To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.



[Lift] Minor *** breaking change *** LiftRules.httpAuthProtectedResource

2010-01-09 Thread Marius
Hi,

LiftRules.httpAuthProtectedResource was changed from

PartialFunction[ParsePath, Box[Role]

to

PartialFunction[Req, Box[Role]


Also the HttpAuthProtected LocParam from

HttpAuthProtected(role: () = Box[Role])

to

HttpAuthProtected(role: (Req) = Box[Role])



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




Re: [Lift] 280_port builds against Scala 2.8 Beta1 RC7

2010-01-09 Thread Heiko Seeberger
2010/1/9 David Pollak feeder.of.the.be...@gmail.com


 Yeah... now that 2.8 Beta1 is out, we'll need to finish porting Lift over.


*Once* 2.8 Beta 1 is out: IMHO we are at Beta1 RC7 and it will take another
couple of days until we will see Beta1.
Anyway, I'd be glad to help porting the rest.

Heiko

My job: weiglewilczek.com
My blog: heikoseeberger.name
Follow me: twitter.com/hseeberger
OSGi on Scala: scalamodules.org
Lift, the simply functional web framework: liftweb.net
-- 

You received this message because you are subscribed to the Google Groups "Lift" group.

To post to this group, send email to lift...@googlegroups.com.

To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.



Re: [Lift] 280_port builds against Scala 2.8 Beta1 RC7

2010-01-09 Thread David Pollak
On Sat, Jan 9, 2010 at 10:18 AM, Heiko Seeberger 
heiko.seeber...@googlemail.com wrote:

 2010/1/9 David Pollak feeder.of.the.be...@gmail.com


 Yeah... now that 2.8 Beta1 is out, we'll need to finish porting Lift over.


 *Once* 2.8 Beta 1 is out: IMHO we are at Beta1 RC7 and it will take
 another couple of days until we will see Beta1.
 Anyway, I'd be glad to help porting the rest.


Oh... It must have been a dream last night that Beta 1 was released (I was
also dreaming of some Lift optimizations that I'll be working on next week).

We need to figure out a naming convention so the 2.8 stuff is built by
Hudson and available as a Snapshot.  Thoughts?



 Heiko

 My job: weiglewilczek.com
 My blog: heikoseeberger.name
 Follow me: twitter.com/hseeberger
 OSGi on Scala: scalamodules.org
 Lift, the simply functional web framework: liftweb.net

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




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

You received this message because you are subscribed to the Google Groups "Lift" group.

To post to this group, send email to lift...@googlegroups.com.

To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.



Re: [Lift] 280_port builds against Scala 2.8 Beta1 RC7

2010-01-09 Thread Indrajit Raychaudhuri
On Sun, Jan 10, 2010 at 12:01 AM, David Pollak
feeder.of.the.be...@gmail.com wrote:


 On Sat, Jan 9, 2010 at 10:18 AM, Heiko Seeberger
 heiko.seeber...@googlemail.com wrote:

 2010/1/9 David Pollak feeder.of.the.be...@gmail.com

 Yeah... now that 2.8 Beta1 is out, we'll need to finish porting Lift
 over.

 Once 2.8 Beta 1 is out: IMHO we are at Beta1 RC7 and it will take another
 couple of days until we will see Beta1.
 Anyway, I'd be glad to help porting the rest.

 Oh... It must have been a dream last night that Beta 1 was released (I was
 also dreaming of some Lift optimizations that I'll be working on next week).

 We need to figure out a naming convention so the 2.8 stuff is built by
 Hudson and available as a Snapshot.  Thoughts?

How about taking the same strategy as last time (during scala 2.7.5 to 2.7.7)?
Use Maven version classifier fot 2.8.0 build and create separate
hudson job(s) for the purpose.

- IRC



 Heiko
 My job: weiglewilczek.com
 My blog: heikoseeberger.name
 Follow me: twitter.com/hseeberger
 OSGi on Scala: scalamodules.org
 Lift, the simply functional web framework: liftweb.net

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




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

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


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




Re: [Lift] 280_port builds against Scala 2.8 Beta1 RC7

2010-01-09 Thread David Pollak
Sounds reasonable.  Can you work on it after we get 2.0M1 out the door?

On Sat, Jan 9, 2010 at 10:59 AM, Indrajit Raychaudhuri
indraj...@gmail.comwrote:

 On Sun, Jan 10, 2010 at 12:01 AM, David Pollak
 feeder.of.the.be...@gmail.com wrote:
 
 
  On Sat, Jan 9, 2010 at 10:18 AM, Heiko Seeberger
  heiko.seeber...@googlemail.com wrote:
 
  2010/1/9 David Pollak feeder.of.the.be...@gmail.com
 
  Yeah... now that 2.8 Beta1 is out, we'll need to finish porting Lift
  over.
 
  Once 2.8 Beta 1 is out: IMHO we are at Beta1 RC7 and it will take
 another
  couple of days until we will see Beta1.
  Anyway, I'd be glad to help porting the rest.
 
  Oh... It must have been a dream last night that Beta 1 was released (I
 was
  also dreaming of some Lift optimizations that I'll be working on next
 week).
 
  We need to figure out a naming convention so the 2.8 stuff is built by
  Hudson and available as a Snapshot.  Thoughts?

 How about taking the same strategy as last time (during scala 2.7.5 to
 2.7.7)?
 Use Maven version classifier fot 2.8.0 build and create separate
 hudson job(s) for the purpose.

 - IRC

 
 
  Heiko
  My job: weiglewilczek.com
  My blog: heikoseeberger.name
  Follow me: twitter.com/hseeberger
  OSGi on Scala: scalamodules.org
  Lift, the simply functional web framework: liftweb.net
 
  --
  You received this message because you are subscribed to the Google
 Groups
  Lift group.
  To post to this group, send email to lift...@googlegroups.com.
  To unsubscribe from this group, send email to
  liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com
 .
  For more options, visit this group at
  http://groups.google.com/group/liftweb?hl=en.
 
 
 
 
  --
  Lift, the simply functional web framework http://liftweb.net
  Beginning Scala http://www.apress.com/book/view/1430219890
  Follow me: http://twitter.com/dpp
  Surf the harmonics
 
  --
  You received this message because you are subscribed to the Google Groups
  Lift group.
  To post to this group, send email to lift...@googlegroups.com.
  To unsubscribe from this group, send email to
  liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com
 .
  For more options, visit this group at
  http://groups.google.com/group/liftweb?hl=en.
 
 

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






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

You received this message because you are subscribed to the Google Groups "Lift" group.

To post to this group, send email to lift...@googlegroups.com.

To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.



Re: [Lift] 280_port builds against Scala 2.8 Beta1 RC7

2010-01-09 Thread Indrajit Raychaudhuri

Sure. Would do that.

On 10/01/10 1:05 AM, David Pollak wrote:

Sounds reasonable.  Can you work on it after we get 2.0M1 out the door?

On Sat, Jan 9, 2010 at 10:59 AM, Indrajit Raychaudhuri
indraj...@gmail.com mailto:indraj...@gmail.com wrote:

On Sun, Jan 10, 2010 at 12:01 AM, David Pollak
feeder.of.the.be...@gmail.com
mailto:feeder.of.the.be...@gmail.com wrote:
 
 
  On Sat, Jan 9, 2010 at 10:18 AM, Heiko Seeberger
  heiko.seeber...@googlemail.com
mailto:heiko.seeber...@googlemail.com wrote:
 
  2010/1/9 David Pollak feeder.of.the.be...@gmail.com
mailto:feeder.of.the.be...@gmail.com
 
  Yeah... now that 2.8 Beta1 is out, we'll need to finish porting
Lift
  over.
 
  Once 2.8 Beta 1 is out: IMHO we are at Beta1 RC7 and it will
take another
  couple of days until we will see Beta1.
  Anyway, I'd be glad to help porting the rest.
 
  Oh... It must have been a dream last night that Beta 1 was
released (I was
  also dreaming of some Lift optimizations that I'll be working on
next week).
 
  We need to figure out a naming convention so the 2.8 stuff is
built by
  Hudson and available as a Snapshot.  Thoughts?

How about taking the same strategy as last time (during scala 2.7.5
to 2.7.7)?
Use Maven version classifier fot 2.8.0 build and create separate
hudson job(s) for the purpose.

- IRC

 
 
  Heiko
  My job: weiglewilczek.com http://weiglewilczek.com
  My blog: heikoseeberger.name http://heikoseeberger.name
  Follow me: twitter.com/hseeberger http://twitter.com/hseeberger
  OSGi on Scala: scalamodules.org http://scalamodules.org
  Lift, the simply functional web framework: liftweb.net
http://liftweb.net
 
  --
  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
mailto:liftweb@googlegroups.com.
  To unsubscribe from this group, send email to
  liftweb+unsubscr...@googlegroups.com
mailto:liftweb%2bunsubscr...@googlegroups.com.
  For more options, visit this group at
  http://groups.google.com/group/liftweb?hl=en.
 
 
 
 
  --
  Lift, the simply functional web framework http://liftweb.net
  Beginning Scala http://www.apress.com/book/view/1430219890
  Follow me: http://twitter.com/dpp
  Surf the harmonics
 
  --
  You received this message because you are subscribed to the
Google Groups
  Lift group.
  To post to this group, send email to liftweb@googlegroups.com
mailto:liftweb@googlegroups.com.
  To unsubscribe from this group, send email to
  liftweb+unsubscr...@googlegroups.com
mailto:liftweb%2bunsubscr...@googlegroups.com.
  For more options, visit this group at
  http://groups.google.com/group/liftweb?hl=en.
 
 

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






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


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




Re: [Lift] 280_port builds against Scala 2.8 Beta1 RC7

2010-01-09 Thread Heiko Seeberger
2010/1/9 Indrajit Raychaudhuri indraj...@gmail.com

How about taking the same strategy as last time (during scala 2.7.5 to
 2.7.7)?
 Use Maven version classifier fot 2.8.0 build and create separate
 hudson job(s) for the purpose.


Yep, let's do that!

Heiko

My job: weiglewilczek.com
My blog: heikoseeberger.name
Follow me: twitter.com/hseeberger
OSGi on Scala: scalamodules.org
Lift, the simply functional web framework: liftweb.net
-- 

You received this message because you are subscribed to the Google Groups "Lift" group.

To post to this group, send email to lift...@googlegroups.com.

To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.



[Lift] Lift Modules 1.1-M8 broken mvn site

2010-01-09 Thread Jaroslaw Zabiello
$ uname -a
Linux Ubuntu-904-jaunty-64-minimal 2.6.28-11-server #42-Ubuntu SMP Fri
Apr 17 02:45:36 UTC 2009 x86_64 GNU/Linux

$ mvn -v
Apache Maven 2.2.1 (r801777; 2009-08-06 21:16:01+0200)
Java version: 1.6.0_0
Java home: /usr/lib/jvm/java-6-openjdk/jre
Default locale: en_US, platform encoding: UTF-8
OS name: linux version: 2.6.28-11-server arch: amd64 Family:
unix

/home/httpd/liftweb.org/app/ror/public/1.1-M8/lift-modules/lift-widgets
$ mvn site -e
+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO]

[INFO] Building Lift Widgets
[INFO]task-segment: [site]
[INFO]

[INFO] [resources:copy-resources {execution: default-copy-resources}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[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] **
[INFO] Starting Jakarta Velocity v1.4
[INFO] RuntimeInstance initializing.
[INFO] Default Properties File: org/apache/velocity/runtime/defaults/
velocity.properties
[INFO] Default ResourceManager initializing. (class
org.apache.velocity.runtime.resource.ResourceManagerImpl)
[INFO] Resource Loader Instantiated:
org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader
[INFO] ClasspathResourceLoader : initialization starting.
[INFO] ClasspathResourceLoader : initialization complete.
[INFO] ResourceCache : initialized. (class
org.apache.velocity.runtime.resource.ResourceCacheImpl)
[INFO] Default ResourceManager initialization complete.
[INFO] Loaded System Directive:
org.apache.velocity.runtime.directive.Literal
[INFO] Loaded System Directive:
org.apache.velocity.runtime.directive.Macro
[INFO] Loaded System Directive:
org.apache.velocity.runtime.directive.Parse
[INFO] Loaded System Directive:
org.apache.velocity.runtime.directive.Include
[INFO] Loaded System Directive:
org.apache.velocity.runtime.directive.Foreach
[INFO] Created: 20 parsers.
[INFO] Velocimacro : initialization starting.
[INFO] Velocimacro : adding VMs from VM library template :
VM_global_library.vm
[ERROR] ResourceManager : unable to find resource
'VM_global_library.vm' in any resource loader.
[INFO] Velocimacro : error using  VM library template
VM_global_library.vm :
org.apache.velocity.exception.ResourceNotFoundException: Unable to
find resource 'VM_global_library.vm'
[INFO] Velocimacro :  VM library template macro registration complete.
[INFO] Velocimacro : allowInline = true : VMs can be defined inline in
templates
[INFO] Velocimacro : allowInlineToOverride = false : VMs defined
inline may NOT replace previous VM definitions
[INFO] Velocimacro : allowInlineLocal = false : VMs defined inline
will be  global in scope if allowed.
[INFO] Velocimacro : initialization complete.
[INFO] Velocity successfully started.
[INFO] Preparing javadoc:javadoc
[INFO] [enforcer:enforce {execution: default-enforce}]
[INFO] Preparing javadoc:test-javadoc
[INFO] [enforcer:enforce {execution: default-enforce}]
[INFO] [resources:resources {execution: default-resources}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 60 resources
[INFO] [scala:compile {execution: scala-compile}]
[INFO] Checking for multiple versions of scala
[INFO] includes = [**/*.scala,**/*.java,]
[INFO] excludes = []
[INFO] Compiling 0 source files to /home/httpd/liftweb.org/app/ror/
public/1.1-M8/lift-modules/lift-widgets/target/classes
[INFO] Nothing to compile - all classes are up to date
[INFO] [yuicompressor:compress {execution: default}]
[INFO] nothing to do, /home/httpd/liftweb.org/app/ror/public/1.1-M8/
lift-modules/lift-widgets/target/classes/toserve/autocomplete/
jquery.autocomplete-min.css is younger than original, use 'force'
option or clean your target
[INFO]

[ERROR] FATAL ERROR
[INFO]

[INFO] null
[INFO]

[INFO] Trace
java.lang.RuntimeException
at
com.yahoo.platform.yui.compressor.JavaScriptCompressor.printSourceNumber
(JavaScriptCompressor.java:299)
at com.yahoo.platform.yui.compressor.JavaScriptCompressor.parse
(JavaScriptCompressor.java:335)
at com.yahoo.platform.yui.compressor.JavaScriptCompressor.init
(JavaScriptCompressor.java:532)
at net.sf.alchim.mojo.yuicompressor.YuiCompressorMojo.processFile
(YuiCompressorMojo.java:178)
at net.sf.alchim.mojo.yuicompressor.MojoSupport.processDir
(MojoSupport.java:151)
at 

[Lift] Proposal to change the AutoComplete widget a tiny bit (with code)

2010-01-09 Thread Mads Hartmann
Hello,
While playing around with the AutoComplete widget i wanted to change
some of the values passed to the jQuery autocomplete plugin and
couldn't figure out if this was possible or not. It didn't seem so
when i looked into the AutoComplete.scala file so i added a few lines
of code to the AutoComplete file and wanted to share it here :)

/* -- MyAutoComplete.scala starts
-- */
object MyAutoComplete {

  def apply(start: String,
options: (String, Int) = Seq[String],
onSubmit: String = Unit,
jqOptions:  List[Pair[String,String]],
attrs: (String, String)*) = new MyAutoComplete().render
(start, options, onSubmit, jqOptions ,attrs:_*)


  /**
   * register the resources with lift (typically in boot)
   */
  def init() {
import net.liftweb.http.ResourceServer

ResourceServer.allow({
case autocomplete :: _ = true
 })
  }

}

class MyAutoComplete {


  /**
   * Render a text field with Ajax autocomplete support
   *
   * @param start - the initial input string
   * @param option - the function to be called when user is typing
text. The text and th options limit is provided to this functions
   * @param attrs - the attributes that can be added to the input text
field
   * @param jsonOptions - a list of pairs that will be send along to
the jQuery().AutoComplete call (for customization purposes)
   */
  def render(start: String,
 options: (String, Int) = Seq[String],
 onSubmit: String = Unit,
 jsonOptions: List[Pair[String,String]],
 attrs: (String, String)*): Elem = {

val f = (ignore: String) = {
  val q = S.param(q).openOr()
  val limit = S.param(limit).flatMap(asInt).openOr(10)
  PlainTextResponse(options(q, limit).map(s = s+|+s).mkString
(\n))
}


fmapFunc(SFuncHolder(f)){ func =
  val what: String = encodeURL(S.contextPath + / +
LiftRules.ajaxPath+?+func+=foo)

  val id = Helpers.nextFuncName
  fmapFunc(SFuncHolder(onSubmit)){hidden =

  /* merge the options that the user wants */
  val jqOptions =  (minChars,0) ::
   (matchContains,true) ::
   Nil ::: jsonOptions
  /* jsonify to options */
  var counter = 0
  var isLast = false
  var json = {
  jqOptions.foreach{ pair: Pair[String,String] =
  counter += 1
  isLast = (counter == jqOptions.size)
  json += pair._1 + :  + pair._2
  if (!isLast) json += , }
  json += }

  val autocompleteOptions = JsRaw(json)

  val onLoad = JsRaw(
  jQuery(document).ready(function(){
var data = +what.encJs+;
jQuery(#+id+).autocomplete(data,
+autocompleteOptions.toJsCmd+).result(function(event, dt,
formatted) {
  jQuery(#+hidden+).val(formatted);
});
  });)

  span
head
  link rel=stylesheet href={/ +
LiftRules.resourceServerPath +/autocomplete/jquery.autocomplete.css}
type=text/css /
  script type=text/javascript src={/ +
LiftRules.resourceServerPath +/autocomplete/jquery.autocomplete.js} /

  script type=text/javascript{Unparsed(onLoad.toJsCmd)}/
script
/head
{
  attrs.foldLeft(input type=text id={id} value={start} /)
(_ % _)
}
input type=hidden name={hidden} id={hidden} value={start} /

  /span
}
   }
  }
}
/* -- MyAutoComplete.scala ends
-- */

I use it in a snippet like this:

val myoptions: List[Pair[String,String]] = (width,300) :: Nil
bind(ajax,in,auto - MyAutoComplete(, buildQuery _, _ = (),
myoptions))

Is there any way you would allow me to merge this with the existing
widget in case anyone else would like this feature?

Recap: The reason i added this is to take advantage of the
customizability the autocomplete plugin offers you.

the following is the values that you can customize if you have full
control over the JS object that is passed to the autocomplete method.
In my case i only needed to change the width but i could image that
someone would want to change some of the others too :)

$.Autocompleter.defaults = {
inputClass: ac_input,
resultsClass: ac_results,
loadingClass: ac_loading,
minChars: 1,
delay: 400,
matchCase: false,
matchSubset: true,
matchContains: false,
cacheLength: 10,
max: 100,
mustMatch: false,
extraParams: {},
selectFirst: true,
formatItem: function(row) { return row[0]; },
formatMatch: null,
autoFill: false,
width: 0,
multiple: false,
multipleSeparator: , ,
highlight: function(value, term) {
return value.replace(new RegExp((?![^;]+;)(?![^]*)( +
term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi, \\$1) + )(?![^]
*)(?![^;]+;), gi), strong$1/strong);
 

[Lift] Re: Lift Modules 1.1-M8 broken mvn site

2010-01-09 Thread Jaroslaw Zabiello
er, the title should be: Lift Widgets - broken mvn site
-- 
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




Re: [Lift] Re: Lift Modules 1.1-M8 broken mvn site

2010-01-09 Thread David Pollak
On Sat, Jan 9, 2010 at 12:39 PM, Jaroslaw Zabiello
hipertrac...@gmail.comwrote:

 er, the title should be: Lift Widgets - broken mvn site


There is a known issue with the openjdk and the YUI compressor library.  If
it's possible for you to try the Sun JDK, I think things should work.



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






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

You received this message because you are subscribed to the Google Groups "Lift" group.

To post to this group, send email to lift...@googlegroups.com.

To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.



[Lift] Re: Lift Actors on Google App Engine

2010-01-09 Thread qingshan
Hi,

What persistence are you using, JPA or JDO?

I was looking for an example of Lift + JPA on GAE but haven't found
one. If you have a working demo, would you mind sharing it?

Thanks,
Qingshan

On Jan 8, 3:18 pm, Arthur arthur.pet...@gmail.com wrote:
 This may have been discussed before but I couldn't find it, so here is
 goes.

 I know that in the past Comet and other actor using features did not
 work on Google App Engine. Did the new Lift Actors solve this problem?
 and if so what versions (or nightlies) have this code?

 Also I understand that running all actors in one thread makes things
 weird so are there any restrictions when running in single thread
 mode?

 My interest is actually not so much Comet as using my own actors on
 GAE to build a game engine of sorts. But I thought lift actors would
 be a good bet since I want to use Lift anyway.

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




[Lift] *** Breaking change *** issue 265 Providing more flexible behaviour for NotFound (404)

2010-01-09 Thread Marius
Hi all,

This affects LiftRules.uriNotFound. It was changed from

 type URINotFoundPF = PartialFunction[(Req, Box[Failure]),
LiftResponse]

to

 type URINotFoundPF = PartialFunction[(Req, Box[Failure]), NotFound]

Where NotFound is a trait having 4 refinements:

// Default behavior where Lift is returning some XhtmlResponse
case object DefaultNotFound extends NotFound

// Use it to directly return a response to client (i.e. redirects etc)
case class NotFoundAsResponse(response: LiftResponse) extends NotFound

// Specify a template that will be rendered if the page is not found.
This will be rendered
// though the normal rendering pipeline
case class NotFoundAsTemplate(path: ParsePath) extends NotFound

// Use an arbitrary NodeSeq as a not found response.
case class NotFoundAsNode(node: NodeSeq) extends NotFound


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




[Lift] Re: *** Breaking change *** issue 265 Providing more flexible behaviour for NotFound (404)

2010-01-09 Thread Timothy Perrett
Very nice stuff Marius, kudos.

Cheers, Tim

On Jan 9, 9:52 pm, Marius marius.dan...@gmail.com wrote:
 Hi all,

 This affects LiftRules.uriNotFound. It was changed from

  type URINotFoundPF = PartialFunction[(Req, Box[Failure]),
 LiftResponse]

 to

  type URINotFoundPF = PartialFunction[(Req, Box[Failure]), NotFound]

 Where NotFound is a trait having 4 refinements:

 // Default behavior where Lift is returning some XhtmlResponse
 case object DefaultNotFound extends NotFound

 // Use it to directly return a response to client (i.e. redirects etc)
 case class NotFoundAsResponse(response: LiftResponse) extends NotFound

 // Specify a template that will be rendered if the page is not found.
 This will be rendered
 // though the normal rendering pipeline
 case class NotFoundAsTemplate(path: ParsePath) extends NotFound

 // Use an arbitrary NodeSeq as a not found response.
 case class NotFoundAsNode(node: NodeSeq) extends NotFound

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




Re: [Lift] Mapper: Hook into owner lifecycle from field

2010-01-09 Thread Naftoli Gugenheim
How would this be implemented in terms of database table structure?

-
Jeppe Nejsum Madsenje...@ingolfs.dk wrote:

On Thu, Jan 7, 2010 at 6:34 PM, David Pollak
feeder.of.the.be...@gmail.com wrote:
 Can you post some example code of your current thinking as a GitHub project
 and we can work on refining it and tuning Mapper/MetaMapper to suit your
 needs?

I realize the original mail wasn't that informative. What can I say, I
was in a hurry running out the door :-)

I've been implementing this with the current mapper code and before
creating GitHub projects etc let me try to explain the use case and we
can see if something needs to be changed in mapper.

I need to implement support for temporal database concepts
(http://en.wikipedia.org/wiki/Temporal_database). For know I don't
need full bi-temporal data, only valid-time. Lets assume the following
simple schema:

class Person extends LongKeyedMapper[Person] with IdPK {
  def getSingleton = Person
  object name extends MappedPoliteString(this, 20)
  object address extends MappedLongForeignKey(this,Address)
}
object Person extends Person with LongKeyedMetaMapper[Person]

class Address extends LongKeyedMapper[Address] with IdPK {
  def getSingleton = Address
  object street extends MappedPoliteString(this, 20)
}
object Address extends Address with LongKeyedMetaMapper[Address]

The challenge is now to be able to track the different addresses that
this person have had over time and be able to answer questions such
as: what's the current address? What was the address at 2009-12-31
etc.

Ideally, I would like to just change the line

 object address extends MappedLongForeignKey(this,Address)

to

 object address extends MappedTemporalObject(this,Address)

and then be able to say e.g.

person.address.set(addr, validInterval) // Add address that is valid
in the specified interval
person.address.set(addr) // Add address that is valid from current date
person.address.history // Get list of addresses
person.address.current // Get current address
etc

This is pretty close to a OneToMany scenario with the added complexity
of a validity interval on the many part. I've used the OneToMany
code as inspiration and made a solution that works (while not being as
non-intrusive as the above)

There are at least two things that needs to happen:

1) Add new fields to the Address object. We need validFrom/to dates,
and foreign key. So currently, I must change my Address class into
this:

class Address extends LongKeyedMapper[Address] with IdPK with
ValidTime[Long,Address] {
  def getSingleton = Address
  object person extends MappedLongForeignKey(this, Person)
  object street extends MappedPoliteString(this, 20)
}

where ValidTime is a trait containing the fields validFrom, validTo

2) Hook into the person object so that any changed addresses are saved

class Person extends TemporalMapper[Long,Person] with
LongKeyedMapper[Person] with IdPK {
  def getSingleton = Person

  object field extends MappedPoliteString(this, 20)
  object address extends MappedTemporalObject(Person,Address.person)
}

where TemporalMapper is a trait that overrides save/delete etc and
MappedTemporalObject handles the collection of addresses.

The above solution works and is not too cumbersome. To make the really
nice solution, a few changes are need to mapper:

1) Ability construct a persisted entity dynamically. I.e I have the
original Address class with no valid time fields or fk reference, but
need to persist Address with ValidTime with ForeignKey. This, I
think, is the hard part :-)

2) The MappedTemporalObject needs to hook into the lifecycle events of
the owner. I think what is needed is just for the LifecycleCallbacks
to be extended with methods that can actually influence the lifecycle
(ie if a lifecycle callback save fails, the owner save should
fail)

Let me know if this makes it more clear. As I said I have this
working, so it's not high priority to get these changes, but they
might come in handy in other scenarios as well.

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


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




[Lift] Need jquery jgGrid working example

2010-01-09 Thread knobi
Hello lifters,

I try to get run the example shown at 
http://trirand.com/blog/jqgrid/jqgrid.html#
- loading XML data.
It shows me the Table-header and the pager but it doesn't call the
url:requestfordata?x=xyz. So I see no data in the grid.


html ...
table id=list1/table
div id=pager1/div
...
/html
script type=text/javascript
jQuery().ready(function (){
jQuery(#list1).jqGrid({
url:'requestfordata?x=xyz',  //  this will not called
datatype: xml,
...

Can anyone show me a working example?

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




Re: [Lift] Re: Lift Actors on Google App Engine

2010-01-09 Thread Arthur Peters
I will probably be using JDO. And there is no code yet anyway.

I thought there was a JPA demo on git hub somewhere. But I guess that would
not provide the GAE code you want.

Good luck
-Arthur (sent from phone)

On Jan 9, 2010 4:15 PM, qingshan qingshan@gmail.com wrote:

Hi,

What persistence are you using, JPA or JDO?

I was looking for an example of Lift + JPA on GAE but haven't found
one. If you have a working demo, would you mind sharing it?

Thanks,
Qingshan

On Jan 8, 3:18 pm, Arthur arthur.pet...@gmail.com wrote:  This may have
been discussed before bu...

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

You received this message because you are subscribed to the Google Groups "Lift" group.

To post to this group, send email to lift...@googlegroups.com.

To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.



[Lift] Can lift strip all the leading and trailing blank characters?

2010-01-09 Thread daiwhea
I saw the html source generated by the lift both in dev and production
mode, there are many leading and trailing blank characters and new
lines. Is it possible to make lift strip all these blank characters?

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




[Lift] Is this correct way to handle RESTful like URL in Lift Framework?

2010-01-09 Thread Brian Hsu
If I have a URL like http://localhost/Test/edit/{id} and I would like
the {id} transform to a parameter instead of URL path part.

The problem is that if I have a template named edit.html under webapp/
Test, which is the template I use to edit an item.

And I have a Menu instance like the following:

code
Menu (Loc(Test, List(Test) - true, Test))
/code

It would only match URL like http://localhost/Test/edit, not anything
like http://localhost/Test/edit/1

Is it best way to do it by create a menu with RewriteRequest? Because
I found it a little boilerplate if I have lot URL pattern like this.

code
val menu = Menu(new Loc[Unit] {

override def name = Test
override def text = Test
override def link = (List (Test), true)
override def params = Nil
override def defaultValue = Full(())


def isTarget (path: ParsePath) = path match {
case ParsePath (List(Test, edit, id), _, _, _) = true

case _ = false
}

override def rewrite = Full ( NamedPF(Test) {
case RewriteRequest (path, _, _) if isTarget(path) =
 RewriteResponse(List(Test, edit),
 Map(id - 1024)) - ()

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