The spatial editing extension for Weave provides a means to edit geometry and attributes for an entity.
...
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 | |
persisted | boolean | no | false | Should the value the user chooses for the field become the default value for the field? |
...
Code Block |
---|
<item action="weave.edit.createNew" entity="graffiti" edit="grafitti.edit"/> |
Overriding Edited Table
It's possible to override the table that Weave will update when the user submits an edit, rather than just using the table associated with the entity in the spatial mapper. This helps when working with views that can't be updated but the table that underlies the view can be.
To tell Weave to update a different table than the one specified in the spatial mapper you need to set a spatialEngine
, table
and key
in the edit config.
Code Block |
---|
<edit:config id="edit.view">
<entity>graffiti</entity> <!-- this entity is backed by a DB view that can't be edited directly -->
<spatialEngine>oracle</spatialEngine> <!-- set the spatial engine that contains the table that should be edited instead, could be the same as the spatial mapper, but might not be -->
<table>GRAFITTI</table> <!-- set the name of the table in the spatial engine that should be edited instead, this should be different than the spatial mapper, since that's the whole point of this -->
<key>OID</key> <!-- set the column that uniquely identifies the rows in the table that should be used instead, generally this would be the same as the spatial mapper -->
<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>
|