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

2009-06-17 Thread Derek Chen-Becker
I agree that it's an issue. In my own defense, what I meant was not that I
didn't think people would use more than one DB. I actually have several apps
(not yet converted to Lift) that use 4 or more persistence units that
represent various legacy databases. Rather, I failed to realize the problem
that would arise from defining the EM factory as a singleton because when I
wrote that code I didn't fully understand how member objects on classes
worked. Other than that, I agree with your post :)
Derek

On Tue, Jun 16, 2009 at 5:38 PM, 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 

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

2009-06-17 Thread Jorge Ortiz
In Derek's defense, it's not how objects in classes work but how Lift
RequestVars work. Scala objects in classes aren't global singletons, just
per-class-instance singletons. But a Lift ReuqestVar object in a class is
pretty much a global singleton (unless you do some hacking like Derek did).

--j

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

 I agree that it's an issue. In my own defense, what I meant was not that I
 didn't think people would use more than one DB. I actually have several apps
 (not yet converted to Lift) that use 4 or more persistence units that
 represent various legacy databases. Rather, I failed to realize the problem
 that would arise from defining the EM factory as a singleton because when I
 wrote that code I didn't fully understand how member objects on classes
 worked. Other than that, I agree with your post :)
 Derek

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

 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 

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

2009-06-17 Thread Oliver Lambert
You made an assumption and programmed a solution based on the knowledge you
had at the time. Thats fine and there is nothing wrong with it - start with
the simplest solution that fits. If it need to be changed due to changing
requirements, thats fine too. There is a tradeoff in creating a overly
complex solution that fits problems that you think might exist in the future
and simplicity. Also, there is nothing that makes composition an idea that
is only understood and relevant to functional programming as almost seems to
be suggested here.

On Wed, Jun 17, 2009 at 4:14 PM, Derek Chen-Becker dchenbec...@gmail.comwrote:

 I agree that it's an issue. In my own defense, what I meant was not that I
 didn't think people would use more than one DB. I actually have several apps
 (not yet converted to Lift) that use 4 or more persistence units that
 represent various legacy databases. Rather, I failed to realize the problem
 that would arise from defining the EM factory as a singleton because when I
 wrote that code I didn't fully understand how member objects on classes
 worked. Other than that, I agree with your post :)
 Derek

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

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

[Lift] Scaladoc Generation

2009-06-17 Thread Makeable

This is probably more of a maven question, but I searched through the
maven docs and the closest I could find is the site plugin - although
this appears to generate a whole load of cruft, so I was wondering if
someone could shed some light.

I have managed to generate the API docs using mvn scala:doc, but the
documentation is split up among the different packages.

How would I generate the docs as shown at 
http://scala-tools.org/scaladocs/liftweb/1.0/
where it shows them all merged together?

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] Scala learning tool

2009-06-17 Thread g-man

All the Scala books and tutorials recommend using the Scala
interactive shell to set up scenarios and learn how Scala works.

I agree, but my problem was the (apparent) lack of something like
Python's dir(object) call, which gives you all the 'names'
available; Ruby and Erlang have similar commands, but not, as far as I
know, Scala.

I did find a little script that does just that at:

http://lousycoder.com/blog/index.php?/archives/91-Scala-Querying-an-objects-fields-and-methods-with-reflection.html

with the source at:

http://gist.github.com/87519

I compiled it, and when I import it, it works just dandy:

scala import ScalaReflection._
import ScalaReflection._

scala 3.methods__
hashCode
reverseBytes(int)
compareTo(Object)
compareTo(Integer)
equals(Object)
toString(int,int)
toString(int)
...

scala 3.fields__
MIN_VALUE
MAX_VALUE
TYPE
digits
DigitTens
DigitOnes
sizeTable
value
SIZE
serialVersionUID

Perhaps there is something like this already built-in to Scala, but I
can't find it... if not, it may be worthwhile adding.

Now, what I want to know is: is there a way to load an actual Lift
session into the interactive command interpreter, so I can create and
check out out functions, etc? I remember doing that with Ruby and
Rails back in the day.

--~--~-~--~~~---~--~~
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-17 Thread TSP

  In my own defense ...  failed to realize the problem that would arise from 
 defining the EM factory as a singleton

Are you being honest here Derek? Was not the real problem that you
failed to truly embrace the shape of the paradoxical combinator?


--~--~-~--~~~---~--~~
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-17 Thread Viktor Klang
Read this and join me in having your brains implode:

http://www.mail-archive.com/everything-l...@googlegroups.com/msg05959.html

On Wed, Jun 17, 2009 at 11:07 AM, TSP tim.pig...@optrak.co.uk wrote:


   In my own defense ...  failed to realize the problem that would arise
 from defining the EM factory as a singleton

 Are you being honest here Derek? Was not the real problem that you
 failed to truly embrace the shape of the paradoxical combinator?


 



-- 
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: scalajpa - while accessing two distincts databases, the second access is made with a connection to the first database

2009-06-17 Thread Jean-Luc
Hi Derek,

I had issues with the http proxy, so I checked building from source code
(scalajpa + lift-jpa) .
It's perfect, just what I need !

Thank you very much ;-)

Jean-Luc


2009/6/16 Derek Chen-Becker dchenbec...@gmail.com

 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





 



-- 
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: Hiring Lift Developers

2009-06-17 Thread Christian Helmbold

Hi Dived,

the just opened http://scala-forum.org has a sub forum for scala job
openings: http://scala-forum.org/list.php?6 Feel free to post your
vacancy there.

Regards,
Christian

On Jun 15, 7:32 pm, 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

--~--~-~--~~~---~--~~
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-17 Thread marius d.



On Jun 17, 12:53 am, Charles F. Munat c...@munat.com wrote:
 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?

Nope it doesn't insert it automatically ...


 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: David and Lift @ QCon

2009-06-17 Thread marius d.

Really enjoined ! ... Thank David and congrats !

Br's,
Marius

On Jun 17, 5:41 pm, Viktor Klang viktor.kl...@gmail.com wrote:
 For those of us who weren't 
 there:http://www.infoq.com/interviews/Lift-Scala-David-Pollack

 Awesome interview Dave!

 Cheers,
 --
 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: scalajpa - while accessing two distincts databases, the second access is made with a connection to the first database

2009-06-17 Thread Eric Bowman

Oliver Lambert wrote:
 Do we need to do some sort of course to understand this language?
This could help:
http://www.mitadmissions.org/topics/apply/the_freshman_application/index.shtml

:)

