Lift in Action: The Simply Functional Web Framework for Scala

Lift in Action: The Simply Functional Web Framework for Scala

Timothy Perrett

Language: English

Pages: 424

ISBN: 1935182803

Format: PDF / Kindle (mobi) / ePub


Summary

Lift in Action is a step-by-step exploration of the Lift framework. It moves through the subject quickly using carefully crafted, well-explained examples that make you comfortable from the start. This book is written for developers who are new to both Scala and Lift.

About the Technology

Lift is a Scala-based web framework designed for extremely interactive and engaging web applications. It's highly scalable, production-ready, and will run in any servlet container. And Lift's convention-over-configuration approach lets you avoid needless work.

About this Book

Lift in Action is a step-by-step exploration of the Lift framework. It moves through the subject quickly using carefully crafted, well-explained examples that make you comfortable from the start. You'll follow an entertaining Travel Auction application that covers the core concepts and shows up architectural and development strategies. Handy appendixes offer a Scala crash course and guidance for setting up a good coding environment.

This book is written for developers who are new to both Scala and Lift and covers just enough Scala to get you started.

Purchase of the print book comes with an offer of a free PDF, ePub, and Kindle eBook from Manning. Also available is all code from the book.

What's Inside

  • Complete coverage of the Lift framework
  • Security, maintainability, and performance
  • Integration and scaling
  • Covers Lift 2.x

Table of Contents

    PART 1 GETTING STARTED
  1. Introducing Lift
  2. Hello Lift
  3. PART 2 APPLICATION TUTORIAL
  4. The auction application
  5. Customers, auctions, and bidding
  6. Shopping basket and checkout
  7. PART 3 LIFT IN DETAIL
  8. Common tasks with Lift WebKit
  9. SiteMap and access control
  10. HTTP in Lift
  11. AJAX, wiring, and Comet
  12. Persistence with Mapper
  13. Persistence with Record

Microsoft SQL Server 2012 A Beginners Guide (5th Edition)

Tales from Facebook

Programming Ruby 1.9: The Pragmatic Programmers' Guide (Facets of Ruby)

 

 

 

 

 

 

 

 

 

 

 

 

 

■ 138 139 SiteMap and access control 140 7.1 Menus and locations 141 Understanding and implementing locations Rendering menus 143 7.2 Location parameters 143 146 Default location parameters 147 Authentication parameters 150 7.3 Customizing SiteMap Creating a custom Loc 7.4 Summary 159 153 153 ■ When to customize SiteMap? 158 CONTENTS x 8 HTTP in Lift 160 8.1 HTTP pipeline 161 HTTP abstraction 161 Request lifecycle 166 8.2 URL rewriting 162 170 Defining a RewritePF

the desired output markup, which is then piped back into the rendered output to the browser. Although this fundamental concept of transforming XML is a simple one, it can be very powerful when you’re building web applications, and Lift uses the same snippet mechanism for implementing many parts of its default infrastructure. A primary 33 Snippets and templating overview example of that would be Lift’s templating support, which is built upon the very same snippet mechanism. 2.3.2 Templating

rendering of default things that other methods might want to bind into a method called single. This method can be reused elsewhere or can be composed together with other functions that need to bind elements other than those defined in the single method. This is achieved by calling the special & operator after calling single; this essentially composes the additional bindings with those specified in single and keeps the code as clutter free as possible. The approach taken here is a baby step in

dispatch = { case "all" => all case "top" => top case "paginate" => paginator.paginate _ } B private val paginator = new MapperPaginatorSnippet(Auction){ override def itemsPerPage = 5 } Extend DispatchSnippet trait C D def all = "li *" #> many(paginator.page) def top = ... Delegate dispatch methods E Display 5 records per page Bind list of auctions } trait AuctionHelpers { protected def many(auctions: List[Auction]) = ... protected def single(auction: Auction) = ... } F Move common

OrderAuction, OrderAuction.order) with Owned[OrderAuction] } D E Create OrderStatus enumeration Add post-creation functions Define foreign key to customers table Reference OrderAuction Mapper entity First, you define an enumeration of statuses that a given order can move through; for this simple use case you only need to extend scala.Enumeration. A user always needs to have an Open order in case they win one of the auctions they bid on. Upon winning an auction, it can then be assigned to

Download sample

Download

About admin