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.

input.html 4.2 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Language" content="en-us">
  4. <title>Input Task</title>
  5. </head>
  6. <body>
  7. <h2><a name="input">Input</a></h2>
  8. <h3>Description</h3>
  9. <p>Allows user interaction during the build process by prompting for
  10. input. To do so, it uses the configured
  11. <a href="../inputhandler.html">InputHandler</a>.</p>
  12. <p>The prompt can be set via the message attribute or as character
  13. data nested into the element.</p>
  14. <p>Optinonally a set of valid imput arguments can be defined via the
  15. validargs attribute. Input task will no accept value that don't match
  16. one of the predefined.</p>
  17. <p>Optionally a property can be created from the value entered by the
  18. user. This property can then be used during the following build
  19. run. Input behaves according to <a href="property.html">property
  20. task</a> which means that existing properties cannot be overriden.</p>
  21. <h3>Parameters</h3>
  22. <table border="1" cellpadding="2" cellspacing="0">
  23. <tr>
  24. <td valign="top"><b>Attribute</b></td>
  25. <td valign="top"><b>Description</b></td>
  26. <td align="center" valign="top"><b>Required</b></td>
  27. </tr>
  28. <tr>
  29. <td valign="top">message</td>
  30. <td valign="top">the Message which gets displayed to the user
  31. during the build run.</td>
  32. <td valign="top" align="center">No</td>
  33. </tr>
  34. <tr>
  35. <td valign="top">validargs</td>
  36. <td valign="top">comma separated String containing valid input
  37. arguments. If set, input task will reject any input not defined
  38. here. Validargs are compared case sensitive. If you want 'a' and
  39. 'A' to be accepted you will need to define both arguments within
  40. validargs.</td>
  41. <td valign="top" align="center">No</td>
  42. </tr>
  43. <tr>
  44. <td valign="top">addproperty</td>
  45. <td valign="top">the name of a property to be created from
  46. input. Behaviour is equal to <a href="property.html">property
  47. task</a> which means that existing properties cannot be
  48. overriden.</td>
  49. <td valign="top" align="center">No</td>
  50. </tr>
  51. <tr>
  52. <td valign="top">defaultvalue</td>
  53. <td valign="top">Defines the default value of the property to be
  54. created from input. Property value will be set to default if no
  55. input is received.</td>
  56. <td valign="top" align="center">No</td>
  57. </tr>
  58. </table>
  59. <h3>Examples</h3>
  60. <pre> &lt;input/&gt;</pre>
  61. <p>Will pause the build run until return key is pressed when using the
  62. <a href="../inputhandler.html#defaulthandler">default
  63. InputHandler</a>, the concrete behavior is defined by the InputHandler
  64. implementation you use.</p>
  65. <pre> &lt;input&gt;Press Return key to continue...&lt;/input&gt;</pre>
  66. <p>Will display the message &quot;Press Return key to
  67. continue...&quot; and pause the build run until return key is pressed
  68. (again, the concrete behavior is implementation dependent).</p>
  69. <pre> &lt;input
  70. message=&quot;Press Return key to continue...&quot;
  71. /&gt;</pre>
  72. <p>Will display the message &quot;Press Return key to
  73. continue...&quot; and pause the build run until return key is pressed
  74. (see above).</p>
  75. <pre>
  76. &lt;input
  77. message=&quot;All data is going to be deleted from DB continue (y/n)?&quot;
  78. validargs=&quot;y,n&quot;
  79. addproperty=&quot;do.delete&quot;
  80. /&gt;
  81. &lt;condition property=&quot;do.abort&quot;&gt;
  82. &lt;equals arg1=&quot;n&quot; arg2=&quot;${do.delete}&quot;/&gt;
  83. &lt;/condition&gt;
  84. &lt;fail if=&quot;do.abort&quot;&gt;Build aborted by user.&lt;/fail&gt;
  85. </pre>
  86. <p>Will display the message &quot;All data is going to be deleted from
  87. DB continue (y/n)?&quot; and require 'y' to continue build or 'n' to
  88. exit build with following message &quot;Build aborted by
  89. user.&quot;.</p>
  90. <pre> &lt;input
  91. message=&quot;Please enter db-username:&quot;
  92. addproperty=&quot;db.user&quot;
  93. /&gt;</pre>
  94. <p>Will display the message &quot;Please enter db-username:&quot; and set the
  95. property <code>db.user</code> to the value entered by the user.</p>
  96. <pre> &lt;input
  97. message=&quot;Please enter db-username:&quot;
  98. addproperty=&quot;db.user&quot;
  99. defaultvalue=&quot;Scott-Tiger&quot;
  100. /&gt;</pre>
  101. <p>Same as above, but will set <code>db.user</code> to the value
  102. <i>Scott- Tiger</i> if the user enters no value (simply types
  103. &lt;return&gt;).</p>
  104. <hr>
  105. <p align="center">Copyright &copy; 2001-2003 Apache Software Foundation. All rights
  106. Reserved.</p>
  107. </body>
  108. </html>