taskjuggler 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (432) hide show
  1. data/Rakefile +1 -0
  2. data/benchmarks/depends.tjp +2 -1
  3. data/benchmarks/htmltaskreport.tjp +2 -1
  4. data/doc/classes/AppConfig.html +124 -120
  5. data/doc/classes/Arguments.html +10 -6
  6. data/doc/classes/Object.html +229 -0
  7. data/doc/classes/String.html +35 -31
  8. data/doc/classes/TaskJuggler/Account.html +18 -18
  9. data/doc/classes/TaskJuggler/AccountAttribute.html +261 -0
  10. data/doc/classes/TaskJuggler/AccountScenario.html +12 -12
  11. data/doc/classes/TaskJuggler/Allocation.html +34 -30
  12. data/doc/classes/TaskJuggler/AllocationAttribute.html +70 -70
  13. data/doc/classes/TaskJuggler/AttributeBase.html +131 -147
  14. data/doc/classes/TaskJuggler/AttributeDefinition.html +38 -21
  15. data/doc/classes/TaskJuggler/BatchProcessor.html +313 -0
  16. data/doc/classes/TaskJuggler/Booking.html +22 -18
  17. data/doc/classes/TaskJuggler/BookingListAttribute.html +42 -42
  18. data/doc/classes/TaskJuggler/BooleanAttribute.html +40 -40
  19. data/doc/classes/TaskJuggler/CSVFile.html +28 -24
  20. data/doc/classes/TaskJuggler/Charge.html +22 -18
  21. data/doc/classes/TaskJuggler/ChargeListAttribute.html +30 -30
  22. data/doc/classes/TaskJuggler/ChargeSet.html +41 -37
  23. data/doc/classes/TaskJuggler/ChargeSetListAttribute.html +46 -46
  24. data/doc/classes/TaskJuggler/ColumnListAttribute.html +231 -0
  25. data/doc/classes/TaskJuggler/ColumnTable.html +23 -21
  26. data/doc/classes/TaskJuggler/DateAttribute.html +20 -20
  27. data/doc/classes/TaskJuggler/DefinitionListAttribute.html +162 -0
  28. data/doc/classes/TaskJuggler/DependencyListAttribute.html +46 -46
  29. data/doc/classes/TaskJuggler/DurationAttribute.html +30 -30
  30. data/doc/classes/TaskJuggler/FixnumAttribute.html +20 -20
  31. data/doc/classes/TaskJuggler/FlagListAttribute.html +42 -42
  32. data/doc/classes/TaskJuggler/FloatAttribute.html +30 -30
  33. data/doc/classes/TaskJuggler/FormatListAttribute.html +197 -0
  34. data/doc/classes/TaskJuggler/GanttChart.html +236 -207
  35. data/doc/classes/TaskJuggler/GanttContainer.html +46 -42
  36. data/doc/classes/TaskJuggler/GanttHeader.html +16 -12
  37. data/doc/classes/TaskJuggler/GanttHeaderScaleItem.html +16 -12
  38. data/doc/classes/TaskJuggler/GanttLine.html +28 -24
  39. data/doc/classes/TaskJuggler/GanttLoadStack.html +22 -18
  40. data/doc/classes/TaskJuggler/GanttMilestone.html +46 -42
  41. data/doc/classes/TaskJuggler/GanttRouter.html +104 -98
  42. data/doc/classes/TaskJuggler/GanttTaskBar.html +46 -42
  43. data/doc/classes/TaskJuggler/HTMLDocument.html +12 -12
  44. data/doc/classes/TaskJuggler/HTMLGraphics.html +12 -12
  45. data/doc/classes/TaskJuggler/Interval.html +126 -120
  46. data/doc/classes/TaskJuggler/IntervalListAttribute.html +46 -46
  47. data/doc/classes/TaskJuggler/JobInfo.html +284 -0
  48. data/doc/classes/TaskJuggler/Journal.html +197 -0
  49. data/doc/classes/TaskJuggler/JournalEntry.html +218 -0
  50. data/doc/classes/TaskJuggler/KeywordArray.html +179 -0
  51. data/doc/classes/TaskJuggler/KeywordDocumentation.html +445 -396
  52. data/doc/classes/TaskJuggler/Limits/Limit.html +34 -30
  53. data/doc/classes/TaskJuggler/Limits.html +68 -62
  54. data/doc/classes/TaskJuggler/LimitsAttribute.html +40 -40
  55. data/doc/classes/TaskJuggler/ListAttributeBase.html +207 -0
  56. data/doc/classes/TaskJuggler/Log.html +72 -68
  57. data/doc/classes/TaskJuggler/LogicalAttribute.html +38 -34
  58. data/doc/classes/TaskJuggler/LogicalExpression.html +16 -12
  59. data/doc/classes/TaskJuggler/LogicalExpressionAttribute.html +194 -0
  60. data/doc/classes/TaskJuggler/LogicalFlag.html +32 -32
  61. data/doc/classes/TaskJuggler/LogicalFunction.html +28 -24
  62. data/doc/classes/TaskJuggler/LogicalOperation.html +17 -13
  63. data/doc/classes/TaskJuggler/Macro.html +10 -6
  64. data/doc/classes/TaskJuggler/MacroParser.html +36 -36
  65. data/doc/classes/TaskJuggler/MacroTable.html +40 -36
  66. data/doc/classes/TaskJuggler/Message.html +16 -12
  67. data/doc/classes/TaskJuggler/MessageHandler.html +16 -12
  68. data/doc/classes/TaskJuggler/Navigator.html +249 -0
  69. data/doc/classes/TaskJuggler/OnShiftCache.html +316 -0
  70. data/doc/classes/TaskJuggler/Project.html +1064 -678
  71. data/doc/classes/TaskJuggler/ProjectFileParser.html +90 -85
  72. data/doc/classes/TaskJuggler/PropertyAttribute.html +194 -0
  73. data/doc/classes/TaskJuggler/PropertyList.html +114 -113
  74. data/doc/classes/TaskJuggler/PropertySet.html +355 -312
  75. data/doc/classes/TaskJuggler/PropertyTreeNode.html +527 -474
  76. data/doc/classes/TaskJuggler/Query.html +90 -85
  77. data/doc/classes/TaskJuggler/RTPNavigator.html +292 -0
  78. data/doc/classes/TaskJuggler/RTPReport.html +301 -0
  79. data/doc/classes/TaskJuggler/RealFormat.html +114 -57
  80. data/doc/classes/TaskJuggler/RealFormatAttribute.html +162 -0
  81. data/doc/classes/TaskJuggler/ReferenceAttribute.html +87 -20
  82. data/doc/classes/TaskJuggler/Report.html +82 -291
  83. data/doc/classes/TaskJuggler/ReportBase.html +448 -0
  84. data/doc/classes/TaskJuggler/ReportContext.html +243 -0
  85. data/doc/classes/TaskJuggler/ReportTable.html +158 -129
  86. data/doc/classes/TaskJuggler/ReportTableCell.html +30 -26
  87. data/doc/classes/TaskJuggler/ReportTableColumn.html +29 -25
  88. data/doc/classes/TaskJuggler/ReportTableLegend.html +28 -24
  89. data/doc/classes/TaskJuggler/ReportTableLine.html +34 -30
  90. data/doc/classes/TaskJuggler/Resource.html +12 -12
  91. data/doc/classes/TaskJuggler/ResourceListAttribute.html +46 -46
  92. data/doc/classes/TaskJuggler/ResourceListRE.html +49 -57
  93. data/doc/classes/TaskJuggler/ResourceScenario.html +126 -126
  94. data/doc/classes/TaskJuggler/RichText.html +52 -48
  95. data/doc/classes/TaskJuggler/RichTextAttribute.html +30 -30
  96. data/doc/classes/TaskJuggler/RichTextDocument.html +41 -37
  97. data/doc/classes/TaskJuggler/RichTextElement.html +274 -264
  98. data/doc/classes/TaskJuggler/RichTextException.html +13 -13
  99. data/doc/classes/TaskJuggler/RichTextParser.html +48 -47
  100. data/doc/classes/TaskJuggler/RichTextProtocolExample.html +52 -55
  101. data/doc/classes/TaskJuggler/RichTextProtocolHandler.html +55 -10
  102. data/doc/classes/TaskJuggler/RichTextScanner.html +106 -245
  103. data/doc/classes/TaskJuggler/RichTextSnip.html +28 -24
  104. data/doc/classes/TaskJuggler/RichTextSyntaxRules.html +381 -301
  105. data/doc/classes/TaskJuggler/Scenario.html +6 -6
  106. data/doc/classes/TaskJuggler/ScenarioData.html +40 -36
  107. data/doc/classes/TaskJuggler/ScenarioListAttribute.html +229 -0
  108. data/doc/classes/TaskJuggler/Scoreboard.html +70 -66
  109. data/doc/classes/TaskJuggler/Shift.html +18 -18
  110. data/doc/classes/TaskJuggler/ShiftAssignment.html +58 -54
  111. data/doc/classes/TaskJuggler/ShiftAssignments.html +82 -78
  112. data/doc/classes/TaskJuggler/ShiftAssignmentsAttribute.html +40 -40
  113. data/doc/classes/TaskJuggler/ShiftScenario.html +24 -24
  114. data/doc/classes/TaskJuggler/SortListAttribute.html +196 -0
  115. data/doc/classes/TaskJuggler/SourceFileInfo.html +16 -12
  116. data/doc/classes/TaskJuggler/StringAttribute.html +30 -30
  117. data/doc/classes/TaskJuggler/SymbolAttribute.html +20 -20
  118. data/doc/classes/TaskJuggler/SyntaxReference.html +46 -42
  119. data/doc/classes/TaskJuggler/TOCEntry.html +16 -12
  120. data/doc/classes/TaskJuggler/TableColumnDefinition.html +48 -33
  121. data/doc/classes/TaskJuggler/TableOfContents.html +22 -18
  122. data/doc/classes/TaskJuggler/TableReport.html +1036 -0
  123. data/doc/classes/TaskJuggler/Task.html +12 -12
  124. data/doc/classes/TaskJuggler/TaskDependency.html +16 -12
  125. data/doc/classes/TaskJuggler/TaskListAttribute.html +46 -46
  126. data/doc/classes/TaskJuggler/TaskListRE.html +49 -58
  127. data/doc/classes/TaskJuggler/TaskScenario.html +1270 -1180
  128. data/doc/classes/TaskJuggler/TextParser/Pattern.html +100 -96
  129. data/doc/classes/TaskJuggler/TextParser/Rule.html +88 -84
  130. data/doc/classes/TaskJuggler/TextParser/StackElement.html +16 -12
  131. data/doc/classes/TaskJuggler/TextParser/TextParserResultArray.html +12 -12
  132. data/doc/classes/TaskJuggler/TextParser/TokenDoc.html +10 -6
  133. data/doc/classes/TaskJuggler/TextParser.html +203 -140
  134. data/doc/classes/TaskJuggler/TextReport.html +364 -0
  135. data/doc/classes/TaskJuggler/TextScanner/BufferStreamHandle.html +70 -70
  136. data/doc/classes/TaskJuggler/TextScanner/FileStreamHandle.html +50 -42
  137. data/doc/classes/TaskJuggler/TextScanner/StreamHandle.html +16 -12
  138. data/doc/classes/TaskJuggler/TextScanner.html +334 -240
  139. data/doc/classes/TaskJuggler/TjException.html +6 -6
  140. data/doc/classes/TaskJuggler/TjTime.html +547 -497
  141. data/doc/classes/TaskJuggler/TjpExample.html +29 -25
  142. data/doc/classes/TaskJuggler/TjpExportRE.html +77 -97
  143. data/doc/classes/TaskJuggler/TjpSyntaxRules.html +3911 -3886
  144. data/doc/classes/TaskJuggler/UserManual.html +54 -54
  145. data/doc/classes/TaskJuggler/WorkingHours.html +53 -49
  146. data/doc/classes/TaskJuggler/WorkingHoursAttribute.html +53 -85
  147. data/doc/classes/TaskJuggler/XMLBlob.html +21 -21
  148. data/doc/classes/TaskJuggler/XMLComment.html +21 -21
  149. data/doc/classes/TaskJuggler/XMLDocument.html +28 -24
  150. data/doc/classes/TaskJuggler/XMLElement.html +70 -58
  151. data/doc/classes/TaskJuggler/XMLNamedText.html +11 -11
  152. data/doc/classes/TaskJuggler/XMLText.html +36 -36
  153. data/doc/classes/TaskJuggler.html +266 -183
  154. data/doc/files/COPYING.html +1 -1
  155. data/doc/files/README.html +1 -1
  156. data/doc/files/lib/AccountScenario_rb.html +1 -1
  157. data/doc/files/lib/Account_rb.html +1 -1
  158. data/doc/files/lib/Allocation_rb.html +1 -1
  159. data/doc/files/lib/AppConfig_rb.html +1 -1
  160. data/doc/files/lib/AttributeBase_rb.html +11 -1
  161. data/doc/files/lib/AttributeDefinition_rb.html +1 -1
  162. data/doc/files/lib/Attributes_rb.html +1 -1
  163. data/doc/files/lib/{LogicalFlag_rb.html → BatchProcessor_rb.html} +8 -6
  164. data/doc/files/lib/Booking_rb.html +1 -1
  165. data/doc/files/lib/ChargeSet_rb.html +1 -1
  166. data/doc/files/lib/Charge_rb.html +1 -1
  167. data/doc/files/lib/HTMLDocument_rb.html +1 -1
  168. data/doc/files/lib/Interval_rb.html +1 -1
  169. data/doc/files/lib/Journal_rb.html +106 -0
  170. data/doc/files/lib/KeywordArray_rb.html +106 -0
  171. data/doc/files/lib/KeywordDocumentation_rb.html +1 -1
  172. data/doc/files/lib/Limits_rb.html +1 -1
  173. data/doc/files/lib/Log_rb.html +1 -1
  174. data/doc/files/lib/LogicalExpression_rb.html +1 -3
  175. data/doc/files/lib/LogicalFunction_rb.html +1 -1
  176. data/doc/files/lib/LogicalOperation_rb.html +1 -1
  177. data/doc/files/lib/MacroParser_rb.html +1 -1
  178. data/doc/files/lib/MacroTable_rb.html +1 -1
  179. data/doc/files/lib/MessageHandler_rb.html +1 -1
  180. data/doc/files/lib/Message_rb.html +1 -1
  181. data/doc/files/lib/ProjectFileParser_rb.html +5 -1
  182. data/doc/files/lib/Project_rb.html +5 -1
  183. data/doc/files/lib/PropertyList_rb.html +1 -1
  184. data/doc/files/lib/PropertySet_rb.html +1 -1
  185. data/doc/files/lib/PropertyTreeNode_rb.html +1 -1
  186. data/doc/files/lib/Query_rb.html +1 -1
  187. data/doc/files/lib/RTPNavigator_rb.html +120 -0
  188. data/doc/files/lib/RTPReport_rb.html +118 -0
  189. data/doc/files/lib/RealFormat_rb.html +1 -1
  190. data/doc/files/lib/ResourceScenario_rb.html +1 -1
  191. data/doc/files/lib/Resource_rb.html +1 -1
  192. data/doc/files/lib/RichTextDocument_rb.html +1 -1
  193. data/doc/files/lib/RichTextElement_rb.html +1 -1
  194. data/doc/files/lib/RichTextParser_rb.html +1 -1
  195. data/doc/files/lib/RichTextProtocolExample_rb.html +1 -1
  196. data/doc/files/lib/RichTextProtocolHandler_rb.html +1 -1
  197. data/doc/files/lib/RichTextScanner_rb.html +1 -1
  198. data/doc/files/lib/RichTextSnip_rb.html +1 -1
  199. data/doc/files/lib/RichTextSyntaxRules_rb.html +1 -1
  200. data/doc/files/lib/RichText_rb.html +1 -1
  201. data/doc/files/lib/ScenarioData_rb.html +1 -1
  202. data/doc/files/lib/Scenario_rb.html +1 -1
  203. data/doc/files/lib/Scoreboard_rb.html +1 -1
  204. data/doc/files/lib/ShiftAssignments_rb.html +1 -1
  205. data/doc/files/lib/ShiftScenario_rb.html +1 -1
  206. data/doc/files/lib/Shift_rb.html +1 -1
  207. data/doc/files/lib/SourceFileInfo_rb.html +1 -1
  208. data/doc/files/lib/SyntaxReference_rb.html +1 -1
  209. data/doc/files/lib/TOCEntry_rb.html +1 -1
  210. data/doc/files/lib/TableColumnDefinition_rb.html +1 -1
  211. data/doc/files/lib/TableOfContents_rb.html +1 -1
  212. data/doc/files/lib/TaskDependency_rb.html +1 -1
  213. data/doc/files/lib/TaskJuggler_rb.html +1 -1
  214. data/doc/files/lib/TaskScenario_rb.html +1 -1
  215. data/doc/files/lib/Task_rb.html +1 -1
  216. data/doc/files/lib/TextParser/Pattern_rb.html +1 -1
  217. data/doc/files/lib/TextParser/Rule_rb.html +1 -1
  218. data/doc/files/lib/TextParser/StackElement_rb.html +1 -1
  219. data/doc/files/lib/TextParser/TokenDoc_rb.html +1 -1
  220. data/doc/files/lib/TextParser_rb.html +1 -1
  221. data/doc/files/lib/TextScanner_rb.html +1 -1
  222. data/doc/files/lib/Tj3Config_rb.html +1 -1
  223. data/doc/files/lib/TjException_rb.html +1 -1
  224. data/doc/files/lib/TjTime_rb.html +1 -1
  225. data/doc/files/lib/TjpExample_rb.html +1 -1
  226. data/doc/files/lib/TjpSyntaxRules_rb.html +1 -1
  227. data/doc/files/lib/UTF8String_rb.html +1 -1
  228. data/doc/files/lib/UserManual_rb.html +1 -1
  229. data/doc/files/lib/WorkingHours_rb.html +1 -1
  230. data/doc/files/lib/XMLDocument_rb.html +1 -1
  231. data/doc/files/lib/XMLElement_rb.html +1 -1
  232. data/doc/files/lib/deep_copy_rb.html +106 -0
  233. data/doc/files/lib/ms_test_rb.html +90 -0
  234. data/doc/files/lib/reports/CSVFile_rb.html +1 -1
  235. data/doc/files/lib/reports/ColumnTable_rb.html +1 -1
  236. data/doc/files/lib/reports/GanttChart_rb.html +1 -1
  237. data/doc/files/lib/reports/GanttContainer_rb.html +1 -1
  238. data/doc/files/lib/reports/GanttHeaderScaleItem_rb.html +1 -1
  239. data/doc/files/lib/reports/GanttHeader_rb.html +1 -1
  240. data/doc/files/lib/reports/GanttLine_rb.html +1 -1
  241. data/doc/files/lib/reports/GanttLoadStack_rb.html +1 -1
  242. data/doc/files/lib/reports/GanttMilestone_rb.html +1 -1
  243. data/doc/files/lib/reports/GanttRouter_rb.html +1 -1
  244. data/doc/files/lib/reports/GanttTaskBar_rb.html +1 -1
  245. data/doc/files/lib/reports/HTMLGraphics_rb.html +1 -1
  246. data/doc/files/lib/reports/{ReportElement_rb.html → Navigator_rb.html} +6 -8
  247. data/doc/files/lib/reports/ReportBase_rb.html +106 -0
  248. data/doc/files/lib/reports/ReportContext_rb.html +106 -0
  249. data/doc/files/lib/reports/ReportTableCell_rb.html +1 -1
  250. data/doc/files/lib/reports/ReportTableColumn_rb.html +1 -1
  251. data/doc/files/lib/reports/ReportTableLegend_rb.html +1 -1
  252. data/doc/files/lib/reports/ReportTableLine_rb.html +1 -1
  253. data/doc/files/lib/reports/ReportTable_rb.html +1 -1
  254. data/doc/files/lib/reports/Report_rb.html +8 -2
  255. data/doc/files/lib/reports/ResourceListRE_rb.html +2 -2
  256. data/doc/files/lib/reports/{ReportTableElement_rb.html → TableReport_rb.html} +7 -5
  257. data/doc/files/lib/reports/TaskListRE_rb.html +2 -2
  258. data/doc/files/lib/reports/TextReport_rb.html +116 -0
  259. data/doc/files/lib/reports/TjpExportRE_rb.html +2 -2
  260. data/doc/files/lib/taskjuggler3_rb.html +61 -56
  261. data/doc/files/lib/tj3man_rb.html +1 -1
  262. data/doc/fr_class_index.html +41 -3
  263. data/doc/fr_file_index.html +21 -5
  264. data/doc/fr_method_index.html +1069 -959
  265. data/examples/ContactList.html +1467 -0
  266. data/examples/Deliveries.html +485 -0
  267. data/examples/Development.html +2525 -0
  268. data/examples/Overview.html +747 -0
  269. data/examples/Resource Graph.html +616 -0
  270. data/examples/tutorial.tjp +63 -67
  271. data/lib/AttributeBase.rb +27 -31
  272. data/lib/AttributeDefinition.rb +12 -7
  273. data/lib/Attributes.rb +134 -34
  274. data/lib/Interval.rb +2 -0
  275. data/lib/Journal.rb +44 -0
  276. data/lib/{LogicalFlag.rb → KeywordArray.rb} +5 -13
  277. data/lib/KeywordDocumentation.rb +84 -47
  278. data/lib/Limits.rb +7 -5
  279. data/lib/LogicalExpression.rb +1 -1
  280. data/lib/LogicalOperation.rb +33 -0
  281. data/lib/Project.rb +313 -99
  282. data/lib/ProjectFileParser.rb +88 -11
  283. data/lib/PropertyList.rb +2 -1
  284. data/lib/PropertySet.rb +13 -4
  285. data/lib/PropertyTreeNode.rb +34 -15
  286. data/lib/Query.rb +2 -1
  287. data/lib/RTPNavigator.rb +53 -0
  288. data/lib/RTPReport.rb +62 -0
  289. data/lib/RealFormat.rb +28 -10
  290. data/lib/RichTextElement.rb +18 -12
  291. data/lib/RichTextParser.rb +1 -0
  292. data/lib/RichTextProtocolExample.rb +8 -11
  293. data/lib/RichTextProtocolHandler.rb +11 -1
  294. data/lib/RichTextScanner.rb +308 -164
  295. data/lib/RichTextSyntaxRules.rb +24 -0
  296. data/lib/TableColumnDefinition.rb +5 -1
  297. data/lib/TaskJuggler.rb +3 -2
  298. data/lib/TaskScenario.rb +123 -31
  299. data/lib/TextParser.rb +14 -3
  300. data/lib/TextScanner.rb +210 -34
  301. data/lib/Tj3Config.rb +1 -1
  302. data/lib/TjTime.rb +15 -0
  303. data/lib/TjpExample.rb +1 -1
  304. data/lib/TjpSyntaxRules.rb +674 -473
  305. data/lib/WorkingHours.rb +1 -1
  306. data/lib/XMLElement.rb +11 -3
  307. data/lib/deep_copy.rb +72 -0
  308. data/lib/ms_test.rb +27 -0
  309. data/lib/reports/ColumnTable.rb +7 -5
  310. data/lib/reports/GanttChart.rb +60 -34
  311. data/lib/reports/GanttHeader.rb +1 -1
  312. data/lib/reports/GanttRouter.rb +7 -5
  313. data/lib/reports/Navigator.rb +72 -0
  314. data/lib/reports/Report.rb +58 -73
  315. data/lib/reports/ReportBase.rb +241 -0
  316. data/lib/reports/ReportContext.rb +41 -0
  317. data/lib/reports/ReportTable.rb +7 -2
  318. data/lib/reports/ReportTableCell.rb +3 -3
  319. data/lib/reports/ResourceListRE.rb +19 -26
  320. data/lib/reports/{ReportTableElement.rb → TableReport.rb} +297 -97
  321. data/lib/reports/TaskListRE.rb +16 -24
  322. data/lib/reports/TextReport.rb +87 -0
  323. data/lib/reports/TjpExportRE.rb +55 -50
  324. data/lib/taskjuggler3.rb +6 -1
  325. data/manual/Getting_Started +57 -6
  326. data/manual/How_To_Contribute +2 -4
  327. data/manual/Intro +2 -2
  328. data/manual/Reporting_Bugs +9 -2
  329. data/manual/Rich_Text_Attributes +41 -0
  330. data/manual/Tutorial +219 -173
  331. data/tasks/test.rake +3 -0
  332. data/test/TestSuite/CSV-Reports/celltext.tjp +2 -1
  333. data/test/TestSuite/CSV-Reports/resourcereport.tjp +2 -1
  334. data/test/TestSuite/CSV-Reports/resourcereport_with_tasks.tjp +2 -1
  335. data/test/TestSuite/CSV-Reports/sortByTree.tjp +2 -1
  336. data/test/TestSuite/CSV-Reports/sortBy_duration.down.tjp +2 -1
  337. data/test/TestSuite/CSV-Reports/sortBy_effort.up.tjp +2 -1
  338. data/test/TestSuite/CSV-Reports/sortBy_plan.start.down.tjp +2 -1
  339. data/test/TestSuite/CSV-Reports/taskreport.tjp +2 -1
  340. data/test/TestSuite/CSV-Reports/taskreport_with_resources.tjp +2 -1
  341. data/test/TestSuite/HTML-Reports/depArrows.tjp +72 -0
  342. data/test/TestSuite/HTML-Reports/reference-export.html +187 -0
  343. data/test/TestSuite/HTML-Reports/reference.tjp +21 -0
  344. data/test/TestSuite/Scheduler/Correct/Allocate.tjp +2 -1
  345. data/test/TestSuite/Scheduler/Correct/AutomaticMilestones.tjp +3 -3
  346. data/test/TestSuite/Scheduler/Correct/Booking.tjp +3 -3
  347. data/test/TestSuite/Scheduler/Correct/Container-2.tjp +37 -0
  348. data/test/TestSuite/Scheduler/Correct/Container.tjp +40 -0
  349. data/test/TestSuite/Scheduler/Correct/Depends.tjp +9 -14
  350. data/test/TestSuite/Scheduler/Correct/Duration.tjp +2 -1
  351. data/test/TestSuite/Scheduler/Correct/InheritStartEnd.tjp +20 -29
  352. data/test/TestSuite/Scheduler/Correct/Limits.tjp +11 -13
  353. data/test/TestSuite/Scheduler/Correct/Optimize-1.tjp +6 -5
  354. data/test/TestSuite/Scheduler/Correct/Optimize-2.tjp +10 -6
  355. data/test/TestSuite/Scheduler/Correct/Optimize-3.tjp +9 -6
  356. data/test/TestSuite/Scheduler/Correct/Optimize-4.tjp +9 -6
  357. data/test/TestSuite/Scheduler/Correct/Optimize-5.tjp +13 -10
  358. data/test/TestSuite/Scheduler/Correct/Precedes.tjp +9 -14
  359. data/test/TestSuite/Scheduler/Correct/Shift.tjp +9 -8
  360. data/test/TestSuite/Scheduler/Correct/checks.tji +4 -0
  361. data/test/TestSuite/Scheduler/Errors/weak_end_dep.tjp +16 -0
  362. data/test/TestSuite/Scheduler/Errors/weak_start_dep.tjp +16 -0
  363. data/test/TestSuite/Syntax/Correct/Account.tjp +1 -1
  364. data/test/TestSuite/Syntax/Correct/AutoID.tjp +21 -0
  365. data/test/TestSuite/Syntax/Correct/AutoMacros.tjp +2 -1
  366. data/test/TestSuite/Syntax/Correct/Caption.tjp +7 -6
  367. data/test/TestSuite/Syntax/Correct/Celltext.tjp +7 -4
  368. data/test/TestSuite/Syntax/Correct/Comments.tjp +1 -1
  369. data/test/TestSuite/Syntax/Correct/CompletedWork.tji +11 -19
  370. data/test/TestSuite/Syntax/Correct/CriticalPath.tjp +4 -3
  371. data/test/TestSuite/Syntax/Correct/Export.tjp +3 -1
  372. data/test/TestSuite/Syntax/Correct/Flags.tjp +2 -1
  373. data/test/TestSuite/Syntax/Correct/HtmlTaskReport.tjp +2 -1
  374. data/test/TestSuite/Syntax/Correct/Journal.tjp +18 -0
  375. data/test/TestSuite/Syntax/Correct/LoadUnits.tjp +2 -1
  376. data/test/TestSuite/Syntax/Correct/LogicalExpression.tjp +16 -0
  377. data/test/TestSuite/Syntax/Correct/Period.tjp +2 -1
  378. data/test/TestSuite/Syntax/Correct/RawHTML.tjp +4 -2
  379. data/test/TestSuite/Syntax/Correct/Reports.tjp +4 -2
  380. data/test/TestSuite/Syntax/Correct/ResourcePrefix.tji +2 -0
  381. data/test/TestSuite/Syntax/Correct/ResourcePrefix.tjp +23 -0
  382. data/test/TestSuite/Syntax/Correct/Responsible.tjp +1 -1
  383. data/test/TestSuite/Syntax/Correct/Simple.tjp +1 -1
  384. data/test/TestSuite/Syntax/Correct/String.tjp +1 -1
  385. data/test/TestSuite/Syntax/Correct/TaskRoot.tjp +2 -1
  386. data/test/TestSuite/Syntax/Correct/tutorial.tjp +92 -70
  387. data/test/TestSuite/Syntax/Errors/bad_comment.tjp +7 -0
  388. data/test/TestSuite/Syntax/Errors/bad_include.tjp +1 -1
  389. data/test/TestSuite/Syntax/Errors/bad_time_zone.tjp +6 -0
  390. data/test/TestSuite/Syntax/Errors/bad_timing_res.tjp +5 -0
  391. data/test/TestSuite/Syntax/Errors/chargeset_master.tjp +1 -1
  392. data/test/TestSuite/Syntax/Errors/container_attribute.tjp +1 -1
  393. data/test/TestSuite/Syntax/Errors/cost_acct_no_top.tjp +3 -2
  394. data/test/TestSuite/Syntax/Errors/cost_rev_same.tjp +1 -1
  395. data/test/TestSuite/Syntax/Errors/eof_in_istring1.tjp +5 -0
  396. data/test/TestSuite/Syntax/Errors/eof_in_istring2.tjp +5 -0
  397. data/test/TestSuite/Syntax/Errors/eof_in_istring3.tjp +6 -0
  398. data/test/TestSuite/Syntax/Errors/eof_in_istring4.tjp +6 -0
  399. data/test/TestSuite/Syntax/Errors/eof_in_istring5.tjp +6 -0
  400. data/test/TestSuite/Syntax/Errors/include_recursion.tji +1 -0
  401. data/test/TestSuite/Syntax/Errors/include_recursion.tjp +7 -0
  402. data/test/TestSuite/Syntax/Errors/junk_after_cut.tjp +6 -0
  403. data/test/TestSuite/Syntax/Errors/navigator_exists.tjp +10 -0
  404. data/test/TestSuite/Syntax/Errors/operand_unkn_flag.tjp +1 -1
  405. data/test/TestSuite/Syntax/Errors/report_end.tjp +1 -1
  406. data/test/TestSuite/Syntax/Errors/report_exists.tjp +10 -0
  407. data/test/TestSuite/Syntax/Errors/report_start.tjp +1 -1
  408. data/test/TestSuite/Syntax/Errors/rev_acct_no_top.tjp +1 -1
  409. data/test/TestSuite/Syntax/Errors/sort_direction.tjp +1 -1
  410. data/test/TestSuite/Syntax/Errors/sort_unknown_scen.tjp +1 -1
  411. data/test/TestSuite/Syntax/Errors/sorting_crit_exptd1.tjp +1 -1
  412. data/test/TestSuite/Syntax/Errors/sorting_crit_exptd2.tjp +1 -1
  413. data/test/TestSuite/Syntax/Errors/sorting_wbs.tjp +1 -1
  414. data/test/TestSuite/Syntax/Errors/too_large_timing_res.tjp +7 -0
  415. data/test/TestSuite/Syntax/Errors/unknown_scenario_idx.tjp +1 -1
  416. data/test/TestSuite/Syntax/Errors/unknown_task.tjp +1 -1
  417. data/test/all.rb +1 -16
  418. data/test/test_CSV-Reports.rb +8 -5
  419. data/test/test_Query.rb +2 -2
  420. data/test/test_RichText.rb +95 -0
  421. data/test/test_Scheduler.rb +8 -4
  422. data/test/test_Syntax.rb +8 -4
  423. data/test/test_deep_copy.rb +83 -0
  424. metadata +549 -487
  425. data/benchmarks/UTF-8-Strings.rb +0 -58
  426. data/doc/classes/TaskJuggler/ReportElement.html +0 -1070
  427. data/doc/classes/TaskJuggler/ReportTableElement.html +0 -644
  428. data/lib/reports/ReportElement.rb +0 -427
  429. data/test/TestSuite/Syntax/Correct/csvtest +0 -16
  430. data/test/TestSuite/Syntax/Errors/no_csv_suffix.tjp +0 -10
  431. data/test/TestSuite/Syntax/Errors/no_html_suffix.tjp +0 -10
  432. data/test/TestSuite/Syntax/Errors/report_redifinition.tjp +0 -10
