Class DocumentFileImporter.ImportCallback

  • Enclosing class:
    DocumentFileImporter

    public abstract static class DocumentFileImporter.ImportCallback
    extends java.lang.Object
    • Constructor Detail

      • ImportCallback

        public ImportCallback()
    • Method Detail

      • addDocument

        public abstract AnnotatedPluginDocument addDocument​(AnnotatedPluginDocument annotatedDocument)
        Report back one imported AnnotatedPluginDocument. Used as an alternative to addDocument(com.biomatters.geneious.publicapi.documents.PluginDocument) for importers that generate AnnotatedPluginDocuments instead. It is better to use addDocument(PluginDocument doc) when possible since it reduces overhead in some cases. In the implementation of this method used by Geneious to import documents, if the document passed in is already present in the database, it will not be added again, but it will be selected along with any imported documents.
        Parameters:
        annotatedDocument - imported document
        Returns:
        the document if it was entered in the database or was already in the database. null if document was not inserted to the database and is not already present or potentially null if DocumentFileImporter.supportsAddingDocumentsInBackgroundThread() returns true
      • addDocument

        public AnnotatedPluginDocument addDocument​(AnnotatedPluginDocument annotatedDocument,
                                                   jebl.util.ProgressListener progress,
                                                   java.lang.String subFolderPath)
        Report back one imported AnnotatedPluginDocument. Used as an alternative to addDocument(com.biomatters.geneious.publicapi.documents.AnnotatedPluginDocument) for importers that want to want to receive progress on how the callback has handled the document. For example, in most situations the given document is saved to the user's local database during the callback, which may take some time on huge documents.

        The default implementation just ignores the progress listener and subFolderPath and calls addDocument(com.biomatters.geneious.publicapi.documents.AnnotatedPluginDocument).

        Parameters:
        annotatedDocument - imported document
        progress - a progress listener to receive progress updates on how the document has been handled. This should not be the progressListener passed to the imported. Instead the importer should construct a CompositeProgressListener to split the progress into sections for reading the file, and then calling this callback method.
        subFolderPath - a path relative to the import target folder which the document should be added to. If null or empty string, the document will be placed in the target folder. If a non-empty string is specified then the document will be placed in a subfolder with the this String as the name. To create nested subfolders sepearate the folders by File.separator in the String. If the string begins with a File.separator then the path will be relative to the root "Local" folder. The program will create any folders if they don't already exist. FileUtilities.isFileNameAllowed(String) must return true for any folder names used.
        Returns:
        the document as it was entered in the database. null if document was not inserted to the database or potentially null if DocumentFileImporter.supportsAddingDocumentsInBackgroundThread() returns true
        See Also:
        FileUtilities.getLegalFileName(String, String)
      • addNucleotideSequenceNameOnFirstPass

        public boolean addNucleotideSequenceNameOnFirstPass​(java.lang.String sequenceName)
        To improve import performance on nextgen sized sequence lists, an importer may optionally make a first pass of the nucleotide sequences and call this method with each sequence name during the first pass. If it does, then the nucleotide sequences passed later to addDocument(com.biomatters.geneious.publicapi.documents.PluginDocument) must use the same names.
        Parameters:
        sequenceName - the name of a nucleotide sequence
        Returns:
        true if there is any point in making later calls to this method. For example if Geneious can't find a pattern in the names provided it will return false and the importer could abort the first pass.
        Since:
        API 4.40 (Geneious 5.4.0)