Class DocumentFileImporter.ImportCallback
- java.lang.Object
-
- com.biomatters.geneious.publicapi.plugin.DocumentFileImporter.ImportCallback
-
- Enclosing class:
- DocumentFileImporter
public abstract static class DocumentFileImporter.ImportCallback extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description ImportCallback()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract AnnotatedPluginDocument
addDocument(AnnotatedPluginDocument annotatedDocument)
Report back one imported AnnotatedPluginDocument.AnnotatedPluginDocument
addDocument(AnnotatedPluginDocument annotatedDocument, jebl.util.ProgressListener progress)
Report back one imported AnnotatedPluginDocument.AnnotatedPluginDocument
addDocument(AnnotatedPluginDocument annotatedDocument, jebl.util.ProgressListener progress, java.lang.String subFolderPath)
Report back one imported AnnotatedPluginDocument.abstract AnnotatedPluginDocument
addDocument(PluginDocument document)
Report back one imported PluginDocument.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.ImportUtilities.ImportSource
getImportSource()
Returns where this import came from in the GUI.
-
-
-
Method Detail
-
addDocument
public abstract AnnotatedPluginDocument addDocument(PluginDocument document)
Report back one imported PluginDocument.- Parameters:
document
- imported document- Returns:
- An annotated document containing doc as it was entered to 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 abstract AnnotatedPluginDocument addDocument(AnnotatedPluginDocument annotatedDocument)
Report back one imported AnnotatedPluginDocument. Used as an alternative toaddDocument(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)
Report back one imported AnnotatedPluginDocument. Used as an alternative toaddDocument(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 callsaddDocument(com.biomatters.geneious.publicapi.documents.AnnotatedPluginDocument)
.- Parameters:
annotatedDocument
- imported documentprogress
- 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 aCompositeProgressListener
to split the progress into sections for reading the file, and then calling this callback method.- 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
-
addDocument
public AnnotatedPluginDocument addDocument(AnnotatedPluginDocument annotatedDocument, jebl.util.ProgressListener progress, java.lang.String subFolderPath)
Report back one imported AnnotatedPluginDocument. Used as an alternative toaddDocument(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 callsaddDocument(com.biomatters.geneious.publicapi.documents.AnnotatedPluginDocument)
.- Parameters:
annotatedDocument
- imported documentprogress
- 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 aCompositeProgressListener
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 byFile.separator
in the String. If the string begins with aFile.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 toaddDocument(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)
-
getImportSource
public ImportUtilities.ImportSource getImportSource()
Returns where this import came from in the GUI. For example, if a user imports via the "Import Primers" menu item, then this will returnImportUtilities.ImportSource.PRIMERS
- Returns:
- where this import is coming from within the UI, this should never be null.
Default implementations return
ImportUtilities.ImportSource.DEFAULT
- Since:
- API 4.202210 (Geneious 2022.1.0)
-
-