@@ -14,6 +14,8 @@ require 'TextParser'
14
14
  require 'TextScanner'
15
15
  require 'TjpSyntaxRules'
16
16
  require 'RichText'
17
+ require 'RTPNavigator'
18
+ require 'RTPReport'
17
19
 
18
20
  class TaskJuggler
19
21
 
@@ -47,9 +49,14 @@ class TaskJuggler
47
49
 
48
50
  # Call this function with the master file to start processing a TJP file or
49
51
  # a set of TJP files.
50
- def open(masterFile)
52
+ def open(file, master)
51
53
  begin
52
- @scanner = TextScanner.new(masterFile, @messageHandler)
54
+ @scanner = TextScanner.new(file, @messageHandler)
55
+ # We need the TextScanner object for error reporting.
56
+ if master && file != '.' && file[-4, 4] != '.tjp'
57
+ error('illegal_extension', "Project file name must end with " +
58
+ '\'.tjp\' extension')
59
+ end
53
60
  @scanner.open
54
61
  rescue StandardError
55
62
  error('file_open', $!.message)
@@ -168,7 +175,7 @@ class TaskJuggler
168
175
  # Register the new Attribute type with the Property set it should belong
169
176
  # to.
170
177
  @propertySet.addAttributeType(AttributeDefinition.new(
171
- @val[1], @val[2], type, inherit, scenarioSpecific, default, true))
178
+ @val[1], @val[2], type, inherit, false, scenarioSpecific, default, true))
172
179
 
