Sha256: 9a429c6586e82b014fb8759eaf61cf1e7353364b0a181b25816e8dcfbea6f89f

Contents?: true

Size: 795 Bytes

Versions: 4

Compression:

Stored size: 795 Bytes

Contents

module GoodData
  class Report < GoodData::MdObject 

    class << self
      def [](id)
        if id == :all
          GoodData.get(GoodData.project.md['query'] + '/reports/')['query']['entries']
        else 
          super
        end
      end
    end

    def execute
      # puts "Executing report #{uri}"
      result = GoodData.post '/gdc/xtab2/executor3', {"report_req" => {"report" => uri}}
      
      dataResultUri = result["reportResult2"]["content"]["dataResult"]
      result = GoodData.get dataResultUri
      return EmptyResult.new([]) if result.nil?

      while result["taskState"] && result["taskState"]["status"] == "WAIT" do
        sleep 10
        result = GoodData.get dataResultUri
      end
      ReportDataResult.new(GoodData.get dataResultUri)
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
gooddata-0.5.5 lib/gooddata/models/report.rb
gooddata-0.5.4 lib/gooddata/models/report.rb
gooddata-0.5.3 lib/gooddata/models/report.rb
gooddata-0.5.2 lib/gooddata/models/report.rb