Skip to content

Commit

Permalink
Merge branch '5.1.f'
Browse files Browse the repository at this point in the history
  • Loading branch information
jpotts committed Jun 23, 2016
2 parents dc3a72d + 4dd1686 commit bdcaf9d
Show file tree
Hide file tree
Showing 13 changed files with 109 additions and 128 deletions.
6 changes: 3 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
------------------------
Expand Down
39 changes: 20 additions & 19 deletions share-site-creators-repo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.ecmarchitect</groupId>
<artifactId>share-site-creators-repo</artifactId>
<version>0.0.2-SNAPSHOT</version>
<version>0.0.3</version>
<name>share-site-creators-repo AMP project</name>
<packaging>amp</packaging>
<description>Changes the permissions so that only members of a specific group can create sites.</description>

<parent>
<groupId>org.alfresco.maven</groupId>
<artifactId>alfresco-sdk-parent</artifactId>
<version>2.1.1</version>
<version>2.2.0</version>
</parent>

<!--
Expand All @@ -27,9 +27,9 @@
-->
<!-- <alfresco.groupId>org.alfresco</alfresco.groupId> -->
<!-- Defines the Alfresco version to work against.
Community versions are typically identified by major.minor.character (4.2.a) while Enterprise versions are identified by major.minor.digit (4.2.0)
<alfresco.version>5.0.d</alfresco.version>
<alfresco.data.location>alf_data_dev</alfresco.data.location> -->
Community versions are typically identified by major.minor.character (4.2.a) while Enterprise versions are identified by major.minor.digit (4.2.0) -->
<alfresco.version>5.1.f</alfresco.version>
<!--<alfresco.data.location>/absolute/path/to/alf_data_dev</alfresco.data.location>-->
<!-- This controls which properties will be picked in src/test/properties for embedded run -->
<env>local</env>
<!-- Defines the target WAR artifactId to run this amp, only used with the -Pamp-to-war profile
Expand Down Expand Up @@ -70,6 +70,21 @@
<groupId>${alfresco.groupId}</groupId>
<artifactId>alfresco-repository</artifactId>
</dependency>
<!-- If we are running tests then make the H2 Scripts available
Note. tests are skipped when you are running -Pamp-to-war -->
<dependency>
<groupId>${alfresco.groupId}</groupId>
<artifactId>alfresco-repository</artifactId>
<version>${alfresco.version}</version>
<classifier>h2scripts</classifier>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<profiles>
<!-- Enterprise profile, manually activated, automatically adds support for Enterprise edition development (dependencies) -->
Expand All @@ -84,19 +99,5 @@
</dependency>
</dependencies>
</profile>
<!--
If the 'amp-to-war' profile is enabled then make sure to bring in the alfresco-rad module,
which has the H2 scripts and other RAD features.
-->
<profile>
<id>amp-to-war</id>
<dependencies>
<dependency>
<groupId>org.alfresco.maven</groupId>
<artifactId>alfresco-rad</artifactId>
<version>${maven.alfresco.version}</version>
</dependency>
</dependencies>
</profile>
</profiles>
</project>
23 changes: 6 additions & 17 deletions share-site-creators-repo/run.bat
Original file line number Diff line number Diff line change
@@ -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
14 changes: 5 additions & 9 deletions share-site-creators-repo/run.sh
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<property name="description"><value>share-site-creators-repo.groupsLoader.description</value></property>
<property name="fixesFromSchema"><value>0</value></property>
<property name="fixesToSchema"><value>${version.schema}</value></property>
<property name="targetSchema"><value>10000</value></property>
<property name="targetSchema"><value>15000</value></property>
<property name="importerBootstrap">
<ref bean="spacesBootstrap" />
</property>
Expand Down
6 changes: 3 additions & 3 deletions share-site-creators-repo/src/main/amp/module.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -45,4 +45,4 @@ module.version=${noSnapshotVersion}
# ==== End of Alfresco required/optional properties ======= #


# ==== Beginning of module required properties/optional ====== #
# ==== Beginning of module required properties/optional ====== #
45 changes: 26 additions & 19 deletions share-site-creators-repo/tomcat/context.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,35 @@
it is never released with the Alfresco.war
=================================================================================================================-->

