[Lift] Re: binding nested groups

2008-10-24 Thread Charles F. Munat

This looks promising! Will do.

Thanks,
Chas.

Derek Chen-Becker wrote:
> You should be able to do that with a combination of bind and 
> chooseTemplate. For instance, your template could look like:
> 
> ...
> 
> Categories
> 
> 
>   
>   
> 
>   
> 
> 
> 
> And then your code would look like:
> 
> val categories = ...
> 
> val catEntries : NodeSeq = categories.flatMap({category =>
>   val linkEntries : NodeSeq = category.links.flatMap({link =>
> bind("link", chooseTemplate("category", "links"), "name" -> 
> Text(link.name <http://link.name>)
>   })
> 
>   bind("category", chooseTemplate("categories", "entries"),
>"name" -> Text(category.name <http://category.name>),
>"links" -> linkEntries)
> })
> 
> bind("categories", xhtml, "entries" -> catEntries)
> 
> 
> Make sense?
> 
> Derek
> 
> On Thu, Oct 23, 2008 at 6:41 PM, Charles F. Munat <[EMAIL PROTECTED] 
> <mailto:[EMAIL PROTECTED]>> wrote:
> 
> 
> I have a group of links that are assigned to categories.
> 
> I want to pull the links and categories down and output them like this:
> 
> Category A
>   Link 1
>   Link 2
> 
> Category B
>   Link 3
> 
> ...
> 
> Is there a way to do this with bind, or should I just build the XHTML in
> the snippet?
> 
> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Lift powered blog project

2008-10-24 Thread Charles F. Munat

This makes things a little easier for me:

alias g1="cd ..; mvn clean compile; cd *app"
alias g2="cd ../*per; mvn install; cd ../*app"
alias g3="mvn jetty:run"
alias g3u="mvn jetty:run -U"

(My persistence layer is xxx-per, and my app is xxx-app.)

I run the above from the xxx/xxx-app directory.

Chas.

Tim Perrett wrote:
> Cheers guys, one thing though that confusses me about Dereks' JPA
> example is why the JPA stuff wasn't consolidated into the lift
> project?
> 
> For instance, I understand why you might well want or need a separate
> persistence tier in some applications or environments, but for the
> majority of arbitrary applications, it seems to just make things more
> complex / lengthy as you need to do "mvn install" all the time after
> any updates. So far, having it consolidated seems to be going very
> well 8-)
> 
> Also, IMO, the Model.scala and JPA.scala should really have the
> majority of there functionality taken out and put into the lift master
> under say, net.liftweb.jpa.Helpers or something? It appears that the
> functionality is so generic im copying and pasting a lot of the time
> those files into different project :-(
> 
> Cheers
> 
> Tim
> > 

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



[Lift] Re: JPA and hiberated generated fields in Lift app

2008-10-24 Thread Charles F. Munat

Happy! Happy! Joy! Joy!

I don't know how I missed this in your email of the 18th. Brain full, I 
guess. This works perfectly and it is exactly the way it should be.

Thank you very much.

Chas.

Derek Chen-Becker wrote:
> Bingo :)
> 
> On Fri, Oct 24, 2008 at 9:50 AM, Tim Perrett <[EMAIL PROTECTED] 
> <mailto:[EMAIL PROTECTED]>> wrote:
> 
> 
> Actually - sorry, im being dull, the annotation marks it for
> invocation doesnt it. Doh.
> 
> On Oct 24, 4:49 pm, Tim Perrett <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>> wrote:
>  > Oh thats really nice - was not aware of those!
>  >
>  > One thing thats not clear from that code; how do markCreateTime and
>  > markUpdateTime get called? They dont appear to be invoked anywhere?
>  >
>  > Cheers, Tim
>  >
>  > On Oct 24, 4:40 pm, "Derek Chen-Becker" <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>> wrote:
>  >
>  > > It's a JPA annotation for lifecycle methods. There's a really
> nice chart
>  > > explaining when they get called here:
>  >
>  >
>  >http://www.oracle.com/technology/products/ias/toplink/jpa/resources/t...
>  >
>  > > Basically, for what Chas wants to do, I'd do something like
>  >
>  > > //define fields
>  > > @Temporal{val value = TemporalType.TIMESTAMP}
>  > > var createTime : Date = _
>  >
>  > > @Temporal{val value = TemporalType.TIMESTAMP}
>  > > var updateTime : Date = _
>  >
>  > > @PrePersist
>  > > def markCreateTime = { createTime = new Date; updateTime =
> createTime }
>  >
>  > > @PreUpdate
>  > > def markUpdateTime = { updateTime = new Date }
>  >
>  > > Derek
>  >
>  > > On Fri, Oct 24, 2008 at 9:27 AM, Tim Perrett
> <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:
>  >
>  > > > Hey Derek,
>  >
>  > > > Whats @PrePersist - cant say im that familiar with it?
>  >
>  > > > Cheers
>  >
>  > > > Tim
>  >
>  > > > On Oct 24, 4:10 pm, "Derek Chen-Becker"
> <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:
>  > > > > Personally I use the @PrePersist lifecycle method
> interceptor when I want
>  > > > to
>  > > > > do things like record dates. Not quite as concise as the
> Hibernate stuff,
>  > > > > but it's more flexible since you control the logic for what
> gets
>  > > > > set/updated.
>  >
>  > > > > Derek
>  >
>  > > > > On Fri, Oct 24, 2008 at 5:16 AM, Tim Perrett
> <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>
>  > > > wrote:
>  >
>  > > > > > I think you should be able to do this by using an
> interceptor or event
>  > > > > > listener - does this article help:
>  >
>  > > > > >http://java.dzone.com/articles/using-a-hibernate-interceptor-
>  >
>  > > > > > If you manage to get the created_on and updated_at stuff
> working I'd
>  > > > > > be interested in how you did it as I think its something
> we should be
>  > > > > > using.
>  >
>  > > > > > Cheers
>  >
>  > > > > > Tim
>  >
>  > > > > > On Oct 22, 9:38 am, "Viktor Klang"
> <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:
>  > > > > > > After migrating from Hibernate 3.0 to 3.3.1 the past 2
> weeks I have
>  > > > > > gained
>  > > > > > > some hatred towards Hibernate.
>  >
>  > > > > > > I had to write atleast 3 workarounds to Hibernate bugs.
> No cool at
>  > > > all.
>  > > > > > :/
>  >
>  > > > > > > I feel your pain,
>  >
>  > > > > > > cheers,
>  > > > > > > Viktor
>  >
>  > > > > > > On Wed, Oct 22, 2008 at 1:41 AM, Charles F. Munat
> <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>
>  > > > > > wrote:
>  >
>  > > &g

[Lift] Re: Friendly URL's?

2008-10-24 Thread Charles F. Munat

I stole this from the wiki, but it works for me:

val profile_rewriter: LiftRules.RewritePf = {
   case RewriteRequest(path @ ParsePath("members" :: "profile" :: page ::
   _, _, _,_), _, _) =>
 RewriteResponse(
   ParsePath("profiles" :: "index" :: Nil, "", true, false),
   Map("member" -> page :: path.wholePath.drop(2)
 .zipWithIndex.map(p => ("param"+(p._2 + 1)) -> p._1) :_*)
 )
}

LiftRules.addRewriteBefore(profile_rewriter)

Chas.

Tim Perrett wrote:
> Quick question chaps,
> 
> If I want my URLs to look like:
> 
> /article/my-demo-blog-post
> 
> How would one go about that? Even with something messy like:
> 
> "name" -> SHtml.link("/article/" + article.permanent_link.toString, ()
> => Nil, Text(article.name))
> 
> I get the query string appended to the url with a bunch of encoding
> stuff... e.g.
> 
> http://127.0.0.1:8080/article/demo-post?F1224871776479962000_JWS=_
> 
> Whilst, if worse came to worse I could live with this, it would be
> nice not to have it for such a simple operation?
> 
> Cheers
> 
> Tim
> > 

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



[Lift] Dynamically adding fields to a form

2008-10-25 Thread Charles F. Munat

I have a Recipe form that allows for multiple Ingredients. (What's more, 
each Ingredient has multiple fields.)

I'd like the blank Recipe form to list, say, three blank Ingredient 
subforms. But I'd like the user to be able to delete unneeded subforms 
(via a - button next to each subform), or add more Ingredient subforms 
(via a + button at the top of the list of Ingredients). This is a pretty 
common situation, and I know how to do it using JQuery.

But in starting to do this in Lift, I realize that there's a problem. 
What are the names of those new fields? Lift encodes the names on the 
server, so it seems like adding a new subform would require a trip to 
the server (unless I included some ridiculous number of subforms, such 
as 20, and then did a show/hide on them -- but that's a pretty kludgy 
way to do things).

Does anyone have an example of how to do this? Or ideas for the best 
practice?

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



[Lift] Re: JPA and hiberated generated fields in Lift app

2008-10-25 Thread Charles F. Munat

What I did was add a BaseEntity from which I create my other entities:

import java.util.Date
import javax.persistence._

/**
   The base entity from which audited entities are extended
*/
@MappedSuperclass
class BaseEntity {

   @Temporal(TemporalType.TIMESTAMP)
   @Column{val name="CREATED_AT", val updatable = false}
   var createdAt : Date = new Date()

   @Temporal(TemporalType.TIMESTAMP)
   @Column{val name="UPDATED_AT"}
   var updatedAt : Date = new Date()

   @PrePersist
   def setCreatedAt = { createdAt = new Date; updatedAt = createdAt }

   @PreUpdate
   def setUpdatedAt = { updatedAt = new Date }

}

Works beautifully!

Chas.

Derek Chen-Becker wrote:
> It's a JPA annotation for lifecycle methods. There's a really nice chart 
> explaining when they get called here:
> 
> http://www.oracle.com/technology/products/ias/toplink/jpa/resources/toplink-jpa-annotations.html#CHDCHFJJ
> 
> Basically, for what Chas wants to do, I'd do something like
> 
> //define fields
> @Temporal{val value = TemporalType.TIMESTAMP}
> var createTime : Date = _
> 
> @Temporal{val value = TemporalType.TIMESTAMP}
> var updateTime : Date = _
> 
> @PrePersist
> def markCreateTime = { createTime = new Date; updateTime = createTime }
> 
> @PreUpdate
> def markUpdateTime = { updateTime = new Date }
> 
> 
> Derek
> 
> On Fri, Oct 24, 2008 at 9:27 AM, Tim Perrett <[EMAIL PROTECTED] 
> <mailto:[EMAIL PROTECTED]>> wrote:
> 
> 
> Hey Derek,
> 
> Whats @PrePersist - cant say im that familiar with it?
> 
> Cheers
> 
> Tim
> 
> On Oct 24, 4:10 pm, "Derek Chen-Becker" <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>> wrote:
>  > Personally I use the @PrePersist lifecycle method interceptor
> when I want to
>  > do things like record dates. Not quite as concise as the
> Hibernate stuff,
>  > but it's more flexible since you control the logic for what gets
>  > set/updated.
>  >
>  > Derek
>  >
>  > On Fri, Oct 24, 2008 at 5:16 AM, Tim Perrett
> <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:
>  >
>  > > I think you should be able to do this by using an interceptor
> or event
>  > > listener - does this article help:
>  >
>  > >http://java.dzone.com/articles/using-a-hibernate-interceptor-
>  >
>  > > If you manage to get the created_on and updated_at stuff
> working I'd
>  > > be interested in how you did it as I think its something we
> should be
>  > > using.
>  >
>  > > Cheers
>  >
>  > > Tim
>  >
>  > > On Oct 22, 9:38 am, "Viktor Klang" <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>> wrote:
>      > > > After migrating from Hibernate 3.0 to 3.3.1 the past 2 weeks
> I have
>  > > gained
>  > > > some hatred towards Hibernate.
>  >
>  > > > I had to write atleast 3 workarounds to Hibernate bugs. No
> cool at all.
>  > > :/
>  >
>  > > > I feel your pain,
>  >
>  > > > cheers,
>  > > > Viktor
>  >
>  > > > On Wed, Oct 22, 2008 at 1:41 AM, Charles F. Munat
> <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>
>  > > wrote:
>  >
>  > > > > Nope. Turns out this is a really poorly explained "feature" of
>  > > Hibernate
>  > > > >  (and, in the opinion of many, a really dumb one). My code
> was correct,
>  > > > > and the problem isn't anything Scala-related. In order for
> this code to
>  > > > > work, the *database* has to generate the values, e.g. via a
> trigger,
>  > > > > which I, the designer, have to add.
>  >
>  > > > > Sheesh. The whole point of Hibernate, I thought, was that I
> don't have
>  > > > > to deal with the database end. Why this can't just add the
> triggers for
>  > > > > me is beyond me. It's easier just to set them in the
> application, I
>  > > think.
>  >
>  > > > > Thanks for the help. Live and learn, I guess.
>  >
>  > > > > Chas.
>  >
>  > > > > Derek Chen-Becker wrote:
>  > > > > > Yeah, I think you want insertable to be true on the first
> one (just
>  > >

[Lift] Re: Dynamically adding fields to a form

2008-10-26 Thread Charles F. Munat

Hmm. My first idea was #3, but that's such a hack. Lift should be better 
than that. My second thought was #1, and I'm still thinking about that, 
although #2 (which also occurred to me) looks like a good fallback.

I'll think more about this, but it seems to me like something Lift 
should do effortlessly (as it's something you see a lot, and Lift is so 
good at everything else).

Thanks!

Chas.

Marius wrote:
> Hi Charles,
> 
> Well if you add new input fields from JS obviously Lift has no idea
> about them and obviously there will be no function associated with
> them on server side.I guess what you can do is :
> 
> 1. When pressing the add field button you do an ajax request, register
> your function n server side and return the new input in Ajax
> response.
> 2. Just add a new input to your form and read thee values manually on
> server side when processing the form.
> 3. Define a limited set of "extra fields" ... say 20 fields (would
> probably be enough). All these fields are mapped on the server side
> but on client side just don;t show them. When user clicks "add new"
> you just subsequently make one field visible. I would probably chose
> this at this point.
> 
> P.S.
> On the new Record stuff I'm working to provide support for adding
> fields dynamically to a record but this will still be on server side.
> Maybe would worth an extension to that idea to generate JS code to add
> fields to a Record from client side as well. Such thing may have side
> effects when the Records is mapped to a RDBMS table .. such as adding
> a new field to a record, that record may not correspond to the table
> structure ...
> 
> Br's,
> Marius
> 
> On Oct 25, 9:23 pm, "Charles F. Munat" <[EMAIL PROTECTED]> wrote:
>> I have a Recipe form that allows for multiple Ingredients. (What's more,
>> each Ingredient has multiple fields.)
>>
>> I'd like the blank Recipe form to list, say, three blank Ingredient
>> subforms. But I'd like the user to be able to delete unneeded subforms
>> (via a - button next to each subform), or add more Ingredient subforms
>> (via a + button at the top of the list of Ingredients). This is a pretty
>> common situation, and I know how to do it using JQuery.
>>
>> But in starting to do this in Lift, I realize that there's a problem.
>> What are the names of those new fields? Lift encodes the names on the
>> server, so it seems like adding a new subform would require a trip to
>> the server (unless I included some ridiculous number of subforms, such
>> as 20, and then did a show/hide on them -- but that's a pretty kludgy
>> way to do things).
>>
>> Does anyone have an example of how to do this? Or ideas for the best
>> practice?
>>
>> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Encrypting user passwords with Jasypt and JPA

2008-10-26 Thread Charles F. Munat

Here's everything I use, which includes the ability to reset the 
password. I'm sure most of this could be done better, but it's working 
fine for me right now.

In User.scala in the perisistence layer:


/**
  This class represents a user with login privileges on the website.
*/
@Entity
@Table{val name = "USERS"}
class User extends BaseEntity {
   @Id
   @GeneratedValue{val strategy = GenerationType.AUTO}
   var id: Long = _

   @Column{val name="EMAIL_ADDRESS", val unique = true,
 val nullable = false}
   var emailAddress: String = ""

   @Column{val name="VALIDATION_CODE"}
   var validationCode: String = ""

   @Column{val name="VALIDATION_EXPIRY"}
   var validationExpiry : Long = _

   @Column{val name="PASSWORD_SALT"}
   var passwordSalt: String = ""

   @Column{val name="PASSWORD_HASH"}
   var passwordHash: String = ""

   @Column{val name="IS_ADMINISTRATOR"}
   var isAdministrator: Boolean = false

   @Column{val name="IS_ACTIVE"}
   var isActive: Boolean = true

   /** create a SHA hash from a String */
   def hash(in: String): String = {
 new String((new Base64) encode
   (MessageDigest.getInstance("SHA")).digest(in.getBytes("UTF-8")))
   }

   def password: String = this.passwordHash

   def password_=(pw: String) = {
 this.passwordSalt = randomString(16)
 this.passwordHash = hash(pw + this.passwordSalt)
   }

   def authenticate(pw: String) = {
 hash(pw + this.passwordSalt) == this.passwordHash && isActive
   }

   def setValidation : String = {
 this.validationCode = randomString(32)
 this.validationExpiry = System.currentTimeMillis + 740L
 this.validationCode
   }

   @PrePersist
   def nullValidation = {
 if (this.validationCode.length > 0 && this.validationExpiry <
   System.currentTimeMillis()) {
 this.validationCode = null
 this.validationExpiry = 0
 }
   }

   /** random numbers generator */
   private val random = new java.security.SecureRandom

   /**
* Create a random string of a given size
*/
   def randomString(size: Int): String = {
 def addChar(pos: Int, lastRand: Int,
 sb: StringBuilder): StringBuilder = {
   if (pos >= size) sb
   else {
 val randNum = if ((pos % 6) == 0) random.nextInt else lastRand
 sb.append((randNum & 0x1f) match {
   case n if n < 26 => ('A' + n).toChar
   case n if n < 52 => ('a' + (n - 26)).toChar
   case n => ('0' + (n - 26)).toChar
 })
 addChar(pos + 1, randNum >> 5, sb)
   }
 }
 addChar(0, 0, new StringBuilder(size)).toString
   }
}



In Boot:

LiftRules.addDispatchBefore {
   case RequestState(List("logout"), "", _) => AccessControl.logout
}

val validation_rewriter: LiftRules.RewritePf = {
   case RewriteRequest(path @ ParsePath("validation" :: page :: _,
   _, _,_), _, _) =>
 RewriteResponse(
   ParsePath("credentials" :: "index" :: Nil, "", true, false),
   Map("code" -> page :: path.wholePath.drop(2).zipWithIndex.map(
 p => ("param"+(p._2 + 1)) -> p._1) :_*)
 )
}

LiftRules.addRewriteBefore(validation_rewriter)

LiftRules.addDispatchBefore {
   case RequestState("admin" :: page , "", _)
 if !AccessControl.isAuthenticated_? =>
   S.error("Please log in to view the page you requested.")
   RequestedURL(Full(S.uri))
   () => Full(RedirectResponse("/login"))
}



In LoginOps:

object LoginOps extends LoginOps

class LoginOps {

   def login (xhtml : NodeSeq) : NodeSeq = {
 def logUserIn () = {
   try {
 val user: User =
   Model.createNamedQuery[User]("findUserByEmailAddress",
   "emailAddress" ->
 S.param("emailAddress").openOr("")).getSingleResult()

 if (user.authenticate(S.param("password").openOr(""))) {
 CurrentUser(Full(user))
 CurrentUserId(Full(user.id))
 }
 else {
   S.error("Unable to log you in.")
 }
   } catch {
 case x: NoResultException =>
   S.error("Unable to log you in.")
 case e: Exception => S.error(e.getMessage)
   }

   if (AccessControl.isAuthenticated_?) {
 redirectTo(RequestedURL.openOr("/"))
 RequestedURL(Empty)
   }
 }

 bind("login", xhtml,
  "emailAddress" -> (FocusOnLoad(
 )),
  "password" -> ,
  "submit" -> SHtml.submit("Log In", logUserIn))
   }

   def changePassword (xhtml : NodeSeq) : NodeSeq = {
 def updatePassword () = {
   try {
 val user: User =
   Model.createNamedQuery[User]("findUserByValidationCode",
   "code" -> S.param("code").openOr("")).getSingleResult()

 if (user.validationExpiry > System.currentTimeMillis()) {
   if (S.param("password") != S.param("confirmation"))
 S.error("Password and confirmation do not match.")
   else {
 val quality =
   Pattern.compile("^(?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).{8,}")

[Lift] Re: Encrypting user passwords with Jasypt and JPA

2008-10-26 Thread Charles F. Munat

Very nice. I'm going to check this Jasypt out when I get a chance. You 
just drop in the jar and then you can use it?

Chas.

Tim Perrett wrote:
> FYI - for completeness, this is what I did in my model class:
> 
> http://blog.timperrett.com/2008/10/27/adding-jasypt-encryption-to-your-scala-jpa-entity-classes
> 
> 
> 
> > 

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



[Lift] deployment hassles with multiple sites

2008-10-26 Thread Charles F. Munat

I've deployed a beta version of my app to Tomcat, so it's available at 
localhost:8080/xxx/

Then I proxied Apache over to localhost:8080/xxx/

And it works.

But all the links in my app have /xxx/ prepended to them, so they try to 
go to /xxx/xxx/the_link instead of just /xxx/the_link. Lift (or the 
container) is plugging the name in there and basing it on the server 
root rather than the application root.

Anyone know how to fix this?

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



[Lift] Re: deployment hassles with multiple sites

2008-10-27 Thread Charles F. Munat

In vhosts.d/xxx.conf:


   ServerName beta.xxx.org
   ServerAlias beta.xxx.org www.beta.xxx.org
   DocumentRoot /var/lib/tomcat6/webapps/xxx/
   AddDefaultCharset utf-8

   
 Options -Indexes FollowSymLinks

 AllowOverride All
 Order allow,deny
 Allow from all
   

   RewriteEngine On

   
 Deny from all
   

   
 ProxyRequests Off

 ProxyPassReverse / http://localhost:8080/xxx/

 ProxyPreserveHost On

 
   Order deny,allow
   Allow from all
 

 RewriteRule "^/(images|stylesheets|javascripts)/?(.*)" "$0" [L]
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteRule "^/(.*)" "http://localhost:8080/xxx/$1"; [P,QSA,L]
   

   AddOutputFilterByType DEFLATE text/html text/xml text/plain text/css 
application/x-javascript text/javascript
   BrowserMatch ^Mozilla/4 gzip-only-text/html
   BrowserMatch ^Mozilla/4\.0[678] no-gzip
   BrowserMatch \bMSIE !no-gzip !gzip-only-text/html


It's passing everything through OK, just prepending /xxx to every link 
-- stylesheets, images, anchors, etc.

Chas.

David Bernard wrote:
> How do you configure you're apache proxy ?
> 
> On Mon, Oct 27, 2008 at 7:45 AM, Charles F. Munat <[EMAIL PROTECTED]> wrote:
>> I've deployed a beta version of my app to Tomcat, so it's available at
>> localhost:8080/xxx/
>>
>> Then I proxied Apache over to localhost:8080/xxx/
>>
>> And it works.
>>
>> But all the links in my app have /xxx/ prepended to them, so they try to
>> go to /xxx/xxx/the_link instead of just /xxx/the_link. Lift (or the
>> container) is plugging the name in there and basing it on the server
>> root rather than the application root.
>>
>> Anyone know how to fix this?
>>
>> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: deployment hassles with multiple sites

2008-10-27 Thread Charles F. Munat

Not sure I understand. How does one do that? Do you have a link?

(I'll start looking.)

Would that still permit multiple Lift apps in the same servlet 
container, or would I have to run one Tomcat each?

Chas.

Marius wrote:
> Why don't deploy your app using root context "/" in tomcat?
> 
> On Oct 27, 8:45 am, "Charles F. Munat" <[EMAIL PROTECTED]> wrote:
>> I've deployed a beta version of my app to Tomcat, so it's available at
>> localhost:8080/xxx/
>>
>> Then I proxied Apache over to localhost:8080/xxx/
>>
>> And it works.
>>
>> But all the links in my app have /xxx/ prepended to them, so they try to
>> go to /xxx/xxx/the_link instead of just /xxx/the_link. Lift (or the
>> container) is plugging the name in there and basing it on the server
>> root rather than the application root.
>>
>> Anyone know how to fix this?
>>
>> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: deployment hassles with multiple sites

2008-10-27 Thread Charles F. Munat

David Pollak wrote:
> Is having the context path a bad thing in the URL presented to the 
> user?  http://foo.com/foo/xxx ?

It might not be in all cases, but in my case it's a show-stopper. I'm 
going to have to figure out a way around this really quickly -- I've got 
to go live with this today.

I'm trying to think about how I could fudge this for the moment. Brain 
not coming up with anything. Must get coffee...

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



[Lift] Re: deployment hassles with multiple sites

2008-10-27 Thread Charles F. Munat

Thanks. I'll play around with this.

Chas.

Marius wrote:
> In tomcat you usually have a webapps/ROOT folder. Try putting you
> webapp in this ROOT folder (unarchived).
> 
> If that does not work, try looking into server.xml for  path="" docBase="ROOT" debug="0"/>. Try change your docBase to the
> folder of your webapp. You can alsouse context.xml but depends on your
> tomcat version where this should be. On tomcat 6.x context.xml should
> be in META-INF folder (if I remember correctly)
> 
> 
> 
> Br's,
> Marius
> 
> On Oct 27, 9:00 pm, "Charles F. Munat" <[EMAIL PROTECTED]> wrote:
>> Not sure I understand. How does one do that? Do you have a link?
>>
>> (I'll start looking.)
>>
>> Would that still permit multiple Lift apps in the same servlet
>> container, or would I have to run one Tomcat each?
>>
>> Chas.
>>
>> Marius wrote:
>>> Why don't deploy your app using root context "/" in tomcat?
>>> On Oct 27, 8:45 am, "Charles F. Munat" <[EMAIL PROTECTED]> wrote:
>>>> I've deployed a beta version of my app to Tomcat, so it's available at
>>>> localhost:8080/xxx/
>>>> Then I proxied Apache over to localhost:8080/xxx/
>>>> And it works.
>>>> But all the links in my app have /xxx/ prepended to them, so they try to
>>>> go to /xxx/xxx/the_link instead of just /xxx/the_link. Lift (or the
>>>> container) is plugging the name in there and basing it on the server
>>>> root rather than the application root.
>>>> Anyone know how to fix this?
>>>> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Kaboom

2008-10-27 Thread Charles F. Munat

Anyone know what this means:

[WARNING] Exception in thread "main" java.lang.RuntimeException: 
malformed Scala signature of Mailer at 5411; reference value mail of 
package javax refers to nonexisting symbol.
[WARNING]   at 
scala.tools.nsc.symtab.classfile.UnPickler$UnPickle.errorBadSignature(UnPickler.scala:755)
[WARNING]   at 
scala.tools.nsc.symtab.classfile.UnPickler$UnPickle.scala$tools$nsc$symtab$classfile$UnPickler$UnPickle$$readSymbol(UnPickler.scala:172)
[WARNING]   at 
scala.tools.nsc.symtab.classfile.UnPickler$UnPickle$$anonfun$scala$tools$nsc$symtab$classfile$UnPickler$UnPickle$$readSymbolRef$1.apply(UnPickler.scala:707)
[WARNING]   at 
scala.tools.nsc.symtab.classfile.UnPickler$UnPickle$$anonfun$scala$tools$nsc$symtab$classfile$UnPickler$UnPickle$$readSymbolRef$1.apply(UnPickler.scala:707)
[WARNING]   at 
scala.tools.nsc.symtab.classfile.UnPickler$UnPickle.scala$tools$nsc$symtab$classfile$UnPickler$UnPickle$$at(UnPickler.scala:139)
[WARNING]   at 
scala.tools.nsc.symtab.classfile.UnPickler$UnPickle.scala$tools$nsc$symtab$classfile$UnPickler$UnPickle$$readSymbolRef(UnPickler.scala:707)
[WARNING]   at 
scala.tools.nsc.symtab.classfile.UnPickler$UnPickle.scala$tools$nsc$symtab$classfile$UnPickler$UnPickle$$readType(UnPickler.scala:247)
[WARNING]   at 
scala.tools.nsc.symtab.classfile.UnPickler$UnPickle$$anonfun$scala$tools$nsc$symtab$classfile$UnPickler$UnPickle$$readTypeRef$1.apply(UnPickler.scala:708)
[WARNING]   at 
scala.tools.nsc.symtab.classfile.UnPickler$UnPickle$$anonfun$scala$tools$nsc$symtab$classfile$UnPickler$UnPickle$$readTypeRef$1.apply(UnPickler.scala:708)
[WARNING]   at 
scala.tools.nsc.symtab.classfile.UnPickler$UnPickle.scala$tools$nsc$symtab$classfile$UnPickler$UnPickle$$at(UnPickler.scala:139)
[WARNING]   at 
scala.tools.nsc.symtab.classfile.UnPickler$UnPickle.scala$tools$nsc$symtab$classfile$UnPickler$UnPickle$$readTypeRef(UnPickler.scala:708)
[WARNING]   at 
scala.tools.nsc.symtab.classfile.UnPickler$UnPickle.scala$tools$nsc$symtab$classfile$UnPickler$UnPickle$$readType(UnPickler.scala:253)
[WARNING]   at 
scala.tools.nsc.symtab.classfile.UnPickler$UnPickle$$anonfun$scala$tools$nsc$symtab$classfile$UnPickler$UnPickle$$readTypeRef$1.apply(UnPickler.scala:708)
[WARNING]   at 
scala.tools.nsc.symtab.classfile.UnPickler$UnPickle$$anonfun$scala$tools$nsc$symtab$classfile$UnPickler$UnPickle$$readTypeRef$1.apply(UnPickler.scala:708)
[WARNING]   at 
scala.tools.nsc.symtab.classfile.UnPickler$UnPickle.scala$tools$nsc$symtab$classfile$UnPickler$UnPickle$$at(UnPickler.scala:139)
[WARNING]   at 
scala.tools.nsc.symtab.classfile.UnPickler$UnPickle.scala$tools$nsc$symtab$classfile$UnPickler$UnPickle$$readTypeRef(UnPickler.scala:708)
[WARNING]   at 
scala.tools.nsc.symtab.classfile.UnPickler$UnPickle$$anonfun$scala$tools$nsc$symtab$classfile$UnPickler$UnPickle$$readType$1.apply(UnPickler.scala:253)
[WARNING]   at 
scala.tools.nsc.symtab.classfile.UnPickler$UnPickle$$anonfun$scala$tools$nsc$symtab$classfile$UnPickler$UnPickle$$readType$1.apply(UnPickler.scala:253)
[WARNING]   at 
scala.tools.nsc.symtab.classfile.PickleBuffer.until(PickleBuffer.scala:127)
[WARNING]   at 
scala.tools.nsc.symtab.classfile.UnPickler$UnPickle.scala$tools$nsc$symtab$classfile$UnPickler$UnPickle$$readType(UnPickler.scala:253)
[WARNING]   at 
scala.tools.nsc.symtab.classfile.UnPickler$UnPickle$$anonfun$scala$tools$nsc$symtab$classfile$UnPickler$UnPickle$$readTypeRef$1.apply(UnPickler.scala:708)
[WARNING]   at 
scala.tools.nsc.symtab.classfile.UnPickler$UnPickle$$anonfun$scala$tools$nsc$symtab$classfile$UnPickler$UnPickle$$readTypeRef$1.apply(UnPickler.scala:708)
[WARNING]   at 
scala.tools.nsc.symtab.classfile.UnPickler$UnPickle.scala$tools$nsc$symtab$classfile$UnPickler$UnPickle$$at(UnPickler.scala:139)
[WARNING]   at 
scala.tools.nsc.symtab.classfile.UnPickler$UnPickle.scala$tools$nsc$symtab$classfile$UnPickler$UnPickle$$readTypeRef(UnPickler.scala:708)
[WARNING]   at 
scala.tools.nsc.symtab.classfile.UnPickler$UnPickle.scala$tools$nsc$symtab$classfile$UnPickler$UnPickle$$readType(UnPickler.scala:270)
[WARNING]   at 
scala.tools.nsc.symtab.classfile.UnPickler$UnPickle$LazyTypeRef$$anonfun$31$$anonfun$apply$4.apply(UnPickler.scala:772)
[WARNING]   at 
scala.tools.nsc.symtab.classfile.UnPickler$UnPickle$LazyTypeRef$$anonfun$31$$anonfun$apply$4.apply(UnPickler.scala:772)
[WARNING]   at 
scala.tools.nsc.symtab.classfile.UnPickler$UnPickle.scala$tools$nsc$symtab$classfile$UnPickler$UnPickle$$at(UnPickler.scala:139)
[WARNING]   at 
scala.tools.nsc.symtab.classfile.UnPickler$UnPickle$LazyTypeRef$$anonfun$31.apply(UnPickler.scala:772)
[WARNING]   at 
scala.tools.nsc.symtab.classfile.UnPickler$UnPickle$LazyTypeRef$$anonfun$31.apply(UnPickler.scala:772)
[WARNING]   at scala.tools.nsc.Global$$anonfun$7.apply(Global.scala:719)
[WARNING]   at scala.tools.nsc.Global$$anonfun$7.apply(Global.scala:71

[Lift] Re: Kaboom

2008-10-27 Thread Charles F. Munat

Nope. I tried that several times before I posted. And I blew away .m2 
and tried that, too.

The problem seems to occur after I install lift. When I blow away .m2 
and re-compile, I have to install the markdownj.jar and the 
postgresql.jdbc.jar, and then I get this:

Missing:
--
1) net.liftweb:lift-webkit:jar:0.10-SNAPSHOT

   Try downloading the file manually from the project website.

   Then, install it using the command:
   mvn install:install-file -DgroupId=net.liftweb 
-DartifactId=lift-webkit -Dversion=0.10-SNAPSHOT -Dpackaging=jar 
-Dfile=/path/to/file

   Alternatively, if you host your own repository you can deploy the 
file there:
   mvn deploy:deploy-file -DgroupId=net.liftweb 
-DartifactId=lift-webkit -Dversion=0.10-SNAPSHOT -Dpackaging=jar 
-Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

I then downloaded the latest lift and built it, and then installed the 
lift-webkit jar. And then I get the error below no matter how many mvn 
clean installs I do. I never had this problem before, and I've done the 
above steps many times.

What am I doing wrong here? Is there a way to make Maven download lift? 
(And if anyone knows how to get the postgresql jdbc jar and the 
markdownj jar into the maven repository, I'd be interested.)

Thanks,
Chas.

David Pollak wrote:
> This is a bug in Scala 2.7.1  Please do a mvn clean install and it'll go 
> away.
> 
> On Mon, Oct 27, 2008 at 6:53 PM, Charles F. Munat <[EMAIL PROTECTED] 
> <mailto:[EMAIL PROTECTED]>> wrote:
> 
> 
> Anyone know what this means:
> 
> [WARNING] Exception in thread "main" java.lang.RuntimeException:
> malformed Scala signature of Mailer at 5411; reference value mail of
> package javax refers to nonexisting symbol.
> [WARNING]   at
> 
> scala.tools.nsc.symtab.classfile.UnPickler$UnPickle.errorBadSignature(UnPickler.scala:755)
> [WARNING]   at
> 
> scala.tools.nsc.symtab.classfile.UnPickler$UnPickle.scala$tools$nsc$symtab$classfile$UnPickler$UnPickle$$readSymbol(UnPickler.scala:172)
> [WARNING]   at
> 
> scala.tools.nsc.symtab.classfile.UnPickler$UnPickle$$anonfun$scala$tools$nsc$symtab$classfile$UnPickler$UnPickle$$readSymbolRef$1.apply(UnPickler.scala:707)
> [WARNING]   at
> 
> scala.tools.nsc.symtab.classfile.UnPickler$UnPickle$$anonfun$scala$tools$nsc$symtab$classfile$UnPickler$UnPickle$$readSymbolRef$1.apply(UnPickler.scala:707)
> [WARNING]   at
> 
> scala.tools.nsc.symtab.classfile.UnPickler$UnPickle.scala$tools$nsc$symtab$classfile$UnPickler$UnPickle$$at(UnPickler.scala:139)
> [WARNING]   at
> 
> scala.tools.nsc.symtab.classfile.UnPickler$UnPickle.scala$tools$nsc$symtab$classfile$UnPickler$UnPickle$$readSymbolRef(UnPickler.scala:707)
> [WARNING]   at
> 
> scala.tools.nsc.symtab.classfile.UnPickler$UnPickle.scala$tools$nsc$symtab$classfile$UnPickler$UnPickle$$readType(UnPickler.scala:247)
> [WARNING]   at
> 
> scala.tools.nsc.symtab.classfile.UnPickler$UnPickle$$anonfun$scala$tools$nsc$symtab$classfile$UnPickler$UnPickle$$readTypeRef$1.apply(UnPickler.scala:708)
> [WARNING]   at
> 
> scala.tools.nsc.symtab.classfile.UnPickler$UnPickle$$anonfun$scala$tools$nsc$symtab$classfile$UnPickler$UnPickle$$readTypeRef$1.apply(UnPickler.scala:708)
> [WARNING]   at
> 
> scala.tools.nsc.symtab.classfile.UnPickler$UnPickle.scala$tools$nsc$symtab$classfile$UnPickler$UnPickle$$at(UnPickler.scala:139)
> [WARNING]   at
> 
> scala.tools.nsc.symtab.classfile.UnPickler$UnPickle.scala$tools$nsc$symtab$classfile$UnPickler$UnPickle$$readTypeRef(UnPickler.scala:708)
> [WARNING]   at
> 
> scala.tools.nsc.symtab.classfile.UnPickler$UnPickle.scala$tools$nsc$symtab$classfile$UnPickler$UnPickle$$readType(UnPickler.scala:253)
> [WARNING]   at
> 
> scala.tools.nsc.symtab.classfile.UnPickler$UnPickle$$anonfun$scala$tools$nsc$symtab$classfile$UnPickler$UnPickle$$readTypeRef$1.apply(UnPickler.scala:708)
> [WARNING]   at
> 
> scala.tools.nsc.symtab.classfile.UnPickler$UnPickle$$anonfun$scala$tools$nsc$symtab$classfile$UnPickler$UnPickle$$readTypeRef$1.apply(UnPickler.scala:708)
> [WARNING]   at
> 
> scala.tools.nsc.symtab.classfile.UnPickler$UnPickle.scala$tools$nsc$symtab$classfile$UnPickler$UnPickle$$at(UnPickler.scala:139)
> [WARNING]   at
> 
> scala.tools.nsc.symtab.classfile.UnPickler$UnPickle.scala$tools$nsc$symtab$classfile$UnPickler$UnPickle$$readTypeRef(UnPickler.scala:708)
> [WARNING]   at
> 
> scala.tools.nsc.symtab.classfile.UnPickler$UnPickle$$anonfun$scala$tools$nsc$symtab$classfile$UnPickler$UnPickle$$readType$1.apply(UnPickler.scala:253)
> [WARNING]   at
> 
> sc

[Lift] Lift webkit jar

2008-10-28 Thread Charles F. Munat

Is there a way to get Maven to download the lift-webkit jar (0.10 
snapshot)? If not, does one just download lift from github, run mvn 
package (compile? install?) and then install the resulting jar?

I'm not sure I'm doing this right.

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



[Lift] Re: Lift webkit jar

2008-10-28 Thread Charles F. Munat

Ah! That's pretty close to what I have been doing, but thanks for the 
magic phrase: mvn clean package install. Abracadabra is so 4th century!

Thanks :-)

Chas.

Tim Perrett wrote:
> Chas,
> 
> Your best bet is to clone the git repo, then cd into the directory, then do:
> 
> mvn clean package install
> 
> If you then want to update from time to time, just do:
> 
> git pull
> 
> Cheers
> 
> Tim
> 
> 
> 
> On 28/10/2008 18:25, "Charles F. Munat" <[EMAIL PROTECTED]> wrote:
> 
>> Is there a way to get Maven to download the lift-webkit jar (0.10
>> snapshot)? If not, does one just download lift from github, run mvn
>> package (compile? install?) and then install the resulting jar?
>>
>> I'm not sure I'm doing this right.
>>
>> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Lift webkit jar

2008-10-28 Thread Charles F. Munat

Ah ha! That's what I was missing. I wondered why it wouldn't download. I 
only had the releases repo in there.

Thanks!

Chas.

David Bernard wrote:
> In the pom.xml under project/repositories add
> 
>   scala-tools.org.snapshots
>   Scala-Tools Maven2 Repository for Snapshots
>   http://scala-tools.org/repo-snapshots
>   
> 
> 
> and set the version of lift-... to 0.10-SNAPSHOT
> 
> quicker than update and build lift every day ;)
> 
> /davidB
> 
> On Tue, Oct 28, 2008 at 7:25 PM, Charles F. Munat <[EMAIL PROTECTED]> wrote:
>> Is there a way to get Maven to download the lift-webkit jar (0.10
>> snapshot)? If not, does one just download lift from github, run mvn
>> package (compile? install?) and then install the resulting jar?
>>
>> I'm not sure I'm doing this right.
>>
>> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Encrypting user passwords with Jasypt and JPA

2008-10-28 Thread Charles F. Munat

I store only the id in the session because I want to pull the user from 
the database freshly on each request. That's the safest security-wise. 
If something happens such as a change in roles or permissions, or 
deactivation, their permissions change on the next request instead of 
the next session.

I store the current user in the request, not the session (look again). 
That's so I only do the lookup once. Then the user is available for the 
remainder of the request processing.

Does that help?

Chas.

Erick Fleming wrote:
> @Derek,  Sorry after reading through the posts I forgot you metioned it.
> 
> @Charles,  Is there a reason you store CurrentUserId and CurrentUser in 
> session?
> 
> On Tue, Oct 28, 2008 at 12:56 PM, Derek Chen-Becker
> <[EMAIL PROTECTED]> wrote:
>> SecurityHelpers is what I was referring to before when I said I copied what
>> was in Mapper. It uses the helpers for random strings, hash, crypto, etc.
>>
>> Derek
>>
>> On Mon, Oct 27, 2008 at 10:25 PM, efleming969 <[EMAIL PROTECTED]> wrote:
>>> There is also SecurityHelpers which has some of this included.
>>>
>>> On Oct 27, 9:35 pm, efleming969 <[EMAIL PROTECTED]> wrote:
>>>> What does Jasypt offer that can't be done using java.security or
>>>> javax.crypto?
>>>>
>>>> On Oct 27, 3:16 am, Tim Perrett <[EMAIL PROTECTED]> wrote:
>>>>
>>>>> Yeah - I usually would add dependecies o a project unless really
>>>>> nesicary, but as it was only 150k all in I thought what the hell
>>>>> Seems to be working quite nicely so far :-)
>>>>> Cheers, Tim
>>>>> Sent from my iPhone
>>>>> On 27 Oct 2008, at 04:59, "Charles F. Munat" <[EMAIL PROTECTED]> wrote:
>>>>>> Very nice. I'm going to check this Jasypt out when I get a chance.
>>>>>> You
>>>>>> just drop in the jar and then you can use it?
>>>>>> Chas.
>>>>>> Tim Perrett wrote:
>>>>>>> FYI - for completeness, this is what I did in my model class:
>>>>>>>>> http://blog.timperrett.com/2008/10/27/adding-jasypt-encryption-to-you...
>>
> 
> > 

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



[Lift] Re: Encrypting user passwords with Jasypt and JPA

2008-10-28 Thread Charles F. Munat

I really have to start reading *all* the new posts before I start 
replying to them. :-P

Chas.

efleming969 wrote:
> @Charles,  nevermind.  I figured it out.
> 
> On Oct 28, 2:02 pm, "Erick Fleming" <[EMAIL PROTECTED]> wrote:
>> @Derek,  Sorry after reading through the posts I forgot you metioned it.
>>
>> @Charles,  Is there a reason you store CurrentUserId and CurrentUser in 
>> session?
>>
>> On Tue, Oct 28, 2008 at 12:56 PM, Derek Chen-Becker
>>
>> <[EMAIL PROTECTED]> wrote:
>>> SecurityHelpers is what I was referring to before when I said I copied what
>>> was in Mapper. It uses the helpers for random strings, hash, crypto, etc.
>>> Derek
>>> On Mon, Oct 27, 2008 at 10:25 PM, efleming969 <[EMAIL PROTECTED]> wrote:
>>>> There is also SecurityHelpers which has some of this included.
>>>> On Oct 27, 9:35 pm, efleming969 <[EMAIL PROTECTED]> wrote:
>>>>> What does Jasypt offer that can't be done using java.security or
>>>>> javax.crypto?
>>>>> On Oct 27, 3:16 am, Tim Perrett <[EMAIL PROTECTED]> wrote:
>>>>>> Yeah - I usually would add dependecies o a project unless really
>>>>>> nesicary, but as it was only 150k all in I thought what the hell
>>>>>> Seems to be working quite nicely so far :-)
>>>>>> Cheers, Tim
>>>>>> Sent from my iPhone
>>>>>> On 27 Oct 2008, at 04:59, "Charles F. Munat" <[EMAIL PROTECTED]> wrote:
>>>>>>> Very nice. I'm going to check this Jasypt out when I get a chance.
>>>>>>> You
>>>>>>> just drop in the jar and then you can use it?
>>>>>>> Chas.
>>>>>>> Tim Perrett wrote:
>>>>>>>> FYI - for completeness, this is what I did in my model class:
>>>>>>>>>> http://blog.timperrett.com/2008/10/27/adding-jasypt-encryption-to-you...
> > 

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



[Lift] Session problems when running the Lift sample apps and my own simultaneously

2008-11-01 Thread Charles F. Munat

I don't know if anyone else has observed this behavior, but...

When I run my Lift app (mvn jetty:run) on port , and simultaneously 
run the Lift sample app (mvn jetty:run) on port 8080, the SessionVars in 
my app get hosed. I have a CurrentUserId session variable, and it just 
disappears, causing the user to be logged out.

This happens whether I'm doing anything on the Lift sample site or not. 
It happens in Firefox 3. I have not tested it in any other browser.

Does the browser ignore the port when setting session variables 
(cookies, I presume)?

My suspicion is that the clock on the Lift sample app runs (every ten 
seconds) and that resets the session, and that the same session is being 
used for both apps for some reason. But I am only guessing as I haven't 
had time to look.

Not sure how important this is, but here's a heads up.

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



[Lift] Re: Session problems when running the Lift sample apps and my own simultaneously

2008-11-01 Thread Charles F. Munat

I'll test this as soon as I get a chance.

Chas.

Tim Perrett wrote:
> Chas,
> 
> What happens if you access one under 127.0.0.1 and the other under  
> localhost? Do you still see this?
> 
> Cheers, Tim
> 
> Sent from my iPhone
> 
> On 1 Nov 2008, at 23:16, "Charles F. Munat" <[EMAIL PROTECTED]> wrote:
> 
>> I don't know if anyone else has observed this behavior, but...
>>
>> When I run my Lift app (mvn jetty:run) on port , and  
>> simultaneously
>> run the Lift sample app (mvn jetty:run) on port 8080, the  
>> SessionVars in
>> my app get hosed. I have a CurrentUserId session variable, and it just
>> disappears, causing the user to be logged out.
>>
>> This happens whether I'm doing anything on the Lift sample site or  
>> not.
>> It happens in Firefox 3. I have not tested it in any other browser.
>>
>> Does the browser ignore the port when setting session variables
>> (cookies, I presume)?
>>
>> My suspicion is that the clock on the Lift sample app runs (every ten
>> seconds) and that resets the session, and that the same session is  
>> being
>> used for both apps for some reason. But I am only guessing as I  
>> haven't
>> had time to look.
>>
>> Not sure how important this is, but here's a heads up.
>>
>> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Concatenating lists of nodes

2008-11-13 Thread Charles F. Munat

If I have a list thus:

List(A,B,C)


How can a get a NodeSeq thus from this:

ABC


I'm sure this is drop-dead simple, but it's still not obvious to me...

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



[Lift] Output for trees

2008-11-13 Thread Charles F. Munat

If I have an entity thus:

@Entity
class Category {
   var name : String = ""
}

and another:

@Entity
class Example {
   var name : String = ""

   var exampleType : String = ""

   @ManyToOne
   var parent : Category = new Category()
}

And this data:

Category
   A
   B
   C

Example
   black type: 2  category: A
   red   type: 1  category: B
   orangetype: 1  category: A
   yellowtype: 2  category: A
   green type: 1  category: C
   blue  type: 2  category: C
   violettype: 2  category: A
   white type: 1  category: B

How do I get this output in Lift:


   Category A
 
   Type 1
 
   orange
 
   
   Type 2
 
   black
   violet
   yellow
 
   
 
   
   Category B
 
   Type 1
 
   red
   white
 
   
 
   Category C
 
   Type 1
 
   green
 
   
   Type 2
 
   blue
 
   
 
   


Which would look like this:

1. Category A
 1. Type 1
 1. orange
 2. Type 2
 1. black
 2. yellow
 3. violet
2. Category B
 1. Type 1
 1. red
 2. white
3. Category C
 1. Type 1
 1. green
 2. Type 2
 1. blue


Can this be done with bind? Choose template? Or do I have to build it in 
the method using a NodeSeq and just output that?

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



[Lift] Re: Concatenating lists of nodes

2008-11-13 Thread Charles F. Munat

Sigh... I knew it had to be drop-dead simple. Not sure how I kept 
getting List(...) output instead of ... out. Works 
now. Thanks.

Chas.

Jorge Ortiz wrote:
> A NodeSeq is really just a Seq[Node]. And a List[Node] is also a 
> Seq[Node]. Hence a List[Node] is a NodeSeq.
> 
> scala> import scala.xml.NodeSeq
> import scala.xml.NodeSeq
> scala> val n: NodeSeq = List(A, B, C)
> n: scala.xml.NodeSeq = ABC
> 
> --j
> 
> On Thu, Nov 13, 2008 at 10:14 AM, Charles F. Munat <[EMAIL PROTECTED] 
> <mailto:[EMAIL PROTECTED]>> wrote:
> 
> 
> If I have a list thus:
> 
> List(A,B,C)
> 
> 
> How can a get a NodeSeq thus from this:
> 
> ABC
> 
> 
> I'm sure this is drop-dead simple, but it's still not obvious to me...
> 
> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Concatenating lists of nodes

2008-11-13 Thread Charles F. Munat

Thanks, but that's what I was trying, and it outputs a String, not the 
nodes.

Chas.

Matt Harrington wrote:
> On Thu, Nov 13, 2008 at 10:14 AM, Charles F. Munat <[EMAIL PROTECTED]> wrote:
>> If I have a list thus:
>>
>> List(A,B,C)
>>
>>
>> How can a get a NodeSeq thus from this:
>>
>> ABC
>>
>>
>> I'm sure this is drop-dead simple, but it's still not obvious to me...
>>
>> Thanks,
>>
>> Chas.
> 
> 
> Take a look at List.mkString().  It inherits from Iterable.
> 
> ---Matt
> 
> > 

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



[Lift] Re: Output for trees

2008-11-13 Thread Charles F. Munat

That's kind of what I figured. Thanks for the code. I'll look through it.

Chas.

David Pollak wrote:
> I think you're going to have to do this one manually.  Attached, please 
> find some less than efficient code.
> 
> On Thu, Nov 13, 2008 at 10:30 AM, Charles F. Munat <[EMAIL PROTECTED] 
> <mailto:[EMAIL PROTECTED]>> wrote:
> 
> 
> If I have an entity thus:
> 
> @Entity
> class Category {
>   var name : String = ""
> }
> 
> and another:
> 
> @Entity
> class Example {
>   var name : String = ""
> 
>   var exampleType : String = ""
> 
>   @ManyToOne
>   var parent : Category = new Category()
> }
> 
> And this data:
> 
> Category
>   A
>   B
>   C
> 
> Example
>   black type: 2  category: A
>   red   type: 1  category: B
>   orangetype: 1  category: A
>   yellowtype: 2  category: A
>   green type: 1  category: C
>   blue  type: 2  category: C
>   violettype: 2  category: A
>   white type: 1  category: B
> 
> How do I get this output in Lift:
> 
> 
>   Category A
> 
>   Type 1
> 
>   orange
> 
>   
>   Type 2
> 
>   black
>   violet
>   yellow
> 
>   
> 
>   
>   Category B
> 
>   Type 1
> 
>   red
>   white
> 
>   
> 
>   Category C
> 
>   Type 1
> 
>   green
> 
>   
>   Type 2
> 
>   blue
> 
>   
> 
>   
> 
> 
> Which would look like this:
> 
> 1. Category A
> 1. Type 1
> 1. orange
> 2. Type 2
> 1. black
> 2. yellow
> 3. violet
> 2. Category B
> 1. Type 1
> 1. red
> 2. white
> 3. Category C
> 1. Type 1
> 1. green
> 2. Type 2
> 1. blue
> 
> 
> Can this be done with bind? Choose template? Or do I have to build it in
> the method using a NodeSeq and just output that?
> 
> Thanks,
> 
> Chas.
> 
> 
> 
> 
> 
> 
> -- 
> Lift, the simply functional web framework http://liftweb.net
> Collaborative Task Management http://much4.us
> Follow me: http://twitter.com/dpp
> Git some: http://github.com/dpp
> 
> > 

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



[Lift] Valid XHTML

2008-11-15 Thread Charles F. Munat

Is there an interest in Lift using valid XHTML, or do the Lift crew only 
care if it's well-formed? I ask because the current version of Lift 
creates XHTML that is invalid on every page unless you adjust the 
default settings, and even then there seems to be a lot of 
framework-generated HTML that violates the XHTML DTD.

I prefer valid XHTML, so I adjust settings and rewrite pieces of Lift 
that break the code, but it occurs to me that others might not even be 
aware that this is an issue and might like to know how to make the HTML 
valid.

So is this something others are interested in, or is it enough that the 
current HTML output appears to work in most browsers?

If the former, I'd be happy to contribute examples for how to fix the 
problems.

(For the record, this is a serious question. Most of the programmers I 
know really couldn't care less if their HTML is "valid" as long as it 
works, so I don't want to assume anything. Even most programming books 
that show HTML show really bad, invalid, and obsolete HTML. HTML is 
evidently not considered a real language by most programmers.)

Chas.

Oh, and for those who are curious and haven't tried it, the W3C HTML 
Validator is here:

http://validator.w3.org/

There's a CSS validator, too:

http://jigsaw.w3.org/css-validator/

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



[Lift] Re: Valid XHTML

2008-11-16 Thread Charles F. Munat

I'm glad to hear that the xmlns issue is a validator issue. That was the 
most troubling thing. And I'm doubly glad that Lift cares about validity 
-- so many groups don't.

Here are some other issues I've encountered:

The SHtml default for a select element uses selected="true" but the 
XHTML DTD requires selected="selected".

The FocusOnLoad method generates a script element but does not include 
the type attribute (type="text/javascript") which is required.

This doesn't affect me, but many of the examples in the liftweb code use 
form="POST" which turns into method="POST" in the form element, but the 
method expects get or post, not GET or POST. In my own code, I use the 
lower case.

There are a couple more but I can't remember where I found them. I'll 
post anything else I see. I believe the others involved elements where 
they weren't permitted.

Some of the above may be specific to XHTML 1.1, which I use. I am 
curious as to why transitional is the default. We've been 
"transitioning" for the better part of a decade now. Will we ever get 
there? Lots of people are using JavaScript libraries now that frankly 
won't work on any of the old browsers that were the reason for the 
transitional version, so why not default to 1.1 and let those few who 
really need it switch back to transitional? You avoid the validator bug 
that way, too.

I had almost given up on XHTML and returned to HTML when Lift convinced 
me that my despair was premature. I've since been moving my sites back 
to XHTML and even trying to serve it with the proper mime type. So 
thanks for that!

I'll post other issues as they come up.

Chas.

David Pollak wrote:
> 
> 
> On Sat, Nov 15, 2008 at 9:24 PM, Charles F. Munat <[EMAIL PROTECTED] 
> <mailto:[EMAIL PROTECTED]>> wrote:
> 
> 
> Is there an interest in Lift using valid XHTML, or do the Lift crew only
> care if it's well-formed?
> 
> 
> We care if it's valid.  As Marius asked, "Please give us examples of 
> invalid XHTML" and as Tim pointed out "the W3C's XHTML validation tool 
> is broken."
> 
> What do you change to make it more valid?
> 
> 
>  
> 
> I ask because the current version of Lift
> creates XHTML that is invalid on every page unless you adjust the
> default settings, and even then there seems to be a lot of
> framework-generated HTML that violates the XHTML DTD.
> 
> I prefer valid XHTML, so I adjust settings and rewrite pieces of Lift
> that break the code, but it occurs to me that others might not even be
> aware that this is an issue and might like to know how to make the HTML
> valid.
> 
> So is this something others are interested in, or is it enough that the
> current HTML output appears to work in most browsers?
> 
> If the former, I'd be happy to contribute examples for how to fix the
> problems.
> 
> (For the record, this is a serious question. Most of the programmers I
> know really couldn't care less if their HTML is "valid" as long as it
> works, so I don't want to assume anything. Even most programming books
> that show HTML show really bad, invalid, and obsolete HTML. HTML is
> evidently not considered a real language by most programmers.)
> 
> Chas.
> 
> Oh, and for those who are curious and haven't tried it, the W3C HTML
> Validator is here:
> 
> http://validator.w3.org/
> 
> There's a CSS validator, too:
> 
> http://jigsaw.w3.org/css-validator/
> 
> 
> 
> 
> 
> -- 
> Lift, the simply functional web framework http://liftweb.net
> Collaborative Task Management http://much4.us
> Follow me: http://twitter.com/dpp
> Git some: http://github.com/dpp
> 
> > 

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



[Lift] SHtml form inputs and attributes/labels

2008-11-17 Thread Charles F. Munat

I spend a lot of time writing % new UnprefixedAttribute(...) to add 
attributes to SHtml form elements (input, textarea, select, etc.).

It would be nice if the relevant SHtml methods would permit optional 
extra parameters in the form of tuples where contents are name-value 
pairs that get translated to attributes. I don't think this would be a 
breaking change.

In other words, instead of:

SHtml.text(user.name, user.name = _) %
   new UnprefixedAttribute("size", "24",
 new UnprefixedAttribute("maxlength", "48",
   new UnprefixedAttribute("id", "user_name",
 new UnprefixedAttribute("title", "Enter your name", Null)
   )
 )
   )

I could do:

SHtml.text(user.name, user.name = _,
   ("size", "24"),
   ("maxlength", "48"),
   ("id", "user_name"),
   ("title", "Enter your name")
)

Which is a hell of a lot cleaner and faster, and I don't have to import 
UnprefixedAttribute and remember the % and the new keywords.

Or is this already possible and I'm missing it?

I have an online survey with 43 questions on 5 pages involving more than 
150 database fields. The snippet is already over 700 lines and growing. 
It's just unmanageable.

Another thing: the  element is a very important part of 
accessibility to persons with disabilities, but it needs a "for" 
attribute that references the "id" attribute of the input element (or 
textarea, etc.). The current SHtml output (unlike Rails) does not 
generate an id attribute, so they have to be added by hand. Has anyone 
given any thought to automatically-generated id elements on form fields? 
Better yet, some way to integrate labels?

Ideally, I would do something like this:



Or this:

Your name

and bind would allow me to generate this:

Your name



What do others think? Is this already possible?

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



[Lift] Re: [ANN] Lift nightlies upgraded to Scala 2.7.2

2008-11-17 Thread Charles F. Munat

This is very exciting. Great job. Thanks!

Chas.

Jorge Ortiz wrote:
> I've just upgraded Lift's trunk to work with the newest release of Scala 
> (2.7.2), Specs (1.4.0), and Scalacheck (1.5). These changes are 
> available in the source code immediately, and should be reflected in the 
> binaries posted to http://scala-tools.org/repo-snapshots/ in about an 
> hour or so. Use Lift 0.10-SNAPSHOT for compatibility with Scala 2.7.2. 
> 
> 
> There should be no breaking changes to source code that uses Lift. As 
> always with new Scala releases, binary incompatibilities will exist. You 
> should clean out any binaries compiled with Scala 2.7.1 and recompile 
> with Scala 2.7.2.  For existing Lift projects using 
> 0.10-SNAPSHOT, this means updating the relevant line in your pom.xml 
> file to read 2.7.2, then running 'mvn 
> clean install'.
> 
> Lift projects that use Specs or Scalacheck may be subject to breaking 
> changes, as those APIs have changed.
> 
> This upgrade should greatly improve Lift's compatibility with the Scala 
> plugins for Eclipse, NetBeans, and IntelliJ IDEA.
> 
> Please report any issues to the Lift mailing list 
> (liftweb@googlegroups.com ).
> 
> Thanks,
> 
> --j
> 
> > 

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



[Lift] Re: SHtml form inputs and attributes/labels

2008-11-17 Thread Charles F. Munat

That's a neat trick. I'll have to document that on the wiki.

Thanks.

Chas.

Jorge Ortiz wrote:
> Try:
> 
> SHtml.text(user.name <http://user.name>, user.name <http://user.name> = _) %
>   ("size", "24") %
>   ("maxlength", "48") %
>   ("id", "user_name") %
>   ("title", "Enter your name")
> 
> That should work.
> 
> --j
> 
> On Mon, Nov 17, 2008 at 12:21 PM, Charles F. Munat <[EMAIL PROTECTED] 
> <mailto:[EMAIL PROTECTED]>> wrote:
> 
> 
> I spend a lot of time writing % new UnprefixedAttribute(...) to add
> attributes to SHtml form elements (input, textarea, select, etc.).
> 
> It would be nice if the relevant SHtml methods would permit optional
> extra parameters in the form of tuples where contents are name-value
> pairs that get translated to attributes. I don't think this would be a
> breaking change.
> 
> In other words, instead of:
> 
> SHtml.text(user.name <http://user.name>, user.name
> <http://user.name> = _) %
>   new UnprefixedAttribute("size", "24",
> new UnprefixedAttribute("maxlength", "48",
>   new UnprefixedAttribute("id", "user_name",
> new UnprefixedAttribute("title", "Enter your name", Null)
>   )
> )
>   )
> 
> I could do:
> 
> SHtml.text(user.name <http://user.name>, user.name
> <http://user.name> = _,
>   ("size", "24"),
>   ("maxlength", "48"),
>   ("id", "user_name"),
>   ("title", "Enter your name")
> )
> 
> Which is a hell of a lot cleaner and faster, and I don't have to import
> UnprefixedAttribute and remember the % and the new keywords.
> 
> Or is this already possible and I'm missing it?
> 
> I have an online survey with 43 questions on 5 pages involving more than
> 150 database fields. The snippet is already over 700 lines and growing.
> It's just unmanageable.
> 
> Another thing: the  element is a very important part of
> accessibility to persons with disabilities, but it needs a "for"
> attribute that references the "id" attribute of the input element (or
> textarea, etc.). The current SHtml output (unlike Rails) does not
> generate an id attribute, so they have to be added by hand. Has anyone
> given any thought to automatically-generated id elements on form fields?
> Better yet, some way to integrate labels?
> 
> Ideally, I would do something like this:
> 
> 
> 
> Or this:
> 
> Your name
> 
> and bind would allow me to generate this:
> 
> Your name
> 
> 
> 
> What do others think? Is this already possible?
> 
> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: SHtml form inputs and attributes/labels

2008-11-17 Thread Charles F. Munat

This is the correct one. ("size -> "24") not ("size", "24").

Thanks!

Chas.

Jorge Ortiz wrote:
> Oops, it might be:
> 
> SHtml.text(user.name <http://user.name>, user.name <http://user.name> = _) %
>   ("size" -> "24") %
>   ("maxlength" -> "48") %
>   ("id" -> "user_name") %
>   ("title" -> "Enter your name")
> 
> One or both of those should work.
> 
> --j
> 
> On Mon, Nov 17, 2008 at 12:27 PM, Jorge Ortiz <[EMAIL PROTECTED] 
> <mailto:[EMAIL PROTECTED]>> wrote:
> 
> Try:
> 
> SHtml.text(user.name <http://user.name>, user.name
> <http://user.name> = _) %
>   ("size", "24") %
>   ("maxlength", "48") %
>   ("id", "user_name") %
>   ("title", "Enter your name")
> 
> That should work.
> 
> --j
> 
> On Mon, Nov 17, 2008 at 12:21 PM, Charles F. Munat <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>> wrote:
> 
> 
> I spend a lot of time writing % new UnprefixedAttribute(...) to add
> attributes to SHtml form elements (input, textarea, select, etc.).
> 
> It would be nice if the relevant SHtml methods would permit optional
> extra parameters in the form of tuples where contents are name-value
> pairs that get translated to attributes. I don't think this
> would be a
> breaking change.
> 
> In other words, instead of:
> 
> SHtml.text(user.name <http://user.name>, user.name
> <http://user.name> = _) %
>   new UnprefixedAttribute("size", "24",
> new UnprefixedAttribute("maxlength", "48",
>   new UnprefixedAttribute("id", "user_name",
> new UnprefixedAttribute("title", "Enter your name", Null)
>   )
> )
>   )
> 
> I could do:
> 
> SHtml.text(user.name <http://user.name>, user.name
> <http://user.name> = _,
>   ("size", "24"),
>   ("maxlength", "48"),
>   ("id", "user_name"),
>   ("title", "Enter your name")
> )
> 
> Which is a hell of a lot cleaner and faster, and I don't have to
> import
> UnprefixedAttribute and remember the % and the new keywords.
> 
> Or is this already possible and I'm missing it?
> 
> I have an online survey with 43 questions on 5 pages involving
> more than
> 150 database fields. The snippet is already over 700 lines and
> growing.
> It's just unmanageable.
> 
> Another thing: the  element is a very important part of
> accessibility to persons with disabilities, but it needs a "for"
> attribute that references the "id" attribute of the input
> element (or
> textarea, etc.). The current SHtml output (unlike Rails) does not
> generate an id attribute, so they have to be added by hand. Has
> anyone
> given any thought to automatically-generated id elements on form
> fields?
> Better yet, some way to integrate labels?
> 
> Ideally, I would do something like this:
> 
> 
> 
> Or this:
> 
> Your name
> 
> and bind would allow me to generate this:
> 
> Your name
>  name="F1226951216428645000_I0G"/>
> 
> 
> What do others think? Is this already possible?
> 
> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: SHtml form inputs and attributes/labels

2008-11-17 Thread Charles F. Munat

Added:

http://liftweb.net/index.php/FAQ#How_do_I_add_attributes_to_form_fields_created_with_SHtml_methods.3F

Chas.

Jorge Ortiz wrote:
> Oops, it might be:
> 
> SHtml.text(user.name <http://user.name>, user.name <http://user.name> = _) %
>   ("size" -> "24") %
>   ("maxlength" -> "48") %
>   ("id" -> "user_name") %
>   ("title" -> "Enter your name")
> 
> One or both of those should work.
> 
> --j
> 
> On Mon, Nov 17, 2008 at 12:27 PM, Jorge Ortiz <[EMAIL PROTECTED] 
> <mailto:[EMAIL PROTECTED]>> wrote:
> 
> Try:
> 
> SHtml.text(user.name <http://user.name>, user.name
> <http://user.name> = _) %
>   ("size", "24") %
>   ("maxlength", "48") %
>   ("id", "user_name") %
>   ("title", "Enter your name")
> 
> That should work.
> 
> --j
> 
> On Mon, Nov 17, 2008 at 12:21 PM, Charles F. Munat <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>> wrote:
> 
> 
> I spend a lot of time writing % new UnprefixedAttribute(...) to add
> attributes to SHtml form elements (input, textarea, select, etc.).
> 
> It would be nice if the relevant SHtml methods would permit optional
> extra parameters in the form of tuples where contents are name-value
> pairs that get translated to attributes. I don't think this
> would be a
> breaking change.
> 
> In other words, instead of:
> 
> SHtml.text(user.name <http://user.name>, user.name
> <http://user.name> = _) %
>   new UnprefixedAttribute("size", "24",
> new UnprefixedAttribute("maxlength", "48",
>   new UnprefixedAttribute("id", "user_name",
> new UnprefixedAttribute("title", "Enter your name", Null)
>   )
> )
>   )
> 
> I could do:
> 
> SHtml.text(user.name <http://user.name>, user.name
> <http://user.name> = _,
>   ("size", "24"),
>   ("maxlength", "48"),
>   ("id", "user_name"),
>   ("title", "Enter your name")
> )
> 
> Which is a hell of a lot cleaner and faster, and I don't have to
> import
> UnprefixedAttribute and remember the % and the new keywords.
> 
> Or is this already possible and I'm missing it?
> 
> I have an online survey with 43 questions on 5 pages involving
> more than
> 150 database fields. The snippet is already over 700 lines and
> growing.
> It's just unmanageable.
> 
> Another thing: the  element is a very important part of
> accessibility to persons with disabilities, but it needs a "for"
> attribute that references the "id" attribute of the input
> element (or
> textarea, etc.). The current SHtml output (unlike Rails) does not
> generate an id attribute, so they have to be added by hand. Has
> anyone
> given any thought to automatically-generated id elements on form
> fields?
> Better yet, some way to integrate labels?
> 
> Ideally, I would do something like this:
> 
> 
> 
> Or this:
> 
> Your name
> 
> and bind would allow me to generate this:
> 
> Your name
>  name="F1226951216428645000_I0G"/>
> 
> 
> What do others think? Is this already possible?
> 
> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] REST CRUD web service

2008-11-17 Thread Charles F. Munat

One thing I'm working on is a two-part application that involves a Lift 
interface app and a REST CRUD back end. I plan to do the back end in 
Lift as well.

One reason for the separation is that it allows me to build other front 
ends for the web service (a desktop app, something on the iPhone, an 
Android app, etc.). Another reason is that the data model is pretty 
complicated, and instantiating a lot of objects is not really necessary. 
If I can handle the back end as just data, rather than objects, passing 
it in and out using XML, that would be faster and easier, I think. And I 
could use an XML database to store the data.

A big issue, of course, is authentication and authorization. I'm 
wondering if anyone else here is doing web services and if so how you're 
handling authentication/authorization. Are you using Lift, or are you 
handling it through the container. Can anyone talk about pros/cons of 
the different methods? Suggestions?

We're thinking about using Berkeley DB XML as the database. Anyone tried 
that?

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



[Lift] Re: REST CRUD web service

2008-11-17 Thread Charles F. Munat

Everything you need to know is here:

http://www.oracle.com/technology/documentation/berkeley-db/xml/index.html

It's an Apache Software License:

http://www.oracle.com/technology/software/products/berkeley-db/htdocs/xmloslicense.html

Happy to share notes as we go along.

Are you connecting to db4o using Lift or Scala? Or is it in another project?

Chas.

Erick Fleming wrote:
> Chas,
> 
> I'm not doing web services yet in my current project, but have plans to. 
> 
> I've been using db4o as my backend, but am interested in Berkley DB.  Do 
> you know what license it's under?  The Oracle website just says Open Source.
> 
> On Mon, Nov 17, 2008 at 8:21 PM, Charles F. Munat <[EMAIL PROTECTED] 
> <mailto:[EMAIL PROTECTED]>> wrote:
> 
> 
> One thing I'm working on is a two-part application that involves a Lift
> interface app and a REST CRUD back end. I plan to do the back end in
> Lift as well.
> 
> One reason for the separation is that it allows me to build other front
> ends for the web service (a desktop app, something on the iPhone, an
> Android app, etc.). Another reason is that the data model is pretty
> complicated, and instantiating a lot of objects is not really necessary.
> If I can handle the back end as just data, rather than objects, passing
> it in and out using XML, that would be faster and easier, I think. And I
> could use an XML database to store the data.
> 
> A big issue, of course, is authentication and authorization. I'm
> wondering if anyone else here is doing web services and if so how you're
> handling authentication/authorization. Are you using Lift, or are you
> handling it through the container. Can anyone talk about pros/cons of
> the different methods? Suggestions?
> 
> We're thinking about using Berkeley DB XML as the database. Anyone tried
> that?
> 
> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: REST CRUD web service

2008-11-17 Thread Charles F. Munat

Yeah, I'm thinking Digest is the way I probably want to go. Sorry to 
hear that it's complicated. Do you have code anywhere that I could look 
at (just curious)?

Chas.

Tim Perrett wrote:
> Hey Chas,
> 
> I'm currently writing HTTP auth for lift, so watch this space :-)
> 
> It's unfortunatly pretty complex, so is taking longer than I'd hoped.  
> I'm impletmenting Basic and Digest auth; the latter being the most  
> secure.
> 
> Cheers, Tim
> 
> Sent from my iPhone
> 
> On 18 Nov 2008, at 02:21, "Charles F. Munat" <[EMAIL PROTECTED]> wrote:
> 
>> One thing I'm working on is a two-part application that involves a  
>> Lift
>> interface app and a REST CRUD back end. I plan to do the back end in
>> Lift as well.
>>
>> One reason for the separation is that it allows me to build other  
>> front
>> ends for the web service (a desktop app, something on the iPhone, an
>> Android app, etc.). Another reason is that the data model is pretty
>> complicated, and instantiating a lot of objects is not really  
>> necessary.
>> If I can handle the back end as just data, rather than objects,  
>> passing
>> it in and out using XML, that would be faster and easier, I think.  
>> And I
>> could use an XML database to store the data.
>>
>> A big issue, of course, is authentication and authorization. I'm
>> wondering if anyone else here is doing web services and if so how  
>> you're
>> handling authentication/authorization. Are you using Lift, or are you
>> handling it through the container. Can anyone talk about pros/cons of
>> the different methods? Suggestions?
>>
>> We're thinking about using Berkeley DB XML as the database. Anyone  
>> tried
>> that?
>>
>> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: SHtml form inputs and attributes/labels

2008-11-18 Thread Charles F. Munat

Ha. Great minds stink alike. I just discovered this little setback 
(after adding "id" attributes to about fifty checkboxes -- note to self: 
check one before doing them all).

I've been messing with the map but it's messing with me. I can grab the 
right node pretty easily, but then I can't seem to add the MetaData.

If you're looking to add an id, you can use checkbox_id:

SHtml.checkbox_id(user.isStupid, user.isStupid = _, Full("isStupid"))

which adds id="isStupid" to the checkbox input.

Chas.



Derek Chen-Becker wrote:
> For a really neat trick, how would I set the ID for a checkbox? The 
> SHtml checkbox method returns a NodeSeq. I suppose I could just do a 
> "map", but I was wondering if there was a simpler way.
> 
> Thanks,
> 
> Derek
> 
> On Mon, Nov 17, 2008 at 4:54 PM, David Pollak 
> <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> 
> wrote:
> 
> 
> 
> On Mon, Nov 17, 2008 at 3:41 PM, Charles F. Munat <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>> wrote:
> 
> 
> Added:
> 
> 
> http://liftweb.net/index.php/FAQ#How_do_I_add_attributes_to_form_fields_created_with_SHtml_methods.3F
> 
> 
> Awesome!  Thanks!
>  
> 
> 
> Chas.
> 
> Jorge Ortiz wrote:
>  > Oops, it might be:
>  >
>  > SHtml.text(user.name <http://user.name> <http://user.name>,
> user.name <http://user.name> <http://user.name> = _) %
>  >   ("size" -> "24") %
>  >   ("maxlength" -> "48") %
>  >   ("id" -> "user_name") %
>  >   ("title" -> "Enter your name")
>  >
>  > One or both of those should work.
>  >
>  > --j
>  >
>  > On Mon, Nov 17, 2008 at 12:27 PM, Jorge Ortiz
> <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
>  > <mailto:[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>>> wrote:
>  >
>  > Try:
>  >
>  > SHtml.text(user.name <http://user.name>
> <http://user.name>, user.name <http://user.name>
>  > <http://user.name> = _) %
>  >   ("size", "24") %
>  >   ("maxlength", "48") %
>  >   ("id", "user_name") %
>  >   ("title", "Enter your name")
>  >
>  > That should work.
>  >
>  > --j
>  >
>  > On Mon, Nov 17, 2008 at 12:21 PM, Charles F. Munat
> <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
>  > <mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>> wrote:
>  >
>  >
>  > I spend a lot of time writing % new
> UnprefixedAttribute(...) to add
>  > attributes to SHtml form elements (input, textarea,
> select, etc.).
>  >
>  > It would be nice if the relevant SHtml methods would
> permit optional
>  > extra parameters in the form of tuples where contents
> are name-value
>  > pairs that get translated to attributes. I don't
> think this
>  > would be a
>  > breaking change.
>  >
>  > In other words, instead of:
>  >
>  > SHtml.text(user.name <http://user.name>
> <http://user.name>, user.name <http://user.name>
>  > <http://user.name> = _) %
>  >   new UnprefixedAttribute("size", "24",
>  > new UnprefixedAttribute("maxlength", "48",
>  >   new UnprefixedAttribute("id", "user_name",
>  > new UnprefixedAttribute("title", "Enter your
> name", Null)
>  >   )
>  > )
>  >   )
>  >
>  > I could do:
>  >
>  > SHtml.text(user.name <http://user.name>
> <http://user.name>, user.name <http://user.name>
>  > <http://user.name> = _,
>  >   ("size", "2

[Lift] Re: Scala 2.7.2 and documentation?

2008-11-18 Thread Charles F. Munat

It's on github, I think:

git clone git://github.com/tjweir/liftbook.git

Chas.

Marius wrote:
> Tyler is there a way for me to sneaky see what you guys done so
> far? :)
> 
> Br's,
> Marius
> 
> On Nov 18, 2:50 am, TylerWeir <[EMAIL PROTECTED]> wrote:
>> Derek and I expect the first draft of ours in January 2009.
>>
>> On Nov 17, 7:01 pm, "Oscar Picasso" <[EMAIL PROTECTED]> wrote:
>>
>>> Two book? Wow!
>>> Any idea when they are expected?
>>> Oscar
>>> On Mon, Nov 17, 2008 at 1:51 PM, David Pollak <[EMAIL PROTECTED]
 wrote:
 On Mon, Nov 17, 2008 at 10:33 AM, tacobandit <[EMAIL PROTECTED]> wrote:
> I noticed mvn pulled a new lift today and it seems it's still not
> working with scala 2.7.2? I'm not worried about it or anything just
> wondering if I'm doing something wrong since I think David Pollack
> remarked that once 2.7.2 final was released lift would be immediately
> updated...
 I didn't same "immediately", I said soon after.  Upgrading any software is
 a non-trivial task.
 There is a 2.7.2 branch of Lift.  It's been maintained in parallel with
 Scala's 2.7.2 development.
 Lift depends on more than just Scala... it also depends on Specs and
 ScalaCheck.  These packages were upgraded to Scala 2.7.2-final over the
 weekend.  Expect Lift to be updated to 2.7.2-final this week.
> Also, I'm wondering if there's a master plan for documentation. I
> think that's a huge blocker for wide lift adoption. I mean not just
> the lack of hand-holding tutorial type stuff but even in the
> scaladocs...  If they're anything like me, people pretty much have to
> look at the source code to learn how to use lift... fortunately the
> source is clear and easy to read so it's not so bad, and i'm happy
> with it...   but I just have a curiosity if addressing the
> documentation issue is on the horizon?
 There are two Lift books in the works.  As part of the API clean-up tasks,
 we're writing more ScalaDocs.  It's a long process, but expect reasonable
 documentation when Lift goes 1.0.
 Thanks,
 David
 --
 Lift, the simply functional web frameworkhttp://liftweb.net
 Collaborative Task Managementhttp://much4.us
 Follow me:http://twitter.com/dpp
 Git some:http://github.com/dpp
> > 

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



[Lift] Re: SHtml form inputs and attributes/labels

2008-11-18 Thread Charles F. Munat

So I copied SHtml over for fun and renamed it FH (form helper). Then I 
tried messing with textarea first, just for fun. This can probably be 
done much better, but this works just fine:

private def getAttrs(attrs: Tuple2[String, String]*) : MetaData = {
   attrs.toList match {
 case x :: xs =>
   new UnprefixedAttribute(x._1, x._2, getAttrs(xs: _*))
 case _ => Null
   }
}

def textarea(value: String, func: String => Any,
   attrs: Tuple2[String, String]*): Elem =
 textarea_*(value, SFuncHolder(func), attrs: _*)

def textarea_*(value: String, func: AFuncHolder,
   attrs: Tuple2[String, String]*): Elem = {
 ({value}) %
   getAttrs(attrs: _*)
}

Now I can call it like this:

FH.textarea(contact.message, contact.message = _, ("id", "myId"),
   ("class", "myClass"), ("rows", "12"))

And I get this:



(I added default rows and cols attributes because they are required for 
valid XHTML.)

For what it's worth, this works much better for me.

Chas.

Charles F. Munat wrote:
> Ha. Great minds stink alike. I just discovered this little setback 
> (after adding "id" attributes to about fifty checkboxes -- note to self: 
> check one before doing them all).
> 
> I've been messing with the map but it's messing with me. I can grab the 
> right node pretty easily, but then I can't seem to add the MetaData.
> 
> If you're looking to add an id, you can use checkbox_id:
> 
> SHtml.checkbox_id(user.isStupid, user.isStupid = _, Full("isStupid"))
> 
> which adds id="isStupid" to the checkbox input.
> 
> Chas.
> 
> 
> 
> Derek Chen-Becker wrote:
>> For a really neat trick, how would I set the ID for a checkbox? The 
>> SHtml checkbox method returns a NodeSeq. I suppose I could just do a 
>> "map", but I was wondering if there was a simpler way.
>>
>> Thanks,
>>
>> Derek
>>
>> On Mon, Nov 17, 2008 at 4:54 PM, David Pollak 
>> <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> 
>> wrote:
>>
>>
>>
>> On Mon, Nov 17, 2008 at 3:41 PM, Charles F. Munat <[EMAIL PROTECTED]
>> <mailto:[EMAIL PROTECTED]>> wrote:
>>
>>
>> Added:
>>
>> 
>> http://liftweb.net/index.php/FAQ#How_do_I_add_attributes_to_form_fields_created_with_SHtml_methods.3F
>>
>>
>> Awesome!  Thanks!
>>  
>>
>>
>> Chas.
>>
>> Jorge Ortiz wrote:
>>  > Oops, it might be:
>>  >
>>  > SHtml.text(user.name <http://user.name> <http://user.name>,
>> user.name <http://user.name> <http://user.name> = _) %
>>  >   ("size" -> "24") %
>>  >   ("maxlength" -> "48") %
>>  >   ("id" -> "user_name") %
>>  >   ("title" -> "Enter your name")
>>  >
>>  > One or both of those should work.
>>  >
>>  > --j
>>  >
>>  > On Mon, Nov 17, 2008 at 12:27 PM, Jorge Ortiz
>> <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
>>  > <mailto:[EMAIL PROTECTED]
>> <mailto:[EMAIL PROTECTED]>>> wrote:
>>  >
>>  > Try:
>>  >
>>  > SHtml.text(user.name <http://user.name>
>> <http://user.name>, user.name <http://user.name>
>>  > <http://user.name> = _) %
>>  >   ("size", "24") %
>>  >   ("maxlength", "48") %
>>  >   ("id", "user_name") %
>>  >   ("title", "Enter your name")
>>  >
>>  > That should work.
>>  >
>>  > --j
>>  >
>>  > On Mon, Nov 17, 2008 at 12:21 PM, Charles F. Munat
>> <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
>>  > <mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>> wrote:
>>  >
>>  >
>>  > I spend a lot of time writing % new
>> UnprefixedAttribute(...) to add
>>  > attributes to SHtml form elements (input, textarea,
>> select, etc.).
>>  >
>>  > It would be nice if the relevant SHtml methods would
>&

[Lift] Re: REST CRUD web service

2008-11-18 Thread Charles F. Munat

Cool.

Tim Perrett wrote:
> Hi Chas,
> 
> The code isn't online anywhere right now - I have a couple of eurostar  
> journeys to go on this week so working on this will pass the time :-)
> 
> Watch this space is all I can offer right now - when I have something  
> to share, I'll push the code to my github repo
> 
> Cheers, Tim
> 
> Sent from my iPhone
> 
> On 18 Nov 2008, at 06:42, "Charles F. Munat" <[EMAIL PROTECTED]> wrote:
> 
>> Yeah, I'm thinking Digest is the way I probably want to go. Sorry to
>> hear that it's complicated. Do you have code anywhere that I could  
>> look
>> at (just curious)?
>>
>> Chas.
>>
>> Tim Perrett wrote:
>>> Hey Chas,
>>>
>>> I'm currently writing HTTP auth for lift, so watch this space :-)
>>>
>>> It's unfortunatly pretty complex, so is taking longer than I'd hoped.
>>> I'm impletmenting Basic and Digest auth; the latter being the most
>>> secure.
>>>
>>> Cheers, Tim
>>>
>>> Sent from my iPhone
>>>
>>> On 18 Nov 2008, at 02:21, "Charles F. Munat" <[EMAIL PROTECTED]> wrote:
>>>
>>>> One thing I'm working on is a two-part application that involves a
>>>> Lift
>>>> interface app and a REST CRUD back end. I plan to do the back end in
>>>> Lift as well.
>>>>
>>>> One reason for the separation is that it allows me to build other
>>>> front
>>>> ends for the web service (a desktop app, something on the iPhone, an
>>>> Android app, etc.). Another reason is that the data model is pretty
>>>> complicated, and instantiating a lot of objects is not really
>>>> necessary.
>>>> If I can handle the back end as just data, rather than objects,
>>>> passing
>>>> it in and out using XML, that would be faster and easier, I think.
>>>> And I
>>>> could use an XML database to store the data.
>>>>
>>>> A big issue, of course, is authentication and authorization. I'm
>>>> wondering if anyone else here is doing web services and if so how
>>>> you're
>>>> handling authentication/authorization. Are you using Lift, or are  
>>>> you
>>>> handling it through the container. Can anyone talk about pros/cons  
>>>> of
>>>> the different methods? Suggestions?
>>>>
>>>> We're thinking about using Berkeley DB XML as the database. Anyone
>>>> tried
>>>> that?
>>>>
>>>> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: REST CRUD web service

2008-11-18 Thread Charles F. Munat

If I read this correctly:

"Do I have to pay for a Berkeley DB license to use it in my Perl or 
Python scripts?

No, you may use the Berkeley DB open source license at no cost. The 
Berkeley DB open source license requires that software that uses 
Berkeley DB be freely redistributable. In the case of Perl or Python, 
that software is Perl or Python, and not your scripts. Any scripts you 
write are your property, including scripts that make use of Berkeley DB. 
None of the Perl, Python or Berkeley DB licenses place any restrictions 
on what you may do with them."

I can use any of the Berkeley DB products to back my web service without 
paying for it. Am I missing something?

Chas.

Alex Boisvert wrote:
> On Mon, Nov 17, 2008 at 9:04 PM, Charles F. Munat <[EMAIL PROTECTED] 
> <mailto:[EMAIL PROTECTED]>> wrote:
> 
> 
> Everything you need to know is here:
> 
> http://www.oracle.com/technology/documentation/berkeley-db/xml/index.html
> 
> It's an Apache Software License:
> 
> 
> http://www.oracle.com/technology/software/products/berkeley-db/htdocs/xmloslicense.html
> 
> 
> This is only for Berkeley DB XML (the XQuery parts), which relies on 
> Berkeley DB.
> 
> Berkeley DB itself is dual-licensed.   In short, you cannot redistribute 
> it without a license.
> 
> Details at:
> http://www.oracle.com/technology/software/products/berkeley-db/htdocs/licensing.html
> 
> alex
> 
> 
> > 

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



[Lift] Re: REST CRUD web service

2008-11-18 Thread Charles F. Munat

I believe that this is only if you "redistribute" it. But these licenses 
are very confusing.

Chas.

Erick Fleming wrote:
> Alex,  this is a quote from the link you gave:
> 
> "Under the open source license, you must release the complete source 
> code for the application that uses Berkeley DB, Berkeley DB Java Edition 
> or Berkeley DB XML. You do not need to release the source code for 
> components that are generally installed on the operating system on which 
> your application runs, such as system header files or libraries."
> 
> This says you have to release the source code of your application, if 
> you use the open source license for BDB.
> 
> 
> On Tue, Nov 18, 2008 at 9:27 AM, Alex Boisvert <[EMAIL PROTECTED] 
> <mailto:[EMAIL PROTECTED]>> wrote:
> 
> On Mon, Nov 17, 2008 at 9:04 PM, Charles F. Munat <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>> wrote:
> 
> 
> Everything you need to know is here:
> 
> 
> http://www.oracle.com/technology/documentation/berkeley-db/xml/index.html
> 
> It's an Apache Software License:
> 
> 
> http://www.oracle.com/technology/software/products/berkeley-db/htdocs/xmloslicense.html
> 
> 
> This is only for Berkeley DB XML (the XQuery parts), which relies on
> Berkeley DB.
> 
> Berkeley DB itself is dual-licensed.   In short, you cannot
> redistribute it without a license.
> 
> Details at:
> 
> http://www.oracle.com/technology/software/products/berkeley-db/htdocs/licensing.html
> 
> alex
> 
> 
> 
> 
> 
> > 

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



[Lift] Re: Error on compile with 2.7.2

2008-11-18 Thread Charles F. Munat

One would think so, and maybe it is, but the problem was actually caused 
by two errors in my code: a missing ) and then later an extra ) which 
turned what should have been a compile time error into a runtime error.

That said, do you think there is a problem with the compiler?

Chas.

Jorge Ortiz wrote:
> That's a bug in the Scala compiler.
> 
> Try to comment out code and reduce the bug to it's minimal form to file 
> a bug report: http://lampsvn.epfl.ch/trac/scala/
> 
> --j
> 
> On Tue, Nov 18, 2008 at 2:44 PM, Charles F. Munat <[EMAIL PROTECTED] 
> <mailto:[EMAIL PROTECTED]>> wrote:
> 
> 
> I changed the Scala version to 2.7.2, blew away .m2, did an mvn clean,
> and I now get the error below when I try to compile. I note that none of
> the files concerned are in my app, so I presume this is a Lift thing...
> 
> Any ideas? I'll keep messing with it.
> 
> [INFO] [compiler:compile]
> [INFO] Nothing to compile - all classes are up to date
> [INFO] [scala:compile {execution: default}]
> [INFO] suggestion: remove the scalaVersion from pom.xml
> [INFO] Compiling 28 source files to
> /private/var/www/mine/mine-app/target/classes
> [WARNING] Exception in thread "main"
> java.lang.ArrayIndexOutOfBoundsException: 30
> [WARNING]   at
> scala.tools.nsc.ast.TreeGen.mkTuple(TreeGen.scala:227)
> [WARNING]   at
> scala.tools.nsc.typechecker.Infer$class.actualArgs(Infer.scala:62)
> [WARNING]   at
> scala.tools.nsc.Global$analyzer$.actualArgs(Global.scala:284)
> [WARNING]   at
> scala.tools.nsc.typechecker.Typers$Typer.doTypedApply(Typers.scala:1733)
> [WARNING]   at
> 
> scala.tools.nsc.typechecker.Typers$Typer$$anonfun$tryTypedApply$1$1.apply(Typers.scala:2566)
> [WARNING]   at
> 
> scala.tools.nsc.typechecker.Typers$Typer$$anonfun$tryTypedApply$1$1.apply(Typers.scala:2566)
> [WARNING]   at
> scala.tools.nsc.typechecker.Typers$Typer.silent(Typers.scala:588)
> [WARNING]   at
> 
> scala.tools.nsc.typechecker.Typers$Typer.tryTypedApply$1(Typers.scala:2566)
> [WARNING]   at
> scala.tools.nsc.typechecker.Typers$Typer.typedApply$1(Typers.scala:2617)
> [WARNING]   at
> scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:3219)
> [WARNING]   at
> scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:3323)
> [WARNING]   at
> scala.tools.nsc.typechecker.Typers$Typer.typedArg(Typers.scala:1621)
> [WARNING]   at
> 
> scala.tools.nsc.typechecker.Typers$Typer.typedArgToPoly$1(Typers.scala:1789)
> [WARNING]   at
> 
> scala.tools.nsc.typechecker.Typers$Typer$$anonfun$27.apply(Typers.scala:1798)
> [WARNING]   at
> 
> scala.tools.nsc.typechecker.Typers$Typer$$anonfun$27.apply(Typers.scala:1798)
> [WARNING]   at scala.List$.map2(List.scala:326)
> [WARNING]   at
> scala.tools.nsc.typechecker.Typers$Typer.doTypedApply(Typers.scala:1798)
> [WARNING]   at
> scala.tools.nsc.typechecker.Typers$Typer.typedApply$1(Typers.scala:2619)
> [WARNING]   at
> scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:3219)
> [WARNING]   at
> scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:3323)
> [WARNING]   at
> scala.tools.nsc.typechecker.Typers$Typer.typedArg(Typers.scala:1621)
> [WARNING]   at
> 
> scala.tools.nsc.typechecker.Typers$Typer$$anonfun$typedArgs$1.apply(Typers.scala:1624)
> [WARNING]   at
> 
> scala.tools.nsc.typechecker.Typers$Typer$$anonfun$typedArgs$1.apply(Typers.scala:1624)
> [WARNING]   at scala.List$.loop$1(List.scala:293)
> [WARNING]   at scala.List$.mapConserve(List.scala:310)
> [WARNING]   at scala.List$.loop$1(List.scala:297)
> [WARNING]   at scala.List$.mapConserve(List.scala:310)
> [WARNING]   at scala.List$.loop$1(List.scala:297)
> [WARNING]   at scala.List$.mapConserve(List.scala:310)
> [WARNING]   at scala.List$.loop$1(List.scala:297)
> [WARNING]   at scala.List$.mapConserve(List.scala:310)
> [WARNING]   at scala.List$.loop$1(List.scala:297)
> [WARNING]   at scala.List$.mapConserve(List.scala:310)
> [WARNING]   at scala.List$.loop$1(List.scala:297)
> [WARNING]   at scala.List$.mapConserve(List.scala:310)
> [WARNING]   at scala.List$.loop$1(List.scala:297)
> [WARNING]   at scala.List$.mapConserve(List.scala:310)
> [WARNING]   at scala.List$.loop$1(List.scala:297)
> [WARNING]   at scala.List$.mapConserve(List.scala:310)
> [WARNI

[Lift] Error on compile with 2.7.2

2008-11-18 Thread Charles F. Munat

I changed the Scala version to 2.7.2, blew away .m2, did an mvn clean, 
and I now get the error below when I try to compile. I note that none of 
the files concerned are in my app, so I presume this is a Lift thing...

Any ideas? I'll keep messing with it.

[INFO] [compiler:compile]
[INFO] Nothing to compile - all classes are up to date
[INFO] [scala:compile {execution: default}]
[INFO] suggestion: remove the scalaVersion from pom.xml
[INFO] Compiling 28 source files to 
/private/var/www/mine/mine-app/target/classes
[WARNING] Exception in thread "main" 
java.lang.ArrayIndexOutOfBoundsException: 30
[WARNING]   at scala.tools.nsc.ast.TreeGen.mkTuple(TreeGen.scala:227)
[WARNING]   at 
scala.tools.nsc.typechecker.Infer$class.actualArgs(Infer.scala:62)
[WARNING]   at 
scala.tools.nsc.Global$analyzer$.actualArgs(Global.scala:284)
[WARNING]   at 
scala.tools.nsc.typechecker.Typers$Typer.doTypedApply(Typers.scala:1733)
[WARNING]   at 
scala.tools.nsc.typechecker.Typers$Typer$$anonfun$tryTypedApply$1$1.apply(Typers.scala:2566)
[WARNING]   at 
scala.tools.nsc.typechecker.Typers$Typer$$anonfun$tryTypedApply$1$1.apply(Typers.scala:2566)
[WARNING]   at 
scala.tools.nsc.typechecker.Typers$Typer.silent(Typers.scala:588)
[WARNING]   at 
scala.tools.nsc.typechecker.Typers$Typer.tryTypedApply$1(Typers.scala:2566)
[WARNING]   at 
scala.tools.nsc.typechecker.Typers$Typer.typedApply$1(Typers.scala:2617)
[WARNING]   at 
scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:3219)
[WARNING]   at 
scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:3323)
[WARNING]   at 
scala.tools.nsc.typechecker.Typers$Typer.typedArg(Typers.scala:1621)
[WARNING]   at 
scala.tools.nsc.typechecker.Typers$Typer.typedArgToPoly$1(Typers.scala:1789)
[WARNING]   at 
scala.tools.nsc.typechecker.Typers$Typer$$anonfun$27.apply(Typers.scala:1798)
[WARNING]   at 
scala.tools.nsc.typechecker.Typers$Typer$$anonfun$27.apply(Typers.scala:1798)
[WARNING]   at scala.List$.map2(List.scala:326)
[WARNING]   at 
scala.tools.nsc.typechecker.Typers$Typer.doTypedApply(Typers.scala:1798)
[WARNING]   at 
scala.tools.nsc.typechecker.Typers$Typer.typedApply$1(Typers.scala:2619)
[WARNING]   at 
scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:3219)
[WARNING]   at 
scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:3323)
[WARNING]   at 
scala.tools.nsc.typechecker.Typers$Typer.typedArg(Typers.scala:1621)
[WARNING]   at 
scala.tools.nsc.typechecker.Typers$Typer$$anonfun$typedArgs$1.apply(Typers.scala:1624)
[WARNING]   at 
scala.tools.nsc.typechecker.Typers$Typer$$anonfun$typedArgs$1.apply(Typers.scala:1624)
[WARNING]   at scala.List$.loop$1(List.scala:293)
[WARNING]   at scala.List$.mapConserve(List.scala:310)
[WARNING]   at scala.List$.loop$1(List.scala:297)
[WARNING]   at scala.List$.mapConserve(List.scala:310)
[WARNING]   at scala.List$.loop$1(List.scala:297)
[WARNING]   at scala.List$.mapConserve(List.scala:310)
[WARNING]   at scala.List$.loop$1(List.scala:297)
[WARNING]   at scala.List$.mapConserve(List.scala:310)
[WARNING]   at scala.List$.loop$1(List.scala:297)
[WARNING]   at scala.List$.mapConserve(List.scala:310)
[WARNING]   at scala.List$.loop$1(List.scala:297)
[WARNING]   at scala.List$.mapConserve(List.scala:310)
[WARNING]   at scala.List$.loop$1(List.scala:297)
[WARNING]   at scala.List$.mapConserve(List.scala:310)
[WARNING]   at scala.List$.loop$1(List.scala:297)
[WARNING]   at scala.List$.mapConserve(List.scala:310)
[WARNING]   at scala.List$.loop$1(List.scala:297)
[WARNING]   at scala.List$.mapConserve(List.scala:310)
[WARNING]   at scala.List$.loop$1(List.scala:297)
[WARNING]   at scala.List$.mapConserve(List.scala:310)
[WARNING]   at scala.List$.loop$1(List.scala:297)
[WARNING]   at scala.List$.mapConserve(List.scala:310)
[WARNING]   at 
scala.tools.nsc.typechecker.Typers$Typer.typedArgs(Typers.scala:1624)
[WARNING]   at 
scala.tools.nsc.typechecker.Typers$Typer.doTypedApply(Typers.scala:1727)
[WARNING]   at 
scala.tools.nsc.typechecker.Typers$Typer$$anonfun$tryTypedApply$1$1.apply(Typers.scala:2566)
[WARNING]   at 
scala.tools.nsc.typechecker.Typers$Typer$$anonfun$tryTypedApply$1$1.apply(Typers.scala:2566)
[WARNING]   at 
scala.tools.nsc.typechecker.Typers$Typer.silent(Typers.scala:583)
[WARNING]   at 
scala.tools.nsc.typechecker.Typers$Typer.tryTypedApply$1(Typers.scala:2566)
[WARNING]   at 
scala.tools.nsc.typechecker.Typers$Typer.typedApply$1(Typers.scala:2617)
[WARNING]   at 
scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:3219)
[WARNING]   at 
scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:3323)
[WARNING]   at 
scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:3371)
[WARNING]   at 
scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:3143)
[WARNING] 

[Lift] Re: Error on compile with 2.7.2

2008-11-18 Thread Charles F. Munat

Done.

Jorge Ortiz wrote:
> Anytime the compiler throws an exception it's a bug and should be filed.
> 
> On Tue, Nov 18, 2008 at 3:23 PM, Charles F. Munat <[EMAIL PROTECTED] 
> <mailto:[EMAIL PROTECTED]>> wrote:
> 
> 
> One would think so, and maybe it is, but the problem was actually caused
> by two errors in my code: a missing ) and then later an extra ) which
> turned what should have been a compile time error into a runtime error.
> 
> That said, do you think there is a problem with the compiler?
> 
> Chas.
> 
> Jorge Ortiz wrote:
>  > That's a bug in the Scala compiler.
>  >
>  > Try to comment out code and reduce the bug to it's minimal form
> to file
>  > a bug report: http://lampsvn.epfl.ch/trac/scala/
>  >
>  > --j
>  >
>  > On Tue, Nov 18, 2008 at 2:44 PM, Charles F. Munat <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>
>  > <mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>> wrote:
>  >
>  >
>  > I changed the Scala version to 2.7.2, blew away .m2, did an
> mvn clean,
>  > and I now get the error below when I try to compile. I note
> that none of
>  > the files concerned are in my app, so I presume this is a
> Lift thing...
>  >
>  > Any ideas? I'll keep messing with it.
>  >
>  > [INFO] [compiler:compile]
>  > [INFO] Nothing to compile - all classes are up to date
>  > [INFO] [scala:compile {execution: default}]
>  > [INFO] suggestion: remove the scalaVersion from pom.xml
>  > [INFO] Compiling 28 source files to
>  > /private/var/www/mine/mine-app/target/classes
>  > [WARNING] Exception in thread "main"
>  > java.lang.ArrayIndexOutOfBoundsException: 30
>  > [WARNING]   at
>  > scala.tools.nsc.ast.TreeGen.mkTuple(TreeGen.scala:227)
>  > [WARNING]   at
>  >
> scala.tools.nsc.typechecker.Infer$class.actualArgs(Infer.scala:62)
>  > [WARNING]   at
>  > scala.tools.nsc.Global$analyzer$.actualArgs(Global.scala:284)
>  > [WARNING]   at
>  >
> scala.tools.nsc.typechecker.Typers$Typer.doTypedApply(Typers.scala:1733)
>  > [WARNING]   at
>  >
> 
> scala.tools.nsc.typechecker.Typers$Typer$$anonfun$tryTypedApply$1$1.apply(Typers.scala:2566)
>  > [WARNING]   at
>  >
> 
> scala.tools.nsc.typechecker.Typers$Typer$$anonfun$tryTypedApply$1$1.apply(Typers.scala:2566)
>  > [WARNING]   at
>  > scala.tools.nsc.typechecker.Typers$Typer.silent(Typers.scala:588)
>  > [WARNING]   at
>  >
> 
> scala.tools.nsc.typechecker.Typers$Typer.tryTypedApply$1(Typers.scala:2566)
>  > [WARNING]   at
>  >
> scala.tools.nsc.typechecker.Typers$Typer.typedApply$1(Typers.scala:2617)
>  > [WARNING]   at
>  >
> scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:3219)
>  > [WARNING]   at
>  > scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:3323)
>  > [WARNING]   at
>  >
> scala.tools.nsc.typechecker.Typers$Typer.typedArg(Typers.scala:1621)
>  > [WARNING]   at
>  >
> 
> scala.tools.nsc.typechecker.Typers$Typer.typedArgToPoly$1(Typers.scala:1789)
>  > [WARNING]   at
>  >
> 
> scala.tools.nsc.typechecker.Typers$Typer$$anonfun$27.apply(Typers.scala:1798)
>  > [WARNING]   at
>  >
> 
> scala.tools.nsc.typechecker.Typers$Typer$$anonfun$27.apply(Typers.scala:1798)
>  > [WARNING]   at scala.List$.map2(List.scala:326)
>  > [WARNING]   at
>  >
> scala.tools.nsc.typechecker.Typers$Typer.doTypedApply(Typers.scala:1798)
>  > [WARNING]   at
>  >
> scala.tools.nsc.typechecker.Typers$Typer.typedApply$1(Typers.scala:2619)
>  > [WARNING]   at
>  >
> scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:3219)
>  > [WARNING]   at
>  > scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:3323)
>  > [WARNING]   at
>  >
> scala.tools.nsc.typechecker.Typers$Typer.typedArg(Typers.scala:1621)
>  > [WARNING]   at
>  >
> 
> scala.tools.nsc.typechecker.Typers$T

[Lift] scala plugin with lift in netbeans

2008-11-19 Thread Charles F. Munat

Hey David,

Any chance you could post something for those of us unfamiliar with 
NetBeans on how to import current Lift projects into NB 6.5 and what 
makes it rock the universe? I'd love to switch over from TextMate if it 
will work, but I'm not sure how to go about it.

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



[Lift] Re: scala plugin with lift in netbeans

2008-11-19 Thread Charles F. Munat

Beauty.

Thanks. Any plugins you recommend? Tips and tricks?

Chas.

David Pollak wrote:
> * Download NetBeans 6.5
> * Install
> * Start
> * Open Tools -> Plugins
> * Add
>   
> http://deadlock.netbeans.org/hudson/job/nbms-and-javadoc/lastStableBuild/artifact/nbbuild/nbms/updates.xml.gz
>   to the update centers (see http://wiki.netbeans.org/Scala for more
>   info)
> * On the available plugins tab, select the Scala plugins and Maven
> * NB will restart
> * Open any Maven-based Lift project and it's ready to be edited, etc.
> 
> 
> 
> 
> On Wed, Nov 19, 2008 at 1:43 PM, Charles F. Munat <[EMAIL PROTECTED] 
> <mailto:[EMAIL PROTECTED]>> wrote:
> 
> 
> Hey David,
> 
> Any chance you could post something for those of us unfamiliar with
> NetBeans on how to import current Lift projects into NB 6.5 and what
> makes it rock the universe? I'd love to switch over from TextMate if it
> will work, but I'm not sure how to go about it.
> 
> Chas.
> 
> 
> 
> 
> 
> -- 
> Lift, the simply functional web framework http://liftweb.net
> Collaborative Task Management http://much4.us
> Follow me: http://twitter.com/dpp
> Git some: http://github.com/dpp
> 
> > 

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



[Lift] JsCmd

2008-11-25 Thread Charles F. Munat

I want to update an attribute on a model object in the database via AJAX 
when a checkbox is clicked on a page. I presume that ajaxCheckbox is for 
this purpose.

Can anyone quickly give me an example of how it works?

If I have an attribute called isActive, how would I create an 
ajaxCheckbox that would call a method on the server when the checkbox is 
clicked to set isActive to true or false, depending on the state of the 
checkbox after the click?

bind("mine", xhtml,
   "isActive" -> SHtml.ajaxCheckbox(thing.isActive, ???)

What about selecting the day of the week from an ajaxSelect and updating 
dayOfWeek. Or, finally, updating a text field on blur and setting the 
user_name.

Examples would really help.

I am pretty desperate to have this done today, and several hours of 
playing with various combinations has left me befuddled. Doesn't help 
that it's 4 AM.

Any and all help very greatly appreciated.

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



[Lift] Re: JsCmd

2008-11-25 Thread Charles F. Munat

So that's what Noop is for...

David Pollak wrote:
> Shtml.ajaxCheckbox(thing.isChecked, b => {thing.setChecked(b); JsCmds.Noop})
> 
> On Nov 25, 2008 4:12 AM, "Charles F. Munat" <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>> wrote:
> 
> 
> I want to update an attribute on a model object in the database via AJAX
> when a checkbox is clicked on a page. I presume that ajaxCheckbox is for
> this purpose.
> 
> Can anyone quickly give me an example of how it works?
> 
> If I have an attribute called isActive, how would I create an
> ajaxCheckbox that would call a method on the server when the checkbox is
> clicked to set isActive to true or false, depending on the state of the
> checkbox after the click?
> 
> bind("mine", xhtml,
>   "isActive" -> SHtml.ajaxCheckbox(thing.isActive, ???)
> 
> What about selecting the day of the week from an ajaxSelect and updating
> dayOfWeek. Or, finally, updating a text field on blur and setting the
> user_name.
> 
> Examples would really help.
> 
> I am pretty desperate to have this done today, and several hours of
> playing with various combinations has left me befuddled. Doesn't help
> that it's 4 AM.
> 
> Any and all help very greatly appreciated.
> 
> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Using TemplatePf for JPA powered templates

2008-11-30 Thread Charles F. Munat

Doing nested sets in your Lift snippet is pretty easy with JPA. I'm 
doing it on one of my Lift sites. One thing to remember, however, is to 
use a transaction. You don't want to do half the update to the tree and 
then have another use start an update before you've finished yours (or 
have half of it fail). Once it gets messed up it's a disaster.

Nested tables are good when you have lots of lookups, particularly 
pulling ancestors or descendants, but not too many updates. Inserts are 
not too bad, but if you have to move whole subtrees, that's a pain.

I'm using one for, among other things, a forum, so messages once posted 
never get moved. Nested sets work great for that.

But, honestly, it is astonishing to me that Java, Scala, and especially 
JPA/Hibernate apparently have no built in features for creating, 
manipulating, and persisting trees (and networks are even less 
supported). These problems were largely solved long ago. Why aren't they 
built in?

Rails has a cool set of plugins -- acts_as_list, acts_as_tree, and 
acts_as_nested_set -- that make it drop-dead simple to implement trees. 
I was thinking that it would be cool if Lift had something similar but 
maybe as a trait? So my object extends ActsAsNestedSet?

I tried to do this in Hibernate, but it would require the object to 
query for other similar objects. For example, if I had a Node object 
that I was persisting, I'd like to do

class Node extends ActsAsNestedSet

And then define methods such as moveToChildOf(node), moveToFirst, 
moveBack, moveForth, moveToLast, etc. But it appears that you need an 
EntityManager to run a query, and there doesn't seem to be a way to go 
backwards from the Node to the EntityManager (probably because, if I 
understand it correctly, there will only be one copy of a given Node in 
memory but there may be multiple EntityManagers?).

So I put the code in the snippet.

If you come up with any clever solutions, I'd love to hear them.

Chas.

Tim Perrett wrote:
> Hey Derek,
> 
> I've been playing around with this nested set stuff today - it's pretty 
> cool. I nearly have an app working that uses the db for page content and 
> maps the urls out however you want, it's pretty neat.
> 
> I have a slight HQL problem with subquery's but I'll post that 2mro :-)
> 
> Thanks for all your help
> 
> Tim
> 
> Sent from my iPhone
> 
> On 30 Nov 2008, at 23:37, "Derek Chen-Becker" <[EMAIL PROTECTED] 
> > wrote:
> 
>> IIRC, JPA has support for batch updates, but I'm not 100% positive on 
>> that. I'll have more time tomorrow to look at this if you'd still like 
>> to discuss it.
>>
>> Derek
>>
>> On Sun, Nov 30, 2008 at 12:32 PM, Tim Perrett < 
>> [EMAIL PROTECTED] 
>> > wrote:
>>
>>
>> Derek,
>>
>> Those links are *extremely* good - thank you! I've not really done
>> anything with tree structures before and they are really, really
>> usefull.
>>
>> One thing however, it appears the optimal way of  doing the insert
>> queries would be with stored procedures, however that im not down
>> with, and ideally, i want to keep database vendor independent (part of
>> the point of using JPA) so ideally i want to suck that up into the
>> application logic. For instance:
>>
>> --START
>> SELECT @myRight := rgt FROM nested_category WHERE name =
>> 'TELEVISIONS';
>>
>> UPDATE nested_category SET rgt = rgt + 2 WHERE rgt > @myRight;
>> UPDATE nested_category SET lft = lft + 2 WHERE lft > @myRight;
>>
>> INSERT INTO nested_category(name, lft, rgt) VALUES('GAME CONSOLES',
>> @myRight + 1, @myRight + 2);
>> --END
>>
>> This makes use of variables, and i could of course do this via 3
>> separate queries in JPA, but i wondered if there was a neater way to
>> construct this type of thing with JPA?
>>
>> Any advice you guys have is most welcome
>>
>> Cheers
>>
>> Tim
>>
>>
>> On Nov 30, 2:27 pm, "Derek Chen-Becker" <[EMAIL PROTECTED]
>> > wrote:
>> > If you're heavily skewed towards reads and not writes (as it
>> seems in the
>> > case of a CMS), you might want to look at Celko nested sets:
>> >
>> >
>> 
>> http://www.intelligententerprise.com/001020/celko.jhtml
>> >
>> 
>> http://dev.mysql.com/tech-resources/articles/hierarchical-data.html
>> >
>> > A little more work on updates than an adjacency model, but a lot
>> more
>> > efficient.
>> >
>> > Derek
>>
>>
>>
>>
>>
> 
> > 

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this 

[Lift] JPA find or create new

2008-11-30 Thread Charles F. Munat

Is there a simple way in JPA/Lift to query to retrieve a single object 
from the database, assign it to a val if found, or create a new object 
of that type and assign it instead of there is no such object in the 
database?

Sort of a...

val user: User =
   Model.createNamedQuery(
 "findUserByUsername",
 "username" -> "hal"
   ).findOr(new User())

or something like that? That would be very useful.

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



[Lift] Re: Using TemplatePf for JPA powered templates

2008-12-01 Thread Charles F. Munat

Will do, if I figure it out. But my comment wasn't complaining. I am 
honestly mystified. Am I the only one using trees in Hibernate? Is there 
a tree library in Scala that I'm missing? What the heck does everyone 
else do? It just blows my mind.

Chas.

Viktor Klang wrote:
> 
> 
> On Mon, Dec 1, 2008 at 5:42 AM, Charles F. Munat <[EMAIL PROTECTED] 
> <mailto:[EMAIL PROTECTED]>> wrote:
> 
> 
> Doing nested sets in your Lift snippet is pretty easy with JPA. I'm
> doing it on one of my Lift sites. One thing to remember, however, is to
> use a transaction. You don't want to do half the update to the tree and
> then have another use start an update before you've finished yours (or
> have half of it fail). Once it gets messed up it's a disaster.
> 
> Nested tables are good when you have lots of lookups, particularly
> pulling ancestors or descendants, but not too many updates. Inserts are
> not too bad, but if you have to move whole subtrees, that's a pain.
> 
> I'm using one for, among other things, a forum, so messages once posted
> never get moved. Nested sets work great for that.
> 
> But, honestly, it is astonishing to me that Java, Scala, and especially
> JPA/Hibernate apparently have no built in features for creating,
> manipulating, and persisting trees (and networks are even less
> supported). These problems were largely solved long ago. Why aren't they
> built in?
> 
> 
> Charles, I hate to say this, but Hibernate is Open Source, so you can 
> add the support for it. :)
>  
> 
> 
> 
> Rails has a cool set of plugins -- acts_as_list, acts_as_tree, and
> acts_as_nested_set -- that make it drop-dead simple to implement trees.
> I was thinking that it would be cool if Lift had something similar but
> maybe as a trait? So my object extends ActsAsNestedSet?
> 
> I tried to do this in Hibernate, but it would require the object to
> query for other similar objects. For example, if I had a Node object
> that I was persisting, I'd like to do
> 
> class Node extends ActsAsNestedSet
> 
> And then define methods such as moveToChildOf(node), moveToFirst,
> moveBack, moveForth, moveToLast, etc. But it appears that you need an
> EntityManager to run a query, and there doesn't seem to be a way to go
> backwards from the Node to the EntityManager (probably because, if I
> understand it correctly, there will only be one copy of a given Node in
> memory but there may be multiple EntityManagers?).
> 
> So I put the code in the snippet.
> 
> If you come up with any clever solutions, I'd love to hear them.
> 
> Chas.
> 
> Tim Perrett wrote:
>  > Hey Derek,
>  >
>  > I've been playing around with this nested set stuff today - it's
> pretty
>  > cool. I nearly have an app working that uses the db for page
> content and
>  > maps the urls out however you want, it's pretty neat.
>  >
>  > I have a slight HQL problem with subquery's but I'll post that
> 2mro :-)
>  >
>  > Thanks for all your help
>  >
>  > Tim
>  >
>  > Sent from my iPhone
>  >
>  > On 30 Nov 2008, at 23:37, "Derek Chen-Becker"
> <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
>  > <mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>> wrote:
>  >
>  >> IIRC, JPA has support for batch updates, but I'm not 100%
> positive on
>  >> that. I'll have more time tomorrow to look at this if you'd
> still like
>  >> to discuss it.
>  >>
>  >> Derek
>  >>
>  >> On Sun, Nov 30, 2008 at 12:32 PM, Tim Perrett <
>  >> <mailto:[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>>[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>
>  >> <mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>> wrote:
>  >>
>  >>
>  >> Derek,
>  >>
>  >> Those links are *extremely* good - thank you! I've not
> really done
>  >> anything with tree structures before and they are really, really
>  >> usefull.
>  >>
>  >> One thing however, it appears the optimal way of  doing the
> insert
>  >> queries would be with stored procedures, however that im not
> down
>  >> with, and ideally, i want to keep da

[Lift] Re: JPA find or create new

2008-12-01 Thread Charles F. Munat

That will probably work. I was thinking it would be nice to build in a 
method findOrNew that would do it for me... but it looks like that might 
involve some sort of implicit manifest thingy, so I don't know.

Chas.

Viktor Klang wrote:
> 
> 
> On Mon, Dec 1, 2008 at 7:12 AM, Charles F. Munat <[EMAIL PROTECTED] 
> <mailto:[EMAIL PROTECTED]>> wrote:
> 
> 
> Is there a simple way in JPA/Lift to query to retrieve a single object
> from the database, assign it to a val if found, or create a new object
> of that type and assign it instead of there is no such object in the
> database?
> 
> Sort of a...
> 
> val user: User =
>   Model.createNamedQuery(
> "findUserByUsername",
> "username" -> "hal"
>   ).findOr(new User())
> 
> 
> (Can ! (yourQuery.uniqueResult)).openOr(new User())
>  
> Should work?
> 
> 
> 
> or something like that? That would be very useful.
> 
> Thanks,
> Chas.
> 
> 
> 
> 
> 
> -- 
> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Using TemplatePf for JPA powered templates

2008-12-01 Thread Charles F. Munat

Are you including a link to the parent node or are you just using the 
left and right values to figure out which nodes are children? I always 
include a foreign key to the parent so I can just select the children of 
that parent directly. Then to get all descendants, I use the left and 
right values. Similarly, to get the parent I use the foreign key, to get 
all ancestors, I use the left/right values.

Does this help?

(Sometimes I also include a calculated field called "level" which 
indicates how far away I am from the root node. It's a simple matter of 
counting the ancestors, but you have to remember to update it on moves. 
The level field is very useful if you want to go, say, two levels deep 
on children, or to parent and grandparent, but not great-grandparent.)

Chas.

Tim Perrett wrote:
> 
> 
> On Dec 1, 9:21 am, "Charles F. Munat" <[EMAIL PROTECTED]> wrote:
>> Will do, if I figure it out. But my comment wasn't complaining. I am
>> honestly mystified. Am I the only one using trees in Hibernate? Is there
>> a tree library in Scala that I'm missing? What the heck does everyone
>> else do? It just blows my mind.
> 
> I found someone's contribution on Hibernate JIRA for handling sets,
> but it never seems to make it into core or the proper distro; it does
> seem odd its not in there.
> 
> Anyway, the HQL problem I mentioned last night... I have the following
> HQL, which is just a slight mod from what was in that mysql article;
> effectivly I want to list all the children of a single leaf:
> 
> SELECT node.name, (COUNT(parent.name) - (sub_tree.depth + 1)) AS depth
> FROM Content AS node,
>   Content AS parent,
>   Content AS sub_parent,
> ( SELECT node.name, (COUNT(parent.name) - 1) AS depth
> FROM Content AS node,
> Content AS parent
> WHERE node.lft BETWEEN parent.lft AND parent.rft
> AND node.name = :leaf
> GROUP BY node.name
> ORDER BY node.lft
> ) AS sub_tree
> WHERE node.lft BETWEEN parent.lft AND parent.rft
> AND node.lft BETWEEN sub_parent.lft AND sub_parent.rft
> AND sub_parent.name = sub_tree.name
> GROUP BY node.name
> HAVING depth <= 1
> ORDER BY node.lft
> 
> However, it bombs on the sub-query in the SELECT ... FROM ...
>  statement im guessing you guys are using "get all leaf
> nodes" type queries, so what are you doing instead of this?
> 
> Cheers
> 
> Tim
> > 

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



[Lift] Re: Using TemplatePf for JPA powered templates

2008-12-01 Thread Charles F. Munat

When I use a nested set, I make it like a combination of nested set and 
a simple tree. So in my database, I have:

idparent_idlftrgtname
--
  1 NULL  1 20Electronics
  21  2  9Televisions
  32  3  4Tube
  42  5  6LCD
  52  7  8Plasma
  61 10 19Portable Electronics
  76 11 14MP3 Players
  87 12 13Flash
  96 15 16CD Players
106 17 182-way Radios

Then I get things the following way:

For MP3 Players (#7):

-- Ancestors
select * from mytable where lft < 11 and rgt > 14;

-- Ancestors and self
select * from mytable where lft <= 11 and rgt >= 14;

-- Parent
select * from mytable where id = 6;

-- Siblings and self
select * from mytable where parent_id = 6;

-- Siblings
select * from mytable where parent_id = 6 and id <> 7;

-- Siblings on the left
select * from mytable where parent_id = 6 and rgt < 11;

-- Siblings on the right
select * from mytable where parent_id = 6 and lft > 14;

-- Immediate children
select * from mytable where parent_id = 7;

-- Descendants and self
select * from mytable where lft >= 11 and rgt <= 14;

-- Descendants
select * from mytable where lft > 11 and rgt < 14;

In JPA/Hibernate, you'd have to modify this slightly. Each node in the 
tree would have a parent: Node attribute and a children: 
java.util.Set[Node] attribute.

So then for example to get immediate children you would do:

from Node n where n.parent.id = :id

(But you could just access them through node.children as well.)

Is this helping at all?

Chas.

Tim Perrett wrote:
> Im not sure I follow? Can you use this diagram to try and explain?:
> 
> http://dev.mysql.com/tech-resources/articles/hierarchical-data-4.png
> 
> If you wanted to select the direct children of 'electronics', how
> would one go about doing that? Is there a simpler way than all that
> HQL?
> 
> Cheers
> 
> Tim
> 
> On Dec 1, 10:28 am, "Charles F. Munat" <[EMAIL PROTECTED]> wrote:
>> Are you including a link to the parent node or are you just using the
>> left and right values to figure out which nodes are children? I always
>> include a foreign key to the parent so I can just select the children of
>> that parent directly. Then to get all descendants, I use the left and
>> right values. Similarly, to get the parent I use the foreign key, to get
>> all ancestors, I use the left/right values.
>>
>> Does this help?
>>
>> (Sometimes I also include a calculated field called "level" which
>> indicates how far away I am from the root node. It's a simple matter of
>> counting the ancestors, but you have to remember to update it on moves.
>> The level field is very useful if you want to go, say, two levels deep
>> on children, or to parent and grandparent, but not great-grandparent.)
>>
>> Chas.
>>
>> Tim Perrett wrote:
>>
>>> On Dec 1, 9:21 am, "Charles F. Munat" <[EMAIL PROTECTED]> wrote:
>>>> Will do, if I figure it out. But my comment wasn't complaining. I am
>>>> honestly mystified. Am I the only one using trees in Hibernate? Is there
>>>> a tree library in Scala that I'm missing? What the heck does everyone
>>>> else do? It just blows my mind.
>>> I found someone's contribution on Hibernate JIRA for handling sets,
>>> but it never seems to make it into core or the proper distro; it does
>>> seem odd its not in there.
>>> Anyway, the HQL problem I mentioned last night... I have the following
>>> HQL, which is just a slight mod from what was in that mysql article;
>>> effectivly I want to list all the children of a single leaf:
>>> SELECT node.name, (COUNT(parent.name) - (sub_tree.depth + 1)) AS depth
>>> FROM Content AS node,
>>>   Content AS parent,
>>>   Content AS sub_parent,
>>> ( SELECT node.name, (COUNT(parent.name) - 1) AS depth
>>> FROM Content AS node,
>>> Content AS parent
>>> WHERE node.lft BETWEEN parent.lft AND parent.rft
>>> AND node.name = :leaf
>>> GROUP BY node.name
>>> ORDER BY node.lft
>>> ) AS sub_tree
>>> WHERE node.lft BETWEEN parent.lft AND parent.rft
>>> AND node.lft BETWEEN sub_parent.lft AND sub_parent.rft
>>> AND sub_parent.name = sub_tree.name
>>> GROUP BY node.name
>>

[Lift] Re: JPA find or create new

2008-12-01 Thread Charles F. Munat

Thanks. Types are still largely a mystery to me, but this works just fine.

Chas.

Derek Chen-Becker wrote:
> Because it's type erasure I don't think I can do a generic "new" inside 
> the methods, but the findOne method does return a Can. That means that 
> you were actually pretty close in your demo code. Here's what it could 
> look like:
> 
> val user: User =
>   Model.createNamedQuery[User](
> "findUserByUsername",
> "username" -> "hal"
>   ).findOne or (new User)
> 
> Derek
> 
> On Mon, Dec 1, 2008 at 2:24 AM, Charles F. Munat <[EMAIL PROTECTED] 
> <mailto:[EMAIL PROTECTED]>> wrote:
> 
> 
> That will probably work. I was thinking it would be nice to build in a
> method findOrNew that would do it for me... but it looks like that might
> involve some sort of implicit manifest thingy, so I don't know.
> 
> Chas.
> 
> Viktor Klang wrote:
>  >
>  >
>  > On Mon, Dec 1, 2008 at 7:12 AM, Charles F. Munat <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>
>  > <mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>> wrote:
>  >
>  >
>  > Is there a simple way in JPA/Lift to query to retrieve a
> single object
>  > from the database, assign it to a val if found, or create a
> new object
>  > of that type and assign it instead of there is no such object
> in the
>  > database?
>  >
>  > Sort of a...
>  >
>  > val user: User =
>  >   Model.createNamedQuery(
>  > "findUserByUsername",
>  > "username" -> "hal"
>  >   ).findOr(new User())
>  >
>  >
>  > (Can ! (yourQuery.uniqueResult)).openOr(new User())
>  >
>  > Should work?
>  >
>  >
>  >
>  > or something like that? That would be very useful.
>  >
>  > Thanks,
>  > Chas.
>  >
>  >
>  >
>  >
>  >
>  > --
>  > 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Inserting/deleting table rows with AJAX

2008-12-01 Thread Charles F. Munat

I have a table in which each row represents an object in the database, 
with each cell in the row an input bound to an attribute of the object. 
I want to be able to add rows (with new, blank objects) and delete rows 
(deleting both the row on the page and the associated object in the 
database).

I've set up a snippet method to insert a new row. It returns the table 
row with all the inputs nicely bound. How do I call this with AJAX and 
insert the NodeSeq into the current table?

At the end of the row I have a [-] ajaxButton. It should delete that row 
and the associated object using AJAX, but when I click it, the page 
reloads and nothing changes.

I've looked through the jQuery Lift stuff. Am I using the ajaxButton 
wrong? Why would the page reload? And what methods are appropriate to 
both updating an object (Model.remove(obj)) and deleting the row 
($('#rowid').remove())?

Any help appreciated.

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



[Lift] Re: Inserting/deleting table rows with AJAX

2008-12-01 Thread Charles F. Munat

Hmm. Crap. Damn that IE.

Well, I have something working in Firefox on Mac for the button. It's 
probably more complicated than it needs to be...

def ajaxRemove(name: String,
   func: AFuncHolder,
   attrs: Tuple2[String, String]*): Elem = {
 val funcName = mapFunc(func)
   () %
 ("value" -> name) %
 ("onclick" -> (makeAjaxCall(JsRaw("'" +
   funcName+"='+this.checked")) + "; return false")) %
 ("class" -> "removeButton") %
 getAttrs(attrs: _*)
}

Then:

{FH.ajaxRemove("-",
   () => {
 val x = Model.getReference[X](classOf[X], tp.id)
 survey.technicalPotentials.remove(x)
 Model.merge(survey)
 Model.remove(x)
 Model.flush()
 Run("$('#tp" + tp.id.toString + "').hide().remove();")
   })}

#tp + tp.id.toString is the id of the  attribute.

I'll crank up the virtual machine and test it in IE.

Thanks for looking at this.

I could conceivably hide the row and delete all the individual inputs 
(or maybe just hide the row), but that seems pretty kludgy.

Chas.

David Pollak wrote:
> Charles,
> 
> If you're planning to deploy this app in IE, you may have an issue.  My 
> experience with IE is that adding/removing  doesn't always work 
> well. :-(
> 
> What is most likely happening is that your button is inside a form.  It 
> turns out that there's a race condition where sometimes the 
> XmlHttpRequest will get fired first and sometimes the form will be 
> submitted first.
> 
> Lemme see if I can do something fancy with returning false from the 
> button ajax request to the event doesn't bubble up.
> 
> Thanks,
> 
> David
> 
> On Mon, Dec 1, 2008 at 1:08 PM, Charles F. Munat <[EMAIL PROTECTED] 
> <mailto:[EMAIL PROTECTED]>> wrote:
> 
> 
> I have a table in which each row represents an object in the database,
> with each cell in the row an input bound to an attribute of the object.
> I want to be able to add rows (with new, blank objects) and delete rows
> (deleting both the row on the page and the associated object in the
> database).
> 
> I've set up a snippet method to insert a new row. It returns the table
> row with all the inputs nicely bound. How do I call this with AJAX and
> insert the NodeSeq into the current table?
> 
> At the end of the row I have a [-] ajaxButton. It should delete that row
> and the associated object using AJAX, but when I click it, the page
> reloads and nothing changes.
> 
> I've looked through the jQuery Lift stuff. Am I using the ajaxButton
> wrong? Why would the page reload? And what methods are appropriate to
> both updating an object (Model.remove(obj)) and deleting the row
> ($('#rowid').remove())?
> 
> Any help appreciated.
> 
> Chas.
> 
> 
> 
> 
> 
> -- 
> Lift, the simply functional web framework http://liftweb.net
> Collaborative Task Management http://much4.us
> Follow me: http://twitter.com/dpp
> Git some: http://github.com/dpp
> 
> > 

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



[Lift] Re: Tools

2008-12-01 Thread Charles F. Munat

I've tried twice to get NetBeans up and running on my MacBook Pro with 2 
gigs of RAM. Both times I made the mistake of loading in the entire 
liftweb library. After that -- and even after I closed the liftweb 
master project -- NetBeans will lock up for long periods of time (e.g. 
ten minutes or more) every few keystrokes to do some sort of indexing. 
It is unbelievably frustrating. Closing and re-opening NetBeans, 
rebooting the computer, etc. do nothing to help. As far as I can tell, 
once that happens, NetBeans is toast.

I plan to reinstall NetBeans (for the nth time) and *never* open Lift in 
it, but that sort of defeats the purpose a bit since perusing the source 
code is where it would be most useful. Maybe I need to set some variable 
differently? I tried enlarging the heap space and things just got worse.

I don't seem to have a plethora of other choices.

Chas.

David Pollak wrote:
> Charles,
> 
> I use NetBeans and a whole lot of printlns.  In general, if you've got a 
> case class or Scala collections, the toString methods are pretty 
> descriptive of what's going on.
> 
> I have heard tell that it's possible to hook the NetBeans debugger up to 
> a running Jetty instance and do breakpoints in the Scala code and 
> inspect variables.  I have not tried it myself.
> 
> Thanks,
> 
> David
> 
> On Wed, Oct 15, 2008 at 8:22 AM, Charles F. Munat <[EMAIL PROTECTED] 
> <mailto:[EMAIL PROTECTED]>> wrote:
> 
> 
> One of the hardest parts about learning Lift and Scala is not really
> know what objects look like. Things get pretty complicated and it's
> difficult to remember what's in what.
> 
> It would be very nice to be able to step through Lift and see exactly
> what is where in memory and how things change, etc. Normally, I'd use an
> IDE for this. I used to work in C#, and Visual Studio has some very nice
> tools. I can step through the program, look in any variable to see
> what's in it, etc.
> 
> In Ruby, I use TextMate. I'm not very good at it, so most of my
> techniques are more rudimentary. But Rails has a nice method called
> debug. I can spit out what's in a variable by just adding:
> 
> <%= debug @my_variable %>
> 
> to a template. Lift, however, eschews code in templates. I created a
> Test snippet to do the same thing, but I'm having trouble understanding
> reflection in Scala. In Ruby, object.inspect or object.to_yaml can give
> me a pretty good picture of the object.
> 
> I've tried Lift in Eclipse, NetBeans, and JEdit and none of them seem to
> work very well. Out of memory errors are common, or I just can't seem to
> get it set up properly.
> 
> What tricks are others using to make it easier to see what's going on in
> Lift? Is there a way to step through a request and see exactly what
> happens and in what order? I would kill for that ability.
> 
> Chas.
> 
> 
> 
> 
> 
> -- 
> Lift, the simply functional web framework http://liftweb.net
> Collaborative Task Management http://much4.us
> Follow me: http://twitter.com/dpp
> Git some: http://github.com/dpp
> 
> > 

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



[Lift] Re: Tools

2008-12-01 Thread Charles F. Munat

Cool. I hope I get time to read this really soon.

Thanks!

Chas.

Derek Chen-Becker wrote:
> I've done it in Eclipse and I'm assuming it would be similarly easy in 
> NetBeans. There's a good article on setting up Maven remote debugging 
> with Jetty here:
> 
> http://www.mojavelinux.com/blog/archives/2007/03/remote_debugging_with_jetty/
> 
> Derek
> 
> On Mon, Dec 1, 2008 at 2:43 PM, David Pollak 
> <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> 
> wrote:
> 
> Charles,
> 
> I use NetBeans and a whole lot of printlns.  In general, if you've
> got a case class or Scala collections, the toString methods are
> pretty descriptive of what's going on.
> 
> I have heard tell that it's possible to hook the NetBeans debugger
> up to a running Jetty instance and do breakpoints in the Scala code
> and inspect variables.  I have not tried it myself.
> 
> Thanks,
> 
> David
> 
> 
> On Wed, Oct 15, 2008 at 8:22 AM, Charles F. Munat <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>> wrote:
> 
> 
> One of the hardest parts about learning Lift and Scala is not really
> know what objects look like. Things get pretty complicated and it's
> difficult to remember what's in what.
> 
> It would be very nice to be able to step through Lift and see
> exactly
> what is where in memory and how things change, etc. Normally,
> I'd use an
> IDE for this. I used to work in C#, and Visual Studio has some
> very nice
> tools. I can step through the program, look in any variable to see
> what's in it, etc.
> 
> In Ruby, I use TextMate. I'm not very good at it, so most of my
> techniques are more rudimentary. But Rails has a nice method called
> debug. I can spit out what's in a variable by just adding:
> 
> <%= debug @my_variable %>
> 
> to a template. Lift, however, eschews code in templates. I created a
> Test snippet to do the same thing, but I'm having trouble
> understanding
> reflection in Scala. In Ruby, object.inspect or object.to_yaml
> can give
> me a pretty good picture of the object.
> 
> I've tried Lift in Eclipse, NetBeans, and JEdit and none of them
> seem to
> work very well. Out of memory errors are common, or I just can't
> seem to
> get it set up properly.
> 
> What tricks are others using to make it easier to see what's
> going on in
> Lift? Is there a way to step through a request and see exactly what
> happens and in what order? I would kill for that ability.
> 
> Chas.
> 
> 
> 
> 
> 
> -- 
> Lift, the simply functional web framework http://liftweb.net
> Collaborative Task Management http://much4.us
> Follow me: http://twitter.com/dpp
> Git some: http://github.com/dpp
> 
> 
> 
> 
> 
> > 

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



[Lift] Re: Inserting/deleting table rows with AJAX

2008-12-01 Thread Charles F. Munat

Will do. Thanks.

Chas.

David Pollak wrote:
> Charles,
> 
> I just checked in code that has a "return false" at the end of 
> ajaxButton.  If you've pulled the Lift source from GitHub, please do a 
> fresh pull and an "mvn clean install" on Lift and then give it a try.
> 
> Thanks,
> 
> David
> 
> On Mon, Dec 1, 2008 at 2:18 PM, Charles F. Munat <[EMAIL PROTECTED] 
> <mailto:[EMAIL PROTECTED]>> wrote:
> 
> 
> Hmm. Crap. Damn that IE.
> 
> Well, I have something working in Firefox on Mac for the button. It's
> probably more complicated than it needs to be...
> 
> def ajaxRemove(name: String,
>   func: AFuncHolder,
>   attrs: Tuple2[String, String]*): Elem = {
> val funcName = mapFunc(func)
>   () %
> ("value" -> name) %
> ("onclick" -> (makeAjaxCall(JsRaw("'" +
>   funcName+"='+this.checked")) + "; return false")) %
> ("class" -> "removeButton") %
> getAttrs(attrs: _*)
> }
> 
> Then:
> 
> {FH.ajaxRemove("-",
>   () => {
> val x = Model.getReference[X](classOf[X], tp.id <http://tp.id>)
> survey.technicalPotentials.remove(x)
> Model.merge(survey)
> Model.remove(x)
> Model.flush()
> Run("$('#tp" + tp.id.toString + "').hide().remove();")
>   })}
> 
> #tp + tp.id.toString is the id of the  attribute.
> 
> I'll crank up the virtual machine and test it in IE.
> 
> Thanks for looking at this.
> 
> I could conceivably hide the row and delete all the individual inputs
> (or maybe just hide the row), but that seems pretty kludgy.
> 
> Chas.
> 
> David Pollak wrote:
>  > Charles,
>  >
>  > If you're planning to deploy this app in IE, you may have an
> issue.  My
>  > experience with IE is that adding/removing  doesn't always work
>  > well. :-(
>  >
>  > What is most likely happening is that your button is inside a
> form.  It
>  > turns out that there's a race condition where sometimes the
>  > XmlHttpRequest will get fired first and sometimes the form will be
>  > submitted first.
>  >
>  > Lemme see if I can do something fancy with returning false from the
>  > button ajax request to the event doesn't bubble up.
>  >
>  > Thanks,
>  >
>  > David
>  >
>  > On Mon, Dec 1, 2008 at 1:08 PM, Charles F. Munat <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>
>  > <mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>> wrote:
>  >
>  >
>  > I have a table in which each row represents an object in the
> database,
>  > with each cell in the row an input bound to an attribute of
> the object.
>  > I want to be able to add rows (with new, blank objects) and
> delete rows
>  > (deleting both the row on the page and the associated object
> in the
>  > database).
>  >
>  > I've set up a snippet method to insert a new row. It returns
> the table
>  > row with all the inputs nicely bound. How do I call this with
> AJAX and
>  > insert the NodeSeq into the current table?
>  >
>  > At the end of the row I have a [-] ajaxButton. It should
> delete that row
>  > and the associated object using AJAX, but when I click it,
> the page
>  > reloads and nothing changes.
>  >
>  > I've looked through the jQuery Lift stuff. Am I using the
> ajaxButton
>  > wrong? Why would the page reload? And what methods are
> appropriate to
>  > both updating an object (Model.remove(obj)) and deleting the row
>  > ($('#rowid').remove())?
>  >
>  > Any help appreciated.
>  >
>  > Chas.
>  >
>  >
>  >
>  >
>  >
>  > --
>  > Lift, the simply functional web framework http://liftweb.net
>  > Collaborative Task Management http://much4.us
>  > Follow me: http://twitter.com/dpp
>  > Git some: http://github.com/dpp
>  >
>  > >
> 
> 
> 
> 
> 
> -- 
> Lift, the simply functional web framework http://liftweb.net
> Collaborative Task Management http://much4.us
> Follow me: http://twitter.com/dpp
> Git some: http://github.com/dpp
> 
> > 

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



[Lift] Re: SHtml form inputs and attributes/labels

2008-12-01 Thread Charles F. Munat

I figured there was a better way to do it. I rewrote pretty much all of 
SHtml to allow adding attributes easily (which is why mine says FH 
instead of SHtml). This looks interesting. I'll check it out.

Thanks,
Chas.

David Pollak wrote:
> Charles,
> 
> Thanks for the suggestion.
> 
> I've just checked up code that looks something like yours:
> 
>   def ajaxButton(text: NodeSeq, func: () => JsCmd, attrs: (String, 
> String)*): Elem =
> attrs.foldLeft( onclick={makeAjaxCall(Str(mapFunc(func)+"=true")).toJsCmd+"; return false;"}
> >{text})(_ % _)
> 
> All the various form element creation methods take an attrs vararg.
> 
> Also, note the use of foldLeft
> 
> Thanks,
> 
> David
> 
> 
> On Tue, Nov 18, 2008 at 1:25 AM, Charles F. Munat <[EMAIL PROTECTED] 
> <mailto:[EMAIL PROTECTED]>> wrote:
> 
> 
> So I copied SHtml over for fun and renamed it FH (form helper). Then I
> tried messing with textarea first, just for fun. This can probably be
> done much better, but this works just fine:
> 
> private def getAttrs(attrs: Tuple2[String, String]*) : MetaData = {
>   attrs.toList match {
> case x :: xs =>
>   new UnprefixedAttribute(x._1, x._2, getAttrs(xs: _*))
> case _ => Null
>   }
> }
> 
> def textarea(value: String, func: String => Any,
>   attrs: Tuple2[String, String]*): Elem =
> textarea_*(value, SFuncHolder(func), attrs: _*)
> 
> def textarea_*(value: String, func: AFuncHolder,
>   attrs: Tuple2[String, String]*): Elem = {
> ( rows="8" cols="40">{value}) %
>   getAttrs(attrs: _*)
> }
> 
> Now I can call it like this:
> 
> FH.textarea(contact.message, contact.message = _, ("id", "myId"),
>   ("class", "myClass"), ("rows", "12"))
> 
> And I get this:
> 
> 
> 
> (I added default rows and cols attributes because they are required for
> valid XHTML.)
> 
> For what it's worth, this works much better for me.
> 
> Chas.
> 
> Charles F. Munat wrote:
>  > Ha. Great minds stink alike. I just discovered this little setback
>  > (after adding "id" attributes to about fifty checkboxes -- note
> to self:
>  > check one before doing them all).
>  >
>  > I've been messing with the map but it's messing with me. I can
> grab the
>  > right node pretty easily, but then I can't seem to add the MetaData.
>  >
>  > If you're looking to add an id, you can use checkbox_id:
>  >
>  > SHtml.checkbox_id(user.isStupid, user.isStupid = _, Full("isStupid"))
>  >
>  > which adds id="isStupid" to the checkbox input.
>  >
>  > Chas.
>  >
>  >
>  >
>  > Derek Chen-Becker wrote:
>  >> For a really neat trick, how would I set the ID for a checkbox? The
>  >> SHtml checkbox method returns a NodeSeq. I suppose I could just do a
>  >> "map", but I was wondering if there was a simpler way.
>  >>
>  >> Thanks,
>  >>
>  >> Derek
>  >>
>  >> On Mon, Nov 17, 2008 at 4:54 PM, David Pollak
>  >> <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>
> <mailto:[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>>>
>  >> wrote:
>  >>
>  >>
>  >>
>  >> On Mon, Nov 17, 2008 at 3:41 PM, Charles F. Munat
> <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
>  >> <mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>> wrote:
>  >>
>  >>
>  >> Added:
>  >>
>  >>
> 
> http://liftweb.net/index.php/FAQ#How_do_I_add_attributes_to_form_fields_created_with_SHtml_methods.3F
>  >>
>  >>
>  >> Awesome!  Thanks!
>  >>
>  >>
>  >>
>  >> Chas.
>  >>
>  >> Jorge Ortiz wrote:
>  >>  > Oops, it might be:
>  >>  >
>  >>  > SHtml.text(user.name <http://user.name>
> <http://user.name> <http://user.name>,
>  >> user.name <http://user.name> <http://user.name>
> <http://user.name> = _) %
>  &g

[Lift] Re: Are there printable versions of any draft Lift books?

2008-12-01 Thread Charles F. Munat

You can use Lyx to create a pdf of Tyler & Derek's book and then print 
that. It's a big install. I'm using it on Mac and it works very well.

http://www.lyx.org/

Once you install it I think you can just double-click on the master.lyx 
file and then choose File > Export > ... (I use pdflatex).

If you clone their book from github (Tyler or Derek might have the link 
handy), then you can do regular pulls, and regenerate the master.pdf file.

You can probably also generate pdfs from individual chapters, if that's 
easier for you.

Hope that helps.

Chas.

mal3 wrote:
> Are there printable versions of any draft Lift books?
> 
> It would help me and would provide an easy basis for feedback to the
> authors if the Lift books currently in draft were made available for
> easy
> download and printing, in say PDF format.
> 
> The Scala book early access process was both useful and efficient.
> 
> I'm not expecting polished early drafts. Just something to read that
> will
> help enlighten me about Lift.
> 
> Mal.
> 
> > 

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



[Lift] Re: Tools

2008-12-01 Thread Charles F. Munat

I thought I had updated to that, but maybe I broke it before the 
update... Will install all the latest this time and will see what 
happens. But I had the same experience a couple of months ago when I 
tried it for the first time. I'd really like it to work, though. That 
would be great, and it would be consistent with my Linux box.

Chas.

David Pollak wrote:
> There was a defect in the plugin.  Cauyuon posted a fix to this list 
> last week.
> 
> On Mon, Dec 1, 2008 at 3:07 PM, Charles F. Munat <[EMAIL PROTECTED] 
> <mailto:[EMAIL PROTECTED]>> wrote:
> 
> 
> I've tried twice to get NetBeans up and running on my MacBook Pro with 2
> gigs of RAM. Both times I made the mistake of loading in the entire
> liftweb library. After that -- and even after I closed the liftweb
> master project -- NetBeans will lock up for long periods of time (e.g.
> ten minutes or more) every few keystrokes to do some sort of indexing.
> It is unbelievably frustrating. Closing and re-opening NetBeans,
> rebooting the computer, etc. do nothing to help. As far as I can tell,
> once that happens, NetBeans is toast.
> 
> I plan to reinstall NetBeans (for the nth time) and *never* open Lift in
> it, but that sort of defeats the purpose a bit since perusing the source
> code is where it would be most useful. Maybe I need to set some variable
> differently? I tried enlarging the heap space and things just got worse.
> 
> I don't seem to have a plethora of other choices.
> 
> Chas.
> 
> David Pollak wrote:
>  > Charles,
>  >
>  > I use NetBeans and a whole lot of printlns.  In general, if
> you've got a
>  > case class or Scala collections, the toString methods are pretty
>  > descriptive of what's going on.
>  >
>  > I have heard tell that it's possible to hook the NetBeans
> debugger up to
>  > a running Jetty instance and do breakpoints in the Scala code and
>  > inspect variables.  I have not tried it myself.
>  >
>  > Thanks,
>  >
>  > David
>  >
>  > On Wed, Oct 15, 2008 at 8:22 AM, Charles F. Munat <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>
>  > <mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>> wrote:
>  >
>  >
>  > One of the hardest parts about learning Lift and Scala is not
> really
>  > know what objects look like. Things get pretty complicated
> and it's
>  > difficult to remember what's in what.
>  >
>  > It would be very nice to be able to step through Lift and see
> exactly
>  > what is where in memory and how things change, etc. Normally,
> I'd use an
>  > IDE for this. I used to work in C#, and Visual Studio has
> some very nice
>  > tools. I can step through the program, look in any variable
> to see
>  > what's in it, etc.
>  >
>  > In Ruby, I use TextMate. I'm not very good at it, so most of my
>  > techniques are more rudimentary. But Rails has a nice method
> called
>  > debug. I can spit out what's in a variable by just adding:
>  >
>  > <%= debug @my_variable %>
>  >
>  > to a template. Lift, however, eschews code in templates. I
> created a
>  > Test snippet to do the same thing, but I'm having trouble
> understanding
>  > reflection in Scala. In Ruby, object.inspect or
> object.to_yaml can give
>  > me a pretty good picture of the object.
>  >
>  > I've tried Lift in Eclipse, NetBeans, and JEdit and none of
> them seem to
>  > work very well. Out of memory errors are common, or I just
> can't seem to
>  > get it set up properly.
>  >
>  > What tricks are others using to make it easier to see what's
> going on in
>  > Lift? Is there a way to step through a request and see
> exactly what
>  > happens and in what order? I would kill for that ability.
>  >
>  > Chas.
>  >
>  >
>  >
>  >
>  >
>  > --
>  > Lift, the simply functional web framework http://liftweb.net
>  > Collaborative Task Management http://much4.us
>  > Follow me: http://twitter.com/dpp
>  > Git some: http://github.com/dpp
>  >
>  > >
> 
> 
> 
> 
> 
> -- 
> Lift, the simply functional web framework http://liftweb.net
> Collaborative Task Management http://much4.us
> Follow me: http://twitter.com/dpp
> Git some: http://github.com/dpp
> 
> > 

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



[Lift] JPA archetype

2008-12-07 Thread Charles F. Munat

Is there a Maven archetype for generating a Lift/JPA project? I want to 
start a new one. I could copy an old one across and delete everything I 
don't need, but I suspect that there've been many improvements to the 
code since I last created a Lift/JPA site.

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



[Lift] Re: JPA archetype

2008-12-08 Thread Charles F. Munat

No sweat, Derek. Just didn't want to do it that way and then find out 
that there was a better way.

Thanks,
Chas.

BTW, I have four sites online right now -- either in beta testing or 
fully in production -- based on the Lift/JPA code. So thank you very 
much. Two more on the way.

Derek Chen-Becker wrote:
> The most recent thing would be what's in the example JPA Demo site. I 
> have making an archetype on my todo list but it will probably be a while 
> before I get that done, sorry :(
> 
> Derek
> 
> On Sun, Dec 7, 2008 at 11:49 PM, Charles F. Munat <[EMAIL PROTECTED] 
> <mailto:[EMAIL PROTECTED]>> wrote:
> 
> 
> Is there a Maven archetype for generating a Lift/JPA project? I want to
> start a new one. I could copy an old one across and delete everything I
> don't need, but I suspect that there've been many improvements to the
> code since I last created a Lift/JPA site.
> 
> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Why JPA?

2008-12-09 Thread Charles F. Munat

I'm not really very clear on how all this works, but I've had a terrible 
time with merging objects.

I built a multi-page survey with forty-some questions on it. One of the 
questions asks users to fill out a table in which each row is an object 
-- call it a Row. I don't know in advance whether there will be two rows 
or twenty.

I set this up so that the user gets a blank row. They can click an "add 
a row" link to add another row. They can click a "-" link at the end of 
each row to remove that row.

On the server, this creates a new Row() and adds it to the survey 
(Survey.rows.add(new Row())). Then it populates a table row and sends it 
back to the browser.

I had a TERRIBLE time making this work (and I'm still not convinced it's 
working consistently).

For one thing, the fields in the table update the server on blur using 
AJAX. That was a hassle. Each time I tabbed from one field to the next, 
instead of updating the current Row object, it would create a new one. 
The reason seemed to be because the object was detached. I tried all 
sorts of things: merging, flushing, even trying to pull the row back out 
from the Survey object before merging it. This drove me crazy for two days.

Maybe I'm wrong, but the idea of keeping the EntityManager open for the 
duration of the session, manually calling begin and end transaction, and 
only merging and flushing as necessary appeals to me. In this instance, 
I'd push the changes to the database probably on every request to be 
safe, but I'd prefer it if objects didn't detach themselves.

It would also be nice to be able to create new objects, and then only 
persist them if they need to be persisted. On the above project, I have 
a dirty field on the Row. Each time the page is reloaded, I delete all 
rows that are not dirty, then recreate new rows as necessary. This burns 
up a lot of ids needlessly. It won't make a difference on this survey, 
but it seems a kludgy way to do things.

Scala is wonderful, Lift is amazing, and JPA/Hibernate mostly rocks. But 
when working with multiple objects associated in a one-to-many 
relationship to a parent object, there simply *has* to be a better way. 
This is one spot where the SQL-centric Rails seems infinitely superior.

So I don't know if the problems I experienced and am experiencing are 
because of some basic misunderstanding on my part, or because of the 
volatile nature of the EntityManager as it is currently managed in 
JPA/Lift, but if it's the latter, then I'm all for the sorts of changes 
that Philip is suggesting.

What do you think, Derek? Am I explaining this well enough that you can 
understand what I'm talking about? Is there a simple solution that I'm 
missing? I'm happy to post code if that helps.

Chas.

Derek Chen-Becker wrote:
> I think you misunderstand the lifecycle of a stateful snippet. A 
> stateful snippet has specific techniques to keep it resident (using 
> this.link, this.redirect, etc) so you have to be careful about how you 
> use it or you lose the instance. The HTTP session would be the most 
> appropriate place for a JPA EM that crosses request boundaries because 
> it will *always* be available to snippets (I had forgotten about the 
> EXTENDED type, I've never used it).
> 
> Another issue, orthogonal to how you keep the session around, is that 
> when you hold a session open you're also holding a transaction open 
> unless you use RESOURCE_LOCAL transactions (unmanaged JDBC connections, 
> essentially). That has implications on data visibility to other 
> connections, how you handle exceptions, etc.
> 
> Don't get me wrong, I think that there's a place for extended JPA EMs, I 
> just want to make sure you're aware of all of the tradeoffs so that you 
> don't get any nasty surprises. It's my opinion that for most use cases 
> opening a session for each request (and the merge/getReference that 
> doing it this way implies) is the best way to do it. JPA providers are 
> usually pretty intelligent about efficiently using database operations 
> to keep things coherent, so I don't think that "avoiding merge" is 
> necessarily a worthwhile goal in and of itself.
> 
> Cheers,
> 
> Derek
> 
> On Tue, Dec 9, 2008 at 6:39 AM, philip <[EMAIL PROTECTED] 
> > wrote:
> 
> 
> Hi Derek,
> 
> I think I found the solution to the problem I am thinking of.
> Its called JPA Extended Persistence Context. Its suggested that a
> extended persistence context be created which starts at some time and
> ends at some time and is stored in HttpSession. From the bits I read
> they said its no good to store in a Stateful Session Bean because the
> bean may be passivated and the context lost. Well we are not using
> stateful session bean so it doesn't matter, we can put it in the
> session or put it on some object that hands around like a session such
> as a ... in our case I believe a Snippet.
> 
> So in the JPA demo, you would then open as
> 

[Lift] Re: Why JPA?

2008-12-09 Thread Charles F. Munat

Derek Chen-Becker wrote:
> Hmmm. It doesn't seem like this should be causing issues. Probably the 
> most common mistake made with merge is that merge returns an entirely 
> new object, so you discard the original.

Ah! That's good to know. I think that after I used Model.merge(row) I 
expected row to be attached. But then maybe I should have used row = 
Model.merge(row)? So then row needs to be a var not a val?

I am confused...
> Also, if you want the change to 
> be immediately visible and to check constraints, etc, you need to 
> immediately flush. For instance:
> 
> updateRow (row : Row) : Row = {
>   Model.merge(row)
>   Model.flush()
> }

Oh, yeah... I've been flushing so much my water bill doubled this month. 
Flush, flush, flush, but then I have twenty copies of each row... sigh.

> It really should be that simple. I'd be happy to look at code if you'd 
> like to see where there might be issues. I've added some comments below:

I can zip it up and send it to you if you're curious.

> I'm assuming that at least this works flawlessly, right?

I think so.

> I'm not 100%, but you may need to actually set the owner field on the 
> row as well as adding it to the Survey.rows collection. If I remember 
> correctly, owner fields in objects belonging to collections aren't 
> automatically updated unless you explicitly set the Cascade property on 
> the collection.

Yeah, this is very confusing. What I am currently doing is this:

def getOneButton(xhtml: NodeSeq) : NodeSeq = {
   val survey: Survey = Model.createNamedQuery[Survey](...)
 .getSingleResult()

   SHtml.ajaxButton("Add a row",
 () => {
   AppendHtml("myTable", getRow(survey))
 }, ("class", "removeButton"
   )
}

def getRow(survey: Survey): NodeSeq = {

   val s = Model.getReference[Survey](classOf[Survey], survey.id)
   s.rows.add(new Row())
   Model.merge(s)
   Model.flush()
   val row = JPA.listToWrapper(s.rows).last

   
 {SHtml.ajaxText(row.colOne,
   (txt: String) => {
 row.colOne = txt
 Model.merge(row)
 Noop
   },
   ("id", "colOne" + row.id.toString), ("size", "8"))}
 ...
   

}

> In your add row method, did you persist the new Row before returning it? 
> If not, it never gets an ID and then when it gets merged it will create 
> a new instance. I'd have to look at the code to see for sure.

See above.

> Actually, I think the case of a multi-page form is a good candidate for 
> an extended session, simply because you would likely want the entire 
> form to be treated atomically.

Yes, although the client wanted every change to the form to be persisted 
immediately (no submit buttons), so I end up making lots of trips to the 
database. But there will only be a few dozen people taking this survey, 
so performance is not an issue. I have other sites with similar forms 
where that is not the case.

> I'm having trouble visualizing what exactly the dirty flag is representing.

I want to be able to strip out empty rows afterwards (since blank rows 
are persisted before they are sent to the browser). Rather than check 
every field in the row (there are seven), I have a flag (not really a 
dirty flag) called isNull or something like that. On the first change to 
a field, I set it to false. Then later I can delete all isNull == true 
rows to clean things up.

If I could just create -- but not persist -- rows and persist them after 
the first field is updated, then that would be better. But I was having 
a really difficult time of that.

> I think I mostly understand and it sounds like something is probably 
> wrong. I don't think what you're describing is the intended behavior for 
> JPA.

Thanks. I'll zip up the site and send it to you off list (I'm not going 
to clean it). If you have a chance to look at the snippet, maybe you can 
see quickly what I'm doing wrong. Hopefully, it will also give you some 
ideas for how something like this could be added to the JPA example. 
That would be super.

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



[Lift] Expiring pages via HTTP headers

2008-12-09 Thread Charles F. Munat

I want to (attempt to) prevent the browser from caching certain pages as 
there is a problem if the user backs up to them. I can do this with HTTP 
headers, of course.

Question: Is this functionality built-in to Lift? I could find nothing 
on the wiki. If not, how does one set the HTTP headers on a page (and 
from where)?

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



[Lift] Re: Expiring pages via HTTP headers

2008-12-10 Thread Charles F. Munat

Actually, I have a multi-page survey that updates the database when you 
change each field (there are no submit buttons). It works pretty well, 
but if the user backs up to a page after many changes have been made...

I'm not sure I'll do anything more than just tell them not to use the 
back button on the forms, but it might be better to force a reload of 
the page where possible. If I can expire it in the cache (or prevent it 
from being cached), then that should eliminate the problem.

That's my thinking anyway.

Thanks for the tip.

Chas.

Tim Perrett wrote:
> Chas,
> 
> Look in HttpResppnse.scala - you'll see the LiftResponse subclasses  
> that are setting custom headers and things. Also see TextResponse etc  
> for more examples ( all in net.liftweb.http )
> 
> I'm guessing you need this for some API or such?
> 
> Cheers
> 
> Tim
> 
> Sent from my iPhone
> 
> On 10 Dec 2008, at 02:00, "Charles F. Munat" <[EMAIL PROTECTED]> wrote:
> 
>> I want to (attempt to) prevent the browser from caching certain  
>> pages as
>> there is a problem if the user backs up to them. I can do this with  
>> HTTP
>> headers, of course.
>>
>> Question: Is this functionality built-in to Lift? I could find nothing
>> on the wiki. If not, how does one set the HTTP headers on a page (and
>> from where)?
>>
>> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Expiring pages via HTTP headers

2008-12-10 Thread Charles F. Munat

I guess what I'm looking to do is mark pages expired, so when you back 
up you get either an expired message or an automatic reload. But I'm not 
sure this is necessary and hope to avoid it. Would be good to know how 
to do it, though.

There's a pretty interesting discussion about caching here:

http://www.mnot.net/cache_docs/#CONTROL

There's also a discussion here...

http://forums.asp.net/p/1013531/1898631.aspx

(using ASP.net) and they suggest the following:

AppendHeader("Cache-Control", "no-cache; private;
   no-store; must-revalidate; max-stale=0; post-check=0;
   pre-check=0; max-age=0"); // HTTP 1.1

AppendHeader("Pragma", "no-cache"); // HTTP 1.1

AppendHeader("Keep-Alive", "timeout=3, max=993"); // HTTP 1.1

AppendHeader("Expires", "Mon, 26 Jul 1997 05:00:00 GMT"); // HTTP 1.1

Hope that helps.

Chas.

David Pollak wrote:
> Charles,
> 
> Lift is supposed to mark all pages as non-cached.  If it's not doing 
> that, then there's a defect in Lift.
> 
> Can I ask that you give me a list of things I can send to the browser 
> (headers, meta-tags, etc.) that will indicate that the browser should 
> not cache the page.  I'll insure that all those things are sent.
> 
> Thanks,
> 
> David
> 
> On Wed, Dec 10, 2008 at 11:23 AM, Charles F. Munat <[EMAIL PROTECTED] 
> <mailto:[EMAIL PROTECTED]>> wrote:
> 
> 
> Actually, I have a multi-page survey that updates the database when you
> change each field (there are no submit buttons). It works pretty well,
> but if the user backs up to a page after many changes have been made...
> 
> I'm not sure I'll do anything more than just tell them not to use the
> back button on the forms, but it might be better to force a reload of
> the page where possible. If I can expire it in the cache (or prevent it
> from being cached), then that should eliminate the problem.
> 
> That's my thinking anyway.
> 
> Thanks for the tip.
> 
> Chas.
> 
> Tim Perrett wrote:
>  > Chas,
>  >
>  > Look in HttpResppnse.scala - you'll see the LiftResponse subclasses
>  > that are setting custom headers and things. Also see TextResponse etc
>  > for more examples ( all in net.liftweb.http )
>  >
>  > I'm guessing you need this for some API or such?
>  >
>  > Cheers
>  >
>  > Tim
>  >
>  > Sent from my iPhone
>  >
>  > On 10 Dec 2008, at 02:00, "Charles F. Munat" <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>> wrote:
>  >
>  >> I want to (attempt to) prevent the browser from caching certain
>  >> pages as
>  >> there is a problem if the user backs up to them. I can do this with
>  >> HTTP
>  >> headers, of course.
>  >>
>  >> Question: Is this functionality built-in to Lift? I could find
> nothing
>  >> on the wiki. If not, how does one set the HTTP headers on a page
> (and
>  >> from where)?
>  >>
>  >> Thanks.
>  >>
>  >> Chas.
>  >>
>  >
>  > >
> 
> 
> 
> 
> 
> -- 
> Lift, the simply functional web framework http://liftweb.net
> Collaborative Task Management http://much4.us
> Follow me: http://twitter.com/dpp
> Git some: http://github.com/dpp
> 
> > 

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



[Lift] Re: Expiring pages via HTTP headers

2008-12-10 Thread Charles F. Munat

I'm not even sure there is a problem.

I have a complicated multi-page survey and on one page there is a table 
with multiple rows where each row is a separate object. You can add new 
blank rows and delete rows. To make it all more complicated, each field 
updates the database using AJAX onChange or onBlur.

One of the beta testers backed up to this page and the ajax row device 
failed, which caused all the scripts to shut down, which was a complete 
disaster since nothing was being updated (and there is no submit button).

I have not been able to duplicate this, and since this survey is only 
for two weeks and a few dozen people, I may just ask them to avoid the 
back button. But I was considering expiring pages so that when you 
backed up it forced a reload of the page (after that everything works fine).

Does this make any sense?

(Oh, and just to complicate things a bit more, I'm passing the survey 
back and forth in the URL via a guid, so it's more like /page_one/x, 
/page_two/x, etc. I make a hit on the database and reload the survey 
via a JPA query each time just to be sure I have the most up-to-date 
copy, and also so the users can link to the survey pages and come back 
to them later.)

Chas.

Tim Perrett wrote:
> Chas,
> 
> Can you detail exactly what the problem is when a user backs up? Do
> you have URLs like:
> 
> /questions-one
> /questions-two
> /questions-three
> 
> etc?
> 
> Users using the back button is a common problem faced by web-dev's the
> world over. Id be interested to hear exactly what your problem is and
> how using cache headers will help you?
> 
> IMO, cache headers like ETag and Cache-Control have a specific use and
> im not sure they are the right solution for your problem. For
> instance, I might use the caching headers as part of a conditional get
> strategy in a rest api...
> 
> Cheers
> 
> Tim
> > 

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



[Lift] Re: error message tag

2008-12-15 Thread Charles F. Munat

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.

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.

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



[Lift] Re: Can or Box or something else

2008-12-20 Thread Charles F. Munat

Yes, but which is it: half empty or half full? You'd think at this stage 
of development we could at least answer that old question.

Chas.

Derek Chen-Becker wrote:
> What about renaming it Glass? Then we could add:
> 
> case class HalfFull[T](data : T) extends Glass[T]
> type HalfEmpty[T] = HalfFull[T]
> 
> ;)
> 
> Derek
> 
> On Sat, Dec 20, 2008 at 8:13 AM, TylerWeir  > wrote:
> 
> 
> Once people get Can, I think it makes sense, so I think we can leave
> it.
> 
> As a replacement, I can't think of a good real-life example of a thing
> with a failure indicator that fits the bill. :)
> 
> What about OptionWithFailure, OptionWF, OptWithF?
> It's more typing, but it's accurate.
> 
> FailureIndicatingOption?  FIOption?
> 
> 
> 
> On Dec 20, 9: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 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: Can or Box or something else

2008-12-20 Thread Charles F. Munat

I agree. I think Box is more cross-cultural and has no confusing 
meanings (e.g. can = possible). But Tyler makes a good point. Really, it 
should be called something like OptionWithFailure. And we should stop 
trying to abbreviate everything (*maybe* OptionWFailure). After all, how 
often do you actually write out "Can"? Usually it's Full() or Empty.

IMO, things should be self-explanatory and documentation should only be 
a fall back. It's generally a bad idea in my experience to rely on 
documentation.

Frankly, I, too, found Can quite confusing, even though I already knew 
what Option did.

Chas.

Marius wrote:
> Between Can, Cup and Box ...Box makes most sense to me ... (I'm not
> going to suggest Bottle :) ...)
> 
> Br's,
> Marius
> 
> On 20 Dec, 18:19, Tim Perrett  wrote:
>> Speaking from personal experience, what I didn't realize to begin with  
>> was that the can was what we in England call a tin, and the  
>> connotation of "you can do something" is conceptually very different  
>> to "a can (tin) contains x" if you follow my meaning...
>>
>> I think the problem can be solved by better docs, and a paper that  
>> explains the rational of can as a container - this would fix the curve  
>> of understanding IMO. What usually happens when noobies ask about can,  
>> is that people are pointed in the direction of Option, but if your new  
>> to scala, that is fairly meaningless also as those comming from java  
>> et al are using to checking for null so don't see why you need a  
>> container.
>>
>> Just my two pence
>>
>> Cheers, Tim
>>
>> Sent from my iPhone
>>
>> On 20 Dec 2008, at 14:43, "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 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: Can or Box or something else

2008-12-20 Thread Charles F. Munat

Generally, I agree, but not at the expense of understandability. And 
about the only time I have to type it is as a result type when it can't 
be inferred. The rest of the time I'm using Full() or Empty, which are 
nice and short. Even Box, which I think is much better, requires 
explaining. OptionWithFailure probably does not.

And with an IDE and code completion, it's not an issue. I'm more 
interested in reducing boilerplate than forcing type names to the 
shortest possible length.

Just my opinion...

Chas.

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-21 Thread Charles F. Munat

I, too, like ?, but I agree that others may not. Could mean too many 
things. But what about ??? instead? Or just two (??)? Or why not steal 
Haskell's thunder and use Maybe?

Chas.

Marius wrote:
> Personally I kind of like ? name ... although I feel many people will
> not. Going further having Full and Empty extending ? may "lift"quite a
> few eyebrows :)
> 
> BTW I totally agree that Result is not ok.
> 
> Br's,
> Marius
> 
> On Dec 21, 7:45 pm, "David Bernard" 
> wrote:
>> current signature :
>>   def doStuff(arg1 : Can[Foo], arg2 : Toto) : Can[Bar]
>>
>> With Result:
>>   def doStuff(arg1 : Result[Foo], arg2 : Toto) : Result[Bar]
>> Result could be good but is not, when used for argument and not for "result"
>>
>> more I think about it, more I thought ? was not so wrong/joke. In the
>> Nice language (a old competitor to scala) ? was used to mark value to
>> be potentially null
>>
>> var myVar1 : ?String //myVar1 could be null
>> var myVar2 : String //myVar2 is never null
>>
>> With ?:
>>   def doStuff(arg1 : ?[Foo], arg2 : Toto) : ?[Bar]
>>
>> On Sun, Dec 21, 2008 at 17:42, Mateusz Fiołka  
>> wrote:
>>> Result +1
>>> Quite short, only one selfexplaining imo and describes the purpose it serves
>>> well. The only downsides of this name is +3 characters and the fact that the
>>> class could be used also as non result but for other purpose.
>>> On Sun, Dec 21, 2008 at 3:32 PM, Derek Chen-Becker 
>>> wrote:
 I think that the previously mentioned "Box" would be the only other thing
 that has
 The same semantic meaning of "container". Well, as Tim pointed out this is
 a US thing for Can...
 The same brevity. I agree with David that commonly used constructs should
 be short
 If it was going to change at all, this would be it.
 Derek
 On Sat, Dec 20, 2008 at 11:13 PM, Josh Suereth 
 wrote:
> On Sat, Dec 20, 2008 at 2:37 PM, Oliver Lambert  wrote:
>> 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.
> Pun intended
> As to my vote (if I'm allowed one)...
> Can was slightly confusing, but looking at it vs Option makes a lot of
> sense.  Option is also slightly confusing, because I expected it to behave
> like Either.   Either is a great name, as you can tell what it's doing.
> Result seems ok, but I would vote for something more like Storage.   Can
> is pretty succinct, and once you know how to use it, it's not hard to
> remember the convention.
> So I'd swing on the side of sticking with Can unless a really good name
> is discovered.
> > 

--~--~-~--~~~---~--~~
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: Websites and apps that are using Lift?

2008-12-21 Thread Charles F. Munat

I have six sites, four of them that will be public, that are coming 
online over the next few days/weeks. I'll add them four public ones to 
your list as they go live.

Chas.

Daniel Cer wrote:
>>> Does anyone here have any public Lift powered webapps? If so, would
>>> you mind sharing the URL and what other support components you are
>>> using (e.g. which servlet container Tomcat, Jetty; database; etc.)
>>>
>> I just wanted to add that small personal projects are fine.
>>
> 
> I entered all the responses I got so far. You can find the complete list at:
> 
> http://www.appliedstacks.com/PoweredBy/Lift
> 
> If people have more Lift sites they would like to add or if you bring
> a new site online in the future, just send me an e-mail and I can add
> it to the list. Or, feel free to just directly add it to the wiki
> (it's open edit, so anybody can make changes even without logging in).
> 
> The larger wiki is being put together as a hobby project of mine that
> I'd like make into a nice community resource that connects people with
> and helps to promote the use of better languages and tools.
> 
> -Dan
> 
> > 

--~--~-~--~~~---~--~~
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: Loc, trailing slashes, and index files

2008-12-22 Thread Charles F. Munat

Yay!

David Pollak wrote:
> Derek,
> 
> This commit should take care of it:
> http://github.com/dpp/liftweb/commit/2650e10981990eeb08d04d686be27d77da2a5434
> 
> Also, it takes care of Charles' "I had index at the end of my URLs" problem.
> 
> Thanks,
> 
> David
> 
> On Tue, Dec 9, 2008 at 2:04 PM, Derek Chen-Becker  > wrote:
> 
> This is both a comment and a question. I'd like to be able to have a
> Menu with a Loc pointing at "/help/". By using the strPairToLink
> method on the Loc object, I can use it as both an entry into the
> help system. This allows me to effectively bring up "/help/index"
> due to Lift converting trailing slashes to "/index", and I can use
> the boolean parameter to allow access to all files under the help
> subdirectory. In order to make this work, though, I need to define
> the menu like:
> 
> val helpMenu = Menu(Loc("HelpHome", ("help" :: "" :: Nil) -> true,
> "Help"))
> 
> Note the empty string as part of the path definition. If I omit
> this, then files under the help subdirectory are accessible, but the
> link generated by Menu.builder is "/help". Because it omits the
> trailing slash it seems that Lift tries to open the directory as a
> template XML file and I get an internal server error (500, stack
> trace at the end of the email). My question is whether this is the
> intended way of doing what I want, or if I've missed some other way
> to define this in a single Menu entry (yes, I could do two, with one
> hidden). With a server like apache, if I request a directory without
> the trailing slash it will respond with a 301 redirect to the same
> URL, but with a trailing slash. Should Lift be modified to follow
> this behavior?
> 
> One more related issue is that even if I define my Menu as I've
> shown above, if I try to use "/help" in the URL without the trailing
> slash, I get a directory listing instead of the index.html, which I
> would expect.
> 
> I'm not sure if this is all under Lift's purview or if some of it
> should be handled by chaining in the filter.
> 
> Derek
> 
> PS - Here's the stack trace if I omit the fake "slash":
> 
> ERROR - Exception being returned to browser when processing
> Req(List(), Map(), ParsePath(List(help),,true,false), , GetRequest,
> null)
> java.lang.IllegalArgumentException: line 1 does not exist
> at scala.io.Source.getLine(Source.scala:280)
> at scala.io.Source.report(Source.scala:368)
> at scala.io.Source.reportError(Source.scala:355)
> at scala.io.Source.reportError(Source.scala:344)
> at
> 
> scala.xml.parsing.MarkupParser$class.reportSyntaxError(MarkupParser.scala:1113)
> 
> 
> 
> 
> 
> 
> -- 
> 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 Charles F. Munat

You must be too young to remember Netscape 4. And IE on the Mac?

Tim Perrett wrote:
> Wow, thats pretty impressive! To not even work in the worst-bit-of- 
> software-enginering-know-to-man (aka IE 6) is a serious feat in  
> itself! Kudos! lol
> 
> On 23 Dec 2008, at 15:39, Derek Chen-Becker wrote:
> 
>> There's nothing else out there like IE for job security. We still  
>> have an app in-house that requires IE 5.5. It won't even work in 6  
>> or above...
> 
> 
> > 

--~--~-~--~~~---~--~~
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-24 Thread Charles F. Munat

Ah, you spoiled youngsters! My first experience was on a $1600 electric 
calculator that could not only do + and -, but also * and /! Unheard of 
in 1975 when mechanical adding machines were the rule. You had to get 
special permission from the teacher to touch it.

Chas.

Derek Chen-Becker wrote:
> Ah, you spoiled youngsters! My first experience on anything resembling 
> the net was dialing up to a local BBS on a 300 baud hotel terminal that 
> used my TV for output. I think my family got our Atari 800 PC in '86!
> 
> Derek
> 
> On Tue, Dec 23, 2008 at 4:42 PM, Tim Perrett  <mailto:he...@timperrett.com>> wrote:
> 
> 
> Ha! Well I remember IE on mac, that truly was awful... I also remember
> dialing up to the internet from a 14.4k modem with windows 3.1, and
> browsing on some ancient version of netscape!
> 
> As for my age, I was born in 86' :-D
> 
> Cheers, Tim
> 
> 
> On 23 Dec 2008, at 20:41, Charles F. Munat wrote:
> 
>  > You must be too young to remember Netscape 4. And IE on the Mac?
> 
> 
> 
> 
> 
> > 

--~--~-~--~~~---~--~~
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-26 Thread Charles F. Munat

Summer solstice? SUMMER solstice? You hemisphere bigot! There you go 
again, insulting half the planet...

(Back to the lawyers again... :-)

Chas.

Marc Boschma wrote:
> Funny thing is the first thought that came to mind here was a Cricket  
> Box :) (and not the KFC variety)
> 
> To close the season and thread with some humour:
> 
> I wanted to send some sort of Christmas (whoops I mean) holiday  
> greeting to my friends, but it is so difficult in today's world to  
> know exactly what to say without offending someone. So I met with my  
> lawyer yesterday, and on his advice I wish to say the following to  
> you, my dear friends throughout the world:
> 
> Please accept with no obligation, implied or implicit, my best wishes  
> for an environmentally conscious, socially responsible, low stress,  
> non-addictive, gender neutral celebration of the Summer solstice  
> holiday, practised with the most enjoyable traditions of religious  
> persuasion or secular practices of your choice with respect for the  
> religious/secular persuasions and/or traditions of others, or their  
> choice not to practice religious or secular traditions at all.
> 
> I also wish you a fiscally successful, personally fulfilling and  
> medically uncomplicated recognition of the onset of the generally  
> accepted calendar year 2009, but not without due respect for the  
> calendars of choice of other cultures whose contributions to society  
> have helped make our country great (not to imply that Australia is  
> necessarily greater than any other country) and without regard to the  
> race, creed, colour, age, physical ability, religious faith or sexual  
> preference of the wishees.
> 
> By accepting this greeting, you are accepting these terms:
> 
> This greeting is subject to clarification or withdrawal. It is freely  
> transferable with no alteration to the original greeting. It implies  
> no promise by the wisher to actually implement any of the wishes for  
> her/himself or others and is void where prohibited by law, and is  
> revocable at the sole discretion of the wisher.
> 
> This wish is warranted to perform as expected within the usual  
> application of good tidings for a period of one year or until the  
> issuance of a subsequent holiday greeting, whichever comes first, and  
> warranty is limited to replacement of this wish or issuance of a new  
> wish at the sole discretion of the wisher.
> 
> Disclaimer: No trees were harmed in the sending of this message;  
> however, a significant number of electrons were slightly inconvenienced.
> 
> On 27/12/2008, at 2:25 AM, Viktor Klang wrote:
> 
>> "Bin"
>> "Slot"
>> "Ref"
>>
>> Though, "Box" is short, self-explanatory and fills the other  
>> criterias aswell.
>>
>> Merry Christmas
>> /Viktor
>>
> 
> > 

--~--~-~--~~~---~--~~
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] versions out of whack?

2008-12-26 Thread Charles F. Munat

Here's a new one I haven't seen before. Are my versions out of whack? 
Should I be moving up to Scala 2.7.3? What's wrong here?

Any ideas?

Chas.

HTTP ERROR: 500

net.liftweb.util.AltXML$.toXML(Lscala/xml/Node;Lscala/xml/NamespaceBinding;Lscala/StringBuilder;ZZ)V

RequestURI=/
Caused by:

java.lang.NoSuchMethodError: 
net.liftweb.util.AltXML$.toXML(Lscala/xml/Node;Lscala/xml/NamespaceBinding;Lscala/StringBuilder;ZZ)V
at net.liftweb.http.NodeResponse$class.toResponse(XmlResponse.scala:40)
at net.liftweb.http.XhtmlResponse.toResponse(XmlResponse.scala:49)
at net.liftweb.http.XhtmlResponse.toResponse(XmlResponse.scala:49)
at net.liftweb.http.LiftServlet.doService(LiftServlet.scala:176)
at 
net.liftweb.http.LiftServlet$$anonfun$doIt$1$1.apply(LiftServlet.scala:97)
at 
net.liftweb.http.LiftServlet$$anonfun$doIt$1$1.apply(LiftServlet.scala:97)
at net.liftweb.util.TimeHelpers$class.calcTime(TimeHelpers.scala:242)
at net.liftweb.util.Helpers$.calcTime(Helpers.scala:29)
at net.liftweb.util.TimeHelpers$class.logTime(TimeHelpers.scala:251)
at net.liftweb.util.Helpers$.logTime(Helpers.scala:29)
at net.liftweb.http.LiftServlet.doIt$1(LiftServlet.scala:96)
at net.liftweb.http.LiftServlet.service(LiftServlet.scala:105)
at 
net.liftweb.http.LiftFilterTrait$$anonfun$doFilter$1$$anonfun$apply$18.apply(LiftServlet.scala:483)
at 
net.liftweb.http.LiftFilterTrait$$anonfun$doFilter$1$$anonfun$apply$18.apply(LiftServlet.scala:483)
at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:33)
at net.liftweb.http.URLRewriter$.doWith(Req.scala:370)
at 
net.liftweb.http.LiftFilterTrait$$anonfun$doFilter$1.apply(LiftServlet.scala:482)
at 
net.liftweb.http.LiftFilterTrait$$anonfun$doFilter$1.apply(LiftServlet.scala:476)
at 
net.liftweb.http.RequestVarHandler$$anonfun$apply$3$$anonfun$apply$4$$anonfun$apply$5.apply(Vars.scala:150)
at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:33)
at 
net.liftweb.http.RequestVarHandler$$anonfun$apply$3$$anonfun$apply$4.apply(Vars.scala:149)
at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:33)
at 
net.liftweb.http.RequestVarHandler$$anonfun$apply$3.apply(Vars.scala:148)
at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:33)
at net.liftweb.http.RequestVarHandler$.apply(Vars.scala:147)
at 
net.liftweb.http.LiftFilterTrait$class.doFilter(LiftServlet.scala:475)
at net.liftweb.http.LiftFilter.doFilter(LiftServlet.scala:496)
at 
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1115)
at 
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:361)
at 
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at 
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at 
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:417)
at 
org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
at 
org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
at 
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:324)
at 
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534)
at 
org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:864)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:533)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:207)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:403)
at 
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
at 
org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:522)

