Re: [Lift] Re: HTTP Reason Phrase

2010-02-07 Thread Timothy Perrett

If you want to alter the Reason-Phrase, you can already do that - objects like 
NotFoundResponse are just helpers on InMemoryResponse... nothing stopping you 
adding your own helpers that set headers with customised reason codes; this 
should give you what you what. I haven't managed to find an RFC that lists 
reason-phrase as anything but a particular header in the HTTP response. 

Moreover, its not the wrong thing to return a plain text response if the 
request mime was text/plain... indeed, it would be even less helpful if it 
returned JSON or such. IMHO, the response type should match what was asked for 
by the caller - i.e. its an implementation issue not a framework level issue. 

Tim

On 6 Feb 2010, at 21:55, Erkki Lindpere wrote:

 The NotFoundResponse (and others) puts the custom message into the
 request body. That works as well, but to be really lean (mainly for
 bragging rights :)) I'd like to remove any unnecessary elements from
 the rest api. Most of the error messages are going to be simple one-
 line messages (and short sentences). For some errors I might provide a
 detailed response and it could go into the body, as XML/JSON/...
 That's inconsistent if the other errors have a plain text message in
 the body.
 So I could either go with structured details for all messages or in
 simple cases use the HTTP headers or status line. A custom header
 would work, but the status line is standard and also more easily
 accessed with some client libraries.
 
 And last but perhaps not least, for debugging purposes, the HTTP
 Reason Code should show up better in web developer tools (for example
 FireBug, Chrome's tools). My web UI also goes through the REST API so
 it would be nice to read error messages right in the listing in
 firebug's net panel.
 
 So I'm suggesting that perhaps Lift would like to provide only the
 possibility of changing that value in user code. But I completely
 understand if it doesn't. Currently it doesn't seem to be supported in
 Lift's http.provider package and even in javax.servlet the
 setStatus(int, String) method is deprecated (I'm not sure if
 sendError(int, String) uses the reason phrase).
 
 Erkki L
 
 On Feb 6, 9:59 pm, Ross Mellgren dri...@gmail.com wrote:
 I think it would be fine to have different text there, probably better than 
 having the standard text if you have refined detail. I don't think it'd be a 
 good idea to conditionalize on the response text in client code - that's 
 always fragile. If you want to give additional machine-readable detail, I'd 
 put it in a response header or in the body as a JSON or XML field or what 
 have you.
 
 You can specify custom text there, but you may have to sidestep the usual 
 response classes, depending on which one. The one you gave, not found, can 
 have the message customized though, just do new NotFoundResponse(the 
 message).
 
 -Ross
 
 On Feb 6, 2010, at 2:52 PM, Erkki Lindpere wrote:
 
 It seems Lift does not support custom HTTP Reason Phrases in
 responses. I would like to send error messages in the Reason Phrase
 (along with a vaguely applicable HTTP status code) in a RESTful API
 I'm providing. My understanding of the HTTP spec is that the reason
 phrase is meant to be human readable and does not have to contain the
 recommended messages (i.e. Not Found).
 
 But maybe it would not be wise to do this? I'm not actually aware of
 any API-s that send error messages in the Reason Phrase.
 
 --
 You received this message because you are subscribed to the Google Groups 
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to 
 liftweb+unsubscr...@googlegroups.com.
 For more options, visit this group 
 athttp://groups.google.com/group/liftweb?hl=en.
 
 
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to 
 liftweb+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/liftweb?hl=en.
 
 

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



Re: [Lift] **IMPORTANT** Lift ticketing system has moved to Assembla

2010-02-07 Thread Timothy Perrett
We also need to change the liftweb.net site... dont forget that.

Cheers, Tim

On 6 Feb 2010, at 21:17, Indrajit Raychaudhuri wrote:

 Folks,
 
 Following David's announcement about moving our ticketing system to
 Assembla [1], the migration is complete and we have now completely
 moved from GitHub issues to Assembla tickets.
 
 Please DO NOT use GitHub to create issues anymore (the GitHub URL
 would be disabled), instead use this Assembla URL:
 http://www.assembla.com/spaces/liftweb/tickets
 
 Feel free to discuss, ask for clarification in the main list.
 
 Cheers,
 Indrajit
 
 [1] 
 http://groups.google.com/group/liftweb/browse_thread/thread/85c38d03790bc2eb
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to 
 liftweb+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/liftweb?hl=en.
 
 

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



Re: [Lift] Forcing Authentication not working

2010-02-07 Thread Timothy Perrett
How odd - why dont you just match on the req unapply rather that this awkward 
sub match? 

You need to do something like:

LiftRules.httpAuthProtectedResource.prepend {
  case Req(restricted :: _,_,_) = Full(AuthRole(admin))
}

LiftRules.authentication = HttpBasicAuthentication(myrealm){
  case (admin, password, req) = {
userRoles(AuthRole(admin))
true
  }
  case (user, pass,_) = Log.warn(Attempted report login with:  + user + 
: + pass); false
}

Cheers, Tim

On 6 Feb 2010, at 20:19, aw wrote:

 LiftRules.httpAuthProtectedResource.append {
  case req :  Req = req.path match {
case ParsePath(restricted :: _, _, _, _) = restrictedRole
case _ = Empty
  }
 }

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



[Lift] Re: HTTP Reason Phrase

2010-02-07 Thread Erkki Lindpere
Actually, the reason phrase is not a normal HTTP header, but part of
the status line:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html#sec6.1

Status-Line = HTTP-Version SP Status-Code SP Reason-Phrase CRLF

Examples:
HTTP/1.1 200 OK
HTTP/1.1 404 The user with id 8 does not exist

The only way of setting this in Java Servlets as far as I know is
through HttpServletResponse.setStatus(int, String), which
unfortunately is deprecated. A non-deprecated possibility is
sendError(int, String), but that goes to the container's default error
page (or the one defined in web.xml, I think) so it's not exactly what
I would like.

Also, I checked that FireBug actually does display the custom reason
phrase, but Chrome displays the standard one instead.

Erkki L

On Feb 7, 1:08 pm, Timothy Perrett timo...@getintheloop.eu wrote:
 If you want to alter the Reason-Phrase, you can already do that - objects 
 like NotFoundResponse are just helpers on InMemoryResponse... nothing 
 stopping you adding your own helpers that set headers with customised reason 
 codes; this should give you what you what. I haven't managed to find an RFC 
 that lists reason-phrase as anything but a particular header in the HTTP 
 response.

 Moreover, its not the wrong thing to return a plain text response if the 
 request mime was text/plain... indeed, it would be even less helpful if it 
 returned JSON or such. IMHO, the response type should match what was asked 
 for by the caller - i.e. its an implementation issue not a framework level 
 issue.

 Tim

 On 6 Feb 2010, at 21:55, Erkki Lindpere wrote:

  The NotFoundResponse (and others) puts the custom message into the
  request body. That works as well, but to be really lean (mainly for
  bragging rights :)) I'd like to remove any unnecessary elements from
  the rest api. Most of the error messages are going to be simple one-
  line messages (and short sentences). For some errors I might provide a
  detailed response and it could go into the body, as XML/JSON/...
  That's inconsistent if the other errors have a plain text message in
  the body.
  So I could either go with structured details for all messages or in
  simple cases use the HTTP headers or status line. A custom header
  would work, but the status line is standard and also more easily
  accessed with some client libraries.

  And last but perhaps not least, for debugging purposes, the HTTP
  Reason Code should show up better in web developer tools (for example
  FireBug, Chrome's tools). My web UI also goes through the REST API so
  it would be nice to read error messages right in the listing in
  firebug's net panel.

  So I'm suggesting that perhaps Lift would like to provide only the
  possibility of changing that value in user code. But I completely
  understand if it doesn't. Currently it doesn't seem to be supported in
  Lift's http.provider package and even in javax.servlet the
  setStatus(int, String) method is deprecated (I'm not sure if
  sendError(int, String) uses the reason phrase).

  Erkki L

  On Feb 6, 9:59 pm, Ross Mellgren dri...@gmail.com wrote:
  I think it would be fine to have different text there, probably better 
  than having the standard text if you have refined detail. I don't think 
  it'd be a good idea to conditionalize on the response text in client code 
  - that's always fragile. If you want to give additional machine-readable 
  detail, I'd put it in a response header or in the body as a JSON or XML 
  field or what have you.

  You can specify custom text there, but you may have to sidestep the usual 
  response classes, depending on which one. The one you gave, not found, can 
  have the message customized though, just do new NotFoundResponse(the 
  message).

  -Ross

  On Feb 6, 2010, at 2:52 PM, Erkki Lindpere wrote:

  It seems Lift does not support custom HTTP Reason Phrases in
  responses. I would like to send error messages in the Reason Phrase
  (along with a vaguely applicable HTTP status code) in a RESTful API
  I'm providing. My understanding of the HTTP spec is that the reason
  phrase is meant to be human readable and does not have to contain the
  recommended messages (i.e. Not Found).

  But maybe it would not be wise to do this? I'm not actually aware of
  any API-s that send error messages in the Reason Phrase.

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

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




Re: [Lift] **IMPORTANT** Lift ticketing system has moved to Assembla

2010-02-07 Thread Jeppe Nejsum Madsen
Timothy Perrett timo...@getintheloop.eu writes:

 We also need to change the liftweb.net site... dont forget that.

It's changed already (at least the frontpage link)I think David
wrote that earlier.

/Jeppe

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



[Lift] Problem with lift openid

2010-02-07 Thread Jeppe Nejsum Madsen
Hi,

I'm trying out Lift openid and created a very simple app with just a
login form:

def renderForm(xhtml: NodeSeq) : NodeSeq = {
  SimpleOpenIdVendor.loginForm
  }

This works if I use google or yahoo OpenId endpoints, but if I enter a
myopenid url such as nejsum.myopenid.com, after return from myopenid, I
get Failed to authenticate. Looking at the logs, I see:

INFO - Found association: {HMAC-SHA256}{4b6ebfd8}{gBQcmw==} verifying signature 
locally...
DEBUG - Verifying signature: 5o6mrCvUwoKzJDLRsa5QalT1qknZZ6rhyGoMkhQP56w=
DEBUG - Computing signature for input data:
assoc_handle:{HMAC-SHA256}{4b6ebfd8}{gBQcmw==}
ax.count.email:0
ax.mode:fetch_response
ax.type.email:http://schema.openid.net/contact/email
claimed_id:http://nejsum.myopenid.com/
identity:http://nejsum.myopenid.com/
mode:id_res
ns:http://specs.openid.net/auth/2.0
ns.ax:http://openid.net/srv/ax/1.0
op_endpoint:http://www.myopenid.com/server
response_nonce:2010-02-07T13:28:05ZSbisTP
return_to:http://localhost:8080/openid/response
signed:assoc_handle,ax.count.email,ax.mode,ax.type.email,claimed_id,identity,mode,ns,ns.ax,op_endpoint,response_nonce,return_to,signed
DEBUG - Calculated signature: tS+YYBmygMRWusXCxvHoms4jpRwX8nRC0MmXOWl9Ik4=
DEBUG - Local signature verification failed.
ERROR - Verification failed for: http://nejsum.myopenid.com/ reason:
Local signature verification failed

I realize this may be an openid4j question, but thought I would ask here
first :-)

