Skip to content

Commit 28f1f69

Browse files
committed
2 parents eeb1306 + 16121ac commit 28f1f69

18 files changed

+79
-46
lines changed

src/main/java/com/docusign/controller/eSignature/examples/EG015ControllerGetTabValues.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,20 @@ protected void onInitModel(WorkArguments args, ModelMap model) throws Exception
3838
}
3939

4040
@Override
41-
// ***DS.snippet.0.start
4241
protected Object doWork(WorkArguments args, ModelMap model, HttpServletResponse response) throws ApiException {
43-
// Step 1. get envelope recipients
42+
//ds-snippet-start:eSign15Step2
4443
EnvelopesApi envelopesApi = createEnvelopesApi(session.getBasePath(), user.getAccessToken());
44+
//ds-snippet-end:eSign15Step2
45+
//ds-snippet-start:eSign15Step3
4546
EnvelopeFormData envelopeFormData = GetTabValuesService.getTabValues(
4647
envelopesApi,
4748
session.getAccountId(),
4849
session.getEnvelopeId());
50+
//ds-snippet-end:eSign15Step3
4951
DoneExample.createDefault(getTextForCodeExampleByApiType().ExampleName)
5052
.withJsonObject(envelopeFormData)
5153
.withMessage(getTextForCodeExampleByApiType().ResultsPageText)
5254
.addToModel(model, config);
5355
return DONE_EXAMPLE_PAGE;
5456
}
55-
// ***DS.snippet.0.end
5657
}

src/main/java/com/docusign/controller/eSignature/examples/EG016ControllerSetTabValues.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,23 +40,28 @@ protected Object doWork(WorkArguments args, ModelMap model,
4040

4141
EnvelopeDefinition envelope = SetTabValuesService.makeEnvelope(signerEmail, signerName);
4242

43-
// Step 2. Construct your API headers
43+
//ds-snippet-start:eSign16Step2
4444
ApiClient apiClient = createApiClient(session.getBasePath(), user.getAccessToken());
4545
EnvelopesApi envelopesApi = new EnvelopesApi(apiClient);
46+
//ds-snippet-end:eSign16Step2
4647

47-
// Step 5. Call the eSignature REST API
48+
// Call the eSignature REST API
49+
//ds-snippet-start:eSign16Step4
4850
EnvelopeSummary envelopeSummary = SetTabValuesService.createEnvelope(envelopesApi, accountId, envelope);
51+
//ds-snippet-end:eSign16Step4
4952

5053
String envelopeId = envelopeSummary.getEnvelopeId();
5154
session.setEnvelopeId(envelopeId);
5255

53-
// Step 6. Create the view request
56+
// Create the view request
57+
//ds-snippet-start:eSign16Step5
5458
RecipientViewRequest viewRequest = SetTabValuesService.makeRecipientViewRequest(
5559
signerEmail,
5660
signerName,
5761
config.getDsReturnUrl(),
5862
config.getDsPingUrl());
5963
ViewUrl viewUrl = SetTabValuesService.createRecipientView(envelopesApi, accountId, envelopeId, viewRequest);
64+
//ds-snippet-end:eSign16Step5
6065

6166
// State can be stored/recovered using the framework's session or a
6267
// query parameter on the returnUrl (see the makeRecipientViewRequest method)

src/main/java/com/docusign/controller/eSignature/examples/EG018ControllerEnvelopeCustomFieldValues.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,22 +38,22 @@ protected void onInitModel(WorkArguments args, ModelMap model) throws Exception
3838
}
3939

4040
@Override
41-
// ***DS.snippet.0.start
4241
protected Object doWork(WorkArguments args, ModelMap model, HttpServletResponse response) throws ApiException {
43-
// Step 2. Construct your API headers
42+
//ds-snippet-start:eSign18Step2
4443
EnvelopesApi envelopesApi = createEnvelopesApi(session.getBasePath(), user.getAccessToken());
45-
// Step 3. Call the eSignature REST API
44+
//ds-snippet-end:eSign18Step2
45+
//ds-snippet-start:eSign18Step3
4646
CustomFieldsEnvelope customFieldsEnvelope = EnvelopeCustomFieldValuesService.envelopeCustomFieldValues(
4747
envelopesApi,
4848
session.getAccountId(),
4949
session.getEnvelopeId()
5050
);
51+
//ds-snippet-end:eSign18Step3
5152

5253
DoneExample.createDefault(getTextForCodeExampleByApiType().ExampleName)
5354
.withJsonObject(customFieldsEnvelope)
5455
.withMessage(getTextForCodeExampleByApiType().ResultsPageText)
5556
.addToModel(model, config);
5657
return DONE_EXAMPLE_PAGE;
5758
}
58-
// ***DS.snippet.0.end
5959
}

src/main/java/com/docusign/controller/eSignature/examples/EG019ControllerAccessCodeAuthentication.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ public EG019ControllerAccessCodeAuthentication(DSConfiguration config, Session s
3333
}
3434