173
180
  # Add the new user-defined attribute as reportable attribute to the parser
174
181
  # rule.
@@ -188,20 +195,41 @@ class TaskJuggler
188
195
  # actual input file. So we have to map the error location in the RichText
189
196
  # input stream back to the position in the project file.
190
197
  def newRichText(text)
198
+ sfi = sourceFileInfo
191
199
  begin
192
200
  rText = RichText.new(text)
201
+ rText.registerProtocol(RTPNavigator.new(@project, sfi))
202
+ rText.registerProtocol(RTPReport.new(@project, sfi))
193
203
  rescue RichTextException => msg
194
- sfi = sourceFileInfo
195
- correctSFI = SourceFileInfo.new(sfi.fileName,
196
- sfi.lineNo + msg.lineNo - 1, 0)
204
+ sfi = SourceFileInfo.new(sfi.fileName, sfi.lineNo + msg.lineNo - 1, 0)
197
205
  message = Message.new(msg.id, 'error', msg.text + "\n" + msg.line,
198
- @property, nil, correctSFI)
206
+ @property, nil, sfi)
199
207
  @messageHandler.send(message)
200
208
 
201
209
  end
202
210
  rText
203
211
  end
204
212
 
213
+ # This method is a convenience wrapper around Project.new. It checks if
214
+ # the report name already exists. It also triggers the attribute
215
+ # inheritance. +name+ is the name of the report, +type+ is the report
216
+ # type. +sourceFileInfo+ is a SourceFileInfo of the report definition. The
217
+ # method returns the newly created Report.
218
+ def newReport(name, type, sourceFileInfo)
219
+ if @project.reportByName(name)
220
+ error('report_redefinition',
221
+ "A report with the name #{name} has already been defined.")
222
+ end
223
+ @property = Report.new(@project, "report#{@reportCounter += 1}",
224
+ name, nil)
225
+ @property.typeSpec = type
226
+ @property.sourceFileInfo = sourceFileInfo
227
+ @property.set('formats', [ type ])
228
+ @property.inheritAttributes
229
+ @property
230
+ end
231
+
232
+
205
233
  # If the @limitResources list is not empty, we have to create a Limits
