taskjuggler 0.0.3 → 0.0.4

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 (495) hide show
  1. data/benchmarks/UTF-8-Strings.rb +58 -0
  2. data/data/css/tjmanual.css +52 -0
  3. data/data/css/tjreport.css +195 -0
  4. data/data/icons/details.png +0 -0
  5. data/data/icons/flag-green.png +0 -0
  6. data/data/icons/flag-red.png +0 -0
  7. data/data/icons/flag-yellow.png +0 -0
  8. data/data/icons/resource.png +0 -0
  9. data/data/icons/resourcegroup.png +0 -0
  10. data/data/icons/task.png +0 -0
  11. data/data/icons/taskgroup.png +0 -0
  12. data/data/icons/trend-down.png +0 -0
  13. data/data/icons/trend-flat.png +0 -0
  14. data/data/icons/trend-up.png +0 -0
  15. data/data/scripts/wz_tooltip.js +1301 -0
  16. data/doc/classes/AppConfig.html +298 -230
  17. data/doc/classes/Arguments.html +8 -8
  18. data/doc/classes/Object.html +7 -7
  19. data/doc/classes/String.html +89 -89
  20. data/doc/classes/TaskJuggler.html +396 -264
  21. data/doc/classes/TaskJuggler/Account.html +18 -18
  22. data/doc/classes/TaskJuggler/AccountAttribute.html +26 -26
  23. data/doc/classes/TaskJuggler/AccountScenario.html +12 -12
  24. data/doc/classes/TaskJuggler/Allocation.html +30 -30
  25. data/doc/classes/TaskJuggler/AllocationAttribute.html +26 -26
  26. data/doc/classes/TaskJuggler/AttributeBase.html +227 -115
  27. data/doc/classes/TaskJuggler/AttributeDefinition.html +6 -6
  28. data/doc/classes/TaskJuggler/BatchProcessor.html +117 -83
  29. data/doc/classes/TaskJuggler/Booking.html +18 -18
  30. data/doc/classes/TaskJuggler/BookingListAttribute.html +26 -26
  31. data/doc/classes/TaskJuggler/BooleanAttribute.html +26 -26
  32. data/doc/classes/TaskJuggler/CSVFile.html +24 -24
  33. data/doc/classes/TaskJuggler/CellSettingPattern.html +201 -0
  34. data/doc/classes/TaskJuggler/CellSettingPatternList.html +253 -0
  35. data/doc/classes/TaskJuggler/Charge.html +18 -18
  36. data/doc/classes/TaskJuggler/ChargeListAttribute.html +20 -20
  37. data/doc/classes/TaskJuggler/ChargeSet.html +37 -37
  38. data/doc/classes/TaskJuggler/ChargeSetListAttribute.html +26 -26
  39. data/doc/classes/TaskJuggler/ColumnListAttribute.html +20 -20
  40. data/doc/classes/TaskJuggler/ColumnTable.html +40 -40
  41. data/doc/classes/TaskJuggler/DateAttribute.html +54 -15
  42. data/doc/classes/TaskJuggler/DefinitionListAttribute.html +10 -10
  43. data/doc/classes/TaskJuggler/DependencyListAttribute.html +47 -47
  44. data/doc/classes/TaskJuggler/DurationAttribute.html +30 -30
  45. data/doc/classes/TaskJuggler/FixnumAttribute.html +20 -20
  46. data/doc/classes/TaskJuggler/FlagListAttribute.html +43 -43
  47. data/doc/classes/TaskJuggler/FloatAttribute.html +30 -30
  48. data/doc/classes/TaskJuggler/FormatListAttribute.html +21 -21
  49. data/doc/classes/TaskJuggler/GanttChart.html +48 -48
  50. data/doc/classes/TaskJuggler/GanttContainer.html +42 -42
  51. data/doc/classes/TaskJuggler/GanttHeader.html +12 -12
  52. data/doc/classes/TaskJuggler/GanttHeaderScaleItem.html +12 -12
  53. data/doc/classes/TaskJuggler/GanttLine.html +24 -24
  54. data/doc/classes/TaskJuggler/GanttLoadStack.html +18 -18
  55. data/doc/classes/TaskJuggler/GanttMilestone.html +42 -42
  56. data/doc/classes/TaskJuggler/GanttRouter.html +24 -24
  57. data/doc/classes/TaskJuggler/GanttTaskBar.html +42 -42
  58. data/doc/classes/TaskJuggler/HTMLDocument.html +13 -13
  59. data/doc/classes/TaskJuggler/HTMLGraphics.html +12 -12
  60. data/doc/classes/TaskJuggler/Interval.html +57 -57
  61. data/doc/classes/TaskJuggler/IntervalListAttribute.html +47 -47
  62. data/doc/classes/TaskJuggler/JobInfo.html +68 -12
  63. data/doc/classes/TaskJuggler/Journal.html +266 -20
  64. data/doc/classes/TaskJuggler/JournalEntry.html +79 -23
  65. data/doc/classes/TaskJuggler/JournalEntryList.html +454 -0
  66. data/doc/classes/TaskJuggler/KeywordArray.html +10 -10
  67. data/doc/classes/TaskJuggler/KeywordDocumentation.html +171 -170
  68. data/doc/classes/TaskJuggler/Limits.html +36 -36
  69. data/doc/classes/TaskJuggler/Limits/Limit.html +30 -30
  70. data/doc/classes/TaskJuggler/LimitsAttribute.html +40 -40
  71. data/doc/classes/TaskJuggler/ListAttributeBase.html +20 -20
  72. data/doc/classes/TaskJuggler/Log.html +145 -107
  73. data/doc/classes/TaskJuggler/LogicalAttribute.html +65 -36
  74. data/doc/classes/TaskJuggler/LogicalExpression.html +61 -24
  75. data/doc/classes/TaskJuggler/LogicalExpressionAttribute.html +20 -20
  76. data/doc/classes/TaskJuggler/LogicalFlag.html +31 -51
  77. data/doc/classes/TaskJuggler/LogicalFunction.html +64 -53
  78. data/doc/classes/TaskJuggler/LogicalOperation.html +103 -55
  79. data/doc/classes/TaskJuggler/Macro.html +6 -6
  80. data/doc/classes/TaskJuggler/MacroParser.html +36 -36
  81. data/doc/classes/TaskJuggler/MacroTable.html +37 -37
  82. data/doc/classes/TaskJuggler/Message.html +12 -12
  83. data/doc/classes/TaskJuggler/MessageHandler.html +32 -20
  84. data/doc/classes/TaskJuggler/Navigator.html +110 -46
  85. data/doc/classes/TaskJuggler/NavigatorElement.html +449 -0
  86. data/doc/classes/TaskJuggler/OnShiftCache.html +24 -24
  87. data/doc/classes/TaskJuggler/Project.html +1158 -893
  88. data/doc/classes/TaskJuggler/ProjectFileParser.html +94 -91
  89. data/doc/classes/TaskJuggler/PropertyAttribute.html +20 -20
  90. data/doc/classes/TaskJuggler/PropertyList.html +225 -155
  91. data/doc/classes/TaskJuggler/PropertySet.html +375 -332
  92. data/doc/classes/TaskJuggler/PropertyTreeNode.html +750 -510
  93. data/doc/classes/TaskJuggler/Query.html +404 -139
  94. data/doc/classes/TaskJuggler/{RTPNavigator.html → RTFNavigator.html} +57 -56
  95. data/doc/classes/TaskJuggler/RTFQuery.html +343 -0
  96. data/doc/classes/TaskJuggler/{RTPReport.html → RTFReport.html} +70 -67
  97. data/doc/classes/TaskJuggler/RealFormat.html +18 -18
  98. data/doc/classes/TaskJuggler/RealFormatAttribute.html +10 -10
  99. data/doc/classes/TaskJuggler/ReferenceAttribute.html +107 -40
  100. data/doc/classes/TaskJuggler/RemoteServiceManager.html +335 -0
  101. data/doc/classes/TaskJuggler/Report.html +66 -64
  102. data/doc/classes/TaskJuggler/ReportBase.html +112 -123
  103. data/doc/classes/TaskJuggler/ReportContext.html +43 -38
  104. data/doc/classes/TaskJuggler/ReportServer.html +320 -0
  105. data/doc/classes/TaskJuggler/ReportTable.html +42 -42
  106. data/doc/classes/TaskJuggler/ReportTableCell.html +221 -129
  107. data/doc/classes/TaskJuggler/ReportTableColumn.html +27 -27
  108. data/doc/classes/TaskJuggler/ReportTableLegend.html +24 -24
  109. data/doc/classes/TaskJuggler/ReportTableLine.html +126 -80
  110. data/doc/classes/TaskJuggler/Resource.html +12 -12
  111. data/doc/classes/TaskJuggler/ResourceListAttribute.html +82 -47
  112. data/doc/classes/TaskJuggler/ResourceListRE.html +43 -39
  113. data/doc/classes/TaskJuggler/ResourceScenario.html +413 -321
  114. data/doc/classes/TaskJuggler/RichText.html +64 -248
  115. data/doc/classes/TaskJuggler/RichTextAttribute.html +94 -30
  116. data/doc/classes/TaskJuggler/RichTextDocument.html +87 -85
  117. data/doc/classes/TaskJuggler/RichTextElement.html +456 -363
  118. data/doc/classes/TaskJuggler/RichTextException.html +13 -13
  119. data/doc/classes/TaskJuggler/{RichTextProtocolExample.html → RichTextFunctionExample.html} +64 -63
  120. data/doc/classes/TaskJuggler/{RichTextProtocolHandler.html → RichTextFunctionHandler.html} +42 -36
  121. data/doc/classes/TaskJuggler/RichTextIntermediate.html +563 -0
  122. data/doc/classes/TaskJuggler/RichTextParser.html +54 -51
  123. data/doc/classes/TaskJuggler/RichTextScanner.html +94 -92
  124. data/doc/classes/TaskJuggler/RichTextSnip.html +96 -60
  125. data/doc/classes/TaskJuggler/RichTextSyntaxRules.html +369 -227
  126. data/doc/classes/TaskJuggler/Scenario.html +6 -6
  127. data/doc/classes/TaskJuggler/ScenarioData.html +37 -37
  128. data/doc/classes/TaskJuggler/ScenarioListAttribute.html +31 -31
  129. data/doc/classes/TaskJuggler/Scoreboard.html +66 -66
  130. data/doc/classes/TaskJuggler/Shift.html +18 -18
  131. data/doc/classes/TaskJuggler/ShiftAssignment.html +54 -54
  132. data/doc/classes/TaskJuggler/ShiftAssignments.html +78 -78
  133. data/doc/classes/TaskJuggler/ShiftAssignmentsAttribute.html +40 -40
  134. data/doc/classes/TaskJuggler/ShiftScenario.html +24 -24
  135. data/doc/classes/TaskJuggler/SortListAttribute.html +22 -22
  136. data/doc/classes/TaskJuggler/SourceFileInfo.html +12 -12
  137. data/doc/classes/TaskJuggler/StringAttribute.html +30 -30
  138. data/doc/classes/TaskJuggler/SymbolAttribute.html +20 -20
  139. data/doc/classes/TaskJuggler/SyntaxReference.html +42 -42
  140. data/doc/classes/TaskJuggler/TOCEntry.html +12 -12
  141. data/doc/classes/TaskJuggler/TSResourceRecord.html +197 -0
  142. data/doc/classes/TaskJuggler/TSTaskRecord.html +215 -0
  143. data/doc/classes/TaskJuggler/TableColumnDefinition.html +64 -43
  144. data/doc/classes/TaskJuggler/TableOfContents.html +18 -18
  145. data/doc/classes/TaskJuggler/TableReport.html +447 -468
  146. data/doc/classes/TaskJuggler/Task.html +12 -12
  147. data/doc/classes/TaskJuggler/TaskDependency.html +12 -12
  148. data/doc/classes/TaskJuggler/TaskListAttribute.html +47 -47
  149. data/doc/classes/TaskJuggler/TaskListRE.html +43 -39
  150. data/doc/classes/TaskJuggler/TaskScenario.html +529 -282
  151. data/doc/classes/TaskJuggler/TextParser.html +215 -194
  152. data/doc/classes/TaskJuggler/TextParser/Pattern.html +97 -97
  153. data/doc/classes/TaskJuggler/TextParser/Rule.html +84 -84
  154. data/doc/classes/TaskJuggler/TextParser/StackElement.html +16 -15
  155. data/doc/classes/TaskJuggler/TextParser/TextParserResultArray.html +12 -12
  156. data/doc/classes/TaskJuggler/TextParser/TokenDoc.html +6 -6
  157. data/doc/classes/TaskJuggler/TextReport.html +77 -74
  158. data/doc/classes/TaskJuggler/TextScanner.html +294 -281
  159. data/doc/classes/TaskJuggler/TextScanner/BufferStreamHandle.html +70 -70
  160. data/doc/classes/TaskJuggler/TextScanner/FileStreamHandle.html +59 -60
  161. data/doc/classes/TaskJuggler/TextScanner/StreamHandle.html +12 -12
  162. data/doc/classes/TaskJuggler/TimeSheetReport.html +406 -0
  163. data/doc/classes/TaskJuggler/TjException.html +6 -6
  164. data/doc/classes/TaskJuggler/TjTime.html +522 -513
  165. data/doc/classes/TaskJuggler/TjpExample.html +25 -25
  166. data/doc/classes/TaskJuggler/TjpExportRE.html +21 -24
  167. data/doc/classes/TaskJuggler/TjpSyntaxRules.html +6177 -4318
  168. data/doc/classes/TaskJuggler/UserManual.html +212 -213
  169. data/doc/classes/TaskJuggler/WorkingHours.html +49 -49
  170. data/doc/classes/TaskJuggler/WorkingHoursAttribute.html +53 -53
  171. data/doc/classes/TaskJuggler/XMLBlob.html +21 -21
  172. data/doc/classes/TaskJuggler/XMLComment.html +21 -21
  173. data/doc/classes/TaskJuggler/XMLDocument.html +27 -26
  174. data/doc/classes/TaskJuggler/XMLElement.html +86 -50
  175. data/doc/classes/TaskJuggler/XMLNamedText.html +11 -11
  176. data/doc/classes/TaskJuggler/XMLText.html +36 -36
  177. data/doc/files/COPYING.html +1 -1
  178. data/doc/files/README.html +1 -1
  179. data/doc/files/lib/AccountScenario_rb.html +3 -2
  180. data/doc/files/lib/Account_rb.html +3 -2
  181. data/doc/files/lib/Allocation_rb.html +3 -2
  182. data/doc/files/lib/AppConfig_rb.html +5 -2
  183. data/doc/files/lib/AttributeBase_rb.html +3 -2
  184. data/doc/files/lib/AttributeDefinition_rb.html +3 -2
  185. data/doc/files/lib/Attributes_rb.html +3 -2
  186. data/doc/files/lib/BatchProcessor_rb.html +4 -3
  187. data/doc/files/lib/Booking_rb.html +3 -2
  188. data/doc/files/lib/ChargeSet_rb.html +3 -2
  189. data/doc/files/lib/Charge_rb.html +3 -2
  190. data/doc/files/lib/HTMLDocument_rb.html +3 -2
  191. data/doc/files/lib/Interval_rb.html +3 -2
  192. data/doc/files/lib/Journal_rb.html +4 -3
  193. data/doc/files/lib/KeywordArray_rb.html +3 -2
  194. data/doc/files/lib/KeywordDocumentation_rb.html +3 -2
  195. data/doc/files/lib/Limits_rb.html +3 -2
  196. data/doc/files/lib/Log_rb.html +3 -2
  197. data/doc/files/lib/LogicalExpression_rb.html +3 -2
  198. data/doc/files/lib/LogicalFunction_rb.html +3 -2
  199. data/doc/files/lib/LogicalOperation_rb.html +3 -2
  200. data/doc/files/lib/MacroParser_rb.html +3 -2
  201. data/doc/files/lib/MacroTable_rb.html +3 -2
  202. data/doc/files/lib/MessageHandler_rb.html +3 -2
  203. data/doc/files/lib/Message_rb.html +3 -2
  204. data/doc/files/lib/ProjectFileParser_rb.html +7 -4
  205. data/doc/files/lib/Project_rb.html +3 -2
  206. data/doc/files/lib/PropertyList_rb.html +3 -2
  207. data/doc/files/lib/PropertySet_rb.html +3 -2
  208. data/doc/files/lib/PropertyTreeNode_rb.html +3 -2
  209. data/doc/files/lib/Query_rb.html +3 -2
  210. data/doc/files/lib/{RTPNavigator_rb.html → RTFNavigator_rb.html} +8 -7
  211. data/doc/files/lib/RTFQuery_rb.html +121 -0
  212. data/doc/files/lib/{RTPReport_rb.html → RTFReport_rb.html} +8 -7
  213. data/doc/files/lib/RealFormat_rb.html +3 -2
  214. data/doc/files/lib/RemoteServiceManager_rb.html +117 -0
  215. data/doc/files/lib/ReportServer_rb.html +107 -0
  216. data/doc/files/lib/ResourceScenario_rb.html +3 -2
  217. data/doc/files/lib/Resource_rb.html +3 -2
  218. data/doc/files/lib/RichTextDocument_rb.html +4 -3
  219. data/doc/files/lib/RichTextElement_rb.html +3 -2
  220. data/doc/files/lib/{RichTextProtocolExample_rb.html → RichTextFunctionExample_rb.html} +8 -7
  221. data/doc/files/lib/{RichTextProtocolHandler_rb.html → RichTextFunctionHandler_rb.html} +7 -6
  222. data/doc/files/lib/RichTextParser_rb.html +3 -2
  223. data/doc/files/lib/RichTextScanner_rb.html +3 -2
  224. data/doc/files/lib/RichTextSnip_rb.html +3 -2
  225. data/doc/files/lib/RichTextSyntaxRules_rb.html +3 -2
  226. data/doc/files/lib/RichText_rb.html +3 -2
  227. data/doc/files/lib/ScenarioData_rb.html +3 -2
  228. data/doc/files/lib/Scenario_rb.html +3 -2
  229. data/doc/files/lib/Scoreboard_rb.html +3 -2
  230. data/doc/files/lib/ShiftAssignments_rb.html +3 -2
  231. data/doc/files/lib/ShiftScenario_rb.html +3 -2
  232. data/doc/files/lib/Shift_rb.html +3 -2
  233. data/doc/files/lib/SourceFileInfo_rb.html +3 -2
  234. data/doc/files/lib/SyntaxReference_rb.html +3 -2
  235. data/doc/files/lib/TOCEntry_rb.html +3 -2
  236. data/doc/files/lib/TableColumnDefinition_rb.html +3 -2
  237. data/doc/files/lib/TableOfContents_rb.html +3 -2
  238. data/doc/files/lib/TaskDependency_rb.html +3 -2
  239. data/doc/files/lib/TaskJuggler_rb.html +7 -2
  240. data/doc/files/lib/TaskScenario_rb.html +3 -2
  241. data/doc/files/lib/Task_rb.html +3 -2
  242. data/doc/files/lib/TextParser/Pattern_rb.html +4 -3
  243. data/doc/files/lib/TextParser/Rule_rb.html +4 -3
  244. data/doc/files/lib/TextParser/StackElement_rb.html +4 -3
  245. data/doc/files/lib/TextParser/TokenDoc_rb.html +4 -3
  246. data/doc/files/lib/TextParser_rb.html +3 -2
  247. data/doc/files/lib/TextScanner_rb.html +3 -2
  248. data/doc/files/lib/Tj3Config_rb.html +3 -2
  249. data/doc/files/lib/TjException_rb.html +3 -2
  250. data/doc/files/lib/TjTime_rb.html +3 -2
  251. data/doc/files/lib/TjpExample_rb.html +3 -2
  252. data/doc/files/lib/TjpSyntaxRules_rb.html +3 -2
  253. data/doc/files/lib/UTF8String_rb.html +14 -6
  254. data/doc/files/lib/UserManual_rb.html +6 -3
  255. data/doc/files/lib/WorkingHours_rb.html +3 -2
  256. data/doc/files/lib/XMLDocument_rb.html +3 -2
  257. data/doc/files/lib/XMLElement_rb.html +3 -2
  258. data/doc/files/lib/deep_copy_rb.html +3 -2
  259. data/doc/files/lib/reports/CSVFile_rb.html +3 -2
  260. data/doc/files/lib/reports/ColumnTable_rb.html +3 -2
  261. data/doc/files/lib/reports/GanttChart_rb.html +3 -2
  262. data/doc/files/lib/reports/GanttContainer_rb.html +3 -2
  263. data/doc/files/lib/reports/GanttHeaderScaleItem_rb.html +3 -2
  264. data/doc/files/lib/reports/GanttHeader_rb.html +3 -2
  265. data/doc/files/lib/reports/GanttLine_rb.html +3 -2
  266. data/doc/files/lib/reports/GanttLoadStack_rb.html +3 -2
  267. data/doc/files/lib/reports/GanttMilestone_rb.html +3 -2
  268. data/doc/files/lib/reports/GanttRouter_rb.html +3 -2
  269. data/doc/files/lib/reports/GanttTaskBar_rb.html +3 -2
  270. data/doc/files/lib/reports/HTMLGraphics_rb.html +3 -2
  271. data/doc/files/lib/reports/Navigator_rb.html +3 -2
  272. data/doc/files/lib/reports/ReportBase_rb.html +3 -2
  273. data/doc/files/lib/reports/ReportContext_rb.html +3 -2
  274. data/doc/files/lib/reports/ReportTableCell_rb.html +3 -2
  275. data/doc/files/lib/reports/ReportTableColumn_rb.html +3 -2
  276. data/doc/files/lib/reports/ReportTableLegend_rb.html +3 -2
  277. data/doc/files/lib/reports/ReportTableLine_rb.html +3 -2
  278. data/doc/files/lib/reports/ReportTable_rb.html +3 -2
  279. data/doc/files/lib/reports/Report_rb.html +7 -2
  280. data/doc/files/lib/reports/ResourceListRE_rb.html +3 -2
  281. data/doc/files/lib/reports/TableReport_rb.html +3 -2
  282. data/doc/files/lib/reports/TaskListRE_rb.html +3 -2
  283. data/doc/files/lib/reports/TextReport_rb.html +4 -3
  284. data/doc/files/lib/reports/TimeSheetReport_rb.html +117 -0
  285. data/doc/files/lib/reports/TjpExportRE_rb.html +3 -2
  286. data/doc/files/lib/taskjuggler3_rb.html +94 -77
  287. data/doc/files/lib/tj3client_rb.html +280 -0
  288. data/doc/files/lib/tj3man_rb.html +10 -9
  289. data/doc/fr_class_index.html +27 -5
  290. data/doc/fr_file_index.html +15 -7
  291. data/doc/fr_method_index.html +1312 -1020
  292. data/examples/tutorial.tjp +113 -14
  293. data/gem_spec.rb +2 -1
  294. data/lib/Account.rb +1 -1
  295. data/lib/AccountScenario.rb +1 -1
  296. data/lib/Allocation.rb +1 -1
  297. data/lib/AppConfig.rb +23 -10
  298. data/lib/AttributeBase.rb +34 -6
  299. data/lib/AttributeDefinition.rb +1 -1
  300. data/lib/Attributes.rb +51 -16
  301. data/lib/BatchProcessor.rb +204 -77
  302. data/lib/Booking.rb +1 -1
  303. data/lib/Charge.rb +1 -1
  304. data/lib/ChargeSet.rb +1 -1
  305. data/lib/HTMLDocument.rb +2 -2
  306. data/lib/Interval.rb +1 -1
  307. data/lib/Journal.rb +231 -9
  308. data/lib/KeywordArray.rb +1 -1
  309. data/lib/KeywordDocumentation.rb +6 -4
  310. data/lib/Limits.rb +1 -1
  311. data/lib/Log.rb +8 -1
  312. data/lib/LogicalExpression.rb +14 -13
  313. data/lib/LogicalFunction.rb +88 -14
  314. data/lib/LogicalOperation.rb +124 -53
  315. data/lib/MacroParser.rb +1 -1
  316. data/lib/MacroTable.rb +2 -2
  317. data/lib/Message.rb +1 -1
  318. data/lib/MessageHandler.rb +7 -3
  319. data/lib/Project.rb +93 -14
  320. data/lib/ProjectFileParser.rb +30 -15
  321. data/lib/PropertyList.rb +103 -36
  322. data/lib/PropertySet.rb +22 -10
  323. data/lib/PropertyTreeNode.rb +120 -15
  324. data/lib/Query.rb +119 -48
  325. data/lib/{RTPNavigator.rb → RTFNavigator.rb} +11 -10
  326. data/lib/RTFQuery.rb +166 -0
  327. data/lib/{RTPReport.rb → RTFReport.rb} +11 -8
  328. data/lib/RealFormat.rb +1 -1
  329. data/lib/RemoteServiceManager.rb +80 -0
  330. data/lib/ReportServer.rb +66 -0
  331. data/lib/Resource.rb +1 -1
  332. data/lib/ResourceScenario.rb +48 -19
  333. data/lib/RichText.rb +98 -41
  334. data/lib/RichTextDocument.rb +10 -8
  335. data/lib/RichTextElement.rb +72 -28
  336. data/lib/{RichTextProtocolExample.rb → RichTextFunctionExample.rb} +8 -7
  337. data/lib/{RichTextProtocolHandler.rb → RichTextFunctionHandler.rb} +12 -14
  338. data/lib/RichTextParser.rb +6 -3
  339. data/lib/RichTextScanner.rb +91 -19
  340. data/lib/RichTextSnip.rb +8 -3
  341. data/lib/RichTextSyntaxRules.rb +103 -45
  342. data/lib/Scenario.rb +1 -1
  343. data/lib/ScenarioData.rb +2 -2
  344. data/lib/Scoreboard.rb +1 -1
  345. data/lib/Shift.rb +1 -1
  346. data/lib/ShiftAssignments.rb +1 -1
  347. data/lib/ShiftScenario.rb +1 -1
  348. data/lib/SourceFileInfo.rb +1 -1
  349. data/lib/SyntaxReference.rb +2 -2
  350. data/lib/TOCEntry.rb +1 -1
  351. data/lib/TableColumnDefinition.rb +59 -16
  352. data/lib/TableOfContents.rb +1 -1
  353. data/lib/Task.rb +1 -1
  354. data/lib/TaskDependency.rb +1 -1
  355. data/lib/TaskJuggler.rb +31 -8
  356. data/lib/TaskScenario.rb +165 -16
  357. data/lib/TextParser.rb +36 -22
  358. data/lib/TextParser/Pattern.rb +3 -3
  359. data/lib/TextParser/Rule.rb +2 -2
  360. data/lib/TextParser/StackElement.rb +4 -3
  361. data/lib/TextParser/TokenDoc.rb +2 -2
  362. data/lib/TextScanner.rb +52 -37
  363. data/lib/Tj3Config.rb +6 -5
  364. data/lib/TjException.rb +1 -1
  365. data/lib/TjTime.rb +12 -3
  366. data/lib/TjpExample.rb +1 -1
  367. data/lib/TjpSyntaxRules.rb +1044 -150
  368. data/lib/UTF8String.rb +2 -1
  369. data/lib/UserManual.rb +18 -70
  370. data/lib/WorkingHours.rb +3 -3
  371. data/lib/XMLDocument.rb +3 -2
  372. data/lib/XMLElement.rb +6 -1
  373. data/lib/deep_copy.rb +1 -1
  374. data/lib/reports/CSVFile.rb +1 -1
  375. data/lib/reports/ColumnTable.rb +9 -9
  376. data/lib/reports/GanttChart.rb +1 -1
  377. data/lib/reports/GanttContainer.rb +1 -1
  378. data/lib/reports/GanttHeader.rb +1 -1
  379. data/lib/reports/GanttHeaderScaleItem.rb +1 -1
  380. data/lib/reports/GanttLine.rb +40 -40
  381. data/lib/reports/GanttLoadStack.rb +1 -1
  382. data/lib/reports/GanttMilestone.rb +1 -1
  383. data/lib/reports/GanttRouter.rb +1 -1
  384. data/lib/reports/GanttTaskBar.rb +1 -1
  385. data/lib/reports/HTMLGraphics.rb +1 -1
  386. data/lib/reports/Navigator.rb +149 -22
  387. data/lib/reports/Report.rb +115 -172
  388. data/lib/reports/ReportBase.rb +22 -27
  389. data/lib/reports/ReportContext.rb +29 -15
  390. data/lib/reports/ReportTable.rb +1 -1
  391. data/lib/reports/ReportTableCell.rb +120 -27
  392. data/lib/reports/ReportTableColumn.rb +3 -3
  393. data/lib/reports/ReportTableLegend.rb +1 -1
  394. data/lib/reports/ReportTableLine.rb +10 -2
  395. data/lib/reports/ResourceListRE.rb +5 -1
  396. data/lib/reports/TableReport.rb +237 -287
  397. data/lib/reports/TaskListRE.rb +5 -1
  398. data/lib/reports/TextReport.rb +7 -4
  399. data/lib/reports/TimeSheetReport.rb +233 -0
  400. data/lib/reports/TjpExportRE.rb +2 -2
  401. data/lib/taskjuggler3.rb +27 -11
  402. data/lib/tj3client.rb +110 -0
  403. data/lib/tj3man.rb +4 -4
  404. data/manual/Getting_Started +0 -50
  405. data/manual/How_To_Contribute +6 -13
  406. data/manual/Installation +102 -28
  407. data/manual/Intro +11 -1
  408. data/manual/Reporting_Bugs +23 -7
  409. data/manual/Rich_Text_Attributes +59 -6
  410. data/manual/TaskJuggler_2x_Migration +27 -0
  411. data/manual/The_TaskJuggler_Syntax +104 -0
  412. data/manual/Tutorial +10 -9
  413. data/prj_cfg.rb +8 -2
  414. data/tasks/csts.rake +1 -1
  415. data/tasks/manual.rake +5 -3
  416. data/test/MessageChecker.rb +1 -1
  417. data/test/TestSuite/HTML-Reports/Alerts.html +172 -0
  418. data/test/TestSuite/HTML-Reports/Alerts.tjp +77 -0
  419. data/test/TestSuite/HTML-Reports/CellText.html +758 -0
  420. data/test/TestSuite/HTML-Reports/CellText.tjp +75 -0
  421. data/test/TestSuite/HTML-Reports/ColumnPeriods.html +156 -0
  422. data/test/TestSuite/HTML-Reports/ColumnPeriods.tjp +44 -0
  423. data/test/TestSuite/HTML-Reports/IsOngoing.html +172 -0
  424. data/test/TestSuite/HTML-Reports/IsOngoing.tjp +34 -0
  425. data/test/TestSuite/HTML-Reports/LogicalFunctions.html +80 -0
  426. data/test/TestSuite/HTML-Reports/LogicalFunctions.tjp +20 -0
  427. data/test/TestSuite/HTML-Reports/Query.html +31 -0
  428. data/test/TestSuite/HTML-Reports/Query.tjp +28 -0
  429. data/test/TestSuite/HTML-Reports/Sorting.tjp +68 -0
  430. data/test/TestSuite/HTML-Reports/TimeSheet.tjp +69 -0
  431. data/test/TestSuite/HTML-Reports/UDAQuery.tjp +27 -0
  432. data/test/TestSuite/HTML-Reports/css/tjmanual.css +52 -0
  433. data/test/TestSuite/HTML-Reports/css/tjreport.css +195 -0
  434. data/test/TestSuite/HTML-Reports/depArrows.html +842 -0
  435. data/test/TestSuite/HTML-Reports/icons/details.png +0 -0
  436. data/test/TestSuite/HTML-Reports/icons/flag-green.png +0 -0
  437. data/test/TestSuite/HTML-Reports/icons/flag-red.png +0 -0
  438. data/test/TestSuite/HTML-Reports/icons/flag-yellow.png +0 -0
  439. data/test/TestSuite/HTML-Reports/icons/resource.png +0 -0
  440. data/test/TestSuite/HTML-Reports/icons/resourcegroup.png +0 -0
  441. data/test/TestSuite/HTML-Reports/icons/task.png +0 -0
  442. data/test/TestSuite/HTML-Reports/icons/taskgroup.png +0 -0
  443. data/test/TestSuite/HTML-Reports/reference.tjp +7 -8
  444. data/test/TestSuite/HTML-Reports/scripts/scripts/wz_tooltip.js +1301 -0
  445. data/test/TestSuite/HTML-Reports/scripts/wz_tooltip.js +1301 -0
  446. data/test/TestSuite/Scheduler/Correct/Mandatory.tjp +34 -0
  447. data/test/TestSuite/Syntax/Correct/Celltext.tjp +2 -1
  448. data/test/TestSuite/Syntax/Correct/Journal.tjp +2 -2
  449. data/test/TestSuite/Syntax/Correct/LogicalExpression.tjp +2 -1
  450. data/test/TestSuite/Syntax/Correct/LogicalFunction.tjp +20 -0
  451. data/test/TestSuite/Syntax/Correct/Query.tjp +18 -0
  452. data/test/TestSuite/Syntax/Correct/StatusSheet.tjp +45 -0
  453. data/test/TestSuite/Syntax/Correct/TimeSheet.tjp +49 -0
  454. data/test/TestSuite/Syntax/Correct/icons/details.png +0 -0
  455. data/test/TestSuite/Syntax/Correct/icons/flag-green.png +0 -0
  456. data/test/TestSuite/Syntax/Correct/icons/flag-red.png +0 -0
  457. data/test/TestSuite/Syntax/Correct/icons/flag-yellow.png +0 -0
  458. data/test/TestSuite/Syntax/Correct/icons/resource.png +0 -0
  459. data/test/TestSuite/Syntax/Correct/icons/resourcegroup.png +0 -0
  460. data/test/TestSuite/Syntax/Correct/icons/task.png +0 -0
  461. data/test/TestSuite/Syntax/Correct/icons/taskgroup.png +0 -0
  462. data/test/TestSuite/Syntax/Correct/scripts/wz_tooltip.js +1301 -0
  463. data/test/TestSuite/Syntax/Correct/tutorial.tjp +113 -14
  464. data/test/TestSuite/Syntax/Errors/macro_stack_overflow.tjp +28 -0
  465. data/test/TestSuite/Syntax/Errors/unsupported_token.tjp +12 -0
  466. data/test/all.rb +2 -2
  467. data/test/test_BatchProcessor.rb +42 -13
  468. data/test/test_CSV-Reports.rb +1 -1
  469. data/test/test_Journal.rb +176 -0
  470. data/test/test_Limits.rb +1 -1
  471. data/test/test_LogicalExpression.rb +14 -5
  472. data/test/test_MacroTable.rb +1 -1
  473. data/test/test_Project.rb +1 -1
  474. data/test/test_PropertySet.rb +1 -1
  475. data/test/test_Query.rb +1 -1
  476. data/test/test_RealFormat.rb +1 -1
  477. data/test/test_RichText.rb +30 -20
  478. data/test/test_Scheduler.rb +1 -1
  479. data/test/test_ShiftAssignments.rb +2 -2
  480. data/test/test_Syntax.rb +1 -1
  481. data/test/test_TextScanner.rb +1 -1
  482. data/test/test_TjTime.rb +1 -1
  483. data/test/test_TjpExample.rb +1 -1
  484. data/test/test_UTF8String.rb +1 -1
  485. data/test/test_WorkingHours.rb +1 -1
  486. data/test/test_deep_copy.rb +2 -2
  487. metadata +610 -532
  488. data/doc/files/lib/ms_test_rb.html +0 -90
  489. data/examples/ContactList.html +0 -1467
  490. data/examples/Deliveries.html +0 -485
  491. data/examples/Development.html +0 -2525
  492. data/examples/Overview.html +0 -747
  493. data/examples/Resource Graph.html +0 -616
  494. data/lib/ms_test.rb +0 -27
  495. data/test/TestSuite/HTML-Reports/reference-export.html +0 -187
