Skip to content

Commit

Permalink
feat: setting the version after closing the document
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksandrfedorov97 committed Apr 5, 2024
1 parent dfe73d0 commit 5974fe7
Show file tree
Hide file tree
Showing 13 changed files with 23 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- core of the plugin has been moved to com.onlyoffice.docs-integration-sdk (https://github.com/ONLYOFFICE/docs-integration-sdk-java)
- document server v6.4 and earlier is no longer supported
- setting authorization header on settings page
- setting the version after closing the document
- docs cloud banner on settings page
- filling pdf

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ protected Map<String, Object> executeImpl(WebScriptRequest req, Status status, C
model.put("demoAvailable", settingsManager.isDemoAvailable());
model.put("webpreview", settingsManager.getSettingBoolean("webpreview", false));
model.put("convertOriginal", settingsManager.getSettingBoolean("convertOriginal", false));
model.put("minorVersion", settingsManager.getSettingBoolean("minorVersion", false));

Map<String, Boolean> lossyEditable = documentManager.getLossyEditableMap();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public void execute(WebScriptRequest request, WebScriptResponse response) throws

settingsManager.setSetting("convertOriginal", (String) extraSettings.get("convertOriginal"));
settingsManager.setSetting("webpreview", (String) extraSettings.get("webpreview"));
settingsManager.setSetting("minorVersion", (String) extraSettings.get("minorVersion"));

if (settings.getDemo() != null && settings.getDemo()) {
settingsManager.enableDemo();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,12 @@ public void handlerSave(final Callback callback, final String fileId) throws Exc
nodeService.removeProperty(wc, Util.EditingHashAspect);
nodeService.removeProperty(wc, Util.EditingKeyAspect);

versionProperties.put(VersionModel.PROP_VERSION_TYPE, VersionType.MAJOR);
if (getSettingsManager().getSettingBoolean("minorVersion", false)) {
versionProperties.put(VersionModel.PROP_VERSION_TYPE, VersionType.MINOR);
} else {
versionProperties.put(VersionModel.PROP_VERSION_TYPE, VersionType.MAJOR);
}

cociService.checkin(wc, versionProperties, null);

History history = callback.getHistory();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@
<input class="value" id="webpreview" name="cert" type="checkbox" <#if webpreview>checked</#if> />
<label class="label" for="webpreview">${msg("onlyoffice-config.webpreview")}</label>
</div>
<div class="control field">
<input class="value" id="minorVersion" name="minorVersion" type="checkbox" <#if minorVersion>checked</#if> />
<label class="label" for="minorVersion">${msg("onlyoffice-config.minor-version")}</label>
</div>
<div class="control field">
<input class="value" id="convertOriginal" name="convertOriginal" type="checkbox" <#if convertOriginal>checked</#if> />
<label class="label" for="convertOriginal">${msg("onlyoffice-config.convert-original")}</label>
Expand Down Expand Up @@ -232,6 +236,7 @@
var cert = document.getElementById("onlycert");
var fs = document.getElementById("forcesave");
var webpreview = document.getElementById("webpreview");
var minorVersion = document.getElementById("minorVersion");
var convertOriginal = document.getElementById("convertOriginal");
var jwts = document.getElementById("jwtsecret");
var securityHeader = document.getElementById("securityHeader");
Expand Down Expand Up @@ -347,6 +352,7 @@
}
};
obj.minorVersion = minorVersion.checked.toString();
obj.convertOriginal = convertOriginal.checked.toString();
obj.webpreview = webpreview.checked.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ onlyoffice-config.jwt-secret=Secret key (leave blank to disable)
onlyoffice-config.security.header=Authorization header (Leave blank to use default header)
onlyoffice-config.save-btn=Save
onlyoffice-config.title=ONLYOFFICE Configuration
onlyoffice-config.minor-version=After closing the editor, save the document as a minor version.
onlyoffice-config.forcesave=Enable Force Save
onlyoffice-config.webpreview=Enable ONLYOFFICE Web Preview
onlyoffice-config.convert-original=Save docx, xlsx or pptx as a new version of the original file after conversion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ onlyoffice-config.jwt-secret=Geheimer Schl\u00FCssel (freilassen, um zu deaktivi
onlyoffice-config.security.header=Authorization-Header (leer lassen, um die standardm\u00e4\u00dfige Kopfzeile zu verwenden)
onlyoffice-config.save-btn=Speichern
onlyoffice-config.title=Konfiguration des ONLYOFFICE
onlyoffice-config.minor-version=
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
onlyoffice-config.forcesave=Force Save aktivieren
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ onlyoffice-config.jwt-secret=Clave secreta (deje en blanco o desactive)
onlyoffice-config.security.header=Encabezado de autenticaci\u00f3n (dejar en blanco para utilizar el encabezado predeterminado)
onlyoffice-config.save-btn=Guardar
onlyoffice-config.title=Ajustes de ONLYOFFICE
onlyoffice-config.minor-version=
onlyoffice-config.forcesave=Habilitar Forzar guardar
onlyoffice-config.webpreview=Habilitar la Vista previa web de ONLYOFFICE
onlyoffice-config.convert-original=Guardar docx, xlsx o pptx como una nueva versi\u00f3n del archivo original despu\u00e9s de la conversi\u00f3n
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ onlyoffice-config.jwt-secret=Cl\u00E9 secr\u00E8te (laisser vide pour d\u00E9sac
onlyoffice-config.security.header=En-t\u00eate d'autorisation (laissez vide pour utiliser l'en-t\u00eate par d\u00e9faut)
onlyoffice-config.save-btn=Enregistrer
onlyoffice-config.title=Configuration d'ONLYOFFICE
onlyoffice-config.minor-version=
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
onlyoffice-config.forcesave=Activer Sauvegarde Forc\u00E9e
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ onlyoffice-config.jwt-secret=Chiave segreta (lasciare vuoto per disabilitare)
onlyoffice-config.save-btn=Salva
onlyoffice-config.security.header=Intestazione di autorizzazione (lascia vuoto per utilizzare l'intestazione predefinita)
onlyoffice-config.title=Configurazione dell'ONLYOFFICE
onlyoffice-config.minor-version=
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
onlyoffice-config.forcesave=Abilita salvataggio forzato
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ onlyoffice-config.jwt-secret=Chave secreta (deixe em branco para desativar)
onlyoffice-config.security.header=Cabe\u00e7alho de autoriza\u00e7\u00e3o (Deixe em branco para usar o cabe\u00e7alho padr\u00e3o)
onlyoffice-config.save-btn=Salvar
onlyoffice-config.title=Configura\u00E7\u00E3o do ONLYOFFICE
onlyoffice-config.minor-version=
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ onlyoffice-config.jwt-secret=\u0421\u0435\u043A\u0440\u0435\u0442\u043D\u044B\u0
onlyoffice-config.security.header=\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 (\u043e\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u043f\u0443\u0441\u0442\u044b\u043c, \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e)
onlyoffice-config.save-btn=\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C
onlyoffice-config.title=ONLYOFFICE \u041D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438
onlyoffice-config.minor-version=\u041f\u043e\u0441\u043b\u0435\u0020\u0437\u0430\u043a\u0440\u044b\u0442\u0438\u044f\u0020\u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430\u002c\u0020\u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c\u0020\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0020\u043a\u0430\u043a\u0020\u043d\u0435\u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e\u0020\u0432\u0435\u0440\u0441\u0438\u044e\u002e
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
onlyoffice-config.forcesave=\u0412\u043A\u043B\u044E\u0447\u0438\u0442\u044C Force Save
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ onlyoffice-config.jwt-secret=\u0422\u0430\u0454\u043C\u043D\u0438\u0439 \u043A\u
onlyoffice-config.security.header=\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0456\u0457 (\u0437\u0430\u043b\u0438\u0448\u0442\u0435 \u043f\u043e\u0440\u043e\u0436\u043d\u0456\u043c \u0434\u043b\u044f \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u0430\u043d\u043d\u044f \u0442\u0438\u043f\u043e\u0432\u043e\u0433\u043e \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0443)
onlyoffice-config.save-btn=\u0417\u0431\u0435\u0440\u0435\u0433\u0442\u0438
onlyoffice-config.title=ONLYOFFICE \u041D\u0430\u043B\u0430\u0448\u0442\u0443\u0432\u0430\u043D\u043D\u044F
onlyoffice-config.minor-version=
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
onlyoffice-config.convert-original=\u0417\u0431\u0435\u0440\u0456\u0433\u0430\u0442\u0438 docx, xlsx \u0430\u0431\u043e pptx \u044f\u043a \u043d\u043e\u0432\u0443 \u0432\u0435\u0440\u0441\u0456\u044e \u0432\u0438\u0445\u0456\u0434\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0443 \u043f\u0456\u0441\u043b\u044f \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0456\u0457
Expand Down

0 comments on commit 5974fe7

Please sign in to comment.