Skip to content

Commit 7cfafb6

Browse files
added manifest support
1 parent 0611cea commit 7cfafb6

158 files changed

Lines changed: 2218 additions & 2625 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

app/__init__.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import os
22

3-
from flask import Flask, session
3+
from flask import Flask, session, current_app
44
from flask_wtf.csrf import CSRFProtect
55

66
from .ds_config import DS_CONFIG
@@ -16,15 +16,21 @@
1616
session_path = "/tmp/python_recipe_sessions"
1717

1818
if EXAMPLES_API_TYPE["Rooms"]:
19+
manifest_url = DS_CONFIG["rooms_manifest_url"]
1920
app = Flask(__name__, template_folder="rooms/templates")
2021
elif EXAMPLES_API_TYPE["Click"]:
22+
manifest_url = DS_CONFIG["click_manifest_url"]
2123
app = Flask(__name__, template_folder="click/templates")
2224
elif EXAMPLES_API_TYPE["Monitor"]:
25+
manifest_url = DS_CONFIG["monitor_manifest_url"]
2326
app = Flask(__name__, template_folder="monitor/templates")
2427
elif EXAMPLES_API_TYPE["Admin"]:
28+
manifest_url = DS_CONFIG["admin_manifest_url"]
2529
app = Flask(__name__, template_folder="admin/templates")
2630
else:
31+
manifest_url = DS_CONFIG["esign_manifest_url"]
2732
app = Flask(__name__)
33+
2834
app.config.from_pyfile("config.py")
2935

3036
# See https://flask-wtf.readthedocs.io/en/stable/csrf.html
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<button type="submit" class="btn btn-docu">{{ session['manifest']['SupportingTexts']['ContinueButton'] }}</button>
Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,41 @@
11
<!-- extend base layout --> {% extends "base.html" %} {% block content %}
22

3-
<h4>1. Create a new active eSignature user</h4>
4-
<p>Demonstrates how to create a new eSignature user and activate their account automatically.</p>
3+
{% include 'example_info.html' %}
54

6-
{% if show_doc %}
7-
<p><a target='_blank' href='{{ documentation | safe }}'>Documentation</a> about this example.</p>
8-
{% endif %}
9-
10-
<p>API methods used:
11-
<a target='_blank' href="https://developers.docusign.com/docs/esign-rest-api/reference/accounts/accountpermissionprofiles/list/">AccountPermissionProfiles:list</a>,
12-
<a target='_blank' href="https://developers.docusign.com/docs/esign-rest-api/reference/usergroups/groups/list/">Groups:list</a>,
13-
<a target='_blank' href="https://developers.docusign.com/docs/admin-api/reference/usermanagement/esignusermanagement/createuser/">eSignUserManagement:createUser</a>.
14-
</p>
15-
<p>
16-
View source file <a target="_blank" href="{{ source_url | safe }}">{{ source_file }}</a> on GitHub.
17-
</p>
5+
{% set form_index = 0 %}
6+
{% set user_name_index = 0 %}
7+
{% set first_name_index = 1 %}
8+
{% set last_name_index = 2 %}
9+
{% set user_email_index = 3 %}
10+
{% set profile_index = 4 %}
11+
{% set group_index = 5 %}
1812

