Skip to content, Skip to search


Script Parameters

304 bytes added, 07:56, 17 March 2016
Parameter properties
If you look at the [ @Parameter annotation], you will notice it has many properties - for example, <code>name</code> and <code>description</code>. In Java, annotations can accept [ comma-separated key=value properties]. Script parameters preserve this property syntax, with the additional requirement that all parameters are enclosed in a '''single parenthetical expression'''.
=== Widget labels ===
For example, instead of just displaying "Name", we can add a custom label and description to the name field of our script as follows:
<source lang="python">
# @String(label="Please enter your name",description="Name field") name
# @OUTPUT String greeting
# Note that documentation comments come AFTER the @Parameters
# A Jython script with parameters.
It is up to the current UI framework how to deal with these properties. By default, the <code>label</code> will change the input field label, while <code>description</code> will change the mouse-over text.
=== Widget mouseover ===
<source lang="python">
# @String(label="Please enter your name", description="Your name") name
# @OUTPUT String greeting
greeting = "Hello, " + name + "!"
=== Default values ===
Eventually, we would like to add support for standard variable assignment syntax (e.g. <code>someInt = 15</code>).
=== Folders ===
By default, a `@File` parameter
Bureaucrat, emailconfirmed, incoming, administrator, uploaders