Skip to content

DataLoaderPlugin

This interface defines the methods of a data loader:

interface DataLoaderPlugin {
static isMatch(context: FileContext): boolean;
canSave?: boolean;
init?(context: FileContext): void;
readFiles?(): void;
getResult(): Dataset;
optionsView?(): string;
entitiesView?(): string;
}

See the data loader plugin page for an example.

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.

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

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

Parameters

  • context: FileContext an object implementing the FileContext interface.

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

This method returns the final dataset for upload.

Returns

Final dataset.

Returns

An HTML view for the options of a data loader.

Returns

An HTML view for the resulting entities.