1913
<form class="eg" action="" method="post" data-busy="form">
14+
{% if 'Forms' in example and 'FormName' in example['Forms'][form_index] %}
15+
<p>{{ example['Forms'][form_index]['FormName'] | safe }}</p>
16+
{% endif %}
17+
2018
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
2119
<div class="form-group">
22-
<label for="user_name">User Name</label>
20+
<label for="user_name">{{ example['Forms'][form_index]['Inputs'][user_name_index]['InputName'] }}</label>
2321
<input type="text" class="form-control" id="user_name" name="user_name" required>
2422
</div>
2523
<div class="form-group">
26-
<label for="first_name">First Name</label>
27-
<input type="text" class="form-control" id="first_name" name="first_name" placeholder="John" required>
24+
<label for="first_name">{{ example['Forms'][form_index]['Inputs'][first_name_index]['InputName'] }}</label>
25+
<input type="text" class="form-control" id="first_name" name="first_name" placeholder="{{ example['Forms'][form_index]['Inputs'][first_name_index]['InputPlaceholder'] }}" required>
2826
</div>
2927
<div class="form-group">
30-
<label for="last_name">Last Name</label>
31-
<input type="text" class="form-control" id="last_name" name="last_name" placeholder="Dow" required>
28+
<label for="last_name">{{ example['Forms'][form_index]['Inputs'][last_name_index]['InputName'] }}</label>
29+
<input type="text" class="form-control" id="last_name" name="last_name" placeholder="{{ example['Forms'][form_index]['Inputs'][last_name_index]['InputPlaceholder'] }}" required>
3230
</div>
3331
<div class="form-group">
34-
<label for="user_email">Email</label>
35-
<input type="email" class="form-control" id="user_email" name="user_email" placeholder="example0001@example.com" required>
32+
<label for="user_email">{{ example['Forms'][form_index]['Inputs'][user_email_index]['InputName'] }}</label>
33+
<input type="email" class="form-control" id="user_email" name="user_email" placeholder="{{ example['Forms'][form_index]['Inputs'][user_email_index]['InputPlaceholder'] }}" required>
3634
<small id="accessHelp" class="form-text text-muted">This email address must use the same domain that has been claimed by your organization.</small>
3735
</div>
3836
{% if permission_profiles %}
3937
<div class="form-group">
40-
<label for="profile_id">eSignature permission profile</label>
38+
<label for="profile_id">{{ example['Forms'][form_index]['Inputs'][profile_index]['InputName'] }}</label>
4139
<select class="form-control" id="profile_id" name="profile_id">
4240
{% for profile in permission_profiles %}
4341
<option value={{profile["permission_profile_id"]}}>{{profile["permission_profile_name"]}}</option>
@@ -50,7 +48,7 @@ <h4>1. Create a new active eSignature user</h4>
5048
{% endif %}
5149
{% if groups %}
5250
<div class="form-group">
53-
<label for="group_id">eSignature group</label>
51+
<label for="group_id">{{ example['Forms'][form_index]['Inputs'][group_index]['InputName'] }}</label>
5452
<select class="form-control" id="group_id" name="group_id">
5553
{% for group in groups %}
5654
<option value={{group["group_id"]}}>{{group["group_name"]}}</option>
@@ -61,7 +59,7 @@ <h4>1. Create a new active eSignature user</h4>
6159
<p>Problem: Please first create a DocuSign group.
6260
</br>Thank you.</p>
6361
{% endif %}
64-
<button type="submit" class="btn btn-docu">Continue</button>
62+
{% include 'continue_button.html' %}
6563
</form>
6664

6765
{% endblock %}
Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,42 @@
11
<!-- extend base layout --> {% extends "base.html" %} {% block content %}
22

3-
<h4>2. Create a new active user for CLM and eSignature</h4>
4-
<p>Demonstrates how to create a new DocuSign user (valid for both CLM and eSignature APIs) and activate their account automatically.</p>
3+
{% include 'example_info.html' %}
54

6-
{% if show_doc %}
7-
<p><a target='_blank' href='{{ documentation | safe }}'>Documentation</a> about this example.</p>
8-
{% endif %}
9-
10-
<p>API methods used:
11-
<a target='_blank' href="https://developers.docusign.com/docs/admin-api/reference/usermanagement/multiproductusermanagement/getproductpermissionprofiles/">MultiProductUserManagement:getProductPermissionProfiles</a>,
12-
<a target ='_blank' href="https://developers.docusign.com/docs/admin-api/reference/usermanagement/multiproductusermanagement/getdsgroups/">MultiProductUserManagement:getDsGroups</a>,
13-
<a target ='_blank' href="https://developers.docusign.com/docs/admin-api/reference/usermanagement/multiproductusermanagement/addorupdateuser/">MultiProductUserManagement:addOrUpdateUser</a>.
14-
</p>
15-
<p>
16-
View source file <a target="_blank" href="{{ source_url | safe }}">{{ source_file }}</a> on GitHub.
17-
</p>
5+
{% set form_index = 0 %}
6+
{% set user_name_index = 0 %}
7+
{% set first_name_index = 1 %}
8+
{% set last_name_index = 2 %}
9+
{% set user_email_index = 3 %}
10+
{% set esign_profile_index = 4 %}
11+
{% set clm_profile_index = 5 %}
12+
{% set group_index = 6 %}
1813

