Skip to content

Commit e553a7b

Browse files
committed
2 parents 511e805 + 899c7e8 commit e553a7b

File tree

4 files changed

+46
-10
lines changed

4 files changed

+46
-10
lines changed

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<oauth2.version>2.5.6</oauth2.version>
2727
<commonsio.version>2.16.1</commonsio.version>
2828

29-
<esignature.version>4.6.0-RC1</esignature.version>
29+
<esignature.version>5.0.0-RC1</esignature.version>
3030
<rooms.version>1.4.3</rooms.version>
3131
<click.version>1.5.0</click.version>
3232
<monitor.version>1.4.0</monitor.version>

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

+2-4
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,11 @@ protected Object doWork(WorkArguments args, ModelMap model,
5858
envelopesApi,
5959
accountId,
6060
envelopeId,
61-
config.getDsReturnUrl());
61+
config.getDsReturnUrl(),
62+
args.getStartingView());
6263

6364
// Switch to Recipient and Documents view if requested by the user
6465
String url = viewUrl.getUrl();
65-
if ("recipient".equalsIgnoreCase(args.getStartingView())) {
66-
url = url.replace("send=1", "send=0");
67-
}
6866

6967
return new RedirectView(url);
7068
}

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

+41-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@
66
import com.docusign.esign.client.ApiException;
77
import com.docusign.esign.model.EnvelopeDefinition;
88
import com.docusign.esign.model.EnvelopeSummary;
9-
import com.docusign.esign.model.ReturnUrlRequest;
9+
import com.docusign.esign.model.EnvelopeViewDocumentSettings;
10+
import com.docusign.esign.model.EnvelopeViewRecipientSettings;
11+
import com.docusign.esign.model.EnvelopeViewRequest;
12+
import com.docusign.esign.model.EnvelopeViewSettings;
13+
import com.docusign.esign.model.EnvelopeViewTaggerSettings;
14+
import com.docusign.esign.model.EnvelopeViewTemplateSettings;
1015
import com.docusign.esign.model.ViewUrl;
1116

1217
import java.io.IOException;
@@ -17,13 +22,46 @@ public static ViewUrl createSenderView(
1722
EnvelopesApi envelopesApi,
1823
String accountId,
1924
String envelopeId,
20-
String dsReturnUrl
25+
String dsReturnUrl,
26+
String startingScreen
2127
) throws ApiException {
2228
// Create the sender view.
2329
// Set the url where you want the recipient to go once they are done
2430
// signing should typically be a callback route somewhere in your app.
25-
ReturnUrlRequest viewRequest = new ReturnUrlRequest();
31+
EnvelopeViewRecipientSettings recipientSettings = new EnvelopeViewRecipientSettings();
32+
recipientSettings.setShowEditRecipients("false");
33+
recipientSettings.setShowContactsList("false");
34+
35+
EnvelopeViewDocumentSettings documentSettings = new EnvelopeViewDocumentSettings();
36+
documentSettings.setShowEditDocuments("false");
37+
documentSettings.setShowEditDocumentVisibility("false");
38+
documentSettings.setShowEditPages("false");
39+
40+
EnvelopeViewTaggerSettings taggerSettings = new EnvelopeViewTaggerSettings();
41+
taggerSettings.setPaletteSections("default");
42+
taggerSettings.setPaletteDefault("custom");
43+
44+
EnvelopeViewTemplateSettings templateSettings = new EnvelopeViewTemplateSettings();
45+
templateSettings.setShowMatchingTemplatesPrompt("true");
46+
47+
EnvelopeViewSettings viewSettings = new EnvelopeViewSettings();
48+
viewSettings.setStartingScreen(startingScreen);
49+
viewSettings.setSendButtonAction("send");
50+
viewSettings.setShowBackButton("false");
51+
viewSettings.setBackButtonAction("previousPage");
52+
viewSettings.setShowHeaderActions("false");
53+
viewSettings.setShowDiscardAction("false");
54+
viewSettings.setLockToken("");
55+
viewSettings.setRecipientSettings(recipientSettings);
56+
viewSettings.setDocumentSettings(documentSettings);
57+
viewSettings.setTaggerSettings(taggerSettings);
58+
viewSettings.setTemplateSettings(templateSettings);
59+
60+
EnvelopeViewRequest viewRequest = new EnvelopeViewRequest();
2661
viewRequest.setReturnUrl(dsReturnUrl);
62+
viewRequest.setViewAccess("envelope");
63+
viewRequest.setSettings(viewSettings);
64+
2765
return envelopesApi.createSenderView(accountId, envelopeId, viewRequest);
2866
}
2967
//ds-snippet-end:eSign11Step3

src/main/webapp/WEB-INF/templates/views/pages/esignature/examples/eg011.jsp

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
</label>
2929

3030
<select id="startingView" name="startingView" class="form-control">
31-
<option value="tagging" selected>Tagging view</option>
32-
<option value="recipient">Recipient &amp; Documents view</option>
31+
<option value="Tagger" selected>Tagging view</option>
32+
<option value="Prepare">Prepare view</option>
3333
</select>
3434
</div>
3535
<div class="form-group">

0 commit comments

Comments
 (0)