[Lift] Re: Hiring Lift Developers

2009-06-16 Thread Viktor Klang
Dang! No Boston, Sweden :(

On Tue, Jun 16, 2009 at 3:02 AM, David LaPalomento
dlapalome...@novell.comwrote:


 As much as I'd love an excuse to fly out to London (or Sydney), you're
 right, it probably is a bit too much of a stretch :)

 On Jun 15, 6:51 pm, KWright kev.lee.wri...@googlemail.com wrote:
  I suspect that London UK would probably be an exception too far!
 
  On 15 June, 23:45, David LaPalomento dlapalome...@novell.com wrote:
 
   Good point, sorry!  Most of the team is located in the Boston area,
   but we'd probably be willing to make exceptions.
 
   On Jun 15, 4:14 pm, KWright kev.lee.wri...@googlemail.com wrote:
 
You forgot to mention where you are in the world, it might be useful
to know... :P
 
On 15 June, 18:32, David LaPalomento dlapalome...@novell.com
wrote:
 
 Hi all,
 My team has recently started a project based around Lift and we're
 looking at bringing on some passionate, full-time developers to make that
 happen.  It's a pretty ambitious effort and we expect to be pushing the
 technology envelope in real-time communication (CometActors have already
 been a huge help here) and user experience for web applications.  If you
 think you might be interested, drop me an email and I'd be glad to go into
 greater detail about the project.  Also, apologies in advance if I shouldn't
 be posting this sort of thing to the list.
 
 Regards,
 David

 



-- 
Viktor Klang
Scala Loudmouth

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



[Lift] Re: Lift Jquery autocomplete *** API CHANGE CANDIDATE ***

2009-06-16 Thread marius d.

yes yes yes ... entirely my bad as I missed that out ...

I'll correct it very soon.

Marius

On Jun 16, 3:07 am, Bryan. germ...@gmail.com wrote:
 Hi Marius,

 I just updated to the tip and got a build failure:

 [WARNING] /home/bryan/public-repos/git/liftweb/sites/example/src/main/
 scala/net/liftweb/example/snippet/Ajax.scala:65: error: value
 autocomplete is not a member of object net.liftweb.http.jquery.JqSHtml
 [WARNING]          auto - JqSHtml.autocomplete(, buildQuery _, _
 = ()))

 --Bryan

 On Jun 15, 2:16 pm, marius d. marius.dan...@gmail.com wrote:

  Folks,

  I just made the autocomplete a Lift widget so it does not exist
  anymore in JqShtml object. Here is an example on how to use it:

  - For Ajax autocomplete
      AutoComplete(, (current, limit) = {
        println(current =  + current)
        (1 to limit).map(v = Value_ + v)
      }, s = println(submit  + s))

  - For pre-provided options list
     AutoComplete.autocompleteObj(/*same params as bfore*/)

  This may break your app but I think it is very easy to update it.

  I also fixed some bugs:
  1. It didn;t work if the container cookies were turned off
  2. hovering on the options list did not work on Ubuntu FF3 at least
  due to a capitalizated LI equality test.

  If you encounter any problems, please let me know.

  Br's,
  Marius

  On Jun 8, 12:34 pm, Kevin Wright kev.lee.wri...@googlemail.com
  wrote:

   +1

   As an evolving framework, it definitely makes more sense to favour
   consistency over backward compatibility at this stage

   On Mon, Jun 8, 2009 at 9:00 AM, marius d. marius.dan...@gmail.com wrote:

Other folks, please speak up ! :) ... I will soon migrate this into a
Lift widget.

Br's,
Marius

On Jun 6, 4:53 pm, David Pollak feeder.of.the.be...@gmail.com wrote:
 I think I'm using in one place in one project so my api breakage 
 factor
is
 low.  I'm okay with moving it unless someone else is going to feel 
 real
 pain.

 On Jun 6, 2009 12:24 AM, Marius marius.dan...@gmail.com wrote:

 Is there a reason why the JQuery autocomplete is not a Lift widget but
 instead it lives in http/jquery package? .. I remember a long time ago
 me putting it in the jquery package to separate SHtml stuff that is
 dependent on JQuery to the others.

 Thoughts?

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



[Lift] Re: Develop / Production System

2009-06-16 Thread Tobias Daub

Ok, thanks.

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


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

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

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


 Hi There,

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


 thanks




 


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



[Lift] Re: a href... optional query params

2009-06-16 Thread Ewan

Thanks thats how I have done it now but was just checking that there
was not some magic that I had missed.

-- Ewan

On Jun 16, 1:00 am, David Pollak feeder.of.the.be...@gmail.com
wrote:
 On Mon, Jun 15, 2009 at 3:59 PM, Ewan ehar...@gmail.com wrote:

  Hi all

  I have bind that renders a link and at the moment I want the link to
  include a couple of query params ie.

  a href=/search?q1=v1q2=v2 Click me/a

  I figured I'd be able to do something like the following except the
  additional key/id is added which messes it up.

  value - SHtml.link(/search?q1=v1, () = doSearch, SText(Click
  me))

 How about just hardcoding things and using S.param(q1) to extract the
 parameters?

 While it's useful to bind to functions for stateful stuff, if you're just
 passing some hard coded parameters, it seems to me that you're best off
 using query parameters.



  Looking at the src I can't see how this would work.  I guess using a
  requestVar would be the recommended solution but how does that work
  for bookmarked urls between server restarts?

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

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



[Lift] Re: scala-forum.org is open!

2009-06-16 Thread David Bernard
Don't worry about duplication, I removed other post.

On Tue, Jun 16, 2009 at 12:45, Christian Helmbold c.helmb...@gmx.de wrote:


 Hi,

 the new forum for Scala developers is open: http://scala-forum.org

 Come in and talk about Scala programming and Scala frameworks!

 Regards,
 Christian


 PS: I hope this message is sent only once - Google told me about troubles
 and I tried it several times.
 --
 GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
 Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01

 


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



[Lift] Re: Mapper or Record?

2009-06-16 Thread Jeppe Nejsum Madsen

On 16 Jun 2009, marius d. wrote:


 Lift Record currently is not implemented for DB interaction but it's
 targeted for 1.1 release.

That probably explains why I couldn't find much when looking through the
source :-)
 
 I'd say to start development using the Mapper and when Record is ready
 migrate to the Record. I would expect to be a fairly easy transition
 from Mapper to Record though.

Ok, sounds good. Will mapper be extended in 1.1 or is it only bug fixing
and all new development will happen in Record?

/Jeppe


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



[Lift] Re: Mapper or Record?

2009-06-16 Thread marius d.



On Jun 16, 3:17 pm, Jeppe Nejsum Madsen je...@ingolfs.dk wrote:
 On 16 Jun 2009, marius d. wrote:

  Lift Record currently is not implemented for DB interaction but it's
  targeted for 1.1 release.

 That probably explains why I couldn't find much when looking through the
 source :-)



  I'd say to start development using the Mapper and when Record is ready
  migrate to the Record. I would expect to be a fairly easy transition
  from Mapper to Record though.

 Ok, sounds good. Will mapper be extended in 1.1 or is it only bug fixing
 and all new development will happen in Record?

I wouldn't expect much new stuff on the Mapper area. It will be
maintained though for a long time. So new stuff should come for
Record ...


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



[Lift] Re: Develop / Production System

2009-06-16 Thread Oliver Lambert
Sometimes (is this, folk-tale or truth?) the maven repository around the
application you'reworking on may get slightly out of sync. Then you might
need to delete the part of
the repository that your application is installed into.

On Tue, Jun 16, 2009 at 7:25 PM, Tobias Daub hannes.flo...@gmx.li wrote:


 Ok, thanks.

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


  Maven stores project dependencies in a repository (by default, its
  called .m2). When you move a Lift application from one system to
  another, the repository on the new system may need to be updated,
  hence your requirement to do a mvn clean install.
 
  Don't know what you changed on the pom.xml (if you have any hard coded
  paths, you might have to change them).
 
  On Tue, Jun 16, 2009 at 2:41 AM, Tobias Daub hannes.flo...@gmx.li
  mailto:hannes.flo...@gmx.li wrote:
 
 
  Hi There,
 
  I would like to know whats the best way to move an existing Lift
  installation from one system to another. I ask this, because I had
  some
  problems after I just copied the whole directory (I had to edit the
  pom.xml file and do mvn clean install).
 
 
  thanks
 
 
 
 
  


 


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



[Lift] Re: Mapper record deletion

2009-06-16 Thread Magnus Alvestad

 As I move deeper into learning Lift, I now want to start deleting
 Mapper records in the ToDo example.

Here's how I did it (based on suggestions in this group, I think):

bind ( question, html,
  text - ..,
  delete - ajaxButton(Text(Remove),
  Call(dialog, Str(Do you want to delete the question?)),
  () = {q.delete_!; S.notice( Deleted the question!); reDraw
()})
)

.. and then in the template (default.html) ..

script type=javascript

function dialog(text, theCall) {
  if (confirm(text)) theCall();
}

/script

-Magnus

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



[Lift] Re: security

2009-06-16 Thread James Matlik
This looks to be a very significant selling point for Lift.  I realize there
are some high level comments about Lift being designed for security, but I
haven't seen any details explaining what measures have been put in place to
qualify those statements.  This is a prime example of what should be put
into some marketing detail pages on the wiki.  I would love to see a
writeup covering these security measures exhaustively.