-- 
Eric Bowman
Boboco Ltd
ebow...@boboco.ie
http://www.boboco.ie/ebowman/pubkey.pgp
+35318394189/+353872801532


--~--~-~--~~~---~--~~
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-17 Thread Andrew Scherpbier

Isn't this just the result of JIT development?  Don't need something 
right now, don't implement it.  If you need it later, refactor.
I'm probably looking at this too much from a low level grunt developer.  
I understand that when developing a framework or anything with a public 
API these are important issues, but that's what bugtrackers are for!

I'm all for composability, but it shouldn't be a religion :-)   (-- 
please note the smiley!)

--Andrew

Derek Chen-Becker wrote:
 I agree that it's an issue. In my own defense, what I meant was not 
 that I didn't think people would use more than one DB. I actually have 
 several apps (not yet converted to Lift) that use 4 or more 
 persistence units that represent various legacy databases. Rather, I 
 failed to realize the problem that would arise from defining the EM 
 factory as a singleton because when I wrote that code I didn't fully 
 understand how member objects on classes worked. Other than that, I 
 agree with your post :)
 Derek

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

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

[Lift] simple syntax question

2009-06-17 Thread DavidV

I would like to include a variable value in an input tag in my .html
file.  I have defined a tag as follows:

  def upload(xhtml: Group): NodeSeq =
if (S.get_?) {
  bind(ul, chooseTemplate(choose, get, xhtml),
file_upload - fileUpload(ul = theUpload(Full
(ul))),
batch - currBatch
  )
}

thus,
choose:get
ul:batch/
/choose:get

returns the variable value that I need

How can I retrieve this variable for the value= attribute of my
input tag?  For instance, right now I am trying to do it like this:
input name=batch type=hidden value=ul:batch/ /

but that is not working.  It also doesn't work like this:
input name=batch type=hidden value=ul:batch/ /

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: David and Lift @ QCon

2009-06-17 Thread Kevin Wright
I do wish they'd make their videos downloadable...

On Wed, Jun 17, 2009 at 5:22 PM, marius d. marius.dan...@gmail.com wrote:


 Really enjoined ! ... Thank David and congrats !

 Br's,
 Marius

 On Jun 17, 5:41 pm, Viktor Klang viktor.kl...@gmail.com wrote:
  For those of us who weren't there:
 http://www.infoq.com/interviews/Lift-Scala-David-Pollack
 
  Awesome interview Dave!
 
  Cheers,
  --
  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: David and Lift @ QCon

2009-06-17 Thread David Pollak
On Wed, Jun 17, 2009 at 7:41 AM, Viktor Klang viktor.kl...@gmail.comwrote:

 For those of us who weren't there:
 http://www.infoq.com/interviews/Lift-Scala-David-Pollack

 Awesome interview Dave!


Thanks.




 Cheers,
 --
 Viktor Klang
 Scala Loudmouth

 



-- 
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: scalajpa - while accessing two distincts databases, the second access is made with a connection to the first database

2009-06-17 Thread Matt Williams

JIT development ;)

In all serious though, its better to have a minimal set of features that
work well and can be refactored effortlessly, than to define an entire
API and have everything need to change in an updated release.

And at the speed this particular fix went in, its hardly hindering
progress!

On Wed, 2009-06-17 at 08:45 -0700, Andrew Scherpbier wrote:
 Isn't this just the result of JIT development?  Don't need something 
 right now, don't implement it.  If you need it later, refactor.
 I'm probably looking at this too much from a low level grunt developer.  
 I understand that when developing a framework or anything with a public 
 API these are important issues, but that's what bugtrackers are for!
 
 I'm all for composability, but it shouldn't be a religion :-)   (-- 
 please note the smiley!)
 
 --Andrew



--~--~-~--~~~---~--~~
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] Trivially Set Mapper Scope

2009-06-17 Thread Matt Williams

Is there a simple way that I can set the record scope on a mapper.
For example, if I want to specify a WHERE clause for every query to the
database, how would I do this?

In my particular case, I want to set the scope based upon the hostname
used to service the request, but other usages may involve soft record
deletion, etc.

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: simple syntax question

2009-06-17 Thread DavidV

For now I have fixed the problem by calling a new method in my snippet
that accesses the variable with { } in the input tag.  I would be
interested to know if there is a way to do this with a bind tag
directly in the input tag in the .html file, because I feel like my
current solution is a bit of a kludge...
-David

On Jun 17, 12:00 pm, DavidV david.v.villa...@gmail.com wrote:
 I would like to include a variable value in an input tag in my .html
 file.  I have defined a tag as follows:

   def upload(xhtml: Group): NodeSeq =
     if (S.get_?) {
       bind(ul, chooseTemplate(choose, get, xhtml),
                     file_upload - fileUpload(ul = theUpload(Full
 (ul))),
                     batch - currBatch
       )
     }

 thus,
 choose:get
 ul:batch/
 /choose:get

 returns the variable value that I need

 How can I retrieve this variable for the value= attribute of my
 input tag?  For instance, right now I am trying to do it like this:
 input name=batch type=hidden value=ul:batch/ /

 but that is not working.  It also doesn't work like this:
 input name=batch type=hidden value=ul:batch/ /

 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] Thoughts on separation of display from logic

2009-06-17 Thread Matt Williams

I wholeheartedly agree with the philosophy of separating the display
from the program logic, and am currently getting to grips with the
generators, but am finding that now I end up with a degree of markup
within my code.

Can you think of any caveats to infering the node type passed, and
dynamically using the relevant generators to construct the returned
node.

I am thinking something along the lines of:

person:biography
textarea style=myStyle cols=20 rows=5
This is a sample of some biography text
/textarea
/person:biography

Where it would automatically infer that it is a textarea, pass through
the relevant attributes, and insert whatever function, values, etc I
have specified in my snippet. 

What are your thoughts on this?

Brgds,

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: Trivially Set Mapper Scope

2009-06-17 Thread David Pollak
Matt,
There's no way to do this right now.  I have an idea... lemme see if I can
knock something together for you.

Thanks,

David

On Wed, Jun 17, 2009 at 10:05 AM, Matt Williams m...@makeable.co.uk wrote:


 Is there a simple way that I can set the record scope on a mapper.
 For example, if I want to specify a WHERE clause for every query to the
 database, how would I do this?

 In my particular case, I want to set the scope based upon the hostname
 used to service the request, but other usages may involve soft record
 deletion, etc.

 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] Re: scalajpa - while accessing two distincts databases, the second access is made with a connection to the first database

