From 85b1d738d766736412577fa1b7e4513867ccd113 Mon Sep 17 00:00:00 2001 From: jpotts Date: Wed, 23 Mar 2016 13:07:15 -0500 Subject: [PATCH 1/4] Upgrade to SDK 2.2.0. This version of the SDK only works with Alfresco 5.1. --- share-site-creators-repo/pom.xml | 31 ++++++------- share-site-creators-repo/run.bat | 23 +++------- share-site-creators-repo/run.sh | 14 +++--- .../src/main/amp/module.properties | 6 +-- share-site-creators-repo/tomcat/context.xml | 45 +++++++++++-------- share-site-creators-share/pom.xml | 19 +------- share-site-creators-share/run.bat | 21 +-------- share-site-creators-share/run.sh | 23 +++++++--- .../src/main/amp/module.properties | 6 +-- share-site-creators-share/tomcat/context.xml | 22 ++++++--- 10 files changed, 95 insertions(+), 115 deletions(-) diff --git a/share-site-creators-repo/pom.xml b/share-site-creators-repo/pom.xml index f92f2a7..50e612f 100644 --- a/share-site-creators-repo/pom.xml +++ b/share-site-creators-repo/pom.xml @@ -12,7 +12,7 @@ org.alfresco.maven alfresco-sdk-parent - 2.1.1 + 2.2.0 + + ${alfresco.groupId} + alfresco-repository + ${alfresco.version} + h2scripts + test + + + * + * + + + @@ -84,19 +99,5 @@ - - - amp-to-war - - - org.alfresco.maven - alfresco-rad - ${maven.alfresco.version} - - - diff --git a/share-site-creators-repo/run.bat b/share-site-creators-repo/run.bat index c08c3e0..03523c1 100644 --- a/share-site-creators-repo/run.bat +++ b/share-site-creators-repo/run.bat @@ -1,19 +1,8 @@ -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -:: Dev environment startup script for Alfresco Community. :: -:: :: -:: Downloads the spring-loaded lib if not existing and :: -:: runs the Repo AMP applied to Alfresco WAR. :: -:: Note. the Share WAR is not deployed. :: -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -@echo off +@ECHO OFF -set springloadedfile=%HOME%\.m2\repository\org\springframework\springloaded\1.2.3.RELEASE\springloaded-1.2.3.RELEASE.jar - -if not exist %springloadedfile% ( - mvn validate -Psetup +IF "%MAVEN_OPTS%" == "" ( + ECHO The environment variable 'MAVEN_OPTS' is not set, setting it for you + SET MAVEN_OPTS=-Xms256m -Xmx2G -XX:PermSize=300m ) - -set MAVEN_OPTS=-javaagent:"%springloadedfile%" -noverify -Xms256m -Xmx2G - -mvn integration-test -Pamp-to-war -nsu -:: mvn integration-test -Pamp-to-war +ECHO MAVEN_OPTS is set to '%MAVEN_OPTS%' +mvn clean install -Pamp-to-war diff --git a/share-site-creators-repo/run.sh b/share-site-creators-repo/run.sh index eeddce4..1df845e 100644 --- a/share-site-creators-repo/run.sh +++ b/share-site-creators-repo/run.sh @@ -1,11 +1,7 @@ #!/bin/bash -# Downloads the spring-loaded lib if not existing and -# runs the Repo AMP applied to Alfresco WAR. -# Note. the Share WAR is not deployed. -springloadedfile=~/.m2/repository/org/springframework/springloaded/1.2.3.RELEASE/springloaded-1.2.3.RELEASE.jar - -if [ ! -f $springloadedfile ]; then -mvn validate -Psetup +if [[ -z ${MAVEN_OPTS} ]]; then + echo "The environment variable 'MAVEN_OPTS' is not set, setting it for you"; + MAVEN_OPTS="-Xms256m -Xmx1524m -XX:PermSize=300m" fi - -MAVEN_OPTS="-javaagent:$springloadedfile -noverify -Xms256m -Xmx2G" mvn integration-test -Pamp-to-war +echo "MAVEN_OPTS is set to '$MAVEN_OPTS'"; +mvn clean install -Pamp-to-war \ No newline at end of file diff --git a/share-site-creators-repo/src/main/amp/module.properties b/share-site-creators-repo/src/main/amp/module.properties index 0e5c045..36097a6 100644 --- a/share-site-creators-repo/src/main/amp/module.properties +++ b/share-site-creators-repo/src/main/amp/module.properties @@ -19,12 +19,12 @@ # ==== Beginning of Alfresco required/optional properties ====== # # NB: These properties are filtered at build time by Maven, single -# sourcing from POM properties +# sourcing from POM properties module.id=${project.artifactId} #module.aliases=myModule-123, my-module module.title=${project.name} module.description=${project.description} -module.version=${noSnapshotVersion} +module.version=${project.version} # The following optional properties can be used to prevent the module from being added # to inappropriate versions of the WAR file. @@ -45,4 +45,4 @@ module.version=${noSnapshotVersion} # ==== End of Alfresco required/optional properties ======= # -# ==== Beginning of module required properties/optional ====== # \ No newline at end of file +# ==== Beginning of module required properties/optional ====== # diff --git a/share-site-creators-repo/tomcat/context.xml b/share-site-creators-repo/tomcat/context.xml index 45d3690..6ef60da 100644 --- a/share-site-creators-repo/tomcat/context.xml +++ b/share-site-creators-repo/tomcat/context.xml @@ -4,28 +4,35 @@ it is never released with the Alfresco.war =================================================================================================================--> - - + + + - - + This way mvn compile can be invoked and all changes will be picked up + --> + - - + + diff --git a/share-site-creators-share/pom.xml b/share-site-creators-share/pom.xml index 2c2c7df..fd09c12 100644 --- a/share-site-creators-share/pom.xml +++ b/share-site-creators-share/pom.xml @@ -12,7 +12,7 @@ org.alfresco.maven alfresco-sdk-parent - 2.1.1 + 2.2.0 - 5.0.d + WARN @@ -84,19 +84,4 @@ - - - - enterprise - - - ${alfresco.groupId} - share-enterprise - ${alfresco.version} - classes - provided - - - - diff --git a/share-site-creators-share/run.bat b/share-site-creators-share/run.bat index 5e4c6a9..ae97ed3 100644 --- a/share-site-creators-share/run.bat +++ b/share-site-creators-share/run.bat @@ -1,20 +1,3 @@ -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -:: Dev environment startup script for Alfresco Community. :: -:: :: -:: Downloads the spring-loaded lib if not existing and :: -:: runs the Share AMP applied to Share WAR. :: -:: Note. requires Alfresco.war to be running in another :: -:: Tomcat on port 8080. :: -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -@echo off +@ECHO OFF -set springloadedfile=%HOME%\.m2\repository\org\springframework\springloaded\1.2.3.RELEASE\springloaded-1.2.3.RELEASE.jar - -if not exist %springloadedfile% ( - mvn validate -Psetup -) - -set MAVEN_OPTS=-javaagent:"%springloadedfile%" -noverify - -mvn integration-test -Pamp-to-war -nsu -:: mvn integration-test -Pamp-to-war +mvn clean install -Pamp-to-war \ No newline at end of file diff --git a/share-site-creators-share/run.sh b/share-site-creators-share/run.sh index c8c46ca..3ce06cc 100644 --- a/share-site-creators-share/run.sh +++ b/share-site-creators-share/run.sh @@ -1,10 +1,19 @@ #!/bin/bash -# Downloads the spring-loaded lib if not existing and runs the Share AMP applied to Share WAR -# Note. requires Alfresco.war to be running in another Tomcat on port 8080 -springloadedfile=~/.m2/repository/org/springframework/springloaded/1.2.3.RELEASE/springloaded-1.2.3.RELEASE.jar +# Note. This script requires Alfresco.war to be running in another Tomcat on port 8080 -if [ ! -f $springloadedfile ]; then -mvn validate -Psetup -fi +if [[ -z ${MAVEN_OPTS} ]]; then + echo "The environment variable 'MAVEN_OPTS' is not set, setting it for you"; + + # Downloads the spring-loaded lib if not existing and runs the Share AMP applied to Share WAR + springloadedfile=~/.m2/repository/org/springframework/springloaded/1.2.5.RELEASE/springloaded-1.2.5.RELEASE.jar -MAVEN_OPTS="-javaagent:$springloadedfile -noverify" mvn integration-test -Pamp-to-war + if [ ! -f $springloadedfile ]; then + mvn validate -Psetup + fi + + # Spring loaded can be used with the Share AMP project in 5.1 + # (i.e. it does not have the same problem as Repo AMP and AIO) + MAVEN_OPTS="-javaagent:$springloadedfile -noverify" +fi +echo "MAVEN_OPTS is set to '$MAVEN_OPTS'"; +mvn clean install -Pamp-to-war \ No newline at end of file diff --git a/share-site-creators-share/src/main/amp/module.properties b/share-site-creators-share/src/main/amp/module.properties index 0e5c045..36097a6 100644 --- a/share-site-creators-share/src/main/amp/module.properties +++ b/share-site-creators-share/src/main/amp/module.properties @@ -19,12 +19,12 @@ # ==== Beginning of Alfresco required/optional properties ====== # # NB: These properties are filtered at build time by Maven, single -# sourcing from POM properties +# sourcing from POM properties module.id=${project.artifactId} #module.aliases=myModule-123, my-module module.title=${project.name} module.description=${project.description} -module.version=${noSnapshotVersion} +module.version=${project.version} # The following optional properties can be used to prevent the module from being added # to inappropriate versions of the WAR file. @@ -45,4 +45,4 @@ module.version=${noSnapshotVersion} # ==== End of Alfresco required/optional properties ======= # -# ==== Beginning of module required properties/optional ====== # \ No newline at end of file +# ==== Beginning of module required properties/optional ====== # diff --git a/share-site-creators-share/tomcat/context.xml b/share-site-creators-share/tomcat/context.xml index 20843db..40e901c 100644 --- a/share-site-creators-share/tomcat/context.xml +++ b/share-site-creators-share/tomcat/context.xml @@ -4,24 +4,34 @@ it is never released with the Alfresco.war =================================================================================================================--> - - + + + extraResourcePaths="/=${project.build.directory}/amp/web,${app.amp.client.war.folder}" /> + virtualClasspath="${project.build.outputDirectory};${project.build.directory}/amp/config;${project.build.testOutputDirectory}" /> From 9015ea56b717474f6b7dac3526bc14fb36e8a1a5 Mon Sep 17 00:00:00 2001 From: "Douglas C. R. Paes" Date: Sun, 29 May 2016 21:23:19 -0300 Subject: [PATCH 2/4] Fixes the issue #18 --- .../share-site-creators-repo/context/bootstrap-context.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share-site-creators-repo/src/main/amp/config/alfresco/module/share-site-creators-repo/context/bootstrap-context.xml b/share-site-creators-repo/src/main/amp/config/alfresco/module/share-site-creators-repo/context/bootstrap-context.xml index 91003d7..ef150d8 100644 --- a/share-site-creators-repo/src/main/amp/config/alfresco/module/share-site-creators-repo/context/bootstrap-context.xml +++ b/share-site-creators-repo/src/main/amp/config/alfresco/module/share-site-creators-repo/context/bootstrap-context.xml @@ -23,7 +23,7 @@ share-site-creators-repo.groupsLoader.description 0 ${version.schema} - 10000 + 15000 From 2b50b0da415da70c3b22b346e4600fc37cc41d86 Mon Sep 17 00:00:00 2001 From: "Douglas C. R. Paes" Date: Sun, 29 May 2016 21:25:21 -0300 Subject: [PATCH 3/4] Sets the module to auto-deploy, as discussed in the issue #16 --- .../web-extension/site-data/site-creators-module-extension.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share-site-creators-share/src/main/amp/config/alfresco/web-extension/site-data/site-creators-module-extension.xml b/share-site-creators-share/src/main/amp/config/alfresco/web-extension/site-data/site-creators-module-extension.xml index 10604a9..702d198 100644 --- a/share-site-creators-share/src/main/amp/config/alfresco/web-extension/site-data/site-creators-module-extension.xml +++ b/share-site-creators-share/src/main/amp/config/alfresco/web-extension/site-data/site-creators-module-extension.xml @@ -3,7 +3,7 @@ Share Site Creators 1.0 - false + true GROUP_SITE_CREATORS From 4dd16868c3fddca27134216154dd4327f0e995f0 Mon Sep 17 00:00:00 2001 From: jpotts Date: Thu, 23 Jun 2016 12:56:05 -0500 Subject: [PATCH 4/4] Update share pom to work around SDK issue, modify the readme to explain how to build the share AMP to work around the SDK issue, bump version to 0.0.3 without SNAPSHOT. --- readme.md | 6 +++--- share-site-creators-repo/pom.xml | 8 ++++---- share-site-creators-share/pom.xml | 11 ++++++----- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/readme.md b/readme.md index 990aac6..ecd0040 100644 --- a/readme.md +++ b/readme.md @@ -17,7 +17,7 @@ Installation ------------ There are two AMPs associated with this add-on. One is a "repo tier" AMP and the other is a "Share tier" AMP. -For each of the two projects, use `mvn install` to create the AMP. By default the POM is set to depend on the latest Alfresco Community Edition using the default specified by the SDK. This has not been tested with Alfresco Enterprise Edition. +For each of the two projects, use `mvn install` to create the AMP. When running with 5.1.f, you must specify `` when running maven commands for the Share tier AMP. ### Install the AMPs @@ -29,11 +29,11 @@ Once the AMPs are deployed, start up Alfresco. ### Deploy the Module in Share -After starting Alfresco with the AMPs deployed, you'll need to go to the [Share Module Deployment Console](http://localhost:8080/share/service/modules/deploy) to deploy the module. After you hit "Apply Changes", log out, then log back in. If you don't already have a group created with your username in it, the "Create Site" links should be gone, even if you are an administrator. +After starting Alfresco with the AMPs deployed, the Share module should be deployed for you automatically. If you can still see "Create Sites" you may need to deploy the module manually. To do so, go to the [Share Module Deployment Console](http://localhost:8080/share/service/modules/deploy) to deploy the module. After you hit "Apply Changes", log out, then log back in. If you don't already have a group created with your username in it, the "Create Site" links should be gone, even if you are an administrator. ### Create and Populate the Group -Now go create a new group with an ID of "GROUP_SITE_CREATORS". You can add individuals and groups to this group. For example, at the very least you will probably want to add ALFRESCO_ADMINISTRATORS to this group. +The SITE_CREATORS group will be created for you automatically. If, for some reason, it does not get created, create a new group with an ID of "GROUP_SITE_CREATORS". You can add individuals and groups to this group. For example, at the very least you will probably want to add ALFRESCO_ADMINISTRATORS to this group. Using a Different Group Name ------------------------ diff --git a/share-site-creators-repo/pom.xml b/share-site-creators-repo/pom.xml index 50e612f..a206b2c 100644 --- a/share-site-creators-repo/pom.xml +++ b/share-site-creators-repo/pom.xml @@ -4,7 +4,7 @@ 4.0.0 com.ecmarchitect share-site-creators-repo - 0.0.2-SNAPSHOT + 0.0.3 share-site-creators-repo AMP project amp Changes the permissions so that only members of a specific group can create sites. @@ -27,9 +27,9 @@ --> + Community versions are typically identified by major.minor.character (4.2.a) while Enterprise versions are identified by major.minor.digit (4.2.0) --> + 5.1.f + local - + 5.1.f WARN @@ -68,9 +68,10 @@ provided - org.springframework.extensions.surf - spring-surf-api - provided + org.alfresco.surf + spring-surf-api + ${dependency.surf.version} + provided