--~--~-~--~~~---~--~~
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: versions out of whack?

2008-12-26 Thread Charles F. Munat

OK, so it's still 2.7.2, I just need to re-grab everything. Will do.

Thanks,
Chas.

David Pollak wrote:
> Charles,
> 
> I did an update to the XML rendering stuff.  It looks like half your 
> Lift jars are old and half are new.  I'd suggest blowing away your Maven 
> repository and doing a clean build.
> 
> Thanks,
> 
> David
> 
> On Fri, Dec 26, 2008 at 3:15 PM, Charles F. Munat  <mailto:c...@munat.com>> wrote:
> 
> 
> Here's a new one I haven't seen before. Are my versions out of whack?
> Should I be moving up to Scala 2.7.3? What's wrong here?
> 
> Any ideas?
> 
> Chas.
> 
> HTTP ERROR: 500
> 
> 
> net.liftweb.util.AltXML$.toXML(Lscala/xml/Node;Lscala/xml/NamespaceBinding;Lscala/StringBuilder;ZZ)V
> 
> RequestURI=/
> Caused by:
> 
> java.lang.NoSuchMethodError:
> 
> net.liftweb.util.AltXML$.toXML(Lscala/xml/Node;Lscala/xml/NamespaceBinding;Lscala/StringBuilder;ZZ)V
>at
> net.liftweb.http.NodeResponse$class.toResponse(XmlResponse.scala:40)
>at
> net.liftweb.http.XhtmlResponse.toResponse(XmlResponse.scala:49)
>at
> net.liftweb.http.XhtmlResponse.toResponse(XmlResponse.scala:49)
>at net.liftweb.http.LiftServlet.doService(LiftServlet.scala:176)
>at
> net.liftweb.http.LiftServlet$$anonfun$doIt$1$1.apply(LiftServlet.scala:97)
>at
> net.liftweb.http.LiftServlet$$anonfun$doIt$1$1.apply(LiftServlet.scala:97)
>at
> net.liftweb.util.TimeHelpers$class.calcTime(TimeHelpers.scala:242)
>at net.liftweb.util.Helpers$.calcTime(Helpers.scala:29)
>at
> net.liftweb.util.TimeHelpers$class.logTime(TimeHelpers.scala:251)
>at net.liftweb.util.Helpers$.logTime(Helpers.scala:29)
>at net.liftweb.http.LiftServlet.doIt$1(LiftServlet.scala:96)
>at net.liftweb.http.LiftServlet.service(LiftServlet.scala:105)
>at
> 
> net.liftweb.http.LiftFilterTrait$$anonfun$doFilter$1$$anonfun$apply$18.apply(LiftServlet.scala:483)
>at
> 
> net.liftweb.http.LiftFilterTrait$$anonfun$doFilter$1$$anonfun$apply$18.apply(LiftServlet.scala:483)
>at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:33)
>at net.liftweb.http.URLRewriter$.doWith(Req.scala:370)
>at
> 
> net.liftweb.http.LiftFilterTrait$$anonfun$doFilter$1.apply(LiftServlet.scala:482)
>at
> 
> net.liftweb.http.LiftFilterTrait$$anonfun$doFilter$1.apply(LiftServlet.scala:476)
>at
> 
> net.liftweb.http.RequestVarHandler$$anonfun$apply$3$$anonfun$apply$4$$anonfun$apply$5.apply(Vars.scala:150)
>at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:33)
>at
> 
> net.liftweb.http.RequestVarHandler$$anonfun$apply$3$$anonfun$apply$4.apply(Vars.scala:149)
>at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:33)
>at
> net.liftweb.http.RequestVarHandler$$anonfun$apply$3.apply(Vars.scala:148)
>at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:33)
>at net.liftweb.http.RequestVarHandler$.apply(Vars.scala:147)
>at
> net.liftweb.http.LiftFilterTrait$class.doFilter(LiftServlet.scala:475)
>at net.liftweb.http.LiftFilter.doFilter(LiftServlet.scala:496)
>at
> 
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1115)
>at
> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:361)
>at
> 
> org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
>at
> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
>at
> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
>at
> org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:417)
>at
> 
> org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
>at
> 
> org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
>at
> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
>at org.mortbay.jetty.Server.handle(Server.java:324)
>at
> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534)
>at
> 
> org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:864)
>at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:533)
>at

