annotate bug-list.xsl @ 12:52b34ea50eff default tip

sync: work time projection doesn't seem to be working anyway
author cin
date Sun, 13 Sep 2015 19:37:16 +0300
parents 4eb9fdf4efa9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
1 <?xml version="1.0" encoding="UTF-8"?>
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
2 <xsl:stylesheet version="1.0"
4
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exsl="http://exslt.org/common"
11
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
4 xmlns:date="http://exslt.org/dates-and-times"
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
5 extension-element-prefixes="exsl date">
4
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
6 <xsl:output method="text" indent="yes" />
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
7
5
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
8 <!-- PARAMETERS -->
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
9
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
10 <!-- chargeset - название аккаунта, на который вести расходы -->
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
11 <xsl:param name="chargeset" />
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
12
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
13 <!-- root_task_id - id корневой задачи, в которую будут организованы все
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
14 задачи -->
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
15 <xsl:param name="root_task_id" />
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
16
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
17 <!-- root_task - описание корневой задачи -->
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
18 <xsl:param name="root_task" />
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
19
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
20 <!-- GLOBAL VARIABLES -->
4
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
21 <xsl:variable name="resources"
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
22 select="document('resources.xml')/resources/resource" />
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
23
3
36ae3ec94442 xslt: prepare taskjuggler tasks structure
cin
parents: 1
diff changeset
24 <xsl:variable name="bugs" select="/bugzilla/bug" />
4
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
25
10
14a966369278 working version of exporting bugs from bugzilla in tj3 format (without bookings)
cin
parents: 6
diff changeset
26 <xsl:key name="bugid" match="/bugzilla/bug" use="string(id)" />
4
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
27
10
14a966369278 working version of exporting bugs from bugzilla in tj3 format (without bookings)
cin
parents: 6
diff changeset
28 <xsl:variable name="roots" select="$bugs[not(blocks[key('bugid',.)])]" />
1
d1400de5832b improved xsl
cin
parents: 0
diff changeset
29
d1400de5832b improved xsl
cin
parents: 0
diff changeset
30 <!-- BUILD BUG TREE -->
d1400de5832b improved xsl
cin
parents: 0
diff changeset
31 <xsl:variable name="tree">
d1400de5832b improved xsl
cin
parents: 0
diff changeset
32 <xsl:apply-templates mode="tree" select="$roots" />
d1400de5832b improved xsl
cin
parents: 0
diff changeset
33 </xsl:variable>
d1400de5832b improved xsl
cin
parents: 0
diff changeset
34
d1400de5832b improved xsl
cin
parents: 0
diff changeset
35 <xsl:template match="bug" mode="tree">
d1400de5832b improved xsl
cin
parents: 0
diff changeset
36 <xsl:element name="bug">
10
14a966369278 working version of exporting bugs from bugzilla in tj3 format (without bookings)
cin
parents: 6
diff changeset
37 <xsl:attribute name="id"><xsl:value-of select="id" /></xsl:attribute>
3
36ae3ec94442 xslt: prepare taskjuggler tasks structure
cin
parents: 1
diff changeset
38 <xsl:if test="component = 'product' or not(number(estimated_time))">
5
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
39 <xsl:attribute name="group"><xsl:value-of select="boolean(1)" /></xsl:attribute>
1
d1400de5832b improved xsl
cin
parents: 0
diff changeset
40 </xsl:if>
10
14a966369278 working version of exporting bugs from bugzilla in tj3 format (without bookings)
cin
parents: 6
diff changeset
41 <xsl:for-each select="depends_on">
1
d1400de5832b improved xsl
cin
parents: 0
diff changeset
42 <xsl:apply-templates mode="tree" select="key('bugid', .)" />
d1400de5832b improved xsl
cin
parents: 0
diff changeset
43 </xsl:for-each>
d1400de5832b improved xsl
cin
parents: 0
diff changeset
44 </xsl:element>
d1400de5832b improved xsl
cin
parents: 0
diff changeset
45 </xsl:template>
d1400de5832b improved xsl
cin
parents: 0
diff changeset
46
d1400de5832b improved xsl
cin
parents: 0
diff changeset
47 <!-- CALCULATE RELATIONS -->
d1400de5832b improved xsl
cin
parents: 0
diff changeset
48 <xsl:variable name="relations">
3
36ae3ec94442 xslt: prepare taskjuggler tasks structure
cin
parents: 1
diff changeset
49 <xsl:apply-templates select="$bugs" mode="relations" />
1
d1400de5832b improved xsl
cin
parents: 0
diff changeset
50 </xsl:variable>
d1400de5832b improved xsl
cin
parents: 0
diff changeset
51
d1400de5832b improved xsl
cin
parents: 0
diff changeset
52 <xsl:template match="bug" mode="relations">
10
14a966369278 working version of exporting bugs from bugzilla in tj3 format (without bookings)
cin
parents: 6
diff changeset
53 <xsl:variable name="bugid" select="string(id)" />
1
d1400de5832b improved xsl
cin
parents: 0
diff changeset
54 <bug id="{$bugid}">
6
2a5f38eb25a9 migrated to saxon8 as xslt processor
cin
parents: 5
diff changeset
55 <!-- calculate all palaces where the same node appears -->
1
d1400de5832b improved xsl
cin
parents: 0
diff changeset
56 <xsl:apply-templates select="exsl:node-set($tree)//bug[@id = $bugid]"
d1400de5832b improved xsl
cin
parents: 0
diff changeset
57 mode="traverse-relations">
d1400de5832b improved xsl
cin
parents: 0
diff changeset
58 </xsl:apply-templates>
d1400de5832b improved xsl
cin
parents: 0
diff changeset
59 </bug>
d1400de5832b improved xsl
cin
parents: 0
diff changeset
60 </xsl:template>
d1400de5832b improved xsl
cin
parents: 0
diff changeset
61
d1400de5832b improved xsl
cin
parents: 0
diff changeset
62 <xsl:template match="bug" mode="traverse-relations">
d1400de5832b improved xsl
cin
parents: 0
diff changeset
63 <xsl:variable name="bugid" select="@id" />
3
36ae3ec94442 xslt: prepare taskjuggler tasks structure
cin
parents: 1
diff changeset
64 <xsl:variable name="path" select="ancestor::bug" />
36ae3ec94442 xslt: prepare taskjuggler tasks structure
cin
parents: 1
diff changeset
65 <xsl:variable name="level" select="count($path)" />
6
2a5f38eb25a9 migrated to saxon8 as xslt processor
cin
parents: 5
diff changeset
66 <!-- for the specified path calculate the distances to the preceding container -->
5
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
67 <xsl:for-each select="$path[@group]">
3
36ae3ec94442 xslt: prepare taskjuggler tasks structure
cin
parents: 1
diff changeset
68 <xsl:variable name="pos" select="position()" />
4
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
69 <xsl:variable name="rank" select="$level - $pos" />
3
36ae3ec94442 xslt: prepare taskjuggler tasks structure
cin
parents: 1
diff changeset
70 <rel container="{@id}" rank="{$rank}" level="{$level}">
6
2a5f38eb25a9 migrated to saxon8 as xslt processor
cin
parents: 5
diff changeset
71 <!-- record the full path -->
2a5f38eb25a9 migrated to saxon8 as xslt processor
cin
parents: 5
diff changeset
72 <xsl:for-each select="$path[@group]">
2a5f38eb25a9 migrated to saxon8 as xslt processor
cin
parents: 5
diff changeset
73 <parent id="{@id}" bugid="{$bugid}" />
3
36ae3ec94442 xslt: prepare taskjuggler tasks structure
cin
parents: 1
diff changeset
74 </xsl:for-each>
36ae3ec94442 xslt: prepare taskjuggler tasks structure
cin
parents: 1
diff changeset
75 </rel>
1
d1400de5832b improved xsl
cin
parents: 0
diff changeset
76 </xsl:for-each>
d1400de5832b improved xsl
cin
parents: 0
diff changeset
77 </xsl:template>
d1400de5832b improved xsl
cin
parents: 0
diff changeset
78
d1400de5832b improved xsl
cin
parents: 0
diff changeset
79 <!-- CALCULATE STRUCTURE -->
d1400de5832b improved xsl
cin
parents: 0
diff changeset
80
3
36ae3ec94442 xslt: prepare taskjuggler tasks structure
cin
parents: 1
diff changeset
81 <xsl:variable name="parents">
1
d1400de5832b improved xsl
cin
parents: 0
diff changeset
82 <xsl:apply-templates select="exsl:node-set($relations)"
3
36ae3ec94442 xslt: prepare taskjuggler tasks structure
cin
parents: 1
diff changeset
83 mode="parents" />
36ae3ec94442 xslt: prepare taskjuggler tasks structure
cin
parents: 1
diff changeset
84 </xsl:variable>
36ae3ec94442 xslt: prepare taskjuggler tasks structure
cin
parents: 1
diff changeset
85
36ae3ec94442 xslt: prepare taskjuggler tasks structure
cin
parents: 1
diff changeset
86 <xsl:template match="bug" mode="parents">
36ae3ec94442 xslt: prepare taskjuggler tasks structure
cin
parents: 1
diff changeset
87 <xsl:variable name="parent"
36ae3ec94442 xslt: prepare taskjuggler tasks structure
cin
parents: 1
diff changeset
88 select="rel[ not(../rel/@rank &lt; @rank) ][1]" />
36ae3ec94442 xslt: prepare taskjuggler tasks structure
cin
parents: 1
diff changeset
89 <bug id="{@id}" parent="{$parent/@container}" rank="{$parent/@rank}"
6
2a5f38eb25a9 migrated to saxon8 as xslt processor
cin
parents: 5
diff changeset
90 level="{$parent/@level}">
2a5f38eb25a9 migrated to saxon8 as xslt processor
cin
parents: 5
diff changeset
91 <xsl:copy-of select="$parent/node()" />
2a5f38eb25a9 migrated to saxon8 as xslt processor
cin
parents: 5
diff changeset
92 </bug>
3
36ae3ec94442 xslt: prepare taskjuggler tasks structure
cin
parents: 1
diff changeset
93 </xsl:template>
36ae3ec94442 xslt: prepare taskjuggler tasks structure
cin
parents: 1
diff changeset
94
36ae3ec94442 xslt: prepare taskjuggler tasks structure
cin
parents: 1
diff changeset
95 <xsl:variable name="structure">
5
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
96 <xsl:choose>
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
97 <xsl:when test="$root_task">
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
98 <bug id="_root" desc="{$root_task}" group="true">
6
2a5f38eb25a9 migrated to saxon8 as xslt processor
cin
parents: 5
diff changeset
99 <xsl:apply-templates select="$roots" mode="structure" />
5
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
100 </bug>
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
101 </xsl:when>
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
102 <xsl:otherwise>
6
2a5f38eb25a9 migrated to saxon8 as xslt processor
cin
parents: 5
diff changeset
103 <xsl:apply-templates select="$roots" mode="structure" />
5
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
104 </xsl:otherwise>
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
105 </xsl:choose>
1
d1400de5832b improved xsl
cin
parents: 0
diff changeset
106 </xsl:variable>
d1400de5832b improved xsl
cin
parents: 0
diff changeset
107
6
2a5f38eb25a9 migrated to saxon8 as xslt processor
cin
parents: 5
diff changeset
108 <!-- applied in context of the bugzilla document -->
1
d1400de5832b improved xsl
cin
parents: 0
diff changeset
109 <xsl:template match="bug" mode="structure">
10
14a966369278 working version of exporting bugs from bugzilla in tj3 format (without bookings)
cin
parents: 6
diff changeset
110 <xsl:variable name="id" select="string(id)" />
3
36ae3ec94442 xslt: prepare taskjuggler tasks structure
cin
parents: 1
diff changeset
111 <xsl:variable name="self" select="." />
5
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
112 <xsl:variable name="children"
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
113 select="exsl:node-set($parents)/bug[@parent = $id]" />
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
114 <xsl:element name="bug">
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
115 <xsl:attribute name="id"><xsl:value-of select="$id" /></xsl:attribute>
10
14a966369278 working version of exporting bugs from bugzilla in tj3 format (without bookings)
cin
parents: 6
diff changeset
116 <xsl:attribute name="desc"><xsl:value-of select="summary" /></xsl:attribute>
11
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
117 <xsl:attribute name="estimated"><xsl:value-of
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
118 select="number((time/estimated | estimated_time)[1])" /></xsl:attribute>
12
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
119 <xsl:attribute name="complete"><xsl:value-of select="status = 'RESOLVED' or status = 'VERIFIED'"/></xsl:attribute>
5
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
120
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
121 <xsl:if test="$children">
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
122 <xsl:attribute name="group"><xsl:value-of select="boolean($children)" /></xsl:attribute>
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
123
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
124 <xsl:for-each select="$children">
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
125 <xsl:variable name="child" select="@id" />
10
14a966369278 working version of exporting bugs from bugzilla in tj3 format (without bookings)
cin
parents: 6
diff changeset
126 <xsl:apply-templates select="$bugs[id = $child]"
5
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
127 mode="structure" />
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
128 </xsl:for-each>
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
129
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
130 </xsl:if>
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
131
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
132 <!-- filter out dependencies -->
6
2a5f38eb25a9 migrated to saxon8 as xslt processor
cin
parents: 5
diff changeset
133 <!-- exclude children, and missing bugs -->
3
36ae3ec94442 xslt: prepare taskjuggler tasks structure
cin
parents: 1
diff changeset
134 <xsl:variable name="dependencies"
10
14a966369278 working version of exporting bugs from bugzilla in tj3 format (without bookings)
cin
parents: 6
diff changeset
135 select="depends_on[not(text() = exsl:node-set($parents)/bug/parent[@id=$id]/@bugid)][key('bugid', .)]" />
5
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
136 <xsl:for-each select="$dependencies">
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
137 <dependency id="{.}" />
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
138 </xsl:for-each>
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
139 </xsl:element>
1
d1400de5832b improved xsl
cin
parents: 0
diff changeset
140 </xsl:template>
d1400de5832b improved xsl
cin
parents: 0
diff changeset
141
4
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
142 <!-- output -->
0
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
143 <xsl:template match="/">
12
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
144 <xsl:apply-templates select="exsl:node-set($structure)/node()">
4
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
145 <xsl:with-param name="indent" select="0" />
6
2a5f38eb25a9 migrated to saxon8 as xslt processor
cin
parents: 5
diff changeset
146 <xsl:with-param name="chargeset" select="$chargeset" />
4
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
147 </xsl:apply-templates>
12
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
148 <!--
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
149 <xsl:apply-templates select="bugzilla/timesheet">
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
150 <xsl:with-param name="indent" select="0" />
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
151 </xsl:apply-templates>
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
152 -->
0
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
153 </xsl:template>
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
154
11
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
155 <!-- task -->
0
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
156 <xsl:template match="bug">
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
157 <xsl:param name="indent" select="0" />
5
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
158 <xsl:param name="chargeset" />
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
159
11
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
160 <!-- format the task header -->
0
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
161 <xsl:call-template name="start-task">
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
162 <xsl:with-param name="indent" select="$indent" />
5
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
163 <xsl:with-param name="id">
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
164 <xsl:call-template name="bug-local-name">
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
165 <xsl:with-param name="id" select="@id" />
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
166 </xsl:call-template>
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
167 </xsl:with-param>
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
168 <xsl:with-param name="desc" select="@desc" />
0
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
169 </xsl:call-template>
6
2a5f38eb25a9 migrated to saxon8 as xslt processor
cin
parents: 5
diff changeset
170
11
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
171 <!-- specify chargeset if present -->
5
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
172 <xsl:if test="$chargeset">
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
173 <xsl:call-template name="println">
6
2a5f38eb25a9 migrated to saxon8 as xslt processor
cin
parents: 5
diff changeset
174 <xsl:with-param name="indent" select="$indent + 1" />
2a5f38eb25a9 migrated to saxon8 as xslt processor
cin
parents: 5
diff changeset
175 <xsl:with-param name="text"
2a5f38eb25a9 migrated to saxon8 as xslt processor
cin
parents: 5
diff changeset
176 select="concat('chargeset ', $chargeset)" />
5
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
177 </xsl:call-template>
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
178 </xsl:if>
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
179
11
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
180 <!-- print task contents -->
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
181 <xsl:apply-templates select="." mode="task-content">
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
182 <xsl:with-param name="indent" select="$indent + 1" />
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
183 </xsl:apply-templates>
0
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
184
11
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
185 <!-- prints subtasks and dependencies -->
4
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
186 <xsl:apply-templates>
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
187 <xsl:with-param name="indent" select="$indent + 1" />
5
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
188 <xsl:with-param name="referer" select="." />
4
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
189 </xsl:apply-templates>
0
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
190
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
191 <xsl:call-template name="end-task">
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
192 <xsl:with-param name="indent" select="$indent" />
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
193 </xsl:call-template>
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
194 </xsl:template>
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
195
11
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
196 <!-- dependency -->
5
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
197 <xsl:template match="dependency">
11
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
198 <xsl:param name="indent" select="0" />
5
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
199 <xsl:param name="referer" />
11
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
200
5
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
201 <xsl:call-template name="println">
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
202 <xsl:with-param name="indent" select="$indent" />
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
203 <xsl:with-param name="text">
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
204 <xsl:text>depends </xsl:text>
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
205 <xsl:call-template name="bug-reference">
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
206 <xsl:with-param name="id" select="@id" />
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
207 <xsl:with-param name="referer" select="$referer" />
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
208 </xsl:call-template>
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
209 </xsl:with-param>
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
210 </xsl:call-template>
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
211 </xsl:template>
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
212
11
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
213 <!-- an organizational task with spent/estimated time will contain a generated
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
214 task which will contain the information about resource allocation and bookings -->
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
215 <xsl:template match="bug[@group][@estimated > 0]" mode="task-content"
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
216 priority="3">
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
217 <xsl:param name="indent" select="0" />
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
218 <xsl:variable name="id" select="@id" />
5
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
219
11
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
220 <!-- DEBUG -->
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
221 <xsl:call-template name="comment">
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
222 <xsl:with-param name="indent" select="$indent" />
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
223 <xsl:with-param name="comment" select="'group'" />
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
224 </xsl:call-template>
5
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
225
11
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
226 <!-- print group details -->
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
227 <xsl:apply-templates select="$bugs[id = $id]/node()"
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
228 mode="group-task">
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
229 <xsl:with-param name="indent" select="$indent" />
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
230 </xsl:apply-templates>
5
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
231
11
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
232 <xsl:variable name="metabug">
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
233 <bug id="{@id}" estimated="{@estimated}" desc="{@desc}" />
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
234 </xsl:variable>
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
235
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
236 <!-- write an administrative bug for this group-task -->
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
237 <xsl:apply-templates select="exsl:node-set($metabug)/bug[1]">
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
238 <xsl:with-param name="indent" select="$indent" />
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
239 </xsl:apply-templates>
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
240 </xsl:template>
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
241
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
242 <!-- an organizational task without resource allocations -->
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
243 <xsl:template match="bug[@group]" mode="task-content">
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
244 <xsl:param name="indent" select="0" />
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
245 <xsl:variable name="id" select="@id" />
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
246 <xsl:apply-templates select="$bugs[id = $id]/node()"
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
247 mode="group-task">
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
248 <xsl:with-param name="indent" select="$indent" />
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
249 </xsl:apply-templates>
4
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
250 </xsl:template>
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
251
11
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
252 <!-- a work task -->
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
253 <xsl:template match="bug[@estimated > 0]" mode="task-content">
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
254 <xsl:param name="indent" select="0" />
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
255 <xsl:variable name="id" select="@id" />
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
256
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
257 <!-- DEBUG -->
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
258 <xsl:call-template name="comment">
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
259 <xsl:with-param name="indent" select="$indent" />
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
260 <xsl:with-param name="comment" select="'work'" />
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
261 </xsl:call-template>
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
262
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
263 <xsl:apply-templates select="$bugs[id = $id]/node()"
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
264 mode="work-task">
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
265 <xsl:with-param name="indent" select="$indent" />
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
266 </xsl:apply-templates>
4
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
267 </xsl:template>
12
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
268
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
269 <xsl:template match="bug[@estimated > 0 and @complete]" mode="task-content">
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
270 <xsl:param name="indent" select="0" />
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
271 <xsl:variable name="id" select="@id" />
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
272
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
273 <!-- DEBUG -->
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
274 <xsl:call-template name="comment">
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
275 <xsl:with-param name="indent" select="$indent" />
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
276 <xsl:with-param name="comment" select="'work'" />
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
277 </xsl:call-template>
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
278
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
279 <xsl:apply-templates select="$bugs[id = $id]/node()"
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
280 mode="done-work-task">
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
281 <xsl:with-param name="indent" select="$indent" />
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
282 </xsl:apply-templates>
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
283 </xsl:template>
4
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
284
11
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
285 <!-- a milestone task -->
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
286 <xsl:template match="bug" mode="task-content">
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
287 <xsl:param name="indent" select="0" />
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
288 <xsl:variable name="id" select="@id" />
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
289
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
290 <!-- DEBUG -->
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
291 <xsl:call-template name="comment">
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
292 <xsl:with-param name="indent" select="$indent" />
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
293 <xsl:with-param name="comment" select="'milestone'" />
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
294 </xsl:call-template>
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
295
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
296 <xsl:apply-templates select="$bugs[id = $id]/node()"
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
297 mode="milestone-task">
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
298 <xsl:with-param name="indent" select="$indent" />
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
299 </xsl:apply-templates>
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
300 </xsl:template>
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
301
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
302 <!-- each type of task processed in the corresponding mode MODES: * group-task
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
303 * work-task * milestone-task -->
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
304
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
305 <!-- group-task -->
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
306 <xsl:template match="assigned_to" mode="group-task">
5
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
307 <xsl:param name="indent" />
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
308 <xsl:variable name="email" select="string(.)" />
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
309 <xsl:variable name="resource" select="$resources[@email = $email]/@id" />
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
310 <xsl:if test="$resource">
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
311 <xsl:call-template name="println">
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
312 <xsl:with-param name="indent" select="$indent" />
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
313 <xsl:with-param name="text"
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
314 select="concat('responsible ', $resource)" />
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
315 </xsl:call-template>
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
316 </xsl:if>
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
317 </xsl:template>
11
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
318
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
319 <xsl:template match="*" mode="group-task">
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
320 <xsl:param name="indent" select="0" />
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
321 <xsl:apply-templates mode="group-task">
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
322 <xsl:with-param name="indent" select="$indent" />
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
323 </xsl:apply-templates>
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
324 </xsl:template>
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
325
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
326 <xsl:template match="text()" mode="group-task">
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
327 </xsl:template>
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
328
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
329
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
330 <!-- work-task -->
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
331 <xsl:template match="assigned_to" mode="work-task">
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
332 <xsl:param name="indent" />
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
333 <xsl:variable name="email" select="string(.)" />
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
334 <xsl:variable name="resource" select="$resources[@email = $email]/@id" />
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
335 <xsl:if test="$resource">
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
336 <xsl:call-template name="println">
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
337 <xsl:with-param name="indent" select="$indent" />
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
338 <xsl:with-param name="text" select="concat('allocate ', $resource)" />
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
339 </xsl:call-template>
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
340 </xsl:if>
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
341 </xsl:template>
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
342
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
343 <!-- if we have a timereports -->
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
344 <xsl:template match="time/estimated[. > 0]" mode="work-task">
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
345 <xsl:param name="indent" />
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
346 <xsl:call-template name="println">
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
347 <xsl:with-param name="indent" select="$indent" />
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
348 <xsl:with-param name="text" select="concat('effort ', .,'h')" />
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
349 </xsl:call-template>
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
350 </xsl:template>
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
351
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
352 <!-- if we have an estimated_time -->
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
353 <xsl:template match="estimated_time[../time/estimated = 0]"
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
354 mode="work-task">
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
355 <xsl:param name="indent" />
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
356 <xsl:call-template name="comment">
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
357 <xsl:with-param name="indent" select="$indent" />
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
358 <xsl:with-param name="comment" select="'original estimated'" />
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
359 </xsl:call-template>
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
360 <xsl:call-template name="println">
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
361 <xsl:with-param name="indent" select="$indent" />
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
362 <xsl:with-param name="text" select="concat('effort ', .,'h')" />
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
363 </xsl:call-template>
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
364 </xsl:template>
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
365
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
366 <xsl:template match="*" mode="work-task">
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
367 <xsl:param name="indent" select="0" />
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
368 <xsl:apply-templates mode="work-task">
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
369 <xsl:with-param name="indent" select="$indent" />
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
370 </xsl:apply-templates>
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
371 </xsl:template>
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
372
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
373 <xsl:template match="text()" mode="work-task">
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
374 </xsl:template>
12
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
375
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
376 <!-- done-work-task -->
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
377
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
378 <xsl:template match="assigned_to" mode="done-work-task">
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
379 <xsl:param name="indent" />
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
380 <xsl:variable name="email" select="string(.)" />
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
381 <xsl:variable name="resource" select="$resources[@email = $email]/@id" />
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
382 <xsl:if test="$resource">
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
383 <xsl:call-template name="println">
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
384 <xsl:with-param name="indent" select="$indent" />
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
385 <xsl:with-param name="text" select="concat('allocate ', $resource)" />
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
386 </xsl:call-template>
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
387 </xsl:if>
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
388 </xsl:template>
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
389
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
390 <!-- if we have a timereports -->
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
391 <xsl:template match="time/estimated[. > 0]" mode="done-work-task">
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
392 <xsl:param name="indent" />
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
393 <xsl:call-template name="println">
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
394 <xsl:with-param name="indent" select="$indent" />
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
395 <xsl:with-param name="text" select="concat('effort ', .,'h')" />
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
396 </xsl:call-template>
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
397 </xsl:template>
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
398
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
399 <xsl:template match="last_change_time" mode="done-work-task">
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
400 <xsl:param name="indent" />
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
401 <xsl:call-template name="println">
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
402 <xsl:with-param name="indent" select="$indent" />
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
403 <xsl:with-param name="text" select="concat('end ', .)" />
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
404 </xsl:call-template>
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
405 </xsl:template>
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
406
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
407 <xsl:template match="*" mode="done-work-task">
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
408 <xsl:param name="indent" select="0" />
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
409 <xsl:apply-templates mode="work-task">
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
410 <xsl:with-param name="indent" select="$indent" />
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
411 </xsl:apply-templates>
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
412 </xsl:template>
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
413
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
414 <xsl:template match="text()" mode="done-work-task">
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
415 </xsl:template>
11
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
416
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
417 <!-- milestone-task -->
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
418 <xsl:template match="assigned_to" mode="milestone-task">
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
419 <xsl:param name="indent" />
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
420 <xsl:variable name="email" select="string(.)" />
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
421 <xsl:variable name="resource" select="$resources[@email = $email]/@id" />
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
422 <xsl:if test="$resource">
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
423 <xsl:call-template name="println">
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
424 <xsl:with-param name="indent" select="$indent" />
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
425 <xsl:with-param name="text"
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
426 select="concat('responsible ', $resource)" />
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
427 </xsl:call-template>
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
428 </xsl:if>
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
429 </xsl:template>
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
430
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
431 <xsl:template match="*" mode="milestone-task">
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
432 <xsl:param name="indent" select="0" />
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
433 <xsl:apply-templates mode="milestone-task">
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
434 <xsl:with-param name="indent" select="$indent" />
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
435 </xsl:apply-templates>
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
436 </xsl:template>
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
437
4eb9fdf4efa9 refactoring, non-working bookings
cin
parents: 10
diff changeset
438 <xsl:template match="text()" mode="milestone-task">
4
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
439 </xsl:template>
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
440
12
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
441 <!-- TIMESHEETS -->
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
442
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
443 <xsl:template match="timesheet">
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
444 <xsl:param name="indent" select="0" />
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
445 <xsl:variable name="email" select="string(@resource)" />
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
446 <xsl:variable name="resource" select="$resources[@email = $email]/@id" />
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
447
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
448 <xsl:call-template name="println">
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
449 <xsl:with-param name="indent" select="$indent" />
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
450 <xsl:with-param name="text"
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
451 select="concat('timesheet ', $resource, ' ', @start, ' - ', @end, ' {')" />
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
452 </xsl:call-template>
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
453
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
454 <xsl:apply-templates mode="timesheet">
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
455 <xsl:with-param name="indent" select="$indent + 1" />
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
456 </xsl:apply-templates>
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
457
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
458 <xsl:call-template name="println">
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
459 <xsl:with-param name="indent" select="$indent" />
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
460 <xsl:with-param name="text" select="'}'" />
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
461 </xsl:call-template>
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
462 </xsl:template>
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
463
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
464 <xsl:template match="bug" mode="timesheet">
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
465 <xsl:param name="indent" select="0" />
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
466 <xsl:variable name="id" select="@id" />
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
467
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
468 <xsl:call-template name="begin-line">
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
469 <xsl:with-param name="indent" select="$indent" />
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
470 </xsl:call-template>
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
471 <xsl:text>task </xsl:text>
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
472 <xsl:for-each
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
473 select="exsl:node-set( $parents)/bug[@id = $id]/parent/@id | @id">
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
474 <xsl:call-template name="bug-local-name">
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
475 <xsl:with-param name="id" select="." />
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
476 </xsl:call-template>
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
477 <xsl:if test="position() != last()">
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
478 <xsl:text>.</xsl:text>
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
479 </xsl:if>
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
480 </xsl:for-each>
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
481 <xsl:text> {</xsl:text>
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
482 <xsl:call-template name="end-line" />
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
483
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
484 <xsl:apply-templates mode="timesheet">
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
485 <xsl:with-param name="indent" select="$indent + 1" />
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
486 </xsl:apply-templates>
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
487
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
488 <xsl:call-template name="println">
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
489 <xsl:with-param name="indent" select="$indent" />
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
490 <xsl:with-param name="text" select="'}'" />
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
491 </xsl:call-template>
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
492
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
493 </xsl:template>
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
494
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
495 <xsl:template match="work" mode="timesheet">
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
496 <xsl:param name="indent" select="0" />
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
497
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
498 <xsl:call-template name="println">
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
499 <xsl:with-param name="indent" select="$indent" />
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
500 <xsl:with-param name="text" select="concat('work ', ., 'h')" />
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
501 </xsl:call-template>
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
502 </xsl:template>
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
503
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
504 <xsl:template match="remaining" mode="timesheet">
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
505 <xsl:param name="indent" select="0" />
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
506
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
507 <xsl:call-template name="println">
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
508 <xsl:with-param name="indent" select="$indent" />
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
509 <xsl:with-param name="text" select="concat('remaining ', ., 'h')" />
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
510 </xsl:call-template>
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
511 </xsl:template>
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
512
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
513 <xsl:template match="*" mode="timesheet">
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
514 <xsl:param name="indent" select="0" />
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
515 <xsl:apply-templates mode="milestone-task">
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
516 <xsl:with-param name="indent" select="$indent" />
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
517 </xsl:apply-templates>
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
518 </xsl:template>
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
519
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
520 <xsl:template match="text()" mode="timesheet">
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
521 </xsl:template>
52b34ea50eff sync: work time projection doesn't seem to be working anyway
cin
parents: 11
diff changeset
522
5
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
523 <!-- PRIMITIVES -->
4
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
524
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
525 <xsl:template name="bug-local-name">
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
526 <xsl:param name="id" />
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
527 <xsl:value-of select="concat('bug',$id)" />
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
528 </xsl:template>
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
529
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
530
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
531 <xsl:template name="bug-reference">
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
532 <xsl:param name="id" />
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
533 <xsl:param name="referer" />
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
534
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
535 <xsl:variable name="refererPathFragment">
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
536 <bug id="#root" />
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
537 <xsl:for-each select="$referer/ancestor-or-self::bug">
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
538 <bug id="{@id}" />
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
539 </xsl:for-each>
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
540 </xsl:variable>
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
541 <xsl:variable name="targetPathFragment">
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
542 <bug id="#root" />
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
543 <xsl:for-each
5
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
544 select="exsl:node-set($structure)//bug[@id = $id]/ancestor-or-self::bug">
4
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
545 <bug id="{@id}" />
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
546 </xsl:for-each>
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
547 </xsl:variable>
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
548 <xsl:variable name="path"
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
549 select="exsl:node-set($refererPathFragment)/bug" />
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
550 <xsl:variable name="targetPath"
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
551 select="exsl:node-set($targetPathFragment)/bug" />
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
552
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
553 <!-- find closest shared container id -->
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
554 <xsl:variable name="join"
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
555 select="($path[@id = $targetPath/@id])[position() = last() ]/@id" />
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
556
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
557 <!-- how many levels we need to up -->
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
558 <xsl:variable name="depth"
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
559 select="count($path[@id = $join]/following-sibling::node())" />
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
560
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
561 <!-- DEBUG -->
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
562 <!-- <xsl:value-of select="concat('id=', $id, ',referer=', $referer/@id)"
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
563 /> <xsl:text>, path=</xsl:text> <xsl:for-each select="$targetPath"> <xsl:value-of
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
564 select="concat(name(),@id)" /> <xsl:if test="position() != last()"> <xsl:text>-</xsl:text>
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
565 </xsl:if> </xsl:for-each> -->
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
566 <!-- DEBUG -->
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
567 <!-- <xsl:value-of select="concat(', join=', $join,', depth=', $depth,'
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
568 ')" /> -->
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
569
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
570 <!-- PRINT REFERENCE -->
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
571 <xsl:call-template name="repeat">
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
572 <xsl:with-param name="value" select="'!'" />
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
573 <xsl:with-param name="count" select="$depth" />
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
574 </xsl:call-template>
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
575 <xsl:for-each select="$targetPath[@id = $join]/following-sibling::node()">
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
576 <xsl:call-template name="bug-local-name">
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
577 <xsl:with-param name="id" select="@id" />
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
578 </xsl:call-template>
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
579 <xsl:if test="position() != last()">
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
580 <xsl:text>.</xsl:text>
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
581 </xsl:if>
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
582 </xsl:for-each>
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
583
0
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
584 </xsl:template>
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
585
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
586 <xsl:template name="start-task">
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
587 <xsl:param name="indent" />
4
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
588 <xsl:param name="id" />
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
589 <xsl:param name="desc" />
0
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
590 <xsl:call-template name="begin-line">
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
591 <xsl:with-param name="indent" select="$indent" />
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
592 </xsl:call-template>
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
593 <xsl:text>task </xsl:text>
5
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
594 <xsl:value-of select="$id" />
4
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
595 <xsl:value-of select="concat(' &quot;',$desc,'&quot; {')" />
0
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
596 <xsl:call-template name="end-line" />
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
597 </xsl:template>
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
598
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
599 <xsl:template name="end-task">
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
600 <xsl:param name="indent" />
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
601 <xsl:call-template name="begin-line">
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
602 <xsl:with-param name="indent" select="$indent" />
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
603 </xsl:call-template>
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
604 <xsl:text>}</xsl:text>
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
605 <xsl:call-template name="end-line" />
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
606 </xsl:template>
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
607
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
608 <xsl:template name="begin-line">
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
609 <xsl:param name="indent" />
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
610 <xsl:if test="number($indent) > 0">
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
611 <xsl:text> </xsl:text>
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
612 <xsl:call-template name="begin-line">
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
613 <xsl:with-param name="indent" select="$indent - 1" />
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
614 </xsl:call-template>
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
615 </xsl:if>
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
616 </xsl:template>
5
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
617
0
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
618 <xsl:template name="end-line">
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
619 <xsl:text>&#xa;</xsl:text>
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
620 </xsl:template>
4
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
621
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
622 <xsl:template name="repeat">
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
623 <xsl:param name="value" />
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
624 <xsl:param name="count" select="0" />
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
625
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
626 <xsl:if test="number($count)">
6
2a5f38eb25a9 migrated to saxon8 as xslt processor
cin
parents: 5
diff changeset
627 <xsl:value-of select="$value" />
4
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
628 <xsl:call-template name="repeat">
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
629 <xsl:with-param name="value" select="$value" />
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
630 <xsl:with-param name="count" select="$count - 1" />
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
631 </xsl:call-template>
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
632 </xsl:if>
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
633 </xsl:template>
5
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
634
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
635 <xsl:template name="comment">
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
636 <xsl:param name="indent" />
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
637 <xsl:param name="comment" />
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
638 <xsl:call-template name="println">
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
639 <xsl:with-param name="indent" select="$indent" />
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
640 <xsl:with-param name="text">
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
641 <xsl:text># </xsl:text>
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
642 <xsl:value-of select="$comment" />
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
643 </xsl:with-param>
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
644 </xsl:call-template>
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
645 </xsl:template>
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
646
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
647 <xsl:template name="println">
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
648 <xsl:param name="indent" />
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
649 <xsl:param name="text" />
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
650 <xsl:call-template name="begin-line">
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
651 <xsl:with-param name="indent" select="$indent" />
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
652 </xsl:call-template>
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
653 <xsl:value-of select="$text" />
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
654 <xsl:call-template name="end-line" />
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
655 </xsl:template>
0
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
656 </xsl:stylesheet>