206
234
  # object for each Resource. Otherwise, one Limits object is enough.
207
235
  def setLimit(name, value, interval)
@@ -218,12 +246,53 @@ class TaskJuggler
218
246
  # syntax tree definition. The *Rule functions may only be used in _rule
219
247
  # functions. And only one function call per _rule function is allowed.
220
248
 
249
+ # This function creates a set of rules to describe a list of keywords.
250
+ # _name_ is the name of the top-level rule and _items_ can be a Hash or
251
+ # Array. The array just contains the allowed keywords, the Hash contains
252
+ # keyword/description pairs. The description is used to describe
253
+ # the keyword in the manual. The syntax supports two special cases. A '*'
254
+ # means all items in the list and '-' means the list is empty.
255
+ def allOrNothingListRule(name, items)
256
+ newRule(name) {
257
+ # A '*' means all possible items should be in the list.
258
+ pattern(%w( _* ), lambda {
259
+ KeywordArray.new([ '*' ])
260
+ })
261
+ descr('A shortcut for all items')
262
+ # A '-' means the list should be empty.
263
+ pattern([ '_ - ' ], lambda {
264
+ KeywordArray.new
265
+ })
266
+ descr('No items')
267
+ # Or the list consists of one or more comma separated keywords.
268
+ pattern([ "!#{name}_AoN_ruleItems" ], lambda {
269
+ KeywordArray.new(@val)
270
+ })
271
+ }
272
+ # Create the rule for the comma separated list.
273
+ newRule("#{name}_AoN_ruleItems") {
274
+ listRule("more#{name}_AoN_ruleItems", "!#{name}_AoN_ruleItem")
275
+ }
276
+ # Create the rule for the keywords with their description.
277
+ newRule("#{name}_AoN_ruleItem") {
278
+ if items.is_a?(Array)
279
+ items.each { |keyword| singlePattern('_' + keyword) }
280
+ else
281
+ items.each do |keyword, description|
282
+ singlePattern('_' + keyword)
283
+ descr(description) if description
284
+ end
285
+ end
286
+ }
287
+ end
288
+
221
289
  def listRule(name, listItem)
