[2.0-scala] Open source projects based on play framework in scala

1,877 views
Skip to first unread message

JuDe

unread,
May 22, 2012, 7:13:52 PM5/22/12
to play-fr...@googlegroups.com
Hello everybody,

Essentially for learning purpose, do you know some open source projects based on the play framework and written in scala ? I searched in github, google code,... where I found projects in java but not in scala.

The samples provided with the framework are very useful! But they cannot cover everything unfortunately. 

For example, I have a little issue for which I still haven't found a solution (neither in the samples nor here in the google group): I can't bind a boolean property within a model case class with a checkbox form field in the view. I mean the case class, the controller and the views compile and work well together for "text" fields but not for the boolean one (which has to be saved into the database, it's not a dummy "checked" terms and conditions).

Thank you in advance for posting a response if you know some open source projects powered up by play! and written in scala and/or the solution to the above example. I guess this one is probably easy (like often...) so sorry but when you're stuck, well... you're stuck! ;-)


sun

unread,
May 23, 2012, 9:32:43 AM5/23/12
to play-framework
It works for me.

case class ModelClass(var/val abcColor: Boolean = true)

var searchForm = Form(
mapping(
"abcColor" -> boolean,
)(ModelClass.apply)(ModelClass.unapply))

def myAction() = Action { implicit request =>
searchForm.bindFromRequest.fold(
formWithErrors => { ... },
model => { // model is an instance of model class with abcColor
set
}
)
}

JuDe

unread,
May 23, 2012, 5:24:25 PM5/23/12
to play-fr...@googlegroups.com
Thank you.

I think my problem is in the view side. Can somebody please end the sample with a little code snippet in the view ?

@helper.checkbox(searchForm("abcColor")) should be enough or something needs to be added ? 
Even if the boolean property in the case class is true, the html code for the checkbox doesn't have "checked" although I see value="true" (if I read well, following the play\src\main\scala\views\helper\checkbox.scala.html if value is different from "", the "checked" is written into the html tag). 

In plus, whatever the checkbox is ticked or not, the value saved in the database is false.

Thanks in advance.

JuDe

unread,
May 23, 2012, 5:38:20 PM5/23/12
to play-fr...@googlegroups.com
Sorry, it is solved.
I got a bit confused to correctly name the form field in the view because of nested mapping in the form (controller)...
Shame on me.
Big thanks anyway!

JuDe

unread,
May 23, 2012, 5:49:34 PM5/23/12
to play-fr...@googlegroups.com
About the open source scala projects in Play!, if somebody has links, I'm still interested... ;-)
And I guess many newbies too... ^^

biesior

unread,
May 23, 2012, 6:20:11 PM5/23/12
to play-fr...@googlegroups.com
C'mon :) Play 2 is quite new kid on the block, don't expect tons of OS projects done with it.. yet...
It's our job (my, your, everebody's) to prove its strange.

Of course you can follow Pere Villega's http://www.playmodules.net/ service to check newest samples and modules, however keep in mind it's now OUR time for Play! :)

JuDe

unread,
May 23, 2012, 7:16:34 PM5/23/12
to play-fr...@googlegroups.com
Am I well hearing the war drum among the JVM based web frameworks...? :-D

You're right, Play 2 is quite new. But the scala module existed for a bit more time so I hope that some scala based projects are working well enough and may possibly serve for learning purpose.

Thanks for the link! The source code of Pere Villega's website itself is very interesting to illustrate some mechanisms. 

JuDe

unread,
May 24, 2012, 5:48:11 AM5/24/12
to play-fr...@googlegroups.com
For those interested, thanks to jcranky we can add https://github.com/jcranky/lojinha

Just a little suggestion : would it be a stupid idea to add a link in the "Community links" (http://www.playframework.org/community) which leads to a new page where we could find all (or at least many) open source play! projects (with filters for the language java or scala and the framework version) ?

This way, it would be easier to find what's already existing in the play! world.
It could be useful for learning purpose, general inspiration and promotion of the play! framework.
And since the version 2 has just been released, we can apply good practices immediatly.

What do you think about that simple idea ?

Pere Villega

unread,
May 24, 2012, 6:12:46 AM5/24/12
to play-fr...@googlegroups.com
Shameless plug: http://www.playmodules.net  < it may help, go to demos section

JuDe

unread,
May 24, 2012, 9:17:48 AM5/24/12
to play-fr...@googlegroups.com
"We are our own best advocates", as the saying goes... ;-)
Biesior was already your advocate a bit earlier in the thread. What a play guru! ^^
In fact, I was more looking in a whole project than modules. So in this matter, the source code of your website itself is very interesting to have one more example of an entire application based on play!.
Thank you!

JuDe

unread,
May 25, 2012, 10:42:28 AM5/25/12
to play-fr...@googlegroups.com
These last days are interesting about "birth" of open source play! scala projects! ^^
Thanks to Aishwarya Singhal with https://github.com/asinghal/factile
Let's try to gather links to play! open source projects in one place.

Manuel Bernhardt

unread,
May 26, 2012, 11:27:39 AM5/26/12
to play-fr...@googlegroups.com
You could check http://github.com/delving/culture-hub - it grew from
Play 1 + Scala module to Play 2

Mind you though that we're not using the scala templates.

Manuel
> --
> You received this message because you are subscribed to the Google Groups
> "play-framework" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/play-framework/-/h6B4sC56rgUJ.
>
> To post to this group, send email to play-fr...@googlegroups.com.
> To unsubscribe from this group, send email to
> play-framewor...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/play-framework?hl=en.

JuDe

unread,
May 28, 2012, 5:28:49 PM5/28/12
to play-fr...@googlegroups.com
Wow, it seems to be quite a big project... Thanks!

Paulo "JCranky" Siqueira

unread,
Jun 1, 2012, 4:15:43 PM6/1/12
to play-fr...@googlegroups.com

I just saw this thread. Thank you JuDe for mentioning my pet project at http://github.com/jcranky/lojinha

I'm basically trying different stuff in there, and any feedback is very much appreciated  :-)

[]s,

Paulo "JCranky" Siqueira
http://jcranky.com

Em 28/05/2012 18:28, "JuDe" <ju.d...@gmail.com> escreveu:
Wow, it seems to be quite a big project... Thanks!

--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To view this discussion on the web visit https://groups.google.com/d/msg/play-framework/-/VFgV-54ANicJ.

James Roper

unread,
Jun 2, 2012, 3:40:43 AM6/2/12
to play-fr...@googlegroups.com
I've often wondered about using the Play framework from an open source project.  Paulo, do you change the application secret when you deploy the app?  Right now, it's checked in to GitHub for the whole world to see, which completely compromises play sessions (so for example, if you stored the currently logged in user in the session scope, then anyone, using that secret, could log themselves in as any user).

Does play have any features currently that let open source projects easily write an installer of some sort, to generate a new application secret?

On Friday, 1 June 2012 22:15:43 UTC+2, JCranky wrote:

I just saw this thread. Thank you JuDe for mentioning my pet project at http://github.com/jcranky/lojinha

I'm basically trying different stuff in there, and any feedback is very much appreciated  :-)

[]s,

Paulo "JCranky" Siqueira
http://jcranky.com

Em 28/05/2012 18:28, "JuDe" <ju.d...@gmail.com> escreveu:
Wow, it seems to be quite a big project... Thanks!

--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To view this discussion on the web visit https://groups.google.com/d/msg/play-framework/-/VFgV-54ANicJ.
To post to this group, send email to play-framework@googlegroups.com.
To unsubscribe from this group, send email to play-framework+unsubscribe@googlegroups.com.

Paulo "JCranky" Siqueira

unread,
Jun 2, 2012, 8:51:18 AM6/2/12
to play-fr...@googlegroups.com

Good point, I don't, because this isn't in production yet. I guess a good strategy would be to add an external config file with a new secret, and make Git ignore this file. This is btw what I'm doing with AWS credentials.

[]s,

Paulo "JCranky" Siqueira
http://jcranky.com

To view this discussion on the web visit https://groups.google.com/d/msg/play-framework/-/ASVo5S_s848J.
To post to this group, send email to play-fr...@googlegroups.com.
To unsubscribe from this group, send email to play-framewor...@googlegroups.com.

JuDe

unread,
Jun 2, 2012, 3:25:08 PM6/2/12
to play-fr...@googlegroups.com
You're welcome Paulo! 

For various reasons (mainly learning purpose but also inspiration and play! promotion), I find interesting for everybody to know what are the open source projects powered by the play framework. I hope that the idea will have echoes into the boss team ears to add a dedicated page on the play website in the community section (with filtering option about language, version, author,...). It would be more appropriate than a thread in the google group (meanwhile we could perhaps get it sticky?).
But for now, to make easier finding a play! open source project, I cheer on authors or more generally anybody knowing such a project to post the announcement in this nice and centralized thread. ;-)

Thanks!

JuDe

unread,
Jun 8, 2012, 3:21:00 PM6/8/12
to play-fr...@googlegroups.com
Thanks to Ornicar, a chess game : https://github.com/ornicar/lila

Reply all
Reply to author
Forward
0 new messages