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

Deleting a redundant shape message from the whiteboard queue (See related posts)

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

You need to create an account or log in to post comments to this site.


Click here to browse all 4834 code snippets

Related Posts