X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/3e355d7dc0fff308170bb7c47dea7e8aa8e54acd..6ae23bed90f249ed943cc43f1bad0e40852f04bb:/app/controllers/node_controller.rb diff --git a/app/controllers/node_controller.rb b/app/controllers/node_controller.rb index 1aef6a8a5..9f8f4a38b 100644 --- a/app/controllers/node_controller.rb +++ b/app/controllers/node_controller.rb @@ -1,3 +1,5 @@ +# The NodeController is the RESTful interface to Node objects + class NodeController < ApplicationController require 'xml/libxml' @@ -7,11 +9,13 @@ class NodeController < ApplicationController before_filter :check_read_availability, :except => [:create, :update, :delete] after_filter :compress_output + # Create a node from XML. def create if request.put? node = Node.from_xml(request.raw_post, true) if node + node.version = 0 node.user_id = @user.id node.visible = true node.save_with_history! @@ -25,6 +29,7 @@ class NodeController < ApplicationController end end + # Dump the details on a node given in params[:id] def read begin node = Node.find(params[:id]) @@ -39,6 +44,7 @@ class NodeController < ApplicationController end end + # Update a node from given XML def update begin node = Node.find(params[:id]) @@ -61,6 +67,8 @@ class NodeController < ApplicationController end end + # Delete a node. Doesn't actually delete it, but retains its history in a wiki-like way. + # FIXME remove all the fricking SQL def delete begin node = Node.find(params[:id]) @@ -85,6 +93,7 @@ class NodeController < ApplicationController end end + # WTF does this do? def nodes ids = params['nodes'].split(',').collect { |n| n.to_i }