2009-06-17 Thread Meredith Gregory
Oliver,

The short answer is no. The longer answer is

   - i worked this all out on my own; so, you guys -- who can program lift
   on top of scala on top of JVM and are therefore about 20X smarter than i am
   -- can too.
   - And also, help is always available, if there is something specific you
   don't understand, let me know and i will do my best to convey it to you.

Best wishes,

--greg

P.S. Here is a version of the paragraph with links to useful bits of lore
from the literature.

For myself, i was unhappy with the notion of name. The
π-calculihttp://en.wikipedia.org/wiki/Pi-calculusand lambda
calculi http://en.wikipedia.org/wiki/Lambda_calculus suffer a dependence
on a notion of name. Both families of calculi require at least countably
infinitely http://en.wikipedia.org/wiki/Countable many
nameshttp://www.cs.nps.navy.mil/research/languages/statements/gordon.html,
and a notion of equality on names. If names have no internal structure then
these theories *cannot be
effectivehttp://en.wikipedia.org/wiki/Computable_function
*. 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
computationhttp://svn.biosimilarity.com/src/open/papers/trunk/concurrency/rho/ex_nihilo_entcs/ex_nihilo_finco.pdf.
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.


2009/6/16 Oliver Lambert olambo...@gmail.com



 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 

[Lift] Re: directory structure

2009-06-17 Thread Derek Chen-Becker
The default behavior is to look at for a snippets sub-package to any
packages you've configured for snippets, so yes, that's required if you're
using snippets. If you're not using a particular feature (i.e. snippets,
views, or comet) then the directory can be missing, I think. I can't
remember if there's anything special about the model subdirectory or if
that's just convention.

Derek

On Tue, Jun 16, 2009 at 7:35 PM, Oliver Lambert olambo...@gmail.com wrote:

 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-17 Thread David Pollak
On Wed, Jun 17, 2009 at 12:04 PM, Derek Chen-Becker
dchenbec...@gmail.comwrote:

 Argh, that's what I was trying to say. No more posting after Midnight for
 me :(


Folks,

We are all on the path to doing better development... but it's a journey,
not a destination.  I like Greg's suggestion of thinking compositionally and
have myself been struggling to improve my compositional thinking.  I like
Derek's responsiveness to the user community and improvements to his ways of
thinking.  We are all being agile (in the best sense of the word.)  We are
all being JIT.  Let's continue to improve as coders and improve the Lift
code base and community.

Thanks,

David




 On Wed, Jun 17, 2009 at 12:29 AM, Jorge Ortiz jorge.or...@gmail.comwrote:

 In Derek's defense, it's not how objects in classes work but how Lift
 RequestVars work. Scala objects in classes aren't global singletons, just
 per-class-instance singletons. But a Lift ReuqestVar object in a class is
 pretty much a global singleton (unless you do some hacking like Derek did).

 --j


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

 I agree that it's an issue. In my own defense, what I meant was not that
 I didn't think people would use more than one DB. I actually have several
 apps (not yet converted to Lift) that use 4 or more persistence units that
 represent various legacy databases. Rather, I failed to realize the problem
 that would arise from defining the EM factory as a singleton because when I
 wrote that code I didn't fully understand how member objects on classes
 worked. Other than that, I agree with your post :)
  Derek

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

 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 

[Lift] Re: Scala learning tool

2009-06-17 Thread Derek Chen-Becker
I think that there's talk in 2.8 of having tab completion or something
similar in the REPL.

Derek

On Tue, Jun 16, 2009 at 9:23 PM, g-man gregor...@gmail.com wrote:


 All the Scala books and tutorials recommend using the Scala
 interactive shell to set up scenarios and learn how Scala works.

 I agree, but my problem was the (apparent) lack of something like
 Python's dir(object) call, which gives you all the 'names'
 available; Ruby and Erlang have similar commands, but not, as far as I
 know, Scala.

 I did find a little script that does just that at:


 http://lousycoder.com/blog/index.php?/archives/91-Scala-Querying-an-objects-fields-and-methods-with-reflection.html

 with the source at:

 http://gist.github.com/87519

 I compiled it, and when I import it, it works just dandy:

 scala import ScalaReflection._
 import ScalaReflection._

 scala 3.methods__
 hashCode
 reverseBytes(int)
 compareTo(Object)
 compareTo(Integer)
 equals(Object)
 toString(int,int)
 toString(int)
 ...

 scala 3.fields__
 MIN_VALUE
 MAX_VALUE
 TYPE
 digits
 DigitTens
 DigitOnes
 sizeTable
 value
 SIZE
 serialVersionUID

 Perhaps there is something like this already built-in to Scala, but I
 can't find it... if not, it may be worthwhile adding.

 Now, what I want to know is: is there a way to load an actual Lift
 session into the interactive command interpreter, so I can create and
 check out out functions, etc? I remember doing that with Ruby and
 Rails back in the day.

 


--~--~-~--~~~---~--~~
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: Thoughts on separation of display from logic

2009-06-17 Thread Kris Nuttycombe

This reminds me somewhat of the Wicket approach, which would use a
namespaced attribute of the textarea tag to inform the binding
logic. I've been wanting to keep the styling of my lift-generated tags
in the markup as well, so maybe I'll toy a bit with creating a version
of bind() and the form generator functions that would allow this.

Kris

On Wed, Jun 17, 2009 at 11:22 AM, Matt Williamsm...@makeable.co.uk wrote:

 I wholeheartedly agree with the philosophy of separating the display
 from the program logic, and am currently getting to grips with the
 generators, but am finding that now I end up with a degree of markup
 within my code.

 Can you think of any caveats to infering the node type passed, and
 dynamically using the relevant generators to construct the returned
 node.

 I am thinking something along the lines of:

 person:biography
 textarea style=myStyle cols=20 rows=5
 This is a sample of some biography text
 /textarea
 /person:biography

 Where it would automatically infer that it is a textarea, pass through
 the relevant attributes, and insert whatever function, values, etc I
 have specified in my snippet.

 What are your thoughts on this?

 Brgds,

 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: Scala learning tool

2009-06-17 Thread David Pollak
On Wed, Jun 17, 2009 at 1:41 PM, Derek Chen-Becker dchenbec...@gmail.comwrote:

 I think that there's talk in 2.8 of having tab completion or something
 similar in the REPL.


