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