On Sat, Jun 13, 2009 at 4:47 PM, David Pollak feeder.of.the.be...@gmail.com
 wrote:



 On Wed, Jun 10, 2009 at 4:45 PM, Oliver Lambert olambo...@gmail.comwrote:



 On Wed, Jun 10, 2009 at 11:58 PM, David Pollak 
 feeder.of.the.be...@gmail.com wrote:



 On Tue, Jun 9, 2009 at 11:39 PM, marius d. marius.dan...@gmail.comwrote:


 Hi,

 For most apps cannonicalization is not really necessary as the
 character stream for form-url-encoded is UTF-8 by default as Lift uses
 UTF-8 by default. Oh and the conversion from URL encoding to plain
 UTF-8 content is really done by container and when we get the params
 from the request object they are already well formed. Now if we're
 talking about a higher level of validation that's a different story
 and IMO this is an application aspect and not much a framework one.


 And Lift does URL Decoding of the paths before presenting them as the
 Req() object.

 More broadly, Lift should provide all the features of ESAPI out of the
 box.  If there are particular things that ESAPI offers that Lift doesn't,
 please flag them and we'll add them.

 I did a bunch of years as VPE and CTO at a web app security company.  In
 general, I've worked to make sure that Lift has security baked in and that
 the developer has to work to make the app insecure, rather than vice versa.
  If I missed a spot, Lift will be enhanced to make sure it does have
 security baked in.


 From my perspective Lift is secure, much more so than other frameworks
 I've used. The current set of Lift apps, that I've helped develop, have
 survived outsourced penetration testing without requiring any modifications
 at all.  Great!

 I'm not a security expert, but I am being asked to consider ESAPI
 features. From my limited understanding, the UTF-8 encoding is fine and Lift
 protects the response from displaying any scripts or html that might have
 inadvertently been added to the database.  The problem is more what is being
 validated and how its being validated. I don't buy Marius's claim that this
 is somehow a higer order validation that is an application concern rather
 than a framework one. The internet has all the insecurities it has, because
 security has been left to the application developer.

 As far a I can see, one problem lies when a string is obtained from the
 web page and instanciated into a String object.  For instance, if it comes
 in as
 scriptalert('XSS')/script, then its probably not what you want.


 I see no reason that you don't want this.  As long as it's a String, it
 will be XML escaped when it's presented to the user.  Unless this String
 were put into an Unparsed block (some affirmative action by the developer),
 it would always appear to the user the way the user typed it.  This is the
 advantage of keeping everything as XML until just before the page is
 delivered to the user.


 Why does it matter if something like this gets stored in your database -
 perhaps because it's one part of your security.  In addition if it comes in
 doubly encoded as

 %253Cscript%253Ealert('XSS')%253C%252Fscript%253E

 then its probably also not what you want.

 1) To stop double encoding, ESAPI suggests that you use cannonicalization
 to convert the strings to a similar format before validation.


 Lift is fact does this.  Lift and/or the app server converts the bytes to
 Strings using UTF-8 encoding and then splits and URL-decodes the Strings
 before delivering them to the application.  The application always sees the
 String as the user typed the String.  All validation is done against Strings
 that have been decoded the same way.



 2) After, the input has been cannonicalized, ESAPI suggests that the input
 should be validated against a whitelist of allowed charaters.


 I disagree with this recommendation within the bounds of a Lift app.
 Strings in Java survive having \00 characters.  They are impurvious to
 buffer overflow attacks.  Strings are escaped before being used as part of
 queries by the JDBC and/or JPA systems (unless the developer explicitly
 builds their own query string, which requires that the developer sign and
 date the code and is a place where one can grep for the construct during a
 code review.)  Strings back out to XML or XHTML will be escaped properly,
 unless the developer uses Unparsed() in rendering... once again, something
 that can be easily checked for in a code review.

 The above rules don't apply to PHP or other code that builds queries from
 raw Strings.  The above rules don't apply to any templating system (all that
 I know of except perhaps 

[Lift] Re: file upload

2009-06-16 Thread DavidV

I'm still stuck on this problem.
Just bringing it to the top of the list again so it's not forgotten...

On Jun 15, 4:04 pm, DavidV david.v.villa...@gmail.com wrote:
 I was able to find the code and have a program ready to parse the
 files as soon as I can upload them.  I tried writing my own version of
 the code found 
 here:http://github.com/dpp/liftweb/blob/dcc7b064a42832b06e4523d1a35351967d...
 but I got the following error when I tried to load the page on my
 browser:

 XML Parsing Error: prefix not bound to a namespace
 Location:http://localhost:8080/analysis/inprocess
 Line Number 78, Column 1:
 choose:post
 ^

 I am not sure what choose is or where to find it and am having
 trouble finding documentation online.  I am still working with
 Lift-1.0, could this be the problem?

 Thanks,
 David

 On Jun 12, 6:35 am, wapgui torsten.schm...@wapgui.com wrote:

  I do similar things.

  First there is a snippet using the bind functionality.
  var image : FileParamHolder = _

  bind(widget, xhtml,
    image - fileUpload(image = _)

  }

  Now write out:

  val wbos : ByteArrayOutputStream = build(image)
  val fout = new File(outputFilename)
  if (fout.exists()) {
     Log.error(Tried to overwrite existing file)
     return Error: Filename already exists}

  val foStream = new FileOutputStream(fout)
  foStream.write(wbos.toByteArray())
  foStream.close()

  def build(image : FileParamHolder) : ByteArrayOutputStream = {
    val bout = new ByteArrayOutputStream()
    val zipout : ZipOutputStream = new ZipOutputStream(bout)
    zipout.setMethod(ZipOutputStream.DEFLATED);
    zipout.setLevel(Deflater.DEFAULT_COMPRESSION);

    writeImage(zos, image)

  }

  private def writeImage(zos: ZipOutputStream,
  image:FileParamHolder):Unit = {
      if (image.fileName == ) {
        Log.info(Provided image file is null)
        return
      }
      if (image.fileName.lastIndexOf(\\) != -1) //this is needed if
  upload is from a windows system
        zos.putNextEntry(new ZipEntry(res/ + image.fileName.substring
  (image.fileName.lastIndexOf(\\)+1)))
      else
        zos.putNextEntry(new ZipEntry(res/ + image.fileName))
      zos.write(image.file, 0, image.file.length) //make here a loop on
  very large files
      zos.closeEntry()

  }

  Cheers
  Torsten

  On Jun 11, 10:24 pm, DavidV david.v.villa...@gmail.com wrote:

   I would like to upload a .csv file onto the web server so I can then
   parse it in my webapp, and put certain fields into my database.  I
   would like a Browse... button, much like the one shown on this Lift
   example page:http://demo.liftweb.net/file_upload
   Can anyone point me in the right direction as to how to get started
   doing this, or tell me where I can find the example code for the link
   I provided?  I can't seem to locate it in liftweb in github
   thanks,
   David

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



[Lift] sample code for using JDO on GAE/J

2009-06-16 Thread Atsuhiko Yamanaka

Hi there,

I have pushed a sample code for using JDO on GAE/J to github.
It has been named as lift-gae-jdo and located at
  http://github.com/ymnk/lift-gae-jdo/tree/master

The latest version of Its README is available at
  
http://github.com/ymnk/lift-gae-jdo/blob/ac06f6460bda5013acc2dc07fd65491a2be65dc0/README

Enjoy!


Sincerely,
--
Atsuhiko Yamanaka
JCraft,Inc.
1-14-20 HONCHO AOBA-KU,
SENDAI, MIYAGI 980-0014 Japan.
Tel +81-22-723-2150
+1-415-578-3454
Skype callto://jcraft/

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



[Lift] Re: file upload

2009-06-16 Thread TylerWeir

Take a look at:
http://github.com/dpp/liftweb/blob/dcc7b064a42832b06e4523d1a35351967d7a46b2/sites/example/src/main/scala/net/liftweb/example/snippet/Misc.scala#L119

It should cast some light on your issue.

On Jun 16, 9:54 am, DavidV david.v.villa...@gmail.com wrote:
 I'm still stuck on this problem.
 Just bringing it to the top of the list again so it's not forgotten...

 On Jun 15, 4:04 pm, DavidV david.v.villa...@gmail.com wrote:

  I was able to find the code and have a program ready to parse the
  files as soon as I can upload them.  I tried writing my own version of
  the code found 
  here:http://github.com/dpp/liftweb/blob/dcc7b064a42832b06e4523d1a35351967d...
  but I got the following error when I tried to load the page on my
  browser:

  XML Parsing Error: prefix not bound to a namespace
  Location:http://localhost:8080/analysis/inprocess
  Line Number 78, Column 1:
  choose:post
  ^

  I am not sure what choose is or where to find it and am having
  trouble finding documentation online.  I am still working with
  Lift-1.0, could this be the problem?

  Thanks,
  David

  On Jun 12, 6:35 am, wapgui torsten.schm...@wapgui.com wrote:

   I do similar things.

   First there is a snippet using the bind functionality.
   var image : FileParamHolder = _

   bind(widget, xhtml,
     image - fileUpload(image = _)

   }

   Now write out:

   val wbos : ByteArrayOutputStream = build(image)
   val fout = new File(outputFilename)
   if (fout.exists()) {
      Log.error(Tried to overwrite existing file)
      return Error: Filename already exists}

   val foStream = new FileOutputStream(fout)
   foStream.write(wbos.toByteArray())
   foStream.close()

   def build(image : FileParamHolder) : ByteArrayOutputStream = {
     val bout = new ByteArrayOutputStream()
     val zipout : ZipOutputStream = new ZipOutputStream(bout)
     zipout.setMethod(ZipOutputStream.DEFLATED);
     zipout.setLevel(Deflater.DEFAULT_COMPRESSION);

     writeImage(zos, image)

   }

   private def writeImage(zos: ZipOutputStream,
   image:FileParamHolder):Unit = {
       if (image.fileName == ) {
         Log.info(Provided image file is null)
         return
       }
       if (image.fileName.lastIndexOf(\\) != -1) //this is needed if
   upload is from a windows system
         zos.putNextEntry(new ZipEntry(res/ + image.fileName.substring
   (image.fileName.lastIndexOf(\\)+1)))
       else
         zos.putNextEntry(new ZipEntry(res/ + image.fileName))
       zos.write(image.file, 0, image.file.length) //make here a loop on
   very large files
       zos.closeEntry()

   }

   Cheers
   Torsten

   On Jun 11, 10:24 pm, DavidV david.v.villa...@gmail.com wrote:

