You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

task.dvsl 13 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499
  1. #*
  2. * DVSL Stylesheet to format the Ant Task documentation.
  3. *#
  4. #set( $relative-path = "../../" )
  5. #if (false)
  6. #set( $body-bg = '#ffffff' )
  7. #set( $body-fg = '#000000' )
  8. #set( $body-link = '#525D76' )
  9. ##set( $banner-bg = '#EEEEEE')
  10. #set( $banner-fg = '#000000')
  11. #set( $sub-banner-bg = '#828DA6')
  12. #set( $sub-banner-fg = '#ffffff')
  13. ##set( $table-th-bg = '#FFEEEE')
  14. ##set( $table-td-bg = '#FFEEEE')
  15. ##set( $source-color = '#CCFFFF')
  16. #set( $table-th-bg = '#EEEEEE')
  17. #set( $table-td-bg = '#EEEEEE')
  18. #set( $banner-bg = '#a0ddf0')
  19. ##set( $banner-bg = '#525D76')
  20. ##set( $table-th-bg = '#039acc')
  21. ##set( $table-td-bg = '#a0ddf0')
  22. #set( $source-color = '#023264')
  23. #end
  24. #set( $body-bg = '#ffffff' )
  25. #set( $body-fg = '#000000' )
  26. #set( $body-link = '#525D76' )
  27. #set( $banner-bg = '#525D76')
  28. #set( $banner-fg = '#ffffff')
  29. #set( $sub-banner-bg = '#828DA6')
  30. #set( $sub-banner-fg = '#ffffff')
  31. #set( $table-th-bg = '#cccccc')
  32. #set( $table-td-bg = '#eeeeee')
  33. #set( $source-color = '#023264')
  34. #set( $source-font-size = '+0')
  35. ## Double quote for convenience
  36. #set ($qq = '"')
  37. ## Macro to output argument if test evaluates to true
  38. #macro(ifset $test $output)
  39. #if ( $test )$output#end
  40. #end
  41. ## Macro to capitalize a word making the first letter upper case
  42. #macro(capitalize $word)
  43. $word.substring(0,1).toUpperCase()$word.substring(1)
  44. #end
  45. #match( "task" )
  46. #set( $project = $node.selectSingleNode("document('xdocs/stylesheets/project.xml')/project" ) )
  47. #if ($node.name().equals("task"))
  48. #set( $title = "#capitalize($attrib.name) Task" )
  49. #set( $summary = $node.short-description )
  50. #end
  51. <html>
  52. <head>
  53. <meta http-equiv="Content-Language" content="en-us">
  54. <title>$title</title>
  55. </head>
  56. <body bgcolor="$body-bg" text="$body-fg" link="$body-link"
  57. alink="$body-link" vlink="$body-link">
  58. <table border="0" width="100%" cellspacing="4">
  59. <!-- PAGE HEADER -->
  60. <tr>
  61. <td>
  62. <table border="0" width="100%"><tr>
  63. <td valign="bottom">
  64. <font size="+3" face="arial,helvetica,sanserif"><strong>$title</strong></font>
  65. #* *##if( $summary )
  66. <br><font face="arial,helvetica,sanserif">$summary</font>
  67. #* *##end
  68. </td>
  69. <td>
  70. #* *##if( $project.logo )
  71. #set( $alt = $project.logo )
  72. #set( $home = $project.attribute("href") )
  73. #set( $src = $project.logo.attribute( "href" ) )
  74. <!-- PROJECT LOGO -->
  75. <a href="$home">
  76. <img src="${relative-path}$src" align="right" alt="$alt" border="0"/>
  77. </a>
  78. #* *##end
  79. </td>
  80. </tr></table>
  81. </td>
  82. </tr>
  83. <!-- START RIGHT SIDE MAIN BODY -->
  84. <tr>
  85. <td valign="top" align="left">
  86. #* *##if ($node.name().equals("task"))
  87. #* Use description from merged XML if available, else javadoc comment *#
  88. #* *##if ($node.external.description)
  89. <!-- Applying task/description -->
  90. #* *#$context.applyTemplates("external/description")
  91. #* *##else
  92. <!-- Applying task/long-description -->
  93. #* *#$context.applyTemplates("long-description")
  94. #* *##end
  95. #* *#$context.applyTemplates("structure/attribute-groups")
  96. #* *#$context.applyTemplates("structure/elements")
  97. #* *#$context.applyTemplates("external/section")
  98. #* *##end
  99. </td>
  100. </tr>
  101. <!-- END RIGHT SIDE MAIN BODY -->
  102. <!-- FOOTER SEPARATOR -->
  103. <tr>
  104. <td>
  105. <hr noshade="" size="1"/>
  106. </td>
  107. </tr>
  108. <!-- PAGE FOOTER -->
  109. <tr>
  110. <td>
  111. <div align="center"><font color="$body-link" size="-1"><em>
  112. Copyright &#169; 2000-2003, Apache Software Foundation
  113. </em></font></div>
  114. </td>
  115. </tr>
  116. </table>
  117. </body>
  118. </html>
  119. #end
  120. #*
  121. Macro to format a table heading cell
  122. *#
  123. #macro( th $text )
  124. <td bgcolor="$table-th-bg" valign="top" align="left">
  125. <font color="#000000" size="-1" face="arial,helvetica,sanserif"><b>$text</b></font>
  126. </td>
  127. #end
  128. #*
  129. Macro to format a table body cell
  130. *#
  131. #macro( td $text )
  132. <td bgcolor="$table-td-bg" valign="top" align="left">
  133. <font color="#000000" size="-1" face="arial,helvetica,sanserif">$text</font>
  134. </td>
  135. #end
  136. #*
  137. Macro to format a table body cell that spans multiple rows
  138. *#
  139. #macro( tdmr $text $rows )
  140. <td bgcolor="$table-td-bg" valign="top" align="left" rowspan="$rows">
  141. <font color="#000000" size="-1" face="arial,helvetica,sanserif">$text</font>
  142. </td>
  143. #end
  144. #*
  145. Macro to format a section banner
  146. *#
  147. #macro( section $anchor $name )
  148. <tr><td bgcolor="$banner-bg">
  149. <font color="$banner-fg" face="arial,helvetica.sanserif">
  150. <a name="$anchor">
  151. <strong>$name</strong></a></font>
  152. </td></tr>
  153. #end
  154. #*
  155. Macro to format a subsection banner
  156. *#
  157. #macro( subsection $anchor $name )
  158. <tr><td bgcolor="$sub-banner-bg">
  159. <font color="$sub-banner-fg" face="arial,helvetica.sanserif">
  160. <a name="$anchor">
  161. <strong>$name</strong></a></font>
  162. </td></tr>
  163. #end
  164. #*
  165. Process javadoc long description section
  166. *#
  167. #match( "long-description" )
  168. <!-- Start Description -->
  169. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  170. <tr><td>&nbsp;</td></tr>
  171. #* *##section("description" "Description")
  172. <tr><td><blockquote>
  173. $node.value().trim()
  174. </blockquote></td></tr>
  175. </table>
  176. <!-- End Description -->
  177. #end
  178. #*
  179. Process external desciption
  180. *#
  181. #match( "external/description" )
  182. <!-- Start Description -->
  183. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  184. <tr><td>&nbsp;</td></tr>
  185. #* *##section("description" "Description")
  186. <tr><td><blockquote>
  187. #* *#$context.applyTemplates("*")
  188. </blockquote></td></tr>
  189. </table>
  190. <!-- End Description -->
  191. #end
  192. #*
  193. Process top level attributes
  194. *#
  195. #match( "structure/attribute-groups" )
  196. <!-- Start Attributes -->
  197. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  198. <tr><td>&nbsp;</td></tr>
  199. #* *##section("attributes" "Parameters")
  200. <tr><td><blockquote>
  201. <table>
  202. <tr>
  203. #* *##th("Attribute")
  204. #* *##th("Description")
  205. #* *##th("Type")
  206. #* *##th("Requirement")
  207. </tr>
  208. #* *#$context.applyTemplates("*")
  209. </table>
  210. </blockquote></td></tr>
  211. </table>
  212. <!-- End Attributes -->
  213. #end
  214. #*
  215. Process attribute group
  216. *#
  217. #match( "structure/attribute-groups/attribute-group" )
  218. <!-- Attribute Group -->
  219. #set ($attributeGroup = $attrib.description)
  220. #set ($numGroups = $node.selectNodes("attribute").size())
  221. #set ($inGroup = true)
  222. #* *#$context.applyTemplates("*")
  223. #end
  224. #*
  225. Process a single attribute
  226. *#
  227. #match( "structure/attribute-groups/attribute-group/attribute" )
  228. <!-- Attribute -->
  229. <tr>
  230. #* *##td($attrib.name)
  231. #* *##td($node.description)
  232. #* *##td($attrib.briefType)
  233. #if ($inGroup)
  234. #* *##tdmr($attributeGroup $numGroups)
  235. #set ($inGroup = false)
  236. #end
  237. </tr>
  238. #end
  239. #*
  240. Process all elements
  241. *#
  242. #match( "elements" )
  243. <!-- Start Elements -->
  244. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  245. <tr><td>&nbsp;</td></tr>
  246. #* *##section("elements" "Parameters as nested elements")
  247. <tr><td><blockquote>
  248. #* *#$context.applyTemplates("*")
  249. </blockquote></td></tr>
  250. </table>
  251. <!-- End Elements -->
  252. #end
  253. #*
  254. Process a single element
  255. *#
  256. #match( "element" )
  257. <!-- Start Element -->
  258. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  259. <tr><td>&nbsp;</td></tr>
  260. <tr><td bgcolor="$sub-banner-bg">
  261. <font color="$sub-banner-fg" face="arial,helvetica.sanserif" size="-1">
  262. <strong>$attrib.name</strong> ($attrib.type)</font>
  263. </td></tr>
  264. <tr><td><blockquote>
  265. $node.description.toString().trim()
  266. #* *#$context.applyTemplates("*")
  267. </blockquote></td></tr>
  268. </table>
  269. <!-- End Element -->
  270. #end
  271. #*
  272. Process attributes within elements
  273. *#
  274. #match( "element/attributes" )
  275. <!-- Start Attributes -->
  276. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  277. <tr><td>&nbsp;</td></tr>
  278. <tr><td>
  279. <table>
  280. <tr>
  281. #* *##th("Attribute")
  282. #* *##th("Description")
  283. #* *##th("Type")
  284. </tr>
  285. #* *#$context.applyTemplates("*")
  286. </table>
  287. </td></tr>
  288. </table>
  289. <!-- End Attributes -->
  290. #end
  291. #*
  292. * Process a menu for the navigation bar
  293. *#
  294. #match( "menu" )
  295. <tr><td>
  296. <p>
  297. <strong>$attrib.name</strong>
  298. </p>
  299. </td><td>
  300. <ul>
  301. $context.applyTemplates("item")
  302. </ul></td></tr>
  303. #end
  304. #*
  305. * Process a menu item for the navigation bar
  306. *#
  307. #match( "item" )
  308. #if( $attrib.href.endsWith("$outputfilename") && !$attrib.href.startsWith("http"))
  309. <strong>$attrib.name</strong>
  310. #else
  311. #if( $attrib.href.startsWith("http") )
  312. <a href="$attrib.href">$attrib.name</a>
  313. #else
  314. <a href="${relative-path}$attrib.href">$attrib.name</a>
  315. #end
  316. #end
  317. #end
  318. #*
  319. * process a documentation section
  320. *#
  321. #match( "section" )
  322. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  323. <tr><td>&nbsp;</td></tr>
  324. <tr><td bgcolor="$banner-bg">
  325. <font color="$banner-fg" face="arial,helvetica.sanserif">
  326. #if ( $attrib.anchor )
  327. #set( $anchor = $attrib.anchor )
  328. #else
  329. #set( $anchor = $attrib.name )
  330. #end
  331. <a name="$anchor">
  332. <strong>$attrib.name</strong></a></font>
  333. </td></tr>
  334. <tr><td><blockquote>
  335. $context.applyTemplates("*")
  336. </blockquote></td></tr>
  337. </table>
  338. #end
  339. #match( "subsection" )
  340. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  341. <!-- Subsection heading -->
  342. <tr><td bgcolor="$sub-banner-bg">
  343. <font color="$sub-banner-fg" face="arial,helvetica.sanserif">
  344. #if ( $attrib.anchor )
  345. #set( $anchor = $attrib.anchor )
  346. #else
  347. #set( $anchor = $attrib.name )
  348. #end
  349. <a name="$anchor">
  350. <strong>$attrib.name</strong></a></font>
  351. </td></tr>
  352. <!-- Subsection body -->
  353. <tr><td>
  354. $context.applyTemplates("*")
  355. </td></tr>
  356. </table>
  357. #end
  358. #*
  359. * process a the requirement groups
  360. *#
  361. #match( "requirement-group" )
  362. #if ($regGroup == $attrib.name)
  363. #* *#$attrib.description
  364. #end
  365. #end
  366. #match( "source" )
  367. <div align="left">
  368. <table cellspacing="4" cellpadding="0" border="0">
  369. <tr>
  370. <td bgcolor="$source-color" width="1" height="1">
  371. <img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/>
  372. </td>
  373. <td bgcolor="$source-color" height="1">
  374. <img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/>
  375. </td>
  376. <td bgcolor="$source-color" width="1" height="1">
  377. <img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/>
  378. </td>
  379. </tr>
  380. <tr>
  381. <td bgcolor="$source-color" width="1">
  382. <img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/>
  383. </td>
  384. <td bgcolor="#ffffff" height="1">
  385. <font size="$source-font-size"><pre>$toolbox.htmlescape.getText( $node.value() )</pre></font>
  386. </td>
  387. <td bgcolor="$source-color" width="1">
  388. <img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/>
  389. </td>
  390. </tr>
  391. <tr>
  392. <td bgcolor="$source-color" width="1" height="1">
  393. <img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/>
  394. </td>
  395. <td bgcolor="$source-color" height="1">
  396. <img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/>
  397. </td>
  398. <td bgcolor="$source-color" width="1" height="1">
  399. <img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/>
  400. </td>
  401. </tr>
  402. </table>
  403. </div>
  404. #end
  405. #match("table")
  406. <table>
  407. $context.applyTemplates("*")
  408. </table>
  409. #end
  410. #match("tr")
  411. <tr>
  412. $context.applyTemplates("*")
  413. </tr>
  414. #end
  415. #match( "td" )
  416. <td bgcolor="$table-td-bg" #*
  417. *##ifset($attrib.colspan "colspan=$qq$attrib.colspan$qq ")#*
  418. *##ifset($attrib.rowspan "rowspan=$qq$attrib.rowspan$qq ")#*
  419. *#valign="top" align="left">
  420. <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  421. $node.copy( $node.children() )
  422. </font>
  423. </td>
  424. #end
  425. #match( "th" )
  426. <td bgcolor="$table-th-bg" #*
  427. *##ifset($attrib.colspan "colspan=$qq$attrib.colspan$qq ")#*
  428. *##ifset($attrib.rowspan "rowspan=$qq$attrib.rowspan$qq ")#*
  429. *#valign="top" align="left">
  430. <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  431. <b>$node.copy( $node.children())</b>
  432. </font>
  433. </td>
  434. #end
  435. #match("*")
  436. $node.copy()
  437. #end