From 279db914f3d60368bc1be3ac000eaf664d74ba8b Mon Sep 17 00:00:00 2001 From: Daniel James Date: Mon, 18 Nov 2013 15:35:29 -0500 Subject: [PATCH] publish version 0.6 release - depends on Datomisca 0.6 release - update and tidy samples for new release --- project/Build.scala | 28 ++++--------------- .../0-play-datomic-sample/app/Global.scala | 18 ++++++------ .../app/controllers/Application.scala | 20 ++++--------- .../0-play-datomic-sample/project/Build.scala | 11 +++----- .../0-play-datomic-sample/project/plugins.sbt | 2 +- .../app/Global.scala | 18 ++++++------ .../app/controllers/Application.scala | 22 +++++---------- .../conf/seattle-data0.dtm | 3 +- .../conf/seattle-data1.dtm | 3 +- .../conf/seattle-schema.dtm | 3 +- .../project/Build.scala | 11 +++----- .../project/plugins.sbt | 2 +- .../app/Global.scala | 17 ++++++----- .../app/controllers/Application.scala | 19 +++++-------- .../project/Build.scala | 11 +++----- .../project/plugins.sbt | 2 +- .../app/Global.scala | 17 ++++++----- .../app/controllers/Application.scala | 15 ++++------ .../project/Build.scala | 11 +++----- .../project/plugins.sbt | 2 +- .../app/Global.scala | 17 ++++++----- .../app/controllers/Application.scala | 16 ++++------- .../project/Build.scala | 11 +++----- .../project/plugins.sbt | 2 +- .../modules/datomisca/DatomicPlugin.scala | 6 ++-- .../play/modules/datomisca/Implicits.scala | 2 +- 26 files changed, 110 insertions(+), 179 deletions(-) diff --git a/project/Build.scala b/project/Build.scala index 6fc83f8..e350a62 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -9,7 +9,7 @@ object PlayDatomiscaBuild extends Build { lazy val buildSettings = Defaults.defaultSettings ++ Seq ( organization := "com.pellucid", - version := "0.5.2", + version := "0.6", scalaVersion := "2.10.2", scalacOptions ++= Seq( "-deprecation", @@ -35,7 +35,6 @@ object PlayDatomiscaBuild extends Build { lazy val playDatomicsaSettings = buildSettings ++ bintray.Plugin.bintraySettings ++ - //Publish.settings ++ Seq( name := "play-datomisca", shellPrompt := CustomShellPrompt.customPrompt, @@ -53,17 +52,17 @@ object Dependencies { object V { // compile - val datomic = "0.8.4020.26" - val datomisca = "0.5.1" - val play = "2.2.0" + val datomic = "0.8.4260" + val datomisca = "0.6" + val play = "2.2.1" // test val junit = "4.8" - val specs2 = "2.0" + val specs2 = "2.3.4" } object Compile { - val datomic = "com.datomic" % "datomic-pro" % V.datomic % "provided" exclude("org.slf4j", "slf4j-nop") exclude("org.jboss.netty", "netty") + val datomic = "com.datomic" % "datomic-free" % V.datomic % "provided" exclude("org.slf4j", "slf4j-nop") exclude("org.jboss.netty", "netty") val datomisca = "com.pellucid" %% "datomisca" % V.datomisca val play = "com.typesafe.play" %% "play" % V.play % "provided" } @@ -110,18 +109,3 @@ object CustomShellPrompt { } } - -/*object Publish { - - lazy val settings = Seq( - publishMavenStyle := true, - publishTo <<= version { v: String => - val localPublishRepo = "../datomisca-repo/" - if (v.trim endsWith "SNAPSHOT") - Some(Resolver.file("snapshots", new File(localPublishRepo + "/snapshots"))) - else - Some(Resolver.file("releases", new File(localPublishRepo + "/releases"))) - } - ) - -}*/ diff --git a/samples/0-play-datomic-sample/app/Global.scala b/samples/0-play-datomic-sample/app/Global.scala index a8ff5e2..dc9e155 100644 --- a/samples/0-play-datomic-sample/app/Global.scala +++ b/samples/0-play-datomic-sample/app/Global.scala @@ -1,15 +1,16 @@ -import play.api._ -import play.modules.datomisca._ +import scala.concurrent.Await +import scala.concurrent.duration.Duration + +import play.api.{Application, GlobalSettings} +import play.api.Play.current +import play.api.libs.concurrent.Execution.Implicits.defaultContext + import datomisca._ +import play.modules.datomisca._ -import scala.concurrent._ -import scala.concurrent.util._ -import java.util.concurrent.TimeUnit._ -import scala.concurrent.duration.Duration object Global extends GlobalSettings { - import play.api.Play.current override def onStart(app: Application){ val uri = DatomicPlugin.uri("mem") @@ -37,7 +38,6 @@ object Global extends GlobalSettings { stupid ) - implicit val ctx = play.api.libs.concurrent.Execution.Implicits.defaultContext implicit val conn = Datomic.connect(uri) val fut = Datomic.transact(schema) map { tx => println("bootstrapped data") @@ -52,4 +52,4 @@ object Global extends GlobalSettings { play.Logger.info("deleted DB:" + Datomic.deleteDatabase(uri)) } -} \ No newline at end of file +} diff --git a/samples/0-play-datomic-sample/app/controllers/Application.scala b/samples/0-play-datomic-sample/app/controllers/Application.scala index 8d1f2d9..afee412 100644 --- a/samples/0-play-datomic-sample/app/controllers/Application.scala +++ b/samples/0-play-datomic-sample/app/controllers/Application.scala @@ -1,21 +1,15 @@ package controllers -import play.api._ -import play.api.mvc._ - import play.api.Play.current -import scala.concurrent._ -import scala.concurrent.util._ -import java.util.concurrent.TimeUnit._ -import scala.concurrent.duration.Duration -import scala.util.{Try, Success, Failure} +import play.api.mvc.{Action, Controller} +import play.api.libs.concurrent.Execution.Implicits.defaultContext import datomisca._ -import Datomic._ import play.modules.datomisca._ + object Application extends Controller { - def index = Action { Async { + def index = Action.async { val uri = DatomicPlugin.uri("mem") implicit val conn = Datomic.connect(uri) @@ -23,8 +17,6 @@ object Application extends Controller { val character = Namespace("person.character") } - implicit val ctx = play.api.libs.concurrent.Execution.Implicits.defaultContext - Datomic.transact( Entity.add(DId(Partition.USER))( person / "name" -> "toto", @@ -49,9 +41,9 @@ object Application extends Controller { ] """) - Datomic.q(query, database, DLong(45L)) + Datomic.q(query, conn.database, DLong(45L)) } map { l => Ok(l.toString) } - }} + } } diff --git a/samples/0-play-datomic-sample/project/Build.scala b/samples/0-play-datomic-sample/project/Build.scala index 2e0cfa4..bffc4ae 100644 --- a/samples/0-play-datomic-sample/project/Build.scala +++ b/samples/0-play-datomic-sample/project/Build.scala @@ -7,8 +7,8 @@ object ApplicationBuild extends Build { val appName = "play-datomisca-sample" val appVersion = "1.0-SNAPSHOT" - val datomicVersion = "0.8.4020.26" - val playDatomiscaVersion = "0.5.2" + val datomicVersion = "0.8.4260" + val playDatomiscaVersion = "0.6" val appDependencies = Seq( "com.pellucid" %% "play-datomisca" % playDatomiscaVersion, @@ -17,11 +17,8 @@ object ApplicationBuild extends Build { val main = play.Project(appName, appVersion, appDependencies).settings( resolvers ++= Seq( - Resolver.file("local repository", file("/Users/pvo/.ivy2/local"))(Resolver.ivyStylePatterns), - "clojars" at "https://clojars.org/repo", - "couchbase" at "http://files.couchbase.com/maven2", - "datomisca-repo snapshots" at "https://github.com/pellucidanalytics/datomisca-repo/raw/master/snapshots", - "datomisca-repo releases" at "https://github.com/pellucidanalytics/datomisca-repo/raw/master/releases" + "Pellucid Bintray" at "http://dl.bintray.com/content/pellucid/maven", + "clojars" at "https://clojars.org/repo" ) ) diff --git a/samples/0-play-datomic-sample/project/plugins.sbt b/samples/0-play-datomic-sample/project/plugins.sbt index e1aef47..ba7a57a 100644 --- a/samples/0-play-datomic-sample/project/plugins.sbt +++ b/samples/0-play-datomic-sample/project/plugins.sbt @@ -5,4 +5,4 @@ logLevel := Level.Warn resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/" // Use the Play sbt plugin for Play projects -addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.2.0") \ No newline at end of file +addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.2.1") diff --git a/samples/1-play-datomic-getting-started/app/Global.scala b/samples/1-play-datomic-getting-started/app/Global.scala index 469ac30..68edf26 100644 --- a/samples/1-play-datomic-getting-started/app/Global.scala +++ b/samples/1-play-datomic-getting-started/app/Global.scala @@ -1,14 +1,15 @@ -import play.api._ -import play.modules.datomisca._ -import datomisca._ - -import scala.concurrent._ -import scala.concurrent.util._ -import java.util.concurrent.TimeUnit._ +import scala.concurrent.Await import scala.concurrent.duration.Duration import scala.io.Source +import play.api.{Application, GlobalSettings} +import play.api.libs.concurrent.Execution.Implicits.defaultContext + +import datomisca._ +import play.modules.datomisca._ + + object Global extends GlobalSettings { import play.api.Play.current @@ -24,7 +25,6 @@ object Global extends GlobalSettings { println("schema:"+schema) schema.map{ schema => - implicit val ctx = play.api.libs.concurrent.Execution.Implicits.defaultContext implicit val conn = Datomic.connect(uri) val fut = Datomic.transact(schema) flatMap { tx => play.Logger.info("bootstrapped schema") @@ -51,4 +51,4 @@ object Global extends GlobalSettings { play.Logger.info("deleted DB:" + Datomic.deleteDatabase(uri)) } -} \ No newline at end of file +} diff --git a/samples/1-play-datomic-getting-started/app/controllers/Application.scala b/samples/1-play-datomic-getting-started/app/controllers/Application.scala index 1b9987b..c82bc7e 100644 --- a/samples/1-play-datomic-getting-started/app/controllers/Application.scala +++ b/samples/1-play-datomic-getting-started/app/controllers/Application.scala @@ -1,27 +1,19 @@ package controllers -import play.api._ -import play.api.mvc._ +import scala.language.reflectiveCalls +import scala.concurrent.Future +import scala.io.Source import play.api.Play.current -import scala.concurrent._ -import scala.concurrent.util._ -import java.util.concurrent.TimeUnit._ -import scala.concurrent.duration.Duration -import scala.util.{Try, Success, Failure} -import scala.io.Source +import play.api.mvc.{Action, Controller} +import play.api.libs.concurrent.Execution.Implicits.defaultContext +import play.api.libs.json.Json import datomisca._ - import play.modules.datomisca._ -import play.api.libs.json._ -import play.api.libs.json.Json - -import scala.language.reflectiveCalls object Application extends Controller { - implicit val ctx = play.api.libs.concurrent.Execution.Implicits.defaultContext val community = new Namespace("community") { val tpe = new Namespace("community.type") @@ -584,4 +576,4 @@ object Application extends Controller { } } -} \ No newline at end of file +} diff --git a/samples/1-play-datomic-getting-started/conf/seattle-data0.dtm b/samples/1-play-datomic-getting-started/conf/seattle-data0.dtm index ebeff61..6ffa133 100644 --- a/samples/1-play-datomic-getting-started/conf/seattle-data0.dtm +++ b/samples/1-play-datomic-getting-started/conf/seattle-data0.dtm @@ -1,4 +1,4 @@ -[ + {:district/region :region/e, :db/id #db/id[:db.part/user -1000001], :district/name "East"} {:db/id #db/id[:db.part/user -1000002], :neighborhood/name "Capitol Hill", :neighborhood/district #db/id[:db.part/user -1000001]} {:community/category ["15th avenue residents"], :community/orgtype :community.orgtype/community, :community/type :community.type/email-list, :db/id #db/id[:db.part/user -1000003], :community/name "15th Ave Community", :community/url "http://groups.yahoo.com/group/15thAve_Community/", :community/neighborhood #db/id[:db.part/user -1000002]} @@ -449,4 +449,3 @@ {:district/region :region/sw, :db/id #db/id[:db.part/user -1000448], :district/name "Delridge"} {:db/id #db/id[:db.part/user -1000449], :neighborhood/name "Delridge", :neighborhood/district #db/id[:db.part/user -1000448]} {:community/category ["environmental conservation"], :community/orgtype :community.orgtype/community, :community/type :community.type/website, :db/id #db/id[:db.part/user -1000450], :community/name "Nature Consortium", :community/url "http://www.naturec.org", :community/neighborhood #db/id[:db.part/user -1000449]} -] diff --git a/samples/1-play-datomic-getting-started/conf/seattle-data1.dtm b/samples/1-play-datomic-getting-started/conf/seattle-data1.dtm index 4b39095..b828bb8 100644 --- a/samples/1-play-datomic-getting-started/conf/seattle-data1.dtm +++ b/samples/1-play-datomic-getting-started/conf/seattle-data1.dtm @@ -1,4 +1,4 @@ -[ + {:district/region :region/se, :db/id #db/id[:db.part/user -1000451], :district/name "Greater Duwamish"} {:db/id #db/id[:db.part/user -1000452], :neighborhood/name "Beacon Hill", :neighborhood/district #db/id[:db.part/user -1000451]} {:community/category ["community members"], :community/orgtype :community.orgtype/community, :community/type :community.type/email-list, :db/id #db/id[:db.part/user -1000453], :community/name "nbeaconhillneighbors", :community/url "http://groups.yahoo.com/group/nbeaconhillneighbors/", :community/neighborhood #db/id[:db.part/user -1000452]} @@ -323,4 +323,3 @@ {:district/region :region/se, :db/id #db/id[:db.part/user -1000772], :district/name "Southeast"} {:db/id #db/id[:db.part/user -1000773], :neighborhood/name "Jackson Place", :neighborhood/district #db/id[:db.part/user -1000772]} {:community/category ["neighborhood-issues" "neighborhood-planning"], :community/orgtype :community.orgtype/community, :community/type :community.type/website, :db/id #db/id[:db.part/user -1000774], :community/name "Jackson Place Community Council", :community/url "http://www.jacksonplace.org", :community/neighborhood #db/id[:db.part/user -1000773]} -] diff --git a/samples/1-play-datomic-getting-started/conf/seattle-schema.dtm b/samples/1-play-datomic-getting-started/conf/seattle-schema.dtm index 540f615..5537056 100644 --- a/samples/1-play-datomic-getting-started/conf/seattle-schema.dtm +++ b/samples/1-play-datomic-getting-started/conf/seattle-schema.dtm @@ -1,4 +1,4 @@ -[ + ;; community {:db/id #db/id[:db.part/db] @@ -102,4 +102,3 @@ [:db/add #db/id[:db.part/user] :db/ident :region/sw] [:db/add #db/id[:db.part/user] :db/ident :region/w] [:db/add #db/id[:db.part/user] :db/ident :region/nw] - ] \ No newline at end of file diff --git a/samples/1-play-datomic-getting-started/project/Build.scala b/samples/1-play-datomic-getting-started/project/Build.scala index 4c434e6..5933783 100644 --- a/samples/1-play-datomic-getting-started/project/Build.scala +++ b/samples/1-play-datomic-getting-started/project/Build.scala @@ -7,8 +7,8 @@ object ApplicationBuild extends Build { val appName = "play-datomisca-getting-started" val appVersion = "1.0-SNAPSHOT" - val datomicVersion = "0.8.4020.26" - val playDatomiscaVersion = "0.5.2" + val datomicVersion = "0.8.4260" + val playDatomiscaVersion = "0.6" val appDependencies = Seq( "com.pellucid" %% "play-datomisca" % playDatomiscaVersion, @@ -17,11 +17,8 @@ object ApplicationBuild extends Build { val main = play.Project(appName, appVersion, appDependencies).settings( resolvers ++= Seq( - Resolver.file("local repository", file("/Users/pvo/.ivy2/local"))(Resolver.ivyStylePatterns), - "clojars" at "https://clojars.org/repo", - "Couchbase" at "http://files.couchbase.com/maven2/", - "datomisca-repo snapshots" at "https://github.com/pellucidanalytics/datomisca-repo/raw/master/snapshots", - "datomisca-repo releases" at "https://github.com/pellucidanalytics/datomisca-repo/raw/master/releases" + "Pellucid Bintray" at "http://dl.bintray.com/content/pellucid/maven", + "clojars" at "https://clojars.org/repo" ), scalacOptions ++= Seq("-deprecation", "-feature", "-unchecked") ) diff --git a/samples/1-play-datomic-getting-started/project/plugins.sbt b/samples/1-play-datomic-getting-started/project/plugins.sbt index e1aef47..ba7a57a 100644 --- a/samples/1-play-datomic-getting-started/project/plugins.sbt +++ b/samples/1-play-datomic-getting-started/project/plugins.sbt @@ -5,4 +5,4 @@ logLevel := Level.Warn resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/" // Use the Play sbt plugin for Play projects -addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.2.0") \ No newline at end of file +addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.2.1") diff --git a/samples/2-play-datomic-person-dog/app/Global.scala b/samples/2-play-datomic-person-dog/app/Global.scala index 9b8b129..b5f4ebe 100644 --- a/samples/2-play-datomic-person-dog/app/Global.scala +++ b/samples/2-play-datomic-person-dog/app/Global.scala @@ -1,13 +1,13 @@ -import play.api._ -import play.modules.datomisca._ -import datomisca._ - -import scala.concurrent._ -import scala.concurrent.util._ -import java.util.concurrent.TimeUnit._ +import scala.concurrent.Await import scala.concurrent.duration.Duration +import play.api.{Application, GlobalSettings} +import play.api.libs.concurrent.Execution.Implicits.defaultContext + +import datomisca._ +import play.modules.datomisca._ + import models._ object Global extends GlobalSettings { @@ -18,7 +18,6 @@ object Global extends GlobalSettings { play.Logger.info("created DB:" + Datomic.createDatabase(uri)) - implicit val ctx = play.api.libs.concurrent.Execution.Implicits.defaultContext implicit val conn = Datomic.connect(uri) // TODO : here we should verify first that schema is not already in DB @@ -41,4 +40,4 @@ object Global extends GlobalSettings { play.Logger.info("deleted DB:" + Datomic.deleteDatabase(uri)) } -} \ No newline at end of file +} diff --git a/samples/2-play-datomic-person-dog/app/controllers/Application.scala b/samples/2-play-datomic-person-dog/app/controllers/Application.scala index 54fd708..eadbe47 100644 --- a/samples/2-play-datomic-person-dog/app/controllers/Application.scala +++ b/samples/2-play-datomic-person-dog/app/controllers/Application.scala @@ -1,27 +1,24 @@ package controllers -import play.api._ -import play.api.mvc._ -import scala.concurrent._ -import scala.concurrent.util._ -import java.util.concurrent.TimeUnit._ +import scala.concurrent.Future import scala.concurrent.duration.Duration -import scala.util.{Try, Success, Failure} +import scala.util.Try import play.api.Play.current +import play.api.mvc.{Action, Controller} import play.api.libs.json._ import play.api.libs.functional.syntax._ +import play.api.libs.concurrent.Execution.Implicits.defaultContext import datomisca._ import play.modules.datomisca._ import models._ + object Application extends Controller { val uri = DatomicPlugin.uri("mem") - - implicit val ctx = play.api.libs.concurrent.Execution.Implicits.defaultContext implicit val conn = Datomic.connect(uri) def index = Action { @@ -117,9 +114,7 @@ object Application extends Controller { "characters" -> Json.toJson(characters) ))) } catch { - case e: EntityNotFoundException => - BadRequest(Json.toJson(Json.obj("result" -> "KO", "error" -> s"Person with id $id not found"))) - case e: Throwable => + case e: Exception => e.printStackTrace BadRequest(Json.toJson(Json.obj("result" -> "KO", "error" -> s"Person entity not mappable"))) } @@ -157,4 +152,4 @@ object Application extends Controller { Future.successful(BadRequest(Json.obj("result" -> "KO", "errors" -> JsError.toFlatJson(errors) ))) } } -} \ No newline at end of file +} diff --git a/samples/2-play-datomic-person-dog/project/Build.scala b/samples/2-play-datomic-person-dog/project/Build.scala index 5ac48f3..b725130 100644 --- a/samples/2-play-datomic-person-dog/project/Build.scala +++ b/samples/2-play-datomic-person-dog/project/Build.scala @@ -7,8 +7,8 @@ object ApplicationBuild extends Build { val appName = "play-datomisca-person-dog" val appVersion = "1.0-SNAPSHOT" - val datomicVersion = "0.8.4020.26" - val playDatomiscaVersion = "0.5.2" + val datomicVersion = "0.8.4260" + val playDatomiscaVersion = "0.6" val appDependencies = Seq( "com.pellucid" %% "play-datomisca" % playDatomiscaVersion, @@ -17,11 +17,8 @@ object ApplicationBuild extends Build { val main = play.Project(appName, appVersion, appDependencies).settings( resolvers ++= Seq( - Resolver.file("local repository", file("/Users/pvo/.ivy2/local"))(Resolver.ivyStylePatterns), - "clojars" at "https://clojars.org/repo", - "couchbase" at "http://files.couchbase.com/maven2", - "datomisca-repo snapshots" at "https://github.com/pellucidanalytics/datomisca-repo/raw/master/snapshots", - "datomisca-repo releases" at "https://github.com/pellucidanalytics/datomisca-repo/raw/master/releases" + "Pellucid Bintray" at "http://dl.bintray.com/content/pellucid/maven", + "clojars" at "https://clojars.org/repo" ) ) diff --git a/samples/2-play-datomic-person-dog/project/plugins.sbt b/samples/2-play-datomic-person-dog/project/plugins.sbt index e1aef47..ba7a57a 100644 --- a/samples/2-play-datomic-person-dog/project/plugins.sbt +++ b/samples/2-play-datomic-person-dog/project/plugins.sbt @@ -5,4 +5,4 @@ logLevel := Level.Warn resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/" // Use the Play sbt plugin for Play projects -addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.2.0") \ No newline at end of file +addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.2.1") diff --git a/samples/3-play-datomic-person-dog-entity-mapping/app/Global.scala b/samples/3-play-datomic-person-dog-entity-mapping/app/Global.scala index 9b8b129..b5f4ebe 100644 --- a/samples/3-play-datomic-person-dog-entity-mapping/app/Global.scala +++ b/samples/3-play-datomic-person-dog-entity-mapping/app/Global.scala @@ -1,13 +1,13 @@ -import play.api._ -import play.modules.datomisca._ -import datomisca._ - -import scala.concurrent._ -import scala.concurrent.util._ -import java.util.concurrent.TimeUnit._ +import scala.concurrent.Await import scala.concurrent.duration.Duration +import play.api.{Application, GlobalSettings} +import play.api.libs.concurrent.Execution.Implicits.defaultContext + +import datomisca._ +import play.modules.datomisca._ + import models._ object Global extends GlobalSettings { @@ -18,7 +18,6 @@ object Global extends GlobalSettings { play.Logger.info("created DB:" + Datomic.createDatabase(uri)) - implicit val ctx = play.api.libs.concurrent.Execution.Implicits.defaultContext implicit val conn = Datomic.connect(uri) // TODO : here we should verify first that schema is not already in DB @@ -41,4 +40,4 @@ object Global extends GlobalSettings { play.Logger.info("deleted DB:" + Datomic.deleteDatabase(uri)) } -} \ No newline at end of file +} diff --git a/samples/3-play-datomic-person-dog-entity-mapping/app/controllers/Application.scala b/samples/3-play-datomic-person-dog-entity-mapping/app/controllers/Application.scala index fc2ac1b..5229f0e 100644 --- a/samples/3-play-datomic-person-dog-entity-mapping/app/controllers/Application.scala +++ b/samples/3-play-datomic-person-dog-entity-mapping/app/controllers/Application.scala @@ -1,15 +1,11 @@ package controllers -import play.api._ -import play.api.mvc._ - -import scala.concurrent._ -import scala.concurrent.util._ -import java.util.concurrent.TimeUnit._ -import scala.concurrent.duration.Duration +import scala.concurrent.Future import scala.util.{Try, Success, Failure} import play.api.Play.current +import play.api.mvc.{Action, Controller} +import play.api.libs.concurrent.Execution.Implicits.defaultContext import play.api.libs.json._ import play.api.libs.functional.syntax._ @@ -18,10 +14,9 @@ import play.modules.datomisca._ import models._ + object Application extends Controller { val uri = DatomicPlugin.uri("mem") - - implicit val ctx = play.api.libs.concurrent.Execution.Implicits.defaultContext implicit val conn = Datomic.connect(uri) def index = Action { @@ -108,4 +103,4 @@ object Application extends Controller { Future.successful(BadRequest(Json.obj("result" -> "KO", "errors" -> JsError.toFlatJson(errors) ))) } } -} \ No newline at end of file +} diff --git a/samples/3-play-datomic-person-dog-entity-mapping/project/Build.scala b/samples/3-play-datomic-person-dog-entity-mapping/project/Build.scala index b19f128..a42d3f3 100644 --- a/samples/3-play-datomic-person-dog-entity-mapping/project/Build.scala +++ b/samples/3-play-datomic-person-dog-entity-mapping/project/Build.scala @@ -7,8 +7,8 @@ object ApplicationBuild extends Build { val appName = "play-datomisca-person-dog-em" val appVersion = "1.0-SNAPSHOT" - val datomicVersion = "0.8.4020.26" - val playDatomiscaVersion = "0.5.2" + val datomicVersion = "0.8.4260" + val playDatomiscaVersion = "0.6" val appDependencies = Seq( "com.pellucid" %% "play-datomisca" % playDatomiscaVersion, @@ -17,11 +17,8 @@ object ApplicationBuild extends Build { val main = play.Project(appName, appVersion, appDependencies).settings( resolvers ++= Seq( - Resolver.file("local repository", file("/Users/pvo/.ivy2/local"))(Resolver.ivyStylePatterns), - "clojars" at "https://clojars.org/repo", - "couchbase" at "http://files.couchbase.com/maven2", - "datomisca-repo snapshots" at "https://github.com/pellucidanalytics/datomisca-repo/raw/master/snapshots", - "datomisca-repo releases" at "https://github.com/pellucidanalytics/datomisca-repo/raw/master/releases" + "Pellucid Bintray" at "http://dl.bintray.com/content/pellucid/maven", + "clojars" at "https://clojars.org/repo" ) ) diff --git a/samples/3-play-datomic-person-dog-entity-mapping/project/plugins.sbt b/samples/3-play-datomic-person-dog-entity-mapping/project/plugins.sbt index e1aef47..ba7a57a 100644 --- a/samples/3-play-datomic-person-dog-entity-mapping/project/plugins.sbt +++ b/samples/3-play-datomic-person-dog-entity-mapping/project/plugins.sbt @@ -5,4 +5,4 @@ logLevel := Level.Warn resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/" // Use the Play sbt plugin for Play projects -addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.2.0") \ No newline at end of file +addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.2.1") diff --git a/samples/4-play-datomic-person-dog-typed/app/Global.scala b/samples/4-play-datomic-person-dog-typed/app/Global.scala index bd9d7fe..0144a9f 100644 --- a/samples/4-play-datomic-person-dog-typed/app/Global.scala +++ b/samples/4-play-datomic-person-dog-typed/app/Global.scala @@ -1,15 +1,15 @@ -import play.api._ +import scala.concurrent.Await +import scala.concurrent.duration.Duration -import play.modules.datomisca._ -import datomisca._ +import play.api.{Application, GlobalSettings} +import play.api.libs.concurrent.Execution.Implicits.defaultContext -import scala.concurrent._ -import scala.concurrent.util._ -import java.util.concurrent.TimeUnit._ -import scala.concurrent.duration.Duration +import datomisca._ +import play.modules.datomisca._ import models._ + object Global extends GlobalSettings { import play.api.Play.current @@ -18,7 +18,6 @@ object Global extends GlobalSettings { play.Logger.info("created DB:" + Datomic.createDatabase(uri)) - implicit val ctx = play.api.libs.concurrent.Execution.Implicits.defaultContext implicit val conn = Datomic.connect(uri) // TODO : here we should verify first that schema is not already in DB @@ -40,4 +39,4 @@ object Global extends GlobalSettings { play.Logger.info("deleted DB:" + Datomic.deleteDatabase(uri)) } -} \ No newline at end of file +} diff --git a/samples/4-play-datomic-person-dog-typed/app/controllers/Application.scala b/samples/4-play-datomic-person-dog-typed/app/controllers/Application.scala index 6698741..c977227 100644 --- a/samples/4-play-datomic-person-dog-typed/app/controllers/Application.scala +++ b/samples/4-play-datomic-person-dog-typed/app/controllers/Application.scala @@ -1,32 +1,26 @@ package controllers -import play.api._ -import play.api.mvc._ import scala.concurrent._ -import scala.concurrent.util._ -import java.util.concurrent.TimeUnit._ import scala.concurrent.duration.Duration -import scala.util.{Try, Success, Failure} import play.api.Play.current +import play.api.mvc.{Action, Controller} import play.api.libs.functional.syntax._ import play.api.libs.json._ -import play.api.libs.json.Reads._ -import play.api.libs.json.Writes._ +import play.api.libs.json.Reads.JsObjectReducer +import play.api.libs.concurrent.Execution.Implicits.defaultContext import datomisca._ -import DatomicMapping._ import play.modules.datomisca._ -import Implicits._ +import play.modules.datomisca.Implicits._ import models._ + object Application extends Controller { val uri = DatomicPlugin.uri("mem") - - implicit val ctx = play.api.libs.concurrent.Execution.Implicits.defaultContext implicit val conn = Datomic.connect(uri) def index = Action { diff --git a/samples/4-play-datomic-person-dog-typed/project/Build.scala b/samples/4-play-datomic-person-dog-typed/project/Build.scala index 610b07d..2afd992 100644 --- a/samples/4-play-datomic-person-dog-typed/project/Build.scala +++ b/samples/4-play-datomic-person-dog-typed/project/Build.scala @@ -7,8 +7,8 @@ object ApplicationBuild extends Build { val appName = "play-datomisca-person-dog-typed" val appVersion = "1.0-SNAPSHOT" - val datomicVersion = "0.8.4020.26" - val playDatomiscaVersion = "0.5.2" + val datomicVersion = "0.8.4260" + val playDatomiscaVersion = "0.6" val appDependencies = Seq( "com.pellucid" %% "play-datomisca" % playDatomiscaVersion, @@ -18,11 +18,8 @@ object ApplicationBuild extends Build { val main = play.Project(appName, appVersion, appDependencies).settings( //scalacOptions ++= Seq("-Xlog-implicits"), resolvers ++= Seq( - Resolver.file("local repository", file("/Users/pvo/.ivy2/local"))(Resolver.ivyStylePatterns), - "clojars" at "https://clojars.org/repo", - "couchbase" at "http://files.couchbase.com/maven2", - "datomisca-repo snapshots" at "https://github.com/pellucidanalytics/datomisca-repo/raw/master/snapshots", - "datomisca-repo releases" at "https://github.com/pellucidanalytics/datomisca-repo/raw/master/releases" + "Pellucid Bintray" at "http://dl.bintray.com/content/pellucid/maven", + "clojars" at "https://clojars.org/repo" ) ) diff --git a/samples/4-play-datomic-person-dog-typed/project/plugins.sbt b/samples/4-play-datomic-person-dog-typed/project/plugins.sbt index e1aef47..ba7a57a 100644 --- a/samples/4-play-datomic-person-dog-typed/project/plugins.sbt +++ b/samples/4-play-datomic-person-dog-typed/project/plugins.sbt @@ -5,4 +5,4 @@ logLevel := Level.Warn resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/" // Use the Play sbt plugin for Play projects -addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.2.0") \ No newline at end of file +addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.2.1") diff --git a/src/main/scala/play/modules/datomisca/DatomicPlugin.scala b/src/main/scala/play/modules/datomisca/DatomicPlugin.scala index 0a50aae..955df10 100644 --- a/src/main/scala/play/modules/datomisca/DatomicPlugin.scala +++ b/src/main/scala/play/modules/datomisca/DatomicPlugin.scala @@ -16,11 +16,11 @@ package play.modules.datomisca -import play.api._ -import scala.concurrent.{ExecutionContext, ExecutionContextExecutor} +import scala.util.Try + +import play.api.{Application, Logger, PlayException, Plugin} import datomisca.{Datomic, Connection} -import scala.util.{Try, Success, Failure} class DatomicPlugin(app: Application) extends Plugin { diff --git a/src/main/scala/play/modules/datomisca/Implicits.scala b/src/main/scala/play/modules/datomisca/Implicits.scala index fbaa5e1..0a2bfd3 100644 --- a/src/main/scala/play/modules/datomisca/Implicits.scala +++ b/src/main/scala/play/modules/datomisca/Implicits.scala @@ -1,8 +1,8 @@ package play.modules.datomisca import datomisca._ + import play.api.libs.json._ -import play.api.data.validation.ValidationError import play.api.libs.functional.{Monoid, Reducer} object Implicits {