Class: CPEE::Logging::Subscriptions

Inherits:
Riddl::Implementation
  • Object
show all
Defined in:
lib/cpee-logging-xes-yaml/logging.rb

Overview

}}}

Instance Method Summary collapse

Instance Method Details

#responseObject

{{{



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/cpee-logging-xes-yaml/logging.rb', line 71

def response
  opts = @a[0]
  Riddl::Parameter::Complex.new("subscriptions","text/xml") do
    ret = XML::Smart::string <<-END
      <subscriptions xmlns='http://riddl.org/ns/common-patterns/notifications-producer/2.0'/>
    END
    Dir.glob(File.join(opts[:notifications_dir],'*','subscription.xml')).each do |f|
      ret.root.add('subscription').tap do |n|
        n.attributes['id'] = File.basename(File.dirname(f))
        XML::Smart.open_unprotected(f) do |doc|
          n.attributes['url'] =  doc.root.attributes['url']
        end
      end
    end
    ret.to_s
  end
end