public static class DocumentOperation.OperationCallback.Wrapper extends DocumentOperation.OperationCallback
DocumentOperation.OperationCallback.Wrapper| Constructor and Description |
|---|
DocumentOperation.OperationCallback.Wrapper(DocumentOperation.OperationCallback delegate) |
| Modifier and Type | Method and Description |
|---|---|
AnnotatedPluginDocument |
addDocument(AnnotatedPluginDocument doc,
boolean dontSelectDocumentWhenComplete,
ProgressListener progress)
returns a document from the operation while the operation is still in progress.
|
boolean |
canResume() |
org.jdom.Element |
getResumableState()
returns the persistent information that was set with the last call to
DocumentOperation.OperationCallback.setResumableState(org.jdom.Element) (this call may have been before the operation was paused) |
boolean |
isInterestedInParentDescendants() |
void |
setOptionsForActivelyLinkedDescendants(org.jdom.Element optionsElement,
List<AnnotatedPluginDocument> inputDocuments,
List<AnnotatedPluginDocument> additionalParentDocuments)
This method will only have an effect if
DocumentOperation.OperationCallback.isInterestedInParentDescendants() returns true. |
void |
setRemoteJobId(GeneiousService service,
String jobId)
This method is only provided for core Geneious use when implementing a remote service such as a Geneious Server or a Green Button service.
|
void |
setResumableState(org.jdom.Element e)
Sets a resumable state for your operation.
|
void |
setSubFolder(String name)
Specify the name of a subfolder that the results of the operation should go in.
|
void |
stopCreatingOperationRecords()
Stops any
operation records from being created for subsequent documents added using addDocument. |
addDocument, setMarkUnselectedDocumentsUnreadpublic DocumentOperation.OperationCallback.Wrapper(DocumentOperation.OperationCallback delegate)
delegate - the OperationCallback to delegate all methods topublic void setResumableState(org.jdom.Element e)
DocumentOperation.OperationCallbackAnnotatedPluginDocuments, Options or SequenceSelections passed in to your operation - the same ones will be passed in when your operation is resumed.setResumableState in class DocumentOperation.OperationCallbacke - all the information necessary to resume the operation, or null to set this operation to be non-resumable.public org.jdom.Element getResumableState()
DocumentOperation.OperationCallbackDocumentOperation.OperationCallback.setResumableState(org.jdom.Element) (this call may have been before the operation was paused)getResumableState in class DocumentOperation.OperationCallbackDocumentOperation.OperationCallback.setResumableState(org.jdom.Element) (this call may have been before the operation was paused), or null if it was never called.public boolean canResume()
canResume in class DocumentOperation.OperationCallbackDocumentOperation.OperationCallback.setResumableState(org.jdom.Element) has been called with a non-null argument.public void setSubFolder(String name) throws DatabaseServiceException
DocumentOperation.OperationCallbacksetSubFolder in class DocumentOperation.OperationCallbackname - name of the subfolder or null to not put the results in a subfolder. Defaults to null.DatabaseServiceException - if failed to create subfolder, in which case the parent folder is used.
This exception may be ignored if that is acceptablepublic AnnotatedPluginDocument addDocument(AnnotatedPluginDocument doc, boolean dontSelectDocumentWhenComplete, ProgressListener progress) throws DocumentOperationException
DocumentOperation.OperationCallbackaddDocument in class DocumentOperation.OperationCallbackdoc - a document to returndontSelectDocumentWhenComplete - should Geneious select the document when the operation is completeAnnotatedPluginDocument or a copy if the document was added to the local database.DocumentOperationException - if the document could not be added for some reason.public void setRemoteJobId(GeneiousService service, String jobId)
DocumentOperation.OperationCallbacksetRemoteJobId in class DocumentOperation.OperationCallbackservice - The location the operation is running. Must not be null.jobId - A unique identifier for a running operation. This identifier must be unique across all jobs for the service.public void setOptionsForActivelyLinkedDescendants(org.jdom.Element optionsElement,
List<AnnotatedPluginDocument> inputDocuments,
List<AnnotatedPluginDocument> additionalParentDocuments)
throws DocumentOperationException
DocumentOperation.OperationCallbackDocumentOperation.OperationCallback.isInterestedInParentDescendants() returns true. If not, then this method won't do anything if you try and use it. Furthermore
if an operation modifies input documents as part of providing parent/descendant functionality (for example adding invisible annotations) then it must not do that if
DocumentOperation.OperationCallback.isInterestedInParentDescendants() returns false.addDocument.
These documents can be recreated later using DocumentOperation.getOptions(org.jdom.Element, java.util.List, java.util.List) in conjunction with a performOperation call.
This method may be called multiple times for different sets of output from the operation. For example when batch creating results, each result may be produced as
an independent parent/descendant data set that can be recreated later independently of other results.setOptionsForActivelyLinkedDescendants in class DocumentOperation.OperationCallbackoptionsElement - an xml form of the options that, when deserialized, allows this operation to be rerun with exactly the same results as when it was first run in this (and any future) version of Geneious, using DocumentOperation.getOptions(org.jdom.Element, java.util.List, java.util.List).
If the options never change between versions of Geneious, and the operation ignores the Sequence Selection, then this is as simple as calling Options.valuesToXML(String) and using Options.valuesFromXML(org.jdom.Element) in DocumentOperation.getOptions(org.jdom.Element, java.util.List, java.util.List).
SequenceSelection if necessary, along with any other relevant information required to completely rerun the operation
exactly. For example, call Options.valuesToXML() and then call setAttribute("version","2.3")
inputDocuments - those parent documents that should be supplied to performOperation as parameters for future runs of the operation. Most of the time this should be the input documents to the operation, except when performing a batch operation.
additionalParentDocuments - those parent documents that shouldn't be supplied directly as parameters to performOperation, but that are supplied via some other mechanism (e.g. DocumentSelectionOption.DocumentChooser)).DocumentOperationException - if there is a problem writing to the databasepublic boolean isInterestedInParentDescendants()
isInterestedInParentDescendants in class DocumentOperation.OperationCallbacksetOptionsForActivelyLinkedDescendants.
You should diverge your code paths so that, for example, any additional work for parent/descendants you do such as creating invisible
annotations on parent documents doesn't get done unnecessarily. If this returns false, then they shouldn't do that or make any other sort of changes to the parent/input documentspublic void stopCreatingOperationRecords()
throws DocumentOperationException
DocumentOperation.OperationCallbackoperation records from being created for subsequent documents added using addDocument.
This can be undone for later documents you wish to add by calling DocumentOperation.OperationCallback.setOptionsForActivelyLinkedDescendants(org.jdom.Element, java.util.List, java.util.List) - documents added subsequent to that call will then have records
created in the manner described in by that method.stopCreatingOperationRecords in class DocumentOperation.OperationCallbackDocumentOperationException - if a problem occurs