222
290
  pattern([ "#{listItem}", "!#{name}" ], lambda {
223
291
  [ @val[0] ] + (@val[1].nil? ? [] : @val[1])
224
292
  })
225
- newRule(name)
226
- commaListRule(listItem)
293
+ newRule(name) {
294
+ commaListRule(listItem)
295
+ }
227
296
  end
228
297
 
229
298
  def commaListRule(listItem)
@@ -261,7 +330,7 @@ class TaskJuggler
261
330
  def descr(text)
262
331
  if @cr.patterns[-1].length != 1 ||
263
332
  (@cr.patterns[-1][0][0] != ?_ && @cr.patterns[-1][0][0] != ?$)
264
- raise('descr() may only be used for patterns with terminal tokens.')
333
+ raise 'descr() may only be used for patterns with terminal tokens.'
265
334
  end
266
335
  arg(0, nil, text)
267
336
  end
@@ -291,6 +360,13 @@ class TaskJuggler
291
360
  def example(file, tag = nil)
292
361
  @cr.setExample(file, tag)
293
362
  end
363
+ # Determine the title of the column with the ID _colId_. The title may be
364
+ # from the static set or be from a user defined attribute.
365
+ def columnTitle(colId)
366
+ TableReport.defaultColumnTitle(colId) ||
367
+ @project.attributeName(colId)
368
+ end
369
+
294
370
 
