Skip to content

Commit 826914d

Browse files
kemister85ShiridiGandhamtiny-ben-tran
authored
DOC-3143: Update key information about trial period behaviour for document converters on Tiny Cloud. (#3640)
* DOC-3143: update key information about trial period behaviour for document converters on Tiny Cloud. * Update modules/ROOT/pages/exportpdf.adoc Co-authored-by: shirqa <[email protected]> * Update modules/ROOT/pages/exportword.adoc Co-authored-by: shirqa <[email protected]> * Update modules/ROOT/pages/importword.adoc Co-authored-by: shirqa <[email protected]> * DOC-3143: add partial file for expected data structure for auth token. * Update modules/ROOT/pages/exportpdf.adoc * Update modules/ROOT/pages/exportword.adoc * Update modules/ROOT/pages/importword.adoc * Update JWT authentication documentation across export and import plugins including use of partials. --------- Co-authored-by: shirqa <[email protected]> Co-authored-by: tiny-ben-tran <[email protected]>
1 parent afba5ae commit 826914d

File tree

8 files changed

+87
-38
lines changed

8 files changed

+87
-38
lines changed

modules/ROOT/pages/exportpdf.adoc

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
= {pluginname} plugin
22
:plugincode: exportpdf
33
:pluginname: Export to PDF
4+
:pluginfilename: export-to-pdf
45
:navtitle: {pluginname}
56
:description: The {pluginname} feature provides the ability to generate a PDF file directly from the editor.
67
:description_short: Generate a PDF file directly from the editor.
@@ -22,29 +23,34 @@ liveDemo::exportpdf[]
2223

2324
To add the {pluginname} plugin to the editor, add `{plugincode}` to the `plugins` option in the editor configuration.
2425

25-
For example:
26-
26+
.Example:
2727
[source,js]
2828
----
2929
tinymce.init({
3030
selector: 'textarea',
3131
plugins: 'exportpdf',
3232
toolbar: 'exportpdf',
33+
// Below option is only required when using the cloud-based Export to PDF plugin from Tiny.Cloud.
34+
// Avoid setting it up during the trial period.
35+
exportpdf_token_provider: () => {
36+
return fetch('http://localhost:3000/jwt', { // specify your token endpoint
37+
method: 'POST',
38+
headers: { 'Content-Type': 'application/json' },
39+
}).then(response => response.json());
40+
},
3341
});
3442
----
3543

36-
[IMPORTANT]
37-
When using the {pluginname} plugin with the {companyname} Cloud service, JWT authentication is required to use the service. For more information on how to set up JWT authentication with {pluginname}, see examples:
44+
For more infomation on the exportpdf_token_provider option, see xref:exportpdf.adoc#exportpdf-token-provider[exportpdf_token_provider].
45+
46+
include::partial$misc/admon-jwt-authentication-requirements.adoc[]
3847

39-
* xref:export-to-pdf-with-jwt-authentication-nodejs.adoc[{pluginname} with JWT authentication (Node.js)]
40-
* xref:export-to-pdf-with-jwt-authentication-php.adoc[{pluginname} with JWT authentication (PHP)]
4148

4249
== Basic setup using the self-hosted service
4350

4451
To use the self-hosted version of the {pluginname} plugin, you need to set the `exportpdf_service_url` option to the URL of the service.
4552

46-
For example:
47-
53+
.Example:
4854
[source,js]
4955
----
5056
tinymce.init({

modules/ROOT/pages/exportword.adoc

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
= {pluginname} plugin
22
:plugincode: exportword
33
:pluginname: Export to Word
4+
:pluginfilename: export-to-word
45
:navtitle: {pluginname}
56
:description: The {pluginname} feature lets you generate a .docx (Microsoft Word document) file directly from the editor.
67
:description_short: Generate a .docx file directly from the editor.
@@ -36,20 +37,27 @@ tinymce.init({
3637
selector: 'textarea',
3738
plugins: 'exportword',
3839
toolbar: 'exportword',
40+
// Below option is only required when using the cloud-based Export to Word plugin from Tiny.Cloud.
41+
// Avoid setting it up during the trial period.
42+
exportword_token_provider: () => {
43+
return fetch('http://localhost:3000/jwt', { // specify your token endpoint
44+
method: 'POST',
45+
headers: { 'Content-Type': 'application/json' },
46+
}).then(response => response.json());
47+
},
3948
});
4049
----
4150

42-
[IMPORTANT]
43-
When using the {pluginname} plugin with the {companyname} Cloud service, JWT authentication is required to use the service. For more information on how to set up JWT authentication with {pluginname}, see examples:
51+
For more infomation on the exportword_token_provider option, see xref:exportword.adoc#exportword-token-provider[exportword_token_provider]
52+
53+
include::partial$misc/admon-jwt-authentication-requirements.adoc[]
4454

45-
* xref:export-to-word-with-jwt-authentication-nodejs.adoc[{pluginname} with JWT authentication (Node.js)]
46-
* xref:export-to-word-with-jwt-authentication-php.adoc[{pluginname} with JWT authentication (PHP)]
4755

4856
== Basic setup using the self-hosted service
4957

5058
To use the self-hosted version of the {pluginname} plugin, you need to set the `exportword_service_url` option to the URL of the service.
5159

52-
For example:
60+
.Example:
5361
[source,js]
5462
----
5563
tinymce.init({

modules/ROOT/pages/importword.adoc

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
= {pluginname} plugin
33
:plugincode: importword
44
:pluginname: Import from Word
5+
:pluginfilename: import-from-word
56
:navtitle: {pluginname}
67
:description: Provides a way to import .docx (Microsoft Word documents) or .dotx (Microsoft Word templates) files into the editor.
78
:description_short: Import .docx or .dotx files into the editor.
@@ -31,21 +32,27 @@ tinymce.init({
3132
selector: 'textarea',
3233
plugins: 'importword',
3334
toolbar: 'importword',
35+
// Below option is only required when using the cloud-based Import from Word plugin from Tiny.Cloud.
36+
// Avoid setting it up during the trial period.
37+
importword_token_provider: () => { // required when using the Import from Word plugin with Tiny Cloud.
38+
return fetch('http://localhost:3000/jwt', { // specify your token endpoint
39+
method: 'POST',
40+
headers: { 'Content-Type': 'application/json' },
41+
}).then(response => response.json());
42+
},
3443
});
3544
----
3645

37-
[IMPORTANT]
38-
When using the {pluginname} plugin with the {companyname} Cloud service, JWT authentication is required to use the service. For more information on how to set up JWT authentication with {pluginname}, see examples:
46+
For more infomation on the importword_token_provider option, see xref:importword.adoc#importword-token-provider[importword_token_provider].
47+
48+
include::partial$misc/admon-jwt-authentication-requirements.adoc[]
3949

40-
* xref:import-from-word-with-jwt-authentication-nodejs.adoc[{pluginname} with JWT authentication (Node.js)]
41-
* xref:import-from-word-with-jwt-authentication-php.adoc[{pluginname} with JWT authentication (PHP)]
4250

4351
== Basic setup using the self-hosted service
4452

4553
To use the self-hosted version of the {pluginname} plugin, you need to set the `importword_service_url` option to the URL of the service.
4654

47-
For example:
48-
55+
.Example:
4956
[source,js]
5057
----
5158
tinymce.init({

modules/ROOT/partials/configuration/exportpdf_token_provider.adoc

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ The `exportpdf_token_provider` option enables integration with a token-based aut
77

88
*Default value:* `undefined`
99

10+
*Return data:* xref:exportpdf.adoc#data-structure[`Token` object]
11+
1012
=== Example: using `exportpdf_token_provider`
1113

1214
[source,js]
@@ -15,7 +17,7 @@ tinymce.init({
1517
selector: 'textarea',
1618
plugins: 'exportpdf',
1719
toolbar: 'exportpdf',
18-
exportpdf_token_provider: () => {
20+
exportpdf_token_provider: () => { // required when using the Export to PDF plugin with Tiny Cloud.
1921
return fetch('http://localhost:3000/jwt', { // specify your token endpoint
2022
method: 'POST',
2123
headers: { 'Content-Type': 'application/json' },
@@ -24,8 +26,4 @@ tinymce.init({
2426
});
2527
----
2628

27-
[NOTE]
28-
The `exportpdf_token_provider` option is required when using the {companyname} Cloud service. For more information on how to set up JWT authentication with {pluginname}, see examples:
29-
30-
* xref:export-to-pdf-with-jwt-authentication-nodejs.adoc[Export to PDF with JWT authentication (Node.js)]
31-
* xref:export-to-pdf-with-jwt-authentication-php.adoc[Export to PDF with JWT authentication (PHP)]
29+
include::partial$misc/admon-document-converters-jwt-expected-data-structure.adoc[]

modules/ROOT/partials/configuration/exportword_token_provider.adoc

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ The `exportword_token_provider` option enables integration with a token-based au
77

88
*Default value:* `undefined`
99

10+
*Return data:* xref:exportword.adoc#data-structure[`Token` object]
11+
1012
=== Example: using `exportword_token_provider`
1113

1214
[source,js]
@@ -15,7 +17,7 @@ tinymce.init({
1517
selector: 'textarea',
1618
plugins: 'exportword',
1719
toolbar: 'exportword',
18-
exportword_token_provider: () => {
20+
exportword_token_provider: () => { // required when using the Export to Word plugin with Tiny Cloud.
1921
return fetch('http://localhost:3000/jwt', { // specify your token endpoint
2022
method: 'POST',
2123
headers: { 'Content-Type': 'application/json' },
@@ -24,9 +26,4 @@ tinymce.init({
2426
});
2527
----
2628

27-
28-
[NOTE]
29-
The `exportword_token_provider` option is required when using the {companyname} Cloud service. For more information on how to set up JWT authentication with {pluginname}, see examples:
30-
31-
* xref:export-to-word-with-jwt-authentication-nodejs.adoc[Export to Word with JWT authentication (Node.js)]
32-
* xref:export-to-word-with-jwt-authentication-php.adoc[Export to Word with JWT authentication (PHP)]
29+
include::partial$misc/admon-document-converters-jwt-expected-data-structure.adoc[]

modules/ROOT/partials/configuration/importword_token_provider.adoc

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ The `importword_token_provider` option enables integration with a token-based au
77

88
*Default value:* `undefined`
99

10+
*Return data:* xref:importword.adoc#data-structure[`Token` object]
11+
1012
=== Example: using `importword_token_provider`
1113

1214
[source,js]
@@ -15,7 +17,7 @@ tinymce.init({
1517
selector: 'textarea',
1618
plugins: 'importword',
1719
toolbar: 'importword',
18-
importword_token_provider: () => {
20+
importword_token_provider: () => { // required when using the Import from Word plugin with Tiny Cloud.
1921
return fetch('http://localhost:3000/jwt', { // specify your token endpoint
2022
method: 'POST',
2123
headers: { 'Content-Type': 'application/json' },
@@ -24,8 +26,4 @@ tinymce.init({
2426
});
2527
----
2628

27-
[NOTE]
28-
The `importword_token_provider` option is required when using the {companyname} Cloud service. For more information on how to set up JWT authentication with {pluginname}, see examples:
29-
30-
* xref:import-from-word-with-jwt-authentication-nodejs.adoc[Import to Word with JWT authentication (Node.js)]
31-
* xref:import-from-word-with-jwt-authentication-php.adoc[Import to Word with JWT authentication (PHP)]
29+
include::partial$misc/admon-document-converters-jwt-expected-data-structure.adoc[]
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[[data-structure]]
2+
=== Data structure for the JWT token
3+
4+
The object containing the valid encoded token must match the following structure:
5+
6+
[source,js]
7+
----
8+
{
9+
token: "<encoded JWT string>"
10+
}
11+
----
12+
13+
[cols="1,1,1,3",options="header"]
14+
|===
15+
|Field |Type |Required? |Description
16+
|`+token+` |`+string+` |required |A Base64-encoded JSON Web Token (JWT) used for authentication and authorization.
17+
|===
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[IMPORTANT]
2+
====
3+
The {pluginname} plugin **requires** JWT authentication when using the {companyname} Cloud service.
4+
5+
* Configure the `{plugincode}_token_provider` option to specify the endpoint for retrieving a valid JWT token.
6+
7+
For more information on how to set up JWT authentication with {pluginname}, see examples:
8+
9+
* xref:{pluginfilename}-with-jwt-authentication-nodejs.adoc[{pluginname} with JWT authentication (Node.js)]
10+
* xref:{pluginfilename}-with-jwt-authentication-php.adoc[{pluginname} with JWT authentication (PHP)]
11+
12+
**Trial period behavior:**
13+
14+
* The {pluginname} plugin runs in evaluation mode and adds a watermark to exported content.
15+
* The `{plugincode}_token_provider` option is "not required" during the trial period.
16+
* If the trial period "expires" or the plugin lacks the necessary entitlement, it becomes _non-functional_.
17+
* Attempting to use JWT authentication during the trial will result in an _error_.
18+
====

0 commit comments

Comments
 (0)