[Lift] Re: versions out of whack?

2008-12-26 Thread Charles F. Munat

What does it mean when I get this error:

1) net.liftweb:lift-webkit:jar:0.10-SNAPSHOT

   Try downloading the file manually from the project website.

   Then, install it using the command:
   mvn install:install-file -DgroupId=net.liftweb 
-DartifactId=lift-webkit -Dversion=0.10-SNAPSHOT -Dpackaging=jar 
-Dfile=/path/to/file

   Alternatively, if you host your own repository you can deploy the 
file there:
   mvn deploy:deploy-file -DgroupId=net.liftweb 
-DartifactId=lift-webkit -Dversion=0.10-SNAPSHOT -Dpackaging=jar 
-Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

   Path to dependency:
 1) com.xxx:yyy-app:war:0.10-SNAPSHOT
 2) net.liftweb:lift-webkit:jar:0.10-SNAPSHOT

I got this before and got around it by using git and then building and 
installing Lift manually, but shouldn't it be possible to just run Maven 
and have it work? Am I doing something wrong?

Chas.

David Pollak wrote:
> Charles,
> 
> I did an update to the XML rendering stuff.  It looks like half your 
> Lift jars are old and half are new.  I'd suggest blowing away your Maven 
> repository and doing a clean build.
> 
> Thanks,
> 
> David
> 
> On Fri, Dec 26, 2008 at 3:15 PM, Charles F. Munat  <mailto:c...@munat.com>> wrote:
> 
> 
> Here's a new one I haven't seen before. Are my versions out of whack?
> Should I be moving up to Scala 2.7.3? What's wrong here?
> 
> Any ideas?
> 
> Chas.
> 
> HTTP ERROR: 500
> 
> 
> net.liftweb.util.AltXML$.toXML(Lscala/xml/Node;Lscala/xml/NamespaceBinding;Lscala/StringBuilder;ZZ)V
> 
> RequestURI=/
> Caused by:
> 
> java.lang.NoSuchMethodError:
> 
> net.liftweb.util.AltXML$.toXML(Lscala/xml/Node;Lscala/xml/NamespaceBinding;Lscala/StringBuilder;ZZ)V
>at
> net.liftweb.http.NodeResponse$class.toResponse(XmlResponse.scala:40)
>at
> net.liftweb.http.XhtmlResponse.toResponse(XmlResponse.scala:49)
>at
> net.liftweb.http.XhtmlResponse.toResponse(XmlResponse.scala:49)
>at net.liftweb.http.LiftServlet.doService(LiftServlet.scala:176)
>at
> net.liftweb.http.LiftServlet$$anonfun$doIt$1$1.apply(LiftServlet.scala:97)
>at
> net.liftweb.http.LiftServlet$$anonfun$doIt$1$1.apply(LiftServlet.scala:97)
>at
> net.liftweb.util.TimeHelpers$class.calcTime(TimeHelpers.scala:242)
>at net.liftweb.util.Helpers$.calcTime(Helpers.scala:29)
>at
> net.liftweb.util.TimeHelpers$class.logTime(TimeHelpers.scala:251)
>at net.liftweb.util.Helpers$.logTime(Helpers.scala:29)
>at net.liftweb.http.LiftServlet.doIt$1(LiftServlet.scala:96)
>at net.liftweb.http.LiftServlet.service(LiftServlet.scala:105)
>at
> 
> net.liftweb.http.LiftFilterTrait$$anonfun$doFilter$1$$anonfun$apply$18.apply(LiftServlet.scala:483)
>at
> 
> net.liftweb.http.LiftFilterTrait$$anonfun$doFilter$1$$anonfun$apply$18.apply(LiftServlet.scala:483)
>at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:33)
>at net.liftweb.http.URLRewriter$.doWith(Req.scala:370)
>at
> 
> net.liftweb.http.LiftFilterTrait$$anonfun$doFilter$1.apply(LiftServlet.scala:482)
>at
> 
> net.liftweb.http.LiftFilterTrait$$anonfun$doFilter$1.apply(LiftServlet.scala:476)
>at
> 
> net.liftweb.http.RequestVarHandler$$anonfun$apply$3$$anonfun$apply$4$$anonfun$apply$5.apply(Vars.scala:150)
>at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:33)
>at
> 
> net.liftweb.http.RequestVarHandler$$anonfun$apply$3$$anonfun$apply$4.apply(Vars.scala:149)
>at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:33)
>at
> net.liftweb.http.RequestVarHandler$$anonfun$apply$3.apply(Vars.scala:148)
>at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:33)
>at net.liftweb.http.RequestVarHandler$.apply(Vars.scala:147)
>at
> net.liftweb.http.LiftFilterTrait$class.doFilter(LiftServlet.scala:475)
>at net.liftweb.http.LiftFilter.doFilter(LiftServlet.scala:496)
>at
> 
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1115)
>at
> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:361)
>at
> 
> org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
>at
> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
>at
> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
> 

