https://api.onlyoffice.com/editors/history
創(chuàng)新互聯(lián)專注于白沙黎族企業(yè)網(wǎng)站建設,成都響應式網(wǎng)站建設公司,電子商務商城網(wǎng)站建設。白沙黎族網(wǎng)站建設公司,為白沙黎族等地區(qū)提供建站服務。全流程按需求定制開發(fā),專業(yè)設計,全程項目跟蹤,創(chuàng)新互聯(lián)專業(yè)和態(tài)度為您提供的服務上面的頁面介紹如何進行歷史版本功能的開發(fā)。
https://api.onlyoffice.com/editors/howitworks
上面介紹了onlyoffice document server所包含的功能,
The client side includes:
Document manager - the list of the documents displayed in the user browser where the user can select the necessary document and perform some actions with it (depending on the provided rights, the user can open the document to view it or edit, share the document with other users).
Document editor - the document viewing and editing interface with all the most known document editing features available, used as a medium between the user and the document editing service.
The server side includes:
Document storage service - the server service which stores all the documents available to the users with the appropriate access rights. It provides the document IDs and links to these documents to the document manager which the user sees in the browser.
Document editing service - the server service which allows to perform the document viewing and editing (in case the user has the appropriate rights to do that). The document editor interface is used to access all the document editing service features.
Document command service - the server service which allows to perfom additional commands with document editing service.
Document conversion service - the server service which allows to convert the document file into the appropriate Office Open XML format (docx for text documents, xlsx for spreadsheets and pptx for presentations) for their editing or downloading.
Please note, that ONLYOFFICE Document Server includes the document editor, document editing service, document command service and document conversion service. The document manager and document storage service are either included to Community Server or must be implemented by the software integrators who use ONLYOFFICE Document Server on their own server.
請注意,onlyoffice document server包括document editor, document editing service, document command service(文檔編輯器、文檔編輯服務、文檔命令服務和文檔轉換服務)。文檔管理器和文檔存儲服務要么包含在社區(qū)服務器上,要么必須由在自己的服務器上僅使用office文檔服務器的軟件集成商實現(xiàn)。
我用golang就是開發(fā)了文檔管理器和文檔存儲。
類似可道云的那種云盤的資料管理。
但相比可道云,對于我們工程設計人員來說,更容易管理文檔,比如編號和名稱分開,文件作為附件放到成果下面,而不像可道云這樣直接看到的就是附件,一個成果下可以放多個附件。還可以發(fā)布文章,可以設置成果間的關聯(lián),可以設置目錄的權限,可以根據(jù)附件擴展名來設置權限,比如只運行看pdf文件,不運行看dwg,dgn等圖紙文件。
回到正題,歷史版本的開發(fā)必須從onlyoffice document server的返回值里找到數(shù)據(jù)結構。
[html] view plain copy
{
"key":"1520696086733383100",
"status":2,
"url":"http://192.168.99.100:9000/cache/files/1520696086733383100_1849/outpu
t.docx/output.docx?md5=CSBXuCfKbp1zaA2C-IoB2g==&expires=1523288157&
disposition=attachment&ooname=output.docx",
"changesurl":"http://192.168.99.100:9000/cache/files/
1520696086733383100_1849/changes.zip/changes.zip?
md5=eQOOXry8Spob255EtEi7QA==&expires=1523288157&
disposition=attachment&ooname=output.zip",
"history":{
"serverVersion":"5.0.7",
"changes":[
{
"created":"2018-03-10 15:34:57",
"user":
{
"id":"9",
"name":"qin.xc"
}
},
{
"created":"2018-03-10 15:35:29",
"user":
{
"id":"8",
"name":"qin8.xc"
}
}
]
},
"users":["8"],
"actions":[{"type":0,"userid":"9"}],
"lastsave":"2018-03-10T15:35:37.823Z",
"notmodified":false
}
官網(wǎng)上的例子:
Sample of JSON object sent to the "callbackUrl" address by document editing service when the user changed the document and closed it for editing
[html] view plain copy
{
"actions": [{"type": 0, "userid": "78e1e841"}],
"changesurl": "https://documentserver/url-to-changes.zip",
"history": {
"changes": changes,
"serverVersion": serverVersion
},
"key": "Khirz6zTPdfd7",
"status": 2,
"url": "https://documentserver/url-to-edited-document.docx",
"users": ["6d5a81d0"]
}
所以用beego開發(fā)先設置數(shù)據(jù)結構,然后解析到結構體就行了。
[plain] view plain copy
type Callback struct {
Key string `json:"key"`
Status int `json:"status"`
Url string `json:"url"`
Changesurl string `json:"changesurl"`
History history1 `json:"history"`
Users []string `json:"users"`
Actions []action `json:"actions"`
Lastsave string `json:"lastsave"`
Notmodified bool `json:"notmodified"`
}
type action struct {
Type int `json:"type"`
Userid string `json:"userid"`
}
type history1 struct {
ServerVersion string `json:"serverVersion"`
Changes []change `json:"changes"`
}
type change struct {
Created string `json:"created"` //time.Time
User User1 `json:"user"`
}
type User1 struct {
Id string `json:"id"` //必須大寫才能在tpl中顯示{{.json}}
Name string `json:"name"`
}
創(chuàng)新互聯(lián)www.cdcxhl.cn,專業(yè)提供香港、美國云服務器,動態(tài)BGP最優(yōu)骨干路由自動選擇,持續(xù)穩(wěn)定高效的網(wǎng)絡助力業(yè)務部署。公司持有工信部辦法的idc、isp許可證, 機房獨有T級流量清洗系統(tǒng)配攻擊溯源,準確進行流量調度,確保服務器高可用性。佳節(jié)活動現(xiàn)已開啟,新人活動云服務器買多久送多久。
新聞名稱:ONLYOFFICE歷史版本功能的開發(fā)-創(chuàng)新互聯(lián)
網(wǎng)頁網(wǎng)址:http://chinadenli.net/article48/dhighp.html
成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供微信公眾號、營銷型網(wǎng)站建設、響應式網(wǎng)站、網(wǎng)站策劃、網(wǎng)站設計、關鍵詞優(yōu)化
聲明:本網(wǎng)站發(fā)布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經(jīng)允許不得轉載,或轉載時需注明來源: 創(chuàng)新互聯(lián)