styles/vym2taskjuggler.xsl
author insilmaril
Wed Jun 21 07:35:32 2006 +0000 (2006-06-21)
changeset 355 ca0c7650fbe4
permissions -rw-r--r--
Version 1.8.0 (instead of 1.8.00)
insilmaril@229
     1
<?xml version="1.0" encoding="ISO-8859-1"?>
insilmaril@229
     2
<xsl:stylesheet name="VYM_TaskJuggler" version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
insilmaril@229
     3
<xsl:output method="text"/>
insilmaril@229
     4
<xsl:template match="node()">
insilmaril@229
     5
	<xsl:apply-templates/>
insilmaril@229
     6
</xsl:template>
insilmaril@229
     7
<xsl:template match="/vymmap/mapcenter">
insilmaril@229
     8
project <xsl:value-of select="translate(heading, ' ', '_')"/> "<xsl:value-of select="heading"/>" "1.0" 2002-01-16 2002-05-28 {
insilmaril@229
     9
  # Pick a day during the project that will be reported as 'today' in
insilmaril@229
    10
  # the project reports. If not specified the current day will be
insilmaril@229
    11
  # used, but this will likely be ouside of the project range, so it
insilmaril@229
    12
  # can't be seen in the reports.
insilmaril@229
    13
  now 2002-03-05-13:00
insilmaril@229
    14
  # Hide the clock time. Only show the date.
insilmaril@229
    15
  timeformat "%Y-%m-%d"
insilmaril@229
    16
  # The currency for all money values is U.S. Dollars.
insilmaril@229
    17
  currency "USD"
insilmaril@229
    18
insilmaril@229
    19
  # We want to compare the planned scenario, to one with the actual
insilmaril@229
    20
  # scenario
insilmaril@229
    21
  scenario plan "Planned" {
insilmaril@229
    22
    scenario actual "Actual"
insilmaril@229
    23
  }
insilmaril@229
    24
}
insilmaril@229
    25
# The daily default rate of all resources. This can be overriden for each
insilmaril@229
    26
# resource. We specify this, so that we can do a good calculation of
insilmaril@229
    27
# the costs of the project.
insilmaril@229
    28
rate 310.0
insilmaril@229
    29
insilmaril@229
    30
# This is one way to form teams
insilmaril@229
    31
macro allocate_developers [
insilmaril@229
    32
  allocate dev1
insilmaril@229
    33
  allocate dev2 { limits { dailymax 4h } }
insilmaril@229
    34
  allocate dev3
insilmaril@229
    35
]
insilmaril@229
    36
insilmaril@229
    37
flags team
insilmaril@229
    38
insilmaril@229
    39
resource dev "In House" {
insilmaril@229
    40
  resource dev1 "Some Guy" { rate 330.00 }
insilmaril@229
    41
  resource dev2 "Some Other Guy"
insilmaril@229
    42
  resource dev3 "Some Last Guy on Vacation" { vacation 2002-02-01 - 2002-02-05 }
insilmaril@229
    43
insilmaril@229
    44
  flags team
insilmaril@229
    45
}
insilmaril@229
    46
insilmaril@229
    47
resource misc "Outsource" {
insilmaril@229
    48
  resource test "Out Sourcer1" { limits { dailymax 6.4h } rate 240.00 }
insilmaril@229
    49
  resource doc  "Out Source2" { rate 280.00 vacation 2002-03-11 - 2002-03-16 }
insilmaril@229
    50
insilmaril@229
    51
  flags team
insilmaril@229
    52
}
insilmaril@229
    53
insilmaril@229
    54
# In order to do a simple profit and loss analysis of the project we
insilmaril@229
    55
# specify accounts. One for the development costs, one for the
insilmaril@229
    56
# documentation costs and one account to credit the customer payments
insilmaril@229
    57
# to.
insilmaril@229
    58
account dev "Development" cost
insilmaril@229
    59
account doc "Documentation" cost
insilmaril@229
    60
account rev "Payments" revenue
insilmaril@229
    61
insilmaril@229
    62
# Now we specify the work packages. The whole project is described as
insilmaril@229
    63
