OWL-Rails Port integration

Paweł Paprota ppawel at fastmail.fm
Mon Jan 7 16:31:08 GMT 2013


Hi all,

As you may or may not know, OWL and OWL-Rails Port integration (in the
form of the new History tab) made beta status last week[1].

 From Rails Port point of view right now it's just a bunch of additional
Javascript and AJAX requests pulling the data from the OWL API.

On one hand, it's nice because it's a non-intrusive and pretty much
self-contained form of integration.

However, as I'm working further with the client-side code I'm starting
to hit some bumps that made me rethink the integration.

Namely, the following things are/will be a bit problematic with the
current OWL integration approach:

* POI symbols - I had to duplicate the code to generate the CSS class
for POI's so that the symbols appear.[2]

* User avatars - it's not (easily) possible to display user avatar from
Javascript since there's additional logic involved that decides whether
to use local user image or the Gravatar[3].

* In general - any other user information that we would maybe like to
display there in the future is not available currently for the JS code
without hitting the API with AJAX for each user that needs to be displayed.

So I started thinking that maybe OWL should be more tightly integrated,
similarly to Nominatim - it would have its own controller and all AJAX
requests would go to Rails Port which would then hit the OWL API and on
the way back from the controller we could "enrich" the response with
additional data (user data like the avatar link).

What do you think? Would the additional load on the Rails Port be a problem?

[1] http://lists.openstreetmap.org/pipermail/talk/2013-January/065556.html

[2] 
https://github.com/openstreetmap/openstreetmap-website/blob/master/app/helpers/browse_helper.rb#L30

[3] 
https://github.com/openstreetmap/openstreetmap-website/blob/master/app/helpers/user_helper.rb

Paweł



More information about the rails-dev mailing list