How to suppress version number suffix in document name
Related to my previous post, if I import the same nucleotide sequence or AB1 file twice. The last one gets a version number suffix attached to the name. This is unconsidered undesriable by the users, but I don't know how to suppress this behaviour. If have tried AnnotatedPluginDocument.setFieldValue(DocumentField.NAME_FIELD, "XXX"), plus saving the document again. But that didn't work.
-
To be more precise: actually with AB1 files I do NOT get this unwanted suffix, presumably because I use List<AnnotatedPluginDocument> apds = PluginUtilities.importDocuments(f, null); to import the documents.
But when importing fasta document I do get the suffix, presumably because I do the importing "myself":
sequence = new DefaultNucleotideSequence(fasta.getHeader(), null, fasta.getSequence(), date);
apd = createAnnotatedPluginDocument(sequence);
++imported;0 -
Try the following instead of setFieldValue() and let me know if it works:
AnnotatedPluginDocument.setName("XXX");
0 -
Hi Richard,
I did already, but it didn't. However, what does work is:
DocumentUtilities.addGenerated documents in stead of returning the document from the performOperation method of DocumentOperation.
To the point where I now simply always return null in performOperation and call DocumentUtilities.addGenerated. This will also make the documents appear in the Swing UIand not add the suffix
0
Please sign in to leave a comment.
Comments
3 comments