[Lift] Re: Looking for web hosting company for Lift

2009-08-24 Thread Chris Richardson
Checkout SpringSource Cloud Foundry: www.cloudfoundry.com



On Mon, Aug 24, 2009 at 9:44 AM, jack jack.wid...@gmail.com wrote:


 I am looking for a web hosting company for my Lift project. I figure
 anyone who does Java would work. Is this true? Can anyone recommend a
 company?

 



-- 
Build better software faster with our consulting and training services -
http://www.chrisrichardson.net
Author, POJOs in Action - http://www.manning.com/crichardson
Rapid deployment on Amazon EC2 with CloudTools.org and CloudFoundry.com

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



[Lift] Re: lift for cloud computing

2009-02-18 Thread Chris Richardson
Lee,

I'd certainly like to have the the Cloud Tools plugin preconfigured in the
archetype pom.xmls
I'll look into this.

Chris

-- 
Build better software faster with our consulting and training services -
http://www.chrisrichardson.net
Author, POJOs in Action - http://www.manning.com/crichardson



On Mon, Feb 16, 2009 at 11:21 PM, mighdoll leemighd...@gmail.com wrote:


 re: deployment scripts, cloudtools looks interesting.  I think it
 would be impressive if you could install lift, generate a hello world
 app, and deploy it to a new amazon cluster in three steps.  Perhaps
 lift could bundle a production cloudtools configuration or two in the
 mvn archetypes?

 Lee

 On Feb 16, 2:31 pm, Tim Perrett he...@timperrett.com wrote:
  What kind of deployment scripts did you have in mind?
 
  Also, I run lift in EC2 with no problems and its actually really
  really great :-)
 
  Cheers, Tim
 
   * Deployment: perhaps lift should release deployment scripts, or even
   EC2 VM instances?
 
   Food for thought.
 


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



[Lift] Re: Implementing RESTful web services using Lift

2009-02-10 Thread Chris Richardson
Dano,

That's a good question.
I am looking at using these web services to expose functionality of an
application that is built using the Spring framework (sorry @dpp :-) ).
My default approach is to use Spring Security/Acegi filter to handle
authentication.
And, I would have passed the credentials using either HTTP BasicAuth or as
specially named URL query parameters

Chris


