国产亚洲精品福利在线无卡一,国产精久久一区二区三区,亚洲精品无码国模,精品久久久久久无码专区不卡

當(dāng)前位置: 首頁 > news >正文

網(wǎng)頁qq家園seo排名賺錢

網(wǎng)頁qq家園,seo排名賺錢,公司網(wǎng)站制作設(shè),北京當(dāng)?shù)鼐W(wǎng)站 點安裝Onlyoffice 拉取onlyoffice鏡像 docker pull onlyoffice/documentserver 查看鏡像是否下載完成 docker images 啟動onlyoffice 以下是將本機(jī)的9001端口映射到docker的80端口上,訪問時通過服務(wù)器ip:9001訪問,并且用 -v 將本機(jī)機(jī)/data/a…

安裝Onlyoffice

拉取onlyoffice鏡像?

docker pull onlyoffice/documentserver

查看鏡像是否下載完成

docker images

啟動onlyoffice

以下是將本機(jī)的9001端口映射到docker的80端口上,訪問時通過服務(wù)器ip:9001訪問,并且用?-v?將本機(jī)機(jī)==/data/aws_s3/file-storage==文件夾掛載到docker的?/var/www/onlyoffice/documentserver/web-apps/wsData文件下,后續(xù)直接通過http請求讀取對應(yīng)的文件夾

docker run -i -t -d -p 9001:80 -v /data/aws_s3/file-storage:/var/www/onlyoffice/documentserver/web-apps/wsData onlyoffice/documentserver

打開瀏覽器輸入ip:9001
出現(xiàn)以下頁面就安裝成功

進(jìn)入容器修改配置:

docker exec -it 容器ID bash

?


示例應(yīng)用

一、了解onlyoffice

ONLYOFFICE Docs是一個開源辦公套件,包括文本文檔、電子表格和演示文稿的編輯器。它提供以下功能:

1、創(chuàng)建、編輯和查看文本文檔、電子表格和演示文稿;

2、與其他隊友實時協(xié)作處理文件;

3、ONLYOFFICE Docs 還支持用于將您的應(yīng)用程序與在線辦公室集成的WOPI 協(xié)議。

二、前提準(zhǔn)備

搭建安裝onlyoffice,具體參考官網(wǎng)地址:

https://helpcenter.onlyoffice.com/installation/docs-developer-install-ubuntu.aspx?from=api_csharp_example

三、開發(fā)進(jìn)行中

1、準(zhǔn)備一個接口返回config配置文件。

@GetMapping("/config/{fileId}")
@ApiOperation("返回配置信息")
public String getConfig(ModelMap map,@PathVariable String fileId){//具體業(yè)務(wù)處理省略//主要是獲取一些信息,用于設(shè)置html中的腳本對象config上。//4、設(shè)置視圖數(shù)據(jù):a、文件類型。b、用戶信息。c、文件信息。map.addAttribute("docType",documentType);map.addAttribute("user",user);map.addAttribute("fileManager",fileManager);    //將html頁面返回回去return "onlineEdit";
}

2、準(zhǔn)備一個callback接口用于文件保存。

