Compare commits

..

26 Commits

Author SHA1 Message Date
44ad9ad1ee master branch only 2024-11-21 13:26:00 +03:00
e97c8a8393 actions for go 2024-11-21 13:23:19 +03:00
78fe9e02ce Merge pull request 'release/v1.11.0' from release/v1.11.0 into master
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/document-server-integration/pulls/16
2024-10-31 13:49:25 +00:00
8e260dec56 nodejs: fix lint (b36bfdec4d) 2024-10-31 16:45:37 +03:00
3010db6bec Merge pull request 'build: update documentserver version to 8.2 in docker-compose files' from documentserver-version into release/v1.11.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/document-server-integration/pulls/14
2024-10-28 10:11:33 +00:00
9f922ccdbe build: update documentserver version to 8.2 in docker-compose files 2024-10-28 13:10:46 +03:00
cb8b4d1681 fix(nodejs): replace localhost in unsupported converted file url. Fix Bug 70551 (c4d80f6b5e) 2024-10-21 14:09:42 +03:00
decb722cf9 1.11.0 2024-10-20 17:08:13 +03:00
d7d31bd6b7 fix changelog 2024-10-16 11:56:16 +03:00
e4f5f0bca7 submit not for viewer
This reverts commit 35cf2fb0b0.
2024-10-15 18:06:37 +03:00
8714cc3d69 Revert "nodejs: comment only is not for pdf"
This reverts commit 146d26c868.
2024-10-14 12:08:22 +03:00
f1c5be0401 Merge remote-tracking branch 'remotes/origin/master' into release/v8.2.0 2024-10-11 12:33:49 +03:00
d68860f025 Merge pull request 'release/v1.10.0 from release/v1.10.0 into master
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/document-server-integration/pulls/9
2024-10-11 09:27:13 +00:00
fdd90fd851 python: fix lint 2024-10-11 12:20:12 +03:00
abb7f6e893 Merge remote-tracking branch 'remotes/origin/release/v1.10.0' into release/v8.2.0 2024-10-10 13:47:38 +03:00
89c60280ba php-laravel: lint 2024-10-10 13:40:12 +03:00
8522e08670 php-laravel: lint 2024-10-10 13:29:10 +03:00
52b792f3a2 Merge pull request 'fix(java-spring): error saving non-existent file. Fix Bug 70788' from fix-java-spring-forgotten into release/v1.10.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/document-server-integration/pulls/8
2024-10-10 10:18:41 +00:00
05f7fa2b84 fix(java-spring): error saving non-existent file. Fix Bug 70788 2024-10-10 17:11:48 +07:00
06c3dc1446 Merge remote-tracking branch 'remotes/origin/release/v1.10.0' into release/v8.2.0 2024-10-08 12:54:10 +03:00
b751d44a51 Merge pull request '1.10.0-bugfix' (#5) from 1.10.0-bugfix into release/v1.10.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/document-server-integration/pulls/5
2024-10-08 09:52:38 +00:00
35cf2fb0b0 submit for all modes 2024-10-07 14:54:16 +03:00
25ec76084f coauthoring/CommandService.ashx address replaced with command 2024-10-07 11:35:55 +03:00
c72218d3ae ConvertService.ashx address replaced with converter 2024-10-07 11:34:22 +03:00
17458ec5b3 fix(java-spring): сut out directUrl. Fix Bug 70571 2024-10-07 14:42:24 +07:00
c4d80f6b5e fix(nodejs): replace localhost in unsupported converted file url. Fix Bug 70551 2024-10-03 15:15:42 +07:00
51 changed files with 251 additions and 176 deletions

32
.github/workflows/artifact-go.yml vendored Normal file
View File

@ -0,0 +1,32 @@
name: Artifact Golang
on:
workflow_dispatch:
push:
branches: [master]
paths: ['web/documentserver-example/go/**']
pull_request:
branches: [master]
paths: ['web/documentserver-example/go/**']
jobs:
artifact:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Build Artifact
run: |
cd ${{ github.workspace }}
cwd=$(pwd)
git submodule update --init --recursive
cd ./web/documentserver-example/go
mkdir -p ./deploy/'Go Example'
rsync -av --exclude='deploy' ./ ./deploy/'Go Example'
rm -rf ./deploy/'Go Example'/static/assets/document-formats/.git
rm -rf ./deploy/'Go Example'/static/assets/document-templates/.git
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: Go.Example
path: ${{ github.workspace }}/web/documentserver-example/go/deploy

View File

@ -0,0 +1,31 @@
name: Artifact PHP Laravel
on:
workflow_dispatch:
push:
branches: [master]
paths: ['web/documentserver-example/php-laravel/**']
pull_request:
branches: [master]
paths: ['web/documentserver-example/php-laravel/**']
jobs:
artifact:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Build Artifact
run: |
cd ${{ github.workspace }}
git submodule update --init --recursive
cd ./web/documentserver-example/php-laravel
mkdir -p ./deploy/'PHP Laravel Example'
rsync -av --exclude='deploy' ./ ./deploy/'PHP Laravel Example'
rm -rf ./deploy/'PHP Laravel Example'/public/assets/document-formats/.git
rm -rf ./deploy/'PHP Laravel Example'/public/assets/document-templates/.git
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: PHP-Laravel.Example
path: ${{ github.workspace }}/web/documentserver-example/php-laravel/deploy

29
.github/workflows/lint-go.yml vendored Normal file
View File

@ -0,0 +1,29 @@
name: Golangci
on:
workflow_dispatch:
push:
branches: [master]
paths: ['web/documentserver-example/go/**']
pull_request:
branches: [master, develop]
paths: ['web/documentserver-example/go/**']
jobs:
lint:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./web/documentserver-example/go
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
- name: Lint Golangci
run: |
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
golangci-lint run

View File

@ -3,10 +3,10 @@ name: Lint Java
on:
workflow_dispatch:
push:
branches: [master, main]
branches: [master]
paths: ['web/documentserver-example/java/**']
pull_request:
branches: [master, main, develop]
branches: [master, develop]
paths: ['web/documentserver-example/java/**']
jobs:

View File

@ -3,10 +3,10 @@ name: ESLint
on:
workflow_dispatch:
push:
branches: [master, main]
branches: [master]
paths: ['web/documentserver-example/nodejs/**']
pull_request:
branches: [master, main, develop]
branches: [master, develop]
paths: ['web/documentserver-example/nodejs/**']
env:

37
.github/workflows/lint-php-laravel.yml vendored Normal file
View File

@ -0,0 +1,37 @@
name: Laravel Pint
on:
workflow_dispatch:
push:
branches: [master]
paths: ['web/documentserver-example/php-laravel/**']
pull_request:
branches: [master, develop]
paths: ['web/documentserver-example/php-laravel/**']
jobs:
lint:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
php: [8.2]
defaults:
run:
working-directory: ./web/documentserver-example/php-laravel
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: json, dom, curl, libxml, mbstring
coverage: none
- name: Install Pint
run: composer global require laravel/pint
- name: Run Pint
run: pint --test

View File

@ -3,10 +3,10 @@ name: PHPCs
on:
workflow_dispatch:
push:
branches: [master, main]
branches: [master]
paths: ['web/documentserver-example/php/**']
pull_request:
branches: [master, main, develop]
branches: [master, develop]
paths: ['web/documentserver-example/php/**']
jobs:

View File

@ -3,10 +3,10 @@ name: PyLint
on:
workflow_dispatch:
push:
branches: [master, main]
branches: [master]
paths: ['web/documentserver-example/python/**']
pull_request:
branches: [master, main, develop]
branches: [master, develop]
paths: ['web/documentserver-example/python/**']
jobs:

View File

@ -3,10 +3,10 @@ name: Rubocop
on:
workflow_dispatch:
push:
branches: [master, main]
branches: [master]
paths: ['web/documentserver-example/ruby/**']
pull_request:
branches: [master, main, develop]
branches: [master, develop]
paths: ['web/documentserver-example/ruby/**']
jobs:

View File

@ -3,10 +3,10 @@ name: Lint Spring
on:
workflow_dispatch:
push:
branches: [master, main]
branches: [master]
paths: ['web/documentserver-example/java-spring/**']
pull_request:
branches: [master, main, develop]
branches: [master, develop]
paths: ['web/documentserver-example/java-spring/**']
jobs:

View File

@ -2,7 +2,7 @@ name: Release
on:
push:
branches: [master,main]
branches: [master]
permissions:
contents: write

View File

@ -1,6 +1,10 @@
# Change Log
## 1.11.0
- he-IL skin language
- ConvertService.ashx address replaced with converter
- coauthoring/CommandService.ashx address replaced with command
- without submitForm in viewer
## 1.10.0
- nodejs: converting function on index page

View File

@ -225,7 +225,7 @@ namespace OnlineEditorsExampleMVC.Helpers
private static void ProcessResponseError(int errorCode)
{
var errorMessage = string.Empty;
const string errorMessageTemplate = "Error occurred in the ConvertService.ashx: {0}";
const string errorMessageTemplate = "Error occurred in the ConvertService: {0}";
switch (errorCode)
{

View File

@ -89,7 +89,7 @@ namespace OnlineEditorsExampleMVC.Models
editorsMode = "fillForms";
canEdit = true;
}
var submitForm = (editorsMode.Equals("fillForms") || editorsMode.Equals("embedded")) && user.id.Equals("uid-1"); // check if the Submit form button is displayed or not
var submitForm = !editorsMode.Equals("view") && user.id.Equals("uid-1"); // check if the Submit form button is displayed or not
var mode = canEdit && editorsMode != "view" ? "edit" : "view"; // set the mode parameter: change it to view if the document can't be edited
// favorite icon state

View File

@ -1,7 +1,7 @@
<?xml version="1.0"?>
<appSettings>
<clear />
<add key="version" value="1.10.0"/>
<add key="version" value="1.11.0"/>
<add key="filesize-max" value="52428800"/>
<add key="storage-path" value=""/>
@ -20,10 +20,10 @@
<add key="files.docservice.url.site" value="http://documentserver/"/>
<add key="files.docservice.url.converter" value="ConvertService.ashx"/>
<add key="files.docservice.url.converter" value="converter"/>
<add key="files.docservice.url.api" value="web-apps/apps/api/documents/api.js"/>
<add key="files.docservice.url.preloader" value="web-apps/apps/api/documents/cache-scripts.html"/>
<add key="files.docservice.url.command" value="coauthoring/CommandService.ashx"/>
<add key="files.docservice.url.command" value="command"/>
<add key="files.docservice.url.example" value=""/>

View File

@ -154,7 +154,7 @@ namespace OnlineEditorsExample
editorsMode = "fillForms";
canEdit = true;
}
var submitForm = (editorsMode.Equals("fillForms") || editorsMode.Equals("embedded")) && user.id.Equals("uid-1"); // check if the Submit form button is displayed or hidden
var submitForm = !editorsMode.Equals("view") && user.id.Equals("uid-1"); // check if the Submit form button is displayed or hidden
var mode = canEdit && editorsMode != "view" ? "edit" : "view"; // get the editor opening mode (edit or view)
var jss = new JavaScriptSerializer();

View File

@ -227,7 +227,7 @@ namespace ASC.Api.DocumentConverter
private static void ProcessResponseError(int errorCode)
{
var errorMessage = string.Empty;
const string errorMessageTemplate = "Error occurred in the ConvertService.ashx: {0}";
const string errorMessageTemplate = "Error occurred in the ConvertService: {0}";
switch (errorCode)
{

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<appSettings>
<clear />
<add key="version" value="1.10.0"/>
<add key="version" value="1.11.0"/>
<add key="filesize-max" value="52428800"/>
<add key="storage-path" value=""/>
@ -19,10 +19,10 @@
<add key="files.docservice.url.site" value="http://documentserver/"/>
<add key="files.docservice.url.converter" value="ConvertService.ashx"/>
<add key="files.docservice.url.converter" value="converter"/>
<add key="files.docservice.url.api" value="web-apps/apps/api/documents/api.js"/>
<add key="files.docservice.url.preloader" value="web-apps/apps/api/documents/cache-scripts.html"/>
<add key="files.docservice.url.command" value="coauthoring/CommandService.ashx"/>
<add key="files.docservice.url.command" value="command"/>
<add key="files.docservice.url.example" value=""/>

View File

@ -33,7 +33,6 @@ import com.onlyoffice.manager.security.JwtManager;
import com.onlyoffice.manager.settings.SettingsManager;
import com.onlyoffice.model.documenteditor.Config;
import com.onlyoffice.model.documenteditor.config.document.Type;
import com.onlyoffice.model.settings.SettingsConstants;
import lombok.SneakyThrows;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
@ -89,8 +88,6 @@ public class EditorController {
@RequestParam(value = "action", required = false) final String actionParam,
@RequestParam(value = "type", required = false) final String typeParam,
@RequestParam(value = "actionLink", required = false) final String actionLink,
@RequestParam(value = "directUrl", required = false,
defaultValue = "false") final Boolean directUrl,
@CookieValue(value = "uid") final String uid,
@CookieValue(value = "ulang") final String lang,
final Model model) throws JsonProcessingException {
@ -105,8 +102,6 @@ public class EditorController {
type = Type.valueOf(typeParam.toUpperCase());
}
settingsManager.setSetting(SettingsConstants.DIRECT_URL, String.valueOf(directUrl));
List<String> langsAndKeys = Arrays.asList(langs.split("\\|"));
for (String langAndKey : langsAndKeys) {
String[] couple = langAndKey.split(":");
@ -144,13 +139,13 @@ public class EditorController {
model.addAttribute("docserviceApiUrl", urlManager.getDocumentServerApiUrl());
// get an image and add it to the model
model.addAttribute("dataInsertImage", getInsertImage(directUrl));
model.addAttribute("dataInsertImage", getInsertImage());
// get a document for comparison and add it to the model
model.addAttribute("dataDocument", getCompareFile(directUrl));
model.addAttribute("dataDocument", getCompareFile());
// get recipients data for mail merging and add it to the model
model.addAttribute("dataSpreadsheet", getSpreadsheet(directUrl));
model.addAttribute("dataSpreadsheet", getSpreadsheet());
// get user data for mentions and add it to the model
model.addAttribute("usersForMentions", getUserMentions(uid));
@ -210,14 +205,10 @@ public class EditorController {
@SneakyThrows
private String getInsertImage(final Boolean directUrl) { // get an image that will be inserted into the document
private String getInsertImage() { // get an image that will be inserted into the document
Map<String, Object> dataInsertImage = new HashMap<>();
dataInsertImage.put("fileType", "svg");
dataInsertImage.put("url", storagePathBuilder.getServerUrl(true) + "/css/img/logo.svg");
if (directUrl) {
dataInsertImage.put("directUrl", storagePathBuilder
.getServerUrl(false) + "/css/img/logo.svg");
}
// check if the document token is enabled
if (settingsManager.isSecurityEnabled()) {
@ -232,14 +223,10 @@ public class EditorController {
// get a document that will be compared with the current document
@SneakyThrows
private String getCompareFile(final Boolean directUrl) {
private String getCompareFile() {
Map<String, Object> dataDocument = new HashMap<>();
dataDocument.put("fileType", "docx");
dataDocument.put("url", storagePathBuilder.getServerUrl(true) + "/assets?name=sample.docx");
if (directUrl) {
dataDocument.put("directUrl", storagePathBuilder
.getServerUrl(false) + "/assets?name=sample.docx");
}
// check if the document token is enabled
if (settingsManager.isSecurityEnabled()) {
@ -252,13 +239,10 @@ public class EditorController {
}
@SneakyThrows
private String getSpreadsheet(final Boolean directUrl) {
private String getSpreadsheet() {
Map<String, Object> dataSpreadsheet = new HashMap<>(); // get recipients data for mail merging
dataSpreadsheet.put("fileType", "csv");
dataSpreadsheet.put("url", storagePathBuilder.getServerUrl(true) + "/csv");
if (directUrl) {
dataSpreadsheet.put("directUrl", storagePathBuilder.getServerUrl(false) + "/csv");
}
// check if the document token is enabled
if (settingsManager.isSecurityEnabled()) {

View File

@ -436,8 +436,11 @@ public class FileController {
callbackService.processCallback(callback, fileName);
} catch (Exception e) {
e.printStackTrace();
return e.getMessage();
String message = e.getMessage();
if (!message.contains("\"error\":1")) {
e.printStackTrace();
}
return message;
}
return "{\"error\":\"0\"}";
@ -525,7 +528,6 @@ public class FileController {
if (!link.contains(storagePathBuilder.getServerUrl(true))) {
HashMap<String, String> data = new HashMap<>();
data.put("url", link);
data.put("directUrl", link);
return gson.toJson(data);
}
@ -571,7 +573,6 @@ public class FileController {
+ new File(storagePathBuilder.getFileLocation(fileName)).lastModified()
));
data.put("url", urlManager.getFileUrl(fileName));
data.put("directUrl", body.getDirectUrl() ? urlManager.getDirectFileUrl(fileName) : null);
data.put("referenceData", referenceData);
data.put("path", fileName);
data.put("link", storagePathBuilder.getServerUrl(true) + "/editor?fileName=" + fileName);
@ -596,9 +597,8 @@ public class FileController {
@GetMapping("/historydata")
@ResponseBody
public String history(@RequestParam("fileName") final String fileName,
@RequestParam("version") final String version,
@RequestParam(value = "directUrl", defaultValue = "false") final Boolean directUrl) {
return historyManager.getHistoryData(fileName, version, directUrl);
@RequestParam("version") final String version) {
return historyManager.getHistoryData(fileName, version);
}
@PutMapping("/restore")

View File

@ -33,7 +33,6 @@ import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.http.ResponseEntity;
@ -83,8 +82,7 @@ public class IndexController {
private String enableForgotten;
@GetMapping("${url.index}")
public String index(@RequestParam(value = "directUrl", required = false) final Boolean directUrl,
final Model model) {
public String index(final Model model) {
java.io.File[] files = storageMutator.getStoredFiles(); // get all the stored files from the storage
List<String> docTypes = new ArrayList<>();
List<Boolean> filesEditable = new ArrayList<>();
@ -128,7 +126,6 @@ public class IndexController {
model.addAttribute("tooltip", tooltip);
model.addAttribute("users", users);
model.addAttribute("languages", languages);
model.addAttribute("directUrl", directUrl);
model.addAttribute("serverVersion", serverVersion);
model.addAttribute("enableForgotten", Boolean.valueOf(enableForgotten));

View File

@ -135,6 +135,11 @@ public class DefaultCallbackManager implements CallbackManager {
String curExt = documentManager.getExtension(fileName); // get current file extension
String downloadExt = callback.getFiletype(); // get an extension of the downloaded file
String storagePath = storagePathBuilder.getFileLocation(newFileName); // get the path to a new file
if (!Paths.get(storagePath).toFile().exists()) {
throw new RuntimeException("{\"error\":1, \"message\":\"file does not exist\"}");
}
downloadUri = urlManager.replaceToInnerDocumentServerUrl(downloadUri);
changesUri = urlManager.replaceToInnerDocumentServerUrl(changesUri);
@ -170,7 +175,6 @@ public class DefaultCallbackManager implements CallbackManager {
byte[] byteArrayFile = getDownloadFile(downloadUri); // download document file
String storagePath = storagePathBuilder.getFileLocation(newFileName); // get the path to a new file
Path lastVersion = Paths.get(storagePathBuilder
.getFileLocation(fileName)); // get the path to the last file version

View File

@ -147,7 +147,7 @@ public class DefaultHistoryManager implements HistoryManager {
// todo: Refactoring
@SneakyThrows
public String getHistoryData(final String fileName, final String version, final Boolean directUrl) {
public String getHistoryData(final String fileName, final String version) {
// get history directory
String histDir = storagePathBuilder.getHistoryDir(storagePathBuilder.getFileLocation(fileName));
Integer curVer = storagePathBuilder.getFileVersion(histDir, false); // get current file version
@ -175,13 +175,6 @@ public class DefaultHistoryManager implements HistoryManager {
.getExtension(fileName), true))
.build();
if (directUrl) {
historyData.setDirectUrl(i == curVer
? urlManager.getDirectFileUrl(fileName)
: urlManager.getHistoryFileUrl(fileName, i, "prev" + documentManager
.getExtension(fileName), false)
);
}
historyData.setVersion(String.valueOf(i));
if (i > 1) { //check if the version number is greater than 1
@ -193,9 +186,6 @@ public class DefaultHistoryManager implements HistoryManager {
.key(historyDataPrev.getKey())
.url(historyDataPrev.getUrl())
.build();
if (directUrl) {
previous.setDirectUrl(historyDataPrev.getDirectUrl());
}
// write information about previous file version to the data object
historyData.setPrevious(previous);

View File

@ -21,6 +21,6 @@ package com.onlyoffice.integration.documentserver.managers.history;
// specify the history manager functions
public interface HistoryManager {
String getHistory(String fileName); // get document history
String getHistoryData(String fileName, String version, Boolean directUrl); // get document history data
String getHistoryData(String fileName, String version); // get document history data
String versionDir(String path, Integer version, boolean historyPath);
}

View File

@ -31,7 +31,6 @@ import lombok.Setter;
@NoArgsConstructor
@JsonIgnoreProperties(ignoreUnknown = true)
public class Reference {
private Boolean directUrl;
private ReferenceData referenceData;
private String path;
private String link;

View File

@ -55,11 +55,6 @@ public class UrlManagerImpl extends DefaultUrlManager implements UrlManager {
return getDownloadUrl(fileId, true);
}
@Override
public String getDirectFileUrl(final String fileId) {
return getDownloadUrl(fileId, false);
}
@Override
public String getCreateUrl(final String fileId) {
return getCreateUrl(fileId, false);

View File

@ -93,7 +93,7 @@ public class ConfigServiceImpl extends DefaultConfigService implements ConfigSer
Config config = super.createConfig(fileId, mode, type);
if ((currentAction.equals(Action.fillForms) || currentAction.equals(Action.embedded))
if (!currentAction.equals(Action.view)
&& appUser.getPermissions().getSubmitForm()) {
config.getEditorConfig().getCustomization().setSubmitForm(true);
}
@ -276,7 +276,7 @@ public class ConfigServiceImpl extends DefaultConfigService implements ConfigSer
@Override
public Embedded getEmbedded(final String fileId) {
String url = getUrlManager().getDirectFileUrl(fileId);
String url = getUrlManager().getFileUrl(fileId);
return Embedded.builder()
.embedUrl(url)

View File

@ -1,4 +1,4 @@
server.version=1.10.0
server.version=1.11.0
server.address=
server.port=4000

View File

@ -16,7 +16,6 @@
*
*/
var directUrl;
var formatManager;
window.onload = function () {
@ -42,19 +41,8 @@ window.onload = function () {
if (typeof jQuery !== "undefined") {
jq = jQuery.noConflict();
directUrl = getUrlVars()["directUrl"] == "true";
mustReload = false;
if (directUrl)
jq("#directUrl").prop("checked", directUrl);
else
directUrl = jq("#directUrl").prop("checked");
jq("#directUrl").change(function() {
window.location = "?directUrl=" + jq(this).prop("checked");
});
jq(function () {
jq("#fileupload").fileupload({
dataType: "json",
@ -272,7 +260,7 @@ if (typeof jQuery !== "undefined") {
jq(document).on("click", "#beginEdit:not(.disable)", function () {
var fileId = encodeURIComponent(jq("#hiddenFileName").val());
var url = UrlEditor + "?action=edit&fileName=" + fileId + "&directUrl=" + directUrl;
var url = UrlEditor + "?action=edit&fileName=" + fileId;
window.open(url, "_blank");
jq("#hiddenFileName").val("");
jq.unblockUI();
@ -280,7 +268,7 @@ if (typeof jQuery !== "undefined") {
jq(document).on("click", "#beginView:not(.disable)", function () {
var fileId = encodeURIComponent(jq("#hiddenFileName").val());
var url = UrlEditor + "?action=view&fileName=" + fileId + "&directUrl=" + directUrl;
var url = UrlEditor + "?action=view&fileName=" + fileId;
window.open(url, "_blank");
jq("#hiddenFileName").val("");
jq.unblockUI();
@ -288,7 +276,7 @@ if (typeof jQuery !== "undefined") {
jq(document).on("click", "#beginEmbedded:not(.disable)", function () {
var fileId = encodeURIComponent(jq("#hiddenFileName").val());
var url = UrlEditor + "?type=embedded&action=embedded&fileName=" + fileId + "&directUrl=" + directUrl;
var url = UrlEditor + "?type=embedded&action=embedded&fileName=" + fileId;
jq("#mainProgress").addClass("embedded");
jq("#beginEmbedded").addClass("disable");

View File

@ -194,8 +194,6 @@
var requestReference = function(data, callback) {
innerAlert(data);
data.directUrl = !!config.document.directUrl;
let xhr = new XMLHttpRequest();
xhr.open("POST", "reference");
xhr.setRequestHeader("Content-Type", "application/json");
@ -220,8 +218,7 @@
var onRequestHistoryData = function (event) {
var version = event.data;
var historyDataUri = "historydata?fileName=" + config.document.title
+ "&version=" + version
+ "&directUrl=" + !!config.document.directUrl;
+ "&version=" + version;
var xhr = new XMLHttpRequest();
xhr.open("GET", historyDataUri, false);
xhr.send();

View File

@ -109,14 +109,6 @@
</select>
</td>
</tr>
<tr>
<td valign="middle">
<label class="side-option">
<input id="directUrl" type="checkbox" class="checkbox" />Try opening on client
<img id="directUrlInfo" class="info info-tooltip" data-id="directUrlInfo" data-tooltip="Some files can be opened in the user's browser without connecting to the document server." src="css/img/info.svg" />
</label>
</td>
</tr>
</tbody>
</table>
</div>
@ -173,52 +165,51 @@
<tr th:each="file,iState : ${files}" class="tableRow" th:title="${files[iState.index].getName() + versions[iState.index]}">
<td class="contentCells">
<a class="stored-edit" th:classappend="${docTypes[iState.index]}"
th:with="directUrl=${directUrl}"
th:href="@{/editor(fileName=${files[iState.index].getName()}, __(${#strings.isEmpty(directUrl)} ? '' : ('directUrl=' + ${directUrl}))__)}" target="_blank">
th:href="@{/editor(fileName=${files[iState.index].getName()})}" target="_blank">
<span th:text="${files[iState.index].getName()}"></span>
</a>
</td>
<th:block th:if="${filesEditable[iState.index]}">
<td class="contentCells contentCells-icon">
<a th:with="directUrl=${directUrl}"
th:href="@{/editor(fileName=${files[iState.index].getName()},type='desktop',action='edit', __(${#strings.isEmpty(directUrl)} ? '' : ('directUrl=' + ${directUrl}))__)}" target="_blank">
<a
th:href="@{/editor(fileName=${files[iState.index].getName()},type='desktop',action='edit')}" target="_blank">
<img src="css/img/desktop.svg" alt="Open in editor for full size screens" title="Open in editor for full size screens"/>
</a>
</td>
<td class="contentCells contentCells-icon">
<a th:with="directUrl=${directUrl}"
th:href="@{/editor(fileName=${files[iState.index].getName()},type='mobile',action='edit', __(${#strings.isEmpty(directUrl)} ? '' : ('directUrl=' + ${directUrl}))__)}" target="_blank">
<a
th:href="@{/editor(fileName=${files[iState.index].getName()},type='mobile',action='edit')}" target="_blank">
<img src="css/img/mobile.svg" alt="Open in editor for mobile devices" title="Open in editor for mobile devices"/>
</a>
</td>
<div th:if="not ${docTypes[iState.index]} eq 'pdf'">
<td class="contentCells contentCells-icon">
<a th:with="directUrl=${directUrl}"
th:href="@{/editor(fileName=${files[iState.index].getName()},type='desktop',action='comment', __(${#strings.isEmpty(directUrl)} ? '' : ('directUrl=' + ${directUrl}))__)}" target="_blank">
<a
th:href="@{/editor(fileName=${files[iState.index].getName()},type='desktop',action='comment')}" target="_blank">
<img src="css/img/comment.svg" alt="Open in editor for comment" title="Open in editor for comment"/>
</a>
</td>
</div>
<div th:if="${docTypes[iState.index]} eq 'word'">
<td class="contentCells contentCells-icon">
<a th:with="directUrl=${directUrl}"
th:href="@{/editor(fileName=${files[iState.index].getName()},type='desktop',action='review', __(${#strings.isEmpty(directUrl)} ? '' : ('directUrl=' + ${directUrl}))__)}" target="_blank">
<a
th:href="@{/editor(fileName=${files[iState.index].getName()},type='desktop',action='review')}" target="_blank">
<img src="css/img/review.svg" alt="Open in editor for review" title="Open in editor for review"/>
</a>
</td>
</div>
<div th:if="${docTypes[iState.index]} eq 'cell'">
<td class="contentCells contentCells-icon">
<a th:with="directUrl=${directUrl}"
th:href="@{/editor(fileName=${files[iState.index].getName()},type='desktop',action='filter', __(${#strings.isEmpty(directUrl)} ? '' : ('directUrl=' + ${directUrl}))__)}" target="_blank">
<a
th:href="@{/editor(fileName=${files[iState.index].getName()},type='desktop',action='filter')}" target="_blank">
<img src="css/img/filter.svg" alt="Open in editor without access to change the filter" title="Open in editor without access to change the filter" />
</a>
</td>
</div>
<div th:if="${docTypes[iState.index]} eq 'word'">
<td class="contentCells contentCells-icon">
<a th:with="directUrl=${directUrl}"
th:href="@{/editor(fileName=${files[iState.index].getName()},type='desktop',action='blockcontent', __(${#strings.isEmpty(directUrl)} ? '' : ('directUrl=' + ${directUrl}))__)}" target="_blank">
<a
th:href="@{/editor(fileName=${files[iState.index].getName()},type='desktop',action='blockcontent')}" target="_blank">
<img src="css/img/block-content.svg" alt="Open in editor without content control modification" title="Open in editor without content control modification"/>
</a>
</td>
@ -231,8 +222,8 @@
</div>
<div th:if="${isFillFormDoc[iState.index]}">
<td class="contentCells contentCells-shift contentCells-icon firstContentCellShift">
<a th:with="directUrl=${directUrl}"
th:href="@{/editor(fileName=${files[iState.index].getName()},type='desktop',action='fillForms', __(${#strings.isEmpty(directUrl)} ? '' : ('directUrl=' + ${directUrl}))__)}" target="_blank">
<a
th:href="@{/editor(fileName=${files[iState.index].getName()},type='desktop',action='fillForms')}" target="_blank">
<img src="css/img/fill-forms.svg" alt="Open in editor for filling in forms" title="Open in editor for filling in forms"/>
</a>
</td>
@ -244,8 +235,8 @@
<th:block th:if="${isFillFormDoc[iState.index] and not filesEditable[iState.index]}">
<td class="contentCells contentCells-icon "></td>
<td class="contentCells contentCells-icon">
<a th:with="directUrl=${directUrl}"
th:href="@{/editor(fileName=${files[iState.index].getName()},type='mobile',action='fillForms', __(${#strings.isEmpty(directUrl)} ? '' : ('directUrl=' + ${directUrl}))__)}" target="_blank">
<a
th:href="@{/editor(fileName=${files[iState.index].getName()},type='mobile',action='fillForms')}" target="_blank">
<img src="css/img/mobile-fill-forms.svg" alt="Open in editor for filling in forms for mobile devices" title="Open in editor for filling in forms for mobile devices" />
</a>
</td>
@ -253,8 +244,8 @@
<td class="contentCells contentCells-icon "></td>
<td class="contentCells contentCells-icon "></td>
<td class="contentCells contentCells-shift contentCells-icon firstContentCellShift">
<a th:with="directUrl=${directUrl}"
th:href="@{/editor(fileName=${files[iState.index].getName()},type='desktop',action='fillForms', __(${#strings.isEmpty(directUrl)} ? '' : ('directUrl=' + ${directUrl}))__)}" target="_blank">
<a
th:href="@{/editor(fileName=${files[iState.index].getName()},type='desktop',action='fillForms')}" target="_blank">
<img src="css/img/fill-forms.svg" alt="Open in editor for filling in forms" title="Open in editor for filling in forms"/>
</a>
</td>
@ -263,20 +254,20 @@
<td class="contentCells contentCells-shift contentCells-icon contentCellsEmpty" colspan="6"></td>
</th:block>
<td class="contentCells contentCells-icon firstContentCellViewers">
<a th:with="directUrl=${directUrl}"
th:href="@{/editor(fileName=${files[iState.index].getName()},type='desktop',action='view', __(${#strings.isEmpty(directUrl)} ? '' : ('directUrl=' + ${directUrl}))__)}" target="_blank">
<a
th:href="@{/editor(fileName=${files[iState.index].getName()},type='desktop',action='view')}" target="_blank">
<img src="css/img/desktop.svg" alt="Open in viewer for full size screens" title="Open in viewer for full size screens"/>
</a>
</td>
<td class="contentCells contentCells-icon">
<a th:with="directUrl=${directUrl}"
th:href="@{/editor(fileName=${files[iState.index].getName()},type='mobile',action='view', __(${#strings.isEmpty(directUrl)} ? '' : ('directUrl=' + ${directUrl}))__)}" target="_blank">
<a
th:href="@{/editor(fileName=${files[iState.index].getName()},type='mobile',action='view')}" target="_blank">
<img src="css/img/mobile.svg" alt="Open in viewer for mobile devices" title="Open in viewer for mobile devices"/>
</a>
</td>
<td class="contentCells contentCells-icon contentCells-shift">
<a th:with="directUrl=${directUrl}"
th:href="@{/editor(fileName=${files[iState.index].getName()},type='embedded',action='embedded', __(${#strings.isEmpty(directUrl)} ? '' : ('directUrl=' + ${directUrl}))__)}" target="_blank">
<a
th:href="@{/editor(fileName=${files[iState.index].getName()},type='embedded',action='embedded')}" target="_blank">
<img src="css/img/embeded.svg" alt="Open in embedded mode" title="Open in embedded mode"/>
</a>
</td>

View File

@ -164,7 +164,7 @@ public class FileModel {
}
// check if the Submit form button is displayed or not
if (mode.equals("fillForms") || mode.equals("embedded")) {
if (!mode.equals("view")) {
editorConfig.getCustomization().setSubmitForm(user.getId().equals("uid-1"));
}

View File

@ -1,4 +1,4 @@
version=1.10.0
version=1.11.0
filesize-max=5242880
storage-folder=app_data
@ -8,8 +8,8 @@ enable-forgotten=TRUE
files.docservice.timeout=120000
files.docservice.url.site=http://documentserver/
files.docservice.url.converter=ConvertService.ashx
files.docservice.url.command=coauthoring/CommandService.ashx
files.docservice.url.converter=converter
files.docservice.url.command=command
files.docservice.url.api=web-apps/apps/api/documents/api.js
files.docservice.url.preloader=web-apps/apps/api/documents/cache-scripts.html
files.docservice.url.example=

View File

@ -274,7 +274,8 @@ app.post('/upload', (req, res) => { // define a handler for uploading files
req.DocManager.createDirectory(uploadDirTmp);
const fileSizeLimit = configServer.get('maxFileSize');
const form = new formidable.IncomingForm({maxFileSize: fileSizeLimit, maxTotalFileSize: fileSizeLimit }); // create a new incoming form
// create a new incoming form
const form = new formidable.IncomingForm({ maxFileSize: fileSizeLimit, maxTotalFileSize: fileSizeLimit });
form.uploadDir = uploadDirTmp; // and write there all the necessary parameters
form.keepExtensions = true;
@ -459,7 +460,7 @@ app.post('/convert', (req, res) => { // define a handler for converting files
if (fileUtility.getFileType(correctName) !== null) {
fileSystem.writeFileSync(req.DocManager.storagePath(correctName), data);
} else {
writeResult(newFileUri, result, 'FileTypeIsNotSupported');
writeResult(newFileUri.replace('http://localhost/', siteUrl), result, 'FileTypeIsNotSupported');
return;
}
// remove file with the origin extension
@ -1115,7 +1116,7 @@ app.get('/editor', (req, res) => { // define a handler for editing document
}
let submitForm = false;
if (mode === 'fillForms' || mode === 'embedded') {
if (mode !== 'view') {
submitForm = userid === 'uid-1';
}

View File

@ -1,5 +1,5 @@
{
"version": "1.10.0",
"version": "1.11.0",
"log": {
"appenders": [
{
@ -17,8 +17,8 @@
"wopi": {
"discovery": "hosting/discovery"
},
"commandUrl": "coauthoring/CommandService.ashx",
"converterUrl": "ConvertService.ashx",
"commandUrl": "command",
"converterUrl": "converter",
"apiUrl": "web-apps/apps/api/documents/api.js",
"preloaderUrl": "web-apps/apps/api/documents/cache-scripts.html",
"exampleUrl": null,

View File

@ -196,14 +196,10 @@
<a class="action-link" href="editor?type=desktop&mode=edit&fileName=<%= encodeURIComponent(storedFiles[i].name) %>" target="_blank">
<img src="images/desktop.svg" alt="Open in editor for full size screens" title="Open in editor for full size screens" /></a>
</td>
<% if (storedFiles[i].documentType !== "pdf") { %>
<td class="contentCells contentCells-icon">
<a class="action-link" href="editor?type=desktop&mode=comment&fileName=<%= encodeURIComponent(storedFiles[i].name) %>" target="_blank">
<img src="images/comment.svg" alt="Open in editor for comment" title="Open in editor for comment" /></a>
</td>
<% } else { %>
<td class="contentCells contentCells-icon"></td>
<% } %>
<% if (storedFiles[i].documentType == "word") { %>
<td class="contentCells contentCells-icon">
<a class="action-link" href="editor?type=desktop&mode=review&fileName=<%= encodeURIComponent(storedFiles[i].name) %>" target="_blank">

View File

@ -3,7 +3,7 @@ version: "3.8"
services:
documentserver:
container_name: documentserver
image: onlyoffice/documentserver:8.0
image: onlyoffice/documentserver:8.2
expose:
- "80"
environment:

View File

@ -22,7 +22,7 @@ use Example\Common\URL;
class ConfigurationManager
{
public string $version = '1.10.0';
public string $version = '1.11.0';
public function getVersion(): string
{
@ -73,7 +73,7 @@ class ConfigurationManager
{
$serverURL = $this->documentServerPrivateURL();
$path = getenv('DOCUMENT_SERVER_COMMAND_PATH')
?: 'coauthoring/CommandService.ashx';
?: 'command';
return $serverURL->joinPath($path);
}
@ -81,7 +81,7 @@ class ConfigurationManager
{
$serverURL = $this->documentServerPrivateURL();
$path = getenv('DOCUMENT_SERVER_CONVERTER_PATH')
?: 'ConvertService.ashx';
?: 'converter';
return $serverURL->joinPath($path);
}

View File

@ -42,7 +42,7 @@ final class ConfigurationManagerDocumentServerCommandURLTests extends TestCase
$configManager = new ConfigurationManager();
$url = $configManager->documentServerCommandURL();
$this->assertEquals(
'http://documentserver/coauthoring/CommandService.ashx',
'http://documentserver/command',
$url->string()
);
}

View File

@ -42,7 +42,7 @@ final class ConfigurationManagerDocumentServerConverterURLTests extends TestCase
$configManager = new ConfigurationManager();
$url = $configManager->documentServerConverterURL();
$this->assertEquals(
'http://documentserver/ConvertService.ashx',
'http://documentserver/converter',
$url->string()
);
}

View File

@ -83,7 +83,7 @@ final class DocEditorView extends View
}
// check if the Submit form button is displayed or not
$submitForm = in_array($editorsMode, ["fillForms", "embedded"]) && $user->id == "uid-1";
$submitForm = $editorsMode != "view" && $user->id == "uid-1";
$mode = $canEdit && $editorsMode != "view" ? "edit" : "view"; // define if the editing mode is edit or view
$type = empty($request["type"]) ? "desktop" : $request["type"];

View File

@ -3,7 +3,7 @@ version: "3.8"
services:
documentserver:
container_name: documentserver
image: onlyoffice/documentserver:8.0
image: onlyoffice/documentserver:8.2
expose:
- "80"
environment:

View File

@ -22,7 +22,7 @@ from src.common import string
class ConfigurationManager:
version = '1.10.0'
version = '1.11.0'
def getVersion(self) -> str:
return self.version
@ -71,7 +71,7 @@ class ConfigurationManager:
base_url = server_url.geturl()
path = (
environ.get('DOCUMENT_SERVER_COMMAND_PATH') or
'/coauthoring/CommandService.ashx'
'/command'
)
url = urljoin(base_url, path)
return urlparse(url)
@ -81,7 +81,7 @@ class ConfigurationManager:
base_url = server_url.geturl()
path = (
environ.get('DOCUMENT_SERVER_CONVERTER_PATH') or
'/ConvertService.ashx'
'/converter'
)
url = urljoin(base_url, path)
return urlparse(url)

View File

@ -145,7 +145,7 @@ class ConfigurationManagerDocumentServerCommandURLTests(TestCase):
url = config_manager.document_server_command_url()
self.assertEqual(
url.geturl(),
'http://localhost/coauthoring/CommandService.ashx'
'http://localhost/command'
)
@patch.object(
@ -176,7 +176,7 @@ class ConfigurationManagerDocumentServerConverterURLTests(TestCase):
url = config_manager.document_server_converter_url()
self.assertEqual(
url.geturl(),
'http://localhost/ConvertService.ashx'
'http://localhost/converter'
)
@patch.object(

View File

@ -207,7 +207,7 @@ def edit(request):
edMode = 'fillForms'
canEdit = True
# if the Submit form button is displayed or hidden
submitForm = edMode in ['fillForms', 'embedded'] and user.id == 'uid-1'
submitForm = edMode != 'view' and user.id == 'uid-1'
mode = 'edit' if canEdit & (edMode != 'view') else 'view' # if the file can't be edited, the mode is view
types = ['desktop', 'mobile', 'embedded']

View File

@ -51,7 +51,7 @@ def getForgottenFiles():
private_url = config_manager.document_server_private_url().geturl()
public_url = config_manager.document_server_public_url().geturl()
if private_url in file["url"]:
file["url"] = file["url"].replace(private_url, public_url)
file["url"] = file["url"].replace(private_url, public_url)
files.append(file)
except (Exception, ValueError) as error:
logging.error(error)

View File

@ -31,7 +31,7 @@ class ConfigurationManager
sig { void }
def initialize
@version = '1.10.0'
@version = '1.11.0'
end
sig { returns(T.nilable(URI::Generic)) }
@ -76,7 +76,7 @@ class ConfigurationManager
def document_server_command_uri
path =
ENV['DOCUMENT_SERVER_COMMAND_PATH'] ||
'/coauthoring/CommandService.ashx'
'/command'
URI.join(document_server_private_uri, path)
end
@ -84,7 +84,7 @@ class ConfigurationManager
def document_server_converter_uri
path =
ENV['DOCUMENT_SERVER_CONVERTER_PATH'] ||
'/ConvertService.ashx'
'/converter'
URI.join(document_server_private_uri, path)
end

View File

@ -151,7 +151,7 @@ class ConfigurationManagerDocumentServerCommandURITests < Test::Unit::TestCase
uri = config_manager.document_server_command_uri
assert_equal(
uri.to_s,
'http://documentserver/coauthoring/CommandService.ashx'
'http://documentserver/command'
)
end
@ -175,7 +175,7 @@ class ConfigurationManagerDocumentServerConverterURITests < Test::Unit::TestCase
uri = config_manager.document_server_converter_uri
assert_equal(
uri.to_s,
'http://documentserver/ConvertService.ashx'
'http://documentserver/converter'
)
end

View File

@ -106,7 +106,7 @@ class FileModel
editors_mode = 'fillForms'
can_edit = true
end
submit_form = ['fillForms', 'embedded'].include?(editors_mode) && @user.id.eql?('uid-1') # Submit form button state
submit_form = !editors_mode.eql?('view') && @user.id.eql?('uid-1') # Submit form button state
mode = can_edit && !editors_mode.eql?('view') ? 'edit' : 'view'
# templates image url in the "From Template" section
templates_image_url = DocumentHelper.get_template_image_url(document_type)

View File

@ -109,23 +109,23 @@ class ServiceConverter
# add an error message to the error message template depending on the error code
case error_code
when -9
error_message = 'Error occurred in the ConvertService.ashx: Error conversion output format'
error_message = 'Error occurred in the ConvertService: Error conversion output format'
when -8
error_message = 'Error occurred in the ConvertService.ashx: Error document VKey'
error_message = 'Error occurred in the ConvertService: Error document VKey'
when -7
error_message = 'Error occurred in the ConvertService.ashx: Error document request'
error_message = 'Error occurred in the ConvertService: Error document request'
when -6
error_message = 'Error occurred in the ConvertService.ashx: Error database'
error_message = 'Error occurred in the ConvertService: Error database'
when -5
error_message = 'Error occurred in the ConvertService.ashx: Incorrect password'
error_message = 'Error occurred in the ConvertService: Incorrect password'
when -4
error_message = 'Error occurred in the ConvertService.ashx: Error download error'
error_message = 'Error occurred in the ConvertService: Error download error'
when -3
error_message = 'Error occurred in the ConvertService.ashx: Error convertation error'
error_message = 'Error occurred in the ConvertService: Error convertation error'
when -2
error_message = 'Error occurred in the ConvertService.ashx: Error convertation timeout'
error_message = 'Error occurred in the ConvertService: Error convertation timeout'
when -1
error_message = 'Error occurred in the ConvertService.ashx: Error convertation unknown'
error_message = 'Error occurred in the ConvertService: Error convertation unknown'
when 0
# public const int c_nErrorNo = 0
else

View File

@ -3,7 +3,7 @@ version: "3.8"
services:
documentserver:
container_name: documentserver
image: onlyoffice/documentserver:8.0
image: onlyoffice/documentserver:8.2
expose:
- "80"
environment: