Permalink
Browse files

Some document cleanup. Added skel of forms chapter

  • Loading branch information...
1 parent 211f3e8 commit dac88056c71750803b96bf795a26a105014c5415 @dpp committed Dec 31, 2010
Showing with 609 additions and 7 deletions.
  1. +3 −1 .gitignore
  2. +10 −0 Simply_Lift.lyx
  3. +55 −0 samples/forms/forms.lyx
  4. +9 −0 samples/forms/project/build.properties
  5. +20 −0 samples/forms/project/build/LiftProject.scala
  6. +1 −0 samples/forms/sbt
  7. BIN samples/forms/sbt-launcher.jar
  8. +2 −0 samples/forms/sbt.bat
  9. 0 samples/forms/src/main/resources/.keep
  10. 0 samples/forms/src/main/resources/props/default.props
  11. +52 −0 samples/forms/src/main/scala/bootstrap/liftweb/Boot.scala
  12. 0 samples/forms/src/main/scala/code/comet/.keep
  13. 0 samples/forms/src/main/scala/code/lib/.keep
  14. 0 samples/forms/src/main/scala/code/model/.keep
  15. 0 samples/forms/src/main/scala/code/snippet/.keep
  16. 0 samples/forms/src/main/scala/code/view/.keep
  17. +21 −0 samples/forms/src/main/webapp/WEB-INF/web.xml
  18. BIN samples/forms/src/main/webapp/images/ajax-loader.gif
  19. +13 −0 samples/forms/src/main/webapp/index.html
  20. +6 −0 samples/forms/src/main/webapp/static/index.html
  21. +4 −0 samples/forms/src/main/webapp/static/sample.html
  22. +85 −0 samples/forms/src/main/webapp/templates-hidden/default.html
  23. +57 −0 samples/forms/src/main/webapp/templates-hidden/wizard-all.html
  24. 0 samples/forms/src/test/resources/.keep
  25. +15 −0 samples/forms/src/test/scala/LiftConsole.scala
  26. +33 −0 samples/forms/src/test/scala/RunWebApp.scala
  27. +76 −0 samples/forms/src/test/scala/code/AppTest.scala
  28. +64 −0 samples/forms/src/test/scala/code/XmlSourceSpecs.scala
  29. +44 −0 samples/forms/src/test/scala/code/snippet/HelloWorldTest.scala
  30. +39 −6 samples/snippet_and_sitemap/snippet_and_sitemap.lyx
