Class: TaskJuggler::TjpExportRE
- Inherits:
-
ReportBase
- Object
- ReportBase
- TaskJuggler::TjpExportRE
- Defined in:
- lib/taskjuggler/reports/TjpExportRE.rb
Overview
This specialization of ReportBase implements an export of the project data in the TJP syntax format.
Instance Method Summary collapse
- #generateIntermediateFormat ⇒ Object
-
#initialize(report) ⇒ TjpExportRE
constructor
Create a new object and set some default values.
-
#to_tjp ⇒ Object
Return the project data in TJP syntax format.
Methods inherited from ReportBase
#a, #filterAccountList, #filterResourceList, #filterTaskList
Constructor Details
#initialize(report) ⇒ TjpExportRE
Create a new object and set some default values.
23 24 25 26 27 28 29 30 |
# File 'lib/taskjuggler/reports/TjpExportRE.rb', line 23 def initialize(report) super(report) @supportedTaskAttrs = %w( booking complete depends flags maxend maxstart minend minstart note priority projectid responsible ) @supportedResourceAttrs = %w( booking flags shifts vacation workinghours ) end |
Instance Method Details
#generateIntermediateFormat ⇒ Object
32 33 34 |
# File 'lib/taskjuggler/reports/TjpExportRE.rb', line 32 def generateIntermediateFormat super end |
#to_tjp ⇒ Object
Return the project data in TJP syntax format.
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/taskjuggler/reports/TjpExportRE.rb', line 37 def to_tjp # 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.setSorting(a('sortTasks')) @taskList = filterTaskList(@taskList, nil, a('hideTask'), a('rollupTask'), a('openNodes')) @taskList.sort! getBookings @file = '' generateProjectProperty if a('definitions').include?('project') generateFlagDeclaration if a('definitions').include?('flags') generateProjectIDs if a('definitions').include?('projectids') generateShiftList if a('definitions').include?('shifts') generateResourceList if a('definitions').include?('resources') generateTaskList if a('definitions').include?('tasks') generateTaskAttributes unless a('taskAttributes').empty? generateResourceAttributes unless a('resourceAttributes').empty? @file end |