kvm 0.0.1.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (148) hide show
  1. data/.gitignore +3 -0
  2. data/.rvmrc +1 -0
  3. data/AGPL-3.0 +661 -0
  4. data/Gemfile +8 -0
  5. data/Gemfile.lock +32 -0
  6. data/LICENSE +23 -0
  7. data/README.md +73 -0
  8. data/Rakefile +48 -0
  9. data/bin/kvm +6 -0
  10. data/kvm.gemspec +28 -0
  11. data/lib/kvm.rb +286 -0
  12. data/lib/kvm/archive.rb +56 -0
  13. data/lib/kvm/artifact.rb +28 -0
  14. data/lib/kvm/db/jdbc_adapter.rb +71 -0
  15. data/lib/kvm/db/oracle.rb +23 -0
  16. data/lib/kvm/db/types.rb +11 -0
  17. data/lib/kvm/impex.rb +109 -0
  18. data/lib/kvm/log.rb +7 -0
  19. data/lib/kvm/resource.rb +72 -0
  20. data/lib/kvm/rice_release.rb +79 -0
  21. data/lib/kvm/rice_release_generated_dataset.rb +68 -0
  22. data/lib/kvm/source.rb +33 -0
  23. data/lib/kvm/subversion.rb +52 -0
  24. data/lib/kvm/version.rb +3 -0
  25. data/lib/kvm/wallet.rb +64 -0
  26. data/support/ant/INSTALL +2 -0
  27. data/support/ant/KEYS +1398 -0
  28. data/support/ant/LICENSE +272 -0
  29. data/support/ant/NOTICE +6 -0
  30. data/support/ant/README +97 -0
  31. data/support/ant/WHATSNEW +5467 -0
  32. data/support/ant/bin/ant +335 -0
  33. data/support/ant/bin/ant.bat +218 -0
  34. data/support/ant/bin/ant.cmd +93 -0
  35. data/support/ant/bin/antRun +24 -0
  36. data/support/ant/bin/antRun.bat +50 -0
  37. data/support/ant/bin/antRun.pl +66 -0
  38. data/support/ant/bin/antenv.cmd +98 -0
  39. data/support/ant/bin/complete-ant-cmd.pl +114 -0
  40. data/support/ant/bin/envset.cmd +131 -0
  41. data/support/ant/bin/lcp.bat +31 -0
  42. data/support/ant/bin/runant.pl +153 -0
  43. data/support/ant/bin/runant.py +102 -0
  44. data/support/ant/bin/runrc.cmd +60 -0
  45. data/support/ant/etc/ant-bootstrap.jar +0 -0
  46. data/support/ant/etc/changelog.xsl +148 -0
  47. data/support/ant/etc/checkstyle/checkstyle-frames.xsl +299 -0
  48. data/support/ant/etc/checkstyle/checkstyle-text.xsl +34 -0
  49. data/support/ant/etc/checkstyle/checkstyle-xdoc.xsl +130 -0
  50. data/support/ant/etc/coverage-frames.xsl +489 -0
  51. data/support/ant/etc/jdepend-frames.xsl +487 -0
  52. data/support/ant/etc/jdepend.xsl +276 -0
  53. data/support/ant/etc/junit-frames-xalan1.xsl +733 -0
  54. data/support/ant/etc/junit-frames.xsl +902 -0
  55. data/support/ant/etc/junit-noframes.xsl +478 -0
  56. data/support/ant/etc/log.xsl +203 -0
  57. data/support/ant/etc/maudit-frames.xsl +503 -0
  58. data/support/ant/etc/mmetrics-frames.xsl +1026 -0
  59. data/support/ant/etc/tagdiff.xsl +179 -0
  60. data/support/ant/fetch.xml +343 -0
  61. data/support/ant/get-m2.xml +121 -0
  62. data/support/ant/lib/README +3 -0
  63. data/support/ant/lib/ant-antlr.jar +0 -0
  64. data/support/ant/lib/ant-antlr.pom +76 -0
  65. data/support/ant/lib/ant-apache-bcel.jar +0 -0
  66. data/support/ant/lib/ant-apache-bcel.pom +72 -0
  67. data/support/ant/lib/ant-apache-bsf.jar +0 -0
  68. data/support/ant/lib/ant-apache-bsf.pom +75 -0
  69. data/support/ant/lib/ant-apache-log4j.jar +0 -0
  70. data/support/ant/lib/ant-apache-log4j.pom +70 -0
  71. data/support/ant/lib/ant-apache-oro.jar +0 -0
  72. data/support/ant/lib/ant-apache-oro.pom +75 -0
  73. data/support/ant/lib/ant-apache-regexp.jar +0 -0
  74. data/support/ant/lib/ant-apache-regexp.pom +71 -0
  75. data/support/ant/lib/ant-apache-resolver.jar +0 -0
  76. data/support/ant/lib/ant-apache-resolver.pom +70 -0
  77. data/support/ant/lib/ant-apache-xalan2.jar +0 -0
  78. data/support/ant/lib/ant-apache-xalan2.pom +95 -0
  79. data/support/ant/lib/ant-commons-logging.jar +0 -0
  80. data/support/ant/lib/ant-commons-logging.pom +71 -0
  81. data/support/ant/lib/ant-commons-net.jar +0 -0
  82. data/support/ant/lib/ant-commons-net.pom +76 -0
  83. data/support/ant/lib/ant-jai.jar +0 -0
  84. data/support/ant/lib/ant-jai.pom +85 -0
  85. data/support/ant/lib/ant-javamail.jar +0 -0
  86. data/support/ant/lib/ant-javamail.pom +79 -0
  87. data/support/ant/lib/ant-jdepend.jar +0 -0
  88. data/support/ant/lib/ant-jdepend.pom +73 -0
  89. data/support/ant/lib/ant-jmf.jar +0 -0
  90. data/support/ant/lib/ant-jmf.pom +66 -0
  91. data/support/ant/lib/ant-jsch.jar +0 -0
  92. data/support/ant/lib/ant-jsch.pom +75 -0
  93. data/support/ant/lib/ant-junit.jar +0 -0
  94. data/support/ant/lib/ant-junit.pom +101 -0
  95. data/support/ant/lib/ant-junit4.jar +0 -0
  96. data/support/ant/lib/ant-junit4.pom +71 -0
  97. data/support/ant/lib/ant-launcher.jar +0 -0
  98. data/support/ant/lib/ant-launcher.pom +58 -0
  99. data/support/ant/lib/ant-netrexx.jar +0 -0
  100. data/support/ant/lib/ant-netrexx.pom +99 -0
  101. data/support/ant/lib/ant-parent.pom +120 -0
  102. data/support/ant/lib/ant-swing.jar +0 -0
  103. data/support/ant/lib/ant-swing.pom +67 -0
  104. data/support/ant/lib/ant-testutil.jar +0 -0
  105. data/support/ant/lib/ant-testutil.pom +75 -0
  106. data/support/ant/lib/ant.jar +0 -0
  107. data/support/ant/lib/ant.pom +222 -0
  108. data/support/ant/lib/libraries.properties +65 -0
  109. data/test/data/files/rice-0.0.0.0-bin.tar.gz +0 -0
  110. data/test/data/svn/README.txt +5 -0
  111. data/test/data/svn/conf/authz +32 -0
  112. data/test/data/svn/conf/passwd +8 -0
  113. data/test/data/svn/conf/svnserve.conf +47 -0
  114. data/test/data/svn/db/current +1 -0
  115. data/test/data/svn/db/format +2 -0
  116. data/test/data/svn/db/fs-type +1 -0
  117. data/test/data/svn/db/fsfs.conf +37 -0
  118. data/test/data/svn/db/min-unpacked-rev +1 -0
  119. data/test/data/svn/db/rep-cache.db +0 -0
  120. data/test/data/svn/db/revprops/0/0 +5 -0
  121. data/test/data/svn/db/revprops/0/1 +13 -0
  122. data/test/data/svn/db/revs/0/0 +11 -0
  123. data/test/data/svn/db/revs/0/1 +0 -0
  124. data/test/data/svn/db/txn-current +1 -0
  125. data/test/data/svn/db/txn-current-lock +0 -0
  126. data/test/data/svn/db/uuid +1 -0
  127. data/test/data/svn/db/write-lock +0 -0
  128. data/test/data/svn/format +1 -0
  129. data/test/data/svn/hooks/post-commit.tmpl +50 -0
  130. data/test/data/svn/hooks/post-lock.tmpl +44 -0
  131. data/test/data/svn/hooks/post-revprop-change.tmpl +56 -0
  132. data/test/data/svn/hooks/post-unlock.tmpl +42 -0
  133. data/test/data/svn/hooks/pre-commit.tmpl +81 -0
  134. data/test/data/svn/hooks/pre-lock.tmpl +71 -0
  135. data/test/data/svn/hooks/pre-revprop-change.tmpl +66 -0
  136. data/test/data/svn/hooks/pre-unlock.tmpl +63 -0
  137. data/test/data/svn/hooks/start-commit.tmpl +65 -0
  138. data/test/data/svn/locks/db-logs.lock +3 -0
  139. data/test/data/svn/locks/db.lock +3 -0
  140. data/test/helper.rb +146 -0
  141. data/test/int_test_generate_sql.rb +58 -0
  142. data/test/test_archive.rb +35 -0
  143. data/test/test_generate_sql.rb +0 -0
  144. data/test/test_rice_release.rb +61 -0
  145. data/test/test_rice_release_generated_dataset.rb +12 -0
  146. data/test/test_source.rb +31 -0
  147. data/test/test_subversion.rb +20 -0
  148. metadata +298 -0
