Developer / Reference / TypeScript APIs / Interfaces / Plugins

DataLoaderPlugin

Last updated on 13-May-2020 by Jakob Jakobsen Boysen
Jakob Jakobsen Boysen

Platform Lead
boysen@scifeon.com

This interface defines the methods of a data loader:

Example

See the data loader plugin page for an example.

API

isMatch(context:

FileContext): boolean

This method implements logic for deciding whether this data loader matches the uploaded file(s) or not.

Parameters

  • context: FileContext an object implementing the FileContext interface.

Returns

True if the data loader should be used.

canSave: boolean

Set this to control whether the "Upload" or "OK" button should be enabled. If not set at all, the buttons are always enabled.

init(context:

FileContext): void

This method is used for initialization of the plugin in the given context.

Parameters

  • context: FileContext an object implementing the FileContext interface.

readFiles(): void

This method is called initially, but after init(). Use this e.g. for reading the files, to update the options view.

getResult():

Dataset

This method returns the final dataset for upload.

Returns

Final dataset.

optionsView(): string

Returns

An HTML view for the options of a data loader.

entitiesView(): string

Returns

An HTML view for the resulting entities.