Data Definition

A Data Definition represents a set of data that the Weave server can use in various ways, for example to provide a list of values for the user when entering data, or as a tabular dataset to display textual data about a selected entity. Basically anywhere that Weave needs some textual data it will retrieve it via a data definition.

There are different types of data definition depending upon where the data is retrieved from, including data definitions that are virtual data definitions that use other data definitions to supply the data which they then filter in some way and provide as a new data definition.

The data definition itself is just a container for a data connection, the data definition provides an id and a container for a data connection and it's the data connection that describes the source of the underlying data and how that data is obtained.

Namespace

urn:com.cohga.server.data.database#1.0

Tags

datadefinition

Properties

Name

Type

Required

Description

Name

Type

Required

Description

id

string

yes

Unique identifier for referencing the data definition

filter

string

no

Provide the id of a selection filter that will be applied to the id’s before generating the data. Available from Weave 2.6.7.
For example if you’re using different id’s for the selection of an entity than the data source provides this can be used to first convert the id’s to the values that the data source does understand.

Sub-tags

Content

None

Notes

  • Only one of the data connection types can be included in a data definition.

Examples

Sample data definition using a database

<data:datadefinition id="roadDetails"> <datasourcedataconnection datasource="datasource.main" table="ROADS" key="RD_NAME" prefix="DISTINCT"> <from table="PLANS"/> <where clause="PLANS.ID=ROADS.PLAN_ID"/> <parameter name="name" label="Name" column="RD_NAME"/> <parameter name="suffix" label="Suffix" column="RD_SUFFIX"/> <parameter name="type" label="Type" column="RD_TYPE"/> <parameter name="altname" label="Alt. Name" column="ALT_NAME"/> <parameter name="altsuffix" label="Alt. Suffix" column="ALT_SUFFIX"/> <parameter name="alttype" label="Alt. Type" column="ALT_TYPE"/> </datasourcedataconnection> </data:datadefinition>

A simple inline data definition

<data:datadefinition id="connectionType"> <inlinedataconnection> <parameter type="string" name="key" label="Key" /> <parameter type="string" name="label" label="Label" /> <row> <cell>U</cell> <cell>Unverfied</cell> </row> <row> <cell>V</cell> <cell>Verified</cell> </row> </inlinedataconnection> </data:datadefinition>