295
371
  # To manage certain variables that have file scope throughout a hierachie
296
372
  # of nested include files, we use a @fileStack to track those variables.
@@ -298,7 +374,8 @@ class TaskJuggler
298
374
  # return from an included file, we need to restore the old values. This
299
375
  # function creates or resets the stack.
300
376
  def initFileStack
301
- @fileStackVariables = %w( taskprefix resourceprefix accountprefix )
377
+ @fileStackVariables = %w( taskprefix reportprefix
378
+ resourceprefix accountprefix )
302
379
  stackEntry = {}
303
380
  @fileStackVariables.each do |var|
304
381
  stackEntry[var] = ''
data/lib/PropertyList.rb CHANGED
@@ -91,7 +91,8 @@ class TaskJuggler
91
91
  end
92
92
  if scIdx == -1
93
93
  if @propertySet.scenarioSpecific?(criteria)
94
- raise TjException.new, "Attribute #{criteria} is scenario specific"
94
+ raise TjException.new, "Attribute #{criteria} is scenario specific." +
95
+ "You must specify a scenario id."
95
96
  end
96
97
  else
97
98
  if !@propertySet.scenarioSpecific?(criteria)
data/lib/PropertySet.rb CHANGED
@@ -101,12 +101,21 @@ class TaskJuggler
101
101
  @attributeDefinitions[attrId].scenarioSpecific
102
102
  end
103
103
 
104
- # Return whether the attribute with _attrId_ is scenario specific or not.
105
- def inheritable?(attrId)
106
- # All hardwired attributes are not inheritable.
104
+ # Return whether the attribute with _attrId_ is inherited from the global
105
+ # scope.
106
+ def inheritedFromProject?(attrId)
107
+ # All hardwired attributes are not inherited.
108
+ return false if @attributeDefinitions[attrId].nil?
109
+
110
+ @attributeDefinitions[attrId].inheritedFromProject
111
+ end
112
+
113
+ # Return whether the attribute with _attrId_ is inherited from parent.
114
+ def inheritedFromParent?(attrId)
115
+ # All hardwired attributes are not inherited.
107
116
  return false if @attributeDefinitions[attrId].nil?
108
117
 
109
- @attributeDefinitions[attrId].inheritable
118
+ @attributeDefinitions[attrId].inheritedFromParent
110
119
  end
111
120
 
112
121
  # Return whether or not the attribute was user defined.
@@ -40,6 +40,12 @@ class TaskJuggler
40
40
  # specified by a hierachical _id_ (e. g. 'father.son').
41
41
  def initialize(propertySet, id, name, parent)
42
42
  @propertySet = propertySet
43
+ # If _id_ is still nil, we generate a unique id.
44
+ unless id
45
+ tag = self.class.to_s.gsub(/TaskJuggler::/, '')
46
+ id = '_' + tag + '_' + (propertySet.items + 1).to_s
47
+ id = parent.id + '.' + id if !@propertySet.flatNamespace && parent
48
+ end
43
49
  if !@propertySet.flatNamespace && id.include?('.')
44
50
  parentId = id[0..(id.rindex('.') - 1)]
45
51
  # Set parent to the parent property if it's still nil.
@@ -73,13 +79,19 @@ class TaskJuggler
73
79
 
74
80
  @attributes = Hash.new
75
81
  @scenarioAttributes = Array.new(@project.scenarioCount)
76
- @project.scenarioCount.times do |i|
77
- @scenarioAttributes[i] = Hash.new
78
- end
82
+ @scenarioAttributes.collect! { |sca| sca = Hash.new }
83
+
79
84
  # Scenario specific data
80
85
  @data = nil
81
86
  end
82
87
 
88
+ # We only use deep_clone for attributes, never for properties. Since
89
+ # attributes may reference properties these references should remain
90
+ # references.
91
+ def deep_clone
92
+ self
93
+ end
94
+
83
95
  # Return the index of the child _node_.
84
96
  def levelSeqNo(node)
85
97
  @children.index(node) + 1
@@ -87,12 +99,9 @@ class TaskJuggler
87
99
 
88
100
  # Inherit values for the attributes from the parent node or the Project.
89
101
  def inheritAttributes
90
- # These attributes are being inherited from the Project.
91
- whitelist = %w( limits priority projectid rate vacation workinghours )
92
-
93
102
  # Inherit non-scenario-specific values
94
103
  @propertySet.eachAttributeDefinition do |attrDef|
95
- next if attrDef.scenarioSpecific || !attrDef.inheritable
104
+ next if attrDef.scenarioSpecific || !attrDef.inheritedFromParent
96
105
 
97
106
  aId = attrDef.id
98
107
  if parent
@@ -102,7 +111,7 @@ class TaskJuggler
102
111
  end
103
112
  else
104
113
  # Inherit selected values from project if top-level property
105
- if whitelist.index(aId)
114
+ if attrDef.inheritedFromProject
106
115
  if @project[aId]
107
116
  @attributes[aId].inherit(@project[aId])
108
117
  end
@@ -112,7 +121,7 @@ class TaskJuggler
112
121
 
113
122
  # Inherit scenario-specific values
114
123
  @propertySet.eachAttributeDefinition do |attrDef|
115
- next if !attrDef.scenarioSpecific || !attrDef.inheritable
124
+ next if !attrDef.scenarioSpecific || !attrDef.inheritedFromParent
116
125
 
117
126
  @project.scenarioCount.times do |scenarioIdx|
118
127
  if parent
@@ -124,7 +133,7 @@ class TaskJuggler
124
133
  end
