This repository has been archived by the owner on Feb 22, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
467 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
<classpath> | ||
<classpathentry kind="src" path="app" output=".target"/> | ||
<classpathentry kind="src" path="test" output=".target"/> | ||
<classpathentry path="/home/fb/workspace-play/play2-mongodb-filmes/target/scala-2.10/classes_managed" kind="lib"></classpathentry> | ||
<classpathentry kind="lib" path="/home/fb/play/framework/../repository/cache/net.vz.mongodb.jackson/play-mongo-jackson-mapper_2.10/jars/play-mongo-jackson-mapper_2.10-1.1.0.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/framework/../repository/cache/net.vz.mongodb.jackson/mongo-jackson-mapper/jars/mongo-jackson-mapper-1.4.1.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/framework/../repository/cache/org.mongodb/mongo-java-driver/jars/mongo-java-driver-2.7.2.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/framework/../repository/cache/org.codehaus.jackson/jackson-mapper-asl/jars/jackson-mapper-asl-1.9.5.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/framework/../repository/cache/org.codehaus.jackson/jackson-core-asl/jars/jackson-core-asl-1.9.5.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/framework/../repository/cache/de.undercouch/bson4jackson/jars/bson4jackson-1.3.0.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/framework/../repository/cache/javax.persistence/persistence-api/jars/persistence-api-1.0.2.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/com.typesafe.play/play_2.10/2.2.1/jars/play_2.10.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/com.typesafe.play/sbt-link/2.2.1/jars/sbt-link.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/org.javassist/javassist/3.18.0-GA/bundles/javassist.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/com.typesafe.play/play-exceptions/2.2.1/jars/play-exceptions.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/com.typesafe.play/templates_2.10/2.2.1/jars/templates_2.10.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/com.github.scala-incubator.io/scala-io-file_2.10/0.4.2/jars/scala-io-file_2.10.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/com.github.scala-incubator.io/scala-io-core_2.10/0.4.2/jars/scala-io-core_2.10.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/com.jsuereth/scala-arm_2.10/1.3/jars/scala-arm_2.10.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/com.typesafe.play/play-iteratees_2.10/2.2.1/jars/play-iteratees_2.10.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/org.scala-stm/scala-stm_2.10/0.7/jars/scala-stm_2.10.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/com.typesafe/config/1.0.2/bundles/config.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/com.typesafe.play/play-json_2.10/2.2.1/jars/play-json_2.10.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/com.typesafe.play/play-functional_2.10/2.2.1/jars/play-functional_2.10.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/com.typesafe.play/play-datacommons_2.10/2.2.1/jars/play-datacommons_2.10.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/joda-time/joda-time/2.2/jars/joda-time.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/org.joda/joda-convert/1.3.1/jars/joda-convert.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/com.fasterxml.jackson.core/jackson-annotations/2.2.2/jars/jackson-annotations.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/com.fasterxml.jackson.core/jackson-core/2.2.2/jars/jackson-core.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/com.fasterxml.jackson.core/jackson-databind/2.2.2/jars/jackson-databind.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/io.netty/netty/3.7.0.Final/bundles/netty.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/com.typesafe.netty/netty-http-pipelining/1.1.2/jars/netty-http-pipelining.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/org.slf4j/slf4j-api/1.7.5/jars/slf4j-api.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/org.slf4j/jul-to-slf4j/1.7.5/jars/jul-to-slf4j.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/org.slf4j/jcl-over-slf4j/1.7.5/jars/jcl-over-slf4j.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/ch.qos.logback/logback-core/1.0.13/jars/logback-core.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/ch.qos.logback/logback-classic/1.0.13/jars/logback-classic.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/com.typesafe.akka/akka-actor_2.10/2.2.0/jars/akka-actor_2.10.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/com.typesafe.akka/akka-slf4j_2.10/2.2.0/bundles/akka-slf4j_2.10.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/org.apache.commons/commons-lang3/3.1/jars/commons-lang3.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/com.ning/async-http-client/1.7.18/jars/async-http-client.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/oauth.signpost/signpost-core/1.2.1.2/jars/signpost-core.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/oauth.signpost/signpost-commonshttp4/1.2.1.2/jars/signpost-commonshttp4.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/commons-logging/commons-logging/1.1.1/jars/commons-logging.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/xerces/xercesImpl/2.11.0/jars/xercesImpl.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/xml-apis/xml-apis/1.4.01/jars/xml-apis.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/javax.transaction/jta/1.1/jars/jta.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/com.typesafe.play/play-java_2.10/2.2.1/jars/play-java_2.10.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/org.yaml/snakeyaml/1.12/bundles/snakeyaml.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/org.hibernate/hibernate-validator/5.0.1.Final/jars/hibernate-validator.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/javax.validation/validation-api/1.1.0.Final/jars/validation-api.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/org.jboss.logging/jboss-logging/3.1.1.GA/jars/jboss-logging.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/com.fasterxml/classmate/0.8.0/bundles/classmate.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/org.springframework/spring-context/3.2.3.RELEASE/jars/spring-context.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/org.springframework/spring-core/3.2.3.RELEASE/jars/spring-core.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/org.springframework/spring-beans/3.2.3.RELEASE/jars/spring-beans.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/org.reflections/reflections/0.9.8/jars/reflections.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/com.google.guava/guava/14.0.1/bundles/guava.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/com.google.code.findbugs/jsr305/2.0.1/jars/jsr305.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/javax.servlet/javax.servlet-api/3.0.1/jars/javax.servlet-api.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/com.typesafe.play/play-test_2.10/2.2.1/jars/play-test_2.10.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/junit/junit/4.11/jars/junit.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/org.hamcrest/hamcrest-core/1.3/jars/hamcrest-core.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/org.specs2/specs2_2.10/2.1.1/jars/specs2_2.10.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/org.scalaz/scalaz-core_2.10/7.0.2/bundles/scalaz-core_2.10.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/org.scalaz/scalaz-concurrent_2.10/7.0.2/bundles/scalaz-concurrent_2.10.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/org.scalaz/scalaz-effect_2.10/7.0.2/bundles/scalaz-effect_2.10.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/com.novocode/junit-interface/0.10/jars/junit-interface.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/org.scala-tools.testing/test-interface/0.5/jars/test-interface.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/org.fluentlenium/fluentlenium-festassert/0.8.0/jars/fluentlenium-festassert.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/org.fluentlenium/fluentlenium-core/0.8.0/jars/fluentlenium-core.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/org.seleniumhq.selenium/selenium-java/2.32.0/jars/selenium-java.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/org.seleniumhq.selenium/selenium-android-driver/2.32.0/jars/selenium-android-driver.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/org.seleniumhq.selenium/selenium-remote-driver/2.32.0/jars/selenium-remote-driver.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/cglib/cglib-nodep/2.1_3/jars/cglib-nodep.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/org.json/json/20080701/jars/json.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/org.seleniumhq.selenium/selenium-api/2.32.0/jars/selenium-api.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/org.apache.httpcomponents/httpclient/4.2.1/jars/httpclient.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/org.apache.httpcomponents/httpcore/4.2.1/jars/httpcore.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/commons-codec/commons-codec/1.6/jars/commons-codec.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/org.apache.commons/commons-exec/1.1/jars/commons-exec.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/net.java.dev.jna/jna/3.4.0/jars/jna.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/net.java.dev.jna/platform/3.4.0/jars/platform.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/org.seleniumhq.selenium/selenium-chrome-driver/2.32.0/jars/selenium-chrome-driver.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/org.seleniumhq.selenium/selenium-htmlunit-driver/2.32.0/jars/selenium-htmlunit-driver.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/net.sourceforge.htmlunit/htmlunit/2.12/jars/htmlunit.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/xalan/xalan/2.7.1/jars/xalan.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/xalan/serializer/2.7.1/jars/serializer.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/commons-collections/commons-collections/3.2.1/jars/commons-collections.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/org.apache.httpcomponents/httpmime/4.2.3/jars/httpmime.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/net.sourceforge.htmlunit/htmlunit-core-js/2.12/jars/htmlunit-core-js.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/net.sourceforge.nekohtml/nekohtml/1.9.18/jars/nekohtml.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/net.sourceforge.cssparser/cssparser/0.9.9/jars/cssparser.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/org.w3c.css/sac/1.3/jars/sac.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/commons-io/commons-io/2.2/jars/commons-io.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/org.eclipse.jetty/jetty-websocket/8.1.9.v20130131/jars/jetty-websocket.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/org.eclipse.jetty/jetty-util/8.1.9.v20130131/jars/jetty-util.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/org.eclipse.jetty/jetty-io/8.1.9.v20130131/jars/jetty-io.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/org.eclipse.jetty/jetty-http/8.1.9.v20130131/jars/jetty-http.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/org.seleniumhq.selenium/selenium-firefox-driver/2.32.0/jars/selenium-firefox-driver.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/org.seleniumhq.selenium/selenium-ie-driver/2.32.0/jars/selenium-ie-driver.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/org.seleniumhq.selenium/selenium-iphone-driver/2.32.0/jars/selenium-iphone-driver.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/org.seleniumhq.selenium/selenium-safari-driver/2.32.0/jars/selenium-safari-driver.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/org.webbitserver/webbit/0.4.14/jars/webbit.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/org.seleniumhq.selenium/selenium-support/2.32.0/jars/selenium-support.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/org.easytesting/fest-assert/1.4/jars/fest-assert.jar"/> | ||
<classpathentry kind="lib" path="/home/fb/play/repository/local/org.easytesting/fest-util/1.1.6/jars/fest-util.jar"/> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> | ||
<classpathentry kind="output" path="bin"/> | ||
<classpathentry path="/home/fb/play/framework/sbt/boot/scala-2.10.2/lib/scala-library.jar" kind="lib"></classpathentry> | ||
</classpath> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,6 @@ | |
*.jar | ||
*.war | ||
*.ear | ||
target/* | ||
logs/* | ||
/.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<projectDescription> | ||
<name>play-mongodb-filmes</name> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.jdt.core.javabuilder</name> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
</natures> | ||
<linkedResources> </linkedResources> | ||
</projectDescription> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
eclipse.preferences.version=1 | ||
encoding/<project>=UTF-8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#Generated by sbt-plugin | ||
#Wed Mar 12 01:25:43 BRT 2014 | ||
eclipse.preferences.version=1 | ||
templateImports=import play.api.templates._\nimport play.api.templates.PlayMagic._\nimport models._\nimport controllers._\nimport java.lang._\nimport java.util._\nimport scala.collection.JavaConversions._\nimport scala.collection.JavaConverters._\nimport play.api.i18n._\nimport play.core.j.PlayMagicForJava._\nimport play.mvc._\nimport play.data._\nimport play.api.data.Field\nimport play.mvc.Http.Context.Implicit._\nimport views.%format%._\n |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#Generated by sbteclipse | ||
#Wed Mar 12 01:25:43 BRT 2014 | ||
scala.compiler.additionalParams=-encoding utf8 | ||
deprecation=true | ||
unchecked=true | ||
scala.compiler.useProjectSettings=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,41 @@ | ||
play2-mondodb | ||
============= | ||
Play! com MongoDB - Filmes cult | ||
===================================== | ||
|
||
Setup do Play: | ||
|
||
Execute do diretório do projeto: | ||
|
||
play run | ||
|
||
|
||
Setup do MongoDB: | ||
|
||
|
||
Execute do diretório do projeto: | ||
|
||
|
||
mongo < mongodb/mondodb-comandos.txt | ||
|
||
Resultado esperado: | ||
|
||
MongoDB shell version: 2.4.9 | ||
connecting to: test | ||
switched to db boaglio | ||
true | ||
98 | ||
bye | ||
|
||
Um teste para exibir um registro: | ||
|
||
> db.filmes.findOne(); | ||
{ | ||
"_id" : ObjectId("531f9d490612421e5c4847d3"), | ||
"nome" : "Psicose", | ||
"tipo" : "Feature Film", | ||
"ano" : 1960, | ||
"nota" : 8.6, | ||
"duracao" : 109, | ||
"url" : "http://www.imdb.com/title/tt0054215/", | ||
"diretor" : "Alfred Hitchcock" | ||
} | ||
|
||
Play 2 com MongoDB |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package controllers; | ||
|
||
import models.Filme; | ||
import play.mvc.Controller; | ||
import play.mvc.Result; | ||
|
||
public class Application extends Controller { | ||
|
||
public static Result index() { | ||
return ok(views.html.index.render(Filme.all())); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package models; | ||
|
||
public class Diretor { | ||
|
||
public Diretor(String nome) { | ||
super(); | ||
this.nome = nome; | ||
} | ||
|
||
public String nome; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package models; | ||
|
||
import java.util.List; | ||
|
||
import net.vz.mongodb.jackson.Id; | ||
import net.vz.mongodb.jackson.JacksonDBCollection; | ||
import net.vz.mongodb.jackson.ObjectId; | ||
import play.modules.mongodb.jackson.MongoDB; | ||
|
||
public class Filme { | ||
|
||
@Id | ||
@ObjectId | ||
public String id; | ||
|
||
public String nome; | ||
|
||
public String tipo; | ||
|
||
public Double nota; | ||
|
||
public Integer duracao; | ||
|
||
public Integer ano; | ||
|
||
public String genero; | ||
|
||
public Integer votos; | ||
|
||
public String url; | ||
|
||
public Diretor diretor; | ||
|
||
public static List<Filme> all() { | ||
return Filme.coll.find().toArray(); | ||
} | ||
|
||
private static JacksonDBCollection<Filme,String> coll = MongoDB.getCollection("filmes",Filme.class,String.class); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
@(filmes: List[Filme]) | ||
|
||
@import helper._ | ||
|
||
@main("Filmes Cult") { | ||
|
||
<div> | ||
<h1> | ||
<img src="@routes.Assets.at("images/play-logo.png")" alt="Play!"/> | ||
Filmes Cult | ||
<img src="@routes.Assets.at("images/PoweredMongoDB.png")" alt="MongoDB"/> | ||
</h1> | ||
<ul> | ||
@for(filme <- filmes) { | ||
<li> | ||
<a href="@filme.url">(@filme.ano) @filme.nome - dirigido por @filme.diretor.nome</a> | ||
</li> | ||
} | ||
</ul> | ||
<h2>@filmes.size() filmes</h2> | ||
</div> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
@(title: String)(content: Html) | ||
|
||
<!DOCTYPE html> | ||
|
||
<html> | ||
<head> | ||
<title>@title</title> | ||
<link rel="stylesheet" media="screen" href="@routes.Assets.at("stylesheets/main.css")"> | ||
<link rel="shortcut icon" type="image/png" href="@routes.Assets.at("images/favicon.png")"> | ||
<script src="@routes.Assets.at("javascripts/jquery-1.9.0.min.js")" type="text/javascript"></script> | ||
</head> | ||
<body> | ||
@content | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
name := "play-mongodb-filmes" | ||
|
||
version := "1.0-SNAPSHOT" | ||
|
||
libraryDependencies ++= Seq( | ||
"net.vz.mongodb.jackson" %% "play-mongo-jackson-mapper" % "1.1.0" | ||
) | ||
|
||
play.Project.playJavaSettings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Play ! | ||
# ~~~~~ | ||
application.secret="w=tlhqEBrn7PJDXU:gE<<PIoqfIyiNIq]foo4L]g?0Hq^`1]ZT7:9Zj2WWIyNjVN" | ||
application.langs="en" | ||
|
||
# Database configuration | ||
mongodb.servers="127.0.0.1:27017" | ||
mongodb.database="boaglio" | ||
|
||
# Root logger: | ||
logger.root=ERROR | ||
logger.play=INFO | ||
logger.application=DEBUG |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Routes | ||
# This file defines all application routes (Higher priority routes first) | ||
# ~~~~ | ||
|
||
# Home page | ||
GET / controllers.Application.index() | ||
|
||
# Map static resources from the /public folder to the /assets URL path | ||
GET /assets/*file controllers.Assets.at(path="/public", file) |
Oops, something went wrong.