@@ -0,0 +1,203 @@
1
+ <?xml version="1.0"?>
2
+ <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
3
+ <xsl:output method="html" indent="yes" encoding="US-ASCII"/>
4
+ <!--
5
+ Licensed to the Apache Software Foundation (ASF) under one or more
6
+ contributor license agreements. See the NOTICE file distributed with
7
+ this work for additional information regarding copyright ownership.
8
+ The ASF licenses this file to You under the Apache License, Version 2.0
9
+ (the "License"); you may not use this file except in compliance with
10
+ the License. You may obtain a copy of the License at
11
+
12
+ http://www.apache.org/licenses/LICENSE-2.0
13
+
14
+ Unless required by applicable law or agreed to in writing, software
15
+ distributed under the License is distributed on an "AS IS" BASIS,
16
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ See the License for the specific language governing permissions and
18
+ limitations under the License.
19
+
20
+ -->
21
+
22
+ <!--
23
+
24
+ The purpose have this XSL is to provide a nice way to look at the output
25
+ from the Ant XmlLogger (ie: ant -listener org.apache.tools.ant.XmlLogger )
26
+
27
+ @author <a href="mailto:sbailliez@apache.org">Stephane Bailliez</a>
28
+
29
+ -->
30
+ <xsl:decimal-format decimal-separator="." grouping-separator="," />
31
+
32
+ <xsl:template match="/">
33
+ <html>
34
+ <head>
35
+ <style type="text/css">
36
+ .bannercell {
37
+ border: 0px;
38
+ padding: 0px;
39
+ }
40
+ body {
41
+ margin: 0;
42
+ font:normal 100% arial,helvetica,sanserif;
43
+ background-color:#FFFFFF;
44
+ color:#000000;
45
+ }
46
+ table.status {
47
+ font:bold 80% arial,helvetica,sanserif;
48
+ background-color:#525D76;
49
+ color:#ffffff;
50
+ }
51
+ table.log tr td, tr th {
52
+ font-size: 80%;
53
+ }
54
+ .error {
55
+ color:red;
56
+ }
57
+ .warn {
58
+ color:brown;
59
+ }
60
+ .info {
61
+ color:gray;
62
+ }
63
+ .debug{
64
+ color:gray;
65
+ }
66
+ .failed {
67
+ font-size:80%;
68
+ background-color: red;
69
+ color:#FFFFFF;
70
+ font-weight: bold
71
+ }
72
+ .complete {
73
+ font-size:80%;
74
+ background-color: #525D76;
75
+ color:#FFFFFF;
76
+ font-weight: bold
77
+ }
78
+ .a td {
79
+ background: #efefef;
80
+ }
81
+ .b td {
82
+ background: #fff;
83
+ }
84
+ th, td {
85
+ text-align: left;
86
+ vertical-align: top;
87
+ }
88
+ th {
89
+ background: #ccc;
90
+ color: black;
91
+ }
92
+ table, th, td {
93
+ border: none
94
+ }
95
+ h3 {
96
+ font:bold 80% arial,helvetica,sanserif;
97
+ background: #525D76;
98
+ color: white;
99
+ text-decoration: none;
100
+ padding: 5px;
101
+ margin-right: 2px;
102
+ margin-left: 2px;
103
+ margin-bottom: 0;
104
+ }
105
+ </style>
106
+ </head>
107
+ <body>
108
+ <!-- jakarta logo -->
109
+ <table border="0" cellpadding="0" cellspacing="0" width="100%">
110
+ <tr>
111
+ <td valign="top" class="bannercell">
112
+ <a href="http://jakarta.apache.org/">
113
+ <img src="http://jakarta.apache.org/images/jakarta-logo.gif" alt="http://jakarta.apache.org" align="left" border="0"/>
114
+ </a>
115
+ </td>
116
+ <td style="text-align:right;vertical-align:bottom">
117
+ <a href="http://ant.apache.org/">Apache Ant</a>
118
+ </td>
119
+ </tr>
120
+ </table>
121
+
122
+ <table border="0" width="100%">
123
+ <tr><td><hr noshade="yes" size="1"/></td></tr>
124
+ </table>
125
+
126
+ <xsl:apply-templates select="build"/>
127
+
128
+ </body>
129
+ </html>
130
+ </xsl:template>
131
+
132
+ <xsl:template match="build">
133
+ <!-- build status -->
134
+ <table width="100%">
135
+ <xsl:attribute name="class">
136
+ <xsl:if test="@error">failed</xsl:if>
137
+ <xsl:if test="not(@error)">complete</xsl:if>
138
+ </xsl:attribute>
139
+ <tr>
140
+ <xsl:if test="@error">
141
+ <td nowrap="yes">Build Failed</td>
142
+ </xsl:if>
143
+ <xsl:if test="not(@error)">
144
+ <td nowrap="yes">Build Complete</td>
145
+ </xsl:if>
146
+ <td style="text-align:right" nowrap="yes">Total Time: <xsl:value-of select="@time"/></td>
147
+ </tr>
148
+ <tr>
149
+ <td colspan="2">
150
+ <xsl:if test="@error">
151
+ <tt><xsl:value-of select="@error"/></tt><br/>
152
+ <i style="font-size:80%">See the <a href="#stacktrace" alt="Click for details">stacktrace</a>.</i>
153
+ </xsl:if>
154
+ </td>
155
+ </tr>
156
+ </table>
157
+ <table border="1" cellspacing="2" cellpadding="3" width="100%" style="font-size:80%">
158
+ <tr class="a"><td width="1">ant.file</td><td><xsl:value-of select="substring-after(//message[contains(text(),'ant.file')], '->')"/></td></tr>
159
+ <tr class="b"><td width="1">ant.version</td><td><xsl:value-of select="substring-after(//message[contains(text(),'ant.version')], '->')"/></td></tr>
160
+ <tr class="a"><td width="1">java.version</td><td><xsl:value-of select="substring-after(//message[contains(text(),'java.vm.version')], '->')"/></td></tr>
161
+ <tr class="b"><td width="1">os.name</td><td><xsl:value-of select="substring-after(//message[contains(text(),'os.name')], '->')"/></td></tr>
162
+ </table>
163
+ <!-- build information -->
164
+ <h3>Build events</h3>
165
+ <table class="log" border="1" cellspacing="2" cellpadding="3" width="100%">
166
+ <tr>
167
+ <th nowrap="yes" align="left" width="1%">target</th>
168
+ <th nowrap="yes" align="left" width="1%">task</th>
169
+ <th nowrap="yes" align="left">message</th>
170
+ </tr>
171
+ <xsl:apply-templates select=".//message[@priority != 'debug']"/>
172
+ </table>
173
+ <p>
174
+ <!-- stacktrace -->
175
+ <xsl:if test="stacktrace">
176
+ <a name="stacktrace"/>
177
+ <h3>Error details</h3>
178
+ <table width="100%">
179
+ <tr><td>
180
+ <pre><xsl:value-of select="stacktrace"/></pre>
181
+ </td></tr>
182
+ </table>
183
+ </xsl:if>
184
+ </p>
185
+ </xsl:template>
186
+
187
+ <!-- report every message but those with debug priority -->
188
+ <xsl:template match="message[@priority!='debug']">
189
+ <tr valign="top">
190
+ <!-- alternated row style -->
191
+ <xsl:attribute name="class">
192
+ <xsl:if test="position() mod 2 = 1">a</xsl:if>
193
+ <xsl:if test="position() mod 2 = 0">b</xsl:if>
194
+ </xsl:attribute>
195
+ <td nowrap="yes" width="1%"><xsl:value-of select="../../@name"/></td>
196
+ <td nowrap="yes" style="text-align:right" width="1%">[ <xsl:value-of select="../@name"/> ]</td>
197
+ <td class="{@priority}" nowrap="yes">
198
+ <xsl:value-of select="text()"/>
199
+ </td>
200
+ </tr>
201
+ </xsl:template>
202
+
203
+ </xsl:stylesheet>
@@ -0,0 +1,503 @@
1
+ <?xml version="1.0"?>
2
+ <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
3
+ xmlns:lxslt="http://xml.apache.org/xslt"
4
+ xmlns:redirect="org.apache.xalan.lib.Redirect"
5
+ extension-element-prefixes="redirect">
6
+ <xsl:output method="html" indent="yes" encoding="US-ASCII"/>
7
+ <xsl:decimal-format decimal-separator="." grouping-separator="," />
8
+ <!--
9
+ Licensed to the Apache Software Foundation (ASF) under one or more
10
+ contributor license agreements. See the NOTICE file distributed with
11
+ this work for additional information regarding copyright ownership.
12
+ The ASF licenses this file to You under the Apache License, Version 2.0
13
+ (the "License"); you may not use this file except in compliance with
14
+ the License. You may obtain a copy of the License at
15
+
16
+ http://www.apache.org/licenses/LICENSE-2.0
17
+
18
+ Unless required by applicable law or agreed to in writing, software
19
+ distributed under the License is distributed on an "AS IS" BASIS,
20
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21
+ See the License for the specific language governing permissions and
22
+ limitations under the License.
23
+ -->
24
+ <!--
25
+
26
+ Stylesheet to transform an XML file generated by the Ant MAudit task into
27
+ a set of JavaDoc-like HTML page to make pages more convenient to be browsed.
28
+
29
+ It use the Xalan redirect extension to write to multiple output files.
30
+
31
+ @author Stephane Bailliez <a href="mailto:sbailliez@apache.org"/>
32
+ -->
33
+
34
+ <xsl:param name="output.dir" select="'.'"/>
35
+
36
+
37
+ <xsl:template match="classes">
38
+ <!-- create the index.html -->
39
+ <redirect:write file="{$output.dir}/index.html">
40
+ <xsl:call-template name="index.html"/>
41
+ </redirect:write>
42
+
43
+ <!-- create the stylesheet.css -->
44
+ <redirect:write file="{$output.dir}/stylesheet.css">
45
+ <xsl:call-template name="stylesheet.css"/>
46
+ </redirect:write>
47
+
48
+ <!-- create the overview-packages.html at the root -->
49
+ <redirect:write file="{$output.dir}/overview-summary.html">
50
+ <xsl:apply-templates select="." mode="overview.packages"/>
51
+ </redirect:write>
52
+
53
+ <!-- create the all-packages.html at the root -->
54
+ <redirect:write file="{$output.dir}/overview-frame.html">
55
+ <xsl:apply-templates select="." mode="all.packages"/>
56
+ </redirect:write>
57
+
58
+ <!-- create the all-classes.html at the root -->
59
+ <redirect:write file="{$output.dir}/allclasses-frame.html">
60
+ <xsl:apply-templates select="." mode="all.classes"/>
61
+ </redirect:write>
62
+
63
+ <!-- process all packages -->
64
+ <xsl:for-each select="./class[not(./@package = preceding-sibling::class/@package)]">
65
+ <xsl:call-template name="package">
66
+ <xsl:with-param name="name" select="@package"/>
67
+ </xsl:call-template>
68
+ </xsl:for-each>
69
+ </xsl:template>
70
+
71
+
72
+ <xsl:template name="package">
73
+ <xsl:param name="name"/>
74
+ <xsl:variable name="package.dir">
75
+ <xsl:if test="not($name = '')"><xsl:value-of select="translate($name,'.','/')"/></xsl:if>
76
+ <xsl:if test="$name = ''">.</xsl:if>
77
+ </xsl:variable>
78
+ <!--Processing package <xsl:value-of select="@name"/> in <xsl:value-of select="$output.dir"/> -->
79
+ <!-- create a classes-list.html in the package directory -->
80
+ <redirect:write file="{$output.dir}/{$package.dir}/package-frame.html">
81
+ <xsl:call-template name="classes.list">
82
+ <xsl:with-param name="name" select="$name"/>
83
+ </xsl:call-template>
84
+ </redirect:write>
85
+
86
+ <!-- create a package-summary.html in the package directory -->
87
+ <redirect:write file="{$output.dir}/{$package.dir}/package-summary.html">
88
+ <xsl:call-template name="package.summary">
89
+ <xsl:with-param name="name" select="$name"/>
90
+ </xsl:call-template>
91
+ </redirect:write>
92
+
93
+ <!-- for each class, creates a @name.html -->
94
+ <!-- @bug there will be a problem with inner classes having the same name, it will be overwritten -->
95
+ <xsl:for-each select="/classes/class[@package = $name]">
96
+ <redirect:write file="{$output.dir}/{$package.dir}/{@name}.html">
97
+ <xsl:apply-templates select="." mode="class.details"/>
98
+ </redirect:write>
99
+ </xsl:for-each>
100
+ </xsl:template>
101
+
102
+ <xsl:template name="index.html">
103
+ <HTML>
104
+ <HEAD><TITLE>Audit Results.</TITLE></HEAD>
105
+ <FRAMESET cols="20%,80%">
106
+ <FRAMESET rows="30%,70%">
107
+ <FRAME src="overview-frame.html" name="packageListFrame"/>
108
+ <FRAME src="allclasses-frame.html" name="classListFrame"/>
109
+ </FRAMESET>
110
+ <FRAME src="overview-summary.html" name="classFrame"/>
111
+ </FRAMESET>
112
+ <noframes>
113
+ <H2>Frame Alert</H2>
114
+ <P>
115
+ This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client.
116
+ </P>
117
+ </noframes>
118
+ </HTML>
119
+ </xsl:template>
120
+
121
+
122
+ <!-- this is the stylesheet css to use for nearly everything -->
123
+ <xsl:template name="stylesheet.css">
124
+ .bannercell {
125
+ border: 0px;
126
+ padding: 0px;
127
+ }
128
+ body {
129
+ margin-left: 10;
130
+ margin-right: 10;
131
+ font:normal 80% arial,helvetica,sanserif;
132
+ background-color:#FFFFFF;
133
+ color:#000000;
134
+ }
135
+ .a td {
136
+ background: #efefef;
137
+ }
138
+ .b td {
139
+ background: #fff;
140
+ }
141
+ th, td {
142
+ text-align: left;
143
+ vertical-align: top;
144
+ }
145
+ th {
146
+ font-weight:bold;
147
+ background: #ccc;
148
+ color: black;
149
+ }
150
+ table, th, td {
151
+ font-size:100%;
152
+ border: none
153
+ }
154
+ table.log tr td, tr th {
155
+
156
+ }
157
+ h2 {
158
+ font-weight:bold;
159
+ font-size:140%;
160
+ margin-bottom: 5;
161
+ }
162
+ h3 {
163
+ font-size:100%;
164
+ font-weight:bold;
165
+ background: #525D76;
166
+ color: white;
167
+ text-decoration: none;
168
+ padding: 5px;
169
+ margin-right: 2px;
170
+ margin-left: 2px;
171
+ margin-bottom: 0;
172
+ }
173
+ </xsl:template>
174
+
175
+
176
+ <!-- print the violations of the class -->
177
+ <xsl:template match="class" mode="class.details">
178
+ <xsl:variable name="package.name" select="@package"/>
179
+ <HTML>
180
+ <HEAD>
181
+ <xsl:call-template name="create.stylesheet.link">
182
+ <xsl:with-param name="package.name" select="$package.name"/>
183
+ </xsl:call-template>
184
+ </HEAD>
185
+ <BODY>
186
+ <xsl:call-template name="pageHeader"/>
187
+ <H3>Class <xsl:if test="not($package.name = '')"><xsl:value-of select="$package.name"/>.</xsl:if><xsl:value-of select="@name"/></H3>
188
+
189
+ <table class="log" border="0" cellpadding="5" cellspacing="2" width="100%">
190
+ <xsl:call-template name="class.audit.header"/>
191
+ <xsl:apply-templates select="." mode="print.audit"/>
192
+ </table>
193
+
194
+ <H3>Violations</H3>
195
+ <table class="log" border="0" cellpadding="5" cellspacing="2" width="100%">
196
+ <xsl:call-template name="violation.audit.header"/>
197
+ <xsl:apply-templates select="./violation" mode="print.audit">
198
+ <xsl:sort data-type="number" select="@line"/>
199
+ </xsl:apply-templates>
200
+ </table>
201
+ <xsl:call-template name="pageFooter"/>
202
+ </BODY>
203
+ </HTML>
204
+ </xsl:template>
205
+
206
+
207
+ <!-- list of classes in a package -->
208
+ <xsl:template name="classes.list">
209
+ <xsl:param name="name"/>
210
+ <HTML>
211
+ <HEAD>
212
+ <xsl:call-template name="create.stylesheet.link">
213
+ <xsl:with-param name="package.name" select="$name"/>
214
+ </xsl:call-template>
215
+ </HEAD>
216
+ <BODY>
217
+ <table width="100%">
218
+ <tr>
219
+ <td nowrap="nowrap">
220
+ <H2><a href="package-summary.html" target="classFrame"><xsl:value-of select="$name"/></a></H2>
221
+ </td>
222
+ </tr>
223
+ </table>
224
+
225
+ <h2>Classes</h2>
226
+ <TABLE WIDTH="100%">
227
+ <xsl:apply-templates select="/classes/class[./@package = $name]" mode="classes.list">
228
+ <xsl:sort select="@name"/>
229
+ </xsl:apply-templates>
230
+ </TABLE>
231
+ </BODY>
232
+ </HTML>
233
+ </xsl:template>
234
+ <!-- the class to list -->
235
+ <xsl:template match="class" mode="classes.list">
236
+ <tr>
237
+ <td nowrap="nowrap">
238
+ <!-- @bug naming to fix for inner classes -->
239
+ <a href="{@name}.html" target="classFrame"><xsl:value-of select="@name"/></a>
240
+ </td>
241
+ </tr>
242
+ </xsl:template>
243
+
244
+
245
+ <!--
246
+ Creates an all-classes.html file that contains a link to all package-summary.html
247
+ on each class.
248
+ -->
249
+ <xsl:template match="classes" mode="all.classes">
250
+ <html>
251
+ <head>
252
+ <xsl:call-template name="create.stylesheet.link">
253
+ <xsl:with-param name="package.name"/>
254
+ </xsl:call-template>
255
+ </head>
256
+ <body>
257
+ <h2>Classes</h2>
258
+ <table width="100%">
259
+ <xsl:apply-templates select=".//class" mode="all.classes">
260
+ <xsl:sort select="@name"/>
261
+ </xsl:apply-templates>
262
+ </table>
263
+ </body>
264
+ </html>
265
+ </xsl:template>
266
+
267
+ <xsl:template match="class" mode="all.classes">
268
+ <!-- (ancestor::package)[last()] is buggy in MSXML3 ? -->
269
+ <xsl:variable name="package.name" select="@package"/>
270
+ <tr>
271
+ <td nowrap="nowrap">
272
+ <a target="classFrame">
273
+ <xsl:attribute name="href">
274
+ <xsl:if test="not($package.name='')">
275
+ <xsl:value-of select="translate($package.name,'.','/')"/><xsl:text>/</xsl:text>
276
+ </xsl:if><xsl:value-of select="@name"/><xsl:text>.html</xsl:text>
277
+ </xsl:attribute>
278
+ <xsl:value-of select="@name"/>
279
+ </a>
280
+ </td>
281
+ </tr>
282
+ </xsl:template>
283
+
284
+
285
+ <!--
286
+ Creates an html file that contains a link to all package-summary.html files on
287
+ each package existing on testsuites.
288
+ @bug there will be a problem here, I don't know yet how to handle unnamed package :(
289
+ -->
290
+ <xsl:template match="classes" mode="all.packages">
291
+ <html>
292
+ <head>
293
+ <xsl:call-template name="create.stylesheet.link">
294
+ <xsl:with-param name="package.name"/>
295
+ </xsl:call-template>
296
+ </head>
297
+ <body>
298
+ <h2><a href="overview-summary.html" target="classFrame">Home</a></h2>
299
+ <h2>Packages</h2>
300
+ <table width="100%">
301
+ <xsl:apply-templates select="class[not(./@package = preceding-sibling::class/@package)]" mode="all.packages">
302
+ <xsl:sort select="@package" order="ascending"/>
303
+ </xsl:apply-templates>
304
+ </table>
305
+ </body>
306
+ </html>
307
+ </xsl:template>
308
+
309
+ <xsl:template match="class" mode="all.packages">
310
+ <tr>
311
+ <td nowrap="nowrap">
312
+ <a href="{translate(@package,'.','/')}/package-summary.html" target="classFrame">
313
+ <xsl:value-of select="@package"/>
314
+ </a>
315
+ </td>
316
+ </tr>
317
+ </xsl:template>
318
+
319
+
320
+ <xsl:template match="classes" mode="overview.packages">
321
+ <html>
322
+ <head>
323
+ <xsl:call-template name="create.stylesheet.link">
324
+ <xsl:with-param name="package.name"/>
325
+ </xsl:call-template>
326
+ </head>
327
+ <body onload="open('allclasses-frame.html','classListFrame')">
328
+ <xsl:call-template name="pageHeader"/>
329
+ <h3>Summary</h3>
330
+ <table class="log" border="0" cellpadding="5" cellspacing="2" width="100%">
331
+ <tr>
332
+ <th>Audited classes</th>
333
+ <th>Reported classes</th>
334
+ <th>Violations</th>
335
+ </tr>
336
+ <tr class="a">
337
+ <td><xsl:value-of select="@audited"/></td>
338
+ <td><xsl:value-of select="@reported"/></td>
339
+ <td><xsl:value-of select="@violations"/></td>
340
+ </tr>
341
+ </table>
342
+ <table border="0" width="100%">
343
+ <tr>
344
+ <td style="text-align: justify;">
345
+ Note: Rules checked have originated from style guidelines suggested by the language designers,
346
+ experience from the Java development community and insite experience. Violations are generally
347
+ reported with a reference to the <a href="http://java.sun.com/docs/books/jls/second_edition/html/jTOC.doc.html">Java Language Specifications</a> (JLS x.x.x)
348
+ and Metamata Audit rules (x.x).
349
+ Please consult these documents for additional information about violations.
350
+ <p/>
351
+ Rules checked also enforce adherence to <a href="http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.html">Sun Java coding guidelines</a> in use at Jakarta.
352
+ <p/>
353
+ One should note that these violations do not necessary underline errors but should be used
354
+ as an indication for <i>possible</i> errors. As always, use your best judgment and review
355
+ them carefully, it might save you hours of debugging.
356
+ </td>
357
+ </tr>
358
+ </table>
359
+
360
+ <h3>Packages</h3>
361
+ <table class="log" border="0" cellpadding="5" cellspacing="2" width="100%">
362
+ <xsl:call-template name="class.audit.header"/>
363
+ <xsl:for-each select="class[not(./@package = preceding-sibling::class/@package)]">
364
+ <xsl:sort select="@package" order="ascending"/>
365
+ <tr>
366
+ <xsl:call-template name="alternate-row"/>
367
+ <td><a href="{translate(@package,'.','/')}/package-summary.html"><xsl:value-of select="@package"/></a></td>
368
+ <td><xsl:value-of select="sum(/classes/class[./@package = current()/@package]/@violations)"/></td>
369
+ </tr>
370
+ </xsl:for-each>
371
+ </table>
372
+ <xsl:call-template name="pageFooter"/>
373
+ </body>
374
+ </html>
375
+ </xsl:template>
376
+
377
+
378
+ <xsl:template name="package.summary">
379
+ <xsl:param name="name"/>
380
+ <HTML>
381
+ <HEAD>
382
+ <xsl:call-template name="create.stylesheet.link">
383
+ <xsl:with-param name="package.name" select="$name"/>
384
+ </xsl:call-template>
385
+ </HEAD>
386
+ <BODY>
387
+ <xsl:attribute name="onload">open('package-frame.html','classListFrame')</xsl:attribute>
388
+ <xsl:call-template name="pageHeader"/>
389
+ <h3>Package <xsl:value-of select="$name"/></h3>
390
+
391
+ <!--table border="0" cellpadding="5" cellspacing="2" width="100%">
392
+ <xsl:call-template name="class.metrics.header"/>
393
+ <xsl:apply-templates select="." mode="print.metrics"/>
394
+ </table-->
395
+
396
+ <xsl:if test="count(/classes/class[./@package = $name]) &gt; 0">
397
+ <H3>Classes</H3>
398
+ <table class="log" border="0" cellpadding="5" cellspacing="2" width="100%">
399
+ <xsl:call-template name="class.audit.header"/>
400
+ <xsl:apply-templates select="/classes/class[./@package = $name]" mode="print.audit">
401
+ <xsl:sort select="@name"/>
402
+ </xsl:apply-templates>
403
+ </table>
404
+ </xsl:if>
405
+ <xsl:call-template name="pageFooter"/>
406
+ </BODY>
407
+ </HTML>
408
+ </xsl:template>
409
+
410
+
411
+ <!--
412
+ transform string like a.b.c to ../../../
413
+ @param path the path to transform into a descending directory path
414
+ -->
415
+ <xsl:template name="path">
416
+ <xsl:param name="path"/>
417
+ <xsl:if test="contains($path,'.')">
418
+ <xsl:text>../</xsl:text>
419
+ <xsl:call-template name="path">
420
+ <xsl:with-param name="path"><xsl:value-of select="substring-after($path,'.')"/></xsl:with-param>
421
+ </xsl:call-template>
422
+ </xsl:if>
423
+ <xsl:if test="not(contains($path,'.')) and not($path = '')">
424
+ <xsl:text>../</xsl:text>
425
+ </xsl:if>
426
+ </xsl:template>
427
+
428
+
429
+ <!-- create the link to the stylesheet based on the package name -->
430
+ <xsl:template name="create.stylesheet.link">
431
+ <xsl:param name="package.name"/>
432
+ <LINK REL ="stylesheet" TYPE="text/css" TITLE="Style"><xsl:attribute name="href"><xsl:if test="not($package.name = 'unnamed package')"><xsl:call-template name="path"><xsl:with-param name="path" select="$package.name"/></xsl:call-template></xsl:if>stylesheet.css</xsl:attribute></LINK>
433
+ </xsl:template>
434
+
435
+ <!-- Page HEADER -->
436
+ <xsl:template name="pageHeader">
437
+
438
+ <!-- jakarta logo -->
439
+ <table border="0" cellpadding="0" cellspacing="0" width="100%">
440
+ <tr>
441
+ <td class="bannercell" rowspan="2">
442
+ <a href="http://jakarta.apache.org/">
443
+ <img src="http://jakarta.apache.org/images/jakarta-logo.gif" alt="http://jakarta.apache.org" align="left" border="0"/>
444
+ </a>
445
+ </td>
446
+ <td style="text-align:right"><h2>Source Code Audit</h2></td>
447
+ </tr>
448
+ <tr>
449
+ <td style="text-align:right">Designed for use with <a href='http://www.webgain.com/products/quality_analyzer/'>Webgain QA/Metamata Audit</a> and <a href='http://jakarta.apache.org'>Ant</a>.</td>
450
+ </tr>
451
+ </table>
452
+ <hr size="1"/>
453
+ </xsl:template>
454
+
455
+ <!-- Page HEADER -->
456
+ <xsl:template name="pageFooter">
457
+ </xsl:template>
458
+
459
+
460
+ <!-- class header -->
461
+ <xsl:template name="class.audit.header">
462
+ <tr>
463
+ <th width="80%">Name</th>
464
+ <th>Violations</th>
465
+ </tr>
466
+ </xsl:template>
467
+
468
+ <!-- method header -->
469
+ <xsl:template name="violation.audit.header">
470
+ <tr>
471
+ <th>Line</th>
472
+ <th>Message</th>
473
+ </tr>
474
+ </xsl:template>
475
+
476
+
477
+ <!-- class information -->
478
+ <xsl:template match="class" mode="print.audit">
479
+ <tr>
480
+ <xsl:call-template name="alternate-row"/>
481
+ <td><a href="{@name}.html"><xsl:value-of select="@name"/></a></td>
482
+ <td><xsl:apply-templates select="@violations"/></td>
483
+ </tr>
484
+ </xsl:template>
485
+
486
+ <xsl:template match="violation" mode="print.audit">
487
+ <tr>
488
+ <xsl:call-template name="alternate-row"/>
489
+ <td><xsl:value-of select="@line"/></td>
490
+ <td><xsl:apply-templates select="@message"/></td>
491
+ </tr>
492
+ </xsl:template>
493
+
494
+ <!-- alternated row style -->
495
+ <xsl:template name="alternate-row">
496
+ <xsl:attribute name="class">
497
+ <xsl:if test="position() mod 2 = 1">a</xsl:if>
498
+ <xsl:if test="position() mod 2 = 0">b</xsl:if>
499
+ </xsl:attribute>
500
+ </xsl:template>
501
+
502
+ </xsl:stylesheet>
503
+