/Jeppe 

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



[Lift] Maven vs. you don’t need to write anything that isn’t explicitly necessary for the task at hand

2010-02-07 Thread mjy
Posting here even though it's not really a support issue:

I've just begun reading the getting started guide and
tripped over this minor(?) inconsistency: I like the principle of
having sane defaults and quoteyou don’t need to write anything that
isn’t explicitly necessary for the task at hand/quote. But then I
saw the Maven stanza required to build a skeleton project (repeated
further down in that document):

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

Why doesn't Lift include some wrapper for Maven that
hides this ugliness? I'm sure that a lot of people would appreciate
it...

 Marinos

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



Re: [Lift] Maven vs. you don’t need to write anyt hing that isn’t explicitly necessary for the task at hand

2010-02-07 Thread Timothy Perrett
Of course we thought of that already. You can do:

mvn archetype:generate -DarchetypeCatalog=http://scala-tools.org/

That sound help you out. Moreover, SBT is not so ugly...

Cheers, Tim

On 7 Feb 2010, at 14:10, mjy wrote:

 Posting here even though it's not really a support issue:
 
 I've just begun reading the getting started guide and
 tripped over this minor(?) inconsistency: I like the principle of
 having sane defaults and quoteyou don’t need to write anything that
 isn’t explicitly necessary for the task at hand/quote. But then I
 saw the Maven stanza required to build a skeleton project (repeated
 further down in that document):
 
 mvn archetype:generate -U \
 -DarchetypeGroupId=net.liftweb \
 -DarchetypeArtifactId=lift-archetype-blank \
 -DarchetypeVersion=1.0 \
 -DremoteRepositories=http://scala-tools.org/repo-releases \
 -DgroupId=demo.helloworld \
 -DartifactId=helloworld \
 -Dversion=1.0-SNAPSHOT
 
 Why doesn't Lift include some wrapper for Maven that
 hides this ugliness? I'm sure that a lot of people would appreciate
 it...
 
 Marinos
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to 
 liftweb+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/liftweb?hl=en.
 
 

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



[Lift] Redirect after post ?

2010-02-07 Thread Francois

Hello guys,

A common pattern to avoid duplicate form submission is to redirect after 
POST to a view of the result ( 
http://en.wikipedia.org/wiki/Post/Redirect/Get )


Does Lift as something built-in for that, and if not, what would be the 
best way to build it ?



Thanks,


--
Francois ARMAND
http://fanf42.blogspot.com

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



[Lift] Are there Maven artifacts for snapshot or milestone releases?

2010-02-07 Thread Heiko Seeberger
-- 
Heiko Seeberger

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

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



[Lift] Re: Are there Maven artifacts for snapshot or milestone releases?

2010-02-07 Thread Timothy Perrett
Would be nice if you could have written an email body - subject only
emails bug the ass out of me ;-)

You mean like: http://scala-tools.org/repo-snapshots/net/liftweb/ or
the hudson builds into nexus?

Otherwise, you'll have to clarify exactly what your asking (herewith
the problem with subject-only emails! - grumble grumble grumble)

Cheers, Tim

On Feb 7, 4:17 pm, Heiko Seeberger heiko.seeber...@googlemail.com
wrote:
 --
 Heiko Seeberger

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

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



[Lift] Re: Redirect after post ?

2010-02-07 Thread Timothy Perrett
Of course its possible.

def myMethod = {
  def submitHandler(){
// after post, redirect
S.redirectTo(/my/page)
  }
  bind(., submit - SHtml.submit(submitHandler))
}

Cheers, Tim