[Lift] Partial functions

2008-12-26 Thread Charles F. Munat

As a holiday gift to myself I am reading Programming in Scala from cover 
to cover. I've gotten as far as the pattern matching stuff and there's a 
discussion of partial functions. PiS says: "In general, you should try 
to work with complete functions whenever possible..."

But I notice that the Lift code is filled with partial functions. 
They're all over the place.

What is the benefit of using partial functions that outweighs the 
detriment of possible runtime errors? I'm trying to understand why 
partial functions might be useful.

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: versions out of whack?

2008-12-26 Thread Charles F. Munat

I have this in my master pom.xml file:

   
 
   scala-tools.org
   Scala-Tools Maven2 Repository
   http://scala-tools.org/repo-releases
 
 
   scala-tools.org
   Scala-Tools Maven2 Repository
   http://scala-tools.org/repo-snapshots
 
   

   
 
   scala-tools.org
   Scala-Tools Maven2 Repository
   http://scala-tools.org/repo-releases
 
   

Is this correct? Am I missing something?

Chas.

Tim Perrett wrote:
> Chas,
> 
> Do you have the scala-tools.org snapshot repo defined in your pom.xml?
> 
> If not, you'll need to add it. then maven will grab it automatically  
> for you. The other alternative is to build locally from src. If your  
> not working on the lift codebase, IMO, use the maven snapshots as it's  
> the most straight forward route.
> 
> Does that make sense?
> 
> Cheers, Tim
> 
> Sent from my iPhone
> 
> On 27 Dec 2008, at 00:25, "Charles F. Munat"  wrote:
> 
>> What does it mean when I get this error:
>>
>> 1) net.liftweb:lift-webkit:jar:0.10-SNAPSHOT
>>
>>   Try downloading the file manually from the project website.
>>
>>   Then, install it using the command:
>>   mvn install:install-file -DgroupId=net.liftweb
>> -DartifactId=lift-webkit -Dversion=0.10-SNAPSHOT -Dpackaging=jar
>> -Dfile=/path/to/file
>>
>>   Alternatively, if you host your own repository you can deploy the
>> file there:
>>   mvn deploy:deploy-file -DgroupId=net.liftweb
>> -DartifactId=lift-webkit -Dversion=0.10-SNAPSHOT -Dpackaging=jar
>> -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
>>
>>   Path to dependency:
>> 1) com.xxx:yyy-app:war:0.10-SNAPSHOT
>> 2) net.liftweb:lift-webkit:jar:0.10-SNAPSHOT
>>
>> I got this before and got around it by using git and then building and
>> installing Lift manually, but shouldn't it be possible to just run  
>> Maven
>> and have it work? Am I doing something wrong?
>>
>> Chas.
>>
>> David Pollak wrote:
>>> Charles,
>>>
>>> I did an update to the XML rendering stuff.  It looks like half your
>>> Lift jars are old and half are new.  I'd suggest blowing away your  
>>> Maven
>>> repository and doing a clean build.
>>>
>>> Thanks,
>>>
>>> David
>>>
>>> On Fri, Dec 26, 2008 at 3:15 PM, Charles F. Munat >> <mailto:c...@munat.com>> wrote:
>>>
>>>
>>>Here's a new one I haven't seen before. Are my versions out of  
>>> whack?
>>>Should I be moving up to Scala 2.7.3? What's wrong here?
>>>
>>>Any ideas?
>>>
>>>Chas.
>>>
>>>HTTP ERROR: 500
>>>
>>>net.liftweb.util.AltXML$.toXML(Lscala/xml/Node;Lscala/xml/ 
>>> NamespaceBinding;Lscala/StringBuilder;ZZ)V
>>>
>>>RequestURI=/
>>>Caused by:
>>>
>>>java.lang.NoSuchMethodError:
>>>net.liftweb.util.AltXML$.toXML(Lscala/xml/Node;Lscala/xml/ 
>>> NamespaceBinding;Lscala/StringBuilder;ZZ)V
>>>   at
>>>net.liftweb.http.NodeResponse$class.toResponse(XmlResponse.scala: 
>>> 40)
>>>   at
>>>net.liftweb.http.XhtmlResponse.toResponse(XmlResponse.scala:49)
>>>   at
>>>net.liftweb.http.XhtmlResponse.toResponse(XmlResponse.scala:49)
>>>   at  
>>> net.liftweb.http.LiftServlet.doService(LiftServlet.scala:176)
>>>   at
>>>net.liftweb.http.LiftServlet$$anonfun$doIt 
>>> $1$1.apply(LiftServlet.scala:97)
>>>   at
>>>net.liftweb.http.LiftServlet$$anonfun$doIt 
>>> $1$1.apply(LiftServlet.scala:97)
>>>   at
>>>net.liftweb.util.TimeHelpers$class.calcTime(TimeHelpers.scala:242)
>>>   at net.liftweb.util.Helpers$.calcTime(Helpers.scala:29)
>>>   at
>>>net.liftweb.util.TimeHelpers$class.logTime(TimeHelpers.scala:251)
>>>   at net.liftweb.util.Helpers$.logTime(Helpers.scala:29)
>>>   at net.liftweb.http.LiftServlet.doIt$1(LiftServlet.scala: 
>>> 96)
>>>   at net.liftweb.http.LiftServlet.service(LiftServlet.scala: 
>>> 105)
>>>   at
>>>net.liftweb.http.LiftFilterTrait$$anonfun$doFilter$1$$anonfun 
>>> $apply$18.apply(LiftServlet.scala:483)
>>>   at
>>>net.liftweb.http.LiftFilterTrait$$anonfun$doFilter$1$$anonfun 
>>> $apply$18.apply(LiftServlet.scala:483

[Lift] Re: Partial functions

2008-12-27 Thread Charles F. Munat

I see. So I looked up orElse and I see that it (and andThen) are methods 
of PartialFunction. Surprisingly, these aren't discussed at all in 
Programming in Scala. Apparently, they're beyond the scope of the book.

I understand the chaining and how this benefits the library designer 
(and the library consumer). I'm now reading through the source code and 
trying to get a better grasp of how partial functions benefit the Lift 
library.

Thanks! Your answers really helped.

BTW, if you do a search for Pf in the Lift code you'll find that there 
remain a couple of instances where the names haven't been changed to PF, 
namely line 259 of docs/presentations/lift-web-services/lift.html and 
lines 157 and 176 of src/main/scala/net/liftweb/http/CometActor.scala.

Chas.

Kris Nuttycombe wrote:
> As David has mentioned before on this list (and as I believe is 
> mentioned in the book as well) the concerns of a library designer and a 
> library user are somewhat different. Allowing the user of a library to 
> provide a partial function makes development using that library easier 
> because the user doesn't need to worry about potential match errors, or 
> having to provide for each possible case in a match; they can just 
> define their partial function over the values that they're interested in 
> and rely upon the framework to do the right thing if no match is available.
> 
> Internally, Lift will check isDefinedAt whenever a partial function is 
> used; this is an instance where the library designer takes on the 
> responsibility for providing correct handling in the undefined case, and 
> leaves the user free to handle whatever specific cases they wish. This 
> gives maximum flexibility to the users of the framework, and allows them 
> to focus on the problems they're trying to solve.
> 
> Kris
> 
> On Sat, Dec 27, 2008 at 1:18 AM, Marius  <mailto:marius.dan...@gmail.com>> wrote:
> 
> 
> Personally I think Partial functions are great because you can chain
> them ... see orEse. The other nice thing is pattern matching on
> function arguments. For instance:
> 
> val x: PartialFunction[String,String] = {
>  case "dog" => "bark"
> }
> 
> this PF is defined only if the argument is "dog". For anything else
> isDefined function returns false.But whenever you want to call a PF
> you should first call the isDefinedAt. If in the example above we'd
> use a complete function calling it with something else then a dog
> you'll get a MatchError at runtime.
> 
> So you'd call the above
> 
> val arg = "dog"
> if (x.isDefinedAt(arg)) {
>  x(arg)
> }
> 
> Br's,
> Marius
> 
> On Dec 27, 2:29 am, "Charles F. Munat"  <mailto:c...@munat.com>> wrote:
>  > As a holiday gift to myself I am reading Programming in Scala
> from cover
>  > to cover. I've gotten as far as the pattern matching stuff and
> there's a
>  > discussion of partial functions. PiS says: "In general, you
> should try
>  > to work with complete functions whenever possible..."
>  >
>  > But I notice that the Lift code is filled with partial functions.
>  > They're all over the place.
>  >
>  > What is the benefit of using partial functions that outweighs the
>  > detriment of possible runtime errors? I'm trying to understand why
>  > partial functions might be useful.
>  >
>  > 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] Forum software

