...
Server Edit Configuration
Before entities an entity can be edited it must have at least one edit configuration associated with it via a configuration item. There are currently two types of edit configurations available, a simple
one that infers the information it requires from the underlying spatial tables, and a custom
one in which you provided all of the details. The edit configuration enables editing for the particular entity and also allows for overriding the details about the way the user can edit the entity, for example what attributes the user can edit, how the attributes are presented to the user, etc.
Info |
---|
You can have multiple edits associated with each entity, the user will be able to choose which edit to perform by selecting from a list. |
...
Basic Server Edit Configuration
The simple
most basic edit configuration interrogates the underlying spatial tables for the information it requires, for example to determine what attributes the entity has associated with it or what spatial geometries (point, line or polygon) the user is allowed to create.
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
<?xml version="1.0" encoding="UTF-8"?> <config xmlns="urn:com.cohga.server.config#1.0" xmlns:edit="urn:com.cohga.spatial.edit#1.0"> <edit:simpleconfig id="simple.edit"> <entity>graffiti</entity> <label>Spatial Attributes<<label>Graffiti</label> <description>Edit<description>Report thegraffiti spatial attributes attached to the graffiti<for removal</description> </edit:simple>config> </config> |
This provides a simple way to edit setup editing for an entity and allows , allowing the user to directly edit the attributes attached to the entity in the spatial table. The only customisation options the simple
edit provides is the label
and a description
the rest of the information required is determined by the spatial table(s) that the entity is associated withunderlying spatial table.
Tip |
---|
The |
...
Default editing attributes
The simple
basic edit configuration offers no options to customise what attributes are available for editing, they all are, or how the user will be able to edit those values, which will be determined by the underlying column type in the spatial table and be limited to simple field types (text fields for string and numbers, calendar field for dates, etc).
...
Default geometry requirements
What types of geometry the user will be able to create/edit will also be determined by the underlying spatial table, if the spatial table contains polygons then the user will only be able to create polygons, they will not be able to create points or lines. If however the entity is linked to two spatial tables, one containing polygons and the other containing points then the user will be able to edit points and polygons.
...
Finally the requirement for the user to actually create geometry is also determined by the underlying spatial table, if the spatial table allows nil geometry then the user will not be forced to create a geometry when creating a new entity, if the spatial table doesn't allow nil geometries then the user will be required to create a geometry before they'll be able to complete the edit.
...
Customising Server Edit Configuration
If you need more control over the attributes and geometry for an edit then you need to create a custom
override the values that the simple form is generating.
The things that you can override are the supported geometry types, the required geometry types and the parameters that the user can edit.
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
<?xml version="1.0" encoding="UTF-8"?> <config xmlns="urn:com.cohga.server.config#1.0" xmlns:edit="urn:com.cohga.spatial.edit#1.0"> <edit:customconfig id="custom.edit"> <entity>graffiti</entity> <label>Custom Attributes<<label>Grafitti</label> <description>Edit<description>Report thegraffiti attributes attached to the graffiti<for removal</description> <supportedGeometry>point</supportedGeometry> <requiredGeometry>point</requiredGeometry> <parameter id="description"> <promptText>Description</promptText> <controlType>text-area</controlType> <column>DESCRIPTION</column> </parameter> </edit:custom>config> </config> |
Custom geometry requirements
Unless explicitly set the types of geometry that a user can create for an entity, and if the user can create an entity with no geometry, is defined by the underlying spatial tables, if you wish to override this then you do so with the supportedGeometry
and requiredGeometry
settings.
Both supportedGeometry
and requiredGeometry
can be listed multiple times, if more that one geometry type is supported/required, and the possible values for both of these are:
- point
- multipoint
- linestring
- multilinestring
- polygon
- multipolygon
Note |
---|
Specifying the single part and multi part options of the same geometry type is treated the same as just specifying the multi part option. That is <requireGeometry>polygon</requireGeometry> and <requireGeometry>multipolygon</requireGeometry> is the same as just <requireGeometry>multipolygon</requireGeometry> |
Some examples of why you would want to set these values are (these assume that you can't change the underlying spatial table):
- Spatial table allows nil geometry but you wish to enforce geometry creation
- Add <requireGeometry>geometryType</requireGeometry> where geometryType matches the underlying spatial table
- Spatial table allows multi part geometry but you wish to enforce creation of single part geometry
- Add <supportGeometry>geometryType</supportGeometry> where geometryType matches the underlying spatial table
- The spatial engine supports multiple geometry types in a single table, for example Oracle Spatial, and you wish to limit the geometry
- Add <supportedGeometry>geometryType</supportedGeometry> to limit the available geometry types, otherwise options all will be available