Class: CPEE::Properties::GetPositions

Inherits:
Riddl::Implementation
  • Object
show all
Defined in:
lib/cpee/implementation_properties.rb

Overview

}}}

Instance Method Summary collapse

Instance Method Details

#responseObject

{{{



501
502
503
504
505
506
507
508
509
510
511
512
513
514
# File 'lib/cpee/implementation_properties.rb', line 501

def response
  id = @a[0]
  opts = @a[1]
  doc = XML::Smart::open_unprotected(opts[:properties_empty])
  doc.register_namespace 'p', 'http://cpee.org/ns/properties/2.0'
  des = doc.find("/p:properties/p:positions").first
  CPEE::Persistence::extract_set(id,opts,'positions').each do |de|
    node = des.add(*de)
    if pt = CPEE::Persistence::extract_item(id,opts,File.join('positions',de[0],'@passthrough'))
      node.attributes['passthrough'] = pt
    end
  end
  Riddl::Parameter::Complex.new('positions','text/xml',des.to_doc.to_s)
end