@@ -1,31 +1,32 @@
1
1
  #!/usr/bin/env ruby -w
2
2
  # encoding: UTF-8
3
3
  #
4
- # = RichTextProtocolExample.rb -- The TaskJuggler III Project Management Software
4
+ # = RichTextFunctionExample.rb -- The TaskJuggler III Project Management Software
5
5
  #
6
- # Copyright (c) 2006, 2007, 2008, 2009 by Chris Schlaeger <cs@kde.org>
6
+ # Copyright (c) 2006, 2007, 2008, 2009, 2010 by Chris Schlaeger <cs@kde.org>
7
7
  #
8
8
  # This program is free software; you can redistribute it and/or modify
9
9
  # it under the terms of version 2 of the GNU General Public License as
10
10
  # published by the Free Software Foundation.
11
11
  #
12
12
 
13
- require 'RichTextProtocolHandler'
13
+ require 'RichTextFunctionHandler'
14
14
  require 'TjpExample'
15
15
  require 'XMLElement'
16
16
 
17
17
  class TaskJuggler
18
18
 
19
- # This class is a specialized RichTextProtocolHandler that turns references to
19
+ # This class is a specialized RichTextFunctionHandler that turns references to
20
20
  # TJP example code in the test/TestSuite/Syntax/Correct directory into