# a task that contains sub tasks. These sub tasks are then broken down
insilmaril@229
    64
# into smaller tasks and so on. The innermost tasks describe the real
insilmaril@229
    65
# work and have resources allocated to them. Many attributes of tasks
insilmaril@229
    66
# are inherited from the enclosing task. This saves you a lot of
insilmaril@229
    67
# writing.
insilmaril@229
    68
task  <xsl:value-of select="translate(heading, ' ', '_')"/> "<xsl:value-of select="heading"/>" {
insilmaril@229
    69
insilmaril@229
    70
  # All work related costs will be booked to this account unless the
insilmaril@229
    71
  # sub tasks specifies it differently.
insilmaril@229
    72
  account dev
insilmaril@229
    73
insilmaril@229
    74
	<xsl:call-template name="recursive"/>
insilmaril@229
    75
insilmaril@229
    76
}
insilmaril@229
    77
insilmaril@229
    78
# This task report is for use with the TaskJuggler GUI
insilmaril@229
    79
taskreport "Project Overview" {
insilmaril@229
    80
  columns start, end, effort, duration, completed, status, note, cost, revenue
insilmaril@229
    81
  scenario actual
insilmaril@229
    82
}
insilmaril@229
    83
insilmaril@229
    84
# A resource report for use with the TaskJuggler GUI
insilmaril@229
    85
resourcereport "Resource Usage" {
insilmaril@229
    86
  columns effort, freeload, utilization, rate
insilmaril@229
    87
  scenario actual
insilmaril@229
    88
  hideresource 0
insilmaril@229
    89
}
insilmaril@229
    90
insilmaril@229
    91
# For conveniance we would like each report to contain links to the
insilmaril@229
    92
# other reports. So we declare a macro with a fragment of raw HTML
insilmaril@229
    93
# code to be embedded into all the HTML reports.
insilmaril@229
    94
macro navbar [
insilmaril@229
    95
rawhead
insilmaril@229
    96
  '<table align="center" border="2" cellpadding="10"
insilmaril@229
    97
    style="background-color:#f3ebae; font-size:105%">
insilmaril@229
    98
  <tr>
insilmaril@229
    99
    <td><a href="Tasks-Overview.html">Tasks Overview</a></td>
insilmaril@229
   100
    <td><a href="Staff-Overview.html">Staff Overview</a></td>
insilmaril@229
   101
    <td><a href="Accounting.html">Accounting</a></td>
insilmaril@229
   102
    <td><a href="Calendar.html">Calendar</a></td>
insilmaril@229
   103
  </tr>
insilmaril@229
   104
  <tr>
insilmaril@229
   105
    <td><a href="Tasks-Details.html">Tasks Details</a></td>
insilmaril@229
   106
    <td><a href="Staff-Details.html">Staff Details</a></td>
insilmaril@229
   107
    <td><a href="Status-Report.html">Status Report</a></td>
insilmaril@229
   108
    <td><a href="acso.eps">GANTT Chart (Postscript)</a></td>
insilmaril@229
   109
  </tr>
insilmaril@229
   110
  </table>
insilmaril@229
   111
  <br/>'
insilmaril@229
   112
]
insilmaril@229
   113
insilmaril@229
   114
# As the first report, we would like to have a general overview of all
insilmaril@229
   115
# tasks with their computed start and end dates. For better
insilmaril@229
   116
# readability we include a calendar like column that lists the effort
insilmaril@229
   117
# for each week.
insilmaril@229
   118
htmltaskreport "Tasks-Overview.html" {
insilmaril@229
   119
  # This report should contain the navigation bar we have declared
insilmaril@229
   120
  # above.
insilmaril@229
   121
  ${navbar}
insilmaril@229
   122
  # The report should be a table that contains several columns. The
insilmaril@229
   123
  # task and their information form the rows of the table. Since we
insilmaril@229
   124
  # don't like the title of the effort column, we change it to "Work".
insilmaril@229
   125
  columns hierarchindex, name, duration, effort { title "Work"},
insilmaril@229
   126
          start, end, weekly
insilmaril@229
   127
  # For this report we like to have the abbreviated weekday in front
insilmaril@229
   128
  # of the date. %a is the tag for this.
insilmaril@229
   129
  timeformat "%a %Y-%m-%d"
insilmaril@229
   130
insilmaril@229
   131
  # Don't show load values.
insilmaril@229
   132
  barlabels empty
insilmaril@229
   133
  # Set a title for the report
insilmaril@229
   134
  headline "<xsl:value-of select="heading"/> Project"
insilmaril@229
   135
  # And a short description what this report is about.
insilmaril@229
   136
  caption "This table presents a management-level overview of the project. The values are days or man-days."
insilmaril@229
   137
}
insilmaril@229
   138
