<@section label=msg("onlyoffice-config.doc-section") />
@@ -21,13 +21,13 @@
-
+
-
+
@@ -35,84 +35,78 @@
-
+
-
+
@tsection>
<@section label=msg("onlyoffice-config.common-section") />
-
+ checked#if> />
-
+ checked#if> />
-
+ checked#if> />
<@section label=msg("onlyoffice-config.customization-section")/>
-
+ checked#if> />
-
+ checked#if> />
-
+ checked#if> />
-
+ checked#if> />
-
+ checked#if> />
-
+ checked#if> />
@@ -125,7 +119,7 @@
- disabled="disabled" #if>/>
+ checked#if> <#if !demoAvailable> disabled="disabled" #if>/>
<#if demoAvailable>
@@ -151,12 +145,6 @@
var convertOriginal = document.getElementById("convertOriginal");
var jwts = document.getElementById("jwtsecret");
var demo = document.getElementById("onlyofficeDemo");
- var odt = document.getElementById("odt");
- var ods = document.getElementById("ods");
- var odp = document.getElementById("odp");
- var csv = document.getElementById("csv");
- var txt = document.getElementById("txt");
- var rtf = document.getElementById("rtf");
var form = document.getElementById("docservcfg");
var btn = document.getElementById("postonlycfg");
@@ -167,6 +155,7 @@
var compactHeader = document.getElementById("compactHeader");
var toolbarNoTabs = document.getElementById("toolbarNoTabs");
var feedback = document.getElementById("feedback");
+ var lossyEdit = document.querySelectorAll(".lossy-edit");
var reviewDisplay = document.getElementsByName("reviewDisplay");
var doPost = function(obj) {
@@ -184,95 +173,120 @@
var callback = function(xhr) {
btn.disabled = false;
- if (xhr.status != 200) {
- showMessage(msg.dataset.error + " " + msg.dataset.statuscode + " " + xhr.status, true);
+ if (xhr.status != 200 || !xhr.response) {
+ showMessage(msg.dataset["settingsSavingError"], true);
return;
}
- var response = JSON.parse(xhr.response);
-
- if (!response.success) {
- showMessage(msg.dataset.error + " " + msg.dataset[response.message], true);
- return;
+ if (xhr.response) {
+ const responseJson = JSON.parse(xhr.response);
+ const validationResults = responseJson.validationResults;
+
+ if (validationResults.documentServer) {
+ if (validationResults.documentServer.status == "failed") {
+ showMessage(validationResults.documentServer.message, true);
+ }
+ }
+
+ if (validationResults.commandService) {
+ if (validationResults.commandService.status == "failed") {
+ showMessage(
+ msg.dataset["onlyofficeCommandServicePrefix"].replace(
+ "$",
+ validationResults.commandService.message
+ ),
+ true
+ );
+ }
+ }
+
+ if (validationResults.convertService) {
+ if (validationResults.convertService.status == "failed") {
+ showMessage(
+ msg.dataset["onlyofficeConvertServicePrefix"].replace(
+ "$",
+ validationResults.convertService.message
+ ),
+ true
+ );
+ }
+ }
+
+ showMessage(msg.dataset["settingsSaved"]);
}
-
- showMessage(msg.dataset.saved);
};
var parseForm = function() {
var obj = {};
- var reg = RegExp(url.pattern);
- if (!reg.test(url.value)) { return null; }
+ obj.lossyEdit = [];
+
+ lossyEdit.forEach((element) => {
+ if (element.checked) obj.lossyEdit.push(element.id);
+ });
obj.url = url.value.trim();
- obj.innerurl = innerurl.value.trim();
- obj.alfurl = alfurl.value.trim();
- obj.cert = cert.checked.toString();
- obj.forcesave = fs.checked.toString();
- obj.webpreview = webpreview.checked.toString();
- obj.convertOriginal = convertOriginal.checked.toString();
- obj.jwtsecret = jwts.value.trim();
+ obj.innerUrl = innerurl.value.trim();
+ obj.productInnerUrl = alfurl.value.trim();
+ obj.security = {
+ key: jwts.value.trim(),
+ ignoreSSLCertificate: cert.checked.toString(),
+ };
obj.demo = demo.checked.toString();
- obj.formats = {
- odt: odt.checked.toString(),
- ods: ods.checked.toString(),
- odp: odp.checked.toString(),
- csv: csv.checked.toString(),
- txt: txt.checked.toString(),
- rtf: rtf.checked.toString()
+ obj.customization = {
+ forcesave: fs.checked.toString(),
+ feedback: feedback.checked.toString(),
+ chat: chat.checked.toString(),
+ help: help.checked.toString(),
+ compactHeader: compactHeader.checked.toString(),
+ toolbarNoTabs: toolbarNoTabs.checked.toString(),
+ review: {
+ reviewDisplay: document.querySelector("input[name='reviewDisplay']:checked").id.replace("reviewDisplay", "").toLowerCase()
+ }
};
- obj.chat = chat.checked.toString();
- obj.help = help.checked.toString();
- obj.compactHeader = compactHeader.checked.toString();
- obj.toolbarNoTabs = toolbarNoTabs.checked.toString();
- obj.feedback = feedback.checked.toString();
-
- reviewDisplay.forEach((element) => {
- if (element.checked) obj.reviewDisplay = element.value.trim();
- });
- return obj;
- };
+ obj.convertOriginal = convertOriginal.checked.toString();
+ obj.webpreview = webpreview.checked.toString();
- var hideMessage = function() {
- msg.classList.add("hidden");
- msg.parentNode.classList.add("hidden");
- msg.classList.remove("error");
- msg.innerText = "";
+ return obj;
};
- var msgTimeout = null;
var showMessage = function(message, error) {
- if (error) {
- msg.classList.add("error");
- }
+ let messageBlock = document.getElementById("messageBlock");
+ let messageElement = document.createElement("span");
+ messageElement.classList.add('message');
+ messageElement.style.width = "fit-content";
+ messageElement.style.margin = "5px 0";
+ messageElement.style.display = "block";
+ messageElement.innerText = message;
- msg.innerText = message;
- msg.classList.remove("hidden");
- msg.parentNode.classList.remove("hidden");
+ if (error) {
+ messageElement.classList.add("error");
+ }
- if (msgTimeout != null) {
- clearTimeout(msgTimeout);
- }
- msgTimeout = setTimeout(hideMessage, 3000);
+ messageBlock.appendChild(messageElement);
+
+ messageBlock.classList.remove("hidden");
+ };
+
+ var hideMessages = function() {
+ document.getElementById("messageBlock").innerHTML = '';
};
var testDocServiceApi = function (obj) {
var testApiResult = function () {
var result = typeof DocsAPI != "undefined";
- if (result) {
- doPost(obj);
- } else {
- btn.disabled = false;
- showMessage(msg.dataset.error + " " + msg.dataset.docservunreachable, true);
+ if (!result) {
+ showMessage(msg.dataset["apijsUnreachable"], true);
}
+
+ doPost(obj);
};
if (window.location.href.startsWith("https://") && obj.url.toLowerCase().startsWith("http://")) {
btn.disabled = false;
- showMessage(msg.dataset.error + " " + msg.dataset["mixedcontent"], true);
+ showMessage(msg.dataset["mixedcontent"], true);
return;
}
@@ -302,13 +316,13 @@
};
btn.onclick = function() {
- hideMessage();
if (btn.disabled) return;
+ btn.disabled = true;
+ hideMessages();
+
var obj = parseForm();
- if (!obj) return;
- btn.disabled = true;
if (demo.checked && !demo.disabled) {
doPost(obj);
} else {
diff --git a/repo/src/main/resources/alfresco/templates/webscripts/onlyoffice/onlyoffice-config.get.properties b/repo/src/main/resources/alfresco/templates/webscripts/onlyoffice/onlyoffice-config.get.properties
index f25c38ed..6841d242 100644
--- a/repo/src/main/resources/alfresco/templates/webscripts/onlyoffice/onlyoffice-config.get.properties
+++ b/repo/src/main/resources/alfresco/templates/webscripts/onlyoffice/onlyoffice-config.get.properties
@@ -8,18 +8,9 @@ onlyoffice-config.doc-url=Document Editing Service address
onlyoffice-config.doc-url-inner=Document Editing Service address for internal requests from the server
onlyoffice-config.doc-url-inner-tooltip=Address that will be used to access Document Editing Service from Alfresco
onlyoffice-config.doc-url-tooltip=Document Editing Service address e.g. http\://localhost/
-onlyoffice-config.docservcommand=Error when trying to check CommandService
-onlyoffice-config.docservconvert=Error when trying to check ConvertService
-onlyoffice-config.docservunreachable=ONLYOFFICE cannot be reached
-onlyoffice-config.error=Error\:
onlyoffice-config.ignore-ssl-cert=Ignore SSL Certificate
-onlyoffice-config.jsonparse=Server can't read JSON
onlyoffice-config.jwt-secret=Secret key (leave blank to disable)
-onlyoffice-config.jwterror=Authorization error
-onlyoffice-config.mixedcontent=Mixed Active Content is not allowed. HTTPS address for Document Server is required.
onlyoffice-config.save-btn=Save
-onlyoffice-config.saved=Success
-onlyoffice-config.statuscode=Status code
onlyoffice-config.title=ONLYOFFICE Configuration
onlyoffice-config.forcesave=Enable Force Save
onlyoffice-config.webpreview=Enable ONLYOFFICE Web Preview
@@ -39,4 +30,13 @@ onlyoffice-config.review-mode-label=Review mode for viewing
onlyoffice-config.review-mode-markup=Markup
onlyoffice-config.review-mode-final=Final
onlyoffice-config.review-mode-original=Original
-onlyoffice-config.customization-section=Editor customization settings
\ No newline at end of file
+onlyoffice-config.customization-section=Editor customization settings
+
+onlyoffice-config.message.settings.saved=Settings saved
+onlyoffice-config.message.settings.saving-error=Error saving settings
+
+onlyoffice.server.common.error.api-js=The API JavaScript file cannot be reached.
+onlyoffice.server.common.error.mixed-content=Mixed Active Content is not allowed. HTTPS address for ONLYOFFICE Document Server is required.
+
+onlyoffice.service.convert.check.error-prefix=Error when trying to check ConvertService ($).
+onlyoffice.service.command.check.error-prefix=Error when trying to check CommandService ($).
diff --git a/repo/src/main/resources/alfresco/templates/webscripts/onlyoffice/onlyoffice-config.get_de.properties b/repo/src/main/resources/alfresco/templates/webscripts/onlyoffice/onlyoffice-config.get_de.properties
index 4011a9dd..6eb536db 100644
--- a/repo/src/main/resources/alfresco/templates/webscripts/onlyoffice/onlyoffice-config.get_de.properties
+++ b/repo/src/main/resources/alfresco/templates/webscripts/onlyoffice/onlyoffice-config.get_de.properties
@@ -8,18 +8,9 @@ onlyoffice-config.doc-url=Serviceadresse der Dokumentbearbeitung
onlyoffice-config.doc-url-inner=Serviceadresse der Dokumentbearbeitung f\u00FCr interne Anforderungen vom Server
onlyoffice-config.doc-url-inner-tooltip=Adresse, \u00FCber die Alfresco auf den Dokumentbearbeitungsdienst zugreifen kann
onlyoffice-config.doc-url-tooltip=Die Adresse des Dokumentenbearbeitungsservices, z.B., http\://localhost/
-onlyoffice-config.docservcommand=Fehler beim Versuch, CommandService zu \u00FCberpr\u00FCfen
-onlyoffice-config.docservconvert=Fehler beim Versuch,\u00A0ConvertService\u00A0zu \u00FCberpr\u00FCfen
-onlyoffice-config.docservunreachable=ONLYOFFICE ist zurzeit nicht erreichbar
-onlyoffice-config.error=Fehler\:
onlyoffice-config.ignore-ssl-cert=SSL-Zertifikat ignorieren
-onlyoffice-config.jsonparse=Server kann JSON nicht lesen
onlyoffice-config.jwt-secret=Geheimer Schl\u00FCssel (freilassen, um zu deaktivieren)
-onlyoffice-config.jwterror=Autorisierungsfehler
-onlyoffice-config.mixedcontent=Mixed Active Content ist nicht m\u00F6glich. HTTPS-Adresse f\u00FCr Document Server ist erforderlich.
onlyoffice-config.save-btn=Speichern
-onlyoffice-config.saved=Erfolgreich
-onlyoffice-config.statuscode=Statuscode
onlyoffice-config.title=Konfiguration des ONLYOFFICE
onlyoffice-config.file-type=\u00d6ffne die Datei zum Bearbeiten (aufgrund von Formateinschr\u00e4nkungen k\u00f6nnen die Daten beim Speichern in den Formaten aus der folgenden Liste verloren gehen)
onlyoffice-config.common-section=Allgemeine Einstellungen
@@ -39,4 +30,13 @@ onlyoffice-config.review-mode-label=Review-Modus zum Anzeigen
onlyoffice-config.review-mode-markup=Markup
onlyoffice-config.review-mode-final=Endg\u00fcltig
onlyoffice-config.review-mode-original=Original
-onlyoffice-config.customization-section=Editor-Einstellungen
\ No newline at end of file
+onlyoffice-config.customization-section=Editor-Einstellungen
+
+onlyoffice-config.message.settings.saved=
+onlyoffice-config.message.settings.saving-error=
+
+onlyoffice.server.common.error.api-js=
+onlyoffice.server.common.error.mixed-content=Mixed Active Content ist nicht m\u00F6glich. HTTPS-Adresse f\u00FCr Document Server ist erforderlich.
+
+onlyoffice.service.convert.check.error-prefix=Fehler beim Versuch, ConvertService zu überprüfen ($).
+onlyoffice.service.command.check.error-prefix=Fehler beim Versuch, CommandService zu überprüfen ($).
diff --git a/repo/src/main/resources/alfresco/templates/webscripts/onlyoffice/onlyoffice-config.get_es.properties b/repo/src/main/resources/alfresco/templates/webscripts/onlyoffice/onlyoffice-config.get_es.properties
index 26292806..5ae8fcf6 100644
--- a/repo/src/main/resources/alfresco/templates/webscripts/onlyoffice/onlyoffice-config.get_es.properties
+++ b/repo/src/main/resources/alfresco/templates/webscripts/onlyoffice/onlyoffice-config.get_es.properties
@@ -8,18 +8,9 @@ onlyoffice-config.doc-url=Direcci\u00F3n del Servicio de Edici\u00F3n de Documen
onlyoffice-config.doc-url-inner=Direcci\u00F3n del Servicio de Edici\u00F3n de Documentos para solicitudes internas del servidor
onlyoffice-config.doc-url-inner-tooltip=Direcci\u00F3n que se utilizar\u00E1 para acceder al servicio de edici\u00F3n de documentos de Alfresco
onlyoffice-config.doc-url-tooltip=Direcci\u00F3n de servicio de edici\u00F3n de documentos, ej. http\://localhost/
-onlyoffice-config.docservcommand=Error al intentar\u00A0verificar CommandService
-onlyoffice-config.docservconvert=Error al intentar\u00A0verificar ConvertService
-onlyoffice-config.docservunreachable=No se puede acceder al ONLYOFFICE.
-onlyoffice-config.error=Error\:
onlyoffice-config.ignore-ssl-cert=Omitir certificado SSL
-onlyoffice-config.jsonparse=Servidor no puede leer\u00A0JSON
onlyoffice-config.jwt-secret=Clave secreta (deje en blanco o desactive)
-onlyoffice-config.jwterror=Error de autorizacion
-onlyoffice-config.mixedcontent=Contenido Mixto Activo no est\u00E1 permitido. Se requiere la direcci\u00F3n HTTPS para Servidor de Documentos.
onlyoffice-config.save-btn=Guardar
-onlyoffice-config.saved=\u00C9xito
-onlyoffice-config.statuscode=C\u00F3digo de estado
onlyoffice-config.title=Ajustes de ONLYOFFICE
onlyoffice-config.forcesave=Habilitar Forzar guardar
onlyoffice-config.webpreview=Habilitar la Vista previa web de ONLYOFFICE
@@ -39,4 +30,13 @@ onlyoffice-config.review-mode-label=Modo de revisi\u00f3n para para visualizaci\
onlyoffice-config.review-mode-markup=Cambios
onlyoffice-config.review-mode-final=Final
onlyoffice-config.review-mode-original=Original
-onlyoffice-config.customization-section=Ajustes del editor
\ No newline at end of file
+onlyoffice-config.customization-section=Ajustes del editor
+
+onlyoffice-config.message.settings.saved=
+onlyoffice-config.message.settings.saving-error=
+
+onlyoffice.server.common.error.api-js=
+onlyoffice.server.common.error.mixed-content=Contenido Mixto Activo no est\u00E1 permitido. Se requiere la direcci\u00F3n HTTPS para Servidor de Documentos.
+
+onlyoffice.service.convert.check.error-prefix= ($).
+onlyoffice.service.command.check.error-prefix= ($).
diff --git a/repo/src/main/resources/alfresco/templates/webscripts/onlyoffice/onlyoffice-config.get_fr.properties b/repo/src/main/resources/alfresco/templates/webscripts/onlyoffice/onlyoffice-config.get_fr.properties
index 081dd8d9..79808a73 100644
--- a/repo/src/main/resources/alfresco/templates/webscripts/onlyoffice/onlyoffice-config.get_fr.properties
+++ b/repo/src/main/resources/alfresco/templates/webscripts/onlyoffice/onlyoffice-config.get_fr.properties
@@ -8,18 +8,9 @@ onlyoffice-config.doc-url=Adresse du service d'\u00E9dition de document
onlyoffice-config.doc-url-inner=Adresse du service d'\u00E9dition de document pour les demandes internes du serveur
onlyoffice-config.doc-url-inner-tooltip=Adresse qui sera utilis\u00E9e pour acc\u00E9der au service d\u2019\u00E9dition de documents \u00E0 partir de Alfresco
onlyoffice-config.doc-url-tooltip=Adresse du service de modification de documents, par ex. http\://localhost/
-onlyoffice-config.docservcommand=Erreur en essayant de v\u00E9rifier CommandService
-onlyoffice-config.docservconvert=Erreur en essayant de v\u00E9rifier ConvertService
-onlyoffice-config.docservunreachable=ONLYOFFICE est indisponible.
-onlyoffice-config.error=Erreur\:
onlyoffice-config.ignore-ssl-cert=Ignorer certificat SSL
-onlyoffice-config.jsonparse=Serveur ne peut pas lire JSON
onlyoffice-config.jwt-secret=Cl\u00E9 secr\u00E8te (laisser vide pour d\u00E9sactiver)
-onlyoffice-config.jwterror=Erreur d'autorisation
-onlyoffice-config.mixedcontent=Le contenu mixte actif n'est pas autoris\u00E9. Une adresse HTTPS pour le serveur de document est requise.
onlyoffice-config.save-btn=Enregistrer
-onlyoffice-config.saved=Succ\u00E8s
-onlyoffice-config.statuscode=Code d'\u00E9tat
onlyoffice-config.title=Configuration d'ONLYOFFICE
onlyoffice-config.file-type=Ouvrir le fichier pour \u00e9dition (en raison de restrictions de format, des donn\u00e9es peuvent \u00eatre perdues lors de l'enregistrement dans les formats de la liste ci-dessous)
onlyoffice-config.common-section=Param\u00E8tres communs
@@ -40,3 +31,13 @@ onlyoffice-config.review-mode-markup=Balisage
onlyoffice-config.review-mode-final=Finale
onlyoffice-config.review-mode-original=Original
onlyoffice-config.customization-section=Param\u00e8tres de personnalisation de l'\u00e9diteur
+
+
+onlyoffice-config.message.settings.saved=
+onlyoffice-config.message.settings.saving-error=
+
+onlyoffice.server.common.error.api-js=
+onlyoffice.server.common.error.mixed-content=Le contenu mixte actif n\u2019est pas autoris\u00E9. Une adresse HTTPS pour le serveur de document est requise.
+
+onlyoffice.service.convert.check.error-prefix=Erreur lors de la vérification de ConvertService ($).
+onlyoffice.service.command.check.error-prefix=Erreur lors de la vérification de CommandService ($).
diff --git a/repo/src/main/resources/alfresco/templates/webscripts/onlyoffice/onlyoffice-config.get_it.properties b/repo/src/main/resources/alfresco/templates/webscripts/onlyoffice/onlyoffice-config.get_it.properties
index 1c274052..f0077c05 100644
--- a/repo/src/main/resources/alfresco/templates/webscripts/onlyoffice/onlyoffice-config.get_it.properties
+++ b/repo/src/main/resources/alfresco/templates/webscripts/onlyoffice/onlyoffice-config.get_it.properties
@@ -8,18 +8,9 @@ onlyoffice-config.doc-url=Indirizzo del servizio di modifica documenti
onlyoffice-config.doc-url-inner=Indirizzo di Document Editing Service per richieste interne dal server
onlyoffice-config.doc-url-inner-tooltip=Indirizzo che sar\u00E0 impiegato per accedere al Document Editing Service da Alfresco
onlyoffice-config.doc-url-tooltip=Indirizzo del servizio di modifica documenti, per esempio http\://localhost/
-onlyoffice-config.docservcommand=Errore durante il tentativo di controllare CommandService
-onlyoffice-config.docservconvert=Errore durante il tentativo di controllare ConvertService
-onlyoffice-config.docservunreachable=ONLYOFFICE non pu\u00F2 essere raggiunto
-onlyoffice-config.error=Errore\:
onlyoffice-config.ignore-ssl-cert=Ignora certificato SSL
-onlyoffice-config.jsonparse=Il server non pu\u00F2 leggere JSON
onlyoffice-config.jwt-secret=Chiave segreta (lasciare vuoto per disabilitare)
-onlyoffice-config.jwterror=Errore di autorizzazione
-onlyoffice-config.mixedcontent=Il contenuto attivo misto non \u00E8 consentito. \u00C8 richiesto l'indirizzo HTTPS per Document Server.
onlyoffice-config.save-btn=Salva
-onlyoffice-config.saved=Successo
-onlyoffice-config.statuscode=Codice di stat
onlyoffice-config.title=Configurazione dell'ONLYOFFICE
onlyoffice-config.file-type=Apri il file per la modifica (a causa di restrizioni di formato, i dati potrebbero andare persi durante il salvataggio nei formati della lista sottostante)
onlyoffice-config.common-section=Impostazioni comuni
@@ -39,4 +30,13 @@ onlyoffice-config.review-mode-label=Modalit\u00e0 di revisione per la visualizza
onlyoffice-config.review-mode-markup=Markup
onlyoffice-config.review-mode-final=Finale
onlyoffice-config.review-mode-original=Originale
-onlyoffice-config.customization-section=Impostazioni di personalizzazione dell'editor
\ No newline at end of file
+onlyoffice-config.customization-section=Impostazioni di personalizzazione dell'editor
+
+onlyoffice-config.message.settings.saved=
+onlyoffice-config.message.settings.saving-error=
+
+onlyoffice.server.common.error.api-js=
+onlyoffice.server.common.error.mixed-content=Il contenuto attivo misto non \u00E8 consentito. \u00C8 richiesto l\u2019indirizzo HTTPS per Document Server.
+
+onlyoffice.service.convert.check.error-prefix=
+onlyoffice.service.command.check.error-prefix=Errore durante il tentativo di controllare CommandService ($).
diff --git a/repo/src/main/resources/alfresco/templates/webscripts/onlyoffice/onlyoffice-config.get_pt.properties b/repo/src/main/resources/alfresco/templates/webscripts/onlyoffice/onlyoffice-config.get_pt.properties
index e907b6ee..09cddb6c 100644
--- a/repo/src/main/resources/alfresco/templates/webscripts/onlyoffice/onlyoffice-config.get_pt.properties
+++ b/repo/src/main/resources/alfresco/templates/webscripts/onlyoffice/onlyoffice-config.get_pt.properties
@@ -8,24 +8,15 @@ onlyoffice-config.doc-url=Endere\u00E7o do Servi\u00E7o de edi\u00E7\u00E3o de d
onlyoffice-config.doc-url-inner=Endere\u00E7o do Servi\u00E7o de edi\u00E7\u00E3o de documentos para solicita\u00E7\u00F5es internas do servidor
onlyoffice-config.doc-url-inner-tooltip=Endere\u00E7o que ser\u00E1 usado para acessar o Servi\u00E7o de edi\u00E7\u00E3o de documentos do Alfresco
onlyoffice-config.doc-url-tooltip=Endere\u00E7o do Servi\u00E7o de Edi\u00E7\u00E3o de Documentos, por exemplo, http\://localhost/
-onlyoffice-config.docservcommand=Erro ao tentar verificar o CommandService
-onlyoffice-config.docservconvert=Erro ao tentar verificar o ConvertService
-onlyoffice-config.docservunreachable=O ONLYOFFICE n\u00E3o pode ser alcan\u00E7ado
-onlyoffice-config.error=Erro\:
-onlyoffice-config.forcesave=Ativar For\u00E7ar salvamento
onlyoffice-config.ignore-ssl-cert=Ignorar certificado SSL
-onlyoffice-config.jsonparse=O servidor n\u00E3o consegue ler JSON
onlyoffice-config.jwt-secret=Chave secreta (deixe em branco para desativar)
-onlyoffice-config.jwterror=Erro de autoriza\u00E7\u00E3o
-onlyoffice-config.mixedcontent=Conte\u00FAdo ativo misto n\u00E3o \u00E9 permitido. \u00C9 necess\u00E1rio o endere\u00E7o HTTPS para o Document Server.
onlyoffice-config.save-btn=Salvar
-onlyoffice-config.saved=Bem-sucedido
-onlyoffice-config.statuscode=C\u00F3digo de status
onlyoffice-config.title=Configura\u00E7\u00E3o do ONLYOFFICE
-onlyoffice-config.webpreview=Ativar o ONLYOFFICE Web Preview
-onlyoffice-config.convert-original=Salvar docx, xlsx ou pptx como uma nova vers\u00e3o do arquivo original ap\u00f3s a convers\u00e3o
onlyoffice-config.file-type=Habilitar edi\u00e7\u00e3o (devido \u00e0 restri\u00e7\u00e3o dos formatos, dados podem ser perdidos ao salvar nos formatos abaixo)
onlyoffice-config.common-section=Configura\u00e7\u00f5es comuns
+onlyoffice-config.forcesave=Ativar For\u00E7ar salvamento
+onlyoffice-config.webpreview=Ativar o ONLYOFFICE Web Preview
+onlyoffice-config.convert-original=Salvar docx, xlsx ou pptx como uma nova vers\u00e3o do arquivo original ap\u00f3s a convers\u00e3o
onlyoffice-config.demo-connect=Conectar ao Servidor de documentos de demonstra\u00e7\u00e3o do ONLYOFFICE
onlyoffice-config.trial=Este \u00e9 um servidor de teste p\u00fablico, n\u00e3o o use para dados confidenciais. O servidor estar\u00e1 dispon\u00edvel por um per\u00edodo de 30 dias.
onlyoffice-config.trial-is-over=O per\u00edodo de teste de 30 dias acabou, voc\u00ea n\u00e3o pode mais se conectar ao Servidor de documentos de demonstra\u00e7\u00e3o do ONLYOFFICE
@@ -40,3 +31,12 @@ onlyoffice-config.review-mode-markup=Markup
onlyoffice-config.review-mode-final=Final
onlyoffice-config.review-mode-original=Original
onlyoffice-config.customization-section=Configura\u00e7\u00f5es de personaliza\u00e7\u00e3o do editor
+
+onlyoffice-config.message.settings.saved=
+onlyoffice-config.message.settings.saving-error=
+
+onlyoffice.server.common.error.api-js=
+onlyoffice.server.common.error.mixed-content=
+
+onlyoffice.service.convert.check.error-prefix=
+onlyoffice.service.command.check.error-prefix=
diff --git a/repo/src/main/resources/alfresco/templates/webscripts/onlyoffice/onlyoffice-config.get_ru.properties b/repo/src/main/resources/alfresco/templates/webscripts/onlyoffice/onlyoffice-config.get_ru.properties
index 5d32d02a..4bd4584d 100644
--- a/repo/src/main/resources/alfresco/templates/webscripts/onlyoffice/onlyoffice-config.get_ru.properties
+++ b/repo/src/main/resources/alfresco/templates/webscripts/onlyoffice/onlyoffice-config.get_ru.properties
@@ -8,18 +8,9 @@ onlyoffice-config.doc-url=\u0410\u0434\u0440\u0435\u0441 \u0441\u043B\u0443\u043
onlyoffice-config.doc-url-inner=\u0410\u0434\u0440\u0435\u0441 \u0441\u043B\u0443\u0436\u0431\u044B \u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u043E\u0432 \u0434\u043B\u044F \u0432\u043D\u0443\u0442\u0440\u0435\u043D\u043D\u0438\u0445 \u0437\u0430\u043F\u0440\u043E\u0441\u043E\u0432 \u0441\u0435\u0440\u0432\u0435\u0440\u0430
onlyoffice-config.doc-url-inner-tooltip=\u0410\u0434\u0440\u0435\u0441, \u043A\u043E\u0442\u043E\u0440\u044B\u0439 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C\u0441\u044F \u0434\u043B\u044F \u0434\u043E\u0441\u0442\u0443\u043F\u0430 \u043A \u0441\u043B\u0443\u0436\u0431\u0435 \u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u043E\u0432 \u0438\u0437 Alfresco
onlyoffice-config.doc-url-tooltip=\u0410\u0434\u0440\u0435\u0441 \u0441\u043B\u0443\u0436\u0431\u044B \u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u043E\u0432, \u043D\u0430\u043F\u0440\u0438\u043C\u0435\u0440 http\://localhost/
-onlyoffice-config.docservcommand=\u041E\u0448\u0438\u0431\u043A\u0430 \u0432\u043E \u0432\u0440\u0435\u043C\u044F \u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0438 CommandService
-onlyoffice-config.docservconvert=\u041E\u0448\u0438\u0431\u043A\u0430 \u0432\u043E \u0432\u0440\u0435\u043C\u044F \u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0438 ConvertService
-onlyoffice-config.docservunreachable=\u041F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u0435 ONLYOFFICE \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u043E
-onlyoffice-config.error=\u041E\u0448\u0438\u0431\u043A\u0430\:
onlyoffice-config.ignore-ssl-cert=\u0418\u0433\u043D\u043E\u0440\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0421\u0435\u0440\u0442\u0438\u0444\u0438\u043A\u0430\u0442 SSL
-onlyoffice-config.jsonparse=\u041D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u043F\u0440\u043E\u0447\u0438\u0442\u0430\u0442\u044C JSON \u043D\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435
onlyoffice-config.jwt-secret=\u0421\u0435\u043A\u0440\u0435\u0442\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 (\u043E\u0441\u0442\u0430\u0432\u044C\u0442\u0435 \u043F\u0443\u0441\u0442\u044B\u043C \u0434\u043B\u044F \u043E\u0442\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u044F)
-onlyoffice-config.jwterror=\u041E\u0448\u0438\u0431\u043A\u0430 \u0430\u0432\u0442\u043E\u0440\u0438\u0437\u0430\u0446\u0438\u0438
-onlyoffice-config.mixedcontent=\u0421\u043C\u0435\u0448\u0430\u043D\u043D\u043E\u0435 \u0430\u043A\u0442\u0438\u0432\u043D\u043E\u0435 \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u043C\u043E\u0435 \u0437\u0430\u043F\u0440\u0435\u0449\u0435\u043D\u043E. \u0414\u043B\u044F \u0421\u0435\u0440\u0432\u0435\u0440\u0430 \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u043E\u0432 \u043D\u0435\u043E\u0431\u0445\u043E\u0434\u0438\u043C\u043E \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C HTTPS-\u0430\u0434\u0440\u0435\u0441.
onlyoffice-config.save-btn=\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C
-onlyoffice-config.saved=\u0423\u0441\u043F\u0435\u0448\u043D\u043E
-onlyoffice-config.statuscode=\u041A\u043E\u0434 \u0441\u043E\u0441\u0442\u043E\u044F\u043D\u0438\u044F
onlyoffice-config.title=ONLYOFFICE \u041D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438
onlyoffice-config.file-type=\u041e\u0442\u043a\u0440\u044b\u0442\u044c\u0020\u0444\u0430\u0439\u043b\u0020\u043d\u0430\u0020\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u0020\u0028\u0438\u0437\u002d\u0437\u0430\u0020\u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439\u0020\u0444\u043e\u0440\u043c\u0430\u0442\u0430\u0020\u0434\u0430\u043d\u043d\u044b\u0435\u0020\u043c\u043e\u0433\u0443\u0442\u0020\u0431\u044b\u0442\u044c\u0020\u0443\u0442\u0435\u0440\u044f\u043d\u044b\u0020\u043f\u0440\u0438\u0020\u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0438\u0020\u0432\u0020\u0444\u043e\u0440\u043c\u0430\u0442\u044b\u0020\u0438\u0437\u0020\u0441\u043f\u0438\u0441\u043a\u0430\u0020\u043d\u0438\u0436\u0435\u0029
onlyoffice-config.common-section=\u041e\u0431\u0449\u0438\u0435\u0020\u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438
@@ -39,4 +30,13 @@ onlyoffice-config.review-mode-label=\u0420\u0435\u0436\u0438\u043c \u0440\u0435\
onlyoffice-config.review-mode-markup=\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f
onlyoffice-config.review-mode-final=\u0418\u0437\u043c\u0435\u043d\u0451\u043d\u043d\u044b\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442
onlyoffice-config.review-mode-original=\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442
-onlyoffice-config.customization-section=\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430
\ No newline at end of file
+onlyoffice-config.customization-section=\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430
+
+onlyoffice-config.message.settings.saved=\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438\u0020\u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u044b
+onlyoffice-config.message.settings.saving-error=\u041e\u0448\u0438\u0431\u043a\u0430\u0020\u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f\u0020\u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a
+
+onlyoffice.server.common.error.api-js=\u041d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0020\u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c\u0020\u0434\u043e\u0441\u0442\u0443\u043f\u0020\u043a\u0020\u0444\u0430\u0439\u043b\u0443\u0020\u0041\u0050\u0049\u0020\u004a\u0061\u0076\u0061\u0053\u0063\u0072\u0069\u0070\u0074\u002e
+onlyoffice.server.common.error.mixed-content=\u0421\u043C\u0435\u0448\u0430\u043D\u043D\u043E\u0435 \u0430\u043A\u0442\u0438\u0432\u043D\u043E\u0435 \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u043C\u043E\u0435 \u0437\u0430\u043F\u0440\u0435\u0449\u0435\u043D\u043E. \u0414\u043B\u044F \u0421\u0435\u0440\u0432\u0435\u0440\u0430 \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u043E\u0432 \u043D\u0435\u043E\u0431\u0445\u043E\u0434\u0438\u043C\u043E \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C HTTPS-\u0430\u0434\u0440\u0435\u0441.
+
+onlyoffice.service.convert.check.error-prefix=\u041e\u0448\u0438\u0431\u043a\u0430 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 ConvertService ($).
+onlyoffice.service.command.check.error-prefix=\u041e\u0448\u0438\u0431\u043a\u0430\u0020\u0432\u043e\u0020\u0432\u0440\u0435\u043c\u044f\u0020\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438\u0020\u0043\u006f\u006d\u006d\u0061\u006e\u0064\u0053\u0065\u0072\u0076\u0069\u0063\u0065\u0020\u0028\u0024\u0029\u002e
diff --git a/repo/src/main/resources/alfresco/templates/webscripts/onlyoffice/onlyoffice-config.get_uk.properties b/repo/src/main/resources/alfresco/templates/webscripts/onlyoffice/onlyoffice-config.get_uk.properties
index 05150a30..2176e42d 100644
--- a/repo/src/main/resources/alfresco/templates/webscripts/onlyoffice/onlyoffice-config.get_uk.properties
+++ b/repo/src/main/resources/alfresco/templates/webscripts/onlyoffice/onlyoffice-config.get_uk.properties
@@ -8,18 +8,9 @@ onlyoffice-config.doc-url=\u0410\u0434\u0440\u0435\u0441\u0430 \u0441\u043B\u044
onlyoffice-config.doc-url-inner=\u0410\u0434\u0440\u0435\u0441\u0430 \u0441\u043b\u0443\u0436\u0431\u0438 \u0440\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u043d\u043d\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0456\u0432 \u0434\u043b\u044f \u0432\u043d\u0443\u0442\u0440\u0456\u0448\u043d\u0456\u0445 \u0437\u0430\u043f\u0438\u0442\u0456\u0432 \u0456\u0437 \u0441\u0435\u0440\u0432\u0435\u0440\u0430
onlyoffice-config.doc-url-inner-tooltip=\u0410\u0434\u0440\u0435\u0441\u0430, \u044f\u043a\u0430 \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u0432\u0430\u0442\u0438\u043c\u0435\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0443 \u0434\u043e \u0441\u043b\u0443\u0436\u0431\u0438 \u0440\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u043d\u043d\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0456\u0432 \u0456\u0437 Alfresco
onlyoffice-config.doc-url-tooltip=\u0410\u0434\u0440\u0435\u0441\u0430 \u0441\u043B\u0443\u0436\u0431\u0438 \u0440\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u043D\u043D\u044F \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0456\u0432, \u043D\u0430\u043F\u0440\u0438\u043A\u043B\u0430\u0434 http\://localhost/
-onlyoffice-config.docservcommand=\u041F\u043E\u043C\u0438\u043B\u043A\u0430 \u043F\u0456\u0434 \u0447\u0430\u0441 \u043F\u0435\u0440\u0435\u0432\u0456\u0440\u043A\u0438 CommandService
-onlyoffice-config.docservconvert=\u041F\u043E\u043C\u0438\u043B\u043A\u0430 \u043F\u0456\u0434 \u0447\u0430\u0441 \u043F\u0435\u0440\u0435\u0432\u0456\u0440\u043A\u0438 ConvertService
-onlyoffice-config.docservunreachable=\u0414\u043E\u0434\u0430\u0442\u043E\u043A ONLYOFFICE \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0438\u0439
-onlyoffice-config.error=\u041F\u043E\u043C\u0438\u043B\u043A\u0430\:
onlyoffice-config.ignore-ssl-cert=\u0406\u0433\u043D\u043E\u0440\u0443\u0432\u0430\u0442\u0438 \u0421\u0435\u0440\u0442\u0438\u0444\u0456\u043A\u0430\u0442 SSL
-onlyoffice-config.jsonparse=\u041D\u0435\u043C\u043E\u0436\u043B\u0438\u0432\u043E \u043F\u0440\u043E\u0447\u0438\u0442\u0430\u0442\u0438 JSON \u043D\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0456
onlyoffice-config.jwt-secret=\u0422\u0430\u0454\u043C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447
-onlyoffice-config.jwterror=\u041F\u043E\u043C\u0438\u043B\u043A\u0430 \u0430\u0432\u0442\u043E\u0440\u0438\u0437\u0430\u0446\u0456\u0457
-onlyoffice-config.mixedcontent=\u0417\u043C\u0456\u0448\u0430\u043D\u0438\u0439 \u0430\u043A\u0442\u0438\u0432\u043D\u0438\u0439 \u0432\u043C\u0456\u0441\u0442 \u0437\u0430\u0431\u043E\u0440\u043E\u043D\u0435\u043D\u043E. \u0414\u043B\u044F \u0421\u0435\u0440\u0432\u0435\u0440\u0430 \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0456\u0432 \u043D\u0435\u043E\u0431\u0445\u0456\u0434\u043D\u043E \u0437\u0430\u0441\u0442\u043E\u0441\u043E\u0432\u0443\u0432\u0430\u0442\u0438 HTTPS-\u0430\u0434\u0440\u0435\u0441\u0443.
onlyoffice-config.save-btn=\u0417\u0431\u0435\u0440\u0435\u0433\u0442\u0438
-onlyoffice-config.saved=\u0412\u0434\u0430\u043B\u043E
-onlyoffice-config.statuscode=\u041A\u043E\u0434 \u0441\u0442\u0430\u043D\u0443
onlyoffice-config.title=ONLYOFFICE \u041D\u0430\u043B\u0430\u0448\u0442\u0443\u0432\u0430\u043D\u043D\u044F
onlyoffice-config.forcesave=\u0423\u0432\u0456\u043c\u043a\u043d\u0443\u0442\u0438 Force Save
onlyoffice-config.webpreview=\u0412\u043a\u043b\u044e\u0447\u0438\u0442\u0438 \u043f\u0440\u0435\u0432'\u044e
@@ -39,4 +30,13 @@ onlyoffice-config.review-mode-label=\u0420\u0435\u0436\u0438\u043c \u0440\u0435\
onlyoffice-config.review-mode-markup=\u0417\u043c\u0456\u043d\u0438
onlyoffice-config.review-mode-final=\u0417\u043c\u0456\u043d\u0435\u043d\u0438\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442
onlyoffice-config.review-mode-original=\u0412\u0438\u0445\u0456\u0434\u043d\u0438\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442
-onlyoffice-config.customization-section=\u041d\u0430\u043b\u0430\u0448\u0442\u0443\u0432\u0430\u043d\u043d\u044f \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430
\ No newline at end of file
+onlyoffice-config.customization-section=\u041d\u0430\u043b\u0430\u0448\u0442\u0443\u0432\u0430\u043d\u043d\u044f \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430
+
+onlyoffice-config.message.settings.saved=
+onlyoffice-config.message.settings.saving-error=
+
+onlyoffice.server.common.error.api-js=
+onlyoffice.server.common.error.mixed-content=
+
+onlyoffice.service.convert.check.error-prefix=
+onlyoffice.service.command.check.error-prefix=
diff --git a/repo/src/main/resources/newdocs b/repo/src/main/resources/newdocs
deleted file mode 160000
index f00ab3a3..00000000
--- a/repo/src/main/resources/newdocs
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit f00ab3a3efe6e2f8542ba026d1fc1d72df7dfd5f
diff --git a/share/pom.xml b/share/pom.xml
index ac304673..19d7aff7 100644
--- a/share/pom.xml
+++ b/share/pom.xml
@@ -31,6 +31,15 @@
spring-surf-api
+
+ com.onlyoffice
+ docs-integration-sdk
+
+
+ com.fasterxml.jackson.core
+ jackson-databind
+
+
javax.servlet
javax.servlet-api
diff --git a/share/src/main/java/com/onlyoffice/web/evaluator/IsConvertible.java b/share/src/main/java/com/onlyoffice/web/evaluator/IsConvertible.java
index c51fb482..5e8c67d4 100644
--- a/share/src/main/java/com/onlyoffice/web/evaluator/IsConvertible.java
+++ b/share/src/main/java/com/onlyoffice/web/evaluator/IsConvertible.java
@@ -5,10 +5,10 @@
package com.onlyoffice.web.evaluator;
+import com.onlyoffice.model.common.Format;
import com.onlyoffice.web.scripts.OnlyofficeSettingsQuery;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.web.evaluator.BaseEvaluator;
-import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
public class IsConvertible extends BaseEvaluator {
@@ -60,26 +60,26 @@ private boolean isConvertibleFormat(JSONObject jsonObject) {
String fileName = (String) jsonObject.get("fileName");
String docExt = fileName.substring(fileName.lastIndexOf(".") + 1).trim().toLowerCase();
- JSONArray supportedFormats = onlyofficeSettings.getSupportedFormats();
-
- for (int i = 0; i < supportedFormats.size(); i++) {
- JSONObject format = (JSONObject) supportedFormats.get(i);
- JSONArray outputTypes = (JSONArray) format.get("convertTo");
-
- if (format.get("name").equals(docExt)) {
- if (docExt.equals("txt") || docExt.equals("csv")) return false;
- switch (format.get("type").toString()) {
- case "FORM":
- if (outputTypes.contains("oform")) return true;
- break;
- case "WORD":
- if (outputTypes.contains("docx")) return true;
+ for (Format format : onlyofficeSettings.getSupportedFormats()) {
+ if (format.getName().equals(docExt)) {
+ switch (format.getType()) {
+ case WORD:
+ if (format.getName().equals("docxf") && format.getConvert().contains("oform")) {
+ return true;
+ }
+ if (format.getConvert().contains("docx")) {
+ return true;
+ }
break;
- case "CELL":
- if (outputTypes.contains("xlsx")) return true;
+ case CELL:
+ if (format.getConvert().contains("xlsx")) {
+ return true;
+ }
break;
- case "SLIDE":
- if (outputTypes.contains("pptx")) return true;
+ case SLIDE:
+ if (format.getConvert().contains("pptx")) {
+ return true;
+ }
break;
default:
break;
diff --git a/share/src/main/java/com/onlyoffice/web/evaluator/IsCorrectDownloadAs.java b/share/src/main/java/com/onlyoffice/web/evaluator/IsCorrectDownloadAs.java
index 9ace68c2..d7ca9af7 100644
--- a/share/src/main/java/com/onlyoffice/web/evaluator/IsCorrectDownloadAs.java
+++ b/share/src/main/java/com/onlyoffice/web/evaluator/IsCorrectDownloadAs.java
@@ -5,12 +5,14 @@
package com.onlyoffice.web.evaluator;
+import com.onlyoffice.model.common.Format;
import com.onlyoffice.web.scripts.OnlyofficeSettingsQuery;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.web.evaluator.BaseEvaluator;
-import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
+import java.util.List;
+
public class IsCorrectDownloadAs extends BaseEvaluator {
private OnlyofficeSettingsQuery onlyofficeSettings;
@@ -30,11 +32,10 @@ public boolean evaluate(JSONObject jsonObject) {
}
private boolean isSuppotredFormats(String ext) {
- JSONArray supportedFormats = onlyofficeSettings.getSupportedFormats();
- for (int i = 0; i < supportedFormats.size(); i++) {
- JSONObject format = (JSONObject) supportedFormats.get(i);
- JSONArray outputTypes = (JSONArray) format.get("convertTo");
- if (format.get("name").equals(ext) && outputTypes != null && outputTypes.size() > 0){
+ List formats = onlyofficeSettings.getSupportedFormats();
+ for (Format format : formats) {
+ List convert = format.getConvert();
+ if (format.getName().equals(ext) && convert != null && convert.size() > 0){
return true;
}
}
diff --git a/share/src/main/java/com/onlyoffice/web/evaluator/IsEditable.java b/share/src/main/java/com/onlyoffice/web/evaluator/IsEditable.java
index c5c40046..185776d1 100644
--- a/share/src/main/java/com/onlyoffice/web/evaluator/IsEditable.java
+++ b/share/src/main/java/com/onlyoffice/web/evaluator/IsEditable.java
@@ -8,7 +8,6 @@
import com.onlyoffice.web.scripts.OnlyofficeSettingsQuery;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.web.evaluator.BaseEvaluator;
-import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
public class IsEditable extends BaseEvaluator {
@@ -25,19 +24,7 @@ public boolean evaluate(JSONObject jsonObject) {
if (fileName != null) {
String docExt = fileName.substring(fileName.lastIndexOf(".") + 1).trim().toLowerCase();
- JSONArray supportedFormats = onlyofficeSettings.getSupportedFormats();
- boolean defaultEditFormat = false;
-
- for (int i = 0; i < supportedFormats.size(); i++) {
- JSONObject format = (JSONObject) supportedFormats.get(i);
-
- if (format.get("name").equals(docExt)) {
- defaultEditFormat = Boolean.parseBoolean(format.get("edit").toString());
- break;
- }
- }
-
- if (defaultEditFormat || onlyofficeSettings.getEditableFormats().contains(docExt)) {
+ if (onlyofficeSettings.getEditableFormats().contains(docExt)) {
return true;
}
}
diff --git a/share/src/main/java/com/onlyoffice/web/evaluator/IsViewable.java b/share/src/main/java/com/onlyoffice/web/evaluator/IsViewable.java
index 32648fcc..3f3265da 100644
--- a/share/src/main/java/com/onlyoffice/web/evaluator/IsViewable.java
+++ b/share/src/main/java/com/onlyoffice/web/evaluator/IsViewable.java
@@ -5,10 +5,10 @@
package com.onlyoffice.web.evaluator;
+import com.onlyoffice.model.common.Format;
import com.onlyoffice.web.scripts.OnlyofficeSettingsQuery;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.web.evaluator.BaseEvaluator;
-import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
public class IsViewable extends BaseEvaluator {
@@ -25,14 +25,13 @@ public boolean evaluate(JSONObject jsonObject) {
if (fileName != null) {
String docExt = fileName.substring(fileName.lastIndexOf(".") + 1).trim().toLowerCase();
- JSONArray supportedFormats = onlyofficeSettings.getSupportedFormats();
boolean canView = false;
- for (int i = 0; i < supportedFormats.size(); i++) {
- JSONObject format = (JSONObject) supportedFormats.get(i);
- if (format.get("name").equals(docExt) && !Boolean.parseBoolean(format.get("edit").toString())) {
+ for (Format format : onlyofficeSettings.getSupportedFormats()) {
+ if (format.getName().equals(docExt)
+ && format.getActions().contains("view")
+ && !onlyofficeSettings.getEditableFormats().contains(docExt)) {
canView = true;
- break;
}
}
diff --git a/share/src/main/java/com/onlyoffice/web/model/OnlyofficeSettings.java b/share/src/main/java/com/onlyoffice/web/model/OnlyofficeSettings.java
new file mode 100644
index 00000000..04800474
--- /dev/null
+++ b/share/src/main/java/com/onlyoffice/web/model/OnlyofficeSettings.java
@@ -0,0 +1,51 @@
+/*
+ Copyright (c) Ascensio System SIA 2023. All rights reserved.
+ http://www.onlyoffice.com
+*/
+
+package com.onlyoffice.web.model;
+
+import com.onlyoffice.model.common.Format;
+
+import java.util.List;
+import java.util.Map;
+
+public class OnlyofficeSettings {
+ Map editableFormats;
+ Boolean convertOriginal;
+ List supportedFormats;
+
+ public OnlyofficeSettings() {
+ }
+
+ public OnlyofficeSettings(Map editableFormats, Boolean convertOriginal,
+ List supportedFormats) {
+ this.editableFormats = editableFormats;
+ this.convertOriginal = convertOriginal;
+ this.supportedFormats = supportedFormats;
+ }
+
+ public Map getEditableFormats() {
+ return editableFormats;
+ }
+
+ public void setEditableFormats(Map editableFormats) {
+ this.editableFormats = editableFormats;
+ }
+
+ public Boolean getConvertOriginal() {
+ return convertOriginal;
+ }
+
+ public void setConvertOriginal(Boolean convertOriginal) {
+ this.convertOriginal = convertOriginal;
+ }
+
+ public List getSupportedFormats() {
+ return supportedFormats;
+ }
+
+ public void setSupportedFormats(List supportedFormats) {
+ this.supportedFormats = supportedFormats;
+ }
+}
diff --git a/share/src/main/java/com/onlyoffice/web/scripts/OnlyofficeSettingsQuery.java b/share/src/main/java/com/onlyoffice/web/scripts/OnlyofficeSettingsQuery.java
index 5237d8ad..b999ea0c 100644
--- a/share/src/main/java/com/onlyoffice/web/scripts/OnlyofficeSettingsQuery.java
+++ b/share/src/main/java/com/onlyoffice/web/scripts/OnlyofficeSettingsQuery.java
@@ -5,6 +5,11 @@
package com.onlyoffice.web.scripts;
+import com.fasterxml.jackson.databind.MapperFeature;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.onlyoffice.model.common.Format;
+import com.onlyoffice.model.settings.Settings;
+import com.onlyoffice.web.model.OnlyofficeSettings;
import org.alfresco.error.AlfrescoRuntimeException;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
@@ -12,13 +17,17 @@
import org.springframework.extensions.webscripts.ScriptRemote;
import org.springframework.extensions.webscripts.Status;
import org.springframework.extensions.webscripts.connector.Response;
+
+import java.util.ArrayList;
import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
import java.util.Set;
public class OnlyofficeSettingsQuery {
private static Set editableFormats = new HashSet();
private static Boolean convertOriginal = false;
- private static JSONArray supportedFormats = new JSONArray();
+ private static List supportedFormats = new ArrayList<>();
private static long timeLastRequest = 0;
private ScriptRemote remote;
@@ -28,21 +37,30 @@ public void setRemote(ScriptRemote remote) {
private void requestOnlyofficeSettingsFromRepo() {
if ((System.nanoTime() - timeLastRequest)/1000000000 > 10) {
- Set editableFormats = new HashSet<>();
Response response = remote.call("/parashift/onlyoffice/onlyoffice-settings");
if (response.getStatus().getCode() == Status.STATUS_OK) {
timeLastRequest = System.nanoTime();
try {
- JSONParser parser = new JSONParser();
- JSONObject json = (JSONObject) parser.parse(response.getResponse());
+ ObjectMapper objectMapper = new ObjectMapper();
+ objectMapper.enable(MapperFeature.ACCEPT_CASE_INSENSITIVE_ENUMS);
+
+ OnlyofficeSettings settings = objectMapper.readValue(response.getResponse(),
+ OnlyofficeSettings.class);
- JSONArray formats = (JSONArray) json.get("editableFormats");
- for (Object format : formats) {
- editableFormats.add((String) format);
+ for (Map.Entry format : settings.getEditableFormats().entrySet()) {
+ if (format.getValue()) {
+ this.editableFormats.add(format.getKey());
+ }
+ }
+ for (Format format : settings.getSupportedFormats()) {
+ if (format.getActions().contains("edit")) {
+ this.editableFormats.add(format.getName());
+ }
}
- this.editableFormats = editableFormats;
- this.convertOriginal = (Boolean) json.get("convertOriginal");
- this.supportedFormats = (JSONArray) json.get("supportedFormats");
+
+
+ this.convertOriginal = settings.getConvertOriginal();
+ this.supportedFormats = settings.getSupportedFormats();
} catch (Exception err) {
throw new AlfrescoRuntimeException("Failed to parse response from Alfresco: " + err.getMessage());
}
@@ -64,7 +82,7 @@ public Boolean getConvertOriginal() {
return convertOriginal;
}
- public JSONArray getSupportedFormats() {
+ public List getSupportedFormats() {
requestOnlyofficeSettingsFromRepo();
return supportedFormats;
}
diff --git a/share/src/main/resources/META-INF/components/documentlibrary/onlyoffice-doclib-multi-download-as.js b/share/src/main/resources/META-INF/components/documentlibrary/onlyoffice-doclib-multi-download-as.js
index 5a76c5e8..2fe5098b 100644
--- a/share/src/main/resources/META-INF/components/documentlibrary/onlyoffice-doclib-multi-download-as.js
+++ b/share/src/main/resources/META-INF/components/documentlibrary/onlyoffice-doclib-multi-download-as.js
@@ -12,7 +12,7 @@
if (supportedFormats) {
for (var format of supportedFormats) {
if (format.name == docExt) {
- outputTypes = format.convertTo;
+ outputTypes = format.convert;
}
}
@@ -20,7 +20,6 @@
if (outputTypes.includes(docExt)) {
outputTypes.splice(outputTypes.indexOf(docExt), 1);
}
- outputTypes.unshift(docExt);
}
}
|