It's far more than talk.  Paul has it nailed.  2.8 will offer a much better
REPL experience.




 Derek


 On Tue, Jun 16, 2009 at 9:23 PM, g-man gregor...@gmail.com wrote:


 All the Scala books and tutorials recommend using the Scala
 interactive shell to set up scenarios and learn how Scala works.

 I agree, but my problem was the (apparent) lack of something like
 Python's dir(object) call, which gives you all the 'names'
 available; Ruby and Erlang have similar commands, but not, as far as I
 know, Scala.

 I did find a little script that does just that at:


 http://lousycoder.com/blog/index.php?/archives/91-Scala-Querying-an-objects-fields-and-methods-with-reflection.html

 with the source at:

 http://gist.github.com/87519

 I compiled it, and when I import it, it works just dandy:

 scala import ScalaReflection._
 import ScalaReflection._

 scala 3.methods__
 hashCode
 reverseBytes(int)
 compareTo(Object)
 compareTo(Integer)
 equals(Object)
 toString(int,int)
 toString(int)
 ...

 scala 3.fields__
 MIN_VALUE
 MAX_VALUE
 TYPE
 digits
 DigitTens
 DigitOnes
 sizeTable
 value
 SIZE
 serialVersionUID

 Perhaps there is something like this already built-in to Scala, but I
 can't find it... if not, it may be worthwhile adding.

 Now, what I want to know is: is there a way to load an actual Lift
 session into the interactive command interpreter, so I can create and
 check out out functions, etc? I remember doing that with Ruby and
 Rails back in the day.




 



-- 
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: Thoughts on separation of display from logic

2009-06-17 Thread David Pollak
I can see a set of methods that look like:
textarea(f: String = Unit)(n: NodeSeq) that will slurp the values and
attributes out of the NodeSeq... so you'd bind like:

biography - textarea(s = setBio(s)) _

On Wed, Jun 17, 2009 at 10:22 AM, Matt Williams m...@makeable.co.uk wrote:


 I wholeheartedly agree with the philosophy of separating the display
 from the program logic, and am currently getting to grips with the
 generators, but am finding that now I end up with a degree of markup
 within my code.

 Can you think of any caveats to infering the node type passed, and
 dynamically using the relevant generators to construct the returned
 node.

 I am thinking something along the lines of:

 person:biography
 textarea style=myStyle cols=20 rows=5
 This is a sample of some biography text
 /textarea
 /person:biography

 Where it would automatically infer that it is a textarea, pass through
 the relevant attributes, and insert whatever function, values, etc I
 have specified in my snippet.

 What are your thoughts on this?

 Brgds,

 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] Re: Lift + Javeline

2009-06-17 Thread marius d.

Just 2.1 version ... we'll try that out. It's still a mystery because
offline example works but wen putting it in lift fails only on FF. So
far there is no indication that Lift is doing anything wrong.


Br's,
Marius

On Jun 17, 4:14 pm, Matt Williams m...@makeable.co.uk wrote:
 Are you using the latest version from the repository?
 There were a few firefox fixes put in place a week or so ago.

 On Jun 17, 1:18 pm, Marius marius.dan...@gmail.com wrote:

  Hi all,

  We've been trying javeline (http://ajax.org/) with Lift and it's
  pretty needless to say how cool it is. It seems to work fine in
  Chrome, IE6/7, Safari but we're getting a strange JS error on FF3
  only.

  Seehttp://scalaliftapp.appspot.com/example2... or FF3 we're getting
  this.oDrag is null JS error. Did anyone experience this before?

  Br's,
  Marius
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to 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: Thoughts on separation of display from logic

2009-06-17 Thread Kris Nuttycombe

We'd still need some attribute to disambiguate in the case of multiple
textarea tags, wouldn't we?

Kris

On Wed, Jun 17, 2009 at 2:51 PM, David
Pollakfeeder.of.the.be...@gmail.com wrote:
 I can see a set of methods that look like:
 textarea(f: String = Unit)(n: NodeSeq) that will slurp the values and
 attributes out of the NodeSeq... so you'd bind like:
 biography - textarea(s = setBio(s)) _

 On Wed, Jun 17, 2009 at 10:22 AM, Matt Williams m...@makeable.co.uk wrote:

 I wholeheartedly agree with the philosophy of separating the display
 from the program logic, and am currently getting to grips with the
 generators, but am finding that now I end up with a degree of markup
 within my code.

 Can you think of any caveats to infering the node type passed, and
 dynamically using the relevant generators to construct the returned
 node.

 I am thinking something along the lines of:

 person:biography
 textarea style=myStyle cols=20 rows=5
 This is a sample of some biography text
 /textarea
 /person:biography

 Where it would automatically infer that it is a textarea, pass through
 the relevant attributes, and insert whatever function, values, etc I
 have specified in my snippet.

 What are your thoughts on this?

 Brgds,

 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] Re: Lift + Javeline

2009-06-17 Thread Matt Williams

Maybe an issue with the compressor?

(although i dont see why that would just affect firefox)

On Wed, 2009-06-17 at 14:00 -0700, marius d. wrote:
 Just 2.1 version ... we'll try that out. It's still a mystery because
 offline example works but wen putting it in lift fails only on FF. So
 far there is no indication that Lift is doing anything wrong.
 
 
 Br's,
 Marius
 
 On Jun 17, 4:14 pm, Matt Williams m...@makeable.co.uk wrote:
  Are you using the latest version from the repository?
  There were a few firefox fixes put in place a week or so ago.
 
  On Jun 17, 1:18 pm, Marius marius.dan...@gmail.com wrote:
 
   Hi all,
 
   We've been trying javeline (http://ajax.org/) with Lift and it's
   pretty needless to say how cool it is. It seems to work fine in
   Chrome, IE6/7, Safari but we're getting a strange JS error on FF3
   only.
 
   Seehttp://scalaliftapp.appspot.com/example2... or FF3 we're getting
   this.oDrag is null JS error. Did anyone experience this before?
 
   Br's,
   Marius
  


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to 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: Thoughts on separation of display from logic

2009-06-17 Thread David Pollak
On Wed, Jun 17, 2009 at 2:07 PM, Kris Nuttycombe
kris.nuttyco...@gmail.comwrote:


 We'd still need some attribute to disambiguate in the case of multiple
 textarea tags, wouldn't we?


