The Import Library is a re-usable framework for building import clients. Several are provided by the OMERO team directly:
The primary classes which make up the Import Library are:
Prior to OMERO 5.0, the import workflow was very much client-side. Using the ImportLibrary a client would determine the import candidates and then import the image. The import phase would comprise copying the pixel data to the OMERO data directory, writing the metadata into the database, and optionally copying the original file to the OMERO data directory for archiving.
From 5.0 the workflow has changed. The client still determines the import candidates but the client-side import process simply uploads the original files to the OMERO data directory and then uses the ManagedRepository service to initiate a server-side import. On the server the import is then completed by writing the metadata into the database. After import, pixel data is accessed directly from the original files using Bio-Formats. This means that data files are no longer duplicated and any nested directory structure is preserved. It also allows OMERO to take advantage of pre-generated pyramids available in some formats e.g. SVS.
For full details of the import workflow see FS Managed Repository.
The CommandLineImporter.java class shows a straightforward import. An ErrorHandler instance is passed both to the ImportCandidates constructor (since errors can occur while parsing a directory) and to the ImportLibrary. This and other handlers receive ImportEvents which notify listeners of the state of the current import.