21
21
  # embedded example code. It currently only supports HTML.
22
- class RichTextProtocolExample < RichTextProtocolHandler
22
+ class RichTextFunctionExample < RichTextFunctionHandler
23
23
 
24
24
  def initialize
25
25
  super(nil, 'example')
26
+ @blockFunction = true
26
27
  end
27
28
 
28
- # Not supported for this protocol
29
+ # Not supported for this function
29
30
  def to_s(args)
30
31
  ''
31
32
  end
@@ -51,7 +52,7 @@ class TaskJuggler
51
52
  frame
52
53
  end
53
54
 
54
- # Not supported for this protocol.
55
+ # Not supported for this function.
55
56
  def to_tagged(args)
56
57
  nil
57
58
  end
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env ruby -w
2
2
  # encoding: UTF-8
3
3
  #
4
- # = RichTextProtocolHandler.rb -- The TaskJuggler III Project Management Software
4
+ # = RichTextFunctionHandler.rb -- The TaskJuggler III Project Management Software
5
5
  #
6
- # Copyright (c) 2006, 2007, 2008, 2009 by Chris Schlaeger <cs@kde.org>
6
+ # Copyright (c) 2006, 2007, 2008, 2009, 2010 by Chris Schlaeger <cs@kde.org>
7
7
  #