I would like to upload a .csv file onto the web server so I can then
parse it in my webapp, and put certain fields into my database.  I
would like a Browse... button, much like the one shown on this Lift
example page:http://demo.liftweb.net/file_upload
Can anyone point me in the right direction as to how to get started
doing this, or tell me where I can find the example code for the link
I provided?  I can't seem to locate it in liftweb in github
thanks,
David


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



[Lift] Re: file upload

2009-06-16 Thread DavidV

yes, that's what I was looking for.  thanks!

On Jun 16, 11:11 am, TylerWeir tyler.w...@gmail.com wrote:
 Take a look 
 at:http://github.com/dpp/liftweb/blob/dcc7b064a42832b06e4523d1a35351967d...

 It should cast some light on your issue.

 On Jun 16, 9:54 am, DavidV david.v.villa...@gmail.com wrote:

  I'm still stuck on this problem.
  Just bringing it to the top of the list again so it's not forgotten...

  On Jun 15, 4:04 pm, DavidV david.v.villa...@gmail.com wrote:

   I was able to find the code and have a program ready to parse the
   files as soon as I can upload them.  I tried writing my own version of
   the code found 
   here:http://github.com/dpp/liftweb/blob/dcc7b064a42832b06e4523d1a35351967d...
   but I got the following error when I tried to load the page on my
   browser:

   XML Parsing Error: prefix not bound to a namespace
   Location:http://localhost:8080/analysis/inprocess
   Line Number 78, Column 1:
   choose:post
   ^

   I am not sure what choose is or where to find it and am having
   trouble finding documentation online.  I am still working with
   Lift-1.0, could this be the problem?

   Thanks,
   David

   On Jun 12, 6:35 am, wapgui torsten.schm...@wapgui.com wrote:

I do similar things.

First there is a snippet using the bind functionality.
var image : FileParamHolder = _

bind(widget, xhtml,
  image - fileUpload(image = _)

}

Now write out:

val wbos : ByteArrayOutputStream = build(image)
val fout = new File(outputFilename)
if (fout.exists()) {
   Log.error(Tried to overwrite existing file)
   return Error: Filename already exists}

val foStream = new FileOutputStream(fout)
foStream.write(wbos.toByteArray())
foStream.close()

def build(image : FileParamHolder) : ByteArrayOutputStream = {
  val bout = new ByteArrayOutputStream()
  val zipout : ZipOutputStream = new ZipOutputStream(bout)
  zipout.setMethod(ZipOutputStream.DEFLATED);
  zipout.setLevel(Deflater.DEFAULT_COMPRESSION);

  writeImage(zos, image)

}

private def writeImage(zos: ZipOutputStream,
image:FileParamHolder):Unit = {
    if (image.fileName == ) {
      Log.info(Provided image file is null)
      return
    }
    if (image.fileName.lastIndexOf(\\) != -1) //this is needed if
upload is from a windows system
      zos.putNextEntry(new ZipEntry(res/ + image.fileName.substring
(image.fileName.lastIndexOf(\\)+1)))
    else
      zos.putNextEntry(new ZipEntry(res/ + image.fileName))
    zos.write(image.file, 0, image.file.length) //make here a loop on
very large files
    zos.closeEntry()

}

Cheers
Torsten

On Jun 11, 10:24 pm, DavidV david.v.villa...@gmail.com wrote:

 I would like to upload a .csv file onto the web server so I can then
 parse it in my webapp, and put certain fields into my database.  I
 would like a Browse... button, much like the one shown on this Lift
 example page:http://demo.liftweb.net/file_upload
 Can anyone point me in the right direction as to how to get started
 doing this, or tell me where I can find the example code for the link
 I provided?  I can't seem to locate it in liftweb in github
 thanks,
 David

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



[Lift] Re: scalajpa - while accessing two distincts databases, the second access is made with a connection to the first database

2009-06-16 Thread Jean-Luc
For your information, here is an extract of source code of RequestVarEM :

Trait RequestVarEM extends ScalaEntityManager with ScalaEMFactory {
   object emVar extends RequestVar[EntityManager](openEM()) { ... }
}

EntityManager is stored in the singleton emVar; so, all db access of Model
objects are made using the singleton emVar.
= trait RequestVarEM allow only one connection to a database within the
same HttpRequest context.


Jean-Luc

2009/6/15 Jean-Luc jlcane...@gmail.com

 Hello,

 I have two databases, db1 (a.k.a. Motorbike) and db2 (a.k.a. Motorway)
 defined with RequestVarEM :
 - object ModelDb1 extends LocalEMF(db1) with RequestVarEM  // Motorbike
 database
 - object ModelDb2 extends LocalEMF(db2) with RequestVarEM  // Motorway
 database

 I thought one could access to any databases independently from any snippet
 as long as the correct Model object were used (ModelDb1 or ModelDb2 for
 exemple) ; but when I access both databases from the same page, the second
 database access issues a Named query not found exception.

 I have two snippets, one to display a list of motorbike, another to
 display a list of motorway :
 - page1 :
 ModelDb1.createNamedQuery[Motorbike](Motorbike.findAll).getResultList() =
 ok
 - page2
 : ModelDb2.createNamedQuery[Motorway](Motorway.findAll).getResultList() =
 ok
 - page3 : calling from page 3 motorbike  motorway snippets : Named query
 not found: Motorway.findAll
 - page4 : calling from page 4 motorway  motorbike snippets : Named query
 not found: Motorbike.findAll
 - page3  changing the query of *Motorway* snippet :
   - 
 ModelDb2.createNamedQuery[*Motorbike*](*Motorbike*.findAll).getResultList()
 = it's ok and I do NOT have an exception !

 I joined a sample application, ...

 any idea about this issue ?
 (bad use of LocalEMF in the application code ? issue with LocalEMF or
 RequestVarEM ?)

 Jean-Luc

 PS :
 I don't know if it's related but I have this in the log :
 [INFO] Checking for multiple versions of scala
 [WARNING] Multiple versions of scala libraries detected!


 --
 Jean-Luc Canela
 jlcane...@gmail.com




-- 
Jean-Luc Canela
jlcane...@gmail.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 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: links, menu items and mega user

2009-06-16 Thread Derek Chen-Becker
There are two ways to handle simple links:

   1. If you want some function to be executed when the link is clicked, use
   SHtml.link from a snippet or view: SHtml.link(page2, () = ..., Text(Some
   Link))
   2. If you just want a link, just use plain XHTML: a href=page2 Some
   Link/a.

Note that in either case we leave the suffix off of the target page. This is
because Lift will try a variety of suffixes to match language and file type
automatically.

Derek

On Mon, Jun 15, 2009 at 6:10 AM, mr revuza rev...@gmail.com wrote:


 Just getting started previewing Lift. It looks cool. The demos looks
 cool as does the todo sample.

 One thing I do not see is an example of doing a simple link to another
 page (ie. from page1.html adding an a tag to page2.html). Is there
 an appropriate lift:? incantation to link to another page that is
 not registered as a menu item? Is there some other place in the
 bootstrap where pages would be listed? Or is it appropriate add the
 full path to page2.html from within page1.html and be done?

 Also, is there an example available of hiding menu items for users
 that are not logged in? For example, if I wanted to add an Add Todo
 and View Todo item to the menu only once the user has logged in.

 Finally, is there an example available of overriding some of the
 behavior of the MetaMegaProtoUser? For example if I did not want to
 have a timezone or locale column, or perhaps at the least not exposing
 those through the sign up page?

 Thank you for you insights

 


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



[Lift] Re: Redirect after login

2009-06-16 Thread Alexander Azarov

David, Glenn,

Many thanks to the thread, I realized how to redirect a user the page
he/she was going to load after his/her logon. In this case, I believe
it's better to re-implement usual IfLoggedIn (instead of overriding
User.login):

lazy val IfLoggedIn = If(User.loggedIn_? _, loginAndComeBack _)

def loginAndComeBack = {
  val uri = S.uri
  RedirectWithState(loginUri, RedirectState( () = User.loginReferer
(uri), ?(notlogged) - NoticeType.Notice ) )
}

lazy val loginUri = SiteMap.findLoc(Login).map{ _.link.uriList }.
  openOr(LiftRules.siteMapFailRedirectLocation).mkString(/, /, )

Alexander

