def response
id = @a[0]
opts = @a[1]
if opts[:statemachine].readonly? id
@status = 423
elsif opts[:statemachine].final? id
@status = 410
else
begin
doc = XML::Smart::string(@p[0].value.read)
if not CPEE::Persistence::extract_item(id,opts,File.join('positions',doc.root.qname.name))
content = {}
content[doc.root.text] = [{ 'position' => doc.root.qname.name }]
content[doc.root.text][0]['passthrough'] = doc.root.attributes['passthrough'] if doc.root.attributes['passthrough']
CPEE::Persistence::set_item(id,opts,'position',content)
else
@status= 409
end
Riddl::Parameter::Simple.new('id',doc.root.qname.name)
rescue => e
@status = 400
end
end
nil
end