8
8
  # This program is free software; you can redistribute it and/or modify
9
9
  # it under the terms of version 2 of the GNU General Public License as
@@ -12,31 +12,29 @@
12
12
 
13
13
  class TaskJuggler
14
14
 
15
- # This class is the abstract base class for all RichText protocol handlers. A
16
- # protocol handler is responsible for a certain protocol such as 'example' or
17
- # 'query'. Protocols are used in internal RichText references such as
18
- # '[[example:Allocation 2]]'. 'example' is the protocol, 'Allocation' is the
19
- # path and '2' is the first argument. Arguments are optional. Protocol handler
15
+ # This class is the abstract base class for all RichText function handlers. A
16
+ # function handler is responsible for a certain function such as 'example' or
17
+ # 'query'. functions are used in internal RichText references such as
18
+ # '[[example:Allocation 2]]'. 'example' is the function, 'Allocation' is the
19
+ # path and '2' is the first argument. Arguments are optional. function handler
20
20
  # can turn such internal references into Strings or XMLElement trees.
21
21
  # Therefor, each derived handler needs to implement a to_s, to_html and
22
22
  # to_tagged method that takes two parameter. The first is the path, the second
23
23
  # is the argument Array.
24
- class RichTextProtocolHandler
24
+ class RichTextFunctionHandler
25
25
 
