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.
- data/benchmarks/UTF-8-Strings.rb +58 -0
- data/data/css/tjmanual.css +52 -0
- data/data/css/tjreport.css +195 -0
- data/data/icons/details.png +0 -0
- data/data/icons/flag-green.png +0 -0
- data/data/icons/flag-red.png +0 -0
- data/data/icons/flag-yellow.png +0 -0
- data/data/icons/resource.png +0 -0
- data/data/icons/resourcegroup.png +0 -0
- data/data/icons/task.png +0 -0
- data/data/icons/taskgroup.png +0 -0
- data/data/icons/trend-down.png +0 -0
- data/data/icons/trend-flat.png +0 -0
- data/data/icons/trend-up.png +0 -0
- data/data/scripts/wz_tooltip.js +1301 -0
- data/doc/classes/AppConfig.html +298 -230
- data/doc/classes/Arguments.html +8 -8
- data/doc/classes/Object.html +7 -7
- data/doc/classes/String.html +89 -89
- data/doc/classes/TaskJuggler.html +396 -264
- data/doc/classes/TaskJuggler/Account.html +18 -18
- data/doc/classes/TaskJuggler/AccountAttribute.html +26 -26
- data/doc/classes/TaskJuggler/AccountScenario.html +12 -12
- data/doc/classes/TaskJuggler/Allocation.html +30 -30
- data/doc/classes/TaskJuggler/AllocationAttribute.html +26 -26
- data/doc/classes/TaskJuggler/AttributeBase.html +227 -115
- data/doc/classes/TaskJuggler/AttributeDefinition.html +6 -6
- data/doc/classes/TaskJuggler/BatchProcessor.html +117 -83
- data/doc/classes/TaskJuggler/Booking.html +18 -18
- data/doc/classes/TaskJuggler/BookingListAttribute.html +26 -26
- data/doc/classes/TaskJuggler/BooleanAttribute.html +26 -26
- data/doc/classes/TaskJuggler/CSVFile.html +24 -24
- data/doc/classes/TaskJuggler/CellSettingPattern.html +201 -0
- data/doc/classes/TaskJuggler/CellSettingPatternList.html +253 -0
- data/doc/classes/TaskJuggler/Charge.html +18 -18
- data/doc/classes/TaskJuggler/ChargeListAttribute.html +20 -20
- data/doc/classes/TaskJuggler/ChargeSet.html +37 -37
- data/doc/classes/TaskJuggler/ChargeSetListAttribute.html +26 -26
- data/doc/classes/TaskJuggler/ColumnListAttribute.html +20 -20
- data/doc/classes/TaskJuggler/ColumnTable.html +40 -40
- data/doc/classes/TaskJuggler/DateAttribute.html +54 -15
- data/doc/classes/TaskJuggler/DefinitionListAttribute.html +10 -10
- data/doc/classes/TaskJuggler/DependencyListAttribute.html +47 -47
- data/doc/classes/TaskJuggler/DurationAttribute.html +30 -30
- data/doc/classes/TaskJuggler/FixnumAttribute.html +20 -20
- data/doc/classes/TaskJuggler/FlagListAttribute.html +43 -43
- data/doc/classes/TaskJuggler/FloatAttribute.html +30 -30
- data/doc/classes/TaskJuggler/FormatListAttribute.html +21 -21
- data/doc/classes/TaskJuggler/GanttChart.html +48 -48
- data/doc/classes/TaskJuggler/GanttContainer.html +42 -42
- data/doc/classes/TaskJuggler/GanttHeader.html +12 -12
- data/doc/classes/TaskJuggler/GanttHeaderScaleItem.html +12 -12
- data/doc/classes/TaskJuggler/GanttLine.html +24 -24
- data/doc/classes/TaskJuggler/GanttLoadStack.html +18 -18
- data/doc/classes/TaskJuggler/GanttMilestone.html +42 -42
- data/doc/classes/TaskJuggler/GanttRouter.html +24 -24
- data/doc/classes/TaskJuggler/GanttTaskBar.html +42 -42
- data/doc/classes/TaskJuggler/HTMLDocument.html +13 -13
- data/doc/classes/TaskJuggler/HTMLGraphics.html +12 -12
- data/doc/classes/TaskJuggler/Interval.html +57 -57
- data/doc/classes/TaskJuggler/IntervalListAttribute.html +47 -47
- data/doc/classes/TaskJuggler/JobInfo.html +68 -12
- data/doc/classes/TaskJuggler/Journal.html +266 -20
- data/doc/classes/TaskJuggler/JournalEntry.html +79 -23
- data/doc/classes/TaskJuggler/JournalEntryList.html +454 -0
- data/doc/classes/TaskJuggler/KeywordArray.html +10 -10
- data/doc/classes/TaskJuggler/KeywordDocumentation.html +171 -170
- data/doc/classes/TaskJuggler/Limits.html +36 -36
- data/doc/classes/TaskJuggler/Limits/Limit.html +30 -30
- data/doc/classes/TaskJuggler/LimitsAttribute.html +40 -40
- data/doc/classes/TaskJuggler/ListAttributeBase.html +20 -20
- data/doc/classes/TaskJuggler/Log.html +145 -107
- data/doc/classes/TaskJuggler/LogicalAttribute.html +65 -36
- data/doc/classes/TaskJuggler/LogicalExpression.html +61 -24
- data/doc/classes/TaskJuggler/LogicalExpressionAttribute.html +20 -20
- data/doc/classes/TaskJuggler/LogicalFlag.html +31 -51
- data/doc/classes/TaskJuggler/LogicalFunction.html +64 -53
- data/doc/classes/TaskJuggler/LogicalOperation.html +103 -55
- data/doc/classes/TaskJuggler/Macro.html +6 -6
- data/doc/classes/TaskJuggler/MacroParser.html +36 -36
- data/doc/classes/TaskJuggler/MacroTable.html +37 -37
- data/doc/classes/TaskJuggler/Message.html +12 -12
- data/doc/classes/TaskJuggler/MessageHandler.html +32 -20
- data/doc/classes/TaskJuggler/Navigator.html +110 -46
- data/doc/classes/TaskJuggler/NavigatorElement.html +449 -0
- data/doc/classes/TaskJuggler/OnShiftCache.html +24 -24
- data/doc/classes/TaskJuggler/Project.html +1158 -893
- data/doc/classes/TaskJuggler/ProjectFileParser.html +94 -91
- data/doc/classes/TaskJuggler/PropertyAttribute.html +20 -20
- data/doc/classes/TaskJuggler/PropertyList.html +225 -155
- data/doc/classes/TaskJuggler/PropertySet.html +375 -332
- data/doc/classes/TaskJuggler/PropertyTreeNode.html +750 -510
- data/doc/classes/TaskJuggler/Query.html +404 -139
- data/doc/classes/TaskJuggler/{RTPNavigator.html → RTFNavigator.html} +57 -56
- data/doc/classes/TaskJuggler/RTFQuery.html +343 -0
- data/doc/classes/TaskJuggler/{RTPReport.html → RTFReport.html} +70 -67
- data/doc/classes/TaskJuggler/RealFormat.html +18 -18
- data/doc/classes/TaskJuggler/RealFormatAttribute.html +10 -10
- data/doc/classes/TaskJuggler/ReferenceAttribute.html +107 -40
- data/doc/classes/TaskJuggler/RemoteServiceManager.html +335 -0
- data/doc/classes/TaskJuggler/Report.html +66 -64
- data/doc/classes/TaskJuggler/ReportBase.html +112 -123
- data/doc/classes/TaskJuggler/ReportContext.html +43 -38
- data/doc/classes/TaskJuggler/ReportServer.html +320 -0
- data/doc/classes/TaskJuggler/ReportTable.html +42 -42
- data/doc/classes/TaskJuggler/ReportTableCell.html +221 -129
- data/doc/classes/TaskJuggler/ReportTableColumn.html +27 -27
- data/doc/classes/TaskJuggler/ReportTableLegend.html +24 -24
- data/doc/classes/TaskJuggler/ReportTableLine.html +126 -80
- data/doc/classes/TaskJuggler/Resource.html +12 -12
- data/doc/classes/TaskJuggler/ResourceListAttribute.html +82 -47
- data/doc/classes/TaskJuggler/ResourceListRE.html +43 -39
- data/doc/classes/TaskJuggler/ResourceScenario.html +413 -321
- data/doc/classes/TaskJuggler/RichText.html +64 -248
- data/doc/classes/TaskJuggler/RichTextAttribute.html +94 -30
- data/doc/classes/TaskJuggler/RichTextDocument.html +87 -85
- data/doc/classes/TaskJuggler/RichTextElement.html +456 -363
- data/doc/classes/TaskJuggler/RichTextException.html +13 -13
- data/doc/classes/TaskJuggler/{RichTextProtocolExample.html → RichTextFunctionExample.html} +64 -63
- data/doc/classes/TaskJuggler/{RichTextProtocolHandler.html → RichTextFunctionHandler.html} +42 -36
- data/doc/classes/TaskJuggler/RichTextIntermediate.html +563 -0
- data/doc/classes/TaskJuggler/RichTextParser.html +54 -51
- data/doc/classes/TaskJuggler/RichTextScanner.html +94 -92
- data/doc/classes/TaskJuggler/RichTextSnip.html +96 -60
- data/doc/classes/TaskJuggler/RichTextSyntaxRules.html +369 -227
- data/doc/classes/TaskJuggler/Scenario.html +6 -6
- data/doc/classes/TaskJuggler/ScenarioData.html +37 -37
- data/doc/classes/TaskJuggler/ScenarioListAttribute.html +31 -31
- data/doc/classes/TaskJuggler/Scoreboard.html +66 -66
- data/doc/classes/TaskJuggler/Shift.html +18 -18
- data/doc/classes/TaskJuggler/ShiftAssignment.html +54 -54
- data/doc/classes/TaskJuggler/ShiftAssignments.html +78 -78
- data/doc/classes/TaskJuggler/ShiftAssignmentsAttribute.html +40 -40
- data/doc/classes/TaskJuggler/ShiftScenario.html +24 -24
- data/doc/classes/TaskJuggler/SortListAttribute.html +22 -22
- data/doc/classes/TaskJuggler/SourceFileInfo.html +12 -12
- data/doc/classes/TaskJuggler/StringAttribute.html +30 -30
- data/doc/classes/TaskJuggler/SymbolAttribute.html +20 -20
- data/doc/classes/TaskJuggler/SyntaxReference.html +42 -42
- data/doc/classes/TaskJuggler/TOCEntry.html +12 -12
- data/doc/classes/TaskJuggler/TSResourceRecord.html +197 -0
- data/doc/classes/TaskJuggler/TSTaskRecord.html +215 -0
- data/doc/classes/TaskJuggler/TableColumnDefinition.html +64 -43
- data/doc/classes/TaskJuggler/TableOfContents.html +18 -18
- data/doc/classes/TaskJuggler/TableReport.html +447 -468
- data/doc/classes/TaskJuggler/Task.html +12 -12
- data/doc/classes/TaskJuggler/TaskDependency.html +12 -12
- data/doc/classes/TaskJuggler/TaskListAttribute.html +47 -47
- data/doc/classes/TaskJuggler/TaskListRE.html +43 -39
- data/doc/classes/TaskJuggler/TaskScenario.html +529 -282
- data/doc/classes/TaskJuggler/TextParser.html +215 -194
- data/doc/classes/TaskJuggler/TextParser/Pattern.html +97 -97
- data/doc/classes/TaskJuggler/TextParser/Rule.html +84 -84
- data/doc/classes/TaskJuggler/TextParser/StackElement.html +16 -15
- data/doc/classes/TaskJuggler/TextParser/TextParserResultArray.html +12 -12
- data/doc/classes/TaskJuggler/TextParser/TokenDoc.html +6 -6
- data/doc/classes/TaskJuggler/TextReport.html +77 -74
- data/doc/classes/TaskJuggler/TextScanner.html +294 -281
- data/doc/classes/TaskJuggler/TextScanner/BufferStreamHandle.html +70 -70
- data/doc/classes/TaskJuggler/TextScanner/FileStreamHandle.html +59 -60
- data/doc/classes/TaskJuggler/TextScanner/StreamHandle.html +12 -12
- data/doc/classes/TaskJuggler/TimeSheetReport.html +406 -0
- data/doc/classes/TaskJuggler/TjException.html +6 -6
- data/doc/classes/TaskJuggler/TjTime.html +522 -513
- data/doc/classes/TaskJuggler/TjpExample.html +25 -25
- data/doc/classes/TaskJuggler/TjpExportRE.html +21 -24
- data/doc/classes/TaskJuggler/TjpSyntaxRules.html +6177 -4318
- data/doc/classes/TaskJuggler/UserManual.html +212 -213
- data/doc/classes/TaskJuggler/WorkingHours.html +49 -49
- data/doc/classes/TaskJuggler/WorkingHoursAttribute.html +53 -53
- data/doc/classes/TaskJuggler/XMLBlob.html +21 -21
- data/doc/classes/TaskJuggler/XMLComment.html +21 -21
- data/doc/classes/TaskJuggler/XMLDocument.html +27 -26
- data/doc/classes/TaskJuggler/XMLElement.html +86 -50
- data/doc/classes/TaskJuggler/XMLNamedText.html +11 -11
- data/doc/classes/TaskJuggler/XMLText.html +36 -36
- data/doc/files/COPYING.html +1 -1
- data/doc/files/README.html +1 -1
- data/doc/files/lib/AccountScenario_rb.html +3 -2
- data/doc/files/lib/Account_rb.html +3 -2
- data/doc/files/lib/Allocation_rb.html +3 -2
- data/doc/files/lib/AppConfig_rb.html +5 -2
- data/doc/files/lib/AttributeBase_rb.html +3 -2
- data/doc/files/lib/AttributeDefinition_rb.html +3 -2
- data/doc/files/lib/Attributes_rb.html +3 -2
- data/doc/files/lib/BatchProcessor_rb.html +4 -3
- data/doc/files/lib/Booking_rb.html +3 -2
- data/doc/files/lib/ChargeSet_rb.html +3 -2
- data/doc/files/lib/Charge_rb.html +3 -2
- data/doc/files/lib/HTMLDocument_rb.html +3 -2
- data/doc/files/lib/Interval_rb.html +3 -2
- data/doc/files/lib/Journal_rb.html +4 -3
- data/doc/files/lib/KeywordArray_rb.html +3 -2
- data/doc/files/lib/KeywordDocumentation_rb.html +3 -2
- data/doc/files/lib/Limits_rb.html +3 -2
- data/doc/files/lib/Log_rb.html +3 -2
- data/doc/files/lib/LogicalExpression_rb.html +3 -2
- data/doc/files/lib/LogicalFunction_rb.html +3 -2
- data/doc/files/lib/LogicalOperation_rb.html +3 -2
- data/doc/files/lib/MacroParser_rb.html +3 -2
- data/doc/files/lib/MacroTable_rb.html +3 -2
- data/doc/files/lib/MessageHandler_rb.html +3 -2
- data/doc/files/lib/Message_rb.html +3 -2
- data/doc/files/lib/ProjectFileParser_rb.html +7 -4
- data/doc/files/lib/Project_rb.html +3 -2
- data/doc/files/lib/PropertyList_rb.html +3 -2
- data/doc/files/lib/PropertySet_rb.html +3 -2
- data/doc/files/lib/PropertyTreeNode_rb.html +3 -2
- data/doc/files/lib/Query_rb.html +3 -2
- data/doc/files/lib/{RTPNavigator_rb.html → RTFNavigator_rb.html} +8 -7
- data/doc/files/lib/RTFQuery_rb.html +121 -0
- data/doc/files/lib/{RTPReport_rb.html → RTFReport_rb.html} +8 -7
- data/doc/files/lib/RealFormat_rb.html +3 -2
- data/doc/files/lib/RemoteServiceManager_rb.html +117 -0
- data/doc/files/lib/ReportServer_rb.html +107 -0
- data/doc/files/lib/ResourceScenario_rb.html +3 -2
- data/doc/files/lib/Resource_rb.html +3 -2
- data/doc/files/lib/RichTextDocument_rb.html +4 -3
- data/doc/files/lib/RichTextElement_rb.html +3 -2
- data/doc/files/lib/{RichTextProtocolExample_rb.html → RichTextFunctionExample_rb.html} +8 -7
- data/doc/files/lib/{RichTextProtocolHandler_rb.html → RichTextFunctionHandler_rb.html} +7 -6
- data/doc/files/lib/RichTextParser_rb.html +3 -2
- data/doc/files/lib/RichTextScanner_rb.html +3 -2
- data/doc/files/lib/RichTextSnip_rb.html +3 -2
- data/doc/files/lib/RichTextSyntaxRules_rb.html +3 -2
- data/doc/files/lib/RichText_rb.html +3 -2
- data/doc/files/lib/ScenarioData_rb.html +3 -2
- data/doc/files/lib/Scenario_rb.html +3 -2
- data/doc/files/lib/Scoreboard_rb.html +3 -2
- data/doc/files/lib/ShiftAssignments_rb.html +3 -2
- data/doc/files/lib/ShiftScenario_rb.html +3 -2
- data/doc/files/lib/Shift_rb.html +3 -2
- data/doc/files/lib/SourceFileInfo_rb.html +3 -2
- data/doc/files/lib/SyntaxReference_rb.html +3 -2
- data/doc/files/lib/TOCEntry_rb.html +3 -2
- data/doc/files/lib/TableColumnDefinition_rb.html +3 -2
- data/doc/files/lib/TableOfContents_rb.html +3 -2
- data/doc/files/lib/TaskDependency_rb.html +3 -2
- data/doc/files/lib/TaskJuggler_rb.html +7 -2
- data/doc/files/lib/TaskScenario_rb.html +3 -2
- data/doc/files/lib/Task_rb.html +3 -2
- data/doc/files/lib/TextParser/Pattern_rb.html +4 -3
- data/doc/files/lib/TextParser/Rule_rb.html +4 -3
- data/doc/files/lib/TextParser/StackElement_rb.html +4 -3
- data/doc/files/lib/TextParser/TokenDoc_rb.html +4 -3
- data/doc/files/lib/TextParser_rb.html +3 -2
- data/doc/files/lib/TextScanner_rb.html +3 -2
- data/doc/files/lib/Tj3Config_rb.html +3 -2
- data/doc/files/lib/TjException_rb.html +3 -2
- data/doc/files/lib/TjTime_rb.html +3 -2
- data/doc/files/lib/TjpExample_rb.html +3 -2
- data/doc/files/lib/TjpSyntaxRules_rb.html +3 -2
- data/doc/files/lib/UTF8String_rb.html +14 -6
- data/doc/files/lib/UserManual_rb.html +6 -3
- data/doc/files/lib/WorkingHours_rb.html +3 -2
- data/doc/files/lib/XMLDocument_rb.html +3 -2
- data/doc/files/lib/XMLElement_rb.html +3 -2
- data/doc/files/lib/deep_copy_rb.html +3 -2
- data/doc/files/lib/reports/CSVFile_rb.html +3 -2
- data/doc/files/lib/reports/ColumnTable_rb.html +3 -2
- data/doc/files/lib/reports/GanttChart_rb.html +3 -2
- data/doc/files/lib/reports/GanttContainer_rb.html +3 -2
- data/doc/files/lib/reports/GanttHeaderScaleItem_rb.html +3 -2
- data/doc/files/lib/reports/GanttHeader_rb.html +3 -2
- data/doc/files/lib/reports/GanttLine_rb.html +3 -2
- data/doc/files/lib/reports/GanttLoadStack_rb.html +3 -2
- data/doc/files/lib/reports/GanttMilestone_rb.html +3 -2
- data/doc/files/lib/reports/GanttRouter_rb.html +3 -2
- data/doc/files/lib/reports/GanttTaskBar_rb.html +3 -2
- data/doc/files/lib/reports/HTMLGraphics_rb.html +3 -2
- data/doc/files/lib/reports/Navigator_rb.html +3 -2
- data/doc/files/lib/reports/ReportBase_rb.html +3 -2
- data/doc/files/lib/reports/ReportContext_rb.html +3 -2
- data/doc/files/lib/reports/ReportTableCell_rb.html +3 -2
- data/doc/files/lib/reports/ReportTableColumn_rb.html +3 -2
- data/doc/files/lib/reports/ReportTableLegend_rb.html +3 -2
- data/doc/files/lib/reports/ReportTableLine_rb.html +3 -2
- data/doc/files/lib/reports/ReportTable_rb.html +3 -2
- data/doc/files/lib/reports/Report_rb.html +7 -2
- data/doc/files/lib/reports/ResourceListRE_rb.html +3 -2
- data/doc/files/lib/reports/TableReport_rb.html +3 -2
- data/doc/files/lib/reports/TaskListRE_rb.html +3 -2
- data/doc/files/lib/reports/TextReport_rb.html +4 -3
- data/doc/files/lib/reports/TimeSheetReport_rb.html +117 -0
- data/doc/files/lib/reports/TjpExportRE_rb.html +3 -2
- data/doc/files/lib/taskjuggler3_rb.html +94 -77
- data/doc/files/lib/tj3client_rb.html +280 -0
- data/doc/files/lib/tj3man_rb.html +10 -9
- data/doc/fr_class_index.html +27 -5
- data/doc/fr_file_index.html +15 -7
- data/doc/fr_method_index.html +1312 -1020
- data/examples/tutorial.tjp +113 -14
- data/gem_spec.rb +2 -1
- data/lib/Account.rb +1 -1
- data/lib/AccountScenario.rb +1 -1
- data/lib/Allocation.rb +1 -1
- data/lib/AppConfig.rb +23 -10
- data/lib/AttributeBase.rb +34 -6
- data/lib/AttributeDefinition.rb +1 -1
- data/lib/Attributes.rb +51 -16
- data/lib/BatchProcessor.rb +204 -77
- data/lib/Booking.rb +1 -1
- data/lib/Charge.rb +1 -1
- data/lib/ChargeSet.rb +1 -1
- data/lib/HTMLDocument.rb +2 -2
- data/lib/Interval.rb +1 -1
- data/lib/Journal.rb +231 -9
- data/lib/KeywordArray.rb +1 -1
- data/lib/KeywordDocumentation.rb +6 -4
- data/lib/Limits.rb +1 -1
- data/lib/Log.rb +8 -1
- data/lib/LogicalExpression.rb +14 -13
- data/lib/LogicalFunction.rb +88 -14
- data/lib/LogicalOperation.rb +124 -53
- data/lib/MacroParser.rb +1 -1
- data/lib/MacroTable.rb +2 -2
- data/lib/Message.rb +1 -1
- data/lib/MessageHandler.rb +7 -3
- data/lib/Project.rb +93 -14
- data/lib/ProjectFileParser.rb +30 -15
- data/lib/PropertyList.rb +103 -36
- data/lib/PropertySet.rb +22 -10
- data/lib/PropertyTreeNode.rb +120 -15
- data/lib/Query.rb +119 -48
- data/lib/{RTPNavigator.rb → RTFNavigator.rb} +11 -10
- data/lib/RTFQuery.rb +166 -0
- data/lib/{RTPReport.rb → RTFReport.rb} +11 -8
- data/lib/RealFormat.rb +1 -1
- data/lib/RemoteServiceManager.rb +80 -0
- data/lib/ReportServer.rb +66 -0
- data/lib/Resource.rb +1 -1
- data/lib/ResourceScenario.rb +48 -19
- data/lib/RichText.rb +98 -41
- data/lib/RichTextDocument.rb +10 -8
- data/lib/RichTextElement.rb +72 -28
- data/lib/{RichTextProtocolExample.rb → RichTextFunctionExample.rb} +8 -7
- data/lib/{RichTextProtocolHandler.rb → RichTextFunctionHandler.rb} +12 -14
- data/lib/RichTextParser.rb +6 -3
- data/lib/RichTextScanner.rb +91 -19
- data/lib/RichTextSnip.rb +8 -3
- data/lib/RichTextSyntaxRules.rb +103 -45
- data/lib/Scenario.rb +1 -1
- data/lib/ScenarioData.rb +2 -2
- data/lib/Scoreboard.rb +1 -1
- data/lib/Shift.rb +1 -1
- data/lib/ShiftAssignments.rb +1 -1
- data/lib/ShiftScenario.rb +1 -1
- data/lib/SourceFileInfo.rb +1 -1
- data/lib/SyntaxReference.rb +2 -2
- data/lib/TOCEntry.rb +1 -1
- data/lib/TableColumnDefinition.rb +59 -16
- data/lib/TableOfContents.rb +1 -1
- data/lib/Task.rb +1 -1
- data/lib/TaskDependency.rb +1 -1
- data/lib/TaskJuggler.rb +31 -8
- data/lib/TaskScenario.rb +165 -16
- data/lib/TextParser.rb +36 -22
- data/lib/TextParser/Pattern.rb +3 -3
- data/lib/TextParser/Rule.rb +2 -2
- data/lib/TextParser/StackElement.rb +4 -3
- data/lib/TextParser/TokenDoc.rb +2 -2
- data/lib/TextScanner.rb +52 -37
- data/lib/Tj3Config.rb +6 -5
- data/lib/TjException.rb +1 -1
- data/lib/TjTime.rb +12 -3
- data/lib/TjpExample.rb +1 -1
- data/lib/TjpSyntaxRules.rb +1044 -150
- data/lib/UTF8String.rb +2 -1
- data/lib/UserManual.rb +18 -70
- data/lib/WorkingHours.rb +3 -3
- data/lib/XMLDocument.rb +3 -2
- data/lib/XMLElement.rb +6 -1
- data/lib/deep_copy.rb +1 -1
- data/lib/reports/CSVFile.rb +1 -1
- data/lib/reports/ColumnTable.rb +9 -9
- data/lib/reports/GanttChart.rb +1 -1
- data/lib/reports/GanttContainer.rb +1 -1
- data/lib/reports/GanttHeader.rb +1 -1
- data/lib/reports/GanttHeaderScaleItem.rb +1 -1
- data/lib/reports/GanttLine.rb +40 -40
- data/lib/reports/GanttLoadStack.rb +1 -1
- data/lib/reports/GanttMilestone.rb +1 -1
- data/lib/reports/GanttRouter.rb +1 -1
- data/lib/reports/GanttTaskBar.rb +1 -1
- data/lib/reports/HTMLGraphics.rb +1 -1
- data/lib/reports/Navigator.rb +149 -22
- data/lib/reports/Report.rb +115 -172
- data/lib/reports/ReportBase.rb +22 -27
- data/lib/reports/ReportContext.rb +29 -15
- data/lib/reports/ReportTable.rb +1 -1
- data/lib/reports/ReportTableCell.rb +120 -27
- data/lib/reports/ReportTableColumn.rb +3 -3
- data/lib/reports/ReportTableLegend.rb +1 -1
- data/lib/reports/ReportTableLine.rb +10 -2
- data/lib/reports/ResourceListRE.rb +5 -1
- data/lib/reports/TableReport.rb +237 -287
- data/lib/reports/TaskListRE.rb +5 -1
- data/lib/reports/TextReport.rb +7 -4
- data/lib/reports/TimeSheetReport.rb +233 -0
- data/lib/reports/TjpExportRE.rb +2 -2
- data/lib/taskjuggler3.rb +27 -11
- data/lib/tj3client.rb +110 -0
- data/lib/tj3man.rb +4 -4
- data/manual/Getting_Started +0 -50
- data/manual/How_To_Contribute +6 -13
- data/manual/Installation +102 -28
- data/manual/Intro +11 -1
- data/manual/Reporting_Bugs +23 -7
- data/manual/Rich_Text_Attributes +59 -6
- data/manual/TaskJuggler_2x_Migration +27 -0
- data/manual/The_TaskJuggler_Syntax +104 -0
- data/manual/Tutorial +10 -9
- data/prj_cfg.rb +8 -2
- data/tasks/csts.rake +1 -1
- data/tasks/manual.rake +5 -3
- data/test/MessageChecker.rb +1 -1
- data/test/TestSuite/HTML-Reports/Alerts.html +172 -0
- data/test/TestSuite/HTML-Reports/Alerts.tjp +77 -0
- data/test/TestSuite/HTML-Reports/CellText.html +758 -0
- data/test/TestSuite/HTML-Reports/CellText.tjp +75 -0
- data/test/TestSuite/HTML-Reports/ColumnPeriods.html +156 -0
- data/test/TestSuite/HTML-Reports/ColumnPeriods.tjp +44 -0
- data/test/TestSuite/HTML-Reports/IsOngoing.html +172 -0
- data/test/TestSuite/HTML-Reports/IsOngoing.tjp +34 -0
- data/test/TestSuite/HTML-Reports/LogicalFunctions.html +80 -0
- data/test/TestSuite/HTML-Reports/LogicalFunctions.tjp +20 -0
- data/test/TestSuite/HTML-Reports/Query.html +31 -0
- data/test/TestSuite/HTML-Reports/Query.tjp +28 -0
- data/test/TestSuite/HTML-Reports/Sorting.tjp +68 -0
- data/test/TestSuite/HTML-Reports/TimeSheet.tjp +69 -0
- data/test/TestSuite/HTML-Reports/UDAQuery.tjp +27 -0
- data/test/TestSuite/HTML-Reports/css/tjmanual.css +52 -0
- data/test/TestSuite/HTML-Reports/css/tjreport.css +195 -0
- data/test/TestSuite/HTML-Reports/depArrows.html +842 -0
- data/test/TestSuite/HTML-Reports/icons/details.png +0 -0
- data/test/TestSuite/HTML-Reports/icons/flag-green.png +0 -0
- data/test/TestSuite/HTML-Reports/icons/flag-red.png +0 -0
- data/test/TestSuite/HTML-Reports/icons/flag-yellow.png +0 -0
- data/test/TestSuite/HTML-Reports/icons/resource.png +0 -0
- data/test/TestSuite/HTML-Reports/icons/resourcegroup.png +0 -0
- data/test/TestSuite/HTML-Reports/icons/task.png +0 -0
- data/test/TestSuite/HTML-Reports/icons/taskgroup.png +0 -0
- data/test/TestSuite/HTML-Reports/reference.tjp +7 -8
- data/test/TestSuite/HTML-Reports/scripts/scripts/wz_tooltip.js +1301 -0
- data/test/TestSuite/HTML-Reports/scripts/wz_tooltip.js +1301 -0
- data/test/TestSuite/Scheduler/Correct/Mandatory.tjp +34 -0
- data/test/TestSuite/Syntax/Correct/Celltext.tjp +2 -1
- data/test/TestSuite/Syntax/Correct/Journal.tjp +2 -2
- data/test/TestSuite/Syntax/Correct/LogicalExpression.tjp +2 -1
- data/test/TestSuite/Syntax/Correct/LogicalFunction.tjp +20 -0
- data/test/TestSuite/Syntax/Correct/Query.tjp +18 -0
- data/test/TestSuite/Syntax/Correct/StatusSheet.tjp +45 -0
- data/test/TestSuite/Syntax/Correct/TimeSheet.tjp +49 -0
- data/test/TestSuite/Syntax/Correct/icons/details.png +0 -0
- data/test/TestSuite/Syntax/Correct/icons/flag-green.png +0 -0
- data/test/TestSuite/Syntax/Correct/icons/flag-red.png +0 -0
- data/test/TestSuite/Syntax/Correct/icons/flag-yellow.png +0 -0
- data/test/TestSuite/Syntax/Correct/icons/resource.png +0 -0
- data/test/TestSuite/Syntax/Correct/icons/resourcegroup.png +0 -0
- data/test/TestSuite/Syntax/Correct/icons/task.png +0 -0
- data/test/TestSuite/Syntax/Correct/icons/taskgroup.png +0 -0
- data/test/TestSuite/Syntax/Correct/scripts/wz_tooltip.js +1301 -0
- data/test/TestSuite/Syntax/Correct/tutorial.tjp +113 -14
- data/test/TestSuite/Syntax/Errors/macro_stack_overflow.tjp +28 -0
- data/test/TestSuite/Syntax/Errors/unsupported_token.tjp +12 -0
- data/test/all.rb +2 -2
- data/test/test_BatchProcessor.rb +42 -13
- data/test/test_CSV-Reports.rb +1 -1
- data/test/test_Journal.rb +176 -0
- data/test/test_Limits.rb +1 -1
- data/test/test_LogicalExpression.rb +14 -5
- data/test/test_MacroTable.rb +1 -1
- data/test/test_Project.rb +1 -1
- data/test/test_PropertySet.rb +1 -1
- data/test/test_Query.rb +1 -1
- data/test/test_RealFormat.rb +1 -1
- data/test/test_RichText.rb +30 -20
- data/test/test_Scheduler.rb +1 -1
- data/test/test_ShiftAssignments.rb +2 -2
- data/test/test_Syntax.rb +1 -1
- data/test/test_TextScanner.rb +1 -1
- data/test/test_TjTime.rb +1 -1
- data/test/test_TjpExample.rb +1 -1
- data/test/test_UTF8String.rb +1 -1
- data/test/test_WorkingHours.rb +1 -1
- data/test/test_deep_copy.rb +2 -2
- metadata +610 -532
- data/doc/files/lib/ms_test_rb.html +0 -90
- data/examples/ContactList.html +0 -1467
- data/examples/Deliveries.html +0 -485
- data/examples/Development.html +0 -2525
- data/examples/Overview.html +0 -747
- data/examples/Resource Graph.html +0 -616
- data/lib/ms_test.rb +0 -27
- data/test/TestSuite/HTML-Reports/reference-export.html +0 -187
data/lib/ResourceScenario.rb
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
#
|
|
4
4
|
# = ResourceScenario.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
|
|
@@ -143,12 +143,12 @@ class TaskJuggler
|
|
|
143
143
|
# directly assiciated with the Task is taken into account.
|
|
144
144
|
def query_cost(query)
|
|
145
145
|
if query.costAccount
|
|
146
|
-
query.
|
|
146
|
+
query.sortable = query.numerical = cost =
|
|
147
147
|
turnover(query.startIdx, query.endIdx, query.costAccount,
|
|
148
148
|
query.scopeProperty)
|
|
149
|
-
query.
|
|
149
|
+
query.string = query.currencyFormat.format(cost)
|
|
150
150
|
else
|
|
151
|
-
query.
|
|
151
|
+
query.string = 'No cost account'
|
|
152
152
|
end
|
|
153
153
|
end
|
|
154
154
|
|
|
@@ -156,22 +156,29 @@ class TaskJuggler
|
|
|
156
156
|
# Task is given as scope property only the effort allocated to this Task is
|
|
157
157
|
# taken into account.
|
|
158
158
|
def query_effort(query)
|
|
159
|
-
query.
|
|
159
|
+
query.sortable = query.numerical = effort =
|
|
160
160
|
getEffectiveWork(query.startIdx, query.endIdx, query.scopeProperty)
|
|
161
|
-
query.
|
|
161
|
+
query.string = query.scaleLoad(effort)
|
|
162
162
|
end
|
|
163
163
|
|
|
164
|
-
# The unallocated
|
|
164
|
+
# The unallocated work time of the Resource during the specified interval.
|
|
165
|
+
def query_freetime(query)
|
|
166
|
+
query.sortable = query.numerical = time =
|
|
167
|
+
getEffectiveFreeTime(query.startIdx, query.endIdx) / (60 * 60 * 24)
|
|
168
|
+
query.string = query.scaleDuration(time)
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
# The unallocated effort of the Resource during the specified interval.
|
|
165
172
|
def query_freework(query)
|
|
166
|
-
query.
|
|
173
|
+
query.sortable = query.numerical = work =
|
|
167
174
|
getEffectiveFreeWork(query.startIdx, query.endIdx)
|
|
168
|
-
query.
|
|
175
|
+
query.string = query.scaleLoad(work)
|
|
169
176
|
end
|
|
170
177
|
|
|
171
178
|
# Get the rate of the resource.
|
|
172
179
|
def query_rate(query)
|
|
173
|
-
query.
|
|
174
|
-
query.
|
|
180
|
+
query.sortable = query.numerical = r = rate
|
|
181
|
+
query.string = query.currencyFormat.format(r)
|
|
175
182
|
end
|
|
176
183
|
|
|
177
184
|
# Compute the revenue generated by this Resource for a given Account during
|
|
@@ -179,12 +186,12 @@ class TaskJuggler
|
|
|
179
186
|
# revenue directly associated to this Task is taken into account.
|
|
180
187
|
def query_revenue(query)
|
|
181
188
|
if query.revenueAccount
|
|
182
|
-
query.
|
|
189
|
+
query.sortable = query.numerical = revenue =
|
|
183
190
|
turnover(query.startIdx, query.endIdx, query.revenueAccount,
|
|
184
191
|
query.scopeProperty)
|
|
185
|
-
query.
|
|
192
|
+
query.string = query.currencyFormat.format(revenue)
|
|
186
193
|
else
|
|
187
|
-
query.
|
|
194
|
+
query.string = 'No revenue account'
|
|
188
195
|
end
|
|
189
196
|
end
|
|
190
197
|
|
|
@@ -251,7 +258,29 @@ class TaskJuggler
|
|
|
251
258
|
time
|
|
252
259
|
end
|
|
253
260
|
|
|
254
|
-
# Return the unallocated work of the resource and its
|
|
261
|
+
# Return the unallocated work time (in seconds) of the resource and its
|
|
262
|
+
# children.
|
|
263
|
+
def getEffectiveFreeTime(startIdx, endIdx)
|
|
264
|
+
# Convert the interval dates to indexes if needed.
|
|
265
|
+
startIdx = @project.dateToIdx(startIdx, true) if startIdx.is_a?(TjTime)
|
|
266
|
+
endIdx = @project.dateToIdx(endIdx, true) if endIdx.is_a?(TjTime)
|
|
267
|
+
|
|
268
|
+
freeTime = 0
|
|
269
|
+
if @property.container?
|
|
270
|
+
@property.children.each do |resource|
|
|
271
|
+
freeTime += resource.getEffectiveFreeTime(@scenarioIdx, startIdx,
|
|
272
|
+
endIdx)
|
|
273
|
+
end
|
|
274
|
+
else
|
|
275
|
+
initScoreboard if @scoreboard.nil?
|
|
276
|
+
|
|
277
|
+
freeTime = getFreeSlots(startIdx, endIdx) *
|
|
278
|
+
@project['scheduleGranularity']
|
|
279
|
+
end
|
|
280
|
+
freeTime
|
|
281
|
+
end
|
|
282
|
+
|
|
283
|
+
# Return the unallocated work of the resource and its children weighted by
|
|
255
284
|
# their efficiency.
|
|
256
285
|
def getEffectiveFreeWork(startIdx, endIdx)
|
|
257
286
|
# Convert the interval dates to indexes if needed.
|
|
@@ -329,13 +358,13 @@ class TaskJuggler
|
|
|
329
358
|
endIdx = @lastBookedSlot + 1
|
|
330
359
|
|
|
331
360
|
# In case the index markers are still uninitialized, we have no bookings.
|
|
332
|
-
return
|
|
361
|
+
return {} if startIdx.nil? || endIdx.nil?
|
|
333
362
|
|
|
334
|
-
startIdx.upto(endIdx
|
|
363
|
+
startIdx.upto(endIdx) do |idx|
|
|
335
364
|
task = @scoreboard[idx]
|
|
336
365
|
# Now we watch for task changes.
|
|
337
366
|
if task != lastTask || (lastTask == nil && task.is_a?(Task)) ||
|
|
338
|
-
(task.is_a?(Task) && idx == endIdx
|
|
367
|
+
(task.is_a?(Task) && idx == endIdx)
|
|
339
368
|
unless lastTask.nil?
|
|
340
369
|
# If we don't have a Booking for the task yet, we create one.
|
|
341
370
|
if bookings[lastTask].nil?
|
|
@@ -343,7 +372,7 @@ class TaskJuggler
|
|
|
343
372
|
end
|
|
344
373
|
|
|
345
374
|
# Make sure the index is correct even for the last task block.
|
|
346
|
-
idx += 1 if idx == endIdx
|
|
375
|
+
idx += 1 if idx == endIdx
|
|
347
376
|
# Append the new interval to the Booking.
|
|
348
377
|
bookings[lastTask].intervals <<
|
|
349
378
|
Interval.new(@scoreboard.idxToDate(bookingStart),
|
data/lib/RichText.rb
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
#
|
|
4
4
|
# = RichText.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
|
|
@@ -63,82 +63,139 @@ class TaskJuggler
|
|
|
63
63
|
# [[item]] site internal internal reference (in HTML .html gets appended
|
|
64
64
|
# automatically)
|
|
65
65
|
# [[item An item]] another internal reference
|
|
66
|
-
# [[
|
|
66
|
+
# [[function:path arg1 arg2 ...]]
|
|
67
67
|
#
|
|
68
68
|
# <nowiki> ... </nowiki> Disable markup interpretation for the enclosed
|
|
69
69
|
# portion of text.
|
|
70
70
|
#
|
|
71
71
|
class RichText
|
|
72
72
|
|
|
73
|
-
|
|
73
|
+
attr_reader :inputText
|
|
74
74
|
|
|
75
75
|
# Create a rich text object by passing a String with markup elements to it.
|
|
76
76
|
# _text_ must be plain text with MediaWiki compatible markup elements. In
|
|
77
77
|
# case an error occurs, an exception of type TjException will be raised.
|
|
78
|
-
|
|
78
|
+
# _functionHandlers_ is a Hash that maps RichTextFunctionHandler objects
|
|
79
|
+
# by their function name.
|
|
80
|
+
def initialize(text, functionHandlers = [])
|
|
81
|
+
# Keep a copy of the original text.
|
|
82
|
+
@inputText = text
|
|
83
|
+
@functionHandlers = functionHandlers
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# Convert the @inputText into an abstract syntax tree that can then be
|
|
87
|
+
# converted into the various output formats. _sectionCounter_ is an Array
|
|
88
|
+
# that holds the initial values for the section counters.
|
|
89
|
+
def generateIntermediateFormat(sectionCounter = [ 0, 0, 0], tokenSet = nil)
|
|
90
|
+
rti = RichTextIntermediate.new(self)
|
|
91
|
+
# Copy the function handlers.
|
|
92
|
+
@functionHandlers.each do |h|
|
|
93
|
+
rti.registerFunctionHandler(h)
|
|
94
|
+
end
|
|
95
|
+
# Parse the input text into an abstract syntax tree.
|
|
96
|
+
parser = RichTextParser.new(rti, sectionCounter, tokenSet)
|
|
97
|
+
parser.open(@inputText)
|
|
98
|
+
# Parse the input text and convert it to the intermediate representation.
|
|
99
|
+
tree = parser.parse('richtext')
|
|
100
|
+
# In case the result is empty, use an empty RichTextElement as result
|
|
101
|
+
tree = RichTextElement.new(rti, :richtext, nil) unless tree
|
|
102
|
+
tree.cleanUp
|
|
103
|
+
rti.tree = tree
|
|
104
|
+
rti
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
# Return the RichTextFunctionHandler for the function _name_. _block_
|
|
108
|
+
# specifies whether we are looking for a block or inline function.
|
|
109
|
+
def functionHandler(name, block)
|
|
110
|
+
@functionHandlers.each do |handler|
|
|
111
|
+
return handler if handler.function == name &&
|
|
112
|
+
handler.blockFunction == block
|
|
113
|
+
end
|
|
114
|
+
nil
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
private
|
|
118
|
+
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
# The RichTextIntermediate is a container for the intermediate
|
|
122
|
+
# representation of a RichText object. By calling the to_* members it can be
|
|
123
|
+
# converted into the respective formats. A RichTextIntermediate object is
|
|
124
|
+
# generated by RichText::generateIntermediateFormat.
|
|
125
|
+
class RichTextIntermediate
|
|
126
|
+
|
|
127
|
+
attr_reader :richText
|
|
128
|
+
attr_accessor :blockMode, :sectionNumbers, :lineWidth, :linkTarget,
|
|
129
|
+
:cssClass, :tree
|
|
130
|
+
|
|
131
|
+
def initialize(richText)
|
|
132
|
+
# A reference to the corresponding RichText object the RTI is derived
|
|
133
|
+
# from.
|
|
134
|
+
@richText = richText
|
|
135
|
+
# The root of the generated intermediate format. This is a
|
|
136
|
+
# RichTextElement.
|
|
137
|
+
@tree = nil
|
|
138
|
+
# The blockMode specifies whether the RichText should be interpreted as
|
|
139
|
+
# a line of text or a block (default).
|
|
140
|
+
@blockMode = true
|
|
79
141
|
# Set this to false to disable automatically generated section numbers.
|
|
80
142
|
@sectionNumbers = true
|
|
81
143
|
# Set this to the width of your text area. Needed for horizonal lines.
|
|
82
144
|
@lineWidth = 80
|
|
83
|
-
#
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
#
|
|
89
|
-
@
|
|
90
|
-
# In case the result is empty, use an empty RichTextElement as result
|
|
91
|
-
@richText = RichTextElement.new(@richText, :richtext, nil) unless @richText
|
|
92
|
-
@richText.cleanUp
|
|
145
|
+
# The target used for hypertext links.
|
|
146
|
+
@linkTarget = nil
|
|
147
|
+
# The CSS class used for some key HTML elements.
|
|
148
|
+
@cssClass = nil
|
|
149
|
+
# These are the RichTextFunctionHandler objects to handle references with
|
|
150
|
+
# a function specification.
|
|
151
|
+
@functionHandlers = {}
|
|
93
152
|
end
|
|
94
153
|
|
|
95
|
-
# Use this function to register new
|
|
154
|
+
# Use this function to register new RichTextFunctionHandler objects with
|
|
96
155
|
# this class.
|
|
97
|
-
def
|
|
98
|
-
|
|
156
|
+
def registerFunctionHandler(functionHandler)
|
|
157
|
+
raise "Bad function handler" unless functionHandler
|
|
158
|
+
@functionHandlers[functionHandler.function] = functionHandler.dup
|
|
99
159
|
end
|
|
100
160
|
|
|
101
|
-
#
|
|
102
|
-
#
|
|
103
|
-
def
|
|
104
|
-
@
|
|
161
|
+
# Return the handler for the given _function_ or raise an exception if it
|
|
162
|
+
# does not exist.
|
|
163
|
+
def functionHandler(function)
|
|
164
|
+
@functionHandlers[function]
|
|
105
165
|
end
|
|
106
166
|
|
|
107
|
-
# Return
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
unless @protocolHandlers.include?(protocol)
|
|
111
|
-
raise TjException.new, "Unsupported protocol #{protocol}"
|
|
112
|
-
end
|
|
113
|
-
@protocolHandlers[protocol]
|
|
167
|
+
# Return true if the RichText has no content.
|
|
168
|
+
def empty?
|
|
169
|
+
@tree.empty?
|
|
114
170
|
end
|
|
115
171
|
|
|
116
|
-
#
|
|
172
|
+
# Recursively extract the section headings from the RichTextElement and
|
|
173
|
+
# build the TableOfContents _toc_ with the gathered sections. _fileName_
|
|
174
|
+
# is the base name (without .html or other suffix) of the file the
|
|
175
|
+
# TOCEntries should point to.
|
|
117
176
|
def tableOfContents(toc, fileName)
|
|
118
|
-
@
|
|
177
|
+
@tree.tableOfContents(toc, fileName)
|
|
119
178
|
end
|
|
120
179
|
|
|
121
180
|
# Return an Array with all other snippet names that are referenced by
|
|
122
|
-
# internal references in this
|
|
181
|
+
# internal references in this RichTextElement.
|
|
123
182
|
def internalReferences
|
|
124
|
-
@
|
|
183
|
+
@tree.internalReferences
|
|
125
184
|
end
|
|
126
185
|
|
|
127
|
-
# Convert the
|
|
128
|
-
# represented easily in ASCII Strings are ommitted.
|
|
186
|
+
# Convert the intermediate format into a plain text String object.
|
|
129
187
|
def to_s
|
|
130
|
-
@
|
|
188
|
+
@tree.to_s
|
|
131
189
|
end
|
|
132
190
|
|
|
133
|
-
# Convert the
|
|
191
|
+
# Convert the intermediate format into a XMLElement objects tree.
|
|
134
192
|
def to_html
|
|
135
|
-
@
|
|
193
|
+
@tree.to_html
|
|
136
194
|
end
|
|
137
195
|
|
|
138
|
-
# Convert the
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
@richText.to_tagged
|
|
196
|
+
# Convert the intermediate format into a tagged syntax String object.
|
|
197
|
+
def to_tagged
|
|
198
|
+
@tree.to_tagged
|
|
142
199
|
end
|
|
143
200
|
|
|
144
201
|
end
|
data/lib/RichTextDocument.rb
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
#
|
|
4
4
|
# = RichTextDocument.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,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
require 'RichTextSnip'
|
|
14
14
|
require 'TableOfContents'
|
|
15
|
-
require '
|
|
15
|
+
require 'RichTextFunctionHandler'
|
|
16
16
|
|
|
17
17
|
class TaskJuggler
|
|
18
18
|
|
|
@@ -24,26 +24,28 @@ class TaskJuggler
|
|
|
24
24
|
# and generateHTMLFooter.
|
|
25
25
|
class RichTextDocument
|
|
26
26
|
|
|
27
|
-
attr_reader :
|
|
27
|
+
attr_reader :functionHandlers
|
|
28
28
|
|
|
29
29
|
# Create a new empty RichTextDocument object.
|
|
30
30
|
def initialize
|
|
31
|
-
@
|
|
31
|
+
@functionHandlers = []
|
|
32
32
|
@snippets = []
|
|
33
33
|
@dirty = false
|
|
34
34
|
@sectionCounter = [ 0, 0, 0 ]
|
|
35
|
+
@linkTarget = nil
|
|
35
36
|
@toc = nil
|
|
36
37
|
end
|
|
37
38
|
|
|
38
|
-
# Register a new
|
|
39
|
-
def
|
|
40
|
-
@
|
|
39
|
+
# Register a new RichTextFunctionHandler for this document.
|
|
40
|
+
def registerFunctionHandler(handler)
|
|
41
|
+
@functionHandlers << handler
|
|
41
42
|
end
|
|
42
43
|
|
|
43
44
|
# Add a new structured text file to the document. _file_ must be the name of
|
|
44
45
|
# a file with RichText compatible syntax elements.
|
|
45
46
|
def addSnip(file)
|
|
46
|
-
@snippets << RichTextSnip.new(self, file, @sectionCounter)
|
|
47
|
+
@snippets << (snippet = RichTextSnip.new(self, file, @sectionCounter))
|
|
48
|
+
snippet.linkTarget = @linkTarget
|
|
47
49
|
@dirty = true
|
|
48
50
|
end
|
|
49
51
|
|
data/lib/RichTextElement.rb
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
#
|
|
4
4
|
# = RichTextElement.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
|
|
@@ -23,7 +23,7 @@ class TaskJuggler
|
|
|
23
23
|
# category that identifies the content of the node.
|
|
24
24
|
class RichTextElement
|
|
25
25
|
|
|
26
|
-
attr_reader :category, :children
|
|
26
|
+
attr_reader :richText, :category, :children
|
|
27
27
|
attr_writer :data
|
|
28
28
|
attr_accessor :appendSpace
|
|
29
29
|
|
|
@@ -65,10 +65,16 @@ class TaskJuggler
|
|
|
65
65
|
self
|
|
66
66
|
end
|
|
67
67
|
|
|
68
|
+
# Return true of the node contains an empty RichText tree.
|
|
69
|
+
def empty?
|
|
70
|
+
@category == :richtext && @children.empty?
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
|
|
68
74
|
# Recursively extract the section headings from the RichTextElement and
|
|
69
|
-
# build
|
|
70
|
-
#
|
|
71
|
-
#
|
|
75
|
+
# build the TableOfContents _toc_ with the gathered sections. _fileName_
|
|
76
|
+
# is the base name (without .html or other suffix) of the file the
|
|
77
|
+
# TOCEntries should point to.
|
|
72
78
|
def tableOfContents(toc, fileName)
|
|
73
79
|
number = nil
|
|
74
80
|
case @category
|
|
@@ -150,7 +156,7 @@ class TaskJuggler
|
|
|
150
156
|
post = "\n\n"
|
|
151
157
|
when :numberlist1
|
|
152
158
|
when :numberitem1
|
|
153
|
-
pre = "#{@data[0]} "
|
|
159
|
+
pre = "#{@data[0]}. "
|
|
154
160
|
post = "\n\n"
|
|
155
161
|
when :numberlist2
|
|
156
162
|
when :numberitem2
|
|
@@ -163,6 +169,10 @@ class TaskJuggler
|
|
|
163
169
|
when :ref
|
|
164
170
|
when :href
|
|
165
171
|
when :blockfunc
|
|
172
|
+
when :inlinefunc
|
|
173
|
+
noChilds = true
|
|
174
|
+
checkHandler
|
|
175
|
+
pre = @richText.functionHandler(@data[0]).to_s(@data[1])
|
|
166
176
|
when :italic
|
|
167
177
|
when :bold
|
|
168
178
|
when :code
|
|
@@ -242,7 +252,9 @@ class TaskJuggler
|
|
|
242
252
|
pre = "<ref data=\"#{@data}\">"
|
|
243
253
|
post = '</ref>'
|
|
244
254
|
when :href
|
|
245
|
-
pre = "<a href=\"#{@data}\"
|
|
255
|
+
pre = "<a href=\"#{@data}\" #{@richText.linkTarget ?
|
|
256
|
+
"target=\"#{@richText.linkTarget}\"" :
|
|
257
|
+
""}>"
|
|
246
258
|
post = '</a>'
|
|
247
259
|
when :blockfunc
|
|
248
260
|
pre = "<blockfunc:#{@data[0]}"
|
|
@@ -252,6 +264,14 @@ class TaskJuggler
|
|
|
252
264
|
end
|
|
253
265
|
end
|
|
254
266
|
post = "/>"
|
|
267
|
+
when :inlinefunc
|
|
268
|
+
pre = "<inlinefunc:#{@data[0]}"
|
|
269
|
+
if @data[1]
|
|
270
|
+
@data[1].keys.sort.each do |key|
|
|
271
|
+
pre += " #{key}=\"#{@data[1][key]}\""
|
|
272
|
+
end
|
|
273
|
+
end
|
|
274
|
+
post = "/>"
|
|
255
275
|
when :italic
|
|
256
276
|
pre = '<i>'
|
|
257
277
|
post = '</i>'
|
|
@@ -283,33 +303,23 @@ class TaskJuggler
|
|
|
283
303
|
# Convert the intermediate representation into HTML elements.
|
|
284
304
|
def to_html
|
|
285
305
|
noChilds = false
|
|
306
|
+
attrs = {}
|
|
307
|
+
attrs['class'] = @richText.cssClass if @richText.cssClass
|
|
286
308
|
html =
|
|
287
309
|
case @category
|
|
288
310
|
when :richtext
|
|
289
|
-
XMLElement.new('div')
|
|
311
|
+
XMLElement.new(@richText.blockMode ? 'div' : 'span', attrs)
|
|
290
312
|
when :title1
|
|
291
|
-
|
|
292
|
-
if @richText.sectionNumbers
|
|
293
|
-
el << XMLText.new("#{@data[0]} ")
|
|
294
|
-
end
|
|
295
|
-
el
|
|
313
|
+
htmlTitle(1)
|
|
296
314
|
when :title2
|
|
297
|
-
|
|
298
|
-
if @richText.sectionNumbers
|
|
299
|
-
el << XMLText.new("#{@data[0]}.#{@data[1]} ")
|
|
300
|
-
end
|
|
301
|
-
el
|
|
315
|
+
htmlTitle(2)
|
|
302
316
|
when :title3
|
|
303
|
-
|
|
304
|
-
if @richText.sectionNumbers
|
|
305
|
-
el << XMLText.new("#{@data[0]}.#{@data[1]}.#{@data[2]} ")
|
|
306
|
-
end
|
|
307
|
-
el
|
|
317
|
+
htmlTitle(3)
|
|
308
318
|
when :hline
|
|
309
319
|
noChilds = true
|
|
310
|
-
XMLElement.new('hr')
|
|
320
|
+
XMLElement.new('hr', attrs)
|
|
311
321
|
when :paragraph
|
|
312
|
-
XMLElement.new('p')
|
|
322
|
+
XMLElement.new('p', attrs)
|
|
313
323
|
when :pre
|
|
314
324
|
noChilds = true
|
|
315
325
|
pre = XMLElement.new('pre')
|
|
@@ -341,16 +351,23 @@ class TaskJuggler
|
|
|
341
351
|
when :ref
|
|
342
352
|
XMLElement.new('a', 'href' => "#{@data}.html")
|
|
343
353
|
when :href
|
|
344
|
-
XMLElement.new('a', 'href' => @data
|
|
354
|
+
a = XMLElement.new('a', 'href' => @data.to_s)
|
|
355
|
+
a['target'] = @richText.linkTarget if @richText.linkTarget
|
|
356
|
+
a
|
|
345
357
|
when :blockfunc
|
|
346
358
|
noChilds = true
|
|
347
|
-
|
|
359
|
+
checkHandler
|
|
360
|
+
@richText.functionHandler(@data[0]).to_html(@data[1])
|
|
361
|
+
when :inlinefunc
|
|
362
|
+
noChilds = true
|
|
363
|
+
checkHandler
|
|
364
|
+
@richText.functionHandler(@data[0]).to_html(@data[1])
|
|
348
365
|
when :italic
|
|
349
366
|
XMLElement.new('i')
|
|
350
367
|
when :bold
|
|
351
368
|
XMLElement.new('b')
|
|
352
369
|
when :code
|
|
353
|
-
XMLElement.new('code')
|
|
370
|
+
XMLElement.new('code', attrs)
|
|
354
371
|
when :text
|
|
355
372
|
noChilds = true
|
|
356
373
|
XMLText.new(@children[0])
|
|
@@ -378,6 +395,15 @@ class TaskJuggler
|
|
|
378
395
|
text
|
|
379
396
|
end
|
|
380
397
|
|
|
398
|
+
def checkHandler
|
|
399
|
+
unless @data[0] && @data[0].is_a?(String)
|
|
400
|
+
raise "Bad RichText function '#{@data[0]}' requested"
|
|
401
|
+
end
|
|
402
|
+
if @richText.functionHandler(@data[0]).nil?
|
|
403
|
+
raise "No handler for #{@data[0]} registered"
|
|
404
|
+
end
|
|
405
|
+
end
|
|
406
|
+
|
|
381
407
|
# This function converts a String into a new String that only contains
|
|
382
408
|
# characters that are acceptable for HTML tag IDs.
|
|
383
409
|
def convertToID(text)
|
|
@@ -391,6 +417,24 @@ class TaskJuggler
|
|
|
391
417
|
out.chomp('_')
|
|
392
418
|
end
|
|
393
419
|
|
|
420
|
+
private
|
|
421
|
+
|
|
422
|
+
def htmlTitle(level)
|
|
423
|
+
attrs = { 'id' => convertToID(children_to_s) }
|
|
424
|
+
attrs['class'] = @richText.cssClass if @richText.cssClass
|
|
425
|
+
el = XMLElement.new("h#{level}", attrs)
|
|
426
|
+
if @richText.sectionNumbers
|
|
427
|
+
s = ''
|
|
428
|
+
1.upto(level) do |i|
|
|
429
|
+
s += '.' unless s.empty?
|
|
430
|
+
s += "#{@data[i - 1]}"
|
|
431
|
+
end
|
|
432
|
+
s += ' '
|
|
433
|
+
el << XMLText.new(s)
|
|
434
|
+
end
|
|
435
|
+
el
|
|
436
|
+
end
|
|
437
|
+
|
|
394
438
|
end
|
|
395
439
|
|
|
396
440
|
end
|