I don't think so. The only NodeSeq being passed to the function is the
NodeSeq inside the tag that's getting bound to.



 Kris

 On Wed, Jun 17, 2009 at 2:51 PM, David
 Pollakfeeder.of.the.be...@gmail.com wrote:
  I can see a set of methods that look like:
  textarea(f: String = Unit)(n: NodeSeq) that will slurp the values and
  attributes out of the NodeSeq... so you'd bind like:
  biography - textarea(s = setBio(s)) _
 
  On Wed, Jun 17, 2009 at 10:22 AM, Matt Williams m...@makeable.co.uk
 wrote:
 
  I wholeheartedly agree with the philosophy of separating the display
  from the program logic, and am currently getting to grips with the
  generators, but am finding that now I end up with a degree of markup
  within my code.
 
  Can you think of any caveats to infering the node type passed, and
  dynamically using the relevant generators to construct the returned
  node.
 
  I am thinking something along the lines of:
 
  person:biography
  textarea style=myStyle cols=20 rows=5
  This is a sample of some biography text
  /textarea
  /person:biography
 
  Where it would automatically infer that it is a textarea, pass through
  the relevant attributes, and insert whatever function, values, etc I
  have specified in my snippet.
 
  What are your thoughts on this?
 
  Brgds,
 
  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
 
  
 

 



-- 
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] Sitemap Base URL

2009-06-17 Thread Matt Williams

Im currently working on porting a CMS built in rails over to lift.

Im finding the sitemap very handy for use in the administration area,
which will be located at /admin/, but for the rest of the site, we will
be using a dynamic navigation constructed from the database on a
requested hostname basis.

By using a sitemap, am I preventing the access to urls not defined
within the sitemap? If so, how do I overcome this behaviour, or can I
set the sitemap to only have scope to a baseuri of /admin/

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: Sitemap Base URL

2009-06-17 Thread David Pollak
Matt,
I posted some code a week or so ago in response to Glenn's request to have
menu items dynamically built from RDBMS queries.  Please take a look at
http://groups.google.com/group/liftweb/browse_thread/thread/3b0e3611bc316f71#

Thanks,

David

PS -- This should not be construed as an
RTFM post... I just want to unify the threads so we can share common
knowledge and maybe you and Glenn and other can collaborate.

On Wed, Jun 17, 2009 at 2:17 PM, Matt Williams m...@makeable.co.uk wrote:


 Im currently working on porting a CMS built in rails over to lift.

 Im finding the sitemap very handy for use in the administration area,
 which will be located at /admin/, but for the rest of the site, we will
 be using a dynamic navigation constructed from the database on a
 requested hostname basis.

 By using a sitemap, am I preventing the access to urls not defined
 within the sitemap? If so, how do I overcome this behaviour, or can I
 set the sitemap to only have scope to a baseuri of /admin/

 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] Re: Trivially Set Mapper Scope

2009-06-17 Thread David Pollak
User.addlQueryParams.set(By(User.firstname, david) ::
User.addlQueryParams.is)
It's a request var so it's set on a request by request basis.

On Wed, Jun 17, 2009 at 10:05 AM, Matt Williams m...@makeable.co.uk wrote:


 Is there a simple way that I can set the record scope on a mapper.
 For example, if I want to specify a WHERE clause for every query to the
 database, how would I do this?

 In my particular case, I want to set the scope based upon the hostname
 used to service the request, but other usages may involve soft record
 deletion, etc.

 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] Re: Trivially Set Mapper Scope

2009-06-17 Thread Matt Williams

Thank you VERY much!

Kind Regards,

Matt

On Wed, 2009-06-17 at 14:42 -0700, David Pollak wrote:
 User.addlQueryParams.set(By(User.firstname, david) ::
 User.addlQueryParams.is)
 
 
 It's a request var so it's set on a request by request basis.





--~--~-~--~~~---~--~~
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-17 Thread Meredith Gregory
Tim,

LOL!

Derek,

i'm amazed at all the good work you've done on lift. You're unstoppable!

i trust that all understood i was having good fun.

Best wishes,

--greg

On Wed, Jun 17, 2009 at 2:07 AM, TSP tim.pig...@optrak.co.uk wrote:


   In my own defense ...  failed to realize the problem that would arise
 from defining the EM factory as a singleton

 Are you being honest here Derek? Was not the real problem that you
 failed to truly embrace the shape of the paradoxical combinator?


 



-- 
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] what does 'S' stand for?

2009-06-17 Thread Eric Bowman

In the files S.scala and SHtml.scala, it's kind of hard to figure out
what S means.

Session?  Simple?  Structured?  Scala?  SomethingElse?

Thanks,
Eric

-- 
Eric Bowman
Boboco Ltd
ebow...@boboco.ie
http://www.boboco.ie/ebowman/pubkey.pgp
+35318394189/+353872801532


--~--~-~--~~~---~--~~
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: Thoughts on separation of display from logic

2009-06-17 Thread Kevin Wright
One possibility I already considered is something like:
bind(nodeseq, prefix,
suffix - Text(matched an element),
@suffix - Text(matched an attribute),
@suffix=value - Text(matched an attribute with specified value));

the bindings here would respectively match the elements:

prefix:suffixcontent/prefix:suffix
span prefix:suffix=placeholdercontent/span
span prefix:suffix=valuecontent/span

Use of the span elements above was an arbitrary choice

What's missing is an intuitive way to access the node that has been bound,
especially if you only want to change the contents


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



 On Wed, Jun 17, 2009 at 2:07 PM, Kris Nuttycombe 
 kris.nuttyco...@gmail.com wrote:


 We'd still need some attribute to disambiguate in the case of multiple
 textarea tags, wouldn't we?


 I don't think so. The only NodeSeq being passed to the function is the
 NodeSeq inside the tag that's getting bound to.



 Kris

 On Wed, Jun 17, 2009 at 2:51 PM, David
 Pollakfeeder.of.the.be...@gmail.com wrote:
  I can see a set of methods that look like:
  textarea(f: String = Unit)(n: NodeSeq) that will slurp the values and
  attributes out of the NodeSeq... so you'd bind like:
  biography - textarea(s = setBio(s)) _
 
  On Wed, Jun 17, 2009 at 10:22 AM, Matt Williams m...@makeable.co.uk
 wrote:
 
  I wholeheartedly agree with the philosophy of separating the display
  from the program logic, and am currently getting to grips with the
  generators, but am finding that now I end up with a degree of markup
  within my code.
 
  Can you think of any caveats to infering the node type passed, and
  dynamically using the relevant generators to construct the returned
  node.
 
  I am thinking something along the lines of:
 
  person:biography
  textarea style=myStyle cols=20 rows=5
  This is a sample of some biography text
  /textarea
  /person:biography
 
  Where it would automatically infer that it is a textarea, pass through
  the relevant attributes, and insert whatever function, values, etc I
  have specified in my snippet.
 
  What are your thoughts on this?
 
  Brgds,
 
  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
 
  
 





 --
 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: what does 'S' stand for?

