Post

2 followers Follow
0
Avatar

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.

Informatiemanagement

Please sign in to leave a comment.

3 comments

0
Avatar

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;

Informatiemanagement 0 votes
Comment actions Permalink
0
Avatar

Try the following instead of setFieldValue() and let me know if it works:

AnnotatedPluginDocument.setName("XXX");
Richard Moir 0 votes
Comment actions Permalink
0
Avatar

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

 

Informatiemanagement 0 votes
Comment actions Permalink