125
134
  else
126
135
  # Inherit selected values from project if top-level property
127
- if whitelist.index(attrDef.id)
136
+ if attrDef.inheritedFromProject
128
137
  if @project[attrDef.id] &&
129
138
  @scenarioAttributes[scenarioIdx][attrDef.id]
130
139
  @scenarioAttributes[scenarioIdx][attrDef.id].inherit(
@@ -156,8 +165,8 @@ class TaskJuggler
156
165
  inherited(attrDef.id, parentScenarioIdx)) &&
157
166
  !(provided(attrDef.id, scenarioIdx) ||
158
167
  inherited(attrDef.id, scenarioIdx))
159
- @scenarioAttributes[scenarioIdx][attrDef.id].inherit(
160
- @scenarioAttributes[parentScenarioIdx][attrDef.id].get)
168
+ @scenarioAttributes[scenarioIdx][attrDef.id] =
169
+ @scenarioAttributes[parentScenarioIdx][attrDef.id].deep_clone
161
170
  end
162
171
  end
163
172
  end
@@ -321,7 +330,16 @@ class TaskJuggler
321
330
  # _scenarioIdx_.
322
331
  def getAttr(attributeId, scenarioIdx = nil)
323
332
  if scenarioIdx.nil?
324
- @attributes[attributeId]
333
+ case attributeId
334
+ when 'id'
335
+ @id
336
+ when 'name'
337
+ @name
338
+ when 'seqno'
339
+ @sequenceNo
340
+ else
341
+ @attributes[attributeId]
342
+ end
325
343
  else
326
344
  @scenarioAttributes[scenarioIdx][attributeId]
327
345
  end
@@ -410,12 +428,13 @@ class TaskJuggler
410
428
  end
411
429
  res += ' Children: ' + children + "\n" unless children.empty?
412
430
  @attributes.sort.each do |key, attr|
413
- if attr.get != @propertySet.defaultValue(key)
431
+ #if attr.get != @propertySet.defaultValue(key)
414
432
  res += indent(" #{key}: ", attr.to_s)
415
- end
433
+ #end
416
434
  end
417
435
  unless @scenarioAttributes.empty?
418
436
  project.scenarioCount.times do |sc|
437
+ break if @scenarioAttributes[sc].nil?
419
438
  headerShown = false
420
439
  @scenarioAttributes[sc].sort.each do |key, attr|
421
440
  if attr.get != @propertySet.defaultValue(key)
data/lib/Query.rb CHANGED
@@ -73,7 +73,8 @@ class TaskJuggler
73
73
  end
74
74
  # Same for the scope property.
75
75
  if !@scopeProperty.nil? && !@scopePropertyId.nil?
76
- @scopeProperty = resolvePropertyId(@scopePropertyType, @scopePropertyId)
76
+ @scopeProperty = resolvePropertyId(@scopePropertyType,
77
+ @scopePropertyId)
77
78
  end
78
79
  # Make sure the have a reference to the project.
79
80
  @project = @property.project unless @project
@@ -0,0 +1,53 @@
1
+ #!/usr/bin/env ruby -w
2
+ # encoding: UTF-8
3
+ #
4
+ # = RTPNavigator.rb -- The TaskJuggler III Project Management Software
5
+ #
6
+ # Copyright (c) 2006, 2007, 2008, 2009 by Chris Schlaeger <cs@kde.org>
7
+ #
8
+ # This program is free software; you can redistribute it and/or modify
9
+ # it under the terms of version 2 of the GNU General Public License as
10
+ # published by the Free Software Foundation.
11
+ #
12
+
13
+ require 'RichTextProtocolHandler'
14
+ require 'XMLElement'
15
+ require 'reports/Navigator'
16
+
17
+ class TaskJuggler
18
+
19
+ # This class is a specialized RichTextProtocolHandler that generates a
20
+ # navigation bar for all reports that match the specified LogicalExpression.
21
+ # It currently only supports HTML.
22
+ class RTPNavigator < RichTextProtocolHandler
23
+
24
+ def initialize(project, sourceFileInfo)
25
+ super(project, 'navigator', sourceFileInfo)
26
+ end
27
+
28
+ # Not supported for this protocol
29
+ def to_s(args)
30
+ ''
31
+ end
32
+
33
+ # Return a XMLElement tree that represents the navigator in HTML code.
34
+ def to_html(args)
35
+ if args.nil? || (id = args['id']).nil?
36
+ error('rtp_nav_id_missing',
37
+ "Argument 'id' missing to specify the navigator to be used.")
38
+ end
39
+ unless (navBar = @project['navigators'][id])
40
+ error('rtp_nav_unknown_id', "Unknown navigator #{id}")
41
+ end
42
+ navBar.to_html
43
+ end
44
+
45
+ # Not supported for this protocol.
46
+ def to_tagged(args)
47
+ nil
48
+ end
49
+
50
+ end
51
+
52
+ end
53
+
data/lib/RTPReport.rb ADDED
@@ -0,0 +1,62 @@
1
+ #!/usr/bin/env ruby -w
2
+ # encoding: UTF-8
3
+ #
4
+ # = RTPReport.rb -- The TaskJuggler III Project Management Software
5
+ #
6
+ # Copyright (c) 2006, 2007, 2008, 2009 by Chris Schlaeger <cs@kde.org>
7
+ #
8
+ # This program is free software; you can redistribute it and/or modify
9
+ # it under the terms of version 2 of the GNU General Public License as
10
+ # published by the Free Software Foundation.
11
+ #
12
+
13
+ require 'RichTextProtocolHandler'
14
+ require 'XMLElement'
15
+
16
+ class TaskJuggler
17
+
18
+ # This class is a specialized RichTextProtocolHandler that includes a
19
+ # report into the RichText output for supported formats.
20
+ class RTPReport < RichTextProtocolHandler
21
+
22
+ def initialize(project, sourceFileInfo)
23
+ super(project, 'report', sourceFileInfo)
24
+ end
25
+
26
+ # Not supported for this protocol
27
+ def to_s(args)
28
+ ''
29
+ end
30
+
31
+ # Return a HTML tree for the report.
32
+ def to_html(args)
33
+ if args.nil? || (id = args['id']).nil?
34
+ error('rtp_report_id',
35
+ "Argument 'id' missing to specify the report to be used.")
36
+ end
37
+ unless (report = @project.report(id))
38
+ error('rtp_report_unknown_id', "Unknown report #{id}")
39
+ end
40
+
41
+ # Save the old report context record
42
+ oldReportContext = @project.reportContext
43
+ # Create a new context for the report.
44
+ @project.reportContext = ReportContext.new(@project, report)
45
+ # Generate the report with the new context
46
+ report.generate
47
+ html = report.to_html
48
+ # Restore the global report context record again.
49
+ @project.reportContext = oldReportContext
50
+
51
+ html
52
+ end
53
+
54
+ # Not supported for this protocol.
55
+ def to_tagged(args)
56
+ nil
57
+ end
58
+
59
+ end
60
+
61
+ end
62
+
data/lib/RealFormat.rb CHANGED
@@ -16,20 +16,33 @@ class TaskJuggler
16
16
  # rules. These rules determine how negative values are represented, how the
17
17
  # fractional part is shown and how to structure the mantissa. The result is
18
18
  # always a String.
19
+ #
20
+ # The class uses the following parameters to control the formating.
21
+ # signPrefix: Prefix used for negative numbers. (String)
22
+ # signSuffix: Suffix used for negative numbers. (String)
23
+ # thousandsSeparator: Separator used after 3 integer digits. (String)
24
+ # fractionSeparator: Separator used between the inter part and the
25
+ # fractional part. (String)
26
+ # fractionDigits: Number of fractional digits to show. (Fixnum)
19
27
  class RealFormat
