Class/Module Index [+]

Quicksearch

TaskJuggler::MspXmlRE

This specialization of ReportBase implements an export of the project data into Microsoft Project XML format. Due to limitations of MS Project and this implementation, only a subset of core data is being exported. The exported data is already a scheduled project with full resource/task assignment data.

Public Class Methods

new(report) click to toggle source

Create a new object and set some default values.

# File lib/taskjuggler/reports/MspXmlRE.rb, line 24
def initialize(report)
  super(report)

  # This report type currently only supports a single scenario. Use the
  # first specified one.
  @scenarioIdx = a('scenarios').first

  # Hash to map calendar names to UIDs (numbers).
  @calendarUIDs = {}
  @timeformat = "%Y-%m-%dT%H:%M:%S"
end

Public Instance Methods

generateIntermediateFormat() click to toggle source
# File lib/taskjuggler/reports/MspXmlRE.rb, line 36
def generateIntermediateFormat
  super
end
to_mspxml() click to toggle source

Return the project data in Microsoft Project XML format.

# File lib/taskjuggler/reports/MspXmlRE.rb, line 41
def to_mspxml
  @query = @project.reportContexts.last.query.dup

  # Prepare the resource list.
  @resourceList = PropertyList.new(@project.resources)
  @resourceList.setSorting(a('sortResources'))
  @resourceList = filterResourceList(@resourceList, nil, a('hideResource'),
                                     a('rollupResource'), a('openNodes'))
  @resourceList.sort!

  # Prepare the task list.
  @taskList = PropertyList.new(@project.tasks)
  @taskList.includeAdopted
  @taskList.setSorting(a('sortTasks'))
  @taskList = filterTaskList(@taskList, nil, a('hideTask'), a('rollupTask'),
                             a('openNodes'))
  @taskList.sort!
  @taskList.checkForDuplicates(@report.sourceFileInfo)

  @file = XMLDocument.new
  @file << XMLBlob.new('<?xml version="1.0" encoding="UTF-8" ' +
                       'standalone="yes"?>')
  @file << XMLComment.new(Generated by #{AppConfig.softwareName} v#{AppConfig.version} on #{TjTime.new}For more information about #{AppConfig.softwareName} see #{AppConfig.contact}.Project: #{@project['name']}Date:    #{@project['now']}
                         )
  @file << (project =
            XMLElement.new('Project',
                           'xmlns' =>
                           'http://schemas.microsoft.com/project'))

  calendars = generateProjectAttributes(project)
  generateTasks(project)
  generateResources(project, calendars)
  generateAssignments(project)

  @file.to_s
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.