On 19 май, 02:57, David Pollak feeder.of.the.be...@gmail.com wrote:
 Glenn,

 Sorry... my mistake... the following code works:

   object loginReferer extends SessionVar(/)

   override def homePage = {
     var ret = loginReferer.*is*
     loginReferer.remove()
     ret
   }

   override def login = {
     for (r - S.referer if loginReferer.is == /) loginReferer.set(r)
     super.login
   }

 Note the is which extracts the contents from the SessionVar before it's
 reset.

 On Sun, May 17, 2009 at 10:30 AM, glenn gl...@exmbly.com wrote:

  David,

  I was a little puzzled by the line, in the override of def homePage,
  of loginReferer.remove(). This actually resets the homePage to /.
  Removing the line has the intended result. But, then I need a way
  to reset the loginReferer session variable.

 Yeah... the reset happened before the old value was removed from the
 SessionVar.  The above code fixes the problem.



  Better still, it would be nice to be able to create additional
  stateful
  parameter maps, something like Seam's conversation state, which
  would make creation of wizards a breeze.

 There's some of that we StatefulSnippets... seehttp://demo.liftweb.net/arc

 I'm hoping that we'll get full wizard support in Lift for 1.1 
 (seehttps://www.lostlake.org/wizard.wmvexcept using a DSL like SiteMap rather
 than XML).



  This brings up another point. The only way I trust to trace the code
  to determine what's going on is the old-fashioned way, of putting in
  a bunch of println statements in my code. With lift's flow back-and-
  forth
  between templates, which are really client-side, and snippets, which
  are on the server, normal java debugging tools just doesn't work.

 That's strange.  There's nothing rendered to the client until all the
 template stuff is fully rendered (the templates are processed by the server
 and the snippets are invoked as the lift:xxx/ tags are encountered during
 the first re-write phase of template process.)

 People have had success setting breakpoints in Eclipse, NetBeans and
 IntelliJ in Lift apps.  I use println personally.

 Thanks,

 David





  This makes developing a slow process and can even offset the gains
  lift brings to coding efficiency.

  What do you, and other's use for debugging that might help.

  Thanks in advance for your assistance.

  Glenn...

  On May 15, 3:35 pm, David Pollak feeder.of.the.be...@gmail.com
  wrote:
   In your User object, do the following:

   object loginReferer extends SessionVar(/)

   override def homePage = {
     var ret = loginReferer
     loginReferer.remove()
     ret

   }

   override def login = {
     for (r - S.referer if loginReferer.is == /) loginReferer.set(r)
     super.login

   }

   So, we're setting up a session variable the keeps track of the referer to
   the login page.

   We define the homePage method to return this page, but reset after use.

   And we override the login method to record the referer.

   On Fri, May 15, 2009 at 3:11 PM, glenn gl...@exmbly.com wrote:

I'm using ProtoUser. But even so, I thought that I might have to
create a
bunch of separate login pages, each using the loginXhtml form so that
action={S.uri} would generate the links to match with the cases. In
that
way I could do the redirection. But that seems convoluted, to me.

This goes back to using EarlyAccess on a menu item, redirecting to the
appropriate
login page, and then once the user logs in, he is immediately taken to
a new page
rather than back to /index. Really, what I'm trying to do is create
a wizard widget
or sorts, to perform a sequence of tasks with a finish button on the
last page.

Glenn...

On May 15, 2:43 pm, David Pollak feeder.of.the.be...@gmail.com
wrote:
 On your login page, you can capture the referer and then redirect to
  the
 refering page on successful login.

 Are you using ProtoUser or are you rolling your own login page?

 On Fri, May 15, 2009 at 1:27 PM, glenn gl...@exmbly.com wrote:

  If I wanted to redirect the user to a different page, depending on
  what page they were on when they initiated a login,
  does anyone know of a good solution?

  I'm thinking I need to use a DispatchLocSnippets and define
  different
  dispatch case functions. But I'm not clear how best to go about it?
  Would I 

[Lift] Re: sample code for using JDO on GAE/J

2009-06-16 Thread David Pollak
Excellent!

On Tue, Jun 16, 2009 at 7:42 AM, Atsuhiko Yamanaka 
atsuhiko.yaman...@gmail.com wrote:


 Hi there,

 I have pushed a sample code for using JDO on GAE/J to github.
 It has been named as lift-gae-jdo and located at
  http://github.com/ymnk/lift-gae-jdo/tree/master

 The latest version of Its README is available at

 http://github.com/ymnk/lift-gae-jdo/blob/ac06f6460bda5013acc2dc07fd65491a2be65dc0/README

 Enjoy!


 Sincerely,
 --
 Atsuhiko Yamanaka
 JCraft,Inc.
 1-14-20 HONCHO AOBA-KU,
 SENDAI, MIYAGI 980-0014 Japan.
 Tel +81-22-723-2150
+1-415-578-3454
 Skype callto://jcraft/

 



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

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



[Lift] Re: Lift Jquery autocomplete *** API CHANGE CANDIDATE ***

2009-06-16 Thread Derek Chen-Becker
Whenever I see msys I hear emesis in my head. Emesis is the medical term
for vomiting.

On 6/16/09, marius d. marius.dan...@gmail.com wrote:


 two things:

 1. Hate msysgit
 2. Thanks to Jorge for his help in committing the file



 Marius


 On Jun 16, 9:41 am, marius d. marius.dan...@gmail.com wrote:
  yes yes yes ... entirely my bad as I missed that out ...
 
  I'll correct it very soon.
 
  Marius
 
  On Jun 16, 3:07 am, Bryan. germ...@gmail.com wrote:
 
   Hi Marius,
 
   I just updated to the tip and got a build failure:
 
   [WARNING] /home/bryan/public-repos/git/liftweb/sites/example/src/main/
   scala/net/liftweb/example/snippet/Ajax.scala:65: error: value
   autocomplete is not a member of object net.liftweb.http.jquery.JqSHtml
   [WARNING]  auto - JqSHtml.autocomplete(, buildQuery _, _
   = ()))
 
   --Bryan
 
   On Jun 15, 2:16 pm, marius d. marius.dan...@gmail.com wrote:
 
Folks,
 
I just made the autocomplete a Lift widget so it does not exist
anymore in JqShtml object. Here is an example on how to use it:
 
- For Ajax autocomplete
AutoComplete(, (current, limit) = {
  println(current =  + current)
  (1 to limit).map(v = Value_ + v)
}, s = println(submit  + s))
 
- For pre-provided options list
   AutoComplete.autocompleteObj(/*same params as bfore*/)
 
This may break your app but I think it is very easy to update it.
 
I also fixed some bugs:
1. It didn;t work if the container cookies were turned off
2. hovering on the options list did not work on Ubuntu FF3 at least
due to a capitalizated LI equality test.
 
If you encounter any problems, please let me know.
 
Br's,
Marius
 
On Jun 8, 12:34 pm, Kevin Wright kev.lee.wri...@googlemail.com
wrote:
 
 +1
 
 As an evolving framework, it definitely makes more sense to favour
 consistency over backward compatibility at this stage
 
 On Mon, Jun 8, 2009 at 9:00 AM, marius d. marius.dan...@gmail.com
 wrote:
 
  Other folks, please speak up ! :) ... I will soon migrate this
 into a
  Lift widget.
 
  Br's,
  Marius
 
  On Jun 6, 4:53 pm, David Pollak feeder.of.the.be...@gmail.com
 wrote:
   I think I'm using in one place in one project so my api
 breakage factor
  is
   low.  I'm okay with moving it unless someone else is going to
 feel real
   pain.
 
   On Jun 6, 2009 12:24 AM, Marius marius.dan...@gmail.com
 wrote:
 
   Is there a reason why the JQuery autocomplete is not a Lift
 widget but
   instead it lives in http/jquery package? .. I remember a long
 time ago
   me putting it in the jquery package to separate SHtml stuff
 that is
   dependent on JQuery to the others.
 
   Thoughts?
 
   Br',
   Marius
 


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



[Lift] Re: Lift Jquery autocomplete *** API CHANGE CANDIDATE ***

2009-06-16 Thread David Pollak
How about vmware and Linux as your dev platform?  Just askin'

On Tue, Jun 16, 2009 at 12:16 AM, marius d. marius.dan...@gmail.com wrote:


 two things:

 1. Hate msysgit
 2. Thanks to Jorge for his help in committing the file


 Marius

 On Jun 16, 9:41 am, marius d. marius.dan...@gmail.com wrote:
  yes yes yes ... entirely my bad as I missed that out ...
 
  I'll correct it very soon.
 
  Marius
 
  On Jun 16, 3:07 am, Bryan. germ...@gmail.com wrote:
 
   Hi Marius,
 
   I just updated to the tip and got a build failure:
 
   [WARNING] /home/bryan/public-repos/git/liftweb/sites/example/src/main/
   scala/net/liftweb/example/snippet/Ajax.scala:65: error: value
   autocomplete is not a member of object net.liftweb.http.jquery.JqSHtml
   [WARNING]  auto - JqSHtml.autocomplete(, buildQuery _, _
   = ()))
 
   --Bryan
 
   On Jun 15, 2:16 pm, marius d. marius.dan...@gmail.com wrote:
 
Folks,
 
I just made the autocomplete a Lift widget so it does not exist
anymore in JqShtml object. Here is an example on how to use it:
 
- For Ajax autocomplete
AutoComplete(, (current, limit) = {
  println(current =  + current)
  (1 to limit).map(v = Value_ + v)
}, s = println(submit  + s))
 
- For pre-provided options list
   AutoComplete.autocompleteObj(/*same params as bfore*/)
 
This may break your app but I think it is very easy to update it.
 
I also fixed some bugs:
1. It didn;t work if the container cookies were turned off
2. hovering on the options list did not work on Ubuntu FF3 at least
due to a capitalizated LI equality test.
 
If you encounter any problems, please let me know.
 
Br's,
Marius
 
