Skip to content

Commit 8eb0185

Browse files
authored
Merge pull request #146 from docusign/feature/added-text-to-manifest
Changed text in Web Forms example
2 parents e8ec920 + daeceab commit 8eb0185

File tree

3 files changed

+19
-16
lines changed

3 files changed

+19
-16
lines changed

src/main/java/com/docusign/controller/webForms/examples/WEB001ControllerCreateAndEmbedForm.java

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,16 @@ public class WEB001ControllerCreateAndEmbedForm extends AbstractWebFormsControll
3939

4040
public static final String INSTANCE_TOKEN = "instanceToken";
4141

42+
private static final String EMDEDDED_BY_TEXT = "example";
43+
4244
public static final String URL = "url";
4345

4446
public static final String INTEGRATION_KEY = "integrationKey";
4547

4648
public WEB001ControllerCreateAndEmbedForm(DSConfiguration config, Session session, User user) {
4749
super(config, "web001", session, user);
4850
}
49-
51+
5052
@Override
5153
protected void onInitModel(WorkArguments args, ModelMap model) throws Exception {
5254
super.onInitModel(args, model);
@@ -57,12 +59,11 @@ protected void onInitModel(WorkArguments args, ModelMap model) throws Exception
5759
protected Object doWork(
5860
WorkArguments args,
5961
ModelMap model,
60-
HttpServletResponse response
61-
) throws ApiException, IOException, com.docusign.webforms.client.ApiException {
62+
HttpServletResponse response) throws ApiException, IOException, com.docusign.webforms.client.ApiException {
6263
if (session.getWebformTemplateId() == null) {
6364
ApiClient eSignApiClient = createESignApiClient(session.getBasePath(), user.getAccessToken());
6465
String accountId = session.getAccountId();
65-
66+
6667
EnvelopeTemplateResults envelopeTemplateResults = CreateTemplateService.searchTemplatesByName(
6768
eSignApiClient,
6869
accountId,
@@ -73,10 +74,9 @@ protected Object doWork(
7374
session.setWebformTemplateId(template.getTemplateId());
7475
} else {
7576
TemplateSummary template = CreateTemplateService.createTemplate(
76-
eSignApiClient,
77-
accountId,
78-
CreateAndEmbedFormService.prepareEnvelopeTemplate(TEMPLATE_NAME, DOCUMENT_FILE_NAME)
79-
);
77+
eSignApiClient,
78+
accountId,
79+
CreateAndEmbedFormService.prepareEnvelopeTemplate(TEMPLATE_NAME, DOCUMENT_FILE_NAME));
8080

8181
session.setWebformTemplateId(template.getTemplateId());
8282
}
@@ -89,14 +89,12 @@ protected Object doWork(
8989

9090
var webFormsApiClient = createWebFormsApiClient(
9191
config.getWebFormsBasePath(),
92-
user.getAccessToken()
93-
);
92+
user.getAccessToken());
9493

9594
WebFormSummaryList forms = CreateAndEmbedFormService.getForms(
9695
webFormsApiClient,
9796
session.getAccountId(),
98-
TEMPLATE_NAME
99-
);
97+
TEMPLATE_NAME);
10098

10199
if (forms.getItems() == null || forms.getItems().size() == 0) {
102100
return new RedirectView("web001");
@@ -107,10 +105,10 @@ protected Object doWork(
107105
WebFormInstance form = CreateAndEmbedFormService.createInstance(
108106
webFormsApiClient,
109107
session.getAccountId(),
110-
formId
111-
);
108+
formId);
112109

113110
session.setWebformTemplateId(null);
111+
model.addAttribute(EMDEDDED_BY_TEXT, getTextForCodeExampleByApiType());
114112
model.addAttribute(LAUNCHER_TEXTS, config.getCodeExamplesText().SupportingTexts);
115113
model.addAttribute(INSTANCE_TOKEN, form.getInstanceToken());
116114
model.addAttribute(URL, form.getFormUrl());

src/main/resources/application.example.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"DS_CLICK_BASE_PATH": "https://demo.docusign.net",
1111
"DS_MONITOR_BASE_PATH": "https://lens-d.docusign.net",
1212
"DS_ADMIN_BASE_PATH": "https://api-d.docusign.net",
13-
"DS_WEBFORMS_BASE_PATH": "https://apps-d.docusign.com/api/webforms/v1.1",
13+
"DS_WEBFORMS_BASE_PATH": "https://apps-d.docusign.com/api/webforms",
1414
"DS_MAESTRO_BASE_PATH": "https://apps-d.docusign.com/api/maestro",
1515

1616
"Gateway_Name": "{DS_PAYMENT_GATEWAY_NAME}",

src/main/webapp/WEB-INF/templates/views/pages/webforms/examples/embed.jsp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@
1010
<body>
1111
<div id="app">
1212
<div id="webform-customer-app-area">
13-
<h5 id="webforms-heading">The web form has been embedded below using the Docusign JS library.</h5>
13+
<c:forEach var="page" items="${example.getAdditionalPage()}">
14+
<c:if test="${page.getName() == 'webforms_heading'}">
15+
<h5 id="webforms-heading">${page.getResultsPageText()}</h5>
16+
</c:if>
17+
</c:forEach>
18+
1419
<div id="docusign" class="webform-iframe-container">
1520
<p>Web Form will render here</p>
1621
</div>

0 commit comments

Comments
 (0)