2008-12-29 Thread Charles F. Munat

Does anyone know of any good Java forum software (open source) -- I'm 
not even going to ask about Scala forums (sigh). I'm looking for 
something that I could integrate with a Lift website.

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] pom.xml

2008-12-29 Thread Charles F. Munat

I am using the JPA demo as my basis and have tried to change the 
included pom.xml from one that inherits from the main lift pom.xml to a 
standalone pom.xml, but I am missing something because I continue to get 
the error below. Can anyone post a copy of a good standalone pom.xml (or 
all three) from a JPA/Lift site? Thanks!

Failed to resolve artifact.

Missing:
--
1) net.liftweb:lift-webkit:jar:0.10-SNAPSHOT

   Try downloading the file manually from the project website.

   Then, install it using the command:
   mvn install:install-file -DgroupId=net.liftweb 
-DartifactId=lift-webkit -Dversion=0.10-SNAPSHOT -Dpackaging=jar 
-Dfile=/path/to/file

   Alternatively, if you host your own repository you can deploy the 
file there:
   mvn deploy:deploy-file -DgroupId=net.liftweb 
-DartifactId=lift-webkit -Dversion=0.10-SNAPSHOT -Dpackaging=jar 
-Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

   Path to dependency:
 1) com.xxx:yyy-app:war:0.10-SNAPSHOT
 2) net.liftweb:lift-webkit:jar:0.10-SNAPSHOT

