Canvas has a built-in DataBase tool-chain, DataSource's are mechanisms to query the tables/collections in the DataBase and get results.
DataSources are a definition of how the Data Should be filtered.
These can be static, where the DataSource always returns the same data
Or Dynamic, where the DataSource returns different Data Items based on some dynamic value.
And can return a Single item or Many Items as a List.
To Add a
DataSource access the Canvas Menu & Select DataSources. This will list the existing DataSources, which initially will be empty. Click the Add in the top right of the screen.
Click Save & Add Matchers, this will create the DataSource and render the Editing options for the DataSource.
Editing a DataSource
By Default a DataSource will get all items from the DataBase, for
LIST or the the first natural result for
SINGLE matching. The Edit screen for an individual DataSource allows you to define the matching and ordering or the given DataSource.
A Data Source can have 1 or more matchers.
An individual Matcher allows you to define the equitant to a SQL
WHERE clause for a given Column/Property, using the built-in the Canvas DataItems & DataServers properties.
For each Column/Property you wish to Filter on, an individual Matcher is Required.
For Example, To Filter on both Properties
TYPE, then 2 Matchers would be required.
DataSource Matcher Types
STATIC The DataSource doesn't require a Dynamic value for filtering, instead a static value is used.
URL Use a value contained within the URL to Filter the DataSource, or any "param", such as a value from the
QueryString or a
POSTed value from a
form, will be used as the value to match against.
DataItem(s)Ref From DataItemsRef or DataItemRef of another DataSource. Where a page already contains a DataSource another DataSource can be included that will use the result of this Data Source to in the matching.
A prime example of this use is where a
WebPage which has a
oCatRef property of type
DataItemRef that contains the
Cat associated with the
WebPage. You'll normally create a a DataSource that matches out the
WebPage and then this is used in another DataSource to gather the
Cat. Allowing for selection of properties from both the
WebPage and the
DESIGN MODE for the Section
RelatedTo T Reverse DataItem(s)Ref of another DataSource.