[Lift] broken app

2009-11-08 Thread Oliver Lambert
Hi

Over the last couple of days I have been getting the following error on Lift
1.0 using scala 2.7.3 when I try to deploy an application to a Glassfish (or
Tomcat) server (Jetty works ok)

: Exception starting filter LiftFilter
java.lang.IncompatibleClassChangeError: Class scala.List$$anon$1 does not
implement the requested interface scala.Seq$Projection
at net.liftweb.util.ListHelpers$class.first(ListHelpers.scala:50)
at net.liftweb.util.Helpers$.first(Helpers.scala:29)
at net.liftweb.util.Props$.(Props.scala:151)
at net.liftweb.util.Props$.(Props.scala)
at net.liftweb.util.LogBoot$.findTheFile$1(Log.scala:115)
at net.liftweb.util.LogBoot$._log4JSetup(Log.scala:118)
at net.liftweb.util.LogBoot$$anonfun$2.apply(Log.scala:96)
at net.liftweb.util.LogBoot$$anonfun$2.apply(Log.scala:96)
at net.liftweb.util.LogBoot$.checkConfig(Log.scala:94)
at
net.liftweb.util.LogBoot$.net$liftweb$util$LogBoot$$_logger(Log.scala:140)
at net.liftweb.util.LogBoot$$anonfun$3.apply(Log.scala:142)
at net.liftweb.util.LogBoot$$anonfun$3.apply(Log.scala:142)
at net.liftweb.http.LiftRules$.(LiftRules.scala:559)
at net.liftweb.http.LiftRules$.(LiftRules.scala)
at net.liftweb.http.LiftFilter.init(LiftServlet.scala:546)
...


I think the application was deploying OK earlier in the week. Any ideas???

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: You are not banned from this group!!

2009-09-24 Thread Oliver Lambert
My son was born a week ago, with a heart defect that has just been operated
on - I've been biting my nails for months and haven't felt like
communicating or working. Things are starting to look good for him so maybe
Im back.
cheers
Oliver

On Thu, Sep 24, 2009 at 12:08 PM, Charles F. Munat  wrote:

>
> Funny, I was just wondering what happened to you maybe two days ago. Are
> you back, or just checking in?
>
> Chas.
>
> Oliver Lambert wrote:
> >
> >
> > On Tue, Sep 22, 2009 at 7:21 AM, David Pollak
> > mailto:feeder.of.the.be...@gmail.com>>
> > wrote:
> >
> >
> > I will gladly buy beer/coffee/food for anyone who gets such a
> > notice.  I sincerely apologize for any problems this is causing.
> >
> >
> > Can you send me such a notice, I'd like a beer!
> > Oh, and I've been away for a while, its nice to see the lift mailing
> > list is going so strong.
> >
> > 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] Lift job

2009-09-24 Thread Oliver Lambert
Hi all,
The company I work for, Paycorp, is based in Sydney Australia and has a job
with a significant Lift / Scala component. The job description is posted on
http://www.scalacareers.com/

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: You are not banned from this group!!

2009-09-23 Thread Oliver Lambert
On Tue, Sep 22, 2009 at 7:21 AM, David Pollak  wrote:

>
> I will gladly buy beer/coffee/food for anyone who gets such a notice.  I
> sincerely apologize for any problems this is causing.
>
>
Can you send me such a notice, I'd like a beer!
Oh, and I've been away for a while, its nice to see the lift mailing list is
going so strong.

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: Rational Behind One Callback per Form Field

2009-07-27 Thread Oliver Lambert
I've been using a library that works somewhat differently from Record
(bottom up rather than top down) and might work in a way more familiar to
some people. It provides a syntax something like

class FavouriteB extends Binder {
val yourName = bindString("yourName") // mandatory is the default
val yourNickname = bindStringOpt("yourNickname") // optional string
val donationDate = bindDate("donationDate")
}

It's strongly typed, provides options for optional fields and validation.
Rather than Record.toForm, the bind then just becomes something like
bind("favourite", xhtml, favouriteB.bindParams)

If someone expresses interested in using it, I would release it. I've been
sitting on it
because I'm not sure I want compete with Record, but, perhaps the two
approaches
could be complementary.

cheers
Oliver

On Mon, Jul 27, 2009 at 12:17 AM, Devon Tucker wrote:

>
> Marius,
>
> Maybe boiler plate is too strong a word, but every form example I've
> seen follows the exact same pattern. The form support in Record sounds
> interesting, though I'm always wary of mixing form handling in with
> mapped objects. Also, not every form necessarily maps to a database
> object. I'll probably still take a look at it though.
>
> As for how, exactly, I would like my code to look... well, it could go
> any number of way really. I like the option of having a form callback
> that deals solely with a Map[String, String] of form fields. It's
> inelegant, and loses some of the static checking the current solution
> has, but it's flexible.
>
> someSnippet(xml: NodeSeq) = {
>bind("prefix", xml,
>"fieldOne" -> SHtml.text( ... ),
>"fieldTwo" -> SHtml.text( ... ),
> "formSubmit" -> SHtml.submit("Submit", submitHandler))
> }
>
> submitHandler(fields: Map[String, String]) {
> //grab things off the map, do processing
> }
>
> Like I said, not really elegant and this exact functionality can
> already be achieved using the current setup but it has the advantage
> of not relying on stored closures; the map would just be part of the
> post request. As far as I can tell, and please correct me if I'm
> wrong, behind the scenes Lift is storing these closures somehow and
> associating them with a form via the name attributes. This idea really
> scares me because it seems to have a very high potential for abuse and
> it doesn't seem to be documented anywhere. For example, it was very to
> use Firebug and modify the name attributes on my form to produce
> unexpected behavior in my application. This means, as a developer, I
> have to worry and protect myself against the case where any and all of
> my field-associated closures were not called at all, even my submit
> handler.
>
> Maybe storing closures is beneficial or even necessary when dealing
> with AJAX and Comet but for vanilla forms it seems unnecessarily
> stateful. Why not just process the entire form as the request is made?
>
> Cheers,
> Devon
>
>
> On Jul 26, 5:26 am, "marius d."  wrote:
> > Why is that a boiler plate?
> >
> > Usually in those functions you are building your domain objects,
> > calling setters etc when your function bound to the submit button is
> > called, you have your model built up and start processing it. One
> > other reason for those little functions is type-safety. Your function
> > is called with the proper parameter value and you just use it in a
> > type safe manner.
> >
> > but if you don't like this you can still use jsonForm and in your
> > JsonHandler you have a Map with all your form fields.
> >
> > Record framework for example has a Record.toForm function that is able
> > to serialize a Record into the form  markup (you can even provide your
> > own template) and you can specify your own function that will be
> > called when your generated form is submitted. Lift will automatically
> > build your Field-s our of submitted values, and in your processing
> > function you can do validation (see validation support in Record), and
> > do whatever else you want with it.
> >
> > Br's,
> > Marius
> >
> > On Jul 26, 12:18 am, Devon Tucker  wrote:
> >
> > > Hi all,
> >
> > > I've been working with Lift for about a little while now; there are
> > > still plenty of aspects of Lift I haven't touched yet. One thing I am
> > > curious about at this point though is the rationale behind having one
> > > callback per field when generating forms. Each SHtml form element
> > > needs 

[Lift] Re: Including jars into a liftweb project

2009-06-26 Thread Oliver Lambert
If I have an application thats not in a Maven repository, I usually put it
in my local (or company) repository - for instance adding functionaljava.jar
mvn install:install-file -DgroupId=org.other -DartifactId=functionaljava
-Dversion=2.17 -Dpackaging=jar -Dfile=functionaljava.jar -DgeneratePom=true

But, before you do this, as suggested
below, you might want to google for the application
(eg "ibiblio functionaljava") to make sure its not in a maven repository.

On Fri, Jun 26, 2009 at 6:16 PM, Timothy Perrett wrote:

>
> To clarify - you only need that system path if its a JAR not in a
> maven repository anywhere. What JAR are you trying to add?
>
> Cheers, Tim
>
> On Jun 26, 9:01 am, Caoyuan  wrote:
> > On Fri, Jun 26, 2009 at 3:51 PM, Jeppe Nejsum Madsen
> wrote:
> >
> > > On 26 Jun 2009, fbettag wrote:
> >
> > >> Hey guys,
> >
> > >> i was wondering how (and where) i have to put jars in my liftweb
> > >> project to get them included. i know it's a beginners question, but
> > >> i've been playing around all night and i couldn't get it to work.
> >
> > > Normally, you would put jars in the WEB-INF/lib folder and they will be
> > > picked up by the servlet container
> >
> > > They need to be available at compile time too...
> >
> > > /Jeppe
> >
> > Usually, jar files should be put under maven's dependency management,
> > but you can try to add them by adding something like the following to
> > pom.xml
> >
> > 
> > 
> > com.xxx
> > com.xxx.xxx
> > 4.7.1
> > system
> >
> ${basedir}/src/main/webapp/WEB-INF/lib/x-4.7.1.jar ath>
> > 
> >
> >
> >
> >
> >
>

--~--~-~--~~~---~--~~
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: New mapper class: MappedEnumString

2009-06-25 Thread Oliver Lambert
On Thu, Jun 25, 2009 at 10:49 PM, Jeppe Nejsum Madsen wrote:

>
> On Thu, Jun 25, 2009 at 1:12 AM, Oliver Lambert 
> wrote:
> >
> > Looks very nice.
> >
> > One thing I'm wondering, what if I wanted the displayed value outside of
> the mapper, such as TestTypes.Item1.displayValue. Would you use an implicit
> conversion to provide this or is the
> > display value conceptually always part of a mapper object.
>
> Good question :-) I'm still using CRUDify generated views while
> prototyping, but will probably need some more sophisticated layouts at
> some point. Don't yet know if the display value will come from the
> mapper object or the underlying enum.
>
> > I have a rough implementation called EnumWithDescription, that wraps (not
> extends) an Enumeration
> > and provides a description method on the enumeration value without using
> an implicit. I'm wondering
> > if it might be useful to combine your approach and mine?
>
> Sure. It might also be possible to make the original MappedEnum a bit
> more flexible instead (as Derek suggested earlier). My class is
> basically just a copy with very few modifications to handle the db
> value. I just haven't got the Scala knowledge yet to easily see how
> the interface should be and I needed to nail the db schema :-)
>

No this isn't what I'm suggesting, I don't think MappedEnum should be made
flexible.
I was thinking perhaps your class could work with EnumWithDescription as
shown below, which
extends Enumeration#Values to include a description.

/*
 A wrapper arround a Scala Enumeration Value that has a name, description
for each object
 */
trait ValueWithDescription  {
def description: String
def name: String
}

abstract class EnumWithDescription  {
type Value = enum.Value with ValueWithDescription

private var _values: List[Value] = Nil
def values = _values

// possibly not a good idea using this directly
val enum = new Enumeration {
def Value(inName: String, inDescription: String): Value with
ValueWithDescription = {
new Val(nextId, inName) with ValueWithDescription {
def description = inDescription
def name = inName
}
}
}

def Value(name: String, description: String): Value = {
val value = enum.Value(name, description)
_values = _values ::: List(value)  // build in order
value
}

def Value(name: String): Value = Value(name, name)

def valueOf(name: String) = values find (_.name == name)

def nameDescriptionList = values map(x => (x.name, x.description) )

}





>
> /Jeppe
>
> >
>

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



[Lift] Re: New mapper class: MappedEnumString

2009-06-24 Thread Oliver Lambert
Looks very nice.

One thing I'm wondering, what if I wanted the displayed value outside of the
mapper, such as TestTypes.Item1.displayValue. Would you use an implicit
conversion to provide this or is the
display value conceptually always part of a mapper object.

I have a rough implementation called EnumWithDescription, that wraps (not
extends) an Enumeration
and provides a description method on the enumeration value without using an
implicit. I'm wondering
if it might be useful to combine your approach and mine?

cheers
Oliver

On Thu, Jun 25, 2009 at 6:39 AM, Jeppe Nejsum Madsen wrote:

> Hi,
>
> A while ago, I asked if it was possible to use something like MappedEnum
> and have some sensible values inserted into the database instead of
> integers.
>
> I got the feeling this was not the case, so I've created MappedEnumString
> (attached) which maps Enumerations into string values.
>
> Example:
>   object TestTypes extends Enumeration {
>  val Unknown = new Val(0,"??")
>  val Item1 = new Val("XX")
>  val Item2 = new Val("YY")
>   }
>
>  object test extends MappedEnumString(this, TestTypes, 2)
>
> This will store the values, ??, XX or YY in the db. For display
> purposes, it will by default lookup the resource values TestTypes.??,
> TestTypes.XX, TestTypes.YY
>
> You can also calculate the displayed values:
>
>object test2 extends MappedEnumString(this, TestTypes, 2) {
>override def _valueToDisplayString(v:Enumeration#Value) = v match {
>case TestTypes.Item1 => "Item1Display"
>case TestTypes.Item2 => "Item2Display"
>case _ => "Unknown x ItemDisplay"
>   }
>}
>
> I'm by no means a Scala/Lift expert so I may have overlooked stuff, so
> feel free to comment :-)
>
> /Jeppe
>
>
> >
>

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



[Lift] Re: [scala] JPA question

2009-06-23 Thread Oliver Lambert
Actually, I don't think I would be looking at @MappedSuperclass either.
Whats your database schema? Is it always a Legacy database or are you
creating it new?
Are the java entities you are trying to create, read only?
Why aren't you using Scala's JPA?
If you are creating a complex parent-child relationships, cant you use
one-many relationships in hibernate
rather than bothering with Hibernates object-superclass implementation?

I have seen Hibernate used to map complex relationships in production, but
when I see an OR-mapping
problem I always try KISS principles on it first. Sometimes this involves
creating views, sometimes it involves just completely lying to Hibernate
about the underling data structure and creating
a Read only entity.
For example I have a the following entity that maps to a select (not a table
or view)
class RoEntity {
  @Id
  var entityId: Long = _
...
}
EM.createNativeQuery[RoEntity](nativeQueryStr, classOf[RoEntity])

If I want to save it, I populate an entity that really has an underlying
table.

cheers
Oliver

On Wed, Jun 24, 2009 at 9:55 AM, Oliver Lambert  wrote:

> I don't understand from the code sample why AbstractContainer has to be an
> entity or
> have a table or id annotation. I'd be looking at just using the
> @MappedSuperclass annotation.
>
>
> On Wed, Jun 24, 2009 at 9:27 AM, Meredith Gregory <
> lgreg.mered...@gmail.com> wrote:
>
>> Kris,
>>
>> Thanks for this code sample. i will study and see if it offers a way
>> around the conundrum. In the meantime, here's a code 
>> sample<http://svn.biosimilarity.com/src/open/codesamples/trunk/hibernate/hbex/>illustrating
>>  exactly what i'm talking about.
>>
>> Best wishes,
>>
>> --greg
>>
>>
>> On Tue, Jun 23, 2009 at 2:21 PM, Kris Nuttycombe <
>> kris.nuttyco...@gmail.com> wrote:
>>
>>>
>>> Oops, forgot a member of the hierarchy, inline below:
>>>
>>> On Tue, Jun 23, 2009 at 3:19 PM, Kris
>>> Nuttycombe wrote:
>>> > I'm just so puzzled by this thread because I have the following entity
>>> > hierarchy in my app:
>>> >
>>> > @Entity
>>> > @Inheritance(strategy = InheritanceType.JOINED)
>>> > @Table(name = "payment_source_transaction")
>>> > public abstract class PaymentSourceTransaction>> PaymentSource>
>>> >extends SubscriptionTransaction implements
>>> > MonetaryTransaction, Serializable {
>>> >
>>> >@ManyToOne(cascade = {CascadeType.MERGE, CascadeType.PERSIST},
>>> > optional = false, targetEntity = PaymentSource.class)
>>> >private T paymentSource;
>>> >
>>> >...
>>> > }
>>> >
>>> > @Entity
>>> > public abstract class CreditCardTransaction extends
>>> > PaymentSourceTransaction { ... }
>>> >
>>>
>>> @MappedSuperclass
>>> public abstract class VoidableCCTransaction extends
>>> CreditCardTransaction implements Serializable { ... }
>>>
>>>@OneToOne(cascade = {CascadeType.MERGE, CascadeType.PERSIST},
>>> mappedBy="voidedTransaction")
>>>private CCVoidTransaction voidTransaction;
>>>
>>> > @Entity
>>> > public class CCAuthTransaction extends VoidableCCTransaction
>>> > implements AuthTransaction, Divisional, Serializable { ..
>>> > }
>>> >
>>> > @Entity
>>> > @Inheritance(strategy = InheritanceType.SINGLE_TABLE)
>>> > public abstract class CCCaptureTransaction extends
>>> > VoidableCCTransaction implements Serializable,
>>> > CaptureTransaction {
>>> >private static final long serialVersionUID = 1L;
>>> >
>>> >@OneToOne(cascade = {CascadeType.PERSIST, CascadeType.MERGE})
>>> >private CCAuthTransaction authTransaction;
>>> >
>>> >...
>>> > }
>>> >
>>> > @Entity
>>> > public class EcometryCaptureTransaction extends CCCaptureTransaction
>>> > implements EcometryOrder, Serializable { ... }
>>> >
>>> > @Entity
>>> > @Inheritance(strategy = InheritanceType.JOINED)
>>> > public abstract class PaymentSource>
>>> > extends UUEntity implements MutationControlled, Serializable { ...
>>> > }
>>> >
>>> > @Entity
>>> > public class CreditCard extends PaymentSource implements
>>> > Addressable, Serializable { ... }
>>> >
>>> > @Ent

[Lift] Re: [scala] JPA question

2009-06-23 Thread Oliver Lambert
I don't understand from the code sample why AbstractContainer has to be an
entity or
have a table or id annotation. I'd be looking at just using the
@MappedSuperclass annotation.

On Wed, Jun 24, 2009 at 9:27 AM, Meredith Gregory
wrote:

> Kris,
>
> Thanks for this code sample. i will study and see if it offers a way around
> the conundrum. In the meantime, here's a code 
> sampleillustrating
>  exactly what i'm talking about.
>
> Best wishes,
>
> --greg
>
>
> On Tue, Jun 23, 2009 at 2:21 PM, Kris Nuttycombe <
> kris.nuttyco...@gmail.com> wrote:
>
>>
>> Oops, forgot a member of the hierarchy, inline below:
>>
>> On Tue, Jun 23, 2009 at 3:19 PM, Kris
>> Nuttycombe wrote:
>> > I'm just so puzzled by this thread because I have the following entity
>> > hierarchy in my app:
>> >
>> > @Entity
>> > @Inheritance(strategy = InheritanceType.JOINED)
>> > @Table(name = "payment_source_transaction")
>> > public abstract class PaymentSourceTransaction> PaymentSource>
>> >extends SubscriptionTransaction implements
>> > MonetaryTransaction, Serializable {
>> >
>> >@ManyToOne(cascade = {CascadeType.MERGE, CascadeType.PERSIST},
>> > optional = false, targetEntity = PaymentSource.class)
>> >private T paymentSource;
>> >
>> >...
>> > }
>> >
>> > @Entity
>> > public abstract class CreditCardTransaction extends
>> > PaymentSourceTransaction { ... }
>> >
>>
>> @MappedSuperclass
>> public abstract class VoidableCCTransaction extends
>> CreditCardTransaction implements Serializable { ... }
>>
>>@OneToOne(cascade = {CascadeType.MERGE, CascadeType.PERSIST},
>> mappedBy="voidedTransaction")
>>private CCVoidTransaction voidTransaction;
>>
>> > @Entity
>> > public class CCAuthTransaction extends VoidableCCTransaction
>> > implements AuthTransaction, Divisional, Serializable { ..
>> > }
>> >
>> > @Entity
>> > @Inheritance(strategy = InheritanceType.SINGLE_TABLE)
>> > public abstract class CCCaptureTransaction extends
>> > VoidableCCTransaction implements Serializable,
>> > CaptureTransaction {
>> >private static final long serialVersionUID = 1L;
>> >
>> >@OneToOne(cascade = {CascadeType.PERSIST, CascadeType.MERGE})
>> >private CCAuthTransaction authTransaction;
>> >
>> >...
>> > }
>> >
>> > @Entity
>> > public class EcometryCaptureTransaction extends CCCaptureTransaction
>> > implements EcometryOrder, Serializable { ... }
>> >
>> > @Entity
>> > @Inheritance(strategy = InheritanceType.JOINED)
>> > public abstract class PaymentSource>
>> > extends UUEntity implements MutationControlled, Serializable { ...
>> > }
>> >
>> > @Entity
>> > public class CreditCard extends PaymentSource implements
>> > Addressable, Serializable { ... }
>> >
>> > @Entity
>> > public class CheckingAccount extends PaymentSource
>> > implements Serializable { ... }
>> >
>> > This works for me without difficulty. What am I missing that is
>> > different about this scheme than the one that you describe?
>> >
>> > Kris
>> >
>> >
>> >
>> > On Tue, Jun 23, 2009 at 11:29 AM, Meredith
>> > Gregory wrote:
>> >> Derek,
>> >>
>> >> i completely concur. i wanted to give it a serious go, however, before
>> i
>> >> abandoned it. The issue is that so much of the incumbent technology
>> goes
>> >> across this object-relational boundary, i needed a simple case to
>> justify
>> >> walking away from this technology. This example provides it. To see
>> just how
>> >> non-complex it is, let me state it in common sense terms.
>> >>
>> >> Suppose we are building an app for a manufacturing firm, and the firm
>> ships
>> >> out its goods in different kinds of containers: plastic-coated
>> cardboard
>> >> boxes, metal boxes, etc.
>> >> Suppose that different kinds of materials go into different kinds of
>> boxes,
>> >> and sometimes medicinal or toxic substances go into these containers;
>> but,
>> >> every container gets a manifest. When the container contains these
>> materials
>> >> that need to be handled with care or attention, the manifest is a
>> special
>> >> kind of certified manifest.
>> >>
>> >> We might imagine that this firm has already constructed an object model
>> that
>> >> looks like
>> >>
>> >> abstract class Container { ...; Manifest getManifest(); void
>> setManifest(
>> >> Manifest manifest ); ... }
>> >> class CardboardContainer extends Container { ... }
>> >> class MetalContainer extends Container { ... }
>> >> abstract class Manifest { ... }
>> >> class StdManifest extends Manifest { ... }
>> >> class CertifiedManifest extends Manifest { ... }
>> >>
>> >> We need to work with their existing infrastructure. However, this
>> >> situation/model breaks Hibernate's implementation of JPA. That such a
>> simple
>> >> situation would cause problems indicates to me that these technologies
>> have
>> >> never been used in any significant way in production -- otherwise they
>> would
>> >> have bumped into such a common case. If i'm wrong about something,
>> her

[Lift] Re: prep for offline work

2009-06-22 Thread Oliver Lambert
Check you can work offline before you go with the command Tim details (mvn
-o clean install).
If you are running against a snapshot of Lift consider changing to a release
instead, otherwise
Maven will want to download a new snapshot every day (you could freeze at a
snapshot version,
but thats more complicated).

On Tue, Jun 23, 2009 at 1:30 AM, Timothy Perrett wrote:

>
> Grab yourself a copy of the lift book, download the lift source code
> so you can build locally if need be and dont forget you prefix all
> your maven commands: mvn -o
>
> Cheers, Tim
>
> On Jun 22, 4:01 pm, Mojo  wrote:
> > Hi all, I've enjoyed following the list for a few weeks, and studying
> > Scala casually for a few months.
> >
> > I'm a Java developer currently working with Spring and Hibernate to
> > build web apps, and spent a few months professionally in the Ruby on
> > Rails world as well.
> >
> > I'm about to depart on a ten-day cruise (San Francisco to Alaska) and
> > kind of looking forward to the disconnected time to spend working with
> > Scala and Lift.
> >
> > Being disconnected makes for good concentration time, but it also
> > makes it difficult to deal with things like missing Maven
> > dependencies. I'm trying to be as prepared as I can before departure.
> >
> > I've done things like install the "helloworld" lift app from Maven,
> > and done a complete build to jetty:run, and even "mvn site" to try and
> > make sure all the plugins and dependencies are in my local repository.
> > I have Netbeans on the machine, 6.5, and the latest RC for 6.7, but
> > haven't yet installed the Scala plugin.
> >
> > I'd probably better have a DB on hand. Mysql or HSQLDB.
> >
> > Can anyone think of any other good ways to prepare for doing some
> > study and development while being off the grid, so to speak?
> >
> > Cheers,
> > Mojo
> > --
> > Morris Jones
> > Monrovia, CA
> > m...@whiteoaks.comhttp://mojo.whiteoaks.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: JPA and auto generation of id

2009-06-22 Thread Oliver Lambert
What sort of database are you trying to use Hibernate against (look at the
property hibernate.dialect  in the file persistence.xml)?
I think the error may mean that your trying to use GenerationType.AUTO
against a database that doesn't support it.
On Mon, Jun 22, 2009 at 7:08 PM, David Persons  wrote:

>
> Hello guys,
>
> I get a org.hibernate.exception.SQLGrammarException: could not get or
> update next value error everytime I try to save the following Entity:
>
> @Entity
> class Scene {
>  @Id
>  @GeneratedValue(){val strategy = GenerationType.AUTO}
>  var id : Long = _
>
>  @Column{val unique = true, val nullable = false}
>  var ordering : Int = _
>
>  @Column{val unique = true, val nullable = false}
>  var name : String = ""
>
>  @ManyToOne{val optional = false}
>  var storyBoard : StoryBoard = _
> }
>
> What am I doing wrong??
>
> grtz,
> David Persons
>
> >
>

--~--~-~--~~~---~--~~
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-18 Thread Oliver Lambert
Hi Greg,
Thank you, I enjoyed reading that. Perhaps the Greedy Empire, should indeed,
be worried.

cheers
Oliver

2009/6/18 Meredith Gregory 

> Oliver,
>
> You wrote:
>
> we would have taken over Google by now.
>>
>
> My not-so-secret plan for taking over Google is contained in the deck i
> posted in response to 
> Viktor<http://svn.biosimilarity.com/src/open/talks/MonadicDesignPatternsForTheWeb.pdf>.
> Part of the reason i was excited that Jonas took on to make the JTA wrapper
> monadic is that it composes perfectly with the ideas explained in the deck.
> These ideas dovetail perfectly with the DSL stuff i've been working on.
>
> My feeling is that we are at a point where things could really start to
> happen. The ideas are 'in the air' so to speak.
>
> Best wishes,
>
> --greg
>
> 2009/6/17 Oliver Lambert 
>
>
>>
>> 2009/6/18 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.
>>>
>>> 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 
>>> π-calculi<http://en.wikipedia.org/wiki/Pi-calculus>and 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 
>>> names<http://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 
>>> effective<http://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
>>> computation<http://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 
>>>
>>>
>>>>
>>>> 2009/6/17 Meredith Gregory 
>>>>
>>>> Jeremy,
>>>>>
>>>>> Most excellent question award to you, sir!
>>>>>
>>>>> How to bootstrap thinking compositionally... this is what i did
>>>>>
>>>>>- learn some compositional idioms by heart
>>>>>   - do you know the shape of the paradoxical combinator by heart
>>>>>   - do you know the data making up a monad
>>>>>   - do you know the data making up a distr

[Lift] Re: Thoughts on separation of display from logic

2009-06-18 Thread Oliver Lambert
I modified the BindHelper in the branch, I am working on some time back to
allow automatic mixin binding by name.
If you have in your html
  ,
then it will accept in the snippet
  bind("favourite", xhtml, "yourName" -> SHtml.text("show string, s =>
setBio(s))
and output something like
   
if you include attributes in the snippets bind, that are already in the
html, it will substitute them

Is this something like what you are trying to achieve?

On Thu, Jun 18, 2009 at 6:51 AM, David Pollak  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 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:
>>
>> 
>> 
>> This is a sample of some biography text
>> 
>> 
>>
>> 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: 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 

> 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 
> π-calculi<http://en.wikipedia.org/wiki/Pi-calculus>and 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 
> names<http://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 
> effective<http://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
> computation<http://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 
>
>
>>
>> 2009/6/17 Meredith Gregory 
>>
>> Jeremy,
>>>
>>> Most excellent question award to you, sir!
>>>
>>> How to bootstrap thinking compositionally... this is what i did
>>>
>>>- learn some compositional idioms by heart
>>>   - do you know the shape of the paradoxical combinator by heart
>>>   - do you know the data making up a monad
>>>   - do you know the data making up a distributive law between monads
>>>   - use them in real world applications and see where they fail
>>>   - when is calculating the least/greatest fixpoint of a recursive
>>>   spec for a problem the suboptimal solution
>>>   - when is a monad not the answer
>>>   - when is an indexed form of composition inadequate
>>>   - improve them
>>>   - is it a situational improvement or
>>>   - a fundamental improvement
>>>   - see where the very programming model itself fails
>>>   - is functional composition the only sort of composition
>>>   - how is parallel composition like functional composition
>>>   - is parallel composition easily represented in categorical
>>>   composition
>>>   - improve it
>>>   - what is the view of the world in your notion of composition
>>>   - play with new programming models
>>>   - does your new notion of composition give rise to a whole
>>>   generation of different models
>>>   - invent new idioms in these models
>>>   - what are the things these models naturally express
>>>   - and teach them to someone who wishes to bootstrap thinking
>>>compositionally
>>>
>>> For myself, i was unhappy with the notion of name. The π-calculi and
>>> lambda calculi suffer a dependence on a notion of name. Both families of
>>> calculi require at lea

[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-16 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 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,
>>
>> 
>> 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.
>> 
>>
>> 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  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 

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

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

2009-06-16 Thread Oliver Lambert
2009/6/17 Meredith Gregory 

> Jeremy,
>
> Most excellent question award to you, sir!
>
> How to bootstrap thinking compositionally... this is what i did
>
>- learn some compositional idioms by heart
>   - do you know the shape of the paradoxical combinator by heart
>   - do you know the data making up a monad
>   - do you know the data making up a distributive law between monads
>   - use them in real world applications and see where they fail
>   - when is calculating the least/greatest fixpoint of a recursive
>   spec for a problem the suboptimal solution
>   - when is a monad not the answer
>   - when is an indexed form of composition inadequate
>   - improve them
>   - is it a situational improvement or
>   - a fundamental improvement
>   - see where the very programming model itself fails
>   - is functional composition the only sort of composition
>   - how is parallel composition like functional composition
>   - is parallel composition easily represented in categorical
>   composition
>   - improve it
>   - what is the view of the world in your notion of composition
>   - play with new programming models
>   - does your new notion of composition give rise to a whole
>   generation of different models
>   - invent new idioms in these models
>   - what are the things these models naturally express
>   - and teach them to someone who wishes to bootstrap thinking
>compositionally
>
> For myself, i was unhappy with the notion of name. The π-calculi and lambda
> calculi suffer a dependence on a notion of name. Both families of calculi
> require at least countably infinitely many names, and a notion of equality
> on names. If names have no internal structure then these theories *cannot
> be effective*.


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


> The reasons is that the notion of equality must then be realized as an
> infinitary table which cannot fit in any computer we have access to.
> Therefore, in effective theories, names must have internal structure. Since
> they have internal structure and are at least countably infinite, one is in
> danger of undermining the foundational character of these proposals for
> computing. Therefore, the only possible solution is that the notion of
> structured name must come from the notion of program proposed by the model.
> This argument is airtight. If you want a foundational model of computing
> with nominal structure, the nominal structure must derive from the notion of
> computation being put forward, i.e. it must *reflect* the notion of
> computation. This gives rise to all kinds of new an beautiful phenomena. One
> measure of your way into compositional thinking is whether this is
> happening. Is your approach to compositional thinking beginning to yield
> whole new aspects of computing, and new 'wholes' of computation, new forms
> of organization.
>
> Best wishes,
>
> --greg
>
> On Tue, Jun 16, 2009 at 7:31 PM, Jeremy Day  wrote:
>
>> Greg,
>>
>> On Tue, Jun 16, 2009 at 6:38 PM, Meredith Gregory <
>> lgreg.mered...@gmail.com> wrote:
>>
>>> It takes some serious training to think compositionally.
>>
>>
>> No doubt it is extremely tough to think compositionally, and it's all too
>> easy to fall back on non-compositional ways of thinking.  In a similar vein
>> it's all too easy to fall into procedural patterns when learning or working
>> with functional programming in a multi-paradigm language.  But what are good
>> ways for programmers to learn to think compositionally and, more
>> importantly, practice?  Do you know of any books or online references that
>> might help make the transition for anyone who is interested?
>>
>> Jeremy
>>
>>
>>
>
>
> --
> L.G. Meredith
> Managing Partner
> Biosimilarity LLC
> 1219 NW 83rd St
> Seattle, WA 98117
>
> +1 206.650.3740
>
> http://biosimilarity.blogspot.com
>
> >
>

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



[Lift] directory structure

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

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

cheers
Oliver

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



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

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

On Wed, Jun 17, 2009 at 9:38 AM, Meredith Gregory
wrote:

> Derek,
>
> 
> 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.
> 
>
> 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  > 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  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 
>>>
  Hello,

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

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

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

 I joined a sample application, ...

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

 Jean-Luc

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


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

>>>
>>>
>>>
>>> --
>>> Jean-Luc Canela
>>> jlcane...@gmail.com
>>>
>>>
>>>
>>
>>
>>
>
>
> --
> L.G. Meredith
> Managing Partner
> Biosimilarity LLC
> 1219 NW 83rd St
> Seattle, WA 98117
>
> +1 206.650.3740
>
> http://biosimilarity.blogspot.com
>
>
> >
>

--~--~-~--~~~---~--~~
You recei

[Lift] Re: Develop / Production System

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

On Tue, Jun 16, 2009 at 7:25 PM, Tobias Daub  wrote:

>
> Ok, thanks.
>
> Well, with the pom.xml file it was a little bit strange. I had to change
> the Lift version to do the mvn clean install and then change it back.
> I've no idea why, but it was the only things that helped.
>
>
> > Maven stores project dependencies in a repository (by default, its
> > called .m2). When you move a Lift application from one system to
> > another, the repository on the new system may need to be updated,
> > hence your requirement to do a "mvn clean install".
> >
> > Don't know what you changed on the pom.xml (if you have any hard coded
> > paths, you might have to change them).
> >
> > On Tue, Jun 16, 2009 at 2:41 AM, Tobias Daub  > > wrote:
> >
> >
> > Hi There,
> >
> > I would like to know whats the best way to move an existing Lift
> > installation from one system to another. I ask this, because I had
> > some
> > problems after I just copied the whole directory (I had to edit the
> > pom.xml file and do "mvn clean install").
> >
> >
> > thanks
> >
> >
> >
> >
> > >
>
>
> >
>

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



[Lift] Re: Develop / Production System

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

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

On Tue, Jun 16, 2009 at 2:41 AM, Tobias Daub  wrote:

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

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



[Lift] Re: Hiring Lift Developers

2009-06-15 Thread Oliver Lambert
As probably is Sydney, Australia.

It might be useful knowing where people are who are looking for jobs - the
company
I work for is small, but, might be interested in hiring sometime in the
future.

On Tue, Jun 16, 2009 at 8:51 AM, KWright wrote:

>
> I suspect that London UK would probably be an exception too far!
>
> On 15 June, 23:45, David LaPalomento  wrote:
> > Good point, sorry!  Most of the team is located in the Boston area,
> > but we'd probably be willing to make exceptions.
> >
> > On Jun 15, 4:14 pm, KWright  wrote:
> >
> > > You forgot to mention where you are in the world, it might be useful
> > > to know... :P
> >
> > > On 15 June, 18:32, "David LaPalomento" 
> > > 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:

2009-06-15 Thread Oliver Lambert
I don't think any of the Liftweb's binding is going to survive a server
restart,
but, why are you worried about a server restart?

On Tue, Jun 16, 2009 at 8:59 AM, Ewan  wrote:

>
> Hi all
>
> I have bind that renders a link and at the moment I want the link to
> include a couple of query params ie.
>
> Click me
>
> I figured I'd be able to do something like the following except the
> additional "key/id" is added which messes it up.
>
> "value" -> SHtml.link("/search?q1=v1", () => doSearch, SText("Click
> me"))
>
> Looking at the src I can't see how this would work.  I guess using a
> requestVar would be the recommended solution but how does that work
> for bookmarked urls between server restarts?
>
> >
>

--~--~-~--~~~---~--~~
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: Cheap Hosting

2009-06-14 Thread Oliver Lambert
Thats good value - might use it too sometime.

On Mon, Jun 15, 2009 at 1:56 PM, David Pollak  wrote:

> Mark,
> You should be able to host a moderately trafficked site (400 unique
> visitors an hour) with a $20 slicehost.com account.
>
> Thanks,
>
> David
>
> On Sun, Jun 14, 2009 at 4:40 PM, Mark Lynn  wrote:
>
>>
>>
>> I have a web app that I am doing free for a charitable organization
>> that is sensitive to hosting costs. I would like to make it my first
>> Lift app since it is pretty straight-forward - simple database and
>> will probably just use Mapper. Most of my previous experience is with
>> Rails projects or projects that were hosted internally so I don't have
>> much experience with java hosting services. Does anyone have a
>> recommendation for an inexpensive hosting option where I can use scala/
>> lift? With Rails or PHP I can find stuff for as little as $5/mth.
>>
>> Mark Lynn
>>
>>
>>
>>
>>
>>
>>
>
>
> --
> 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: file upload

2009-06-12 Thread Oliver Lambert
Whats serious uploading? I uploaded 15,000 records using it today - seemedto
handle it OK.

On Fri, Jun 12, 2009 at 9:48 AM, Timothy Perrett wrote:

>
> FYI - its not a streaming upload at the moment, so its great for
> smallish files, but you wouldnt want to do much serious uploading with
> it right now. We've had several discussions about making it streaming,
> and its certainly "on the todo list".
>
> Cheers, Tim
>
> On Jun 11, 9:24 pm, DavidV  wrote:
> > I would like to upload a .csv file onto the web server so I can then
> > parse it in my webapp, and put certain fields into my database.  I
> > would like a "Browse..." button, much like the one shown on this Lift
> > example page:http://demo.liftweb.net/file_upload
> > Can anyone point me in the right direction as to how to get started
> > doing this, or tell me where I can find the example code for the link
> > I provided?  I can't seem to locate it in liftweb in github
> > thanks,
> > David
> >
>

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



[Lift] Re: security

2009-06-10 Thread Oliver Lambert
On Wed, Jun 10, 2009 at 11:58 PM, David Pollak <
feeder.of.the.be...@gmail.com> wrote:

>
>
> On Tue, Jun 9, 2009 at 11:39 PM, marius d. wrote:
>
>>
>> Hi,
>>
>> For most apps cannonicalization is not really necessary as the
>> character stream for form-url-encoded is UTF-8 by default as Lift uses
>> UTF-8 by default. Oh and the conversion from URL encoding to plain
>> UTF-8 content is really done by container and when we get the params
>> from the request object they are already well formed. Now if we're
>> talking about a higher level of validation that's a different story
>> and IMO this is an application aspect and not much a framework one.
>
>
> And Lift does URL Decoding of the paths before presenting them as the Req()
> object.
>
> More broadly, Lift should provide all the features of ESAPI out of the box.
>  If there are particular things that ESAPI offers that Lift doesn't, please
> flag them and we'll add them.
>
> I did a bunch of years as VPE and CTO at a web app security company.  In
> general, I've worked to make sure that Lift has security baked in and that
> the developer has to work to make the app insecure, rather than vice versa.
>  If I missed a spot, Lift will be enhanced to make sure it does have
> security baked in.
>
>
>From my perspective Lift is secure, much more so than other frameworks I've
used. The current set of Lift apps, that I've helped develop, have survived
outsourced penetration testing without requiring any modifications at all.
Great!

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

As far a I can see, one problem lies when a string is obtained from the web
page and instanciated into a String object.  For instance, if it comes in as
alert('XSS'), then its probably not what you want.  Why
does it matter if something like this gets stored in your database - perhaps
because it's one part of your security.  In addition if it comes in doubly
encoded as

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

then its probably also not what you want.

1) To stop double encoding, ESAPI suggests that you use cannonicalization to
convert the strings to a similar format before validation.
2) After, the input has been cannonicalized, ESAPI suggests that the input
should be validated against a whitelist of allowed charaters.

Now, I can't see that 1 or 2 is necessary if you are creating a number from
the input, but perhaps it should be, if you are creating a ordinary String
object. I also am not sure how much work would be involved in using a
whitelist in a location aware multilingual way, but perhaps it could be done
as a default.



>
>>
>> Br's,
>> Marius
>>
>> On Jun 10, 5:43 am, Oliver Lambert  wrote:
>> > Looks like I might have a requirement for implementing OWASP secure
>> coding
>> > practices, as described by
>> >
>>
>> > One thing that I definitively don't do and I believe Lift doesn't do out
>> of
>> > the box is Canonicalize input
>> > before validation/filtering. I was looking into using OWASP
>> > ESAPI<http://www.owasp.org/index.php/ESAPI>but I'm put off by it's use
>> > of
>> > property files and system resources.  Do any of you Canonicalize input,
>> if
>> > so, do you use a Library? Does Lift
>> > need this feature, or any of the others described in the above document?
>> >
>> > 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] security

