Skip to content

Commit 6e431a2

Browse files
committed
Update actions tutorial source and body for SDK 4.2 and Alfresco 7.0
1 parent 7694ac4 commit 6e431a2

File tree

12 files changed

+116
-71
lines changed

12 files changed

+116
-71
lines changed

actions/actions-tutorial/actions-tutorial-platform-docker/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131
<classifier>tests</classifier>
3232
</dependency>
3333
<!-- Add any additional AMPs or extension JARs here that you want to be deployed in Alfresco -->
34-
<!-- IMPORTANT:
34+
<!-- IMPORTANT:
3535
If using amp extensions only, add <includeTypes>amp</includeTypes> to the "collect-extensions" execution below.
36-
If using both amp and jar extensions, you have to add:
36+
If using both amp and jar extensions, you have to add:
3737
<exclusions>
3838
<exclusion>
3939
<groupId>*</groupId>

actions/actions-tutorial/actions-tutorial-platform/src/main/assembly/amp.xml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<assembly
2-
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd">
2+
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd">
55

66
<!--
77
Note that the Module dependency specified in the configuration section for the Alfresco Maven Plugin
@@ -10,7 +10,7 @@
1010
<platformModules>
1111
<moduleDependency>
1212
<groupId>${project.groupId}</groupId>
13-
<artifactId>some-platform-jar</artifactId>
13+
<artifactId>some-platform</artifactId>
1414
<version>${project.version}</version>
1515
<type>amp</type>
1616
</moduleDependency>
@@ -35,6 +35,11 @@
3535
<source>src/main/assembly/file-mapping.properties</source>
3636
<filtered>false</filtered>
3737
</file>
38+
<!-- Add module-specific log4j.properties configuration at top level in the AMP -->
39+
<file>
40+
<source>src/main/resources/alfresco/module/${project.artifactId}/log4j.properties</source>
41+
<filtered>false</filtered>
42+
</file>
3843
</files>
3944

4045
<fileSets>

actions/actions-tutorial/actions-tutorial-platform/src/main/assembly/web/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ any existing web resources in the Alfresco.WAR.
1010
`
1111
<moduleDependency>
1212
<groupId>${project.groupId}</groupId>
13-
<artifactId>some-platform-jar</artifactId>
13+
<artifactId>some-platform</artifactId>
1414
<version>${project.version}</version>
1515
<type>amp</type>
1616
</moduleDependency>

actions/actions-tutorial/actions-tutorial-share-docker/pom.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@
2121
<groupId>com.someco</groupId>
2222
<artifactId>actions-tutorial-share</artifactId>
2323
<version>1.0-SNAPSHOT</version>
24+
<type>amp</type>
25+
</dependency>
26+
<dependency>
27+
<groupId>com.someco</groupId>
28+
<artifactId>content-tutorial-share</artifactId>
29+
<version>1.0-SNAPSHOT</version>
30+
<type>amp</type>
2431
</dependency>
2532
</dependencies>
2633

@@ -41,6 +48,7 @@
4148
<outputDirectory>${project.build.directory}/extensions</outputDirectory>
4249
<includeScope>runtime</includeScope>
4350
<!-- IMPORTANT: if using amp dependencies only, add <includeTypes>amp</includeTypes> -->
51+
<includeTypes>amp</includeTypes>
4452
</configuration>
4553
</execution>
4654
</executions>

actions/actions-tutorial/actions-tutorial-share/src/main/assembly/amp.xml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<assembly
2-
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd">
2+
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd">
55

66
<!--
77
Note that the Module dependency specified in the configuration section for the Alfresco Maven Plugin
@@ -10,7 +10,7 @@
1010
<shareModules>
1111
<moduleDependency>
1212
<groupId>${project.groupId}</groupId>
13-
<artifactId>some-share-jar</artifactId>
13+
<artifactId>some-share</artifactId>
1414
<version>${project.version}</version>
1515
<type>amp</type>
1616
</moduleDependency>
@@ -35,6 +35,11 @@
3535
<source>src/main/assembly/file-mapping.properties</source>
3636
<filtered>false</filtered>
3737
</file>
38+
<!-- Add module-specific log4j.properties configuration at top level in the AMP -->
39+
<file>
40+
<source>src/main/resources/alfresco/module/${project.artifactId}/log4j.properties</source>
41+
<filtered>false</filtered>
42+
</file>
3843
</files>
3944

4045
<fileSets>

actions/actions-tutorial/actions-tutorial-share/src/main/assembly/web/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ any existing web resources in the Share.WAR.
1010
`
1111
<moduleDependency>
1212
<groupId>${project.groupId}</groupId>
13-
<artifactId>some-share-jar</artifactId>
13+
<artifactId>some-share</artifactId>
1414
<version>${project.version}</version>
1515
<type>amp</type>
1616
</moduleDependency>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Add here module-specific custom log4j.properties configuration

