mirror of
https://github.com/ONLYOFFICE/document-server-integration.git
synced 2026-04-07 14:06:11 +08:00
Compare commits
17 Commits
v5.2.99.92
...
v5.3.0.173
| Author | SHA1 | Date | |
|---|---|---|---|
| a536fdf6ab | |||
| 71103b802e | |||
| 0b33ce14f7 | |||
| a945870c6a | |||
| cafaa27e92 | |||
| d22d2ace22 | |||
| 430a16b543 | |||
| d2a89f4a5f | |||
| efda987b55 | |||
| 20827e4d76 | |||
| 16473b4e06 | |||
| 30d26df97d | |||
| 9fb0289af4 | |||
| fa8e2cf975 | |||
| 68f6be2e43 | |||
| 87381123e3 | |||
| 7d79efe1f1 |
@ -1,6 +1,6 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2018 ONLYOFFICE
|
||||
Copyright (c) 2019 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-2018
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2018
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2018
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2018
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2018
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2018
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2018
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2018
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2018
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2018
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2018 ONLYOFFICE
|
||||
Copyright (c) 2019 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-2018
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2018
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -7,7 +7,7 @@ using System.Runtime.InteropServices;
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Ascensio System SIA")]
|
||||
[assembly: AssemblyProduct("OnlineEditorsExampleMVC")]
|
||||
[assembly: AssemblyCopyright("Ascensio System SIA 2018")]
|
||||
[assembly: AssemblyCopyright("Ascensio System SIA 2019")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2018
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<!--*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2018
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
@ -61,7 +61,7 @@
|
||||
console.log(message);
|
||||
};
|
||||
|
||||
var onReady = function () {
|
||||
var onAppReady = function () {
|
||||
innerAlert("Document editor ready");
|
||||
};
|
||||
|
||||
@ -136,7 +136,7 @@
|
||||
},
|
||||
},
|
||||
events: {
|
||||
'onReady': onReady,
|
||||
'onAppReady': onAppReady,
|
||||
'onDocumentStateChange': onDocumentStateChange,
|
||||
'onRequestEditRights': onRequestEditRights,
|
||||
'onError': onError,
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<!--*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2018
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2018
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2018
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2018
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -53,7 +53,7 @@
|
||||
console.log(message);
|
||||
};
|
||||
|
||||
var onReady = function () {
|
||||
var onAppReady = function () {
|
||||
innerAlert("Document editor ready");
|
||||
};
|
||||
|
||||
@ -128,7 +128,7 @@
|
||||
},
|
||||
},
|
||||
events: {
|
||||
'onReady': onReady,
|
||||
'onAppReady': onAppReady,
|
||||
'onDocumentStateChange': onDocumentStateChange,
|
||||
'onRequestEditRights': onRequestEditRights,
|
||||
'onError': onError,
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2018
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2018
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2018 ONLYOFFICE
|
||||
Copyright (c) 2019 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
|
||||
|
||||
@ -7,7 +7,7 @@ using System.Runtime.InteropServices;
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Ascensio System SIA")]
|
||||
[assembly: AssemblyProduct("OnlineEditorsExample")]
|
||||
[assembly: AssemblyCopyright("Ascensio System SIA 2018")]
|
||||
[assembly: AssemblyCopyright("Ascensio System SIA 2019")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2018
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2018
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,9 +0,0 @@
|
||||
FROM ubuntu:16.04
|
||||
RUN apt-get update && apt-get install -y software-properties-common \
|
||||
python-software-properties
|
||||
RUN add-apt-repository -y ppa:webupd8team/java
|
||||
RUN echo "oracle-java8-installer shared/accepted-oracle-license-v1-1 select true" | debconf-set-selections
|
||||
RUN apt-get update && apt-get install -y oracle-java8-installer \
|
||||
maven
|
||||
COPY . /java
|
||||
CMD mvn -f /java package
|
||||
@ -1,6 +1,6 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2018 ONLYOFFICE
|
||||
Copyright (c) 2019 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
|
||||
|
||||
@ -55,7 +55,6 @@ files.docservice.url.preloader=https://documentserver/web-apps/apps/api/document
|
||||
|
||||
Run next command in java example directory:
|
||||
```
|
||||
docker build . -t java-example
|
||||
docker run -it -v $PWD/target:/java/target java-example
|
||||
docker-compose up
|
||||
```
|
||||
After it, all bin files will be passed to `./target` folder
|
||||
|
||||
7
web/documentserver-example/java/docker-compose.yml
Normal file
7
web/documentserver-example/java/docker-compose.yml
Normal file
@ -0,0 +1,7 @@
|
||||
version: '3'
|
||||
services:
|
||||
build:
|
||||
image: maven:3.6
|
||||
volumes:
|
||||
- .:/java
|
||||
command: mvn -f /java package
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2018
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2018
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2018
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
@ -27,6 +27,7 @@
|
||||
|
||||
package controllers;
|
||||
|
||||
import helpers.ConfigManager;
|
||||
import helpers.DocumentManager;
|
||||
import helpers.ServiceConverter;
|
||||
import java.io.File;
|
||||
@ -35,6 +36,7 @@ import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.PrintWriter;
|
||||
import java.net.URL;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Scanner;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.annotation.MultipartConfig;
|
||||
@ -54,6 +56,8 @@ import org.primeframework.jwt.domain.JWT;
|
||||
@MultipartConfig
|
||||
public class IndexServlet extends HttpServlet
|
||||
{
|
||||
private static final String DocumentJwtHeader = ConfigManager.GetProperty("files.docservice.header");
|
||||
|
||||
protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
|
||||
{
|
||||
String action = request.getParameter("type");
|
||||
@ -255,6 +259,11 @@ public class IndexServlet extends HttpServlet
|
||||
{
|
||||
String token = (String) jsonObj.get("token");
|
||||
|
||||
if (token == null) {
|
||||
String header = (String) request.getHeader(DocumentJwtHeader == "" ? "Authorization" : DocumentJwtHeader);
|
||||
token = header.startsWith("Bearer ") ? header.substring(7) : header;
|
||||
}
|
||||
|
||||
JWT jwt = DocumentManager.ReadToken(token);
|
||||
if (jwt == null)
|
||||
{
|
||||
@ -262,6 +271,19 @@ public class IndexServlet extends HttpServlet
|
||||
return;
|
||||
}
|
||||
|
||||
if (jwt.getObject("payload") != null) {
|
||||
try {
|
||||
@SuppressWarnings("unchecked") LinkedHashMap<String, Object> payload =
|
||||
(LinkedHashMap<String, Object>)jwt.getObject("payload");
|
||||
|
||||
jwt.claims = payload;
|
||||
}
|
||||
catch (Exception ex) {
|
||||
writer.write("Wrong payload");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
status = jwt.getInteger("status");
|
||||
downloadUri = jwt.getString("url");
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2018
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2018
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2018
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2018
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2018
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2018
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
@ -49,6 +49,7 @@ public class ServiceConverter
|
||||
{
|
||||
private static int ConvertTimeout = 120000;
|
||||
private static final String DocumentConverterUrl = ConfigManager.GetProperty("files.docservice.url.converter");
|
||||
private static final String DocumentJwtHeader = ConfigManager.GetProperty("files.docservice.header");
|
||||
|
||||
public static class ConvertBody
|
||||
{
|
||||
@ -96,6 +97,26 @@ public class ServiceConverter
|
||||
if (isAsync)
|
||||
body.async = true;
|
||||
|
||||
String headerToken = "";
|
||||
if (DocumentManager.TokenEnabled())
|
||||
{
|
||||
HashMap<String, Object> map = new HashMap<String, Object>();
|
||||
map.put("url", body.url);
|
||||
map.put("outputtype", body.outputtype);
|
||||
map.put("filetype", body.filetype);
|
||||
map.put("title", body.title);
|
||||
map.put("key", body.key);
|
||||
if (isAsync)
|
||||
map.put("async", body.async);
|
||||
|
||||
String token = DocumentManager.CreateToken(map);
|
||||
body.token = token;
|
||||
|
||||
Map<String, Object> payloadMap = new HashMap<String, Object>();
|
||||
payloadMap.put("payload", map);
|
||||
headerToken = DocumentManager.CreateToken(payloadMap);
|
||||
}
|
||||
|
||||
Gson gson = new Gson();
|
||||
String bodyString = gson.toJson(body);
|
||||
|
||||
@ -112,10 +133,7 @@ public class ServiceConverter
|
||||
|
||||
if (DocumentManager.TokenEnabled())
|
||||
{
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("payload", body);
|
||||
String token = DocumentManager.CreateToken(map);
|
||||
connection.setRequestProperty("Authorization", "Bearer " + token);
|
||||
connection.setRequestProperty(DocumentJwtHeader == "" ? "Authorization" : DocumentJwtHeader, "Bearer " + headerToken);
|
||||
}
|
||||
|
||||
connection.connect();
|
||||
|
||||
@ -11,3 +11,4 @@ files.docservice.url.tempstorage=https://documentserver/ResourceService.ashx
|
||||
files.docservice.url.api=https://documentserver/web-apps/apps/api/documents/api.js
|
||||
files.docservice.url.preloader=https://documentserver/web-apps/apps/api/documents/cache-scripts.html
|
||||
files.docservice.secret=
|
||||
files.docservice.header=Authorization
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2018
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2018
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<!--*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2018
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
@ -48,7 +48,7 @@
|
||||
console.log(message);
|
||||
};
|
||||
|
||||
var onReady = function () {
|
||||
var onAppReady = function () {
|
||||
innerAlert("Document editor ready");
|
||||
};
|
||||
|
||||
@ -71,11 +71,11 @@
|
||||
};
|
||||
|
||||
var сonnectEditor = function () {
|
||||
var config = <%= FileModel.Serialize(Model) %>;
|
||||
var config = JSON.parse('<%= FileModel.Serialize(Model) %>');
|
||||
config.width = "100%";
|
||||
config.height = "100%";
|
||||
config.events = {
|
||||
"onReady": onReady,
|
||||
"onAppReady": onAppReady,
|
||||
"onDocumentStateChange": onDocumentStateChange,
|
||||
'onRequestEditRights': onRequestEditRights,
|
||||
"onError": onError,
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<!--*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2018
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2018
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2018 ONLYOFFICE
|
||||
Copyright (c) 2019 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-2018
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2018
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2018
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2018 ONLYOFFICE
|
||||
Copyright (c) 2019 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,7 +1,7 @@
|
||||
"use strict";
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2018
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
@ -132,7 +132,7 @@ app.get("/download", function(req, res) {
|
||||
res.setHeader("Content-Length", fileSystem.statSync(path).size);
|
||||
res.setHeader("Content-Type", mime.lookup(path));
|
||||
|
||||
res.setHeader("Content-Disposition", "attachment; filename=\"" + fileName + "\"");
|
||||
res.setHeader("Content-Disposition", "attachment; filename*=UTF-8\'\'" + encodeURIComponent(fileName));
|
||||
|
||||
var filestream = fileSystem.createReadStream(path);
|
||||
filestream.pipe(res);
|
||||
@ -532,6 +532,11 @@ app.get("/editor", function (req, res) {
|
||||
|
||||
var userAddress = docManager.curUserHostAddress();
|
||||
var fileName = fileUtility.getFileName(req.query.fileName);
|
||||
if (!docManager.existsSync(docManager.storagePath(fileName, userAddress))) {
|
||||
throw {
|
||||
"message": "File not found: " + fileName
|
||||
};
|
||||
}
|
||||
var key = docManager.getKey(fileName);
|
||||
var url = docManager.getFileUri(fileName);
|
||||
var mode = req.query.mode || "edit"; //mode: view/edit/review/comment/fillForms/embedded
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2018
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
"use strict";
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2018
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2018
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
@ -93,13 +93,14 @@ documentService.getConvertedUri = function (documentUri, fromExtension, toExtens
|
||||
};
|
||||
|
||||
documentService.generateRevisionId = function (expectedKey) {
|
||||
if (expectedKey.length > 20) {
|
||||
let maxKeyLength = 128;
|
||||
if (expectedKey.length > maxKeyLength) {
|
||||
expectedKey = expectedKey.hashCode().toString();
|
||||
}
|
||||
|
||||
var key = expectedKey.replace(new RegExp("[^0-9-.a-zA-Z_=]", "g"), "_");
|
||||
|
||||
return key.substring(0, Math.min(key.length, 20));
|
||||
return key.substring(0, Math.min(key.length, maxKeyLength));
|
||||
};
|
||||
|
||||
documentService.processConvertServiceResponceError = function (errorCode) {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2018
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2018
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
1279
web/documentserver-example/nodejs/package-lock.json
generated
Normal file
1279
web/documentserver-example/nodejs/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2018
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2018
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2018
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<!--*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2018
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
@ -53,7 +53,7 @@
|
||||
console.log(message);
|
||||
};
|
||||
|
||||
var onReady = function () {
|
||||
var onAppReady = function () {
|
||||
innerAlert("Document editor ready");
|
||||
};
|
||||
|
||||
@ -100,7 +100,7 @@
|
||||
|
||||
docEditor = new DocsAPI.DocEditor("iframeEditor", {<% include config %>,
|
||||
events: {
|
||||
"onReady": onReady,
|
||||
"onAppReady": onAppReady,
|
||||
"onDocumentStateChange": onDocumentStateChange,
|
||||
'onRequestEditRights': onRequestEditRights,
|
||||
"onError": onError,
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<!--*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2018
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
@ -244,7 +244,7 @@
|
||||
|
||||
<span id="loadScripts" data-docs="<%= preloaderUrl %>"></span>
|
||||
|
||||
<footer>© Ascensio Systems Inc 2018. All rights reserved.</footer>
|
||||
<footer>© Ascensio Systems SIA 2019. All rights reserved.</footer>
|
||||
|
||||
<script type="text/javascript" src="javascripts/jquery-1.8.2.js"></script>
|
||||
<script type="text/javascript" src="javascripts/jquery-ui.js"></script>
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2018 ONLYOFFICE
|
||||
Copyright (c) 2019 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,7 +1,7 @@
|
||||
<?php
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2018
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2018
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2018
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2018
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
@ -128,7 +128,7 @@
|
||||
console.log(message);
|
||||
};
|
||||
|
||||
var onReady = function () {
|
||||
var onAppReady = function () {
|
||||
innerAlert("Document editor ready");
|
||||
};
|
||||
|
||||
@ -213,7 +213,7 @@
|
||||
},
|
||||
},
|
||||
events: {
|
||||
'onReady': onReady,
|
||||
'onAppReady': onAppReady,
|
||||
'onDocumentStateChange': onDocumentStateChange,
|
||||
'onRequestEditRights': onRequestEditRights,
|
||||
'onError': onError,
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2018
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2018
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2018
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2018
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2018 ONLYOFFICE
|
||||
Copyright (c) 2019 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,5 +1,5 @@
|
||||
/*
|
||||
Copyright (c) Ascensio System SIA 2018. All rights reserved.
|
||||
Copyright (c) Ascensio System SIA 2019. All rights reserved.
|
||||
http://www.onlyoffice.com
|
||||
*/
|
||||
if (typeof jQuery != "undefined") {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (c) Ascensio System SIA 2018. All rights reserved.
|
||||
Copyright (c) Ascensio System SIA 2019. All rights reserved.
|
||||
http://www.onlyoffice.com
|
||||
*/
|
||||
html {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (c) Ascensio System SIA 2018. All rights reserved.
|
||||
Copyright (c) Ascensio System SIA 2019. All rights reserved.
|
||||
http://www.onlyoffice.com
|
||||
*/
|
||||
html {
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
console.log(message);
|
||||
};
|
||||
|
||||
var onReady = function () {
|
||||
var onAppReady = function () {
|
||||
innerAlert("Document editor ready");
|
||||
};
|
||||
|
||||
@ -91,7 +91,7 @@
|
||||
},
|
||||
},
|
||||
events: {
|
||||
'onReady': onReady,
|
||||
'onAppReady': onAppReady,
|
||||
'onDocumentStateChange': onDocumentStateChange,
|
||||
'onError': onError,
|
||||
'onOutdatedVersion': onOutdatedVersion,
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2018
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<!--*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2018
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
@ -90,6 +90,6 @@ onlyoffice4enterprise/documentserver-ee</pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer>© Ascensio Systems Inc 2018. All rights reserved.</footer>
|
||||
<footer>© Ascensio Systems SIA 2019. All rights reserved.</footer>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user