xml.instruct!
xml.rules do
rules.each do |rule|
- xml << rule.to_xml(profile)
+ rule.to_xml(profile, xml)
end
end
end
def <=>(rule)
name<=>rule.name
end
+
+ def config_key
+ plugin_config_key
+ end
def self.to_i(key_or_id)
id=key_or_id.to_i
end
def to_hash_json(profile)
- json = {'title' => name, 'key' => key, 'plugin' => plugin_name}
+ json = {'title' => name, 'key' => key, 'plugin' => plugin_name, 'config_key' => config_key}
json['description'] = description
active_rule = nil
if profile
json
end
- def to_xml(profile)
- xml = Builder::XmlMarkup.new
+ def to_xml(profile, xml)
xml.rule do
xml.title(name)
xml.key(key)
+ xml.config_key(config_key)
xml.plugin(plugin_name)
xml.description {xml.cdata!(description)}
active_rule = nil
xml.priority(priority_text)
end
parameters.each do |parameter|
- xml << parameter.to_xml(active_rule)
+ parameter.to_xml(active_rule, xml)
end
end
end
json
end
- def to_xml(active_rule)
- xml = Builder::XmlMarkup.new
+ def to_xml(active_rule, xml)
xml.param do
xml.name(name)
xml.description {xml.cdata!(description)}
private String title = null;
private String key = null;
+ private String configKey = null;
private String repository = null;
private String description = null;
private String severity = null;
return this;
}
+ /**
+ * @since 2.7
+ */
+ public String getConfigKey() {
+ return configKey;
+ }
+
+ /**
+ * @since 2.7
+ */
+
+ public Rule setConfigKey(String s) {
+ this.configKey = s;
+ return this;
+ }
+
public String getRepository() {
return repository;
}
rule.setTitle(utils.getString(json, "title"))
.setKey(utils.getString(json, "key"))
+ .setConfigKey(utils.getString(json, "config_key"))
.setRepository(utils.getString(json, "plugin"))
.setDescription(utils.getString(json, "description"))
.setSeverity(utils.getString(json, "priority"))