[Lift] Lift Google Summer of Code?

2010-02-06 Thread Justin Reardon
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.



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

2010-02-06 Thread Luke Nezda
Hi, David -

Thanks for your prompt response!

On Feb 6, 4:45 pm, David Bernard  wrote:
> retrotranslator-runtime version 1.2.1 is available in central
> repository (the default one) since 2007.
> see :http://repo2.maven.org/maven2/net/sf/retrotranslator/retrotranslator-...
>
> May be you tried to build offline, or you define/use wrong
> mirror/proxy of central repository.
Totally possible :), but certainly not intentional.
> Do you have a custom $HOME/.m2/settings.xml (with mirror or repository
> section) ?

My ~/.m2/settings.xml is empty:
ne...@gae$ less /Users/nezda/.m2/settings.xml



> When maven report report missing artifact, it also report the list of
> repository from where it try to download, what is the 'full' content
> of the missing message ?

The full error message which mentions central among the "specified
remote repositories" is below.  When I looked in looked in my local
repo, I saw a newer version !?
  /Users/nezda/.m2/repository/net/sf/retrotranslator/retrotranslator-
runtime/1.2.4/retrotranslator-runtime-1.2.4.jar

And as luck would have it, it was owned by root (likely a side effect
of sudo port upgrade scala). I did

sudo mv ~.m2/repository/net/sf/retrotranslator/ ~/

and the problem is resolved.  That Maven error message was not so
helpful; fyi

ne...@gae$ mvn --version
Apache Maven 2.2.0 (r788681; 2009-06-26 08:04:01-0500)
Java version: 1.6.0_17
Java home: /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/
Home
Default locale: en_US, platform encoding: MacRoman
OS name: "mac os x" version: "10.6.2" arch: "x86_64" Family: "mac"

I guess moral of the story is nuke your local Maven repository before
giving up.  Thanks for you help!  And now the misleading error
message:

[INFO]

[ERROR] BUILD ERROR
[INFO]

[INFO] Failed to resolve artifact.

Missing:
--
1) net.sf.retrotranslator:retrotranslator-runtime:jar:1.2.1

  Try downloading the file manually from the project website.

  Then, install it using the command:
  mvn install:install-file -DgroupId=net.sf.retrotranslator -
DartifactId=retrotranslator-runtime -Dversion=1.2.1 -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.sf.retrotranslator -
DartifactId=retrotranslator-runtime -Dversion=1.2.1 -Dpackaging=jar -
Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

  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

--
1 required artifact is missing.

for artifact:
  net.sf.alchim:yuicompressor-maven-plugin:maven-plugin:0.7.1

