Skip to content

Commit

Permalink
Merge pull request #27 from ifreitas/Scala-2.11
Browse files Browse the repository at this point in the history
Scala 2.11
  • Loading branch information
ifreitas authored Feb 25, 2018
2 parents e505242 + 2208aac commit 9dace37
Show file tree
Hide file tree
Showing 73 changed files with 168 additions and 400 deletions.
137 changes: 0 additions & 137 deletions .classpath

This file was deleted.

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,8 @@ profiles
log/
.cache
.settings
.classpath
.project
databases
knowledge_base
/bin/
13 changes: 0 additions & 13 deletions .project

This file was deleted.

31 changes: 19 additions & 12 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,39 @@ version := "0.3.2"

organization := "Israel Freitas"

scalaVersion := "2.10.2"
scalaVersion := "2.11.0"

EclipseKeys.withSource := true

resolvers ++= Seq(
"snapshots" at "http://oss.sonatype.org/content/repositories/snapshots",
"staging" at "http://oss.sonatype.org/content/repositories/staging" ,
"releases" at "http://oss.sonatype.org/content/repositories/releases" ,
"snapshots" at "https://oss.sonatype.org/content/repositories/snapshots",
"staging" at "https://oss.sonatype.org/content/repositories/staging" ,
"releases" at "https://oss.sonatype.org/content/repositories/releases" ,
"Ansvia Releases Repo" at "http://scala.repo.ansvia.com/releases/"
)

seq(webSettings :_*)
enablePlugins(JettyPlugin)

mainClass := Some("RunWebApp")

//unmanagedResourceDirectories in Test <+= (baseDirectory) { _ / "src/main/webapp" }
unmanagedResourceDirectories in Test += (baseDirectory) { _ / "src/main/webapp" }.value

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