On Jun 8, 12:34 pm, Kevin Wright kev.lee.wri...@googlemail.com
wrote:
 
 +1
 
 As an evolving framework, it definitely makes more sense to favour
 consistency over backward compatibility at this stage
 
 On Mon, Jun 8, 2009 at 9:00 AM, marius d. marius.dan...@gmail.com
 wrote:
 
  Other folks, please speak up ! :) ... I will soon migrate this
 into a
  Lift widget.
 
  Br's,
  Marius
 
  On Jun 6, 4:53 pm, David Pollak feeder.of.the.be...@gmail.com
 wrote:
   I think I'm using in one place in one project so my api
 breakage factor
  is
   low.  I'm okay with moving it unless someone else is going to
 feel real
   pain.
 
   On Jun 6, 2009 12:24 AM, Marius marius.dan...@gmail.com
 wrote:
 
   Is there a reason why the JQuery autocomplete is not a Lift
 widget but
   instead it lives in http/jquery package? .. I remember a long
 time ago
   me putting it in the jquery package to separate SHtml stuff
 that is
   dependent on JQuery to the others.
 
   Thoughts?
 
   Br',
   Marius
 



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

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



[Lift] Difference between running from command line and from Eclipse

2009-06-16 Thread ph

I've created a test hello-world lift project and it runs fine.
http://wiki.liftweb.net/index.php/HowTo_start_a_new_liftwebapp

also I've imported this project to Eclipse (mvn eclipse:eclipse) and
import from Eclipse. I'm currently using m2eclipse (http://
m2eclipse.codehaus.org/), but before I tried Eclipse IAM with same
result:
error in src/test/scala/RunWebApp.scala
import _root_.org.mortbay.jetty.webapp.WebAppContext = WebAppContext
is not in webapp

project still runs from command line and fails in Eclipse

I tried to create lift projects with maven in eclipse with same result
- that error

I'm on Windows


What is the difference beween running from command line and Eclipse
and is there a way to fix it?

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



[Lift] article proposal : How to code a multi-criteria search form using Hibernate Criteria API

2009-06-16 Thread Jean-Luc
Hello,

I propose to write an article about How to code a multi-criteria search
form using Hibernate Criteria API.

Before starting, I'd like to check :
- if no such article is being written ...
- if someone is interested by the subject

Jean-Luc

-- 
Jean-Luc Canela
jlcane...@gmail.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 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Develop / Production System

2009-06-16 Thread David Pollak
On Tue, Jun 16, 2009 at 6:43 AM, Oliver Lambert olambo...@gmail.com wrote:

 Sometimes (is this, folk-tale or truth?) the maven repository around the
 application you'reworking on may get slightly out of sync. Then you might
 need to delete the part of
 the repository that your application is installed into.


I typically do an rm -rf ~/.m2 once every few weeks... the maven repo gets
rebuilt and life goes in... but that's just me.



 On Tue, Jun 16, 2009 at 7:25 PM, Tobias Daub hannes.flo...@gmx.li wrote:


 Ok, thanks.

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


  Maven stores project dependencies in a repository (by default, its
  called .m2). When you move a Lift application from one system to
  another, the repository on the new system may need to be updated,
  hence your requirement to do a mvn clean install.
 
  Don't know what you changed on the pom.xml (if you have any hard coded
  paths, you might have to change them).
 
  On Tue, Jun 16, 2009 at 2:41 AM, Tobias Daub hannes.flo...@gmx.li
  mailto:hannes.flo...@gmx.li wrote:
 
 
  Hi There,
 
  I would like to know whats the best way to move an existing Lift
  installation from one system to another. I ask this, because I had
  some
  problems after I just copied the whole directory (I had to edit the
  pom.xml file and do mvn clean install).
 
 
  thanks
 
 
 
 
  





 



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

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



[Lift] Re: Getting Started Issue

2009-06-16 Thread David Pollak
Thanks for answering your own question. :-)

On Mon, Jun 15, 2009 at 3:13 PM, Chris Lamey cla...@gmail.com wrote:


 FYI - I had to specify the full name to get it to work:

 ./apache-maven-2.0.10/bin/mvn -e org.apache.maven.plugins:maven-
 archetype-plugin:2.0-alpha-4:generate -U -
 DarchetypeGroupId=net.liftweb -DarchetypeArtifactId=lift-archetype-
 blank -DarchetypeVersion=1.0 -DremoteRepositories=http://scala-
 tools.org/repo-releases -DgroupId=demo.helloworld -
 DartifactId=helloworld -Dversion=1.0-SNAPSHOT

 Thanks,
 Chris

 On Jun 15, 3:30 pm, Chris Lamey cla...@gmail.com wrote:
  Heya,
 
  I'm on Mac OS X 10.5 using Java 1.6.0_07 and Maven 2.0.10.
 
  I'm following the Getting Started guide here:
 
 http://liftweb.net/docs/getting_started/mod_master.html
 
  And am running into a maven issue with the first application:
 
  clameylt:~/tmp/lift  ./apache-maven-2.0.10/bin/mvn -e
  archetype:generate -U -DarchetypeGroupId=net.liftweb -
  DarchetypeArtifactId=lift-archetype-blank -DarchetypeVersion=1.0 -
  DremoteRepositories=http://scala-tools.org/repo-releases-
  DgroupId=demo.helloworld -DartifactId=helloworld -Dversion=1.0-
  SNAPSHOT
  + 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 lm
  [INFO] org.apache.maven.plugins: checking for updates from central
  [INFO] org.codehaus.mojo: checking for updates from lm
  [INFO] org.codehaus.mojo: checking for updates from central
  [INFO] artifact org.apache.maven.plugins:maven-archetype-plugin:
  checking for updates from lm
  [INFO] artifact org.apache.maven.plugins:maven-archetype-plugin:
  checking for updates from central
  [INFO]
  
  [ERROR] BUILD FAILURE
  [INFO]
  
  [INFO] Required goal not found: archetype:generate in
  org.apache.maven.plugins:maven-archetype-plugin:1.0-alpha-4
  [INFO]
  
  [INFO] Trace
  org.apache.maven.BuildFailureException: Required goal not found:
  archetype:generate in org.apache.maven.plugins:maven-archetype-plugin:
  1.0-alpha-4
  at
  org.apache.maven.lifecycle.DefaultLifecycleExecutor.getMojoDescriptor
  (DefaultLifecycleExecutor.java:1559)
  at
 
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.segmentTaskListByAggregationNeeds
  (DefaultLifecycleExecutor.java:406)
  at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute
  (DefaultLifecycleExecutor.java:137)
  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:301)
  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:585)
  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)
  [INFO]
  
  [INFO] Total time: 1 second
  [INFO] Finished at: Mon Jun 15 15:25:18 MDT 2009
  [INFO] Final Memory: 1M/4M
  [INFO]
  
 
  The doc says Maven 2.0.9 or greater, has anyone run this with 2.0.10?
 
  Thanks,
  Chris

 



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

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



[Lift] Re: Difference between running from command line and from Eclipse

2009-06-16 Thread Jeppe Nejsum Madsen

On 16 Jun 2009, ph wrote:


 I've created a test hello-world lift project and it runs fine.
 http://wiki.liftweb.net/index.php/HowTo_start_a_new_liftwebapp
 
 also I've imported this project to Eclipse (mvn eclipse:eclipse) and
 import from Eclipse. I'm currently using m2eclipse (http://
 m2eclipse.codehaus.org/), but before I tried Eclipse IAM with same
 result:
 error in src/test/scala/RunWebApp.scala
 import _root_.org.mortbay.jetty.webapp.WebAppContext = WebAppContext
 is not in webapp
 
 project still runs from command line and fails in Eclipse
 
 I tried to create lift projects with maven in eclipse with same result
 - that error
 
 I'm on Windows

I had the same problems. IIRC, it's a problem with the build path source
folders/multiple output folders generated by the mvn eclipse plugin. 

I fixed this by manually deleting the source folders in eclipse and then
adding
  src/main/scala
  src/test/scala

as source folders (using the default output folder)

/Jeppe
  

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



[Lift] Re: Difference between running from command line and from Eclipse

2009-06-16 Thread Philippe Kirsanov
Thank you for the reply, however I don't think this is the issue (I tried
and that didn't work).Seems like issue in which version of Jetty is used.
Maven generates pom file with jetty version [6.1.16,) and this works from
command line, in Eclipse however it tries to use version 7.0.0.pre5 (I see
it in dependencies). Changing jetty to version 7.0.0.pre5 in pom forces
same error running from command line.
The question is how to make maven plugin Eclipse use jetty v6 and not 7
pre5.


On Tue, Jun 16, 2009 at 15:32, Jeppe Nejsum Madsen je...@ingolfs.dk wrote:


 On 16 Jun 2009, ph wrote:


  I've created a test hello-world lift project and it runs fine.
  http://wiki.liftweb.net/index.php/HowTo_start_a_new_liftwebapp
 
  also I've imported this project to Eclipse (mvn eclipse:eclipse) and
  import from Eclipse. I'm currently using m2eclipse (http://
  m2eclipse.codehaus.org/), but before I tried Eclipse IAM with same
  result:
  error in src/test/scala/RunWebApp.scala
  import _root_.org.mortbay.jetty.webapp.WebAppContext = WebAppContext
  is not in webapp
 
  project still runs from command line and fails in Eclipse
 
  I tried to create lift projects with maven in eclipse with same result
  - that error
 
  I'm on Windows

 I had the same problems. IIRC, it's a problem with the build path source
 folders/multiple output folders generated by the mvn eclipse plugin.

 I fixed this by manually deleting the source folders in eclipse and then
 adding
  src/main/scala
  src/test/scala

 as source folders (using the default output folder)

 /Jeppe


 


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



[Lift] Re: Difference between running from command line and from Eclipse

2009-06-16 Thread David Bernard
oups (old version) set the version to 6.1.17 or any 6.1.x and remove range
version indicator [ and ,)

