class Nexpose::DBExport

Configuration structure for database exporting of reports.

Attributes

credentials[RW]

Credentials needed to export to the specified database.

parameters[RW]

Map of parameters for this DB export configuration.

type[RW]

The DB type to export to.

Public Class Methods

new(type) click to toggle source
# File lib/nexpose/report.rb, line 559
def initialize(type)
  @type = type
  @parameters = {}
end
parse(xml) click to toggle source
# File lib/nexpose/report.rb, line 573
def self.parse(xml)
  xml.elements.each('//DBExport') do |dbexport|
    config = DBExport.new(dbexport.attributes['type'])
    config.credentials = ExportCredential.parse(xml)
    xml.elements.each('//param') do |param|
      config.parameters[param.attributes['name']] = param.text
    end
    return config
  end
  nil
end

Public Instance Methods

to_xml() click to toggle source
# File lib/nexpose/report.rb, line 564
def to_xml
  xml = %(<DBExport type="#{@type}">)
  xml << @credentials.to_xml if @credentials
  @parameters.each_pair do |name, value|
    xml << %(<param name="#{name}">#{value}</param>)
  end
  xml << '</DBExport>'
end