...
Name | Type | Required | Description |
---|---|---|---|
datasource | yes | reference to the data source that this data definition should use to generate its data | |
table | string | yes | The name of the table that provides the data |
key | string | no | If this data definition is generating data relating to an entity then this is the column name that contains the entities id |
prefix | string | no | The prefix value will be inserted into the generated SQL statement immediately after the SELECT, for example DISTINCT |
trim | boolean | no | If |
...
Name | Type | Cardinality |
---|---|---|
parameter | 1 0..n | |
cache | 0..1 |
...
- The cache settings are only used for data source data connections that have a key specified, since it's the key that's used as the cache index
- If no
cache
tag is specified then the data will still be cached, but it will use the default cache configuration, to disable caching you need to setdisable
totrue
inside the cache definition - If no parameters are specified then the server will generate parameters based on the columns in the underlying table, in this case you should also not include any
from
tags since joins are not supported,where
tags are ok though.
Anchor | ||||
---|---|---|---|---|
|
parameter
...
Sub-tags
None
Content
None
Examples
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
<data:datadefinition id="roadDetails">
<datasourcedataconnection datasource="datasource.main" table="ROADS" key="RD_NAME" prefix="DISTINCT"/>
</data:datadefinition>
|
Code Block | ||||||
---|---|---|---|---|---|---|
|
...
Code Block | ||||
---|---|---|---|---|
| ||||
<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"/> <parameter type="integer" name="class" label="Class" column="CLASS_CODE"/> <parameter type="url" name="plan" label="Plan" column="'http://imgsvr:8080/gis/documents/plan_'|PLANS.PLAN_CODE|'.pdf'" text="Open"/> <cache> <maxElementsInMemory>500</maxElementsInMemory> <eternal>false</eternal> <timeToIdleSeconds>60</timeToIdleSeconds> <timeToLiveSeconds>300</timeToLiveSeconds> <overflowToDisk>true</overflowToDisk> <maxElementsOnDisk>20000</maxElementsOnDisk> <diskPersistent>false</diskPersistent> <diskExpiryThreadIntervalSeconds>120</diskExpiryThreadIntervalSeconds> <memoryStoreEvictionPolicy>LRU</memoryStoreEvictionPolicy> </cache> </datasourcedataconnection> </data:datadefinition> |
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
Code Block | ||||||
| ||||||
<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"/> <parameter type="integer" name="class" label="Class" column="CLASS_CODE"/> <parameter type="url" name="plan" label="Plan" column="'http://imgsvr:8080/gis/documents/plan_'|PLANS.PLAN_CODE|'.pdf'" text="Open"/> <cache disable="true"/> </datasourcedataconnection> </data:datadefinition> |
Code Block | ||||||
---|---|---|---|---|---|---|
|
...
Code Block | ||||
---|---|---|---|---|
| ||||
<data:cache id="test.cache"> <maxElementsInMemory>500</maxElementsInMemory> <eternal>false</eternal> <timeToIdleSeconds>60</timeToIdleSeconds> <timeToLiveSeconds>300</timeToLiveSeconds> <overflowToDisk>true</overflowToDisk> <maxElementsOnDisk>20000</maxElementsOnDisk> <diskPersistent>false</diskPersistent> <diskExpiryThreadIntervalSeconds>120</diskExpiryThreadIntervalSeconds> <memoryStoreEvictionPolicy>LRU</memoryStoreEvictionPolicy> </data:cache> <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"/> <parameter type="integer" name="class" label="Class" column="CLASS_CODE"/> <parameter type="url" name="plan" label="Plan" column="'http://imgsvr:8080/gis/documents/plan_'|PLANS.PLAN_CODE|'.pdf'" text="Open"/> <cache id="test.cache"/> </datasourcedataconnection> </data:datadefinition> |
Code Block | ||||||
---|---|---|---|---|---|---|
|
...
Code Block | ||||
---|---|---|---|---|
| ||||
<data:datadefinition id="suburbRoads"> <datasourcedataconnection datasource="datasource.main" table="PROPERTY" prefix="DISTINCT"> <parameter name="suburb" label="Suburb" column="PRSUB_NAME"/> <parameter name="roadname" label="Road Name" column="PRROD_NAME"/> </datasourcedataconnection> </data:datadefinition> |
Code Block | ||||||
---|---|---|---|---|---|---|
|
...
Code Block | ||||
---|---|---|---|---|
| ||||
<data:datadefinition id="suburbRoadType"> <datasourcedataconnection datasource="datasource.main" table="PROPERTY" prefix="DISTINCT"> <parameter name="suburb" label="Suburb" column="PRSUB_NAME"/> <parameter name="roadname" label="Road Name" column="PRROD_NAME"/> <parameter name="roadtype" label="Road Type" column="PRROD_TYPE"/> </datasourcedataconnection> </data:datadefinition> |
...