playframework-2.0

Integrate SecureSocial with backend user services/storages?

爱⌒轻易说出口 提交于 2019-12-24 00:37:13
问题 Using Play! 2.0.4 and SecureSocial 2 (http://securesocial.ws/). Scala implementation. Most of this question will be directly referencing the sample here: https://github.com/jaliss/securesocial/blob/2.0.12/samples/scala/demo/app/service/InMemoryUserService.scala I'm trying to figure out the author's original intention as to backend interaction with a storage service. With respect to the def find(id: UserId) and the def findByEmailAndProvider(email: String, providerId: String): methods, is

HttpClient uploading MultipartFormData to play 2 framework

我与影子孤独终老i 提交于 2019-12-23 20:03:28
问题 I have the following code in a Windows Phone 8 project that uses RestSharp client: public async Task<string> DoMultiPartPostRequest(String ext, JSonWriter jsonObject, ObservableCollection<Attachment> attachments) { var client = new RestClient(DefaultUri); // client.Authenticator = new HttpBasicAuthenticator(username, password); var request = new RestRequest(ext, Method.POST); request.RequestFormat = DataFormat.Json; request.AddParameter("json", jsonObject.ToString(), ParameterType.GetOrPost);

Play framework 2.0.x AskTimeoutException

淺唱寂寞╮ 提交于 2019-12-23 19:07:28
问题 I'm trying to do some load testing on my Play 2.0.2 app, but I keep running into the following exception: Cannot invoke the action, eventually got an error: Thrown(akka.pattern.AskTimeoutException: Timed out) I'm using http://blitz.io/ to do my load testing. My tech stack is Play + mysql. I'm not using any promises in my app. Here's the customized akka configuration: #default timeout for promises promise.akka.actor.typed.timeout=10s play { akka { event-handlers = ["akka.event.slf4j

How to use Oracle stored procedures with Scala Anorm in Playframework

江枫思渺然 提交于 2019-12-23 18:45:47
问题 I have many stored procedures which have Lists of Strings as result How can i access the refcurser in the play 2.0 Framework with scala? Can someone make a simple example how i can fill a list? I tried this: case class XXXX(name: String, description: String) object XXXX{ val simple = { get[String]("name") ~ get[String]("description") map { case name~description => XXXX(name, description) } } def all(): List[XXXX] = DB.withConnection { implicit c => SQL("""exec PROCEDURE""").as(XXXX.simple *)

Weird spurious errors during compilation of Play / Activator program?

谁都会走 提交于 2019-12-23 17:11:07
问题 I have a large and moderately complex web application, using the standard Typesafe Stack of Play, Scala and Akka. (I'm in the process of adding scala.js, but this problem predates that.) A couple of months ago, I upgraded to the current Activator-based version of the world (having fallen behind the times), and that's mostly worked fine. But ever since then, I am semi-frequently getting a weird error when I try to compile: [Querki] $ compile [trace] Stack trace suppressed: run last scalajvm

How to set up multi-module build with reference to external local sbt project?

牧云@^-^@ 提交于 2019-12-23 17:01:36
问题 I just started with Scala and Play and I'm trying to set up a multi build with sbt 0.13.5 My project structure is the following: /AnormCypher -> /src ->/main ->/scala ->org.anormcypher[package] ->[Some classes] -> [other dirs/files] -> build.sbt /sample -> /src ->/main ->/scala ->/controllers[package] ->Application.scala ->[Some classes] -> [other dirs/files] -> build.sbt The sample project depends on the AnormCypher project. I tried to set up the dependency following this SO post. My build

Play framework 2.0 evolutions and create trigger

本秂侑毒 提交于 2019-12-23 16:09:27
问题 I have been trying to get this trigger created using Play 2.0.3. It runs perfectly fine in MySQL if I run it manually, but it fails when trying to run it from Play. delimiter | create trigger company_updated before update on company for each row begin set new.updated = CURRENT_TIMESTAMP; end; | delimiter ; The error it throws is this: We got the following error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use

Why am I Failing to combine Enumerators in SimpleResult body?

老子叫甜甜 提交于 2019-12-23 12:54:23
问题 Im trying to achieve something similar to the first example under "Sending large amounts of data" at http://www.playframework.org/documentation/2.0/ScalaStream. What I am doing differently is that I have more than one file that I want to concatenate in the response. It looks like this: def index = Action { val file1 = new java.io.File("/tmp/fileToServe1.pdf") val fileContent1: Enumerator[Array[Byte]] = Enumerator.fromFile(file1) val file2 = new java.io.File("/tmp/fileToServe2.pdf") val

Cannot find sbt launcher 0.11.2

痴心易碎 提交于 2019-12-23 12:45:35
问题 I have a Play 2.0 app that uses sbt 0.11.2 . However when I set up a new Play server, it grabbed the latest version of sbt 0.11.3 . Now when I run sbt compile on the new server, it complains Detected sbt version 0.11.2 Cannot find sbt launcher 0.11.2 Please download: /sbt-launch.jartypesafe.artifactoryonline.com/typesafe/ivy-releases/org.scala-tools.sbt/sbt-launch/0.11.2 /sbt-launch.jarc2-user/.sbt/.lib/0.11.2 I tried downloading sbt-launch 0.11.2 and putting in the same folder as sbt but

How to access SBT settings from Java code in PlayFramework?

孤人 提交于 2019-12-23 12:23:59
问题 I have a PlayFramework application, and there is a name and version in the build.sbt . If I run the play console, I can access this information by typing name or version . How can I get this information from Java code inside the application? I can't seem to find any useful methods in Play.application() and I have not been able to find this in the documentation. 回答1: For this you can use the SBT plugin BuildInfo: Add to project/plugins.sbt: addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.2