libraryDependencies ++= {
val liftVersion = "2.6-M2"
val liftVersion = "2.6"
Seq(
"org.eclipse.jetty" % "jetty-webapp" % "8.1.12.v20130726" % "compile,container,test",
"org.eclipse.jetty.orbit" % "javax.servlet" % "3.0.0.v201112011016" % "compile,container,test" artifacts Artifact("javax.servlet", "jar", "jar"),
"org.scalatest" % "scalatest_2.10" % "2.0.M8" % "test",
"org.mockito" % "mockito-all" % "1.9.5" % "test",
"org.seleniumhq.selenium" % "selenium-java" % "2.35.0" % "test"
"org.scala-lang.modules" %% "scala-xml" % "1.0.6",
"com.ansvia.graph" %% "blueprints-scala" % "0.1.61-20150416-SNAPSHOT",
"com.orientechnologies" % "orientdb-core" % "1.6.3",
"com.orientechnologies" % "orient-commons" % "1.6.3",
"com.orientechnologies" % "orientdb-client" % "1.6.3",
"net.liftweb" %% "lift-webkit" % liftVersion % "compile" withSources(),
"org.eclipse.jetty.orbit" % "javax.servlet" % "3.0.0.v201112011016" % "compile,test" artifacts Artifact("javax.servlet", "jar", "jar"),
"org.eclipse.jetty" % "jetty-webapp" % "8.1.12.v20130726" % "compile,test",
"net.liftweb" %% "lift-mapper" % liftVersion % "compile",
"org.scalatest" %% "scalatest" % "2.1.3" % "test",
"org.mockito" % "mockito-all" % "1.9.5" % "test",
"org.seleniumhq.selenium" % "selenium-java" % "2.35.0" % "test"
)
}
Binary file removed lib/activation-1.1.jar
Binary file not shown.
Binary file removed lib/aiml-to-xml_2.10-0.15.3.jar
Binary file not shown.
Binary file added lib/aiml-to-xml_2.11-0.15.3.jar
Binary file not shown.
Binary file removed lib/ansvia-commons-0.0.7.jar
Binary file not shown.
Binary file removed lib/blueprints-core-2.5.0-20131216.163836-23.jar
Binary file not shown.
Binary file removed lib/blueprints-core-2.5.0-SNAPSHOT.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed lib/castor-1.1-codegen.jar
Binary file not shown.
Binary file removed lib/castor-1.1.jar
Binary file not shown.
Binary file removed lib/colt-1.2.0.jar
Binary file not shown.
Binary file removed lib/commons-beanutils-1.7.0.jar
Binary file not shown.
Binary file removed lib/commons-beanutils-core-1.8.0.jar
Binary file not shown.
Binary file removed lib/commons-codec-1.6.jar
Binary file not shown.
Binary file removed lib/commons-collections-3.2.1.jar
Binary file not shown.
Binary file removed lib/commons-configuration-1.6.jar
Binary file not shown.
Binary file removed lib/commons-dbcp-1.4.jar
Binary file not shown.
Binary file removed lib/commons-digester-1.8.jar
Binary file not shown.
Binary file removed lib/commons-fileupload-1.2.2.jar
Binary file not shown.
Binary file removed lib/commons-lang-2.4.jar
Binary file not shown.
Binary file removed lib/commons-logging-1.1.1.jar
Binary file not shown.
Binary file removed lib/commons-pool-1.5.7.jar
Binary file not shown.
Binary file removed lib/concurrent-1.3.4.jar
Binary file not shown.
Binary file removed lib/gnu.getopt-1.0.10.jar
Binary file not shown.
Binary file removed lib/gremlin-java-2.5.0-20131204.001019-6.jar
Binary file not shown.
Binary file removed lib/htmlparser-1.4.jar
Binary file not shown.
Binary file removed lib/jackson-annotations-2.2.2.jar
Binary file not shown.
Binary file removed lib/jackson-core-2.2.2.jar
Binary file not shown.
Binary file removed lib/jackson-databind-2.2.2.jar
Binary file not shown.
Binary file removed lib/jackson-datatype-json-org-2.2.3.jar
Binary file not shown.
Binary file removed lib/jdbcappender.jar
Binary file not shown.
Binary file removed lib/jettison-1.3.3.jar
Binary file not shown.
Binary file removed lib/jna-4.0.0.jar
Binary file not shown.
Binary file removed lib/jna-platform-4.0.0.jar
Binary file not shown.
Binary file removed lib/joda-convert-1.2.jar
Binary file not shown.
Binary file removed lib/joda-time-2.1.jar
Binary file not shown.
Binary file removed lib/js.jar
Binary file not shown.
Binary file removed lib/json-20090211.jar
Binary file not shown.
Binary file removed lib/jstl.jar
Binary file not shown.
Binary file removed lib/lift-actor_2.10-2.6-M2.jar
Binary file not shown.
Binary file removed lib/lift-common_2.10-2.6-M2.jar
Binary file not shown.
Binary file removed lib/lift-db_2.10-2.6-M2.jar
Binary file not shown.
Binary file removed lib/lift-json_2.10-2.6-M2.jar
Binary file not shown.
Binary file removed lib/lift-mapper_2.10-2.6-M2.jar
Binary file not shown.
Binary file removed lib/lift-markdown_2.10-2.6-M2.jar
Binary file not shown.
Binary file removed lib/lift-proto_2.10-2.6-M2.jar
Binary file not shown.
Binary file removed lib/lift-util_2.10-2.6-M2.jar
Binary file not shown.
Binary file removed lib/lift-webkit_2.10-2.6-M2.jar
Binary file not shown.
Binary file removed lib/logback-classic-1.0.6.jar
Binary file not shown.
Binary file removed lib/logback-core-1.0.6.jar
Binary file not shown.
Binary file removed lib/orient-commons-1.6.3.jar
Binary file not shown.
Binary file removed lib/orientdb-client-1.6.3.jar
Binary file not shown.
Binary file removed lib/orientdb-core-1.6.3.jar
Binary file not shown.
Binary file removed lib/orientdb-enterprise-1.6.3.jar
Binary file not shown.
Binary file removed lib/orientdb-nativeos-1.6.3.jar
Binary file not shown.
Binary file removed lib/paranamer-2.4.1.jar
Binary file not shown.
Binary file removed lib/pipes-2.5.0-20131024.235509-5.jar
Binary file not shown.
Binary file removed lib/saxon9he.jar
Binary file not shown.
Binary file removed lib/scala-reflect-2.10.0.jar
Binary file not shown.
Binary file removed lib/slf4j-api-1.7.2.jar
Binary file not shown.
Binary file removed lib/snappy-0.3.jar
Binary file not shown.
Binary file removed lib/standard.jar
Binary file not shown.
Binary file removed lib/stax-api-1.0.1.jar
Binary file not shown.
1 change: 1 addition & 0 deletions project/build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sbt.version=1.1.0
6 changes: 2 additions & 4 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
addSbtPlugin("com.earldouglas" % "xsbt-web-plugin" % "0.4.0")

//Enable the sbt eclipse plugin
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.2.0")
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "5.2.4")

addSbtPlugin("com.earldouglas" % "xsbt-web-plugin" % "4.0.1")
91 changes: 0 additions & 91 deletions src/main/scala/brain/models/Teste2.scala

This file was deleted.

