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 Summary
Modifier and TypeMethodDescriptionstatic String
formatDate
(Date date) Formats a date in RFC3339 formatstatic boolean
isEnvelopeProcessed
(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 void
markEnvelopeAsProcessed
(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 =envelopeId
string1 =subject
static Date
Parses a date in RFC3339 formatstatic long
processCompletedEnvelope
(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 long
processCompletedEnvelope
(String envelopeId, long userId, org.slf4j.Logger log) Takes the documents already signed from the envelope and updates the local documents
-
Method Details
-
formatDate
Formats a date in RFC3339 format- Parameters:
date
- the date to format- Returns:
- the formatted date
-
parseDate
Parses a date in RFC3339 format- Parameters:
date
- the date to parse- Returns:
- the parsed date
- Throws:
ParseException
- a parsing error
-
isEnvelopeProcessed
public 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
-
markEnvelopeAsProcessed
public 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 envelopeenvelopeSubject
- subject to give to the envelope notificationsuser
- the user whose DocuSign profile belongs to- Throws:
com.logicaldoc.core.PersistenceException
- Error at database level
-
listUsersWithDocuSignProfile
public 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
-
processCompletedEnvelope
public 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 envelopeuserId
- the user that created the envelopelog
- the logger to use- Returns:
- the number of updated documents
- Throws:
IOException
- exception downloading the files from DocuSign or writing in the local storecom.docusign.esign.client.ApiException
- error interacting with DocuSigncom.logicaldoc.core.security.authentication.AuthenticationException
- the user has not been authenticated by DocuSigncom.logicaldoc.core.PersistenceException
- error at data layer
-
processCompletedEnvelope
public 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 processdocuSign
- the DocuSign facade, if not provided it will be createdlog
- the logger to use- Returns:
- the number of updated documents
- Throws:
IOException
- exception downloading the files from DocuSign or writing in the local storecom.docusign.esign.client.ApiException
- error interacting with DocuSigncom.logicaldoc.core.security.authentication.AuthenticationException
- the user has not been authenticated by DocuSigncom.logicaldoc.core.PersistenceException
- error at data layer
-