2009-06-09 Thread Oliver Lambert
Looks like I might have a requirement for implementing OWASP secure coding
practices, as described by

http://www.sans.org/reading_room/whitepapers/application/rss/appsec_protecting_your_web_apps_two_big_mistakes_and_12_practical_tips_to_avoid_them_33038<https://mail01.paycorp.com.au/owa/redir.aspx?C=a9af519a5b1b45909b8897b71d6534db&URL=http%3a%2f%2fwww.sans.org%2freading_room%2fwhitepapers%2fapplication%2frss%2fappsec_protecting_your_web_apps_two_big_mistakes_and_12_practical_tips_to_avoid_them_33038>

One thing that I definitively don't do and I believe Lift doesn't do out of
the box is Canonicalize input
before validation/filtering. I was looking into using OWASP
ESAPI<http://www.owasp.org/index.php/ESAPI>but I'm put off by it's use
of
property files and system resources.  Do any of you Canonicalize input, if
so, do you use a Library? Does Lift
need this feature, or any of the others described in the above document?

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: Record with the new bind-immutable

2009-06-01 Thread Oliver Lambert
On Sat, May 30, 2009 at 2:05 AM, marius d.  wrote:

>
>
>
> On May 29, 4:32 pm, Oliver Lambert  wrote:
> > Hi Marius,
> > To try and answer your question, I had to go and look at the Record code
> in
> > more detail. I hadn't recently written the Binder Validator, so it wasn't
> > designed to be
> > complementary to anything else (however, some of the naming and
> methodology
> > is very
> > similar in both sets of code).
> >
> > What I found.
> > 1) MetaRecord.validate === Binder.validate
> > 2) Field.validators === BoundObj.validations
> > 3) Field.validationFunction === Validator.validate
> > 4) List[FieldError]  === List[ValidationError]
> >
> > Can I get rid of Binder Validation and just use Record/Field validation?
> > It certainly looks like I should try. However, I might have to add/change
> > some of the original Lift code.
> > For instance, I might want to add an errorType (with a default, so no
> code
> > is broken) to FieldError.
> > I might also want to move/change Field.validationFunction so its a little
> > more
> > like my Validator,with an errorType and toString (When I print my
> > validators, the errorType give a little
> > information on what they do, rather than just telling me I have a
> function -
> > I also filter using
> > the errorType)
>
> I think we should unify the models. What I particularly like about the
> existent validators is that it rlies on function type hence the
> flexibility to use anonymous functions or existent ones. SO IMHO it
> would be really neat to keep the existent validators per Field and if
> you would edd the errorType support would just great.
>

I think Ive managed to unify the models. There is a new Validator object,
net.liftweb.record.Validator that has an implicit conversion that accepts a
function (anonymous or otherwise) and wraps it in a Validator class with an
errorType. Thus validators can be written as functions or classes, and as
they are wrapped in a class it should be easy enough to add support for
javascript validation.
I can't really test it on the existing Record code, as I can't even manage
to instanciate a simple record. I have however, refactored the immutable
binding code.


> Oh FWIW I'm not a fan of function names starting with capital letters
> such as: def Range(lower: Int, upper: Int, errStr: String)  .. but
> that's just me.
>

Me neither. Don't know why I did this.


>
> >
> > Other things of interest that I found.
> >
> > Could a Binder be a MetaRecord? There are definitely some similarities.
> > Binder holds a set of
> > immutable objects which can be an advantage, but MetaRecord can talk to
> > databases which is
> > kind of useful at times.
>
> I think we should keep the Meta Record and Record. Please keep in mind
> that MetaRecord and Record have NOTHING to do with database, they are
> completely separated per design so that Records can be also used
> outside of a RDBMS scope. For DB we have DBMetaRecord and DBRecord
> which are not fully implemented yet.
>
> >
> > Could a BoundObj be a Field. Same distinction as above. A BoundObj[T] may
> > hold a reference to a string value
> > that is completely invalid. I'm not sure I see this in Field.
>
>
> IMHO I would just add the features that your code has and current code
> does not (such as error type) and put them in the MetaRecord/Record
> (or wherever they belong) and have a single coherent model. Please
> also take a deeper look on the existent code, in MetaRecord, Record,
> Fields implementations Not DB Fields) and see what goodies can be
> added from your new code.
>
> And integrating client side validations (as Dave suggested) in the
> same model would be really cool.
>
> >
> > cheers
> > Oliver
> >
> > On Fri, May 29, 2009 at 6:22 PM, marius d. 
> wrote:
> >
> > > I see ... still the question remains. What are we going to do with two
> > > validators? I'd like to understand the principles of your addition
> > > (... I know I should have dig into the code but I don't have much time
> > > now).
> >
> > > I'd like to understand as I said previously if we have redundant
> > > validators or complementary functionality so that people to not get
> > > confused.
> >
> > > I'm not trying at all to be negative or anything, just trying to
> > > understand the value added.
> >
> > > Br's,
> > > Marius
> >
> > > On May 29, 11:01 am, Oliver Lambert  wrote:
> > > > I'm a

[Lift] Re: Record and Field

2009-06-01 Thread Oliver Lambert
 Im not at the machine right now, but I believe it was a version of 1.6 on
Ubuntu, I was running against the snapshot of liftweb that I cloned a couple
of days ago.

I've rerun On my mac, build 1.6.0_07-b06-153
but the exception with build 1.0 is different,
java.lang.IllegalArgumentException: wrong number of arguments
On Mon, Jun 1, 2009 at 10:05 PM, marius d.  wrote:

>
> what Java version are you using?
>
> On Jun 1, 1:58 pm, Oliver Lambert  wrote:
> > When I try to run createRecord on a net.liftweb.record.Record, I get
> > a java.lang.ExceptionInInitializerError.
> > Any ideas what I might be doing wrong?
> >
> > 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] Record and Field

2009-06-01 Thread Oliver Lambert
When I try to run createRecord on a net.liftweb.record.Record, I get
a java.lang.ExceptionInInitializerError.
Any ideas what I might be doing wrong?

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: Record with the new bind-immutable

2009-05-29 Thread Oliver Lambert
That would be very cool

On Fri, May 29, 2009 at 11:37 PM, David Pollak <
feeder.of.the.be...@gmail.com> wrote:

> One thing I've been thinking about is optionally extending the Validator
> Functions to also emit JavaScript that would perform the validation in the
> browser... that would provide a seamless way to do client-side validation
> for validators (e.g., min len, max len, regex) that only rely on client-side
> data.
>
>
> On Fri, May 29, 2009 at 6:32 AM, Oliver Lambert wrote:
>
>> Hi Marius,
>> To try and answer your question, I had to go and look at the Record code
>> in
>> more detail. I hadn't recently written the Binder Validator, so it wasn't
>> designed to be
>> complementary to anything else (however, some of the naming and
>> methodology is very
>> similar in both sets of code).
>>
>> What I found.
>> 1) MetaRecord.validate === Binder.validate
>> 2) Field.validators === BoundObj.validations
>> 3) Field.validationFunction === Validator.validate
>> 4) List[FieldError]  === List[ValidationError]
>>
>> Can I get rid of Binder Validation and just use Record/Field validation?
>> It certainly looks like I should try. However, I might have to add/change
>> some of the original Lift code.
>> For instance, I might want to add an errorType (with a default, so no code
>> is broken) to FieldError.
>> I might also want to move/change Field.validationFunction so its a little
>> more
>> like my Validator,with an errorType and toString (When I print my
>> validators, the errorType give a little
>> information on what they do, rather than just telling me I have a function
>> - I also filter using
>> the errorType)
>>
>> Other things of interest that I found.
>>
>> Could a Binder be a MetaRecord? There are definitely some similarities.
>> Binder holds a set of
>> immutable objects which can be an advantage, but MetaRecord can talk to
>> databases which is
>> kind of useful at times.
>>
>> Could a BoundObj be a Field. Same distinction as above. A BoundObj[T] may
>> hold a reference to a string value
>> that is completely invalid. I'm not sure I see this in Field.
>>
>> cheers
>> Oliver
>>
>> On Fri, May 29, 2009 at 6:22 PM, marius d. wrote:
>>
>>>
>>> I see ... still the question remains. What are we going to do with two
>>> validators? I'd like to understand the principles of your addition
>>> (... I know I should have dig into the code but I don't have much time
>>> now).
>>>
>>> I'd like to understand as I said previously if we have redundant
>>> validators or complementary functionality so that people to not get
>>> confused.
>>>
>>> I'm not trying at all to be negative or anything, just trying to
>>> understand the value added.
>>>
>>> Br's,
>>> Marius
>>>
>>> On May 29, 11:01 am, Oliver Lambert  wrote:
>>> > I'm aware of S.error and my ValidationError uses it when I'm ready to
>>> show
>>> > errors. I've briefly looked at the ValidationFunction and the thing I
>>> might
>>> > stumble on is the errorType which I rely on.
>>> >
>>> > I may be able to refactor the code to use List[FieldError] as I don't
>>> think
>>> > I rely on errorType at this point.
>>> >
>>> > I'll have a go at modifying the Binder code.
>>> >
>>> > cheers
>>> > Oliver
>>> >
>>> > On Fri, May 29, 2009 at 5:05 PM, Marius 
>>> wrote:
>>> >
>>> > > Oliver,
>>> >
>>> > > I very briefly looked on your code and I saw that you have your own
>>> > > validator there. How would that play with the existent validattors
>>> > > that Record has where each field has a list of :
>>> >
>>> > > type ValidationFunction = MyType => Box[Node]
>>> >
>>> > > Note that current MetaRecord's validator after evaluating the
>>> > > validators for each field it yields a List[FieldError] which can be
>>> > > easily naturally used with S.error function to show the error
>>> messages
>>> > > etc.
>>> >
>>> > > Is there a redundancy or complementary functionality?
>>> >
>>> > > Br's,
>>> > > Marius
>>>
>>>
>>
>>
>>
>
>
> --
> Lift, the simply functional web framework http://liftweb.net
> Beginning Scala http://www.apress.com/book/view/1430219890
> Follow me: http://twitter.com/dpp
> Git some: http://github.com/dpp
>
>
> >
>

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



[Lift] Re: Record with the new bind-immutable

2009-05-29 Thread Oliver Lambert
Oh, and I think I now have a better understanding of why David wanted me to
add this to the Record module.

On Fri, May 29, 2009 at 11:32 PM, Oliver Lambert wrote:

> Hi Marius,
> To try and answer your question, I had to go and look at the Record code
> in
> more detail. I hadn't recently written the Binder Validator, so it wasn't
> designed to be
> complementary to anything else (however, some of the naming and methodology
> is very
> similar in both sets of code).
>
> What I found.
> 1) MetaRecord.validate === Binder.validate
> 2) Field.validators === BoundObj.validations
> 3) Field.validationFunction === Validator.validate
> 4) List[FieldError]  === List[ValidationError]
>
> Can I get rid of Binder Validation and just use Record/Field validation?
> It certainly looks like I should try. However, I might have to add/change
> some of the original Lift code.
> For instance, I might want to add an errorType (with a default, so no code
> is broken) to FieldError.
> I might also want to move/change Field.validationFunction so its a little
> more
> like my Validator,with an errorType and toString (When I print my
> validators, the errorType give a little
> information on what they do, rather than just telling me I have a function
> - I also filter using
> the errorType)
>
> Other things of interest that I found.
>
> Could a Binder be a MetaRecord? There are definitely some similarities.
> Binder holds a set of
> immutable objects which can be an advantage, but MetaRecord can talk to
> databases which is
> kind of useful at times.
>
> Could a BoundObj be a Field. Same distinction as above. A BoundObj[T] may
> hold a reference to a string value
> that is completely invalid. I'm not sure I see this in Field.
>
> cheers
> Oliver
>
> On Fri, May 29, 2009 at 6:22 PM, marius d. wrote:
>
>>
>> I see ... still the question remains. What are we going to do with two
>> validators? I'd like to understand the principles of your addition
>> (... I know I should have dig into the code but I don't have much time
>> now).
>>
>> I'd like to understand as I said previously if we have redundant
>> validators or complementary functionality so that people to not get
>> confused.
>>
>> I'm not trying at all to be negative or anything, just trying to
>> understand the value added.
>>
>> Br's,
>> Marius
>>
>> On May 29, 11:01 am, Oliver Lambert  wrote:
>> > I'm aware of S.error and my ValidationError uses it when I'm ready to
>> show
>> > errors. I've briefly looked at the ValidationFunction and the thing I
>> might
>> > stumble on is the errorType which I rely on.
>> >
>> > I may be able to refactor the code to use List[FieldError] as I don't
>> think
>> > I rely on errorType at this point.
>> >
>> > I'll have a go at modifying the Binder code.
>> >
>> > cheers
>> > Oliver
>> >
>> > On Fri, May 29, 2009 at 5:05 PM, Marius 
>> wrote:
>> >
>> > > Oliver,
>> >
>> > > I very briefly looked on your code and I saw that you have your own
>> > > validator there. How would that play with the existent validattors
>> > > that Record has where each field has a list of :
>> >
>> > > type ValidationFunction = MyType => Box[Node]
>> >
>> > > Note that current MetaRecord's validator after evaluating the
>> > > validators for each field it yields a List[FieldError] which can be
>> > > easily naturally used with S.error function to show the error messages
>> > > etc.
>> >
>> > > Is there a redundancy or complementary functionality?
>> >
>> > > 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: Record with the new bind-immutable

2009-05-29 Thread Oliver Lambert
Hi Marius,
To try and answer your question, I had to go and look at the Record code in
more detail. I hadn't recently written the Binder Validator, so it wasn't
designed to be
complementary to anything else (however, some of the naming and methodology
is very
similar in both sets of code).

What I found.
1) MetaRecord.validate === Binder.validate
2) Field.validators === BoundObj.validations
3) Field.validationFunction === Validator.validate
4) List[FieldError]  === List[ValidationError]

Can I get rid of Binder Validation and just use Record/Field validation?
It certainly looks like I should try. However, I might have to add/change
some of the original Lift code.
For instance, I might want to add an errorType (with a default, so no code
is broken) to FieldError.
I might also want to move/change Field.validationFunction so its a little
more
like my Validator,with an errorType and toString (When I print my
validators, the errorType give a little
information on what they do, rather than just telling me I have a function -
I also filter using
the errorType)

Other things of interest that I found.

Could a Binder be a MetaRecord? There are definitely some similarities.
Binder holds a set of
immutable objects which can be an advantage, but MetaRecord can talk to
databases which is
kind of useful at times.

Could a BoundObj be a Field. Same distinction as above. A BoundObj[T] may
hold a reference to a string value
that is completely invalid. I'm not sure I see this in Field.

cheers
Oliver

On Fri, May 29, 2009 at 6:22 PM, marius d.  wrote:

>
> I see ... still the question remains. What are we going to do with two
> validators? I'd like to understand the principles of your addition
> (... I know I should have dig into the code but I don't have much time
> now).
>
> I'd like to understand as I said previously if we have redundant
> validators or complementary functionality so that people to not get
> confused.
>
> I'm not trying at all to be negative or anything, just trying to
> understand the value added.
>
> Br's,
> Marius
>
> On May 29, 11:01 am, Oliver Lambert  wrote:
> > I'm aware of S.error and my ValidationError uses it when I'm ready to
> show
> > errors. I've briefly looked at the ValidationFunction and the thing I
> might
> > stumble on is the errorType which I rely on.
> >
> > I may be able to refactor the code to use List[FieldError] as I don't
> think
> > I rely on errorType at this point.
> >
> > I'll have a go at modifying the Binder code.
> >
> > cheers
> > Oliver
> >
> > On Fri, May 29, 2009 at 5:05 PM, Marius  wrote:
> >
> > > Oliver,
> >
> > > I very briefly looked on your code and I saw that you have your own
> > > validator there. How would that play with the existent validattors
> > > that Record has where each field has a list of :
> >
> > > type ValidationFunction = MyType => Box[Node]
> >
> > > Note that current MetaRecord's validator after evaluating the
> > > validators for each field it yields a List[FieldError] which can be
> > > easily naturally used with S.error function to show the error messages
> > > etc.
> >
> > > Is there a redundancy or complementary functionality?
> >
> > > 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: git ouch

2009-05-29 Thread Oliver Lambert
Thanks for this, wish I'd read it earlier.As a matter of interest, is there
anything else on the committer mailing list that a new committer
should read - and can I read emails posted before I became one?

cheers
Oliver
On Fri, May 29, 2009 at 6:39 PM, Timothy Perrett wrote:

>
> Oliver,
>
> There are detailed instructions on the committer mailing list as to
> how to create a remote branch for lift. For reference, I include them
> here (originally from Mr Weir, so credit to him for being the git
> master!):
>
> **Creating a Remote Branch**
> 1. Create the remote branch
> git push origin origin:refs/heads/new_feature_name
>
> 2. Make sure everything is up-to-date
> git fetch origin
>
> 3. Then you can see that the branch is created.
> git branch -r
>
> * This should show ‘origin/new_feature_name’
>
> 4. Start tracking the new branch
> git checkout --track -b new_feature_name origin/new_feature_name
>
> *This means that when you do pulls that it will get the latest from
> that branch as well.
>
> 5. Make sure everything is up-to-date
> git pull
>
> **Cleaning up Mistakes**
> If you make a mistake you can always delete the remote branch:
> git push origin :heads/new_feature_name
>
> Hope that helps
>
> Cheers, Tim
>
> On May 29, 8:32 am, Heiko Seeberger 
> wrote:
> > Hm, never looked at those images before. But I guess it is OK.
> > Heiko
> >
> > 2009/5/29 Oliver Lambert 
> >
> >
> >
> >
> >
> > > I have a problem with breaking a build on my first attempt of working
> with
> > > git. I'm happy if I haven't, but what was concerning me was in the
> included
> > > image (the network line looks like wip-ol-immu is directly next to
> master,
> > > rather than on a separate branch - if this is normal, Im happy)
> >
> > > On Fri, May 29, 2009 at 4:22 PM, Heiko Seeberger <
> > > heiko.seeber...@googlemail.com> wrote:
> >
> > >> Oliver,
> > >> But that's perfect! What's your problem?
> >
> > >> There is one LOCAL wip-ol-immu branch and one REMOTE. That's how it is
> > >> expected to be for a branch you pushed.
> >
> > >> Heiko
> >
> > >> 2009/5/29 Oliver Lambert 
> >
> > >>  I got that list of commands wrong, what I typed, was
> >
> > >>> git clone g...@github.com:dpp/liftweb.git
> > >>> git branch wip-ol-immu
> > >>> git checkout wip-ol-immu
> > >>> git push origin wip-ol-immu
> >
> > >>> When I do a git branch -a, I get two wip-ol-immu
> > >>>   master
> > >>> * wip-ol-immu
> > >>>   origin/1.0_maint
> > >>>   origin/HEAD
> > >>>   origin/master
> > >>>   origin/new_actor
> > >>>   origin/wip-boolean-can
> > >>>   origin/wip-dcb-derby-binary
> > >>>   origin/wip-dcb-jpa-jta
> > >>>   origin/wip-dcb-jpa-validation
> > >>>   origin/wip-dcb-lift-jpa
> > >>>   origin/wip-dpp-record
> > >>>   origin/wip-marius-dom-optimizations
> > >>>   origin/wip-ol-immu
> > >>>   origin/wip-prettify
> > >>>   origin/wip-record2-dpp
> >
> > --
> > My blog: heikoseeberger.name
> > Follow me: twitter.com/hseeberger
> > OSGi on Scala:www.scalamodules.org
> > Lift, the simply functional web framework: liftweb.net
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to 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: Record with the new bind-immutable

2009-05-29 Thread Oliver Lambert
I'm aware of S.error and my ValidationError uses it when I'm ready to show
errors. I've briefly looked at the ValidationFunction and the thing I might
stumble on is the errorType which I rely on.

I may be able to refactor the code to use List[FieldError] as I don't think
I rely on errorType at this point.

I'll have a go at modifying the Binder code.

cheers
Oliver

On Fri, May 29, 2009 at 5:05 PM, Marius  wrote:

>
> Oliver,
>
> I very briefly looked on your code and I saw that you have your own
> validator there. How would that play with the existent validattors
> that Record has where each field has a list of :
>
> type ValidationFunction = MyType => Box[Node]
>
> Note that current MetaRecord's validator after evaluating the
> validators for each field it yields a List[FieldError] which can be
> easily naturally used with S.error function to show the error messages
> etc.
>
> Is there a redundancy or complementary functionality?
>
> 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: git ouch

2009-05-28 Thread Oliver Lambert
I have a problem with breaking a build on my first attempt of working with
git. I'm happy if I haven't, but what was concerning me was in the included
image (the network line looks like wip-ol-immu is directly next to master,
rather than on a separate branch - if this is normal, Im happy)

On Fri, May 29, 2009 at 4:22 PM, Heiko Seeberger <
heiko.seeber...@googlemail.com> wrote:

> Oliver,
> But that's perfect! What's your problem?
>
> There is one LOCAL wip-ol-immu branch and one REMOTE. That's how it is
> expected to be for a branch you pushed.
>
> Heiko
>
> 2009/5/29 Oliver Lambert 
>
> I got that list of commands wrong, what I typed, was
>>
>> git clone g...@github.com:dpp/liftweb.git
>> git branch wip-ol-immu
>> git checkout wip-ol-immu
>> git push origin wip-ol-immu
>>
>> When I do a git branch -a, I get two wip-ol-immu
>>   master
>> * wip-ol-immu
>>   origin/1.0_maint
>>   origin/HEAD
>>   origin/master
>>   origin/new_actor
>>   origin/wip-boolean-can
>>   origin/wip-dcb-derby-binary
>>   origin/wip-dcb-jpa-jta
>>   origin/wip-dcb-jpa-validation
>>   origin/wip-dcb-lift-jpa
>>   origin/wip-dpp-record
>>   origin/wip-marius-dom-optimizations
>>   origin/wip-ol-immu
>>   origin/wip-prettify
>>   origin/wip-record2-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: git ouch

2009-05-28 Thread Oliver Lambert
I got that list of commands wrong, what I typed, was

git clone g...@github.com:dpp/liftweb.git
git branch wip-ol-immu
git checkout wip-ol-immu
git push origin wip-ol-immu

When I do a git branch -a, I get two wip-ol-immu
  master
* wip-ol-immu
  origin/1.0_maint
  origin/HEAD
  origin/master
  origin/new_actor
  origin/wip-boolean-can
  origin/wip-dcb-derby-binary
  origin/wip-dcb-jpa-jta
  origin/wip-dcb-jpa-validation
  origin/wip-dcb-lift-jpa
  origin/wip-dpp-record
  origin/wip-marius-dom-optimizations
  origin/wip-ol-immu
  origin/wip-prettify
  origin/wip-record2-dpp

On Fri, May 29, 2009 at 3:50 PM, Oliver Lambert  wrote:

> When I look at the liftweb network graph, it looks like I'm working on the
> main liftweb master line and have renamed it.
>
>
> On Fri, May 29, 2009 at 3:38 PM, Derek Chen-Becker 
> wrote:
>
>> I just looked at Git and I show a proper branch there (wip-ol-immu)
>> committed about 30 minutes ago. Are you seeing some error on your end?
>>
>> Derek
>>
>>
>> On Thu, May 28, 2009 at 11:19 PM, Oliver Lambert wrote:
>>
>>> Git wouldn't let me create a branch of liftweb until I deleted and
>>> recreated my ssh keys - I believed all was good.
>>>
>>> I thought I was following the documentation, to create my own branch,
>>> which appeared to be correct on my machine. But, when I just pushed what I
>>> thought was my branch, I appear to have done something wrong. Any help
>>> (without curses) is greatly appreciated at this moment.
>>>
>>> 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: git ouch

2009-05-28 Thread Oliver Lambert
When I look at the liftweb network graph, it looks like I'm working on the
main liftweb master line and have renamed it.

On Fri, May 29, 2009 at 3:38 PM, Derek Chen-Becker wrote:

> I just looked at Git and I show a proper branch there (wip-ol-immu)
> committed about 30 minutes ago. Are you seeing some error on your end?
>
> Derek
>
>
> On Thu, May 28, 2009 at 11:19 PM, Oliver Lambert wrote:
>
>> Git wouldn't let me create a branch of liftweb until I deleted and
>> recreated my ssh keys - I believed all was good.
>>
>> I thought I was following the documentation, to create my own branch,
>> which appeared to be correct on my machine. But, when I just pushed what I
>> thought was my branch, I appear to have done something wrong. Any help
>> (without curses) is greatly appreciated at this moment.
>>
>> 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: git ouch

2009-05-28 Thread Oliver Lambert
The following sequence, without various commits

git clone g...@github.com:dpp/liftweb.git
git branch wip-ol-immugit checkout wip-ol-immu
git checkout wip-ol-immu
git push origin wip-ol-immu

The git network now looks wrong. Where did I stuff up?


On Fri, May 29, 2009 at 3:29 PM, Heiko Seeberger <
heiko.seeber...@googlemail.com> wrote:

> Some more details, please: What git commands did you enter?
>
> 2009/5/29 Oliver Lambert 
>
> Git wouldn't let me create a branch of liftweb until I deleted and
>> recreated my ssh keys - I believed all was good.
>>
>> I thought I was following the documentation, to create my own branch,
>> which appeared to be correct on my machine. But, when I just pushed what I
>> thought was my branch, I appear to have done something wrong. Any help
>> (without curses) is greatly appreciated at this moment.
>>
>> cheers
>> Oliver
>>
>>
>>
>
>
> --
> My blog: heikoseeberger.name
> Follow me: twitter.com/hseeberger
> OSGi on Scala: www.scalamodules.org
> Lift, the simply functional web framework: liftweb.net
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to 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] git ouch

2009-05-28 Thread Oliver Lambert
Git wouldn't let me create a branch of liftweb until I deleted and recreated
my ssh keys - I believed all was good.

I thought I was following the documentation, to create my own branch, which
appeared to be correct on my machine. But, when I just pushed what I thought
was my branch, I appear to have done something wrong. Any help (without
curses) is greatly appreciated at this moment.

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



Re: Fwd: [Lift] Re: immutable bindings

2009-05-28 Thread Oliver Lambert
Hi Tim,

My apologies about the fork vs branch stuff. If my knowledge about git is
correct I don't have permission to create a branch yet, though David has
agreed to make me a committer - maybe after the milestone release tomorrow.

cheers
Oliver

On Wed, May 27, 2009 at 8:01 PM, Timothy Perrett wrote:

>
> Hey Oliver,
>
> Just to clear the confussion (as I was looking on our main github repo
> for your branch), you created a *fork* not a branch (as only
> committers can create branches). For group reference, the repo is
> here:
>
> http://github.com/olambo/liftweb/tree/master
>
> Cheers, tim
>
> On May 27, 10:08 am, Oliver Lambert  wrote:
> > Added immutable binding example application to sites module, in my branch
> > (didn't take long, must have done something right).
>
> >
>

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



Fwd: [Lift] Re: immutable bindings

2009-05-27 Thread Oliver Lambert
Added immutable binding example application to sites module, in my branch
(didn't take long, must have done something right).

-- Forwarded message --
From: Oliver Lambert 
Date: Wed, May 27, 2009 at 4:16 PM
Subject: Re: [Lift] Re: immutable bindings
To: liftweb@googlegroups.com


I've pushed my changes and additions back to my branch, hopefully for all to
see (still learning git). I'll write an example app based on the changes
soon.

cheers
Oliver


On Tue, May 19, 2009 at 9:14 AM, David Pollak  wrote:

> Oliver,
>
> Good stuff... please make sure that your branch is available on the GitHub
> repository for all to see and use.
>
> Thanks,
>
> David
>
>
> On Sat, May 16, 2009 at 1:36 AM, Oliver Lambert wrote:
>
>>
>>
>> On Sat, May 16, 2009 at 4:32 AM, David Pollak <
>> feeder.of.the.be...@gmail.com> wrote:
>>
>>>
>>>
>>> On Thu, May 14, 2009 at 7:43 PM, Oliver Lambert wrote:
>>>
>>>> I've started integrating my immutable bindings, but have some questions
>>>>
>>>> On my build, I've placed the main immutable binding classes in module
>>>> lift webkit under package net.liftweb.http.immu.
>>>> Is that location/name OK?
>>>
>>>
>>> If there's stuff that does not reference other stuff in the http classes,
>>> please put it in net.liftweb.util.  How many classes do you have?  Can we
>>> put it in net.liftweb.record instead?  I'm thinking your work might form the
>>> basis for some of the record stuff.
>>>
>>>
>> I'll put what I can in net.liftweb.util. I guess there are about 10
>> classes, but I'll probably put these in a few files. I like the idea of
>> using net.liftweb.record - I'll start to study the record methodology, also.
>>
>>
>>>>
>>>> I would like to introduce a new set of currency classes, roughly based
>>>> on Martin et al's Currency Zone example in their book. Derek, is using an
>>>> earlier version of it in his JPA example, Ive simplified it a little and
>>>> extended it to include a few different currencies. Is this OK? - I know
>>>> there is a simple currency class already.
>>>
>>>
>>> Sure.  I'm pretty sure the existing currency class in net.liftweb.util is
>>> unused, so if you want to "break" that class, that might be a good place to
>>> put your code.
>>>
>>
>> cool, will do
>>
>>
>>>
>>>> I'm not sure what to do about the mixin binding that I use for html,
>>>> that extends/modifies BindHelpers.
>>>
>>>
>>> Put it in BindHelpers... as long as it doesn't break any of the existing
>>> APIs.
>>>
>>>
>> ok, I might go slowly on this bit.
>>
>>
>>>
>>>> Potentially I could modify BindHelpers, but, should I leave it out for
>>>> now or include it as an optional and separate class in
>>>> net.liftweb.html.immu?
>>>>
>>>> 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
>>>
>>>
>>>
>>
>>
>>
>
>
> --
> 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: immutable bindings

2009-05-26 Thread Oliver Lambert
I've pushed my changes and additions back to my branch, hopefully for all to
see (still learning git). I'll write an example app based on the changes
soon.

cheers
Oliver

On Tue, May 19, 2009 at 9:14 AM, David Pollak  wrote:

> Oliver,
>
> Good stuff... please make sure that your branch is available on the GitHub
> repository for all to see and use.
>
> Thanks,
>
> David
>
>
> On Sat, May 16, 2009 at 1:36 AM, Oliver Lambert wrote:
>
>>
>>
>> On Sat, May 16, 2009 at 4:32 AM, David Pollak <
>> feeder.of.the.be...@gmail.com> wrote:
>>
>>>
>>>
>>> On Thu, May 14, 2009 at 7:43 PM, Oliver Lambert wrote:
>>>
>>>> I've started integrating my immutable bindings, but have some questions
>>>>
>>>> On my build, I've placed the main immutable binding classes in module
>>>> lift webkit under package net.liftweb.http.immu.
>>>> Is that location/name OK?
>>>
>>>
>>> If there's stuff that does not reference other stuff in the http classes,
>>> please put it in net.liftweb.util.  How many classes do you have?  Can we
>>> put it in net.liftweb.record instead?  I'm thinking your work might form the
>>> basis for some of the record stuff.
>>>
>>>
>> I'll put what I can in net.liftweb.util. I guess there are about 10
>> classes, but I'll probably put these in a few files. I like the idea of
>> using net.liftweb.record - I'll start to study the record methodology, also.
>>
>>
>>>>
>>>> I would like to introduce a new set of currency classes, roughly based
>>>> on Martin et al's Currency Zone example in their book. Derek, is using an
>>>> earlier version of it in his JPA example, Ive simplified it a little and
>>>> extended it to include a few different currencies. Is this OK? - I know
>>>> there is a simple currency class already.
>>>
>>>
>>> Sure.  I'm pretty sure the existing currency class in net.liftweb.util is
>>> unused, so if you want to "break" that class, that might be a good place to
>>> put your code.
>>>
>>
>> cool, will do
>>
>>
>>>
>>>> I'm not sure what to do about the mixin binding that I use for html,
>>>> that extends/modifies BindHelpers.
>>>
>>>
>>> Put it in BindHelpers... as long as it doesn't break any of the existing
>>> APIs.
>>>
>>>
>> ok, I might go slowly on this bit.
>>
>>
>>>
>>>> Potentially I could modify BindHelpers, but, should I leave it out for
>>>> now or include it as an optional and separate class in
>>>> net.liftweb.html.immu?
>>>>
>>>> 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
>>>
>>>
>>>
>>
>>
>>
>
>
> --
> 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: Robust and clear ways to do performant JDBC?

2009-05-23 Thread Oliver Lambert
When I want to have user defined types, I have to write them as a Hibernate
hack to JPA - Id rather not be wedded to Hibernate.When I get a collection
out of a returned entity, I have to use JCL to wrap it. I'd rather, have
everything in Scala collections.
When I have a read only entity, I'd like it to be immutable. In fact, maybe
all entities should be, but thats probably too hard.
I'm just taking about the lower layer of JPA that Derek's stuff hooks into -
its OK for Java, it kind of sucks for Scala.

Just my thoughts, don't expect anyone to agree.

cheers
Oliver

On Sat, May 23, 2009 at 9:41 PM, Timothy Perrett wrote:

>
> Lol! Sorry oliver... I remember now :)
>
> What did you have in mind for “scala solution using JPA”? Is this not what
> we have already?
>
> Cheers, Tim
>
>
> On 23/05/2009 12:33, "Oliver Lambert"  wrote:
>
> Yes, I helped with the code!
>
> On Sat, May 23, 2009 at 9:28 PM, Timothy Perrett 
> wrote:
>
>
>
> To what degree are you wanting to re-invent the wheel? Derek has done
> amazing work with JPA and Scala - the resulting output being scala-jpa and
> the jpa archetypes for lift. Are you familiar with them?
>
> Cheers, Tim
>
> On 23/05/2009 11:56, "Oliver Lambert"  wrote:
>
> > JPA is a ORM tool. I think it would be great if someone would create a
> > Scala solution using JPA as the starting point - any takers?
> >
>
>
>
>
>
>
>
>
>
> >
>

--~--~-~--~~~---~--~~
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: Robust and clear ways to do performant JDBC?

2009-05-23 Thread Oliver Lambert
Yes, I helped with the code!

On Sat, May 23, 2009 at 9:28 PM, Timothy Perrett wrote:

>
>
> To what degree are you wanting to re-invent the wheel? Derek has done
> amazing work with JPA and Scala - the resulting output being scala-jpa and
> the jpa archetypes for lift. Are you familiar with them?
>
> Cheers, Tim
>
> On 23/05/2009 11:56, "Oliver Lambert"  wrote:
>
> > JPA is a ORM tool. I think it would be great if someone would create a
> > Scala solution using JPA as the starting point - any takers?
> >
>
>
>
> >
>

--~--~-~--~~~---~--~~
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: Robust and clear ways to do performant JDBC?

2009-05-23 Thread Oliver Lambert
On Sat, May 23, 2009 at 9:53 AM, braver  wrote:

>
> On May 22, 7:06 pm, Timothy Perrett  wrote:
> > Hey there,
> >
> > Is their a particular reason you wouldn't or couldn't use existing java
> > persistence infrastructure inside your scala application? That's the
> > recommended advice right now; JPA (for instance) will slot right into
> your
> > app :-)
>
> Tim -- thanks for the pointer; as I'm coming to JVM solely for Scala,
> I'm learning the acronyms as I go.  So JPA is good for ORM, right?  My


JPA is a ORM tool. I think it would be great if someone would create a
Scala solution using JPA as the starting point - any takers?


>
> problem is not a typical web app, but rather an intensive warehousing
> -- storing something like a web crawl.  It involves maintaining
> workers stuffing XML into the database, and checking whether a record
> is already there.  I plan to first try it with an RDBMS such as
> PostgreSQL, and/or DB2/Oracle if needed, on a multicore Linux server;


Oracle has a highly performant data warehousing solution, but its a little
costly.


>
> if not enough, I'd explore other solutions such as Berkeley DB or
> distributed HBase.  But first I want to see if "just" JDBC is enough,
> and in order to make sure I get it at its most efficient, I'd like to
> see how the pros do it -- preferably with some Scala goodness so it's
> not as verbose as just Java's.  I saw Dave mention JNDI and found DBCP
> and JNDI-DBCP Howto, and wonder whether it's applicable for high-
> performance apps or is primarily for containers like Tomcat where you
> have to maintain the connection across invocations.  For my purely DB-
> stuffing app, I have connections open in each process; the interesting
> question is, can I unleash e.g. 8 actors, for the 8 cores, and
> leverage JNDI-DBCP pool to make it efficient, or should I simply open
> a connection per actor?
>