On Feb 7, 2:53 pm, Francois fan...@gmail.com wrote:
 Hello guys,

 A common pattern to avoid duplicate form submission is to redirect after
 POST to a view of the result (http://en.wikipedia.org/wiki/Post/Redirect/Get)

 Does Lift as something built-in for that, and if not, what would be the
 best way to build it ?

 Thanks,

 --
 Francois ARMANDhttp://fanf42.blogspot.com

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



[Lift] Re: Lift Google Summer of Code?

2010-02-07 Thread Peter Robinett
Hey Justin,

That sounds like a very cool idea. Do you know what the organization
has to do?

On Feb 6, 7:23 pm, Justin Reardon justin.rear...@gmail.com wrote:
 Hi folks,

 I'm a Computer Science student at the University of Waterloo, looking to 
 participate in Google Summer of Code program this spring. Have you given any 
 thought to applying as a mentoring organization this year? I've been playing 
 around with Lift for a while now and its been a delightful change from other 
 web development frameworks I've used. I'd love to spend a summer contributing 
 to the project!

 Thanks,
 Justin Reardon

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



Re: [Lift] Re: Lift Google Summer of Code?

2010-02-07 Thread Timothy Perrett
It would require one of the committers to essentially act as a mentor - someone 
who knows Lift very well would need to mentor the candidate and dedicate a fair 
amount of time to the program. We looked at doing it last year if memory 
serves... 

Cheers, Tim

On 7 Feb 2010, at 17:29, Peter Robinett wrote:

 Hey Justin,
 
 That sounds like a very cool idea. Do you know what the organization
 has to do?
 
 On Feb 6, 7:23 pm, Justin Reardon justin.rear...@gmail.com wrote:
 Hi folks,
 
 I'm a Computer Science student at the University of Waterloo, looking to 
 participate in Google Summer of Code program this spring. Have you given any 
 thought to applying as a mentoring organization this year? I've been playing 
 around with Lift for a while now and its been a delightful change from other 
 web development frameworks I've used. I'd love to spend a summer 
 contributing to the project!
 
 Thanks,
 Justin Reardon
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to 
 liftweb+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/liftweb?hl=en.
 
 

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



Re: [Lift] Is it possible to use CRUDify snippets on non CRUDified pages?

2010-02-07 Thread Naftoli Gugenheim
The archetypes' Boot use List(index), hence my guess (since I though you 
tried Jeppe's suggestion). 
Then again they use an actual index.html. In any case / maps to index, I 
believe.

-
Jonathan Fergusonj...@spiralarm.com wrote:

Is there are reason one or more correct than the other?

Is it style or something else ?

Cheers

Jono

On 5 February 2010 10:01, David Pollak feeder.of.the.be...@gmail.comwrote:



 On Thu, Feb 4, 2010 at 2:58 PM, Naftoli Gugenheim naftoli...@gmail.comwrote:

 What does wasn't able to mean?
 Did you write
 override lazy val listPath = List(index)


 This is the wrong answer.  Jeppe gave the correct answer.


 ?

 -
 Jonathan Fergusonj...@spiralarm.com wrote:

 I wasn't able to override listPath, Ill have a bit more of a play to make
 sure I'm not doing anything to silly; trying to get /crudify/path to  / .
 Rewrite worked wonderfully.

 Cheers
 Jono

 On 5 February 2010 04:45, Jeppe Nejsum Madsen je...@ingolfs.dk wrote:

  Naftoli Gugenheim naftoli...@gmail.com writes:
 
   It's not overridable?
 
  Actually, I think it is :-)
 
  You might be able to just
 
  override lazy val listPath = Nil
 
  /Jeppe
 
  
   -
   Jeppe Nejsum Madsenje...@ingolfs.dk wrote:
  
   Jonathan Ferguson j...@spiralarm.com writes:
  
   I would like to have the list view of one of my model objects as my
 home
   page.
  
   Can this done with out having the home page redirect to /mymodel/list
 ?
  
   I don't think you can change the native URL of CRUDify list, but you
   could add a rewrite (not redirect). See
  
  
 
 http://blog.getintheloop.eu/2009/5/3/url-rewriting-with-the-lift-framework
  
   /Jeppe
  
   --
   You received this message because you are subscribed to the Google
 Groups
  Lift group.
   To post to this group, send email to lift...@googlegroups.com.
   To unsubscribe from this group, send email to
  liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com
 liftweb%2bunsubscr...@googlegroups.comliftweb%252bunsubscr...@googlegroups.com
 
  .
   For more options, visit this group at
  http://groups.google.com/group/liftweb?hl=en.
 
  --
  You received this message because you are subscribed to the Google
 Groups
  Lift group.
  To post to this group, send email to lift...@googlegroups.com.
  To unsubscribe from this group, send email to
  liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com
 liftweb%2bunsubscr...@googlegroups.comliftweb%252bunsubscr...@googlegroups.com
 
  .
  For more options, visit this group at
  http://groups.google.com/group/liftweb?hl=en.
 
 

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

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




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

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


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

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



[Lift] Re: Are there Maven artifacts for snapshot or milestone releases?

2010-02-07 Thread Heiko Seeberger
Are there Maven *archetypes* for snapshot or milestone releases?

Heiko

On Sunday, February 7, 2010, Timothy Perrett timo...@getintheloop.eu wrote:
 Would be nice if you could have written an email body - subject only
 emails bug the ass out of me ;-)

 You mean like: http://scala-tools.org/repo-snapshots/net/liftweb/ or
 the hudson builds into nexus?

 Otherwise, you'll have to clarify exactly what your asking (herewith
 the problem with subject-only emails! - grumble grumble grumble)

 Cheers, Tim

 On Feb 7, 4:17 pm, Heiko Seeberger heiko.seeber...@googlemail.com
 wrote:
 --
 Heiko Seeberger

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

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



-- 
Heiko Seeberger

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

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



Re: [Lift] **IMPORTANT** HOLD OFF CREATING TICKETS ON ASSEMBLA

2010-02-07 Thread Naftoli Gugenheim
Thank you for a great web framework!
Thanks tons Indrajit for getting this done!

-
David Pollakfeeder.of.the.be...@gmail.com wrote:

On Sat, Feb 6, 2010 at 12:12 PM, Indrajit Raychaudhuri
indraj...@gmail.comwrote:

 Go ahead! create tickets in Assembla.


Excellent job and a huge round of applause to Indrajit and Naftoli for
moving the tickets over the Assembla.  Thanks guys!



 Cheers, Indrajit

 On 05/02/10 10:49 AM, Naftoli Gugenheim wrote:

 Indrajit and I are working on importing tickets into Assembla. The first
 ticket on GitHub is #3 and there are now two on Assembla.
 So please don't create any Assembla tickets until further notice.
 Thanks!

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


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




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

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

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



Re: [Lift] lift-archetype-blank 1.1-M8 2.0-M1 : missing net.sf.retrotranslator:retrotranslator-runtime:jar:1.2.1

2010-02-07 Thread Naftoli Gugenheim
The blank archetype uses retrotranslator? Why?

-
Luke  Nezdalne...@gmail.com wrote:

Hello -

I am just getting started with Lift and used the Hello, World
archetype lift-archetype-blank (tried 1.1-M8  2.0-M1) and both fail
to build successfully from the specified public Maven repositories
with:

Missing:
--
1) net.sf.retrotranslator:retrotranslator-runtime:jar:1.2.1
...
 Path to dependency:
1) net.sf.alchim:yuicompressor-maven-plugin:maven-plugin:0.7.1
2) net.sf.retrotranslator:retrotranslator-runtime:jar:1.2.1

I stfw'd a bit and found Apache Tiles was able to resolve it (http://
tiles.apache.org/2.0/framework/tiles-assembly/dependencies.html -
Dependency Repository Locations - Artifact -
net.sf.retrotranslator:retrotranslator-runtime:jar:1.2.1) at
atlassian-public/ https://maven.atlassian.com/repository/public;,
however I have still failed to determine the correct Maven pom
incantation to get this to install itself.  I tried:

  repositories