actions/actions-tutorial/docker/docker-compose.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ services:
1818
dockerfile: ./Dockerfile
1919
context: ../../../actions-tutorial-platform-docker/target
2020
environment:
21+
JAVA_TOOL_OPTIONS: "${keystore.settings}"
2122
CATALINA_OPTS: "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=0.0.0.0:8888"
2223
ports:
2324
- "${acs.port}:8080"
@@ -56,4 +57,4 @@ volumes:
5657
actions-tutorial-db-volume:
5758
external: true
5859
actions-tutorial-ass-volume:
59-
external: true
60+
external: true

actions/actions-tutorial/pom.xml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
<groupId>com.someco</groupId>
55
<artifactId>actions-tutorial</artifactId>
66
<version>1.0-SNAPSHOT</version>
7-
<name>AIO - SDK 4.0</name>
8-
<description>All-In-One (AIO) project for SDK 4.0</description>
7+
<name>AIO - SDK 4.2</name>
8+
<description>All-In-One (AIO) project for SDK 4.2</description>
99
<packaging>pom</packaging>
1010

1111
<prerequisites>
@@ -14,20 +14,31 @@
1414

1515
<properties>
1616
<!-- Alfresco Maven Plugin version to use -->
17-
<alfresco.sdk.version>4.1.0</alfresco.sdk.version>
17+
<alfresco.sdk.version>4.2.0</alfresco.sdk.version>
1818

1919
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
2020

2121
<!-- Properties used in dependency declarations, you don't need to change these -->
2222
<alfresco.groupId>org.alfresco</alfresco.groupId>
2323
<alfresco.bomDependencyArtifactId>acs-community-packaging</alfresco.bomDependencyArtifactId>
24-
<alfresco.platform.version>6.2.0-ea</alfresco.platform.version>
25-
<alfresco.share.version>6.2.0</alfresco.share.version>
24+
<alfresco.platform.version>7.0.0</alfresco.platform.version>
25+
<alfresco.share.version>7.0.0</alfresco.share.version>
2626

2727
<!-- Docker images -->
2828
<docker.acs.image>alfresco/alfresco-content-repository-community</docker.acs.image>
2929
<docker.share.image>alfresco/alfresco-share</docker.share.image>
3030

31+
<keystore.settings>-Dencryption.keystore.type=JCEKS
32+
-Dencryption.cipherAlgorithm=AES/CBC/PKCS5Padding
33+
-Dencryption.keyAlgorithm=AES
34+
-Dencryption.keystore.location=/usr/local/tomcat/shared/classes/alfresco/extension/keystore/keystore
35+
-Dmetadata-keystore.password=mp6yc0UD9e
36+
-Dmetadata-keystore.aliases=metadata
37+
-Dmetadata-keystore.metadata.password=oKIWzVdEdA
38+
-Dmetadata-keystore.metadata.algorithm=AES</keystore.settings>
39+
40+
<activemq.version>5.16.1</activemq.version>
41+
3142
<!-- JRebel Hot reloading of classpath stuff and web resource stuff -->
3243
<jrebel.version>1.1.8</jrebel.version>
3344

actions/actions-tutorial/run.bat

100755100644
Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ IF NOT [%M2_HOME%]==[] (
1111
)
1212

1313
IF [%1]==[] (
14-
echo "Usage: %0 {build_start|start|stop|purge|tail|reload_share|reload_acs|build_test|test}"
14+
echo "Usage: %0 {build_start|build_start_it_supported|start|stop|purge|tail|reload_share|reload_acs|build_test|test}"
1515
GOTO END
1616
)
1717

