M-Files / Samples.CustomExternalObjectTypeDataSources

Example implementations of M-Files External Object Type Data Sources.
https://developer.m-files.com/Built-In/External-Object-Type-Data-Source/Custom/
MIT License
2 stars 3 forks source link

Missing M-Files External Object Type Data Source (beta) Sample #4

Open Koushiq opened 1 year ago

Koushiq commented 1 year ago

The csproj provided in this repository does not matches the newer (M-Files External Object Type Data Source (beta) ) could you provide one sample which includes column mapping

CraigHawker commented 1 year ago

I agree that having a branch showing this would be good (the older version could be kept as a separate branch). For now: you can find an example in the "Twelve Days of Code" solution (the "import gists" project): https://github.com/M-Files/TwelveDaysOfCode

I lied. This approach uses another approach. This sample is currently missing. I can add it to our backlog.

Koushiq commented 1 year ago

please provide example with column mapping

CraigHawker commented 1 year ago

I'm not sure exactly what you're after, @Koushiq. You don't provide a column mapping in an external object type data source. Instead you expose the columns that the data source has, and the user then creates the column mapping when configuring the connection in their vault. This is because the configuration of each vault can differ drastically, so there's no way for your connector to know beforehand how it should be mapped.

To declare the available columns you should return them from DataSourceConnection.GetAvailableColumns, something like this:

    public partial class DataSourceConnection
    {
        public override List<ColumnDefinition> GetAvailableColumns()
        {
            var columns = new List<ColumnDefinition>();
            // TODO: add columns
            return columns;
        }
    }