Spatial Data Connection

spatialdataconnection

Properties

Name

Type

Required

Description

Name

Type

Required

Description

entity

ref urn:com.cohga.server.entity#1.0

no1

Id of the entity that this data definition should use to generate its data.
The data is generated based on the Spatial Mapping specified for the entity

spatialengine

ref urn:com.cohga.server.spatial.geotools#1.0

no1

The Id of a spatial engine that contains the table with the data required

table

string

no1

The name of the table within the spatial engine that contains the data required

key

string

no1

The name of the column within the table that contains the id’s of the entities of the data required

Sub-tags

Name

Type

Cardinality

Name

Type

Cardinality

parameter

parameter

0..n

Content

None

Notes

If no parameter tags are included Weave will make a (probably not great) guess at including all the available columns.

1 Either entity, or spatialengine, table and key are required.

parameter

Properties

Name

Type

Required

Description

Name

Type

Required

Description

column

string

yes

The name of the column within the table that this parameter references

type

'string', 'numeric', 'date' or 'url'

no (default 'string')

An indicator of how the data should be displayed on the client

name

string

no (default lowercase value of column)

A unique identifier for the parameter

label

string

no (default 'pretty' value of column)

A user displayable label for the column

text

string

no

Only when type is 'url'. Specifies text to be displayed to the user instead of the actual url contents

textcolumn

string

no

Only when type is 'url'. Specifies the column that contains text to be displayed to the user instead of the actual url contents

Sub-tags

None

Content

None

Notes

  • If no label is specified then it will be generated by formatting the name, unless no name is supplied, then it will be generated by formatting the column

  • Formatting involves converting any _'s to spaces, converting the first letter and any letter after a space to upper case and converting every other letter to lower case, e.g. "BOMB_DISPOSAL_METHOD" becomes "Bomb Disposal Method"

  • Only one of text or textcolumn should be specified when type is 'url'

Examples

A simple spatial data definition generating name and label attributes based on the column

<data:datadefinition id="graffiti"> <spatialdataconnection entity="graffiti"> <parameter column="ID"/> <!-- name will be 'id', label 'Id' --> <parameter column="DESCRIPTION"/> <!-- name will be 'description', label 'Description' --> <parameter label="Created on" column="CREATED" type="datetime"/> <!-- name will be 'created' --> <parameter label="Modified on" column="MODIFIED" type="datetime"/> <!-- name will be 'modified' --> <parameter name="user" label="User" column="USERID"/> </spatialdataconnection> </data:datadefinition>


A simple example that points directly to a table, and therefore does not require its own entity and spatial mapper

<data:definition id="graffiti"> <spatialdataconnection spatialengine="gis" table="GRAFITTI" key="ID"> <parameter name="id" label="Id" column="ID"/> <parameter name="description" label="Description" column="DESCRIPTION"/> <parameter name="created" label="Created on" column="CREATED" type="datetime"/> <parameter name="modified" label="Modified on" column="MODIFIED" type="datetime"/> <parameter name="user" label="User" column="USERID"/> </spatialdataconnection> <data:definition>