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

{{{



86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# File 'lib/cpee-logging-xes-yaml/logging.rb', line 86

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