View
@@ -67,4 +67,6 @@ runner
*.tex
*.toc
Simply_Lift/
-Simply_Lift.html.tgz
+Simply_Lift.html.tgz
+
+*#
View
@@ -1006,6 +1006,16 @@ filename "samples/snippet_and_sitemap/snippet_and_sitemap.lyx"
\end_inset
+\end_layout
+
+\begin_layout Standard
+\begin_inset CommandInset include
+LatexCommand include
+filename "samples/forms/forms.lyx"
+
+\end_inset
+
+
\end_layout
\begin_layout Standard
View
@@ -0,0 +1,55 @@
+#LyX 1.6.7 created this file. For more info see http://www.lyx.org/
+\lyxformat 345
+\begin_document
+\begin_header
+\textclass book
+\use_default_options true
+\begin_modules
+eqs-within-sections
+figs-within-sections
+theorems-ams
+\end_modules
+\language english
+\inputencoding auto
+\font_roman default
+\font_sans default
+\font_typewriter default
+\font_default_family default
+\font_sc false
+\font_osf false
+\font_sf_scale 100
+\font_tt_scale 100
+
+\graphics default
+\paperfontsize default
+\spacing single
+\use_hyperref false
+\papersize default
+\use_geometry false
+\use_amsmath 1
+\use_esint 1
+\cite_engine basic
+\use_bibtopic false
+\paperorientation portrait
+\secnumdepth 3
+\tocdepth 3
+\paragraph_separation skip
+\defskip medskip
+\quotes_language english
+\papercolumns 1
+\papersides 1
+\paperpagestyle default
+\tracking_changes false
+\output_changes false
+\author ""
+\author ""
+\end_header
+
+\begin_body
+
+\begin_layout Chapter
+Forms
+\end_layout
+
+\end_body
+\end_document
@@ -0,0 +1,9 @@
+#Project properties
+#Fri Apr 23 11:24:20 PDT 2010
+project.organization=Lift
+project.name=Lift SBT Template
+sbt.version=0.7.4
+project.version=0.1
+def.scala.version=2.7.7
+build.scala.versions=2.8.1
+project.initialize=false
@@ -0,0 +1,20 @@
+import sbt._
+
+class LiftProject(info: ProjectInfo) extends DefaultWebProject(info) {
+ val liftVersion = "2.2-RC5"
+
+ // uncomment the following if you want to use the snapshot repo
+ // val scalatoolsSnapshot = ScalaToolsSnapshots
+
+ // If you're using JRebel for Lift development, uncomment
+ // this line
+ override def scanDirectories = Nil
+
+ override def libraryDependencies = Set(
+ "net.liftweb" %% "lift-webkit" % liftVersion % "compile->default",
+ "org.mortbay.jetty" % "jetty" % "6.1.22" % "test->default",
+ "junit" % "junit" % "4.5" % "test->default",
+ "ch.qos.logback" % "logback-classic" % "0.9.26",
+ "org.scala-tools.testing" %% "specs" % "1.6.6" % "test->default"
+ ) ++ super.libraryDependencies
+}
View
@@ -0,0 +1 @@
+java -Xmx512M -Xss2M -XX:+CMSClassUnloadingEnabled -jar `dirname $0`/sbt-launcher.jar "$@"
Binary file not shown.
View
@@ -0,0 +1,2 @@
+set SCRIPT_DIR=%~dp0
+java -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256m -Xmx512M -Xss2M -jar "%SCRIPT_DIR%\sbt-launcher.jar" %*
No changes.
@@ -0,0 +1,52 @@
+package bootstrap.liftweb
+
+import net.liftweb._
+import util._
+import Helpers._
+
+import common._
+import http._
+import sitemap._
+import Loc._
+
+/**
+ * A class that's instantiated early and run. It allows the application
+ * to modify lift's environment
+ */
+class Boot {
+ /**
+ * Calculate if the page should be displayed.
+ * In this case, it will be visible every other minute
+ */
+ def displaySometimes_? : Boolean =
+ (millis / 1000L / 60L) % 2 == 0
+
+ def boot {
+ // where to search snippet
+ LiftRules.addToPackages("code")
+
+ // Build SiteMap
+ def sitemap(): SiteMap = SiteMap(
+ Menu.i("Home") / "index" // the simple way to declare a menu
+ )
+
+ // set the sitemap. Note if you don't want access control for
+ // each page, just comment this line out.
+ LiftRules.setSiteMapFunc(() => sitemap())
+
+ //Show the spinny image when an Ajax call starts
+ LiftRules.ajaxStart =
+ Full(() => LiftRules.jsArtifacts.show("ajax-loader").cmd)
+
+ // Make the spinny image go away when it ends
+ LiftRules.ajaxEnd =
+ Full(() => LiftRules.jsArtifacts.hide("ajax-loader").cmd)
+
+ // Force the request to be UTF-8
+ LiftRules.early.append(_.setCharacterEncoding("UTF-8"))
+
+ // Use HTML5 for rendering
+ LiftRules.htmlProperties.default.set((r: Req) =>
+ new Html5Properties(r.userAgent))
+ }
+}
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<!DOCTYPE web-app
+PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+"http://java.sun.com/dtd/web-app_2_3.dtd">
+
+<web-app>
+<filter>
+ <filter-name>LiftFilter</filter-name>
+ <display-name>Lift Filter</display-name>
+ <description>The Filter that intercepts lift calls</description>
+ <filter-class>net.liftweb.http.LiftFilter</filter-class>
+</filter>
+
+
+<filter-mapping>
+ <filter-name>LiftFilter</filter-name>
+ <url-pattern>/*</url-pattern>
+</filter-mapping>
+
+</web-app>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta content="text/html; charset=UTF-8" http-equiv="content-type" />
+ <title>Home</title>
+ </head>
+ <body class="lift:content_id=main">
+ <div id="main" class="lift:surround?with=default&at=content">
+
+ </div>
+ </body>
+</html>
+
@@ -0,0 +1,6 @@
+<div id="main" class="lift:surround?with=default;at=content">
+ Static content... everything you put in the /static
+ directory will be served without additions to SiteMap.
+ <a href="/static/sample">Sample</a> page.
+</div>
+
@@ -0,0 +1,4 @@
+<div id="main" class="lift:surround?with=default;at=content">
+ This is the sample page. <a href="/static/index">Back to index</a>
+</div>
+
@@ -0,0 +1,85 @@
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:lift="http://liftweb.net/">
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
+ <meta name="description" content="" />
+ <meta name="keywords" content="" />
+ <title class="lift:Menu.title">App: </title>
+ <style class="lift:CSS.blueprint"></style>
+ <style class="lift:CSS.fancyType"></style>
+ <script id="jquery" src="/classpath/jquery.js" type="text/javascript"></script>
+ <script id="json" src="/classpath/json.js" type="text/javascript"></script>
+ <style type="text/css">
+/* <![CDATA[ */
+.edit_error_class {
+ display: block;
+ color: red;
+}
+
+.sidebar ul {
+ margin:0;
+ padding:0;
+ border-bottom:1px solid #ccc;
+}
+
+
+.sidebar ul li {
+ margin:0;
+ padding:0;
+ list-style:none;
+ border:1px solid #ccc;
+ border-bottom:none;
+}
+
+.sidebar ul li a {
+ display:block;
+ padding:3px;
+ text-indent:30px;
+ text-decoration:none;
+}
+
+.sidebar ul li span {
+ display:block;
+ padding:3px;
+ text-indent:30px;
+ text-decoration:none;
+}
+
+.sidebar ul li a:hover {
+ background-color: #eee;
+}
+
+
+ /* ]]> */
+ </style>
+ </head>
+ <body>
+ <div class="container">
+ <div class="column span-12 last" style="text-align: right">
+ <h1 class="alt">app<img alt="" id="ajax-loader" style="display:none; margin-bottom: 0px; margin-left: 5px" src="/images/ajax-loader.gif"></h1>
+ </div>
+
+ <hr>
+
+ <div class="column span-6 colborder sidebar">
+ <hr class="space" >
+
+ <span class="lift:Menu.builder"></span>
+
+ <div class="lift:Msgs?showAll=true"></div>
+ <hr class="space" />
+ </div>
+
+ <div class="column span-17 last">
+ <div id="content">The main content will get bound here</div>
+ </div>
+
+ <hr />
+ <div class="column span-23 last" style="text-align: center">
+ <h4 class="alt">
+ <a href="http://www.liftweb.net"><i>Lift</i></a>
+ is Copyright 2007-2010 WorldWide Conferencing, LLC.
+ Distributed under an Apache 2.0 License.</h4>
+ </div>
+ </div>
+ </body>
+</html>
@@ -0,0 +1,57 @@
+<div>
+ <wizard:screen_info><div>Page <wizard:screen_number></wizard:screen_number> of <wizard:total_screens></wizard:total_screens></div></wizard:screen_info>
+ <wizard:wizard_top> <div> <wizard:bind></wizard:bind> </div> </wizard:wizard_top>
+ <wizard:screen_top> <div> <wizard:bind></wizard:bind> </div> </wizard:screen_top>
+ <wizard:errors> <div> <ul> <wizard:item> <li> <wizard:bind></wizard:bind> </li> </wizard:item> </ul> </div> </wizard:errors>
+ <div>
+ <wizard:fields>
+ <table>
+ <tbody>
+ <tr lift:bind="wizard:line">
+ <td>
+ <wizard:label>
+ <label wizard:for="">
+ <wizard:bind></wizard:bind>
+ </label>
+ </wizard:label>
+ <wizard:help>
+ <span>
+ <wizard:bind></wizard:bind>
+ </span>
+ </wizard:help>
+ <wizard:field_errors>
+ <ul>
+ <wizard:error>
+ <li>
+ <wizard:bind></wizard:bind>
+ </li>
+ </wizard:error>
+ </ul>
+ </wizard:field_errors>
+ </td>
+ <td>
+ <wizard:form></wizard:form>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </wizard:fields>
+ </div>
+ <div>
+ <table>
+ <tr>
+ <td>
+ <wizard:prev></wizard:prev>
+ </td>
+ <td>
+ <wizard:cancel></wizard:cancel>
+ </td>
+ <td>
+ <wizard:next></wizard:next>
+ </td>
+ </tr>
+ </table>
+ </div>
+ <wizard:screen_bottom> <div> <wizard:bind></wizard:bind> </div> </wizard:screen_bottom>
+ <wizard:wizard_bottom> <div> <wizard:bind></wizard:bind> </div> </wizard:wizard_bottom>
+</div>
No changes.
@@ -0,0 +1,15 @@
+import _root_.bootstrap.liftweb.Boot
+import _root_.scala.tools.nsc.MainGenericRunner
+
+object LiftConsole {
+ def main(args : Array[String]) {
+ // Instantiate your project's Boot file
+ val b = new Boot()
+ // Boot your project
+ b.boot
+ // Now run the MainGenericRunner to get your repl
+ MainGenericRunner.main(args)
+ // After the repl exits, then exit the scala script
+ exit(0)
+ }
+}
Oops, something went wrong.

0 comments on commit dac8805

Please sign in to comment.