repository
  idscala-tools.releases/id
  nameScala-Tools Maven2 Repository for Releases/name
  urlhttp://scala-tools.org/repo-releases/url
/repository
repository
  idatlassian-public/id
  urlhttps://maven.atlassian.com/repository/public/url
/repository
  /repositories

and for good measure

  pluginRepositories
pluginRepository
  idscala-tools.org/id
  nameScala-Tools Maven2 Repository/name
  urlhttp://scala-tools.org/repo-releases/url
/pluginRepository
pluginRepository
  idatlassian-public/id
  urlhttps://maven.atlassian.com/repository/public/url
/pluginRepository
  /pluginRepositories

Ultimately, I just removed the offending plugin:
  plugin
groupIdnet.sf.alchim/groupId
artifactIdyuicompressor-maven-plugin/artifactId
...
  /plugin

This was a lot bumpier than I was hoping for, but a typical Maven
experience :/  Anyone know what the proper course of action is here ?
Add some other repo (maybe in some other way), or something else?  Are
1.1-M8 and/or 2.0-M1 just not meant for folks to try out?  I'll see if
1.0.3 is the same and report back.

Thanks in advance,
- Luke

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

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



Re: [Lift] Map to JsObj

2010-02-07 Thread Naftoli Gugenheim
Since Map implements Seq you can probably remove the '.toSeq'.

-
Ross Mellgrendri...@gmail.com wrote:

JsObj(map.toSeq: _*) ?

-Ross

On Feb 5, 2010, at 3:53 PM, Peter Robinett wrote:

 I thought it would be something that already exists but I can't for
 the life of me find out how to convert a Map to a JsObj. Am I missing
 something basic in net.liftweb.http.js?
 
 Thanks,
 Peter
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to 
 liftweb+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/liftweb?hl=en.
 

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

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



Re: [Lift] Redirect after post ?

2010-02-07 Thread Naftoli Gugenheim
If you are using a StatefulSnippet call redirectTo(S.uri) on in to load the 
same page with the same snippet instance.

-
Francoisfan...@gmail.com wrote:

Hello guys,

A common pattern to avoid duplicate form submission is to redirect after 
POST to a view of the result ( 
http://en.wikipedia.org/wiki/Post/Redirect/Get )

Does Lift as something built-in for that, and if not, what would be the 
best way to build it ?


Thanks,


-- 
Francois ARMAND
http://fanf42.blogspot.com

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

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



Re: [Lift] Mapped(Date)(Time) formatter/parser

2010-02-07 Thread Naftoli Gugenheim
In reverse order:
Re #2, (a) that would create a two-way dependency between TimeHelpers and 
ConversionRules--is that desirable; (b) and thus call into question the 
decision to put ConversionRules in webkit not util. (c) Still, it would be an 
indirect branch from MappedDate etc. to ConversionRules--is there a reason?
Re #1, I'm thinking maybe an even better idea is instead signatures like
def format: String
def parse(s: String): Unit
In other words, they should deal directly with the field's state.
The advantage is that it provides a future hook to deal with parsing errors 
similar to validation errors.
Which brings me to two somewhat unrelated quesions.
1) What is the reason for 'setFromAny'? Why not overloaded methods?
2) Parsing dates with a DateFormat seems to be very brittle -- the string has 
to match the format exactly, e.g., if you write 1:00PM and the format string 
has a space before the a, it's invalid, etc.--not very user friendly. Is there 
a better way?
-
Jeppe Nejsum Madsenje...@ingolfs.dk wrote:

Naftoli Gugenheim naftoli...@gmail.com writes:

 David and all,
 QUESTION 1
 I'm working on issue #258. Here are two options for an overridable parser 
 (applies to formatting too):
 1. def parse(s: String): Box[Date] = ConversionRules.parseDate()(s)
 2. def parse: String=Box[Date] = ConversionRules.parseDate()

 What are the pros and cons, and which should I use?

I prefer 1) I see no reason for parse to be a function


 QUESTION 2
 MappedDate and MappedDateTime apparently were parsing via LiftRules in 
 setFromAny, while buildSetStringValue etc. were using (Time)Helpers.toDate. 
 Is there a reason not to change it? Or, should toDate use ConversionRules?

I think it would be natural for toDate to use ConversionRulesthen
ConversionRules becomes the only place where date formatting is handled.

/Jeppe

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

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



[Lift] Re: Forcing Authentication not working

2010-02-07 Thread aw
Thank you for responding, and I can use your advice to make my code a
little less verbose and concise.  Alas, it did not address my core
issue of forcing authentication.  The behavior is exactly the same.

If I go to a protected resource with a Role requirement, then
authentication and an authorization check is performed.  But
otherwise, nothing, and I need the authentication done because that is
what defines the roles, and I have some pages that are accessible, but
adjust due to a user's restrictions (fine-grained access control)...

Perhaps it would help to elaborate on my solution...

My authentication mechanism is really done by a special SSO Filter.
The Filter populates the HTTPRequest's remote user, so then Lift can
simply ask that for who was authenticated.  While the Servlet layer
has a valid username, I still need to build some kind of bridge to
Lift land.  As a result, I have a specialized HttpAuthentication like
so:

case class FilterAuthentication (authorizationFunc:
PartialFunction[(String), Boolean]) extends HttpAuthentication {

  /** Extract the remote username from the HTTP Request. */
  private def authenticatedUsername (r : Req) =
r.request.asInstanceOf[HTTPRequestServlet].req.getRemoteUser().toLowerCase()

  /** Extract the Authenticated User and call the Authorization
function. */
  def verified_? = {
case req = {
  authenticatedUsername(req) match {
case u if null != u  u.length  1 
authorizationFunc.isDefinedAt(u) = authorizationFunc(u)
case _ = false
  }
}
  }
}

Then, I need to hook this into LiftRules like so:

LiftRules.authentication = FilterAuthentication( {
  case username = Log.info(Authenticating:  + username)
val isAuthorized = Auth.isAuthorized(username)
if (isAuthorized) {
  val authorizedRoles = Auth.authorizedRoles(username)
  userRoles(authorizedRoles)
}
isAuthorized
})

Note that the Filter will acquire an authenticated user -- but that
user may still not have access to this particular application.  As a
result, I need to do the isAuthorized check that basically does a
lookup to see if jdoe, for example, is authorized to access my
application.  If he is, then roles are populated and true is returned;
if not, false is returned.

I need to restrict some pages, so I do something like:

LiftRules.httpAuthProtectedResource.prepend {
  case Req(restricted :: _,_,_) = restrictedRole
  case _ = Empty
}

If the user goes to /restricted/, then I see the authentication and
authorization kick in.  But I am also interested in authentication
(i.e. validating that the user is allowed to access the application)
even if index.xhtml is hit.  I thought I am telling Lift to do that
with the case _ = Empty.

I am not using the siteMap to generate my menus because I need to
control the styling.  As a result, when I create my menus, I do
something like:

lift:Auth.secure role=restricteda href=/restricted/Restricted
Access/a/lift:Auth.secure

In my case, I actually have the privilege, so I should see this link,
however because Lift isn't calling the FilterAuthentication logic, it
doesn't know my roles and hence hides the link.
If I go to /restricted/, then all is well...

In summary, according to the documentation, returning an Empty should
force an authentication, but that doesn't seem to be working.  Am I
doing something wrong?  Or is the documentation incorrect?  Or is
there a bug in 2.0-M1?

(This is a big show stopper for me, so I certainly appreciate the
assistance.)

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



Re: [Lift] Re: Lift Google Summer of Code?

