Class TaskJuggler::RTFQuery
In: lib/taskjuggler/RichText/RTFQuery.rb
Parent: RTFWithQuerySupport

This class is a specialized RichTextFunctionHandler that can be used to query the value of a project or property attribute.

Methods

new   to_html   to_s   to_tagged  

Public Class methods

[Source]

# File lib/taskjuggler/RichText/RTFQuery.rb, line 24
    def initialize(project, sourceFileInfo = nil)
      @project = project
      super('query', sourceFileInfo)
      @blockMode = false
    end

Public Instance methods

Return a XMLElement tree that represents the navigator in HTML code.

[Source]

# File lib/taskjuggler/RichText/RTFQuery.rb, line 42
    def to_html(args)
      return nil unless (query = prepareQuery(args))
      if query.ok
        if (rti = query.to_rti)
          rti.to_html
        elsif (str = query.to_s)
          XMLText.new(str)
        else
          nil
        end
      else
        error('query_error', query.errorMessage + recreateQuerySyntax(args))
        font = XMLElement.new('font', 'color' => '#FF0000')
        font << XMLText.new('Query Error: ' + query.errorMessage)
        font
      end
    end

Return the result of the query as String.

[Source]

# File lib/taskjuggler/RichText/RTFQuery.rb, line 31
    def to_s(args)
      return '' unless (query = prepareQuery(args))
      if query.ok
        query.to_s
      else
        error('query_error', query.errorMessage + recreateQuerySyntax(args))
        'Query Error: ' + query.errorMessage
      end
    end

Not supported for this function.

[Source]

# File lib/taskjuggler/RichText/RTFQuery.rb, line 61
    def to_tagged(args)
      nil
    end

[Validate]