from the specified remote repositories:
  org.wicketstuff (http://wicketstuff.org/maven/repository/),
  scala-tools.org (http://scala-tools.org/repo-releases),
  scala-tools.releases (http://scala-tools.org/repo-releases),
  central (http://repo1.maven.org/maven2)



[INFO]

[INFO] For more information, run Maven with the -e switch
[INFO]

[INFO] Total time: 17 seconds
[INFO] Finished at: Sat Feb 06 16:51:57 CST 2010
[INFO] Final Memory: 35M/80M
[INFO]

>
> /davidB
>
> On Sat, Feb 6, 2010 at 22:36, Luke  Nezda  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:
>
> >  
> >    
> >      scala-tools.releases
> >      Scala-Tools Maven2 Repository for Releases
> >      http://scala-tools.org/repo-releases
> >    
> >    
> >      atlassian-public
> >      https://maven.atlassian.com/repository/public
> >    
> >  
>
> > and for good measure
>
> >  
> >    
> >      scala-tools.org
> >      Scala-Tools Maven2 Repository
> >      http://scala-tools.org/repo-releases
> >    
> >    
> >      atlassian-pub

[Lift] Re: URL Rewriting - 'nested' ParsePath?

2010-02-06 Thread Alex Black
Hi Philip, thanks for the response.

That looks relevant to what i'm doing... but I think the key thing I'm
looking for is for the case not to match if the product does not exist
for that manufacturer, so I can show a 404.  I think Jeppe's approach
will work well.

I'm not 100% following your example, but it looks to me like your case
statements always match /page/level1/level2 etc without a check like
does this particular level 2 (say "foo") make sense for this level1
("bar"), but maybe I misunderstood.

- Alex

On Feb 6, 8:25 pm, philip  wrote:
> Hi Alex,
>
> I am making a CMS, so I had to get database content for any page up to
> 4 levels under the URLhttp://site/page/leve1/level2/etc... Here is
> some example code from this:
>
> class Boot {
>   def selectTemplate(template: String, subPages: List[String]):
> RewriteResponse =
>     {
>       var levels = Map() ++ (List[String]("level1", "level2",
> "level3", "level4") zip subPages)
>       levels = levels + ("totalLevels" -> levels.size.toString)
>       RewriteResponse(template :: Nil, levels)
>     }
>
>   def boot {
> ... lots of stuff
>
>     LiftRules.rewrite.prepend(NamedPF("inner pages")
>         {
>           case RewriteRequest(ParsePath("page" :: subPages, _, _, _),
> _, _) => selectTemplate("innerpage", subPages)
>           case RewriteRequest(ParsePath("intercitizen" :: subPages, _,
> _, _), _, _) => selectTemplate("intercitizentemplate", subPages)
>         })
>
> This means that anything that goes tohttp://site/page/one/twogoes to
> a file called innerpage.html and the innerpage.html contains
>
> 
> 
>       
>       
> 
> 
>
> And the snippit contains
>
> package com.orsa.iom3.snippet
>
> import xml.{Text, NodeSeq}
> import net.liftweb.http.S
> import com.orsa.iom3.model.SiteContent
> import net.liftweb.util.{Log, Helpers}
> import com.orsa.util.Constants
>
> /**
>  */
>
> class Content
> {
>   def display(in: NodeSeq): NodeSeq =
>     {
>       //val name = S.attr("name") openOr "0"
>
>       // Get the site content from the database
>       val totalLevels:String = S.param("totalLevels") openOr "0"
>       // Build the path for the levels
>       var path = Constants.CMS_ROOT_PATH
>       for (i <- 1 to totalLevels.toInt)
>         path = path + Constants.CMS_PATH_SEP + S.param("level" +
> i).openOr("0")
>
>       val content:SiteContent = SiteContent.findByUniqueName(path)
> openOr new SiteContent
>       // Return the content inside a DIV
>       {scala.xml.Unparsed(content.page_Content_Html.toString)} div>
>     }
>
> }
>
> On 2月6日, 上午9時14分, Alex Black  wrote:
>
>
>
> > Hi, I'd like to rewrite a url like this:
>
> > /manufacturer/product
>
> > e.g.
>
> >     LiftRules.statelessRewrite.append( {
> >       case RewriteRequest(
> >         ParsePath( manufacturerName :: productName :: Nil, _, _,_), _,
> > _)  =>
>
> >         RewriteResponse("productView" :: Nil)
> >     })
>
> > But, I'd like to the ParsePath case to not 'catch' for non-existant
> > manufacturers, and non-existant products by the manufacturer.
>
> > So, I might do this:
>
> >     LiftRules.statelessRewrite.append( {
> >       case RewriteRequest(
> >         ParsePath( Manufacturer(manufacturer) :: Product(product) ::
> > Nil, _, _,_), _, _)  =>
>
> >         RewriteResponse("productView" :: Nil)
> >     })
>
> > Where Manufacturer and Product objects provide an extractor which does
> > a lookup.
>
> > However, the product lookup depends on the manufacturer.. is there a
> > way to handle that?
>
> > ideas:
> > 1. use an if guard
>
> >       case RewriteRequest(
> >         ParsePath( Manufacturer(manufacturer) :: productName :: Nil,
> > _, _,_), _, _)  if manufacturer.contains(productName) =>
> >           val product = manufacturer.getProduct(productName)
>
> > sucks because it looks up the product twice.
>
> > 2. some time of nested case?
>
> >       case RewriteRequest(
> >         ParsePath( Manufacturer(manufacturer) :: Product(manufacturer,
> > product) :: Nil, _, _,_), _, _)  =>
>
> > obviously doesn't work..
>
> > any suggestions welcome, thanks!
>
> > - Alex

-- 
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: URL Rewriting - 'nested' ParsePath?

2010-02-06 Thread Alex Black
Hi Jeppe, thanks, that looks like what I need!

On Feb 6, 3:03 am, Jeppe Nejsum Madsen  wrote:
> Alex Black  writes:
> > Hi, I'd like to rewrite a url like this:
>
> > /manufacturer/product
>
> > e.g.
>
> >     LiftRules.statelessRewrite.append( {
> >       case RewriteRequest(
> >         ParsePath( manufacturerName :: productName :: Nil, _, _,_), _,
> > _)  =>
>
> >         RewriteResponse("productView" :: Nil)
> >     })
>
> > But, I'd like to the ParsePath case to not 'catch' for non-existant
> > manufacturers, and non-existant products by the manufacturer.
>
> > So, I might do this:
>
> >     LiftRules.statelessRewrite.append( {
> >       case RewriteRequest(
> >         ParsePath( Manufacturer(manufacturer) :: Product(product) ::
> > Nil, _, _,_), _, _)  =>
>
> >         RewriteResponse("productView" :: Nil)
> >     })
>
> > Where Manufacturer and Product objects provide an extractor which does
> > a lookup.
>
> > However, the product lookup depends on the manufacturer.. is there a
> > way to handle that?
>
> > ideas:
> > 1. use an if guard
>
> >       case RewriteRequest(
> >         ParsePath( Manufacturer(manufacturer) :: productName :: Nil,
> > _, _,_), _, _)  if manufacturer.contains(productName) =>
> >           val product = manufacturer.getProduct(productName)
>
> > sucks because it looks up the product twice.
>
> > 2. some time of nested case?
>
> >       case RewriteRequest(
> >         ParsePath( Manufacturer(manufacturer) :: Product(manufacturer,
> > product) :: Nil, _, _,_), _, _)  =>
>
> > obviously doesn't work..
>
> > any suggestions welcome, thanks!
>
> You could write you own extractor. Here's an example from production
> code :-)
>
>  override val rewrite: LocRewrite = Full(NamedPF(name) {
>               case RewriteRequest(ParamsExtractor(account,orgUnit) , _, _) => 
> (RewriteResponse(path), Full(account, orgUnit))
>           })
>
>     object ParamsExtractor {
>       def unapply(pp:ParsePath): Option[(Account, OrgUnit)] = {
>         val result:Box[(Account, OrgUnit)] = if 
> (pp.wholePath.startsWith(path) && pp.wholePath.length == (path.length + 2)) {
>           val res = for {decrypted1 <- 
> FleetZoneRules.decrypt(pp.wholePath(path.length))
>                          account <- 
> urlAccount.is.choice(Full(_))(Account.find(decrypted1))
>                          decrypted2 <- 
> FleetZoneRules.decrypt(pp.wholePath.last)
>                          orgUnit <- 
> urlOrgUnit.is.choice(Full(_))(OrgUnit.find(decrypted2)) if (orgUnit.account 
> == account)} yield {
>                            urlAccount(Full(account))
>                            urlOrgUnit(Full(orgUnit))
>                            (account, orgUnit)
>                          }
>           log.debug("Decoded URL: %s=%s".format(pp,res))
>           res
>           }
>         else
>           None
>         result
>       }
>     }
>
> /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] Re: URL Rewriting - 'nested' ParsePath?

2010-02-06 Thread philip
Hi Alex,

I am making a CMS, so I had to get database content for any page up to
4 levels under the URL http://site/page/leve1/level2/etc ... Here is
some example code from this:

class Boot {
  def selectTemplate(template: String, subPages: List[String]):
RewriteResponse =
{
  var levels = Map() ++ (List[String]("level1", "level2",
"level3", "level4") zip subPages)
  levels = levels + ("totalLevels" -> levels.size.toString)
  RewriteResponse(template :: Nil, levels)
}

  def boot {
... lots of stuff

LiftRules.rewrite.prepend(NamedPF("inner pages")
{
  case RewriteRequest(ParsePath("page" :: subPages, _, _, _),
_, _) => selectTemplate("innerpage", subPages)
  case RewriteRequest(ParsePath("intercitizen" :: subPages, _,
_, _), _, _) => selectTemplate("intercitizentemplate", subPages)
})

This means that anything that goes to http://site/page/one/two goes to
a file called innerpage.html and the innerpage.html contains



  
  



And the snippit contains

package com.orsa.iom3.snippet

import xml.{Text, NodeSeq}
import net.liftweb.http.S
import com.orsa.iom3.model.SiteContent
import net.liftweb.util.{Log, Helpers}
import com.orsa.util.Constants

/**
 */

class Content
{
  def display(in: NodeSeq): NodeSeq =
{
  //val name = S.attr("name") openOr "0"

  // Get the site content from the database
  val totalLevels:String = S.param("totalLevels") openOr "0"
  // Build the path for the levels
  var path = Constants.CMS_ROOT_PATH
  for (i <- 1 to totalLevels.toInt)
path = path + Constants.CMS_PATH_SEP + S.param("level" +
i).openOr("0")

  val content:SiteContent = SiteContent.findByUniqueName(path)
openOr new SiteContent
  // Return the content inside a DIV
  {scala.xml.Unparsed(content.page_Content_Html.toString)}
}
}



On 2月6日, 上午9時14分, Alex Black  wrote:
> Hi, I'd like to rewrite a url like this:
>
> /manufacturer/product
>
> e.g.
>
>     LiftRules.statelessRewrite.append( {
>       case RewriteRequest(
>         ParsePath( manufacturerName :: productName :: Nil, _, _,_), _,
> _)  =>
>
>         RewriteResponse("productView" :: Nil)
>     })
>
> But, I'd like to the ParsePath case to not 'catch' for non-existant
> manufacturers, and non-existant products by the manufacturer.
>
> So, I might do this:
>
>     LiftRules.statelessRewrite.append( {
>       case RewriteRequest(
>         ParsePath( Manufacturer(manufacturer) :: Product(product) ::
> Nil, _, _,_), _, _)  =>
>
>         RewriteResponse("productView" :: Nil)
>     })
>
> Where Manufacturer and Product objects provide an extractor which does
> a lookup.
>
> However, the product lookup depends on the manufacturer.. is there a
> way to handle that?
>
> ideas:
> 1. use an if guard
>
>       case RewriteRequest(
>         ParsePath( Manufacturer(manufacturer) :: productName :: Nil,
> _, _,_), _, _)  if manufacturer.contains(productName) =>
>           val product = manufacturer.getProduct(productName)
>
> sucks because it looks up the product twice.
>
> 2. some time of nested case?
>
>       case RewriteRequest(
>         ParsePath( Manufacturer(manufacturer) :: Product(manufacturer,
> product) :: Nil, _, _,_), _, _)  =>
>
> obviously doesn't work..
>
> any suggestions welcome, thanks!
>
> - Alex

-- 
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-06 Thread David Bernard
retrotranslator-runtime version 1.2.1 is available in central
repository (the default one) since 2007.
see : 
http://repo2.maven.org/maven2/net/sf/retrotranslator/retrotranslator-runtime/1.2.1/

May be you tried to build offline, or you define/use wrong
mirror/proxy of central repository.
Do you have a custom $HOME/.m2/settings.xml (with mirror or repository
section) ?

When maven report report missing artifact, it also report the list of
repository from where it try to download, what is the 'full' content
of the missing message ?

/davidB

On Sat, Feb 6, 2010 at 22:36, Luke  Nezda  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:
>
>  
>    
>      scala-tools.releases
>      Scala-Tools Maven2 Repository for Releases
>      http://scala-tools.org/repo-releases
>    
>    
>      atlassian-public
>      https://maven.atlassian.com/repository/public
>    
>  
>
> and for good measure
>
>  
>    
>      scala-tools.org
>      Scala-Tools Maven2 Repository
>      http://scala-tools.org/repo-releases
>    
>    
>      atlassian-public
>      https://maven.atlassian.com/repository/public
>    
>  
>
> Ultimately, I just removed the offending plugin:
>      
>        net.sf.alchim
>        yuicompressor-maven-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.



[Lift] Re: HTTP Reason Phrase

2010-02-06 Thread Erkki Lindpere
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  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.



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

2010-02-06 Thread Luke Nezda
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:

  

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


  atlassian-public
  https://maven.atlassian.com/repository/public

  

and for good measure

  

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


  atlassian-public
  https://maven.atlassian.com/repository/public

  

Ultimately, I just removed the offending plugin:
  
net.sf.alchim
yuicompressor-maven-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.



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

2010-02-06 Thread David Pollak
Please note that you must register with Assembla **AND** register as a
watcher of the Lift project in order to create/edit tickets.  We have this
rule to avoid spam in the tickets.

On Sat, Feb 6, 2010 at 1:17 PM, 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
>



-- 
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] **IMPORTANT** Lift ticketing system has moved to Assembla

2010-02-06 Thread Indrajit Raychaudhuri
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.



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

2010-02-06 Thread David Pollak
On Sat, Feb 6, 2010 at 12:12 PM, Indrajit Raychaudhuri
wrote:

> 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.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, 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] **IMPORTANT** TOTALLY DO CREATE TICKETS ON ASSEMBLA

2010-02-06 Thread David Pollak
On Sat, Feb 6, 2010 at 12:16 PM, Ross Mellgren  wrote:

> Also, please don't use GitHub for issues any more. Care of Indrajit, here
> is the new URL to submit issues:
>
> http://www.assembla.com/spaces/liftweb/tickets
>
>
I have disabled the GitHub issue tracker and I have changed the issue
tracker URL from the main Lift site to the new Assembla site.


> -Ross
>
>
> On Feb 6, 2010, at 3:12 PM, Indrajit Raychaudhuri wrote:
>
> Go ahead! create tickets in Assembla.
>
> 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.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, 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] **IMPORTANT** TOTALLY DO CREATE TICKETS ON ASSEMBLA

2010-02-06 Thread Ross Mellgren
hah no problem, though if I had realized initially that you had cc'd liftweb on 
the other thread, I probably wouldn't have ;-)

-Ross

On Feb 6, 2010, at 3:35 PM, Indrajit Raychaudhuri wrote:

> Ross, Thanks for updating the subject line and clarifying even.
> 
> - Indrajit
> 
> On 07/02/10 1:46 AM, Ross Mellgren wrote:
>> Also, please don't use GitHub for issues any more. Care of Indrajit,
>> here is the new URL to submit issues:
>> 
>> http://www.assembla.com/spaces/liftweb/tickets
>> 
>> -Ross
>> 
>> 
>> On Feb 6, 2010, at 3:12 PM, Indrajit Raychaudhuri wrote:
>> 
>>> Go ahead! create tickets in Assembla.
>>> 
>>> 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 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.
>>> 
>>> --
>>> 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.
>>> 
>> 
>> --
>> 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] **IMPORTANT** TOTALLY DO CREATE TICKETS ON ASSEMBLA

2010-02-06 Thread Indrajit Raychaudhuri

Ross, Thanks for updating the subject line and clarifying even.

- Indrajit

On 07/02/10 1:46 AM, Ross Mellgren wrote:

Also, please don't use GitHub for issues any more. Care of Indrajit,
here is the new URL to submit issues:

http://www.assembla.com/spaces/liftweb/tickets

-Ross


On Feb 6, 2010, at 3:12 PM, Indrajit Raychaudhuri wrote:


Go ahead! create tickets in Assembla.

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


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



--
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] Forcing Authentication not working

2010-02-06 Thread aw
According to:

http://scala-tools.org/mvnsites-snapshots/liftweb/lift-base/lift-webkit/scaladocs/net/liftweb/http/LiftRules$object.html#httpAuthProtectedResource

It says that if I have a rule that responds with Empty, it means that
authentications is performed, but not an authorization check.  This is
what I need.  So, I have a rule something like:

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

Alas, I can clearly see that my authentication is NOT being performed
for just any page.

Am I missing something, or is the documentation incorrect, or is this
a bug?  Note that I am using 2.0-M1.

-- 
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** TOTALLY DO CREATE TICKETS ON ASSEMBLA

2010-02-06 Thread Ross Mellgren
Also, please don't use GitHub for issues any more. Care of Indrajit, here is 
the new URL to submit issues:

http://www.assembla.com/spaces/liftweb/tickets

-Ross


On Feb 6, 2010, at 3:12 PM, Indrajit Raychaudhuri wrote:

> Go ahead! create tickets in Assembla.
> 
> 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.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] **IMPORTANT** HOLD OFF CREATING TICKETS ON ASSEMBLA