On Tue, Feb 10, 2009 at 2:22 PM, Dano olearydani...@gmail.com wrote:


 Chris/David,

 Thanks very much for the example!

 Have you two discussed how to mix authorization into this example?
 When I talked with David about this topic, it seemed that restful
 services couple credentials with the request.

 For example, could you use BasicAuth with a username/password as part
 of the URL via https?  If so, how would your example above be changed
 to reflect that?

 Thanks in advance.


 Dan

 On Feb 9, 4:51 pm, David Pollak feeder.of.the.be...@gmail.com wrote:
  Chris,
  Looks like you've been having way too much fun!
 
  Thanks,
 
  David
 
  On Mon, Feb 9, 2009 at 2:01 PM, Chris Richardson 
 
 
 
  chris.e.richard...@gmail.com wrote:
   Hi,
 
   I just started playing around with Scala and Lift and with @dpp's help
   wrote a simple RESTful web service.
   I wanted to share the code with this group and get feedback and
 suggestions
   about improvements.
   See below.
   Thanks.
 
   Chris
 
   In Boot.scala you register one or more WsEndpoints (a trait that is
 defined
   later).
 
   I was wondering whether Lift has a way to search and register them
   automatically?
 
   class Boot {
 
 def boot {
 
   val x :List[WsEndpoint] = List(ExampleApi)
   x.foreach ( endpoint = LiftRules.dispatch.append
   (endpoint.dispatchRules)  )
 
 }
 
   }
 
   
 
   Here is the class that defines methods that take parameters from the
 HTTP
   request and returns XML nodes.
 
   class ExampleApi {
 
def doGet(id: String) : Node = {
  info3 id={id} /
 }
 
   }
 
   The companion object sets up the mapping rules, e.g. /api/item/1 -
   exampleApi.doGet(1)
 
   object ExampleApi extends WsEndpoint {
 
   val exampleApi = new ExampleApi()
 
   override def wsDispatchRules  =
   {
 case Req(api :: item :: id :: _, _, GetRequest) = () =
   exampleApi.doGet(id)
   }
   }
 
   WsEndpoint is a trait that handles the conversion from what Lift
 expects,
   i.e. () = Full[XmlResponse] to what is written above, i.e .() = Node
 
   trait WsEndpoint {
 
   def wsDispatchRules : PartialFunction[Req,() = Node]
 
   def dispatchRules : PartialFunction[Req,() = Full[XmlResponse]] =
 {
 new MyAdapter(wsDispatchRules)
   }
 
   abstract class PartialFunctionAdapter [F, T1, T2] (adaptee:
   PartialFunction[F, T1]) extends PartialFunction[F, T2] {
 override def isDefinedAt(r : F) = adaptee.isDefinedAt(r)
 
 override def apply(r : F)  = {
   converter(adaptee.apply(r))
 }
 
 def converter (x : T1) : T2
 
   }
 
   class MyAdapter(adaptee: PartialFunction[Req, () = Node])
   extends PartialFunctionAdapter[Req, () = Node, () =
   Full[XmlResponse] ](adaptee)   {
 
  override def converter (x : () = Node)  = {
   () = Full(XmlResponse(x()))
  }
   }
   }
 
  --
  Lift, the simply functional web frameworkhttp://liftweb.net
  Beginning Scalahttp://www.apress.com/book/view/1430219890
  Follow me:http://twitter.com/dpp
  Git some:http://github.com/dpp
 


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



[Lift] Implementing RESTful web services using Lift

2009-02-09 Thread Chris Richardson
Hi,

I just started playing around with Scala and Lift and with @dpp's help wrote
a simple RESTful web service.
I wanted to share the code with this group and get feedback and suggestions
about improvements.
See below.
Thanks.

Chris


In Boot.scala you register one or more WsEndpoints (a trait that is defined
later).

I was wondering whether Lift has a way to search and register them
automatically?

class Boot {

  def boot {

val x :List[WsEndpoint] = List(ExampleApi)
x.foreach ( endpoint = LiftRules.dispatch.append
(endpoint.dispatchRules)  )

  }

}



Here is the class that defines methods that take parameters from the HTTP
request and returns XML nodes.

class ExampleApi {

 def doGet(id: String) : Node = {
   info3 id={id} /
  }

}

The companion object sets up the mapping rules, e.g. /api/item/1 -
exampleApi.doGet(1)

object ExampleApi extends WsEndpoint {

val exampleApi = new ExampleApi()

override def wsDispatchRules  =
{
  case Req(api :: item :: id :: _, _, GetRequest) = () =
exampleApi.doGet(id)
}
}

WsEndpoint is a trait that handles the conversion from what Lift expects,
i.e. () = Full[XmlResponse] to what is written above, i.e .() = Node

trait WsEndpoint {

def wsDispatchRules : PartialFunction[Req,() = Node]

def dispatchRules : PartialFunction[Req,() = Full[XmlResponse]] = {
  new MyAdapter(wsDispatchRules)
}


abstract class PartialFunctionAdapter [F, T1, T2] (adaptee:
PartialFunction[F, T1]) extends PartialFunction[F, T2] {
  override def isDefinedAt(r : F) = adaptee.isDefinedAt(r)

  override def apply(r : F)  = {
converter(adaptee.apply(r))
  }

  def converter (x : T1) : T2

}

class MyAdapter(adaptee: PartialFunction[Req, () = Node])
extends PartialFunctionAdapter[Req, () = Node, () =
Full[XmlResponse] ](adaptee)   {

   override def converter (x : () = Node)  = {
() = Full(XmlResponse(x()))
   }
}
}

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