1914
<form class="eg" action="" method="post" data-busy="form">
15+
{% if 'Forms' in example and 'FormName' in example['Forms'][form_index] %}
16+
<p>{{ example['Forms'][form_index]['FormName'] | safe }}</p>
17+
{% endif %}
18+
2019
<div class="form-group">
21-
<label for="user_name">User Name</label>
20+
<label for="user_name">{{ example['Forms'][form_index]['Inputs'][user_name_index]['InputName'] }}</label>
2221
<input type="text" class="form-control" id="user_name" name="user_name" required>
2322
</div>
2423
<div class="form-group">
25-
<label for="first_name">First Name</label>
24+
<label for="first_name">{{ example['Forms'][form_index]['Inputs'][first_name_index]['InputName'] }}</label>
2625
<input type="text" class="form-control" id="first_name" name="first_name" required>
2726
</div>
2827
<div class="form-group">
29-
<label for="last_name">Last Name</label>
28+
<label for="last_name">{{ example['Forms'][form_index]['Inputs'][last_name_index]['InputName'] }}</label>
3029
<input type="text" class="form-control" id="last_name" name="last_name" required>
3130
</div>
3231
<div class="form-group">
33-
<label for="email">Email</label>
32+
<label for="email">{{ example['Forms'][form_index]['Inputs'][user_email_index]['InputName'] }}</label>
3433
<input type="email" class="form-control" id="email" name="email"
3534
aria-describedby="emailHelp" required>
3635
<small id="emailHelp" class="form-text text-muted">We will never share your email with anyone else.</small>
3736
</div>
3837
{% if esign_permission_profiles_list %}
3938
<div class="form-group">
40-
<label for="esign_permission_profile">eSignature permission profile</label>
39+
<label for="esign_permission_profile">{{ example['Forms'][form_index]['Inputs'][esign_profile_index]['InputName'] }}</label>
4140
<select class="form-control" id="esign_permission_profile" name="esign_permission_profile">
4241
{% for profile in esign_permission_profiles_list %}
4342
<option value="{{profile}}">{{profile}}</option>
@@ -50,7 +49,7 @@ <h4>2. Create a new active user for CLM and eSignature</h4>
5049
{% endif %}
5150
{% if clm_permission_profiles_list %}
5251
<div class="form-group">
53-
<label for="clm_permission_profile">CLM permission profile</label>
52+
<label for="clm_permission_profile">{{ example['Forms'][form_index]['Inputs'][clm_profile_index]['InputName'] }}</label>
5453
<select class="form-control" id="clm_permission_profile" name="clm_permission_profile">
5554
{% for profile in clm_permission_profiles_list %}
5655
<option value="{{profile}}">{{profile}}</option>
@@ -63,7 +62,7 @@ <h4>2. Create a new active user for CLM and eSignature</h4>
6362
{% endif %}
6463
{% if ds_groups %}
6564
<div class="form-group">
66-
<label for="ds_group">DocuSign Admin Group</label>
65+
<label for="ds_group">{{ example['Forms'][form_index]['Inputs'][group_index]['InputName'] }}</label>
6766
<select class="form-control" id="ds_group" name="ds_group">
6867
{% for group in ds_groups %}
6968
<option value={{group["ds_group_id"]}}>{{group["group_name"]}}</option>
@@ -77,7 +76,7 @@ <h4>2. Create a new active user for CLM and eSignature</h4>
7776

7877

7978
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
80-
<button type="submit" class="btn btn-docu">Continue</button>
79+
{% include 'continue_button.html' %}
8180
</form>
8281

8382
{% endblock %}
Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,14 @@
11
<!-- extend base layout --> {% extends "base.html" %} {% block content %}
22

3-
<h4>3. Bulk export user data</h4>
4-
<p>Demonstrates how to bulk-export user accounts within an organization into a CSV (comma separated value) file.</p>
5-
6-
{% if show_doc %}
7-
<p><a target='_blank' href='{{ documentation | safe }}'>Documentation</a> about this example.</p>
8-
{% endif %}
9-
10-
<p>API methods used:
11-
<a target='_blank' href="https://developers.docusign.com/docs/admin-api/reference/bulkoperations/userexport/createuserlistexport/">UserExport:createUserListExport</a>,
12-
<a target='_blank' href="https://developers.docusign.com/docs/admin-api/reference/bulkoperations/userexport/getuserlistexport/">UserExport:getUserListExport</a>.
13-
</p>
14-
<p>
15-
View source file <a target="_blank" href="{{ source_url | safe }}">{{ source_file }}</a> on GitHub.
16-
</p>
3+
{% include 'example_info.html' %}
174

