To help the Visual Query Designer properly guide the user, there is an C# Attribute called VisualQuery to configure everything.
This is part of the new API for DataSources released in 2sxc 9.13.
How to use VisualQuery
Here's a simple example of the FormAndList DataSource:
Using the VisualQuery in FormAndList
GlobalName = "0a0924a5-ca2f-4db5-8fc7-1a21fdbb2fbb",
NiceName = "Dnn FormAndList",
Type = DataSourceType.Source,
ExpectsDataOfType = "d98db323-7c33-4f2a-b173-ef91c0875124",
HelpLink = "https://github.com/2sic/dnn-datasource-form-and-list/wiki")]
This example shows how the the FormAndList DataSource tells the UI things like:
- the global name
- that it's a source (and not a filter) - affecting the icon shown
- that it has a content-type which should be used for the UI to configure it
- the help-link in the UI
What you can Configure on VisualQuery
These are the things you can configure:
- string GlobalName - required this should be a unique id, ideally a GUID
important: old code use string names like a .net namespace. This should not be done any more and will be deprecated in the future
- DataSourceType Type - a type which basically controlls the icon shown in the designer. Supported values are
- string ExpectsDataOfType - if your datasource expects configuration, use this to tell the UI which content-type should be opened. Should be a GUID.
important: old code sometimes uses string-names. This will be deprecated in the future, so use GUIDs only
- string In - optional information if your source expects multiple in-sources (default is empty)
- string HelpLink - a url to a page giving the user help on this DataSource
- string NiceName - a nicer name to show in the UI instead of the GlobalName
For advanced details, read the wiki about the VisualQuery attribute.
Love from Switzerland,