Skip to content
This repository has been archived by the owner on Feb 27, 2021. It is now read-only.

Commit

Permalink
Added Anorm(original) and ScalikeJDBC version
Browse files Browse the repository at this point in the history
  • Loading branch information
seratch committed Jul 26, 2012
1 parent ac7d442 commit c0bef1b
Show file tree
Hide file tree
Showing 107 changed files with 5,560 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .gitignore
@@ -0,0 +1,57 @@
.settings
.classpath
.project
*.iml
*.ipr
*.iws
dist/
lib_managed/
project/boot/
project/plugins/project/
target/

# use glob syntax.
syntax: glob
*.ser
*.class
*~
*.bak
#*.off
*.old

# eclipse conf file
.settings
.classpath
.project
.manager
.scala_dependencies

# idea
.idea
*.iml

# building
target
build
null
tmp*
temp*
dist
test-output
build.log

# other scm
.svn
.CVS
.hg*

# switch to regexp syntax.
# syntax: regexp
# ^\.pc/

#SHITTY output not in target directory
build.log
.DS_Store
derby.log

db
5 changes: 5 additions & 0 deletions anorm/README
@@ -0,0 +1,5 @@
This advanced todo list demonstrates a modern AJAX-based web application. This is a work in progress, and we plan to add several features in the future releases. For now you can check it out to learn how to:

- Integrate authentication, and security.
- Use AJAX and the Javascript reverse routing.
- Integrate with compiled assets - LESS CSS and CoffeeScript.
62 changes: 62 additions & 0 deletions anorm/app/Global.scala
@@ -0,0 +1,62 @@
import play.api._

import models._
import anorm._

object Global extends GlobalSettings {

override def onStart(app: Application) {
InitialData.insert()
}

}

/**
* Initial set of data to be imported
* in the sample application.
*/
object InitialData {

def date(str: String) = new java.text.SimpleDateFormat("yyyy-MM-dd").parse(str)

def insert() = {

if(User.findAll.isEmpty) {

Seq(
User("guillaume@sample.com", "Guillaume Bort", "secret"),
User("maxime@sample.com", "Maxime Dantec", "secret"),
User("sadek@sample.com", "Sadek Drobi", "secret"),
User("erwan@sample.com", "Erwan Loisant", "secret")
).foreach(User.create)

Seq(
Project(Id(1), "Play framework", "Play 2.0") -> Seq("guillaume@sample.com", "maxime@sample.com", "sadek@sample.com", "erwan@sample.com"),
Project(Id(2), "Play framework", "Play 1.2.4") -> Seq("guillaume@sample.com", "erwan@sample.com"),
Project(Id(3), "Play framework", "Website") -> Seq("guillaume@sample.com", "maxime@sample.com"),
Project(Id(4), "Zenexity", "Secret project") -> Seq("guillaume@sample.com", "maxime@sample.com", "sadek@sample.com", "erwan@sample.com"),
Project(Id(5), "Zenexity", "Playmate") -> Seq("maxime@sample.com"),
Project(Id(6), "Personal", "Things to do") -> Seq("guillaume@sample.com"),
Project(Id(7), "Zenexity", "Play samples") -> Seq("guillaume@sample.com", "maxime@sample.com"),
Project(Id(8), "Personal", "Private") -> Seq("maxime@sample.com"),
Project(Id(9), "Personal", "Private") -> Seq("guillaume@sample.com"),
Project(Id(10), "Personal", "Private") -> Seq("erwan@sample.com"),
Project(Id(11), "Personal", "Private") -> Seq("sadek@sample.com")
).foreach {
case (project,members) => Project.create(project, members)
}

Seq(
Task(NotAssigned, "Todo", 1, "Fix the documentation", false, None, Some("guillaume@sample.com")),
Task(NotAssigned, "Urgent", 1, "Prepare the beta release", false, Some(date("2011-11-15")), None),
Task(NotAssigned, "Todo", 9, "Buy some milk", false, None, None),
Task(NotAssigned, "Todo", 2, "Check 1.2.4-RC2", false, Some(date("2011-11-18")), Some("guillaume@sample.com")),
Task(NotAssigned, "Todo", 7, "Finish zentask integration", true, Some(date("2011-11-15")), Some("maxime@sample.com")),
Task(NotAssigned, "Todo", 4, "Release the secret project", false, Some(date("2012-01-01")), Some("sadek@sample.com"))
).foreach(Task.create)

}

}

}

0 comments on commit c0bef1b

Please sign in to comment.