20
28
 
21
29
  # Create a new RealFormat object and define the formating rules.
22
30
  def initialize(args)
23
- # Prefix used for negative numbers. (String)
24
- @signPrefix = args[0]
25
- # Suffix used for negative numbers. (String)
26
- @signSuffix = args[1]
27
- # Separator used after 3 integer digits. (String)
28
- @thousandsSeparator = args[2]
29
- # Separator used between the inter part and the fractional part. (String)
30
- @fractionSeparator = args[3]
31
- # Number of fractional digits to show. (Fixnum)
32
- @fractionDigits = args[4]
31
+ iVars = %w( @signPrefix @signSuffix @thousandsSeparator
32
+ @fractionSeparator @fractionDigits )
33
+ if args.is_a?(RealFormat)
34
+ # The argument is another RealFormat object.
35
+ iVars.each do |iVar|
36
+ instance_variable_set(iVar, args.instance_variable_get(iVar))
37
+ end
38
+ elsif args.length == 5
39
+ # The argument is a list of values.
40
+ 0.upto(4) do |i|
41
+ instance_variable_set(iVars[i], args[i])
42
+ end
43
+ else
44
+ raise RuntimeError, "Bad number of parameters #{args.length}"
45
+ end
33
46
  end
34
47
 
35
48
  # Converts the Float _number_ into a String representation according to the
@@ -67,6 +80,11 @@ class TaskJuggler
67
80
  out
68
81
  end
69
82
 
83
+ def to_s
84
+ [ @signPrefix, @signSuffix, @thousandsSeparator, @fractionSeparator,
85
+ @fractionDigits ].collect { |s| "\"#{s}\"" }.join(' ')
86
+ end
87
+
70
88
  end
71
89
 
72
90
  end
@@ -162,6 +162,7 @@ class TaskJuggler
162
162
  post = "\n\n"
163
163
  when :ref
164
164
  when :href
165
+ when :blockfunc
165
166
  when :italic
166
167
  when :bold
167
168
  when :code
@@ -243,6 +244,14 @@ class TaskJuggler
243
244
  when :href
244
245
  pre = "<a href=\"#{@data}\" target=\"_blank\">"
245
246
  post = '</a>'
247
+ when :blockfunc
248
+ pre = "<blockfunc:#{@data[0]}"
249
+ if @data[1]
250
+ @data[1].keys.sort.each do |key|
251
+ pre += " #{key}=\"#{@data[1][key]}\""
252
+ end
253
+ end
254
+ post = "/>"
246
255
  when :italic
247
256
  pre = '<i>'
248
257
  post = '</i>'
@@ -273,6 +282,7 @@ class TaskJuggler
273
282
 
274
283
  # Convert the intermediate representation into HTML elements.
275
284
  def to_html
285
+ noChilds = false
276
286
  html =
277
287
  case @category
278
288
  when :richtext
@@ -296,10 +306,12 @@ class TaskJuggler
296
306
  end
297
307
  el
298
308
  when :hline
309
+ noChilds = true
299
310
  XMLElement.new('hr')
300
311
  when :paragraph
301
312
  XMLElement.new('p')
302
313
  when :pre
314
+ noChilds = true
303
315
  pre = XMLElement.new('pre')
304
316
  pre << XMLText.new(@children[0])
305
317
  when :bulletlist1
@@ -327,19 +339,12 @@ class TaskJuggler
327
339
  when :numberitem3
328
340
  XMLElement.new('li')
329
341
  when :ref
330
- if @data.include?(':')
331
- protocol, path = @data.split(':')
332
- raise TjException.new, "Reference protocol empty." if protocol.empty?
333
- if path.empty?
334
- raise TjException.new, "Reference path may not be empty."
335
- end
336
- args = children_to_s.split(' ')
337
- return @richText.protocolHandler(protocol).to_html(path, args)
338
- else
339
- XMLElement.new('a', 'href' => "#{@data}.html")
340
- end
342
+ XMLElement.new('a', 'href' => "#{@data}.html")
341
343
  when :href
342
344
  XMLElement.new('a', 'href' => @data, 'target' => '_blank')
345
+ when :blockfunc
346
+ noChilds = true
347
+ @richText.protocolHandler(@data[0]).to_html(@data[1])
343
348
  when :italic
344
349
  XMLElement.new('i')
345
350
  when :bold
@@ -347,13 +352,14 @@ class TaskJuggler
347
352
  when :code
348
353
  XMLElement.new('code')
349
354
  when :text
355
+ noChilds = true
350
356
  XMLText.new(@children[0])
351
357
  else
352
358
  raise TjException.new, "Unknown RichTextElement category #{@category}"
353
359
  end
354
360
 
355
361
  # Some elements never have leaves.
356
- return html if [ :text, :pre, :hline ].include?(@category)
362
+ return html if noChilds
357
363
 
358
364
  @children.each do |el_i|
359
365
  html << el_i.to_html
@@ -33,6 +33,7 @@ class TaskJuggler
33
33
  # These are the tokens that can be returned by the RichTextScanner.
34
34
  @variables = %w( LINEBREAK SPACE WORD BOLD ITALIC CODE BOLDITALIC PRE
35
35
  HREF HREFEND REF REFEND HLINE
36
+ BLOCKFUNCSTART BLOCKFUNCEND ID STRING
36
37
  TITLE1 TITLE2 TITLE3 TITLE1END TITLE2END TITLE3END
37
38
  BULLET1 BULLET2 BULLET3 NUMBER1 NUMBER2 NUMBER3 )
38
39
  # Load the rule set into the parser.
@@ -22,27 +22,24 @@ class TaskJuggler
22
22
  class RichTextProtocolExample < RichTextProtocolHandler
23
23
 
24
24
  def initialize
25
- super('example')
25
+ super(nil, 'example')
26
26
  end
27
27
 
28
28
  # Not supported for this protocol
29
- def to_s(path, args)
29
+ def to_s(args)
30
30
  ''
31
31
  end
32
32
 
33
33
  # Return a XMLElement tree that represents the example file as HTML code.
34
- def to_html(path, args)
35
- if args.length > 1
36
- raise "The example protocol may only take upto one argument."
37
- elsif args.length == 1
38
- tag = args[0]
39
- else
40
- tag = nil
34
+ def to_html(args)
35
+ unless (file = args['file'])
36
+ raise "'file' argument missing"
41
37
  end
38
+ tag = args['tag']
42
39
 
43
40
  example = TjpExample.new
44
41
  fileName = AppConfig.dataDirs('test')[0] +
45
- "TestSuite/Syntax/Correct/#{path}.tjp"
42
+ "TestSuite/Syntax/Correct/#{file}.tjp"
46
43
  example.open(fileName)
47
44
  frame = XMLElement.new('div', 'class' => 'codeframe')
48
45
  frame << (pre = XMLElement.new('pre', 'class' => 'code'))
@@ -55,7 +52,7 @@ class TaskJuggler
55
52
  end
56
53
 
57
54
  # Not supported for this protocol.
58
- def to_tagged(path, args)
55
+ def to_tagged(args)
59
56
  nil
60
57
  end
61
58
 
@@ -25,8 +25,18 @@ class TaskJuggler
25
25
 
26
26
  attr_reader :protocol
27
27
 
28
- def initialize(protocol)
28
+ def initialize(project, protocol, sourceFileInfo = nil)
29
+ @project = project
29
30
  @protocol = protocol
31
+ @sourceFileInfo = sourceFileInfo
32
+ end
33
+
34
+ def error(id, text)
35
+ message = Message.new(id, 'error', text, nil, nil, @sourceFileInfo)
36
+ @project.sendMessage(message)
37
+
38
+ # An empty strings signals an already reported error
39
+ raise TjException.new, ''
30
40
  end
31
41
 
32
42
  end