2010-02-06 Thread Indrajit Raychaudhuri

Go ahead! create tickets in Assembla.

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.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: [Lift committers] We're moving our ticketing system to Assembla

2010-02-06 Thread Indrajit Raychaudhuri

Migration complete!

Please DO NOT use GitHub Issue tracking facility anymore.
Use http://www.assembla.com/spaces/liftweb/tickets instead.

Cheers, Indrajit

On 04/02/10 2:05 AM, David Pollak wrote:

Folks,

On today's committer call, we made the final decision to move the Lift
ticketing system from GitHub to Assembla.  We made the decision to move
ticketing systems because the current GitHub ticket system, while
visually pretty, is slow, lacks support for ordinal ordering (bug
priority, milestone dates, etc.), is difficult to use for more than 40
open tickets, doesn't allow attachments, etc.

I personally would have preferred to move to a home-grown system built
on top of Derek's LiftTicket system.  Unfortunately, we did not find a
prime maintainer (owner) for enhancing LiftTicket code someone who
could evolve the code into something similar to Trac or other systems.
If Derek winds up having more time or if someone else shows long term
dedication to LiftTicket, the choice of moving to LiftTicket remains open.

I vetoed Trac because it's got a horrid UI.

Assembla has a nice ticketing system (it's used by the Akka and Clojure
teams and well regarded by both teams.)

