Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
* dev:
  #24 Added SelectMany View Type and stringList Data Type Example
  #24 Adding example for selectOne view type
  #24 textarea and readOnlyText samples added.
  #24 Minor JSON formatting
  #24 Table sample
  • Loading branch information
Javier Molina committed May 17, 2019
2 parents e2a1d0a + 2842481 commit 1304eb6
Show file tree
Hide file tree
Showing 6 changed files with 245 additions and 1 deletion.
2 changes: 1 addition & 1 deletion EcodataClientPluginGrailsPlugin.groovy
Original file line number Diff line number Diff line change
@@ -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
Expand Down
18 changes: 18 additions & 0 deletions grails-app/conf/example_models/viewReadonlyTextExample.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
23 changes: 23 additions & 0 deletions grails-app/conf/example_models/viewSelectOneExample.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
162 changes: 162 additions & 0 deletions grails-app/conf/example_models/viewTableExample.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
18 changes: 18 additions & 0 deletions grails-app/conf/example_models/viewTextareaExample.json
Original file line number Diff line number Diff line change
@@ -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"
}]
}

0 comments on commit 1304eb6

Please sign in to comment.