On 04.03.2013 12:37, Aaron Yung wrote:
activexml is basically two things: the HTTP implementation as part of transport.rb and on top of that is the Node, which is parsing the XML returned from the API into a ruby tree.
For this to work every API route needs to be mapped to a model and a route, so you can find in config/initializers/activexml.rb e.g.
map.connect :statusmessage, 'rest:///status/messages/:id/?:limit'
This maps to app/models/statusmessage.rb, so you can use Statusmessage.find(:id => params[:message_id])
This will then call into $APIURL/status/messages/#{params[:message_id} and the returned XML is available in the model.
So e.g. see this example:
irb(main):003:0> Statusmessage.find(id: 1).message.msg_id => "1" irb(main):004:0> Statusmessage.find(id: 1).value(:message) => "Now we have status messages ... watch out for notes here, if you encounter problems."
Thanks for replying~ when I delete/create a project something else, How does the backend perl scripts know and update the api_production tables ? Also with the xml files ? I can't follow that
the database is purely in the hand of the API, if you create a project, the API will push things into the backend. Check app/models/project.rb's write_to_backend function Greetings, Stephan -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org