2010-02-07 Thread Justin Reardon
Yes, there were posts mentioning the possibility the last two years even, but 
no one appeared to follow up on them.

Google hasn't got the documentation up for 2010 yet (shortly they say), but 
it's supposed to be pretty much the same as last year. A some point in early 
March interested organizations submit an application to Google describing the 
organization ([1] has complete list). Among other things there needs to be 
someone to act as an administer, people willing to act as mentors, and an 
Ideas list of possible projects.

If the organization gets accepted there is an application period for students 
that should be in late March. Students apply with a project proposal (likely 
based on something in the Ideas list), why the student should get the 
project, qualifications, etc. After the application period the mentoring 
organization gets allocated (at least 1) slots depending on how many students 
applied, ranks the proposals, and matches students with mentors. 

Regarding mentor time the faq estimates ~5 hours a week(see [2]), of course 
this really depends on the project/student.

[1] 
http://socghop.appspot.com/document/show/program/google/gsoc2009/faqs#org_app
[2] 
http://socghop.appspot.com/document/show/program/google/gsoc2009/faqs#mentor_time

On 2010-02-07, at 12:44 , Timothy Perrett wrote:

 It would require one of the committers to essentially act as a mentor - 
 someone who knows Lift very well would need to mentor the candidate and 
 dedicate a fair amount of time to the program. We looked at doing it last 
 year if memory serves... 
 
 Cheers, Tim
 
 On 7 Feb 2010, at 17:29, Peter Robinett wrote:
 
 Hey Justin,
 
 That sounds like a very cool idea. Do you know what the organization
 has to do?
 
 On Feb 6, 7:23 pm, Justin Reardon justin.rear...@gmail.com wrote:
 Hi folks,
 
 I'm a Computer Science student at the University of Waterloo, looking to 
 participate in Google Summer of Code program this spring. Have you given 
 any thought to applying as a mentoring organization this year? I've been 
 playing around with Lift for a while now and its been a delightful change 
 from other web development frameworks I've used. I'd love to spend a summer 
 contributing to the project!
 
 Thanks,
 Justin Reardon
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to 
 liftweb+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/liftweb?hl=en.
 
 
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to 
 liftweb+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/liftweb?hl=en.
 

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



[Lift] Re: Forcing Authentication not working

2010-02-07 Thread aw
OK, I think I found the source code that is the culprit.  From
LiftServlet.scala:

http://github.com/dpp/liftweb/blob/master/framework/lift-base/lift-webkit/src/main/scala/net/liftweb/http/LiftServlet.scala

  private def authPassed_?(req: Req): Boolean = {

val checkRoles: (Role, List[Role]) = Boolean = {
  case (resRole, roles) = (false /: roles)((l, r) = l ||
resRole.isChildOf(r.name))
}

val role = NamedPF.applyBox(req,
LiftRules.httpAuthProtectedResource.toList)
role.map(_ match {
  case Full(r) =
LiftRules.authentication.verified_?(req) match {
  case true = checkRoles(r, userRoles.get)
  case _ = false
}
  case _ = true
}) openOr true
  }

This logic seems to be inconsistent with the documentation found in
LiftRules.scala:

http://github.com/dpp/liftweb/blob/master/framework/lift-base/lift-webkit/src/main/scala/net/liftweb/http/LiftRules.scala

  /**
   * Defines the resources that are protected by authentication and
authorization. If this function
   * is notdefined for the input data, the resource is considered
unprotected ergo no authentication
   * is performed. If this function is defined and returns a Full can,
it means that this resource
   * is protected by authentication,and authenticated subjed must be
assigned to the role returned by
   * this function or to a role that is child-of this role. If this
function returns Empty it means that
   * this resource is protected by authentication but no authorization
is performed meaning that roles are
   * not verified.
   */
  val httpAuthProtectedResource =
RulesSeq[HttpAuthProtectedResourcePF]

Shouldn't there be something like:

  case Empty =
LiftRules.authentication.verified_?(req)

?

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



[Lift] Why not SHtml?

2010-02-07 Thread Naftoli Gugenheim
Hello. Why do Mapper's toForm implementations use S.fmapFunc directly rather 
than using SHtml? Is it not duplicate code?
Thanks.

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



Re: [Lift] Re: HTTP Reason Phrase

2010-02-07 Thread Ross Mellgren
Yeah you're very correct. It's unfortunate, but I think since it's deprecated 
in the container we should probably not add support for it. I can't believe 
they deprecated it for the reason they did, but there it is.

-Ross

