├── .gitignore ├── LICENSE ├── README.md ├── admin-console-sm.png ├── alfresco-systemmessages-integration-tests ├── pom.xml └── src │ └── test │ └── java │ └── com │ └── redpill_linpro │ └── alfresco │ └── repo │ └── systemmessages │ └── ListExistsComponentIT.java ├── alfresco-systemmessages-platform-docker ├── pom.xml └── src │ └── main │ └── docker │ ├── Dockerfile │ ├── alfresco-global.properties │ ├── dev-log4j.properties │ ├── disable-webscript-caching-context.xml │ ├── hotswap-agent.properties │ └── license │ └── README.md ├── alfresco-systemmessages-platform ├── pom.xml └── src │ └── main │ ├── assembly │ ├── amp.xml │ └── file-mapping.properties │ ├── java │ └── com │ │ └── redpill_linpro │ │ └── alfresco │ │ └── repo │ │ └── systemmessages │ │ ├── bean │ │ └── SystemNotificationBean.java │ │ ├── model │ │ └── SystemMessagesModel.java │ │ ├── service │ │ ├── SystemMessagesService.java │ │ └── SystemMessagesServiceImpl.java │ │ └── webscript │ │ ├── DeleteNode.java │ │ ├── GetDataList.java │ │ └── SystemMessagesGet.java │ └── resources │ └── alfresco │ ├── extension │ └── templates │ │ └── webscripts │ │ └── com │ │ └── redpill-linpro │ │ └── notifications │ │ ├── node.delete.desc.xml │ │ ├── node.delete.json.ftl │ │ ├── notifications-datalist.get.desc.xml │ │ ├── notifications-datalist.get.json.ftl │ │ ├── notifications.get.desc.xml │ │ └── notifications.get.json.ftl │ └── module │ └── alfresco-systemmessages-platform │ ├── alfresco-global.properties │ ├── bootstrap │ └── system-messages-list.xml │ ├── context │ ├── bootstrap-context.xml │ ├── service-context.xml │ └── webscript-context.xml │ ├── messages │ ├── sm-patch-service.properties │ ├── systemmessages-model.properties │ ├── systemmessages-model_fr.properties │ └── systemmessages-model_sv.properties │ ├── model │ └── systemmessages-model.xml │ ├── module-context.xml │ └── module.properties ├── alfresco-systemmessages-share-docker ├── pom.xml └── src │ └── main │ └── docker │ ├── Dockerfile │ ├── hotswap-agent.properties │ ├── log4j.properties │ └── share-config-custom.xml ├── alfresco-systemmessages-share ├── pom.xml └── src │ └── main │ ├── assembly │ ├── amp.xml │ └── file-mapping.properties │ ├── java │ └── com │ │ └── redpill_linpro │ │ └── alfresco │ │ └── systemmessages │ │ └── share │ │ └── evaluator │ │ └── IsAdmin.java │ └── resources │ ├── META-INF │ └── redpill │ │ └── components │ │ ├── global │ │ ├── notifications.css │ │ ├── notifications.js │ │ └── notifications.min.js │ │ └── system-messages │ │ ├── system-messages-admin.js │ │ └── system-messages-admin.min.js │ └── alfresco │ ├── module │ └── alfresco-systemmessages-share │ │ └── module.properties │ └── web-extension │ ├── messages │ ├── systemmessages_en.properties │ ├── systemmessages_fr.properties │ └── systemmessages_sv.properties │ ├── site-data │ └── extensions │ │ └── systemmessages-module.xml │ ├── site-webscripts │ └── com │ │ └── redpill-linpro │ │ ├── global │ │ └── alfresco │ │ │ └── components │ │ │ └── head │ │ │ └── resources.get.html.ftl │ │ └── system-messages │ │ ├── system-messages-admin.get.desc.xml │ │ ├── system-messages-admin.get.html.ftl │ │ └── system-messages-admin.get.js │ ├── systemmessages-context.xml │ └── systemmessages-datalist-config.xml ├── all-pages-sm.png ├── docker └── docker-compose.yml ├── pom.xml ├── run.bat └── run.sh /.gitignore: -------------------------------------------------------------------------------- 1 | *.class 2 | .idea 3 | *.iml 4 | .project 5 | .settings 6 | .classpath 7 | target 8 | alf_data_dev 9 | bin 10 | 11 | # Ignoring backup files that mergetool meld creates 12 | *.LOCAL.* 13 | *.BASE.* 14 | *.BACKUP.* 15 | *.REMOTE.* 16 | *.orig 17 | 18 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 19 | hs_err_pid* 20 | *.log 21 | deploy-share.sh 22 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU LESSER GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | 9 | This version of the GNU Lesser General Public License incorporates 10 | the terms and conditions of version 3 of the GNU General Public 11 | License, supplemented by the additional permissions listed below. 12 | 13 | 0. Additional Definitions. 14 | 15 | As used herein, "this License" refers to version 3 of the GNU Lesser 16 | General Public License, and the "GNU GPL" refers to version 3 of the GNU 17 | General Public License. 18 | 19 | "The Library" refers to a covered work governed by this License, 20 | other than an Application or a Combined Work as defined below. 21 | 22 | An "Application" is any work that makes use of an interface provided 23 | by the Library, but which is not otherwise based on the Library. 24 | Defining a subclass of a class defined by the Library is deemed a mode 25 | of using an interface provided by the Library. 26 | 27 | A "Combined Work" is a work produced by combining or linking an 28 | Application with the Library. The particular version of the Library 29 | with which the Combined Work was made is also called the "Linked 30 | Version". 31 | 32 | The "Minimal Corresponding Source" for a Combined Work means the 33 | Corresponding Source for the Combined Work, excluding any source code 34 | for portions of the Combined Work that, considered in isolation, are 35 | based on the Application, and not on the Linked Version. 36 | 37 | The "Corresponding Application Code" for a Combined Work means the 38 | object code and/or source code for the Application, including any data 39 | and utility programs needed for reproducing the Combined Work from the 40 | Application, but excluding the System Libraries of the Combined Work. 41 | 42 | 1. Exception to Section 3 of the GNU GPL. 43 | 44 | You may convey a covered work under sections 3 and 4 of this License 45 | without being bound by section 3 of the GNU GPL. 46 | 47 | 2. Conveying Modified Versions. 48 | 49 | If you modify a copy of the Library, and, in your modifications, a 50 | facility refers to a function or data to be supplied by an Application 51 | that uses the facility (other than as an argument passed when the 52 | facility is invoked), then you may convey a copy of the modified 53 | version: 54 | 55 | a) under this License, provided that you make a good faith effort to 56 | ensure that, in the event an Application does not supply the 57 | function or data, the facility still operates, and performs 58 | whatever part of its purpose remains meaningful, or 59 | 60 | b) under the GNU GPL, with none of the additional permissions of 61 | this License applicable to that copy. 62 | 63 | 3. Object Code Incorporating Material from Library Header Files. 64 | 65 | The object code form of an Application may incorporate material from 66 | a header file that is part of the Library. You may convey such object 67 | code under terms of your choice, provided that, if the incorporated 68 | material is not limited to numerical parameters, data structure 69 | layouts and accessors, or small macros, inline functions and templates 70 | (ten or fewer lines in length), you do both of the following: 71 | 72 | a) Give prominent notice with each copy of the object code that the 73 | Library is used in it and that the Library and its use are 74 | covered by this License. 75 | 76 | b) Accompany the object code with a copy of the GNU GPL and this license 77 | document. 78 | 79 | 4. Combined Works. 80 | 81 | You may convey a Combined Work under terms of your choice that, 82 | taken together, effectively do not restrict modification of the 83 | portions of the Library contained in the Combined Work and reverse 84 | engineering for debugging such modifications, if you also do each of 85 | the following: 86 | 87 | a) Give prominent notice with each copy of the Combined Work that 88 | the Library is used in it and that the Library and its use are 89 | covered by this License. 90 | 91 | b) Accompany the Combined Work with a copy of the GNU GPL and this license 92 | document. 93 | 94 | c) For a Combined Work that displays copyright notices during 95 | execution, include the copyright notice for the Library among 96 | these notices, as well as a reference directing the user to the 97 | copies of the GNU GPL and this license document. 98 | 99 | d) Do one of the following: 100 | 101 | 0) Convey the Minimal Corresponding Source under the terms of this 102 | License, and the Corresponding Application Code in a form 103 | suitable for, and under terms that permit, the user to 104 | recombine or relink the Application with a modified version of 105 | the Linked Version to produce a modified Combined Work, in the 106 | manner specified by section 6 of the GNU GPL for conveying 107 | Corresponding Source. 108 | 109 | 1) Use a suitable shared library mechanism for linking with the 110 | Library. A suitable mechanism is one that (a) uses at run time 111 | a copy of the Library already present on the user's computer 112 | system, and (b) will operate properly with a modified version 113 | of the Library that is interface-compatible with the Linked 114 | Version. 115 | 116 | e) Provide Installation Information, but only if you would otherwise 117 | be required to provide such information under section 6 of the 118 | GNU GPL, and only to the extent that such information is 119 | necessary to install and execute a modified version of the 120 | Combined Work produced by recombining or relinking the 121 | Application with a modified version of the Linked Version. (If 122 | you use option 4d0, the Installation Information must accompany 123 | the Minimal Corresponding Source and Corresponding Application 124 | Code. If you use option 4d1, you must provide the Installation 125 | Information in the manner specified by section 6 of the GNU GPL 126 | for conveying Corresponding Source.) 127 | 128 | 5. Combined Libraries. 129 | 130 | You may place library facilities that are a work based on the 131 | Library side by side in a single library together with other library 132 | facilities that are not Applications and are not covered by this 133 | License, and convey such a combined library under terms of your 134 | choice, if you do both of the following: 135 | 136 | a) Accompany the combined library with a copy of the same work based 137 | on the Library, uncombined with any other library facilities, 138 | conveyed under the terms of this License. 139 | 140 | b) Give prominent notice with the combined library that part of it 141 | is a work based on the Library, and explaining where to find the 142 | accompanying uncombined form of the same work. 143 | 144 | 6. Revised Versions of the GNU Lesser General Public License. 145 | 146 | The Free Software Foundation may publish revised and/or new versions 147 | of the GNU Lesser General Public License from time to time. Such new 148 | versions will be similar in spirit to the present version, but may 149 | differ in detail to address new problems or concerns. 150 | 151 | Each version is given a distinguishing version number. If the 152 | Library as you received it specifies that a certain numbered version 153 | of the GNU Lesser General Public License "or any later version" 154 | applies to it, you have the option of following the terms and 155 | conditions either of that published version or of any later version 156 | published by the Free Software Foundation. If the Library as you 157 | received it does not specify a version number of the GNU Lesser 158 | General Public License, you may choose any version of the GNU Lesser 159 | General Public License ever published by the Free Software Foundation. 160 | 161 | If the Library as you received it specifies that a proxy can decide 162 | whether future versions of the GNU Lesser General Public License shall 163 | apply, that proxy's public statement of acceptance of any version is 164 | permanent authorization for you to choose that version for the 165 | Library. 166 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Alfresco System Messages 2 | ============================================= 3 | 4 | This module is sponsored by Redpill Linpro AB - http://www.redpill-linpro.com. 5 | 6 | Description 7 | ----------- 8 | This project contains some tools for displaying system wide messages to users. Example usage when system is going down for maintenance 9 | 10 | 11 | ![Add a message](https://github.com/Redpill-Linpro/alfresco-systemmessages/blob/master/admin-console-sm.png) 12 | 13 | Depending on priority different colours will be used for the message. 14 | 15 | ![How its presented](https://github.com/Redpill-Linpro/alfresco-systemmessages/blob/master/all-pages-sm.png) 16 | 17 | Structure 18 | ------------ 19 | 20 | The project consists of a repository module and a share module packaged as jar files. 21 | 22 | Building & Installation 23 | ------------ 24 | UPDATE IS NEEDED. THIS IS NOT CURRENT! 25 | 26 | The build produces several jar files. Attach them to your own maven project using dependencies or put them under tomcat/shared/lib. Amp files are also produced if you prefer this installation type. 27 | 28 | SDK 1 and SDK 2 29 | 30 | For inclusion in an pre Alfresco 5.1 (pre SDK3) project use the pre 2.0-versions of the jar-files, navigate to our support-branch for this and follow instructions in the README.md file: https://github.com/Redpill-Linpro/alfresco-systemmessages/tree/support/pre-5.x-support 31 | 32 | SDK 3 33 | 34 | Platform/Repository module (parent pom): 35 | ```xml 36 | 37 | com.redpill-linpro.alfresco 38 | alfresco-systemmessages-platform 39 | 2.0.1 40 | 41 | ``` 42 | 43 | Share module (parent pom): 44 | ```xml 45 | 46 | com.redpill-linpro.alfresco 47 | alfresco-systemmessages-share 48 | 2.0.1 49 | 50 | ``` 51 | The artifacts are deployed to the Maven Central Repository and can be downloaded from there as well. 52 | 53 | 54 | License 55 | ------- 56 | 57 | This application is licensed under the LGPLv3 License. See the [LICENSE file](LICENSE) for details. 58 | 59 | Authors 60 | ------- 61 | 62 | Erik Billerby - Redpill Linpro AB 63 | Magnus Pedersen - Redpill Linpro AB 64 | -------------------------------------------------------------------------------- /admin-console-sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Redpill-Linpro/alfresco-systemmessages/ad88946f0c782e6cad00ca0b3c173722ee67efcc/admin-console-sm.png -------------------------------------------------------------------------------- /alfresco-systemmessages-integration-tests/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | alfresco-systemmessages-integration-tests 6 | Integration Tests Module 7 | Integration Tests module for in-container integration testing - part of AIO - SDK 4.7 8 | jar 10 | 11 | 12 | com.redpill-linpro.alfresco 13 | alfresco-systemmessages 14 | 4.0 15 | 16 | 17 | 18 | 19 | 20 | 21 | 23 | 24 | com.redpill-linpro.alfresco 25 | alfresco-systemmessages-platform 26 | 4.0 27 | test 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | src/test/resources 36 | true 37 | 38 | 39 | 40 | 41 | 42 | 43 | org.zeroturnaround 44 | jrebel-maven-plugin 45 | 46 | ${project.build.testOutputDirectory} 47 | 48 | 49 | 50 | 51 | 52 | org.apache.maven.plugins 53 | maven-jar-plugin 54 | 55 | 56 | 57 | test-jar 58 | 59 | 60 | 61 | 62 | 63 | 65 | 66 | org.apache.maven.plugins 67 | maven-failsafe-plugin 68 | 69 | 70 | ${test.acs.endpoint.path} 71 | 72 | 73 | 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /alfresco-systemmessages-integration-tests/src/test/java/com/redpill_linpro/alfresco/repo/systemmessages/ListExistsComponentIT.java: -------------------------------------------------------------------------------- 1 | package com.redpill_linpro.alfresco.repo.systemmessages; 2 | 3 | import static org.junit.Assert.assertEquals; 4 | 5 | import java.util.List; 6 | 7 | import org.alfresco.rad.test.AbstractAlfrescoIT; 8 | import org.alfresco.rad.test.AlfrescoTestRunner; 9 | import org.alfresco.service.cmr.repository.NodeRef; 10 | import org.alfresco.service.cmr.repository.StoreRef; 11 | import org.junit.Test; 12 | import org.junit.runner.RunWith; 13 | 14 | import com.redpill_linpro.alfresco.repo.systemmessages.webscript.GetDataList; 15 | 16 | /** 17 | * Tests if the systemmessages datalist is bootstrapped correctly. 18 | * 19 | * @author Erik Billerby 20 | * 21 | */ 22 | 23 | @RunWith(value = AlfrescoTestRunner.class) 24 | public class ListExistsComponentIT extends AbstractAlfrescoIT { 25 | 26 | @Test 27 | public void testCreateDataListPatch() throws Exception { 28 | 29 | List result = getServiceRegistry().getSearchService().selectNodes(getServiceRegistry().getNodeService().getRootNode(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE), GetDataList.DATALIST_PATH + "/" + GetDataList.SYSTEM_MESSAGES_DL_NAME, null, getServiceRegistry().getNamespaceService(), false); 30 | assertEquals(1, result.size()); 31 | 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /alfresco-systemmessages-platform-docker/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | alfresco-systemmessages-platform-docker 6 | Alfresco Platform/Repository Docker Module 7 | Platform/Repo Docker Module to generate the final Docker image 8 | jar 9 | 10 | 11 | com.redpill-linpro.alfresco 12 | alfresco-systemmessages 13 | 4.0 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | com.redpill-linpro.alfresco 22 | alfresco-systemmessages-platform 23 | 4.0 24 | 25 | 26 | com.redpill-linpro.alfresco 27 | alfresco-systemmessages-integration-tests 28 | 4.0 29 | test 30 | tests 31 | 32 | 33 | 44 | 45 | 46 | 47 | 48 | 49 | org.apache.maven.plugins 50 | maven-dependency-plugin 51 | 52 | 53 | 54 | collect-test-artifacts 55 | pre-integration-test 56 | 57 | copy-dependencies 58 | 59 | 60 | ${project.build.directory}/extensions 61 | compile 62 | 63 | 64 | 65 | 66 | collect-extensions 67 | package 68 | 69 | copy-dependencies 70 | 71 | 72 | ${project.build.directory}/extensions 73 | runtime 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | org.apache.maven.plugins 82 | maven-resources-plugin 83 | 84 | 85 | copy-and-filter-docker-resources 86 | validate 87 | 88 | copy-resources 89 | 90 | 91 | ${project.build.directory} 92 | 93 | 94 | src/main/docker 95 | true 96 | 97 | **/*.jar 98 | **/*.so 99 | **/*.gz 100 | 101 | 102 | 103 | 104 | 105 | 106 | copy-and-filter-docker-resources-non-filtered 107 | validate 108 | 109 | copy-resources 110 | 111 | 112 | ${project.build.directory} 113 | 114 | 115 | src/main/docker 116 | false 117 | 118 | **/*.jar 119 | **/*.so 120 | **/*.gz 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | -------------------------------------------------------------------------------- /alfresco-systemmessages-platform-docker/src/main/docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ${docker.acs.image}:${alfresco.platform.version} 2 | 3 | ARG TOMCAT_DIR=/usr/local/tomcat 4 | ARG USERNAME=${alfresco.platform.docker.user} 5 | 6 | USER root 7 | 8 | # Copy Dockerfile to avoid an error if no JARs exist 9 | COPY Dockerfile extensions/*.jar $TOMCAT_DIR/webapps/alfresco/WEB-INF/lib/ 10 | 11 | # Copy Dockerfile to avoid an error if no AMPs exist 12 | COPY Dockerfile extensions/*.amp $TOMCAT_DIR/amps/ 13 | RUN java -jar $TOMCAT_DIR/alfresco-mmt/alfresco-mmt*.jar install \ 14 | $TOMCAT_DIR/amps $TOMCAT_DIR/webapps/alfresco -directory -nobackup -force 15 | 16 | COPY alfresco-global.properties $TOMCAT_DIR/shared/classes/alfresco-global.properties 17 | COPY dev-log4j.properties $TOMCAT_DIR/shared/classes/alfresco/extension 18 | COPY disable-webscript-caching-context.xml $TOMCAT_DIR/shared/classes/alfresco/extension 19 | 20 | # Copy Dockerfile to avoid an error if no license file exists 21 | COPY Dockerfile license/*.* $TOMCAT_DIR/webapps/alfresco/WEB-INF/classes/alfresco/extension/license/ 22 | 23 | USER ${USERNAME} -------------------------------------------------------------------------------- /alfresco-systemmessages-platform-docker/src/main/docker/alfresco-global.properties: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # RUN TIME PROPERTIES 16 | # ------------------- 17 | 18 | # 19 | # Alfresco configuration for running locally with PostgreSQL Database 20 | # 21 | # Configuration when running Tomcat embedded from Maven. 22 | # Property values from the POM but it can also be edited here. 23 | # 24 | 25 | # Alfresco Repo Webapp (alfresco.war) context, ports etc 26 | alfresco.context=alfresco 27 | alfresco.host=localhost 28 | alfresco.port=8080 29 | alfresco.protocol=http 30 | 31 | # Alfresco Share Webapp (share.war) context, ports etc 32 | share.context=share 33 | share.host=localhost 34 | share.port=8180 35 | share.protocol=http 36 | 37 | # Don't try and recover any index 38 | index.recovery.mode=NONE 39 | 40 | # These jobs seem to require Lucene (Unsupported Operation with Solr) so we disable them / set to future date 41 | # See https://forums.alfresco.com/en/viewtopic.php?f=52&t=41597 42 | # If you want to enable them (and so full WQS functionality), please also set index.subsystem.name=lucene 43 | wcmqs.dynamicCollectionProcessor.schedule=0 30 2 * * ? 2060 44 | wcmqs.feedbackProcessor.schedule=0 40 2 * * ? 2060 45 | wcmqs.publishQueueProcessor.schedule=0 50 2 * * ? 2060 46 | 47 | # Fail or not when there are node integrity checker errors 48 | integrity.failOnError=true 49 | 50 | # Alfresco Repository PostgreSQL Database configuration. 51 | # The PostgreSQL Driver is brought in via the tomcat7-maven-plugin as a dependency. 52 | db.driver=org.postgresql.Driver 53 | 54 | # This Alfresco Platform Configuration file should be used for custom properties that are introduced by this module. 55 | # Define default values for all properties here. 56 | # System Administrators can override these values in environment specific configurations in 57 | # alfresco/tomcat/shared/classes/alfresco-global.properties. 58 | # 59 | index.subsystem.name=solr6 60 | solr.host=alfresco-systemmessages-ass 61 | solr.port=8983 62 | solr.secureComms=secret 63 | solr.sharedSecret=secret 64 | 65 | db.username=alfresco 66 | db.password=alfresco 67 | db.pool.initial=10 68 | db.pool.max=100 69 | 70 | db.url=jdbc:postgresql://alfresco-systemmessages-postgres:5432/alfresco 71 | 72 | # File servers related properties 73 | # For local runs we disable CIFS and FTP 74 | cifs.enabled=false 75 | ftp.enabled=false 76 | 77 | csrf.filter.enabled=false 78 | 79 | # Embedded broker without persistence 80 | messaging.broker.url=vm://localhost?broker.persistent=false 81 | 82 | # Disable ATS 83 | transform.service.enabled=false 84 | local.transform.service.enabled=false 85 | legacy.transform.service.enabled=false 86 | -------------------------------------------------------------------------------- /alfresco-systemmessages-platform-docker/src/main/docker/dev-log4j.properties: -------------------------------------------------------------------------------- 1 | # Set root logger level to error 2 | log4j.rootLogger=error, Console, File 3 | 4 | 5 | # All outputs currently set to be a ConsoleAppender. 6 | log4j.appender.Console=org.apache.log4j.ConsoleAppender 7 | log4j.appender.Console.layout=org.apache.log4j.PatternLayout 8 | 9 | # use log4j NDC to replace %x with tenant domain / username 10 | log4j.appender.Console.layout.ConversionPattern=%d{ISO8601} %x %-5p [%c{3}] [%t] %m%n 11 | #log4j.appender.Console.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c] %m%n 12 | 13 | log4j.appender.File=org.apache.log4j.DailyRollingFileAppender 14 | log4j.appender.File.File=logs/alfresco.log 15 | log4j.appender.File.Append=true 16 | log4j.appender.File.DatePattern='.'yyyy-MM-dd 17 | log4j.appender.File.layout=org.apache.log4j.PatternLayout 18 | log4j.appender.File.layout.ConversionPattern=%d{yyyy-MM-dd} %d{ABSOLUTE} %-5p [%c] [%t] %m%n 19 | 20 | #log4j.appender.file=org.apache.log4j.FileAppender 21 | #log4j.appender.file.File=hibernate.log 22 | #log4j.appender.file.layout=org.apache.log4j.PatternLayout 23 | #log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n 24 | 25 | 26 | # Commented-in loggers will be exposed as JMX MBeans (refer to org.alfresco.repo.admin.Log4JHierarchyInit) 27 | # Hence, generally useful loggers should be listed with at least ERROR level to allow simple runtime 28 | # control of the level via a suitable JMX Console. Also, any other loggers can be added transiently via 29 | # Log4j addLoggerMBean as long as the logger exists and has been loaded. 30 | 31 | # Hibernate 32 | log4j.logger.org.hibernate=error 33 | log4j.logger.org.hibernate.util.JDBCExceptionReporter=fatal 34 | log4j.logger.org.hibernate.event.def.AbstractFlushingEventListener=fatal 35 | log4j.logger.org.hibernate.type=warn 36 | log4j.logger.org.hibernate.cfg.SettingsFactory=warn 37 | 38 | # Spring 39 | log4j.logger.org.springframework=warn 40 | # Turn off Spring remoting warnings that should really be info or debug. 41 | log4j.logger.org.springframework.remoting.support=error 42 | log4j.logger.org.springframework.util=error 43 | 44 | # Axis/WSS4J 45 | log4j.logger.org.apache.axis=info 46 | log4j.logger.org.apache.ws=info 47 | 48 | # CXF 49 | log4j.logger.org.apache.cxf=error 50 | 51 | # MyFaces 52 | log4j.logger.org.apache.myfaces.util.DebugUtils=info 53 | log4j.logger.org.apache.myfaces.el.VariableResolverImpl=error 54 | log4j.logger.org.apache.myfaces.application.jsp.JspViewHandlerImpl=error 55 | log4j.logger.org.apache.myfaces.taglib=error 56 | 57 | # OpenOfficeConnection 58 | log4j.logger.net.sf.jooreports.openoffice.connection=fatal 59 | 60 | # log prepared statement cache activity log4j.logger.org.hibernate.ps.PreparedStatementCache=info 61 | 62 | # Alfresco 63 | log4j.logger.org.alfresco=error 64 | log4j.logger.org.alfresco.repo.admin=info 65 | log4j.logger.org.alfresco.repo.transaction=warn 66 | log4j.logger.org.alfresco.repo.cache.TransactionalCache=warn 67 | log4j.logger.org.alfresco.repo.model.filefolder=warn 68 | log4j.logger.org.alfresco.repo.tenant=info 69 | log4j.logger.org.alfresco.config=warn 70 | log4j.logger.org.alfresco.config.JndiObjectFactoryBean=warn 71 | log4j.logger.org.alfresco.config.JBossEnabledWebApplicationContext=warn 72 | log4j.logger.org.alfresco.repo.management.subsystems=warn 73 | log4j.logger.org.alfresco.repo.management.subsystems.ChildApplicationContextFactory=info 74 | log4j.logger.org.alfresco.repo.management.subsystems.ChildApplicationContextFactory$ChildApplicationContext=warn 75 | log4j.logger.org.alfresco.repo.security.sync=info 76 | log4j.logger.org.alfresco.repo.security.person=info 77 | 78 | log4j.logger.org.alfresco.sample=info 79 | log4j.logger.org.alfresco.web=info 80 | #log4j.logger.org.alfresco.web.app.AlfrescoNavigationHandler=debug 81 | #log4j.logger.org.alfresco.web.ui.repo.component.UIActions=debug 82 | #log4j.logger.org.alfresco.web.ui.repo.tag.PageTag=debug 83 | #log4j.logger.org.alfresco.web.bean.clipboard=debug 84 | log4j.logger.org.alfresco.service.descriptor.DescriptorService=info 85 | #log4j.logger.org.alfresco.web.page=debug 86 | 87 | log4j.logger.org.alfresco.repo.importer.ImporterBootstrap=error 88 | #log4j.logger.org.alfresco.repo.importer.ImporterBootstrap=info 89 | 90 | log4j.logger.org.alfresco.repo.admin.patch.PatchExecuter=info 91 | log4j.logger.org.alfresco.repo.domain.patch.ibatis.PatchDAOImpl=info 92 | 93 | # Specific patches 94 | log4j.logger.org.alfresco.repo.admin.patch.impl.DeploymentMigrationPatch=info 95 | log4j.logger.org.alfresco.repo.version.VersionMigrator=info 96 | 97 | log4j.logger.org.alfresco.repo.module.ModuleServiceImpl=info 98 | log4j.logger.org.alfresco.repo.domain.schema.SchemaBootstrap=info 99 | log4j.logger.org.alfresco.repo.admin.ConfigurationChecker=info 100 | log4j.logger.org.alfresco.repo.node.index.AbstractReindexComponent=warn 101 | log4j.logger.org.alfresco.repo.node.index.IndexTransactionTracker=warn 102 | log4j.logger.org.alfresco.repo.node.index.FullIndexRecoveryComponent=info 103 | log4j.logger.org.alfresco.util.OpenOfficeConnectionTester=info 104 | log4j.logger.org.alfresco.repo.node.db.hibernate.HibernateNodeDaoServiceImpl=warn 105 | log4j.logger.org.alfresco.repo.domain.hibernate.DirtySessionMethodInterceptor=warn 106 | log4j.logger.org.alfresco.repo.transaction.RetryingTransactionHelper=warn 107 | log4j.logger.org.alfresco.util.transaction.SpringAwareUserTransaction.trace=warn 108 | log4j.logger.org.alfresco.util.AbstractTriggerBean=warn 109 | log4j.logger.org.alfresco.enterprise.repo.cluster=info 110 | log4j.logger.org.alfresco.repo.version.Version2ServiceImpl=warn 111 | 112 | #log4j.logger.org.alfresco.web.app.DebugPhaseListener=debug 113 | log4j.logger.org.alfresco.repo.node.db.NodeStringLengthWorker=info 114 | 115 | log4j.logger.org.alfresco.repo.workflow=info 116 | 117 | # CIFS server debugging 118 | log4j.logger.org.alfresco.smb.protocol=error 119 | #log4j.logger.org.alfresco.smb.protocol.auth=debug 120 | #log4j.logger.org.alfresco.acegi=debug 121 | 122 | # FTP server debugging 123 | log4j.logger.org.alfresco.ftp.protocol=error 124 | #log4j.logger.org.alfresco.ftp.server=debug 125 | 126 | # WebDAV debugging 127 | #log4j.logger.org.alfresco.webdav.protocol=debug 128 | log4j.logger.org.alfresco.webdav.protocol=info 129 | 130 | # NTLM servlet filters 131 | #log4j.logger.org.alfresco.web.app.servlet.NTLMAuthenticationFilter=debug 132 | #log4j.logger.org.alfresco.repo.webdav.auth.NTLMAuthenticationFilter=debug 133 | 134 | # Kerberos servlet filters 135 | #log4j.logger.org.alfresco.web.app.servlet.KerberosAuthenticationFilter=debug 136 | #log4j.logger.org.alfresco.repo.webdav.auth.KerberosAuthenticationFilter=debug 137 | 138 | # File servers 139 | log4j.logger.org.alfresco.fileserver=warn 140 | 141 | # Repo filesystem debug logging 142 | #log4j.logger.org.alfresco.filesys.repo.ContentDiskDriver=debug 143 | 144 | # Integrity message threshold - if 'failOnViolation' is off, then WARNINGS are generated 145 | log4j.logger.org.alfresco.repo.node.integrity=ERROR 146 | 147 | # Indexer debugging 148 | log4j.logger.org.alfresco.repo.search.Indexer=error 149 | #log4j.logger.org.alfresco.repo.search.Indexer=debug 150 | 151 | log4j.logger.org.alfresco.repo.search.impl.lucene.index=error 152 | log4j.logger.org.alfresco.repo.search.impl.lucene.fts.FullTextSearchIndexerImpl=warn 153 | #log4j.logger.org.alfresco.repo.search.impl.lucene.index=DEBUG 154 | 155 | # Audit debugging 156 | # log4j.logger.org.alfresco.repo.audit=DEBUG 157 | # log4j.logger.org.alfresco.repo.audit.model=DEBUG 158 | 159 | # Property sheet and modelling debugging 160 | # change to error to hide the warnings about missing properties and associations 161 | log4j.logger.alfresco.missingProperties=warn 162 | 163 | # Dictionary/Model debugging 164 | log4j.logger.org.alfresco.repo.dictionary=warn 165 | log4j.logger.org.alfresco.repo.dictionary.types.period=warn 166 | 167 | # Virtualization Server Registry 168 | log4j.logger.org.alfresco.mbeans.VirtServerRegistry=error 169 | 170 | # Spring context runtime property setter 171 | log4j.logger.org.alfresco.util.RuntimeSystemPropertiesSetter=info 172 | 173 | # Debugging options for clustering 174 | log4j.logger.org.alfresco.repo.content.ReplicatingContentStore=error 175 | log4j.logger.org.alfresco.repo.content.replication=error 176 | 177 | #log4j.logger.org.alfresco.repo.deploy.DeploymentServiceImpl=debug 178 | 179 | # Activity service 180 | log4j.logger.org.alfresco.repo.activities=warn 181 | 182 | # User usage tracking 183 | log4j.logger.org.alfresco.repo.usage=info 184 | 185 | # Sharepoint 186 | log4j.logger.org.alfresco.module.vti=info 187 | 188 | # Forms Engine 189 | log4j.logger.org.alfresco.web.config.forms=info 190 | log4j.logger.org.alfresco.web.scripts.forms=info 191 | 192 | # CMIS 193 | log4j.logger.org.alfresco.opencmis=error 194 | log4j.logger.org.alfresco.opencmis.AlfrescoCmisServiceInterceptor=error 195 | log4j.logger.org.alfresco.cmis=error 196 | log4j.logger.org.alfresco.cmis.dictionary=warn 197 | log4j.logger.org.apache.chemistry.opencmis=info 198 | log4j.logger.org.apache.chemistry.opencmis.server.impl.browser.CmisBrowserBindingServlet=OFF 199 | log4j.logger.org.apache.chemistry.opencmis.server.impl.atompub.CmisAtomPubServlet=OFF 200 | 201 | # IMAP 202 | log4j.logger.org.alfresco.repo.imap=info 203 | 204 | # JBPM 205 | # Note: non-fatal errors (eg. logged during job execution) should be handled by Alfresco's retrying transaction handler 206 | log4j.logger.org.jbpm.graph.def.GraphElement=fatal 207 | 208 | #log4j.logger.org.alfresco.repo.googledocs=debug 209 | 210 | 211 | # Web Framework 212 | log4j.logger.org.springframework.extensions.webscripts=info 213 | log4j.logger.org.springframework.extensions.webscripts.ScriptLogger=warn 214 | log4j.logger.org.springframework.extensions.webscripts.ScriptDebugger=off 215 | 216 | # Repository 217 | log4j.logger.org.alfresco.repo.web.scripts=warn 218 | log4j.logger.org.alfresco.repo.web.scripts.BaseWebScriptTest=info 219 | log4j.logger.org.alfresco.repo.web.scripts.AlfrescoRhinoScriptDebugger=off 220 | log4j.logger.org.alfresco.repo.jscript=error 221 | log4j.logger.org.alfresco.repo.jscript.ScriptLogger=warn 222 | log4j.logger.org.alfresco.repo.cmis.rest.CMISTest=info 223 | 224 | log4j.logger.org.alfresco.repo.domain.schema.script.ScriptBundleExecutorImpl=off 225 | log4j.logger.org.alfresco.repo.domain.schema.script.ScriptExecutorImpl=info 226 | 227 | log4j.logger.org.alfresco.repo.search.impl.solr.facet.SolrFacetServiceImpl=info 228 | 229 | # Bulk Filesystem Import Tool 230 | log4j.logger.org.alfresco.repo.bulkimport=warn 231 | 232 | # Freemarker 233 | # Note the freemarker.runtime logger is used to log non-fatal errors that are handled by Alfresco's retrying transaction handler 234 | log4j.logger.freemarker.runtime= 235 | 236 | # Metadata extraction 237 | log4j.logger.org.alfresco.repo.content.metadata.AbstractMappingMetadataExtracter=warn 238 | 239 | # Reduces PDFont error level due to ALF-7105 240 | log4j.logger.org.apache.pdfbox.pdmodel.font.PDSimpleFont=fatal 241 | log4j.logger.org.apache.pdfbox.pdmodel.font.PDFont=fatal 242 | log4j.logger.org.apache.pdfbox.pdmodel.font.PDCIDFont=fatal 243 | 244 | # no index support 245 | log4j.logger.org.alfresco.repo.search.impl.noindex.NoIndexIndexer=fatal 246 | log4j.logger.org.alfresco.repo.search.impl.noindex.NoIndexSearchService=fatal 247 | 248 | # lucene index warnings 249 | log4j.logger.org.alfresco.repo.search.impl.lucene.index.IndexInfo=warn 250 | 251 | # Warn about RMI socket bind retries. 252 | log4j.logger.org.alfresco.util.remote.server.socket.HostConfigurableSocketFactory=warn 253 | 254 | log4j.logger.org.alfresco.repo.usage.RepoUsageMonitor=info 255 | 256 | # Authorization 257 | log4j.logger.org.alfresco.enterprise.repo.authorization.AuthorizationService=info 258 | log4j.logger.org.alfresco.enterprise.repo.authorization.AuthorizationsConsistencyMonitor=warn 259 | 260 | #----------------------------------------------------------------------- 261 | # Platform module logging 262 | #----------------------------------------------------------------------- 263 | log4j.logger.com.redpill_linpro.alfresco.repo.systemmessages.platformsample.DemoComponent=debug 264 | log4j.logger.com.redpill_linpro.alfresco.repo.systemmessages.platformsample.HelloWorldWebScript=debug 265 | 266 | 267 | 268 | -------------------------------------------------------------------------------- /alfresco-systemmessages-platform-docker/src/main/docker/disable-webscript-caching-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 19 | 20 | 31 | 32 | 33 | javascript 34 | 35 | 36 | js 37 | 38 | 39 | 40 | false 41 | 42 | 43 | 44 | 45 | true 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | ${spaces.store} 56 | 57 | 58 | ${spaces.company_home.childname} 59 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /alfresco-systemmessages-platform-docker/src/main/docker/hotswap-agent.properties: -------------------------------------------------------------------------------- 1 | # Enable hotswap so that changes in this module will be automatically reloaded 2 | # Watch for changed class files on watchResources path and reload class definition in the running application. 3 | autoHotswap=true 4 | #autoHotswap.port=8000 5 | 6 | # Add a directory prior to application classpath (load classes and resources). 7 | # 8 | # This may be useful for example in multi module maven project to load class changes from upstream project 9 | # classes. Set extraClasspath to upstream project compiler output and .class file will have precedence to 10 | # classes from built JAR file. 11 | # i.e. monitor /target/classes 12 | # should work with extraClasspath=${project.build.outputDirectory} 13 | # If not try 14 | extraClasspath=/usr/local/tomcat/hotswap-agent 15 | 16 | # Comma separated list of disabled plugins 17 | # Use plugin name - e.g. 18 | # Hotswapper, AnonymousClassPatch, WatchResources, Hibernate, Spring, Jersey2, Jetty, Tomcat, 19 | # ZK, Logback, JSF, Seam, ELResolver, OsgiEquinox, Proxy, WebObjects, Weld, JBossModules, Resteasy, Gae 20 | disabledPlugins=Hibernate,Spring 21 | 22 | # Add a directory prior to webapp path (load webapp resources). 23 | # 24 | # Load web application resources (such as HTML, JSP, CSS, ...) from this directory prior to default processing. 25 | # Use this setting to set to serve resources from source directory directly (e.g. src/main/webapp). 26 | extraWebappContext=/usr/local/tomcat/hotswap-agent/alfresco-systemmessages-platform/target/classes/META-INF/resources; 27 | 28 | # Load static web resources from different directory. 29 | # 30 | # This setting is dependent on application server plugin(Jetty, Tomcat, JBoss, ...) 31 | webappDir=/usr/local/tomcat/hotswap-agent/alfresco-systemmessages-platform/target/classes/META-INF/resources; 32 | 33 | # Watch for changes in a directory (resources only). 34 | # 35 | # Similar to extraClasspath this property adds classpath when searching for resources (not classes). 36 | # While extra classpath just modifies the classloader, this setting does nothing until the resource 37 | # is really changed. 38 | # 39 | # Sometimes it is not possible to point extraClasspath to your i.e. src/main/resources, because there are multiple 40 | # replacements of resources in a building step (maven filtering resource option). 41 | # This setting will leave i.e. src/target/classes as default source for resources, but after the resource is modified 42 | # in src/main/resources, the new changed resource is served instead. 43 | # watchResources= 44 | 45 | LOGGER.org.hotswap.agent=DEBUG 46 | #LOGGER.org.hotswap.agent.plugin=TRACE 47 | #LOGGER.org.hotswap.agent.watch=TRACE 48 | #LOGGER.org.hotswap.agent.command=TRACE -------------------------------------------------------------------------------- /alfresco-systemmessages-platform-docker/src/main/docker/license/README.md: -------------------------------------------------------------------------------- 1 | # Enterprise License location 2 | 3 | Put the Alfresco Enterprise license file in this directory. 4 | It will then be copied into the ACS container in the 5 | $TOMCAT_DIR/WEB-INF/classes/alfresco/extension/license directory. 6 | 7 | -------------------------------------------------------------------------------- /alfresco-systemmessages-platform/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | alfresco-systemmessages-platform 5 | Alfresco Platform/Repository JAR Module 6 | Platform/Repo JAR Module (to be included in the alfresco.war) - part of AIO - SDK 4.7 7 | jar 8 | 9 | 10 | com.redpill-linpro.alfresco 11 | alfresco-systemmessages 12 | 4.0 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | org.apache.maven.plugins 25 | maven-assembly-plugin 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /alfresco-systemmessages-platform/src/main/assembly/amp.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 18 | 19 | build-amp-file 20 | 21 | 22 | amp 23 | 24 | 25 | false 26 | 27 | 28 | 29 | 30 | src/main/resources/alfresco/module/${project.artifactId}/module.properties 31 | true 32 | 33 | 34 | 35 | src/main/assembly/file-mapping.properties 36 | false 37 | 38 | 39 | 40 | src/main/resources/alfresco/module/${project.artifactId}/log4j.properties 41 | false 42 | 43 | 44 | 45 | 46 | 47 | 48 | src/main/assembly/web 49 | web 50 | true 51 | 52 | README.md 53 | 54 | 55 | 56 | 57 | 60 | 61 | 62 | lib 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /alfresco-systemmessages-platform/src/main/assembly/file-mapping.properties: -------------------------------------------------------------------------------- 1 | # Custom AMP to WAR location mappings 2 | 3 | # 4 | # The following property can be used to include the standard set of mappings. 5 | # The contents of this file will override any defaults. The default is 6 | # 'true', i.e. the default mappings will be augmented or modified by values in 7 | # this file. 8 | # 9 | # Default mappings are: 10 | # 11 | # /config=/WEB-INF/classes 12 | # /lib=/WEB-INF/lib 13 | # /licenses=/WEB-INF/licenses 14 | # /web/jsp=/jsp 15 | # /web/css=/css 16 | # /web/images=/images 17 | # /web/scripts=/scripts 18 | # /web/php=/php 19 | # 20 | include.default=true 21 | 22 | # 23 | # Custom mappings. If 'include.default' is false, then this is the complete set. 24 | # Map /web to / in AMP so we can override things like favicon.ico 25 | # 26 | /web=/ 27 | 28 | -------------------------------------------------------------------------------- /alfresco-systemmessages-platform/src/main/java/com/redpill_linpro/alfresco/repo/systemmessages/bean/SystemNotificationBean.java: -------------------------------------------------------------------------------- 1 | package com.redpill_linpro.alfresco.repo.systemmessages.bean; 2 | 3 | import java.io.Serializable; 4 | import java.util.Date; 5 | 6 | import org.joda.time.DateTime; 7 | import org.joda.time.Interval; 8 | 9 | public class SystemNotificationBean implements Serializable { 10 | 11 | /** 12 | * 13 | */ 14 | private static final long serialVersionUID = -2550061773631638481L; 15 | private String id; 16 | private String nodeRef; 17 | private String title; 18 | private String message; 19 | private String priority; 20 | private Date startTime; 21 | private Date endTime; 22 | 23 | public String getId() { 24 | return id; 25 | } 26 | 27 | public void setId(String id) { 28 | this.id = id; 29 | } 30 | 31 | public String getNodeRef() { 32 | return nodeRef; 33 | } 34 | 35 | public void setNodeRef(String nodeRef) { 36 | this.nodeRef = nodeRef; 37 | } 38 | 39 | public String getTitle() { 40 | return title; 41 | } 42 | 43 | public void setTitle(String title) { 44 | this.title = title; 45 | } 46 | 47 | public String getMessage() { 48 | return message; 49 | } 50 | 51 | public void setMessage(String message) { 52 | this.message = message; 53 | } 54 | 55 | public String getPriority() { 56 | return priority; 57 | } 58 | 59 | public void setPriority(String priority) { 60 | this.priority = priority; 61 | } 62 | 63 | public Date getStartTime() { 64 | return startTime; 65 | } 66 | 67 | public void setStartTime(Date startTime) { 68 | this.startTime = startTime; 69 | } 70 | 71 | public Date getEndTime() { 72 | return endTime; 73 | } 74 | 75 | public void setEndTime(Date endTime) { 76 | this.endTime = endTime; 77 | } 78 | 79 | /** 80 | * Returns true if the current time is in the interval of 81 | * the start and end time. 82 | * 83 | * @return 84 | */ 85 | public boolean isActive() { 86 | DateTime now = new DateTime(); 87 | 88 | if (startTime != null && endTime != null) { 89 | Interval timeSpan = new Interval(startTime.getTime(), endTime.getTime()); 90 | return timeSpan.contains(now); 91 | } 92 | return false; 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /alfresco-systemmessages-platform/src/main/java/com/redpill_linpro/alfresco/repo/systemmessages/model/SystemMessagesModel.java: -------------------------------------------------------------------------------- 1 | package com.redpill_linpro.alfresco.repo.systemmessages.model; 2 | import org.alfresco.service.namespace.QName; 3 | public interface SystemMessagesModel 4 | { 5 | String URI = "http://www.redpill-linpro.com/model/sm/1.0"; 6 | String SHORT_PREFIX = "rlsm"; 7 | 8 | 9 | 10 | //TYPES 11 | QName TYPE_SYSTEM_MESSAGE = QName.createQName(URI,"systemMessage"); 12 | 13 | 14 | 15 | //Aspects 16 | 17 | 18 | 19 | //PROPS 20 | QName PROP_SYSTEM_MESSAGE_TITLE = QName.createQName(URI,"systemMessageTitle"); 21 | QName PROP_SYSTEM_MESSAGE_DESCRIPTION = QName.createQName(URI,"systemMessageDescription"); 22 | QName PROP_SYSTEM_MESSAGE_START_TIME = QName.createQName(URI,"systemMessageStartTime"); 23 | QName PROP_SYSTEM_MESSAGE_END_TIME = QName.createQName(URI,"systemMessageEndTime"); 24 | QName PROP_SYSTEM_MESSAGE_PRIORITY = QName.createQName(URI,"systemMessagePriority"); 25 | } -------------------------------------------------------------------------------- /alfresco-systemmessages-platform/src/main/java/com/redpill_linpro/alfresco/repo/systemmessages/service/SystemMessagesService.java: -------------------------------------------------------------------------------- 1 | package com.redpill_linpro.alfresco.repo.systemmessages.service; 2 | 3 | import java.util.List; 4 | 5 | import org.alfresco.service.cmr.repository.NodeRef; 6 | 7 | import com.redpill_linpro.alfresco.repo.systemmessages.bean.SystemNotificationBean; 8 | 9 | public interface SystemMessagesService { 10 | public List getActiveNotifications(); 11 | public List getAllNotifications(); 12 | public NodeRef getSystemMessagesDatalistNodeRef(); 13 | } 14 | -------------------------------------------------------------------------------- /alfresco-systemmessages-platform/src/main/java/com/redpill_linpro/alfresco/repo/systemmessages/service/SystemMessagesServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.redpill_linpro.alfresco.repo.systemmessages.service; 2 | 3 | import java.util.ArrayList; 4 | import java.util.Date; 5 | import java.util.List; 6 | 7 | import org.alfresco.error.AlfrescoRuntimeException; 8 | import org.alfresco.repo.tenant.TenantUtil; 9 | import org.alfresco.service.cmr.repository.NodeRef; 10 | import org.alfresco.service.cmr.repository.NodeService; 11 | import org.alfresco.service.cmr.repository.StoreRef; 12 | import org.alfresco.service.cmr.search.SearchService; 13 | import org.alfresco.service.namespace.NamespaceService; 14 | import com.redpill_linpro.alfresco.repo.systemmessages.bean.SystemNotificationBean; 15 | import com.redpill_linpro.alfresco.repo.systemmessages.model.SystemMessagesModel; 16 | import com.redpill_linpro.alfresco.repo.systemmessages.webscript.GetDataList; 17 | import org.springframework.beans.factory.InitializingBean; 18 | import org.springframework.util.Assert; 19 | 20 | public class SystemMessagesServiceImpl implements SystemMessagesService, InitializingBean { 21 | private NodeService nodeService; 22 | private NamespaceService namespaceService; 23 | private SearchService searchService; 24 | 25 | @Override 26 | public void afterPropertiesSet() throws Exception { 27 | Assert.notNull(nodeService, "You must provide an instance of NodeService"); 28 | Assert.notNull(searchService, "You must provide an instance of SearchService"); 29 | Assert.notNull(namespaceService, "You must provide an instance of NamespaceService"); 30 | } 31 | 32 | @Override 33 | public List getActiveNotifications() { 34 | return getNotifications(true); 35 | } 36 | 37 | @Override 38 | public List getAllNotifications() { 39 | return getNotifications(false); 40 | } 41 | 42 | @Override 43 | public NodeRef getSystemMessagesDatalistNodeRef() { 44 | return TenantUtil.runAsDefaultTenant(new TenantUtil.TenantRunAsWork() 45 | { 46 | @Override 47 | public NodeRef doWork() throws Exception 48 | { 49 | List dataList = searchService.selectNodes(nodeService.getRootNode(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE), GetDataList.DATALIST_PATH + "/" + GetDataList.SYSTEM_MESSAGES_DL_NAME, null, namespaceService, false); 50 | 51 | if (!dataList.isEmpty()) 52 | { 53 | return dataList.get(0); 54 | } else 55 | { 56 | throw new AlfrescoRuntimeException("Could not find System Messages datalist"); 57 | } 58 | } 59 | }); 60 | } 61 | 62 | private List getNotifications(final boolean onlyActive) { 63 | return TenantUtil.runAsDefaultTenant(new TenantUtil.TenantRunAsWork>() 64 | { 65 | @Override 66 | public List doWork() throws Exception 67 | { 68 | List nodeRefList = searchService.selectNodes(nodeService.getRootNode(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE), GetDataList.DATALIST_PATH + "/" + GetDataList.SYSTEM_MESSAGES_DL_NAME + "/*", null, namespaceService, false); 69 | List notifications = new ArrayList<>(); 70 | 71 | for (NodeRef nodeRef : nodeRefList) { 72 | 73 | SystemNotificationBean notification = new SystemNotificationBean(); 74 | notification.setId(nodeRef.getId()); 75 | notification.setNodeRef(nodeRef.toString()); 76 | notification.setTitle((String) nodeService.getProperty(nodeRef, SystemMessagesModel.PROP_SYSTEM_MESSAGE_TITLE)); 77 | notification.setMessage((String) nodeService.getProperty(nodeRef, SystemMessagesModel.PROP_SYSTEM_MESSAGE_DESCRIPTION)); 78 | notification.setPriority((String) nodeService.getProperty(nodeRef, SystemMessagesModel.PROP_SYSTEM_MESSAGE_PRIORITY)); 79 | notification.setStartTime((Date) nodeService.getProperty(nodeRef, SystemMessagesModel.PROP_SYSTEM_MESSAGE_START_TIME)); 80 | notification.setEndTime((Date) nodeService.getProperty(nodeRef, SystemMessagesModel.PROP_SYSTEM_MESSAGE_END_TIME)); 81 | 82 | if (onlyActive) { 83 | if (notification.isActive()) { 84 | notifications.add(notification); 85 | } 86 | } else { 87 | notifications.add(notification); 88 | } 89 | 90 | } 91 | return notifications; 92 | } 93 | }); 94 | } 95 | 96 | public void setNodeService(NodeService nodeService) { 97 | this.nodeService = nodeService; 98 | } 99 | 100 | public void setNamespaceService(NamespaceService namespaceService) { 101 | this.namespaceService = namespaceService; 102 | } 103 | 104 | public void setSearchService(SearchService searchService) { 105 | this.searchService = searchService; 106 | } 107 | 108 | } 109 | -------------------------------------------------------------------------------- /alfresco-systemmessages-platform/src/main/java/com/redpill_linpro/alfresco/repo/systemmessages/webscript/DeleteNode.java: -------------------------------------------------------------------------------- 1 | package com.redpill_linpro.alfresco.repo.systemmessages.webscript; 2 | 3 | import java.util.Map; 4 | 5 | import org.alfresco.service.cmr.repository.NodeRef; 6 | import org.alfresco.service.cmr.repository.NodeService; 7 | import org.alfresco.service.cmr.repository.StoreRef; 8 | import org.springframework.extensions.webscripts.Cache; 9 | import org.springframework.extensions.webscripts.DeclarativeWebScript; 10 | import org.springframework.extensions.webscripts.Status; 11 | import org.springframework.extensions.webscripts.WebScriptRequest; 12 | 13 | /** 14 | * Created by magnus on 2016-10-26. 15 | */ 16 | public class DeleteNode extends DeclarativeWebScript 17 | { 18 | private NodeService nodeService; 19 | @Override 20 | protected Map executeImpl(WebScriptRequest req, Status status, Cache cache) 21 | { 22 | Map templateArgs = req.getServiceMatch() 23 | .getTemplateVars(); 24 | String storeType = templateArgs.get("store_type"); 25 | String storeId = templateArgs.get("store_id"); 26 | String nodeId = templateArgs.get("id"); 27 | NodeRef nodeRef = new NodeRef(new StoreRef(storeType+"://"+storeId), nodeId); 28 | nodeService.deleteNode(nodeRef); 29 | return null; 30 | } 31 | 32 | public void setNodeService(NodeService nodeService) 33 | { 34 | this.nodeService = nodeService; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /alfresco-systemmessages-platform/src/main/java/com/redpill_linpro/alfresco/repo/systemmessages/webscript/GetDataList.java: -------------------------------------------------------------------------------- 1 | package com.redpill_linpro.alfresco.repo.systemmessages.webscript; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | import org.alfresco.service.cmr.repository.NodeRef; 7 | import com.redpill_linpro.alfresco.repo.systemmessages.service.SystemMessagesService; 8 | import org.springframework.extensions.webscripts.Cache; 9 | import org.springframework.extensions.webscripts.DeclarativeWebScript; 10 | import org.springframework.extensions.webscripts.Status; 11 | import org.springframework.extensions.webscripts.WebScriptRequest; 12 | 13 | public class GetDataList extends DeclarativeWebScript { 14 | private SystemMessagesService systemMessagesService; 15 | 16 | public final static String SYSTEM_MESSAGES_DL_NAME = "cm:system-messages-datalist"; 17 | public final static String DATALIST_PATH = "/app:company_home/app:dictionary/cm:dataLists"; 18 | 19 | @Override 20 | protected Map executeImpl(WebScriptRequest req, Status status, Cache cache) { 21 | HashMap result = new HashMap<>(); 22 | NodeRef systemMessagesDatalistNodeRef = systemMessagesService.getSystemMessagesDatalistNodeRef(); 23 | result.put("nodeRef", systemMessagesDatalistNodeRef.toString()); 24 | return result; 25 | } 26 | 27 | public void setSystemMessagesService(SystemMessagesService systemMessagesService) { 28 | this.systemMessagesService = systemMessagesService; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /alfresco-systemmessages-platform/src/main/java/com/redpill_linpro/alfresco/repo/systemmessages/webscript/SystemMessagesGet.java: -------------------------------------------------------------------------------- 1 | package com.redpill_linpro.alfresco.repo.systemmessages.webscript; 2 | 3 | import java.util.HashMap; 4 | import java.util.List; 5 | import java.util.Map; 6 | 7 | import com.redpill_linpro.alfresco.repo.systemmessages.bean.SystemNotificationBean; 8 | import com.redpill_linpro.alfresco.repo.systemmessages.service.SystemMessagesService; 9 | import org.springframework.extensions.webscripts.Cache; 10 | import org.springframework.extensions.webscripts.DeclarativeWebScript; 11 | import org.springframework.extensions.webscripts.Status; 12 | import org.springframework.extensions.webscripts.WebScriptRequest; 13 | 14 | public class SystemMessagesGet extends DeclarativeWebScript 15 | { 16 | private SystemMessagesService systemMessagesService; 17 | 18 | @Override 19 | protected Map executeImpl(WebScriptRequest req, Status status, Cache cache) 20 | { 21 | 22 | HashMap result = new HashMap<>(); 23 | List notifications = null; 24 | if(req.getParameter("active")!=null) 25 | { 26 | notifications = systemMessagesService.getActiveNotifications(); 27 | }else{ 28 | notifications = systemMessagesService.getAllNotifications(); 29 | } 30 | result.put("notifications", notifications); 31 | return result; 32 | } 33 | 34 | public void setSystemMessagesService(SystemMessagesService systemMessagesService) { 35 | this.systemMessagesService = systemMessagesService; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /alfresco-systemmessages-platform/src/main/resources/alfresco/extension/templates/webscripts/com/redpill-linpro/notifications/node.delete.desc.xml: -------------------------------------------------------------------------------- 1 | 2 | Delete node 3 | 4 | /api/redpill/delete/{store_type}/{store_id}/{id} 5 | argument 6 | user 7 | required 8 | Redpill Linpro 9 | -------------------------------------------------------------------------------- /alfresco-systemmessages-platform/src/main/resources/alfresco/extension/templates/webscripts/com/redpill-linpro/notifications/node.delete.json.ftl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Redpill-Linpro/alfresco-systemmessages/ad88946f0c782e6cad00ca0b3c173722ee67efcc/alfresco-systemmessages-platform/src/main/resources/alfresco/extension/templates/webscripts/com/redpill-linpro/notifications/node.delete.json.ftl -------------------------------------------------------------------------------- /alfresco-systemmessages-platform/src/main/resources/alfresco/extension/templates/webscripts/com/redpill-linpro/notifications/notifications-datalist.get.desc.xml: -------------------------------------------------------------------------------- 1 | 2 | Get notifications datalist 3 | 4 | /api/redpill/notifications/datalist 5 | argument 6 | user 7 | required 8 | Redpill Linpro 9 | -------------------------------------------------------------------------------- /alfresco-systemmessages-platform/src/main/resources/alfresco/extension/templates/webscripts/com/redpill-linpro/notifications/notifications-datalist.get.json.ftl: -------------------------------------------------------------------------------- 1 | <#escape x as jsonUtils.encodeJSONString(x)> 2 | {"nodeRef": "${nodeRef}"} 3 | -------------------------------------------------------------------------------- /alfresco-systemmessages-platform/src/main/resources/alfresco/extension/templates/webscripts/com/redpill-linpro/notifications/notifications.get.desc.xml: -------------------------------------------------------------------------------- 1 | 2 | Get a list of current system notifications 3 | 4 | /api/redpill/notifications 5 | argument 6 | user 7 | required 8 | Redpill Linpro 9 | -------------------------------------------------------------------------------- /alfresco-systemmessages-platform/src/main/resources/alfresco/extension/templates/webscripts/com/redpill-linpro/notifications/notifications.get.json.ftl: -------------------------------------------------------------------------------- 1 | <#macro dateFormat date=""><#if date?is_date>${xmldate(date)} 2 | <#escape x as jsonUtils.encodeJSONString(x)> 3 | { 4 | "notifications": 5 | [ 6 | <#list notifications as item> 7 | { 8 | "nodeRef": "${item.nodeRef}", 9 | "id": "${item.id}", 10 | "title": "${item.title!''}", 11 | "text": "${item.message!''}", 12 | "type": "${item.priority!''}", 13 | "startTime": "<@dateFormat item.startTime />", 14 | "endTime": "<@dateFormat item.endTime />" 15 | }<#if item_has_next>, 16 | 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /alfresco-systemmessages-platform/src/main/resources/alfresco/module/alfresco-systemmessages-platform/alfresco-global.properties: -------------------------------------------------------------------------------- 1 | ## This Alfresco Platform Configuration file should be used for custom properties that are introduced by this module. 2 | ## Define default values for all properties here. 3 | ## System Administrators can override these values in environment specific configurations in 4 | ## alfresco/tomcat/shared/classes/alfresco-global.properties. 5 | ## 6 | system.messages.datalist.location= 7 | -------------------------------------------------------------------------------- /alfresco-systemmessages-platform/src/main/resources/alfresco/module/alfresco-systemmessages-platform/bootstrap/system-messages-list.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | dataLists 14 | dataLists 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | system-messages-datalist 29 | 30 | System Messages 31 | 32 | 33 | Datalist containing system messages 34 | 35 | {http://www.redpill-linpro.com/model/sm/1.0}systemMessage 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /alfresco-systemmessages-platform/src/main/resources/alfresco/module/alfresco-systemmessages-platform/context/bootstrap-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 9 | 10 | 11 | 12 | 13 | 14 | alfresco/module/alfresco-systemmessages-platform/model/systemmessages-model.xml 15 | 16 | 17 | 18 | 19 | alfresco/module/alfresco-systemmessages-platform/messages/systemmessages-model 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | patch.systemMessagesDatalist 28 | 29 | 30 | patch.systemMessagesDatalist.description 31 | 32 | 33 | 0 34 | 35 | 36 | ${version.schema} 37 | 38 | 39 | 100000 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | /${spaces.company_home.childname}/${spaces.dictionary.childname}/cm:dataLists 48 | 49 | 50 | 51 | UTF-8 52 | /${spaces.company_home.childname}/${spaces.dictionary.childname} 53 | alfresco/module/alfresco-systemmessages-platform/bootstrap/system-messages-list.xml 54 | alfresco/module/alfresco-systemmessages-platform/messages/sm-patch-service 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /alfresco-systemmessages-platform/src/main/resources/alfresco/module/alfresco-systemmessages-platform/context/service-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /alfresco-systemmessages-platform/src/main/resources/alfresco/module/alfresco-systemmessages-platform/context/webscript-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /alfresco-systemmessages-platform/src/main/resources/alfresco/module/alfresco-systemmessages-platform/messages/sm-patch-service.properties: -------------------------------------------------------------------------------- 1 | patch.systemMessagesDatalist=Adds a datalistContainer to the data dictionary and the system messages datalist. 2 | patch.systemMessagesDatalist.description=Adds a datalistContainer to the data dictionary and the system messages datalist. -------------------------------------------------------------------------------- /alfresco-systemmessages-platform/src/main/resources/alfresco/module/alfresco-systemmessages-platform/messages/systemmessages-model.properties: -------------------------------------------------------------------------------- 1 | # Type 2 | rlsm_systemMessagesModel.type.rlsm_systemMessage.title=System messages 3 | 4 | 5 | # Properties 6 | rlsm_systemMessagesModel.property.rlsm_systemMessageTitle.title=Title 7 | rlsm_systemMessagesModel.property.rlsm_systemMessageDescription.title=Description 8 | rlsm_systemMessagesModel.property.rlsm_systemMessageStartTime.title=Start Time 9 | rlsm_systemMessagesModel.property.rlsm_systemMessageEndTime.title=End Time 10 | rlsm_systemMessagesModel.property.rlsm_systemMessagePriority.title=Priority -------------------------------------------------------------------------------- /alfresco-systemmessages-platform/src/main/resources/alfresco/module/alfresco-systemmessages-platform/messages/systemmessages-model_fr.properties: -------------------------------------------------------------------------------- 1 | # Type 2 | rlsm_systemMessagesModel.type.rlsm_systemMessage.title=Messages syst\u00e8me 3 | 4 | 5 | # Properties 6 | rlsm_systemMessagesModel.property.rlsm_systemMessageTitle.title=Titre 7 | rlsm_systemMessagesModel.property.rlsm_systemMessageDescription.title=Description 8 | rlsm_systemMessagesModel.property.rlsm_systemMessageStartTime.title=Date de d\u00e9but 9 | rlsm_systemMessagesModel.property.rlsm_systemMessageEndTime.title=Date de fin 10 | rlsm_systemMessagesModel.property.rlsm_systemMessagePriority.title=Priorit\u00e9 -------------------------------------------------------------------------------- /alfresco-systemmessages-platform/src/main/resources/alfresco/module/alfresco-systemmessages-platform/messages/systemmessages-model_sv.properties: -------------------------------------------------------------------------------- 1 | # Type 2 | rlsm_systemMessagesModel.type.rlsm_systemMessage.title=Systemmeddelanden 3 | 4 | 5 | # Properties 6 | rlsm_systemMessagesModel.property.rlsm_systemMessageTitle.title=Titel 7 | rlsm_systemMessagesModel.property.rlsm_systemMessageDescription.title=Beskrivning 8 | rlsm_systemMessagesModel.property.rlsm_systemMessageStartTime.title=Starttid 9 | rlsm_systemMessagesModel.property.rlsm_systemMessageEndTime.title=Sluttid 10 | rlsm_systemMessagesModel.property.rlsm_systemMessagePriority.title=Prioritet -------------------------------------------------------------------------------- /alfresco-systemmessages-platform/src/main/resources/alfresco/module/alfresco-systemmessages-platform/model/systemmessages-model.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | RL System Messages Data Model 5 | Redpill Linpro AB 6 | 1.0.0 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | System messages 25 | dl:dataListItem 26 | 27 | 28 | Title 29 | d:text 30 | true 31 | 32 | 33 | Description 34 | d:mltext 35 | true 36 | 37 | 38 | Start Time 39 | d:datetime 40 | 41 | 42 | End Time 43 | d:datetime 44 | 45 | 46 | Priority 47 | d:text 48 | Normal 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /alfresco-systemmessages-platform/src/main/resources/alfresco/module/alfresco-systemmessages-platform/module-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 23 | 24 | 25 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /alfresco-systemmessages-platform/src/main/resources/alfresco/module/alfresco-systemmessages-platform/module.properties: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | 17 | 18 | # SDK Sample module 19 | 20 | # ==== Beginning of Alfresco required/optional properties ====== # 21 | # NB: These properties are filtered at build time by Maven, single 22 | # sourcing from POM properties 23 | module.id=${project.artifactId} 24 | #module.aliases=myModule-123, my-module 25 | module.title=${project.name} 26 | module.description=${project.description} 27 | module.version=${project.version} 28 | 29 | # The following optional properties can be used to prevent the module from being added 30 | # to inappropriate versions of the WAR file. 31 | # module.repo.version.min=2.0 32 | # module.repo.version.max=2.1 33 | 34 | # FIXME: This dependencies should come out of mvn dependencies on amp 35 | 36 | # The following describe dependencies on other modules 37 | # Depends on net.sf.myproject.module.SupportModuleA version ${version} or later 38 | # module.depends.net.sf.myproject.module.SupportModuleA=${version}-* 39 | # Depends on net.sf.myproject.module.SupportModuleA version ${version} to 2.0 40 | # module.depends.net.sf.myproject.module.SupportModuleB=${version}-2.0 41 | # Depends on net.sf.myproject.module.SupportModuleC - any version 42 | # module.depends.net.sf.myproject.module.SupportModuleB=* 43 | 44 | 45 | # ==== End of Alfresco required/optional properties ======= # 46 | 47 | 48 | # ==== Beginning of module required properties/optional ====== # -------------------------------------------------------------------------------- /alfresco-systemmessages-share-docker/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | alfresco-systemmessages-share-docker 6 | Alfresco Share Docker Module 7 | Share Docker Module to generate the final Docker image 8 | jar 9 | 10 | 11 | com.redpill-linpro.alfresco 12 | alfresco-systemmessages 13 | 4.0 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | com.redpill-linpro.alfresco 22 | alfresco-systemmessages-share 23 | 4.0 24 | 25 | 26 | 27 | 28 | 29 | 30 | org.apache.maven.plugins 31 | maven-dependency-plugin 32 | 33 | 34 | 35 | collect-extensions 36 | package 37 | 38 | copy-dependencies 39 | 40 | 41 | ${project.build.directory}/extensions 42 | runtime 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | org.apache.maven.plugins 51 | maven-resources-plugin 52 | 53 | 54 | copy-and-filter-docker-resources 55 | validate 56 | 57 | copy-resources 58 | 59 | 60 | ${project.build.directory} 61 | 62 | 63 | src/main/docker 64 | true 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /alfresco-systemmessages-share-docker/src/main/docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ${docker.share.image}:${alfresco.share.docker.version} 2 | 3 | ARG TOMCAT_DIR=/usr/local/tomcat 4 | 5 | # Copy Dockerfile to avoid an error if no JARs exist 6 | COPY Dockerfile extensions/*.jar $TOMCAT_DIR/webapps/share/WEB-INF/lib/ 7 | 8 | # Copy Dockerfile to avoid an error if no AMPs exist 9 | COPY Dockerfile extensions/*.amp $TOMCAT_DIR/amps_share/ 10 | RUN java -jar $TOMCAT_DIR/alfresco-mmt/alfresco-mmt*.jar install \ 11 | $TOMCAT_DIR/amps_share $TOMCAT_DIR/webapps/share -directory -nobackup -force 12 | 13 | COPY share-config-custom.xml $TOMCAT_DIR/shared/classes/alfresco/web-extension 14 | 15 | COPY log4j.properties $TOMCAT_DIR/webapps/share/WEB-INF/classes 16 | COPY hotswap-agent.properties $TOMCAT_DIR/webapps/share/WEB-INF/classes 17 | -------------------------------------------------------------------------------- /alfresco-systemmessages-share-docker/src/main/docker/hotswap-agent.properties: -------------------------------------------------------------------------------- 1 | # Enable hotswap so that changes in this module will be automatically reloaded 2 | # Watch for changed class files on watchResources path and reload class definition in the running application. 3 | autoHotswap=true 4 | #autoHotswap.port=8000 5 | 6 | # Add a directory prior to application classpath (load classes and resources). 7 | # 8 | # This may be useful for example in multi module maven project to load class changes from upstream project 9 | # classes. Set extraClasspath to upstream project compiler output and .class file will have precedence to 10 | # classes from built JAR file. 11 | # i.e. monitor /target/classes 12 | # should work with extraClasspath=${project.build.outputDirectory} 13 | # If not try 14 | extraClasspath=/usr/local/tomcat/hotswap-agent 15 | 16 | 17 | # Comma separated list of disabled plugins 18 | # Use plugin name - e.g. 19 | # Hotswapper, AnonymousClassPatch, WatchResources, Hibernate, Spring, Jersey2, Jetty, Tomcat, 20 | # ZK, Logback, JSF, Seam, ELResolver, OsgiEquinox, Proxy, WebObjects, Weld, JBossModules, Resteasy, Gae 21 | disabledPlugins=Hibernate,Spring 22 | 23 | # Add a directory prior to webapp path (load webapp resources). 24 | # 25 | # Load web application resources (such as HTML, JSP, CSS, ...) from this directory prior to default processing. 26 | # Use this setting to set to serve resources from source directory directly (e.g. src/main/webapp). 27 | extraWebappContext=/usr/local/tomcat/hotswap-agent/alfresco-systemmessages-share/target/classes/META-INF/resources; 28 | 29 | # Load static web resources from different directory. 30 | # 31 | # This setting is dependent on application server plugin(Jetty, Tomcat, JBoss, ...) 32 | webappDir=/usr/local/tomcat/hotswap-agent/alfresco-systemmessages-share/target/classes/META-INF/resources; 33 | 34 | # Watch for changes in a directory (resources only). 35 | # 36 | # Similar to extraClasspath this property adds classpath when searching for resources (not classes). 37 | # While extra classpath just modifies the classloader, this setting does nothing until the resource 38 | # is really changed. 39 | # 40 | # Sometimes it is not possible to point extraClasspath to your i.e. src/main/resources, because there are multiple 41 | # replacements of resources in a building step (maven filtering resource option). 42 | # This setting will leave i.e. src/target/classes as default source for resources, but after the resource is modified 43 | # in src/main/resources, the new changed resource is served instead. 44 | # watchResources= 45 | 46 | LOGGER.org.hotswap.agent=DEBUG 47 | #LOGGER.org.hotswap.agent.plugin=TRACE 48 | #LOGGER.org.hotswap.agent.watch=TRACE 49 | #LOGGER.org.hotswap.agent.command=TRACE -------------------------------------------------------------------------------- /alfresco-systemmessages-share-docker/src/main/docker/log4j.properties: -------------------------------------------------------------------------------- 1 | # Set root logger level to error 2 | log4j.rootLogger=error, Console, File 3 | 4 | # Console appender definition # 5 | 6 | # All outputs currently set to be a ConsoleAppender. 7 | log4j.appender.Console=org.apache.log4j.ConsoleAppender 8 | log4j.appender.Console.layout=org.apache.log4j.PatternLayout 9 | 10 | # use log4j NDC to replace %x with tenant domain / username 11 | log4j.appender.Console.layout.ConversionPattern=%d{ISO8601} %x %-5p [%c{3}] [%t] %m%n 12 | #log4j.appender.Console.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c] %m%n 13 | 14 | # File appender definition # 15 | log4j.appender.File=org.apache.log4j.DailyRollingFileAppender 16 | log4j.appender.File.File=share.log 17 | log4j.appender.File.Append=true 18 | log4j.appender.File.DatePattern='.'yyyy-MM-dd 19 | log4j.appender.File.layout=org.apache.log4j.PatternLayout 20 | log4j.appender.File.layout.ConversionPattern=%d{yyyy-MM-dd} %d{ABSOLUTE} %-5p [%c] [%t] %m%n 21 | 22 | # Spring 23 | log4j.logger.org.springframework=warn 24 | # Turn off Spring remoting warnings that should really be info or debug. 25 | log4j.logger.org.springframework.remoting.support=error 26 | log4j.logger.org.springframework.util=error 27 | 28 | # MyFaces 29 | log4j.logger.org.apache.myfaces.util.DebugUtils=info 30 | log4j.logger.org.apache.myfaces.el.VariableResolverImpl=error 31 | log4j.logger.org.apache.myfaces.application.jsp.JspViewHandlerImpl=error 32 | log4j.logger.org.apache.myfaces.taglib=error 33 | 34 | # Alfresco 35 | log4j.logger.org.alfresco=error 36 | log4j.logger.org.alfresco.config=warn 37 | log4j.logger.org.alfresco.config.JndiObjectFactoryBean=warn 38 | log4j.logger.org.alfresco.web=info 39 | 40 | # Web Framework 41 | log4j.logger.org.springframework.extensions.webscripts=info 42 | log4j.logger.org.springframework.extensions.webscripts.ScriptLogger=warn 43 | log4j.logger.org.springframework.extensions.webscripts.ScriptDebugger=off 44 | 45 | # Freemarker 46 | # Note the freemarker.runtime logger is used to log non-fatal errors that are handled by Alfresco's retrying transaction handler 47 | log4j.logger.freemarker.runtime= 48 | 49 | #----------------------------------------------------------------------- 50 | # Custom Share module logging goes here... 51 | #----------------------------------------------------------------------- 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /alfresco-systemmessages-share-docker/src/main/docker/share-config-custom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | production 9 | 10 | 11 | 20 | false 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 31 | true 32 | 36 | false 37 | 38 | 39 | 40 | 44 | 45 | 46 | 47 | 48 | 49 | 53 | 54 | 55 | 56 | alfresco-noauth 57 | Alfresco - unauthenticated access 58 | Access to Alfresco Repository WebScripts that do not require authentication 59 | alfresco 60 | http://${acs.host}:8080/alfresco/s 61 | none 62 | 63 | 64 | 65 | alfresco 66 | Alfresco - user access 67 | Access to Alfresco Repository WebScripts that require user authentication 68 | alfresco 69 | http://${acs.host}:8080/alfresco/s 70 | user 71 | 72 | 73 | 74 | alfresco-feed 75 | Alfresco Feed 76 | Alfresco Feed - supports basic HTTP authentication via the EndPointProxyServlet 77 | http 78 | http://${acs.host}:8080/alfresco/s 79 | true 80 | user 81 | 82 | 83 | 84 | activiti-admin 85 | Activiti Admin UI - user access 86 | Access to Activiti Admin UI, that requires user authentication 87 | activiti-admin-connector 88 | http://${acs.host}:8080/alfresco/activiti-admin 89 | user 90 | 91 | 92 | 93 | alfresco-api 94 | alfresco 95 | Alfresco Public API - user access 96 | Access to Alfresco Repository Public API that require user authentication. 97 | This makes use of the authentication that is provided by parent 'alfresco' endpoint. 98 | alfresco 99 | http://${acs.host}:8080/alfresco/api 100 | user 101 | 102 | 103 | 104 | 105 | 106 | -------------------------------------------------------------------------------- /alfresco-systemmessages-share/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | alfresco-systemmessages-share 6 | Alfresco Share JAR Module 7 | jar 8 | Sample Share JAR Module (to be included in the share.war) - part of AIO - SDK 4.7 9 | 10 | 11 | com.redpill-linpro.alfresco 12 | alfresco-systemmessages 13 | 4.0 14 | 15 | 16 | 17 | 18 | 19 | 22 | 23 | 24 | ${alfresco.groupId} 25 | share 26 | classes 27 | 28 | 29 | 30 | 31 | 32 | 33 | org.apache.maven.plugins 34 | maven-assembly-plugin 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /alfresco-systemmessages-share/src/main/assembly/amp.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 18 | 19 | build-amp-file 20 | 21 | 22 | amp 23 | 24 | 25 | false 26 | 27 | 28 | 29 | 30 | src/main/resources/alfresco/module/${project.artifactId}/module.properties 31 | true 32 | 33 | 34 | 35 | src/main/assembly/file-mapping.properties 36 | false 37 | 38 | 39 | 40 | src/main/resources/alfresco/module/${project.artifactId}/log4j.properties 41 | false 42 | 43 | 44 | 45 | 46 | 47 | 48 | src/main/assembly/web 49 | web 50 | true 51 | 52 | README.md 53 | 54 | 55 | 56 | 57 | 60 | 61 | 62 | lib 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /alfresco-systemmessages-share/src/main/assembly/file-mapping.properties: -------------------------------------------------------------------------------- 1 | # Custom AMP to WAR location mappings 2 | 3 | # 4 | # The following property can be used to include the standard set of mappings. 5 | # The contents of this file will override any defaults. The default is 6 | # 'true', i.e. the default mappings will be augmented or modified by values in 7 | # this file. 8 | # 9 | # Default mappings are: 10 | # 11 | # /config=/WEB-INF/classes 12 | # /lib=/WEB-INF/lib 13 | # /licenses=/WEB-INF/licenses 14 | # /web/jsp=/jsp 15 | # /web/css=/css 16 | # /web/images=/images 17 | # /web/scripts=/scripts 18 | # /web/php=/php 19 | # 20 | include.default=true 21 | 22 | # 23 | # Custom mappings. If 'include.default' is false, then this is the complete set. 24 | # Map /web to / in AMP so we can override things like favicon.ico 25 | # 26 | /web=/ 27 | 28 | -------------------------------------------------------------------------------- /alfresco-systemmessages-share/src/main/java/com/redpill_linpro/alfresco/systemmessages/share/evaluator/IsAdmin.java: -------------------------------------------------------------------------------- 1 | package com.redpill_linpro.alfresco.systemmessages.share.evaluator; 2 | 3 | import org.alfresco.error.AlfrescoRuntimeException; 4 | import org.alfresco.web.evaluator.BaseEvaluator; 5 | import org.json.simple.JSONObject; 6 | import org.springframework.extensions.surf.RequestContext; 7 | import org.springframework.extensions.surf.support.ThreadLocalRequestContext; 8 | import org.springframework.extensions.webscripts.connector.User; 9 | 10 | /** 11 | * 12 | * @author Marcus Svartmark 13 | */ 14 | public class IsAdmin extends BaseEvaluator { 15 | 16 | @Override 17 | public boolean evaluate(JSONObject jsono) { 18 | try { 19 | RequestContext rc = ThreadLocalRequestContext.getRequestContext(); 20 | User user = rc.getUser(); 21 | 22 | return (user != null && user.isAdmin()); 23 | } catch (Exception err) { 24 | throw new AlfrescoRuntimeException( 25 | "Exception while running action evaluator: " 26 | + err.getMessage()); 27 | } 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /alfresco-systemmessages-share/src/main/resources/META-INF/redpill/components/global/notifications.css: -------------------------------------------------------------------------------- 1 | #notifications .notification { 2 | margin-top: 10px; 3 | padding: 15px 35px; 4 | margin-left: 10px; 5 | margin-right: 10px; 6 | 7 | /* default to yellow, ie. normal */ 8 | border: 1px solid #DDD6A0; 9 | background-color: #FFFBDD; 10 | } 11 | 12 | #notifications .title { 13 | color: #038603; 14 | padding-right: 0.8em; 15 | font-weight: bold; 16 | } 17 | 18 | /* types of notifocation */ 19 | #notifications .high,#notifications .warning { 20 | color: white; 21 | border: 1px solid #cf1956; 22 | background-color: rgb(185, 74, 72); 23 | } 24 | 25 | #notifications .high .title,#notifications .warning .title { 26 | color: white; 27 | } 28 | 29 | #notifications .normal,#notifications .info { 30 | border: 1px solid #DDD6A0; 31 | background-color: #FFFBDD; 32 | } 33 | 34 | #notifications .low { 35 | border: 1px solid #BABABA; 36 | background-color: #F9FCFD; 37 | } 38 | 39 | #notifications .low .title { 40 | color: #6CA5CE; 41 | } 42 | 43 | /* invites */ 44 | #notifications .invite-yes { 45 | color: #038603; 46 | padding-left: 20px; 47 | font-weight: bold; 48 | } 49 | #notifications .invite-no { 50 | padding-left: 10px; 51 | } 52 | 53 | #notifications .notification .close { 54 | float: right; 55 | width: 16px; 56 | height: 16px; 57 | background-image: url("/share/res/components/images/remove-icon-16.png"); 58 | background-position: center center; 59 | background-repeat: no-repeat; 60 | cursor: pointer; 61 | 62 | } -------------------------------------------------------------------------------- /alfresco-systemmessages-share/src/main/resources/META-INF/redpill/components/global/notifications.js: -------------------------------------------------------------------------------- 1 | /** 2 | * System notification 3 | * 4 | */ 5 | (function(){ //function scope 6 | 7 | var Dom = YAHOO.util.Dom; 8 | var Event = YAHOO.util.Event; 9 | var Cookie = YAHOO.util.Cookie; 10 | var Bubbling = YAHOO.Bubbling; 11 | 12 | /** 13 | * System messages 14 | * 15 | */ 16 | var SystemNotifications = function() { 17 | //Do an ajax request to check for messagexs 18 | Alfresco.util.Ajax.jsonGet({ 19 | url: '/share/proxy/alfresco/api/redpill/notifications?active=true', 20 | successCallback: { 21 | fn: (function (res) { 22 | if (res.json && res.json.notifications) { 23 | //If the server is really fast we get a response before the DOM is ready, at least its possible theoretically 24 | Event.onDOMReady((function(){ 25 | this._callback(res.json.notifications); 26 | }).bind(this)); 27 | } 28 | }).bind(this) 29 | } 30 | }); 31 | 32 | }; 33 | 34 | SystemNotifications.prototype._callback = function(data) { 35 | for (var i=0; i':''); 106 | 107 | //add to notifications 108 | n.node = Dom.getFirstChild(tmp); 109 | notifications_div.appendChild(n.node); 110 | 111 | if (n.close) { 112 | //hook up close event 113 | Dom.getElementsByClassName('close','a',n.node,function(a){ 114 | Event.on(a,'click',function(e){ 115 | Event.stopPropagation(e); 116 | 117 | //Dom.addClass(n.node,'hidden'); 118 | Alfresco.util.Anim.fadeOut(n.node); 119 | //do callback 120 | if (YAHOO.lang.isFunction(n.close)) { 121 | n.close(n); 122 | } 123 | }); 124 | }); 125 | } 126 | }); 127 | 128 | /** 129 | * Start it all off 130 | * 131 | */ 132 | 133 | function init() { 134 | var system = new SystemNotifications(); 135 | } 136 | 137 | var currentUser = Alfresco.constants.USERNAME.toLowerCase(); 138 | if (currentUser !== "guest"){ 139 | YAHOO.util.Event.onContentReady('HEADER_LICENSE_WARNING', init, this); 140 | } 141 | 142 | 143 | })(); 144 | -------------------------------------------------------------------------------- /alfresco-systemmessages-share/src/main/resources/META-INF/redpill/components/global/notifications.min.js: -------------------------------------------------------------------------------- 1 | 'use strict';(function(){function m(){new f}var e=YAHOO.util.Dom,g=YAHOO.util.Event,k=YAHOO.util.Cookie,l=YAHOO.Bubbling,f=function(){Alfresco.util.Ajax.jsonGet({url:"/share/proxy/alfresco/api/redpill/notifications?active=true",successCallback:{fn:function(b){if(b.json&&b.json.notifications)g.onDOMReady(function(){this._callback(b.json.notifications)}.bind(this))}.bind(this)}})};f.prototype._callback=function(b){for(var c=0;c{close}{title}{text}'.replace("{id}",a.id).replace("{type}",a.type.toLowerCase()).replace("{title}",a.title).replace("{text}",a.text).replace("{close}",a.close?'':"");a.node=e.getFirstChild(c); 4 | d.appendChild(a.node);a.close&&e.getElementsByClassName("close","a",a.node,function(h){g.on(h,"click",function(n){g.stopPropagation(n);Alfresco.util.Anim.fadeOut(a.node);YAHOO.lang.isFunction(a.close)&&a.close(a)})})});if("guest"!==Alfresco.constants.USERNAME.toLowerCase())YAHOO.util.Event.onContentReady("HEADER_LICENSE_WARNING",m,this)})(); 5 | -------------------------------------------------------------------------------- /alfresco-systemmessages-share/src/main/resources/META-INF/redpill/components/system-messages/system-messages-admin.js: -------------------------------------------------------------------------------- 1 | var Redpill = Redpill || {}; 2 | Alfresco.logger.debug("system-messages-admin.js"); 3 | 4 | Redpill.SystemMessages = function (htmlId) { 5 | Redpill.SystemMessages.superclass.constructor.call(this, 6 | "Redpill.SystemMessages", 7 | htmlId, 8 | ["button", "container", "datasource", "datatable", "paginator", "history", "animation"] 9 | ); 10 | 11 | return this; 12 | }; 13 | 14 | YAHOO.extend(Redpill.SystemMessages, Alfresco.component.Base, { 15 | 16 | notificationsUrl: Alfresco.constants.PROXY_URI + "api/redpill/notifications", 17 | 18 | onReady: function () { 19 | Alfresco.logger.debug("onReady", arguments); 20 | Alfresco.util.Ajax.jsonGet({ 21 | url: Alfresco.constants.PROXY_URI + "api/redpill/notifications/datalist", 22 | responseContentType: Alfresco.util.Ajax.JSON, 23 | successCallback: { 24 | fn: function (response) { 25 | console.log(response); 26 | this.dataList = response.json.nodeRef; 27 | }, 28 | scope: this 29 | }, 30 | failureMessage: this.msg("operation.failed") 31 | }); 32 | this.setupDataTable(); 33 | this.setupNewMessageButton(); 34 | Alfresco.logger.debug("END onReady"); 35 | }, 36 | setupNewMessageButton: function () { 37 | this.widgets.newMessageButton = 38 | new YAHOO.widget.Button(this.id + "-new-message"); 39 | this.widgets.newMessageButton.on( 40 | "click", 41 | function () { 42 | this.onNewRow(); 43 | }, 44 | null, 45 | this 46 | ); 47 | }, 48 | actionFormatter: function (elCell, oRecord, oColumn, oData) { 49 | Alfresco.logger.debug("actionFormatter", arguments); 50 | var nodeRef = oRecord.getData().nodeRef; 51 | elCell.innerHTML = ""; 55 | Alfresco.logger.debug("END actionFormatter"); 56 | }, 57 | timeFormatter: function (elCell, oRecord, oColumn, oData) { 58 | var timeISODateTime = oData; 59 | if (timeISODateTime !== null) 60 | { 61 | var time = Alfresco.util.fromISO8601(timeISODateTime); 62 | elCell.innerHTML = Alfresco.util.formatDate(time); 63 | } 64 | else 65 | { 66 | elCell.innerHTML = this.msg("label.none"); 67 | } 68 | }, 69 | typeFormatter: function (elCell, oRecord, oColumn, oData) { 70 | var html = ''; 71 | 72 | if (oData) { 73 | html = this.msg("systemmessages.priority." + oData.toLowerCase()); 74 | } 75 | 76 | elCell.innerHTML = html; 77 | }, 78 | 79 | setupDataTable: function () { 80 | Alfresco.logger.debug("setupDataTable", arguments); 81 | var columnDefinitions = [ 82 | { 83 | key: "title", 84 | label: this.msg("title.title"), 85 | sortable: false 86 | }, 87 | { 88 | key: "text", 89 | label: this.msg("title.text"), 90 | sortable: false 91 | }, 92 | { 93 | key: "startTime", 94 | label: this.msg("title.startTime"), 95 | sortable: true, 96 | formatter: this.timeFormatter.bind(this) 97 | }, 98 | { 99 | key: "endTime", 100 | label: this.msg("title.endTime"), 101 | sortable: true, 102 | formatter: this.timeFormatter.bind(this) 103 | }, 104 | { 105 | key: "type", 106 | label: this.msg("title.type"), 107 | sortable: false, 108 | formatter: this.typeFormatter.bind(this) 109 | }, 110 | { 111 | key: "actions", 112 | label: this.msg("title.actions"), 113 | sortable: false, 114 | formatter: this.actionFormatter.bind(this) 115 | } 116 | ]; 117 | 118 | // DataSource definition 119 | 120 | var dataSource = this.widgets.dataSource = 121 | new YAHOO.util.DataSource(this.notificationsUrl, { 122 | responseType: YAHOO.util.DataSource.TYPE_JSON, 123 | connXhrMode: "queueRequests", 124 | responseSchema: { 125 | resultsList: "notifications", 126 | fields: ["id","nodeRef", "title", "text", "startTime","endTime", "type"] 127 | 128 | } 129 | }); 130 | // DataTable definition 131 | var dataTable = this.widgets.dataTable = 132 | new YAHOO.widget.DataTable( 133 | this.id + "-messages", 134 | columnDefinitions, 135 | dataSource, 136 | { 137 | initialLoad: {}, 138 | MSG_LOADING: this.msg("loading.messages"), 139 | MSG_EMPTY: this.msg("no.messages.found") 140 | } 141 | ); 142 | 143 | // Enables row highlighting 144 | dataTable.subscribe("rowMouseoverEvent", dataTable.onEventHighlightRow); 145 | dataTable.subscribe("rowMouseoutEvent", dataTable.onEventUnhighlightRow); 146 | 147 | // Attach event to update links 148 | YAHOO.util.Event.delegate( 149 | this.id, 150 | "click", 151 | this.onEditRow.bind(this), 152 | "a.edit-message" 153 | ); 154 | 155 | // Attach event to delete links 156 | YAHOO.util.Event.delegate( 157 | this.id, 158 | "click", 159 | this.onDeleteRow.bind(this), 160 | "a.delete-message" 161 | ); 162 | }, 163 | 164 | onDeleteRow:function(event,element) 165 | { 166 | var tr = element.parentNode.parentNode.parentNode; 167 | var record = this.widgets.dataTable.getRecord(tr); 168 | var parsedNodeRef = Alfresco.util.NodeRef(record.getData().nodeRef); 169 | var url = YAHOO.lang.substitute( 170 | Alfresco.constants.PROXY_URI + 171 | "api/redpill/delete/{storeType}/{storeId}/{id}", 172 | parsedNodeRef 173 | ); 174 | if(confirm(this.msg("message.delete.confirm"))) 175 | { 176 | Alfresco.util.Ajax.jsonDelete({ 177 | url: url, 178 | responseContentType: Alfresco.util.Ajax.JSON, 179 | successCallback: { 180 | fn: function (response) { 181 | Alfresco.util.PopupManager.displayMessage( 182 | { 183 | text: this.msg("message.delete.success",record.getData().title) 184 | }); 185 | this.widgets.dataTable.deleteRow(record); 186 | }, 187 | scope: this 188 | }, 189 | failureMessage: this.msg("operation.failed") 190 | }); 191 | } 192 | }, 193 | 194 | onNewRow: function DataListToolbar_onNewRow(e, p_obj) 195 | { 196 | var destination = this.dataList; 197 | var itemType = "rlsm:systemMessage"; 198 | // Intercept before dialog show 199 | var doBeforeDialogShow = function DataListToolbar_onNewRow_doBeforeDialogShow(p_form, p_dialog) 200 | { 201 | Alfresco.util.populateHTML( 202 | [ p_dialog.id + "-dialogTitle", this.msg("label.new-row.title") ], 203 | [ p_dialog.id + "-dialogHeader", this.msg("label.new-row.header") ] 204 | ); 205 | }; 206 | 207 | var templateUrl = YAHOO.lang.substitute(Alfresco.constants.URL_SERVICECONTEXT + "components/form?itemKind={itemKind}&itemId={itemId}&destination={destination}&mode={mode}&submitType={submitType}&showCancelButton=true", 208 | { 209 | itemKind: "type", 210 | itemId: itemType, 211 | destination: destination, 212 | mode: "create", 213 | submitType: "json" 214 | }); 215 | 216 | // Using Forms Service, so always create new instance 217 | var createRow = new Alfresco.module.SimpleDialog(this.id + "-createRow"); 218 | 219 | createRow.setOptions( 220 | { 221 | templateUrl: templateUrl, 222 | actionUrl: null, 223 | destroyOnHide: true, 224 | doBeforeDialogShow: 225 | { 226 | fn: doBeforeDialogShow, 227 | scope: this 228 | }, 229 | onSuccess: 230 | { 231 | fn: function DataListToolbar_onNewRow_success(response) 232 | { 233 | var data = response.config.dataObj; 234 | var nodeRef = Alfresco.util.NodeRef(response.json.persistedObject); 235 | var item = 236 | { 237 | id:nodeRef.id, 238 | nodeRef:nodeRef.toString(), 239 | title:data.prop_rlsm_systemMessageTitle, 240 | text:data.prop_rlsm_systemMessageDescription, 241 | type:data.prop_rlsm_systemMessagePriority, 242 | startTime:data.prop_rlsm_systemMessageStartTime, 243 | endTime:data.prop_rlsm_systemMessageEndTime 244 | }; 245 | Alfresco.util.PopupManager.displayMessage( 246 | { 247 | text: this.msg("message.new-row.success") 248 | }); 249 | this.widgets.dataTable.addRow(item); 250 | }, 251 | scope: this 252 | }, 253 | onFailure: 254 | { 255 | fn: function DataListToolbar_onNewRow_failure(response) 256 | { 257 | Alfresco.util.PopupManager.displayMessage( 258 | { 259 | text: this.msg("message.new-row.failure") 260 | }); 261 | }, 262 | scope: this 263 | } 264 | }).show(); 265 | }, 266 | onEditRow:function(event,element) 267 | { 268 | var tr = element.parentNode.parentNode.parentNode; 269 | var record = this.widgets.dataTable.getRecord(tr) 270 | var data = record.getData(); 271 | var destination = this.dataList; 272 | var itemType = "rlsm:systemMessage"; 273 | // Intercept before dialog show 274 | var doBeforeDialogShow = function(p_form, p_dialog) 275 | { 276 | Alfresco.util.populateHTML( 277 | [ p_dialog.id + "-dialogTitle", this.msg("label.new-row.title") ], 278 | [ p_dialog.id + "-dialogHeader", this.msg("label.new-row.header") ] 279 | ); 280 | }; 281 | 282 | var templateUrl = YAHOO.lang.substitute(Alfresco.constants.URL_SERVICECONTEXT + "components/form?submitType=json&itemKind={itemKind}&itemId={itemId}&mode={mode}&showCancelButton=true", 283 | { 284 | itemKind: "node", 285 | itemId: data.nodeRef, 286 | mode: "edit", 287 | }); 288 | 289 | var editRow = new Alfresco.module.SimpleDialog(this.id + "-editRow"); 290 | editRow.setOptions( 291 | { 292 | templateUrl: templateUrl, 293 | actionUrl: null, 294 | destroyOnHide: true, 295 | doBeforeDialogShow: 296 | { 297 | fn: doBeforeDialogShow, 298 | scope: this 299 | }, 300 | onSuccess: 301 | { 302 | fn: function(response) 303 | { 304 | var dataObj = response.config.dataObj; 305 | data.text = dataObj.prop_rlsm_systemMessageDescription; 306 | data.title = dataObj.prop_rlsm_systemMessageTitle; 307 | data.type = dataObj.prop_rlsm_systemMessagePriority; 308 | data.startTime = dataObj.prop_rlsm_systemMessageStartTime; 309 | data.endTime = dataObj.prop_rlsm_systemMessageEndTime; 310 | Alfresco.util.PopupManager.displayMessage( 311 | { 312 | text: this.msg("message.edit.success") 313 | }); 314 | this.widgets.dataTable.updateRow(record, data); 315 | }, 316 | scope: this 317 | }, 318 | onFailure: 319 | { 320 | fn: function (response) 321 | { 322 | Alfresco.util.PopupManager.displayMessage( 323 | { 324 | text: this.msg("message.edit.failure") 325 | }); 326 | }, 327 | scope: this 328 | } 329 | }).show(); 330 | } 331 | }); 332 | -------------------------------------------------------------------------------- /alfresco-systemmessages-share/src/main/resources/META-INF/redpill/components/system-messages/system-messages-admin.min.js: -------------------------------------------------------------------------------- 1 | 'use strict';var Redpill=Redpill||{};Alfresco.logger.debug("system-messages-admin.js");Redpill.SystemMessages=function(a){Redpill.SystemMessages.superclass.constructor.call(this,"Redpill.SystemMessages",a,"button container datasource datatable paginator history animation".split(" "));return this}; 2 | YAHOO.extend(Redpill.SystemMessages,Alfresco.component.Base,{notificationsUrl:Alfresco.constants.PROXY_URI+"api/redpill/notifications",onReady:function(){Alfresco.logger.debug("onReady",arguments);Alfresco.util.Ajax.jsonGet({url:Alfresco.constants.PROXY_URI+"api/redpill/notifications/datalist",responseContentType:Alfresco.util.Ajax.JSON,successCallback:{fn:function(a){console.log(a);this.dataList=a.json.nodeRef},scope:this},failureMessage:this.msg("operation.failed")});this.setupDataTable();this.setupNewMessageButton(); 3 | Alfresco.logger.debug("END onReady")},setupNewMessageButton:function(){this.widgets.newMessageButton=new YAHOO.widget.Button(this.id+"-new-message");this.widgets.newMessageButton.on("click",function(){this.onNewRow()},null,this)},actionFormatter:function(a,d,c,b){Alfresco.logger.debug("actionFormatter",arguments);d.getData();a.innerHTML="";Alfresco.logger.debug("END actionFormatter")}, 4 | timeFormatter:function(a,d,c,b){null!==b?(d=Alfresco.util.fromISO8601(b),a.innerHTML=Alfresco.util.formatDate(d)):a.innerHTML=this.msg("label.none")},typeFormatter:function(a,d,c,b){d="";b&&(d=this.msg("systemmessages.priority."+b.toLowerCase()));a.innerHTML=d},setupDataTable:function(){Alfresco.logger.debug("setupDataTable",arguments);var a=[{key:"title",label:this.msg("title.title"),sortable:!1},{key:"text",label:this.msg("title.text"),sortable:!1},{key:"startTime",label:this.msg("title.startTime"), 5 | sortable:!0,formatter:this.timeFormatter.bind(this)},{key:"endTime",label:this.msg("title.endTime"),sortable:!0,formatter:this.timeFormatter.bind(this)},{key:"type",label:this.msg("title.type"),sortable:!1,formatter:this.typeFormatter.bind(this)},{key:"actions",label:this.msg("title.actions"),sortable:!1,formatter:this.actionFormatter.bind(this)}],d=this.widgets.dataSource=new YAHOO.util.DataSource(this.notificationsUrl,{responseType:YAHOO.util.DataSource.TYPE_JSON,connXhrMode:"queueRequests",responseSchema:{resultsList:"notifications", 6 | fields:"id nodeRef title text startTime endTime type".split(" ")}});a=this.widgets.dataTable=new YAHOO.widget.DataTable(this.id+"-messages",a,d,{initialLoad:{},MSG_LOADING:this.msg("loading.messages"),MSG_EMPTY:this.msg("no.messages.found")});a.subscribe("rowMouseoverEvent",a.onEventHighlightRow);a.subscribe("rowMouseoutEvent",a.onEventUnhighlightRow);YAHOO.util.Event.delegate(this.id,"click",this.onEditRow.bind(this),"a.edit-message");YAHOO.util.Event.delegate(this.id,"click",this.onDeleteRow.bind(this), 7 | "a.delete-message")},onDeleteRow:function(a,d){var c=this.widgets.dataTable.getRecord(d.parentNode.parentNode.parentNode);a=Alfresco.util.NodeRef(c.getData().nodeRef);a=YAHOO.lang.substitute(Alfresco.constants.PROXY_URI+"api/redpill/delete/{storeType}/{storeId}/{id}",a);confirm(this.msg("message.delete.confirm"))&&Alfresco.util.Ajax.jsonDelete({url:a,responseContentType:Alfresco.util.Ajax.JSON,successCallback:{fn:function(b){Alfresco.util.PopupManager.displayMessage({text:this.msg("message.delete.success", 8 | c.getData().title)});this.widgets.dataTable.deleteRow(c)},scope:this},failureMessage:this.msg("operation.failed")})},onNewRow:function(a,d){a=YAHOO.lang.substitute(Alfresco.constants.URL_SERVICECONTEXT+"components/form?itemKind={itemKind}&itemId={itemId}&destination={destination}&mode={mode}&submitType={submitType}&showCancelButton=true",{itemKind:"type",itemId:"rlsm:systemMessage",destination:this.dataList,mode:"create",submitType:"json"});(new Alfresco.module.SimpleDialog(this.id+"-createRow")).setOptions({templateUrl:a, 9 | actionUrl:null,destroyOnHide:!0,doBeforeDialogShow:{fn:function(c,b){Alfresco.util.populateHTML([b.id+"-dialogTitle",this.msg("label.new-row.title")],[b.id+"-dialogHeader",this.msg("label.new-row.header")])},scope:this},onSuccess:{fn:function(c){var b=c.config.dataObj;c=Alfresco.util.NodeRef(c.json.persistedObject);b={id:c.id,nodeRef:c.toString(),title:b.prop_rlsm_systemMessageTitle,text:b.prop_rlsm_systemMessageDescription,type:b.prop_rlsm_systemMessagePriority,startTime:b.prop_rlsm_systemMessageStartTime, 10 | endTime:b.prop_rlsm_systemMessageEndTime};Alfresco.util.PopupManager.displayMessage({text:this.msg("message.new-row.success")});this.widgets.dataTable.addRow(b)},scope:this},onFailure:{fn:function(c){Alfresco.util.PopupManager.displayMessage({text:this.msg("message.new-row.failure")})},scope:this}}).show()},onEditRow:function(a,d){var c=this.widgets.dataTable.getRecord(d.parentNode.parentNode.parentNode),b=c.getData();a=YAHOO.lang.substitute(Alfresco.constants.URL_SERVICECONTEXT+"components/form?submitType=json&itemKind={itemKind}&itemId={itemId}&mode={mode}&showCancelButton=true", 11 | {itemKind:"node",itemId:b.nodeRef,mode:"edit"});(new Alfresco.module.SimpleDialog(this.id+"-editRow")).setOptions({templateUrl:a,actionUrl:null,destroyOnHide:!0,doBeforeDialogShow:{fn:function(e,f){Alfresco.util.populateHTML([f.id+"-dialogTitle",this.msg("label.new-row.title")],[f.id+"-dialogHeader",this.msg("label.new-row.header")])},scope:this},onSuccess:{fn:function(e){e=e.config.dataObj;b.text=e.prop_rlsm_systemMessageDescription;b.title=e.prop_rlsm_systemMessageTitle;b.type=e.prop_rlsm_systemMessagePriority; 12 | b.startTime=e.prop_rlsm_systemMessageStartTime;b.endTime=e.prop_rlsm_systemMessageEndTime;Alfresco.util.PopupManager.displayMessage({text:this.msg("message.edit.success")});this.widgets.dataTable.updateRow(c,b)},scope:this},onFailure:{fn:function(e){Alfresco.util.PopupManager.displayMessage({text:this.msg("message.edit.failure")})},scope:this}}).show()}}); 13 | -------------------------------------------------------------------------------- /alfresco-systemmessages-share/src/main/resources/alfresco/module/alfresco-systemmessages-share/module.properties: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | 17 | 18 | # SDK Sample module 19 | 20 | # ==== Beginning of Alfresco required/optional properties ====== # 21 | # NB: These properties are filtered at build time by Maven, single 22 | # sourcing from POM properties 23 | module.id=${project.artifactId} 24 | #module.aliases=myModule-123, my-module 25 | module.title=${project.name} 26 | module.description=${project.description} 27 | module.version=${project.version} 28 | 29 | # The following optional properties can be used to prevent the module from being added 30 | # to inappropriate versions of the WAR file. 31 | # module.repo.version.min=2.0 32 | # module.repo.version.max=2.1 33 | 34 | # FIXME: This dependencies should come out of mvn dependencies on amp 35 | 36 | # The following describe dependencies on other modules 37 | # Depends on net.sf.myproject.module.SupportModuleA version ${version} or later 38 | # module.depends.net.sf.myproject.module.SupportModuleA=${version}-* 39 | # Depends on net.sf.myproject.module.SupportModuleA version ${version} to 2.0 40 | # module.depends.net.sf.myproject.module.SupportModuleB=${version}-2.0 41 | # Depends on net.sf.myproject.module.SupportModuleC - any version 42 | # module.depends.net.sf.myproject.module.SupportModuleB=* 43 | 44 | 45 | # ==== End of Alfresco required/optional properties ======= # 46 | 47 | 48 | # ==== Beginning of module required properties/optional ====== # -------------------------------------------------------------------------------- /alfresco-systemmessages-share/src/main/resources/alfresco/web-extension/messages/systemmessages_en.properties: -------------------------------------------------------------------------------- 1 | systemmessages.admin-console.title=System Messages 2 | title.title=Title 3 | title.text=Description 4 | title.startTime=Start time 5 | title.endTime=End time 6 | title.type=Priority 7 | title.actions=Actions 8 | new.message=New Message 9 | label.edit.title=Edit Message 10 | label.new-row.title=New Message 11 | message.new-row.success=Added new message 12 | message.edit.success=Sucessfully updated message 13 | message.new-row.failure=Failure when adding message 14 | message.edit.failure=Failure when updating message 15 | message.delete.confirm=Are you sure you want to delete this message? 16 | tool.system-messages-admin.label=System Messages 17 | tool.system-messages-admin.description=System Messages Administration 18 | no.messages.found=No messages 19 | systemmessages.priority.high=High 20 | systemmessages.priority.normal=Normal 21 | systemmessages.priority.low=Low -------------------------------------------------------------------------------- /alfresco-systemmessages-share/src/main/resources/alfresco/web-extension/messages/systemmessages_fr.properties: -------------------------------------------------------------------------------- 1 | systemmessages.admin-console.title=Messages syst\u00e8me 2 | title.title=Titre 3 | title.text=Description 4 | title.startTime=Date de d\u00e9but 5 | title.endTime=Date de fin 6 | title.type=Priorit\u00e9 7 | title.actions=Actions 8 | new.message=Nouveau message 9 | label.edit.title=\u00c9diter le message 10 | label.new-row.title=Nouveau message 11 | message.new-row.success=Message ajout\u00e9 avec succ\u00e8s 12 | message.edit.success=Message mis \u00e0 jour avec succ\u00e8s 13 | message.new-row.failure=Une erreur s'est produite lors de l'ajout du message 14 | message.edit.failure=Une erreur s'est produite lors de la mise \u00e0 jour du message 15 | message.delete.confirm=\u00cates-vous s\u00fbr de vouloir supprimer ce message ? 16 | tool.system-messages-admin.label=Messages syst\u00e8me 17 | tool.system-messages-admin.description=Administration des messages syst\u00e8me 18 | no.messages.found=Aucun message 19 | systemmessages.priority.high=\u00c9lev\u00e9e 20 | systemmessages.priority.normal=Normale 21 | systemmessages.priority.low=Basse -------------------------------------------------------------------------------- /alfresco-systemmessages-share/src/main/resources/alfresco/web-extension/messages/systemmessages_sv.properties: -------------------------------------------------------------------------------- 1 | systemmessages.admin-console.title=Systemmeddelanden 2 | title.title=Titel 3 | title.text=Beskrivning 4 | title.startTime=Starttid 5 | title.endTime=Sluttid 6 | title.type=Prioritet 7 | title.actions=Funktioner 8 | new.message=Nytt meddelande 9 | label.edit.title=Redigera meddelande 10 | label.new-row.title=Nytt meddelande 11 | message.new-row.success=Lade till nytt meddelande 12 | message.edit.success=\u00c4ndrade meddelande 13 | message.new-row.failure=Misslyckades l\u00e4gga till nytt meddelande 14 | message.edit.failure=Misslyckades uppdatera meddelande 15 | message.delete.confirm=\u00c4r du s\u00e4ker p\u00e5 att du vill ta bort detta meddelandet? 16 | tool.system-messages-admin.label=Systemmeddelanden 17 | tool.system-messages-admin.description=Administration av Systemmeddelanden 18 | no.messages.found=Inga meddelanden 19 | systemmessages.priority.high=H\u00f6g 20 | systemmessages.priority.normal=Normal 21 | systemmessages.priority.low=L\u00e5g -------------------------------------------------------------------------------- /alfresco-systemmessages-share/src/main/resources/alfresco/web-extension/site-data/extensions/systemmessages-module.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | System Messages - Show System messages 5 | true 6 | ${project.version} 7 | 8 | 9 | 10 | org.alfresco 11 | com.redpill-linpro.global.alfresco 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /alfresco-systemmessages-share/src/main/resources/alfresco/web-extension/site-webscripts/com/redpill-linpro/global/alfresco/components/head/resources.get.html.ftl: -------------------------------------------------------------------------------- 1 | <#-- @overridden projects/slingshot/config/alfresco/site-webscripts/org/alfresco/components/head/resources.get.html.ftl --> 2 | 3 | <@markup id="systemmessages-alfrescoResources" action="after" target="alfrescoResources" scope="global"> 4 | <@link href="${url.context}/res/redpill/components/global/notifications.css" group="template-common"/> 5 | <@script type="text/javascript" src="${url.context}/res/yui/cookie/cookie.js" group="template-common"/> 6 | <@script type="text/javascript" src="${url.context}/res/redpill/components/global/notifications.js" group="template-common"> 7 | -------------------------------------------------------------------------------- /alfresco-systemmessages-share/src/main/resources/alfresco/web-extension/site-webscripts/com/redpill-linpro/system-messages/system-messages-admin.get.desc.xml: -------------------------------------------------------------------------------- 1 | 2 | System messages admin panel 3 | System messages admin panel 4 | admin-console 5 | /components/console/system-messages/admin 6 | admin 7 | 8 | -------------------------------------------------------------------------------- /alfresco-systemmessages-share/src/main/resources/alfresco/web-extension/site-webscripts/com/redpill-linpro/system-messages/system-messages-admin.get.html.ftl: -------------------------------------------------------------------------------- 1 | <@markup id="js"> 2 | <#-- JavaScript Dependencies --> 3 | <#include "/org/alfresco/components/form/form.js.ftl"/> 4 | <@script src="${url.context}/res/redpill/components/system-messages/system-messages-admin.js" group="console"/> 5 | <@script src="${url.context}/res/modules/simple-dialog.js" group="console"/> 6 | <@script src="${url.context}/res/components/console/consoletool.js" group="console"/> 7 | 8 | 9 | <@markup id="widgets"> 10 | <@createWidgets group="console"/> 11 | 12 | 13 | <@markup id="html"> 14 | <@uniqueIdDiv> 15 | <#assign el=args.htmlid?html> 16 |
${msg('systemmessages.admin-console.title')}
17 | 18 |
19 |
${msg('systemmessages.admin-console.title')}
20 |
21 | 24 |
25 |
26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /alfresco-systemmessages-share/src/main/resources/alfresco/web-extension/site-webscripts/com/redpill-linpro/system-messages/system-messages-admin.get.js: -------------------------------------------------------------------------------- 1 | function main() { 2 | // Widget instantiation metadata... 3 | var widget = { 4 | id: "SystemMessages", 5 | name: "Redpill.SystemMessages", 6 | }; 7 | model.widgets = [widget]; 8 | } 9 | main(); -------------------------------------------------------------------------------- /alfresco-systemmessages-share/src/main/resources/alfresco/web-extension/systemmessages-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | alfresco.web-extension.messages.systemmessages 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | classpath:alfresco/web-extension/systemmessages-datalist-config.xml 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /alfresco-systemmessages-share/src/main/resources/alfresco/web-extension/systemmessages-datalist-config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
32 |
33 |
-------------------------------------------------------------------------------- /all-pages-sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Redpill-Linpro/alfresco-systemmessages/ad88946f0c782e6cad00ca0b3c173722ee67efcc/all-pages-sm.png -------------------------------------------------------------------------------- /docker/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.4' 2 | services: 3 | alfresco-systemmessages-share: 4 | image: alfresco-share-alfresco-systemmessages:development 5 | build: 6 | dockerfile: ./Dockerfile 7 | context: ../../../alfresco-systemmessages-share-docker/target 8 | environment: 9 | CATALINA_OPTS: "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=0.0.0.0:8888" 10 | REPO_HOST: alfresco-systemmessages-acs 11 | REPO_PORT: 8080 12 | ports: 13 | - "${share.port}:8080" 14 | - "${share.debug.port}:8888" 15 | alfresco-systemmessages-acs: 16 | image: alfresco-content-services-alfresco-systemmessages:development 17 | build: 18 | dockerfile: ./Dockerfile 19 | context: ../../../alfresco-systemmessages-platform-docker/target 20 | environment: 21 | JAVA_TOOL_OPTIONS: "${keystore.settings}" 22 | JAVA_OPTS: " 23 | -Dsolr.secureComms=secret 24 | -Dsolr.sharedSecret=secret 25 | -Dmessaging.broker.url=\"failover:(nio://alfresco-systemmessages-activemq:61616)?timeout=3000&jms.useCompression=true\" 26 | " 27 | CATALINA_OPTS: "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=0.0.0.0:8888" 28 | ports: 29 | - "${acs.port}:8080" 30 | - "${acs.debug.port}:8888" 31 | volumes: 32 | - alfresco-systemmessages-acs-volume:/usr/local/tomcat/alf_data 33 | depends_on: 34 | - alfresco-systemmessages-postgres 35 | alfresco-systemmessages-postgres: 36 | image: postgres:9.6 37 | environment: 38 | POSTGRES_DB: alfresco 39 | POSTGRES_USER: alfresco 40 | POSTGRES_PASSWORD: alfresco 41 | command: postgres -c max_connections=300 -c log_min_messages=LOG 42 | ports: 43 | - "${postgres.port}:5432" 44 | volumes: 45 | - alfresco-systemmessages-db-volume:/var/lib/postgresql/data 46 | alfresco-systemmessages-ass: 47 | image: alfresco/alfresco-search-services:2.0.3 48 | environment: 49 | SOLR_ALFRESCO_HOST: alfresco-systemmessages-acs 50 | SOLR_ALFRESCO_PORT: 8080 51 | SOLR_SOLR_HOST: alfresco-systemmessages-ass 52 | SOLR_SOLR_PORT: 8983 53 | SOLR_CREATE_ALFRESCO_DEFAULTS: alfresco,archive 54 | ALFRESCO_SECURE_COMMS: "secret" 55 | JAVA_TOOL_OPTIONS: "-Dalfresco.secureComms.secret=secret" 56 | ports: 57 | - "8983:8983" 58 | volumes: 59 | - alfresco-systemmessages-ass-volume:/opt/alfresco-search-services/contentstore 60 | - alfresco-systemmessages-ass-volume:/opt/alfresco-search-services/data 61 | alfresco-systemmessages-activemq: 62 | image: alfresco/alfresco-activemq:5.16.1 63 | mem_limit: 1g 64 | ports: 65 | - 8161:8161 # Web Console 66 | - 5672:5672 # AMQP 67 | - 61616:61616 # OpenWire 68 | - 61613:61613 # STOMP 69 | 70 | volumes: 71 | alfresco-systemmessages-acs-volume: 72 | external: true 73 | alfresco-systemmessages-db-volume: 74 | external: true 75 | alfresco-systemmessages-ass-volume: 76 | external: true 77 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | com.redpill-linpro.alfresco 5 | alfresco-systemmessages 6 | 4.0 7 | AIO - SDK 4.7 8 | All-In-One (AIO) project for SDK 4.7 9 | pom 10 | 11 | 12 | 3.3.0 13 | 14 | 15 | 16 | 17 | 4.7.0 18 | 19 | UTF-8 20 | 21 | 22 | org.alfresco 23 | acs-community-packaging 24 | 23.1.0 25 | alfresco 26 | 23.1.0.269 27 | 23.1.0 28 | 29 | 30 | alfresco/alfresco-content-repository-community 31 | alfresco/alfresco-share 32 | 33 | -Dencryption.keystore.type=JCEKS 34 | -Dencryption.cipherAlgorithm=AES/CBC/PKCS5Padding 35 | -Dencryption.keyAlgorithm=AES 36 | -Dencryption.keystore.location=/usr/local/tomcat/shared/classes/alfresco/extension/keystore/keystore 37 | -Dmetadata-keystore.password=mp6yc0UD9e 38 | -Dmetadata-keystore.aliases=metadata 39 | -Dmetadata-keystore.metadata.password=oKIWzVdEdA 40 | -Dmetadata-keystore.metadata.algorithm=AES 41 | 42 | 43 | 44 | 1.1.8 45 | 46 | 47 | 8180 48 | 9898 49 | alfresco-systemmessages-acs 50 | 8080 51 | 8888 52 | 5555 53 | 54 | 55 | 56 | 57 | 58 | 59 | 61 | 62 | 63 | junit 64 | junit 65 | test 66 | 67 | 68 | 69 | org.mockito 70 | mockito-core 71 | 4.2.0 72 | test 73 | 74 | 75 | 76 | org.apache.httpcomponents 77 | httpclient 78 | test 79 | 80 | 81 | 82 | 83 | ${alfresco.groupId} 84 | alfresco-remote-api 85 | provided 86 | 87 | 88 | 89 | 90 | org.alfresco.maven 91 | alfresco-rad 92 | ${alfresco.sdk.version} 93 | test 94 | 95 | 96 | 97 | 98 | 99 | 105 | 106 | ${alfresco.groupId} 107 | ${alfresco.bomDependencyArtifactId} 108 | ${alfresco.platform.version} 109 | pom 110 | import 111 | 112 | 113 | 115 | 116 | ${alfresco.groupId} 117 | share 118 | ${alfresco.share.version} 119 | war 120 | provided 121 | 122 | 123 | 124 | ${alfresco.groupId} 125 | share 126 | ${alfresco.share.version} 127 | classes 128 | provided 129 | 130 | 131 | 132 | ${alfresco.groupId} 133 | alfresco-web-framework-commons 134 | ${alfresco.share.version} 135 | classes 136 | provided 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 151 | 178 | 179 | 180 | 181 | org.apache.maven.plugins 182 | maven-resources-plugin 183 | 3.1.0 184 | 185 | UTF-8 186 | 187 | 188 | ftl 189 | acp 190 | svg 191 | pdf 192 | doc 193 | docx 194 | xls 195 | xlsx 196 | ppt 197 | pptx 198 | bin 199 | lic 200 | swf 201 | zip 202 | msg 203 | jar 204 | ttf 205 | eot 206 | woff 207 | woff2 208 | css 209 | ico 210 | psd 211 | js 212 | 213 | 214 | 215 | 216 | 217 | org.zeroturnaround 218 | jrebel-maven-plugin 219 | ${jrebel.version} 220 | 221 | 222 | 223 | org.apache.maven.plugins 224 | maven-jar-plugin 225 | 3.1.0 226 | 227 | 228 | 229 | org.apache.maven.plugins 230 | maven-failsafe-plugin 231 | 3.0.0-M1 232 | 233 | 234 | integration-test 235 | integration-test 236 | 237 | integration-test 238 | 239 | 240 | 241 | verify-test 242 | verify 243 | 244 | verify 245 | 246 | 247 | 248 | 249 | 250 | org.apache.maven.surefire 251 | surefire-junit47 252 | 3.0.0-M1 253 | 254 | 255 | 256 | 257 | 258 | org.apache.maven.plugins 259 | maven-dependency-plugin 260 | 3.1.1 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | src/main/resources 269 | true 270 | 271 | 272 | 273 | 274 | 276 | 277 | org.apache.maven.plugins 278 | maven-resources-plugin 279 | false 280 | 281 | 282 | 283 | copy-and-filter-docker-resources 284 | validate 285 | 286 | copy-resources 287 | 288 | 289 | ${project.build.outputDirectory}/docker 290 | 291 | 292 | docker 293 | true 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | com.github.blutorange 304 | closure-compiler-maven-plugin 305 | 2.28.0 306 | 307 | 308 | 309 | compress-assembly 310 | generate-resources 311 | 312 | minify 313 | 314 | 315 | ${project.basedir}/src/main/assembly 316 | ${project.basedir}/src/main/assembly 317 | web 318 | web 319 | true 320 | 321 | **/*.js 322 | 323 | 324 | **/webscripts/** 325 | **/site-webscripts/** 326 | **/META-INF/** 327 | **/*.lib.js 328 | **/*.css 329 | **/*.min.js 330 | **/*.min.css 331 | 332 | true 333 | 334 | 335 | 336 | 337 | compress-resources 338 | generate-resources 339 | 340 | minify 341 | 342 | 343 | ${project.basedir}/src/main 344 | ${project.basedir}/src/main 345 | resources 346 | resources 347 | true 348 | 349 | **/*.js 350 | 351 | 352 | **/webscripts/** 353 | **/site-webscripts/** 354 | **/*.lib.js 355 | **/*.css 356 | **/*.min.js 357 | **/*.min.css 358 | 359 | true 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | org.zeroturnaround 368 | jrebel-maven-plugin 369 | 370 | 371 | generate-rebel-xml 372 | process-resources 373 | 374 | generate 375 | 376 | 377 | 378 | 379 | 381 | 382 | all 383 | 384 | 385 | ${project.build.outputDirectory} 386 | ${project.build.testOutputDirectory} 387 | 388 | 389 | 390 | 395 | true 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | java8 404 | 405 | [1.8,11.0) 406 | 407 | 408 | 409 | 410 | org.apache.maven.plugins 411 | maven-compiler-plugin 412 | 3.8.0 413 | 414 | 1.8 415 | 1.8 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | java11 424 | 425 | [11.0,17) 426 | 427 | 428 | 429 | 430 | org.apache.maven.plugins 431 | maven-compiler-plugin 432 | 3.8.0 433 | 434 | 11 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | java17 443 | 444 | [17,) 445 | 446 | 447 | 448 | 449 | org.apache.maven.plugins 450 | maven-compiler-plugin 451 | 3.8.0 452 | 453 | 17 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | alfresco-public 465 | https://artifacts.alfresco.com/nexus/content/groups/public 466 | 467 | 468 | 469 | alfresco-public-snapshots 470 | https://artifacts.alfresco.com/nexus/content/groups/public-snapshots 471 | 472 | true 473 | daily 474 | 475 | 476 | 477 | 478 | 479 | alfresco-private-repository 480 | https://artifacts.alfresco.com/nexus/content/groups/private 481 | 482 | 483 | 484 | alfresco-internal 485 | https://artifacts.alfresco.com/nexus/content/groups/internal 486 | 487 | 488 | 489 | 490 | 491 | alfresco-plugin-public 492 | https://artifacts.alfresco.com/nexus/content/groups/public 493 | 494 | 495 | 496 | alfresco-plugin-public-snapshots 497 | https://artifacts.alfresco.com/nexus/content/groups/public-snapshots 498 | 499 | true 500 | daily 501 | 502 | 503 | 504 | 505 | 506 | alfresco-systemmessages-platform 507 | alfresco-systemmessages-share 508 | alfresco-systemmessages-integration-tests 509 | alfresco-systemmessages-platform-docker 510 | alfresco-systemmessages-share-docker 511 | 512 | 513 | -------------------------------------------------------------------------------- /run.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | SET COMPOSE_FILE_PATH=%CD%\target\classes\docker\docker-compose.yml 4 | 5 | IF [%M2_HOME%]==[] ( 6 | SET MVN_EXEC=mvn 7 | ) 8 | 9 | IF NOT [%M2_HOME%]==[] ( 10 | SET MVN_EXEC=%M2_HOME%\bin\mvn 11 | ) 12 | 13 | IF [%1]==[] ( 14 | echo "Usage: %0 {build_start|build_start_it_supported|start|stop|purge|tail|reload_share|reload_acs|build_test|test}" 15 | GOTO END 16 | ) 17 | 18 | IF %1==build_start ( 19 | CALL :down 20 | CALL :build 21 | CALL :start 22 | CALL :tail 23 | GOTO END 24 | ) 25 | IF %1==build_start_it_supported ( 26 | CALL :down 27 | CALL :build 28 | CALL :prepare-test 29 | CALL :start 30 | CALL :tail 31 | GOTO END 32 | ) 33 | IF %1==start ( 34 | CALL :start 35 | CALL :tail 36 | GOTO END 37 | ) 38 | IF %1==stop ( 39 | CALL :down 40 | GOTO END 41 | ) 42 | IF %1==purge ( 43 | CALL:down 44 | CALL:purge 45 | GOTO END 46 | ) 47 | IF %1==tail ( 48 | CALL :tail 49 | GOTO END 50 | ) 51 | IF %1==reload_share ( 52 | CALL :build_share 53 | CALL :start_share 54 | CALL :tail 55 | GOTO END 56 | ) 57 | IF %1==reload_acs ( 58 | CALL :build_acs 59 | CALL :start_acs 60 | CALL :tail 61 | GOTO END 62 | ) 63 | IF %1==build_test ( 64 | CALL :down 65 | CALL :build 66 | CALL :prepare-test 67 | CALL :start 68 | CALL :test 69 | CALL :tail_all 70 | CALL :down 71 | GOTO END 72 | ) 73 | IF %1==test ( 74 | CALL :test 75 | GOTO END 76 | ) 77 | echo "Usage: %0 {build_start|start|stop|purge|tail|reload_share|reload_acs|build_test|test}" 78 | :END 79 | EXIT /B %ERRORLEVEL% 80 | 81 | :start 82 | docker volume create alfresco-systemmessages-acs-volume 83 | docker volume create alfresco-systemmessages-db-volume 84 | docker volume create alfresco-systemmessages-ass-volume 85 | docker-compose -f "%COMPOSE_FILE_PATH%" up --build -d 86 | EXIT /B 0 87 | :start_share 88 | docker-compose -f "%COMPOSE_FILE_PATH%" up --build -d alfresco-systemmessages-share 89 | EXIT /B 0 90 | :start_acs 91 | docker-compose -f "%COMPOSE_FILE_PATH%" up --build -d alfresco-systemmessages-acs 92 | EXIT /B 0 93 | :down 94 | if exist "%COMPOSE_FILE_PATH%" ( 95 | docker-compose -f "%COMPOSE_FILE_PATH%" down 96 | ) 97 | EXIT /B 0 98 | :build 99 | call %MVN_EXEC% clean package 100 | EXIT /B 0 101 | :build_share 102 | docker-compose -f "%COMPOSE_FILE_PATH%" kill alfresco-systemmessages-share 103 | docker-compose -f "%COMPOSE_FILE_PATH%" rm -f alfresco-systemmessages-share 104 | call %MVN_EXEC% clean package -pl alfresco-systemmessages-share,alfresco-systemmessages-share-docker 105 | EXIT /B 0 106 | :build_acs 107 | docker-compose -f "%COMPOSE_FILE_PATH%" kill alfresco-systemmessages-acs 108 | docker-compose -f "%COMPOSE_FILE_PATH%" rm -f alfresco-systemmessages-acs 109 | call %MVN_EXEC% clean package -pl alfresco-systemmessages-integration-tests,alfresco-systemmessages-platform,alfresco-systemmessages-platform-docker 110 | EXIT /B 0 111 | :tail 112 | docker-compose -f "%COMPOSE_FILE_PATH%" logs -f 113 | EXIT /B 0 114 | :tail_all 115 | docker-compose -f "%COMPOSE_FILE_PATH%" logs --tail="all" 116 | EXIT /B 0 117 | :prepare-test 118 | call %MVN_EXEC% verify -DskipTests=true -pl alfresco-systemmessages-platform,alfresco-systemmessages-integration-tests,alfresco-systemmessages-platform-docker 119 | EXIT /B 0 120 | :test 121 | call %MVN_EXEC% verify -pl alfresco-systemmessages-platform,alfresco-systemmessages-integration-tests 122 | EXIT /B 0 123 | :purge 124 | docker volume rm -f alfresco-systemmessages-acs-volume 125 | docker volume rm -f alfresco-systemmessages-db-volume 126 | docker volume rm -f alfresco-systemmessages-ass-volume 127 | EXIT /B 0 -------------------------------------------------------------------------------- /run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | export COMPOSE_FILE_PATH="${PWD}/target/classes/docker/docker-compose.yml" 4 | 5 | if [ -z "${M2_HOME}" ]; then 6 | export MVN_EXEC="mvn" 7 | else 8 | export MVN_EXEC="${M2_HOME}/bin/mvn" 9 | fi 10 | 11 | start() { 12 | docker volume create alfresco-systemmessages-acs-volume 13 | docker volume create alfresco-systemmessages-db-volume 14 | docker volume create alfresco-systemmessages-ass-volume 15 | docker-compose -f "$COMPOSE_FILE_PATH" up --build -d 16 | } 17 | 18 | start_share() { 19 | docker-compose -f "$COMPOSE_FILE_PATH" up --build -d alfresco-systemmessages-share 20 | } 21 | 22 | start_acs() { 23 | docker-compose -f "$COMPOSE_FILE_PATH" up --build -d alfresco-systemmessages-acs 24 | } 25 | 26 | down() { 27 | if [ -f "$COMPOSE_FILE_PATH" ]; then 28 | docker-compose -f "$COMPOSE_FILE_PATH" down 29 | fi 30 | } 31 | 32 | purge() { 33 | docker volume rm -f alfresco-systemmessages-acs-volume 34 | docker volume rm -f alfresco-systemmessages-db-volume 35 | docker volume rm -f alfresco-systemmessages-ass-volume 36 | } 37 | 38 | build() { 39 | $MVN_EXEC clean package 40 | } 41 | 42 | build_share() { 43 | docker-compose -f "$COMPOSE_FILE_PATH" kill alfresco-systemmessages-share 44 | yes | docker-compose -f "$COMPOSE_FILE_PATH" rm -f alfresco-systemmessages-share 45 | $MVN_EXEC clean package -pl alfresco-systemmessages-share,alfresco-systemmessages-share-docker 46 | } 47 | 48 | build_acs() { 49 | docker-compose -f "$COMPOSE_FILE_PATH" kill alfresco-systemmessages-acs 50 | yes | docker-compose -f "$COMPOSE_FILE_PATH" rm -f alfresco-systemmessages-acs 51 | $MVN_EXEC clean package -pl alfresco-systemmessages-integration-tests,alfresco-systemmessages-platform,alfresco-systemmessages-platform-docker 52 | } 53 | 54 | tail() { 55 | docker-compose -f "$COMPOSE_FILE_PATH" logs -f 56 | } 57 | 58 | tail_all() { 59 | docker-compose -f "$COMPOSE_FILE_PATH" logs --tail="all" 60 | } 61 | 62 | prepare_test() { 63 | $MVN_EXEC verify -DskipTests=true -pl alfresco-systemmessages-platform,alfresco-systemmessages-integration-tests,alfresco-systemmessages-platform-docker 64 | } 65 | 66 | test() { 67 | $MVN_EXEC verify -pl alfresco-systemmessages-platform,alfresco-systemmessages-integration-tests 68 | } 69 | 70 | case "$1" in 71 | build_start) 72 | down 73 | build 74 | start 75 | tail 76 | ;; 77 | build_start_it_supported) 78 | down 79 | build 80 | prepare_test 81 | start 82 | tail 83 | ;; 84 | start) 85 | start 86 | tail 87 | ;; 88 | stop) 89 | down 90 | ;; 91 | purge) 92 | down 93 | purge 94 | ;; 95 | tail) 96 | tail 97 | ;; 98 | reload_share) 99 | build_share 100 | start_share 101 | tail 102 | ;; 103 | reload_acs) 104 | build_acs 105 | start_acs 106 | tail 107 | ;; 108 | build_test) 109 | down 110 | build 111 | prepare_test 112 | start 113 | test 114 | tail_all 115 | down 116 | ;; 117 | test) 118 | test 119 | ;; 120 | *) 121 | echo "Usage: $0 {build_start|build_start_it_supported|start|stop|purge|tail|reload_share|reload_acs|build_test|test}" 122 | esac --------------------------------------------------------------------------------