2009-06-17 Thread David Pollak
It stands for State.
When I first started coding Lift, I was using emacs and wanted to have short
names for everything... especially the commonly used stuff.

I wanted to isolate state into a single place so every time you dealt with
S, you know you were doing something stateful (rather than purely functional
with no side effects... with the exception of RDBMS related stuff which is
stateful on its face.)

S has morphed into S, SHtml, RequestVars and SessionVars... but all the
explicit state is still kept in S.

Does that help?

Thanks,

David

On Wed, Jun 17, 2009 at 3:35 PM, Eric Bowman ebow...@boboco.ie wrote:


 In the files S.scala and SHtml.scala, it's kind of hard to figure out
 what S means.

 Session?  Simple?  Structured?  Scala?  SomethingElse?

 Thanks,
 Eric

 --
 Eric Bowman
 Boboco Ltd
 ebow...@boboco.ie
 http://www.boboco.ie/ebowman/pubkey.pgp
 +35318394189/+353872801532


 



-- 
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: scalajpa - while accessing two distincts databases, the second access is made with a connection to the first database

2009-06-17 Thread Matt Williams


 
 i trust that all understood i was having good fun. 
 

The only thing I understood is that there are some people out there
vastly more knowledgeable than myself! :D

Brgds,

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: Thoughts on separation of display from logic

2009-06-17 Thread David Pollak
Crud... adding xpathisms to bind... where will it end? :-)



On Wed, Jun 17, 2009 at 3:41 PM, Kevin Wright kev.lee.wri...@googlemail.com
 wrote:

 One possibility I already considered is something like:
 bind(nodeseq, prefix,
 suffix - Text(matched an element),
 @suffix - Text(matched an attribute),
 @suffix=value - Text(matched an attribute with specified value));

 the bindings here would respectively match the elements:

 prefix:suffixcontent/prefix:suffix
 span prefix:suffix=placeholdercontent/span
 span prefix:suffix=valuecontent/span

 Use of the span elements above was an arbitrary choice

 What's missing is an intuitive way to access the node that has been bound,
 especially if you only want to change the contents


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



 On Wed, Jun 17, 2009 at 2:07 PM, Kris Nuttycombe 
 kris.nuttyco...@gmail.com wrote:


 We'd still need some attribute to disambiguate in the case of multiple
 textarea tags, wouldn't we?


 I don't think so. The only NodeSeq being passed to the function is the
 NodeSeq inside the tag that's getting bound to.



 Kris

 On Wed, Jun 17, 2009 at 2:51 PM, David
 Pollakfeeder.of.the.be...@gmail.com wrote:
  I can see a set of methods that look like:
  textarea(f: String = Unit)(n: NodeSeq) that will slurp the values and
  attributes out of the NodeSeq... so you'd bind like:
  biography - textarea(s = setBio(s)) _
 
  On Wed, Jun 17, 2009 at 10:22 AM, Matt Williams m...@makeable.co.uk
 wrote:
 
  I wholeheartedly agree with the philosophy of separating the display
  from the program logic, and am currently getting to grips with the
  generators, but am finding that now I end up with a degree of markup
  within my code.
 
  Can you think of any caveats to infering the node type passed, and
  dynamically using the relevant generators to construct the returned
  node.
 
  I am thinking something along the lines of:
 
  person:biography
  textarea style=myStyle cols=20 rows=5
  This is a sample of some biography text
  /textarea
  /person:biography
 
  Where it would automatically infer that it is a textarea, pass through
  the relevant attributes, and insert whatever function, values, etc I
  have specified in my snippet.
 
  What are your thoughts on this?
 
  Brgds,
 
  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
 
  
 





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




 



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

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



[Lift] Re: what does 'S' stand for?

2009-06-17 Thread Eric Bowman

David Pollak wrote:
 It stands for State.

 When I first started coding Lift, I was using emacs and wanted to have
 short names for everything... especially the commonly used stuff.

 I wanted to isolate state into a single place so every time you dealt
 with S, you know you were doing something stateful (rather than purely
 functional with no side effects... with the exception of RDBMS related
 stuff which is stateful on its face.)

 S has morphed into S, SHtml, RequestVars and SessionVars... but all
 the explicit state is still kept in S.

 Does that help?


Yeah, muchly, thanks.  That might be a nice thing to put in a comment in
S.scala...

-- 
Eric Bowman
Boboco Ltd
ebow...@boboco.ie
http://www.boboco.ie/ebowman/pubkey.pgp
+35318394189/+353872801532


--~--~-~--~~~---~--~~
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] Combined Lift/Servlet and initialization

2009-06-17 Thread Andreas B

Given the combination of a lift powered webapp and an existing servlet
I like to use lift's marvellous mapper in the latter.
Do I need to ensure that lift (i.e. db and Schemifier) is initialized
before the servlet starts serving requests,
or is this implied by some servlet specification?
If it needs to be done manually, what would be the right procedure?
There is LiftRules.doneBoot being set after initialization, but it is
private.

Thanks in advance

Andreas

--~--~-~--~~~---~--~~
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] QA, before merging code

2009-06-17 Thread Oliver Lambert
Hi,

Seems theres been a little bit of discussion about methodologies of coding
and development processes in the latest threads which is cool
and makes me think about my current coding efforts.

I created a branch a while ago where I put in my take on a slightly
alternative (or complementary?) binding process (the particular code
adds a bind by name to BindHelpers). I was hoping for some feedback from a
few of you (David, Marius, and anyone else) before
merging it back with the main site, as I feel what I have done might be
contentious and I don't want to cause any problems.

Whats the normal process of committing changes. Is the code QA'ed in some
way or do I just do it,and wait for people to say #!.

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-17 Thread Oliver Lambert
2009/6/18 Meredith Gregory lgreg.mered...@gmail.com

 Oliver,

 The short answer is no. The longer answer is

- i worked this all out on my own; so, you guys -- who can program lift
on top of scala on top of JVM and are therefore about 20X smarter than i am
-- can too.

 I think if we were all 20X (or 2X) smarter than you, we would have taken
over Google by now.


-
- And also, help is always available, if there is something specific
you don't understand, let me know and i will do my best to convey it to 
 you.

 As suggested by another kind person, I may have to start by going back to
(an American?) school.