On Feb 7, 2010, at 8:16 AM, Erkki Lindpere wrote:

 Actually, the reason phrase is not a normal HTTP header, but part of
 the status line:
 http://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html#sec6.1
 
 Status-Line = HTTP-Version SP Status-Code SP Reason-Phrase CRLF
 
 Examples:
 HTTP/1.1 200 OK
 HTTP/1.1 404 The user with id 8 does not exist
 
 The only way of setting this in Java Servlets as far as I know is
 through HttpServletResponse.setStatus(int, String), which
 unfortunately is deprecated. A non-deprecated possibility is
 sendError(int, String), but that goes to the container's default error
 page (or the one defined in web.xml, I think) so it's not exactly what
 I would like.
 
 Also, I checked that FireBug actually does display the custom reason
 phrase, but Chrome displays the standard one instead.
 
 Erkki L
 
 On Feb 7, 1:08 pm, Timothy Perrett timo...@getintheloop.eu wrote:
 If you want to alter the Reason-Phrase, you can already do that - objects 
 like NotFoundResponse are just helpers on InMemoryResponse... nothing 
 stopping you adding your own helpers that set headers with customised reason 
 codes; this should give you what you what. I haven't managed to find an RFC 
 that lists reason-phrase as anything but a particular header in the HTTP 
 response.
 
 Moreover, its not the wrong thing to return a plain text response if the 
 request mime was text/plain... indeed, it would be even less helpful if it 
 returned JSON or such. IMHO, the response type should match what was asked 
 for by the caller - i.e. its an implementation issue not a framework level 
 issue.
 
 Tim
 
 On 6 Feb 2010, at 21:55, Erkki Lindpere wrote:
 
 The NotFoundResponse (and others) puts the custom message into the
 request body. That works as well, but to be really lean (mainly for
 bragging rights :)) I'd like to remove any unnecessary elements from
 the rest api. Most of the error messages are going to be simple one-
 line messages (and short sentences). For some errors I might provide a
 detailed response and it could go into the body, as XML/JSON/...
 That's inconsistent if the other errors have a plain text message in
 the body.
 So I could either go with structured details for all messages or in
 simple cases use the HTTP headers or status line. A custom header
 would work, but the status line is standard and also more easily
 accessed with some client libraries.
 
 And last but perhaps not least, for debugging purposes, the HTTP
 Reason Code should show up better in web developer tools (for example
 FireBug, Chrome's tools). My web UI also goes through the REST API so
 it would be nice to read error messages right in the listing in
 firebug's net panel.
 
 So I'm suggesting that perhaps Lift would like to provide only the
 possibility of changing that value in user code. But I completely
 understand if it doesn't. Currently it doesn't seem to be supported in
 Lift's http.provider package and even in javax.servlet the
 setStatus(int, String) method is deprecated (I'm not sure if
 sendError(int, String) uses the reason phrase).
 
 Erkki L
 
 On Feb 6, 9:59 pm, Ross Mellgren dri...@gmail.com wrote:
 I think it would be fine to have different text there, probably better 
 than having the standard text if you have refined detail. I don't think 
 it'd be a good idea to conditionalize on the response text in client code 
 - that's always fragile. If you want to give additional machine-readable 
 detail, I'd put it in a response header or in the body as a JSON or XML 
 field or what have you.
 
 You can specify custom text there, but you may have to sidestep the usual 
 response classes, depending on which one. The one you gave, not found, can 
 have the message customized though, just do new NotFoundResponse(the 
 message).
 
 -Ross
 
 On Feb 6, 2010, at 2:52 PM, Erkki Lindpere wrote:
 
 It seems Lift does not support custom HTTP Reason Phrases in
 responses. I would like to send error messages in the Reason Phrase
 (along with a vaguely applicable HTTP status code) in a RESTful API
 I'm providing. My understanding of the HTTP spec is that the reason
 phrase is meant to be human readable and does not have to contain the
 recommended messages (i.e. Not Found).
 
 But maybe it would not be wise to do this? I'm not actually aware of
 any API-s that send error messages in the Reason Phrase.
 
 --
 You received this message because you are subscribed to the Google Groups 
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to 
 liftweb+unsubscr...@googlegroups.com.
 For more options, visit this group 
 athttp://groups.google.com/group/liftweb?hl=en.
 
 --
 You received this message because you are subscribed to the Google Groups 

Re: [Lift] Why not SHtml?

2010-02-07 Thread Naftoli Gugenheim
So if I get around to it would it indeed be preferable to point it to SHtml?

-
David Pollakfeeder.of.the.be...@gmail.com wrote:

On Sun, Feb 7, 2010 at 12:47 PM, Naftoli Gugenheim naftoli...@gmail.comwrote:

 Hello. Why do Mapper's toForm implementations use S.fmapFunc directly
 rather than using SHtml? Is it not duplicate code?


Because the Mapper code was the earliest Lift code... written long before
SHtml.


 Thanks.

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




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

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

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



Re: [Lift] Re: Lift Google Summer of Code?

2010-02-07 Thread David Pollak
I mentored Greggory Brown (Ruport now Ruby Reports) for GSoC in 2006.  It
was an excellent experience for me.

I would be willing to mentor a single student doing Lift work if I could
time-box it to 3 hours/week and if there was the right chemistry between me
and the student.

I do not have the time to submit Lift itself as a project to GSoC.  If
someone else wants to step up and do the GSoC paperwork, that'd be awesome.

Justin -- please contact me privately so we can set up a time to chat and
see if we get along.

On Sun, Feb 7, 2010 at 12:10 PM, Justin Reardon justin.rear...@gmail.comwrote:

 Yes, there were posts mentioning the possibility the last two years even,
 but no one appeared to follow up on them.

 Google hasn't got the documentation up for 2010 yet (shortly they say), but
 it's supposed to be pretty much the same as last year. A some point in early
 March interested organizations submit an application to Google describing
 the organization ([1] has complete list). Among other things there needs to
 be someone to act as an administer, people willing to act as mentors, and an
 Ideas list of possible projects.

 If the organization gets accepted there is an application period for
 students that should be in late March. Students apply with a project
 proposal (likely based on something in the Ideas list), why the student
 should get the project, qualifications, etc. After the application period
 the mentoring organization gets allocated (at least 1) slots depending on
 how many students applied, ranks the proposals, and matches students with
 mentors.

 Regarding mentor time the faq estimates ~5 hours a week(see [2]), of course
 this really depends on the project/student.

 [1]
 http://socghop.appspot.com/document/show/program/google/gsoc2009/faqs#org_app
 [2]
 http://socghop.appspot.com/document/show/program/google/gsoc2009/faqs#mentor_time

 On 2010-02-07, at 12:44 , Timothy Perrett wrote:

  It would require one of the committers to essentially act as a mentor -
 someone who knows Lift very well would need to mentor the candidate and
 dedicate a fair amount of time to the program. We looked at doing it last
 year if memory serves...
 
  Cheers, Tim
 
  On 7 Feb 2010, at 17:29, Peter Robinett wrote:
 
  Hey Justin,
 
  That sounds like a very cool idea. Do you know what the organization
  has to do?
 
  On Feb 6, 7:23 pm, Justin Reardon justin.rear...@gmail.com wrote:
  Hi folks,
 
  I'm a Computer Science student at the University of Waterloo, looking
 to participate in Google Summer of Code program this spring. Have you given
 any thought to applying as a mentoring organization this year? I've been
 playing around with Lift for a while now and its been a delightful change
 from other web development frameworks I've used. I'd love to spend a summer
 contributing to the project!
 
  Thanks,
  Justin Reardon
 
  --
  You received this message because you are subscribed to the Google
 Groups Lift group.
  To post to this group, send email to lift...@googlegroups.com.
  To unsubscribe from this group, send email to
 liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com
 .
  For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=en.
 
 
 
  --
  You received this message because you are subscribed to the Google Groups
 Lift group.
  To post to this group, send email to lift...@googlegroups.com.
  To unsubscribe from this group, send email to
 liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com
 .
  For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=en.
 

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




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

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



[Lift] Re: Problem with lift openid

2010-02-07 Thread Jeppe Nejsum Madsen
On Sun, Feb 7, 2010 at 2:30 PM, Jeppe Nejsum Madsen je...@ingolfs.dk wrote:
 Hi,

 I'm trying out Lift openid and created a very simple app with just a
 login form:

 def renderForm(xhtml: NodeSeq) : NodeSeq = {
          SimpleOpenIdVendor.loginForm
  }

 This works if I use google or yahoo OpenId endpoints, but if I enter a
 myopenid url such as nejsum.myopenid.com, after return from myopenid, I
 get Failed to authenticate. Looking at the logs, I see:

To answer my self: I think this is because the default OpenIdConsumer
tries to request the email attribute which is not available. Just one
more reason to fix
https://www.assembla.com/spaces/liftweb/tickets/329-Make-OpenID-support-more-extensible

/Jeppe

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



Re: [Lift] Why not SHtml?

2010-02-07 Thread David Pollak
On Sun, Feb 7, 2010 at 1:01 PM, Naftoli Gugenheim naftoli...@gmail.comwrote:

 So if I get around to it would it indeed be preferable to point it to
 SHtml?


Changing the code is one of the lowest priorities I could imagine.  I would
say that closing the stuff you've had on review board for  1 months would
be much higher priority.  Adding copyright notices and other headers to the
code you've written in Lift is a higher priority.  Helping to port your code
to 2.8 would be a higher priority.



 -
 David Pollakfeeder.of.the.be...@gmail.com wrote:

 On Sun, Feb 7, 2010 at 12:47 PM, Naftoli Gugenheim naftoli...@gmail.com
 wrote:

  Hello. Why do Mapper's toForm implementations use S.fmapFunc directly
  rather than using SHtml? Is it not duplicate code?
 

 Because the Mapper code was the earliest Lift code... written long before
 SHtml.


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


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

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

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




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

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



Re: [Lift] Re: Are there Maven artifacts for snapshot or milestone releases?

2010-02-07 Thread David Pollak
On Sun, Feb 7, 2010 at 10:43 AM, Heiko Seeberger 
heiko.seeber...@googlemail.com wrote:

 Are there Maven *archetypes* for snapshot or milestone releases?


There are archetypes generated for both snapshot and milestone releases.
See http://scala-tools.org/repo-snapshots/net/liftweb/lift-archetype-basic/



 Heiko

 On Sunday, February 7, 2010, Timothy Perrett timo...@getintheloop.eu
 wrote:
  Would be nice if you could have written an email body - subject only
  emails bug the ass out of me ;-)
 
  You mean like: http://scala-tools.org/repo-snapshots/net/liftweb/ or
  the hudson builds into nexus?
 
  Otherwise, you'll have to clarify exactly what your asking (herewith
  the problem with subject-only emails! - grumble grumble grumble)
 
  Cheers, Tim
 
  On Feb 7, 4:17 pm, Heiko Seeberger heiko.seeber...@googlemail.com
  wrote:
  --
  Heiko Seeberger
 
  Work: weiglewilczek.com
  Blog: heikoseeberger.name
  Follow me: twitter.com/hseeberger
  OSGi on Scala: scalamodules.org
  Lift, the simply functional web framework: liftweb.net
 
  --
  You received this message because you are subscribed to the Google Groups
 Lift group.
  To post to this group, send email to lift...@googlegroups.com.
  To unsubscribe from this group, send email to
 liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com
 .
  For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=en.
 
 

 --
 Heiko Seeberger

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

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




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

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



