From 57cff2be1134574183517169ca7018dd4f64b1da Mon Sep 17 00:00:00 2001 From: Serge Fedorow Date: Fri, 7 Feb 2020 17:52:59 +0200 Subject: [PATCH] 2.0.0 release Alfresco 6 --- CHANGELOG.md | 12 ++++++++++++ README.md | 1 + repo/build.gradle | 10 ++++++++-- .../main/java/com/parashift/onlyoffice/CallBack.java | 5 +++-- .../com/parashift/onlyoffice/OnlyOfficeService.java | 5 +++-- .../main/java/com/parashift/onlyoffice/Prepare.java | 5 +++-- .../java/com/parashift/onlyoffice/PrepareNoAuth.java | 5 +++-- share/build.gradle | 7 ++++++- .../META-INF/components/preview/OnlyOffice.js | 11 +++++++++-- .../com/parashift/onlyoffice-edit.get.html.ftl | 4 +++- .../onlyoffice/preview-config/web-preview.get.js | 3 ++- 11 files changed, 53 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 46cdd968..15b2a554 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,18 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## [2.0.0] 2020-02-07 + +### Changed +* Support Java 11 for Alfresco 6.x (replace depricated javex.annotation.Resource to org.springframework.beans.factory.annotation). +* Editor config and view parameters. + +### Fixed +* Can't find amp-plagin location +* Don't generat correct project.version +* Don't switch editor languages. +* Show all users as Anonymous. + ## [1.4.1] 2018-10-11 ### Fixed diff --git a/README.md b/README.md index be8f31fd..11e4958a 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ This Share plugin enables users to edit and preview Office documents within ONLYOFFICE from Alfresco Share. This will create a new **Edit in ONLYOFFICE** action within the document library for Office documents. This allows multiple users to collaborate in real time and to save back those changes to Alfresco. Tested with Enterprise 5.0.\*, 5.1.\*, 5.2.\* and Community 5.1.\*, 5.2.\* +Version 2.0.0 tested only with Community 6.1 (java 11) ## Features diff --git a/repo/build.gradle b/repo/build.gradle index c5a31ccb..2f6295d5 100644 --- a/repo/build.gradle +++ b/repo/build.gradle @@ -22,11 +22,15 @@ allprojects { ext { alfresco = [:] alfresco.version = "5.2.f" - } + ByteArrayOutputStream byteOut = new ByteArrayOutputStream() + project.exec { + commandLine = "git describe --tags".split(" ") + standardOutput = byteOut + } +project.version = byteOut.toString().trim() project.description = "ONLYOFFICE Integration for Alfresco" -version = "git describe --tags".execute().text.trim() repositories { mavenCentral() @@ -42,6 +46,8 @@ configurations { } dependencies { + // https://mvnrepository.com/artifact/javax.xml.bind/jaxb-api + compile group: 'javax.xml.bind', name: 'jaxb-api', version: '2.3.1' compile "org.alfresco:alfresco-repository:${alfresco.version}" compile ('com.monitorjbl:xlsx-streamer:1.0.2') { transitive = false } diff --git a/repo/src/main/java/com/parashift/onlyoffice/CallBack.java b/repo/src/main/java/com/parashift/onlyoffice/CallBack.java index 903a1ad7..346523b8 100644 --- a/repo/src/main/java/com/parashift/onlyoffice/CallBack.java +++ b/repo/src/main/java/com/parashift/onlyoffice/CallBack.java @@ -23,13 +23,13 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.extensions.webscripts.AbstractWebScript; import org.springframework.extensions.webscripts.WebScriptRequest; import org.springframework.extensions.webscripts.WebScriptResponse; import org.springframework.stereotype.Component; import javax.annotation.PostConstruct; -import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.transaction.Status; import javax.transaction.SystemException; @@ -55,7 +55,8 @@ public class CallBack extends AbstractWebScript { @Autowired NodeService nodeService; - @Resource(name = "policyBehaviourFilter") + @Autowired + @Qualifier("policyBehaviourFilter") BehaviourFilter behaviourFilter; @Autowired diff --git a/repo/src/main/java/com/parashift/onlyoffice/OnlyOfficeService.java b/repo/src/main/java/com/parashift/onlyoffice/OnlyOfficeService.java index 04a0d3f9..9905ba45 100644 --- a/repo/src/main/java/com/parashift/onlyoffice/OnlyOfficeService.java +++ b/repo/src/main/java/com/parashift/onlyoffice/OnlyOfficeService.java @@ -8,10 +8,10 @@ import org.alfresco.service.namespace.QName; import org.alfresco.util.UrlUtil; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Component; import javax.annotation.PostConstruct; -import javax.annotation.Resource; import javax.crypto.Mac; import javax.crypto.spec.SecretKeySpec; import java.io.Serializable; @@ -40,7 +40,8 @@ public class OnlyOfficeService { @Autowired NodeService nodeService; - @Resource(name = "global-properties") + @Autowired + @Qualifier( "global-properties") Properties globalProp; private byte[] token; diff --git a/repo/src/main/java/com/parashift/onlyoffice/Prepare.java b/repo/src/main/java/com/parashift/onlyoffice/Prepare.java index b2ac3ac6..16774130 100644 --- a/repo/src/main/java/com/parashift/onlyoffice/Prepare.java +++ b/repo/src/main/java/com/parashift/onlyoffice/Prepare.java @@ -20,13 +20,13 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.extensions.webscripts.AbstractWebScript; import org.springframework.extensions.webscripts.WebScriptRequest; import org.springframework.extensions.webscripts.WebScriptResponse; import org.springframework.stereotype.Component; import javax.annotation.PostConstruct; -import javax.annotation.Resource; import java.io.*; import java.util.*; @@ -48,7 +48,8 @@ public class Prepare extends AbstractWebScript { @Autowired ContentService contentService; - @Resource(name = "global-properties") + @Autowired + @Qualifier("global-properties") Properties globalProp; Integer docxMaxParagraph; diff --git a/repo/src/main/java/com/parashift/onlyoffice/PrepareNoAuth.java b/repo/src/main/java/com/parashift/onlyoffice/PrepareNoAuth.java index 66190f90..78882551 100644 --- a/repo/src/main/java/com/parashift/onlyoffice/PrepareNoAuth.java +++ b/repo/src/main/java/com/parashift/onlyoffice/PrepareNoAuth.java @@ -11,12 +11,12 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.extensions.webscripts.AbstractWebScript; import org.springframework.extensions.webscripts.WebScriptRequest; import org.springframework.extensions.webscripts.WebScriptResponse; import org.springframework.stereotype.Component; -import javax.annotation.Resource; import java.io.IOException; import java.io.Serializable; import java.io.Writer; @@ -41,7 +41,8 @@ public class PrepareNoAuth extends AbstractWebScript { @Autowired NodeService nodeService; - @Resource(name = "global-properties") + @Autowired + @Qualifier("global-properties") Properties globalProp; @Override diff --git a/share/build.gradle b/share/build.gradle index 16955523..27c9ec37 100644 --- a/share/build.gradle +++ b/share/build.gradle @@ -15,8 +15,13 @@ allprojects { targetCompatibility = 1.7 } + ByteArrayOutputStream byteOut = new ByteArrayOutputStream() + project.exec { + commandLine = "git describe --tags".split(" ") + standardOutput = byteOut + } +project.version = byteOut.toString().trim() project.description = "ONLYOFFICE Integration for Alfresco Share" -version = "git describe --tags".execute().text.trim() repositories { mavenCentral() diff --git a/share/src/main/resources/META-INF/components/preview/OnlyOffice.js b/share/src/main/resources/META-INF/components/preview/OnlyOffice.js index 67243c38..0151ae2e 100644 --- a/share/src/main/resources/META-INF/components/preview/OnlyOffice.js +++ b/share/src/main/resources/META-INF/components/preview/OnlyOffice.js @@ -85,13 +85,20 @@ fileType: translateDocumentType(docType), key: this.attributes.key, permissions: { - edit: true + edit: true, + comment: false } }, editorConfig: { mode: "view", + lang: this.attributes.lang, callbackUrl: this.attributes.callbackUrl, - user: this.attributes.user + user: this.attributes.user, + customization: { + zoom: -2, + chat: false, + comments: false + } } }; diff --git a/share/src/main/resources/alfresco/site-webscripts/com/parashift/onlyoffice-edit.get.html.ftl b/share/src/main/resources/alfresco/site-webscripts/com/parashift/onlyoffice-edit.get.html.ftl index 4ee120c1..7e265790 100644 --- a/share/src/main/resources/alfresco/site-webscripts/com/parashift/onlyoffice-edit.get.html.ftl +++ b/share/src/main/resources/alfresco/site-webscripts/com/parashift/onlyoffice-edit.get.html.ftl @@ -49,11 +49,13 @@ }, editorConfig: { mode: "edit", + lang: "${lang}", callbackUrl: "${callbackUrl}", user: { id: "${userId}", firstname: "${firstName}", - lastname: "${lastName}" + lastname: "${lastName}", + name: "${firstName} ${lastName}" } }, events: { diff --git a/share/src/main/resources/alfresco/site-webscripts/com/parashift/onlyoffice/preview-config/web-preview.get.js b/share/src/main/resources/alfresco/site-webscripts/com/parashift/onlyoffice/preview-config/web-preview.get.js index b7077c18..172629aa 100644 --- a/share/src/main/resources/alfresco/site-webscripts/com/parashift/onlyoffice/preview-config/web-preview.get.js +++ b/share/src/main/resources/alfresco/site-webscripts/com/parashift/onlyoffice/preview-config/web-preview.get.js @@ -46,7 +46,8 @@ if (model.widgets) pObj.user = { userId: user.id, firstName: user.firstName, - lastName: user.lastName + lastName: user.lastName, + name: user.firstName + " " + user.lastName } widget.options.pluginConditions = jsonUtils.toJSONString([{