@@ -22,6 +22,14 @@ IF %1==build_start (
2222
CALL :tail
2323
GOTO END
2424
)
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+
)
2533
IF %1==start (
2634
CALL :start
2735
CALL :tail
@@ -55,6 +63,7 @@ IF %1==reload_acs (
5563
IF %1==build_test (
5664
CALL :down
5765
CALL :build
66+
CALL :prepare-test
5867
CALL :start
5968
CALL :test
6069
CALL :tail_all
@@ -82,36 +91,37 @@ EXIT /B 0
8291
docker-compose -f "%COMPOSE_FILE_PATH%" up --build -d actions-tutorial-acs
8392
EXIT /B 0
8493
:down
85-
docker-compose -f "%COMPOSE_FILE_PATH%" down
94+
if exist "%COMPOSE_FILE_PATH%" (
95+
docker-compose -f "%COMPOSE_FILE_PATH%" down
96+
)
8697
EXIT /B 0
8798
:build
88-
docker rmi alfresco-content-services-actions-tutorial:development
89-
docker rmi alfresco-share-actions-tutorial:development
90-
call %MVN_EXEC% clean install -DskipTests
99+
call %MVN_EXEC% clean package
91100
EXIT /B 0
92101
:build_share
93102
docker-compose -f "%COMPOSE_FILE_PATH%" kill actions-tutorial-share
94103
docker-compose -f "%COMPOSE_FILE_PATH%" rm -f actions-tutorial-share
95-
docker rmi alfresco-share-actions-tutorial:development
96-
call %MVN_EXEC% clean install -DskipTests -pl actions-tutorial-share
104+
call %MVN_EXEC% clean package -pl actions-tutorial-share,actions-tutorial-share-docker
97105
EXIT /B 0
98106
:build_acs
99107
docker-compose -f "%COMPOSE_FILE_PATH%" kill actions-tutorial-acs
100108
docker-compose -f "%COMPOSE_FILE_PATH%" rm -f actions-tutorial-acs
101-
docker rmi alfresco-content-services-actions-tutorial:development
102-
call %MVN_EXEC% clean install -DskipTests -pl actions-tutorial-platform
109+
call %MVN_EXEC% clean package -pl actions-tutorial-integration-tests,actions-tutorial-platform,actions-tutorial-platform-docker
103110
EXIT /B 0
104111
:tail
105112
docker-compose -f "%COMPOSE_FILE_PATH%" logs -f
106113
EXIT /B 0
107114
:tail_all
108115
docker-compose -f "%COMPOSE_FILE_PATH%" logs --tail="all"
109116
EXIT /B 0
117+
:prepare-test
118+
call %MVN_EXEC% verify -DskipTests=true -pl actions-tutorial-platform,actions-tutorial-integration-tests,actions-tutorial-platform-docker
119+
EXIT /B 0
110120
:test
111-
call %MVN_EXEC% verify -pl integration-tests
121+
call %MVN_EXEC% verify -pl actions-tutorial-platform,actions-tutorial-integration-tests
112122
EXIT /B 0
113123
:purge
114-
docker volume rm actions-tutorial-acs-volume
115-
docker volume rm actions-tutorial-db-volume
116-
docker volume rm actions-tutorial-ass-volume
117-
EXIT /B 0
124+
docker volume rm -f actions-tutorial-acs-volume
125+
docker volume rm -f actions-tutorial-db-volume
126+
docker volume rm -f actions-tutorial-ass-volume
127+
EXIT /B 0

actions/actions-tutorial/run.sh

Lines changed: 34 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22

3-
export COMPOSE_FILE_PATH=${PWD}/target/classes/docker/docker-compose.yml
3+
export COMPOSE_FILE_PATH="${PWD}/target/classes/docker/docker-compose.yml"
44

55
if [ -z "${M2_HOME}" ]; then
66
export MVN_EXEC="mvn"
@@ -12,57 +12,59 @@ start() {
1212
docker volume create actions-tutorial-acs-volume
1313
docker volume create actions-tutorial-db-volume
1414
docker volume create actions-tutorial-ass-volume
15-
docker-compose -f $COMPOSE_FILE_PATH up --build -d
15+
docker-compose -f "$COMPOSE_FILE_PATH" up --build -d
1616
}
1717

1818
start_share() {
19-
docker-compose -f $COMPOSE_FILE_PATH up --build -d actions-tutorial-share
19+
docker-compose -f "$COMPOSE_FILE_PATH" up --build -d actions-tutorial-share
2020
}
2121

2222
start_acs() {
23-
docker-compose -f $COMPOSE_FILE_PATH up --build -d actions-tutorial-acs
23+
docker-compose -f "$COMPOSE_FILE_PATH" up --build -d actions-tutorial-acs
2424
}
2525

2626
down() {
27-
docker-compose -f $COMPOSE_FILE_PATH down
27+
if [ -f "$COMPOSE_FILE_PATH" ]; then
28+
docker-compose -f "$COMPOSE_FILE_PATH" down
29+
fi
2830
}
2931

3032
purge() {
31-
docker volume rm actions-tutorial-acs-volume
32-
docker volume rm actions-tutorial-db-volume
33-
docker volume rm actions-tutorial-ass-volume
33+
docker volume rm -f actions-tutorial-acs-volume
34+
docker volume rm -f actions-tutorial-db-volume
35+
docker volume rm -f actions-tutorial-ass-volume
3436
}
3537

3638
build() {
37-
docker rmi alfresco-content-services-actions-tutorial:development
38-
docker rmi alfresco-share-actions-tutorial:development
39-
$MVN_EXEC clean install -DskipTests=true
39+
$MVN_EXEC clean package
4040
}
4141

4242
build_share() {
43-
docker-compose -f $COMPOSE_FILE_PATH kill actions-tutorial-share
44-
yes | docker-compose -f $COMPOSE_FILE_PATH rm -f actions-tutorial-share
45-
docker rmi alfresco-share-actions-tutorial:development
46-
$MVN_EXEC clean install -DskipTests=true -pl actions-tutorial-share
43+
docker-compose -f "$COMPOSE_FILE_PATH" kill actions-tutorial-share
44+
yes | docker-compose -f "$COMPOSE_FILE_PATH" rm -f actions-tutorial-share
45+
$MVN_EXEC clean package -pl actions-tutorial-share,actions-tutorial-share-docker
4746
}
4847

4948
build_acs() {
50-
docker-compose -f $COMPOSE_FILE_PATH kill actions-tutorial-acs
51-
yes | docker-compose -f $COMPOSE_FILE_PATH rm -f actions-tutorial-acs
52-
docker rmi alfresco-content-services-actions-tutorial:development
53-
$MVN_EXEC clean install -DskipTests=true -pl actions-tutorial-platform
49+
docker-compose -f "$COMPOSE_FILE_PATH" kill actions-tutorial-acs
50+
yes | docker-compose -f "$COMPOSE_FILE_PATH" rm -f actions-tutorial-acs
51+
$MVN_EXEC clean package -pl actions-tutorial-integration-tests,actions-tutorial-platform,actions-tutorial-platform-docker
5452
}
5553

5654
tail() {
57-
docker-compose -f $COMPOSE_FILE_PATH logs -f
55+
docker-compose -f "$COMPOSE_FILE_PATH" logs -f
5856
}
5957

6058
tail_all() {
61-
docker-compose -f $COMPOSE_FILE_PATH logs --tail="all"
59+
docker-compose -f "$COMPOSE_FILE_PATH" logs --tail="all"
60+
}
61+
62+
prepare_test() {
63+
$MVN_EXEC verify -DskipTests=true -pl actions-tutorial-platform,actions-tutorial-integration-tests,actions-tutorial-platform-docker
6264
}
6365

6466
test() {
65-
$MVN_EXEC verify -pl actions-tutorial-integration-tests
67+
$MVN_EXEC verify -pl actions-tutorial-platform,actions-tutorial-integration-tests
6668
}
6769

6870
case "$1" in
@@ -72,6 +74,13 @@ case "$1" in
7274
start
7375
tail
7476
;;
77+
build_start_it_supported)
78+
down
79+
build
80+
prepare_test
81+
start
82+
tail
83+
;;
7584
start)
7685
start
7786
tail
@@ -99,6 +108,7 @@ case "$1" in
99108
build_test)
100109
down
101110
build
111+
prepare_test
102112
start
103113
test
104114
tail_all
@@ -108,5 +118,5 @@ case "$1" in
108118
test
109119
;;
110120
*)
111-
echo "Usage: $0 {build_start|start|stop|purge|tail|reload_share|reload_acs|build_test|test}"
112-
esac
121+
echo "Usage: $0 {build_start|build_start_it_supported|start|stop|purge|tail|reload_share|reload_acs|build_test|test}"
122+
esac

0 commit comments

Comments
 (0)