Re: [Lift] Re: HTTP Reason Phrase

2010-02-07 Thread Timothy Perrett
I agree Ross... I would be very reluctant to have Lift rely on some deprecated 
method in the servlet spec - even if it is in servlet 3.0.

Cheers, Tim

On 7 Feb 2010, at 20:48, Ross Mellgren wrote:

 Yeah you're very correct. It's unfortunate, but I think since it's deprecated 
 in the container we should probably not add support for it. I can't believe 
 they deprecated it for the reason they did, but there it is.
 
 -Ross
 
 On Feb 7, 2010, at 8:16 AM, Erkki Lindpere wrote:
 
 Actually, the reason phrase is not a normal HTTP header, but part of
 the status line:
 http://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html#sec6.1
 
 Status-Line = HTTP-Version SP Status-Code SP Reason-Phrase CRLF
 
 Examples:
 HTTP/1.1 200 OK
 HTTP/1.1 404 The user with id 8 does not exist
 
 The only way of setting this in Java Servlets as far as I know is
 through HttpServletResponse.setStatus(int, String), which
 unfortunately is deprecated. A non-deprecated possibility is
 sendError(int, String), but that goes to the container's default error
 page (or the one defined in web.xml, I think) so it's not exactly what
 I would like.
 
 Also, I checked that FireBug actually does display the custom reason
 phrase, but Chrome displays the standard one instead.
 
 Erkki L
 
 On Feb 7, 1:08 pm, Timothy Perrett timo...@getintheloop.eu wrote:
 If you want to alter the Reason-Phrase, you can already do that - objects 
 like NotFoundResponse are just helpers on InMemoryResponse... nothing 
 stopping you adding your own helpers that set headers with customised 
 reason codes; this should give you what you what. I haven't managed to find 
 an RFC that lists reason-phrase as anything but a particular header in the 
 HTTP response.
 
 Moreover, its not the wrong thing to return a plain text response if the 
 request mime was text/plain... indeed, it would be even less helpful if it 
 returned JSON or such. IMHO, the response type should match what was asked 
 for by the caller - i.e. its an implementation issue not a framework level 
 issue.
 
 Tim
 
 On 6 Feb 2010, at 21:55, Erkki Lindpere wrote:
 
 The NotFoundResponse (and others) puts the custom message into the
 request body. That works as well, but to be really lean (mainly for
 bragging rights :)) I'd like to remove any unnecessary elements from
 the rest api. Most of the error messages are going to be simple one-
 line messages (and short sentences). For some errors I might provide a
 detailed response and it could go into the body, as XML/JSON/...
 That's inconsistent if the other errors have a plain text message in
 the body.
 So I could either go with structured details for all messages or in
 simple cases use the HTTP headers or status line. A custom header
 would work, but the status line is standard and also more easily
 accessed with some client libraries.
 
 And last but perhaps not least, for debugging purposes, the HTTP
 Reason Code should show up better in web developer tools (for example
 FireBug, Chrome's tools). My web UI also goes through the REST API so
 it would be nice to read error messages right in the listing in
 firebug's net panel.
 
 So I'm suggesting that perhaps Lift would like to provide only the
 possibility of changing that value in user code. But I completely
 understand if it doesn't. Currently it doesn't seem to be supported in
 Lift's http.provider package and even in javax.servlet the
 setStatus(int, String) method is deprecated (I'm not sure if
 sendError(int, String) uses the reason phrase).
 
 Erkki L
 
 On Feb 6, 9:59 pm, Ross Mellgren dri...@gmail.com wrote:
 I think it would be fine to have different text there, probably better 
 than having the standard text if you have refined detail. I don't think 
 it'd be a good idea to conditionalize on the response text in client code 
 - that's always fragile. If you want to give additional machine-readable 
 detail, I'd put it in a response header or in the body as a JSON or XML 
 field or what have you.
 
 You can specify custom text there, but you may have to sidestep the usual 
 response classes, depending on which one. The one you gave, not found, 
 can have the message customized though, just do new NotFoundResponse(the 
 message).
 
 -Ross
 
 On Feb 6, 2010, at 2:52 PM, Erkki Lindpere wrote:
 
 It seems Lift does not support custom HTTP Reason Phrases in
 responses. I would like to send error messages in the Reason Phrase
 (along with a vaguely applicable HTTP status code) in a RESTful API
 I'm providing. My understanding of the HTTP spec is that the reason
 phrase is meant to be human readable and does not have to contain the
 recommended messages (i.e. Not Found).
 
 But maybe it would not be wise to do this? I'm not actually aware of
 any API-s that send error messages in the Reason Phrase.
 
 --
 You received this message because you are subscribed to the Google 
 Groups Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to 

Re: [Lift] Re: Are there Maven artifacts for snapshot or milestone releases?

2010-02-07 Thread Heiko Seeberger
Sorry guys, tonight I seem unable to ask precise questions.

What I would like to know: Is it possible to get snapshot or milestone
archetypes from an archetype catalog? I tried scala-tools.org, but found
only version 1.0 of archetype-basic. Is there another catalog containing 2.0
milestones or snapshots?

Thank you!

Heiko

On 7 February 2010 22:10, David Pollak feeder.of.the.be...@gmail.comwrote:



 On Sun, Feb 7, 2010 at 10:43 AM, Heiko Seeberger 
 heiko.seeber...@googlemail.com wrote:

 Are there Maven *archetypes* for snapshot or milestone releases?


 There are archetypes generated for both snapshot and milestone releases.
 See
 http://scala-tools.org/repo-snapshots/net/liftweb/lift-archetype-basic/



 Heiko

 On Sunday, February 7, 2010, Timothy Perrett timo...@getintheloop.eu
 wrote:
  Would be nice if you could have written an email body - subject only
  emails bug the ass out of me ;-)
 
  You mean like: http://scala-tools.org/repo-snapshots/net/liftweb/ or
  the hudson builds into nexus?
 
  Otherwise, you'll have to clarify exactly what your asking (herewith
  the problem with subject-only emails! - grumble grumble grumble)
 
  Cheers, Tim
 
  On Feb 7, 4:17 pm, Heiko Seeberger heiko.seeber...@googlemail.com
  wrote:
  --
  Heiko Seeberger
 
  Work: weiglewilczek.com
  Blog: heikoseeberger.name
  Follow me: twitter.com/hseeberger
  OSGi on Scala: scalamodules.org
  Lift, the simply functional web framework: liftweb.net
 
  --
  You received this message because you are subscribed to the Google
 Groups Lift group.
  To post to this group, send email to lift...@googlegroups.com.
  To unsubscribe from this group, send email to
 liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com
 .
  For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=en.
 
 

 --
 Heiko Seeberger

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

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




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

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




-- 
Heiko Seeberger

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

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



Re: [Lift] Why not SHtml?

