mirror of
https://github.com/ONLYOFFICE/document-server-integration.git
synced 2026-04-07 14:06:11 +08:00
Compare commits
12 Commits
v4.3.0.52
...
v4.3.0.162
| Author | SHA1 | Date | |
|---|---|---|---|
| 7e26d068a5 | |||
| 13c8530cfd | |||
| c0f47f892b | |||
| ca142cc2cd | |||
| f8ebb4af10 | |||
| 4f21721901 | |||
| 5ccef87a38 | |||
| 4ab35107d0 | |||
| 1599022776 | |||
| 7b9e4e7fde | |||
| a5703b663c | |||
| 4e7586cd2a |
@ -1,6 +1,6 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2016 ONLYOFFICE
|
||||
Copyright (c) 2017 ONLYOFFICE
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2016
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
*
|
||||
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
|
||||
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2016
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
*
|
||||
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
|
||||
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2016
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
*
|
||||
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
|
||||
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2016
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
*
|
||||
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
|
||||
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2016
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
*
|
||||
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
|
||||
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2016
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
*
|
||||
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
|
||||
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2016
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
*
|
||||
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
|
||||
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2016
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
*
|
||||
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
|
||||
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2016
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
*
|
||||
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
|
||||
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2016
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
*
|
||||
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
|
||||
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
|
||||
@ -26,6 +26,7 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Web;
|
||||
using System.Web.Configuration;
|
||||
@ -213,20 +214,26 @@ namespace OnlineEditorsExampleMVC.Helpers
|
||||
: documentRevisionId;
|
||||
documentRevisionId = GenerateRevisionId(documentRevisionId);
|
||||
|
||||
var urlDocumentService = DocumentConverterUrl + ConvertParams;
|
||||
var urlToConverter = String.Format(urlDocumentService,
|
||||
HttpUtility.UrlEncode(documentUri),
|
||||
toExtension.Trim('.'),
|
||||
fromExtension.Trim('.'),
|
||||
title,
|
||||
documentRevisionId);
|
||||
|
||||
if (isAsync)
|
||||
urlToConverter += "&async=true";
|
||||
|
||||
var req = (HttpWebRequest) WebRequest.Create(urlToConverter);
|
||||
var req = (HttpWebRequest)WebRequest.Create(DocumentConverterUrl);
|
||||
req.Method = "POST";
|
||||
req.ContentType = "text/json";
|
||||
req.Timeout = ConvertTimeout;
|
||||
|
||||
var bodyString = string.Format("{{\"async\": {0},\"filetype\": \"{1}\",\"key\": \"{2}\",\"outputtype\": \"{3}\",\"title\": \"{4}\",\"url\": \"{5}\"}}",
|
||||
isAsync.ToString().ToLower(),
|
||||
fromExtension.Trim('.'),
|
||||
documentRevisionId,
|
||||
toExtension.Trim('.'),
|
||||
title,
|
||||
documentUri);
|
||||
|
||||
var bytes = Encoding.UTF8.GetBytes(bodyString);
|
||||
req.ContentLength = bytes.Length;
|
||||
using (var requestStream = req.GetRequestStream())
|
||||
{
|
||||
requestStream.Write(bytes, 0, bytes.Length);
|
||||
}
|
||||
|
||||
Stream stream = null;
|
||||
var countTry = 0;
|
||||
while (countTry < MaxTry)
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2016 ONLYOFFICE
|
||||
Copyright (c) 2017 ONLYOFFICE
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2016
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
*
|
||||
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
|
||||
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2016
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
*
|
||||
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
|
||||
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2016
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
*
|
||||
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
|
||||
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<!--*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2016
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
*
|
||||
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
|
||||
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<!--*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2016
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
*
|
||||
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
|
||||
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2016
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
*
|
||||
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
|
||||
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2016
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
*
|
||||
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
|
||||
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2016
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
*
|
||||
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
|
||||
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2016
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
*
|
||||
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
|
||||
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2016
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
*
|
||||
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
|
||||
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
|
||||
@ -23,6 +23,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
using System.Text;
|
||||
using OnlineEditorsExample;
|
||||
using System;
|
||||
using System.IO;
|
||||
@ -220,22 +221,28 @@ namespace ASC.Api.DocumentConverter
|
||||
: documentRevisionId;
|
||||
documentRevisionId = GenerateRevisionId(documentRevisionId);
|
||||
|
||||
var urlDocumentService = DocumentConverterUrl + ConvertParams;
|
||||
var urlToConverter = String.Format(urlDocumentService,
|
||||
HttpUtility.UrlEncode(documentUri),
|
||||
toExtension.Trim('.'),
|
||||
fromExtension.Trim('.'),
|
||||
title,
|
||||
documentRevisionId);
|
||||
|
||||
if (isAsync)
|
||||
urlToConverter += "&async=true";
|
||||
|
||||
var req = (HttpWebRequest) WebRequest.Create(urlToConverter);
|
||||
var req = (HttpWebRequest)WebRequest.Create(DocumentConverterUrl);
|
||||
req.Method = "POST";
|
||||
req.ContentType = "text/json";
|
||||
req.Timeout = ConvertTimeout;
|
||||
|
||||
Stream stream = null;
|
||||
var bodyString = string.Format("{{\"async\": {0},\"filetype\": \"{1}\",\"key\": \"{2}\",\"outputtype\": \"{3}\",\"title\": \"{4}\",\"url\": \"{5}\"}}",
|
||||
isAsync.ToString().ToLower(),
|
||||
fromExtension.Trim('.'),
|
||||
documentRevisionId,
|
||||
toExtension.Trim('.'),
|
||||
title,
|
||||
documentUri);
|
||||
|
||||
var bytes = Encoding.UTF8.GetBytes(bodyString);
|
||||
req.ContentLength = bytes.Length;
|
||||
using (var requestStream = req.GetRequestStream())
|
||||
{
|
||||
requestStream.Write(bytes, 0, bytes.Length);
|
||||
}
|
||||
|
||||
var countTry = 0;
|
||||
Stream stream = null;
|
||||
|
||||
// hack. http://ubuntuforums.org/showthread.php?t=1841740
|
||||
if (_Default.IsMono)
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2016 ONLYOFFICE
|
||||
Copyright (c) 2017 ONLYOFFICE
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2016
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
*
|
||||
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
|
||||
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2016
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
*
|
||||
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
|
||||
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2016 ONLYOFFICE
|
||||
Copyright (c) 2017 ONLYOFFICE
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2016
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
*
|
||||
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
|
||||
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2016
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
*
|
||||
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
|
||||
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2016
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
*
|
||||
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
|
||||
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2016
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
*
|
||||
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
|
||||
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2016
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
*
|
||||
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
|
||||
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<!--*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2016
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
*
|
||||
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
|
||||
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<!--*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2016
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
*
|
||||
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
|
||||
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2016
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
*
|
||||
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
|
||||
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2016 ONLYOFFICE
|
||||
Copyright (c) 2017 ONLYOFFICE
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<!--*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2016
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
*
|
||||
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
|
||||
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2016
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
*
|
||||
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
|
||||
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2016
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
*
|
||||
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
|
||||
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2016 ONLYOFFICE
|
||||
Copyright (c) 2017 ONLYOFFICE
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2016
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
*
|
||||
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
|
||||
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
|
||||
@ -234,7 +234,7 @@ app.get("/convert", function (req, res) {
|
||||
try {
|
||||
if (configServer.get('convertedDocs').indexOf(fileExt) != -1) {
|
||||
var key = documentService.generateRevisionId(fileUri);
|
||||
documentService.getConvertedUriAsync(fileUri, fileExt, internalFileExt, key, callback);
|
||||
documentService.getConvertedUri(fileUri, fileExt, internalFileExt, key, true, callback);
|
||||
} else {
|
||||
writeResult(fileName, null, null);
|
||||
}
|
||||
@ -290,9 +290,7 @@ app.post("/track", function (req, res) {
|
||||
|
||||
var processTrack = function (response, body, fileName, userAddress) {
|
||||
|
||||
var processSave = function (body, fileName, userAddress, newVersion) {
|
||||
|
||||
var downloadUri = body.url;
|
||||
var processSave = function (downloadUri, body, fileName, userAddress, resp, newVersion) {
|
||||
var curExt = fileUtility.getFileExtension(fileName);
|
||||
var downloadExt = fileUtility.getFileExtension(downloadUri);
|
||||
|
||||
@ -300,7 +298,10 @@ app.post("/track", function (req, res) {
|
||||
var key = documentService.generateRevisionId(downloadUri);
|
||||
|
||||
try {
|
||||
downloadUri = documentService.getConvertedUri(downloadUri, downloadExt, curExt, key);
|
||||
documentService.getConvertedUriSync(downloadUri, downloadExt, curExt, key, function(dUri){
|
||||
processSave(dUri, body, fileName, userAddress, resp, newVersion)
|
||||
});
|
||||
return;
|
||||
} catch (ex) {
|
||||
console.log(ex);
|
||||
fileName = docManager.getCorrectName(fileUtility.getFileName(fileName, true) + downloadExt, userAddress)
|
||||
@ -348,7 +349,10 @@ app.post("/track", function (req, res) {
|
||||
} catch (ex) {
|
||||
console.log(ex);
|
||||
}
|
||||
}
|
||||
|
||||
response.write("{\"error\":0}");
|
||||
response.end();
|
||||
};
|
||||
|
||||
if (body.status == 1) { //Editing
|
||||
if (body.actions && body.actions[0].type == 0) { //finished edit
|
||||
@ -362,15 +366,17 @@ app.post("/track", function (req, res) {
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (body.status == 2 || body.status == 3) { //MustSave, Corrupted
|
||||
processSave(body, fileName, userAddress, true);
|
||||
} else if (body.status == 6 || body.status == 7) { //MustForceSave, CorruptedForceSave
|
||||
processSave(body, fileName, userAddress);
|
||||
|
||||
} else if (body.status == 2 || body.status == 3 //MustSave, Corrupted
|
||||
|| body.status == 6 || body.status == 7) { //MustForceSave, CorruptedForceSave
|
||||
var newVersion = (body.status == 2 || body.status == 3);
|
||||
processSave(body.url, body, fileName, userAddress, response, newVersion);
|
||||
return;
|
||||
}
|
||||
|
||||
response.write("{\"error\":0}");
|
||||
response.end();
|
||||
}
|
||||
};
|
||||
|
||||
var readbody = function (request, response, fileName, userAddress) {
|
||||
var content = "";
|
||||
@ -381,7 +387,7 @@ app.post("/track", function (req, res) {
|
||||
var body = JSON.parse(content);
|
||||
processTrack(response, body, fileName, userAddress);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
if (req.body.hasOwnProperty("status")) {
|
||||
processTrack(res, req.body, fileName, userAddress);
|
||||
@ -406,7 +412,7 @@ app.get("/editor", function (req, res) {
|
||||
if (fileExt != null) {
|
||||
var fileName = docManager.createDemo((req.query.sample ? "sample." : "new.") + fileExt, userid, name);
|
||||
|
||||
var redirectPath = docManager.getProtocol() + "://" + docManager.req.get("host") + "/editor?fileName=" + encodeURIComponent(fileName) + docManager.getCustomParams();
|
||||
var redirectPath = docManager.getServerUrl() + "/editor?fileName=" + encodeURIComponent(fileName) + docManager.getCustomParams();
|
||||
res.redirect(redirectPath);
|
||||
return;
|
||||
}
|
||||
@ -463,7 +469,7 @@ app.get("/editor", function (req, res) {
|
||||
documentType: fileUtility.getFileType(fileName),
|
||||
key: key,
|
||||
callbackUrl: docManager.getCallback(fileName),
|
||||
isEdit: canEdit,
|
||||
isEdit: canEdit && mode != "review",
|
||||
mode: canEdit && mode != "view" ? "edit" : "view",
|
||||
canBackToFolder: type != "embedded",
|
||||
getServerUrl: docManager.getServerUrl(),
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2016
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
*
|
||||
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
|
||||
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2016
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
*
|
||||
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
|
||||
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
|
||||
@ -152,7 +152,7 @@ docManager.getFileUri = function (fileName) {
|
||||
};
|
||||
|
||||
docManager.getlocalFileUri = function (fileName, version) {
|
||||
var serverPath = docManager.getProtocol() + "://" + docManager.req.get("host");
|
||||
var serverPath = docManager.getServerUrl();
|
||||
var storagePath = storageFolder.length ? storageFolder + "/" : "";
|
||||
var hostAddress = docManager.curUserHostAddress();
|
||||
var url = serverPath + "/" + storagePath + hostAddress + "/" + encodeURIComponent(fileName);
|
||||
@ -167,7 +167,7 @@ docManager.getServerUrl = function () {
|
||||
};
|
||||
|
||||
docManager.getCallback = function (fileName) {
|
||||
var server = docManager.getProtocol() + "://" + docManager.req.get("host");
|
||||
var server = docManager.getServerUrl();
|
||||
var hostAddress = docManager.curUserHostAddress();
|
||||
var handler = "/track?useraddress=" + encodeURIComponent(hostAddress) + "&filename=" + encodeURIComponent(fileName);
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2016
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
*
|
||||
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
|
||||
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
|
||||
@ -25,7 +25,6 @@
|
||||
|
||||
var path = require("path");
|
||||
var urllib = require("urllib");
|
||||
var syncRequest = require("sync-request");
|
||||
var xml2js = require("xml2js");
|
||||
var fileUtility = require("./fileUtility");
|
||||
var guidManager = require("./guidManager");
|
||||
@ -34,52 +33,71 @@ var siteUrl = configServer.get('siteUrl');
|
||||
|
||||
var documentService = {};
|
||||
|
||||
documentService.convertParams = "?url={0}&outputtype={1}&filetype={2}&title={3}&key={4}";
|
||||
documentService.commandParams = "?c={0}&key={1}";
|
||||
documentService.userIp = null;
|
||||
|
||||
documentService.getConvertedUri = function (documentUri, fromExtension, toExtension, documentRevisionId) {
|
||||
var xml = documentService.sendRequestToConvertService(documentUri, fromExtension, toExtension, documentRevisionId);
|
||||
documentService.getConvertedUriSync = function (documentUri, fromExtension, toExtension, documentRevisionId, callback) {
|
||||
documentRevisionId = documentService.generateRevisionId(documentRevisionId || documentUri);
|
||||
|
||||
var res = documentService.getResponseUri(xml);
|
||||
|
||||
return res.value;
|
||||
documentService.getConvertedUri(documentUri, fromExtension, toExtension, documentRevisionId, false, function (err, data) {
|
||||
if (err) {
|
||||
callback();
|
||||
return;
|
||||
}
|
||||
var res = documentService.getResponseUri(data);
|
||||
callback(res.value);
|
||||
});
|
||||
};
|
||||
|
||||
documentService.getConvertedUriAsync = function (documentUri, fromExtension, toExtension, documentRevisionId, callback) {
|
||||
documentService.getConvertedUri = function (documentUri, fromExtension, toExtension, documentRevisionId, async, callback) {
|
||||
fromExtension = fromExtension || fileUtility.getFileExtension(documentUri);
|
||||
|
||||
var title = fileUtility.getFileName(documentUri) || guidManager.newGuid();
|
||||
|
||||
documentRevisionId = documentService.generateRevisionId(documentRevisionId || documentUri);
|
||||
|
||||
var params = documentService.convertParams.format(
|
||||
encodeURIComponent(documentUri),
|
||||
toExtension.replace(".", ""),
|
||||
fromExtension.replace(".", ""),
|
||||
title,
|
||||
documentRevisionId);
|
||||
var params = {
|
||||
async: async,
|
||||
url: documentUri,
|
||||
outputtype: toExtension.replace(".", ""),
|
||||
filetype: fromExtension.replace(".", ""),
|
||||
title: title,
|
||||
key: documentRevisionId
|
||||
};
|
||||
|
||||
urllib.request(siteUrl + configServer.get('converterUrl') + params, callback);
|
||||
urllib.request(siteUrl + configServer.get('converterUrl'),
|
||||
{
|
||||
method: "POST",
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
data: params
|
||||
},
|
||||
callback);
|
||||
};
|
||||
|
||||
documentService.getExternalUri = function (fileStream, contentLength, contentType, documentRevisionId) {
|
||||
var params = documentService.convertParams.format("", "", "", "", documentRevisionId);
|
||||
documentService.getExternalUri = function (fileStream, contentLength, contentType, documentRevisionId, callback) {
|
||||
documentRevisionId = documentService.generateRevisionId(documentRevisionId);
|
||||
|
||||
var urlTostorage = siteUrl + configServer.get('storageUrl') + params;
|
||||
var urlTostorage = siteUrl + configServer.get('storageUrl') + "?key=" + documentRevisionId;
|
||||
|
||||
var response = syncRequest("POST", urlTostorage, {
|
||||
headers: {
|
||||
"Content-Type": contentType == null ? "application/octet-stream" : contentType,
|
||||
"Content-Length": contentLength.toString(),
|
||||
"charset": "utf-8"
|
||||
urllib.request(urlTostorage,
|
||||
{
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": contentType == null ? "application/octet-stream" : contentType,
|
||||
"Content-Length": contentLength.toString(),
|
||||
"charset": "utf-8"
|
||||
},
|
||||
data: fileStream
|
||||
},
|
||||
body: fileStream
|
||||
});
|
||||
|
||||
var res = documentService.getResponseUri(response.body.toString());
|
||||
|
||||
return res.value;
|
||||
function (err, data) {
|
||||
if (err) {
|
||||
callback();
|
||||
return;
|
||||
}
|
||||
var res = documentService.getResponseUri(data);
|
||||
callback(res.value);
|
||||
});
|
||||
};
|
||||
|
||||
documentService.generateRevisionId = function (expectedKey) {
|
||||
@ -92,24 +110,6 @@ documentService.generateRevisionId = function (expectedKey) {
|
||||
return key.substring(0, Math.min(key.length, 20));
|
||||
};
|
||||
|
||||
documentService.sendRequestToConvertService = function (documentUri, fromExtension, toExtension, documentRevisionId) {
|
||||
fromExtension = fromExtension || fileUtility.getFileExtension(documentUri);
|
||||
|
||||
var title = fileUtility.getFileName(documentUri) || guidManager.newGuid();
|
||||
|
||||
documentRevisionId = documentService.generateRevisionId(documentRevisionId || documentUri);
|
||||
|
||||
var params = documentService.convertParams.format(
|
||||
encodeURIComponent(documentUri),
|
||||
toExtension.replace(".", ""),
|
||||
fromExtension.replace(".", ""),
|
||||
title,
|
||||
documentRevisionId);
|
||||
|
||||
var res = syncRequest("GET", siteUrl + configServer.get('converterUrl') + params);
|
||||
return res.getBody("utf8");
|
||||
};
|
||||
|
||||
documentService.processConvertServiceResponceError = function (errorCode) {
|
||||
var errorMessage = "";
|
||||
var errorMessageTemplate = "Error occurred in the ConvertService: ";
|
||||
@ -200,14 +200,22 @@ documentService.convertXmlStringToJson = function (xml) {
|
||||
return res;
|
||||
};
|
||||
|
||||
documentService.commandRequest = function (method, documentRevisionId) {
|
||||
documentService.commandRequest = function (method, documentRevisionId, callback) {
|
||||
documentRevisionId = documentService.generateRevisionId(documentRevisionId);
|
||||
var params = documentService.commandParams.format(
|
||||
method,
|
||||
documentRevisionId);
|
||||
var params = {
|
||||
c: method,
|
||||
key: documentRevisionId
|
||||
};
|
||||
|
||||
var res = syncRequest("GET", siteUrl + configServer.get('commandUrl') + params).getBody("utf8");
|
||||
return JSON.parse(res).error;
|
||||
urllib.request(siteUrl + configServer.get('commandUrl'),
|
||||
{
|
||||
method: "POST",
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
data: params
|
||||
},
|
||||
callback);
|
||||
};
|
||||
|
||||
module.exports = documentService;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2016
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
*
|
||||
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
|
||||
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2016
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
*
|
||||
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
|
||||
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
|
||||
|
||||
BIN
web/documentserver-example/nodejs/public/images/review-24.png
Normal file
BIN
web/documentserver-example/nodejs/public/images/review-24.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 127 B |
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2016
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
*
|
||||
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
|
||||
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
|
||||
@ -25,12 +25,12 @@
|
||||
|
||||
var language;
|
||||
var userid;
|
||||
var name;
|
||||
var username;
|
||||
|
||||
if (typeof jQuery != "undefined") {
|
||||
jq = jQuery.noConflict();
|
||||
|
||||
name = getUrlVars()["name"];
|
||||
username = getUrlVars()["name"];
|
||||
userid = getUrlVars()["userid"];
|
||||
language = getUrlVars()["lang"];
|
||||
|
||||
@ -41,26 +41,26 @@ if (typeof jQuery != "undefined") {
|
||||
|
||||
|
||||
jq("#language").change(function() {
|
||||
var name = jq('#user option:selected').text();
|
||||
window.location = "?lang=" + jq(this).val() + "&userid=" + userid + "&name=" + name;
|
||||
var username = jq('#user option:selected').text();
|
||||
window.location = "?lang=" + jq(this).val() + "&userid=" + userid + "&name=" + username;
|
||||
});
|
||||
|
||||
|
||||
|
||||
if ("" != userid && undefined != userid)
|
||||
jq("#user").val(userid);
|
||||
else
|
||||
userid = jq("#user").val();
|
||||
|
||||
if ("" != name && undefined != name) {
|
||||
name=getUrlVars()["name"];
|
||||
if ("" != username && undefined != username) {
|
||||
username = getUrlVars()["name"];
|
||||
}
|
||||
else {
|
||||
name = jq('#user option:selected').text();
|
||||
username = jq('#user option:selected').text();
|
||||
}
|
||||
|
||||
jq("#user").change(function() {
|
||||
var name = jq('#user option:selected').text();
|
||||
window.location = "?lang=" + language + "&userid=" + jq(this).val() + "&name=" + name;
|
||||
var username = jq('#user option:selected').text();
|
||||
window.location = "?lang=" + language + "&userid=" + jq(this).val() + "&name=" + username;
|
||||
});
|
||||
|
||||
jq(function () {
|
||||
@ -198,7 +198,7 @@ if (typeof jQuery != "undefined") {
|
||||
|
||||
jq(document).on("click", "#beginEdit:not(.disable)", function () {
|
||||
var fileId = encodeURIComponent(jq('#hiddenFileName').val());
|
||||
var url = UrlEditor + "?fileName=" + fileId + "&lang=" + language + "&userid=" + userid + "&name=" + name;
|
||||
var url = UrlEditor + "?fileName=" + fileId + "&lang=" + language + "&userid=" + userid + "&name=" + username;
|
||||
window.open(url, "_blank");
|
||||
jq('#hiddenFileName').val("");
|
||||
jq.unblockUI();
|
||||
@ -207,7 +207,7 @@ if (typeof jQuery != "undefined") {
|
||||
|
||||
jq(document).on("click", "#beginView:not(.disable)", function () {
|
||||
var fileId = encodeURIComponent(jq('#hiddenFileName').val());
|
||||
var url = UrlEditor + "?mode=view&fileName=" + fileId + "&lang=" + language + "&userid=" + userid + "&name=" + name;
|
||||
var url = UrlEditor + "?mode=view&fileName=" + fileId + "&lang=" + language + "&userid=" + userid + "&name=" + username;
|
||||
window.open(url, "_blank");
|
||||
jq('#hiddenFileName').val("");
|
||||
jq.unblockUI();
|
||||
@ -216,7 +216,7 @@ if (typeof jQuery != "undefined") {
|
||||
|
||||
jq(document).on("click", "#beginEmbedded:not(.disable)", function () {
|
||||
var fileId = encodeURIComponent(jq('#hiddenFileName').val());
|
||||
var url = UrlEditor + "?type=embedded&fileName=" + fileId + "&lang=" + language + "&userid=" + userid + "&name=" + name;
|
||||
var url = UrlEditor + "?type=embedded&fileName=" + fileId + "&lang=" + language + "&userid=" + userid + "&name=" + username;
|
||||
|
||||
jq("#mainProgress").addClass("embedded");
|
||||
jq("#beginEmbedded").addClass("disable");
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2016
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
*
|
||||
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
|
||||
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2016
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
*
|
||||
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
|
||||
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
|
||||
@ -288,7 +288,7 @@ footer {
|
||||
background-repeat: no-repeat;
|
||||
display: inline-block;
|
||||
height: 16px;
|
||||
max-width: 450px;
|
||||
max-width: 250px;
|
||||
margin-bottom: -6px;
|
||||
overflow: hidden;
|
||||
padding: 8px 0 1px 34px;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<!--*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2016
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
*
|
||||
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
|
||||
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
|
||||
@ -114,8 +114,9 @@
|
||||
created: new Date().toDateString()
|
||||
},
|
||||
permissions: {
|
||||
download: true,
|
||||
edit: "<%= editor.isEdit %>" == "true",
|
||||
download: true
|
||||
review: true,
|
||||
}
|
||||
},
|
||||
editorConfig: {
|
||||
@ -138,7 +139,7 @@
|
||||
comments: true,
|
||||
feedback: true,
|
||||
goback: {
|
||||
url: ("<%= editor.type %>" == "embedded" ? null : "<%= editor.getServerUrl %>")
|
||||
url: "<%= editor.getServerUrl %>"
|
||||
}
|
||||
},
|
||||
fileChoiceUrl: "<%= editor.fileChoiceUrl %>",
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<!--*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2016
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
*
|
||||
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
|
||||
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
|
||||
@ -129,7 +129,7 @@
|
||||
<thead>
|
||||
<tr class="tableHeader">
|
||||
<td class="tableHeaderCell tableHeaderCellFileName">Filename</td>
|
||||
<td colspan="2" class="tableHeaderCell contentCells-shift">Editors</td>
|
||||
<td colspan="3" class="tableHeaderCell contentCells-shift">Editors</td>
|
||||
<td colspan="3" class="tableHeaderCell">Viewers</td>
|
||||
</tr>
|
||||
</thead>
|
||||
@ -137,7 +137,7 @@
|
||||
<% for (var i = 0; i < storedFiles.length; i++) { %>
|
||||
<tr class="tableRow" title="<%=storedFiles[i].name%>">
|
||||
<td class="contentCells">
|
||||
<a class="stored-edit <%= storedFiles[i].documentType%>" href="editor?fileName=<%= encodeURIComponent(storedFiles[i].name) + params %>" target="_blank">
|
||||
<a class="stored-edit <%= storedFiles[i].documentType %>" href="editor?fileName=<%= encodeURIComponent(storedFiles[i].name) + params %>" target="_blank">
|
||||
<span title="<%= storedFiles[i].url %>"><%= storedFiles[i].name %></span></a>
|
||||
<a href="<%= storedFiles[i].url %>">
|
||||
<img class="icon-download" src="images/download-24.png" alt="Download" title="Download" /></a>
|
||||
@ -148,10 +148,16 @@
|
||||
<a href="editor?fileName=<%= encodeURIComponent(storedFiles[i].name) + params %>" target="_blank">
|
||||
<img src="images/desktop-24.png" alt="Open in editor for full size screens" title="Open in editor for full size screens" /></a>
|
||||
</td>
|
||||
<td class="contentCells contentCells-shift contentCells-icon">
|
||||
<td class="contentCells contentCells-icon">
|
||||
<a href="editor?type=mobile&mode=edit&fileName=<%= encodeURIComponent(storedFiles[i].name) + params %>" target="_blank">
|
||||
<img src="images/mobile-24.png" alt="Open in editor for mobile devices" title="Open in editor for mobile devices" /></a>
|
||||
</td>
|
||||
<td class="contentCells contentCells-shift contentCells-icon">
|
||||
<% if (storedFiles[i].documentType == "text") { %>
|
||||
<a href="editor?mode=review&fileName=<%= encodeURIComponent(storedFiles[i].name) + params %>" target="_blank">
|
||||
<img src="images/review-24.png" alt="Open in editor for review" title="Open in editor for review" /></a>
|
||||
<% } %>
|
||||
</td>
|
||||
<td class="contentCells contentCells-icon">
|
||||
<a href="editor?mode=view&fileName=<%= encodeURIComponent(storedFiles[i].name) + params %>" target="_blank">
|
||||
<img src="images/desktop-24.png" alt="Open in viewer for full size screens" title="Open in viewer for full size screens" /></a>
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2016 ONLYOFFICE
|
||||
Copyright (c) 2017 ONLYOFFICE
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
BIN
web/documentserver-example/php/css/images/review-24.png
Normal file
BIN
web/documentserver-example/php/css/images/review-24.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 127 B |
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2016
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
*
|
||||
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
|
||||
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
|
||||
@ -291,7 +291,7 @@ footer {
|
||||
background-repeat: no-repeat;
|
||||
display: inline-block;
|
||||
height: 16px;
|
||||
max-width: 450px;
|
||||
max-width: 250px;
|
||||
margin-bottom: -6px;
|
||||
overflow: hidden;
|
||||
padding: 8px 0 1px 34px;
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2016
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
*
|
||||
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
|
||||
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
|
||||
@ -174,8 +174,9 @@
|
||||
},
|
||||
|
||||
permissions: {
|
||||
edit: <?php echo (in_array(strtolower('.' . pathinfo($filename, PATHINFO_EXTENSION)), $GLOBALS['DOC_SERV_EDITED']) ? "true" : "false") ?>,
|
||||
download: true,
|
||||
edit: <?php echo (in_array(strtolower('.' . pathinfo($filename, PATHINFO_EXTENSION)), $GLOBALS['DOC_SERV_EDITED']) && $_GET["action"] != "review" ? "true" : "false") ?>,
|
||||
review: true
|
||||
}
|
||||
},
|
||||
editorConfig: {
|
||||
|
||||
@ -100,23 +100,6 @@ function DoUpload($fileUri) {
|
||||
}
|
||||
|
||||
|
||||
function generateUrlToConverter($document_uri, $from_extension, $to_extension, $title, $document_revision_id, $is_async) {
|
||||
$urlToConverterParams = array(
|
||||
"url" => $document_uri,
|
||||
"outputtype" => trim($to_extension,'.'),
|
||||
"filetype" => trim($from_extension, '.'),
|
||||
"title" => $title,
|
||||
"key" => $document_revision_id);
|
||||
|
||||
$urlToConverter = $GLOBALS['DOC_SERV_CONVERTER_URL'] . "?" . http_build_query($urlToConverterParams);
|
||||
|
||||
if ($is_async)
|
||||
$urlToConverter = $urlToConverter . "&async=true";
|
||||
|
||||
return $urlToConverter;
|
||||
}
|
||||
|
||||
|
||||
function generateUrlToStorage($document_uri, $from_extension, $to_extension, $title, $document_revision_id) {
|
||||
|
||||
return $GLOBALS['DOC_SERV_STORAGE_URL'] . "?" . http_build_query(
|
||||
@ -221,16 +204,29 @@ function SendRequestToConvertService($document_uri, $from_extension, $to_extensi
|
||||
|
||||
$document_revision_id = GenerateRevisionId($document_revision_id);
|
||||
|
||||
$urlToConverter = generateUrlToConverter($document_uri, $from_extension, $to_extension, $title, $document_revision_id, $is_async);
|
||||
$urlToConverter = $GLOBALS['DOC_SERV_CONVERTER_URL'];
|
||||
|
||||
$data = json_encode(
|
||||
array(
|
||||
"async" => $is_async,
|
||||
"url" => $document_uri,
|
||||
"outputtype" => trim($to_extension,'.'),
|
||||
"filetype" => trim($from_extension, '.'),
|
||||
"title" => $title,
|
||||
"key" => $document_revision_id
|
||||
)
|
||||
);
|
||||
|
||||
$response_xml_data;
|
||||
$countTry = 0;
|
||||
|
||||
$opts = array('http' => array(
|
||||
'method' => 'GET',
|
||||
'timeout' => $GLOBALS['DOC_SERV_TIMEOUT']
|
||||
)
|
||||
);
|
||||
'method' => 'POST',
|
||||
'timeout' => $GLOBALS['DOC_SERV_TIMEOUT'],
|
||||
'header'=> "Content-type: application/json\r\n",
|
||||
'content' => $data
|
||||
)
|
||||
);
|
||||
|
||||
if (substr($urlToConverter, 0, strlen("https")) === "https") {
|
||||
$opts['ssl'] = array( 'verify_peer' => FALSE );
|
||||
@ -253,8 +249,8 @@ function SendRequestToConvertService($document_uri, $from_extension, $to_extensi
|
||||
if (!function_exists('simplexml_load_file')){
|
||||
throw new Exception("Server can't read xml");
|
||||
}
|
||||
$data = simplexml_load_string($response_xml_data);
|
||||
if (!$data) {
|
||||
$response_data = simplexml_load_string($response_xml_data);
|
||||
if (!$response_data) {
|
||||
$exc = "Bad Response. Errors: ";
|
||||
foreach(libxml_get_errors() as $error) {
|
||||
$exc = $exc . "\t" . $error->message;
|
||||
@ -262,7 +258,7 @@ function SendRequestToConvertService($document_uri, $from_extension, $to_extensi
|
||||
throw new Exception ($exc);
|
||||
}
|
||||
|
||||
return $data;
|
||||
return $response_data;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2016
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
*
|
||||
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
|
||||
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
|
||||
@ -163,7 +163,7 @@
|
||||
<thead>
|
||||
<tr class="tableHeader">
|
||||
<td class="tableHeaderCell tableHeaderCellFileName">Filename</td>
|
||||
<td colspan="2" class="tableHeaderCell contentCells-shift">Editors</td>
|
||||
<td colspan="3" class="tableHeaderCell contentCells-shift">Editors</td>
|
||||
<td colspan="3" class="tableHeaderCell">Viewers</td>
|
||||
</tr>
|
||||
</thead>
|
||||
@ -188,10 +188,16 @@
|
||||
echo ' <img src="css/images/desktop-24.png" alt="Open in editor for full size screens" title="Open in editor for full size screens" /></a>';
|
||||
echo ' </a>';
|
||||
echo ' </td>';
|
||||
echo ' <td class="contentCells contentCells-shift contentCells-icon">';
|
||||
echo ' <td class="contentCells contentCells-icon">';
|
||||
echo ' <a href="doceditor.php?fileID='.urlencode($storeFile->name).'&user='.$user.'&type=mobile" target="_blank">';
|
||||
echo ' <img src="css/images/mobile-24.png" alt="Open in editor for mobile devices" title="Open in editor for mobile devices" /></a>';
|
||||
echo ' </a>';
|
||||
echo ' <td class="contentCells contentCells-shift contentCells-icon">';
|
||||
if ($storeFile->documentType == "text") {
|
||||
echo ' <a href="doceditor.php?fileID='.urlencode($storeFile->name).'&user='.$user.'&action=review" target="_blank">';
|
||||
echo ' <img src="css/images/review-24.png" alt="Open in editor for review" title="Open in editor for review" /></a>';
|
||||
echo ' </a>';
|
||||
}
|
||||
echo ' </td>';
|
||||
echo ' <td class="contentCells contentCells-icon">';
|
||||
echo ' <a href="doceditor.php?fileID='.urlencode($storeFile->name).'&user='.$user.'&action=view" target="_blank">';
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2016
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
*
|
||||
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
|
||||
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2016 ONLYOFFICE
|
||||
Copyright (c) 2017 ONLYOFFICE
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2016
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
*
|
||||
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
|
||||
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<!--*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2016
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
*
|
||||
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
|
||||
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
|
||||
|
||||
Reference in New Issue
Block a user