Skip to main content

Configuration

Frontend SDK integration uses the JSSDK initialization configuration to pass necessary information to Filez Document Platform.

userinfo

Properties

FieldRequiredDescription
idYesUser ID
display_nameYesUser nickname
emailYesUser email, can be the same as id
photo_urlNoUser 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

FieldRequiredTypeExample ValueDescription
idYesString577Unique file ID, must be consistent with docId in the request URL
nameYesStringPreview Center.docxFile name including extension
modified_atYesString2023-08-17T13:57:38.000ZModification time, format must be consistent with the example on the left. See below for details
created_by.idYesString301Document creator ID
created_by.nameYesStringdocstest02Document creator name
permissions.writeYesBooleantrueWhether the user has edit permission
permissions.readYesBooleantrueWhether the user has read permission
permissions.downloadNoBooleantrueWhether the file can be downloaded. If it cannot be downloaded, the file content also cannot be copied elsewhere. Default is false
permissions.printNoBooleantrueWhether the file can be printed. Default is false
roleNoStringcommenterCan be "contributor", "commenter", or "auditor". No default value
waterMark.line1NoStringFilez zOffice docstest02First line of watermark, empty by default
waterMark.line2NoStringlast modified userSecond line of watermark, empty by default
waterMark.line3NoStringproduct infoThird line of watermark, empty by default
waterMark.line4NoStringmore infoFourth line of watermark, empty by default
waterMark.withDataNoBooleantrueWhether the watermark includes date, default true
waterMark.fontcolorNoString#cececeWatermark color, default gray
waterMark.transparentNoNumber70Transparency. The smaller the value, the more transparent it is. Default is 70 (numeric type)
waterMark.rotationNoNumber315Rotation angle, range 0–360, e.g. left tilt = 315, right tilt = 45, horizontal = 0 (numeric type)
waterMark.fontsizeNoString16Watermark font size, default 16
waterMark.fontNoString黑体Watermark font, default is "黑体"
waterMark.spacingNoNumber50Line spacing, default 50 (numeric type)
owner.idNoString301Document owner ID
owner.nameNoStringdocstest02Document owner name
extension.previewWithTrackChangeNoBooleanfalsetrue means track changes are automatically shown in preview; false or not provided means not shown. Only for word-processing documents
extension.trackChangeForceOnNoBooleanfalsetrue 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

FieldRequiredTypeExample ValueDescription
actionYesStringedit or viewOpen online edit or preview page

JSON Representation

{
"action": "edit"
}

repoConfig

Properties

FieldRequiredTypeExample ValueDescription
idYesString3rd-partyThird-party application ID
downloadUrlYesStringhttps://download.lenovocloud.com/v2/context/577/contentURL for downloading the file
uploadUrlYesStringhttps://upload.lenovocloud.com/v2/context/577/contentURL for uploading the file
paramsNoObjectParameters 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.