...
This example sets an id field that's hidden from the user and it's created from the existing values in the table. This is not an optimal solution to generating new key values, and it would be much better to use the functionality provided by the underlying database (sequences, auto-generate, identity, etc).
Writing to other tables
So far all attribute values entered by the user were written directly to the underlying spatial table, it's also possible to write values, including those entered by the user and those available via value formulas, to another database table. This can be done by creating an audit
edit configuration item and attaching it to an existing edit configuration item.
The audit
configuration specified a datasource and table to write the values to plus a list of parameters that correspond to the columns in the table.
The columns can derive their values either from the values entered by the user as a parameter in the original edit
configuration or as a formula using a value
tag or as a hard coded value.
Note |
---|
Parameters in |
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
<edit:config id="custom.edit">
<entity>graffiti</entity>
<label>Grafitti</label>
<description>Report graffiti for removal</description>
<supportedGeometry>point</supportedGeometry>
<requiredGeometry>point</requiredGeometry>
<parameter id="description" label="Description" controlType="text-area" column="DESCRIPTION"/>
</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="USERID" value="userid()"/>
<parameter column="MODIFIED" value="datetime()"/>
</edit:audit>
|
TO BE DONE
- More examples
- Writing values to a separate database table
- Starting the Weave client with a url