Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Body parsers and ActionBuilder #84

Closed
jmparsons opened this Issue · 12 comments

8 participants

@jmparsons

I don't know if this is already on the roadmap, but if DBAction extended ActionBuilder to take in body parsers and have async would be really nice.

I have a play-slick example app using backbone and json calls, so my crud uses body parsers to validate against.

https://github.com/jmparsons/play-scala-backbone-todo

DBAction(parser.json) etc.

@diwa

+1 one for this. I am facing similar issue is using DBAction with multipart formdata which needs DBAction(parse.multipartFormData)

The idiomatic play 2.2 way would be to implement DBAction as a composable ActionBuilder so that we can chain other actions easily.
http://www.playframework.com/documentation/2.2.0-RC1/ScalaActionsComposition

@freekh

Yep makes sense ... Will fix

@freekh

As decided in the other threads you can now use body parsers as of 0.5.0.4.
It is not a ActionBuilder, since it was clunky.

@freekh freekh closed this
@DCKcode

@freekh ActionBuilder is Play's recommended way to perform action composition. If the Play Slick plugin is to be integrated in Play 2.3, I do think that this plugin should provide a specialized DatabaseActionBuilder that works with a DBSessionRequest so that users of this pluging can create further specialized custom Actions using it.

The reason I'm asking this is that we want to replace our homemade basic support for Slick-enabled actions with this plugin. We can't however use this plugin's far more sophisticated DBAction functionality without dropping the recommended way to build actions and breaking everything again. We refactored all our code to use this "The Play 2.2 Way" of doing action composition; while I agree it's kind of clunky to write custom actions in this way, it does make actually using those actions in controller code cleaner and more powerful.

Could you please leave this issue open until this plugin provides its own ActionBuilder?

@cvogt cvogt reopened this
@cvogt
Collaborator

Reopening this as there seems to be room for improvement

@cvogt
Collaborator

@DCKcode Would you mind taking a look at this and creating a PR that adjusts DBAction as you suggest, so we can discuss this?

@daron666

I'm confused. Will this issue be resolved or won't?

@DCKcode

I'm sorry, I wanted to take a look at this, but I can't anymore. It seems as though this code will be refactored anyway though!

@daron666

Ok! Look forward to see that.

@slorber

+1 using an action builder would make action composition more easier.
I need a composition of DBAction and UserAuthenticatedAction for exemple

@dotta
Owner

Since play-slick 1.0.0 is using stock Play 2.4, the problem reported in this ticket is no longer actual.

@dotta dotta closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.