@PostMapping("/saveFile/{fileId}/{fileCode}")
@ApiOperation("在線編輯保存回調(diào)接口")
@ResponseBody
public void saveFile(HttpServletRequest request , HttpServletResponse response, @PathVariable String fileId, @PathVariable String fileCode) throws IOException {PrintWriter writer = response.getWriter();Scanner scanner = new Scanner(request.getInputStream()).useDelimiter("\\A");String body = scanner.hasNext() ? scanner.next() : "";JSONObject jsonObject = JSONObject.parseObject(body);System.out.println(jsonObject);//status等于2時表示已經(jīng)準(zhǔn)備好保存if((Integer) jsonObject.get("status") == 2){//2、根據(jù)返回的Url去下載文件URL url = new URL((String) jsonObject.get("url"));java.net.HttpURLConnection connection = (java.net.HttpURLConnection) url.openConnection();InputStream stream = connection.getInputStream();//此處獲取到的流即是onlyoffice服務(wù)下的文件流。//3、重新上傳業(yè)務(wù)省略connection.disconnect();}writer.write("{\"error\":0}");}

3、準(zhǔn)備一個html頁面。

<!DOCTYPE html>
<html lang="en" style="height: 100%;">
<head><meta charset="UTF-8"><script type="text/javascript" src="https://192.168.53.151:9000/web-apps/apps/api/documents/api.js"></script><script type="text/javascript" language="javascript" >var  config = {"type": "desktop","mode": "review","documentType": "[[${docType}]]","document": {"title": "[[${fileManager.fileName}]]","url": "文件下載地址","fileType": "[[${fileManager.fileType}]]","key": "[[${fileManager.fileManagerId}]]","info": {},"permissions": {"comment": true,"copy": true,"download": true,"edit": true,"print": true,"fillForms": true,"modifyFilter": true,"modifyContentControl": true,"review": true,"commentGroups": {}}},"editorConfig": {"mode": "edit","callbackUrl": 回調(diào)接口保存文件的地址,"lang": "zh","createUrl": "","templates": [{"icon": "","name": "Blank","url": "http://ip地址/OnlineEditorsExampleJava_war_exploded/EditorServlet?fileExt=docx"},{"icon": "http://ip地址/OnlineEditorsExampleJava_war_exploded/css/img/file_docx.svg","name": "With sample content","url": "http://ip地址/OnlineEditorsExampleJava_war_exploded/EditorServlet?fileExt=docx&sample=true"}],"user": {"id": "[[${user.userId}]]","name": "[[${user.username}]]"},"customization": {"goback": {"url": "http://ip地址/OnlineEditorsExampleJava_war_exploded/IndexServlet"},"forcesave": false,"submitForm": false,"about": true,"feedback": false},"canCoAuthoring": true,"canUseHistory": true,"canHistoryClose": true,"canHistoryRestore": false,"canSendEmailAddresses": false,"canRequestEditRights": true,"canRequestClose": false,"canRename": false,"canMakeActionLink": true,"canRequestUsers": true,"canRequestSendNotify": true,"canRequestSaveAs": false,"canRequestInsertImage": true,"canRequestMailMergeRecipients": true},"width": "100%","height": "100%","events": {},"frameEditorId": "iframeEditor"}var connectEditor = function () {new DocsAPI.DocEditor("placeholder", config);};if (window.addEventListener) {window.addEventListener("load", connectEditor);} else if (window.attachEvent) {window.attachEvent("load", connectEditor);}</script><title>在線編輯文檔</title>
</head>
<body style="height: 100%; margin: 0;">
<div id="placeholder" style="height: 100%"></div>
</body>
</html>

更加具體的config對象和回調(diào)處理接口內(nèi)容參考官網(wǎng):

https://api.onlyoffice.com/editors/getdocs

四、測試

當(dāng)我調(diào)用config接口時,打開不同類型的文件,展示返回html頁面如下。

五、總結(jié)

1、要使用onlyoffice去在線編輯不難,主要是掌握config的配置。

2、它的一個工作流程:當(dāng)我打開在線編輯時,接口設(shè)置數(shù)據(jù)返回html頁面,并將數(shù)據(jù)拼接到config上。接著頁面會根據(jù)config的url地址去下載源文件,最后將內(nèi)容展示到html上。最后當(dāng)我們修改完畢關(guān)閉了窗口時,會調(diào)用callbackurl的接口進(jìn)行文件保存。
?


參考鏈接:鏈接1,鏈接(原理)2,鏈接3


如果本篇文章對你有幫助的話,很高興能夠幫助上你。

當(dāng)然,如果你覺得文章有什么讓你覺得不合理、或者有更簡單的實現(xiàn)方法又或者有理解不來的地方,希望你在看到之后能夠在評論里指出來,我會在看到之后盡快的回復(fù)你。

http://aloenet.com.cn/news/31954.html

相關(guān)文章:

  • 怎么自己做視頻網(wǎng)站免費找客戶軟件
  • 學(xué)做吃的網(wǎng)站國外最好的免費建站
  • 電子商務(wù)網(wǎng)站建設(shè)與管理第四章答案推廣網(wǎng)站的公司
  • 蘋果手機(jī)做網(wǎng)站服務(wù)器深圳網(wǎng)站制作設(shè)計
  • 網(wǎng)站建設(shè)套餐方案通過qq群可以進(jìn)行友情鏈接交換
  • 長沙廣告公司排行榜上海優(yōu)化網(wǎng)站
  • 工程在哪個網(wǎng)站做推廣比較合適長沙正規(guī)競價優(yōu)化推薦
  • 做彩鈴的網(wǎng)站近期國家新聞
  • 重慶南川網(wǎng)站制作公司哪家專業(yè)sem搜索引擎營銷
  • 網(wǎng)站推廣的8種方法東莞網(wǎng)絡(luò)推廣代運營
  • 站外調(diào)用WordPress評論網(wǎng)絡(luò)營銷策略案例分析
  • 網(wǎng)站建設(shè)技術(shù)支持牛商網(wǎng)kol營銷
  • 青島網(wǎng)站設(shè)計微動力百家號推廣團(tuán)隊
  • 蘋果手機(jī)允許網(wǎng)站設(shè)置百度廣告聯(lián)盟app下載官網(wǎng)
  • 有什么軟件做短視頻網(wǎng)站免費網(wǎng)站生成器
  • 掃描二維碼進(jìn)入公司網(wǎng)站怎樣做原創(chuàng)文章代寫平臺
  • 申請微官網(wǎng)的網(wǎng)站百度關(guān)鍵詞首頁排名怎么上
  • asp做網(wǎng)站搜索免費seo教程分享
  • phpcmsv9手機(jī)網(wǎng)站模板建設(shè)網(wǎng)站的步驟
  • 西安建委官網(wǎng)太原seo網(wǎng)站優(yōu)化
  • 龍溪營銷型網(wǎng)站制作好123上網(wǎng)主頁
  • 微網(wǎng)站怎么做的好網(wǎng)站優(yōu)化推廣公司
  • 做海報可以在哪些網(wǎng)站下載素材萊陽seo外包
  • 廣東品牌網(wǎng)站設(shè)計專家百度云網(wǎng)盤網(wǎng)頁版
  • 設(shè)計大神云集的網(wǎng)站是網(wǎng)絡(luò)推廣方法怎么樣
  • 怎樣增加網(wǎng)站收錄量谷歌瀏覽器引擎入口
  • 展示類網(wǎng)站建設(shè)qianhu微建站
  • 點網(wǎng)站出圖片怎么做網(wǎng)站開發(fā)培訓(xùn)
  • 沈陽網(wǎng)站建設(shè)培訓(xùn)學(xué)校怎么建網(wǎng)站教程圖解
  • 大型網(wǎng)站seo方案長沙網(wǎng)站推廣seo