50 changes: 25 additions & 25 deletions src/main/scala/brain/rest/BrainRest.scala
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/**
* Copyright 2013 Israel Freitas ([email protected])
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand Down Expand Up @@ -46,9 +46,9 @@ object ContentToValidade{


object BrainRest extends RestHelper {

def jsonMessage(success:Boolean, msg:String, httpStatus:Int) = JsonResponse((("success"->success) ~ ("msg"->msg)), httpStatus)

serve("rest"/"validate" prefix {
case "memorize" :: Nil JsonPost ContentToValidade(fieldContent) -> _ => {
try{
Expand All @@ -69,15 +69,15 @@ object BrainRest extends RestHelper {
}
}
})

serve("rest"/"chat" prefix{
case message :: Nil JsonGet _ => {
jsonMessage(true, ProgramD.response(message), 200)
}
})

serve("rest"/"knowledges" prefix{

/*
* KNOWLEDGE
*/
Expand All @@ -93,7 +93,7 @@ object BrainRest extends RestHelper {
db.shutdown()
}
}

//TODO change to Post!
case "apply" :: Nil JsonGet _ => {
implicit val db = GraphDb.get
Expand All @@ -109,7 +109,7 @@ object BrainRest extends RestHelper {
db.shutdown()
}
}



case id :: Nil JsonGet _ => {
Expand All @@ -125,7 +125,7 @@ object BrainRest extends RestHelper {
db.shutdown()
}
}

// update
case id :: Nil JsonPut Knowledge(knowledge) -> _ => {
implicit val db = GraphDb.get
Expand All @@ -144,7 +144,7 @@ object BrainRest extends RestHelper {
}

// create
case Nil JsonPost Knowledge(knowledge) -> _ => {
case Nil JsonPost Knowledge(knowledge) -> _ => {
implicit val db = GraphDb.get
try{
val vertex = knowledge.save
Expand All @@ -159,7 +159,7 @@ object BrainRest extends RestHelper {
db.shutdown()
}
}

//requires the id url param
case id :: Nil JsonDelete _ => {
implicit val db = GraphDb.get
Expand All @@ -176,7 +176,7 @@ object BrainRest extends RestHelper {
db.shutdown()
}
}

/*
* TOPICS
*/
Expand All @@ -192,7 +192,7 @@ object BrainRest extends RestHelper {
db.shutdown()
}
}

// update
case knowledgeId :: "topics" :: id :: Nil JsonPut Topic(topic) -> _ => {
implicit val db = GraphDb.get
Expand All @@ -212,7 +212,7 @@ object BrainRest extends RestHelper {
}

// create
case knowledgeId :: "topics" :: Nil JsonPost Topic(topic) -> _ => {
case knowledgeId :: "topics" :: Nil JsonPost Topic(topic) -> _ => {
implicit val db = GraphDb.get
try{
//TODO: retornar 404 caso este knowlege nao tenha esta information
Expand All @@ -228,7 +228,7 @@ object BrainRest extends RestHelper {
db.shutdown()
}
}

//requires the id url param
case knowledgeId :: "topics" :: id :: Nil JsonDelete _ => {
implicit val db = GraphDb.get
Expand All @@ -246,7 +246,7 @@ object BrainRest extends RestHelper {
db.shutdown()
}
}

/*
* TEACHINGS
*/
Expand All @@ -262,14 +262,14 @@ object BrainRest extends RestHelper {
db.shutdown()
}
}

// update
case knowledgeId :: "topics" :: topicId :: "teachings" :: id :: Nil JsonPut Teaching(teaching) -> _ => {
implicit val db = GraphDb.get
try{
//TODO: retornar 404 caso este knowlege nao tenha esta information
teaching.update

teaching : JValue
}
catch{
Expand All @@ -279,9 +279,9 @@ object BrainRest extends RestHelper {
db.shutdown()
}
}

// create
case knowledgeId :: "topics" :: topicId :: "teachings" :: Nil JsonPost Teaching(teaching) -> _ => {
case knowledgeId :: "topics" :: topicId :: "teachings" :: Nil JsonPost Teaching(teaching) -> _ => {
implicit val db = GraphDb.get
try{
//TODO: retornar 404 caso este knowlege nao tenha esta information
Expand All @@ -297,7 +297,7 @@ object BrainRest extends RestHelper {
db.shutdown()
}
}

//requires the id url param
case knowledgeId :: "topics" :: topicId :: "teachings" :: id :: Nil JsonDelete _ => {
implicit val db = GraphDb.get
Expand All @@ -316,5 +316,5 @@ object BrainRest extends RestHelper {
}
}
})
}

}
Loading

0 comments on commit 9dace37

Please sign in to comment.