Versions Compared

Key

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

...

If you wish to apply the filter to a data definition that uses a database table to retrieve data then the filter can be added as an SQL Where clause in the data definition configuration. This is possible because the dayasourcedataconnection datasourcedataconnection type of data definition provides support for filtering using SQL via the where tag, where-as an inlinedataconnection does not (currently) support filtering so cannot use a dynamic user attribute to refine the returned data.

...

By applying the filtering to each item that’s related to the trees then the end user will have a consistent filtered view of the data related to the values they entered for the filter, which is the intended use case of thing this functionality.

Indexes

Applying a filter to an index is a little more involved than some of the other items in that it requires that additional fields be added to the index when it is built.

Note

If you intend to include the indexes related to an entity in the filtering you will be limited to only filter parameters the that perform an equals comparison, that is you will not be able to filter on a range so you can not use the silder or multislider parameters types when defining the user attributes, or utilise multiple fields that are combined to filter on a range.

This is because the filtering is performed by the underlying indexing engine which does not support range based queries.

...

If the insp_date user attribute is not set then the query will not be adjusted to include a reference and all documents will be searched.

Configuration

Namespace

urn:com.cohga.weave.dynamic.attributes#1.0

Tags

config

Properties

...

Name

...

Type

...

Required

...

Description

...

id

...

string

...

yes

...

Unique identifier for this filter.

...

label

...

string

...

yes

...

Text to be displayed to the user to represent this filter.

Sub-tags

...

Name

...

Type

...

Cardinality

...

parameter

...

urn:com.cohga.weave.dynamic.attributes#1.0:parameter

...

1..n

parameter

Properties

...

Name

...

Type

...

Required

...

Default

...

Description

...

id

...

string

...

yes

...

A unique identifier for the parameter.

...

label

...

string

...

yes

...

The prompt text displayed when user input the parameter value.

...

column

...

string

...

yes

...

The name of the column within the layer that this parameter references.

...

controlType

...

'text', '‘list', 'radio', ‘check', ‘multicheck’, 'silder’, 'multislider’

...

no

...

'text'

...

The UI control to use when displaying the parameter.

...

dataType

...

'boolean', 'float', 'integer', 'string'

...

no

...

'string'

...

The data type for the parameter.

...

allowBlank

...

boolean

...

no

...

true

...

Give the user the choice of an empty value in the listbox (as opposed to a null value).

...

value

...

any

...

no

...

The default value of the parameter (except multislider fields).

...

dataSet

...

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

...

no

...

Where to get the values for a listbox.

...

labelColumn

...

string

...

no

...

Column in the datadefinition that supplies the label of the value to show the user.

...

valueColumn

...

string

...

no

...

Column in the datadefinition that supplies the value of the value to use in the SQL.

...

scalarparametertype

...

string

...

no

...

'simple'

...

'simple' or 'multi-value' to determine of more than one value can be selected from a list.

...

width

...

integer

...

no

...

Set the width of the field.

...

minValue

...

number

...

yes - for slider and multislider

...

The minimum value allowed for a numeric field.

...

maxValue

...

number

...

yes - for slider and multislider

...

The maximum value allowed for a numeric field.

...

leftValue

...

number

...

no

...

 

...

The initial minimum value for a multislider.

...

rightValue

...

number

...

no

...

 

...

The initial maximum value for a multislider.

...

increment

...

number

...

no

...

The increment to use for fields that support it, the units are dependant upon the field type.

...

trueValue

...

any

...

no

...

The value that equates to "true" in the underlying table, only suitable for checkboxes.

...

falseValue

...

any

...

no

...

The value that equates to "false" in the underlying table, only suitable for checkboxes.

...

decimalPrecision

...

number

...

no

...

 

...

The precision of any numeric fields.

Sub-tags

...

Name

...

Type

...

Cardinality

...

list

...

urn:com.cohga.weave.dynamic.attributes#1.0:list

...

1..1 - only for radio and multicheck fields

list

Properties

...

Name

...

Type

...

Required

...

Description

...

value