Heres a question, why should I care about Monad's when they are already in
OO, just not called Monads?



-

 Best wishes,

 --greg

 P.S. Here is a version of the paragraph with links to useful bits of lore
 from the literature.

 For myself, i was unhappy with the notion of name. The 
 π-calculihttp://en.wikipedia.org/wiki/Pi-calculusand lambda
 calculi http://en.wikipedia.org/wiki/Lambda_calculus suffer a dependence
 on a notion of name. Both families of calculi require at least countably
 infinitely http://en.wikipedia.org/wiki/Countable many 
 nameshttp://www.cs.nps.navy.mil/research/languages/statements/gordon.html,
 and a notion of equality on names. If names have no internal structure then
 these theories *cannot be 
 effectivehttp://en.wikipedia.org/wiki/Computable_function
 *. 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
 computationhttp://svn.biosimilarity.com/src/open/papers/trunk/concurrency/rho/ex_nihilo_entcs/ex_nihilo_finco.pdf.
 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.


 2009/6/16 Oliver Lambert olambo...@gmail.com



 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 

[Lift] MEMDEBUG failure

2009-06-17 Thread glenn

I don't know whether this is a Scala problem or a Llift one, so I'll
post this problem here with apologies if it's a Scala issue.

I keep getting the following error message since I upgraded to Scala
1.7.5.  This pops up in my console every 5 seconds, the default jetty
scan interval in the pom. I'm using a MySQL database instead of
embedded derby, if that makes a difference?

ERROR - [MEMDEBUG] failure
java.lang.NoSuchFieldException: refSet
at java.lang.Class.getDeclaredField(Class.java:1882)
at net.liftweb.http.PointlessActorToWorkAroundBug$$anonfun$act$1$
$anonfun$apply$1.apply(LiftServlet.scala:715)
at net.liftweb.http.PointlessActorToWorkAroundBug$$anonfun$act$1$
$anonfun$apply$1.apply(LiftServlet.scala:707)
at scala.actors.Reaction.run(Reaction.scala:78)
at net.liftweb.http.ActorSchedulerFixer$$anon$1$$anonfun$execute
$1.apply(LiftServlet.scala:668)
at net.liftweb.http.ActorSchedulerFixer$$anon$1$$anonfun$execute
$1.apply(LiftServlet.scala:668)
at net.liftweb.http.ActorSchedulerFixer$$anonfun$20$$anon$2.run
(LiftServlet.scala:626)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask
(ThreadPoolExecutor.java:885)
at java.util.concurrent.ThreadPoolExecutor$Worker.run
(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)

--~--~-~--~~~---~--~~
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: MEMDEBUG failure

2009-06-17 Thread David Pollak
Glenn,

We have not moved Lift to Scala 2.7.5.  It's about a day's worth of work for
me to verify that the Actor fixes actually fix things.  Please stick with
Scala 2.7.4.

Thanks,

David

On Wed, Jun 17, 2009 at 5:13 PM, glenn gl...@exmbly.com wrote:


 I don't know whether this is a Scala problem or a Llift one, so I'll
 post this problem here with apologies if it's a Scala issue.

 I keep getting the following error message since I upgraded to Scala
 1.7.5.  This pops up in my console every 5 seconds, the default jetty
 scan interval in the pom. I'm using a MySQL database instead of
 embedded derby, if that makes a difference?

 ERROR - [MEMDEBUG] failure
 java.lang.NoSuchFieldException: refSet
at java.lang.Class.getDeclaredField(Class.java:1882)
at net.liftweb.http.PointlessActorToWorkAroundBug$$anonfun$act$1$
 $anonfun$apply$1.apply(LiftServlet.scala:715)
at net.liftweb.http.PointlessActorToWorkAroundBug$$anonfun$act$1$
 $anonfun$apply$1.apply(LiftServlet.scala:707)
at scala.actors.Reaction.run(Reaction.scala:78)
at net.liftweb.http.ActorSchedulerFixer$$anon$1$$anonfun$execute
 $1.apply(LiftServlet.scala:668)
at net.liftweb.http.ActorSchedulerFixer$$anon$1$$anonfun$execute
 $1.apply(LiftServlet.scala:668)
at net.liftweb.http.ActorSchedulerFixer$$anonfun$20$$anon$2.run
 (LiftServlet.scala:626)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask
 (ThreadPoolExecutor.java:885)
at java.util.concurrent.ThreadPoolExecutor$Worker.run
 (ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)

 



-- 
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] SOME FAMOUS COLLECTIONS

2009-06-17 Thread cubramanian mugsan

SOME FAMOUS COLLECTIONS

http://nicesubramani.blogspot.com


http://nicesubramani.blogspot.com


http://nicesubramani.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-17 Thread Meredith Gregory
Oliver,

Objects and monads are really not the same. At it's heart the concept of
monad is an appropriately parametric notion of composition. If you have any
experience with abstract algebra, you might recognize that the notion of a
group http://en.wikipedia.org/wiki/Symmetry_group is an appropriately
parametric notion of symmetry. Groups give an exceptionally well abstracted
account of symmetry. Monads give an exceptionally well abstracted notion of
composition. This is a lot easier to see in the Category Theoretic
presentation.

A monad http://en.wikipedia.org/wiki/Monad_%28category_theory%29 is
presented by three pieces of data:

   - An endofunctor http://en.wikipedia.org/wiki/Functor M : C - C
   (intuitively, think of M as a parametric type constructor and C as the
   universe of types and maps)
   - A natural 
transformationhttp://en.wikipedia.org/wiki/Natural_transformationunit:
Id - M -- this is a higher-order critter: it takes maps to maps; but
   i'll give you a metaphor in just a moment.
   - A natural transformation mult: M^2 - M

