Class Index [+]

Quicksearch

TaskJuggler::RTFReportLink

This class is a specialized RichTextFunctionHandler that generates a link to another report. It’s not available on all output formats.

Public Class Methods

new(project, sourceFileInfo = nil) click to toggle source
    # File lib/RTFReportLink.rb, line 24
24:     def initialize(project, sourceFileInfo = nil)
25:       @project = project
26:       super(project.messageHandler, 'reportlink', sourceFileInfo)
27:       @blockFunction = false
28:       @query = nil
29:     end

Public Instance Methods

to_html(args) click to toggle source

Return a HTML tree for the report.

    # File lib/RTFReportLink.rb, line 37
37:     def to_html(args)
38:       if args.nil? || (id = args['id']).nil?
39:         error('rtp_report_id',
40:               "Argument 'id' missing to specify the report to be used.")
41:         return nil
42:       end
43:       unless (report = @project.report(id))
44:         error('rtp_report_unknown_id', "Unknown report #{id}")
45:         return nil
46:       end
47: 
48:       # The URL for interactive reports is different than for static reports.
49:       if report.interactive?
50:         # The project and report ID must be provided as query.
51:         url = "taskjuggler?project=#{@project['projectid']};" +
52:               "report=#{report.fullId}"
53: 
54:         if args['attributes']
55:           qEx = SimpleQueryExpander.new(args['attributes'], @query,
56:                                         @project.messageHandler,
57:                                         @sourceFileInfo)
58:           url += ";attributes=" + URLParameter.encode(qEx.expand)
59:         end
60:       else
61:         # The report name just gets a '.html' extension.
62:         url = report.name + ".html"
63:       end
64:       a = XMLElement.new('a', 'href'=> url)
65:       a << XMLText.new(report.name)
66:       a
67:     end
to_s(args) click to toggle source

Not supported for this function

    # File lib/RTFReportLink.rb, line 32
32:     def to_s(args)
33:       ''
34:     end
to_tagged(args) click to toggle source

Not supported for this function.

    # File lib/RTFReportLink.rb, line 70
70:     def to_tagged(args)
71:       nil
72:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.