--
1 required artifact is missing.

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

2008-12-29 Thread Charles F. Munat

Good to know. Thanks!

Randall R Schulz wrote:
> On Monday 29 December 2008 13:54, Charles F. Munat wrote:
>> Does anyone know of any good Java forum software (open source) -- I'm
>> not even going to ask about Scala forums (sigh). I'm looking for
>> something that I could integrate with a Lift website.
> 
> I can't give a positive recommendation, but I strongly recommend that 
> you avoid ClearSpace by Jive software. JetBrains uses it for their 
> product forums, and it's an abomination. They recently upgraded to 
> version 2.5 and the only thing so far to say in its favor over the 
> previous version that was running there is that it doesn't crash. 
> Everything about the UI is inferior to the old version except that you 
> don't see Java stack traces any more.
> 
> 
>> Chas.
> 
> 
> Randall Schulz
> 
> > 

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

2008-12-29 Thread Charles F. Munat

I concur. There's nothing particularly difficult about changing a simple 
name, even if it is used frequently throughout the code. Global search 
and replace with a decent regex and you're done. Now, changing 
signatures or something like that -- that requires some serious recoding.

Thanks, David, for the change to Box. I do think it is much easier for 
newcomers to understand, and with no loss of terseness.

Chas.

Derek Chen-Becker wrote:
> In the grand scheme of things, changing the name of a class (Can -> Box) 
> is much more minor in my experience than some of the /behavior/ changes 
> that we've gone through the past month or so. The former is relatively 
> simple to fix with a sed script or with Find/Replace in, say, Eclipse, 
> while the latter means actually rethinking code at some level.
> 
> Derek
> 
> On Sun, Dec 28, 2008 at 2:00 PM, Tim Perrett  > wrote:
> 
> 
> Further to Davids comment, Id like to add the following:
> 
> We are currently having a strong drive forward in the lift code base,
> and the project at large (documentation, installers etc), so breaking
> changes like this, whilst few and far between, are unfortunately
> required growing pains to make lift better and more user friendly long
> term. We hope that changing from Can[T] to Box[T] will make the
> learning curve for lift new-commers easier, as we find people
> struggling with the Can[T] concept initially.
> 
> The committer team is working hard to get a 0.10 release out early in
> the new year, and we hope that when that release is out, the lift API
> will be pretty much frozen as we progress to a 1.0 RC in 2009 with
> scala 2.7.3, so this should be one of the last wide spread breaking
> changes. No doubt David will post more information about the current
> roadmap in January.
> 
> Cheers everyone, happy lifting!
> 
> Tim
> 
> 
> 
> 
> 
> 
> > 

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



