DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:struct:aggregation

This is an old revision of the document!


Struct Plugin: Aggregation

Aggregation of structured data is the main purpose of the plugin. Aggregation is done through a simple syntax which will result in a dynamic table listing all pages and associated data matching certain criteria.

The basic syntax looks like this:

---- struct table ----
schema: schema_name
cols: %pageid%, other, cols
----

The aggregation-syntax is very similar to that the data plugin. The main difference is, that you have to specify a schema name (or more than one). :!:

Also note that the width option no longer exists.

The keyword before the colon is a configuration option and the value behind is the actual setting. To make it more fault tolerant often multiple option names are possible. Here is a list of all available options:

Option(s) Required? Description
schema
from
yes These are the schemas from which you want to display the data.
cols
select
yes These are the attributes you want to display. These are the same names you used in the Data Entry part
head
header
headers
no If specified, these names will be used in the table headers instead of the column names
max
limit
no How many rows should be displayed. If more rows are available the table will be made browsable. If not given all matching rows are shown
sort
order
no By what column should the table be sorted initially? Prepend a ^ to reverse the sorting
filter
where
filterand
and
no Filter by a column value. You may specify this more than once, multiple filters will be ANDed.
filteror
or
no Like filter, but multiple instances will be ORed
dynfilters no Set to 1 to enable a row of input fields for dynamically filtering the table
summarize no Set to 1 to calculate sum of columns
align no List of column alignments. The alignments can be left (l), center (c) or right (r)
rownumbers no Set to 1 to show row numbers

When selecting data from multiple schemas wich contain the same field names, you have to prefix them with the schema name:

---- struct table ----
schemas: schema1, schema2
cols: %pageid%, schema1.name, schema2.name
----

You can use aliases to reference schemas to type less. Aliases are separated by a space from the schema name:

---- struct table ----
schemas: schema1 A, schema2 B
cols: %pageid%, A.name, B.name
----

Please see filters to learn more about filtering.

plugin/struct/aggregation.1459435319.txt.gz · Last modified: 2016-03-31 16:41 by andi

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki