Package com.logicaldoc.docusign
Class DocuSignUtil
java.lang.Object
com.logicaldoc.docusign.DocuSignUtil
A set of utility methods for DocuSign
- Since:
- 8.5
- Author:
- Marco Meschieri - LogicalDOC
- 
Method SummaryModifier and TypeMethodDescriptionstatic StringformatDate(Date date) Formats a date in RFC3339 formatstatic booleanisEnvelopeProcessed(String envelopeId) Checks if the given envelope has been processed.static List<com.logicaldoc.core.security.user.User> Gets the list of users with a DocuSign profilestatic voidmarkEnvelopeAsProcessed(String envelopeId, String envelopeSubject, com.logicaldoc.core.security.user.User user) Marks a given envelope as already processed that is a generic with: type = docusign-env subtype =envelopeIdstring1 =subjectstatic DateParses a date in RFC3339 formatstatic longprocessCompletedEnvelope(com.docusign.esign.model.Envelope envelope, DocuSign docuSign, org.slf4j.Logger log) Takes the documents already signed from the envelope and updates the local documentsstatic longprocessCompletedEnvelope(String envelopeId, long userId, org.slf4j.Logger log) Takes the documents already signed from the envelope and updates the local documents
- 
Method Details- 
formatDateFormats a date in RFC3339 format- Parameters:
- date- the date to format
- Returns:
- the formatted date
 
- 
parseDateParses a date in RFC3339 format- Parameters:
- date- the date to parse
- Returns:
- the parsed date
- Throws:
- ParseException- a parsing error
 
- 
isEnvelopeProcessedpublic static boolean isEnvelopeProcessed(String envelopeId) throws com.logicaldoc.core.PersistenceException Checks if the given envelope has been processed.- Parameters:
- envelopeId- identifier of the envelope
- Returns:
- if the envelope has been processed
- Throws:
- com.logicaldoc.core.PersistenceException- Error at database level
 
- 
markEnvelopeAsProcessedpublic static void markEnvelopeAsProcessed(String envelopeId, String envelopeSubject, com.logicaldoc.core.security.user.User user) throws com.logicaldoc.core.PersistenceException Marks a given envelope as already processed that is a generic with:- type = docusign-env
- subtype = envelopeId
- string1 = subject
 - Parameters:
- envelopeId- identifier of the envelope
- envelopeSubject- subject to give to the envelope notifications
- user- the user whose DocuSign profile belongs to
- Throws:
- com.logicaldoc.core.PersistenceException- Error at database level
 
- 
listUsersWithDocuSignProfilepublic static List<com.logicaldoc.core.security.user.User> listUsersWithDocuSignProfile() throws com.logicaldoc.core.PersistenceExceptionGets the list of users with a DocuSign profile- Returns:
- list of users
- Throws:
- com.logicaldoc.core.PersistenceException- Error in the database
 
- 
processCompletedEnvelopepublic static long processCompletedEnvelope(String envelopeId, long userId, org.slf4j.Logger log) throws IOException, com.docusign.esign.client.ApiException, com.logicaldoc.core.security.authentication.AuthenticationException, com.logicaldoc.core.PersistenceException Takes the documents already signed from the envelope and updates the local documents- Parameters:
- envelopeId- identifier of the completed envelope
- userId- the user that created the envelope
- log- the logger to use
- Returns:
- the number of updated documents
- Throws:
- IOException- exception downloading the files from DocuSign or writing in the local store
- com.docusign.esign.client.ApiException- error interacting with DocuSign
- com.logicaldoc.core.security.authentication.AuthenticationException- the user has not been authenticated by DocuSign
- com.logicaldoc.core.PersistenceException- error at data layer
 
- 
processCompletedEnvelopepublic static long processCompletedEnvelope(com.docusign.esign.model.Envelope envelope, DocuSign docuSign, org.slf4j.Logger log) throws IOException, com.docusign.esign.client.ApiException, com.logicaldoc.core.security.authentication.AuthenticationException, com.logicaldoc.core.PersistenceException Takes the documents already signed from the envelope and updates the local documents- Parameters:
- envelope- the envelope to process
- docuSign- the DocuSign facade, if not provided it will be created
- log- the logger to use
- Returns:
- the number of updated documents
- Throws:
- IOException- exception downloading the files from DocuSign or writing in the local store
- com.docusign.esign.client.ApiException- error interacting with DocuSign
- com.logicaldoc.core.security.authentication.AuthenticationException- the user has not been authenticated by DocuSign
- com.logicaldoc.core.PersistenceException- error at data layer
 
 
-