...

string

...

yes

...

Value to be used in the filter

...

label

...

string

...

yes

...

Text to be displayed to the user to represent this filter

...

checked

...

string

...

no

...

Client

Once you have the filters configured and the various other configuration items setup to use the filters you need to add the filter panel to the client so that the user can modify the parameters for the filter(s).

There is no specific configuration that is available for the panel so you just need to include a label and location. The id for the panel is weave.userAttributes.

Code Block
breakoutModewide
languagexml
			<view id="weave.userAttributes" label="Data Filters">
				<location>east</location>
			</view>

Configuration

Namespace

urn:com.cohga.weave.dynamic.attributes#1.0

Tags

config

...

Properties

Name

Type

Required

Description

id

string

yes

Unique identifier for this filter.

label

string

yes

Text to be displayed to the user to represent this filter.

Sub-tags

Name

Type

Cardinality

parameter

urn:com.cohga.weave.dynamic.attributes#1.0:parameter

1..n

parameter

...

Properties

Name

Type

Required

Default

Description

id

string

yes

A unique identifier for the parameter.

label

string

yes

The prompt text displayed when user input the parameter value.

column

string

yes

The name of the column within the layer that this parameter references.

controlType

'text', '‘list', 'radio', ‘check', ‘multicheck’, 'silder’, 'multislider’

no

'text'

The UI control to use when displaying the parameter.

dataType

'boolean', 'float', 'integer', 'string'

no

'string'

The data type for the parameter.

allowBlank

boolean

no

true

Give the user the choice of an empty value in the listbox (as opposed to a null value).

value

any

no

The default value of the parameter (except multislider fields).

dataSet

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

no

Where to get the values for a listbox.

labelColumn

string

no

Column in the datadefinition that supplies the label of the value to show the user.

valueColumn

string

no

Column in the datadefinition that supplies the value of the value to use in the SQL.

scalarparametertype

string

no

'simple'

'simple' or 'multi-value' to determine of more than one value can be selected from a list.

width

integer

no

Set the width of the field.

minValue

number

yes - for slider and multislider

The minimum value allowed for a numeric field.

maxValue

number

yes - for slider and multislider

The maximum value allowed for a numeric field.

leftValue

number

no

 

The initial minimum value for a multislider.

rightValue

number

no

 

The initial maximum value for a multislider.

increment

number

no

The increment to use for fields that support it, the units are dependant upon the field type.

trueValue

any

no

The value that equates to "true" in the underlying table, only suitable for checkboxes.

falseValue

any

no

The value that equates to "false" in the underlying table, only suitable for checkboxes.

decimalPrecision

number

no

 

The precision of any numeric fields.

Sub-tags

Name

Type

Cardinality

list

urn:com.cohga.weave.dynamic.attributes#1.0:list

1..1 - only for radio and multicheck fields

list

...

Properties

Name

Type

Required

Description

value

string

yes

Value to be used in the filter

label

string

yes

Text to be displayed to the user to represent this filter

checked

string

no

Should this check box be initially checked. Only for list within multicheck field

Data Security

To ensure that data is not accidentally exposed because of an incorrectly configured filter if the value for a user property is missing then filtering will convert the generated filter into one that returns no results rather than just removing the filter and returning all results, e.g. a filter like where client_id = ${user.dynamic.client_id} will be replaced with something like where 1 = 0 if there is no dynamic value for the client_id.

Normally you would resolve this by providing a suitable default value for the client_id, e.g. where client_id = ${user.dynamic.client_id|9999999}, which would result in the same outcome in this example, but make it explicit what is happening and shows that the issue has been looked at. Alternatively, you can set a property that changes the handling of the filtering to remove the filter if the value is missing.

The property to set is weave.ignoreonsubstitutionerror and if it is set to true then the handling of missing values will be treated differently and will result in the filter being excluded and all results (subject to any other filtering) will be returned rather than no results. The value can be set as a system property or just adding the following to a config xml file:

Code Block
languagexml
<?set weave.ignoreonsubstitutionerror=true?>