Package com.logicaldoc.docusign
Class DocuSignUtil
- java.lang.Object
-
- com.logicaldoc.docusign.DocuSignUtil
-
public class DocuSignUtil extends Object
A set of utility methods for DocuSign- Since:
- 8.5
- Author:
- Marco Meschieri - LogicalDOC
-
-
Constructor Summary
Constructors Constructor Description DocuSignUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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>
listUsersWithDocuSignProfile()
Gets the list of users with a DocuSign profilestatic void
markEnvelopeAsProcessed(String envelopeId, String envelopeSubject, com.logicaldoc.core.security.User user)
Marks a given envelope as already processed that is a generic with: type = docusign-env subtype =envelopeId
string1 =subject
static Date
parseDate(String 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 Detail
-
formatDate
public static String formatDate(Date date)
Formats a date in RFC3339 format- Parameters:
date
- the date to format- Returns:
- the formatted date
-
parseDate
public static Date parseDate(String date) throws ParseException
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) 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> listUsersWithDocuSignProfile()
Gets the list of users with a DocuSign profile- Returns:
- list of users
-
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 storagecom.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 processlog
- the logger to usedocuSign
- the DocuSign facade, if not provided it will be created- Returns:
- the number of updated documents
- Throws:
IOException
- exception downloading the files from DocuSign or writing in the local storagecom.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
-
-