26
- attr_reader :protocol
26
+ attr_reader :function, :blockFunction
27
27
 
28
- def initialize(project, protocol, sourceFileInfo = nil)
28
+ def initialize(project, function, sourceFileInfo = nil)
29
29
  @project = project
30
- @protocol = protocol
30
+ @function = function
31
+ @blockFunction = false
31
32
  @sourceFileInfo = sourceFileInfo
32
33
  end
33
34
 
34
35
  def error(id, text)
35
36
  message = Message.new(id, 'error', text, nil, nil, @sourceFileInfo)
36
37
  @project.sendMessage(message)
37
-
38
- # An empty strings signals an already reported error
39
- raise TjException.new, ''
40
38
  end
41
39
 
42
40
  end
@@ -3,7 +3,7 @@
3
3
  #
4
4
  # = RichTextParser.rb -- The TaskJuggler III Project Management Software
5
5
  #
6
- # Copyright (c) 2006, 2007, 2008, 2009 by Chris Schlaeger <cs@kde.org>
6
+ # Copyright (c) 2006, 2007, 2008, 2009, 2010 by Chris Schlaeger <cs@kde.org>
7
7
  #
8
8
  # This program is free software; you can redistribute it and/or modify
9
9
  # it under the terms of version 2 of the GNU General Public License as
@@ -27,15 +27,18 @@ class TaskJuggler
27
27
 
28
28
  # Create the parser and initialize the rule set. _rt_ is the RichText object
29
29
  # the resulting tree of RichTextElement objects should belong to.
30
- def initialize(rt, sectionCounter = [ 0, 0, 0] )
30
+ def initialize(rti, sectionCounter = [ 0, 0, 0], tokenSet = nil)
31
31
  super()
32
- @richText = rt
32
+ @richTextI = rti
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
+ QUERY
37
+ INLINEFUNCSTART INLINEFUNCEND
36
38
  BLOCKFUNCSTART BLOCKFUNCEND ID STRING
37
39
  TITLE1 TITLE2 TITLE3 TITLE1END TITLE2END TITLE3END
38
40
  BULLET1 BULLET2 BULLET3 NUMBER1 NUMBER2 NUMBER3 )
41
+ limitTokenSet(tokenSet)
39
42
  # Load the rule set into the parser.
40
43
  initRules
41
44
  # The sections and numbered list can each nest 3 levels deep. We use these
@@ -3,7 +3,7 @@
3
3
  #
4
4
  # = RichTextScanner.rb -- The TaskJuggler III Project Management Software
5
5
  #
6
- # Copyright (c) 2006, 2007, 2008, 2009 by Chris Schlaeger <cs@kde.org>
6
+ # Copyright (c) 2006, 2007, 2008, 2009, 2010 by Chris Schlaeger <cs@kde.org>
7
7
  #
