Configuration
Frontend SDK integration uses the JSSDK initialization configuration to pass necessary information to Filez Document Platform.
userinfo
Properties
| Field | Required | Description |
|---|---|---|
| id | Yes | User ID |
| display_name | Yes | User nickname |
| Yes | User email, can be the same as id | |
| photo_url | No | User avatar |
JSON Representation
{
"id": "301", // User ID
"display_name": "docstest02", // User nickname
"email": "docstest02@lenovocloud.com", // User email
"photo_url": "https://avatar.thirdparty.com/testOrg/people/301.png" // User avatar
}
meta Description
meta supports the following information. Other information will be filtered out. Only a subset of the following fields can be provided if desired.
Properties
| Field | Required | Type | Example Value | Description |
|---|---|---|---|---|
| id | Yes | String | 577 | Unique file ID, must be consistent with docId in the request URL |
| name | Yes | String | Preview Center.docx | File name including extension |
| modified_at | Yes | String | 2023-08-17T13:57:38.000Z | Modification time, format must be consistent with the example on the left. See below for details |
| created_by.id | Yes | String | 301 | Document creator ID |
| created_by.name | Yes | String | docstest02 | Document creator name |
| permissions.write | Yes | Boolean | true | Whether the user has edit permission |
| permissions.read | Yes | Boolean | true | Whether the user has read permission |
| permissions.download | No | Boolean | true | Whether the file can be downloaded. If it cannot be downloaded, the file content also cannot be copied elsewhere. Default is false |
| permissions.print | No | Boolean | true | Whether the file can be printed. Default is false |
| role | No | String | commenter | Can be "contributor", "commenter", or "auditor". No default value |
| waterMark.line1 | No | String | Filez zOffice docstest02 | First line of watermark, empty by default |
| waterMark.line2 | No | String | last modified user | Second line of watermark, empty by default |
| waterMark.line3 | No | String | product info | Third line of watermark, empty by default |
| waterMark.line4 | No | String | more info | Fourth line of watermark, empty by default |
| waterMark.withData | No | Boolean | true | Whether the watermark includes date, default true |
| waterMark.fontcolor | No | String | #cecece | Watermark color, default gray |
| waterMark.transparent | No | Number | 70 | Transparency. The smaller the value, the more transparent it is. Default is 70 (numeric type) |
| waterMark.rotation | No | Number | 315 | Rotation angle, range 0–360, e.g. left tilt = 315, right tilt = 45, horizontal = 0 (numeric type) |
| waterMark.fontsize | No | String | 16 | Watermark font size, default 16 |
| waterMark.font | No | String | 黑体 | Watermark font, default is "黑体" |
| waterMark.spacing | No | Number | 50 | Line spacing, default 50 (numeric type) |
| owner.id | No | String | 301 | Document owner ID |
| owner.name | No | String | docstest02 | Document owner name |
| extension.previewWithTrackChange | No | Boolean | false | true means track changes are automatically shown in preview; false or not provided means not shown. Only for word-processing documents |
| extension.trackChangeForceOn | No | Boolean | false | true means track changes are forced on during editing and cannot be turned off; false or not provided means not forced on. Only for word-processing documents |
JSON Representation
{
"id": "577",
"name": "Preview Center.docx",
"modified_at": "2023-08-17T13:57:38.000Z",
"created_by": {
"id": "301",
"name": "docstest02"
},
"permissions": {
"write": true, // Controls whether the document can be edited
"read": true // Controls whether the document can be previewed
},
"role": "commenter", // Optional. Indicates the user's role in the zOffice editor for this document (only for word-processing documents). Can be "contributor", "commenter", or "auditor".
"extension": {
"previewWithTrackChange": false, // true: show track changes automatically in preview; false or not provided: do not show. Only for word-processing documents.
"trackChangeForceOn": false // true: force track changes on during editing and cannot be turned off; false or not provided: not forced on. Only for word-processing documents.
},
"waterMark": { // Watermark-related settings
"linel": "Liming liming@lenovo.com", // e.g. last modifier info
"line2": "Zhang San zhangsan@lenovo.com", // e.g. editor/viewer info
"line3": "", // e.g. other custom text
"line4": "", // e.g. other custom text
"withDate": true, // Whether to append date after each line
"fontcolor": "#fD4147", // RGB value
"transparent": 30, // 0–100, transparency. The smaller the value, the more transparent.
"rotation": 315, // 0–360, rotation angle; left tilt=315, right tilt=45, horizontal=0
"fontsize": "72",
"font": "黑体"
}
}
Notes for Implementing modified_at
Please refer to: Cache Description
openConfig
Properties
| Field | Required | Type | Example Value | Description |
|---|---|---|---|---|
| action | Yes | String | edit or view | Open online edit or preview page |
JSON Representation
{
"action": "edit"
}
repoConfig
Properties
| Field | Required | Type | Example Value | Description |
|---|---|---|---|---|
| id | Yes | String | 3rd-party | Third-party application ID |
| downloadUrl | Yes | String | https://download.lenovocloud.com/v2/context/577/content | URL for downloading the file |
| uploadUrl | Yes | String | https://upload.lenovocloud.com/v2/context/577/content | URL for uploading the file |
| params | No | Object | Parameters passed when calling third-party callbacks |
JSON Representation
{
"id": "3rd-party",
"downloadUrl": "https://demohost/v2/context/577/content",
"uploadUrl": "https://demohost/v2/context/577/content",
"params": {
"x-param-1": "aaa",
"x-param-2": "bbb"
}
}
repoConfig.params
Information in params will be passed back in headers, cookies, and query parameters when calling third-party interfaces.
For example, when params is as above and the third-party interface is /v2/context/docId/content, the actual request received by the third-party will be:
Request URL: /v2/context/docId/content?x-param-1=aaa&x-param-2=bbb
Request Headers:
x-param-1: aaa
x-param-2: bbb
Cookie: x-param-1=aaa;x-param-2=bbb
Note: Parameters that need to be passed back in headers must start with x- (this can be changed by modifying the special configuration headerPrefix default value).
token
Signature for other parameters, used to verify the validity of the request. For details, see Signature.
documentServerAddr
Address for accessing the document server, including protocol, host name, and port. If a proxy path is configured in the third-party application, the proxy path must also be included.