Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

About this user

James Robertson http://www.r0bertson.co.uk

« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS 

Deleting a redundant shape message from the whiteboard queue

This code is used to remove a message from the whiteboard queue containing a shape which has recently moved it's position (x and y coordinates) on the board. Code extract from whiteboardqueue.rb

  def call_delete_shape(params)
    #get the shape's message id.
    doc = Document.new(params)
    shape_id = doc.root.elements["param[@var='id']"].text.to_s
    initialize_doc

    doc_xml = Document.new(decode2(@doc_file.root.to_s))
    id = doc_xml.root.elements["records/message/body/*[@id='#{shape_id}']"].parent.parent.attributes.get_attribute('id')
    delete_record(id)
    save_file
  end


*update 10:04pm*
Added the link to the project code http://github.com/jrobertson/whiteboardqueue/tree
« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS