| Class | TaskJuggler::ReportServlet |
| In: |
lib/taskjuggler/daemon/ReportServlet.rb
|
| Parent: | WEBrick::HTTPServlet::AbstractServlet |
# File lib/taskjuggler/daemon/ReportServlet.rb, line 32 def self.get_instance(config, options) self.new(config, options) end
# File lib/taskjuggler/daemon/ReportServlet.rb, line 24 def initialize(config, options) super @authKey = options[0] @host = options[1] @port = options[2] @uri = options[3] end
# File lib/taskjuggler/daemon/ReportServlet.rb, line 36 def do_GET(req, res) debug('', "Serving URL #{req}") @req = req @res = res begin # WEBrick is returning the query elements as FormData objects. We must # use to_s to explicitely convert them to String objects. projectId = req.query['project'].to_s debug('', "Project ID: #{projectId}") reportId = req.query['report'].to_s debug('', "Report ID: #{reportId}") if projectId.empty? || reportId.empty? debug('', "Project welcome page requested") generateWelcomePage(projectId) else debug('', "Report #{reportId} of project #{projectId} requested") attributes = req.query['attributes'] || '' attributes = URLParameter.decode(attributes) unless attributes.empty? generateReport(projectId, reportId, attributes) end rescue end end