...
This view also provides the actions required to initiate editing and the tools required to perform the spatial edit operations.
Client panel buttons
name | description |
---|---|
Create | Insert a new entity. |
Update | Change the currently selected entity. |
Delete | Remove the currently selected entity. |
Reset | Reset the form fields back to their original values. |
Submit | Complete the edit process and save the current changes. |
Cancel | Abort the edit process and abandon the current changes. |
Modify | Modify an existing geometry. |
Point | Create a new point. |
Line | Create a new line. |
Polygon | Create a new polygon. |
Remove | Remove the currently selected geometry. |
Snap | Toggle the snapping function on and off. |
Settings | Changes the snapping settings. |
Import | The import button allows the user to import geometry from another entity. |
Customising the client edit view
There are a number of customisation options available to alter the display of the edit view
name | type | default | description |
---|---|---|---|
enableCreate | boolean | true | Should the 'Create' button be displayed |
enableUpdate | boolean | true | Should the 'Update' button be displayed |
enableDelete | boolean | true | Should the 'Delete' button be displayed |
enableModify | boolean | true | Should the 'Modify' button be displayed |
enablePoint | boolean | true | Should the 'Point' button be displayed |
enableLine | boolean | true | Should the 'Line' button be displayed |
enablePolygon | boolean | true | Should the 'Polygon' button be displayed |
enableRemove | boolean | true | Should the 'Remove' button be displayed |
enableSnap | boolean | true | Should the 'Snapping' button be displayed |
enableSettings | boolean | true | Should the 'Settings' button be displayed |
enableImport | boolean | true | Should the 'Import' button be displayed |
showText | boolean | true | Should the text labels appear in the buttons |
showIcons | boolean | true | Should the icons appear in the buttons |
embedButtons | boolean | false | Should the 'Submit' and 'Cancel' buttons be embedded in the form (or remain in the toolbar) |
Edit View with embedButtons
set to true
and showText
set to false
...
This is done by adding one or more parameter
items to the edit configuration, where each parameter
specified one input parameter. The format of the parameter
items in an edit config are an extension of those available for search parameters.
Name | Type | Required | Default | Description |
id | string | yes |
A unique identifier for the parameter | ||
label | string | yes |
The prompt text displayed when user input the parameter value | ||
column | string | no |
The name of the column within the table that this parameter references | ||
helptext | string | no |
Additional text to display for the parameter to explain how to use the parameter | ||||
hidden | boolean | no | false | Hides the parameter from the parameter UI |
alignment | 'left', 'center', 'right', 'auto' | no | 'auto' | How the items should appear in the UI |
controltype | 'listbox', 'checkbox', 'radiobutton', 'textbox' or 'textarea' | no | 'textbox' | The suggested type of UI control to use when displaying the parameter |
datatype | 'any', 'date', 'time', 'datetime', 'integer', 'string' | no | 'string' | The data type for the parameter |
allownull | boolean | no | false | Whether a null value is allowed for this parameter |
allowblank | boolean | no | true | Give the user the choice of an empty value in the listbox (as opposed to a null value) |
allownewvalues | boolean | no | false | Allow the user to enter values not in the listbox already |
defaultvalue | any | no |
The default value of the parameter | ||
dataset | no |
Where to get the values for a listbox | ||
labelcolumn | string | no |
Column in the datadefinition that supplies the label of the value to show the user | ||
valuecolumn | string | no |
Column in the datadefinition that supplies the value of the value to use in the SQL | ||||
uppercase | boolean | no | false | Should the value be converted to upper case in the generated SQL |
readonly | boolean | no | false | Can the user change the value |
readonlyoninsert | boolean | no | false | Can the user change the value when a new entity is being created |
readonlyonupdate | boolean | no | false | Can the user change the value when an entity is being edited |
updatable | boolean | no | true | Can the underlying value ever be changed once set (implied readonlyonupdate if set to true) |
value | any | formula or any |
A value to insert into the database, provides a means of creating values beyond what the user enters (implied readonly if set |
A few things to not about the properties that can be applied to parameters:
...
To record who created and who modifies an entity use:
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
<edit:config id="custom.edit"> <entity>graffiti</entity> <label>Grafitti</label> <description>Report graffiti for removal</description> <geometry> <point minimum="1" maximum="1"/> </geometry> <parameter id="description"> <label>Description</label> <controlType>text-area</controlType> <column>DESCRIPTION</column> </parameter> <!-- Hidden parameters to record audit information --> <parameter id="createdby"> <hidden>true</hidden> <column>CREATEDBY</columncolumn> <value>userid()</value> <updatable>false</updatable> </parameter> <parameter id="createdon"> <hidden>true</hidden> <column>CREATEDON</column> <value>datetime()</value> <updatable>false</updatable> </parameter> <parameter id="modifiedby"> <hidden>true</hidden> <column>MODIFIEDBY</columncolumn> <value>userid()</value> </parameter> <parameter id="modifiedon"> <hidden>true</hidden> <column>MODIFIEDON</column> <value>datetime()</value> </parameter> </edit:config> |
In this example the audit information is stored in the spatial table itself, so the table must already contain the CREATEDBY
, CREATEDON
, MODIFIEDBY
and MODIFIEDON
fields and they need to by be character fields for the 'by' fields and timestamps for the 'on' fields.
Also, the about configuration assumes that there is an additional column that's used to identify the records, the id column, but that the column is auto-generated by the database and is not user editable.
...
Info |
---|
Parameters in |
...
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
<edit:config id="custom.edit"> <entity>graffiti</entity> <label>Grafitti</label> <description>Report graffiti for removal</description> <geometry> <point minimum="1" maximum="1"/> </geometry> <parameter id="id" hidden="true" label="Id" column="ID" value="auto()"/> <parameter id="description" label="Description" controlType="text-area"/> </edit:config> <edit:audit id="custom.audit"> <edit>custom.edit</edit> <datasource>datasource.main</datasource> <table>EDIT_AUDIT</table> <parameter column="ID" value="id()"/> <parameter column="DESC" parameter="description"/> <parameter column="USER" value="userid()"/> <parameter column="MODIFIED" value="datetime()"/> </edit:audit> |
...
The edit panel provides a set of resource id's that it understands and if they're set for the users locale they will be used instead of the defaults values.
id | default |
edit.create.text | Create |
edit.create.tooltip | Create a new entity |
edit.create.notify | Entity successfully created |
edit.update.text | Update |
edit.delete.tooltip | Edit the selected entity |
edit.delete.notify | Entity successfully edited |
edit.delete.text | Delete |
edit.delete.tooltip | Delete the selected entity |
edit.delete.notify | Entity successfully deleted |
edit.submit.text | Submit |
edit.submit.tooltip | Submit changes |
edit.cancel.text | Cancel |
edit.cancel.tooltip | Cancel changes |
edit.polygon.text | Polygon |
edit.polygon.tooltip | Add a polygon |
edit.line.text | Line |
edit.line.tooltip | Add a line |
edit.point.text | Point |
edit.point.tooltip | Add a point |
edit.modify.text | Modify |
edit.modify.tooltip | Click on an item to modify it |
edit.remove.text | Remove |
edit.remove.tooltip | Remove the currently selected item |
edit.reset.text | Reset |
edit.reset.tooltip | Reset the form fields |
edit.import.text | Import |
edit.import.tooltip | Import geometry from another entity |
edit.import.error.tooManyGeometries | There are too many geometries in the source |
edit.import.error.tooManyPoints | There are too many points in the source |
edit.import.error.tooManyLinestrings | There are too many lines in the source |
edit.import.error.tooManyPolygons | There are too many polygons in the source |
The following resources item can be used to replace the text for all of the items
...