Over the next week, we'll be migrating from the GitHub ticket system to
Assembla: https://liftweb.assembla.com/spaces/liftweb/tickets  Specifically:

* Indrajit will spearhead the migration of existing tickets to the
  new system
* For the committers, I will invite you to join the project via
  Assembla's invitation system
* For the community, please start opening tickets at Assembla.  Once
  we get our existing tickets moved over, we'll disable the GitHub
  ticketing system.

One of the side benefits of the new system is that we'll relax the
"discuss the defect on the list first" policy as the Assembla ticketing
system allows for a more robust mechanism for changing the state of tickets.

Thanks,

David

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

--
You received this message because you are subscribed to the Google
Groups "Lift-committers" group.
To post to this group, send email to lift-committ...@googlegroups.com.
To unsubscribe from this group, send email to
lift-committers+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/lift-committers?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] HTTP Reason Phrase

2010-02-06 Thread Ross Mellgren
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 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] HTTP Reason Phrase

2010-02-06 Thread Erkki Lindpere
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 at 
http://groups.google.com/group/liftweb?hl=en.



[Lift] Re: Error messages are not displayed - 2.0-M1

2010-02-06 Thread Marius
What Lift version are you using?

If you are using an Ajax form  did not show
the messages associated with ID's ... messages coming from FieldError.
This is a defect I fixed about a week ago. Please use the latest lift
build.

