Skip to main content

Functions Accessible via 'documentService'

Updated over 3 weeks ago

1

applyActivityLocks

Signature: applyActivityLocks(int docVo.getRevisionId(), int ActivityId, int TaskType)

Description: To apply activity locks to document

Returns: ---

2

assignVisibility

Signature: assignVisibility(DocumentVO documentVO, Map<String, List<String>> assignVisibilityMap)

Description: To assign visibility for users, roles and distribution groups only.

Returns: ---

3

callExternalAPI

Signature: callExternalAPI(HashMap<Object, Object> apiCallParameters)

Description: To call any web service with customized parameters.

Returns: Map<String, String> apiResponse

apiResponse.get(IGroovyConstant.DATA) - This will give you the response of API in String format
apiResponse.get(IGroovyConstant.STATUS) - This will give you API call response status like 200

4

createPackageAndTransfer

Signature: createPackageAndTransfer(HashMap options, String metadata Json/Xml, String metadataFileType)

Description: To create a package of different files of the Asite platform to transfer the created package to an external location.

Returns: ---

5

createPlaceholders

Signature: createPlaceHolders(Map documentDetails)

Description: To create placeholders in the current folder.

Returns: ---

6

distributeFile

Signature: distributeFile(HashMap distributeFileMap)

Description: To distribute files based on the user's email, role, organisation or distribution group.

Returns: ---

7

getAttachmentDetails

Signature: getAttachmentDetails()

Description: To get details of the file attached with revision.

Returns: List of DocAttachmentVO

8

getAttachmentDetailsWithChecksum

Signature: getAttachmentDetailsWithChecksum(DocAttachmentVO)

Description: To get details of the attached file, including the revision and the SHA-1 checksum. Here SHA-1 is a type of file checksum calculation.

Returns: List of DocAttachmentVO

9

getCustomAttributeValue

Signature: getCustomAttributeValue(DocumentVO documentVO,String attributeName)

Description: To get the value of the custom attribute.

Returns: [String] - To get a specific value of the custom attribute in DocumentVO.

10

getDocsByCustomAttribute

Signature: getDocsByCustomAttribute(String customAttrName, String customAttrValue, String FolderPath, HashMap <String, String> revDetailsOptions)

Description: To get a list of DocumentVO that matches with the provided custom attribute name and values in the given folderpath.

Returns: HashMap - List of documents based on custom attributes, if any

11

getDocumentDetails

Signature: getDocumentDetails()

Description: To get values of all basic attributes of revision or document.

Returns: DocumentVO

12

getDocumentDetails

Signature: getDocumentDetails(HashMap<Object, Object> optionMap)

Description: To get values of all basic and custom attributes based on the provided optionMap.

Returns: DocumentVO

13

getDocumentsByDocRefs

Signature: getDocumentsByDocRefs(Set<String> docRefSet, String folderPath, HashMap mapRevDetailsOptions);

Description: To get details of existing revisions by Docef and Folder Path

Returns: Map<String,DocumentVO> Response Map will have documentRef#revisionId as the key and DocumentVO as its value. Please go through the sample script for more details.

14

getFolderPath

Signature: getFolderPath(document DocumentVO);

Description: To get the folder path of the given document

Returns: String folder path. Please go through the sample script for more details.

15

getStaticDataOfQRCode

Signature: getStaticDataOfQRCode(DocumentVO document)

Description: To get static data of the QR code.

Returns: QRCodeStaticDataVO

16

getUsersEmailIdByGroupOrRole

Signature: getUsersEmailIdByGroupOrRole(Map<String, List<String>> inputDataMap)

Description: To get the user's email address.

Returns: Map<String, Map<String, List<String>>> - Email ID of users in provided distribution group or role.

17

isDocRefExist

Signature: isDocRefExist(String docRef, RevisionDetailsOption.PROJECT_LEVEL_UNIQUE)

Description: To check whether the given document reference already exists in any folder of the selected project.

Returns: true/false

18

setDynamicDistribution

Signature: setDynamicDistribution(Map<String, DynamicDistributionVO> userTaskDistributionList,int recipientDataType)

Description: Save the dynamic distribution list for use in the 'User Task' node of the Visual Workflow.

Returns: ---

19

toJson

Signature: toJSON(DocumentVO docVo, String Template_URL)

Description: To convert DocumentVO to JSON string. The user can apply a template as well.

Returns: [String] - JSON format of provided DocumentVO and template

20

toXml

Signature: toXML(DocumentVO docVo, String Template_URL)

Description: To convert DocumentVO to XML string. The user can apply a template as well.

Returns: [String] - XML format of provided DocumentVO and template

21

updateDocument

Signature: updateDocument(DocumentContext)

Description: To update attributes of revision [revision, docTitle, revisionNotes]. This method should be used in a Groovy script configured only with a POST mode trigger. (This is a deprecated function. For enhanced options, you can use the 'updateDocuments' function.)

Returns: ---

22

updateDocuments

Signature: updateDocuments(ArrayList<DocumentVO> documentList)

Description: To update attributes of revision [revision, docTitle, revisionNotes, DocRef, PurposeOfIssue, Private, CustomAttribute]. This method should be used in a Groovy script configured only with a POST mode trigger.

Returns: ---

23

updateDocuments

Signature: updateDocuments(ArrayList<DocumentVO> documentList, HashMap<Object, Object> optionDataMap)

Description: To update revision attributes with apply timezone [revision, docTitle, revisionNotes, DocRef, PurposeOfIssue, Private, CustomAttribute]. This method should be used in a Groovy script configured only with a POST mode trigger.

Returns: ---

24

updateFileStatus

Signature: updateFileStatus(String status)

Description: To update document status.

Returns: ---

25

writeAdoddleAttributesToFilePropertyAttributes

Signature: writeAdoddleAttributesToFilePropertyAttributes(HashMap<String,String> attributeMapping)

Description: To write Asite platform attribute values in file content property values. Supported for .docx file format only.

Returns: ---



Did this answer your question?