Skip to content
This repository has been archived by the owner on Aug 12, 2019. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
* Fixed up the mvc sample
  • Loading branch information
fmpwizard committed Jul 7, 2012
1 parent f57f5ca commit 2569be1
Show file tree
Hide file tree
Showing 14 changed files with 120 additions and 149 deletions.
2 changes: 1 addition & 1 deletion scala_29/lift_basic/build.sbt
Expand Up @@ -19,7 +19,7 @@ libraryDependencies ++= {
Seq(
"net.liftweb" %% "lift-webkit" % liftVersion % "compile",
"net.liftweb" %% "lift-mapper" % liftVersion % "compile",
"net.liftmodules" %% "lift-jquery-module" % (liftVersion + "-0.0.4-SNAPSHOT"),
"net.liftmodules" %% "lift-jquery-module" % (liftVersion + "-1.0-SNAPSHOT"),
"org.eclipse.jetty" % "jetty-webapp" % "7.5.4.v20111024" % "container; test",
"ch.qos.logback" % "logback-classic" % "1.0.6",
"org.specs2" %% "specs2" % "1.11" % "test",
Expand Down
29 changes: 29 additions & 0 deletions scala_29/lift_mvc/build.sbt
@@ -0,0 +1,29 @@
name := "Lift 2.5 starter template"

version := "0.0.1"

organization := "net.liftweb"

scalaVersion := "2.9.1"

resolvers ++= Seq("snapshots" at "http://oss.sonatype.org/content/repositories/snapshots",
"releases" at "http://oss.sonatype.org/content/repositories/releases"
)

seq(com.github.siasia.WebPlugin.webSettings :_*)

scalacOptions ++= Seq("-deprecation", "-unchecked")

libraryDependencies ++= {
val liftVersion = "2.5-SNAPSHOT"
Seq(
"net.liftweb" %% "lift-webkit" % liftVersion % "compile",
"net.liftweb" %% "lift-mapper" % liftVersion % "compile",
"net.liftmodules" %% "lift-jquery-module" % (liftVersion + "-1.0-SNAPSHOT"),
"org.eclipse.jetty" % "jetty-webapp" % "7.5.4.v20111024" % "container; test",
"ch.qos.logback" % "logback-classic" % "1.0.6",
"org.specs2" %% "specs2" % "1.11" % "test",
"com.h2database" % "h2" % "1.3.167"
)
}

9 changes: 0 additions & 9 deletions scala_29/lift_mvc/project/build.properties

This file was deleted.

26 changes: 0 additions & 26 deletions scala_29/lift_mvc/project/build/LiftProject.scala

This file was deleted.

12 changes: 12 additions & 0 deletions scala_29/lift_mvc/project/plugins.sbt
@@ -0,0 +1,12 @@
libraryDependencies <+= sbtVersion(v => v match {
case "0.11.0" => "com.github.siasia" %% "xsbt-web-plugin" % "0.11.0-0.2.8"
case "0.11.1" => "com.github.siasia" %% "xsbt-web-plugin" % "0.11.1-0.2.10"
case "0.11.2" => "com.github.siasia" %% "xsbt-web-plugin" % "0.11.2-0.2.11"
case "0.11.3" => "com.github.siasia" %% "xsbt-web-plugin" % "0.11.3-0.2.11.1"
})

//Uncoment this line to enable the sbt idea plugin
addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.0.0")

//Uncoment this line to enable the sbt eclipse plugin
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.1.0-RC1")
2 changes: 1 addition & 1 deletion scala_29/lift_mvc/sbt
@@ -1 +1 @@
java -Xmx1024M -Xss2M -XX:+CMSClassUnloadingEnabled -jar `dirname $0`/sbt-launcher.jar "$@"
java -Xmx1024M -Xss2M -XX:MaxPermSize=512m -XX:+CMSClassUnloadingEnabled -jar `dirname $0`/sbt-launcher.jar "$@"
Binary file modified scala_29/lift_mvc/sbt-launcher.jar
Binary file not shown.
23 changes: 23 additions & 0 deletions scala_29/lift_mvc/src/main/resources/props/default.logback.xml
@@ -0,0 +1,23 @@
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<appender name="FILE" class="ch.qos.logback.core.FileAppender">
<file>console.devmode.log</file>
<append>true</append>
<encoder>
<pattern>%-4relative [%thread] %-5level %logger{35} - %msg%n</pattern>
</encoder>
</appender>



<logger name="code.snippet" level="info" />
<logger name="net.liftweb" level="warn" />
<logger name="bootstrap.liftweb" level="info" />
<root level="warn">
<appender-ref ref="STDOUT" />
</root>
</configuration>
12 changes: 10 additions & 2 deletions scala_29/lift_mvc/src/main/scala/bootstrap/liftweb/Boot.scala
Expand Up @@ -8,6 +8,7 @@ import common._
import http._

import code.controller._
import net.liftmodules.JQueryModule


/**
Expand All @@ -19,8 +20,7 @@ class Boot {
// where to search snippet
LiftRules.addToPackages("code")

// Use jQuery 1.4
LiftRules.jsArtifacts = net.liftweb.http.js.jquery.JQuery14Artifacts
LiftRules.jsArtifacts = net.liftweb.http.js.jquery.JQueryArtifacts

//Show the spinny image when an Ajax call starts
LiftRules.ajaxStart =
Expand All @@ -34,5 +34,13 @@ class Boot {
LiftRules.early.append(_.setCharacterEncoding("UTF-8"))

LiftRules.dispatch.append(RootController)

// Use HTML5 for rendering
LiftRules.htmlProperties.default.set((r: Req) =>
new Html5Properties(r.userAgent))

//Init the jQuery module, see http://liftweb.net/jquery for more information.
JQueryModule.InitParam.JQuery=JQueryModule.JQuery172
JQueryModule.init()
}
}
25 changes: 13 additions & 12 deletions scala_29/lift_mvc/src/main/webapp/templates-hidden/default.html
Expand Up @@ -3,10 +3,11 @@
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="description" content="" />
<meta name="keywords" content="" />
<lift:CSS.blueprint />
<lift:CSS.fancyType />
<script id="jquery" src="/classpath/jquery.js" type="text/javascript"/>
<script id="json" src="/classpath/json.js" type="text/javascript"/>
<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 {
Expand Down Expand Up @@ -54,20 +55,20 @@
<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>
<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-23 last">
<lift:bind name="content" />
<hr>
<div class="column span-6 colborder sidebar">
<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-2011 WorldWide Conferencing, LLC.
is Copyright 2007-2012 WorldWide Conferencing, LLC.
Distributed under an Apache 2.0 License.</h4>
</div>
</div>
Expand Down
23 changes: 23 additions & 0 deletions scala_29/lift_mvc/src/test/resources/logback-test.xml
@@ -0,0 +1,23 @@
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<appender name="FILE" class="ch.qos.logback.core.FileAppender">
<file>console.devmode.log</file>
<append>true</append>
<encoder>
<pattern>%-4relative [%thread] %-5level %logger{35} - %msg%n</pattern>
</encoder>
</appender>



<logger name="code.snippet" level="info" />
<logger name="net.liftweb" level="warn" />
<logger name="bootstrap.liftweb" level="info" />
<root level="warn">
<appender-ref ref="STDOUT" />
</root>
</configuration>
15 changes: 0 additions & 15 deletions scala_29/lift_mvc/src/test/scala/LiftConsole.scala

This file was deleted.

15 changes: 8 additions & 7 deletions scala_29/lift_mvc/src/test/scala/RunWebApp.scala
@@ -1,7 +1,7 @@
import org.mortbay.jetty.Connector
import org.mortbay.jetty.Server
import org.mortbay.jetty.webapp.WebAppContext
import org.mortbay.jetty.nio._
import org.eclipse.jetty.server.handler.ContextHandler
import org.eclipse.jetty.server.nio.SelectChannelConnector
import org.eclipse.jetty.server.{Handler, Server}
import org.eclipse.jetty.webapp.WebAppContext

object RunWebApp extends App {
val server = new Server
Expand All @@ -11,10 +11,11 @@ object RunWebApp extends App {

val context = new WebAppContext()
context.setServer(server)
context.setContextPath("/")
context.setWar("src/main/webapp")

server.addHandler(context)
val context0: ContextHandler = new ContextHandler();
context0.setHandler(context)
server.setHandler(context0)

try {
println(">>> STARTING EMBEDDED JETTY SERVER, PRESS ANY KEY TO STOP")
Expand All @@ -25,7 +26,7 @@ object RunWebApp extends App {
server.stop()
server.join()
} catch {
case exc : Exception => {
case exc: Exception => {
exc.printStackTrace()
System.exit(100)
}
Expand Down
76 changes: 0 additions & 76 deletions scala_29/lift_mvc/src/test/scala/code/AppTest.scala

This file was deleted.

0 comments on commit 2569be1

Please sign in to comment.