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/PropertySet.rb
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
#
|
|
4
4
|
# = PropertySet.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
|
|
@@ -93,6 +93,24 @@ class TaskJuggler
|
|
|
93
93
|
@attributeDefinitions.include?(attrId)
|
|
94
94
|
end
|
|
95
95
|
|
|
96
|
+
# Check whether the PropertyTreeNode has a calculated attribute with the
|
|
97
|
+
# ID _attrId_. For scenarioSpecific attributes _scenarioIdx_ needs to be
|
|
98
|
+
# provided.
|
|
99
|
+
def hasQuery?(attrId, scenarioIdx = nil)
|
|
100
|
+
return false if @properties.empty?
|
|
101
|
+
|
|
102
|
+
property = @properties.first
|
|
103
|
+
methodName = 'query_' + attrId
|
|
104
|
+
# First we check for non-scenario-specific query functions.
|
|
105
|
+
if property.respond_to?(methodName)
|
|
106
|
+
return true
|
|
107
|
+
elsif scenarioIdx
|
|
108
|
+
# Then we check for scenario-specific ones via the @data member.
|
|
109
|
+
return property.data[scenarioIdx].respond_to?(methodName)
|
|
110
|
+
end
|
|
111
|
+
false
|
|
112
|
+
end
|
|
113
|
+
|
|
96
114
|
# Return whether the attribute with _attrId_ is scenario specific or not.
|
|
97
115
|
def scenarioSpecific?(attrId)
|
|
98
116
|
# All hardwired attributes are not scenario specific.
|
|
@@ -224,19 +242,14 @@ class TaskJuggler
|
|
|
224
242
|
@propertyMap[id]
|
|
225
243
|
end
|
|
226
244
|
|
|
227
|
-
# Update the
|
|
228
|
-
# the set has been modified.
|
|
245
|
+
# Update the work-breakdown-structure (wbs) indicies. This method needs to
|
|
246
|
+
# be called whenever the set has been modified.
|
|
229
247
|
def index
|
|
230
248
|
each do |p|
|
|
231
249
|
wbsIdcs = p.getWBSIndicies
|
|
232
|
-
tree = ""
|
|
233
250
|
wbs = ""
|
|
234
251
|
first = true
|
|
235
252
|
wbsIdcs.each do |idx|
|
|
236
|
-
# Prefix the level index with zeros so that we always have a 5 digit
|
|
237
|
-
# long String. 5 digits should be large enough for all real-world
|
|
238
|
-
# projects.
|
|
239
|
-
tree += idx.to_s.rjust(5, '0')
|
|
240
253
|
if first
|
|
241
254
|
first = false
|
|
242
255
|
else
|
|
@@ -245,7 +258,6 @@ class TaskJuggler
|
|
|
245
258
|
wbs += idx.to_s
|
|
246
259
|
end
|
|
247
260
|
p.set('wbs', wbs)
|
|
248
|
-
p.set('tree', tree)
|
|
249
261
|
end
|
|
250
262
|
end
|
|
251
263
|
|
|
@@ -300,7 +312,7 @@ class TaskJuggler
|
|
|
300
312
|
|
|
301
313
|
# Return the set of PropertyTreeNode objects as flat Array.
|
|
302
314
|
def to_ary
|
|
303
|
-
@properties
|
|
315
|
+
@properties.dup
|
|
304
316
|
end
|
|
305
317
|
|
|
306
318
|
def to_s
|
data/lib/PropertyTreeNode.rb
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
#
|
|
4
4
|
# = PropertyTreeNode.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
|
|
@@ -29,6 +29,7 @@ class TaskJuggler
|
|
|
29
29
|
attr_reader :propertySet, :id, :name, :parent, :project, :sequenceNo,
|
|
30
30
|
:children
|
|
31
31
|
attr_accessor :sourceFileInfo
|
|
32
|
+
attr_reader :data
|
|
32
33
|
|
|
33
34
|
# Create a new PropertyTreeNode object. _propertySet_ is the PropertySet
|
|
34
35
|
# that this PropertyTreeNode object belongs to. The PropertySet determines
|
|
@@ -44,7 +45,7 @@ class TaskJuggler
|
|
|
44
45
|
unless id
|
|
45
46
|
tag = self.class.to_s.gsub(/TaskJuggler::/, '')
|
|
46
47
|
id = '_' + tag + '_' + (propertySet.items + 1).to_s
|
|
47
|
-
id = parent.
|
|
48
|
+
id = parent.fullId + '.' + id if !@propertySet.flatNamespace && parent
|
|
48
49
|
end
|
|
49
50
|
if !@propertySet.flatNamespace && id.include?('.')
|
|
50
51
|
parentId = id[0..(id.rindex('.') - 1)]
|
|
@@ -251,6 +252,19 @@ class TaskJuggler
|
|
|
251
252
|
idcs
|
|
252
253
|
end
|
|
253
254
|
|
|
255
|
+
# Return the 'index' attributes of this property, prefixed by the 'index'
|
|
256
|
+
# attributes of all its parents. The result is an Array of Fixnums.
|
|
257
|
+
def getIndicies
|
|
258
|
+
idcs = []
|
|
259
|
+
p = self
|
|
260
|
+
begin
|
|
261
|
+
parent = p.parent
|
|
262
|
+
idcs.insert(0, p.get('index'))
|
|
263
|
+
p = parent
|
|
264
|
+
end while p
|
|
265
|
+
idcs
|
|
266
|
+
end
|
|
267
|
+
|
|
254
268
|
# Add _child_ node as child to this node.
|
|
255
269
|
def addChild(child)
|
|
256
270
|
if $DEBUG && child.propertySet != @propertySet
|
|
@@ -319,7 +333,9 @@ class TaskJuggler
|
|
|
319
333
|
@sequenceNo
|
|
320
334
|
else
|
|
321
335
|
unless @attributes.has_key?(attributeId)
|
|
322
|
-
raise TjException.new,
|
|
336
|
+
raise TjException.new,
|
|
337
|
+
"Unknown attribute '#{attributeId}' requested for " +
|
|
338
|
+
"#{self.class.to_s.sub(/TaskJuggler::/, '')} '#{fullId}'"
|
|
323
339
|
end
|
|
324
340
|
@attributes[attributeId].get
|
|
325
341
|
end
|
|
@@ -345,6 +361,22 @@ class TaskJuggler
|
|
|
345
361
|
end
|
|
346
362
|
end
|
|
347
363
|
|
|
364
|
+
# This function is similar to getAttr() but it always returns a
|
|
365
|
+
# AttributeBase object.
|
|
366
|
+
def getAttribute(attributeId, scenarioIdx = nil)
|
|
367
|
+
case attributeId
|
|
368
|
+
when 'id'
|
|
369
|
+
StringAttribute.new(self, @id)
|
|
370
|
+
when 'name'
|
|
371
|
+
StringAttribute.new(self, @name)
|
|
372
|
+
when 'seqno'
|
|
373
|
+
FixnumAttribute.new(self, @sequenceNo)
|
|
374
|
+
else
|
|
375
|
+
@attributes[attributeId] ||
|
|
376
|
+
@scenarioAttributes[scenarioIdx][attributeId]
|
|
377
|
+
end
|
|
378
|
+
end
|
|
379
|
+
|
|
348
380
|
# Set the non-scenario-specific attribute with ID _attributeId_ to _value_.
|
|
349
381
|
# In case the attribute does not exist, an exception is raised.
|
|
350
382
|
def set(attributeId, value)
|
|
@@ -379,18 +411,6 @@ class TaskJuggler
|
|
|
379
411
|
end
|
|
380
412
|
end
|
|
381
413
|
|
|
382
|
-
# This function returns true if the PropertyTreeNode has a query function
|
|
383
|
-
# for the given ID _queryId_. In case a _scenarioIdx_ is specified, the
|
|
384
|
-
# query function must be scenario specific.
|
|
385
|
-
def hasQuery?(queryId, scenarioIdx = nil)
|
|
386
|
-
methodName = 'query_' + queryId
|
|
387
|
-
if scenarioIdx
|
|
388
|
-
@data[scenarioIdx].respond_to?(methodName)
|
|
389
|
-
else
|
|
390
|
-
respond_to?(methodName)
|
|
391
|
-
end
|
|
392
|
-
end
|
|
393
|
-
|
|
394
414
|
# Returns true if the value of the attribute _attributeId_ (in scenario
|
|
395
415
|
# _scenarioIdx_) has been provided by the user.
|
|
396
416
|
def provided(attributeId, scenarioIdx = nil)
|
|
@@ -415,6 +435,48 @@ class TaskJuggler
|
|
|
415
435
|
end
|
|
416
436
|
end
|
|
417
437
|
|
|
438
|
+
def modified?(attributeId, scenarioIdx = nil)
|
|
439
|
+
if scenarioIdx
|
|
440
|
+
return false if @scenarioAttributes[scenarioIdx][attributeId].nil?
|
|
441
|
+
@scenarioAttributes[scenarioIdx][attributeId].provided ||
|
|
442
|
+
@scenarioAttributes[scenarioIdx][attributeId].inherited
|
|
443
|
+
else
|
|
444
|
+
return false if @attributes[attributeId].nil?
|
|
445
|
+
@attributes[attributeId].provided || @attributes[attributeId].inherited
|
|
446
|
+
end
|
|
447
|
+
end
|
|
448
|
+
|
|
449
|
+
def query_alert(query)
|
|
450
|
+
journal = @project['journal']
|
|
451
|
+
query.sortable = query.numerical = alert =
|
|
452
|
+
journal.alertLevel(query.end, self)
|
|
453
|
+
query.string = @project.alertLevelName(alert)
|
|
454
|
+
end
|
|
455
|
+
|
|
456
|
+
def query_alertsummary(query)
|
|
457
|
+
alertMessages(query, false)
|
|
458
|
+
end
|
|
459
|
+
|
|
460
|
+
def query_alertmessage(query)
|
|
461
|
+
alertMessages(query, true)
|
|
462
|
+
end
|
|
463
|
+
|
|
464
|
+
def query_alerttrend(query)
|
|
465
|
+
journal = @project['journal']
|
|
466
|
+
startAlert = journal.alertLevel(query.start, self)
|
|
467
|
+
endAlert = journal.alertLevel(query.end, self)
|
|
468
|
+
if startAlert < endAlert
|
|
469
|
+
query.sortable = 0
|
|
470
|
+
query.string = 'Up'
|
|
471
|
+
elsif startAlert > endAlert
|
|
472
|
+
query.sortable = 2
|
|
473
|
+
query.string = 'Down'
|
|
474
|
+
else
|
|
475
|
+
query.sortable = 1
|
|
476
|
+
query.string = 'Flat'
|
|
477
|
+
end
|
|
478
|
+
end
|
|
479
|
+
|
|
418
480
|
# Dump the class data in human readable form. Used for debugging only.
|
|
419
481
|
def to_s # :nodoc:
|
|
420
482
|
res = "#{self.class} #{fullId} \"#{@name}\"\n" +
|
|
@@ -460,6 +522,49 @@ class TaskJuggler
|
|
|
460
522
|
|
|
461
523
|
private
|
|
462
524
|
|
|
525
|
+
# Create a blog-style list of all alert messages that match the Query.
|
|
526
|
+
def alertMessages(query, longVersion)
|
|
527
|
+
# The components of the message are either UTF-8 text or RichText. For
|
|
528
|
+
# the RichText components, we use the originally provided markup since
|
|
529
|
+
# we compose the result as RichText markup first.
|
|
530
|
+
rText = ''
|
|
531
|
+
@project['journal'].currentEntries(query.end, self, 0,
|
|
532
|
+
query.start).each do |entry|
|
|
533
|
+
rText += "== " + entry.headline + " ==\n"
|
|
534
|
+
rText += "''Reported on #{entry.date.to_s(query.timeFormat)}'' "
|
|
535
|
+
if entry.author
|
|
536
|
+
rText += "''by #{entry.author.name}''"
|
|
537
|
+
end
|
|
538
|
+
rText += "\n\n"
|
|
539
|
+
if entry.summary
|
|
540
|
+
rText += entry.summary.richText.inputText + "\n\n"
|
|
541
|
+
end
|
|
542
|
+
if longVersion && entry.details
|
|
543
|
+
rText += entry.details.richText.inputText + "\n\n"
|
|
544
|
+
end
|
|
545
|
+
end
|
|
546
|
+
# Now convert the RichText markup String into RichTextIntermediate
|
|
547
|
+
# format.
|
|
548
|
+
handlers = [
|
|
549
|
+
RTFNavigator.new(@project),
|
|
550
|
+
RTFQuery.new(@project),
|
|
551
|
+
RTFReport.new(@project)
|
|
552
|
+
]
|
|
553
|
+
begin
|
|
554
|
+
rti = RichText.new(rText, handlers).generateIntermediateFormat
|
|
555
|
+
rescue RichTextException => msg
|
|
556
|
+
$stderr.puts "Error in RichText of rule #{@keyword}\n" +
|
|
557
|
+
"Line #{msg.lineNo}: #{msg.text}\n" +
|
|
558
|
+
"#{msg.line}"
|
|
559
|
+
return nil
|
|
560
|
+
end
|
|
561
|
+
# No section numbers, please!
|
|
562
|
+
rti.sectionNumbers = false
|
|
563
|
+
# We use a special class to allow CSS formating.
|
|
564
|
+
rti.cssClass = 'alertmessage'
|
|
565
|
+
query.rti = rti
|
|
566
|
+
end
|
|
567
|
+
|
|
463
568
|
def newAttribute(attributeType)
|
|
464
569
|
attribute = attributeType.objClass.new(self, attributeType)
|
|
465
570
|
# If the attribute requires a pointer to the project, we'll hand it over.
|
data/lib/Query.rb
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
#
|
|
4
4
|
# = Query.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
|
|
@@ -19,7 +19,8 @@ class TaskJuggler
|
|
|
19
19
|
# run has been completed, but it only produces good results for static
|
|
20
20
|
# attributes. And for such queries, the PropertyTreeNode.get and [] functions
|
|
21
21
|
# are a lot more efficient.
|
|
22
|
-
#
|
|
22
|
+
#
|
|
23
|
+
# When constructing a Query, a set of variables need to be set that is
|
|
23
24
|
# sufficient enough to identify a unique attribute. Some attribute are
|
|
24
25
|
# computed dynamically and further variables such as a start and end time will
|
|
25
26
|
# be incorporated into the result computation.
|
|
@@ -33,17 +34,22 @@ class TaskJuggler
|
|
|
33
34
|
|
|
34
35
|
attr_accessor :project, :propertyType, :propertyId, :property,
|
|
35
36
|
:scopePropertyType, :scopePropertyId, :scopeProperty,
|
|
36
|
-
:attributeId, :scenarioIdx, :
|
|
37
|
-
:numberFormat, :currencyFormat, :costAccount,
|
|
37
|
+
:attributeId, :scenarioIdx, :startIdx, :endIdx,
|
|
38
|
+
:timeFormat, :numberFormat, :currencyFormat, :costAccount,
|
|
39
|
+
:revenueAccount,
|
|
38
40
|
:loadUnit,
|
|
39
|
-
:
|
|
41
|
+
:ok, :errorMessage
|
|
42
|
+
attr_reader :end, :start
|
|
43
|
+
attr_writer :sortable, :numerical, :string, :rti
|
|
40
44
|
|
|
41
45
|
# Create a new Query object. The _parameters_ need to be sufficent to
|
|
42
46
|
# uniquely identify an attribute.
|
|
43
47
|
def initialize(parameters = { })
|
|
44
48
|
ps = %w( project propertyType propertyId property scopePropertyId
|
|
45
|
-
scopeProperty attributeId scenarioIdx
|
|
46
|
-
|
|
49
|
+
scopeProperty attributeId scenario scenarioIdx
|
|
50
|
+
start end startIdx endIdx
|
|
51
|
+
loadUnit numberFormat currencyFormat timeFormat
|
|
52
|
+
costAccount revenueAccount)
|
|
47
53
|
ps.each do |p|
|
|
48
54
|
instance_variable_set('@' + p, parameters[p] ? parameters[p] : nil)
|
|
49
55
|
end
|
|
@@ -51,26 +57,49 @@ class TaskJuggler
|
|
|
51
57
|
reset
|
|
52
58
|
end
|
|
53
59
|
|
|
54
|
-
#
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
@
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
@
|
|
60
|
+
# Reset the @startIdx when a start date is set.
|
|
61
|
+
def start=(date)
|
|
62
|
+
@start = date
|
|
63
|
+
@startIdx = nil
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Reset the @endIdx when an end date is set.
|
|
67
|
+
def end=(date)
|
|
68
|
+
@end = date
|
|
69
|
+
@endIdx = nil
|
|
63
70
|
end
|
|
64
71
|
|
|
65
72
|
# This method tries to resolve the query and return a result. In case it
|
|
66
73
|
# finds an attribute that matches the query, it returns true; false
|
|
67
|
-
# otherwise. The actual result data is
|
|
74
|
+
# otherwise. The actual result data is stored in the Query object. It can
|
|
75
|
+
# then be retrieved by the caller with the methods to_s(), to_num(),
|
|
76
|
+
# to_sort() and result().
|
|
68
77
|
def process
|
|
78
|
+
reset
|
|
69
79
|
begin
|
|
70
80
|
# Resolve property reference from property ID.
|
|
71
|
-
if
|
|
81
|
+
if @property.nil? && !@propertyId.nil?
|
|
72
82
|
@property = resolvePropertyId(@propertyType, @propertyId)
|
|
73
83
|
end
|
|
84
|
+
|
|
85
|
+
unless @property
|
|
86
|
+
# No property was provided. We are looking for a project attribute.
|
|
87
|
+
supportedAttrs = %w( copyright currency end name now projectid
|
|
88
|
+
start version )
|
|
89
|
+
unless supportedAttrs.include?(@attributeId)
|
|
90
|
+
raise TjException.new,
|
|
91
|
+
"Unsupported project attribute '#{@attributeId}'"
|
|
92
|
+
end
|
|
93
|
+
attr = @project[@attributeId]
|
|
94
|
+
if attr.is_a?(TjTime)
|
|
95
|
+
@sortable = @numerical = attr
|
|
96
|
+
@string = attr.to_s(@timeFormat)
|
|
97
|
+
else
|
|
98
|
+
@sortable = @string = attr
|
|
99
|
+
end
|
|
100
|
+
return @ok = true
|
|
101
|
+
end
|
|
102
|
+
|
|
74
103
|
# Same for the scope property.
|
|
75
104
|
if !@scopeProperty.nil? && !@scopePropertyId.nil?
|
|
76
105
|
@scopeProperty = resolvePropertyId(@scopePropertyType,
|
|
@@ -79,45 +108,77 @@ class TaskJuggler
|
|
|
79
108
|
# Make sure the have a reference to the project.
|
|
80
109
|
@project = @property.project unless @project
|
|
81
110
|
|
|
111
|
+
if @scenario && !@scenarioIdx
|
|
112
|
+
@scenarioIdx = @project.scenarioIdx(@scenario)
|
|
113
|
+
unless @scenarioIdx
|
|
114
|
+
raise "Query cannot resolve scenario '#{@scenario}'"
|
|
115
|
+
end
|
|
116
|
+
end
|
|
82
117
|
@startIdx = @project.dateToIdx(@start, true) if @startIdx.nil? && @start
|
|
83
118
|
@endIdx = @project.dateToIdx(@end, true) - 1 if @endIdx.nil? && @end
|
|
84
119
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
120
|
+
queryMethodName = 'query_' + @attributeId
|
|
121
|
+
# First we check for non-scenario-specific query functions.
|
|
122
|
+
if @property.respond_to?(queryMethodName)
|
|
123
|
+
@property.send(queryMethodName, self)
|
|
124
|
+
elsif @scenarioIdx &&
|
|
125
|
+
@property.data[@scenarioIdx].respond_to?(queryMethodName)
|
|
126
|
+
# Then we check for scenario-specific ones via the @data member.
|
|
127
|
+
@property.send(queryMethodName, @scenarioIdx, self)
|
|
92
128
|
else
|
|
93
|
-
#
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
@property[@attributeId, @scenarioIdx]
|
|
98
|
-
else
|
|
99
|
-
@property.get(@attributeId)
|
|
100
|
-
end
|
|
101
|
-
if @sortableResult.is_a?(Array)
|
|
102
|
-
# This ugly special case is needed for custom attributes of type
|
|
103
|
-
# reference.
|
|
104
|
-
@sortableResult = @sortableResult[0]
|
|
129
|
+
# The result is a BaseAttribute
|
|
130
|
+
unless (@attr = @property.getAttribute(@attributeId, @scenarioIdx))
|
|
131
|
+
errorMessage = "Unknown attribute #{@attributeId} queried"
|
|
132
|
+
return @ok = false
|
|
105
133
|
end
|
|
106
|
-
@result = @sortableResult.to_s
|
|
107
|
-
@numericalResult = @result if @result.is_a?(Fixnum) or
|
|
108
|
-
@result.is_a?(Float)
|
|
109
134
|
end
|
|
110
135
|
rescue TjException
|
|
111
|
-
@errorMessage =
|
|
112
|
-
@result = ''
|
|
136
|
+
@errorMessage = $!.message
|
|
113
137
|
return @ok = false
|
|
114
138
|
end
|
|
115
139
|
@ok = true
|
|
116
140
|
end
|
|
117
141
|
|
|
118
|
-
#
|
|
119
|
-
|
|
120
|
-
|
|
142
|
+
# Return the result of the Query as String. The result may be nil.
|
|
143
|
+
def to_s
|
|
144
|
+
@attr ? @attr.to_s(self) : (@string || '')
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
# Return the result of the Query as Fixnum or Float. The result may be
|
|
148
|
+
# nil.
|
|
149
|
+
def to_num
|
|
150
|
+
@attr ? @attr.to_num : @numerical
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
# Return the result in the best suited type and format for sorting. The
|
|
154
|
+
# result may be nil.
|
|
155
|
+
def to_sort
|
|
156
|
+
@attr ? @attr.to_sort : @sortable
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
# Return the result as RichTextIntermediate object. The result may be nil.
|
|
160
|
+
def to_rti
|
|
161
|
+
@attr ? @attr.to_rti(self) : @rti
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
# Return the result in the orginal form. It may be nil.
|
|
165
|
+
def result
|
|
166
|
+
if @attr
|
|
167
|
+
if @attr.value && @attr.is_a?(ReferenceAttribute)
|
|
168
|
+
@attr.value[0]
|
|
169
|
+
else
|
|
170
|
+
@attr.value
|
|
171
|
+
end
|
|
172
|
+
elsif @numerical
|
|
173
|
+
@numerical
|
|
174
|
+
else
|
|
175
|
+
@string
|
|
176
|
+
end
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
# Convert a duration to the format specified by @loadUnit. _value_ is the
|
|
180
|
+
# duration effort in days. The return value is the converted value with
|
|
181
|
+
# optional unit as a String.
|
|
121
182
|
def scaleDuration(value)
|
|
122
183
|
scaleValue(value, [ 24 * 60, 24, 1, 1.0 / 7, 1.0 / 30.42, 1.0 / 365 ])
|
|
123
184
|
end
|
|
@@ -142,11 +203,11 @@ class TaskJuggler
|
|
|
142
203
|
end
|
|
143
204
|
case pType
|
|
144
205
|
when :Account
|
|
145
|
-
@project.account
|
|
206
|
+
@project.account(pId)
|
|
146
207
|
when :Task
|
|
147
|
-
@project.task
|
|
208
|
+
@project.task(pId)
|
|
148
209
|
when:Resource
|
|
149
|
-
@project.resource
|
|
210
|
+
@project.resource(pId)
|
|
150
211
|
else
|
|
151
212
|
raise TjException.new, "Unknown property type #{pType}"
|
|
152
213
|
end
|
|
@@ -222,6 +283,16 @@ class TaskJuggler
|
|
|
222
283
|
str
|
|
223
284
|
end
|
|
224
285
|
|
|
286
|
+
private
|
|
287
|
+
|
|
288
|
+
# Queries object can be reused. Calling this function will clear the query
|
|
289
|
+
# result data.
|
|
290
|
+
def reset
|
|
291
|
+
@attr = @numerical = @sortable = @string = @rti = nil
|
|
292
|
+
@ok = nil
|
|
293
|
+
@errorMessage = nil
|
|
294
|
+
end
|
|
295
|
+
|
|
225
296
|
end
|
|
226
297
|
|
|
227
298
|
end
|