185
<form class="eg" action="" method="post" data-busy="form">
6+
{% if 'Forms' in example and 'FormName' in example['Forms'][form_index] %}
7+
<p>{{ example['Forms'][form_index]['FormName'] | safe }}</p>
8+
{% endif %}
9+
1910
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
20-
<button type="submit" class="btn btn-docu">Continue</button>
11+
{% include 'continue_button.html' %}
2112
</form>
2213

2314
{% endblock %}

app/admin/templates/eg004_add_users_via_bulk_import.html

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,16 @@
11
<!-- extend base layout --> {% extends "base.html" %} {% block content %}
22

3-
<h4>4. Add users via bulk import</h4>
4-
<p>Demonstrates how to bulk-import users and add user data from an example CSV (comma-separated value) file into a DocuSign Admin organization.</p>
3+
{% include 'example_info.html' %}
4+
5+
{% set form_index = 0 %}
6+
{% set file_index = 0 %}
57

6-
{% if show_doc %}
7-
<p><a target='_blank' href='{{ documentation | safe }}'>Documentation</a> about this example.</p>
8-
{% endif %}
9-
10-
<p>API methods used:
11-
<a target='_blank' href="https://developers.docusign.com/docs/admin-api/reference/bulkoperations/userimport/addbulkuserimport/">UserImport:addBulkUserImport</a>,
12-
<a target='_blank' href="https://developers.docusign.com/docs/admin-api/reference/bulkoperations/userimport/getbulkuserimportrequest/">UserImport:getBulkUserImportRequest</a>.
13-
</p>
14-
<p>
15-
View source file <a target="_blank" href="{{ source_url | safe }}">{{ source_file }}</a> on GitHub.
16-
</p>
17-
<br>
18-
<p>
19-
You can <a href="eg004examplecsv">download an example of the required csv file</a>
20-
and change it as you see fit.
21-
</p>
228
<form class="eg" action="" method="post" data-busy="form" enctype="multipart/form-data">
23-
<label>Upload your CSV file:</label>
9+
{% if 'Forms' in example and 'FormName' in example['Forms'][form_index] %}
10+
<p>{{ example['Forms'][form_index]['FormName'] | safe }}</p>
11+
{% endif %}
12+
13+
<label>{{ example['Forms'][form_index]['Inputs'][file_index]['InputName'] }}</label>
2414
<div class="form-group">
2515
<input type="file" name="csv_file" required>
2616
</div>
Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,14 @@
11
<!-- extend base layout --> {% extends "base.html" %} {% block content %}
22

3-
<h4>5. Audit users</h4>
4-
<p>Demonstrates how to audit the users in your account by retrieving the profiles of users that were modified after a specified date.</p>
5-
6-
{% if show_doc %}
7-
<p><a target='_blank' href='{{ documentation | safe }}'>Documentation</a> about this example.</p>
8-
{% endif %}
9-
10-
<p>API methods used:
11-
<a target='_blank' href="https://developers.docusign.com/docs/admin-api/reference/usermanagement/users/getusers/">Users:getUsers</a>,
12-
<a target='_blank' href="https://developers.docusign.com/docs/admin-api/reference/usermanagement/esignusermanagement/getuserprofiles/">eSignUserManagement:getUserProfiles</a>.
13-
</p>
14-
<p>
15-
View source file <a target="_blank" href="{{ source_url | safe }}">{{ source_file }}</a> on GitHub.
16-
</p>
3+
{% include 'example_info.html' %}
174

185
<form class="eg" action="" method="post" data-busy="form">
6+
{% if 'Forms' in example and 'FormName' in example['Forms'][form_index] %}
7+
<p>{{ example['Forms'][form_index]['FormName'] | safe }}</p>
8+
{% endif %}
9+
1910
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
20-
<button type="submit" class="btn btn-docu">Continue</button>
11+
{% include 'continue_button.html' %}
2112
</form>
2213