[Lift] box can boogie

2008-12-29 Thread Charles F. Munat

When I do a git pull on the lift 0.10-SNAPSHOT (I think), I get an 
interesting melange of Box and Can that does not compile. Am I doing 
something wrong, or are there still some references that need to be 
changed over?

I'll keep trying.

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: box can boogie... working

2008-12-29 Thread Charles F. Munat

Well, I got it working, but it required deleting and re-cloning the 
liftweb directory, and deleting liftweb from the .m2 repository. As I 
suspected, the code is correct on the server.

So what am I doing wrong here? Why is it that git won't update the local 
code properly? Why do I have to keep deleting things from the Maven 
repository? Shouldn't the -u option update things? Is all this stuff 
broken or am I missing some important concept?

I assume there is some sort of flag I need to add to get everything to 
update properly. I still haven't figured out how to get Maven to 
download the lift-webkit without me installing it locally.

Any git or maven geniuses out there willing to divulge the secret?

Chas.

Charles F. Munat wrote:
> When I do a git pull on the lift 0.10-SNAPSHOT (I think), I get an 
> interesting melange of Box and Can that does not compile. Am I doing 
> something wrong, or are there still some references that need to be 
> changed over?
> 
> I'll keep trying.
> 
> 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: pom.xml

2008-12-29 Thread Charles F. Munat