insilmaril@229
   139
# Now a more detailed report that shows all jobs and the people
insilmaril@229
   140
# assigned to the tasks. It also features a comparison of the planned
insilmaril@229
   141
# and actual scenario.
insilmaril@229
   142
htmltaskreport "Tasks-Details.html" {
insilmaril@229
   143
  ${navbar}
insilmaril@229
   144
  # Now we use a daily calendar.
insilmaril@229
   145
  columns no, name, start, end, scenario, daily
insilmaril@229
   146
  #start 2002-03-01
insilmaril@229
   147
  #end 2002-04-01
insilmaril@229
   148
  # Show plan and delayed scenario values.
insilmaril@229
   149
  scenarios plan, actual
insilmaril@229
   150
  headline "<xsl:value-of select="heading"/> Project - March 2002"
insilmaril@229
   151
  caption "This table shows the load of each day for all the tasks.
insilmaril@229
   152
  Additionally the resources used for each task are listed. Since the
insilmaril@229
   153
  project start was delayed, the delayed schedule differs significantly
insilmaril@229
   154
  from the original plan."
insilmaril@229
   155
  # Don't hide any resources, that is show them all.
insilmaril@229
   156
  hideresource 0
insilmaril@229
   157
}
insilmaril@229
   158
insilmaril@229
   159
# The previous report listed the resources per task. Now we generate a
insilmaril@229
   160
# report the lists all resources.
insilmaril@229
   161
htmlresourcereport "Staff-Overview.html" {
insilmaril@229
   162
  ${navbar}
insilmaril@229
   163
  # Add a column with the total effort per task.
insilmaril@229
   164
  columns no, name { cellurl "http://www.tj.org" }, scenario, weekly, effort
insilmaril@229
   165
  scenarios plan, actual
insilmaril@229
   166
  # Since we want to see the load values as hours per week, we switch
insilmaril@229
   167
  # the unit that loads are reported in to hours.
insilmaril@229
   168
  loadunit hours
insilmaril@229
   169
  headline "Weekly working hours for the <xsl:value-of select="heading"/> Project"
insilmaril@229
   170
}
insilmaril@229
   171
insilmaril@229
   172
# Now a report similar to the above one but with much more details.
insilmaril@229
   173
htmlresourcereport "Staff-Details.html" {
insilmaril@229
   174
  ${navbar}
insilmaril@229
   175
  columns name, daily, effort
insilmaril@229
   176
  # To still keep the report readable we limit it to show only the
insilmaril@229
   177
  # data for March 2002.
insilmaril@229
   178
  start 2002-01-16
insilmaril@229
   179
  end 2002-04-01
insilmaril@229
   180
  hidetask 0
insilmaril@229
   181
  # The teams are virtual resources that we don't want to see. Since
insilmaril@229
   182
  # we have assigned a flag to those virtual resource, we can just
insilmaril@229
   183
  # hide them.
insilmaril@229
   184
  hideresource team
insilmaril@229
   185
  # We also like to have the report sorted alphabetically ascending by
insilmaril@229
   186
  # resource name.
insilmaril@229
   187
  sortresources nameup
insilmaril@229
   188
  loadunit hours
insilmaril@229
   189
  headline "Daily working hours for the <xsl:value-of select="heading"/> Project - March 2002"
insilmaril@229
   190
}
insilmaril@229
   191
insilmaril@229
   192
