diff --git a/EcodataClientPluginGrailsPlugin.groovy b/EcodataClientPluginGrailsPlugin.groovy index 4b939042..25a8f339 100644 --- a/EcodataClientPluginGrailsPlugin.groovy +++ b/EcodataClientPluginGrailsPlugin.groovy @@ -1,6 +1,6 @@ class EcodataClientPluginGrailsPlugin { // the plugin version - def version = "1.5" + def version = "1.6" // the version or versions of Grails the plugin is designed for def grailsVersion = "2.4 > *" // resources that are excluded from plugin packaging diff --git a/grails-app/conf/example_models/viewReadonlyTextExample.json b/grails-app/conf/example_models/viewReadonlyTextExample.json new file mode 100644 index 00000000..841c1a65 --- /dev/null +++ b/grails-app/conf/example_models/viewReadonlyTextExample.json @@ -0,0 +1,18 @@ +{ + "dataModel": [ + { + "dataType": "text", + "description": "", + "name": "notes", + "defaultValue": "Default Value" + } + ], + "modelName": "Readonly View Type Example", + "viewModel": [ + { + "title": "Notes:", + "source": "notes", + "type": "readonlyText" + } + ] +} \ No newline at end of file diff --git a/grails-app/conf/example_models/viewSelectManyDataStringListExample.json b/grails-app/conf/example_models/viewSelectManyDataStringListExample.json new file mode 100644 index 00000000..4b1bd07c --- /dev/null +++ b/grails-app/conf/example_models/viewSelectManyDataStringListExample.json @@ -0,0 +1,23 @@ +{ + "dataModel": [ + { + "dataType": "stringList", + "name": "stringListField", + "description": "Description for stringListField", + "constraints": [ + "value1", + "value2", + "value3" + ] + } + ], + "modelName": "SelectMany View Type and stringList Data Type Example", + "viewModel": [ + { + "preLabel": "Description for stringListField", + "computed": null, + "source": "stringListField", + "type": "selectMany" + } + ] +} \ No newline at end of file diff --git a/grails-app/conf/example_models/viewSelectOneExample.json b/grails-app/conf/example_models/viewSelectOneExample.json new file mode 100644 index 00000000..852341d9 --- /dev/null +++ b/grails-app/conf/example_models/viewSelectOneExample.json @@ -0,0 +1,23 @@ +{ + "dataModel": [ + { + "name": "textFieldWithConstraints", + "dataType": "text", + "description": "Description for textFieldWithConstraints", + "constraints": [ + "value1", + "value2", + "value3" + ], + "defaultValue": 1 + } + ], + "modelName": "SelectOne View Type Example", + "viewModel": [ + { + "source": "textFieldWithConstraints", + "type": "selectOne", + "preLabel": "selectOne control" + } + ] +} \ No newline at end of file diff --git a/grails-app/conf/example_models/viewTableExample.json b/grails-app/conf/example_models/viewTableExample.json new file mode 100644 index 00000000..216a0b4d --- /dev/null +++ b/grails-app/conf/example_models/viewTableExample.json @@ -0,0 +1,162 @@ +{ + "dataModel": [ + { + "dataType": "list", + "name": "adminActions", + "columns": [ + { + "dataType": "text", + "noTotal": "true", + "description": "The type of administration activity undertaken. Add more rows for different admin activities as required.", + "name": "adminActionType", + "constraints": [ + "Assess EOI applications and EOI site visits", + "Development / call for applications", + "Data analysis", + "Desktop information gathering", + "Develop monitoring protocols", + "Communications plan", + "Establish contractor agreements", + "Establish landholder agreements", + "Financial audits", + "Financial planning", + "GIS / spatial data", + "Meeting / meeting administration", + "Modelling", + "Order / purchase equipment, plants, seed, wire, posts etc", + "Partnership building", + "Prepare EOI process / criteria", + "Record Keeping", + "Site selection", + "Steering group / working group established", + "Submit project progress / annual / final report", + "Technical support", + "Update / submit Project MERI Plan", + "Works approvals", + "Other (specify in notes)" + ], + "validate": "required" + }, + { + "dataType": "number", + "description": "Number of people involved in the administration activity. An individual can be involved in more than one activity.", + "name": "numberInvolved" + }, + { + "dataType": "number", + "description": "The average number of hours per person spent on each administration activity", + "name": "hoursPerPerson" + }, + { + "dataType": "number", + "description": "The total estimated person hours spent on each administration activity.", + "computed": { + "operation": "times", + "dependents": [ + "numberInvolved", + "hoursPerPerson" + ] + }, + "name": "hoursActionTotal" + }, + { + "dataType": "text", + "description": "", + "name": "activityNotes" + } + ] + }, + { + "dataType": "number", + "description": "Aggregate total of hours spent undertaking administration activities.", + "primaryResult": "true", + "computed": { + "operation": "sum", + "dependents": { + "source": "hoursActionTotal", + "fromList": "adminActions" + } + }, + "name": "hoursAdminTotal" + }, + { + "dataType": "text", + "description": "", + "name": "notes" + } + ], + "modelName": "Table View Type Example", + "viewModel": [ + { + "items": [{ + "source": "Please list the numbers of people involved in undertaking each relevant type of administration activity and the average time spent per person:", + "computed": null, + "type": "literal" + }], + "type": "row" + }, + { + "footer": + {"rows": + [{"columns": [ + { + "colspan": 2, + "source": "", + "computed": null, + "type": "literal" + }, + { + "source": "Total time spent undertaking project administration activities (Hrs)", + "computed": null, + "type": "literal" + }, + { + "source": "hoursAdminTotal", + "computed": "{\"operation\":\"sum\",\"dependents\":{\"source\":\"hoursActionTotal\",\"fromList\":\"adminActions\"}}", + "type": "number" + } + ]}]}, + "source": "adminActions", + "columns": [ + { + "title": "Type of administration activity:", + "source": "adminActionType", + "width": "25%", + "computed": null, + "type": "selectOne" + }, + { + "title": "No. of people:", + "source": "numberInvolved", + "width": "10%", + "computed": null, + "type": "number" + }, + { + "title": "Ave. time per person (Hrs):", + "source": "hoursPerPerson", + "width": "10%", + "computed": null, + "type": "number" + }, + { + "title": "Ave. total time spent (Hrs):", + "source": "hoursActionTotal", + "width": "10%", + "computed": "{\"operation\":\"product\",\"dependents\":[\"numberInvolved\",\"hoursPerPerson\"]}", + "type": "number" + }, + { + "title": "Notes:", + "source": "activityNotes", + "width": "40%", + "computed": null, + "type": "textarea" + } + ], + "userAddedRows": true, + "class": "output-section", + "type": "table" + } + ] +} \ No newline at end of file diff --git a/grails-app/conf/example_models/viewTextareaExample.json b/grails-app/conf/example_models/viewTextareaExample.json new file mode 100644 index 00000000..6ea449cd --- /dev/null +++ b/grails-app/conf/example_models/viewTextareaExample.json @@ -0,0 +1,18 @@ +{ + "dataModel": [ + { + "dataType": "text", + "description": "", + "name": "notes" + } + ], + "modelName": "Textarea View Type Example", + "viewModel": [ + { + "title": "Notes:", + "source": "notes", + "rows": "5", + "cols": "100", + "type": "textarea" + }] +} \ No newline at end of file