Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

datasourcedataconnection

Properties

Name

Type

Required

Description

datasource

ref urn:com.cohga.server.datasource.jdbc#1.0: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 true the generated SQL will ensure that the id's are compared against a trimmed version of the id stored in the database.
This helps with systems like Pathway, where some tables store padded id's

keytable

string

no

An optional database table that will be used to store entity keys temporarily when performing the required SQL to generate the data for this data connection. If this option isn't set then the SQL used to generate the data will create the data in batches, which can cause issues with sorting, optionally you can create a simple two column table, with an index on the userid column, and set this value to the name of this table, then Weave will insert the entity id's into this table temporarily and use this table in a SQL join when generating the data. This will resolve any sorting issues, and is more important if caching is also disabled for the data connection.

keycolumn

string

no

The column in keytable that contains the entity id, default is key

usercolumn

string

no

The column in keytable that contains the userid, default is userid

Sub-tags

Content

None

Notes

  • 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 set disable to true inside the cache definition (see example below).

  • You can completely disable the caching (for all data definitions that don't have cache setting explicitly set) by setting the startup parameter weave.cache.default to true (in startup.cmd, startup.sh and/or weave-service.conf).

  • 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 currently supported, where tags are ok though.

Anchor
parameter
parameter

parameter

Properties

Name

Type

Required

Default

Description

column

string

yes


The name of the column within the table that this parameter references (can be an sql function also)

type

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

no

'string'

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

name

string

no

lowercase value of column

A unique identifier for the parameter

label

string

no

"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

format

string

no

"date", "time" or "datetime"

When the type attribute is date this value can force the value to be formatted as as specific date type.

Sub-tags

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'

Anchor
from
from

from

Properties

Name

Type

Required

Description

table

string

yes

An additional table to include in the generated SQL

Sub-tags

None

Content

None

Anchor
where
where

where

Properties

Name

Type

Required

Description

clause

string

yes

An additional clause to include in the generated SQL

uppercase

boolean

no

If the clause uses parameter substitution should the value be converted to upper-case before being substituted

Sub-tags

None

Content

None

sort

Properties

Name

Type

Required

Description

parameter

string

yes

Name of parameter to sort on

direction

string

no

ASC or DESC, ASC is default

Sub-tags

None

Content

None

join

Only available in 2.5.11 or later

properties

Name

Type

Required

Description

table

string

yes

The table to join to

on

string

yes

The clause used to join the table

type

string

no

The type of join to use

clause

string

no

Additional clauses that can be added to the join

options

Properties

Name

Type

Required

Description

rpad

number

no

If the key value needs to be padded with spaces on the right to make it match the database, this specifies the total length of the final padded value.

For example rpad = 10 would change a key value from "value" to "value....." (where each . is a space).

lpad

number

no

If the key value needs to be padded with spaces on the left to make it match the database, this specifies the total length of the final padded value.

For example lpad = 10 would change a key value from "value" to ".....value" (where each . is a space).

trim

boolean

no

If a key value needs to be trimmed of spaces before being used setting this to true will cause that to be done.

maxrows

number

no

Limit the number of rows that will be extracted from the database when generating the data.

failOnSubstitutionError

boolean

no

If set to true, or not set at all, this flag will force the generation of the data to fail if there is an issue with performing parameter substitution.

If this is set to false then a where clause that fails parameter substitution will be ignored.

The default value for this flag if it is not set is true.

timeout

number

no

The number of milliseconds before the SQL should be cancelled. Default 120000, can be disabled by setting to 0, can be changed globally by setting the system property weave.data.timeout. Also, the system property weave.data.mimimumtimeout specifies a minimum value, currently 5000, that if the timeout is set greater than 0 but less than this value it will be increased to be this value.

Sub-tags

None

Content

None


Examples

...