If you just want to render all messages (regardles if they are
associated with ID's or not) in one place  
should be fine. But typically for field related message you could use
 which would render only messages associated
with "field_id" id. As a side note  only render messages
that are not associated with any ID.

Br's,
Marius

On Feb 6, 3:51 pm, wibblecp  wrote:
> hi Adam,
>
> thank you. It is exactly what I done
>
> def validateAndSave (): Unit = currentEntry.validate match {
>       case Nil => currentEntry.save ; S.notice(currentEntry.title + "
> SAVED!")
>       case x => { x map { (e:FieldError) => S.error(e.msg) } }
>     }
>
> have a nice day.
> wibble
>
> On Feb 6, 2:35 pm, Adam Warski  wrote:
>
>
>
> > Hello,
>
> > are you submitting the form with ajax?
> > If so, see this thread:
>
> >http://groups.google.com/group/liftweb/browse_thread/thread/e25d86a24...
>
> > In short, check if doing:
>
> > xs.map {i => S.error(i.msg) };
>
> > instead of:
>
> > S.error(xs);
>
> > works.
>
> > > Hi Jeppe,
> > >  does not work. Always the same result.
>
> > > If the form does not contain errors the data are saved well and the
> > > browser display S.notice("saved") correctly.
> > > The S.error method returns a List[FieldError]. I receive a List with
> > > the format of List(Full(tablename_field) : message)
>
> > > this is a field of my database class:
> > > [code]
> > > object description extends MappedTextarea(this, 255) {
> > >    override def displayName = "Description"
> > >    override def validations =  valMinLen(1, S.??("description must
> > > not be empty")) _ :: super.validations
> > >  }
>
> > > [/code]
>
> > > thanks,
> > > wibble
>
> > > On Feb 6, 12:19 pm, Jeppe Nejsum Madsen  wrote:
> > >> wibblecp  writes:
> > >>> it does not work even in the case of a single error on the form.
>
> > >>> the result is always a List(Full(entries_code) : Description must not
> > >>> be empty)
>
> > >> Try adding showAll:
>
> > >> 
>
> > >> But default, Msgs doesnøt show field-level errors
>
> > >> /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 
> > > athttp://groups.google.com/group/liftweb?hl=en.
>
> > --
> > Adam Warskihttp://www.warski.orghttp://www.softwaremill.eu

-- 
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-OpenID should default to openid_identifier for post param name

2010-02-06 Thread Erkki Lindpere
Ok, I'll do that.

BTW. As I'm doing a bit of research how providers support Attribute-
Exchange, it seems their behaviour and supported schemas can be quite
different (for example, Google ignores optional attributes). So the
function might need a parameter from which the openid provider can be
determined, to allow customizations for well-known providers.

Erkki L

On Feb 6, 9:54 am, Jeppe Nejsum Madsen  wrote:
> Erkki Lindpere  writes:
> > Thanks!
>
> > I'm now trying to customize the attribute-exchange and noticed that it
> > is embedded in a longish method. I think it would be good if this was
> > extracted to a method (maybe: def reqAttributeExchange:
> > Option[FetchRequest] ?) so that ax info could be modified without
> > digging into the rest of the logic or copy'n'pasting. Specifically, I
> > think these lines could be extracted:
>
> >     // Attribute Exchange example: fetching the 'email' attribute
> >     val fetch = FetchRequest.createFetchRequest()
> >     fetch.addAttribute("email",
> >                        // attribute alias
> >                        "http://schema.openid.net/contact/email";,   //
> > type URI
> >                        true);                                      //
> > required
>
> I maybe about to look at the openid stuff for a project and will need
> this functionality as well :-) If you could open a ticket on Assembla
> (when it's availability has been announced) I'll have a look...
>
> /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] Vim Helpers for Lift

2010-02-06 Thread TylerWeir
Antonio Salazar Cardozo put together some helpers for Vim.

http://www.vim.org/scripts/script.php?script_id=2962

"Currently provides a few commands:

* :Lmodel, Lsnippet, Lactor, Lcomet -- all take a class name and take
you to
  the appropriate associated file
* :Lview -- takes a class name and takes you to the appropriate view
file
* :Lspec or :Ltest -- when called from a class (e.g., GroupSnip),
takes you to
  the associated test file (GroupSnipTest)
* :Lclass -- the opposite of Lspec, takes you to the class for the
current test "

I'll have to play with it as soon as I can, but it looks handy.

-- 
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: Error messages are not displayed - 2.0-M1

2010-02-06 Thread Timothy Perrett
wow, thats some ugly code man. Why dont you try something like:

def validateAndSave { 
  currentEntry.validate match {
case Nil => 
  currentEntry.save
  S.notice(currentEntry.title + "SAVED!")
case List(fielderror) => S.error(fielderror.msg)
case _ => 
  }
}

I havent tested it of course, but just wanna show you how you could tidy up 
your code somewhat.

Cheers, Tim

On 6 Feb 2010, at 13:51, wibblecp wrote:

> def validateAndSave (): Unit = currentEntry.validate match {
>  case Nil => currentEntry.save ; S.notice(currentEntry.title + "
> SAVED!")
>  case x => { x map { (e:FieldError) => S.error(e.msg) } }
>}

-- 
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: Error messages are not displayed - 2.0-M1

2010-02-06 Thread wibblecp
hi Adam,

thank you. It is exactly what I done

def validateAndSave (): Unit = currentEntry.validate match {
  case Nil => currentEntry.save ; S.notice(currentEntry.title + "
SAVED!")
  case x => { x map { (e:FieldError) => S.error(e.msg) } }
}

have a nice day.
wibble


On Feb 6, 2:35 pm, Adam Warski  wrote:
> Hello,
>
> are you submitting the form with ajax?
> If so, see this thread:
>
> http://groups.google.com/group/liftweb/browse_thread/thread/e25d86a24...
>
> In short, check if doing:
>
> xs.map {i => S.error(i.msg) };
>
> instead of:
>
> S.error(xs);
>
> works.
>
>
>
> > Hi Jeppe,
> >  does not work. Always the same result.
>
> > If the form does not contain errors the data are saved well and the
> > browser display S.notice("saved") correctly.
> > The S.error method returns a List[FieldError]. I receive a List with
> > the format of List(Full(tablename_field) : message)
>
> > this is a field of my database class:
> > [code]
> > object description extends MappedTextarea(this, 255) {
> >    override def displayName = "Description"
> >    override def validations =  valMinLen(1, S.??("description must
> > not be empty")) _ :: super.validations
> >  }
>
> > [/code]
>
> > thanks,
> > wibble
>
> > On Feb 6, 12:19 pm, Jeppe Nejsum Madsen  wrote:
> >> wibblecp  writes:
> >>> it does not work even in the case of a single error on the form.
>
> >>> the result is always a List(Full(entries_code) : Description must not
> >>> be empty)
>
> >> Try adding showAll:
>
> >> 
>
> >> But default, Msgs doesnøt show field-level errors
>
> >> /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 
> > athttp://groups.google.com/group/liftweb?hl=en.
>
> --
> Adam Warskihttp://www.warski.orghttp://www.softwaremill.eu

-- 
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: Potential breakage: Choosing the default Lift logging backend

2010-02-06 Thread Timothy Perrett
Jeppe,

Certainly 2 has to be the way to go. We can add stuff to the
archetypes to ease this process for users. Moreover, we could add
specific lift modules that carried the right dependencies and boot
wire up to save the users writing boilerplate. i.e.:

+ lift-logging
\ - lift-log4j
\ - lift-logback

The overhead of this would be negligible. Thoughts?

Cheers, Tim

On Feb 6, 11:28 am, Jeppe Nejsum Madsen  wrote:
> Heiko Seeberger  writes:
> > Hi,
>
> > On 5 February 2010 22:11, Jeppe Nejsum Madsen  wrote:
>
> >> 2) is the cleanest solution since the choice of logging backend is made
> >> explicit. But this requires people to change their poms in order to get
> >> any logging.
>
> > Let's go for 2) because in real-world projects people will have to adjust
> > the POM anyway. E.g. for persistence modules or for 3rd party libs.
>
> After some thoughts, I agree.
>
> One issue remains: Configuration of the actual logging backend (ie log4j
> or logback) to load e.g. prod, test & dev configs.
>
> We can either
>
> 1) Try to be smart and figure out which backend is available and
> configure it automatically. This (I learned :-) doesn't sit too well
> with OSGi and is not really the Lift way.
>
> 2) Require backend specific configuration in Boot. This is the Lift way,
> but it's a breaking change
>
> Opinions?
>
> /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] Re: Error messages are not displayed - 2.0-M1

2010-02-06 Thread Adam Warski
Hello,

are you submitting the form with ajax?
If so, see this thread:

http://groups.google.com/group/liftweb/browse_thread/thread/e25d86a24a5266a2/9fdcf9f2ce022618

In short, check if doing:

xs.map {i => S.error(i.msg) }; 

instead of:

S.error(xs); 

works.

> Hi Jeppe,
>  does not work. Always the same result.
> 
> If the form does not contain errors the data are saved well and the
> browser display S.notice("saved") correctly.
> The S.error method returns a List[FieldError]. I receive a List with
> the format of List(Full(tablename_field) : message)
> 
> this is a field of my database class:
> [code]
> object description extends MappedTextarea(this, 255) {
>override def displayName = "Description"
>override def validations =  valMinLen(1, S.??("description must
> not be empty")) _ :: super.validations
>  }
> 
> [/code]
> 
> thanks,
> wibble
> 
> On Feb 6, 12:19 pm, Jeppe Nejsum Madsen  wrote:
>> wibblecp  writes:
>>> it does not work even in the case of a single error on the form.
>> 
>>> the result is always a List(Full(entries_code) : Description must not
>>> be empty)
>> 
>> Try adding showAll:
>> 
>> 
>> 
>> But default, Msgs doesnøt show field-level errors
>> 
>> /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.
> 

-- 
Adam Warski
http://www.warski.org
http://www.softwaremill.eu




-- 
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: Error messages are not displayed - 2.0-M1

2010-02-06 Thread wibblecp
Hi Jeppe,
 does not work. Always the same result.

If the form does not contain errors the data are saved well and the
browser display S.notice("saved") correctly.
The S.error method returns a List[FieldError]. I receive a List with
the format of List(Full(tablename_field) : message)

this is a field of my database class:
[code]
object description extends MappedTextarea(this, 255) {
override def displayName = "Description"
override def validations =  valMinLen(1, S.??("description must
not be empty")) _ :: super.validations
  }

[/code]

thanks,
wibble

On Feb 6, 12:19 pm, Jeppe Nejsum Madsen  wrote:
> wibblecp  writes:
> > it does not work even in the case of a single error on the form.
>
> > the result is always a List(Full(entries_code) : Description must not
> > be empty)
>
> Try adding showAll:
>
> 
>
> But default, Msgs doesnøt show field-level errors
>
> /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] Potential breakage: Choosing the default Lift logging backend

2010-02-06 Thread Jeppe Nejsum Madsen
Heiko Seeberger  writes:

> Hi,
>
> On 5 February 2010 22:11, Jeppe Nejsum Madsen  wrote:
>
>>
>> 2) is the cleanest solution since the choice of logging backend is made
>> explicit. But this requires people to change their poms in order to get
>> any logging.
>>
>
> Let's go for 2) because in real-world projects people will have to adjust
> the POM anyway. E.g. for persistence modules or for 3rd party libs.

After some thoughts, I agree.

One issue remains: Configuration of the actual logging backend (ie log4j
or logback) to load e.g. prod, test & dev configs.

We can either 

1) Try to be smart and figure out which backend is available and
configure it automatically. This (I learned :-) doesn't sit too well
with OSGi and is not really the Lift way.

2) Require backend specific configuration in Boot. This is the Lift way,
but it's a breaking change

Opinions?

/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] Re: Error messages are not displayed - 2.0-M1

2010-02-06 Thread Jeppe Nejsum Madsen
wibblecp  writes:

> it does not work even in the case of a single error on the form.
>
> the result is always a List(Full(entries_code) : Description must not
> be empty)

Try adding showAll:



But default, Msgs doesnøt show field-level errors

/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] Re: Error messages are not displayed - 2.0-M1

2010-02-06 Thread wibblecp
it does not work even in the case of a single error on the form.

the result is always a List(Full(entries_code) : Description must not
be empty)

thanks,
wibble.


On Feb 6, 11:00 am, wibblecp  wrote:
> Using  I receive the same result.
>
> S.notice works fine in the browser but S.error with a list of errors
> does not work.
>
> any advice? thanks,
> wibble.
>
> On Feb 6, 10:16 am, wibblecp  wrote:
>
>
>
> > Hi Marius, thanks for your raply
>
> > I am using it in my html page as:
>
> > [code]
> >         
> >             flash_error
> >             errorExplanation
> >             flash_notice
> >         
> > [/code]
>
> > thanks,
> > w.
>
> > On Feb 6, 10:12 am, Marius  wrote:
>
> > > Are you using in your html page  ?
>
> > > Br's,
> > > Marius
>
> > > On Feb 6, 10:45 am, wibblecp  wrote:
>
> > > > Hi all,
> > > > I'm newbie with lifts and I am having a little problem. I am using
> > > > Lift2.0-M1.
>
> > > > I have a snippet that runs the rescue of a model. The method is called
> > > > when the submit the form
>
> > > > [code]
> > > > def validateAndSave (): Unit = currentEntry.validate match {
> > > >       case Nil => currentEntry.save ; S.notice(currentEntry.title + "
> > > > SAVED!")
> > > >       case x => println(x) ; S.error(x);
> > > >     }
> > > > [/code]
>
> > > > I am not able to view the error messages in the browser, but only in
> > > > the shell.
> > > > Instead of using S.error(x) I tried S.error(""+x). Now when I submit a
> > > > form I see the error messages but the message looks like this:
>
> > > > [code]
> > > > List(Full(entries_code) : Description must not be empty,
> > > > Full(entries_title) : Title must not be empty;,
> > > > Full(entries_author_email) : Invalid email address)
> > > > [/code]
>
> > > > So, the message are not displayed as expected and I am not able to
> > > > understand the reason for S.error("" + x) to read something.
>
> > > > Could anyone give me an advice?
>
> > > > Thanks for your helps.
>
> > > > Ragards,
> > > > w.

-- 
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: Error messages are not displayed - 2.0-M1

2010-02-06 Thread wibblecp
Using  I receive the same result.

S.notice works fine in the browser but S.error with a list of errors
does not work.

any advice? thanks,
wibble.

On Feb 6, 10:16 am, wibblecp  wrote:
> Hi Marius, thanks for your raply
>
> I am using it in my html page as:
>
> [code]
>         
>             flash_error
>             errorExplanation
>             flash_notice
>         
> [/code]
>
> thanks,
> w.
>
> On Feb 6, 10:12 am, Marius  wrote:
>
>
>
> > Are you using in your html page  ?
>
> > Br's,
> > Marius
>
> > On Feb 6, 10:45 am, wibblecp  wrote:
>
> > > Hi all,
> > > I'm newbie with lifts and I am having a little problem. I am using
> > > Lift2.0-M1.
>
> > > I have a snippet that runs the rescue of a model. The method is called
> > > when the submit the form
>
> > > [code]
> > > def validateAndSave (): Unit = currentEntry.validate match {
> > >       case Nil => currentEntry.save ; S.notice(currentEntry.title + "
> > > SAVED!")
> > >       case x => println(x) ; S.error(x);
> > >     }
> > > [/code]
>
> > > I am not able to view the error messages in the browser, but only in
> > > the shell.
> > > Instead of using S.error(x) I tried S.error(""+x). Now when I submit a
> > > form I see the error messages but the message looks like this:
>
> > > [code]
> > > List(Full(entries_code) : Description must not be empty,
> > > Full(entries_title) : Title must not be empty;,
> > > Full(entries_author_email) : Invalid email address)
> > > [/code]
>
> > > So, the message are not displayed as expected and I am not able to
> > > understand the reason for S.error("" + x) to read something.
>
> > > Could anyone give me an advice?
>
> > > Thanks for your helps.
>
> > > Ragards,
> > > w.

-- 
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: Error messages are not displayed - 2.0-M1

2010-02-06 Thread wibblecp
Hi Marius, thanks for your raply

I am using it in my html page as:

[code]

flash_error
errorExplanation
flash_notice

[/code]

thanks,
w.

On Feb 6, 10:12 am, Marius  wrote:
> Are you using in your html page  ?
>
> Br's,
> Marius
>
> On Feb 6, 10:45 am, wibblecp  wrote:
>
>
>
> > Hi all,
> > I'm newbie with lifts and I am having a little problem. I am using
> > Lift2.0-M1.
>
> > I have a snippet that runs the rescue of a model. The method is called
> > when the submit the form
>
> > [code]
> > def validateAndSave (): Unit = currentEntry.validate match {
> >       case Nil => currentEntry.save ; S.notice(currentEntry.title + "
> > SAVED!")
> >       case x => println(x) ; S.error(x);
> >     }
> > [/code]
>
> > I am not able to view the error messages in the browser, but only in
> > the shell.
> > Instead of using S.error(x) I tried S.error(""+x). Now when I submit a
> > form I see the error messages but the message looks like this:
>
> > [code]
> > List(Full(entries_code) : Description must not be empty,
> > Full(entries_title) : Title must not be empty;,
> > Full(entries_author_email) : Invalid email address)
> > [/code]
>
> > So, the message are not displayed as expected and I am not able to
> > understand the reason for S.error("" + x) to read something.
>
> > Could anyone give me an advice?
>
> > Thanks for your helps.
>
> > Ragards,
> > w.

-- 
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: Error messages are not displayed - 2.0-M1

2010-02-06 Thread Marius
Are you using in your html page  ?

Br's,
Marius

On Feb 6, 10:45 am, wibblecp  wrote:
> Hi all,
> I'm newbie with lifts and I am having a little problem. I am using
> Lift2.0-M1.
>
> I have a snippet that runs the rescue of a model. The method is called
> when the submit the form
>
> [code]
> def validateAndSave (): Unit = currentEntry.validate match {
>       case Nil => currentEntry.save ; S.notice(currentEntry.title + "
> SAVED!")
>       case x => println(x) ; S.error(x);
>     }
> [/code]
>
> I am not able to view the error messages in the browser, but only in
> the shell.
> Instead of using S.error(x) I tried S.error(""+x). Now when I submit a
> form I see the error messages but the message looks like this:
>
> [code]
> List(Full(entries_code) : Description must not be empty,
> Full(entries_title) : Title must not be empty;,
> Full(entries_author_email) : Invalid email address)
> [/code]
>
> So, the message are not displayed as expected and I am not able to
> understand the reason for S.error("" + x) to read something.
>
> Could anyone give me an advice?
>
> Thanks for your helps.
>
> Ragards,
> w.

-- 
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] Error messages are not displayed - 2.0-M1

2010-02-06 Thread wibblecp
Hi all,
I'm newbie with lifts and I am having a little problem. I am using
Lift2.0-M1.

I have a snippet that runs the rescue of a model. The method is called
when the submit the form

[code]
def validateAndSave (): Unit = currentEntry.validate match {
  case Nil => currentEntry.save ; S.notice(currentEntry.title + "
SAVED!")
  case x => println(x) ; S.error(x);
}
[/code]

I am not able to view the error messages in the browser, but only in
the shell.
Instead of using S.error(x) I tried S.error(""+x). Now when I submit a
form I see the error messages but the message looks like this:

[code]
List(Full(entries_code) : Description must not be empty,
Full(entries_title) : Title must not be empty;,
Full(entries_author_email) : Invalid email address)
[/code]

So, the message are not displayed as expected and I am not able to
understand the reason for S.error("" + x) to read something.

Could anyone give me an advice?

Thanks for your helps.

Ragards,
w.


-- 
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: OSGi example, what to do to make it run?

2010-02-06 Thread Heiko Seeberger
Philip,

2010/2/6 philip 

>
> Why do I want to do that? I am making a code generator which generates
> Scala code, I want the user to be able to try out the Scala code. So
> some liftweb method would generate a .scala file and another would
> package it into a OSGi and load the OSGi.
>

OSGi offers so much more than installing/updating bundles at runtime: There
is dependency management, versioning, services, etc. But you have to pay a
price for all these features => Constraints and complexity.

I do not think you need to pay that price: Just use the embedded Scala
compiler or even the interpreter. Take a look at http://www.simplyscala.com,
they might be doing something similar.

Heiko

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] URL Rewriting - 'nested' ParsePath?

2010-02-06 Thread Jeppe Nejsum Madsen
Alex Black  writes:

> Hi, I'd like to rewrite a url like this:
>
> /manufacturer/product
>
> e.g.
>
> LiftRules.statelessRewrite.append( {
>   case RewriteRequest(
> ParsePath( manufacturerName :: productName :: Nil, _, _,_), _,
> _)  =>
>
> RewriteResponse("productView" :: Nil)
> })
>
> But, I'd like to the ParsePath case to not 'catch' for non-existant
> manufacturers, and non-existant products by the manufacturer.
>
> So, I might do this:
>
> LiftRules.statelessRewrite.append( {
>   case RewriteRequest(
> ParsePath( Manufacturer(manufacturer) :: Product(product) ::
> Nil, _, _,_), _, _)  =>
>
> RewriteResponse("productView" :: Nil)
> })
>
> Where Manufacturer and Product objects provide an extractor which does
> a lookup.
>
> However, the product lookup depends on the manufacturer.. is there a
> way to handle that?
>
> ideas:
> 1. use an if guard
>
>   case RewriteRequest(
> ParsePath( Manufacturer(manufacturer) :: productName :: Nil,
> _, _,_), _, _)  if manufacturer.contains(productName) =>
>   val product = manufacturer.getProduct(productName)
>
> sucks because it looks up the product twice.
>
> 2. some time of nested case?
>
>   case RewriteRequest(
> ParsePath( Manufacturer(manufacturer) :: Product(manufacturer,
> product) :: Nil, _, _,_), _, _)  =>
>
> obviously doesn't work..
>
> any suggestions welcome, thanks!


You could write you own extractor. Here's an example from production
code :-)

 override val rewrite: LocRewrite = Full(NamedPF(name) {
  case RewriteRequest(ParamsExtractor(account,orgUnit) , _, _) => 
(RewriteResponse(path), Full(account, orgUnit))
  })


object ParamsExtractor {
  def unapply(pp:ParsePath): Option[(Account, OrgUnit)] = {
val result:Box[(Account, OrgUnit)] = if (pp.wholePath.startsWith(path) 
&& pp.wholePath.length == (path.length + 2)) {
  val res = for {decrypted1 <- 
FleetZoneRules.decrypt(pp.wholePath(path.length))
 account <- 
urlAccount.is.choice(Full(_))(Account.find(decrypted1))
 decrypted2 <- FleetZoneRules.decrypt(pp.wholePath.last)
 orgUnit <- 
urlOrgUnit.is.choice(Full(_))(OrgUnit.find(decrypted2)) if (orgUnit.account == 
account)} yield {
   urlAccount(Full(account))
   urlOrgUnit(Full(orgUnit))
   (account, orgUnit)
 }
  log.debug("Decoded URL: %s=%s".format(pp,res))
  res
  }
else
  None
result
  }
}

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