I'm don't think the JPA database connection pool requires actors. You can
mix and match JPA for the convenience of an ORM with connection pools
and entity caching with JDBC (and/or native JPA queries) when you require
faster raw SQL performance.


>
> Cheers,
> Alexy
>
> >
>

--~--~-~--~~~---~--~~
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: immutable bindings

2009-05-16 Thread Oliver Lambert
On Sat, May 16, 2009 at 4:32 AM, David Pollak  wrote:

>
>
> On Thu, May 14, 2009 at 7:43 PM, Oliver Lambert wrote:
>
>> I've started integrating my immutable bindings, but have some questions
>>
>> On my build, I've placed the main immutable binding classes in module lift
>> webkit under package net.liftweb.http.immu.
>> Is that location/name OK?
>
>
> If there's stuff that does not reference other stuff in the http classes,
> please put it in net.liftweb.util.  How many classes do you have?  Can we
> put it in net.liftweb.record instead?  I'm thinking your work might form the
> basis for some of the record stuff.
>
>
I'll put what I can in net.liftweb.util. I guess there are about 10 classes,
but I'll probably put these in a few files. I like the idea of using
net.liftweb.record - I'll start to study the record methodology, also.


>>
>> I would like to introduce a new set of currency classes, roughly based on
>> Martin et al's Currency Zone example in their book. Derek, is using an
>> earlier version of it in his JPA example, Ive simplified it a little and
>> extended it to include a few different currencies. Is this OK? - I know
>> there is a simple currency class already.
>
>
> Sure.  I'm pretty sure the existing currency class in net.liftweb.util is
> unused, so if you want to "break" that class, that might be a good place to
> put your code.
>

cool, will do


>
>> I'm not sure what to do about the mixin binding that I use for html, that
>> extends/modifies BindHelpers.
>
>
> Put it in BindHelpers... as long as it doesn't break any of the existing
> APIs.
>
>
ok, I might go slowly on this bit.


>
>> Potentially I could modify BindHelpers, but, should I leave it out for now
>> or include it as an optional and separate class in net.liftweb.html.immu?
>>
>> 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: immutable bindings

2009-05-14 Thread Oliver Lambert
I've started integrating my immutable bindings, but have some questions

On my build, I've placed the main immutable binding classes in module lift
webkit under package net.liftweb.http.immu.
Is that location/name OK?

I would like to introduce a new set of currency classes, roughly based on
Martin et al's Currency Zone example in their book. Derek, is using an
earlier version of it in his JPA example, Ive simplified it a little and
extended it to include a few different currencies. Is this OK? - I know
there is a simple currency class already.

I'm not sure what to do about the mixin binding that I use for html, that
extends/modifies BindHelpers.
Potentially I could modify BindHelpers, but, should I leave it out for now
or include it as an optional and separate class in net.liftweb.html.immu?

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

2009-05-11 Thread Oliver Lambert
I've created a git branch, cloned it on my machine and built lift - built in
9 minutes with no errors (1 more tick for maven). Will "go wild" soon.

On Tue, May 12, 2009 at 9:26 AM, David Pollak  wrote:

> Oliver,
>
> Please create a git branch and "go wild" on the branch... once you're
> comfortable with it, please roll the changes into the main branch.
>
> 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: garbage collection

2009-05-08 Thread Oliver Lambert
On Fri, May 8, 2009 at 10:51 PM, David Pollak  wrote:

>
>
> On Fri, May 8, 2009 at 12:49 AM, Oliver Lambert wrote:
>
>>
>>
>> On Fri, May 8, 2009 at 6:51 AM, marius d. wrote:
>>
>>>
>>> Personally I'd be very reluctant exposing that to applications as this
>>> is Lift implementation specific and exposing an API tight to that
>>> leads to unnecessary coupling.
>>>
>>
>> While I don't like unnecessary coupling, either, I do like simple
>> profiling.
>>
>
> We have a Map of names and functions and the functions can be associated
> with particular pages and they have a "last seen" time.  What kind of
> information do you want?  The issue is that the "page association" part of
> the data structure will likely change.  The storage mechanism will likely
> change.  Do you want a call (which will be somewhat expensive) to get a list
> of functions, their opaque ID, and their expected expiration date?
>
>
No, I just want to know how many functions are stored in the session at any
one time. I guess I can "expose" this number myself while Im testing, but I
thought if I want to know this perhaps someone else who isn't currently
using Lift's gc (or is) might what to know this too.

--~--~-~--~~~---~--~~
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: garbage collection

2009-05-08 Thread Oliver Lambert
On Fri, May 8, 2009 at 6:51 AM, marius d.  wrote:

>
> Personally I'd be very reluctant exposing that to applications as this
> is Lift implementation specific and exposing an API tight to that
> leads to unnecessary coupling.
>

While I don't like unnecessary coupling, either, I do like simple profiling.


>
> But why do you really need this? ... just for statistical
> purposes? ... I'm not sure about the relevance of such number.


I want to get an idea about the growth of functions stored in the session.
I
have a idea that might cut the number of functions, under certain
circumstances.


> Br's,
> Marius
>
> On May 7, 10:22 pm, Oliver Lambert  wrote:
> > Any chance of exposing a getter on messageCallback that would return some
> > statistics (the number of functions being stored would be a good starting
> > point)?
> >
> > On Thu, May 7, 2009 at 11:21 PM, marius d. 
> wrote:
> >
> > > Just FYI ...
> >
> > > Things in this area are may change a bit once JQuery fixes the bug
> > > related with namespaces.This was the main reason why we had to deviate
> > > from Dave's original idea of using lift:gc attributes.
> >
> > > Br's,
> > > Marius
> >
> > > On May 7, 3:47 pm, Oliver Lambert  wrote:
> > > > Ah, you mean messageCallback - The joys of private variables.
> > > > thanks again
> > > > Ol
> >
> > > > On Thu, May 7, 2009 at 9:55 PM, marius d. 
> > > wrote:
> >
> > > > > Please see LiftSession.
> >
> > > > > On May 7, 1:41 pm, Oliver Lambert  wrote:
> > > > > > Thanks for this. I would like to look at the code that actually
> holds
> > > the
> > > > > > storage container and profile it. Any pointers on which class to
> look
> > > at
> > > > > s a
> > > > > > starting point?
> > > > > > Ol
> >
> > > > > > On Thu, May 7, 2009 at 7:17 PM, marius d. <
> marius.dan...@gmail.com>
> > > > > wrote:
> >
> > > > > > > In short the current Lift GC is:
> >
> > > > > > > 1. Each page has an ID
> > > > > > > 2. Each mapped function is associated with the page ID
> > > > > > > 3. There are periodical Ajax request sent from the page that
> are
> > > > > > > refreshing the timestamps on the mapped functions
> > > > > > > 4. Mapped functions that exceeded the expiration time are de-
> > > > > > > referenced hence become eligible for garbage collector.
> >
> > > > > > > Br's,
> > > > > > > Marius
> >
> > > > > > > On May 7, 10:15 am, Oliver Lambert 
> wrote:
> > > > > > > > I'm trying to get an understanding how garbage collection is
> > > > > implemented
> > > > > > > in
> > > > > > > > Lift.
> > > > > > > > Any pointers on what scala classes do the actual work?
> >
> > > > > > > > While I'm at it, S.functionMap appears to only return
> functions
> > > that
> > > > > were
> > > > > > > > "recently" bound. Does S._functionMap, contain the functions
> > > being
> > > > > > > garbage
> > > > > > > > collected?
> >
> > > > > > > > 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: garbage collection

2009-05-07 Thread Oliver Lambert
Any chance of exposing a getter on messageCallback that would return some
statistics (the number of functions being stored would be a good starting
point)?

On Thu, May 7, 2009 at 11:21 PM, marius d.  wrote:

>
> Just FYI ...
>
> Things in this area are may change a bit once JQuery fixes the bug
> related with namespaces.This was the main reason why we had to deviate
> from Dave's original idea of using lift:gc attributes.
>
> Br's,
> Marius
>
> On May 7, 3:47 pm, Oliver Lambert  wrote:
> > Ah, you mean messageCallback - The joys of private variables.
> > thanks again
> > Ol
> >
> > On Thu, May 7, 2009 at 9:55 PM, marius d. 
> wrote:
> >
> > > Please see LiftSession.
> >
> > > On May 7, 1:41 pm, Oliver Lambert  wrote:
> > > > Thanks for this. I would like to look at the code that actually holds
> the
> > > > storage container and profile it. Any pointers on which class to look
> at
> > > s a
> > > > starting point?
> > > > Ol
> >
> > > > On Thu, May 7, 2009 at 7:17 PM, marius d. 
> > > wrote:
> >
> > > > > In short the current Lift GC is:
> >
> > > > > 1. Each page has an ID
> > > > > 2. Each mapped function is associated with the page ID
> > > > > 3. There are periodical Ajax request sent from the page that are
> > > > > refreshing the timestamps on the mapped functions
> > > > > 4. Mapped functions that exceeded the expiration time are de-
> > > > > referenced hence become eligible for garbage collector.
> >
> > > > > Br's,
> > > > > Marius
> >
> > > > > On May 7, 10:15 am, Oliver Lambert  wrote:
> > > > > > I'm trying to get an understanding how garbage collection is
> > > implemented
> > > > > in
> > > > > > Lift.
> > > > > > Any pointers on what scala classes do the actual work?
> >
> > > > > > While I'm at it, S.functionMap appears to only return functions
> that
> > > were
> > > > > > "recently" bound. Does S._functionMap, contain the functions
> being
> > > > > garbage
> > > > > > collected?
> >
> > > > > > 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: garbage collection

2009-05-07 Thread Oliver Lambert
Ah, you mean messageCallback - The joys of private variables.
thanks again
Ol

On Thu, May 7, 2009 at 9:55 PM, marius d.  wrote:

>
> Please see LiftSession.
>
> On May 7, 1:41 pm, Oliver Lambert  wrote:
> > Thanks for this. I would like to look at the code that actually holds the
> > storage container and profile it. Any pointers on which class to look at
> s a
> > starting point?
> > Ol
> >
> > On Thu, May 7, 2009 at 7:17 PM, marius d. 
> wrote:
> >
> > > In short the current Lift GC is:
> >
> > > 1. Each page has an ID
> > > 2. Each mapped function is associated with the page ID
> > > 3. There are periodical Ajax request sent from the page that are
> > > refreshing the timestamps on the mapped functions
> > > 4. Mapped functions that exceeded the expiration time are de-
> > > referenced hence become eligible for garbage collector.
> >
> > > Br's,
> > > Marius
> >
> > > On May 7, 10:15 am, Oliver Lambert  wrote:
> > > > I'm trying to get an understanding how garbage collection is
> implemented
> > > in
> > > > Lift.
> > > > Any pointers on what scala classes do the actual work?
> >
> > > > While I'm at it, S.functionMap appears to only return functions that
> were
> > > > "recently" bound. Does S._functionMap, contain the functions being
> > > garbage
> > > > collected?
> >
> > > > 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: garbage collection

2009-05-07 Thread Oliver Lambert
Thanks for this. I would like to look at the code that actually holds the
storage container and profile it. Any pointers on which class to look at s a
starting point?
Ol

On Thu, May 7, 2009 at 7:17 PM, marius d.  wrote:

>
> In short the current Lift GC is:
>
> 1. Each page has an ID
> 2. Each mapped function is associated with the page ID
> 3. There are periodical Ajax request sent from the page that are
> refreshing the timestamps on the mapped functions
> 4. Mapped functions that exceeded the expiration time are de-
> referenced hence become eligible for garbage collector.
>
>
> Br's,
> Marius
>
> On May 7, 10:15 am, Oliver Lambert  wrote:
> > I'm trying to get an understanding how garbage collection is implemented
> in
> > Lift.
> > Any pointers on what scala classes do the actual work?
> >
> > While I'm at it, S.functionMap appears to only return functions that were
> > "recently" bound. Does S._functionMap, contain the functions being
> garbage
> > collected?
> >
> > 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] garbage collection

2009-05-07 Thread Oliver Lambert
I'm trying to get an understanding how garbage collection is implemented in
Lift.
Any pointers on what scala classes do the actual work?

While I'm at it, S.functionMap appears to only return functions that were
"recently" bound. Does S._functionMap, contain the functions being garbage
collected?

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: Where to add demos/examples

2009-05-02 Thread Oliver Lambert
Oh dear, sorry didn't realize I was butting in on committers talk.

On Sat, May 2, 2009 at 11:20 PM, David Pollak  wrote:

>
>
> On Sat, May 2, 2009 at 5:09 AM, Timothy Perrett 
> wrote:
>
>>
>>
>> Heiko,
>>
>> Please see here: http://is.gd/w5SB
>>
>
> +1
>
>
>>
>> We've talked before on the committers list about renaming sites to
>> "examples" or such, so I see no reason why putting any working example you
>> want in there. POC would probably be a different matter... If its not
>> working code, host it on your own github account then when its working
>> potentially move it into examples if appropriate.
>>
>> Cheers, Tim
>>
>>
>>
>> On 02/05/2009 12:53, "Oliver Lambert"  wrote:
>>
>> > Interesting idea, perhaps you could get the examples hosted on the lift
>> demo
>> > website too.
>> >
>> > Oliver
>> >
>> > On Sat, May 2, 2009 at 7:48 PM, Heiko Seeberger
>> >  wrote:
>> >> Hi,
>> >>
>> >> I would like to add demo/example (well, also POC) projects to the
>> repository.
>> >> Where would be the right place?
>> >>
>> >> 1. Into the repository root
>> >> 2. Into a lift-examples module
>> >> 3. Other alternatives?
>> >>
>> >> I think I would like to go for lift-examples and maybe have nested
>> modules
>> >> there, e.g.
>> >> lift-examples
>> >>   lift-examples-osgi
>> >> lift-examples-osgi-hello
>> >> ...
>> >>
>> >> What do you think?
>> >>
>> >> Heiko
>>
>>
>>
>>
>>
>
>
> --
> 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: Where to add demos/examples

2009-05-02 Thread Oliver Lambert
Interesting idea, perhaps you could get the examples hosted on the lift demo
website too.
Oliver

On Sat, May 2, 2009 at 7:48 PM, Heiko Seeberger <
heiko.seeber...@googlemail.com> wrote:

> Hi,
> I would like to add demo/example (well, also POC) projects to the
> repository. Where would be the right place?
>
> 1. Into the repository root
> 2. Into a lift-examples module
> 3. Other alternatives?
>
> I think I would like to go for lift-examples and maybe have nested modules
> there, e.g.
> lift-examples
>   lift-examples-osgi
> lift-examples-osgi-hello
> ...
>
> What do you think?
>
> Heiko
> --
> www.heikoseeberger.name
> OSGi on Scala: www.scalamodules.org
> Lift, the simply functional web framework: http://liftweb.net
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
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: immutable bindings

2009-04-30 Thread Oliver Lambert
I just realized, I removed the header comments to the classes under the
package scalame and had removed credit to Lift for SBind (modifying Bind).
 My apologies, and I understand my code is nowhere near as well written as
the original.

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

2009-04-25 Thread Oliver Lambert
Sorry, I didn't get back sooner - too much work!
No one told me I couldn't do this so I just did it. Create a dummy entity to
a table/view that doesn't exist - then write a query that uses column
aliases and any arbitrary sql to populate that entity. I guess JPA/Hibernate
is just creating an instance of a class and then calling a bunch of setters.

Other times, I've dumped all the hard work on Oracle programmers, getting
them to create a set of read only views and created entities on them, but I
guess thats less weird.

I've also done a similar thing in using formal constructors via hibernate's
report queries, but thats more work and I'm lazy.

cheers Oliver

On Fri, Apr 24, 2009 at 6:11 AM, Derek Chen-Becker wrote:

> Oliver, I've never done anything like that in JPA or Hibernate. Is that
> actually possible? Can you "create" a class instance within a query?
>
> Derek
>
>
> On Thu, Apr 23, 2009 at 2:47 PM, Charles F. Munat  wrote:
>
>>
>> I'm not really sure how I would go about this, but I'll think about it
>> when I have time to get back to that code.
>>
>> Thanks, Oliver.
>>
>> Chas.
>>
>> Oliver Lambert wrote:
>> > Is there anything to stop you defining an class/entity {answer: String,
>> > countAnswer: Int} and to directly create it from JPA (of course, it's
>> > read only).
>> >
>> > On Wed, Apr 22, 2009 at 9:36 AM, Charles F. Munat > > <mailto:c...@munat.com>> wrote:
>> >
>> >
>> > I was thinking tuples, but that didn't work. I'll try your
>> suggestion.
>> > BTW, for anyone reading along, I forgot the group by clause in the
>> query
>> > below.
>> >
>> > Chas.
>> >
>> > Derek Chen-Becker wrote:
>> >  > I think that the type would be Array[Any] and you'll get one
>> > String and
>> >  > Int for each row.
>> >  >
>> >  > Derek
>> >  >
>> >  > On Tue, Apr 21, 2009 at 3:37 PM, Charles F. Munat <
>> c...@munat.com
>> > <mailto:c...@munat.com>
>> >  > <mailto:c...@munat.com <mailto:c...@munat.com>>> wrote:
>> >  >
>> >  >
>> >  > Anyone have a quick example of how to run a scalar query in
>> > JPA? I can't
>> >  > find anything in the JPA demo.
>> >  >
>> >  > I have this query:
>> >  >
>> >  > select t.answer, count(distinct answer) from Vote t where
>> > t.poll = :poll
>> >  > order by t.answer
>> >  >
>> >  > but how do I call it? I normally do:
>> >  >
>> >  > Model.createNamedQuery[...]("findVoteCountAnswersByPoll",
>> > "poll" ->
>> >  > poll).findAll
>> >  >
>> >  > But what is the type? And how do I get the results back out?
>> >  >
>> >  > I know I did this once before somewhere, but I can't remember
>> > where and
>> >  > I can't find it.
>> >  >
>> >  > Thanks!
>> >  >
>> >  > Chas.
>> >  >
>> >  >
>> >  >
>> >  >
>> >  > >
>> >
>> >
>> >
>> >
>> > >
>>
>>
>>
>
> >
>

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



[Lift] Re: scalar queries in Lift/JPA

2009-04-23 Thread Oliver Lambert
Is there anything to stop you defining an class/entity {answer: String,
countAnswer: Int} and to directly create it from JPA (of course, it's read
only).

On Wed, Apr 22, 2009 at 9:36 AM, Charles F. Munat  wrote:

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

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



[Lift] Re: stateful vs stateless snippet

2009-04-13 Thread Oliver Lambert
On Mon, Apr 13, 2009 at 4:35 AM, David Pollak  wrote:

>
>
> On Sun, Apr 12, 2009 at 7:30 AM, Oliver Lambert wrote:
>
>>
>>
>> On Sun, Apr 12, 2009 at 11:04 PM, David Pollak <
>> feeder.of.the.be...@gmail.com> wrote:
>>
>>>
>>>
>>> On Sun, Apr 12, 2009 at 5:29 AM, Oliver Lambert wrote:
>>>
>>>>
>>>>
>>>> On Sun, Apr 12, 2009 at 3:49 PM, marius d. wrote:
>>>>
>>>>>
>>>>> As I said you CAN use it to "span" the same snippet instance for
>>>>> multiple pages. Please see the two fundamental functions offered by
>>>>> StatefulSnippet: link and redirect. Lift book provided correct
>>>>> information.
>>>>>
>>>>
>>>> It can be used, but doesn't always give the same instance when the back
>>>> button is used?
>>>> Therefore, all my fields are reset to null. Is this the expected
>>>> functionality, or a bug (my code or Lift's)?
>>>> I am using Stateful link and redirect and the application works fine,
>>>> apart from the back button.
>>>>
>>>
>>> If you're using the back button and you're presenting forms to the user,
>>> what you're seeing is the expected (perhaps not desired) behavior.
>>>
>>> In order to figure out which stateful snippet is being used, Lift either
>>> inserts a hidden field on the form or adds a parameter to the link URL.  In
>>> both cases, these hidden items refer to a function that binds the instance
>>> of the stateful snippet to the name of the snippet so that the same instance
>>> will be used.  If you press the back button and a URL does not have the
>>> query parameter, there's no way for Lift to know which instance of the
>>> stateful snippet to attach to the particular snippet name and Lift creates a
>>> new one.
>>>
>>> More broadly, I opted to not have ugly URLs in Lift.  Seaside and other
>>> frameworks that are more stateful than Lift have to put a token in the URL
>>> indicating the state of the application for that particular URL.  This
>>> allows you to have multiple instances of a given multi-page form going at
>>> the same time, all with back-button support.  The cost is ugly URLs and the
>>> inability to send a given URL to a friend (because the state information is
>>> part of the URL.)  In Seaside, you have to specify that a particular URL is
>>> durable and it's not uglified.  In Lift, by default, the URLs are pretty and
>>> stateless.
>>>
>>> So, you've found a corner case of the downside of this choice.  I'm
>>> hoping to add wizard functionality to Lift for 1.1 (although it's not on the
>>> official schedule) and that would give you better statefulness, ugly URLs,
>>> and better back-button support.
>>>
>>> Thanks,
>>>
>>> David
>>>
>>>
>> Thanks, for explaining the functionality. I was just asked by my boss to
>> ask a question, I'm not criticizing Lift for having the occasional corner
>> case I don't expect. The fix for the application I'm currently working on is
>> to use sessionVars, the occasional requestVar and to remove statefulSnippets
>> - probably several hours work.
>>
>
> Cool.
>
>
>>
>> In fact, I think I appreciate the design of lift for its flexibility.
>> While I use the function binding of Lift, I've abstracted part of it away,
>> so much of my code is automatically dealing with immutable objects. Maybe my
>> one criticism of Lift is - it almost offers too much choice.
>>
>
> Yeah.  Rails and Mac are both great and having one true way.  Windows gives
> you the "choose what you like."  In general, Mac apps feel more uniform and
> better than Windows apps.
>

Mac apps often look more professional too - which is kind of funny
considering their market.


>
> More broadly, I'd like to see how you do more immutable stuff within the
> context of Lift.  I'm still uncomfortable about the the amount of mutability
> floating around in Lift.
>

Great, I'll create an example project using the methodology I'm using this
week.


> Thanks,
>
> David
>
>
>>
>> cheers
>> Oliver
>>
>>>
>>>>
>>>>>
>>>>>
>>>>> On Apr 12, 5:44 am, Oliver Lambert  wrote:
>>>>> > On Sun, Apr 12, 2009 at 7:14 AM, marius d. 
>>>>> wrote:

[Lift] Re: stateful vs stateless snippet

2009-04-12 Thread Oliver Lambert
On Sun, Apr 12, 2009 at 11:04 PM, David Pollak <
feeder.of.the.be...@gmail.com> wrote:

>
>
> On Sun, Apr 12, 2009 at 5:29 AM, Oliver Lambert wrote:
>
>>
>>
>> On Sun, Apr 12, 2009 at 3:49 PM, marius d. wrote:
>>
>>>
>>> As I said you CAN use it to "span" the same snippet instance for
>>> multiple pages. Please see the two fundamental functions offered by
>>> StatefulSnippet: link and redirect. Lift book provided correct
>>> information.
>>>
>>
>> It can be used, but doesn't always give the same instance when the back
>> button is used?
>> Therefore, all my fields are reset to null. Is this the expected
>> functionality, or a bug (my code or Lift's)?
>> I am using Stateful link and redirect and the application works fine,
>> apart from the back button.
>>
>
> If you're using the back button and you're presenting forms to the user,
> what you're seeing is the expected (perhaps not desired) behavior.
>
> In order to figure out which stateful snippet is being used, Lift either
> inserts a hidden field on the form or adds a parameter to the link URL.  In
> both cases, these hidden items refer to a function that binds the instance
> of the stateful snippet to the name of the snippet so that the same instance
> will be used.  If you press the back button and a URL does not have the
> query parameter, there's no way for Lift to know which instance of the
> stateful snippet to attach to the particular snippet name and Lift creates a
> new one.
>
> More broadly, I opted to not have ugly URLs in Lift.  Seaside and other
> frameworks that are more stateful than Lift have to put a token in the URL
> indicating the state of the application for that particular URL.  This
> allows you to have multiple instances of a given multi-page form going at
> the same time, all with back-button support.  The cost is ugly URLs and the
> inability to send a given URL to a friend (because the state information is
> part of the URL.)  In Seaside, you have to specify that a particular URL is
> durable and it's not uglified.  In Lift, by default, the URLs are pretty and
> stateless.
>
> So, you've found a corner case of the downside of this choice.  I'm hoping
> to add wizard functionality to Lift for 1.1 (although it's not on the
> official schedule) and that would give you better statefulness, ugly URLs,
> and better back-button support.
>
> Thanks,
>
> David
>
>
Thanks, for explaining the functionality. I was just asked by my boss to ask
a question, I'm not criticizing Lift for having the occasional corner case I
don't expect. The fix for the application I'm currently working on is to use
sessionVars, the occasional requestVar and to remove statefulSnippets -
probably several hours work.

In fact, I think I appreciate the design of lift for its flexibility. While
I use the function binding of Lift, I've abstracted part of it away, so much
of my code is automatically dealing with immutable objects. Maybe my
one criticism of Lift is - it almost offers too much choice.

cheers
Oliver

>
>>
>>>
>>>
>>> On Apr 12, 5:44 am, Oliver Lambert  wrote:
>>> > On Sun, Apr 12, 2009 at 7:14 AM, marius d. 
>>> wrote:
>>> >
>>> > > The StatefulSnippet is not a snippet instance that is always used in
>>> > > the context of your session.
>>> >
>>> > Yikes! in that case, I wrote a whole application based on false
>>> assumption.
>>> > It says in the lift book
>>> > a StatefulSnippet is "ideal for small, conversational state, such as a
>>> form
>>> > that spans multiple pages"
>>> > If it spans multiple pages, doesn't this kind of imply the same
>>> instance in
>>> > the session?
>>> >
>>> > Anyway thanks for this info. Any reason why a StatefulSnippet always
>>> has a
>>> > dispatch function and
>>> > a Stateless one, by default, has not?
>>>
>>> The reason that I see ...
>>> Stateless snippets are the most used artifacts to "attach" business
>>> logic to your view. Because it is so common besides DispatchSnippet
>>> trait, Lift loads and invoke Snippets functions using reflection.
>>> Since discriminating at runtime between a stateless and a stateful
>>> requires a trait (forget about annotations for now) well that trait is
>>> StatefulSnippet.
>>>
>>>
>>> >
>>> > to avoid RequestVar-s but keep state for current rendering pipeline in

[Lift] Re: stateful vs stateless snippet

2009-04-12 Thread Oliver Lambert
On Sun, Apr 12, 2009 at 3:49 PM, marius d.  wrote:

>
> As I said you CAN use it to "span" the same snippet instance for
> multiple pages. Please see the two fundamental functions offered by
> StatefulSnippet: link and redirect. Lift book provided correct
> information.
>

It can be used, but doesn't always give the same instance when the back
button is used?
Therefore, all my fields are reset to null. Is this the expected
functionality, or a bug (my code or Lift's)?
I am using Stateful link and redirect and the application works fine, apart
from the back button.


>
>
> On Apr 12, 5:44 am, Oliver Lambert  wrote:
> > On Sun, Apr 12, 2009 at 7:14 AM, marius d. 
> wrote:
> >
> > > The StatefulSnippet is not a snippet instance that is always used in
> > > the context of your session.
> >
> > Yikes! in that case, I wrote a whole application based on false
> assumption.
> > It says in the lift book
> > a StatefulSnippet is "ideal for small, conversational state, such as a
> form
> > that spans multiple pages"
> > If it spans multiple pages, doesn't this kind of imply the same instance
> in
> > the session?
> >
> > Anyway thanks for this info. Any reason why a StatefulSnippet always has
> a
> > dispatch function and
> > a Stateless one, by default, has not?
>
> The reason that I see ...
> Stateless snippets are the most used artifacts to "attach" business
> logic to your view. Because it is so common besides DispatchSnippet
> trait, Lift loads and invoke Snippets functions using reflection.
> Since discriminating at runtime between a stateless and a stateful
> requires a trait (forget about annotations for now) well that trait is
> StatefulSnippet.
>
>
> >
> > to avoid RequestVar-s but keep state for current rendering pipeline in
> >
> > > the snippet.
> > > 2. You can indicate that you want to reuse the same instance across
> > > multiple pages using link or redirectTo functions from the
> > > StatefulSnippet
> >
> > > So depending what you want to doyou can use the statefull or stateless
> > > nature of snippets. For stateless snippets you can just declare the
> > > class and the method and just use it. Such as:
> >
> > > class Foo {
> >
> > >  def bar(xml: NodeSeq) :NodeSeq = ...
> > > }
> >
> > > .. and in your markup
> >
> > > 
> >
> > > you can also say
> >
> > > class Foo  extends DispatchSniuppet {
> >
> > >   def dispatch = ...
> > > }
> >
> > > which is also a stateless snippet.
> >
> > > Br's,
> > > Marius
> >
> > > On Apr 11, 7:21 am, Oliver Lambert  wrote:
> > > > I have a stateful snippet that doesn't always appear to work with the
> > > back
> > > > button.
> > > > Sometimes, when the back button is used, a new stateful snippet
> instance
> > > > appears to be created. Has this happened to anyone else?
> >
> > > > Anyway, I've converted what I had to use a SessionVar to store the
> state.
> > > > Should I replace the stateful snippet with a stateless one - does a
> > > stateful
> > > > snippet that isn't storing any state have any extra overhead over a
> > > > stateless one?
> >
> > > > If I do use a stateless snipet can I still have a dispatch method?
> >
> > > > 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: JPA or JDO best for us on Google App Engine?

2009-04-11 Thread Oliver Lambert
On Sun, Apr 12, 2009 at 2:54 PM, David Pollak  wrote:

>
>
> On Sat, Apr 11, 2009 at 8:36 PM, mal3  wrote:
>
>>
>> We are going to use the Google App Engine (GAE) for our app using GWT
>> with the new Google GWT Eclipse plugin support.
>>
>> Our Scala and Lift skills are not up to the task of doing it in Lift
>> right now.
>> Once we have Exploring Lift and Beginning Scala books in our hot
>> little hands in May, we will begin to port the app over to Lift.
>>
>> We need to choose between JPA and JDO. Which is the best choice
>> in anticipation of using Lift on GAE in a couple of months time?
>>  So far as I can see, Lift supports JPA but not JDO.
>
>
> Lift supports either.  Lift is persistence agnostic.  Lift has a module,
> mapper, that has JDBC support.  Derek and Co. have built some nice
> JPA archetypes, but you can use JDO to your heart's content with Lift.
>

But there are no JDO examples while there are JPA and mapper ones.


>
>>
>> Mal.
>>
>>
>>
>
>
> --
> 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: stateful vs stateless snippet

2009-04-11 Thread Oliver Lambert
On Sun, Apr 12, 2009 at 7:14 AM, marius d.  wrote:

>
> The StatefulSnippet is not a snippet instance that is always used in
> the context of your session.
>

Yikes! in that case, I wrote a whole application based on false assumption.
It says in the lift book
a StatefulSnippet is "ideal for small, conversational state, such as a form
that spans multiple pages"
If it spans multiple pages, doesn't this kind of imply the same instance in
the session?

Anyway thanks for this info. Any reason why a StatefulSnippet always has a
dispatch function and
a Stateless one, by default, has not?


to avoid RequestVar-s but keep state for current rendering pipeline in
> the snippet.
> 2. You can indicate that you want to reuse the same instance across
> multiple pages using link or redirectTo functions from the
> StatefulSnippet
>
> So depending what you want to doyou can use the statefull or stateless
> nature of snippets. For stateless snippets you can just declare the
> class and the method and just use it. Such as:
>
> class Foo {
>
>  def bar(xml: NodeSeq) :NodeSeq = ...
> }
>
> .. and in your markup
>
> 
>
> you can also say
>
> class Foo  extends DispatchSniuppet {
>
>   def dispatch = ...
> }
>
> which is also a stateless snippet.
>
> Br's,
> Marius
>
> On Apr 11, 7:21 am, Oliver Lambert  wrote:
> > I have a stateful snippet that doesn't always appear to work with the
> back
> > button.
> > Sometimes, when the back button is used, a new stateful snippet instance
> > appears to be created. Has this happened to anyone else?
> >
> > Anyway, I've converted what I had to use a SessionVar to store the state.
> > Should I replace the stateful snippet with a stateless one - does a
> stateful
> > snippet that isn't storing any state have any extra overhead over a
> > stateless one?
> >
> > If I do use a stateless snipet can I still have a dispatch method?
> >
> > 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] stateful vs stateless snippet

2009-04-10 Thread Oliver Lambert
I have a stateful snippet that doesn't always appear to work with the back
button.
Sometimes, when the back button is used, a new stateful snippet instance
appears to be created. Has this happened to anyone else?

Anyway, I've converted what I had to use a SessionVar to store the state.
Should I replace the stateful snippet with a stateless one - does a stateful
snippet that isn't storing any state have any extra overhead over a
stateless one?

If I do use a stateless snipet can I still have a dispatch method?

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: Lift AJAX and IE6

2009-04-09 Thread Oliver Lambert
On Thu, Apr 9, 2009 at 11:03 PM, David Pollak  wrote:

>
>
> On Thu, Apr 9, 2009 at 4:35 AM, olambo  wrote:
>
>>
>>
>> >
>> > > Also, is the Lift AJAX script necessary for anything other than Comet?
>> > > If I have a site that's using no AJAX or Comet, can I just turn this
>> > > off? If so, how?
>> >
>> > No... it's also used for Garbage Collection. :-(
>>
>> I've also noticed this running. Is this Garbage Collection of
>> javascript or a call to the JVM?
>
>
> Lift stores a mapping between GUIDs it assigns to HTML elements on the
> client to functions to execute when those elements are processed by the
> server.  For example:
>
> SHtml.text("", s => println("The text box was "+s))
>
> The function (s => println("The text box was "+s)) is stored on the server.
>  The  tag has a GUID that binds the HTML element to
> the function.  If the HTML element is not on the client any more, the
> reference to the function should be dropped so it's not using resources.
>  This is garbage collection.  It is not JVM garbage collection, but it is
> removal of unused references.
>
>
I can see that it needs to remove unused references, but why in an ajax
call, why not as part of the lift request lifecycle? If the client has
closed the browser the ajax call isn't going to be called anyway. Why would
a single HTML element in a single client response have disappeared (heavy
use of ajax and javascript?).

Now why is lift saving references - obviously to support the next request
from the current page, which might involve the back button (and
subsequently, the forward button). So in my mind, I should be able to
specify I want the last N back button calls supported and any functions
older than that get dropped from the reference map. But obviously this isn't
whats happening, because an ajax call to do it, makes no sense (assuming I
have no javascript and no ajax calls).

So what references are being removed and why ajax to remove them?


>
>>
>>
>>
>>
>>
>
>
> --
> 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] maven scala plugin

2009-02-18 Thread Oliver

Hi,
I know its not exactly a lift specific problem, but

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

This creates a pom.xml with 2.7.3 as the version of Scala - Everything
appears fine.
I add a variable that uses an Enumeration and use the new valueOf method.

When I open the project in netbeans, it says the valueOf method doesnt
exist, but when I do a mvn clean build, everything is happy
When I extend an Enumeration and define a valueOf method (without
overriding it) maven fails at the test stage, saying I need to
override
When I override the valueOf method, maven fails at the compilation
stage, saying valueOf is not defined in the parent

Any ideas what the maven scala plugin is doing?

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

2009-02-12 Thread Oliver

If you could that would be great!

On Fri, Feb 13, 2009 at 10:55 AM, Jorge Ortiz  wrote:
>
> One of the projects I keep putting off is to extract Lift's templating
> system into a component that could be used as a stand-alone library. If this
> is something you'd be interested in, let me know and I'll try to prioritize
> it.
>
>> 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] thanks

2009-02-12 Thread Oliver

Thanks for all the help and support over the last few months. During
that time, I've developed several
Lift applications that are now successfully running in production at
the company I work for.

One of the things that has impressed me is the community spirit of the
group.  I've had pretty much
all my questions answered and problems fixed very quickly. This gave
me confidence to push the
adoption of the framework.

I haven't always agreed with some of the design decisions in Lift, but
that's true of any framework. I bet
even a framework founder doesn't like everything about it.  Anyway
sometimes programmers have to agree
to disagree.

I now find myself in the position of having to consider Slinky as an
alternative to Lift. This brings up
questions in my mind about community, support and maturity.  I'm not
willing to let go of Lift's
xhtml templating paradigm, so I can see some interesting discussions ahead.

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: *** BREAKING CHANGES ***

2009-02-10 Thread Oliver

My apologies, it works as shown by your code and in the way Jorge
described. I had changed simply cut and pasted Marius's example
and deleted it when it didn't work. Then I changed my own code without
modifying the case statement correctly. Sometimes I can't
add 1 + 1

On Wed, Feb 11, 2009 at 10:26 AM, David Pollak
 wrote:
>
>
> On Tue, Feb 10, 2009 at 3:13 PM, Oliver  wrote:
>>
>> I've just updated my code to rely on the stable version of lift 0.10
>> rather than an earlier snapshot.
>> Unfortunately the removal of LiftRules.logAndReturnExceptionToBrowser
>> and non working status of
>> LiftRules.exceptionHandler.prepend means my choices now are
>>
>> 1) To back out my reliance on the stable version of lift 0.10
>> 2) To look at the source code for lift and try to figure out the problem
>> 3) To remove my applications reliance on this code
>
> I just inserted:
>
> LiftRules.exceptionHandler.prepend {
>   case (mode, state, ex) => RedirectResponse("/error")
> }
>
> Into Boot.scala in a newly created Lift 0.10 app.  It worked without
> complaint.
>
> Please try doing an mvn -U clean install and see if that works.  I'm also
> happy to look at your source off-list to see if I can puzzle through the
> problem.
>
> And, yes the API changes are going to be minimal from here on out.
>
>>
>> I am going to be glad when Lift gets to version 1.0, because
>> presumably there will be less breaking changes (I hope)
>>
>> On Wed, Feb 11, 2009 at 9:58 AM, Oliver  wrote:
>> > Doesn't look right and If I do this I get the following error -
>> > constructor cannot be instantiated to the expected type
>> >
>> > On Tue, Feb 10, 2009 at 8:57 PM, Jorge Ortiz 
>> > wrote:
>> >> Try (without the = sign):
>> >>
>> >> LiftRules.exceptionHandler.prepend {
>> >>case (mode, state, ex) => RedirectResponse("/error")
>> >> }
>> >> --j
>> >>
>> >> On Mon, Feb 9, 2009 at 10:47 PM, Oliver  wrote:
>> >>>
>> >>> If I try to use the following, I get a reassignment to Val error - any
>> >>> ideas?
>> >>>
>> >>> LiftRules.exceptionHandler.prepend = {
>> >>>case (mode, state, ex) => RedirectResponse("/error")
>> >>> }
>> >>>
>> >>> On Wed, Dec 24, 2008 at 5:41 AM, Marius 
>> >>> wrote:
>> >>> >
>> >>> > Folks,
>> >>> >
>> >>> > I just committed a couple of changes that may impact your
>> >>> > application.
>> >>> >
>> >>> > 1. LiftRules.logAndReturnExceptionToBrowser and
>> >>> > LiftRules.browserResponseToException have been removed. These were
>> >>> > two
>> >>> > different variables that did pretty much the same thing in fact the
>> >>> > first ultimately called the former. These have been replaced with:
>> >>> >
>> >>> >
>> >>> > var exceptionHandler = RulesSeq[ExceptionHandlerPF]
>> >>> >
>> >>> > having
>> >>> >
>> >>> > type ExceptionHandlerPF = PartialFunction[(Props.RunModes.Value,
>> >>> > Req,
>> >>> > Throwable), LiftResponse]
>> >>> >
>> >>> > By default a partial function is appended and it is the same code
>> >>> > that
>> >>> > used to be for LiftRules.browserResponseToException.
>> >>> >
>> >>> > So up until now probably your application was using something like:
>> >>> >
>> >>> > LiftRules.logAndReturnExceptionToBrowser = {
>> >>> >case (state, ex) => RedirectResponse("/error")
>> >>> > }
>> >>> >
>> >>> > now this turns into:
>> >>> >
>> >>> > LiftRules.exceptionHandler.prepend = {
>> >>> >case (mode, state, ex) => RedirectResponse("/error")
>> >>> > }
>> >>> >
>> >>> >
>> >>> > 2. More unification of Ajax notices with "static" notices. So far to
>> >>> > apply styling information (css classes etc) to Ajax notices we used
>> >>> > three LiftRules variables:
>> >>> >
>> >>> >  var ajaxNoticeMeta: Can[Aj

[Lift] Re: *** BREAKING CHANGES ***

2009-02-10 Thread Oliver

I've just updated my code to rely on the stable version of lift 0.10
rather than an earlier snapshot.
Unfortunately the removal of LiftRules.logAndReturnExceptionToBrowser
and non working status of
LiftRules.exceptionHandler.prepend means my choices now are

1) To back out my reliance on the stable version of lift 0.10
2) To look at the source code for lift and try to figure out the problem
3) To remove my applications reliance on this code

I am going to be glad when Lift gets to version 1.0, because
presumably there will be less breaking changes (I hope)

On Wed, Feb 11, 2009 at 9:58 AM, Oliver  wrote:
> Doesn't look right and If I do this I get the following error -
> constructor cannot be instantiated to the expected type
>
> On Tue, Feb 10, 2009 at 8:57 PM, Jorge Ortiz  wrote:
>> Try (without the = sign):
>>
>> LiftRules.exceptionHandler.prepend {
>>case (mode, state, ex) => RedirectResponse("/error")
>> }
>> --j
>>
>> On Mon, Feb 9, 2009 at 10:47 PM, Oliver  wrote:
>>>
>>> If I try to use the following, I get a reassignment to Val error - any
>>> ideas?
>>>
>>> LiftRules.exceptionHandler.prepend = {
>>>case (mode, state, ex) => RedirectResponse("/error")
>>> }
>>>
>>> On Wed, Dec 24, 2008 at 5:41 AM, Marius  wrote:
>>> >
>>> > Folks,
>>> >
>>> > I just committed a couple of changes that may impact your application.
>>> >
>>> > 1. LiftRules.logAndReturnExceptionToBrowser and
>>> > LiftRules.browserResponseToException have been removed. These were two
>>> > different variables that did pretty much the same thing in fact the
>>> > first ultimately called the former. These have been replaced with:
>>> >
>>> >
>>> > var exceptionHandler = RulesSeq[ExceptionHandlerPF]
>>> >
>>> > having
>>> >
>>> > type ExceptionHandlerPF = PartialFunction[(Props.RunModes.Value, Req,
>>> > Throwable), LiftResponse]
>>> >
>>> > By default a partial function is appended and it is the same code that
>>> > used to be for LiftRules.browserResponseToException.
>>> >
>>> > So up until now probably your application was using something like:
>>> >
>>> > LiftRules.logAndReturnExceptionToBrowser = {
>>> >case (state, ex) => RedirectResponse("/error")
>>> > }
>>> >
>>> > now this turns into:
>>> >
>>> > LiftRules.exceptionHandler.prepend = {
>>> >case (mode, state, ex) => RedirectResponse("/error")
>>> > }
>>> >
>>> >
>>> > 2. More unification of Ajax notices with "static" notices. So far to
>>> > apply styling information (css classes etc) to Ajax notices we used
>>> > three LiftRules variables:
>>> >
>>> >  var ajaxNoticeMeta: Can[AjaxMessageMeta]
>>> >  var ajaxWarningMeta: Can[AjaxMessageMeta]
>>> >  var ajaxErrorMeta: Can[AjaxMessageMeta]
>>> >
>>> > the motivation was that in order for Lift to send down the correct
>>> > style information for Ajax/Comet notices it needed to maintain this
>>> > information. Now I finally found time to do it. The above variables
>>> > are gone. Instead the same styling information that you use for
>>> > lift:msgs and lift:msg snippets will be applied for AJax and Comet
>>> > notices. The styling information is captured when these snippets are
>>> > executed and used whenever you're using notices for AJax response or
>>> > from a Comet actor.
>>> >
>>> >
>>> > 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: *** BREAKING CHANGES ***

2009-02-10 Thread Oliver

Doesn't look right and If I do this I get the following error -
constructor cannot be instantiated to the expected type

On Tue, Feb 10, 2009 at 8:57 PM, Jorge Ortiz  wrote:
> Try (without the = sign):
>
> LiftRules.exceptionHandler.prepend {
>case (mode, state, ex) => RedirectResponse("/error")
> }
> --j
>
> On Mon, Feb 9, 2009 at 10:47 PM, Oliver  wrote:
>>
>> If I try to use the following, I get a reassignment to Val error - any
>> ideas?
>>
>> LiftRules.exceptionHandler.prepend = {
>>case (mode, state, ex) => RedirectResponse("/error")
>> }
>>
>> On Wed, Dec 24, 2008 at 5:41 AM, Marius  wrote:
>> >
>> > Folks,
>> >
>> > I just committed a couple of changes that may impact your application.
>> >
>> > 1. LiftRules.logAndReturnExceptionToBrowser and
>> > LiftRules.browserResponseToException have been removed. These were two
>> > different variables that did pretty much the same thing in fact the
>> > first ultimately called the former. These have been replaced with:
>> >
>> >
>> > var exceptionHandler = RulesSeq[ExceptionHandlerPF]
>> >
>> > having
>> >
>> > type ExceptionHandlerPF = PartialFunction[(Props.RunModes.Value, Req,
>> > Throwable), LiftResponse]
>> >
>> > By default a partial function is appended and it is the same code that
>> > used to be for LiftRules.browserResponseToException.
>> >
>> > So up until now probably your application was using something like:
>> >
>> > LiftRules.logAndReturnExceptionToBrowser = {
>> >case (state, ex) => RedirectResponse("/error")
>> > }
>> >
>> > now this turns into:
>> >
>> > LiftRules.exceptionHandler.prepend = {
>> >case (mode, state, ex) => RedirectResponse("/error")
>> > }
>> >
>> >
>> > 2. More unification of Ajax notices with "static" notices. So far to
>> > apply styling information (css classes etc) to Ajax notices we used
>> > three LiftRules variables:
>> >
>> >  var ajaxNoticeMeta: Can[AjaxMessageMeta]
>> >  var ajaxWarningMeta: Can[AjaxMessageMeta]
>> >  var ajaxErrorMeta: Can[AjaxMessageMeta]
>> >
>> > the motivation was that in order for Lift to send down the correct
>> > style information for Ajax/Comet notices it needed to maintain this
>> > information. Now I finally found time to do it. The above variables
>> > are gone. Instead the same styling information that you use for
>> > lift:msgs and lift:msg snippets will be applied for AJax and Comet
>> > notices. The styling information is captured when these snippets are
>> > executed and used whenever you're using notices for AJax response or
>> > from a Comet actor.
>> >
>> >
>> > 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: *** BREAKING CHANGES ***

2009-02-09 Thread Oliver

If I try to use the following, I get a reassignment to Val error - any ideas?

LiftRules.exceptionHandler.prepend = {
case (mode, state, ex) => RedirectResponse("/error")
}

On Wed, Dec 24, 2008 at 5:41 AM, Marius  wrote:
>
> Folks,
>
> I just committed a couple of changes that may impact your application.
>
> 1. LiftRules.logAndReturnExceptionToBrowser and
> LiftRules.browserResponseToException have been removed. These were two
> different variables that did pretty much the same thing in fact the
> first ultimately called the former. These have been replaced with:
>
>
> var exceptionHandler = RulesSeq[ExceptionHandlerPF]
>
> having
>
> type ExceptionHandlerPF = PartialFunction[(Props.RunModes.Value, Req,
> Throwable), LiftResponse]
>
> By default a partial function is appended and it is the same code that
> used to be for LiftRules.browserResponseToException.
>
> So up until now probably your application was using something like:
>
> LiftRules.logAndReturnExceptionToBrowser = {
>case (state, ex) => RedirectResponse("/error")
> }
>
> now this turns into:
>
> LiftRules.exceptionHandler.prepend = {
>case (mode, state, ex) => RedirectResponse("/error")
> }
>
>
> 2. More unification of Ajax notices with "static" notices. So far to
> apply styling information (css classes etc) to Ajax notices we used
> three LiftRules variables:
>
>  var ajaxNoticeMeta: Can[AjaxMessageMeta]
>  var ajaxWarningMeta: Can[AjaxMessageMeta]
>  var ajaxErrorMeta: Can[AjaxMessageMeta]
>
> the motivation was that in order for Lift to send down the correct
> style information for Ajax/Comet notices it needed to maintain this
> information. Now I finally found time to do it. The above variables
> are gone. Instead the same styling information that you use for
> lift:msgs and lift:msg snippets will be applied for AJax and Comet
> notices. The styling information is captured when these snippets are
> executed and used whenever you're using notices for AJax response or
> from a Comet actor.
>
>
> 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] JTA showSQL

2009-02-09 Thread Oliver

Hi Derek and interested parties

I know there is a showSQL option that can be enabled with
JTA/Hibernate but I find the output verbose and uninformative about
parameter replacement.

So, I have my own ScalaQuery that allows simple debugging - the main
differences are -

var queryParams: List[Pair[String,Any]] = Nil
   /*  the following method needs to be called by the various
SetParameter methods */
def addParam(one: String,two: Any) = {
query.setParameter(one, two)
queryParams = (one, two) :: queryParams
}
/*
 output the query with parameters substitued, for debugging ...
 */
def getQueryWithParams() = {
var q = queryStr
try {
queryParams.foreach{v =>
var rep = v._2 match {
case d: Date => "'"+SUtil.formatDate(d, "dd/MM/")+"'"
case s: String => "'"+s+"'"
case x => if (x==null) "" else x.toString
}
rep = rep.replaceAll("\\$", "ddDollardd") // stupid bug
q = q.replaceAll(":"+v._1, rep)
}
q.replaceAll("ddDollardd", "\\$")
} catch {
case e: Exception => q+" PARAMS "+queryParams+ " EXCEPTION "+e
}
}

With this I can log the query via
 Log.info(emailQuery.getQueryWithParams())

Better still, (assuming execOnce exists in a utility object) when I
only need to see the query once in the log
/*
 execulte execFn, just once for the jvm.
 */
val execOnceSet = scala.collection.mutable.Set("")
def execOnce(key: String, execFn: => Unit) = {
if (!execOnceSet.contains(key)) {
execOnceSet += key
execFn
}
}

  execOnce("findByEmail",  Log.info(emailQuery.getQueryWithParams()) )


You can add the functionality if you find it useful

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: Can or Box or something else

2008-12-27 Thread Oliver Lambert
Ha :), I really think you've let the Can out of the Box by raising  
this thread. Don't we all get a vote?
After reading all the threads -
+1 Box

On 27/12/2008, at 10:06 AM, David Pollak wrote:

>
>
> 2008/12/26 Alex Boisvert 
> Just brainstorming here...  not sure if we're beating a dead  
> horse... but about Option3 to signify it has 3 states?  (i.e. Some3,  
> None3, Error3)
>
> It's uglier but could be easier to explain and understand.
>
> Personally, it took me a lot to get the concept of Option... mainly  
> because to me, an Option is this or that, not some or none.   
> Optional would have been a better choice as is Maybe.  In fact, it  
> wasn't until I was playing around with Haskell and the Maybe monad,  
> that I finally "got" Options.  I would despise the idea of  
> perpetuating what I consider to be one of Scala's weakest naming  
> schemes.
>
> It's going to stay "Can", but if I had it to do all over, I'd call  
> it Box.
>
> Thanks for all your respective thoughts on the subject.
>
> David
>
> PS -- The code is pretty much frozen for Lift.  There'll be a few  
> last minute minor changes between now and Jan 2 (or whenever 2.7.3  
> goes final) at which time we'll release Lift 0.10 and start on the  
> Lift 1.0-SNAPSHOT version.  We're expecting to ship Lift 1.0 on the  
> 2 year anniversary of the project.
>
>
>
> alex
>
>
> On Fri, Dec 26, 2008 at 3:29 AM, Mateusz Fiołka  m> wrote:
> If Maybe should be not used because of possible name clash in Scala  
> library then how about considering synonyms: Possible and Perhaps?
>
>
> On Fri, Dec 26, 2008 at 10:31 AM, Caoyuan  wrote:
>
> and "Pack" ?
>
> On Fri, Dec 26, 2008 at 8:35 AM, Marc Boschma  +lift...@boschma.cx> wrote:
> >
> > I know David has resigned to keeping 'Can', but wouldn't 'Jar' be an
> > alternative? That way Empty and Full still make sense...
> >
> > Initially I thought 'Tin' sounded better but I recognise that term
> > wouldn't be as universal.
> >
> > Marc
> >
> > On 26/12/2008, at 4:14 AM, Michael Campbell wrote:
> >
> >>
> >> David Pollak wrote:
> >>> Folks,
> >>>
> >>> Over the year that Lift has had Can[T] as a replacement for  
> Scala's
> >>> Option[T], the name "Can" has required a lot of explaining.
> >>
> >>
> >> I've never liked "Can" as a name; always thinking that the opposite
> >> of one
> >> should be a "Can't".   I'm sure it's my own issue to solve, but  
> it's
> >> cognitively dissonant to me.
> >>
> >> Any other container name works better for me, although of the ones
> >> you listed,
> >> I like "Box".
> >>
> >>
> >> --
> >> Twitter:  http://twitter.com/campbellmichael
> >>
> >> >
> >
> >
> > >
> >
>
>
>
>
>
>
>
>
>
>
>
> -- 
> Lift, the simply functional web framework http://liftweb.net
> Collaborative Task Management http://much4.us
> Follow me: http://twitter.com/dpp
> Git some: http://github.com/dpp
>
> >


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



[Lift] Re: error message tag

2008-12-23 Thread Oliver Lambert
I think quirks keeps some people in jobs.

Cheers in advance for the update.

On 23/12/2008, at 8:49 PM, David Pollak wrote:

> Does ie have anything other than quirks mode?
>
> I'll update the rendering methods to make sure span goes out as  
> begin/end tags
>
>
> On Dec 23, 2008 12:55 AM, "Oliver Lambert"  wrote:
>
> I have a html/css developer who is claiming that   
> is causing IE to go into quirks mode.
> He suggests  would be OK
>
> On 23/12/2008, at 11:16 AM, David Pollak wrote:
>
>> > > > On Mon, Dec 15, 2008 at 3:29 PM, Oliver   
>> wrote: >> >> >> I have the followin...
>>
>> > Lift, the simply functional web framework http://liftweb.net >  
>> Collaborative Task Management http:...
>>
>
> >


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



[Lift] Re: error message tag

2008-12-23 Thread Oliver Lambert

He came up with no other cases.

On 23/12/2008, at 9:05 PM, Marius wrote:

>
> LIft code actually does this for empty node that are not div, script
> or textarea. I could quick fix it for span as well but can you verify
> if there are are cases except span where IE is messing around with us?
>
> On Dec 23, 10:55 am, Oliver Lambert  wrote:
>> I have a html/css developer who is claiming that 
>> is causing IE to go into quirks mode.
>> He suggests  would be OK
>>
>> On 23/12/2008, at 11:16 AM, David Pollak wrote:
>>
>>
>>
>>> On Mon, Dec 15, 2008 at 3:29 PM, Oliver  wrote:
>>
>>> I have the following to output an error message against
>>> 
>>
>>> When I have an error its all fine, but when I don't have an error I
>>> get the following html
>>> 
>>
>>> Is there any way of getting rid of the empty span?
>>
>>> I think you want to keep the empty span.  If you've got Comet and/or
>>> Ajax code updating the messages, then need a place to go and
>>> that place would be this empty span.
>>
>>> cheers
>>> Oliver
>>
>>> --
>>> Lift, the simply functional web frameworkhttp://liftweb.net
>>> Collaborative Task Managementhttp://much4.us
>>> Follow me:http://twitter.com/dpp
>>> Git some:http://github.com/dpp
> >


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



[Lift] Re: error message tag

2008-12-23 Thread Oliver Lambert
I have a html/css developer who is claiming that   
is causing IE to go into quirks mode.
He suggests  would be OK

On 23/12/2008, at 11:16 AM, David Pollak wrote:

>
>
> On Mon, Dec 15, 2008 at 3:29 PM, Oliver  wrote:
>
> I have the following to output an error message against
> 
>
> When I have an error its all fine, but when I don't have an error I
> get the following html
> 
>
> Is there any way of getting rid of the empty span?
>
> I think you want to keep the empty span.  If you've got Comet and/or  
> Ajax code updating the messages, then need a place to go and  
> that place would be this empty span.
>
>
>
> cheers
> Oliver
>
>
>
>
>
> -- 
> Lift, the simply functional web framework http://liftweb.net
> Collaborative Task Management http://much4.us
> Follow me: http://twitter.com/dpp
> Git some: http://github.com/dpp
>
> >


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



[Lift] Re: LiftRules.logAndReturnExceptionToBrowser doesnt alway work

2008-12-21 Thread Oliver Lambert

Cool, Thanks

On 21/12/2008, at 6:20 PM, Marius wrote:

>
> You already got good advices to your particular problem still an
> exception thrown from LoanWrapper-s should be caught by and your
> function called. I'll look into it tomorrow.
>
>
> Br's,
> Marius
>
> On 18 Dec, 23:58, Oliver  wrote:
>> I was redirecting to an error page using
>> LiftRules.logAndReturnExceptionToBrowser, but when I use a  
>> LoanWrapper
>> to close a EntityManager and an error occurs when closing the entity
>> manager, LiftRules.logAndReturnExceptionToBrowser doesn't appear to
>> redirect to my error page. Can anyone think of a work around?
>>
>> // Output a simple error to the user. Link the error message
>> to the screen via the current datetime
>> LiftRules.logAndReturnExceptionToBrowser = {
>> RedirectResponse("/error);
>> }
>>
>> // Set up a LoanWrapper to automatically close a  
>> EntityManager
>> if its open
>> S.addAround(List(
>> new LoanWrapper {
>> def apply[T] (f : => T): T = {
>> try {
>> f
>> } finally {
>> EM.closeEM // close if open
>> }
>> }
>> }))
>>
>> }
> >


