public static class WritableDatabaseService.DummyService extends WritableDatabaseService
WritableDatabaseService.DummyService, WritableDatabaseService.SearchResultPropertiesAdjusterDatabaseService.SequenceSearchQueryTypeGeneiousService.ServiceStatusKEY_SEARCH_SUBFOLDERS, KEY_SEARCH_TYPE| Constructor and Description |
|---|
WritableDatabaseService.DummyService(String name,
String rootUniqueId,
Icons icons)
Construct a new dummy service that provides no functionality apart from a name and icons
|
| Modifier and Type | Method and Description |
|---|---|
protected AnnotatedPluginDocument |
_addDocumentCopy(AnnotatedPluginDocument annotatedDocument,
ProgressListener progress)
Implementaion method for
WritableDatabaseService.addDocumentCopy(com.biomatters.geneious.publicapi.documents.AnnotatedPluginDocument, jebl.util.ProgressListener)
that subclasses should implement. |
protected AnnotatedPluginDocument |
_addReferencedOnlyDocumentCopy(AnnotatedPluginDocument annotatedDocument,
ProgressListener progress)
This method is only called from the helper method
WritableDatabaseService.duplicateDocumentAndDealWithReferencedDocuments(com.biomatters.geneious.publicapi.documents.AnnotatedPluginDocument, com.biomatters.geneious.publicapi.documents.ElementProvider, java.util.concurrent.atomic.AtomicReference, com.biomatters.geneious.publicapi.documents.URN). |
protected String |
_getHelp()
Sub-classes should override this to provide help as defined by
GeneiousService.getHelp()
Ths results of this method are combined with any
additional help provided to WritableDatabaseService.addAdditionalHelp(String)
to create the results for WritableDatabaseService.getHelp(). |
protected WritableDatabaseService |
_getHiddenFolder(String folderName,
boolean isPerUserFolder)
The implementation method for
WritableDatabaseService.getHiddenFolder(String, boolean) |
protected Icons |
_getIcons()
Sub-classes should override this to provide icons as defined by
GeneiousService.getIcons(). |
protected boolean |
_moveDocument(AnnotatedPluginDocument document,
ProgressListener progress)
Implementation method for
WritableDatabaseService.moveDocument(com.biomatters.geneious.publicapi.documents.AnnotatedPluginDocument, jebl.util.ProgressListener)
that subclasses should implement. |
protected void |
_removeDocument(AnnotatedPluginDocument document,
ProgressListener progress)
Implementation method for
WritableDatabaseService.removeDocument(com.biomatters.geneious.publicapi.documents.AnnotatedPluginDocument, jebl.util.ProgressListener)
that subclasses should implement. |
protected void |
_retrieve(Query query,
RetrieveCallback callback,
URN[] urnsToNotRetrieve)
Implementaion method for
WritableDatabaseService.retrieve(com.biomatters.geneious.publicapi.databaseservice.Query, com.biomatters.geneious.publicapi.databaseservice.RetrieveCallback, com.biomatters.geneious.publicapi.documents.URN[])
that subclasses should implement. |
protected void |
_retrieve(URN[] urnsToRetrieve,
RetrieveCallback callback)
Implementaion method for
WritableDatabaseService.retrieve(com.biomatters.geneious.publicapi.documents.URN[], com.biomatters.geneious.publicapi.databaseservice.RetrieveCallback)
that subclasses should implement. |
String |
addHiddenElement(org.jdom.Element newElement,
ProgressListener progress)
Adds a new hidden element to this database and generates a new unique name
which is returned.
|
void |
addHiddenElement(String name,
org.jdom.Element newElement,
ProgressListener progress)
adds a new hidden element to this database using the given name.
|
boolean |
canMoveTo(WritableDatabaseService destination)
Can this entire database folder be moved to this new location?
The default implementation always returns false.
|
boolean |
containsDocumentAnywhereWithinDatabase(URN documentURN)
Determine if this database (including any other folders and any user invisible
folders) contains a document with this URN
This method should return the same information no matter where in the
DatabaseService tree it is called.
|
WritableDatabaseService |
createChildFolder(String name)
Creates a child DatabaseService.
|
String |
getDescription()
This gives the human-readable short description of the service as it might appear in
any user-interface.
|
int |
getDocumentCount(boolean includeSubFolders)
Get the number of documents in this folder
|
WritableDatabaseService |
getDocumentLocation(URN documentURN)
If this database contains this document in any user visible folder returns
the WritableDatabaseService representing the folder that contains it.
|
String |
getFolderName()
Get the name of this DatabaseService folder displayed to the user.
|
org.jdom.Element |
getHiddenElement(String elementName,
ProgressListener progress)
get(load) a special hidden element
|
String[] |
getHiddenElementNames()
lists the hidden elements stored in this database.
|
String[] |
getHiddenFolderNames()
Get a list of hidden folders that can be used as parameters to the getHiddenFolder() method.
|
String |
getName()
This gives the human-readable name of the service as it might appear in
any user-interface.
|
protected String |
getRootUniqueId()
Get the unique ID for the root folder of this database.
|
QueryField[] |
getSearchFields()
Gives the set of fields that can be used for searching this repository/database.
|
String |
getServiceTreeLabel(boolean expanded,
boolean showAdditionalInformation)
Provide additional details for a human user.
|
void |
moveTo(WritableDatabaseService destination)
Move this entire database folder to a new location.
|
void |
removeChildFolder(String folderName)
Removes a child folder with this folder name.
|
void |
removeHiddenElement(String name)
removes a hidden element.
|
void |
renameFolder(String newName)
Rename this folder.
|
boolean |
saveDocument(AnnotatedPluginDocument document,
boolean onlyAnnotatedDocumentHasChanged,
ProgressListener progress)
A document that is already in this database has been modified in memory and should now be saved to permanent storage.
|
String |
toString() |
void |
updateHiddenElement(String name,
org.jdom.Element newElement,
ProgressListener progress)
updates the contents of a hidden element.
|
_addDocumentCopyWithProperties, _addDocumentCopyWithProperties, _canRemoveChildFolder, _getActionsEnabledWhenServiceSelected, _getExtendedSearchOptions, _getFolderViewDocument, _retrieve, addAdditionalAction, addAdditionalHelp, addDatabaseServiceListener, addDocumentCopy, addDocumentCopyWithProperties, addDocumentCopyWithProperties, addOverlayIcons, addSearchResultPropertiesAdjuster, allowChangingFolderProperties, canRemoveChildFolder, createFolderViewFolder, createUrnForDocumentSoonToBeAdded, duplicateDocumentAndDealWithReferencedDocuments, duplicateDocumentAndDealWithReferencedDocuments, getActionsEnabledWhenServiceSelected, getAdditionalPerDocumentXml, getAdditionalPerDocumentXml, getAdditionalPerDocumentXmlKeys, getAssignerForCreatingUrn, getChildService, getColor, getDatabaseRoot, getDatabaseServiceListeners, getDocument, getExtendedSearchOptions, getFolderViewDocument, getHelp, getHiddenFolder, getIcons, getLock, getPrimaryDatabaseRoot, getUniqueID, initialize, isDeleted, isLocal, isReadOnly, moveDocument, removeAdditionalAction, removeAdditionalHelp, removeChildFolder, removeDatabaseServiceListener, removeDocument, removeOverlayIcons, removeSearchResultPropertiesAdjuster, retrieve, retrieve, retrieve, saveAdditionalPerDocumentXml, saveAdditionalPerDocumentXml, setAllowChangingFolderProperties, setColor, setFolderViewDocument, waitForSearchIndexingToCompleteaddWeakDatabaseServiceListener, batchSequenceSearch, getDocumentTypesForSequenceSearch, getSequenceSearchOptions, getSequenceSearchPrograms, isBrowsable, locateSummaryDocument, resumeSearch, retrieve, retrieve, retrieve, sequenceSearch_shutdown, addGeneiousServiceListener, addWeakGeneiousServiceListener, canShutdown, getActionsAlwaysEnabled, getChildServices, getFullPath, getGeneiousServiceListener, getParentService, getPreferences, getStatus, hasShutdownOrStartedShuttingDown, initializeService, isProOnly, removeGeneiousServiceListener, showInServiceTree, shutdownpublic WritableDatabaseService.DummyService(String name, String rootUniqueId, Icons icons)
name - the name returned from getName()rootUniqueId - the id returned from getRootUniqueId()icons - the icons returned from _getIcons()public String getName()
GeneiousServicegetName in class GeneiousServicepublic String getServiceTreeLabel(boolean expanded, boolean showAdditionalInformation)
GeneiousServicegetServiceTreeLabel in class GeneiousServiceexpanded - if the service's children are visible in the tree.showAdditionalInformation - if true, then optionally add extra information,
such as the number of documents contained within the servicepublic String getDescription()
GeneiousServicegetDescription in class GeneiousServiceprotected AnnotatedPluginDocument _addDocumentCopy(AnnotatedPluginDocument annotatedDocument, ProgressListener progress) throws DatabaseServiceException
WritableDatabaseServiceWritableDatabaseService.addDocumentCopy(com.biomatters.geneious.publicapi.documents.AnnotatedPluginDocument, jebl.util.ProgressListener)
that subclasses should implement.
The implementation must create a copy of the given annotatedDocument that has a different URN from the given annotatedDocument.
This could be done like this:
Element annotatedDocumentXML= annotatedDocument.toXMLExcludingInternalPluginDocument();
AnnotatedPluginDocument annotatedDocumentCopy= DocumentUtilities.createAnnotatedPluginDocument(annotatedDocumentXML,pluginDocumentElementProvider,true);
but that doesn't deal with the complexities of referenced documents. Instead,
the helper method WritableDatabaseService.duplicateDocumentAndDealWithReferencedDocuments(com.biomatters.geneious.publicapi.documents.AnnotatedPluginDocument, com.biomatters.geneious.publicapi.documents.ElementProvider, java.util.concurrent.atomic.AtomicReference, com.biomatters.geneious.publicapi.documents.URN)
should be used._addDocumentCopy in class WritableDatabaseServiceDatabaseServiceExceptionprotected AnnotatedPluginDocument _addReferencedOnlyDocumentCopy(AnnotatedPluginDocument annotatedDocument, ProgressListener progress) throws DatabaseServiceException
WritableDatabaseServiceWritableDatabaseService.duplicateDocumentAndDealWithReferencedDocuments(com.biomatters.geneious.publicapi.documents.AnnotatedPluginDocument, com.biomatters.geneious.publicapi.documents.ElementProvider, java.util.concurrent.atomic.AtomicReference, com.biomatters.geneious.publicapi.documents.URN).
It should add copy of the given document to an invisible folder independent area of the database. Implementations can do
mostly the same as they do for WritableDatabaseService._addDocumentCopy(com.biomatters.geneious.publicapi.documents.AnnotatedPluginDocument, jebl.util.ProgressListener)
except the document is added to an invisible folder independent area of the database rather than a standard folder.
Note: Any implementation must also call WritableDatabaseService.copyAdditionalXmlToNewDocument(com.biomatters.geneious.publicapi.documents.AnnotatedPluginDocument, com.biomatters.geneious.publicapi.documents.AnnotatedPluginDocument).
An easy way to ensure this is to call WritableDatabaseService.addDocumentCopy(com.biomatters.geneious.publicapi.documents.AnnotatedPluginDocument, jebl.util.ProgressListener) or
WritableDatabaseService.addDocumentCopyWithProperties(com.biomatters.geneious.publicapi.documents.AnnotatedPluginDocument, jebl.util.ProgressListener, java.util.Map)
because they will call WritableDatabaseService.copyAdditionalXmlToNewDocument(com.biomatters.geneious.publicapi.documents.AnnotatedPluginDocument, com.biomatters.geneious.publicapi.documents.AnnotatedPluginDocument)
as part of their implementation._addReferencedOnlyDocumentCopy in class WritableDatabaseServiceannotatedDocument - the document to copied and addedprogress - reports progressDatabaseServiceExceptionprotected void _removeDocument(AnnotatedPluginDocument document, ProgressListener progress) throws DatabaseServiceException
WritableDatabaseServiceWritableDatabaseService.removeDocument(com.biomatters.geneious.publicapi.documents.AnnotatedPluginDocument, jebl.util.ProgressListener)
that subclasses should implement.
The implementation must ensure that it deals with referenced documents correctly.
(see WritableDatabaseService.duplicateDocumentAndDealWithReferencedDocuments(com.biomatters.geneious.publicapi.documents.AnnotatedPluginDocument, com.biomatters.geneious.publicapi.documents.ElementProvider, java.util.concurrent.atomic.AtomicReference, com.biomatters.geneious.publicapi.documents.URN)).
WritableDatabaseService.moveDocument(com.biomatters.geneious.publicapi.documents.AnnotatedPluginDocument, jebl.util.ProgressListener)setDatabase(null) called on
them before returning from this method. Documents moved to the hidden referenced only documents must have their database set to the root database.
_removeDocument in class WritableDatabaseServiceDatabaseServiceExceptionprotected boolean _moveDocument(AnnotatedPluginDocument document, ProgressListener progress) throws DatabaseServiceException
WritableDatabaseServiceWritableDatabaseService.moveDocument(com.biomatters.geneious.publicapi.documents.AnnotatedPluginDocument, jebl.util.ProgressListener)
that subclasses should implement._moveDocument in class WritableDatabaseServiceDatabaseServiceExceptionpublic boolean saveDocument(AnnotatedPluginDocument document, boolean onlyAnnotatedDocumentHasChanged, ProgressListener progress) throws DatabaseServiceException
WritableDatabaseServiceAnnotatedPluginDocument.save() and AnnotatedPluginDocument.saveDocument().saveDocument in class WritableDatabaseServicedocument - the document that has changed. This is the same AnnotatedPluginDocument instance returned from
either WritableDatabaseService.addDocumentCopy(com.biomatters.geneious.publicapi.documents.AnnotatedPluginDocument, jebl.util.ProgressListener)
or WritableDatabaseService.getDocument(com.biomatters.geneious.publicapi.documents.URN)
or one of the retrieve methods via RetrieveCallback.add(com.biomatters.geneious.publicapi.documents.AnnotatedPluginDocument, java.util.Map).onlyAnnotatedDocumentHasChanged - Sometimes only the AnnotatedPluginDocument rather than the internal PluginDocument has changed. In this
case this parameter is true and the database can perform more efficient storage if it stores the AnnotatedPluginDocument separately from the PluginDocument.
If this parameter is false, both the AnnotatedPluginDocument and the internal PluginDocument should be saved.progress - to report progress if saving the document takes time. The progress listener may also request the save be
cancelled. In this case the DatabaseService should either revert the stored version of the document to its previous state and return false or continue
with saving and return true, whichever is faster. It is not acceptable to leave the stored document in a partially saved state when cancelling.DatabaseServiceException - if the document cannot be saved for any reason.public WritableDatabaseService createChildFolder(String name) throws DatabaseServiceException
WritableDatabaseServicegetChildService(name)
already exists, then this method returns it.createChildFolder in class WritableDatabaseServicename - the name of the child DatabaseService to createDatabaseServiceException - if the folder can't be created.public boolean canMoveTo(WritableDatabaseService destination)
WritableDatabaseServicecanMoveTo in class WritableDatabaseServicedestination - the destination to put this folder inside.WritableDatabaseService.moveTo(WritableDatabaseService)public void moveTo(WritableDatabaseService destination) throws DatabaseServiceException
WritableDatabaseServicedestination.getChildService(folderName).moveTo in class WritableDatabaseServicedestination - the destination to put this folder inside.DatabaseServiceExceptionWritableDatabaseService.canMoveTo(WritableDatabaseService)public boolean containsDocumentAnywhereWithinDatabase(URN documentURN) throws DatabaseServiceException
WritableDatabaseServicecontainsDocumentAnywhereWithinDatabase in class WritableDatabaseServicedocumentURN - the URN of the documentDatabaseServiceExceptionpublic WritableDatabaseService getDocumentLocation(URN documentURN) throws DatabaseServiceException
WritableDatabaseServicegetDocumentLocation in class WritableDatabaseServicedocumentURN - the URN of the documentDatabaseServiceExceptionpublic String getFolderName()
WritableDatabaseServiceWritableDatabaseService.getUniqueID(), for this folder.getFolderName in class WritableDatabaseServiceprotected String getRootUniqueId()
WritableDatabaseServicegetRootUniqueId in class WritableDatabaseServicepublic String toString()
toString in class GeneiousServicepublic void removeChildFolder(String folderName) throws DatabaseServiceException
WritableDatabaseServiceremoveChildFolder in class WritableDatabaseServicefolderName - the name of the child folder to be removed. See WritableDatabaseService.getFolderName()DatabaseServiceException - if the folder is unable to be removed for any reason.public void renameFolder(String newName) throws DatabaseServiceException
WritableDatabaseServiceparent.getChildService(folderName).
The newly renamed folder may not be available immediately due to delayed firing of listeners. To get the new folder
after calling this method, the calling code should wait (in a non-swing thread) until parent.getChildService(folderName) returns
non-null.renameFolder in class WritableDatabaseServicenewName - the new name of this folderDatabaseServiceException - if the folder is unable to be renamed for any reason.protected Icons _getIcons()
WritableDatabaseServiceGeneiousService.getIcons().
Ths results of this method are combined with any
additional overlay icons provided to WritableDatabaseService.addOverlayIcons(com.biomatters.geneious.publicapi.plugin.Icons)
to create the results for WritableDatabaseService.getIcons()._getIcons in class WritableDatabaseServiceprotected String _getHelp()
WritableDatabaseServiceGeneiousService.getHelp()
Ths results of this method are combined with any
additional help provided to WritableDatabaseService.addAdditionalHelp(String)
to create the results for WritableDatabaseService.getHelp()._getHelp in class WritableDatabaseServiceprotected void _retrieve(URN[] urnsToRetrieve, RetrieveCallback callback) throws DatabaseServiceException
WritableDatabaseServiceWritableDatabaseService.retrieve(com.biomatters.geneious.publicapi.documents.URN[], com.biomatters.geneious.publicapi.databaseservice.RetrieveCallback)
that subclasses should implement. Unlike the parent case, implementations of this should
return documents if they exist anywhere within the database folder hierarchy._retrieve in class WritableDatabaseServiceDatabaseServiceExceptionprotected void _retrieve(Query query, RetrieveCallback callback, URN[] urnsToNotRetrieve) throws DatabaseServiceException
WritableDatabaseServiceWritableDatabaseService.retrieve(com.biomatters.geneious.publicapi.databaseservice.Query, com.biomatters.geneious.publicapi.databaseservice.RetrieveCallback, com.biomatters.geneious.publicapi.documents.URN[])
that subclasses should implement._retrieve in class WritableDatabaseServiceDatabaseServiceExceptionpublic int getDocumentCount(boolean includeSubFolders)
WritableDatabaseServicegetDocumentCount in class WritableDatabaseServiceincludeSubFolders - if true, the returned value should include in the total the number of documents in all sub-folders recursivelyprotected WritableDatabaseService _getHiddenFolder(String folderName, boolean isPerUserFolder) throws DatabaseServiceException
WritableDatabaseServiceWritableDatabaseService.getHiddenFolder(String, boolean)_getHiddenFolder in class WritableDatabaseServiceDatabaseServiceExceptionpublic String[] getHiddenFolderNames() throws DatabaseServiceException
WritableDatabaseServicegetHiddenFolderNames in class WritableDatabaseServiceDatabaseServiceExceptionpublic String addHiddenElement(org.jdom.Element newElement, ProgressListener progress) throws DatabaseServiceException
WritableDatabaseServiceaddHiddenElement in class WritableDatabaseServiceDatabaseServiceExceptionpublic void addHiddenElement(String name, org.jdom.Element newElement, ProgressListener progress) throws DatabaseServiceException
WritableDatabaseServiceaddHiddenElement in class WritableDatabaseServicename - a unique identifier for this element. This must consist of only the following characters: "[a-z][A-Z][0-9] _."DatabaseServiceExceptionpublic org.jdom.Element getHiddenElement(String elementName, ProgressListener progress) throws DatabaseServiceException
WritableDatabaseServicegetHiddenElement in class WritableDatabaseServiceelementName - the value returned from a previous call to addHiddenElement(Element) or the name specified as a parameter to a previous call to addHiddenElement(String, Element) or getHiddenElementNames()DatabaseServiceException - if there is no hidden element with this name or if an I/O error occurs.public String[] getHiddenElementNames() throws DatabaseServiceException
WritableDatabaseServicegetHiddenElementNames in class WritableDatabaseServiceDatabaseServiceExceptionpublic void updateHiddenElement(String name, org.jdom.Element newElement, ProgressListener progress) throws DatabaseServiceException
WritableDatabaseServiceupdateHiddenElement in class WritableDatabaseServicename - the name returned from a previous call to addHiddenElement(Element) or the name specified as a parameter to a previous call to addHiddenElement(String, Element)newElement - the new element to be saved.DatabaseServiceExceptionpublic void removeHiddenElement(String name) throws DatabaseServiceException
WritableDatabaseServiceremoveHiddenElement in class WritableDatabaseServicename - the name returned from a previous call to addHiddenElement(Element) or the name specified as a parameter to a previous call to addHiddenElement(String, Element). If a hidden element with this name doesn't exist, this method does nothing,DatabaseServiceExceptionpublic QueryField[] getSearchFields()
DatabaseServiceDatabaseServiceListener.fieldsChanged() when the fields are available.getSearchFields in class DatabaseService