Class: CPEE::Properties::PutTransformation

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(id, opts, xml) ⇒ Object

{{{



813
814
815
816
817
818
819
820
821
822
823
824
# File 'lib/cpee/implementation_properties.rb', line 813

def self::set(id,opts,xml)
  doc = XML::Smart::string(xml)
  doc.register_namespace 'p', 'http://cpee.org/ns/properties/2.0'
  CPEE::Persistence::set_item(id,opts,'transformation',
    :description => doc.find('string(/p:transformation/p:description)'),
    :description_type => doc.find('string(/p:transformation/p:description/@type)'),
    :dataelements =>doc.find('string(/p:transformation/p:dataelements)'),
    :dataelements_type => doc.find('string(/p:transformation/p:dataelements/@type)'),
    :endpoints =>doc.find('string(/p:transformation/p:endpoints)'),
    :endpoints_type => doc.find('string(/p:transformation/p:endpoints/@type)')
  )
end

Instance Method Details

#responseObject



825
826
827
828
829
830
831
832
833
834
# File 'lib/cpee/implementation_properties.rb', line 825

def response
  id = @a[0]
  opts = @a[1]
  if opts[:statemachine].readonly? id
    @status = 422 # semantic error
  else
    PutTransformation::set(id,opts,@p[0].value.read)
  end
  nil
end