1 class NodeController < ApplicationController
4 before_filter :authorize
8 node = Node.from_xml(request.raw_post, true)
11 node.user_id = @user.id
12 if node.save_with_history
14 render :text => node.id
16 render :text => 'truesrgtsrtfgsar', :status => 500
17 # render :nothing => true, :status => 500
22 render :nothing => true, :status => 400 # if we got here the doc didnt parse
27 render :text => 'FFFFFFFFFF ', :status => 500
28 # render :nothing => true, :status => 500 # something went very wrong
32 unless Node.exists?(params[:id])
33 render :nothing => true, :status => 400
37 node = Node.find(params[:id])
42 render :text => node.to_xml.to_s
50 node.save_with_history
52 render :nothing => true
54 render :nothing => true, :status => 410
59 new_node = Node.from_xml(request.raw_post)
61 new_node.timestamp = Time.now
62 new_node.user_id = @user.id
64 if node.id == new_node.id and new_node.save_with_history
65 render :text => node.id
67 render :nothing => true, :status => 500