Class: CPEE::Properties::PutItems

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

Overview

}}}

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.set(item, id, opts, xml) ⇒ Object

{{{



425
426
427
428
429
430
431
432
# File 'lib/cpee/implementation_properties.rb', line 425

def self::set(item,id,opts,xml)
  doc = XML::Smart::string(xml)
  val = {}
  doc.find("/*/*").each do |ele|
    val[ele.qname.name] = ele.text unless val.has_key?(ele.qname.name)
  end
  CPEE::Persistence::set_list(id,opts,item,val,true,true)
end

Instance Method Details

#responseObject



434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
# File 'lib/cpee/implementation_properties.rb', line 434

def response
  item = @a[0]
  id = @a[1]
  opts = @a[2]
  if opts[:statemachine].readonly? id
    @status = 423
  elsif opts[:statemachine].final? id
    @status = 410
  else
    begin
      PutItems::set(item,id,opts,@p[0].value.read)
    rescue
      @status = 400
    end
  end
  nil
end