Table of Contents

Class GitlabRepositoryApiConnector

Namespace
MES.MQC.DataSourceLibrary.Adapters.Apis
Assembly
MES.MQC.DataSourceLibrary.dll
public class GitlabRepositoryApiConnector : GitlabApiConnector, IFormProvider
Inheritance
GitlabRepositoryApiConnector
Implements
Inherited Members

Properties

Description

Description of the Adapter that is visible in the Adapter Dialog as a popover. If the adapter is an API Connector, the description is also shown in the Add/Edit DataSource dialog, when the API Connector is selected. Absolute links get transformed into HTML Link Tags, line breaks (\n) get transformed into HTML line breaks (<br>), HTML tags are not allowed.

public override string Description { get; }

Property Value

string

Name

Unique Name of the Adapter. Defaults to the ClassName (without Adapter / FileReader / ApiConnector suffix), can be overridden with a user defined Name.

public override string Name { get; }

Property Value

string

Methods

CheckAvailable(ApiConnectorContext)

CheckAvailable must be implemented by the Api Adapter class. This method is called to show a warning for configured but unavailable data sources in the UI.

public override bool CheckAvailable(ApiConnectorContext context)

Parameters

context ApiConnectorContext

ApiConnectorContext

Returns

bool

boolean (is the api available/accessible)

CheckModified(ApiConnectorContext)

CheckModified must be implemented by the Api Adapter class. This method is called by the local and server side monitoring, to check if the data sources should be updated.

public override bool CheckModified(ApiConnectorContext context)

Parameters

context ApiConnectorContext

ApiConnectorContext

Returns

bool

boolean (are there any changes)

Download(ApiConnectorContext)

Download can be implemented by the Api Adapter class. At least one of Download and Read must be implemented. The implementation of this method should access the configured API, download and save files to the context.DownloadPath directory and return a AdapterDownloadResult.

protected override AdapterDownloadResult Download(ApiConnectorContext context)

Parameters

context ApiConnectorContext

ApiConnectorContext

Returns

AdapterDownloadResult

AdapterDownloadResult

PreviewForm(IForm, string, out int)

PreviewForm can be implemented by an API Connector. It is used to load the Preview, if one was defined in the AdapterConfiguration. Based on the focused form field, the Preview is shown in the Dialog and provides the ability to load by clicking on a button. This button click calls this method. Based on the configuration and the preview type, the api should load the relevant data, limited to ~100 for better performance, and a array of FormPreview should be returned.

public override FormPreview[] PreviewForm(IForm form, string preview, out int totalCount)

Parameters

form IForm

IForm, the AdapterConfiguration

preview string

The preview type (string)

totalCount int

Output of totalCount, if 0 shown as ? in the preview dialog

Returns

FormPreview[]

Array of FormPreview, to show Title and optionally Description and DateTime