...
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 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.
Setting an id field
Specifying an field as an id field to be created by using the maximum value from the column.
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="id"> <hidden>true</hidden> <column>ID</column> <value>nextval()</value> </parameter> <parameter id="description"> <label>Description</label> <controlType>text-area</controlType> <column>DESCRIPTION</column> </parameter> </edit:config> |
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).and it would be much better to use the functionality provided by the underlying database (sequences, auto-generate, identity, etc).
...
Drop down lists
...
Specifying that the value for a field is chosen from a list. Here we have a static list, status, included directly in the configuration, and a dynamic list populated from a data definition, reporter.
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="id">
<hidden>true</hidden>
<column>ID</column>
<value>nextval()</value>
</parameter>
<parameter id="description">
<label>Description</label>
<controlType>text-area</controlType>
<column>DESCRIPTION</column>
</parameter>
<parameter id="status">
<label>Status</label>
<controlType>list-box</controlType>
<column>STATUS</column>
<defaultValue>N</defaultValue>
<list value="N" label="New"/>
<list value="V" label="Verified"/>
<list value="S" label="Scheduled"/>
<list value="R" label="Removed"/>
</parameter>
<parameter id="reporter">
<label>Reporter</label>
<controlType>list-box</controlType>
<dataSet>staff</dataSet>
<allowNewValues>true</allowNewValues>
<column>REPORTEDBY</column>
</parameter>
</edit:config>
|
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.
...
Code Block |
---|
http://localhost:8080/weave/edit.html?create=custom.edit&description=Type%20your%20description%20here |
TO BE DONE
...