8
8
  # This program is free software; you can redistribute it and/or modify
9
9
  # it under the terms of version 2 of the GNU General Public License as
@@ -53,6 +53,7 @@ class TaskJuggler
53
53
  # This is a wrapper for nextToken only used for debugging.
54
54
  #def nextToken
55
55
  # tok = nextTokenI
56
+ # raise "Token Error:" unless tok && tok[0] && tok[1]
56
57
  # puts "#{tok[0]}: #{tok[1]}"
57
58
  # tok
58
59
  #end
@@ -68,6 +69,8 @@ class TaskJuggler
68
69
 
69
70
  if @mode == :funcarg
70
71
  return nextTokenFuncArg
72
+ elsif @mode == :href
73
+ return nextTokenHRef
71
74
  end
72
75
  if @beginOfLine && @mode == :wiki
73
76
  if (res = nextTokenWikiBOL)
@@ -124,7 +127,7 @@ class TaskJuggler
124
127
  # <-inlinefunc par1="value1" ... ->
125
128
  def nextTokenFuncArg
126
129
  token = [ '.', '<END>' ]
127
- while c = nextChar
130
+ while (c = nextChar)
128
131
  case c
129
132
  when ' ', "\n", "\t"
130
133
  if (tok = readBlanks(c))
@@ -153,6 +156,42 @@ class TaskJuggler
153
156
  returnChar
154
157
  end
155
158
  end
159
+ token
160
+ end
161
+
162
+ def nextTokenHRef
163
+ token = [ '.', '<END>' ]
164
+ while (c = nextChar)
165
+ if c.nil?
166
+ # We've reached the end of the text.
167
+ return [ '.', '<END>' ]
168
+ elsif c == ' ' || c == "\t" || c == "\n"
169
+ # Sequences of tabs, spaces and newlines are treated as token
170
+ # boundaries, but otherwise they are ignored.
171
+ readSequence(" \n\t")
172
+ return [ 'SPACE', ' ' ]
173
+ elsif c == '<' && !@ignoreInlineMarkup
174
+ if nextChar == '-' && isIdStart(peek(1))
175
+ token = readId('', 'QUERY')
176
+ unless nextChar == '-' && nextChar == '>'
177
+ error('unterminated_query',
178
+ "Inline query must be terminated with '->'")
179
+ end
180
+ return token
181
+ else
182
+ # It's not a query.
183
+ returnChar(2)
184
+ @ignoreInlineMarkup = true
185
+ next
186
+ end
187
+ elsif c == ']'
188
+ @mode = :wiki
189
+ return [ 'HREFEND', ']' ]
190
+ else
191
+ return nextTokenWord(c)
192
+ end
193
+ end
194
+ token
156
195
  end
157
196
 
158
197
  def nextTokenWikiBOL
@@ -234,7 +273,7 @@ class TaskJuggler
234
273
  elsif c == ' ' || c == "\t"
235
274
  # Sequences of tabs or spaces are treated as token boundaries, but
236
275
  # otherwise they are ignored.
237
- readSequence(' ', "\t")
276
+ readSequence(" \t")
238
277
  [ 'SPACE', ' ' ]
239
278
  elsif c == "'" && !@ignoreInlineMarkup
240
279
  # Sequence of 2 ' means italic, 3 ' means bold, 4 ' means monospaced
@@ -270,10 +309,15 @@ class TaskJuggler
270
309
  end
271
310
  elsif c == '['
272
311
  level = readSequenceMax('[', 2)
273
- [ level == 1 ? 'HREF' : 'REF', '[' * level ]
274
- elsif c == ']'
275
- level = readSequenceMax(']', 2)
276
- [ level == 1 ? 'HREFEND' : 'REFEND', ']' * level ]
312
+ if level == 1
313
+ @mode = :href
314
+ [ 'HREF' , '[' ]
315
+ else
316
+ [ 'REF', '[[' ]
317
+ end
318
+ elsif c == ']' && peek == ']'
319
+ nextChar
320
+ [ 'REFEND', ']]' ]
277
321
  elsif c == "\n"
278
322
  nextTokenNewline
279
323
  elsif c == '<' && !@ignoreInlineMarkup
@@ -291,7 +335,7 @@ class TaskJuggler
291
335
  elsif c == ' ' || c == "\t"
292
336
  # Sequences of tabs or spaces are treated as token boundaries, but
293
337
  # otherwise they are ignored.
294
- readSequence(' ', "\t")
338
+ readSequence(" \t")
295
339
  [ 'SPACE', ' ' ]
296
340
  elsif c == "\n"
297
341
  nextTokenNewline
@@ -310,14 +354,24 @@ class TaskJuggler
310
354
  # the next character into the start of a control sequence.
311
355
  # Hard linebreaks consist of a newline followed by another newline or
312
356
  # any of the begin-of-line control characters.
313
- if (c = nextChar) && "\n*#< =-".include?(c)
357
+ if (c = nextChar).nil?
358
+ # We hit the end of the text.
359
+ [ '.', '<END>' ]
360
+ elsif c == '<' && peekMatch('[')
361
+ # the '<' can be a start of a block (BLOCKFUNCSTART) or inline text
362
+ # (INLINEFUNCSTART). Only for the first case the linebreak is real.
363
+ returnChar if c != "\n"
364
+ # The next character may be a control character.
365
+ @beginOfLine = true
366
+ [ 'LINEBREAK', "\n" ]
367
+ elsif "\n*# =-".include?(c)
368
+ # These characters correspond to the first characters of a block
369
+ # element. When they are found at the begin of the line, the newline
370
+ # was really a line break.
314
371
  returnChar if c != "\n"
315
372
  # The next character may be a control character.
316
373
  @beginOfLine = true
317
374
  [ 'LINEBREAK', "\n" ]
318
- elsif c.nil?
319
- # We hit the end of the text.
320
- [ '.', '<END>' ]
321
375
  else
322
376
  # Single line breaks are treated as spaces. Return the char after
323
377
  # the newline and start with this one again.
@@ -335,6 +389,11 @@ class TaskJuggler
335
389
  # Turn most wiki markup interpretation on.
336
390
  @pos += '/nowiki>'.length
337
391
  @mode = :wiki
392
+ elsif peekMatch('-') && @mode == :wiki
393
+ nextChar
394
+ # Switch the parser to function argument parsing mode.
395
+ @mode = :funcarg
396
+ return [ 'INLINEFUNCSTART', '<-' ]
338
397
  else
339
398
  # We've not found a valid control sequence. Push back the character
340
399
  # and make sure we treat it as a normal character.
@@ -353,11 +412,15 @@ class TaskJuggler
353
412
  str << c
354
413
  # Now we can collect characters of a word until we hit a whitespace.
355
414
  while (c = nextChar) && !" \n\t".include?(c)
356
- if @mode == :wiki
415
+ case @mode
416
+ when :wiki
357
417
  # Or at least to ' characters in a row.
358
418
  break if c == "'" && peek == "'"
359
- # Or a ] or <
419
+ # Or a -, ] or <
360
420
  break if ']<'.include?(c)
421
+ when :href
422
+ # Look for - of the end mark -> end ']'
423
+ break if c == '-' || c == ']' || c == '<'
361
424
  else
362
425
  # Make sure we find the </nowiki> tag even within a word.
363
426
  break if c == '<'
@@ -372,7 +435,12 @@ class TaskJuggler
372
435
  # Deliver the next character. Keep track of the cursor position. In case we
373
436
  # reach the end, nil is returned.
374
437
  def nextChar
375
- return nil if @pos >= @textLength
438
+ if @pos >= @textLength
439
+ # Correct @pos so that returnChar works properly but mutliple reads of
440
+ # EOT are ignored.
441
+ @pos = @textLength + 1
442
+ return nil
443
+ end
376
444
  c = @text[@pos]
377
445
  @pos += 1
378
446
  if c == ?\n
@@ -430,9 +498,9 @@ class TaskJuggler
430
498
  # Read a sequence of characters that are all contained in the _chars_ Array.
431
499
  # If a character is found that is not in _chars_ the method returns the so
432
500
  # far found sequence of chars as String.
433
- def readSequence(*chars)
501
+ def readSequence(chars)
434
502
  sequence = ''
435
- while chars.include?(c = nextChar)
503
+ while (c = nextChar) && chars.index(c)
436
504
  sequence << c
437
505
  end
438
506
  # Push back the character that did no longer match.
@@ -485,7 +553,11 @@ class TaskJuggler
485
553
  end
486
554
  end
487
555
 