3535
@Override
36-
// ***DS.snippet.0.start
3736
protected Object doWork(WorkArguments args, ModelMap model,
3837
HttpServletResponse response) throws ApiException, IOException {
3938
// Step 1: Construct your API headers
@@ -63,5 +62,4 @@ protected Object doWork(WorkArguments args, ModelMap model,
6362

6463
return DONE_EXAMPLE_PAGE;
6564
}
66-
// ***DS.snippet.0.end
6765
}

src/main/java/com/docusign/controller/eSignature/examples/EG030ControllerApplyBrandToTemplate.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ protected Object doWork(WorkArguments args, ModelMap model, HttpServletResponse
7474
// Step 3: Construct your envelope JSON body
7575
EnvelopeDefinition envelope = makeEnvelope(args, session.getTemplateId());
7676

77-
// Step 5: Call the eSignature REST API
77+
// Step 4: Call the eSignature REST API
7878
EnvelopeSummary envelopeSummary = ApplyBrandToTemplateService.applyBrandToTemplate(
7979
envelopesApi,
8080
session.getAccountId(),
@@ -90,6 +90,7 @@ protected Object doWork(WorkArguments args, ModelMap model, HttpServletResponse
9090
return DONE_EXAMPLE_PAGE;
9191
}
9292

93+
//ds-snippet-start:eSign30Step3
9394
private static EnvelopeDefinition makeEnvelope(WorkArguments args, String templateId) {
9495
TemplateRole signer = new TemplateRole()
9596
.email(args.getSignerEmail())
@@ -107,4 +108,5 @@ private static EnvelopeDefinition makeEnvelope(WorkArguments args, String templa
107108
.brandId(args.getBrandId())
108109
.status(EnvelopeHelpers.ENVELOPE_STATUS_SENT);
109110
}
111+
//ds-snippet-end:eSign30Step3
110112
}

src/main/java/com/docusign/controller/eSignature/examples/EG032ControllerPauseSignatureWorkflow.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,23 +46,25 @@ protected Object doWork(WorkArguments args, ModelMap model, HttpServletResponse
4646
throws ApiException, IOException
4747
{
4848

49-
// Step 2: Construct your API headers
49+
//ds-snippet-start:eSign32Step2
5050
EnvelopesApi envelopesApi = createEnvelopesApi(this.session.getBasePath(), this.user.getAccessToken());
51-
52-
// Step 3: Construct your envelope JSON body
51+
//ds-snippet-end:eSign32Step2
52+
53+
// Construct your envelope JSON body
5354
EnvelopeDefinition envelope = PauseSignatureWorkflowService.createEnvelope(
5455
args.getSignerName(),
5556
args.getSignerEmail(),
5657
args.getSignerName2(),
5758
args.getSignerEmail2()
5859
);
5960

60-
// Step 4: Call the eSignature REST API
61+
//ds-snippet-start:eSign32Step4
6162
EnvelopeSummary envelopeSummary = PauseSignatureWorkflowService.pauseSignatureWorkflow(
6263
envelopesApi,
6364
this.session.getAccountId(),
6465
envelope
6566
);
67+
//ds-snippet-end:eSign32Step4
6668

6769
this.session.setEnvelopeId(envelopeSummary.getEnvelopeId());
6870
DoneExample.createDefault(this.title)

src/main/java/com/docusign/controller/eSignature/examples/EG039ControllerInPersonSigning.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,15 @@ protected Object doWork(WorkArguments args, ModelMap model,
5858
EnvelopeDefinition envelope = InPersonSigningService.makeEnvelope(hostEmail, hostName, signerName,
5959
ANCHOR_OFFSET_Y, ANCHOR_OFFSET_X, DOCUMENT_FILE_NAME, DOCUMENT_NAME);
6060

61-
// Step 3 start
61+
//ds-snippet-start:eSign39Step3
6262
ApiClient apiClient = createApiClient(basePath, accessToken);
6363
EnvelopesApi envelopesApi = new EnvelopesApi(apiClient);
6464

6565
EnvelopeSummary envelopeSummary = envelopesApi.createEnvelope(accountId, envelope);
66-
// Step 3 end
67-
// Step 5 start
66+
//ds-snippet-end:eSign39Step3
67+
//ds-snippet-start:eSign39Step5
6868
RecipientViewRequest viewRequest = InPersonSigningService.makeRecipientViewRequest(hostEmail, hostName, config);
69-
// Step 5 end
69+
//ds-snippet-end:eSign39Step5
7070

7171
ViewUrl viewUrl = InPersonSigningService.inPersonSigning(
7272
envelopesApi,

src/main/java/com/docusign/controller/eSignature/examples/EG040ControllerSetDocumentVisibility.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,14 @@ protected Object doWork(WorkArguments args, ModelMap model,
6666
EnvelopeDefinition envelope = SetDocumentVisibilityService.makeEnvelope(signerEmail, signerName, signer2Email,
6767
signer2Name, ccEmail, ccName, DOCUMENT_FILE_NAME_PDF, DOCUMENT_FILE_NAME_DOCX, DOCUMENT_FILE_NAME_HTML);
6868

69-
// Step 2 start
69+
//ds-snippet-start:eSign40Step2
7070
ApiClient apiClient = createApiClient(basePath, accessToken);
7171
EnvelopesApi envelopesApi = new EnvelopesApi(apiClient);
72-
// Step 2 end
72+
//ds-snippet-end:eSign40Step2
7373

74-
// Step 4 start
74+
//ds-snippet-start:eSign40Step4
7575
EnvelopeSummary envelopeSummary = envelopesApi.createEnvelope(accountId, envelope);
76-
// Step 4 end
76+
//ds-snippet-end:eSign40Step4
7777

7878
DoneExample.createDefault(title)
7979
.withMessage("The envelope has been created and sent!<br />Envelope ID "

src/main/java/com/docusign/controller/eSignature/examples/EG041ControllerCfrEmbeddedSigning.java

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,9 @@ protected Object doWork(WorkArguments args, ModelMap model,
5959
String phoneNumber = args.getPhoneNumber();
6060
String accountId = session.getAccountId();
6161

62-
// Step 2 start
62+
//ds-snippet-start:eSign41Step2
6363
ApiClient apiClient = createApiClient(session.getBasePath(), user.getAccessToken());
64-
// Step 2 end
6564

66-
// Step 3 start
6765
AccountsApi workflowDetails = new AccountsApi(apiClient);
6866
AccountIdentityVerificationResponse workflowRes = workflowDetails.getAccountIdentityVerification(session.getAccountId());
6967
List<AccountIdentityVerificationWorkflow> identityVerification = workflowRes.getIdentityVerification();
@@ -75,15 +73,16 @@ protected Object doWork(WorkArguments args, ModelMap model,
7573
workflowId = identityVerification.get(i).getWorkflowId();
7674
}
7775
}
78-
// Step 3 end
76+
//ds-snippet-end:eSign41Step2
77+
7978
logger.info("workflowId = " + workflowId);
8079
if (workflowId.equals(""))
8180
{
8281
throw new ApiException(0, getTextForCodeExample().CustomErrorTexts.get(0).ErrorMessage);
8382
}
8483

85-
86-
// Step 1. Create the envelope definition
84+
// Create the envelope definition
85+
//ds-snippet-start:eSign41Step4
8786
EnvelopeDefinition envelope = CfrEmbeddedSigningService.makeEnvelope(
8887
signerName,
8988
signerEmail,
@@ -96,26 +95,33 @@ protected Object doWork(WorkArguments args, ModelMap model,
9695
DOCUMENT_FILE_NAME,
9796
DOCUMENT_NAME);
9897

99-
// Step 2. Call DocuSign to create the envelope
98+
// Call DocuSign to create the envelope
10099
EnvelopesApi envelopesApi = new EnvelopesApi(apiClient);
101100
EnvelopeSummary envelopeSummary = envelopesApi.createEnvelope(accountId, envelope);
102101

103102
String envelopeId = envelopeSummary.getEnvelopeId();
103+
//ds-snippet-end:eSign41Step4
104+
104105
session.setEnvelopeId(envelopeId);
105106

106-
// Step 3. create the recipient view, the embedded signing
107+
// create the recipient view, the embedded signing
108+
//ds-snippet-start:eSign41Step5
107109
RecipientViewRequest viewRequest = CfrEmbeddedSigningService.makeRecipientViewRequest(
108110
signerEmail,
109111
signerName,
110112
config,
111113
signerClientId);
112114

115+
//ds-snippet-end:eSign41Step5
116+
117+
//ds-snippet-start:eSign41Step6
113118
ViewUrl viewUrl = CfrEmbeddedSigningService.embeddedSigning(
114119
envelopesApi,
115120
accountId,
116121
envelopeId,
117122
viewRequest
118123
);
124+
//ds-snippet-end:eSign41Step6
119125

120126
// Step 4. Redirect the user to the embedded signing
121127
// Don't use an iFrame!

src/main/java/com/docusign/controller/eSignature/services/AccessCodeAuthenticationService.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,12 @@ public static EnvelopeSummary accessCodeAuthentication(
1717
String accountId,
1818
EnvelopeDefinition envelope
1919
) throws ApiException {
20+
//ds-snippet-start:eSign19Step4
2021
return envelopesApi.createEnvelope(accountId, envelope);
22+
//ds-snippet-end:eSign19Step4
2123
}
2224

25+
//ds-snippet-start:eSign19Step3
2326
public static EnvelopeDefinition createEnvelope(
2427
String signerName,
2528
String signerEmail,
@@ -43,4 +46,5 @@ public static EnvelopeDefinition createEnvelope(
4346

4447
return envelope;
4548
}
49+
//ds-snippet-end:eSign19Step3
4650
}

0 commit comments

Comments
 (0)