On Tue, Jun 16, 2009 at 22:14, Philippe Kirsanov pkirsa...@gmail.comwrote:

 Thank you for the reply, however I don't think this is the issue (I tried
 and that didn't work).Seems like issue in which version of Jetty is used.
 Maven generates pom file with jetty version [6.1.16,) and this works from
 command line, in Eclipse however it tries to use version 7.0.0.pre5 (I see
 it in dependencies). Changing jetty to version 7.0.0.pre5 in pom forces
 same error running from command line.
 The question is how to make maven plugin Eclipse use jetty v6 and not 7
 pre5.


 On Tue, Jun 16, 2009 at 15:32, Jeppe Nejsum Madsen je...@ingolfs.dkwrote:


 On 16 Jun 2009, ph wrote:


  I've created a test hello-world lift project and it runs fine.
  http://wiki.liftweb.net/index.php/HowTo_start_a_new_liftwebapp
 
  also I've imported this project to Eclipse (mvn eclipse:eclipse) and
  import from Eclipse. I'm currently using m2eclipse (http://
  m2eclipse.codehaus.org/), but before I tried Eclipse IAM with same
  result:
  error in src/test/scala/RunWebApp.scala
  import _root_.org.mortbay.jetty.webapp.WebAppContext = WebAppContext
  is not in webapp
 
  project still runs from command line and fails in Eclipse
 
  I tried to create lift projects with maven in eclipse with same result
  - that error
 
  I'm on Windows

 I had the same problems. IIRC, it's a problem with the build path source
 folders/multiple output folders generated by the mvn eclipse plugin.

 I fixed this by manually deleting the source folders in eclipse and then
 adding
  src/main/scala
  src/test/scala

 as source folders (using the default output folder)

 /Jeppe





 


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



[Lift] Firebug error message for AJAX

2009-06-16 Thread Charles F. Munat

I'm getting the following error in Firebug:

YAHOO.lift is undefined
url = YAHOO.lift.buildURI(addPageName('/...nSuccess(res);}, failure : 
onFailure });

I have the following scripts:

script src=/scripts/yahoo-dom-event/yahoo-dom-event.js 
type=text/javascript/script
script src=/scripts/utilities/utilities.js 
type=text/javascript/script
script src=/scripts/json/json-min.js type=text/javascript/script
script src=/scripts/connection/connection-min.js 
type=text/javascript/script
script type=text/javascript src=/ajax_request/liftAjax.js/script


Any ideas?

Chas.

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



[Lift] Re: Difference between running from command line and from Eclipse

2009-06-16 Thread Jeppe Nejsum Madsen

On 16 Jun 2009, Philippe Kirsanov wrote:

 Thank you for the reply, however I don't think this is the issue (I
 tried and that didn't work).Seems like issue in which version of Jetty
 is used.  Maven generates pom file with jetty version [6.1.16,) and
 this works from command line, in Eclipse however it tries to use
 version 7.0.0.pre5 (I see it in dependencies). Changing jetty to
 version 7.0.0.pre5 in pom forces same error running from command
 line.  The question is how to make maven plugin Eclipse use jetty v6
 and not 7 pre5.


Ahh sorry, didn't read the error message thoroughly :-) Why not just
change jetty to 6.1.16? I went through the same steps some time ago. I'm
not quite sure how I got the stuff info Eclipse, but my Eclipse project
references jetty-6.1.6. Maybe something has changed in the lift plugin
since then. This is from my pom: 

dependency
  groupIdorg.mortbay.jetty/groupId
  artifactIdjetty/artifactId
  version[6.1.6]/version
  scopetest/scope
/dependency

/Jeppe


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



[Lift] Re: scalajpa - while accessing two distincts databases, the second access is made with a connection to the first database

2009-06-16 Thread Derek Chen-Becker
OK, I just checked in code that should allow this to work. Could you please
test and make sure that it's functioning correctly?

Thanks,

Derek

On 6/16/09, Derek Chen-Becker dchenbec...@gmail.com wrote:

 Using multiple EMs was not something I had considered when I wrote this. I
 think that I can modify the code to provide a __nameSalt def to
 differentiate instances. Let me work on it and I'll have something soon.

 Derek

 On 6/16/09, Jean-Luc jlcane...@gmail.com wrote:

 For your information, here is an extract of source code of RequestVarEM :

 Trait RequestVarEM extends ScalaEntityManager with ScalaEMFactory {
object emVar extends RequestVar[EntityManager](openEM()) { ... }
 }

 EntityManager is stored in the singleton emVar; so, all db access of Model
 objects are made using the singleton emVar.
 = trait RequestVarEM allow only one connection to a database within the
 same HttpRequest context.


 Jean-Luc

 2009/6/15 Jean-Luc jlcane...@gmail.com

  Hello,

 I have two databases, db1 (a.k.a. Motorbike) and db2 (a.k.a. Motorway)
 defined with RequestVarEM :
 - object ModelDb1 extends LocalEMF(db1) with RequestVarEM  // Motorbike
 database
 - object ModelDb2 extends LocalEMF(db2) with RequestVarEM  // Motorway
 database

 I thought one could access to any databases independently from any
 snippet as long as the correct Model object were used (ModelDb1 or ModelDb2
 for exemple) ; but when I access both databases from the same page, the
 second database access issues a Named query not found exception.

 I have two snippets, one to display a list of motorbike, another to
 display a list of motorway :
 - page1 :
 ModelDb1.createNamedQuery[Motorbike](Motorbike.findAll).getResultList() =
 ok
 - page2
 : ModelDb2.createNamedQuery[Motorway](Motorway.findAll).getResultList() =
 ok
 - page3 : calling from page 3 motorbike  motorway snippets : Named query
 not found: Motorway.findAll
 - page4 : calling from page 4 motorway  motorbike snippets : Named query
 not found: Motorbike.findAll
 - page3  changing the query of *Motorway* snippet :
   - 
 ModelDb2.createNamedQuery[*Motorbike*](*Motorbike*.findAll).getResultList()
 = it's ok and I do NOT have an exception !

 I joined a sample application, ...

 any idea about this issue ?
 (bad use of LocalEMF in the application code ? issue with LocalEMF or
 RequestVarEM ?)

 Jean-Luc

 PS :
 I don't know if it's related but I have this in the log :
 [INFO] Checking for multiple versions of scala
 [WARNING] Multiple versions of scala libraries detected!


 --
 Jean-Luc Canela
 jlcane...@gmail.com




 --
 Jean-Luc Canela
 jlcane...@gmail.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 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Firebug error message for AJAX

2009-06-16 Thread Charles F. Munat

I have the import statment and the LiftRules.jsArtifacts = YUIArtifacts
in Boot, but the script tag for the liftYUI.js script is not being 
inserted. I guess I could add it manually, but isn't Lift supposed to 
insert it?

Thanks!

Chas.

marius d. wrote:
 Also please see: http://wiki.liftweb.net/index.php/HowTo_use_Lift_with_YUI
 
 Marius
 
 On Jun 16, 11:58 pm, marius d. marius.dan...@gmail.com wrote:
 You need one more

 script src=/classpath/liftYUI.js type=text/javascript/script

 Br's,
 Marius

 On Jun 16, 11:30 pm, Charles F. Munat c...@munat.com wrote:

 I'm getting the following error in Firebug:
 YAHOO.lift is undefined
 url = YAHOO.lift.buildURI(addPageName('/...nSuccess(res);}, failure :
 onFailure });
 I have the following scripts:
 script src=/scripts/yahoo-dom-event/yahoo-dom-event.js
 type=text/javascript/script
 script src=/scripts/utilities/utilities.js
 type=text/javascript/script
 script src=/scripts/json/json-min.js type=text/javascript/script
 script src=/scripts/connection/connection-min.js
 type=text/javascript/script
 script type=text/javascript src=/ajax_request/liftAjax.js/script
 Any ideas?
 Chas.
  

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



[Lift] Re: Difference between running from command line and from Eclipse

2009-06-16 Thread Philippe Kirsanov
Thank you
changing to version 6.1.17 worked, but interesting that jetty version that
is running is still 6.1.16 and Eclipse in editor still complains that there
is an error (class  missed)

[INFO] Starting jetty 6.1.16 ...
2009-06-16 16:31:35.173::INFO:  jetty-6.1.16




On Tue, Jun 16, 2009 at 16:23, David Bernard david.bernard...@gmail.comwrote:

 oups (old version) set the version to 6.1.17 or any 6.1.x and remove range
 version indicator [ and ,)


 On Tue, Jun 16, 2009 at 22:14, Philippe Kirsanov pkirsa...@gmail.comwrote:

 Thank you for the reply, however I don't think this is the issue (I tried
 and that didn't work). Seems like issue in which version of Jetty is
 used.
 Maven generates pom file with jetty version [6.1.16,) and this works
 from command line, in Eclipse however it tries to use version 7.0.0.pre5
 (I see it in dependencies). Changing jetty to version 7.0.0.pre5 in pom
 forces same error running from command line.
 The question is how to make maven plugin Eclipse use jetty v6 and not 7
 pre5.


 On Tue, Jun 16, 2009 at 15:32, Jeppe Nejsum Madsen je...@ingolfs.dkwrote:


 On 16 Jun 2009, ph wrote:


  I've created a test hello-world lift project and it runs fine.
  http://wiki.liftweb.net/index.php/HowTo_start_a_new_liftwebapp
 
  also I've imported this project to Eclipse (mvn eclipse:eclipse) and
  import from Eclipse. I'm currently using m2eclipse (http://
  m2eclipse.codehaus.org/), but before I tried Eclipse IAM with same
  result:
  error in src/test/scala/RunWebApp.scala
  import _root_.org.mortbay.jetty.webapp.WebAppContext = WebAppContext
  is not in webapp
 
  project still runs from command line and fails in Eclipse
 
  I tried to create lift projects with maven in eclipse with same result
  - that error
 
  I'm on Windows

 I had the same problems. IIRC, it's a problem with the build path source
 folders/multiple output folders generated by the mvn eclipse plugin.

 I fixed this by manually deleting the source folders in eclipse and then
 adding
  src/main/scala
  src/test/scala

 as source folders (using the default output folder)

 /Jeppe








 


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



