I've been very busy with client projects so haven't had the time to port restfulx gem to Rails 3 yet, but it's on the agenda.
Speaking of which. If anyone wants to help with Rails 3 port feel free to jump in. Just fork the project on github. I am always happy to pull additions other people find useful provided they don't break existing functionality.
Dima
> --
> You received this message because you are subscribed to the Google Groups "restfulx-framework" group.
> To post to this group, send email to restfulx-...@googlegroups.com.
> To unsubscribe from this group, send email to restfulx-framew...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/restfulx-framework?hl=en.
>
Is there a list of what needs to be done, I would like to help as I am
in the same boat as Miranda.
Bill
--
William
Definitely looks like you are in the right track. I am assuming someone else (or I) can look at the generators when there's time.
Further comments are inline.
On 2010-12-03, at 2:50 AM, scho wrote:
> Hi Dima,
>
> I'm porting our application to Rails 3 too. And since we use RestfulX
> I've started to port some functionality of RestfulX to Rails 3.
> I don't really need all the generators, the most important thing for
> me is the to_fxml function for active_record instances, errors and
> arrays.
>
> First I've taken a look at the implementation of the RestfulX
> serialization. I've seen, that you've copied most of the code of the
> Xml serializer and then you've made your changes. So you don't
> actually use any of the xml stuff already programmed in rails. Do I
> get this right or am I wrong?
It was easier to customize to_fxml stuff by mirroring what was done in Rails for serialization rather then delegating to it, so FXMLSerializer is pretty much standalone but is explicitly based on Rails XMLSerializer.
>
> So, what I've done is the following:
> I was digging into the Rails 3 source code until I found the classes,
> which implement the to_xml stuff. These classes are:
> * rails / activerecord / lib / active_record / serializers /
> xml_serializer.rb (https://gist.github.com/rails/rails/blob/master/
> activerecord/lib/active_record/serializers/xml_serializer.rb)
> * rails / activesupport / lib / active_support / core_ext / array /
> conversions.rb (https://github.com/rails/rails/blob/master/
> activesupport/lib/active_support/core_ext/array/conversions.rb)
> * rails / activemodel / lib / active_model / errors.rb (https://
> gist.github.com/rails/rails/blob/master/activemodel/lib/active_model/
> errors.rb)
> * rails / activemodel / lib / active_model / serializers / xml.rb
> (https://gist.github.com/rails/rails/blob/master/activemodel/lib/
> active_model/serializers/xml.rb)
>
> Then I've built the same class structure I found in Rails 3 in
> RestfulX (except, that all is in a module called RestfulX), changed
> to_xml to to_fxml and made the same modifications you did. Finally
> I've thrown all the unused stuff away.
>
> So, what do you think? Am I on the right track?
Absolutely. Let me know when there's anything to pull/review.
>
> Another thing, theres is a rails3 branch in your project. Am I
> supposed to take that one or the master branch?
Please use the rails3 branch. This might get moved around when there's proper rails 3 support but for now it's obviously still work in progress so best to keep it in standalone branch.
Thanks a lot for taking initiative on this! It's much appreciated.
Dima
No list right now, but it's essentially a two part job:
1. Port over the *core*: (to_fxml, to_amf, activerecord, activecontroller patches, etc). Looks like Georg has started on that.
2. Port over the generators. At the moment there are 2 sets of generators. 1 based on rubigen (for standalone apps, such as AIR, etc that use no Rails back-end), the other one based on generator architecture in Rails 2 so they integrate nicely into Rails apps. Rails 3 is using thor (which is way better incidentially). For restfulx I suspect we can rewrite all the generators to use thor and thus get rid of custom for rails and standalone for AIR/GAE apps.
Makes sense?
Dima
That makes total sense and Thor does seem much better. I will start on
the rewrite of the rails generators.
Thanks
Bill
Thanks a lot for taking initiative on this! I'll do my best to help out. Been very busy with client work recently so couldn't keep up with maintenance on RestfulX but I am sure I'll carve out some time soon.
Dima
--
Rails3/Flex4 compatibility is next on the agenda. Flex4 support within the framework (AS3 side) is pretty much done. See flex4 branch in restfulx_framework project.
As far the gem is concerned the following is the case (Refer to rails3 branch in restfulx project):
1. Core Rails3 support is pretty close to complete (things like to_fxml/to_amf work, ActiveModel/ActionController compatibility, etc)
2. Templates for Flex4 compatibility are also pretty much complete
The biggest outstanding issue is actually rewriting generators to be based on Thor (and hence become Rails3 compatible).
If you look at https://github.com/dima/restfulx
You'll notice app_generators, rails_generators and rxgen_generators folders.
app_generators and rxgen_generators are for standalone usage (based on rubigen) and are used for code generators in environments that don't require/use Rails.
rails_generators are for use within Rails2.
Ideally, all of the code generators will be done from the same core structure and Rails3/Thor architecture does allow that kind of refactoring
So in terms of the biggest bottleneck right now there's essentially one:
3. Rewriting code generators to be based on Thor and updating code templates as appropriate.
A very good starting point is https://github.com/indirect/rails3-generators. If you go through some of the code generation in restfulx and rails3-generators you'll get the hang of it very quickly.
Let me know if you want to help with that. Perhaps there's more experienced Rubyists out there who are willing to jump in on this too?
Dima
Sorry I didn't get any time at year end to work on generators. I have time now
Bill
Sent from my iPhone
No problem. Just to update you on the current state of affairs.
Check out rails3 branch of dima/restfulx project on github. You should already be able to install the gem on your system and use it in a rails3 project.
Things like:
YourModel.to_fxml should work as should responds_with :fxml in your controller.
Rake tasks that restfulx gem adds should also be pulled in correctly. Do rake -T to verify. I'll do a bit more work to port AMF stuff to Rails3 in the next few days at which point of time getting to the generators will be the big thing that's left.
Thanks again for your help!
Dima
There's flex4 branch on restfulx_framework and rails3 branch on restfulx gem on github. flex4 support is pretty much complete on Flex-end.
Rails3 support is functionally almost there except for generators. If you are using to_fxml and don't need code generation you can use Flex 4/Rails 3 already. I don't have a specific launch date in mind = as soon as it's ready. If somebody helps with the generators that would be earlier of course.
Dima