--~--~-~--~~~---~--~~
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: LiftRules.logAndReturnExceptionToBrowser doesnt alway work

2008-12-20 Thread Oliver Lambert

What's the big advantage of using JTA over resource local transactions?

On 21/12/2008, at 2:34 AM, Derek Chen-Becker wrote:

> Also, if you want lazy transactions it means you can't use JTA; as  
> far as I know, a JTA-aware EM wants the transaction to already exist  
> at the time that the EM is created. If that's not an issue and  
> you're using resource local transactions, transactions are pretty  
> inexpensive since they're essentially just turning off JDBC's  
> autocommit.

I'll have a look at the JPA demo code to see if anything is changed.

> On Sat, Dec 20, 2008 at 8:31 AM, Derek Chen-Becker  > wrote:
> I would suggest looking at the JPA demo code in liftweb under the  
> sites directory. The JPA.scala and Model.scala have some code in  
> there for handling transactions. There's also a wrapEM method that  
> can help with catching and handling exceptions. I have a branch  
> underway that improves on the code a bit (wip-dcb-jpa-jta), but I'm  
> stuck at the moment because of a weird issue with Jetty JNDI. I may  
> end up just merging some of those changes back into trunk since it  
> looks like it may be a while before that's resolved.
>

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



[Lift] Re: Can or Box or something else

2008-12-20 Thread Oliver Lambert

Perhaps we should rename Can to Option and get the Scala guys to  
rename theirs, OptionWithoutFailure :)

On 21/12/2008, at 6:50 AM, Charles F. Munat wrote:

> OptionWithFailure


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



[Lift] Re: Can or Box or something else

2008-12-20 Thread Oliver Lambert
Yup, when you chose the original name, you did a good job - why second  
guess yourself now. Can we just leave it the way it is.

On 21/12/2008, at 6:25 AM, David Pollak wrote:

> Because Can is three letters and OptionPlus is 11 and a frequently  
> used construct should be easy on the fingers.
>
>
> On Dec 20, 2008 11:15 AM, "Oliver Lambert"  wrote:
>
> Ok so Can is not either an Either or an Option, its a Can. I kind of  
> wondered when I first used Can, and it was described as an enhanced  
> Option,  why it wasn't called something like Option+ with None, Some  
> and Failure.
> On 21/12/2008, at 5:47 AM, David Pollak wrote: > Can has map,  
> flatMap, filter etc. So it can be u...
>
> You received this message because you are subscribed to the Google  
> Groups "Lift" group. To post to ...
>
>
>
>
> >


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



[Lift] Re: Can or Box or something else

2008-12-20 Thread Oliver Lambert
Ok so Can is not either an Either or an Option, its a Can. I kind of  
wondered when I first used Can, and it was described as an enhanced  
Option,  why it wasn't called something like Option+ with None, Some  
and Failure.

On 21/12/2008, at 5:47 AM, David Pollak wrote:

> Can has map, flatMap, filter etc. So it can be used in a for  
> comphrension.  I don't believe Either has those methods. Further,  
> Can has a bunch of helpers to turn Empty into Failure
>
>
> On Dec 20, 2008 10:33 AM, "Oliver Lambert"  wrote:
>
> Is Can a little less like Option and more like scala.Either, where  
> the left side is used to indicate failure?
> On 21/12/2008, at 1:43 AM, David Pollak wrote: > Folks, > > Over the  
> year that Lift has had Can[T...
>
> >


--~--~-~--~~~---~--~~
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: url handling

2008-12-20 Thread Oliver Lambert

No, but as Derek suggests, it sounds a bit like the stateful snippet  
is doing it for me.

On 21/12/2008, at 5:31 AM, Marius wrote:

>
> Yeah but there are 2 overloaded versions. Are you also pasing a
> function to it?
>
> On 20 Dec, 14:31, Oliver Lambert  wrote:
>> Im using a net.liftweb.http.S.redirectTo within a stateful snippet.
>>
>> On 20/12/2008, at 9:40 PM, Marius wrote:
>>
>>
>>
>>> Looks like a function will be executed when this request is  
>>> submitted.
>>
>>> In what conditions are you seeing this? Are you calling S.redirectTo
>>> and pass a function? ... or use RedirectWithState?
>>
>>> Br's,
>>> Marius
>>
>>> On 20 Dec, 05:26, Oliver Lambert  wrote:
>>>> Hi
>>
>>>> I notice lift sometimes lift rewrites the url a little
>>>> e.g. -  
>>>> http://localhost:9090/enterbecomeshttp://localhost:9090/enter?fnVT32K 
>>>> ...
>>
>>>> What are the rules for when this happens?
>>>> Is there anyway to write a lift application where it doesn't  
>>>> happen?
>>
>>>> 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: url handling

2008-12-20 Thread Oliver Lambert
It sounds like the this version is firing. What should I be using?

On 21/12/2008, at 2:36 AM, Derek Chen-Becker wrote:

> Are you sure you're using S.redirectTo? For one, that's not what you  
> want if you want to keep using the same stateful snippet instance.  
> Second, if you're not calling it explicitly (i.e. using just  
> "redirectTo"), the "this" version of redirectTo on StatefulSnippet  
> may be firing.
>
> Derek
>
> On Sat, Dec 20, 2008 at 5:36 AM, Oliver Lambert   
> wrote:
>
> Simple, I would like my url to be called without ?... tacked onto the
> end.
>
> On 20/12/2008, at 10:40 PM, Tim Perrett wrote:
>
> >
> > Oliver,
> >
> > Lift will only create these types of URL when you pass params when
> > creating a link.
> >
> > There is a very sophisticated rewriting engine in lift, so a better
> > question would be what do you want your URL to look like?
> >
> > Thanks, Tim
> >
> > Sent from my iPhone
> >
> > On 20 Dec 2008, at 03:26, Oliver Lambert  wrote:
> >
> >>
> >> Hi
> >>
> >> I notice lift sometimes lift rewrites the url a little
> >>   e.g. -  http://localhost:9090/enter becomes 
> >> http://localhost:9090/enter?fnVT32KHAJRTHI5RNQ2XBY=_
> >>
> >> What are the rules for when this happens?
> >> Is there anyway to write a lift application where it doesn't  
> happen?
> >>
> >> 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] Can or Box or something else

2008-12-20 Thread Oliver Lambert
Is Can a little less like Option and more like scala.Either, where the  
left side is used to indicate failure?

On 21/12/2008, at 1:43 AM, David Pollak wrote:

> Folks,
>
> Over the year that Lift has had Can[T] as a replacement for Scala's  
> Option[T], the name "Can" has required a lot of explaining.
>
> As we make the final push into freezing Lift's APIs, do we want to  
> change the name of Can to something else or should we leave it as  
> Can.  Alternatives are:
> Cup
> Box
> Both of which can be Full/Empty.
>
> Thanks,
>
> David
>
> PS -- The Scala collections classes are getting a redo for 2.8.   
> I've been gently pestering Martin to expand Option to have a Failure  
> case.  If this happens (it's not really likely for a couple of  
> reasons), Can will be orphaned.
>
> -- 
> Lift, the simply functional web framework http://liftweb.net
> Collaborative Task Management http://much4.us
> Follow me: http://twitter.com/dpp
> Git some: http://github.com/dpp
>
> >


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



[Lift] Re: url handling

2008-12-20 Thread Oliver Lambert

Simple, I would like my url to be called without ?... tacked onto the  
end.

On 20/12/2008, at 10:40 PM, Tim Perrett wrote:

>
> Oliver,
>
> Lift will only create these types of URL when you pass params when
> creating a link.
>
> There is a very sophisticated rewriting engine in lift, so a better
> question would be what do you want your URL to look like?
>
> Thanks, Tim
>
> Sent from my iPhone
>
> On 20 Dec 2008, at 03:26, Oliver Lambert  wrote:
>
>>
>> Hi
>>
>> I notice lift sometimes lift rewrites the url a little
>>   e.g. -  http://localhost:9090/enter becomes 
>> http://localhost:9090/enter?fnVT32KHAJRTHI5RNQ2XBY=_
>>
>> What are the rules for when this happens?
>> Is there anyway to write a lift application where it doesn't happen?
>>
>> 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: url handling

2008-12-20 Thread Oliver Lambert

Im using a net.liftweb.http.S.redirectTo within a stateful snippet.

On 20/12/2008, at 9:40 PM, Marius wrote:

>
> Looks like a function will be executed when this request is submitted.
>
> In what conditions are you seeing this? Are you calling S.redirectTo
> and pass a function? ... or use RedirectWithState?
>
> Br's,
> Marius
>
> On 20 Dec, 05:26, Oliver Lambert  wrote:
>> Hi
>>
>> I notice lift sometimes lift rewrites the url a little
>> e.g. -  
>> http://localhost:9090/enterbecomeshttp://localhost:9090/enter?fnVT32KHAJRTHI5RNQ2XBY=_
>>
>> What are the rules for when this happens?
>> Is there anyway to write a lift application where it doesn't happen?
>>
>> 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] url handling

2008-12-19 Thread Oliver Lambert

Hi

I notice lift sometimes lift rewrites the url a little
e.g. -  http://localhost:9090/enter becomes 
http://localhost:9090/enter?fnVT32KHAJRTHI5RNQ2XBY=_

What are the rules for when this happens?
Is there anyway to write a lift application where it doesn't happen?

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: LiftRules.logAndReturnExceptionToBrowser doesnt alway work

2008-12-19 Thread Oliver Lambert
Ha, very observant - I am relying on it to commit or rollback or do  
nothing.

  I note your recommendation, but I'd rather not have transaction  
support code littered around.
For my application, I want a transaction lazily created  and closed  
after each request, if it was created.
If what I am doing is bad design or coding, Im willing to change it.

Oliver

On 20/12/2008, at 1:12 AM, Derek Chen-Becker wrote:

> What kind of error are you getting when the EM closes? As long as  
> you're not relying on the EM.close to commit your transaction  
> (something I'd recommend against anyway) then there really shouldn't  
> be any errors at this point.
>
> Derek
>
> On Thu, Dec 18, 2008 at 10:00 PM, Oliver  wrote:
>
> I started on that path, and thought I could redirect with something  
> like
>   Full( "some html that redirects to the error page"...
> ).asInstanceOf[T]
> It feels like a big hack, even if I could get it working and I was a
> little worried about creating
> a redirection loop.
> I've created a static html error page and call it from web.xml for now
> - it'll have to do for now.
>
> On Fri, Dec 19, 2008 at 11:09 AM, David Pollak
>  wrote:
> > I'd put a try/finally around the EM.closeEM call so that it does  
> not impact
> > the stuff that's being rendered to the browser.  Don't let the  
> exception in
> > the finally block propogate.
> >
> > On Thu, Dec 18, 2008 at 1:58 PM, Oliver  wrote:
> >>
> >> I was redirecting to an error page using
> >> LiftRules.logAndReturnExceptionToBrowser, but when I use a  
> LoanWrapper
> >> to close a EntityManager and an error occurs when closing the  
> entity
> >> manager, LiftRules.logAndReturnExceptionToBrowser doesn't appear to
> >> redirect to my error page. Can anyone think of a work around?
> >>
> >>
> >>// Output a simple error to the user. Link the error message
> >> to the screen via the current datetime
> >>LiftRules.logAndReturnExceptionToBrowser = {
> >>RedirectResponse("/error);
> >>}
> >>
> >>// Set up a LoanWrapper to automatically close a  
> EntityManager
> >> if its open
> >>S.addAround(List(
> >>new LoanWrapper {
> >>def apply[T] (f : => T): T = {
> >>try {
> >>f
> >>} finally {
> >>EM.closeEM // close if open
> >>}
> >>}
> >>}))
> >>
> >>}
> >>
> >>
> >
> >
> >
> > --
> > Lift, the simply functional web framework http://liftweb.net
> > Collaborative Task Management http://much4.us
> > Follow me: http://twitter.com/dpp
> > Git some: http://github.com/dpp
> >
> > >
> >
>
>
>
>
> >


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



[Lift] Re: LiftRules.logAndReturnExceptionToBrowser doesnt alway work

2008-12-18 Thread Oliver

I started on that path, and thought I could redirect with something like
   Full( "some html that redirects to the error page"...
).asInstanceOf[T]
It feels like a big hack, even if I could get it working and I was a
little worried about creating
a redirection loop.
I've created a static html error page and call it from web.xml for now
- it'll have to do for now.

On Fri, Dec 19, 2008 at 11:09 AM, David Pollak
 wrote:
> I'd put a try/finally around the EM.closeEM call so that it does not impact
> the stuff that's being rendered to the browser.  Don't let the exception in
> the finally block propogate.
>
> On Thu, Dec 18, 2008 at 1:58 PM, Oliver  wrote:
>>
>> I was redirecting to an error page using
>> LiftRules.logAndReturnExceptionToBrowser, but when I use a LoanWrapper
>> to close a EntityManager and an error occurs when closing the entity
>> manager, LiftRules.logAndReturnExceptionToBrowser doesn't appear to
>> redirect to my error page. Can anyone think of a work around?
>>
>>
>>// Output a simple error to the user. Link the error message
>> to the screen via the current datetime
>>LiftRules.logAndReturnExceptionToBrowser = {
>>RedirectResponse("/error);
>>}
>>
>>// Set up a LoanWrapper to automatically close a EntityManager
>> if its open
>>S.addAround(List(
>>new LoanWrapper {
>>def apply[T] (f : => T): T = {
>>try {
>>f
>>} finally {
>>EM.closeEM // close if open
>>}
>>}
>>}))
>>
>>}
>>
>>
>
>
>
> --
> Lift, the simply functional web framework http://liftweb.net
> Collaborative Task Management http://much4.us
> Follow me: http://twitter.com/dpp
> Git some: http://github.com/dpp
>
> >
>

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



[Lift] LiftRules.logAndReturnExceptionToBrowser doesnt alway work

2008-12-18 Thread Oliver

I was redirecting to an error page using
LiftRules.logAndReturnExceptionToBrowser, but when I use a LoanWrapper
to close a EntityManager and an error occurs when closing the entity
manager, LiftRules.logAndReturnExceptionToBrowser doesn't appear to
redirect to my error page. Can anyone think of a work around?


// Output a simple error to the user. Link the error message
to the screen via the current datetime
LiftRules.logAndReturnExceptionToBrowser = {
RedirectResponse("/error);
}

// Set up a LoanWrapper to automatically close a EntityManager
if its open
S.addAround(List(
new LoanWrapper {
def apply[T] (f : => T): T = {
try {
f
} finally {
EM.closeEM // close if open
}
}
}))

}

--~--~-~--~~~---~--~~
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: liftweb xml schema location

2008-12-17 Thread Oliver

When I validate a lift page, via an XML validator (eg:  Firefox Html
Validator plugin) I get the following error

 "there is no attribute xmlns"

Should I be concerned with this?

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



[Lift] Re: liftweb xml schema location

2008-12-17 Thread Oliver

I didn't know what  xmlns:lift="http://liftweb.net/"; meant. My client was
assuming something was happening along the lines of your *%#!
Thanks for the info.

On Thu, Dec 18, 2008 at 7:16 AM, Alex Cruise  wrote:
>
> Viktor Klang wrote:
>> Ah, I read "I have a client doesn't want an external link*/ like/*
>>   xmlns:lift="http://liftweb.net/"";
>>
>> If you're only talking about that namespace declaration, it's just as
>> David says, just a namespace declaration.
> 
> If any software is expecting to find a .dtd or .xsd by doing a GET on a
> namespace URI it has a severe bug.  It happens that many well-known
> public namespace URIs actually *do* return their .dtd or .xsd from their
> namespace URI, but it was probably a mistake to ever set them up that
> way, due to the aforementioned severe bugs that are incredibly widespread.
>
> The only sane way to figure out where the .dtd or .xsd for a namespace
> URI might be downloaded--if any exists--is to look, in the instance
> document, for either a doctype with a system identifier (for a DTD) or a
> schemaLocation directive (for an XSD).  If you don't see either of
> those, and you absolutely need to validate the document, and there's no
> locally saved copy, throw an exception as early as possible.
>
> For everyone's sake, PLEASE don't write code that downloads DTDs or
> schemas automatically unless it's doing so in response to a human action
> and is planning to save it locally for later use.
> 
>
> -0xe1a
>
> >
>

--~--~-~--~~~---~--~~
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: liftweb xml schema location

2008-12-17 Thread Oliver

Thanks

This is the information I need

On Wed, Dec 17, 2008 at 11:29 PM, David Bernard
 wrote:
>
> It's not an external link nor a link to a schema but the definition of
> a namespace : lift
>
> On Wed, Dec 17, 2008 at 10:07, Oliver Lambert  wrote:
>> Don't I need the xsd or dtd specification?
>> On 17/12/2008, at 7:50 PM, Viktor Klang wrote:
>>
>> Why not just add a hosts entry and redirect that host to an internal
>> machine?
>>
>> On Wed, Dec 17, 2008 at 7:26 AM, Oliver  wrote:
>>>
>>> I have a client doesn't want an external link like
>>> xmlns:lift="http://liftweb.net/";
>>> Can I store the schema locally? How do I get it?
>>>
>>> cheers
>>> Oliver
>>>
>>>
>>
>>
>>
>> --
>> Viktor Klang
>> Senior Systems Analyst
>>
>>
>>
>>
>>
>> >
>>
>
> >
>

--~--~-~--~~~---~--~~
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: liftweb xml schema location

2008-12-17 Thread Oliver Lambert
Don't I need the xsd or dtd specification?

On 17/12/2008, at 7:50 PM, Viktor Klang wrote:

> Why not just add a hosts entry and redirect that host to an internal  
> machine?
>
> On Wed, Dec 17, 2008 at 7:26 AM, Oliver  wrote:
>
> I have a client doesn't want an external link like
> xmlns:lift="http://liftweb.net/";
> Can I store the schema locally? How do I get it?
>
> cheers
> Oliver
>
>
>
>
>
> -- 
> Viktor Klang
> Senior Systems Analyst
>
> >


--~--~-~--~~~---~--~~
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] liftweb xml schema location

2008-12-16 Thread Oliver

I have a client doesn't want an external link like
xmlns:lift="http://liftweb.net/";
Can I store the schema locally? How do I get it?

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: error message tag

2008-12-16 Thread Oliver Lambert


On 16/12/2008, at 3:30 PM, Charles F. Munat wrote:

>
> I copied and pasted the error message code into my own error message
> utility and then changed the blank output to Text(""). I also wanted  
> to
> rewrite other parts of it.

Im trying to get a html programmer to come up with a css fix before I  
put
in my own fix, but its certainly a option to use, if necessary.

> It seems there is always a trade-off between convenience and
> configuration. My coding style is very different from David's (at  
> least
> where HTML is concerned), so I find myself rewriting (modifying,  
> really)
> lots of stuff to make it work the way I need it to. But it sure saves
> time to have a base of code to modify, rather than having to write it
> all from scratch.

I've been guilty of modifying a few things myself, so I certainly  
understand
where you are coming from here. It makes me wonder how many "lifters"  
are
working with an unadulterated version of the code-base.

My own code style is also probably different from others and is likely
going to diverge as I have a "mentor" pushing me to adopt a much
more functional/immutable style of programming.

>
>
> Chas.
>
> Oliver wrote:
>> I have the following to output an error message against
>> 
>>
>> When I have an error its all fine, but when I don't have an error I
>> get the following html
>> 
>>
>> Is there any way of getting rid of the empty span?
>>
>> 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
-~--~~~~--~~--~--~---



  1   2   >