htmlweeklycalendar "Calendar.html" {
insilmaril@229
   193
  ${navbar}
insilmaril@229
   194
  headline "Ongoing Tasks - March 2002"
insilmaril@229
   195
  start 2002-03-01
insilmaril@229
   196
  end 2002-04-01
insilmaril@229
   197
}
insilmaril@229
   198
insilmaril@229
   199
htmlstatusreport "Status-Report.html" {
insilmaril@229
   200
  ${navbar}
insilmaril@229
   201
}
insilmaril@229
   202
insilmaril@229
   203
# To conclude the HTML reports a report that shows how badly the
insilmaril@229
   204
# project is calculated is generated. The company won't get rich with
insilmaril@229
   205
# this project. Due to the slip, it actually needs some money from the
insilmaril@229
   206
# bank to pay the salaries.
insilmaril@229
   207
htmlaccountreport "Accounting.html" {
insilmaril@229
   208
  ${navbar}
insilmaril@229
   209
  # Besides the number of the account and the name we have a column
insilmaril@229
   210
  # with the total values (at the end of the project) and the values
insilmaril@229
   211
  # for each month of the project.
insilmaril@229
   212
  columns no, name, scenario, total, monthly
insilmaril@229
   213
  headline "P&#038;L for the Accounting Software Project"
insilmaril@229
   214
  caption "The table shows the profit and loss
insilmaril@229
   215
           analysis as well as the cashflow situation of the Accounting
insilmaril@229
   216
           Software Project."
insilmaril@229
   217
  # Since this is a cashflow calculation we show accumulated values
insilmaril@229
   218
  # per account.
insilmaril@229
   219
  accumulate
insilmaril@229
   220
  scenarios plan, actual
insilmaril@229
   221
}
insilmaril@229
   222
insilmaril@229
   223
# Finally we generate an XML report that contains all info about the
insilmaril@229
   224
# scheduled project. This will be used by tjx2gantt to create a nice
insilmaril@229
   225
# Gantt chart of our project.
insilmaril@229
   226
xmlreport "<xsl:value-of select="translate(heading, ' ', '_')"/>.tjx" {
insilmaril@229
   227
# version 2
insilmaril@229
   228
}
insilmaril@229
   229
</xsl:template>
insilmaril@229
   230
<xsl:template name="recursive">
insilmaril@229
   231
	<xsl:for-each select="branch">
insilmaril@229
   232
        	task <xsl:value-of select="translate(heading, ' ', '_')"/> "<xsl:value-of select="heading"/>" {
insilmaril@229
   233
		# I've included all of the Optional Attributes here.
insilmaril@229
   234
		# Commented out for your pleasure.	
insilmaril@229
   235
		#account
insilmaril@229
   236
		#allocate dev1
insilmaril@229
   237
		#complete
insilmaril@229
   238
		#depends 
insilmaril@229
   239
		#duration
insilmaril@229
   240
		#effort 20d
insilmaril@229
   241
		#endbuffer
insilmaril@229
   242
		#endcredit
insilmaril@229
   243
		#end, flags
insilmaril@229
   244
		#journalentry
insilmaril@229
   245
		#length
insilmaril@229
   246
		#maxend
insilmaril@229
   247
		#maxstart
insilmaril@229
   248
		#milestone
insilmaril@229
   249
		#minend
insilmaril@229
   250
		#minstart
insilmaril@229
   251
		#note
insilmaril@229
   252
		#precedes
insilmaril@229
   253
		#priority
insilmaril@229
   254
		#projectid
insilmaril@229
   255
		#reference
insilmaril@229
   256
		#responsible
insilmaril@229
   257
		#scheduled
insilmaril@229
   258
		#scheduling
insilmaril@229
   259
		#shift
insilmaril@229
   260
		#startbuffer
insilmaril@229
   261
		#startcredit
insilmaril@229
   262
		plan:start 2002-03-05
insilmaril@229
   263
		actual:start 2002-03-05
insilmaril@229
   264
		#statusnote
insilmaril@229
   265
		#supplement
insilmaril@229
   266
		<xsl:call-template name="recursive"/>
insilmaril@229
   267
		}
insilmaril@229
   268
	</xsl:for-each>
insilmaril@229
   269
</xsl:template>
insilmaril@229
   270
</xsl:stylesheet>