2314
{% endblock %}
Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,21 @@
11
<!-- extend base layout --> {% extends "base.html" %} {% block content %}
22

3-
<h4>6. Retrieve the user's DocuSign profile using an email address</h4>
4-
<p>Demonstrates how to obtain the user’s DocuSign profile information across all DocuSign accounts by specifying the user’s email address.</p>
3+
{% include 'example_info.html' %}
54

6-
{% if show_doc %}
7-
<p><a target='_blank' href='{{ documentation | safe }}'>Documentation</a> about this example.</p>
8-
{% endif %}
9-
10-
<p>API method used:
11-
<a target="_blank" rel='noopener noreferrer'
12-
href="https://developers.docusign.com/docs/admin-api/reference/usermanagement/multiproductusermanagement/getuserdsprofilesbyemail/">MultiProductUserManagement:getUserDSProfilesByEmail</a>.
13-
</p>
14-
<p>
15-
View source file <a target="_blank" href="{{ source_url | safe }}">{{ source_file }}</a> on GitHub.
16-
</p>
5+
{% set form_index = 0 %}
6+
{% set email_index = 0 %}
177

188
<form class="eg" action="" method="post" data-busy="form">
9+
{% if 'Forms' in example and 'FormName' in example['Forms'][form_index] %}
10+
<p>{{ example['Forms'][form_index]['FormName'] | safe }}</p>
11+
{% endif %}
12+
1913
<div class="form-group">
20-
<label for="email">Email address</label>
21-
<input type="email" class="form-control" id="email" name="email" placeholder="example@example.com" required>
14+
<label for="email">{{ example['Forms'][form_index]['Inputs'][email_index]['InputName'] }}</label>
15+
<input type="email" class="form-control" id="email" name="email" placeholder="{{ example['Forms'][form_index]['Inputs'][email_index]['InputPlaceholder'] }}" required>
2216
</div>
2317
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
24-
<button type="submit" class="btn btn-docu">Continue</button>
18+
{% include 'continue_button.html' %}
2519
</form>
2620

2721
{% endblock %}
Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,23 @@
11
<!-- extend base layout --> {% extends "base.html" %} {% block content %}
22

3-
<h4>7. Retrieve the user's DocuSign profile using a User ID</h4>
4-
<p>
5-
Demonstrates how to obtain the user’s DocuSign profile information across all DocuSign accounts by specifying the user’s User ID.
6-
</p>
3+
{% include 'example_info.html' %}
74

8-
{% if show_doc %}
9-
<p><a target='_blank' href='{{ documentation | safe }}'>Documentation</a> about this example.</p>
10-
{% endif %}
11-
12-
<p>API method used:
13-
<a target="_blank" rel='noopener noreferrer'
14-
href="https://developers.docusign.com/docs/admin-api/reference/usermanagement/multiproductusermanagement/getuserdsprofile/">MultiProductUserManagement:getUserDSProfile</a>.
15-
</p>
16-
<p>
17-
View source file <a target="_blank" href="{{ source_url | safe }}">{{ source_file }}</a> on GitHub.
18-
</p>
5+
{% set form_index = 0 %}
6+
{% set user_id_index = 0 %}
197

208
<form class="eg" action="" method="post" data-busy="form">
9+
{% if 'Forms' in example and 'FormName' in example['Forms'][form_index] %}
10+
<p>{{ example['Forms'][form_index]['FormName'] | safe }}</p>
11+
{% endif %}
12+
2113
<div class="form-group">
22-
<label for="user_id">User ID</label>
14+
<label for="user_id">{{ example['Forms'][form_index]['Inputs'][user_id_index]['InputName'] }}</label>
2315
<input type="text" class="form-control" id="user_id" name="user_id"
24-
placeholder="00000000-0000-0000-0000-000000000000" required
16+
placeholder="{{ example['Forms'][form_index]['Inputs'][user_id_index]['InputPlaceholder'] }}" required
2517
pattern="[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}">
2618
</div>
2719
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
28-
<button type="submit" class="btn btn-docu">Continue</button>
20+
{% include 'continue_button.html' %}
2921
</form>
3022

3123
{% endblock %}

0 commit comments

Comments
 (0)