[Lift] Re: Difference between running from command line and from Eclipse

2009-06-16 Thread Philippe Kirsanov
yes, that what I did and workedthanks

On Tue, Jun 16, 2009 at 16:36, Jeppe Nejsum Madsen je...@ingolfs.dk wrote:


 On 16 Jun 2009, Philippe Kirsanov wrote:

  Thank you for the reply, however I don't think this is the issue (I
  tried and that didn't work).Seems like issue in which version of Jetty
  is used.  Maven generates pom file with jetty version [6.1.16,) and
  this works from command line, in Eclipse however it tries to use
  version 7.0.0.pre5 (I see it in dependencies). Changing jetty to
  version 7.0.0.pre5 in pom forces same error running from command
  line.  The question is how to make maven plugin Eclipse use jetty v6
  and not 7 pre5.


 Ahh sorry, didn't read the error message thoroughly :-) Why not just
 change jetty to 6.1.16? I went through the same steps some time ago. I'm
 not quite sure how I got the stuff info Eclipse, but my Eclipse project
 references jetty-6.1.6. Maybe something has changed in the lift plugin
 since then. This is from my pom:

 dependency
  groupIdorg.mortbay.jetty/groupId
  artifactIdjetty/artifactId
  version[6.1.6]/version
  scopetest/scope
 /dependency

 /Jeppe


 


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



[Lift] Simple Link

2009-06-16 Thread Makeable

Is there a generator to create a simple non-stateful link, or should I
be manually creating the node?

Kind Regards,

Matt

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



[Lift] Re: scalajpa - while accessing two distincts databases, the second access is made with a connection to the first database

2009-06-16 Thread Meredith Gregory
Derek,

soapbox
You have just demonstrated a process that i have been talking about for the
last 15 years. People have a blind spot when it comes to thinking
compositionally. They think -- almost to a person -- about god's eye view
solutions where there's only one of some key solution component. They don't
think about solutions that are composed of ... (wait for it)... solutions!
It takes some serious training to think compositionally. Compositional
solutions, however, are the only realistic way to scale. When solutions are
compositional, you can *de*compose. The db example is a case in point. One
of the most natural ways to scale data access is sharding and partitioning
-- which requires upfront machinery to support decomposition of the store.

Lest you feel bad, note that some of the best scientific minds of all time
have fallen prey to this blind spot. Newtonian physics as well as Einstein's
update to Newton's proposal is a non-compositional solution. Quantum
mechanics also exhibits compositional failures. This is why physics is
failing to find proposals that link theories of gravitation (essentially
large scale) to quantum mechanical theories of the other forces (essentially
very small scale) -- the physical theories are non-compositional -- they
don't scale!

One of the real things functional programming has going for it is that the
basic model of computation underlying the means of structuring and
manipulating programs is compositional. That's why it is important to have a
technology like Scala resting atop the incumbent execution model (JVM) being
deployed on web-scale problems. Compositionality is the only way to tackle
applications at global scale.
/soapbox

Thanks for getting the fix to this problem in so quickly.

Best wishes,

--greg

On Tue, Jun 16, 2009 at 11:53 AM, Derek Chen-Becker
dchenbec...@gmail.comwrote:

 Using multiple EMs was not something I had considered when I wrote this. I
 think that I can modify the code to provide a __nameSalt def to
 differentiate instances. Let me work on it and I'll have something soon.

 Derek


 On 6/16/09, Jean-Luc jlcane...@gmail.com wrote:

 For your information, here is an extract of source code of RequestVarEM :

 Trait RequestVarEM extends ScalaEntityManager with ScalaEMFactory {
object emVar extends RequestVar[EntityManager](openEM()) { ... }
 }

 EntityManager is stored in the singleton emVar; so, all db access of Model
 objects are made using the singleton emVar.
 = trait RequestVarEM allow only one connection to a database within the
 same HttpRequest context.


 Jean-Luc

 2009/6/15 Jean-Luc jlcane...@gmail.com

  Hello,

 I have two databases, db1 (a.k.a. Motorbike) and db2 (a.k.a. Motorway)
 defined with RequestVarEM :
 - object ModelDb1 extends LocalEMF(db1) with RequestVarEM  // Motorbike
 database
 - object ModelDb2 extends LocalEMF(db2) with RequestVarEM  // Motorway
 database

 I thought one could access to any databases independently from any
 snippet as long as the correct Model object were used (ModelDb1 or ModelDb2
 for exemple) ; but when I access both databases from the same page, the
 second database access issues a Named query not found exception.

 I have two snippets, one to display a list of motorbike, another to
 display a list of motorway :
 - page1 :
 ModelDb1.createNamedQuery[Motorbike](Motorbike.findAll).getResultList() =
 ok
 - page2
 : ModelDb2.createNamedQuery[Motorway](Motorway.findAll).getResultList() =
 ok
 - page3 : calling from page 3 motorbike  motorway snippets : Named query
 not found: Motorway.findAll
 - page4 : calling from page 4 motorway  motorbike snippets : Named query
 not found: Motorbike.findAll
 - page3  changing the query of *Motorway* snippet :
   - 
 ModelDb2.createNamedQuery[*Motorbike*](*Motorbike*.findAll).getResultList()
 = it's ok and I do NOT have an exception !

 I joined a sample application, ...

 any idea about this issue ?
 (bad use of LocalEMF in the application code ? issue with LocalEMF or
 RequestVarEM ?)

 Jean-Luc

 PS :
 I don't know if it's related but I have this in the log :
 [INFO] Checking for multiple versions of scala
 [WARNING] Multiple versions of scala libraries detected!


 --
 Jean-Luc Canela
 jlcane...@gmail.com




 --
 Jean-Luc Canela
 jlcane...@gmail.com




 



-- 
L.G. Meredith
Managing Partner
Biosimilarity LLC
1219 NW 83rd St
Seattle, WA 98117

+1 206.650.3740

http://biosimilarity.blogspot.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 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: scalajpa - while accessing two distincts databases, the second access is made with a connection to the first database

2009-06-16 Thread Oliver Lambert
I think you have just volunteered to help refactor this code to make it more
composition friendly :)

On Wed, Jun 17, 2009 at 9:38 AM, Meredith Gregory
lgreg.mered...@gmail.comwrote:

 Derek,

 soapbox
 You have just demonstrated a process that i have been talking about for the
 last 15 years. People have a blind spot when it comes to thinking
 compositionally. They think -- almost to a person -- about god's eye view
 solutions where there's only one of some key solution component. They don't
 think about solutions that are composed of ... (wait for it)... solutions!
 It takes some serious training to think compositionally. Compositional
 solutions, however, are the only realistic way to scale. When solutions are
 compositional, you can *de*compose. The db example is a case in point. One
 of the most natural ways to scale data access is sharding and partitioning
 -- which requires upfront machinery to support decomposition of the store.

 Lest you feel bad, note that some of the best scientific minds of all time
 have fallen prey to this blind spot. Newtonian physics as well as Einstein's
 update to Newton's proposal is a non-compositional solution. Quantum
 mechanics also exhibits compositional failures. This is why physics is
 failing to find proposals that link theories of gravitation (essentially
 large scale) to quantum mechanical theories of the other forces (essentially
 very small scale) -- the physical theories are non-compositional -- they
 don't scale!

 One of the real things functional programming has going for it is that the
 basic model of computation underlying the means of structuring and
 manipulating programs is compositional. That's why it is important to have a
 technology like Scala resting atop the incumbent execution model (JVM) being
 deployed on web-scale problems. Compositionality is the only way to tackle
 applications at global scale.
 /soapbox

 Thanks for getting the fix to this problem in so quickly.

 Best wishes,

 --greg


 On Tue, Jun 16, 2009 at 11:53 AM, Derek Chen-Becker dchenbec...@gmail.com
  wrote:

 Using multiple EMs was not something I had considered when I wrote this. I
 think that I can modify the code to provide a __nameSalt def to
 differentiate instances. Let me work on it and I'll have something soon.

 Derek


 On 6/16/09, Jean-Luc jlcane...@gmail.com wrote:

 For your information, here is an extract of source code of RequestVarEM :

 Trait RequestVarEM extends ScalaEntityManager with ScalaEMFactory {
object emVar extends RequestVar[EntityManager](openEM()) { ... }
 }

 EntityManager is stored in the singleton emVar; so, all db access of
 Model objects are made using the singleton emVar.
 = trait RequestVarEM allow only one connection to a database within the
 same HttpRequest context.


 Jean-Luc

 2009/6/15 Jean-Luc jlcane...@gmail.com

  Hello,

 I have two databases, db1 (a.k.a. Motorbike) and db2 (a.k.a. Motorway)
 defined with RequestVarEM :
 - object ModelDb1 extends LocalEMF(db1) with RequestVarEM  //
 Motorbike database
 - object ModelDb2 extends LocalEMF(db2) with RequestVarEM  // Motorway
 database

 I thought one could access to any databases independently from any
 snippet as long as the correct Model object were used (ModelDb1 or ModelDb2
 for exemple) ; but when I access both databases from the same page, the
 second database access issues a Named query not found exception.

 I have two snippets, one to display a list of motorbike, another to
 display a list of motorway :
 - page1 :
 ModelDb1.createNamedQuery[Motorbike](Motorbike.findAll).getResultList() =
 ok
 - page2
 : ModelDb2.createNamedQuery[Motorway](Motorway.findAll).getResultList() =
 ok
 - page3 : calling from page 3 motorbike  motorway snippets : Named
 query not found: Motorway.findAll
 - page4 : calling from page 4 motorway  motorbike snippets : Named
 query not found: Motorbike.findAll
 - page3  changing the query of *Motorway* snippet :
   - 
 ModelDb2.createNamedQuery[*Motorbike*](*Motorbike*.findAll).getResultList()
 = it's ok and I do NOT have an exception !

 I joined a sample application, ...

 any idea about this issue ?
 (bad use of LocalEMF in the application code ? issue with LocalEMF or
 RequestVarEM ?)

 Jean-Luc

 PS :
 I don't know if it's related but I have this in the log :
 [INFO] Checking for multiple versions of scala
 [WARNING] Multiple versions of scala libraries detected!


 --
 Jean-Luc Canela
 jlcane...@gmail.com




 --
 Jean-Luc Canela
 jlcane...@gmail.com








 --
 L.G. Meredith
 Managing Partner
 Biosimilarity LLC
 1219 NW 83rd St
 Seattle, WA 98117

 +1 206.650.3740

 http://biosimilarity.blogspot.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 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 

