Package com.simplicite.util.tools
Class DocSignProvider
- java.lang.Object
-
- com.simplicite.util.tools.DocSignProvider
-
- Direct Known Subclasses:
DocuSignTool
public abstract class DocSignProvider extends java.lang.Object
Document signing interface. For example use DocSignProvider p = DocSignProvider.getInstance(DocSignProvider.PROVIDER_DOCUSIGN)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DocSignProvider.DocSignAccount
Account data of Sign providerstatic class
DocSignProvider.DocSignSignerStatus
Signer statusstatic class
DocSignProvider.DocSignStatus
Document status
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
PROVIDER_DOCUSIGN
Document signing provider namestatic java.lang.String
STATUS_CANCELED
The sender canceled the envelope before it was completedstatic java.lang.String
STATUS_COMPLETED
Completed once all of the recipients have completed their actionsstatic java.lang.String
STATUS_DECLINED
A signer has declined to signstatic java.lang.String
STATUS_DELIVERED
Document delivered to signerstatic java.lang.String
STATUS_FAILURE
Document not delivered (auto-respond, invalid email...)static java.lang.String
STATUS_SENT
Document sentstatic java.lang.String
STATUS_SIGNED
Document signedstatic java.lang.String
STATUS_TIMEOUT
Timeout of a signaturestatic java.lang.String
STATUS_UNKNOWN
Unknown status
-
Constructor Summary
Constructors Constructor Description DocSignProvider()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract DocSignProvider.DocSignAccount
authent(Grant g)
Manage the provider authent to get account infosabstract boolean
cancelDocument(DocSignProvider.DocSignAccount account, java.lang.String envelopeId, java.lang.String voidedReason)
Cancel an envelopeabstract DocSignProvider.DocSignStatus
getDocument(Grant g, java.lang.String envelopeId, boolean withDocs)
Call with current document statusDocSignProvider.DocSignStatus
getDocument(java.lang.String envelopeId, boolean withDocs)
Call with current document statusstatic DocSignProvider
getInstance(java.lang.String provider)
Get isolated instance ofDocSignProvider
java.lang.String
send(DocSignProvider.DocSignAccount account, java.lang.String subject, java.lang.String pdfPath, java.lang.String pdfName, java.lang.String signerEmail, java.lang.String signerName, java.lang.String signerAnchor, java.lang.String object)
Send one document to one signerjava.lang.String
send(DocSignProvider.DocSignAccount account, java.lang.String subject, java.util.List<java.lang.String> pdfPaths, java.util.List<java.lang.String> pdfNames, java.util.List<java.lang.String> signerEmails, java.util.List<java.lang.String> signerNames, java.util.List<java.util.List<java.lang.String>> signerAnchors, java.util.List<java.util.List<java.lang.String>> initialAnchors, java.lang.String object)
Send documents to signersabstract java.lang.String
send(DocSignProvider.DocSignAccount account, java.lang.String subject, java.util.List<java.lang.String> pdfPaths, java.util.List<java.lang.String> pdfNames, java.util.List<java.lang.String> signerEmails, java.util.List<java.lang.String> signerNames, java.util.List<java.util.List<java.lang.String>> signerAnchors, java.util.List<java.util.List<java.lang.String>> initialAnchors, java.util.List<java.util.List<java.lang.String>> stampAnchors, java.lang.String object)
Send documents to signersstatic void
webhook(DocSignProvider.DocSignStatus data)
Web-hook callback: call the web hook of target object from public servletvoid
webhook(java.io.InputStream in)
Web-hook callback: call the web hook of target object from public servlet
-
-
-
Field Detail
-
PROVIDER_DOCUSIGN
public static final java.lang.String PROVIDER_DOCUSIGN
Document signing provider name- See Also:
- Constant Field Values
-
STATUS_SENT
public static final java.lang.String STATUS_SENT
Document sent- See Also:
- Constant Field Values
-
STATUS_DELIVERED
public static final java.lang.String STATUS_DELIVERED
Document delivered to signer- See Also:
- Constant Field Values
-
STATUS_FAILURE
public static final java.lang.String STATUS_FAILURE
Document not delivered (auto-respond, invalid email...)- See Also:
- Constant Field Values
-
STATUS_TIMEOUT
public static final java.lang.String STATUS_TIMEOUT
Timeout of a signature- See Also:
- Constant Field Values
-
STATUS_DECLINED
public static final java.lang.String STATUS_DECLINED
A signer has declined to sign- See Also:
- Constant Field Values
-
STATUS_CANCELED
public static final java.lang.String STATUS_CANCELED
The sender canceled the envelope before it was completed- See Also:
- Constant Field Values
-
STATUS_SIGNED
public static final java.lang.String STATUS_SIGNED
Document signed- See Also:
- Constant Field Values
-
STATUS_COMPLETED
public static final java.lang.String STATUS_COMPLETED
Completed once all of the recipients have completed their actions- See Also:
- Constant Field Values
-
STATUS_UNKNOWN
public static final java.lang.String STATUS_UNKNOWN
Unknown status- See Also:
- Constant Field Values
-
-
Method Detail
-
send
public final java.lang.String send(DocSignProvider.DocSignAccount account, java.lang.String subject, java.lang.String pdfPath, java.lang.String pdfName, java.lang.String signerEmail, java.lang.String signerName, java.lang.String signerAnchor, java.lang.String object)
Send one document to one signer- Parameters:
account
- API account datasubject
- Email subjectpdfPath
- Path to PDF documentpdfName
- Name of filesignerEmail
- Signer emailsignerName
- Signer full namesignerAnchor
- Anchor to localize the signatureobject
- Related object for callback- Returns:
- envelope ID to store for further usage (web-hook or call)
-
send
public java.lang.String send(DocSignProvider.DocSignAccount account, java.lang.String subject, java.util.List<java.lang.String> pdfPaths, java.util.List<java.lang.String> pdfNames, java.util.List<java.lang.String> signerEmails, java.util.List<java.lang.String> signerNames, java.util.List<java.util.List<java.lang.String>> signerAnchors, java.util.List<java.util.List<java.lang.String>> initialAnchors, java.lang.String object)
Send documents to signers- Parameters:
account
- API account datasubject
- Email subject (truncated to 100)pdfPaths
- Paths to PDF documentpdfNames
- Names of filesignerEmails
- Signers emailsignerNames
- Signers full namesignerAnchors
- Anchors to localize the signature per document and signer (null if none)initialAnchors
- Optional anchors to localize the initials per document and signer (null if none)object
- Related object with hook "docuSign"- Returns:
- envelope ID to store for further usage (web-hook or call)
-
send
public abstract java.lang.String send(DocSignProvider.DocSignAccount account, java.lang.String subject, java.util.List<java.lang.String> pdfPaths, java.util.List<java.lang.String> pdfNames, java.util.List<java.lang.String> signerEmails, java.util.List<java.lang.String> signerNames, java.util.List<java.util.List<java.lang.String>> signerAnchors, java.util.List<java.util.List<java.lang.String>> initialAnchors, java.util.List<java.util.List<java.lang.String>> stampAnchors, java.lang.String object)
Send documents to signers- Parameters:
account
- API account datasubject
- Email subject (truncated to 100)pdfPaths
- Paths to PDF documentpdfNames
- Names of filesignerEmails
- Signers emailsignerNames
- Signers full namesignerAnchors
- Anchors to localize the signature per document and signer (null if none)initialAnchors
- Optional anchors to localize the initials per document and signer (null if none)stampAnchors
- Optional anchor to localize the stamps per document and signer (null if none)object
- Related object with hook "docuSign"- Returns:
- envelope ID to store for further usage (web-hook or call)
-
cancelDocument
public abstract boolean cancelDocument(DocSignProvider.DocSignAccount account, java.lang.String envelopeId, java.lang.String voidedReason)
Cancel an envelope- Parameters:
account
- API accountenvelopeId
- DocuSign envelop IDvoidedReason
- Optional reason- Returns:
- true if successful
-
webhook
public void webhook(java.io.InputStream in) throws java.io.IOException
Web-hook callback: call the web hook of target object from public servlet- Parameters:
in
- Input stream- Throws:
java.io.IOException
-
webhook
public static void webhook(DocSignProvider.DocSignStatus data)
Web-hook callback: call the web hook of target object from public servlet- Parameters:
data
- Event data
-
getDocument
public final DocSignProvider.DocSignStatus getDocument(java.lang.String envelopeId, boolean withDocs)
Call with current document status- Parameters:
envelopeId
- Envelope IDwithDocs
- Get the joined files (slower)- Returns:
- DocuSign status
-
getDocument
public abstract DocSignProvider.DocSignStatus getDocument(Grant g, java.lang.String envelopeId, boolean withDocs)
Call with current document status- Parameters:
g
- GrantenvelopeId
- Envelope IDwithDocs
- Get the joined files (slower)- Returns:
- DocuSign status
-
authent
public abstract DocSignProvider.DocSignAccount authent(Grant g) throws javax.security.auth.login.LoginException
Manage the provider authent to get account infos- Parameters:
g
- Grant- Throws:
javax.security.auth.login.LoginException
-
getInstance
public static DocSignProvider getInstance(java.lang.String provider)
Get isolated instance ofDocSignProvider
- Parameters:
provider
- PROVIDER_*- Returns:
- Isolated instance of
DocSignProvider
-
-