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
/* | |
* The MIT License (MIT) | |
* | |
* Copyright (c) 2013 Association du Paris Java User Group. | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy of | |
* this software and associated documentation files (the "Software"), to deal in | |
* the Software without restriction, including without limitation the rights to | |
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | |
* the Software, and to permit persons to whom the Software is furnished to do so, |
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
/* | |
* The MIT License (MIT) | |
* | |
* Copyright (c) 2013 Association du Paris Java User Group. | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy of | |
* this software and associated documentation files (the "Software"), to deal in | |
* the Software without restriction, including without limitation the rights to | |
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | |
* the Software, and to permit persons to whom the Software is furnished to do so, |
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
object JournauxRepository { | |
def allWithOperateurs():Seq[(Journal, Operateur, Option[String])] = { | |
DB.withSession { | |
implicit s => | |
val result = for { | |
((journal, operateur), intervenant) <- Journaux leftJoin Operateurs on(_.idOperateur === _.id) leftJoin Intervenants on(_._1.idIntervenant === _.idAgence) | |
} yield (journal,operateur,intervenant.nom.?) | |
result.run | |
} | |
} |
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
package roger | |
import org.scalatest.{FlatSpec, ShouldMatchers} | |
import roger.AggregationOperation.AggregationOperation | |
case class Metric(id: String, aggregationOperation: AggregationOperation) | |
case class Dimension(id: String) | |
object AggregationOperation extends Enumeration { |
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
/** | |
* Loads the specified documentInstance, the current authenticated user is retrieved | |
* to check that it's the document owner. | |
* Play! Framework with latest Scala module. | |
* Nicolas Martignole - 09/08/2011 | |
*/ | |
def loadImage(di:Option[Long]) = { | |
import play.utils.Scala.MayErr._ | |
val result=( |
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
@(contacts:List[(Long,String,String)]) | |
<html> | |
<head> | |
<title>ZenContact - Play! 2 Sample application</title> | |
<link rel="shortcut icon" type="image/png" href="http://www.playframework.org/public/images/favicon.png"> | |
<link rel="stylesheet" type="text/css" media="screen" href="@routes.Assets.at("stylesheets/main.css")"> | |
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Varela+Round|Droid+Sans"> | |
</head> | |
<body> |
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
@(contacts:List[(models.Contact)]) | |
<html> | |
<head> | |
<title>Contact - Play! 2 Sample application</title> | |
</head> | |
<body> | |
Number of contacts in the database: @contacts.length<br/> | |
@for(letter<-("ABCDEFGHIJKLMNOPQRSTUVWXYZ#")) { |
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
val urlBase = "http://localhost:8080" | |
val httpConf = httpConfig.baseURL(urlBase) | |
val headers_1 = Map( | |
"Accept" -> """text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8""", | |
"Accept-Charset" -> """ISO-8859-1,utf-8;q=0.7,*;q=0.3""", | |
"Accept-Encoding" -> """gzip,deflate,sdch""", | |
"Accept-Language" -> """fr-FR,fr;q=0.8,en-US;q=0.6,en;q=0.4""", |
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
package controllers; | |
import models.JobPost; | |
import play.mvc.Controller; | |
import java.util.List; | |
public class DemoPlayground extends Controller { | |
public static void index(){ | |
List<JobPost> jobs=JobPost.find15Latest(); |
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
def getJobsSinceWithPattern(someday: DateTime, msgPattern: String): List[Log] = DB.withConnection{ | |
implicit c=> | |
val sql = SQL("""|SELECT log_date, category, level, message, error, source FROM logs | |
|WHERE log_date >={day} | |
|AND message like {msg} | |
""".stripMargin) | |
.on("day" -> someday.toString("yyyy-MM-dd")).on("msg" -> msgPattern) | |
val listParsed=sql.as(date("log_date") ~ str("category") ~ str("level") ~ str("message") ~ get[Option[String]]("error") ~ str("source") map flatten *) |
OlderNewer