One picture you can have in your mind is M is a kind of box factory. Then
unit says how you can put things into a box, and mult says how you can
flatten nested boxes into an ordinary box (this is the origins of flatMap in
Scala's presentation). Another way of understanding this is that M is a kind
of higher-order compositor, i.e. a way of combining things just like
multiplication, as in a*b, is a way of combining things. Then the unit is
the analog of having a unit for your multiplication and mult is the analog
of an associativity law ( a*(b*c) = (a*b)*c ). These line up with the box
analogy more easily if you write things with prefix notation instead of
infix notation.

   - Let's write {*| a, b |*} instead of a*b. The reason we adopt this more
   verbose notation is that we can note the different kind of boxes with the
   'color' of the braces. M-colored braces, {M| a, b |M}, are associated with
   an M-box.
   - Then unit( a ) = {M| a |M}, it puts a in an M-box. This has an
   alternate presentation of the form {M| |M}.{M| a |M} = {M| a |M}. i mention
   it to point out the analogy with the binary operation _*_, but it muddies
   the water a little with begging the question about the _._. So, i will just
   leave it -- without explanation -- for you to explore.
   - And mult( {M| {M| a11, ..., a1J |M} ... {M| aI1, ... aIJ' |M} |M} ) =
   {M| a11, ..., aIJ' |M}. It tells you how to canonically flatten M-boxes.
   This functions as an association because if boxes canonically flatten, then
   {M| a, {M| b, c |M} |M} = {M| a, b, c |M} = {M| {M| a, b |M}, c |M}.


The apparent lexical connection between this way of thinking about things
and XML *is not accidental*. Monads can be viewed as colored braces, aka
matched tags. Monads are a semantical creature that presents syntactically
like XML.

This way of thinking about things is really different from objects. To be
sure, there are notions of objects that are universal and so can be made to
fit or encode just about anything; but, that doesn't mean the encodings are
nice, or scalable or maintainable. You have only to to look at something
like LINQ -- which is really just a presentation of monads -- to see just
how flexible and yet compact the monadic way of structuring composition is.
Specifically, both set-comprehension notation and SELECT-FROM-WHERE, when
interpreted polymorphically, provide a natural representation of the monad.

   - { pattern | t1 - generator1, ..., tn - generatorN, constraint1, ...,
   constraintK }
   - SELECT pattern FROM generator WHERE constraint

Those to pieces of computational machinery have very simple, and natural
mappings to the monad operations. You will win if you work these out for
yourself. Phil Wadler has excellent papers to provide cheat sheets. The
Scala for-comprehension and the corresponding operations of map, flatMap and
filter are also excellent cheat sheets. But, you get the joy if you work
this out for yourself.

Best wishes,

--greg

2009/6/17 Oliver Lambert olambo...@gmail.com



 2009/6/18 Meredith Gregory lgreg.mered...@gmail.com

 Oliver,

 The short answer is no. The longer answer is

- i worked this all out on my own; so, you guys -- who can program
lift on top of scala on top of JVM and are therefore about 20X smarter 
 than
i am -- can too.

 I think if we were all 20X (or 2X) smarter than you, we would have taken
 over Google by now.


- And also, help is always available, if there is something specific
you don't understand, let me know and i will do my best to convey it to 
 you.

 As suggested by another kind person, I may have to start by going back to
 (an American?) school.

 Heres a question, why should I care about Monad's when they are already in
 OO, just not called Monads?



-

 Best wishes,

 --greg

 P.S. Here is a version of the paragraph with links to useful bits of lore
 from the literature.

 For myself, i was unhappy with 

[Lift] Re: Mapper record deletion

2009-06-17 Thread g-man

Thanks, I'm working on it.

It seems, after reading the Lift book, since we have 'Alert' in the
list of basic JsCmds in Table 8.2, a companion 'Confirm' (and perhaps
even 'Prompt') command would be logical to have, since these are basic
and popular user interface elements.


On Jun 16, 6:46 am, Magnus Alvestad magnus.alves...@gmail.com wrote:
  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: Combined Lift/Servlet and initialization

2009-06-17 Thread David Pollak
Andreas,
As long as the LiftServlet is in your web.xml file, all should work
correctly.

Thanks,

David

On Wed, Jun 17, 2009 at 4:53 PM, Andreas B and...@gmx.net wrote:


 Given the combination of a lift powered webapp and an existing servlet
 I like to use lift's marvellous mapper in the latter.
 Do I need to ensure that lift (i.e. db and Schemifier) is initialized
 before the servlet starts serving requests,
 or is this implied by some servlet specification?
 If it needs to be done manually, what would be the right procedure?
 There is LiftRules.doneBoot being set after initialization, but it is
 private.

 Thanks in advance

 Andreas

 



-- 
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: QA, before merging code

2009-06-17 Thread David Pollak
On Wed, Jun 17, 2009 at 5:00 PM, Oliver Lambert olambo...@gmail.com wrote:

 Hi,

 Seems theres been a little bit of discussion about methodologies of coding
 and development processes in the latest threads which is cool
 and makes me think about my current coding efforts.

 I created a branch a while ago where I put in my take on a slightly
 alternative (or complementary?) binding process (the particular code
 adds a bind by name to BindHelpers). I was hoping for some feedback from a
 few of you (David, Marius, and anyone else) before
 merging it back with the main site, as I feel what I have done might be
 contentious and I don't want to cause any problems.


Generally, let me or Marius or Derek or one of the other been around Lift
for a while guys take a look at the code.  Then check it into the main
branch and let people give you feedback.

Please make sure to do a mvn clean install before pushing code to make sure
all compiles and passes tests.




 Whats the normal process of committing changes. Is the code QA'ed in some
 way or do I just do it,and wait for people to say #!.

 cheers
 Oliver

 



-- 
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: simple syntax question

2009-06-17 Thread David Pollak
If you have XML like: input my:id=foo/
you can:

bind(my, xml, FuncAttrBindParam(id, nodeseq = nodeseq ++ Text(bar),
id))

And you get:

input id=foobar/


On Wed, Jun 17, 2009 at 10:21 AM, DavidV david.v.villa...@gmail.com wrote:


 For now I have fixed the problem by calling a new method in my snippet
 that accesses the variable with { } in the input tag.  I would be
 interested to know if there is a way to do this with a bind tag
 directly in the input tag in the .html file, because I feel like my
 current solution is a bit of a kludge...
 -David

 On Jun 17, 12:00 pm, DavidV david.v.villa...@gmail.com wrote:
  I would like to include a variable value in an input tag in my .html
  file.  I have defined a tag as follows:
 
def upload(xhtml: Group): NodeSeq =
  if (S.get_?) {
bind(ul, chooseTemplate(choose, get, xhtml),
  file_upload - fileUpload(ul = theUpload(Full
  (ul))),
  batch - currBatch
)
  }
 
  thus,
  choose:get
  ul:batch/
  /choose:get
 
  returns the variable value that I need
 
  How can I retrieve this variable for the value= attribute of my
  input tag?  For instance, right now I am trying to do it like this:
  input name=batch type=hidden value=ul:batch/ /
 
  but that is not working.  It also doesn't work like this:
  input name=batch type=hidden value=ul:batch/ /
 
  Thanks,
  David

 



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

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