From 89e906be6be45d4a6c8bc06784dcc45fbca530be Mon Sep 17 00:00:00 2001 From: Alan Davis Date: Wed, 28 Mar 2018 14:12:59 +0100 Subject: [PATCH 1/5] REPO-3299,REPO-3437,REPO-3436: Switch to Enterprise license. --- .../Dockerfile | 5 +- alfresco-docker-alfresco-pdf-renderer/LICENSE | 201 ------------------ .../LICENSES.md | 3 +- .../AlfrescoPdfRendererController.java | 23 +- .../org/alfresco/transformer/Application.java | 22 +- alfresco-docker-imagemagick/Dockerfile | 5 +- alfresco-docker-imagemagick/LICENSE | 201 ------------------ alfresco-docker-imagemagick/LICENSES.md | 3 +- .../org/alfresco/transformer/Application.java | 22 +- .../transformer/ImageMagickController.java | 26 +-- alfresco-docker-libreoffice/Dockerfile | 5 +- alfresco-docker-libreoffice/LICENSE | 201 ------------------ alfresco-docker-libreoffice/LICENSES.md | 3 +- .../org/alfresco/transformer/Application.java | 22 +- .../alfresco/transformer/JodConverter.java | 22 +- .../transformer/LibreOfficeController.java | 23 +- .../base/AbstractTransformerController.java | 10 + pom.xml | 2 +- 18 files changed, 57 insertions(+), 742 deletions(-) delete mode 100644 alfresco-docker-alfresco-pdf-renderer/LICENSE delete mode 100644 alfresco-docker-imagemagick/LICENSE delete mode 100644 alfresco-docker-libreoffice/LICENSE diff --git a/alfresco-docker-alfresco-pdf-renderer/Dockerfile b/alfresco-docker-alfresco-pdf-renderer/Dockerfile index a0c4794d..25ffd285 100644 --- a/alfresco-docker-alfresco-pdf-renderer/Dockerfile +++ b/alfresco-docker-alfresco-pdf-renderer/Dockerfile @@ -1,6 +1,7 @@ -# Image provides a container in which to run alfresco-pdf-renderer transformations for Alfresco Content Services. +# Image provides a container in which to run alfresco-pdf-renderer transformations for Alfresco Enterprise Content Services. -# alfresco-pdf-renderer uses the PDFium library from Google Inc. See the license at https://pdfium.googlesource.com/pdfium/+/master/LICENSE or in /pdfium.txt +# The container is only intended to be used with the Alfresco Enterprise editon which is covered by https://www.alfresco.com/legal/agreements and https://www.alfresco.com/terms-use. +# alfresco-pdf-renderer uses the PDFium library from Google Inc. See the license at https://pdfium.googlesource.com/pdfium/+/master/LICENSE or in /pdfium.txt. FROM quay.io/alfresco/alfresco-base-java:9 diff --git a/alfresco-docker-alfresco-pdf-renderer/LICENSE b/alfresco-docker-alfresco-pdf-renderer/LICENSE deleted file mode 100644 index 261eeb9e..00000000 --- a/alfresco-docker-alfresco-pdf-renderer/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/alfresco-docker-alfresco-pdf-renderer/LICENSES.md b/alfresco-docker-alfresco-pdf-renderer/LICENSES.md index 1f79dfa9..61ec4d48 100644 --- a/alfresco-docker-alfresco-pdf-renderer/LICENSES.md +++ b/alfresco-docker-alfresco-pdf-renderer/LICENSES.md @@ -1,5 +1,6 @@ ### Licenses -* See the Alfresco [LICENSE](LICENSE) file in this directory. +* The code in the alfresco-docker-alfresco-pdf-renderer project is only intended to be use with the Alfresco Enterprise + Content Repository which is covered by [https://www.alfresco.com/legal/agreements](https://www.alfresco.com/legal/agreements) and [https://www.alfresco.com/terms-use](https://www.alfresco.com/terms-use) * The alfresco-pdf-renderer transformer uses the PDFium library from Google Inc. See [https://pdfium.googlesource.com/pdfium/+/master/LICENSE](https://pdfium.googlesource.com/pdfium/+/master/LICENSE) or the [pdfium.txt](https://github.com/Alfresco/acs-community-packaging/blob/master/zip/src/main/resources/licenses/3rd-party/pdfium.txt) file placed in the root directory of the docker image. diff --git a/alfresco-docker-alfresco-pdf-renderer/src/main/java/org/alfresco/transformer/AlfrescoPdfRendererController.java b/alfresco-docker-alfresco-pdf-renderer/src/main/java/org/alfresco/transformer/AlfrescoPdfRendererController.java index 9c082bf0..cedddfd7 100644 --- a/alfresco-docker-alfresco-pdf-renderer/src/main/java/org/alfresco/transformer/AlfrescoPdfRendererController.java +++ b/alfresco-docker-alfresco-pdf-renderer/src/main/java/org/alfresco/transformer/AlfrescoPdfRendererController.java @@ -1,26 +1,12 @@ /* * #%L - * Alfresco Repository + * Alfresco Enterprise Repository * %% * Copyright (C) 2005 - 2018 Alfresco Software Limited * %% - * This file is part of the Alfresco software. - * If the software was purchased under a paid Alfresco license, the terms of - * the paid license agreement will prevail. Otherwise, the software is - * provided under the following open source license terms: - * - * Alfresco is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Alfresco is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Alfresco. If not, see . + * License rights for this program may be obtained from Alfresco Software, Ltd. + * pursuant to a written agreement and any use of this program without such an + * agreement is prohibited. * #L% */ package org.alfresco.transformer; @@ -73,6 +59,7 @@ public class AlfrescoPdfRendererController extends AbstractTransformerController { logger = LogFactory.getLog(AlfrescoPdfRendererController.class); logger.info("-----------------------------------------------------------------------------------------------------------------------------------------------------------"); + logEnterpriseLicenseMessage(); logger.info("alfresco-pdf-renderer uses the PDFium library from Google Inc. See the license at https://pdfium.googlesource.com/pdfium/+/master/LICENSE or in /pdfium.txt"); logger.info("-----------------------------------------------------------------------------------------------------------------------------------------------------------"); setTransformCommand(createTransformCommand()); diff --git a/alfresco-docker-alfresco-pdf-renderer/src/main/java/org/alfresco/transformer/Application.java b/alfresco-docker-alfresco-pdf-renderer/src/main/java/org/alfresco/transformer/Application.java index ab1a8c49..6b28dcf7 100644 --- a/alfresco-docker-alfresco-pdf-renderer/src/main/java/org/alfresco/transformer/Application.java +++ b/alfresco-docker-alfresco-pdf-renderer/src/main/java/org/alfresco/transformer/Application.java @@ -1,26 +1,12 @@ /* * #%L - * Alfresco Repository + * Alfresco Enterprise Repository * %% * Copyright (C) 2005 - 2018 Alfresco Software Limited * %% - * This file is part of the Alfresco software. - * If the software was purchased under a paid Alfresco license, the terms of - * the paid license agreement will prevail. Otherwise, the software is - * provided under the following open source license terms: - * - * Alfresco is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Alfresco is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Alfresco. If not, see . + * License rights for this program may be obtained from Alfresco Software, Ltd. + * pursuant to a written agreement and any use of this program without such an + * agreement is prohibited. * #L% */ package org.alfresco.transformer; diff --git a/alfresco-docker-imagemagick/Dockerfile b/alfresco-docker-imagemagick/Dockerfile index 33269f71..392bc643 100644 --- a/alfresco-docker-imagemagick/Dockerfile +++ b/alfresco-docker-imagemagick/Dockerfile @@ -1,6 +1,7 @@ -# Image provides a container in which to run ImageMagick transformations for Alfresco Content Services. +# Image provides a container in which to run ImageMagick transformations for Alfresco Enterprise Content Services. -# ImageMagick is from ImageMagick Studio LLC. See the license at http://www.imagemagick.org/script/license.php or in /ImageMagick-license.txt +# The container is only intended to be used with the Alfresco Enterprise editon which is covered by https://www.alfresco.com/legal/agreements and https://www.alfresco.com/terms-use. +# ImageMagick is from ImageMagick Studio LLC. See the license at http://www.imagemagick.org/script/license.php or in /ImageMagick-license.txt. FROM quay.io/alfresco/alfresco-base-java:9 diff --git a/alfresco-docker-imagemagick/LICENSE b/alfresco-docker-imagemagick/LICENSE deleted file mode 100644 index 261eeb9e..00000000 --- a/alfresco-docker-imagemagick/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/alfresco-docker-imagemagick/LICENSES.md b/alfresco-docker-imagemagick/LICENSES.md index f69c1d87..a6d2cbee 100644 --- a/alfresco-docker-imagemagick/LICENSES.md +++ b/alfresco-docker-imagemagick/LICENSES.md @@ -1,6 +1,7 @@ ### Licenses -* See the Alfresco [LICENSE](LICENSE) file in this directory. +* The code in the alfresco-docker-imagemagick project is only intended to be use with the Alfresco Enterprise + Content Repository which is covered by [https://www.alfresco.com/legal/agreements](https://www.alfresco.com/legal/agreements) and [https://www.alfresco.com/terms-use](https://www.alfresco.com/terms-use) * ImageMagick is from ImageMagick Studio LLC. See the license at [http://www.imagemagick.org/script/license.php](http://www.imagemagick.org/script/license.php) or the [ImageMagick-license.txt](https://github.com/Alfresco/acs-community-packaging/blob/master/zip/src/main/resources/licenses/3rd-party/ImageMagick-license.txt) file placed in the root directory of the docker image. diff --git a/alfresco-docker-imagemagick/src/main/java/org/alfresco/transformer/Application.java b/alfresco-docker-imagemagick/src/main/java/org/alfresco/transformer/Application.java index 0eccaa69..22cbefc4 100644 --- a/alfresco-docker-imagemagick/src/main/java/org/alfresco/transformer/Application.java +++ b/alfresco-docker-imagemagick/src/main/java/org/alfresco/transformer/Application.java @@ -1,26 +1,12 @@ /* * #%L - * Alfresco Repository + * Alfresco Enterprise Repository * %% * Copyright (C) 2005 - 2018 Alfresco Software Limited * %% - * This file is part of the Alfresco software. - * If the software was purchased under a paid Alfresco license, the terms of - * the paid license agreement will prevail. Otherwise, the software is - * provided under the following open source license terms: - * - * Alfresco is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Alfresco is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Alfresco. If not, see . + * License rights for this program may be obtained from Alfresco Software, Ltd. + * pursuant to a written agreement and any use of this program without such an + * agreement is prohibited. * #L% */ package org.alfresco.transformer; diff --git a/alfresco-docker-imagemagick/src/main/java/org/alfresco/transformer/ImageMagickController.java b/alfresco-docker-imagemagick/src/main/java/org/alfresco/transformer/ImageMagickController.java index 320c8ad7..2b1c0285 100644 --- a/alfresco-docker-imagemagick/src/main/java/org/alfresco/transformer/ImageMagickController.java +++ b/alfresco-docker-imagemagick/src/main/java/org/alfresco/transformer/ImageMagickController.java @@ -1,26 +1,12 @@ /* * #%L - * Alfresco Repository + * Alfresco Enterprise Repository * %% * Copyright (C) 2005 - 2018 Alfresco Software Limited * %% - * This file is part of the Alfresco software. - * If the software was purchased under a paid Alfresco license, the terms of - * the paid license agreement will prevail. Otherwise, the software is - * provided under the following open source license terms: - * - * Alfresco is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Alfresco is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Alfresco. If not, see . + * License rights for this program may be obtained from Alfresco Software, Ltd. + * pursuant to a written agreement and any use of this program without such an + * agreement is prohibited. * #L% */ package org.alfresco.transformer; @@ -35,14 +21,11 @@ import org.springframework.core.io.Resource; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletRequest; import java.io.File; -import java.io.UnsupportedEncodingException; import java.util.*; /** @@ -81,6 +64,7 @@ public class ImageMagickController extends AbstractTransformerController { logger = LogFactory.getLog(ImageMagickController.class); logger.info("--------------------------------------------------------------------------------------------------------------------------------------------------------------"); + logEnterpriseLicenseMessage(); logger.info("This transformer uses ImageMagick from ImageMagick Studio LLC. See the license at http://www.imagemagick.org/script/license.php or in /ImageMagick-license.txt"); logger.info("--------------------------------------------------------------------------------------------------------------------------------------------------------------"); setTransformCommand(createTransformCommand()); diff --git a/alfresco-docker-libreoffice/Dockerfile b/alfresco-docker-libreoffice/Dockerfile index 178a90e4..d7ba9033 100644 --- a/alfresco-docker-libreoffice/Dockerfile +++ b/alfresco-docker-libreoffice/Dockerfile @@ -1,6 +1,7 @@ -# Image provides a container in which to run LibreOffice transformations for Alfresco Content Services. +# Image provides a container in which to run LibreOffice transformations for Alfresco Enterprise Content Services. -# LibreOffice is from The Document Foundation. See the license at https://www.libreoffice.org/download/license/ or in /libreoffice.txt +# The container is only intended to be used with the Alfresco Enterprise editon which is covered by https://www.alfresco.com/legal/agreements and https://www.alfresco.com/terms-use. +# LibreOffice is from The Document Foundation. See the license at https://www.libreoffice.org/download/license/ or in /libreoffice.txt. FROM quay.io/alfresco/alfresco-base-java:9 diff --git a/alfresco-docker-libreoffice/LICENSE b/alfresco-docker-libreoffice/LICENSE deleted file mode 100644 index 261eeb9e..00000000 --- a/alfresco-docker-libreoffice/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/alfresco-docker-libreoffice/LICENSES.md b/alfresco-docker-libreoffice/LICENSES.md index 3e5d8688..6675172b 100644 --- a/alfresco-docker-libreoffice/LICENSES.md +++ b/alfresco-docker-libreoffice/LICENSES.md @@ -1,6 +1,7 @@ ### Licenses -* See the Alfresco [LICENSE](LICENSE) file in this directory. +* The code in the alfresco-docker-libreoffice project is only intended to be use with the Alfresco Enterprise + Content Repository which is covered by [https://www.alfresco.com/legal/agreements](https://www.alfresco.com/legal/agreements) and [https://www.alfresco.com/terms-use](https://www.alfresco.com/terms-use) * This transformer uses LibreOffice from The Document Foundation. See the license at [https://www.libreoffice.org/download/license/](https://www.libreoffice.org/download/license/) or the [libreoffice.txt](https://github.com/Alfresco/acs-community-packaging/blob/master/zip/src/main/resources/licenses/3rd-party/libreoffice.txt) diff --git a/alfresco-docker-libreoffice/src/main/java/org/alfresco/transformer/Application.java b/alfresco-docker-libreoffice/src/main/java/org/alfresco/transformer/Application.java index ab1a8c49..6b28dcf7 100644 --- a/alfresco-docker-libreoffice/src/main/java/org/alfresco/transformer/Application.java +++ b/alfresco-docker-libreoffice/src/main/java/org/alfresco/transformer/Application.java @@ -1,26 +1,12 @@ /* * #%L - * Alfresco Repository + * Alfresco Enterprise Repository * %% * Copyright (C) 2005 - 2018 Alfresco Software Limited * %% - * This file is part of the Alfresco software. - * If the software was purchased under a paid Alfresco license, the terms of - * the paid license agreement will prevail. Otherwise, the software is - * provided under the following open source license terms: - * - * Alfresco is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Alfresco is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Alfresco. If not, see . + * License rights for this program may be obtained from Alfresco Software, Ltd. + * pursuant to a written agreement and any use of this program without such an + * agreement is prohibited. * #L% */ package org.alfresco.transformer; diff --git a/alfresco-docker-libreoffice/src/main/java/org/alfresco/transformer/JodConverter.java b/alfresco-docker-libreoffice/src/main/java/org/alfresco/transformer/JodConverter.java index 2fad484c..2ac68ba7 100644 --- a/alfresco-docker-libreoffice/src/main/java/org/alfresco/transformer/JodConverter.java +++ b/alfresco-docker-libreoffice/src/main/java/org/alfresco/transformer/JodConverter.java @@ -1,26 +1,12 @@ /* * #%L - * Alfresco Repository + * Alfresco Enterprise Repository * %% * Copyright (C) 2005 - 2018 Alfresco Software Limited * %% - * This file is part of the Alfresco software. - * If the software was purchased under a paid Alfresco license, the terms of - * the paid license agreement will prevail. Otherwise, the software is - * provided under the following open source license terms: - * - * Alfresco is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Alfresco is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Alfresco. If not, see . + * License rights for this program may be obtained from Alfresco Software, Ltd. + * pursuant to a written agreement and any use of this program without such an + * agreement is prohibited. * #L% */ package org.alfresco.transformer; diff --git a/alfresco-docker-libreoffice/src/main/java/org/alfresco/transformer/LibreOfficeController.java b/alfresco-docker-libreoffice/src/main/java/org/alfresco/transformer/LibreOfficeController.java index fe7f3abb..0cdc3b3d 100644 --- a/alfresco-docker-libreoffice/src/main/java/org/alfresco/transformer/LibreOfficeController.java +++ b/alfresco-docker-libreoffice/src/main/java/org/alfresco/transformer/LibreOfficeController.java @@ -1,26 +1,12 @@ /* * #%L - * Alfresco Repository + * Alfresco Enterprise Repository * %% * Copyright (C) 2005 - 2018 Alfresco Software Limited * %% - * This file is part of the Alfresco software. - * If the software was purchased under a paid Alfresco license, the terms of - * the paid license agreement will prevail. Otherwise, the software is - * provided under the following open source license terms: - * - * Alfresco is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Alfresco is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Alfresco. If not, see . + * License rights for this program may be obtained from Alfresco Software, Ltd. + * pursuant to a written agreement and any use of this program without such an + * agreement is prohibited. * #L% */ package org.alfresco.transformer; @@ -82,6 +68,7 @@ public class LibreOfficeController extends AbstractTransformerController { logger = LogFactory.getLog(LibreOfficeController.class); logger.info("-------------------------------------------------------------------------------------------------------------------------------------------------------"); + logEnterpriseLicenseMessage(); logger.info("This transformer uses LibreOffice from The Document Foundation. See the license at https://www.libreoffice.org/download/license/ or in /libreoffice.txt"); logger.info("-------------------------------------------------------------------------------------------------------------------------------------------------------"); setJodConverter(createJodConverter()); diff --git a/alfresco-transformer-base/src/main/java/org/alfresco/transformer/base/AbstractTransformerController.java b/alfresco-transformer-base/src/main/java/org/alfresco/transformer/base/AbstractTransformerController.java index 870555a7..6bdbefac 100644 --- a/alfresco-transformer-base/src/main/java/org/alfresco/transformer/base/AbstractTransformerController.java +++ b/alfresco-transformer-base/src/main/java/org/alfresco/transformer/base/AbstractTransformerController.java @@ -98,6 +98,16 @@ public abstract class AbstractTransformerController checkCommand = runtimeExec; } + protected void logEnterpriseLicenseMessage() + { + logger.info("This image is only intended to be use with the Alfresco Enterprise Content Repository which is covered by "); + logger.info("https://www.alfresco.com/legal/agreements and https://www.alfresco.com/terms-use"); + logger.info(""); + logger.info("License rights for this program may be obtained from Alfresco Software, Ltd. pursuant to a written agreement"); + logger.info("and any use of this program without such an agreement is prohibited."); + logger.info(""); + } + @RequestMapping("/version") @ResponseBody String version() diff --git a/pom.xml b/pom.xml index 1eb12e8a..05914544 100644 --- a/pom.xml +++ b/pom.xml @@ -15,7 +15,7 @@ 1.8 - local + latest 2.0.8 3.5.37 1.5.10.RELEASE From b4fc6c0097e66652d36b52533a4218d50b3db492 Mon Sep 17 00:00:00 2001 From: Alan Davis Date: Wed, 28 Mar 2018 14:40:22 +0100 Subject: [PATCH 2/5] REPO-3299,REPO-3436,REPO-3437: Typo in license message --- .../transformer/base/AbstractTransformerController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alfresco-transformer-base/src/main/java/org/alfresco/transformer/base/AbstractTransformerController.java b/alfresco-transformer-base/src/main/java/org/alfresco/transformer/base/AbstractTransformerController.java index 6bdbefac..4a917733 100644 --- a/alfresco-transformer-base/src/main/java/org/alfresco/transformer/base/AbstractTransformerController.java +++ b/alfresco-transformer-base/src/main/java/org/alfresco/transformer/base/AbstractTransformerController.java @@ -100,7 +100,7 @@ public abstract class AbstractTransformerController protected void logEnterpriseLicenseMessage() { - logger.info("This image is only intended to be use with the Alfresco Enterprise Content Repository which is covered by "); + logger.info("This image is only intended to be used with the Alfresco Enterprise Content Repository which is covered by "); logger.info("https://www.alfresco.com/legal/agreements and https://www.alfresco.com/terms-use"); logger.info(""); logger.info("License rights for this program may be obtained from Alfresco Software, Ltd. pursuant to a written agreement"); From 9266b34ecdde6899cd862584457c6f77d2eda18c Mon Sep 17 00:00:00 2001 From: Alexandru-Eusebiu Epure Date: Mon, 2 Apr 2018 16:22:07 +0300 Subject: [PATCH 3/5] REPO-3378: update Dockerfile ENV variables to point to the corect imagemagick,libreoffice and pdfium license url. --- alfresco-docker-alfresco-pdf-renderer/Dockerfile | 2 +- alfresco-docker-imagemagick/Dockerfile | 2 +- alfresco-docker-libreoffice/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/alfresco-docker-alfresco-pdf-renderer/Dockerfile b/alfresco-docker-alfresco-pdf-renderer/Dockerfile index 25ffd285..ee01f707 100644 --- a/alfresco-docker-alfresco-pdf-renderer/Dockerfile +++ b/alfresco-docker-alfresco-pdf-renderer/Dockerfile @@ -6,7 +6,7 @@ FROM quay.io/alfresco/alfresco-base-java:9 ENV ALFRESCO_PDF_RENDERER_LIB_RPM_URL=https://nexus.alfresco.com/nexus/service/local/repositories/releases/content/org/alfresco/alfresco-pdf-renderer/1.1/alfresco-pdf-renderer-1.1-linux.tgz -ENV PDFIUM_LICENSE_FILE=https://github.com/Alfresco/acs-community-packaging/blob/master/zip/src/main/resources/licenses/3rd-party/pdfium.txt +ENV PDFIUM_LICENSE_FILE=https://github.com/Alfresco/acs-community-packaging/blob/master/distribution/src/main/resources/licenses/3rd-party/pdfium.txt COPY target/alfresco-docker-alfresco-pdf-renderer-${env.project_version}.jar /usr/bin diff --git a/alfresco-docker-imagemagick/Dockerfile b/alfresco-docker-imagemagick/Dockerfile index 392bc643..2acb679d 100644 --- a/alfresco-docker-imagemagick/Dockerfile +++ b/alfresco-docker-imagemagick/Dockerfile @@ -7,7 +7,7 @@ FROM quay.io/alfresco/alfresco-base-java:9 ENV IMAGEMAGICK_RPM_URL=https://nexus.alfresco.com/nexus/service/local/repositories/thirdparty/content/org/imagemagick/imagemagick-distribution/7.0.7-27/imagemagick-distribution-7.0.7-27-linux.rpm ENV IMAGEMAGICK_LIB_RPM_URL=https://nexus.alfresco.com/nexus/service/local/repositories/thirdparty/content/org/imagemagick/imagemagick-distribution/7.0.7-27/imagemagick-distribution-7.0.7-27-libs-linux.rpm -ENV IMAGEMAGICK_LICENSE_FILE=https://github.com/Alfresco/acs-community-packaging/blob/master/zip/src/main/resources/licenses/3rd-party/ImageMagick-license.txt +ENV IMAGEMAGICK_LICENSE_FILE=https://github.com/Alfresco/acs-community-packaging/blob/master/distribution/src/main/resources/licenses/3rd-party/ImageMagick-license.txt COPY target/alfresco-docker-imagemagick-${env.project_version}.jar /usr/bin diff --git a/alfresco-docker-libreoffice/Dockerfile b/alfresco-docker-libreoffice/Dockerfile index d7ba9033..d501bafc 100644 --- a/alfresco-docker-libreoffice/Dockerfile +++ b/alfresco-docker-libreoffice/Dockerfile @@ -6,7 +6,7 @@ FROM quay.io/alfresco/alfresco-base-java:9 ENV LIBREOFFICE_RPM_URL=https://nexus.alfresco.com/nexus/service/local/repositories/thirdparty/content/org/libreoffice/libreoffice-dist/5.4.6/libreoffice-dist-5.4.6-linux.gz -ENV LIBREOFFICE_LICENSE_FILE=https://github.com/Alfresco/acs-community-packaging/blob/master/zip/src/main/resources/licenses/3rd-party/libreoffice.txt +ENV LIBREOFFICE_LICENSE_FILE=https://github.com/Alfresco/acs-community-packaging/blob/master/distribution/src/main/resources/licenses/3rd-party/libreoffice.txt COPY target/alfresco-docker-libreoffice-${env.project_version}.jar /usr/bin From 419d71bfbffe5b4b98e8dba122dd95394baa3786 Mon Sep 17 00:00:00 2001 From: Alan Davis Date: Tue, 3 Apr 2018 14:10:48 +0100 Subject: [PATCH 4/5] REPO-3264 Typo correction LiberOffice -> LibreOffice --- .../src/main/resources/templates/transformForm.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alfresco-docker-libreoffice/src/main/resources/templates/transformForm.html b/alfresco-docker-libreoffice/src/main/resources/templates/transformForm.html index b7e62be9..7353bc5b 100644 --- a/alfresco-docker-libreoffice/src/main/resources/templates/transformForm.html +++ b/alfresco-docker-libreoffice/src/main/resources/templates/transformForm.html @@ -6,7 +6,7 @@
-

