This is an old revision of the document!
Table of Contents
structjoin Plugin
Compatible with DokuWiki
Greebo
This extension has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues.
Installation
External requirements: This plugin requires the following additional plugin that must be installed separately:
- the struct plugin
Search and install the plugin using the Extension Manager. Refer to Plugins on how to install plugins manually.
Description
This plugin allows you to perform joins over struct schemes. It has some limitations but still can be very useful in many use cases. Introduction of join to struct was discussed previously in #221, #269 and #285.
Usage
Introduction
The idea is simple. Lookup column in your schema allows you actually to join your schema with another one. The only limitation is that you can join only one column from it. This plugin introduces a new column type: “Join” that allows you to select other columns too. Let's have a look at example. Imagine that we have two schemes: “customer” and “product”. Customer schema has a following structure:
"columns": [ { "colref": 1, "ismulti": false, "isenabled": true, "sort": 10, "label": "name", "class": "Text", }, { "colref": 2, "ismulti": false, "isenabled": true, "sort": 20, "label": "address", "class": "Text" } ]
Now we want to create a product schema that has a product id, the name and the address of the customer that this product belongs to. We can do it using “Join” column type:
"columns": [ { "colref": 1, "ismulti": false, "isenabled": true, "sort": 10, "label": "Id", "class": "Text", }, { "colref": 2, "ismulti": false, "isenabled": true, "sort": 20, "label": "Customer", "class": "Lookup", "config": { "schema": "customer", "field": "name" } }, { "colref": 3, "ismulti": false, "isenabled": true, "sort": 30, "label": "Customer_address", "class": "Join", "config": { "schema": "customer", "field": "address" } } ]
Join column type is not editable and it's only make sense