Permalink
Browse files

Comet and ajax stuff.

  • Loading branch information...
1 parent 06c6204 commit bbeb2ab4bac37fd6903177f13d135e996d02166a @tjweir committed Sep 28, 2008
Showing with 471 additions and 139 deletions.
  1. BIN Comet.png
  2. BIN ajax.png
  3. +167 −36 chapter02.lyx
  4. +219 −29 chapter06.lyx
  5. +27 −27 chapter07.lyx
  6. +34 −46 chapter08.lyx
  7. +24 −1 master.lyx
View
BIN Comet.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN ajax.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
203 chapter02.lyx
@@ -1,4 +1,4 @@
-#LyX 1.5.3 created this file. For more info see http://www.lyx.org/
+#LyX 1.5.6 created this file. For more info see http://www.lyx.org/
\lyxformat 276
\begin_document
\begin_header
@@ -83,6 +83,10 @@ Project info (author, date, version, etc)
Special build targets
\end_layout
+\begin_layout Section
+Maven
+\end_layout
+
\begin_layout Standard
A great web framework deserves a great build system, so Lift uses Maven
\begin_inset Foot
@@ -123,26 +127,159 @@ target "http://www.apache.org"
\end_inset
.
- Maven's concept of a single config file, pom file, that controls the project's
- build, dependencies, reporting and documentation generation was a desirable
- feature for the Lift project.
- Lift requires at least version 2.0.7 or Maven.
+ Maven's concept of a single config file, known as the Project Object Model
+ or pom file, that controls the project's build, dependencies, reporting
+ and documentation generation was a desirable feature for the Lift project.
+ Below is a sample pom.xml file.
+\end_layout
+
+\begin_layout Standard
+\begin_inset listings
+inline false
+status open
+
+\begin_layout Standard
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+\end_layout
+
+\begin_layout Standard
+
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+\end_layout
+
+\begin_layout Standard
+
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
+\end_layout
+
+\begin_layout Standard
+
+ http://maven.apache.org/xsd/maven-4.0.0.xsd">
+\end_layout
+
+\begin_layout Standard
+
+ <modelVersion>4.0.0</modelVersion>
+\end_layout
+
+\begin_layout Standard
+
+ <groupId>com.mycompany.app</groupId>
+\end_layout
+
+\begin_layout Standard
+
+ <artifactId>my-app</artifactId>
+\end_layout
+
+\begin_layout Standard
+
+ <packaging>jar</packaging>
+\end_layout
+
+\begin_layout Standard
+
+ <version>1.0-SNAPSHOT</version>
+\end_layout
+
+\begin_layout Standard
+
+ <name>Maven Quick Start Archetype</name>
+\end_layout
+
+\begin_layout Standard
+
+ <url>http://maven.apache.org</url>
+\end_layout
+
+\begin_layout Standard
+
+ <dependencies>
+\end_layout
+
+\begin_layout Standard
+
+ <dependency>
+\end_layout
+
+\begin_layout Standard
+
+ <groupId>junit</groupId>
+\end_layout
+
+\begin_layout Standard
+
+ <artifactId>junit</artifactId>
+\end_layout
+
+\begin_layout Standard
+
+ <version>3.8.1</version>
+\end_layout
+
+\begin_layout Standard
+
+ <scope>test</scope>
+\end_layout
+
+\begin_layout Standard
+
+ </dependency>
+\end_layout
+
+\begin_layout Standard
+
+ </dependencies>
+\end_layout
+
+\begin_layout Standard
+
+</project>
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout LyX-Code
+
+\end_layout
+
+\begin_layout LyX-Code
+
+\end_layout
+
+\begin_layout Standard
+Lift requires at least version 2.0.7.
\end_layout
\begin_layout Standard
-At the beginning of your development your interaction with Maven will be
- sparse.
- You'll probably issue
+Maven uses the concept of lifecycle phases for execution.
+ Some of the default phases are validate, compile, test, package.
+ At the beginning of your development you'll probably just use clean and
+ jetty:run, in the form
\family typewriter
-mvn -U clean jetty:run
+mvn -U clean jetty:run.
\family default
- repeatedly
+
\begin_inset Note Note
status open
\begin_layout Standard
Maybe we should mention the scala:cc target for continuous compilation?
+ - Derek Maybe we have a section in the Appendix about scala:cc and JavaRebel,
+ or something like
+\begin_inset Quotes eld
+\end_inset
+
+How we develop
+\begin_inset Quotes erd
+\end_inset
+
+ -Ty
\end_layout
\end_inset
@@ -177,8 +314,12 @@ target "http://localhost:8080/"
\family default
.
- As your project matures and features you add start to require additional
- JARs, you'll have to spend a bit of time in the
+
+\end_layout
+
+\begin_layout Standard
+As your project matures you may start to require additional JARs due to
+ new dependencies , you'll have to spend a bit of time in the
\family typewriter
pom.xml
\begin_inset LatexCommand index
@@ -212,18 +353,24 @@ target "http://maven.apache.org"
.
\end_layout
-\begin_layout Standard
-[This should go later, new people won't care about .m2 for a while]
+\begin_layout Section
+Project Layout
\end_layout
\begin_layout Standard
-Maven will look in (or create) ~/.m2 and find the required dependencies.
- These will either be found in your local repository or will be pulled down
- from the net from a public repository.
-\end_layout
+The layout of a Lift project is not complicated, please see figure
+\begin_inset LatexCommand ref
+reference "fig:dirlayout"
-\begin_layout Standard
-[This should go later, new people won't care about .m2 for a while]
+\end_inset
+
+.
+ The directory /src/main will contain your scala files.
+ This will follow the traditional Java packaging style.
+ The directory /src/main/webapp will contain all of the static web files,
+ such as JavaScript, XHTML, CSS and images.
+ In /src/main/webapp/templates-hidden you will find a file named default.html.
+ This is the default template that other XHTML fragments will be embedded.
\end_layout
\begin_layout Standard
@@ -264,21 +411,5 @@ name "fig:dirlayout"
\end_layout
-\begin_layout Standard
-The layout of a Lift project is not complicated, please see figure
-\begin_inset LatexCommand ref
-reference "fig:dirlayout"
-
-\end_inset
-
-.
- The directory /src/main will contain your scala files.
- This will follow the traditional Java packaging style.
- The directory /src/main/webapp will contain all of the static web files,
- such as JavaScript, XHTML, CSS and images.
- In /src/main/webapp/templates-hidden you will find a file named default.html.
- This is the default template that other XHTML fragments will be embedded.
-\end_layout
-
\end_body
\end_document
View
248 chapter06.lyx
@@ -48,35 +48,6 @@ AJAX and COMET in Lift
\end_layout
\begin_layout Standard
-*
-\series bold
-What is AJAX?
-\series default
- http://en.wikipedia.org/wiki/Ajax_(programming)
-\end_layout
-
-\begin_layout Standard
-AJAX (asynchronous JavaScript and XML) is a group of techniques that allow
- for interactive web applications.
- Using AJAX applications can talk to the server asynchronously and therefore
- not disrupt the display of the client.
- (this is awkwardly worded)
-\end_layout
-
-\begin_layout Standard
-* why is AJAX awesome? [example]
-\end_layout
-
-\begin_layout Standard
-Ajax allows for a much richer interface for a web application, an example
- is Google Suggest.
- When you start typing your search term, the word fragment is sent to the
- server and common completions of your term are sent back, you see an instant
- response.
-
-\end_layout
-
-\begin_layout Standard
* Method for async updates pulled from the client without a full page reload
\end_layout
@@ -177,5 +148,224 @@ Comet is a method that uses long-polling to keep a connection between a
* Go through Dynamic chat room example
\end_layout
+\begin_layout Section
+AJAX
+\end_layout
+
+\begin_layout Subsection
+What is AJAX
+\end_layout
+
+\begin_layout Standard
+AJAX
+\begin_inset Foot
+status open
+
+\begin_layout Standard
+\begin_inset LatexCommand htmlurl
+name "AJAX"
+target "http://en.wikipedia.org/wiki/Ajax_(programming)"
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+
+ or (asynchronous JavaScript and XML) is a group of techniques that allow
+ for interactive web applications.
+ Using AJAX applications can talk to the server asynchronously and therefore
+ not disrupt the display of the client.
+ (this is awkwardly worded)
+\end_layout
+
+\begin_layout Standard
+\begin_inset Float figure
+wide false
+sideways false
+status open
+
+\begin_layout Standard
+\begin_inset Caption
+
+\begin_layout Standard
+\begin_inset Graphics
+ filename ajax.png
+ lyxscale 50
+ scale 50
+ subcaption
+ subcaptionText "AJAX Application Model"
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+
+
+\begin_inset Note Note
+status open
+
+\begin_layout Standard
+Copyright Check Required
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset LatexCommand label
+name "fig:ajaxarch"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+What is the benefit of AJAX?
+\end_layout
+
+\begin_layout Standard
+Ajax allows for a much richer interface for a web application, an example
+ is Google Suggest.
+ When you start typing your search term, the word fragment is sent to the
+ server and common completions of your term are sent back, you see an instant
+ response.
+
+\end_layout
+
+\begin_layout Subsection
+Examples of AJAX
+\end_layout
+
+\begin_layout Subsection
+AJAX Example in Lift
+\end_layout
+
+\begin_layout Section
+COMET
+\end_layout
+
+\begin_layout Subsection
+What is COMET
+\end_layout
+
+\begin_layout Standard
+COMET
+\begin_inset Foot
+status open
+
+\begin_layout Standard
+\begin_inset LatexCommand htmlurl
+name "Comet"
+target "http://en.wikipedia.org/wiki/Comet_(programming)"
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+
+ is a group of methods that use long-polling to keep a connection between
+ a browser and a server open.
+ The allows the server to push data to the browser, rather than requiring
+ the browser to request the data.
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Float figure
+wide false
+sideways false
+status open
+
+\begin_layout Standard
+\begin_inset Caption
+
+\begin_layout Standard
+\begin_inset Graphics
+ filename Comet.png
+ lyxscale 50
+ scale 50
+ subcaption
+ subcaptionText "COMET Application Model"
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Note Note
+status open
+
+\begin_layout Standard
+Copyright Check Required
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset LatexCommand label
+name "fig:cometarch"
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+What is the benefit of COMET?
+\end_layout
+
+\begin_layout Standard
+The main benefit
+\end_layout
+
+\begin_layout Subsection
+Examples of COMET
+\end_layout
+
+\begin_layout Standard
+An example of this would be a Stock Ticker.
+ A user may have a page open that has a number of stock prices and as the
+ price changes, the new value is pushed to the broswer without the need
+ to refresh the page.
+ Another example is the embedded Google Talk chat client in GMail.
+ Instant messages from friends are automatically pushed to your browser.
+\end_layout
+
+\begin_layout Subsection
+COMET Example in Lift
+\end_layout
+
\end_body
\end_document
View
54 chapter07.lyx
@@ -44,62 +44,62 @@ Deployment
\end_layout
\begin_layout Standard
-- Ask the list what they are deploying with.
+Ask the list what they are deploying with.
Generally it shouldn't be an issue where they deploy since Lift is essentially
self-contained.
We can go into specifics for special cases, I suppose
\end_layout
-\begin_layout Standard
--!! jetty is required for continuations
+\begin_layout Itemize
+Jetty is required for continuations
\end_layout
-\begin_layout Standard
-* Basic deployment via Jetty
+\begin_layout Itemize
+Basic deployment via Jetty
\end_layout
-\begin_layout Standard
-* Brief overview of Jetty
+\begin_layout Itemize
+Brief overview of Jetty
\end_layout
-\begin_layout Standard
-* Capabilities
+\begin_layout Itemize
+Capabilities
\end_layout
-\begin_layout Standard
-* Configuration
+\begin_layout Itemize
+Configuration
\end_layout
-\begin_layout Standard
-* SSL
+\begin_layout Itemize
+SSL
\end_layout
-\begin_layout Standard
-* How jetty is configured in maven for testing
+\begin_layout Itemize
+How jetty is configured in maven for testing
\end_layout
-\begin_layout Standard
-* Changing the default port (8080)
+\begin_layout Itemize
+Changing the default port (8080)
\end_layout
-\begin_layout Standard
-* Tips and tricks
+\begin_layout Itemize
+Tips and tricks
\end_layout
-\begin_layout Standard
-* Deployment in Tomcat
+\begin_layout Itemize
+Deployment in Tomcat
\end_layout
-\begin_layout Standard
-* Packaging options (pom dependency scope)
+\begin_layout Itemize
+Packaging options (pom dependency scope)
\end_layout
-\begin_layout Standard
-* Deployment in JBoss
+\begin_layout Itemize
+Deployment in JBoss
\end_layout
-\begin_layout Standard
-* Deployment in GlassFish
+\begin_layout Itemize
+Deployment in GlassFish
\end_layout
\begin_layout Standard
View
80 chapter08.lyx
@@ -44,91 +44,79 @@ Request/Response Lifecycle
\end_layout
\begin_layout Standard
-8.
- Detailed request/response handling info (should cover how Actors are used,
+Detailed request/response handling info (should cover how Actors are used,
too)
\end_layout
-\begin_layout Standard
-1.
- Request hits LiftFilter
+\begin_layout Enumerate
+Request hits LiftFilter
\end_layout
-\begin_layout Standard
-2.
- LiftFilter executes each item in LiftRules.early.
+\begin_layout Enumerate
+LiftFilter executes each item in LiftRules.early.
This would allow you to do advance processing of the HttpRequest
\end_layout
-\begin_layout Standard
-3.
- Rewrites occur per the LiftRules.rewriteTable (set up via LiftRules.addRewriteBef
-ore/After)
+\begin_layout Enumerate
+Rewrites occur per the LiftRules.rewriteTable (set up via LiftRules.addRewriteBefo
+re/After)
\end_layout
-\begin_layout Standard
-4.
- LiftFilter determines whether the request should be handled by Lift or
- if it should be chained.
+\begin_layout Enumerate
+LiftFilter determines whether the request should be handled by Lift or if
+ it should be chained.
If the processing fails it's automatically chained
\end_layout
-\begin_layout Standard
-5.
- Processing takes place via the LiftFilter's internal LiftServlet instance
+\begin_layout Enumerate
+Processing takes place via the LiftFilter's internal LiftServlet instance
\end_layout
-\begin_layout Standard
-6.
- If Lift is running in Jetty, any continuations are invoked (explain a little
+\begin_layout Enumerate
+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
\end_layout
-\begin_layout Standard
-7.
- LiftServlet checks LiftRules.statelessDispatchTable and returns if matched
+\begin_layout Enumerate
+LiftServlet checks LiftRules.statelessDispatchTable and returns if matched
(what is this for?)
\end_layout
-\begin_layout Standard
-8.
- LiftServlet checks LiftRules.dispatchTable (set up via LiftRules.addDispatchBefor
-e/After) and if dispatches match it dispatches there and returns the result
+\begin_layout Enumerate
+LiftServlet checks LiftRules.dispatchTable (set up via LiftRules.addDispatchBefore
+/After) and if dispatches match it dispatches there and returns the result
* detail dispatch handling
\end_layout
-\begin_layout Standard
-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
+\begin_layout Enumerate
+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
* detail COMET handling path
\end_layout
-\begin_layout Standard
-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
+\begin_layout Enumerate
+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
* detail AJAX handling
\end_layout
-\begin_layout Standard
-11.
- If nothing else has occurred, do normal template processing at this point
+\begin_layout Enumerate
+If nothing else has occurred, do normal template processing at this point
\end_layout
-\begin_layout Standard
-11.1.
- Lookup template based on path
+\begin_deeper
+\begin_layout Enumerate
+Lookup template based on path
\end_layout
-\begin_layout Standard
-11.2.
- Process template recursively (surround, include, etc)
+\begin_layout Enumerate
+Process template recursively (surround, include, etc)
\end_layout
+\end_deeper
\begin_layout Standard
* Additional topics
\end_layout
View
25 master.lyx
@@ -1,4 +1,4 @@
-#LyX 1.5.3 created this file. For more info see http://www.lyx.org/
+#LyX 1.5.6 created this file. For more info see http://www.lyx.org/
\lyxformat 276
\begin_document
\begin_header
@@ -104,6 +104,14 @@ Derek Chen-Becker and Tyler Weir
\end_layout
\begin_layout Standard
+\begin_inset FloatList figure
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
\begin_inset Note Note
status open
@@ -112,6 +120,21 @@ We can put acknowledgements, foreward, etc here.
I just need to figure out how to get them properly numbered in LyX - Derek
\end_layout
+\begin_layout Standard
+I guess we'll have to write our bios as well.
+
+\begin_inset Quotes eld
+\end_inset
+
+Tyler helped write this book.
+ And...
+ well, that's about it.
+\begin_inset Quotes erd
+\end_inset
+
+ :)
+\end_layout
+
\end_inset

0 comments on commit bbeb2ab

Please sign in to comment.