]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-833 remove support of XML format
authorsimonbrandhof <simon.brandhof@gmail.com>
Tue, 14 Dec 2010 11:07:41 +0000 (11:07 +0000)
committersimonbrandhof <simon.brandhof@gmail.com>
Tue, 14 Dec 2010 11:07:41 +0000 (11:07 +0000)
sonar-server/src/main/webapp/WEB-INF/app/controllers/api/timemachine_controller.rb

index 62d0788e2117adad3942069b6a43500af426bb7e..746c27cadf4c57cb6f2bf5d2b8312badebac3c89 100644 (file)
@@ -106,7 +106,6 @@ class Api::TimemachineController < Api::ApiController
       objects = { :snapshots => snapshots, :measures_by_sid => measures_by_sid, :metric_keys => metric_keys }
       respond_to do |format|
         format.json { render :json => jsonp(to_json(objects)) }
-        format.xml  { render :xml  => to_xml(objects) }
         format.csv  {
           send_data(to_csv(objects),
             :type => 'text/csv; charset=utf-8; header=present',
@@ -146,35 +145,6 @@ class Api::TimemachineController < Api::ApiController
     json
   end
 
-  def to_xml(objects)
-    snapshots = objects[:snapshots]
-    measures_by_sid = objects[:measures_by_sid]
-    metric_keys = objects[:metric_keys]
-
-    xml = Builder::XmlMarkup.new(:indent => 0)
-    xml.instruct!
-
-    xml.snapshots do
-      snapshots.each do |snapshot|
-        snapshot_to_xml(xml, snapshot, measures_by_sid[snapshot.id], metric_keys)
-      end
-    end
-  end
-
-  def snapshot_to_xml(xml, snapshot, measures, metric_keys)
-    values_by_key = {}
-    measures.each do |measure|
-      values_by_key[measure.metric.name] = measure.value.to_f if measure.value
-    end
-
-    xml.snapshot do
-      xml.date(format_datetime(snapshot.created_at))
-      metric_keys.each do |metric|
-        xml.measure(values_by_key[metric])
-      end
-    end
-  end
-
   def to_csv(objects)
     snapshots = objects[:snapshots]
     measures_by_sid = objects[:measures_by_sid]