- sbt 0.11(xsbt)
- xsbt-web-plugin
- scala 2.9.1
の組み合わせのサンプルを発見。
バージョン指定の方法で毎度悩むので、2011年10月19日現在の最新(と思われる)この組み合わせを使ってliftをやろうかと。
https://github.com/schmmd/helloworld-scala-servlet
(via https://github.com/siasia/xsbt-web-plugin/wiki/)
I personally switched to the Eclipse plugin after 20 years of emacs. Certainly before then, I tried the plugin; but for the complex projects I do, it didn't live up to what I needed. Now, I would now never go back to emacs.『eclipseのScalaプラグインの出来が素晴らしくて、20年使ってきたけどemacsにはもう戻れません!』
http://stackoverflow.com/questions/6566470/how-to-add-sbteclipse-plugin-to-sbt-0-10-x→バージョンの指定方法を参考にしました。
resolvers += {
val typesafeRepoUrl = new java.net.URL("http://repo.typesafe.com/typesafe/releases")
val pattern = Patterns(false, "[organisation]/[module]/[sbtversion]/[revision]/[type]s/[module](-[classifier])-[revision].[ext]")
Resolver.url("Typesafe Repository", typesafeRepoUrl)(pattern)
}
libraryDependencies <<= (libraryDependencies, sbtVersion) { (deps, version) =>
deps :+ ("com.typesafe.sbteclipse" %% "sbteclipse" % "1.2" extra("sbtversion" -> version))
}
resolvers += Classpaths.typesafeResolver
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse" % "1.4.0")
eclipse create-srcを実行すると、.projectファイルと.classpathファイルが作成される。eclipseにて、.projectファイルが存在するパスを指定し、プロジェクト毎import。という感じです。import sbt._
class LiftProject(info: ProjectInfo) extends DefaultWebProject(info) {
val liftVersion = "2.3"
// 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",
"net.liftweb" %% "lift-mapper" % liftVersion % "compile",
"org.mortbay.jetty" % "jetty" % "6.1.22" % "test",
"junit" % "junit" % "4.5" % "test",
"ch.qos.logback" % "logback-classic" % "0.9.26",
"org.scala-tools.testing" %% "specs" % "1.6.6" % "test",
"com.h2database" % "h2" % "1.2.138",
"com.foursquare" %% "rogue" % "1.0.14-SNAPSHOT" withSources()
) ++ super.libraryDependencies
}
"com.foursquare" %% "rogue" % "1.0.14-SNAPSHOT" withSources()の"1.0.14-SNAPSHOT"については、下記のリポジトリを参考にその時々のバージョンを指定して下さい。
package code.model
import net.liftweb._
import mongodb._
import util.Props
import com.mongodb.{Mongo, ServerAddress}
object MongoConfig {
def init: Unit = {
val srvr = new ServerAddress("127.0.0.1", 27017)
MongoDB.defineDb(DefaultMongoIdentifier, new Mongo(srvr), "foo")
}
}
class Boot {
def boot {
if (!DB.jndiJdbcConnAvailable_?) {
//MongoDb boot
MongoConfig.init
(後略)
set USER_PATH=%USER_PATH%;"%SCALA_HOME%\bin"
set USER_PATH=%USER_PATH%;%SBT_HOME%
setx PATH %USER_PATH%
mongod --dbpath e:\data\db--dbpathオプションでデータを保持するフォルダを指定しています。
mongoと打つとシェルが立ち上がります。
db.foo.insert({name:"aaa"})これでfooというコレクションにnameがaaaという値が登録されます。
db.foo.find()
class AccountSnippet{
//色々
}
<lift:AccountSnippet.post form="POST">
<ul class="status">
<li> <accnt:name/> </li>
<li> <accnt:submit/> </li>
</ul>
</lift:AccountSnippet.post>
Error processing snippet: accountsnippet.post
Reason: Class Not Found
XML causing this error:
<lift:accountsnippet.post form="POST">
<ul class="status">
<li> <accnt:name> </accnt:name></li>
<li> <accnt:submit> </accnt:submit></li>
</ul>
</lift:accountsnippet.post>
class Accountsnippet{
//色々
}
名門オーケストラの元天才指揮者が、ひょんなことから昔の仲間を中心にオーケストラを再結成し、かつての栄光を取り戻そうと奮闘する姿をユーモラスに描 いた感動音楽ドラマ。主演はロシアを拠点に活躍するアレクセイ・グシュコフ。共演に「イングロリアス・バスターズ」のメラニー・ロラン。監督は「約束の旅 路」のラデュ・ミヘイレアニュ。
ロシアのボリショイ交響楽団で劇場清掃員として働く中年男アンドレイ。彼は30年前、この楽団で天才指揮者と持 てはやされ活躍していた。しかし、共産主義の当時、国がユダヤ人排斥の政策を強行、ユダヤ系の演奏家たちも例外なく排斥されることにアンドレイらは反旗を 翻したことから、解雇の憂き目に遭う。以来、再起の機会を窺いながら、冴えない現状に甘んじていた。そんなある日、パリの劇場から届いた出演依頼のファッ クスを目にしたアンドレイは、とんでもない考えを思いつく。それは、彼と同様に落ちぶれてしまったかつての仲間を集めて偽のオーケストラを結成し、ボリ ショイ代表として夢のパリ公演を実現させようという突拍子もない計画だった。こうして、タクシー運転手、蚤の市業者、ポルノ映画の効果音担当など、様々な 職業で生計を立てていた仲間が集まり、いざパリへと乗り込む一行だが…。