Interface DocumentService
- All Superinterfaces:
Service
-
Method Summary
Modifier and TypeMethodDescriptionCreates an operation to create documents specified in theDocumentBatchCreateRequest.Creates an operation to create document versions specified in theDocumentVersionBatchCreateRequest.Creates an operation to delete documents and document versions specified in theDocumentBatchDeleteRequest.Creates an operation to reclassify documents specified in theDocumentBatchReclassifyRequest.Creates an operation to update document versions specified in theDocumentVersionBatchUpdateRequest.createAttachments(List<? extends SharedAttachment> sharedAttachments) Creates new attachment- or attachment-versions for a document or an object record.createDocuments(List<DocumentVersion> documentVersions) Deprecated.createRenditions(List<DocumentRendition> documentRenditions) Creates new renditions for a document.deleteDocumentVersions(List<DocumentVersion> documentVersions) Deprecated.as of 26R1.1, replaced bybatchDeleteDocuments(DocumentBatchDeleteRequest)migrateDocumentVersions(List<DocumentVersion> documentVersions) Creates new document-versions for existing documents.Instantiates a new, emptyDocumentVersion.newDocumentAttachment(FileReference fileReference, String docId) newDocumentAttachmentFileReference(ConnectionContext connectionContext, String attachmentId) Instantiates aDocumentAttachmentFileReferenceand sets the ID.Creates aDocumentBatchCreateRequest.BuilderCreates aDocumentBatchDeleteRequest.BuilderCreates aDocumentBatchReclassifyRequest.Builder.newDocumentRendition(FileReference fileReference, String docVersion, String renditionTypeName) newDocumentRenditionFileReference(ConnectionContext connectionContext, String documentVersionId, String renditionTypeName) Instantiates aDocumentRenditionFileReferenceand sets the rendition type, ID, major and minor version.newDocumentSourceFileReference(ConnectionContext connectionContext, String documentVersionId) Instantiates aDocumentSourceFileReferenceand sets the ID, major and minor version.newDocumentVersion(String documentVersionId) Deprecated.as of 19R3.5, replaced bynewVersionWithId(String)newDocumentWithId(String docId) Instantiates aDocumentVersionwith the givenidand sets the version to the latest version of the document.newVersion(String docId) Instantiates aDocumentVersionand sets the document ID.newVersionWithId(String documentVersionId) Instantiates aDocumentVersionand sets the ID, major version, and minor version.saveDocumentVersions(List<DocumentVersion> documentVersions) Deprecated.as of 26R1.1, replaced bybatchUpdateDocumentVersions(DocumentVersionBatchUpdateRequest)
-
Method Details
-
newDocumentVersion
Deprecated.as of 19R3.5, replaced bynewVersionWithId(String)Instantiates aDocumentVersionand sets the ID, major version, and minor version. Use this method to create an instance of an existing version of a document for updating or deleting. While you can delete any document version, you can only update the latest version of a document. If you want to update a document, we recommendnewDocumentWithId(String).- Parameters:
documentVersionId- the document ID, major version, and minor version, in the format id_major_minor. For example, 951_0_1.- Returns:
- a data-holder for an existing version of a document
-
newDocumentWithId
Instantiates aDocumentVersionwith the givenidand sets the version to the latest version of the document.Use this method to create an instance of the latest version of an existing document. You can then update or delete this document version.
- Parameters:
docId- the document ID- Returns:
- a data-holder for the latest version of an existing document
-
saveDocumentVersions
@Deprecated SaveDocumentVersionsResponse saveDocumentVersions(List<DocumentVersion> documentVersions) Deprecated.as of 26R1.1, replaced bybatchUpdateDocumentVersions(DocumentVersionBatchUpdateRequest)Save the specifiedDocumentVersioninstances. After updating the latest version of a document, use this method to save the document.This saves the
DocumentVersioninstances regardless of the current user's access to thatDocumentVersion.The total number of
DocumentVersioninstances in the input list cannot exceed 500.This is an all-or-nothing operation. If one or more documents fail to save, users see an error message and the operation is rolled back.
- Parameters:
documentVersions- List ofDocumentVersioninstances to save- Returns:
- the response of the save process
-
deleteDocumentVersions
@Deprecated DeleteDocumentVersionsResponse deleteDocumentVersions(List<DocumentVersion> documentVersions) Deprecated.as of 26R1.1, replaced bybatchDeleteDocuments(DocumentBatchDeleteRequest)Delete the specified List ofDocumentVersioninstances.A delete can be either a single version delete or document delete. If an input
DocumentVersionhas no major version and no minor version, that's an indication this is a complete document delete. If the inputDocumentVersionhas a major and minor version, that's an indication this is a document version delete.This is an all-or-nothing operation. If one or more documents fail to delete, users see an error message and the operation is rolled back.
- Parameters:
documentVersions- List ofDocumentVersioninstances to delete- Returns:
- the response of the delete process
-
newVersionWithId
Instantiates aDocumentVersionand sets the ID, major version, and minor version. Use this method to create an instance of an existing version of a document for updating or deleting. While you can delete any document version, you can only update the latest version of a document.To update a document, we recommend using
newDocumentWithId(String).- Parameters:
documentVersionId- the document ID, major version, and minor version, in the formatid_major_minor. For example, 951_0_1.- Returns:
- a data-holder for an existing version of a document
-
newDocument
DocumentVersion newDocument()Instantiates a new, emptyDocumentVersion. Use this method to create an instance of a new document and its first version.- Returns:
- a data-holder for a new document
-
newVersion
Instantiates aDocumentVersionand sets the document ID. Use this method to create a new version for an existing document. Existing documents can be identified by thedocId.- Parameters:
docId- the ID of the existing document- Returns:
- a data-holder for a new version of an existing document
-
newDocumentSourceFileReference
DocumentSourceFileReference newDocumentSourceFileReference(ConnectionContext connectionContext, String documentVersionId) Instantiates aDocumentSourceFileReferenceand sets the ID, major and minor version.- Parameters:
connectionContext- contains contextual connection informationdocumentVersionId- the document ID, major version, and minor version, in the formatid_major_minor. For example, 951_0_1.- Returns:
- a data-holder for a source file
DocumentSourceFileReference
-
newDocumentRenditionFileReference
DocumentRenditionFileReference newDocumentRenditionFileReference(ConnectionContext connectionContext, String documentVersionId, String renditionTypeName) Instantiates aDocumentRenditionFileReferenceand sets the rendition type, ID, major and minor version.- Parameters:
connectionContext- contains contextual connection informationdocumentVersionId- the document ID, major version, and minor version, in the formatid_major_minorFor example, 951_0_1.renditionTypeName- name of rendition type- Returns:
- a data-holder for a rendition file
DocumentRenditionFileReference
-
newDocumentAttachmentFileReference
DocumentAttachmentFileReference newDocumentAttachmentFileReference(ConnectionContext connectionContext, String attachmentId) Instantiates aDocumentAttachmentFileReferenceand sets the ID.- Parameters:
connectionContext- contains contextual connection informationattachmentId- the attachment ID, for example, 952- Returns:
- a data-holder for an attachment file
DocumentAttachmentFileReference
-
newDocumentAttachment
- Parameters:
fileReference- file reference pointing to the original filedocId- ID of the document which the attachment is associate with- Returns:
- instantiated
DocumentAttachment
-
newDocumentRendition
DocumentRendition newDocumentRendition(FileReference fileReference, String docVersion, String renditionTypeName) - Parameters:
fileReference- file reference pointing to the original filedocVersion- version of the document which the rendition is associate with. For example, 1_0_1.renditionTypeName- rendition type name of the new rendition- Returns:
- instantiated
DocumentRendition
-
createDocuments
Deprecated.as of 26R1.1, replaced bybatchCreateDocuments(DocumentBatchCreateRequest)Creates new documents. After constructing the first version of the new documents, use this method to save the new documents and first version. This is an all-or-nothing operation. If one or more documents fail to save, users see an error message and the operation rolls back.- Parameters:
documentVersions- list ofDocumentVersioninstances to create- Returns:
- the response of the save process
-
migrateDocumentVersions
Creates new document-versions for existing documents. After constructing the new versions of existing documents, use this method to create them. This is an all-or-nothing operation. If one or more documents fail to save, users see an error message and the operation rolls back.- Parameters:
documentVersions- list ofDocumentVersioninstances to create- Returns:
- the response of the save process
-
createAttachments
Creates new attachment- or attachment-versions for a document or an object record. After constructing the new attachments, use this method to create them. This is an all-or-nothing operation. If one or more attachment versions fail to save, users see an error message and the operation rolls back.- Parameters:
sharedAttachments- list ofSharedAttachmentor its subclasses to create- Returns:
- the response of the save process
-
createRenditions
Creates new renditions for a document. After constructing the new renditions, use this method to create them. This is an all-or-nothing operation. If one or more renditions fail to save, users see an error message and the operation rolls back.- Parameters:
documentRenditions- list ofDocumentRenditionto create- Returns:
- the response of the save process
-
newDocumentBatchCreateRequestBuilder
DocumentBatchCreateRequest.Builder newDocumentBatchCreateRequestBuilder()Creates aDocumentBatchCreateRequest.Builder- Returns:
- the created
DocumentBatchCreateRequest.Builder
-
batchCreateDocuments
Creates an operation to create documents specified in theDocumentBatchCreateRequest.You can specify how to handle errors and successes on the returned
BatchOperation. You can then callBatchOperation.execute()to execute the creation. For example:documentService.batchCreateDocuments(documentBatchCreateRequest).rollbackOnErrors().execute()All Documents in the list specified in
DocumentBatchCreateRequestmust not have anidand their total cannot exceed 500.- Parameters:
request- contains the list ofDocumentVersioninstances to create- Returns:
- an operation to create the documents
-
newDocumentVersionBatchCreateRequestBuilder
DocumentVersionBatchCreateRequest.Builder newDocumentVersionBatchCreateRequestBuilder()- Returns:
- the created
DocumentVersionBatchCreateRequest.Builder
-
batchCreateDocumentVersions
DocumentVersionBatchCreateOperation batchCreateDocumentVersions(DocumentVersionBatchCreateRequest request) Creates an operation to create document versions specified in theDocumentVersionBatchCreateRequest. This also supports creating new draft versions.You can specify how to handle errors and successes on the returned
BatchOperation. You can then callBatchOperation.execute()to execute the creation. For example:documentService.batchCreateDocumentVersions(documentVersionBatchCreateRequest).rollbackOnErrors().execute()All Documents in the list specified in
DocumentBatchCreateRequestmust have anidand their total cannot exceed 500.- Parameters:
request- contains the list ofDocumentVersioninstances to create- Returns:
- an operation to create the document versions
-
newDocumentVersionBatchUpdateRequestBuilder
DocumentVersionBatchUpdateRequest.Builder newDocumentVersionBatchUpdateRequestBuilder()- Returns:
- the created
DocumentVersionBatchUpdateRequest.Builder
-
batchUpdateDocumentVersions
DocumentVersionBatchUpdateOperation batchUpdateDocumentVersions(DocumentVersionBatchUpdateRequest request) Creates an operation to update document versions specified in theDocumentVersionBatchUpdateRequest.An update can be either be on the document's latest version or the specified version. If an input
DocumentVersionhas no major version or no minor version, then the operation updates the latest version. If an inputDocumentVersionhas a major and minor version, then the operation updates that specified version.You can specify how to handle errors and successes on the returned
BatchOperation. You can then callBatchOperation.execute()to execute the update. For example:documentService.batchUpdateDocumentVersions(documentBatchCreateRequest).rollbackOnErrors().execute()All DocumentVersions in the list specified in
DocumentVersionBatchUpdateRequestmust have anidand must not be a duplicate within the batch. The batch total cannot exceed 500.- Parameters:
request- contains the list ofDocumentVersioninstances to update- Returns:
- an operation to update document versions
-
newDocumentBatchDeleteRequestBuilder
DocumentBatchDeleteRequest.Builder newDocumentBatchDeleteRequestBuilder()Creates aDocumentBatchDeleteRequest.Builder- Returns:
- the created
DocumentBatchDeleteRequest.Builder
-
batchDeleteDocuments
Creates an operation to delete documents and document versions specified in theDocumentBatchDeleteRequest.A delete operation can be either a single version delete or document delete. If an input
DocumentVersionhas no major version and no minor version value, the whole document is deleted. If the inputDocumentVersionhas major and minor version values, then the specified document version is deleted.You can specify how to handle errors and successes on the returned
BatchOperation. You can then callBatchOperation.execute()to execute the deletion. For example:documentService.batchDeleteDocuments(documentBatchDeleteRequest).rollbackOnErrors().execute()All DocumentVersions in the list specified in
DocumentBatchDeleteRequestmust have anidand must not be a duplicate within the batch. The batch total cannot exceed 500.- Parameters:
request- contains the list ofDocumentVersioninstances to delete and additional parameters- Returns:
- an operation to delete documents and document versions
-
newDocumentBatchReclassifyRequestBuilder
DocumentBatchReclassifyRequest.Builder newDocumentBatchReclassifyRequestBuilder()Creates aDocumentBatchReclassifyRequest.Builder.- Returns:
- the created
DocumentBatchReclassifyRequest.Builder
-
batchReclassifyDocuments
Creates an operation to reclassify documents specified in theDocumentBatchReclassifyRequest.You can specify how to handle errors and successes on the returned
BatchOperation. You can then callBatchOperation.execute()to execute the reclassification. For example:documentService.batchReclassifyDocuments(documentBatchReclassifyRequest).rollbackOnErrors().execute()All
DocumentVersions in the list specified inDocumentBatchReclassifyRequestmust have anidand must not be a duplicate within the batch. The batch total cannot exceed 500.- Parameters:
request- contains the list ofDocumentVersioninstances to reclassify and additional parameters- Returns:
- an operation to reclassify the documents
-
batchCreateDocuments(DocumentBatchCreateRequest)