Class PartiallyWritableDatabaseService
- java.lang.Object
-
- com.biomatters.geneious.publicapi.plugin.GeneiousService
-
- com.biomatters.geneious.publicapi.databaseservice.DatabaseService
-
- com.biomatters.geneious.publicapi.databaseservice.PartiallyWritableDatabaseService
-
public abstract class PartiallyWritableDatabaseService extends DatabaseService
A database service which allows partial editing of its contents (either the deleting or renaming or editing field values of some or all of its contents). Documents can be renamed by editing the field valueDocumentField.NAME_FIELD
usingeditDocumentField(com.biomatters.geneious.publicapi.documents.AnnotatedPluginDocument, com.biomatters.geneious.publicapi.documents.DocumentFieldAndValue)
- Since:
- API 4.14 (Geneious 5.1)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.biomatters.geneious.publicapi.databaseservice.DatabaseService
DatabaseService.SequenceSearchQueryType
-
Nested classes/interfaces inherited from class com.biomatters.geneious.publicapi.plugin.GeneiousService
GeneiousService.ServiceStatus
-
-
Field Summary
-
Fields inherited from class com.biomatters.geneious.publicapi.plugin.GeneiousService
SERVICE_TREE_LABEL_FAINTER_END, SERVICE_TREE_LABEL_FAINTER_START
-
-
Constructor Summary
Constructors Constructor Description PartiallyWritableDatabaseService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canDeleteDocuments(java.util.List<AnnotatedPluginDocument> documents)
Return true if it is possible to delete all the documents in the list.boolean
canEditDocumentField(AnnotatedPluginDocument document, DocumentField field)
Returns true if it is possible to edit the given document field for the given document.void
deleteDocuments(java.util.List<AnnotatedPluginDocument> documents)
Deletes documents in this database.void
editDocumentField(AnnotatedPluginDocument document, DocumentFieldAndValue newValue)
Edits a field value on a document.-
Methods inherited from class com.biomatters.geneious.publicapi.databaseservice.DatabaseService
addDatabaseServiceListener, addWeakDatabaseServiceListener, batchSequenceSearch, getDatabaseServiceListeners, getDocumentTypesForSequenceSearch, getExtendedSearchOptions, getSearchFields, getSequenceSearchOptions, getSequenceSearchPrograms, isBrowsable, isDocumentUnreadStatusEnabled, locateSummaryDocument, removeDatabaseServiceListener, resumeSearch, retrieve, retrieve, retrieve, retrieve, retrieve, retrieve, sequenceSearch, showAdvancedSearchByDefault
-
Methods inherited from class com.biomatters.geneious.publicapi.plugin.GeneiousService
_shutdown, addGeneiousServiceListener, addWeakGeneiousServiceListener, canShutdown, getActionsAlwaysEnabled, getActionsEnabledWhenServiceSelected, getChildServices, getDescription, getFullPath, getGeneiousServiceListener, getHelp, getIcons, getName, getNameForSorting, getParentService, getPreferences, getServiceTreeLabel, getStatus, getUniqueID, hasShutdownOrStartedShuttingDown, initialize, initializeService, isProOnly, removeGeneiousServiceListener, showInServiceTree, shutdown, toString
-
-
-
-
Method Detail
-
canDeleteDocuments
public boolean canDeleteDocuments(java.util.List<AnnotatedPluginDocument> documents)
Return true if it is possible to delete all the documents in the list. This method will be passed in a list of documents which are guaranteed to have come from one of the DatabaseServiceDatabaseService.retrieve(Query, jebl.util.ProgressListener)
methods.- Parameters:
documents
- a list of documents which are guaranteed to have come from one of the DatabaseServiceDatabaseService.retrieve(Query, jebl.util.ProgressListener)
methods.- Returns:
- true if it is possible to delete all the documents in the list passed in.
-
deleteDocuments
public void deleteDocuments(java.util.List<AnnotatedPluginDocument> documents) throws DatabaseServiceException
Deletes documents in this database. This method will be passed in a list of documents for deletion which are guaranteed to have come from one of the DatabaseServiceDatabaseService.retrieve(Query, jebl.util.ProgressListener)
methods.canDeleteDocuments(java.util.List)
will be called before the list is passed to this method.- Parameters:
documents
- a list of documents which are guaranteed to have come from one of the DatabaseServiceDatabaseService.retrieve(Query, jebl.util.ProgressListener)
methods.- Throws:
DatabaseServiceException
- if the documents cannot be deleted for some reason.
-
canEditDocumentField
public boolean canEditDocumentField(AnnotatedPluginDocument document, DocumentField field)
Returns true if it is possible to edit the given document field for the given document. This method will be passed in a document which is guaranteed to have come from one of the DatabaseServiceDatabaseService.retrieve(Query, jebl.util.ProgressListener)
methods.- Parameters:
document
- a document which is guaranteed to have come from one of the DatabaseServiceDatabaseService.retrieve(Query, jebl.util.ProgressListener)
methods.field
- The Document field to check- Returns:
- true if it is possible to edit the given document field for the given document.
-
editDocumentField
public void editDocumentField(AnnotatedPluginDocument document, DocumentFieldAndValue newValue) throws DatabaseServiceException
Edits a field value on a document. This method will be passed in a document which is guaranteed to have come from one of the DatabaseServiceDatabaseService.retrieve(Query, jebl.util.ProgressListener)
methods.canEditDocumentField(com.biomatters.geneious.publicapi.documents.AnnotatedPluginDocument, com.biomatters.geneious.publicapi.documents.DocumentField)
will be called before the documents are passed to this method.- Parameters:
document
- a document to edit which is guaranteed to have come from one of the DatabaseServiceDatabaseService.retrieve(Query, jebl.util.ProgressListener)
methods.newValue
- The new value to apply to the document- Throws:
DatabaseServiceException
- if it is not possible to edit the document for some reason
-
-