2010-02-07 Thread Naftoli Gugenheim
Sure. It came up as part of those.
The RB about TableEditor has been waiting for a Ship it for a while, and the 
one about ConversionRules is pretty much done locally -- some questions on 
Mapper's usage of it are on the list waiting for a good answer.

-
David Pollakfeeder.of.the.be...@gmail.com wrote:

On Sun, Feb 7, 2010 at 1:01 PM, Naftoli Gugenheim naftoli...@gmail.comwrote:

 So if I get around to it would it indeed be preferable to point it to
 SHtml?


Changing the code is one of the lowest priorities I could imagine.  I would
say that closing the stuff you've had on review board for  1 months would
be much higher priority.  Adding copyright notices and other headers to the
code you've written in Lift is a higher priority.  Helping to port your code
to 2.8 would be a higher priority.



 -
 David Pollakfeeder.of.the.be...@gmail.com wrote:

 On Sun, Feb 7, 2010 at 12:47 PM, Naftoli Gugenheim naftoli...@gmail.com
 wrote:

  Hello. Why do Mapper's toForm implementations use S.fmapFunc directly
  rather than using SHtml? Is it not duplicate code?
 

 Because the Mapper code was the earliest Lift code... written long before
 SHtml.


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


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

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

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




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

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

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



[Lift] Re: HTTP Reason Phrase

2010-02-07 Thread Erkki Lindpere
Ok. The feature is not really that important for me, just something
that would be nice to have. I think some hack could be made with
sendError(int, String) and web.xml config, but that would be worse
than using the deprecated method.

Erkki L

On Feb 7, 11:20 pm, Timothy Perrett timo...@getintheloop.eu wrote:
 I agree Ross... I would be very reluctant to have Lift rely on some 
 deprecated method in the servlet spec - even if it is in servlet 3.0.

 Cheers, Tim

 On 7 Feb 2010, at 20:48, Ross Mellgren wrote:

  Yeah you're very correct. It's unfortunate, but I think since it's 
  deprecated in the container we should probably not add support for it. I 
  can't believe they deprecated it for the reason they did, but there it is.

  -Ross

  On Feb 7, 2010, at 8:16 AM, Erkki Lindpere wrote:

  Actually, the reason phrase is not a normal HTTP header, but part of
  the status line:
 http://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html#sec6.1

  Status-Line = HTTP-Version SP Status-Code SP Reason-Phrase CRLF

  Examples:
  HTTP/1.1 200 OK
  HTTP/1.1 404 The user with id 8 does not exist

  The only way of setting this in Java Servlets as far as I know is
  through HttpServletResponse.setStatus(int, String), which
  unfortunately is deprecated. A non-deprecated possibility is
  sendError(int, String), but that goes to the container's default error
  page (or the one defined in web.xml, I think) so it's not exactly what
  I would like.

  Also, I checked that FireBug actually does display the custom reason
  phrase, but Chrome displays the standard one instead.

  Erkki L

  On Feb 7, 1:08 pm, Timothy Perrett timo...@getintheloop.eu wrote:
  If you want to alter the Reason-Phrase, you can already do that - objects 
  like NotFoundResponse are just helpers on InMemoryResponse... nothing 
  stopping you adding your own helpers that set headers with customised 
  reason codes; this should give you what you what. I haven't managed to 
  find an RFC that lists reason-phrase as anything but a particular header 
  in the HTTP response.

  Moreover, its not the wrong thing to return a plain text response if the 
  request mime was text/plain... indeed, it would be even less helpful if 
  it returned JSON or such. IMHO, the response type should match what was 
  asked for by the caller - i.e. its an implementation issue not a 
  framework level issue.

  Tim

  On 6 Feb 2010, at 21:55, Erkki Lindpere wrote:

  The NotFoundResponse (and others) puts the custom message into the
  request body. That works as well, but to be really lean (mainly for
  bragging rights :)) I'd like to remove any unnecessary elements from
  the rest api. Most of the error messages are going to be simple one-
  line messages (and short sentences). For some errors I might provide a
  detailed response and it could go into the body, as XML/JSON/...
  That's inconsistent if the other errors have a plain text message in
  the body.
  So I could either go with structured details for all messages or in
  simple cases use the HTTP headers or status line. A custom header
  would work, but the status line is standard and also more easily
  accessed with some client libraries.

  And last but perhaps not least, for debugging purposes, the HTTP
  Reason Code should show up better in web developer tools (for example
  FireBug, Chrome's tools). My web UI also goes through the REST API so
  it would be nice to read error messages right in the listing in
  firebug's net panel.

  So I'm suggesting that perhaps Lift would like to provide only the
  possibility of changing that value in user code. But I completely
  understand if it doesn't. Currently it doesn't seem to be supported in
  Lift's http.provider package and even in javax.servlet the
  setStatus(int, String) method is deprecated (I'm not sure if
  sendError(int, String) uses the reason phrase).

  Erkki L

  On Feb 6, 9:59 pm, Ross Mellgren dri...@gmail.com wrote:
  I think it would be fine to have different text there, probably better 
  than having the standard text if you have refined detail. I don't think 
  it'd be a good idea to conditionalize on the response text in client 
  code - that's always fragile. If you want to give additional 
  machine-readable detail, I'd put it in a response header or in the body 
  as a JSON or XML field or what have you.

  You can specify custom text there, but you may have to sidestep the 
  usual response classes, depending on which one. The one you gave, not 
  found, can have the message customized though, just do new 
  NotFoundResponse(the message).

  -Ross

  On Feb 6, 2010, at 2:52 PM, Erkki Lindpere wrote:

  It seems Lift does not support custom HTTP Reason Phrases in
  responses. I would like to send error messages in the Reason Phrase
  (along with a vaguely applicable HTTP status code) in a RESTful API
  I'm providing. My understanding of the HTTP spec is that the reason
  phrase is meant to be human readable and does not have to contain the
  

[Lift] Re: Forcing Authentication not working

2010-02-07 Thread Marius
Please open a defect here http://www.assembla.com/spaces/liftweb/tickets

Br's,
Marius

On Feb 7, 10:44 pm, aw anth...@whitford.com wrote:
 OK, I think I found the source code that is the culprit.  From
 LiftServlet.scala:

 http://github.com/dpp/liftweb/blob/master/framework/lift-base/lift-we...

   private def authPassed_?(req: Req): Boolean = {

     val checkRoles: (Role, List[Role]) = Boolean = {
       case (resRole, roles) = (false /: roles)((l, r) = l ||
 resRole.isChildOf(r.name))
     }

     val role = NamedPF.applyBox(req,
 LiftRules.httpAuthProtectedResource.toList)
     role.map(_ match {
       case Full(r) =
         LiftRules.authentication.verified_?(req) match {
           case true = checkRoles(r, userRoles.get)
           case _ = false
         }
       case _ = true
     }) openOr true
   }

 This logic seems to be inconsistent with the documentation found in
 LiftRules.scala:

 http://github.com/dpp/liftweb/blob/master/framework/lift-base/lift-we...

   /**
    * Defines the resources that are protected by authentication and
 authorization. If this function
    * is notdefined for the input data, the resource is considered
 unprotected ergo no authentication
    * is performed. If this function is defined and returns a Full can,
 it means that this resource
    * is protected by authentication,and authenticated subjed must be
 assigned to the role returned by
    * this function or to a role that is child-of this role. If this
 function returns Empty it means that
    * this resource is protected by authentication but no authorization
 is performed meaning that roles are
    * not verified.
    */
   val httpAuthProtectedResource =
 RulesSeq[HttpAuthProtectedResourcePF]

 Shouldn't there be something like:

       case Empty =
         LiftRules.authentication.verified_?(req)

 ?

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