Interface DocumentService
- All Superinterfaces:
Service
-
Method Summary
Modifier and TypeMethodDescriptioncreateAttachments(List<? extends SharedAttachment> sharedAttachments) Creates new attachment- or attachment-versions for a document or an object record.createDocuments(List<DocumentVersion> documentVersions) Creates new documents.createRenditions(List<DocumentRendition> documentRenditions) Creates new renditions for a document.deleteDocumentVersions(List<DocumentVersion> documentVersions) Delete the specified List ofDocumentVersions.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.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.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) Save the specifiedDocumentVersions.
-
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
Save the specifiedDocumentVersions. After updating the latest version of a document, use this method to save the document.This saves the
DocumentVersions regardless of the current user's access to thatDocumentVersion.The total number of
DocumentVersions 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 ofDocumentVersions to save- Returns:
- the response of the save process. See
SaveDocumentVersionsResponsefor more information.
-
deleteDocumentVersions
Delete the specified List ofDocumentVersions.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 ofDocumentVersions to delete- Returns:
- the response of the delete process. See
DeleteDocumentVersionsResponsefor more information.
-
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_minor. For 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
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 ofDocumentVersions to create- Returns:
- the response of the save process. See
SaveDocumentVersionsResponsefor more information.
-
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 ofDocumentVersions to create- Returns:
- the response of the save process. See
SaveDocumentVersionsResponsefor more information.
-
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. See
SaveDocumentVersionsResponsefor more information.
-
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. See
SaveDocumentVersionsResponsefor more information.
-
newVersionWithId(String)