E-Book, Englisch, 200 Seiten
Danciu / Weir / Chen-Becker The Definitive Guide to Lift
1. ed
ISBN: 978-1-4302-2422-8
Verlag: Apress
Format: PDF
Kopierschutz: 1 - PDF Watermark
A Scala-based Web Framework
E-Book, Englisch, 200 Seiten
ISBN: 978-1-4302-2422-8
Verlag: Apress
Format: PDF
Kopierschutz: 1 - PDF Watermark
The Definitive Guide to Lift will educate you about Lift, a great framework for building compelling web applications. Lift is designed to make powerful techniques easily accessible, while keeping the overall framework simple and flexible. Lift makes it fun to develop because it lets you focus on the interesting parts of coding. By the end of this book, you'll be able to create and extend any web application you can think of.
Marius Danciu spent the past 6 years architecting, designing, and leading development of highly scalable server-side applications based on J(2)EE platforms. Most applications were based on the data synchronization techniques (which in turn were based on the SyncML OMA standard) and adjacent technologies. For more than a year, Marius has been a committer to the LiftWeb framework, contributing to the design and implementation of various features in the framework.
Autoren/Hrsg.
Weitere Infos & Material
1;Table of Contents;1
2;The Definitive Guide to Lift: A Scala-Based Web Framework;8
3;Acknowledgements;9
4;Chapter 1: Welcome to Lift;10
4.1;Lifting Off!;10
4.1.1;Implementing the View-First Pattern with Lift;10
4.1.2;Leveraging the Scala Language;11
4.1.3;Supporting Advanced Features Easily;12
4.2;Getting to Know the Lift Community;12
4.3;Creating Your First Lift Application;13
4.4;Conclusion;18
5;Chapter 2: PocketChange;19
5.1;Keeping Track of Your PocketChange;19
5.2;Defining the Model;20
5.3;Creating Your First Template;23
5.4;Writing Snippets;24
5.5;Sprinkling a Little AJAX Spice;27
5.6;Conclusion;31
6;Chapter 3: Lift Fundamentals;32
6.1;Entering Lift;32
6.2;Making Standard import Assumptions for This Book;33
6.3;Bootstrapping in Lift;33
6.3.1;Using LiftRules;33
6.3.2;Resolving Classes;34
6.4;Rendering in Lift;34
6.4.1;Rendering with Templates;35
6.4.2;Rendering with Views;36
6.4.3;Getting to Know the Lift Tags;38
6.4.3.1;snippet;38
6.4.3.2;surround;39
6.4.3.3;bind;40
6.4.3.4;embed;40
6.4.3.5;comet;40
6.4.4;Merging HTML Headings;41
6.4.5;Providing User Feedback;42
6.4.6;Using Snippets;42
6.4.6.1;Binding Values in Snippets;43
6.4.6.2;Choosing Between Stateless and Stateful Snippets;44
6.4.6.3;Using Eager Evaluation;45
6.4.7;Rewriting URLs;45
6.4.8;Adding Custom Dispatch Functions;48
6.4.9;Using HTTP Redirects;50
6.5;Using Cookies;50
6.6;Storing Session and Request States;51
6.7;Gathering a Few More Useful Objects;53
6.7.1;S object;53
6.7.2;SHtml;53
6.8;Conclusion;53
7;Chapter 4: Forms in Lift;54
7.1;Practicing Form Fundamentals;54
7.1.1;checkbox;59
7.1.2;hidden;60
7.1.3;link;60
7.1.4;text and password;61
7.1.5;textarea;62
7.1.6;submit;62
7.1.7;multiselect;62
7.1.8;radio;63
7.1.9;select;64
7.1.10;selectObj;65
7.1.11;untrustedSelect;65
7.2;Uploading Files;65
7.3;Conclusion;67
8;Chapter 5: SiteMap;68
8.1;Defining SiteMap;68
8.1.1;Creating the Link Class;68
8.1.2;Using ExtLink;69
8.1.3;Creating Menu Entries;69
8.1.4;Using Nested Menus;70
8.1.5;Setting the Global SiteMap;71
8.2;Customizing the Display;72
8.2.1;Using the Hidden LocParam;72
8.2.2;Controlling the Menu Text;72
8.2.3;Using Menu;73
8.3;Controlling Access with Menus;74
8.3.1;Using If Clauses;74
8.3.2;Using the Unless LocParam;75
8.3.3;Working with the Template LocParam;75
8.3.4;Working with the Snippet and LocSnippets Parameters;76
8.3.5;Setting the Title;77
8.4;Testing a Request;77
8.5;Categorizing with LocGroup;78
8.6;Writing Your Own Loc;78
8.6.1;Knowing the Corresponding Functions;79
8.6.2;Using Type-Safe Parameters;80
8.7;Conclusion;84
9;Chapter 6: Mapper and Record;85
9.1;Introducing Mapper and MetaMapper;85
9.1.1;Adding Mapper to Your Project;86
9.1.2;Setting Up the Database Connection;86
9.1.3;Constructing a Mapper-Enabled Class;87
9.1.4;Creating Object Relationships;90
9.1.5;Indexing;93
9.1.6;Mapping Schemas;93
9.1.7;Performing Persistence Operations on an Entity;94
9.1.8;Creating a Mapper Instance;95
9.1.9;Saving a Mapper Instance;96
9.1.10;Deleting a Mapper Instance;96
9.1.11;Querying for Entities;96
9.1.12;Using Comparison QueryParams;97
9.1.13;Using Control QueryParams;99
9.1.14;Making Joins a Little Friendlier;101
9.2;Using Utility Functionality;101
9.2.1;Generating a Display;101
9.2.2;Generating Forms;102
9.2.3;Validating Forms;103
9.2.4;Supporting CRUD Operations;104
9.2.5;Using Life Cycle Callbacks;105
9.2.6;Knowing the Base Field Types;105
9.2.7;Defining Custom Field Types;108
9.2.8;Working with ProtoUser and MegaProtoUser;113
9.3;Using Advanced Mapper Features;114
9.3.1;Using Multiple Databases;114
9.3.2;Performing SQL-Based Queries;117
9.4;Conclusion;119
10;Chapter 7: Advanced Lift Architecture;120
10.1;Understanding Lift Architecture;120
10.2;Understanding the Request/Response Life Cycle;121
10.2.1;Transforming a Request into a Response;122
10.2.2;Processing a Stateful Request;123
10.3;Mapping Lift Functions;125
10.4;Exploring LiftResponse in Detail;127
10.4.1;Basic HTTP Equivalent Responses;127
10.4.2;Redirecting the Client;128
10.4.3;Sending Content to the Client;129
10.4.4;InMemoryResponse;130
10.4.5;StreamingResponse;130
10.4.6;Returning Text to the Client;131
10.4.7;Returning XML to the Client;131
10.5;Managing Sessions;132
10.5.1;Using Sticky Sessions;133
10.5.2;Using Lift’s Garbage Collection;134
10.6;Wrapping Lift’s Processing Logic;135
10.7;Using Additional Snippet Features;137
10.7.1;Passing Parameters to Snippets;137
10.7.2;Using Snippets for Tag Attributes;137
10.8;Working with Advanced S Object Features;139
10.8.1;Managing Cookies;139
10.8.2;Managing the Time Zone;140
10.8.3;Setting Session DispatchPF Functions;140
10.8.4;Rewriting Sessions;140
10.8.5;Accessing HTTP Headers;140
10.8.6;Managing the Document Type;141
10.8.7;Performing Other Functions;141
10.9;Managing Resources with ResourceServer;141
10.10;Obtaining HTTP Authentication;142
10.10.1;Using Basic HTTP Authentication;142
10.10.2;Using HTTP Digest Authentication;145
10.11;Conclusion;147
11;Chapter 8: Lift and JavaScript;148
11.1;Using High-Level JavaScript Abstractions;148
11.1.1;Understanding JsCmd and JsExp;149
11.1.2;Exploring JavaScript Abstraction Examples;152
11.2;Using jQuery and Other JavaScript Frameworks;153
11.3;Using XML and JavaScript;155
11.4;Using JSON;158
11.5;Using JqSHtml Object;162
11.6;Creating a More Complex Lift and JavaScript Example;162
11.7;Conclusion;164
12;Chapter 9: Lift with AJAX and Comet;165
12.1;Understanding the Basics of Asynchronous Requests;165
12.2;Using AJAX in Lift;168
12.2.1;Considering a More Complex AJAX Example;170
12.2.2;Exploring AJAX Generators in Detail;170
12.3;Using Comet in Lift;172
12.3.1;Understanding Actors in Scala;173
12.3.2;Building a Comet-Enabled Application;175
12.3.3;Accessing Comet Actors from Other Code;177
12.4;Conclusion;179
13;Chapter 10: JPA Integration;180
13.1;Introducing JPA;180
13.1.1;Using Entity Classes in Scala;182
13.1.2;Using the orm.xml Descriptor;182
13.1.3;Working with Attached and Detached Objects;183
13.2;Obtaining a Per-Session EntityManager;185
13.3;Handling Transactions;186
13.4;Using ScalaEntityManager and ScalaQuery;188
13.5;Operating on Entities;188
13.5.1;Persisting, Merging, and Removing Entities;188
13.5.2;Loading an Entity;189
13.5.3;Loading Many Entities;190
13.5.4;Using Queries Wisely;191
13.5.5;Converting Collection Properties;192
13.5.6;Understanding the Importance of the flush Methods and Exceptions;192
13.5.7;Validating Entities;193
13.6;Supporting User Types;195
13.7;Running the Application;196
13.8;Conclusion;197
14;Chapter 11: Third-Party Integrations;198
14.1;Integrating OpenID;198
14.2;Integrating AMQP;200
14.3;Integrating PayPal;203
14.4;Integrating Facebook;204
14.5;Integrating XMPP;205
14.6;Conclusion;207
15;Chapter 12: Lift Widgets;208
15.1;Getting to Know the Lift Widgets;208
15.1.1;Using the TableSorter Widget;208
15.1.2;Using the Calendar Widgets;209
15.1.3;Using the RSS Feed Widget;214
15.1.4;Using the Gravatar Widget;215
15.1.5;Using the TreeView Widget;215
15.1.6;Using the Sparklines Widget;218
15.2;Building a Widget;219
15.3;Conclusion;220
16;Chapter 13: Web Services;221
16.1;Choosing to Add an API to Your Web Application;221
16.2;Reviewing a Little Bit About HTTP;221
16.3;Defining REST;223
16.4;Comparing XML-RPC and REST Architectures;223
16.5;Creating a Simple API for PocketChange;224
16.6;Pattern Matching for the URLs;224
16.7;Writing the API Service Code;225
16.8;Creating a Helper Method for the Expense Model Object;227
16.9;Setting Up the Request/Response Cycles for Our API;228
16.10;Extending the API to Return Atom Feeds;229
16.11;Conclusion;231
17;Copyright;232




