Skip to content

Commit 3bb23ce

Browse files
committed
Merge branch 'sdk-4.0'
2 parents 1925599 + dbaed53 commit 3bb23ce

File tree

526 files changed

+12221
-22143
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

526 files changed

+12221
-22143
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ workflow/workflow-tutorial-share/.idea
2929
alfresco.log.*
3030
solr.log.*
3131
share.log.*
32+
target
33+
*.iml
3234
behaviors/behavior-tutorial-repo/.idea
3335
behaviors/behavior-tutorial-share/.idea
3436
behaviors/behavior-tutorial-common/.idea

README.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ Alfresco Developer Series Tutorials
33

44
Source code from the [ecmarchitect.com Alfresco Developer Series](https://ecmarchitect.com/alfresco-developer-series) tutorials.
55

6-
These tutorials are written for Alfresco Community Edition 5.2.f and Alfresco Enterprise 5.1. They leverage the Alfresco SDK 3.0.1. That version of the SDK should work with older versions of Alfresco, but certain releases may require modification.
6+
These tutorials are written for Alfresco 6.x, both Community and Enterprise
7+
Editions. They leverage Alfresco SDK 4.0. That version of the SDK will not work
8+
with older versions of Alfresco. If you want to go through these tutorials using
9+
an older version of Alfresco and the SDK, switch to the sdk-3.0.1 tag.
710

811
The tutorials build upon each other. The recommended order of progression is:
912

@@ -17,6 +20,15 @@ The tutorials build upon each other. The recommended order of progression is:
1720
Repository Structure
1821
--------------------
1922

20-
The repository contains a folder for each tutorial. Within that, there is a tutorial directory that contains the actual tutorial text and images as well as one or more project folders that contain source code that goes along with the tutorial.
23+
The repository contains a folder for each tutorial. Within that, there is a
24+
tutorial directory that contains the actual tutorial text and images as well as
25+
one or more project folders that contain source code that goes along with the
26+
tutorial.
2127

22-
The projects roughly build on each other. So, for example, if you want to work through the Actions tutorial, you'll need to understand the content tutorial and you will need to deploy the repo and share AMPs the content tutorial produces for subsequent tutorial source code to run in your own Alfresco repository.
28+
The projects roughly build on each other. So, for example, if you want to work
29+
through the Actions tutorial, you'll need to understand the content tutorial and
30+
you will need to check out the content tutorial source code and build it locally
31+
so that the actions project can pull in the content project as a dependency.
32+
33+
Each tutorial contains specifics on which earlier tutorials it needs as
34+
dependencies.

actions/actions-tutorial/integration-tests/pom.xml renamed to actions/actions-tutorial/actions-tutorial-integration-tests/pom.xml

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
33
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
44
<modelVersion>4.0.0</modelVersion>
5-
<artifactId>integration-tests</artifactId>
5+
<artifactId>actions-tutorial-integration-tests</artifactId>
66
<name>Integration Tests Module</name>
7-
<description>Integration Tests module for in-container integration testing - part of AIO - SDK 3</description>
7+
<description>Integration Tests module for in-container integration testing - part of AIO - SDK 4.0</description>
88
<packaging>jar</packaging> <!-- Note. this just runs Integration Tests, but it needs to be a JAR otherwise
99
nothing is compiled (i.e. you cannot set it to pom) -->
1010

@@ -68,6 +68,11 @@
6868
<groupId>org.apache.maven.plugins</groupId>
6969
<artifactId>maven-failsafe-plugin</artifactId>
7070
<version>2.19.1</version>
71+
<configuration>
72+
<systemPropertyVariables>
73+
<acs.endpoint.path>${test.acs.endpoint.path}</acs.endpoint.path>
74+
</systemPropertyVariables>
75+
</configuration>
7176
<executions>
7277
<execution>
7378
<id>integration-test</id>
@@ -92,22 +97,6 @@
9297
</dependency>
9398
</dependencies>
9499
</plugin>
95-
96-
<!-- Run Alfresco Tomcat embedded -->
97-
<plugin>
98-
<groupId>org.alfresco.maven.plugin</groupId>
99-
<artifactId>alfresco-maven-plugin</artifactId>
100-
<version>${alfresco.sdk.version}</version>
101-
<executions>
102-
<execution>
103-
<id>start-alfresco</id>
104-
<goals>
105-
<goal>it</goal>
106-
</goals>
107-
<phase>pre-integration-test</phase>
108-
</execution>
109-
</executions>
110-
</plugin>
111100
</plugins>
112101
</build>
113102
</project>

actions/actions-tutorial/integration-tests/src/test/java/com/someco/action/test/MoveReplacedActionIT.java renamed to actions/actions-tutorial/actions-tutorial-integration-tests/src/test/java/com/someco/action/test/MoveReplacedActionIT.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ public class MoveReplacedActionIT extends AbstractAlfrescoIT {
3232
@Test
3333
public void testGetAction() {
3434
ActionService actionService = getServiceRegistry().getActionService();
35-
Action action = actionService.createAction("move-replaced");
36-
Assert.assertNotNull(action);
35+
Action action = actionService.createAction("move-replaced");
36+
Assert.assertNotNull(action);
3737
}
3838

3939
@Test
@@ -51,22 +51,22 @@ public void testExecuteAction() {
5151

5252
// create content node
5353
ChildAssociationRef association = nodeService.createNode(
54-
companyHome,
55-
ContentModel.ASSOC_CONTAINS,
56-
QName.createQName(NamespaceService.CONTENT_MODEL_PREFIX, name),
57-
ContentModel.TYPE_CONTENT,
58-
contentProps
59-
);
54+
companyHome,
55+
ContentModel.ASSOC_CONTAINS,
56+
QName.createQName(NamespaceService.CONTENT_MODEL_PREFIX, name),
57+
ContentModel.TYPE_CONTENT,
58+
contentProps
59+
);
6060

6161
NodeRef content = association.getChildRef();
6262

6363
NodeRef targetFolder = nodeLocatorService.getNode(UserHomeNodeLocator.NAME, null, null);
6464

65-
Action action = actionService.createAction("move-replaced");
66-
action.setParameterValue("destination-folder", targetFolder);
67-
actionService.executeAction(action, content);
65+
Action action = actionService.createAction("move-replaced");
66+
action.setParameterValue("destination-folder", targetFolder);
67+
actionService.executeAction(action, content);
6868

69-
nodeService.deleteNode(content);
69+
nodeService.deleteNode(content);
7070
}
7171

7272
}
Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
<artifactId>actions-tutorial-platform-docker</artifactId>
6+
<name>Alfresco Platform/Repository Docker Module</name>
7+
<description>Platform/Repo Docker Module to generate the final Docker image</description>
8+
<packaging>jar</packaging>
9+
10+
<parent>
11+
<groupId>com.someco</groupId>
12+
<artifactId>actions-tutorial</artifactId>
13+
<version>1.0-SNAPSHOT</version>
14+
</parent>
15+
16+
<properties>
17+
</properties>
18+
19+
<dependencies>
20+
<dependency>
21+
<groupId>com.someco</groupId>
22+
<artifactId>actions-tutorial-platform</artifactId>
23+
<version>1.0-SNAPSHOT</version>
24+
<type>amp</type>
25+
</dependency>
26+
<dependency>
27+
<groupId>com.someco</groupId>
28+
<artifactId>actions-tutorial-integration-tests</artifactId>
29+
<version>1.0-SNAPSHOT</version>
30+
<scope>test</scope>
31+
<classifier>tests</classifier>
32+
</dependency>
33+
<dependency>
34+
<groupId>com.someco</groupId>
35+
<artifactId>content-tutorial-platform</artifactId>
36+
<version>1.0-SNAPSHOT</version>
37+
<type>amp</type>
38+
</dependency>
39+
<!-- Add any additional AMPs or extension JARs here that you want to be deployed in Alfresco -->
40+
<!-- IMPORTANT:
41+
If using amp extensions only, add <includeTypes>amp</includeTypes> to the "collect-extensions" execution below.
42+
If using both amp and jar extensions, you have to add:
43+
<exclusions>
44+
<exclusion>
45+
<groupId>*</groupId>
46+
<artifactId>*</artifactId>
47+
</exclusion>
48+
</exclusions>
49+
to each amp dependency definition.
50+
-->
51+
</dependencies>
52+
53+
<build>
54+
<plugins>
55+
<plugin>
56+
<groupId>org.apache.maven.plugins</groupId>
57+
<artifactId>maven-dependency-plugin</artifactId>
58+
<executions>
59+
<!-- Copy the repository extension and the dependencies required for execute integration tests -->
60+
<execution>
61+
<id>collect-test-artifacts</id>
62+
<phase>pre-integration-test</phase>
63+
<goals>
64+
<goal>copy-dependencies</goal>
65+
</goals>
66+
<configuration>
67+
<outputDirectory>${project.build.directory}/extensions</outputDirectory>
68+
<excludeScope>compile</excludeScope>
69+
</configuration>
70+
</execution>
71+
<!-- Collect extensions (JARs or AMPs) declared in this module do be deployed to docker -->
72+
<execution>
73+
<id>collect-extensions</id>
74+
<phase>package</phase>
75+
<goals>
76+
<goal>copy-dependencies</goal>
77+
</goals>
78+
<configuration>
79+
<outputDirectory>${project.build.directory}/extensions</outputDirectory>
80+
<includeScope>runtime</includeScope>
81+
<!-- IMPORTANT: if using amp dependencies only, add <includeTypes>amp</includeTypes> -->
82+
<includeTypes>amp</includeTypes>
83+
</configuration>
84+
</execution>
85+
</executions>
86+
</plugin>
87+
<!-- Filter the Dockerfile and the other files added to the container to be able to replace maven properties -->
88+
<plugin>
89+
<groupId>org.apache.maven.plugins</groupId>
90+
<artifactId>maven-resources-plugin</artifactId>
91+
<executions>
92+
<execution>
93+
<id>copy-and-filter-docker-resources</id>
94+
<phase>validate</phase>
95+
<goals>
96+
<goal>copy-resources</goal>
97+
</goals>
98+
<configuration>
99+
<outputDirectory>${project.build.directory}</outputDirectory>
100+
<resources>
101+
<resource>
102+
<directory>src/main/docker</directory>
103+
<filtering>true</filtering>
104+
<excludes>
105+
<exclude>**/*.jar</exclude>
106+
<exclude>**/*.so</exclude>
107+
<exclude>**/*.gz</exclude>
108+
</excludes>
109+
</resource>
110+
</resources>
111+
</configuration>
112+
</execution>
113+
<execution>
114+
<id>copy-and-filter-docker-resources-non-filtered</id>
115+
<phase>validate</phase>
116+
<goals>
117+
<goal>copy-resources</goal>
118+
</goals>
119+
<configuration>
120+
<outputDirectory>${project.build.directory}</outputDirectory>
121+
<resources>
122+
<resource>
123+
<directory>src/main/docker</directory>
124+
<filtering>false</filtering>
125+
<includes>
126+
<include>**/*.jar</include>
127+
<include>**/*.so</include>
128+
<include>**/*.gz</include>
129+
</includes>
130+
</resource>
131+
</resources>
132+
</configuration>
133+
</execution>
134+
</executions>
135+
</plugin>
136+
</plugins>
137+
</build>
138+
</project>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM ${docker.acs.image}:${alfresco.platform.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/alfresco/WEB-INF/lib/
7+
8+
# Copy Dockerfile to avoid an error if no AMPs exist
9+
COPY Dockerfile extensions/*.amp $TOMCAT_DIR/amps/
10+
RUN java -jar $TOMCAT_DIR/alfresco-mmt/alfresco-mmt*.jar install \
11+
$TOMCAT_DIR/amps $TOMCAT_DIR/webapps/alfresco -directory -nobackup -force
12+
13+
COPY alfresco-global.properties $TOMCAT_DIR/shared/classes/alfresco-global.properties
14+
COPY dev-log4j.properties $TOMCAT_DIR/shared/classes/alfresco/extension
15+
COPY disable-webscript-caching-context.xml $TOMCAT_DIR/shared/classes/alfresco/extension
16+
17+
# Copy Dockerfile to avoid an error if no license file exists
18+
COPY Dockerfile license/*.* $TOMCAT_DIR/webapps/alfresco/WEB-INF/classes/alfresco/extension/license/
Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,12 @@
1515
# RUN TIME PROPERTIES
1616
# -------------------
1717

18-
########################################################################################################################
18+
#
1919
# Alfresco configuration for running locally with PostgreSQL Database
2020
#
2121
# Configuration when running Tomcat embedded from Maven.
2222
# Property values from the POM but it can also be edited here.
23-
########################################################################################################################
24-
25-
dir.root=${alfresco.data.location}
23+
#
2624

2725
# Alfresco Repo Webapp (alfresco.war) context, ports etc
2826
alfresco.context=alfresco
@@ -33,19 +31,11 @@ alfresco.protocol=http
3331
# Alfresco Share Webapp (share.war) context, ports etc
3432
share.context=share
3533
share.host=localhost
36-
share.port=8080
34+
share.port=8180
3735
share.protocol=http
3836

39-
index.subsystem.name=solr4
40-
solr.host=localhost
41-
solr.port=8080
42-
solr.secureComms=none
43-
4437
# Don't try and recover any index
4538
index.recovery.mode=NONE
46-
# As we run embedded, we set Lucene
47-
# TODO: Find a better solution for indexing, as buildonly (embedded Lucene) is deprecated and going to be removed soon
48-
#index.subsystem.name=buildonly
4939

5040
# These jobs seem to require Lucene (Unsupported Operation with Solr) so we disable them / set to future date
5141
# See https://forums.alfresco.com/en/viewtopic.php?f=52&t=41597
@@ -60,13 +50,30 @@ integrity.failOnError=true
6050
# Alfresco Repository PostgreSQL Database configuration.
6151
# The PostgreSQL Driver is brought in via the tomcat7-maven-plugin as a dependency.
6252
db.driver=org.postgresql.Driver
63-
db.url=jdbc:postgresql://localhost:5432/alfrescoaio
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=actions-tutorial-ass
61+
solr.port=8983
62+
solr.secureComms=none
63+
6464
db.username=alfresco
6565
db.password=alfresco
6666
db.pool.initial=10
6767
db.pool.max=100
6868

69+
db.url=jdbc:postgresql://actions-tutorial-postgres:5432/alfresco
70+
6971
# File servers related properties
7072
# For local runs we disable CIFS and FTP
7173
cifs.enabled=false
72-
ftp.enabled=false
74+
ftp.enabled=false
75+
76+
csrf.filter.enabled=false
77+
78+
# Embedded broker without persistence
79+
messaging.broker.url=vm://localhost?broker.persistent=false

0 commit comments

Comments
 (0)