LiberOffice Test Transformation

+

LibreOffice Test Transformation

From a0dd60d6a6b930e30862f18ed714bdc6c886e891 Mon Sep 17 00:00:00 2001 From: Alan Davis Date: Mon, 9 Apr 2018 06:57:53 +0100 Subject: [PATCH 5/5] REPO-3422 Startup check for LibreOffice Also included the transformer name on the log and error pages. --- .../AlfrescoPdfRendererController.java | 6 ++ .../resources/templates/transformForm.html | 4 -- .../transformer/ImageMagickController.java | 6 ++ .../resources/templates/transformForm.html | 4 -- .../transformer/LibreOfficeController.java | 18 ++++++ .../resources/templates/transformForm.html | 4 -- .../base/AbstractTransformerController.java | 43 +++++++++++-- .../alfresco/transformer/base/LogEntry.java | 37 ++++++++++- .../src/main/resources/templates/error.html | 17 +++++ .../src/main/resources/templates/log.html | 63 +++++++++---------- 10 files changed, 152 insertions(+), 50 deletions(-) create mode 100644 alfresco-transformer-base/src/main/resources/templates/error.html diff --git a/alfresco-docker-alfresco-pdf-renderer/src/main/java/org/alfresco/transformer/AlfrescoPdfRendererController.java b/alfresco-docker-alfresco-pdf-renderer/src/main/java/org/alfresco/transformer/AlfrescoPdfRendererController.java index cedddfd7..cbf1815f 100644 --- a/alfresco-docker-alfresco-pdf-renderer/src/main/java/org/alfresco/transformer/AlfrescoPdfRendererController.java +++ b/alfresco-docker-alfresco-pdf-renderer/src/main/java/org/alfresco/transformer/AlfrescoPdfRendererController.java @@ -66,6 +66,12 @@ public class AlfrescoPdfRendererController extends AbstractTransformerController setCheckCommand(createCheckCommand()); } + @Override + protected String getTransformerName() + { + return "Alfresco PDF Renderer"; + } + private static RuntimeExec createTransformCommand() { RuntimeExec runtimeExec = new RuntimeExec(); diff --git a/alfresco-docker-alfresco-pdf-renderer/src/main/resources/templates/transformForm.html b/alfresco-docker-alfresco-pdf-renderer/src/main/resources/templates/transformForm.html index 5f6b20ea..f142aeee 100644 --- a/alfresco-docker-alfresco-pdf-renderer/src/main/resources/templates/transformForm.html +++ b/alfresco-docker-alfresco-pdf-renderer/src/main/resources/templates/transformForm.html @@ -1,10 +1,6 @@ -
-

-

-

Alfresco PDF Renderer Test Transformation

diff --git a/alfresco-docker-imagemagick/src/main/java/org/alfresco/transformer/ImageMagickController.java b/alfresco-docker-imagemagick/src/main/java/org/alfresco/transformer/ImageMagickController.java index 2b1c0285..837b77ff 100644 --- a/alfresco-docker-imagemagick/src/main/java/org/alfresco/transformer/ImageMagickController.java +++ b/alfresco-docker-imagemagick/src/main/java/org/alfresco/transformer/ImageMagickController.java @@ -71,6 +71,12 @@ public class ImageMagickController extends AbstractTransformerController setCheckCommand(createCheckCommand()); } + @Override + protected String getTransformerName() + { + return "ImageMagick"; + } + private static RuntimeExec createTransformCommand() { RuntimeExec runtimeExec = new RuntimeExec(); diff --git a/alfresco-docker-imagemagick/src/main/resources/templates/transformForm.html b/alfresco-docker-imagemagick/src/main/resources/templates/transformForm.html index b849eee4..a33c40d9 100644 --- a/alfresco-docker-imagemagick/src/main/resources/templates/transformForm.html +++ b/alfresco-docker-imagemagick/src/main/resources/templates/transformForm.html @@ -1,10 +1,6 @@ -
-

-

-

ImageMagick Test Transformation

diff --git a/alfresco-docker-libreoffice/src/main/java/org/alfresco/transformer/LibreOfficeController.java b/alfresco-docker-libreoffice/src/main/java/org/alfresco/transformer/LibreOfficeController.java index 0cdc3b3d..5378a56a 100644 --- a/alfresco-docker-libreoffice/src/main/java/org/alfresco/transformer/LibreOfficeController.java +++ b/alfresco-docker-libreoffice/src/main/java/org/alfresco/transformer/LibreOfficeController.java @@ -96,6 +96,24 @@ public class LibreOfficeController extends AbstractTransformerController this.jodconverter = jodconverter; } + @Override + protected String getTransformerName() + { + return "LibreOffice"; + } + + @Override + protected String version() + { + // This method is simply used to check the availability in the case of LibreOffice. + if (!jodconverter.isAvailable()) + { + throw new TransformException(500, "LibreOffice is not yet available"); + } + + return "LibreOffice available"; + } + @PostMapping("/transform") public ResponseEntity transform(HttpServletRequest request, @RequestParam("file") MultipartFile sourceMultipartFile, diff --git a/alfresco-docker-libreoffice/src/main/resources/templates/transformForm.html b/alfresco-docker-libreoffice/src/main/resources/templates/transformForm.html index 7353bc5b..40667bf7 100644 --- a/alfresco-docker-libreoffice/src/main/resources/templates/transformForm.html +++ b/alfresco-docker-libreoffice/src/main/resources/templates/transformForm.html @@ -1,10 +1,6 @@ -
-

-

-

LibreOffice Test Transformation

diff --git a/alfresco-transformer-base/src/main/java/org/alfresco/transformer/base/AbstractTransformerController.java b/alfresco-transformer-base/src/main/java/org/alfresco/transformer/base/AbstractTransformerController.java index 4a917733..8b0dfef0 100644 --- a/alfresco-transformer-base/src/main/java/org/alfresco/transformer/base/AbstractTransformerController.java +++ b/alfresco-transformer-base/src/main/java/org/alfresco/transformer/base/AbstractTransformerController.java @@ -108,9 +108,11 @@ public abstract class AbstractTransformerController logger.info(""); } + protected abstract String getTransformerName(); + @RequestMapping("/version") @ResponseBody - String version() + protected String version() { String version = "Version not checked"; if (checkCommand != null) @@ -140,6 +142,7 @@ public abstract class AbstractTransformerController @GetMapping("/log") public String log(Model model) { + model.addAttribute("title", getTransformerName() + " Log Entries"); Collection log = LogEntry.getLog(); if (!log.isEmpty()) { @@ -148,9 +151,16 @@ public abstract class AbstractTransformerController return "log"; // the name of the template } + @GetMapping("/error") + public String error() + { + return "error"; // the name of the template + } + @ExceptionHandler(TypeMismatchException.class) public void handleParamsTypeMismatch(HttpServletResponse response, MissingServletRequestParameterException e) throws IOException { + String transformerName = getTransformerName(); String name = e.getParameterName(); String message = "Request parameter " + name + " is of the wrong type"; int statusCode = 400; @@ -162,12 +172,13 @@ public abstract class AbstractTransformerController LogEntry.setStatusCodeAndMessage(statusCode, message); - response.sendError(statusCode, message); + response.sendError(statusCode, transformerName+" - "+message); } @ExceptionHandler(MissingServletRequestParameterException.class) public void handleMissingParams(HttpServletResponse response, MissingServletRequestParameterException e) throws IOException { + String transformerName = getTransformerName(); String name = e.getParameterName(); String message = "Request parameter " + name + " is missing"; int statusCode = 400; @@ -179,12 +190,13 @@ public abstract class AbstractTransformerController LogEntry.setStatusCodeAndMessage(statusCode, message); - response.sendError(statusCode, message); + response.sendError(statusCode, transformerName+" - "+message); } @ExceptionHandler(TransformException.class) public void transformExceptionWithMessage(HttpServletResponse response, TransformException e) throws IOException { + String transformerName = getTransformerName(); String message = e.getMessage(); int statusCode = e.getStatusCode(); @@ -195,9 +207,32 @@ public abstract class AbstractTransformerController LogEntry.setStatusCodeAndMessage(statusCode, message); - response.sendError(statusCode, message); + // Forced to include the transformer name in the message (see commented out version of this method) + response.sendError(statusCode, transformerName+" - "+message); } + // Results in HTML rather than json but there is an error in the log about "template might not exist or might + // not be accessible by any of the configured Template Resolvers" for the transformer.html (which is correct + // because that failed). Looks like Spring only supports returning json or XML when returning an Object or even + // a ResponseEntity without this logged exception, which is a shame as it would have been nicer to have just + // added the transformerName to the Object. +// @ExceptionHandler(TransformException.class) +// public final Map transformExceptionWithMessage(HttpServletResponse response, TransformException e, WebRequest request) +// { +// String transformerName = getTransformerName(); +// String message = e.getMessage(); +// int statusCode = e.getStatusCode(); +// +// LogEntry.setStatusCodeAndMessage(statusCode, message); +// +// Map errorAttributes = new HashMap<>(); +// errorAttributes.put("title", transformerName); +// errorAttributes.put("message", message); +// errorAttributes.put("status", Integer.toString(statusCode)); +// errorAttributes.put("error", HttpStatus.valueOf(statusCode).getReasonPhrase()); +// return errorAttributes; +// } + protected String createTargetFileName(MultipartFile sourceMultipartFile, String targetExtension) { String targetFilename = null; diff --git a/alfresco-transformer-base/src/main/java/org/alfresco/transformer/base/LogEntry.java b/alfresco-transformer-base/src/main/java/org/alfresco/transformer/base/LogEntry.java index 49358340..d8600320 100644 --- a/alfresco-transformer-base/src/main/java/org/alfresco/transformer/base/LogEntry.java +++ b/alfresco-transformer-base/src/main/java/org/alfresco/transformer/base/LogEntry.java @@ -25,7 +25,10 @@ */ package org.alfresco.transformer.base; -import java.util.*; +import java.text.SimpleDateFormat; +import java.util.Collection; +import java.util.Date; +import java.util.Deque; import java.util.concurrent.ConcurrentLinkedDeque; import java.util.concurrent.atomic.AtomicInteger; @@ -40,6 +43,7 @@ public class LogEntry private static final AtomicInteger count = new AtomicInteger(0); private static final Deque log = new ConcurrentLinkedDeque<>(); private static final int MAX_LOG_SIZE = 10; + private static final SimpleDateFormat HH_MM_SS = new SimpleDateFormat("HH:mm:ss"); private static ThreadLocal currentLogEntry = new ThreadLocal() { @@ -71,6 +75,32 @@ public class LogEntry private String options; private String message; + @Override + public String toString() + { + StringBuilder sb = new StringBuilder(); + sb.append(getId()); + sb.append(' '); + sb.append(HH_MM_SS.format(getDate())); + sb.append(' '); + sb.append(getStatusCode()); + sb.append(' '); + sb.append(getDuration()); + sb.append(' '); + sb.append(getSource()); + sb.append(' '); + sb.append(getSourceSize()); + sb.append(' '); + sb.append(getTarget()); + sb.append(' '); + sb.append(getTargetSize()); + sb.append(' '); + sb.append(getOptions()); + sb.append(' '); + sb.append(getMessage()); + return sb.toString(); + } + public static Collection getLog() { return log; @@ -127,6 +157,11 @@ public class LogEntry LogEntry logEntry = currentLogEntry.get(); logEntry.durationStreamOut = System.currentTimeMillis() - logEntry.start - logEntry.durationStreamIn - logEntry.durationTransform; currentLogEntry.remove(); + + if (AbstractTransformerController.logger != null && AbstractTransformerController.logger.isDebugEnabled()) + { + AbstractTransformerController.logger.debug(logEntry.toString()); + } } public int getId() diff --git a/alfresco-transformer-base/src/main/resources/templates/error.html b/alfresco-transformer-base/src/main/resources/templates/error.html new file mode 100644 index 00000000..b6cd4be7 --- /dev/null +++ b/alfresco-transformer-base/src/main/resources/templates/error.html @@ -0,0 +1,17 @@ + + + +
+

+

+

+
+ + + + + diff --git a/alfresco-transformer-base/src/main/resources/templates/log.html b/alfresco-transformer-base/src/main/resources/templates/log.html index 5c9a1a2b..856c5dd1 100644 --- a/alfresco-transformer-base/src/main/resources/templates/log.html +++ b/alfresco-transformer-base/src/main/resources/templates/log.html @@ -1,41 +1,38 @@ -
-

+
+

+
+

file *
+ + + + + + + + + + + + + + + + + + + + + + + + +
IdTimeStatus CodeDuration (ms)SourceTargetOptionsMessage
+
-

Log entries

-
- - - - - - - - - - - - - - - - - - - - - - - - - -
IdTimeStatus CodeDuration (ms)SourceTargetOptionsMessage
-
- -