Using ImporterResource

The ImporterResource contains functionality needed to import data of any type with different execution behavior based on the given data to import. The table below shows all possible combinations of the three import data values (filename(s), import descriptors, and importer) and how the ImportAgent::execute() method works based on the given import data.

Import Data
The Filename(s), Import Descriptors, and Importer columns indicate the import data that is either passed into the ImporterResource constructor or set by calling ImportAgent::setFilename(), ImportAgent::setFilenames(), ImportAgent::setDatasets(), and ImportAgent::setPlugIn().

Execution Mode
The Application Mode column indicates the operating mode of the application as determined by ApplicationServices::isBatch(). This is different than the batch mode parameter that is passed into the resource constructor. The constructor parameter is passed into the importer being executed and is not used internally by the resource or the agent.

Execution Behavior
The Resource Execution Behavior column describes what will happen when executing the resource based on the various combinations of data specified in the import data columns.

Execution Options
The Importer Subtype, Edit Type, and Update MRU File List columns pertain to optional settings that affect execution behavior. The text describes how the setting is used when the resource is executed.

Import Data Execution Mode Execution Behavior Execution Options
Filename(s) Import Descriptors Importer Application Mode Resource Execution Behavior Importer Subtype Edit Type Update MRU File List
      Interactive The import dialog is invoked for the user to select an importer, filename(s), and the imported data sets from the file(s). Used - Filters the available importers shown in the import dialog. Ignored - The user can invoke the import options dialog from the import dialog. Used
    X Interactive The import dialog is invoked for the user to select an importer, filename(s), and the imported data sets from the file(s). The importer set in the importer resource is used as the default selected importer in the dialog. Used - Filters the available importers shown in the import dialog. Ignored - The user can invoke the import options dialog from the import dialog. Used
X     Interactive The Auto Importer is used to import the default data sets in the file(s) obtained from Importer::getImportDescriptors(). Ignored Used Used
X   X Interactive The given importer is used to import the default data sets in the file(s) obtained from Importer::getImportDescriptors(). Ignored Used Used
X X   Interactive The resource fails to execute because specific import descriptors were set without an importer being set. Ignored Ignored Ignored
X X X Interactive The importer set in the importer resource is used to import the data sets represented by the import descriptors set in the importer resource. Ignored Used Used
      Batch The resource fails to execute because no filenames (either with or without specific import descriptors) were set. Ignored Ignored Ignored
    X Batch The resource fails to execute because no filenames (either with or without specific import descriptors) were set. Ignored Ignored Ignored
X     Batch The Auto Importer is used to import the default data sets in the file(s) obtained from Importer::getImportDescriptors(). Ignored Ignored Used
X   X Batch The given importer is used to import the default data sets in the file(s) obtained from Importer::getImportDescriptors(). Ignored Ignored Used
X X   Batch The resource fails to execute because specific import descriptors were set without an importer being set. Ignored Ignored Ignored
X X X Batch The importer set in the importer resource is used to import the data sets represented by the import descriptors set in the importer resource. Ignored Ignored Used


Software Development Kit - Opticks 4.9.0 Build 16218