[Lift] Re: Simple Link

2009-06-16 Thread David Pollak
On Tue, Jun 16, 2009 at 5:09 PM, Matt Williams m...@makeable.co.uk wrote:


 I thought as much - I think i've gotten used to helper overload from
 other frameworks and was looking to keep as much markup out of the
 snippets as possible.
 Would it be worth me creating helpers for such trivialities, or are
 they outside the project scope?


I don't think so... I think:

aHref(/foo/bar, something)

is less meaningful in code than:

a href=/foo/barsomething/a

However, you should code your sites the way you want and you should build a
library that helps you.  If you want to open source it, others may find it
valuable and may start using it.

Thanks,

David




 On Jun 17, 12:54 am, David Pollak feeder.of.the.be...@gmail.com
 wrote:
  a href=/mypagego there/a
 
  No need for any lift method to help
 
  On Jun 16, 2009 4:00 PM, Makeable m...@makeable.co.uk wrote:
 
  Is there a generator to create a simple non-stateful link, or should I
  be manually creating the node?
 
  Kind Regards,
 
  Matt

 



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

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



[Lift] directory structure

2009-06-16 Thread Oliver Lambert
In Boot.scala can I call LiftRules.addToPackages multiple times to add
multiple directories with snippets in them?

Do I have to have a directory structure ending with snippet, for snippets?
Do I need the directories comet, model and view, when they are just empty?

cheers
Oliver

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



[Lift] Re: scalajpa - while accessing two distincts databases, the second access is made with a connection to the first database

2009-06-16 Thread Jeremy Day
Greg,

On Tue, Jun 16, 2009 at 6:38 PM, Meredith Gregory
lgreg.mered...@gmail.comwrote:

 It takes some serious training to think compositionally.


No doubt it is extremely tough to think compositionally, and it's all too
easy to fall back on non-compositional ways of thinking.  In a similar vein
it's all too easy to fall into procedural patterns when learning or working
with functional programming in a multi-paradigm language.  But what are good
ways for programmers to learn to think compositionally and, more
importantly, practice?  Do you know of any books or online references that
might help make the transition for anyone who is interested?

Jeremy

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



[Lift] Re: scalajpa - while accessing two distincts databases, the second access is made with a connection to the first database

2009-06-16 Thread Meredith Gregory
Jeremy,

Most excellent question award to you, sir!

How to bootstrap thinking compositionally... this is what i did

   - learn some compositional idioms by heart
  - do you know the shape of the paradoxical combinator by heart
  - do you know the data making up a monad
  - do you know the data making up a distributive law between monads
  - use them in real world applications and see where they fail
  - when is calculating the least/greatest fixpoint of a recursive spec
  for a problem the suboptimal solution
  - when is a monad not the answer
  - when is an indexed form of composition inadequate
  - improve them
  - is it a situational improvement or
  - a fundamental improvement
  - see where the very programming model itself fails
  - is functional composition the only sort of composition
  - how is parallel composition like functional composition
  - is parallel composition easily represented in categorical
  composition
  - improve it
  - what is the view of the world in your notion of composition
  - play with new programming models
  - does your new notion of composition give rise to a whole generation
  of different models
  - invent new idioms in these models
  - what are the things these models naturally express
  - and teach them to someone who wishes to bootstrap thinking
   compositionally

For myself, i was unhappy with the notion of name. The π-calculi and lambda
calculi suffer a dependence on a notion of name. Both families of calculi
require at least countably infinitely many names, and a notion of equality
on names. If names have no internal structure then these theories *cannot be
effective*. The reasons is that the notion of equality must then be realized
as an infinitary table which cannot fit in any computer we have access to.
Therefore, in effective theories, names must have internal structure. Since
they have internal structure and are at least countably infinite, one is in
danger of undermining the foundational character of these proposals for
computing. Therefore, the only possible solution is that the notion of
structured name must come from the notion of program proposed by the model.
This argument is airtight. If you want a foundational model of computing
with nominal structure, the nominal structure must derive from the notion of
computation being put forward, i.e. it must *reflect* the notion of
computation. This gives rise to all kinds of new an beautiful phenomena. One
measure of your way into compositional thinking is whether this is
happening. Is your approach to compositional thinking beginning to yield
whole new aspects of computing, and new 'wholes' of computation, new forms
of organization.

Best wishes,

--greg

On Tue, Jun 16, 2009 at 7:31 PM, Jeremy Day jeremy@gmail.com wrote:

 Greg,

 On Tue, Jun 16, 2009 at 6:38 PM, Meredith Gregory 
 lgreg.mered...@gmail.com wrote:

 It takes some serious training to think compositionally.


 No doubt it is extremely tough to think compositionally, and it's all too
 easy to fall back on non-compositional ways of thinking.  In a similar vein
 it's all too easy to fall into procedural patterns when learning or working
 with functional programming in a multi-paradigm language.  But what are good
 ways for programmers to learn to think compositionally and, more
 importantly, practice?  Do you know of any books or online references that
 might help make the transition for anyone who is interested?

 Jeremy

 



-- 
L.G. Meredith
Managing Partner
Biosimilarity LLC
1219 NW 83rd St
Seattle, WA 98117

+1 206.650.3740

http://biosimilarity.blogspot.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 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: scalajpa - while accessing two distincts databases, the second access is made with a connection to the first database

2009-06-16 Thread Oliver Lambert
2009/6/17 Meredith Gregory lgreg.mered...@gmail.com

 Jeremy,

 Most excellent question award to you, sir!

 How to bootstrap thinking compositionally... this is what i did

- learn some compositional idioms by heart
   - do you know the shape of the paradoxical combinator by heart
   - do you know the data making up a monad
   - do you know the data making up a distributive law between monads
   - use them in real world applications and see where they fail
   - when is calculating the least/greatest fixpoint of a recursive
   spec for a problem the suboptimal solution
   - when is a monad not the answer
   - when is an indexed form of composition inadequate
   - improve them
   - is it a situational improvement or
   - a fundamental improvement
   - see where the very programming model itself fails
   - is functional composition the only sort of composition
   - how is parallel composition like functional composition
   - is parallel composition easily represented in categorical
   composition
   - improve it
   - what is the view of the world in your notion of composition
   - play with new programming models
   - does your new notion of composition give rise to a whole
   generation of different models
   - invent new idioms in these models
   - what are the things these models naturally express
   - and teach them to someone who wishes to bootstrap thinking
compositionally

 For myself, i was unhappy with the notion of name. The π-calculi and lambda
 calculi suffer a dependence on a notion of name. Both families of calculi
 require at least countably infinitely many names, and a notion of equality
 on names. If names have no internal structure then these theories *cannot
 be effective*.


Do we need to do some sort of course to understand this language?


 The reasons is that the notion of equality must then be realized as an
 infinitary table which cannot fit in any computer we have access to.
 Therefore, in effective theories, names must have internal structure. Since
 they have internal structure and are at least countably infinite, one is in
 danger of undermining the foundational character of these proposals for
 computing. Therefore, the only possible solution is that the notion of
 structured name must come from the notion of program proposed by the model.
 This argument is airtight. If you want a foundational model of computing
 with nominal structure, the nominal structure must derive from the notion of
 computation being put forward, i.e. it must *reflect* the notion of
 computation. This gives rise to all kinds of new an beautiful phenomena. One
 measure of your way into compositional thinking is whether this is
 happening. Is your approach to compositional thinking beginning to yield
 whole new aspects of computing, and new 'wholes' of computation, new forms
 of organization.

 Best wishes,

 --greg

 On Tue, Jun 16, 2009 at 7:31 PM, Jeremy Day jeremy@gmail.com wrote:

 Greg,

 On Tue, Jun 16, 2009 at 6:38 PM, Meredith Gregory 
 lgreg.mered...@gmail.com wrote:

 It takes some serious training to think compositionally.


 No doubt it is extremely tough to think compositionally, and it's all too
 easy to fall back on non-compositional ways of thinking.  In a similar vein
 it's all too easy to fall into procedural patterns when learning or working
 with functional programming in a multi-paradigm language.  But what are good
 ways for programmers to learn to think compositionally and, more
 importantly, practice?  Do you know of any books or online references that
 might help make the transition for anyone who is interested?

 Jeremy





 --
 L.G. Meredith
 Managing Partner
 Biosimilarity LLC
 1219 NW 83rd St
 Seattle, WA 98117

 +1 206.650.3740

 http://biosimilarity.blogspot.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 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---