<!-- Setup docBase to something like repo-amp/target/repo-amp-war
and path to /alfresco
The Alfresco.war 5.0 does not have a webapp (it used to have Alfresco Explorer but not anymore)
that we will access, so this docBase might not be needed
-->
<Context docBase="${app.amp.client.war.folder}" path="${alfresco.client.contextPath}">
<!-- Setup a virtual context for the /alfresco webapp by specifying this as path for Context.
The amp-to-war profile uses the tomcat7-maven-plugin to kick off the webapp.
This profile is used for both the repo and share AMP archetypes, and has no config for path or resources,
so we need to specify here both the context path and where the webapp resources can be found.
The webapp resources are located in the {repo-amp-dir}/target/amp-war directory, However, we
cannot just set this up as the docBase attribute for the Context as it would always be read
before any paths in the extraResourcePaths. So to allow for customizations to override
stuff in the alfresco.war webapp, such as the /images/logo/logo.png, we add the webapp resource
path last in the extraResourcePaths.
<Resources className="org.apache.naming.resources.VirtualDirContext"
extraResourcePaths="/=${project.build.directory}/${project.build.finalName}/web" />
Note. Alfresco.war 5.0 does not have a webapp, just an index page, the Alfresco Explorer webapp is no longer available.
-->
<Context path="${alfresco.client.contextPath}">
<Resources className="org.apache.naming.resources.VirtualDirContext"
extraResourcePaths="/=${project.build.directory}/amp/web,${app.amp.client.war.folder}" />

<!-- Setup the virtual class path like this:
1) target/classes
2) target/${project.build.finalName}/config
3) target/test-classes
<!-- Setup the virtual class path like this:
1) target/classes
2) target/amp/config
3) target/test-classes
This way mvn compile can be invoked and all changes will be picked up
-->
<Loader searchVirtualFirst="true"
className="org.apache.catalina.loader.VirtualWebappLoader"
virtualClasspath="${project.build.outputDirectory};${project.build.directory}/${project.build.finalName}/config;${project.build.testOutputDirectory}" />
This way mvn compile can be invoked and all changes will be picked up
-->
<Loader searchVirtualFirst="true"
className="org.apache.catalina.loader.VirtualWebappLoader"
virtualClasspath="${project.build.outputDirectory};${project.build.directory}/amp/config;${project.build.testOutputDirectory}" />


<!-- This enables hot reloading of web resources from uncompressed jars (while in prod they would be loaded from WEB-INF/lib/{\*.jar}/META-INF/resources -->
<JarScanner scanAllDirectories="true" />
<!-- This enables hot reloading of web resources from uncompressed jars (while in prod they would be loaded from WEB-INF/lib/{\*.jar}/META-INF/resources -->
<JarScanner scanAllDirectories="true" />
</Context>
28 changes: 7 additions & 21 deletions share-site-creators-share/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.ecmarchitect</groupId>
<artifactId>share-site-creators-share</artifactId>
<version>0.0.2-SNAPSHOT</version>
<version>0.0.3</version>
<name>share-site-creators-share AMP project</name>
<packaging>amp</packaging>
<description>Hides all &quot;create site&quot; links from all users except those belonging to a specific group.</description>

<parent>
<groupId>org.alfresco.maven</groupId>
<artifactId>alfresco-sdk-parent</artifactId>
<version>2.1.1</version>
<version>2.2.0</version>
</parent>

<!--
Expand All @@ -34,7 +34,7 @@
Community versions are typically identified by major.minor.character (4.2.a),
while Enterprise versions are identified by major.minor.digit (4.2.0)
-->
<alfresco.version>5.0.d</alfresco.version>
<alfresco.version>5.1.f</alfresco.version>

<!-- Defines the log level used in log4j.properties -->
<app.log.root.level>WARN</app.log.root.level>
Expand Down Expand Up @@ -68,9 +68,10 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.extensions.surf</groupId>
<artifactId>spring-surf-api</artifactId>
<scope>provided</scope>
<groupId>org.alfresco.surf</groupId>
<artifactId>spring-surf-api</artifactId>
<version>${dependency.surf.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>

Expand All @@ -84,19 +85,4 @@
</plugins>
</build>

<profiles>
<!-- Enterprise profile, manually activated, automatically adds support for Enterprise edition development (dependencies) -->
<profile>
<id>enterprise</id>
<dependencies>
<dependency>
<groupId>${alfresco.groupId}</groupId>
<artifactId>share-enterprise</artifactId>
<version>${alfresco.version}</version>
<classifier>classes</classifier>
<scope>provided</scope>
</dependency>
</dependencies>
</profile>
</profiles>
</project>
21 changes: 2 additions & 19 deletions share-site-creators-share/run.bat
Original file line number Diff line number Diff line change
@@ -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
23 changes: 16 additions & 7 deletions share-site-creators-share/run.sh
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<module>
<id>Share Site Creators</id>
<version>1.0</version>
<auto-deploy>false</auto-deploy>
<auto-deploy>true</auto-deploy>
<evaluator type="group.module.evaluator">
<params>
<groups>GROUP_SITE_CREATORS</groups>
Expand Down
6 changes: 3 additions & 3 deletions share-site-creators-share/src/main/amp/module.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -45,4 +45,4 @@ module.version=${noSnapshotVersion}
# ==== End of Alfresco required/optional properties ======= #


# ==== Beginning of module required properties/optional ====== #
# ==== Beginning of module required properties/optional ====== #
Loading

0 comments on commit bdcaf9d

Please sign in to comment.