Getting at the "GenbankSequenceDocument" class
I'm writing a plugin where it behooves me to extend the "GenbankSequenceDocument" class, however, I'm having significant trouble figuring out how to import this class into my project.
I am using the "Geneious Files" module as a depdendency for my plugin and that gives me access to most of what I need, but there are several files inside "com.biomatters.plugins.NCBI" that I have no access to.
I have tried adding the NCBI jar as a depdency, and while that allows me to use the class in my IDE, upon starting I get errors as the genbank class expects certain resource files to be in other locations relative to it, and it can't find those when just the JAR is included.
Has anyone figured out how to import this?
-
Unfortunately GenbankSequenceDocument is part of the NCBI plugin and is not part of the Geneious public API so you are unable to extend it from your own plugin. We've designed the Geneious plugin system so that plugins may not directly depend on each other which means different plugins can be developed and changed without worrying about the effect that changes may have on other plugins.
I suggest you extend DefaultSequenceDocument instead or preferably just use DefaultSequenceDocument without extending it if possible. If you can you explain why you think it is best for your plugin to extend GenbankSequenceDocument I may be able to suggest an alternative solution.
Best regards,
Matt.0 -
Hi Matt,
Essentially, the input for what I'm developing is going to be genbank files, I want all the fields, the viewer, and all the tools that work on genbank files I would like to work on these files. I just want to add a few additional fields and functionality on top of what genbank already has.
I could certainly extend DefaultSequenceDocument, but then I'd have to write my own viewer from the ground up, including the "text" display for the flatfile information. It just seems redundant when an existing class have 90% of what I want to use, and no "conflicting" functionality.
I can understand your desire for "plugin encapsulation", but certainly basic genbank support is pretty ubiquitous. I don't really need the "functionality" of the class, just its implementations of the "PluginDocument" interface like "toHtml(), getDisplayableFields" and so on, and the "class definition" so that anything that accepts GenbankSequenceDocument will also accept my class.
0 -
One option would be to create a GenbankSequenceDocument by importing from a genbank format file using PluginUtilities.importDocuments and then set your own custom fields on it using setFieldValue. You could make your own viewer only show up on documents that have your custom fields.
Alternatively you could create your own class that extends DefaultSequeceDocument that delegates functionality to the GenbankSequenceDocument returned from PluginUtilities.importDocuments.
Would either of those solutions work for you? If not can you explain a bit more about the additional functionality you require and I might be able to suggest something else.
Best regards,
Matt.
0
Please sign in to leave a comment.
Comments
3 comments