Skip to content
Newer
Older
100644 371 lines (312 sloc) 15 KB
b6693c2 @tjweir Add the works license.
authored Sep 17, 2008
1 We chose a license: http://creativecommons.org/license/results-one?license_code=by-nd
2 License:
0f33d38 @tjweir more details, a couple of questions.
authored Sep 19, 2008
3 This work is licensed under the Creative Commons Attribution-No Derivative Works 3.0 Unported License.
4 To view a copy of this license, visit http://creativecommons.org/licenses/by-nd/3.0/ or send a letter to
5 Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.
b6693c2 @tjweir Add the works license.
authored Sep 18, 2008
6
7
8
2c2ee91 @dchenbecker Expanded JPA Section
dchenbecker authored Sep 20, 2008
9 [Decision] Pick an application to build from scratch. (I like the latter 3. First one is already heavily covered on the Wiki)
0f33d38 @tjweir more details, a couple of questions.
authored Sep 19, 2008
10 Here are a few ideas
11 - blogging tool (rebuild and extend HelloLift) Super obvious :)
12 - ToDo tracker (extend to group todo tracker)
13 - build PocketChangeApp (my simple expense tracker)
14 - Build LuxTape, a lift implementation of OpenTape
9681159 @tjweir Lets seed
authored Sep 16, 2008
15
16
0f33d38 @tjweir more details, a couple of questions.
authored Sep 19, 2008
17 [Decision] Should we compare and contrast with other frameworks? I don't know many others --Tyler
18
1653ad4 @tjweir Add a question
authored Sep 22, 2008
19 [Decision] Should we include a section of HowTos?
20 * may be easier to get a lot content across in a short period of time
21
0f33d38 @tjweir more details, a couple of questions.
authored Sep 19, 2008
22 [Ideas]
23 1. Include a "Lift quick reference card": all of the lift template tags, brief overview of the render flow (with cross-refs) (love this idea -Ty)
24
79972f3 Major expansion started on the ToC/Outline. Lots more work to do but I
Derek Chen-Becker authored Sep 16, 2008
25
26 --------------------
27 IMHO we should start with an introduction that gives a brief overview
28 of what Lift is trying to solve, how it works and why it does it
29 well. The first half would explain some basics about it (built on
30 Scala, incredible template support, clean separation of V and C), and
31 then the second half would walk the user through running the HelloLift
32 example just to get something going out of the box. From my
33 understanding at this point that would involve just three things:
34 installing Java (if required), installing Maven2, and then downloading
35 and running the HelloLift project zip. Of those three, I think
9203e13 @tjweir Clean up some GoogleDocs debris
authored Sep 17, 2008
36 installing Maven is probably the most complex - Derek
9681159 @tjweir Lets seed
authored Sep 16, 2008
37
63c477c Expanded more of the sections out. I'll expand the JPA section a bit …
Derek Chen-Becker authored Sep 18, 2008
38 So you see 2 distinct Sections: Generalized info and intro, and
39 getting into and building an app? Sounds good to me. -Tyler
40
41 Next question is how much should assume about Scala knowledge? - Derek
42
0f33d38 @tjweir more details, a couple of questions.
authored Sep 19, 2008
43 I think if we assume none, we'll never finish the book. I would prefer to target
44 those that are comfortable with Scala. -Ty
9681159 @tjweir Lets seed
authored Sep 16, 2008
45 --------------------
46
0f33d38 @tjweir more details, a couple of questions.
authored Sep 19, 2008
47 ===============================
48 BOOK
49 ===============================
50
79972f3 Major expansion started on the ToC/Outline. Lots more work to do but I
Derek Chen-Becker authored Sep 16, 2008
51 ====== Intro Section ======
52
53 1. Introduction
54 * Welcome to lift
2c2ee91 @dchenbecker Expanded JPA Section
dchenbecker authored Sep 20, 2008
55 * What we'd like you to get out of this book
1930e92 @tjweir Started turning points into prose.
authored Sep 21, 2008
56 * By the end of the book you should be able to create and extend any web application you can think of
2c2ee91 @dchenbecker Expanded JPA Section
dchenbecker authored Sep 20, 2008
57 * What we expect you to already know
58 * Scala
59 * HTTP protocol
60 * HTML
61 * Javascript
1930e92 @tjweir Started turning points into prose.
authored Sep 21, 2008
62 * CSS
79972f3 Major expansion started on the ToC/Outline. Lots more work to do but I
Derek Chen-Becker authored Sep 16, 2008
63 * What is lift?
64 * Fast, flexible template-based web framework built on Scala
65 * Full-featured template system
66 * Clean separation of M,V and C
67 * Powerful Web 2.0 (AJAX, COMET) support baked in
68 * Thriving community of developers
69 * Brief overview of Scala
70 * OO/FP Hybird
71 * Compiles to JVM Bytecode
72 * Made by the good people who brought us generics
73 * You get a new powerful language with access to all of Java's libs
74 * Why another framework?
75 * Too much boilerplate in other frameworks (Struts, we're talking about you)
76 * Exposure of programming logic in templates makes things difficult (JSP, etc)
77 * Scala has higher efficiency in terms of LoC per function point
78 * Powerful AJAX, COMET and JS support
79 * Let's try out HelloLift
80 * Prerequisites
81 * Java 1.5 or newer (Scala is not required directly since Maven will pull it down)
9681159 @tjweir Lets seed
authored Sep 16, 2008
82 * Maven 2 - include a very brief synopsis on Maven. Anything more detailed should point to the Maven site or go in an appendix
3f3ec1e Fixed some whitespace that git was complaining about
Derek Chen-Becker authored Sep 16, 2008
83 * Some sort of programming editor is recommended: mention emacs, Eclipse, NetBeans, JEdit, etc.
79972f3 Major expansion started on the ToC/Outline. Lots more work to do but I
Derek Chen-Becker authored Sep 16, 2008
84 * Download the HelloLift project and unzip it
85 * "mvn jetty:run"
e218091 @tjweir more details
authored Sep 19, 2008
86 * Profit! - let's hope :)
79972f3 Major expansion started on the ToC/Outline. Lots more work to do but I
Derek Chen-Becker authored Sep 16, 2008
87 * Cursory examination of:
88 * Index template (shows surround and snippet)
89 * Default template
90 * Hello snippet
e218091 @tjweir more details
authored Sep 19, 2008
91 * Optionally install the JavaRebel Scala plugin from zeroturnaround
79972f3 Major expansion started on the ToC/Outline. Lots more work to do but I
Derek Chen-Becker authored Sep 16, 2008
92
93 2. Getting to know Maven and Project layout (based on HelloLift example)
94
95 - I think this should be a small, but self-contained section with
96 enough info so that someone who wanted to do "standard" things with
97 Maven wouldn't need to go digging around on the site. In other
98 words, enough info on maven in this book to handle all of the
99 examples we use in the book.
100
101 * What is maven
102 * Comprehensive project and build management
103 * Structured project layout (conventions)
104 * Dependency management
105 * Automated testing and packaging
106 * Automated reporting
107 * Archetypes: project "templates"
108 * Directory layout
109 * Scala-specific stuff
110 * web content
111 * resources
112 * Introducing the POM
113 * Project info (author, date, version, etc)
114 * Repo definitions
115 * Dependencies
116 * Special build targets
3f3ec1e Fixed some whitespace that git was complaining about
Derek Chen-Becker authored Sep 16, 2008
117
79972f3 Major expansion started on the ToC/Outline. Lots more work to do but I
Derek Chen-Becker authored Sep 16, 2008
118 ====== General Topics ======
119
e218091 @tjweir more details
authored Sep 19, 2008
120 3. Lift Architecture in general
79972f3 Major expansion started on the ToC/Outline. Lots more work to do but I
Derek Chen-Becker authored Sep 16, 2008
121 * Everything handled by LiftFilter
122 * Show example config in web.xml
123 * Handling in LiftFilter allows fall-through to default handlers for things that Lift doesn't handle (Static content, primarily)
124 * Rendering pipeline (This can be high-level right now, with links to detailed info in the advanced section - Derek)
125 * Dispatch to proper code
126 * dispatch methods in effect?
127 * rewrite methods in effect?
128 * SiteMap matching and access control
129 * template or view matched?
130 * recursive processing of template and any snippets contained therein
131 * direct processing of view
132 * Error handling
133 * List of tags that are handled by Lift (stolen from http://liftweb.net/index.php/LiftTags, not sure how up-to-date this is)
134 * surround
135 * embed
136 * comet
137 * ignore
138 * snippet (and, the alternative lift:<class>.<method>)
139 * additional attribute handling in tags (via S.attr)
140
141 4. A detailed look at lift user components
142 * SiteMap
143 * Performs two primary duties: generates the menu for your site (customizable) and performs per-page access control
144 * Cover Menu, Loc objects to define paths and superpaths (my term for paths that match anything under them)
145 * Additional attributes
146 * If
147 * Unless
63c477c Expanded more of the sections out. I'll expand the JPA section a bit …
Derek Chen-Becker authored Sep 18, 2008
148 * Test
149 * Title
79972f3 Major expansion started on the ToC/Outline. Lots more work to do but I
Derek Chen-Becker authored Sep 16, 2008
150 * Templates
151 * Static xml that may embed or surround other templates, and may embed snippets (reference tag list)
152 * well-formed XML
153 * Special template-hidden directory not directly accessible
154 * Use of prefixed elements to assist with binding in snippets
155 * Re-cover how templates are located/dispatched
156 * Snippets
157 * Chunks of code that generate pieces of a final output page. May themselves generate template code that is interpreted
158 * Generic Scala classes (stateless)
159 * How to deal with state in snippets
160 * RequestVars
161 * SessionVars
162 * StatefulSnippets
163 * Using Helpers.bind. In particular, cover view vs. forms usage
164 * Using Helpers.chooseTemplate for nested templates
165 * Views
166 * Chunks of code intended to generate a complete page
167 * Can be shoehorned to process template code via processSurroundAndInclude
168 * Re-cover how views are located/dispatched
169 * Path-based (/my/view)
170 * addDispatchBefore/After
171 * What are the use cases for snippets vs. views?
172
173 5. Intro to the Mapper package
0f33d38 @tjweir more details, a couple of questions.
authored Sep 19, 2008
174 * This may be Mapper, or it may be Record depending on whether Record makes the 1.0 cut
175 * If it's Mapper, then blurb about all the Mapped* fields
176
79972f3 Major expansion started on the ToC/Outline. Lots more work to do but I
Derek Chen-Becker authored Sep 16, 2008
177
178 6. AJAX and COMET
0f33d38 @tjweir more details, a couple of questions.
authored Sep 19, 2008
179 * What is COMET?
e218091 @tjweir more details
authored Sep 19, 2008
180 * Why is Comet Awesome? [example]
181 * Push to the browser
1930e92 @tjweir Started turning points into prose.
authored Sep 21, 2008
182 * [Example] following a LiveBlog of a keynote presentation, elememts are pushed to your browser
183 * Here's a super simple example - http://wiki.liftweb.net/index.php/CometActor
63c477c Expanded more of the sections out. I'll expand the JPA section a bit …
Derek Chen-Becker authored Sep 18, 2008
184 * Method for async updates pushed *from server to client*
185 * Connection is kept open
186 * Streaming
187 * Long polling
188 * Scalability issues
189 * Using COMET in Lift
190 * CometActor
191 * Mine Jorge's blog post: http://scala-blogs.org/2007/12/dynamic-web-applications-with-lift-and.html
192 * Go through Dynamic chat room example
193 * What is AJAX?
e218091 @tjweir more details
authored Sep 19, 2008
194 * why is AJAX awesome? [example]
63c477c Expanded more of the sections out. I'll expand the JPA section a bit …
Derek Chen-Becker authored Sep 18, 2008
195 * Method for async updates pulled from the client without a full page reload
196 * Relies heavily on javascript and XML
197 * Javascript client-side events (button push, timer, etc) trigger requests "behind the scenes"
198 * Web 2.0 built on this
199 * Using AJAX in Lift
200 * Allows you to bind Javascript events (AJAX) to form elements, links, etc
201 * Go through example HelloDarwin AJAX example
79972f3 Major expansion started on the ToC/Outline. Lots more work to do but I
Derek Chen-Becker authored Sep 16, 2008
202
203 7. Deployment
63c477c Expanded more of the sections out. I'll expand the JPA section a bit …
Derek Chen-Becker authored Sep 18, 2008
204 - Ask the list what they are deploying with. Generally it shouldn't
205 be an issue where they deploy since Lift is essentially
206 self-contained. We can go into specifics for special cases, I
207 suppose
e218091 @tjweir more details
authored Sep 19, 2008
208 -!! jetty is required for continuations
63c477c Expanded more of the sections out. I'll expand the JPA section a bit …
Derek Chen-Becker authored Sep 18, 2008
209
210 * Basic deployment via Jetty
211 * Brief overview of Jetty
212 * Capabilities
213 * Configuration
214 * SSL
215 * How jetty is configured in maven for testing
216 * Changing the default port (8080)
217 * Tips and tricks
218 * Deployment in Tomcat
219 * Packaging options (pom dependency scope)
220 * Deployment in JBoss
221 * Deployment in GlassFish
e218091 @tjweir more details
authored Sep 19, 2008
222 * putting nginx out front???
79972f3 Major expansion started on the ToC/Outline. Lots more work to do but I
Derek Chen-Becker authored Sep 16, 2008
223
224 ====== Advanced Topics ======
225
63c477c Expanded more of the sections out. I'll expand the JPA section a bit …
Derek Chen-Becker authored Sep 18, 2008
226 8. Detailed request/response handling info (should cover how Actors are used, too)
227 1. Request hits LiftFilter
228 2. LiftFilter executes each item in LiftRules.early. This would allow you to do advance processing of the HttpRequest
229 3. Rewrites occur per the LiftRules.rewriteTable (set up via LiftRules.addRewriteBefore/After)
230 4. LiftFilter determines whether the request should be handled by Lift or if it should be chained. If the processing fails it's automatically chained
231 5. Processing takes place via the LiftFilter's internal LiftServlet instance
232 6. If Lift is running in Jetty, any continuations are invoked (explain a little about Jetty continuations here...). If continuation exists and returns a response, return
233 7. LiftServlet checks LiftRules.statelessDispatchTable and returns if matched (what is this for?)
234 8. LiftServlet checks LiftRules.dispatchTable (set up via LiftRules.addDispatchBefore/After) and if dispatches match it dispatches there and returns the result
235 * detail dispatch handling
236 9. LiftServlet then checks to see if the request starts with LiftRules.cometPath (default "comet_request") and if so, handles the request as a COMET request
237 * detail COMET handling path
238 10. LiftServlet then checks to see if the request starts with LiftRules.ajaxPath (default "ajax_request") and if so, handles the request as an AJAX request
239 * detail AJAX handling
240 11. If nothing else has occurred, do normal template processing at this point
241 1. Lookup template based on path
242 2. Process template recursively (surround, include, etc)
243 * Additional topics
244 * S.addAround and LoanWrapper
245 * How S.attr works in conjunction with XML attributes on snippets, etc and with Rewriting
79972f3 Major expansion started on the ToC/Outline. Lots more work to do but I
Derek Chen-Becker authored Sep 16, 2008
246
247 9. URL Rewriting
63c477c Expanded more of the sections out. I'll expand the JPA section a bit …
Derek Chen-Becker authored Sep 18, 2008
248 * What is URL rewriting
249 * Using LiftRules.addRewriteBefore.After
250 * What constitutes a rewrite function?
251 * Using the params Map to pass parts of the path back into your code via S.param
79972f3 Major expansion started on the ToC/Outline. Lots more work to do but I
Derek Chen-Becker authored Sep 16, 2008
252 * Example: user-friendly URLs
253
254 10. JSON handling
63c477c Expanded more of the sections out. I'll expand the JPA section a bit …
Derek Chen-Becker authored Sep 18, 2008
255 * What is JSON?
e218091 @tjweir more details
authored Sep 19, 2008
256 * Why is JSON awesome? [example]
63c477c Expanded more of the sections out. I'll expand the JPA section a bit …
Derek Chen-Becker authored Sep 18, 2008
257 * Technically, just a data format for Javascript (http://www.json.org/)
258 * Used as an RPC transfer format
259 * Well-suited to AJAX because it's essentially javascript
260 * How does Lift support JSON?
261 * JsonHandler allows simple wrapping and processing of JSON (AJAX) forms
262 * JsonCmd allows matching of submitted JSON
263 * Go through example JSON/AJAX submission form. Maybe it would be best to make
264 it an extension of one of the other examples?
79972f3 Major expansion started on the ToC/Outline. Lots more work to do but I
Derek Chen-Becker authored Sep 16, 2008
265
266 11. JsCommands
267 * Integrated javascript handling without hard-coding it in templates
268 * jQuery intro
269 * Utility library that makes IE6 less ugly ;)
270 * Powerful support for dynamic attributing of elements
271 * Based on CSS selectors
560764e @tjweir Small additions, fleshing out topics.
authored Sep 17, 2008
272 * Talk about Marius JS abstraction
79972f3 Major expansion started on the ToC/Outline. Lots more work to do but I
Derek Chen-Becker authored Sep 16, 2008
273
274 12. AJAX and COMET in depth
560764e @tjweir Small additions, fleshing out topics.
authored Sep 17, 2008
275 - this is probably the place for the Spreadsheet example
276 - talk about design "patterns" ex. the proper TagCloud example
79972f3 Major expansion started on the ToC/Outline. Lots more work to do but I
Derek Chen-Becker authored Sep 16, 2008
277
278 13. JPA Integration
2c2ee91 @dchenbecker Expanded JPA Section
dchenbecker authored Sep 20, 2008
279 * What is JPA?
280 * Part of EJB3 spec
281 * Evolution of container-managed persistence
282 * Simplified model (a lot less XML)
283 * Heavy use of annotations, although you can define/override via XML descriptors if you want
284 * Available in container and outside of container (Hibernate EM, JPOX, etc)
285 * Why use JPA when we have mapper?
286 * Usable outside of Lift
287 * Easily accessible from Java and Scala
288 * Legacy models
289 * More flexibility w/large schemas
290 * Performance/Caching
291 * Intro to JPA
292 * JPA archetype in Maven
293 * Annotations on Scala classes
294 * Using orm.xml to override and define
295 * Getting a per-session entity manager
296 * RequestVar lifecycle
297 * In a container (JTA)
298 * User-managed transactions
299 * ScalaEntityManager and ScalaQuery
300 * Provide Scala-esque access to all EM methods (List vs java.util.List,etc)
301 * Implicit defs for conversion from java.util.{Set,List} to Scala counterparts
302 * Example app (Library catalog)
79972f3 Major expansion started on the ToC/Outline. Lots more work to do but I
Derek Chen-Becker authored Sep 16, 2008
303
304 14. Using Scala Actors
560764e @tjweir Small additions, fleshing out topics.
authored Sep 17, 2008
305 - this is a broad topic, ask the committor list for opinions
306
79972f3 Major expansion started on the ToC/Outline. Lots more work to do but I
Derek Chen-Becker authored Sep 16, 2008
307
308 ====== Advanced Examples ======
309
310 15. OpenID Integration
311
312 16. Lucene/Compass Integration
313
314 17. Tagging support
315
316 ====== Appendices ======
317
318 A. Lift message handling
560764e @tjweir Small additions, fleshing out topics.
authored Sep 17, 2008
319 - What happens now
320 - How to Fade them web2.0 stylee!
79972f3 Major expansion started on the ToC/Outline. Lots more work to do but I
Derek Chen-Becker authored Sep 16, 2008
321
322 B. Helpers methods, in particular Can/Empty/Full
560764e @tjweir Small additions, fleshing out topics.
authored Sep 17, 2008
323 - Can is super important, as it's everywhere
79972f3 Major expansion started on the ToC/Outline. Lots more work to do but I
Derek Chen-Becker authored Sep 16, 2008
324
325 C. I18N and L10N
326 * S.?(String)
327 * lift:loc tag
560764e @tjweir Small additions, fleshing out topics.
authored Sep 17, 2008
328 * Proper placement of language resources
79972f3 Major expansion started on the ToC/Outline. Lots more work to do but I
Derek Chen-Becker authored Sep 16, 2008
329
330 D. Logging
331 * Configuring built-in log4j
332 * Using slf4j instead
0f33d38 @tjweir more details, a couple of questions.
authored Sep 19, 2008
333 * Query Logger
334 * Maybe some recommendations?
79972f3 Major expansion started on the ToC/Outline. Lots more work to do but I
Derek Chen-Becker authored Sep 16, 2008
335
336 E. Mailer
337 * Configuring the mailer lib
338 * Sending email
e218091 @tjweir more details
authored Sep 19, 2008
339 * System.properties
9681159 @tjweir Lets seed
authored Sep 16, 2008
340
0f33d38 @tjweir more details, a couple of questions.
authored Sep 19, 2008
341
342
1930e92 @tjweir Started turning points into prose.
authored Sep 21, 2008
343
344
345 Chapter 1: Introduction
346
347 * Welcome to Lift!
348 We've created this book to educate you about Lift, which we think is a great framework for building compelling web applications.
349 Our goal for this book is that by the end, you'll be able to create and extend any web application you can think of.
350
351 * Expections for the reader
352 We are going to focus on Lift in the book, so we expect that you're comfortable with:
353 - Scala - http://www.scala-lang.org
354 - The HTTP Protocol - http://www.ietf.org/rfc/rfc2616.txt
355 - HTML - http://www.w3.org/MarkUp/Guide/
356 - JavaScript - http://en.wikipedia.org/wiki/JavaScript, and
357 - CSS - http://en.wikipedia.org/wiki/Cascading_Style_Sheets
358
359 * What is Lift?
360 Lift is a fast, flexible template-based web framework built on Scala. Some of it's notable features are a full-featured template system, a clean separation of Model, View and Controller, powerful AJAX and COMET support baked in and there is also a thriving community of developers.
361
362 * Brief overview of Scala
363 From Scala-lang.org: http://www.scala-lang.org/node/25
364 [quote]Scala is a general purpose programming language designed to express common programming patterns in a concise, elegant, and type-safe way. It smoothly integrates features of object-oriented and functional languages. It is also fully interoperable with Java.[/quote]
365 Scala code Compiles to JVM Bytecode so you get a new powerful language with access to all of Java's libraries.
178e15a @tjweir Add the mailing list file.
authored Sep 21, 2008
366 [todo] discuss some of the Scala features we use, pattern matching and traits, actors
1930e92 @tjweir Started turning points into prose.
authored Sep 21, 2008
367
368
369
370
Something went wrong with that request. Please try again.