Version 52 (modified by ehb, 6 years ago) (diff) |
---|
module json
- the module json describes the input and output for a wrapped executable module
- many examples are found here
current target languages
- html5
- qt3
- qt4
special note on loading filenames in text fields
- Filenames loaded in via input as text should be declared "safefile" : "true" in the field JSON.
- the acceptable pattern is currently: starts with alphanumeric then followed by alphanumeric, dot (.), underscore (_), dash (-), and forward slashes (for directory traversal within the job tree), but after every slash you must again start with an alphanumeric character. e.g. abc/.xyz is not acceptable, abc/x./y./z is.
- This will prevent attempts at wandering outside the job's directory tree
- e.g.:
{ "role" : "input", "id" : "filetext", "label" : "filetext", "type" : "text", "safefile" : "on" },
target compute resource
- optional top-level attribute
- i.e. in module.json, not under fields
- "resource" : "xyz"
- this module-specific attribute will override the global default "resourcedefault" attribute in the application configuration json
- the attribute value must be defined in "resources" as described in the application configuration json
- example in genapptest: data_interpolation
submit policy
- optional top-level attribute
- i.e., in module.json, not under fields
- "submitpolicy" : "login"
- the user must be logged in to submit this module
- "submitpolicy" : "all"
- anyone (logged in or not) can submit this module
- this module-specific attribute will override the global default "submitpolicy" in the application configuration json
- example in genapptest: align
unique run directory
- optional top-level attribute
- i.e., in module.json, not under fields
- "uniquedir" : "on"
- see more about projects and files here
- example in genapptest: data_interpolation
specified project - html5-only
- for the case when each run should get a specified project identifier
- it will be assembled as a sequence of selected input field values
- each field to be part of that sequence needs
- "projectprefix" : "pp"
- this will add that field's projectprefix and its value to assemble the project name
- do to project naming restrictions, any non-alphanumeric character will be replaced by an underscore
- specified projects results can be cached
module help
- optional top level attribute
- "help" : "help text"
- "help text" will appear over the module load button when help is on
module field help
- optional field level attribute
- "help" : "help text"
- "help text" will appear over the module's field when help is on
captcha
- any module can optionally require a "captcha" human verification upon submit
- to enable, you must enable captcha in directives.json and add to the module json as a top level attribute:
"captcha" : "true",
hide buttons if not logged on
- this option will hide the submit and reset buttons if the user is not logged in
- one use is for viewing public cached results
"hideifnotlogon" : "true",
autosubmit
- if modules have no input (i.e. are simply a result), they "self submit" automatically with the "autosubmit" tag
"autosubmit" : "true",
background image
- a module specific background image can be specified with the "backgroundimage" tag
- note: a global image can be specified in directives.json
- N.B. can not be currently combined with user colors
- e.g.
,"backgroundimage" : "pngs/simulate.png"
- these images should be placed in add/pngs/ before running genapp.pl
currently defined types
- notes:
- module entry id's must be unique
- html5-only should only be temporary until the feature is ported to other languages
- decimal number values for min, max etc *must* begin with a digit: e.g. .5 is not a valid number and will not behave as expected.
name | input support | output support | append (output-only) primarily for messaging) | default (input-only) | min (input-only) | max (input-only) | step (input-only) | required (input-only) | repeater (input-only) | help (example calculate:calculate_2, analysis:pm) | notes | genapptest example |
integer | yes | yes | yes | no | yes | yes | html5-only | yes | html5-only | html5-only | more info including sync | tools:center repeater example interact:interact_1 step example tools:center |
float | yes | yes | no | yes | yes | yes | html5-only | yes | no | html5-only | tools:center | |
text | yes | yes | no | yes | no | no | no | yes | no | html5-only | build:build_1 | |
textarea | yes | yes | html5-only | yes | no | no | no | yes | no | html5-only | multiline default input not yet supported | build:build_2 |
checkbox | yes | yes | no | no | no | no | no | yes | html5-only | html5-only | additional 'checked' attribute | build:build_2 repeater example calculate:calculate_1 |
radio | yes | yes | no | no | no | no | no | yes | no | html5-only | one entry for each button name is the name of the radio button (common for all members) | build:build_2 |
listbox | yes | no | no | yes | no | no | no | no | html5-only | html5-only | no required attribute, but it will always have a value row spacing minor layout issue on repeater | build:build_2 repeater example calculate:calculate_2 |
plot2d | no | yes | no | no | no | no | no | no | no | html5-only | more info | tools:data_interpolation |
atomicstructure | no | yes | no | no | no | no | no | no | no | html5-only | more info | tools:data_interpolation |
file | yes | yes | no | no | no | no | no | yes | no | html5-only | additional multiple attribute(input-only) | simulate:simulate_1 |
lrfile | html5-only | html5-only | no | no | no | no | no | yes | no | html5-only | more info "multiple" attribute not yet supported | tools:filetest |
rfile | html5-only | html5-only | no | no | no | no | no | yes | no | html5-only | more info "multiple" attribute not yet supported | tools:filetest |
rpath | html5-only | html5-only | no | no | no | no | no | yes | no | html5-only | more info "multiple" attribute not yet supported | tools:filetest |
label | html5-only | html5-only | no | yes* | no | no | no | no | no | html5-only | *can be header1,2,3,4 or blank | interact:interact_2 |
hidden | html5-only | no | no | yes | no | no | no | no | no | no | this is primarily to pass a value in json to the executable | analysis:pm |
html | no | html5-only | no | yes | no | no | no | no | no | no | allows html output | none currently, but it's a typical field layout |
progress | no | html5-only | no | no | no | yes (for output) | no | no | no | no | progress bar default ranges is 0 to 1.0, setting max to a positive value will make the range 0-max | tools:center |