488
- def readId(c)
556
+ def isIdStart(c)
557
+ (('a'..'z') === c || ('A'..'Z') === c || c == '_')
558
+ end
559
+
560
+ def readId(c, tokenType = 'ID')
489
561
  token = ""
490
562
  token << c
491
563
  while (c = nextChar) &&
@@ -494,7 +566,7 @@ class TaskJuggler
494
566
  token << c
495
567
  end
496
568
  returnChar
497
- return [ 'ID', token ]
569
+ return [ tokenType, token ]
498
570
  end
499
571
 
500
572
  def readString(terminator)
data/lib/RichTextSnip.rb CHANGED
@@ -3,7 +3,7 @@
3
3
  #
4
4
  # = RichTextSnip.rb -- The TaskJuggler III Project Management Software
5
5
  #
6
- # Copyright (c) 2006, 2007, 2008, 2009 by Chris Schlaeger <cs@kde.org>
6
+ # Copyright (c) 2006, 2007, 2008, 2009, 2010 by Chris Schlaeger <cs@kde.org>
7
7
  #
8
8
  # This program is free software; you can redistribute it and/or modify
9
9
  # it under the terms of version 2 of the GNU General Public License as
@@ -40,18 +40,23 @@ class TaskJuggler
40
40
  file.each_line { |line| text += line }
41
41
  end
42
42
  begin
43
- @richText = RichText.new(text, sectionCounter)
43
+ rText = RichText.new(text, @document.functionHandlers)
44
+ @richText = rText.generateIntermediateFormat(sectionCounter)
44
45
  rescue RichTextException => msg
45
46
  $stderr.puts "Error in RichText of file '#{fileName}'\n" +
46
47
  "Line #{msg.lineNo}: #{msg.text}\n" +
47
48
  "#{msg.line}"
48
49
  exit
49
50
  end
50
- @richText.setProtocolHandlers(@document.protocolHandlers)
51
51
 
52
52
  @prevSnip = @nextSnip = nil
53
53
  end
54
54
 
55
+ # Set the target for all anchor links in the document.
56
+ def linkTarget=(target)
57
+ @richText.linkTarget = target
58
+ end
59
+
55
60
  # Generate a TableOfContents object from the section headers of the
56
61
  # RichTextSnip.
57
62
  def tableOfContents(toc, fileName)
@@ -3,7 +3,7 @@
3
3
  #
4
4
  # = RichTextSyntaxRules.rb -- The TaskJuggler III Project Management Software
5
5
  #
6
- # Copyright (c) 2006, 2007, 2008, 2009 by Chris Schlaeger <cs@kde.org>
6
+ # Copyright (c) 2006, 2007, 2008, 2009, 2010 by Chris Schlaeger <cs@kde.org>
7
7
  #
8
8
  # This program is free software; you can redistribute it and/or modify
9
9
  # it under the terms of version 2 of the GNU General Public License as
@@ -31,7 +31,7 @@ class TaskJuggler
31
31
  # This is the entry node.
32
32
  def rule_richtext
33
33
  pattern(%w( !sections !blankLines . ), lambda {
34
- el = RichTextElement.new(@richText, :richtext, @val[0])
34
+ el = RichTextElement.new(@richTextI, :richtext, @val[0])
35
35
  })
36
36
  end
37
37
 
@@ -44,20 +44,20 @@ class TaskJuggler
44
44
  @val[0]
45
45
  })
46
46
  pattern(%w( $HLINE !blankLines ), lambda {
47
- RichTextElement.new(@richText, :hline, @val[0])
47
+ RichTextElement.new(@richTextI, :hline, @val[0])
48
48
  })
49
49
  pattern(%w( !paragraph ), lambda {
50
50
  @val[0]
51
51
  })
52
52
  pattern(%w( $PRE ), lambda {
53
- RichTextElement.new(@richText, :pre, @val[0])
53
+ RichTextElement.new(@richTextI, :pre, @val[0])
54
54
  })
55
55
  pattern(%w( !bulletList1 ), lambda {
56
- RichTextElement.new(@richText, :bulletlist1, @val[0])
56
+ RichTextElement.new(@richTextI, :bulletlist1, @val[0])
57
57
  })
58
58
  pattern(%w( !numberList1 ), lambda {
59
59
  @numberListCounter = [ 0, 0, 0 ]
60
- RichTextElement.new(@richText, :numberlist1, @val[0])
60
+ RichTextElement.new(@richTextI, :numberlist1, @val[0])
61
61
  })
