打开文件test123.docx
1. FileConverter/sources/converter.js的 receiveTask 接收到mq消息
receiveTask redelivered data="{"cmd":{"c":"open","id":"183_1527585831","userid":"admin","format":"docx","url":"http://172.16.52.25:32778/apps/onlyoffice/download?doc=bUJIY3d6bm1RN1RtMWQ4YWRJeWFqYzBVbXF4bHlncG9lTnhKMk5WY0ZOVT0/eyJmaWxlSWQiOjE4MywidXNlcklkIjoiYWRtaW4iLCJ0b2tlbiI6bnVsbCwiYWN0aW9uIjoiZG93bmxvYWQifQ%3D%3D","title":"test123.docx","outputformat":8192,"embeddedfonts":false,"nobase64":true},"toFile":"Editor.bin","visibilityTimeout":300}"
1.1 ExecuteTask 执行task
ExecuteTask task={"cmd":{"c":"open","id":"183_1527585831","userid":"admin","format":"docx","url":"http://172.16.52.25:32778/apps/onlyoffice/download?doc=bUJIY3d6bm1RN1RtMWQ4YWRJeWFqYzBVbXF4bHlncG9lTnhKMk5WY0ZOVT0/eyJmaWxlSWQiOjE4MywidXNlcklkIjoiYWRtaW4iLCJ0b2tlbiI6bnVsbCwiYWN0aW9uIjoiZG93bmxvYWQifQ%3D%3D","title":"test123.docx","outputformat":8192,"embeddedfonts":false,"nobase64":true},"toFile":"Editor.bin","visibilityTimeout":300}
Start Task(id=183_1527585831)
cmd={"c":"open","id":"183_1527585831","userid":"admin","format":"docx","url":"http://172.16.52.25:32778/apps/onlyoffice/download?doc=bUJIY3d6bm1RN1RtMWQ4YWRJeWFqYzBVbXF4bHlncG9lTnhKMk5WY0ZOVT0/eyJmaWxlSWQiOjE4MywidXNlcklkIjoiYWRtaW4iLCJ0b2tlbiI6bnVsbCwiYWN0aW9uIjoiZG93bmxvYWQifQ%3D%3D","title":"test123.docx","outputformat":8192,"embeddedfonts":false,"nobase64":true}
1.1.1 下载文件
docId=183_1527585831, uri=http://172.16.52.25:32778/apps/onlyoffice/download?doc=bUJIY3d6bm1RN1RtMWQ4YWRJeWFqYzBVbXF4bHlncG9lTnhKMk5WY0ZOVT0/eyJmaWxlSWQiOjE4MywidXNlcklkIjoiYWRtaW4iLCJ0b2tlbiI6bnVsbCwiYWN0aW9uIjoiZG93bmxvYWQifQ%3D%3D, fileFrom=/tmp/ASC_CONVERT118429-cx9v4r.s1pmc/source/183_1527585831.docx
downloadFile complete filesize=7038 (id=183_1527585831)
constants={"DOC_ID_PATTERN":"0-9-.a-zA-Z_=","CHAR_DELIMITER":"\u0005","OUTPUT_NAME":"output","ONLY_OFFICE_URL_PARAM":"ooname","DISPLAY_PREFIX":"display","RIGHTS":{"None":0,"Edit":1,"Review":2,"Comment":3,"View":4},"LICENSE_MODE":{"None":0,"Trial":1,"Developer":2},"LICENSE_RESULT":{"Error":1,"Expired":2,"Success":3,"UnknownUser":4,"Connections":5,"ExpiredTrial":6,"SuccessLimit":7,"UsersCount":8},"LICENSE_CONNECTIONS":20,"LICENSE_EXPIRE_USERS_ONE_DAY":86400,"AVS_OFFICESTUDIO_FILE_UNKNOWN":0,"AVS_OFFICESTUDIO_FILE_DOCUMENT":64,"AVS_OFFICESTUDIO_FILE_DOCUMENT_DOCX":65,"AVS_OFFICESTUDIO_FILE_DOCUMENT_DOC":66,"AVS_OFFICESTUDIO_FILE_DOCUMENT_ODT":67,"AVS_OFFICESTUDIO_FILE_DOCUMENT_RTF":68,"AVS_OFFICESTUDIO_FILE_DOCUMENT_TXT":69,"AVS_OFFICESTUDIO_FILE_DOCUMENT_HTML":70,"AVS_OFFICESTUDIO_FILE_DOCUMENT_MHT":71,"AVS_OFFICESTUDIO_FILE_DOCUMENT_EPUB":72,"AVS_OFFICESTUDIO_FILE_DOCUMENT_FB2":73,"AVS_OFFICESTUDIO_FILE_DOCUMENT_MOBI":74,"AVS_OFFICESTUDIO_FILE_PRESENTATION":128,"AVS_OFFICESTUDIO_FILE_PRESENTATION_PPTX":129,"AVS_OFFICESTUDIO_FILE_PRESENTATION_PPT":130,"AVS_OFFICESTUDIO_FILE_PRESENTATION_ODP":131,"AVS_OFFICESTUDIO_FILE_PRESENTATION_PPSX":132,"AVS_OFFICESTUDIO_FILE_SPREADSHEET":256,"AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLSX":257,"AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLS":258,"AVS_OFFICESTUDIO_FILE_SPREADSHEET_ODS":259,"AVS_OFFICESTUDIO_FILE_SPREADSHEET_CSV":260,"AVS_OFFICESTUDIO_FILE_CROSSPLATFORM":512,"AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_PDF":513,"AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_SWF":514,"AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_DJVU":515,"AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_XPS":516,"AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_SVG":517,"AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_HTMLR":518,"AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_HTMLR_MENU":519,"AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_HTMLR_CANVAS":520,"AVS_OFFICESTUDIO_FILE_IMAGE":1024,"AVS_OFFICESTUDIO_FILE_IMAGE_JPG":1025,"AVS_OFFICESTUDIO_FILE_IMAGE_TIFF":1026,"AVS_OFFICESTUDIO_FILE_IMAGE_TGA":1027,"AVS_OFFICESTUDIO_FILE_IMAGE_GIF":1028,"AVS_OFFICESTUDIO_FILE_IMAGE_PNG":1029,"AVS_OFFICESTUDIO_FILE_IMAGE_EMF":1030,"AVS_OFFICESTUDIO_FILE_IMAGE_WMF":1031,"AVS_OFFICESTUDIO_FILE_IMAGE_BMP":1032,"AVS_OFFICESTUDIO_FILE_IMAGE_CR2":1033,"AVS_OFFICESTUDIO_FILE_IMAGE_PCX":1034,"AVS_OFFICESTUDIO_FILE_IMAGE_RAS":1035,"AVS_OFFICESTUDIO_FILE_IMAGE_PSD":1036,"AVS_OFFICESTUDIO_FILE_IMAGE_ICO":1037,"AVS_OFFICESTUDIO_FILE_OTHER":2048,"AVS_OFFICESTUDIO_FILE_OTHER_EXTRACT_IMAGE":2049,"AVS_OFFICESTUDIO_FILE_OTHER_MS_OFFCRYPTO":2050,"AVS_OFFICESTUDIO_FILE_OTHER_HTMLZIP":2051,"AVS_OFFICESTUDIO_FILE_OTHER_OLD_DOCUMENT":2052,"AVS_OFFICESTUDIO_FILE_OTHER_OLD_PRESENTATION":2053,"AVS_OFFICESTUDIO_FILE_OTHER_OLD_DRAWING":2054,"AVS_OFFICESTUDIO_FILE_OTHER_TEAMLAB_INNER":2055,"AVS_OFFICESTUDIO_FILE_OTHER_JSON":2056,"AVS_OFFICESTUDIO_FILE_TEAMLAB":4096,"AVS_OFFICESTUDIO_FILE_TEAMLAB_DOCY":4097,"AVS_OFFICESTUDIO_FILE_TEAMLAB_XLSY":4098,"AVS_OFFICESTUDIO_FILE_TEAMLAB_PPTY":4099,"AVS_OFFICESTUDIO_FILE_CANVAS":8192,"AVS_OFFICESTUDIO_FILE_CANVAS_WORD":8193,"AVS_OFFICESTUDIO_FILE_CANVAS_SPREADSHEET":8194,"AVS_OFFICESTUDIO_FILE_CANVAS_PRESENTATION":8195,"NO_ERROR":0,"UNKNOWN":-1,"READ_REQUEST_STREAM":-3,"WEB_REQUEST":-4,"TASK_QUEUE":-20,"TASK_RESULT":-40,"STORAGE":-60,"STORAGE_FILE_NO_FOUND":-61,"STORAGE_READ":-62,"STORAGE_WRITE":-63,"STORAGE_REMOVE_DIR":-64,"STORAGE_CREATE_DIR":-65,"STORAGE_GET_INFO":-66,"CONVERT":-80,"CONVERT_DOWNLOAD":-81,"CONVERT_UNKNOWN_FORMAT":-82,"CONVERT_TIMEOUT":-83,"CONVERT_READ_FILE":-84,"CONVERT_CORRUPTED":-86,"CONVERT_LIBREOFFICE":-87,"CONVERT_PARAMS":-88,"CONVERT_NEED_PARAMS":-89,"CONVERT_DRM":-90,"CONVERT_PASSWORD":-91,"CONVERT_ICU":-92,"CONVERT_LIMITS":-93,"CONVERT_DEAD_LETTER":-99,"UPLOAD":-100,"UPLOAD_CONTENT_LENGTH":-101,"UPLOAD_EXTENSION":-102,"UPLOAD_COUNT_FILES":-103,"UPLOAD_URL":-104,"VKEY":-120,"VKEY_ENCRYPT":-121,"VKEY_KEY_EXPIRE":-122,"VKEY_USER_COUNT_EXCEED":-123,"VKEY_TIME_EXPIRE":-124,"VKEY_TIME_INCORRECT":-125,"EDITOR_CHANGES":-160,"QUEUE_PRIORITY_VERY_LOW":0,"QUEUE_PRIORITY_LOW":1,"QUEUE_PRIORITY_NORMAL":2,"QUEUE_PRIORITY_HIGH":3,"QUEUE_PRIORITY_VERY_HIGH":4,"EDITOR_TYPE_WORD":0,"EDITOR_TYPE_SPREADSHEET":1,"EDITOR_TYPE_PRESENTATION":2,"EDITOR_TYPE_CONVERTATION":3,"PACKAGE_TYPE_OS":0,"PACKAGE_TYPE_I":1,"PACKAGE_TYPE_D":2,"REDIS_KEY_PUBSUB":"pubsub","REDIS_KEY_SAVE_LOCK":"savelock:","REDIS_KEY_PRESENCE_HASH":"presence:hash:","REDIS_KEY_PRESENCE_SET":"presence:set:","REDIS_KEY_PRESENCE_UNIQUE_USERS":"presence:unique:users","REDIS_KEY_LOCKS":"locks:","REDIS_KEY_CHANGES_INDEX":"changesindex:","REDIS_KEY_LOCK_DOCUMENT":"lockdocument:","REDIS_KEY_MESSAGE":"message:","REDIS_KEY_DOCUMENTS":"documents","REDIS_KEY_LAST_SAVE":"lastsave:","REDIS_KEY_FORCE_SAVE":"forcesave:","REDIS_KEY_FORCE_SAVE_TIMER":"forcesavetimer","REDIS_KEY_FORCE_SAVE_TIMER_LOCK":"forcesavetimerlock:","REDIS_KEY_SAVED":"saved:","REDIS_KEY_SHUTDOWN":"shutdown","REDIS_KEY_COLLECT_LOST":"collectlost","REDIS_KEY_LICENSE":"license","REDIS_KEY_LICENSE_T":"licenseT","SHUTDOWN_CODE":4001,"SHUTDOWN_REASON":"server shutdown","SESSION_IDLE_CODE":4002,"SESSION_IDLE_REASON":"idle session expires","SESSION_ABSOLUTE_CODE":4003,"SESSION_ABSOLUTE_REASON":"absolute session expires","ACCESS_DENIED_CODE":4004,"ACCESS_DENIED_REASON":"access deny","JWT_EXPIRED_CODE":4005,"JWT_EXPIRED_REASON":"token:","JWT_ERROR_CODE":4006,"JWT_ERROR_REASON":"token:","DROP_CODE":4007,"DROP_REASON":"drop","CONTENT_DISPOSITION_INLINE":"inline","CONTENT_DISPOSITION_ATTACHMENT":"attachment","CONN_CLOSED":3}
1.1.2 转换文件
/var/www/onlyoffice/documentserver/server/FileConverter/bin/x2t, childArgs=["/tmp/ASC_CONVERT118429-cx9v4r.s1pmc/params.xml"]
183_1527585831
/tmp/ASC_CONVERT118429-cx9v4r.s1pmc/source/183_1527585831.docx
/tmp/ASC_CONVERT118429-cx9v4r.s1pmc/result/Editor.bin
8192
false
/usr/share/fonts
/var/www/onlyoffice/documentserver/sdkjs/slide/themes
2018-05-29T09:23:54.486Z
true
转换之后
/tmp/ASC_CONVERT118429-cx9v4r.s1pmc/result/Editor.bin
和目录 /tmp/ASC_CONVERT118429-cx9v4r.s1pmc/result/media/
1.1.3 处理结果 postProcess
postProcess cmd={"c":"open","id":"183_1527585831","userid":"admin","format":"docx","url":"http://172.16.52.25:32778/apps/onlyoffice/download?doc=bUJIY3d6bm1RN1RtMWQ4YWRJeWFqYzBVbXF4bHlncG9lTnhKMk5WY0ZOVT0/eyJmaWxlSWQiOjE4MywidXNlcklkIjoiYWRtaW4iLCJ0b2tlbiI6bnVsbCwiYWN0aW9uIjoiZG93bmxvYWQifQ%3D%3D","title":"test123.docx","outputformat":8192,"embeddedfonts":false,"nobase64":true},dataConvert={"key":"183_1527585831","fileFrom":"/tmp/ASC_CONVERT118429-cx9v4r.s1pmc/source/183_1527585831.docx","fileTo":"/tmp/ASC_CONVERT118429-cx9v4r.s1pmc/result/Editor.bin","formatTo":8192,"embeddedFonts":false,"fontDir":"/usr/share/fonts","themeDir":"/var/www/onlyoffice/documentserver/sdkjs/slide/themes","noBase64":true,"timestamp":"2018-05-29T09:23:54.486Z"},tempDirs={"temp":"/tmp/ASC_CONVERT118429-cx9v4r.s1pmc","source":"/tmp/ASC_CONVERT118429-cx9v4r.s1pmc/source","result":"/tmp/ASC_CONVERT118429-cx9v4r.s1pmc/result"},childRes={"pid":8350,"output":["",""],"stdout":"","stderr":"","status":0,"signal":null},error=0,isTimeout=false
上传转换后的文件到指定路径
processUploadToStorage dir=/tmp/ASC_CONVERT118429-cx9v4r.s1pmc/result, storagePath=183_1527585831
/var/lib/onlyoffice/documentserver/App_Data/cache/files/183_1527585831/Editor.bin
output (data={"cmd":{"c":"open","id":"183_1527585831","userid":"admin","format":"docx","url":"http://172.16.52.25:32778/apps/onlyoffice/download?doc=bUJIY3d6bm1RN1RtMWQ4YWRJeWFqYzBVbXF4bHlncG9lTnhKMk5WY0ZOVT0/eyJmaWxlSWQiOjE4MywidXNlcklkIjoiYWRtaW4iLCJ0b2tlbiI6bnVsbCwiYWN0aW9uIjoiZG93bmxvYWQifQ%3D%3D","title":"test123.docx","outputformat":8192,"outputpath":"Editor.bin","embeddedfonts":false,"status_info":0,"nobase64":true}};id=183_1527585831)
resData={"cmd":{"c":"open","id":"183_1527585831","userid":"admin","format":"docx","url":"http://172.16.52.25:32778/apps/onlyoffice/download?doc=bUJIY3d6bm1RN1RtMWQ4YWRJeWFqYzBVbXF4bHlncG9lTnhKMk5WY0ZOVT0/eyJmaWxlSWQiOjE4MywidXNlcklkIjoiYWRtaW4iLCJ0b2tlbiI6bnVsbCwiYWN0aW9uIjoiZG93bmxvYWQifQ%3D%3D","title":"test123.docx","outputformat":8192,"outputpath":"Editor.bin","embeddedfonts":false,"status_info":0,"nobase64":true}}
1.1.4 删除临时目录 /tmp/ASC_CONVERT118429-cx9v4r.s1pmc
2. docservice 收到请求
GET /doc/183_1527585831/c/info?t=1527585833178 1ms 200
GET /doc/183_1527585831/c/983/ordcn02p/websocket 1ms (unfinished)
2.1 DocService/sources/DocsCoServer.js exports.install
data.type = auth id = undefined
2.2 调用 auth函数
2.3 auth中调用 endAuth
2.4 endAuth 中调用 sendStatusDocument
sendStatusDocument updateIf no effect: docId = 183_1527585831
2.5 sendStatusDocument 中调用 sendServerRequest
postData request: docId = 183_1527585831;url = http://172.16.52.25:32778/apps/onlyoffice/track?doc=WDFzUnVxY0pZa0Z4NlBZUE51RG4wQ0U2b1NHU1ZsTlpQRlJXZlM2dy9aaz0/eyJmaWxlSWQiOjE4Mywib3duZXJJZCI6ImFkbWluIiwidG9rZW4iOm51bGwsImFjdGlvbiI6InRyYWNrIn0%3D;data = {"key":"183_1527585831","status":1,"users":["admin"],"actions":[{"type":1,"userid":"admin"}]}
postData response: docId = 183_1527585831;data = {"error":0}
3. 打开文档DocService/sources/canvasservice.js openDocument被调用
Start command: docId = 183_1527585831 {"c":"open","id":"183_1527585831","userid":"admin","format":"docx","url":"http://172.16.52.25:32778/apps/onlyoffice/download?doc=bUJIY3d6bm1RN1RtMWQ4YWRJeWFqYzBVbXF4bHlncG9lTnhKMk5WY0ZOVT0/eyJmaWxlSWQiOjE4MywidXNlcklkIjoiYWRtaW4iLCJ0b2tlbiI6bnVsbCwiYWN0aW9uIjoiZG93bmxvYWQifQ%3D%3D","title":"test123.docx","nobase64":true}
3.1 openDocument调用 commandOpen
新增task
End command: docId = 183_1527585831
3.2 receiveTask 接收到task
Start receiveTask: docId = 183_1527585831 {"cmd":{"c":"open","id":"183_1527585831","userid":"admin","format":"docx","url":"http://172.16.52.25:32778/apps/onlyoffice/download?doc=bUJIY3d6bm1RN1RtMWQ4YWRJeWFqYzBVbXF4bHlncG9lTnhKMk5WY0ZOVT0/eyJmaWxlSWQiOjE4MywidXNlcklkIjoiYWRtaW4iLCJ0b2tlbiI6bnVsbCwiYWN0aW9uIjoiZG93bmxvYWQifQ%3D%3D","title":"test123.docx","outputformat":8192,"outputpath":"Editor.bin","embeddedfonts":false,"status_info":0,"nobase64":true}}
command=open
3.2.1 receiveTask调用 getOutputData
3.2 返回receiveTask
outputData={"type":"open","status":"ok"}
Send receiveTask: docId = 183_1527585831 {"type":"open","status":"ok"}
opt_dataRaw={"fields":{"consumerTag":"amq.ctag-xtYpjZT7G6PIgRTIyu2WMQ","deliveryTag":4,"redelivered":false,"exchange":"","routingKey":"ds.convertresponse"},"properties":{"headers":{},"deliveryMode":2},"content":{"type":"Buffer","data":[123,34,99,109,100,34,58,123,34,99,34,58,34,111,112,101,110,34,44,34,105,100,34,58,34,49,56,51,95,49,53,50,55,53,56,53,56,51,49,34,44,34,117,115,101,114,105,100,34,58,34,97,100,109,105,110,34,44,34,102,111,114,109,97,116,34,58,34,100,111,99,120,34,44,34,117,114,108,34,58,34,104,116,116,112,58,47,47,49,55,50,46,49,54,46,53,50,46,50,53,58,51,50,55,55,56,47,97,112,112,115,47,111,110,108,121,111,102,102,105,99,101,47,100,111,119,110,108,111,97,100,63,100,111,99,61,98,85,74,73,89,51,100,54,98,109,49,82,78,49,82,116,77,87,81,52,89,87,82,74,101,87,70,113,89,122,66,86,98,88,70,52,98,72,108,110,99,71,57,108,84,110,104,75,77,107,53,87,89,48,90,79,86,84,48,47,101,121,74,109,97,87,120,108,83,87,81,105,79,106,69,52,77,121,119,105,100,88,78,108,99,107,108,107,73,106,111,105,89,87,82,116,97,87,52,105,76,67,74,48,98,50,116,108,98,105,73,54,98,110,86,115,98,67,119,105,89,87,78,48,97,87,57,117,73,106,111,105,90,71,57,51,98,109,120,118,89,87,81,105,102,81,37,51,68,37,51,68,34,44,34,116,105,116,108,101,34,58,34,116,101,115,116,49,50,51,46,100,111,99,120,34,44,34,111,117,116,112,117,116,102,111,114,109,97,116,34,58,56,49,57,50,44,34,111,117,116,112,117,116,112,97,116,104,34,58,34,69,100,105,116,111,114,46,98,105,110,34,44,34,101,109,98,101,100,100,101,100,102,111,110,116,115,34,58,102,97,108,115,101,44,34,115,116,97,116,117,115,95,105,110,102,111,34,58,48,44,34,110,111,98,97,115,101,54,52,34,58,116,114,117,101,125,125]}}
if opt_dataRaw
End receiveTask: docId = 183_1527585831
3.3 返回到DocService/sources/DocsCoServer.js install
3.4 install调用 pubsubOnMessage
pubsub message start:{"type":7,"cmd":{"c":"open","id":"183_1527585831","userid":"admin","format":"docx","url":"http://172.16.52.25:32778/apps/onlyoffice/download?doc=bUJIY3d6bm1RN1RtMWQ4YWRJeWFqYzBVbXF4bHlncG9lTnhKMk5WY0ZOVT0/eyJmaWxlSWQiOjE4MywidXNlcklkIjoiYWRtaW4iLCJ0b2tlbiI6bnVsbCwiYWN0aW9uIjoiZG93bmxvYWQifQ%3D%3D","title":"test123.docx","outputformat":8192,"outputpath":"Editor.bin","embeddedfonts":false,"status_info":0,"nobase64":true},"output":{"type":"documentOpen","data":{"type":"open","status":"ok"}},"needUrlKey":"183_1527585831","needUrlMethod":0,"needUrlType":0}