Front cover
brief contents
contents
preface
acknowledgments
about this book
Roadmap
Who should read this book?
Code conventions and examples
Author Online
about the author
about the cover illustration
Part 1 — Getting started
Introducing Lift
1.1 What is Scala?
1.2 What is Lift?
1.2.1 Lift design goals
1.2.2 View-first design
1.2.3 Community and team
1.3 Lift features
1.3.1 Lift Core and Lift Web
1.3.2 Lift Persistence
1.3.3 Lift Modules
1.4 Summary
Hello Lift
2.1 Getting started with SBT
2.2 Your first Lift application
2.2.1 Creating the project
2.2.2 Inspecting the project
2.2.3 Booting the application
2.3 Snippets and templating overview
2.3.1 Snippets
2.3.2 Templating overview
2.4 Summary
Part 2 — Application tutorial
The auction application
3.1 Application requirements
3.1.1 Frontend
3.1.2 Administration
3.2 Template structure
3.2.1 Design workflow
3.2.2 Template setup
3.3 Data models
3.3.1 Schema definition
3.3.2 Connecting to the database
3.4 Scaffolding
3.4.1 Prototype traits
3.4.2 CRUD generation
3.5 Validation
3.5.1 Definitions
3.5.2 Displaying field errors
3.6 Summary
Customers, auctions, and bidding
4.1 Building an auction catalog
4.1.1 Listing auctions
4.1.2 Adding to SiteMap
4.2 Displaying auctions
4.2.1 Auction detail URLs
4.2.2 The AJAX bidding interface
4.2.3 Real-time bidding
4.3 Summary
Shopping basket and checkout
5.1 Order creation
5.1.1 Order models
5.1.2 Attributing auctions to customers
5.2 Implementing the basket and checkout process
5.2.1 Implementing the basket
5.2.2 Implementing the checkout
5.3 Collecting payment with PayPal
5.3.1 Environment setup
5.3.2 The Buy Now button
5.4 Summary
Part 3 — Lift in detail
Common tasks with Lift WebKit
6.1 Templates, snippets, and views
6.1.1 Templates
6.1.2 Snippets
6.1.3 Views
6.2 Managing state
6.2.1 Request and session state
6.2.2 Cookies
6.3 Forms with LiftScreen and Wizard
6.3.1 LiftScreen
6.3.2 Wizard
6.4 Widgets
6.4.1 AutoComplete widget
6.4.2 Gravatar widget
6.5 Summary
SiteMap and access control
7.1 Menus and locations
7.1.1 Understanding and implementing locations
7.1.2 Rendering menus
7.2 Location parameters
7.2.1 Default location parameters
7.2.2 Authentication parameters
7.3 Customizing SiteMap
7.3.1 Creating a custom Loc
7.3.2 When to customize SiteMap?
7.4 Summary
HTTP in Lift
8.1 HTTP pipeline
8.1.1 HTTP abstraction
8.1.2 Application lifecycle
8.1.3 Request lifecycle
8.2 URL rewriting
8.2.1 Defining a RewritePF
8.2.2 Advanced rewriting
8.3 Dispatching and web services
8.3.1 Using the HTTP dispatch DSL
8.3.2 Basic REST service
8.3.3 Advanced multiformat REST service
8.4 Summary
AJAX, wiring, and Comet
9.1 AJAX
9.1.1 JavaScript abstractions
9.1.2 AJAX 101
9.1.3 Sophisticated AJAX
9.1.4 Using JSON forms with AJAX
9.1.5 AJAX with LiftScreen
9.2 Wiring
9.2.1 Formula wiring
9.3 Comet
9.3.1 What are actors?
9.3.2 Basic Comet usage
9.3.3 Comet-based rock-paper-scissors
9.4 Summary
Persistence with Mapper
10.1 Setting up a database
10.1.1 Installation and connectivity
10.1.2 Defining Mappers
10.1.3 Relationships
10.1.4 Schema creation and control
10.2 Interacting with Mapper
10.2.1 Creating data
10.2.2 Querying data
10.2.3 Updating and deleting data
10.2.4 Validation and lifecycle callbacks
10.2.5 Display functionality
10.3 Advanced Mapper
10.3.1 Query logging
10.3.2 Transactions
10.3.3 Custom mapped fields
10.4 Summary
Persistence with Record
11.1 Common Record functionality
11.1.1 Common Record fields
11.1.2 Integration with LiftScreen and Wizard
11.2 Record for relational databases
11.2.1 Connecting and querying with Squeryl
11.2.2 A bookstore with Squeryl
11.3 Record for NoSQL stores
11.3.1 NoSQL support in Lift
11.3.2 Bookstore with MongoDB
11.4 Summary
Localization
12.1 Implementing localization
12.1.1 Implementing locale calculator
12.1.2 Localizing templates and code
12.2 Defining localized resources
12.2.1 Using XML resources
12.2.2 Using Java properties resources
12.2.3 Using custom resource factories
12.3 Summary
Distributed messaging and Java enterprise integration
13.1 Distributed programming
13.1.1 Messaging with AMQP
13.1.2 Messaging with Akka
13.2 Integrating Lift into existing Java infrastructure
13.2.1 JPA and Scala EntityManager
13.3 Summary
Application testing
14.1 Scala testing frameworks
14.1.1 ScalaTest
14.1.2 Scala Specs
14.1.3 ScalaCheck
14.1.4 Code coverage reports
14.2 Writing testable code
14.2.1 Complexities of testing state
14.2.2 Dependency injection
14.3 Testing strategies
14.3.1 Testing snippets
14.3.2 Testing web services
14.3.3 Testing with Mapper
14.3.4 Testing Comet and AJAX
14.4 Summary
Deployment and scaling
15.1 Choosing a servlet container
15.2 Handling state
15.2.1 Sticky session strategies
15.2.2 Distributing critical state
15.3 Choosing a configuration
15.3.1 Single server
15.3.2 Multiple servers
15.4 Deployment tools and techniques
15.4.1 Built-in assistance
15.4.2 Monitoring
15.5 Case studies
15.5.1 Foursquare
15.5.2 Novell Vibe
15.6 Summary
appendix A: Introduction to Scala
A.1 Variables, values, and immutability
A.2 Classes, methods, traits, and functions
A.2.1 Classes
A.2.2 Traits
A.2.3 Methods
A.2.4 Functions
A.3 Collections
A.4 Pattern matching
A.5 Implicits
appendix B: Configuring an IDE
B.1 IntelliJ
B.2 Eclipse
appendix C: Options and boxes
index
Symbols
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Back cover