62
62
  pattern(%w( !blockFunction !blankLines ), lambda {
63
63
  @val[0]
@@ -79,7 +79,7 @@ class TaskJuggler
79
79
  def rule_title1
80
80
  pattern(%w( $TITLE1 !text $TITLE1END ), lambda {
81
81
  @val[1][-1].appendSpace = false
82
- el = RichTextElement.new(@richText, :title1, @val[1])
82
+ el = RichTextElement.new(@richTextI, :title1, @val[1])
83
83
  @sectionCounter[0] += 1
84
84
  @sectionCounter[1] = @sectionCounter[2] = 0
85
85
  el.data = @sectionCounter.dup
@@ -90,7 +90,7 @@ class TaskJuggler
90
90
  def rule_title2
91
91
  pattern(%w( $TITLE2 !text $TITLE2END ), lambda {
92
92
  @val[1][-1].appendSpace = false
93
- el = RichTextElement.new(@richText, :title2, @val[1])
93
+ el = RichTextElement.new(@richTextI, :title2, @val[1])
94
94
  @sectionCounter[1] += 1
95
95
  @sectionCounter[2] = 0
96
96
  el.data = @sectionCounter.dup
@@ -101,7 +101,7 @@ class TaskJuggler
101
101
  def rule_title3
102
102
  pattern(%w( $TITLE3 !text $TITLE3END ), lambda {
103
103
  @val[1][-1].appendSpace = false
104
- el = RichTextElement.new(@richText, :title3, @val[1])
104
+ el = RichTextElement.new(@richTextI, :title3, @val[1])
105
105
  @sectionCounter[2] += 1
106
106
  el.data = @sectionCounter.dup
107
107
  el
@@ -112,27 +112,27 @@ class TaskJuggler
112
112
  optional
113
113
  repeatable
114
114
  pattern(%w( $BULLET1 !text $LINEBREAK), lambda {
115
- RichTextElement.new(@richText, :bulletitem1, @val[1])
115
+ RichTextElement.new(@richTextI, :bulletitem1, @val[1])
116
116
  })
117
117
  pattern(%w( !bulletList2 ), lambda {
118
- RichTextElement.new(@richText, :bulletlist2, @val[0])
118
+ RichTextElement.new(@richTextI, :bulletlist2, @val[0])
119
119
  })
120
120
  end
121
121
 
122
122
  def rule_bulletList2
123
123
  repeatable
124
124
  pattern(%w( $BULLET2 !text $LINEBREAK), lambda {
125
- RichTextElement.new(@richText, :bulletitem2, @val[1])
125
+ RichTextElement.new(@richTextI, :bulletitem2, @val[1])
126
126
  })
127
127
  pattern(%w( !bulletList3 ), lambda {
128
- RichTextElement.new(@richText, :bulletlist3, @val[0])
128
+ RichTextElement.new(@richTextI, :bulletlist3, @val[0])
129
129
  })
130
130
  end
131
131
 
132
132
  def rule_bulletList3
133
133
  repeatable
134
134
  pattern(%w( $BULLET3 !text $LINEBREAK), lambda {
135
- RichTextElement.new(@richText, :bulletitem3, @val[1])
135
+ RichTextElement.new(@richTextI, :bulletitem3, @val[1])
136
136
  })
137
137
  end
138
138
 
@@ -140,35 +140,35 @@ class TaskJuggler
140
140
  optional
141
141
  repeatable
142
142
  pattern(%w( $NUMBER1 !text $LINEBREAK), lambda {
143
- el = RichTextElement.new(@richText, :numberitem1, @val[1])
143
+ el = RichTextElement.new(@richTextI, :numberitem1, @val[1])
144
144
  @numberListCounter[0] += 1
145
145
  el.data = @numberListCounter.dup
146
146
  el
147
147
  })
148
148
  pattern(%w( !numberList2 ), lambda {
149
149
  @numberListCounter[1, 2] = [ 0, 0 ]
150
- RichTextElement.new(@richText, :numberlist2, @val[0])
150
+ RichTextElement.new(@richTextI, :numberlist2, @val[0])
151
151
  })
152
152
  end
153
153
 
154
154
  def rule_numberList2
155
155
  repeatable
156
156
  pattern(%w( $NUMBER2 !text $LINEBREAK), lambda {
157
- el = RichTextElement.new(@richText, :numberitem2, @val[1])
157
+ el = RichTextElement.new(@richTextI, :numberitem2, @val[1])
158
158
  @numberListCounter[1] += 1
159
159
  el.data = @numberListCounter.dup
160
160
  el
161
161
  })
162
162
  pattern(%w( !numberList3 ), lambda {
163
163
  @numberListCounter[2] = 0
164
- RichTextElement.new(@richText, :numberlist3, @val[0])
164
+ RichTextElement.new(@richTextI, :numberlist3, @val[0])
165
165
  })
166
166
  end
167
167
 
168
168
  def rule_numberList3
169
169
  repeatable
170
170
  pattern(%w( $NUMBER3 !text $LINEBREAK), lambda {
171
- el = RichTextElement.new(@richText, :numberitem3, @val[1])
171
+ el = RichTextElement.new(@richTextI, :numberitem3, @val[1])
172
172
  @numberListCounter[2] += 1
173
173
  el.data = @numberListCounter.dup
174
174
  el
@@ -177,7 +177,7 @@ class TaskJuggler
177
177
 
178
178
  def rule_paragraph
179
179
  pattern(%w( !text $LINEBREAK ), lambda {
180
- RichTextElement.new(@richText, :paragraph, @val[0])
180
+ RichTextElement.new(@richTextI, :paragraph, @val[0])
181
181
  })
182
182
  end
183
183
 
@@ -186,26 +186,36 @@ class TaskJuggler
186
186
  pattern(%w( !plainTextWithLinks ), lambda {
187
187
  @val[0]
188
188
  })
189
- pattern(%w( $ITALIC !plainTextWithLinks $ITALIC !space ), lambda {
190
- el = RichTextElement.new(@richText, :italic, @val[1])
191
- el.appendSpace = !@val[3].empty?
189
+ pattern(%w( !inlineFunction ), lambda {
190
+ @val[0]
191
+ })
192
+ pattern(%w( $ITALIC !space !plainTextWithLinks $ITALIC !space ), lambda {
193
+ el = RichTextElement.new(@richTextI, :italic, @val[2])
194
+ # Since the italic end marker will disappear we need to make sure
195
+ # there was no space before it.
196
+ @val[2].last.appendSpace = false if @val[2].last
197
+ el.appendSpace = !@val[4].empty?
192
198
  el
193
199
  })
194
- pattern(%w( $BOLD !plainTextWithLinks $BOLD !space ), lambda {
195
- el = RichTextElement.new(@richText, :bold, @val[1])
196
- el.appendSpace = !@val[3].empty?
200
+ pattern(%w( $BOLD !space !plainTextWithLinks $BOLD !space ), lambda {
201
+ el = RichTextElement.new(@richTextI, :bold, @val[2])
202
+ @val[2].last.appendSpace = false if @val[2].last
203
+ el.appendSpace = !@val[4].empty?
197
204
  el
198
205
  })
199
- pattern(%w( $CODE !plainTextWithLinks $CODE !space ), lambda {
200
- el = RichTextElement.new(@richText, :code, @val[1])
201
- el.appendSpace = !@val[3].empty?
206
+ pattern(%w( $CODE !space !plainTextWithLinks $CODE !space ), lambda {
207
+ el = RichTextElement.new(@richTextI, :code, @val[2])
208
+ @val[2].last.appendSpace = false if @val[2].last
209
+ el.appendSpace = !@val[4].empty?
202
210
  el
203
211
  })
204
- pattern(%w( $BOLDITALIC !plainTextWithLinks $BOLDITALIC !space ), lambda {
205
- el = RichTextElement.new(@richText,
206
- :bold, RichTextElement.new(@richText,
207
- :italic, @val[1]))
208
- el.appendSpace = !@val[3].empty?
212
+ pattern(%w( $BOLDITALIC !space !plainTextWithLinks $BOLDITALIC !space ),
213
+ lambda {
214
+ el = RichTextElement.new(@richTextI,
215
+ :bold, RichTextElement.new(@richTextI,
216
+ :italic, @val[2]))
217
+ @val[2].last.appendSpace = false if @val[2].last
218
+ el.appendSpace = !@val[4].empty?
209
219
  el
210
220
  })
211
221
  end
@@ -216,8 +226,8 @@ class TaskJuggler
216
226
  @val[0]
217
227
  })
218
228
  pattern(%w( $REF $WORD !space !plainText $REFEND !space ), lambda {
219
- el = RichTextElement.new(@richText, :ref,
220
- RichTextElement.new(@richText,
229
+ el = RichTextElement.new(@richTextI, :ref,
230
+ RichTextElement.new(@richTextI,
221
231
  :text, @val[3].empty? ?
222
232
  @val[1] :
223
233
  @val[3].join(' ')))
@@ -225,28 +235,53 @@ class TaskJuggler
225
235
  el.appendSpace = !@val[5].empty?
226
236
  el
227
237
  })
228
- pattern(%w( $HREF $WORD !space !plainText $HREFEND !space ), lambda {
229
- el = RichTextElement.new(@richText, :href,
230
- RichTextElement.new(@richText,
231
- :text, @val[3].empty? ?
232
- @val[1] :
233
- @val[3].join(' ')))
234
- el.data = @val[1]
238
+ pattern(%w( $HREF !wordWithQueries !space !plainTextWithQueries
239
+ $HREFEND !space ), lambda {
240
+ el = RichTextElement.new(@richTextI, :href, @val[3].empty? ?
241
+ @val[1] : @val[3])
242
+ el.data = RichTextElement.new(@richTextI, :richtext, @val[1])
235
243
  el.appendSpace = !@val[5].empty?
236
244
  el
237
245
  })
238
246
  end
239
247
 
248
+ def rule_wordWithQueries
249
+ repeatable
250
+ pattern(%w( $WORD ), lambda {
251
+ RichTextElement.new(@richTextI, :text, @val[0])
252
+ })
253
+ pattern(%w( $QUERY ), lambda {
254
+ # The ${attribute} syntax is a shortcut for an embedded query inline
255
+ # function. It can only be used within a ReportTableCell context that
256
+ # provides a property and a scope property.
257
+ el = RichTextElement.new(@richTextI, :inlinefunc)
258
+ # Data is a 2 element Array with the function name and a Hash for the
259
+ # arguments.
260
+ el.data = ['query', { 'attribute' => @val[0] } ]
261
+ el
262
+ })
263
+
264
+ end
265
+
240
266
  def rule_plainText
241
267
  repeatable
242
268
  optional
243
269
  pattern(%w( $WORD !space ), lambda {
244
- el = RichTextElement.new(@richText, :text, @val[0])
270
+ el = RichTextElement.new(@richTextI, :text, @val[0])
245
271
  el.appendSpace = !@val[1].empty?
246
272
  el
247
273
  })
248
274
  end
249
275
 
276
+ def rule_plainTextWithQueries
277
+ repeatable
278
+ optional
279
+ pattern(%w( !wordWithQueries !space ), lambda {
280
+ @val[0][-1].appendSpace = true if !@val[1].empty?
281
+ @val[0]
282
+ })
283
+ end
284
+
250
285
  def rule_space
251
286
  optional
252
287
  repeatable
@@ -267,10 +302,33 @@ class TaskJuggler
267
302
  lambda {
268
303
  args = {}
269
304
  @val[2].each { |arg| args[arg[0]] = arg[1] }
270
- el = RichTextElement.new(@richText, :blockfunc)
305
+ el = RichTextElement.new(@richTextI, :blockfunc)
306
+ # Data is a 2 element Array with the function name and a Hash for the
307
+ # arguments.
308
+ unless @richTextI.richText.functionHandler(@val[1], true)
309
+ error('bad_block_function',
310
+ "Unsupported block function #{@val[1]}")
311
+ end
312
+ el.data = [@val[1], args ]
313
+ el
314
+ })
315
+ end
316
+
317
+ def rule_inlineFunction
318
+ pattern(%w( $INLINEFUNCSTART $ID !functionArguments $INLINEFUNCEND
319
+ !space ),
320
+ lambda {
321
+ args = {}
322
+ @val[2].each { |arg| args[arg[0]] = arg[1] }
323
+ el = RichTextElement.new(@richTextI, :inlinefunc)
271
324
  # Data is a 2 element Array with the function name and a Hash for the
272
325
  # arguments.
326
+ unless @richTextI.richText.functionHandler(@val[1], false)
327
+ error('bad_inline_function',
328
+ "Unsupported inline function #{@val[1]}")
329
+ end
273
330
  el.data = [@val[1], args ]
331
+ el.appendSpace = !@val[4].empty?
274
332
  el
275
333
  })
276
334
  end