Is it necessary to wipe the whole repo, or just net/liftweb? It seems a 
big pain to keep re-downloading everything every week or so.

Thanks for the help. I ended up downloading a clean copy of lift and 
then running mvn install, which installed everything nicely. So now, 
will it update itself when I run mvn with the -u flag, or will I need to 
reinstall lift manually after each update? Maybe that's the problem...

Is this the way it's supposed to work, or is something a bit broken with 
Maven?

Thanks!

Chas.

Derek Chen-Becker wrote:
> It should be able to pull lift-webkit from the repos. I'm guessing you 
> already have, but just as a sanity check did you wipe your maven repo?
> 
> Derek
> 
> On Mon, Dec 29, 2008 at 3:24 PM, Charles F. Munat  <mailto:c...@munat.com>> wrote:
> 
> 
> I am using the JPA demo as my basis and have tried to change the
> included pom.xml from one that inherits from the main lift pom.xml to a
> standalone pom.xml, but I am missing something because I continue to get
> the error below. Can anyone post a copy of a good standalone pom.xml (or
> all three) from a JPA/Lift site? Thanks!
> 
> Failed to resolve artifact.
> 
> Missing:
> --
> 1) net.liftweb:lift-webkit:jar:0.10-SNAPSHOT
> 
>   Try downloading the file manually from the project website.
> 
>   Then, install it using the command:
>   mvn install:install-file -DgroupId=net.liftweb
> -DartifactId=lift-webkit -Dversion=0.10-SNAPSHOT -Dpackaging=jar
> -Dfile=/path/to/file
> 
>   Alternatively, if you host your own repository you can deploy the
> file there:
>   mvn deploy:deploy-file -DgroupId=net.liftweb
> -DartifactId=lift-webkit -Dversion=0.10-SNAPSHOT -Dpackaging=jar
> -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
> 
>   Path to dependency:
> 1) com.xxx:yyy-app:war:0.10-SNAPSHOT
> 2) net.liftweb:lift-webkit:jar:0.10-SNAPSHOT
> 
> --
> 1 required artifact is missing.
> 
> 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: box can boogie

2008-12-29 Thread Charles F. Munat

Any ideas what might cause a partial update rather than a full update? 
Is it because I've only got the webkit in my pom.xml and not the other 
parts of lift (I'm not using the mapper, e.g.)?

It's working fine now, but I'd like to avoid this problem in the future. 
It seems to crop up with depressing regularity. Still not clear if I'm 
doing something wrong or if this is just the current state of 
git/maven/lift.

Thanks.

Chas.

David Pollak wrote:
> Sounds like you're getting a partial update.  The code is clean on all 
> my machines which means it's clean in GitHub.
> 
> If you're still having issues, please post up examples of compilation 
> failures.
> 
> On Mon, Dec 29, 2008 at 3:37 PM, Charles F. Munat  <mailto:c...@munat.com>> wrote:
> 
> 
> When I do a git pull on the lift 0.10-SNAPSHOT (I think), I get an
> interesting melange of Box and Can that does not compile. Am I doing
> something wrong, or are there still some references that need to be
> changed over?
> 
> I'll keep trying.
> 
> Chas.
> 
> 
> 
> 
> 
> -- 
> 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: box can boogie

2008-12-29 Thread Charles F. Munat

Yeah. (I wrote -u in other messages, but in fact it is -U that I'm 
using.) But weirdly it doesn't always seem to work. Blowing away the 
repository is a workaround, but I was just wondering if I am somehow 
messing it up or if -U doesn't always work.

Does anyone else have problems with -U not doing a full update? If so, 
any ideas as to why that might be so? It's got to drive newbies nuts.

Chas.

Derek Chen-Becker wrote:
> Are you using the "-U" flag for maven? If you don't it only checks 
> periodically for new code (once a day? Every few hours? I can't remember)
> 
> Derek
> 
> On Mon, Dec 29, 2008 at 5:14 PM, Charles F. Munat  <mailto:c...@munat.com>> wrote:
> 
> 
> Any ideas what might cause a partial update rather than a full update?
> Is it because I've only got the webkit in my pom.xml and not the other
> parts of lift (I'm not using the mapper, e.g.)?
> 
> It's working fine now, but I'd like to avoid this problem in the future.
> It seems to crop up with depressing regularity. Still not clear if I'm
> doing something wrong or if this is just the current state of
> git/maven/lift.
> 
> Thanks.
> 
> Chas.
> 
> David Pollak wrote:
>  > Sounds like you're getting a partial update.  The code is clean
> on all
>  > my machines which means it's clean in GitHub.
>  >
>  > If you're still having issues, please post up examples of compilation
>  > failures.
>  >
>  > On Mon, Dec 29, 2008 at 3:37 PM, Charles F. Munat  <mailto:c...@munat.com>
>  > <mailto:c...@munat.com <mailto:c...@munat.com>>> wrote:
>  >
>  >
>  > When I do a git pull on the lift 0.10-SNAPSHOT (I think), I
> get an
>  > interesting melange of Box and Can that does not compile. Am
> I doing
>  > something wrong, or are there still some references that need
> to be
>  > changed over?
>  >
>  > I'll keep trying.
>  >
>  > Chas.
>  >
>  >
>  >
>  >
>  >
>  > --
>  > 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: pom.xml

2008-12-29 Thread Charles F. Munat

Here's what's in the master (below the groupId, etc):


   
   
 2.7.2
   

   
 
   scala-tools.org
   Scala-Tools Maven2 Repository
   http://scala-tools.org/repo-releases
 
 
   scala-tools.org
   Scala-Tools Maven2 Repository
   http://scala-tools.org/repo-snapshots
 
   

   
 
   scala-tools.org
   Scala-Tools Maven2 Repository
   http://scala-tools.org/repo-releases
 
   

   
 
   org.scala-lang
   scala-library
   ${scala.version}
 
 
   javax.servlet
   servlet-api
   2.5
   provided
 
 
   com.petebevin.markdown
   markdownj
   0.3.0
 
 
   commons-codec
   commons-codec
   1.3
 
 
   commons-httpclient
   commons-httpclient
   3.0.1
 
 
   commons-collections
   commons-collections
   3.2
 
 
   com.rabbitmq
   rabbitmq-client
   1.2.0
 
 
   junit
   junit
   4.4
   test
 
   
 javax.activation
activation
1.1
  
   

   
 src/main/scala
 src/test/scala
 
   
 org.scala-tools
 maven-scala-plugin
 
   
 
   compile
   testCompile
 
   
 
 
   ${scala.version}
 
   
   
 org.mortbay.jetty
 maven-jetty-plugin
 
   /
   0
 
   
 
   

   
 
   
 org.scala-tools
 maven-scala-plugin
 
   ${scala.version}
 
   
 
   

Then the webapp has this:

   
 
   org.mortbay.jetty
   jetty
   (6.1,]
   test
 
 
   javax.servlet
   servlet-api
   2.5
   provided
 
 
   net.liftweb
   lift-webkit
   0.10-SNAPSHOT
 
 
 
   org.scala-lang
   scala-compiler
   ${scala.version}
   test
 
 
   ${pom.groupId}
   tales-per
   ${pom.version}
 
   

   
 
   
 org.mortbay.jetty
 maven-jetty-plugin
 
   /
   5
   
 
   9889
   6
 
   
 
   
   
 net.sf.alchim
 yuicompressor-maven-plugin
 
   
 
   compress
 
   
 
 
   true
 
   
   

   maven-surefire-plugin

  true

 
 
 

And  the  persistence  project  has  this;

 
 
 geronimo-spec
 geronimo-spec-ejb
 2.1-rc4
 
 
 org.hibernate
 hibernate-entitymanager
 3.3.1.ga
 
   
   javax.transaction
   jta
   
 
 
 
 geronimo-spec
 geronimo-spec-jta
 1.0.1B-rc4
 provided
 
 
   postgresql
   postgresql
   [8.1-404.jdbc3,)
 
 

 
 
 
 maven-surefire-plugin
 
 true
 
 
 
 


Josh  Suereth  wrote:
>  Chas,
>  
>  Please  send  your  poms.
>  
>  Note:
>  Wiping  the  maven  repo  is  the  CTRL-ALT-DEL  windows-style  fix  for  
> maven.
>  Youjust  delete  the  Lift  directory  (as  long  as  you  get  the  
> meta-data  
>  poms  associated  with  it)  you  should  be  ok.Once  again,  this  is  
> more  of  
>  a  hack,  than  a  fix.If  you're  in  a  jam,  just  do  it.If  
> not,  it's  
>  usually  better  to  figure  out  why  it's  bombing  so  younot  run  
> into  
>  the  problem  again.
>  
>  Also  remember  that  if  you"mvn  install"  something  it  goes  into  your 
>  local  
>  repo.The  mvn  -U  command  tells  maven  to  check  the  remote  
> repositories  
>  for  newer  versions  /than  the  ones  found  in  your  local  repository/  
> (i.e.  
>  if  you  install  locally,  you  will  automatically  use  that  version  
> and  the  
>  -U  will  not  do  anything  useful).  
>  
>  
>  
>  One  side  note,  please  make  sure  you're  not  using  ${pom.version}  in 
>  
>  dependencies  with  snapshot  pom  versions...  (see  here:  
>  http://jira.codehaus.org/browse/MNG-2796  )
>  
>  
>  Cheers,
>  -Josh
>  
>  On  Mon,  Dec  29,  2008  at  7:12  PM,  Charles  F.  Munat
>  <mailto:c...@munat.com>>  wrote:
>  
>  
>  Is  it  necessary  to  wipe  the  whole  repo,  or  just  
> net/liftweb?  It  seems  a
>  big  pain  to  keep  re-downloading  everything  every  week  or  so.
>  
>  Thanks  for  t

  1   2   3   4   5   6   7   >