Compare commits

...

32 Commits

Author SHA1 Message Date
Andrea Ligios
400785cc66 Fixed next version - releases in master only 2021-03-29 09:45:39 +02:00
Jose Luis Osorno
cdd77a5a2a Merge branch 'sdk-4.1' of https://github.com/Alfresco/alfresco-sdk into sdk-4.1 2020-04-30 12:19:09 +02:00
Jose Luis Osorno
110b89651c Archetypes - Rename Alfresco Search Service 2020-04-30 12:18:13 +02:00
alfresco-build
36dbb24ce9 [maven-release-plugin] prepare for next development iteration 2019-12-18 14:40:36 +00:00
alfresco-build
84266f0379 [maven-release-plugin] prepare release alfresco-sdk-aggregator-4.1.0 2019-12-18 14:40:29 +00:00
Jose Luis Osorno
372afc6ba4 Archetypes - Update ACS 6.2.0 version 2019-11-18 10:28:46 +01:00
Jose Luis Osorno
3908cc73b7 Archetypes - Update ACS enterprise version
Update version to 6.2.0-RC3.
2019-10-21 09:28:24 +02:00
Jose Luis Osorno
76d813f2f4 Archetypes - Update SDK and alfresco versions
- Update SDK version to 4.1.0-SNAPSHOT
- Update Alfresco versions for 6.2.0
2019-10-18 11:15:12 +02:00
Jose Luis Osorno
5edd1f7b43 Merge pull request #582 from Alfresco/sdk-4/doc-62-support
Documentation - Update documentation to SDK 4.1
2019-10-18 10:18:44 +02:00
Jose Luis Osorno
12db1fcb17 Documentation - Update documentation to SDK 4.1
- Update SDK and ACS versions
- New article how to setup ATS in alfresco community
- New troubleshooting section about configuring ATS
2019-10-18 10:16:18 +02:00
Jose Luis Osorno
3e4a793f5d Merge pull request #581 from Alfresco/bug/578
Archetypes - Fix deprecated use of maven project name
2019-10-18 08:22:21 +02:00
Jose Luis Osorno
fba08f9ab7 Archetypes - Fix deprecated use of maven project name
Fix the use of the deprecated maven key ${build.finalName}. Using ${project.build.finalName}
instead.
2019-10-18 08:20:31 +02:00
Jose Luis Osorno
56300e35aa Merge pull request #580 from Alfresco/sdk-4/workflow-sample-fix
Archetypes - Fix workflow sample
2019-10-18 08:17:55 +02:00
Jose Luis Osorno
b4b0be82ae Archetypes - Fix workflow sample
Fix workflow sample in aio and platform archetypes
2019-10-18 08:15:46 +02:00
Jose Luis Osorno
50f43f23d3 Merge pull request #579 from Alfresco/sdk-4/acs-62-support
Archetypes - Add support for ACS 6.2
2019-10-18 08:11:45 +02:00
Jose Luis Osorno
2ee5120413 Archetypes - Add support for ACS 6.2
- New alfresco community and enterprise 6.2.0 profiles
- Execute dockerfile as root to avoid issues applying AMPs
- Disable transformation service by default in archetypes
2019-10-18 08:06:00 +02:00
Ole Hejlskov
7f861a9672 Merge pull request #564 from nbarithel/pwd_whitespace
Allow working directory to include whitespaces
2019-04-16 15:24:13 +02:00
Nicolas Barithel
b199afcd7e Allow working directory to include whitespaces 2019-04-05 14:36:09 +02:00
Jose Luis Osorno
7baf3fb0a1 Merge pull request #563 from Alfresco/sdk-4.0
SDK 4.0 RELEASE
2019-03-27 15:41:34 +01:00
Jose Luis Osorno
54504b4962 Archetypes IT - Fix IT archetype version number
Modify the archetypes ITs to get the version number from the pom.xml
file instead of hardcode the version.
2019-03-27 15:09:00 +01:00
Jose Luis Osorno
1503134f77 Merge branch 'master' into sdk-4.0 2019-03-27 14:53:44 +01:00
Jose Luis Osorno
71ed669795 Merge pull request #562 from Alfresco/sdk-3.1
SDK 3.1 RELEASE
2019-03-27 14:46:25 +01:00
Jose Luis Osorno
7d9b7de8c8 Documentation - Update SDK-3.1 SDK-4.0 release versions 2019-03-27 14:42:43 +01:00
Martin Bergljung
7483212c1f Merge branch 'sdk-4.0' of https://github.com/Alfresco/alfresco-sdk into sdk-4.0 2019-03-27 10:42:29 +00:00
Martin Bergljung
3d30a5893b Added documentation around working with the projects 2019-03-27 10:25:53 +00:00
alfresco-build
32666d167f [maven-release-plugin] prepare for next development iteration 2019-03-26 20:19:31 +00:00
alfresco-build
4cdc281f7f [maven-release-plugin] prepare for next development iteration 2019-03-26 18:50:32 +00:00
alfresco-build
f4c3ac7c84 [maven-release-plugin] prepare release alfresco-sdk-aggregator-3.1.0 2019-03-26 18:50:25 +00:00
alfresco-build
af8c6c42c4 [maven-release-plugin] prepare for next development iteration 2019-03-26 16:25:15 +00:00
alfresco-build
e61c08c650 [maven-release-plugin] prepare release alfresco-sdk-aggregator-3.1.0 2019-03-26 16:25:06 +00:00
Ole Hejlskov
3050c9deb4 Bump version to 3.1.0 2019-03-26 16:06:39 +01:00
Jose Luis Osorno
6dc927e668 Archetypes - Update default enterprise version to 5.2.4 2019-03-26 13:12:35 +01:00
66 changed files with 1310 additions and 275 deletions

View File

@@ -10,7 +10,9 @@ If you are an Enterprise customer check the [Support](#alfresco-enterprise-custo
## News
- 2019-XX-XX: Alfresco SDK 4.0.0 released **(confirmation required)**
- 2019-10: Alfresco SDK 4.1.0 released
- 2019-03: Alfresco SDK 4.0.0 released
- 2019-03: Alfresco SDK 3.1.0 released
- 2017-06-23: Alfresco SDK 3.0.1 released, [containing a critical bugfix](https://github.com/Alfresco/alfresco-sdk/issues/461)
- 2017-04-01: Alfresco SDK 3.0.0 released
- 2017-03-27: After years of hard work, countless iterations and gathering feedback, SDK 3.0 has finally been merged into the master branch, ready for release in the coming days
@@ -24,20 +26,20 @@ If you are an Enterprise customer check the [Support](#alfresco-enterprise-custo
## User Getting Started
### Latest Documentation
To get started with **Alfresco SDK 4.0.x** (latest) visit the [Alfresco Documentation](docs/README.md).
To get started with **Alfresco SDK 4.1.x** (latest) visit the [Alfresco Documentation](docs/README.md).
#### Documentation about Previous Versions
| SDK Version | Alfresco Enterprise Version | Alfresco Community Version | Documentation |
| ------------- |:-------------:| :-----:|:-----|
| SDK 4.0 | Alfresco 6.0.x / 6.1.x | Alfresco 6.0.x / 6.1.x | https://master--alfresco-builder-network.netlify.com **(confirmation required)** |
| SDK 4.1 | Alfresco 6.0.x / 6.1.x / 6.2.x | Alfresco 6.0.x / 6.1.x / 6.2.x | https://github.com/Alfresco/alfresco-sdk/tree/master/docs/README.md |
| SDK 4.0 | Alfresco 6.0.x / 6.1.x | Alfresco 6.0.x / 6.1.x | https://github.com/Alfresco/alfresco-sdk/blob/sdk-4.0/docs/README.md |
| SDK 3.1 | Alfresco 5.2.x | Alfresco 5.2.x | http://docs.alfresco.com/5.2/concepts/sdk-intro.html |
| SDK 3.0 | Alfresco 5.2.x | Alfresco 5.2.x | http://docs.alfresco.com/5.2/concepts/sdk-intro.html |
| SDK 2.2 | Alfresco 5.1.x | Alfresco 5.1.x | https://docs.alfresco.com/5.1/concepts/alfresco-sdk-intro.html |
| SDK 2.1 | Alfresco 5.0.1 | Alfresco 5.0.d | https://docs.alfresco.com/sdk2.1/concepts/alfresco-sdk-intro.html |
| SDK 2.0 | Alfresco 5.0.0 | Alfresco 5.0.c | https://docs.alfresco.com/sdk2.0/concepts/alfresco-sdk-intro.html |
| SDK 1.1.1 | Alfresco 4.2.x | Alfresco 4.2.x | https://docs.alfresco.com/4.2/concepts/dev-extensions-maven-sdk-intro.html |
## Reporting Issues and Community Support
Report issues (and contribute!) [here](https://github.com/Alfresco/alfresco-sdk/issues?milestone=1&state=open) or join us on the [IRC Channel](http://chat.alfresco.com/).

View File

@@ -11,7 +11,7 @@
<parent>
<groupId>org.alfresco.maven</groupId>
<artifactId>alfresco-sdk-aggregator</artifactId>
<version>4.0.0</version>
<version>4.2.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

View File

@@ -2,6 +2,8 @@ FROM ${docker.acs.image}:${alfresco.platform.version}
ARG TOMCAT_DIR=/usr/local/tomcat
USER root
# Copy Dockerfile to avoid an error if no JARs exist
COPY Dockerfile extensions/*.jar $TOMCAT_DIR/webapps/alfresco/WEB-INF/lib/
@@ -15,4 +17,6 @@ COPY dev-log4j.properties $TOMCAT_DIR/shared/classes/alfresco/extension
COPY disable-webscript-caching-context.xml $TOMCAT_DIR/shared/classes/alfresco/extension
# Copy Dockerfile to avoid an error if no license file exists
COPY Dockerfile license/*.* $TOMCAT_DIR/webapps/alfresco/WEB-INF/classes/alfresco/extension/license/
COPY Dockerfile license/*.* $TOMCAT_DIR/webapps/alfresco/WEB-INF/classes/alfresco/extension/license/
USER ${USERNAME}

View File

@@ -60,7 +60,7 @@ db.driver=org.postgresql.Driver
# alfresco/tomcat/shared/classes/alfresco-global.properties.
#
index.subsystem.name=solr6
solr.host=${rootArtifactId}-ass
solr.host=${rootArtifactId}-search
solr.port=8983
solr.secureComms=none
@@ -79,4 +79,9 @@ ftp.enabled=false
csrf.filter.enabled=false
# Embedded broker without persistence
messaging.broker.url=vm://localhost?broker.persistent=false
messaging.broker.url=vm://localhost?broker.persistent=false
# Disable ATS
transform.service.enabled=false
local.transform.service.enabled=false
legacy.transform.service.enabled=false

View File

@@ -36,5 +36,10 @@
</props>
</list>
</property>
<property name="labels">
<list>
<value>alfresco/module/${project.artifactId}/messages/workflow-messages</value>
</list>
</property>
</bean>
</beans>

View File

@@ -0,0 +1,5 @@
#
# Activiti My Process Workflow
#
my-process.workflow.title=My Process
my-process.workflow.description=This is my custom process

View File

@@ -1,20 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn"
xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC"
xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema"
expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test">
<definitions
xmlns:activiti="http://activiti.org/bpmn"
xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" typeLanguage="http://www.w3.org/2001/XMLSchema"
expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test">
<process id="my-process">
<startEvent id="start" />
<sequenceFlow id="flow1" sourceRef="start" targetRef="someTask" />
<userTask id="someTask" name="Activiti is awesome!" />
<sequenceFlow id="flow2" sourceRef="someTask" targetRef="end" />
<startEvent id="start" activiti:formKey="wf:submitAdhocTask"/>
<sequenceFlow id="flow1" sourceRef="start" targetRef="someTask"/>
<endEvent id="end" />
<userTask id="someTask" name="Activiti is awesome!" activiti:formKey="wf:adhocTask">
<humanPerformer>
<resourceAssignmentExpression>
<formalExpression>${bpm_assignee.properties.userName}</formalExpression>
</resourceAssignmentExpression>
</humanPerformer>
</userTask>
<sequenceFlow id="flow2" sourceRef="someTask" targetRef="end"/>
<endEvent id="end"/>
</process>

View File

@@ -38,23 +38,23 @@ services:
- "${symbol_dollar}{postgres.port}:5432"
volumes:
- ${rootArtifactId}-db-volume:/var/lib/postgresql/data
${rootArtifactId}-ass:
${rootArtifactId}-search:
image: alfresco/alfresco-search-services:1.2.0
environment:
SOLR_ALFRESCO_HOST: ${rootArtifactId}-acs
SOLR_ALFRESCO_PORT: 8080
SOLR_SOLR_HOST: ${rootArtifactId}-ass
SOLR_SOLR_HOST: ${rootArtifactId}-search
SOLR_SOLR_PORT: 8983
SOLR_CREATE_ALFRESCO_DEFAULTS: alfresco,archive
ports:
- "8983:8983"
volumes:
- ${rootArtifactId}-ass-volume:/opt/alfresco-search-services/contentstore
- ${rootArtifactId}-ass-volume:/opt/alfresco-search-services/data
- ${rootArtifactId}-search-volume:/opt/alfresco-search-services/contentstore
- ${rootArtifactId}-search-volume:/opt/alfresco-search-services/data
volumes:
${rootArtifactId}-acs-volume:
external: true
${rootArtifactId}-db-volume:
external: true
${rootArtifactId}-ass-volume:
${rootArtifactId}-search-volume:
external: true

View File

@@ -82,7 +82,7 @@ EXIT /B %ERRORLEVEL%
:start
docker volume create ${rootArtifactId}-acs-volume
docker volume create ${rootArtifactId}-db-volume
docker volume create ${rootArtifactId}-ass-volume
docker volume create ${rootArtifactId}-search-volume
docker-compose -f "%COMPOSE_FILE_PATH%" up --build -d
EXIT /B 0
:start_share
@@ -124,5 +124,5 @@ EXIT /B 0
:purge
docker volume rm -f ${rootArtifactId}-acs-volume
docker volume rm -f ${rootArtifactId}-db-volume
docker volume rm -f ${rootArtifactId}-ass-volume
docker volume rm -f ${rootArtifactId}-search-volume
EXIT /B 0

View File

@@ -1,7 +1,7 @@
#set( $symbol_dollar = '$' )
#!/bin/sh
export COMPOSE_FILE_PATH=${symbol_dollar}{PWD}/target/classes/docker/docker-compose.yml
export COMPOSE_FILE_PATH="${symbol_dollar}{PWD}/target/classes/docker/docker-compose.yml"
if [ -z "${symbol_dollar}{M2_HOME}" ]; then
export MVN_EXEC="mvn"
@@ -12,28 +12,28 @@ fi
start() {
docker volume create ${rootArtifactId}-acs-volume
docker volume create ${rootArtifactId}-db-volume
docker volume create ${rootArtifactId}-ass-volume
docker-compose -f ${symbol_dollar}COMPOSE_FILE_PATH up --build -d
docker volume create ${rootArtifactId}-search-volume
docker-compose -f "${symbol_dollar}COMPOSE_FILE_PATH" up --build -d
}
start_share() {
docker-compose -f ${symbol_dollar}COMPOSE_FILE_PATH up --build -d ${rootArtifactId}-share
docker-compose -f "${symbol_dollar}COMPOSE_FILE_PATH" up --build -d ${rootArtifactId}-share
}
start_acs() {
docker-compose -f ${symbol_dollar}COMPOSE_FILE_PATH up --build -d ${rootArtifactId}-acs
docker-compose -f "${symbol_dollar}COMPOSE_FILE_PATH" up --build -d ${rootArtifactId}-acs
}
down() {
if [ -f ${symbol_dollar}COMPOSE_FILE_PATH ]; then
docker-compose -f ${symbol_dollar}COMPOSE_FILE_PATH down
if [ -f "${symbol_dollar}COMPOSE_FILE_PATH" ]; then
docker-compose -f "${symbol_dollar}COMPOSE_FILE_PATH" down
fi
}
purge() {
docker volume rm -f ${rootArtifactId}-acs-volume
docker volume rm -f ${rootArtifactId}-db-volume
docker volume rm -f ${rootArtifactId}-ass-volume
docker volume rm -f ${rootArtifactId}-search-volume
}
build() {
@@ -41,23 +41,23 @@ build() {
}
build_share() {
docker-compose -f ${symbol_dollar}COMPOSE_FILE_PATH kill ${rootArtifactId}-share
yes | docker-compose -f ${symbol_dollar}COMPOSE_FILE_PATH rm -f ${rootArtifactId}-share
docker-compose -f "${symbol_dollar}COMPOSE_FILE_PATH" kill ${rootArtifactId}-share
yes | docker-compose -f "${symbol_dollar}COMPOSE_FILE_PATH" rm -f ${rootArtifactId}-share
${symbol_dollar}MVN_EXEC clean package -pl ${rootArtifactId}-share,${rootArtifactId}-share-docker
}
build_acs() {
docker-compose -f ${symbol_dollar}COMPOSE_FILE_PATH kill ${rootArtifactId}-acs
yes | docker-compose -f ${symbol_dollar}COMPOSE_FILE_PATH rm -f ${rootArtifactId}-acs
docker-compose -f "${symbol_dollar}COMPOSE_FILE_PATH" kill ${rootArtifactId}-acs
yes | docker-compose -f "${symbol_dollar}COMPOSE_FILE_PATH" rm -f ${rootArtifactId}-acs
${symbol_dollar}MVN_EXEC clean package -pl ${rootArtifactId}-integration-tests,${rootArtifactId}-platform,${rootArtifactId}-platform-docker
}
tail() {
docker-compose -f ${symbol_dollar}COMPOSE_FILE_PATH logs -f
docker-compose -f "${symbol_dollar}COMPOSE_FILE_PATH" logs -f
}
tail_all() {
docker-compose -f ${symbol_dollar}COMPOSE_FILE_PATH logs --tail="all"
docker-compose -f "${symbol_dollar}COMPOSE_FILE_PATH" logs --tail="all"
}
prepare_test() {

View File

@@ -12,7 +12,7 @@
<parent>
<groupId>org.alfresco.maven</groupId>
<artifactId>alfresco-sdk-aggregator</artifactId>
<version>4.0.0</version>
<version>4.2.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

View File

@@ -34,23 +34,23 @@ services:
- "${symbol_dollar}{postgres.port}:5432"
volumes:
- ${rootArtifactId}-db-volume:/var/lib/postgresql/data
${rootArtifactId}-ass:
${rootArtifactId}-search:
image: alfresco/alfresco-search-services:1.2.0
environment:
SOLR_ALFRESCO_HOST: ${rootArtifactId}-acs
SOLR_ALFRESCO_PORT: 8080
SOLR_SOLR_HOST: ${rootArtifactId}-ass
SOLR_SOLR_HOST: ${rootArtifactId}-search
SOLR_SOLR_PORT: 8983
SOLR_CREATE_ALFRESCO_DEFAULTS: alfresco,archive
ports:
- "8983:8983"
volumes:
- ${rootArtifactId}-ass-volume:/opt/alfresco-search-services/contentstore
- ${rootArtifactId}-ass-volume:/opt/alfresco-search-services/data
- ${rootArtifactId}-search-volume:/opt/alfresco-search-services/contentstore
- ${rootArtifactId}-search-volume:/opt/alfresco-search-services/data
volumes:
${rootArtifactId}-acs-volume:
external: true
${rootArtifactId}-db-volume:
external: true
${rootArtifactId}-ass-volume:
${rootArtifactId}-search-volume:
external: true

View File

@@ -239,7 +239,7 @@
<resource>
<directory>target</directory>
<includes>
<include>${build.finalName}.jar</include>
<include>${project.build.finalName}.jar</include>
</includes>
<filtering>false</filtering>
</resource>
@@ -258,7 +258,7 @@
<resource>
<directory>target</directory>
<includes>
<include>${build.finalName}-tests.jar</include>
<include>${project.build.finalName}-tests.jar</include>
</includes>
<filtering>false</filtering>
</resource>

View File

@@ -70,7 +70,7 @@ EXIT /B %ERRORLEVEL%
:start
docker volume create ${rootArtifactId}-acs-volume
docker volume create ${rootArtifactId}-db-volume
docker volume create ${rootArtifactId}-ass-volume
docker volume create ${rootArtifactId}-search-volume
docker-compose -f "%COMPOSE_FILE_PATH%" up --build -d
EXIT /B 0
:down
@@ -96,5 +96,5 @@ EXIT /B 0
:purge
docker volume rm -f ${rootArtifactId}-acs-volume
docker volume rm -f ${rootArtifactId}-db-volume
docker volume rm -f ${rootArtifactId}-ass-volume
docker volume rm -f ${rootArtifactId}-search-volume
EXIT /B 0

View File

@@ -1,7 +1,7 @@
#set( $symbol_dollar = '$' )
#!/bin/sh
export COMPOSE_FILE_PATH=${symbol_dollar}{PWD}/target/classes/docker/docker-compose.yml
export COMPOSE_FILE_PATH="${symbol_dollar}{PWD}/target/classes/docker/docker-compose.yml"
if [ -z "${symbol_dollar}{M2_HOME}" ]; then
export MVN_EXEC="mvn"
@@ -12,20 +12,20 @@ fi
start() {
docker volume create ${rootArtifactId}-acs-volume
docker volume create ${rootArtifactId}-db-volume
docker volume create ${rootArtifactId}-ass-volume
docker-compose -f ${symbol_dollar}COMPOSE_FILE_PATH up --build -d
docker volume create ${rootArtifactId}-search-volume
docker-compose -f "${symbol_dollar}COMPOSE_FILE_PATH" up --build -d
}
down() {
if [ -f ${symbol_dollar}COMPOSE_FILE_PATH ]; then
docker-compose -f ${symbol_dollar}COMPOSE_FILE_PATH down
if [ -f "${symbol_dollar}COMPOSE_FILE_PATH" ]; then
docker-compose -f "${symbol_dollar}COMPOSE_FILE_PATH" down
fi
}
purge() {
docker volume rm -f ${rootArtifactId}-acs-volume
docker volume rm -f ${rootArtifactId}-db-volume
docker volume rm -f ${rootArtifactId}-ass-volume
docker volume rm -f ${rootArtifactId}-search-volume
}
build() {
@@ -33,11 +33,11 @@ build() {
}
tail() {
docker-compose -f ${symbol_dollar}COMPOSE_FILE_PATH logs -f
docker-compose -f "${symbol_dollar}COMPOSE_FILE_PATH" logs -f
}
tail_all() {
docker-compose -f ${symbol_dollar}COMPOSE_FILE_PATH logs --tail="all"
docker-compose -f "${symbol_dollar}COMPOSE_FILE_PATH" logs --tail="all"
}
prepare_test() {

View File

@@ -2,6 +2,8 @@ FROM ${docker.acs.image}:${alfresco.platform.version}
ARG TOMCAT_DIR=/usr/local/tomcat
USER root
# Copy Dockerfile to avoid an error if no JARs exist
COPY Dockerfile extensions/*.jar $TOMCAT_DIR/webapps/alfresco/WEB-INF/lib/
@@ -15,4 +17,6 @@ COPY dev-log4j.properties $TOMCAT_DIR/shared/classes/alfresco/extension
COPY disable-webscript-caching-context.xml $TOMCAT_DIR/shared/classes/alfresco/extension
# Copy Dockerfile to avoid an error if no license file exists
COPY Dockerfile license/*.* $TOMCAT_DIR/webapps/alfresco/WEB-INF/classes/alfresco/extension/license/
COPY Dockerfile license/*.* $TOMCAT_DIR/webapps/alfresco/WEB-INF/classes/alfresco/extension/license/
USER ${USERNAME}

View File

@@ -60,7 +60,7 @@ db.driver=org.postgresql.Driver
# alfresco/tomcat/shared/classes/alfresco-global.properties.
#
index.subsystem.name=solr6
solr.host=${rootArtifactId}-ass
solr.host=${rootArtifactId}-search
solr.port=8983
solr.secureComms=none
@@ -79,4 +79,9 @@ ftp.enabled=false
csrf.filter.enabled=false
# Embedded broker without persistence
messaging.broker.url=vm://localhost?broker.persistent=false
messaging.broker.url=vm://localhost?broker.persistent=false
# Disable ATS
transform.service.enabled=false
local.transform.service.enabled=false
legacy.transform.service.enabled=false

View File

@@ -36,5 +36,10 @@
</props>
</list>
</property>
<property name="labels">
<list>
<value>alfresco/module/${project.artifactId}/messages/workflow-messages</value>
</list>
</property>
</bean>
</beans>

View File

@@ -0,0 +1,5 @@
#
# Activiti My Process Workflow
#
my-process.workflow.title=My Process
my-process.workflow.description=This is my custom process

View File

@@ -1,20 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn"
xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC"
xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema"
expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test">
<definitions
xmlns:activiti="http://activiti.org/bpmn"
xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" typeLanguage="http://www.w3.org/2001/XMLSchema"
expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test">
<process id="my-process">
<startEvent id="start" />
<sequenceFlow id="flow1" sourceRef="start" targetRef="someTask" />
<userTask id="someTask" name="Activiti is awesome!" />
<sequenceFlow id="flow2" sourceRef="someTask" targetRef="end" />
<startEvent id="start" activiti:formKey="wf:submitAdhocTask"/>
<sequenceFlow id="flow1" sourceRef="start" targetRef="someTask"/>
<endEvent id="end" />
<userTask id="someTask" name="Activiti is awesome!" activiti:formKey="wf:adhocTask">
<humanPerformer>
<resourceAssignmentExpression>
<formalExpression>${bpm_assignee.properties.userName}</formalExpression>
</resourceAssignmentExpression>
</humanPerformer>
</userTask>
<sequenceFlow id="flow2" sourceRef="someTask" targetRef="end"/>
<endEvent id="end"/>
</process>

View File

@@ -14,7 +14,7 @@
<parent>
<groupId>org.alfresco.maven</groupId>
<artifactId>alfresco-sdk-aggregator</artifactId>
<version>4.0.0</version>
<version>4.2.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

View File

@@ -22,13 +22,16 @@ services:
# -Ddb.username=alfresco
# -Ddb.password=alfresco
# -Ddb.url=jdbc:postgresql://${rootArtifactId}-postgres:5432/alfresco
# -Dsolr.host=${rootArtifactId}-ass
# -Dsolr.host=${rootArtifactId}-search
# -Dsolr.port=8983
# -Dsolr.secureComms=none
# -Dsolr.base.url=/solr
# -Dindex.subsystem.name=solr6
# -Dcsrf.filter.enabled=false
# -Dmessaging.broker.url=\"vm://localhost?broker.persistent=false\"
# -Dtransform.service.enabled=false
# -Dlocal.transform.service.enabled=false
# -Dlegacy.transform.service.enabled=false
# "
# ports:
# - "${symbol_dollar}{acs.port}:8080"
@@ -47,23 +50,23 @@ services:
# - "${symbol_dollar}{postgres.port}:5432"
# volumes:
# - ${rootArtifactId}-db-volume:/var/lib/postgresql/data
# ${rootArtifactId}-ass:
# ${rootArtifactId}-search:
# image: alfresco/alfresco-search-services:1.2.0
# environment:
# SOLR_ALFRESCO_HOST: ${rootArtifactId}-acs
# SOLR_ALFRESCO_PORT: 8080
# SOLR_SOLR_HOST: ${rootArtifactId}-ass
# SOLR_SOLR_HOST: ${rootArtifactId}-search
# SOLR_SOLR_PORT: 8983
# SOLR_CREATE_ALFRESCO_DEFAULTS: alfresco,archive
# ports:
# - "8983:8983"
# volumes:
# - ${rootArtifactId}-ass-volume:/opt/alfresco-search-services/contentstore
# - ${rootArtifactId}-ass-volume:/opt/alfresco-search-services/data
# - ${rootArtifactId}-search-volume:/opt/alfresco-search-services/contentstore
# - ${rootArtifactId}-search-volume:/opt/alfresco-search-services/data
#volumes:
# ${rootArtifactId}-acs-volume:
# external: true
# ${rootArtifactId}-db-volume:
# external: true
# ${rootArtifactId}-ass-volume:
# ${rootArtifactId}-search-volume:
# external: true

View File

@@ -207,7 +207,7 @@
<resource>
<directory>target</directory>
<includes>
<include>${build.finalName}.jar</include>
<include>${project.build.finalName}.jar</include>
</includes>
<filtering>false</filtering>
</resource>

View File

@@ -54,7 +54,7 @@ EXIT /B %ERRORLEVEL%
:start
docker volume create ${rootArtifactId}-acs-volume
docker volume create ${rootArtifactId}-db-volume
docker volume create ${rootArtifactId}-ass-volume
docker volume create ${rootArtifactId}-search-volume
docker-compose -f "%COMPOSE_FILE_PATH%" up --build -d
EXIT /B 0
:start_share
@@ -82,5 +82,5 @@ EXIT /B 0
:purge
docker volume rm -f ${rootArtifactId}-acs-volume
docker volume rm -f ${rootArtifactId}-db-volume
docker volume rm -f ${rootArtifactId}-ass-volume
docker volume rm -f ${rootArtifactId}-search-volume
EXIT /B 0

View File

@@ -1,7 +1,7 @@
#set( $symbol_dollar = '$' )
#!/bin/sh
export COMPOSE_FILE_PATH=${symbol_dollar}{PWD}/target/classes/docker/docker-compose.yml
export COMPOSE_FILE_PATH="${symbol_dollar}{PWD}/target/classes/docker/docker-compose.yml"
if [ -z "${symbol_dollar}{M2_HOME}" ]; then
export MVN_EXEC="mvn"
@@ -12,24 +12,24 @@ fi
start() {
docker volume create ${rootArtifactId}-acs-volume
docker volume create ${rootArtifactId}-db-volume
docker volume create ${rootArtifactId}-ass-volume
docker-compose -f ${symbol_dollar}COMPOSE_FILE_PATH up --build -d
docker volume create ${rootArtifactId}-search-volume
docker-compose -f "${symbol_dollar}COMPOSE_FILE_PATH" up --build -d
}
start_share() {
docker-compose -f ${symbol_dollar}COMPOSE_FILE_PATH up --build -d ${rootArtifactId}-share
docker-compose -f "${symbol_dollar}COMPOSE_FILE_PATH" up --build -d ${rootArtifactId}-share
}
down() {
if [ -f ${symbol_dollar}COMPOSE_FILE_PATH ]; then
docker-compose -f ${symbol_dollar}COMPOSE_FILE_PATH down
if [ -f "${symbol_dollar}COMPOSE_FILE_PATH" ]; then
docker-compose -f "${symbol_dollar}COMPOSE_FILE_PATH" down
fi
}
purge() {
docker volume rm -f ${rootArtifactId}-acs-volume
docker volume rm -f ${rootArtifactId}-db-volume
docker volume rm -f ${rootArtifactId}-ass-volume
docker volume rm -f ${rootArtifactId}-search-volume
}
build() {
@@ -37,17 +37,17 @@ build() {
}
build_share() {
docker-compose -f ${symbol_dollar}COMPOSE_FILE_PATH kill ${rootArtifactId}-share
yes | docker-compose -f ${symbol_dollar}COMPOSE_FILE_PATH rm -f ${rootArtifactId}-share
docker-compose -f "${symbol_dollar}COMPOSE_FILE_PATH" kill ${rootArtifactId}-share
yes | docker-compose -f "${symbol_dollar}COMPOSE_FILE_PATH" rm -f ${rootArtifactId}-share
${symbol_dollar}MVN_EXEC clean package
}
tail() {
docker-compose -f ${symbol_dollar}COMPOSE_FILE_PATH logs -f
docker-compose -f "${symbol_dollar}COMPOSE_FILE_PATH" logs -f
}
tail_all() {
docker-compose -f ${symbol_dollar}COMPOSE_FILE_PATH logs --tail="all"
docker-compose -f "${symbol_dollar}COMPOSE_FILE_PATH" logs --tail="all"
}
case "${symbol_dollar}1" in

View File

@@ -17,7 +17,7 @@
<parent>
<groupId>org.alfresco.maven</groupId>
<artifactId>alfresco-sdk-aggregator</artifactId>
<version>4.0.0</version>
<version>4.2.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
@@ -78,6 +78,7 @@
<org.slf4j.simpleLogger.showDateTime>false</org.slf4j.simpleLogger.showDateTime>
<org.slf4j.simpleLogger.showThreadName>false</org.slf4j.simpleLogger.showThreadName>
<org.slf4j.simpleLogger.showLogName>false</org.slf4j.simpleLogger.showLogName>
<projectArtifactId>${project.version}</projectArtifactId>
</systemPropertyVariables>
</configuration>
</plugin>

View File

@@ -17,7 +17,7 @@ public class AllInOneArchetypeIT extends AbstractArchetypeIT {
return ArchetypeProperties.builder()
.withArchetypeGroupId("org.alfresco.maven.archetype")
.withArchetypeArtifactId("alfresco-allinone-archetype")
.withArchetypeVersion("4.0.0-SNAPSHOT")
.withArchetypeVersion(System.getProperty("projectArtifactId"))
.withProjectGroupId("archetype.it")
.withProjectArtifactId("allinone-test-run")
.withProjectVersion("0.1-SNAPSHOT")

View File

@@ -17,7 +17,7 @@ public class PlatformJarArchetypeIT extends AbstractArchetypeIT {
return ArchetypeProperties.builder()
.withArchetypeGroupId("org.alfresco.maven.archetype")
.withArchetypeArtifactId("alfresco-platform-jar-archetype")
.withArchetypeVersion("4.0.0-SNAPSHOT")
.withArchetypeVersion(System.getProperty("projectArtifactId"))
.withProjectGroupId("archetype.it")
.withProjectArtifactId("repojar-test-run")
.withProjectVersion("0.1-SNAPSHOT")

View File

@@ -17,7 +17,7 @@ public class ShareJarArchetypeIT extends AbstractArchetypeIT {
return ArchetypeProperties.builder()
.withArchetypeGroupId("org.alfresco.maven.archetype")
.withArchetypeArtifactId("alfresco-share-jar-archetype")
.withArchetypeVersion("4.0.0-SNAPSHOT")
.withArchetypeVersion(System.getProperty("projectArtifactId"))
.withProjectGroupId("archetype.it")
.withProjectArtifactId("sharejar-test-run")
.withProjectVersion("0.1-SNAPSHOT")

View File

@@ -1,35 +1,35 @@
---
Title: Alfresco SDK 4.0
Title: Alfresco SDK 4.1
Added: v3.0.0
Last reviewed: 2019-01-17
Last reviewed: 2019-10-18
---
# Alfresco SDK 4.0
# Alfresco SDK 4.1
Alfresco SDK 4.0 is a Maven based development kit that provides an easy to use approach to developing applications and extensions for Alfresco. With this
Alfresco SDK 4.1 is a Maven based development kit that provides an easy to use approach to developing applications and extensions for Alfresco. With this
SDK you can develop, package, test, run, document and release your Alfresco extension project.
For earlier releases of the Alfresco SDK, see the Previous versions section of [http://docs.alfresco.com](http://docs.alfresco.com).
For earlier releases of the Alfresco SDK, see the Previous versions of [http://docs.alfresco.com](http://docs.alfresco.com).
The Alfresco Software Development Kit (Alfresco SDK) is a fundamental tool provided by Alfresco to developers to build customizations and extensions for
the Alfresco Digital Business Platform. It is based on [Apache Maven](http://maven.apache.org/) and [Docker](https://www.docker.com/) and is compatible with
major IDEs. This enables Rapid Application Development (RAD) and Test Driven Development (TDD).
Alfresco SDK 4.0 is released under [Apache License version 2.0](http://www.apache.org/licenses/LICENSE-2.0.html) and supports Alfresco Content Services both
Alfresco SDK 4.1 is released under [Apache License version 2.0](http://www.apache.org/licenses/LICENSE-2.0.html) and supports Alfresco Content Services both
in Community Edition and Enterprise Edition. If you're an Enterprise customer, please check the [Alfresco SDK Support status](https://www.alfresco.com/alfresco-product-support-status)
for the version you're using. If your version is in Limited or Full Support and you need help, contact our Support team [http://support.alfresco.com](http://support.alfresco.com/).
Alfresco SDK 4.0 is a major update to the SDK and provides several improvements on the previous releases.
Alfresco SDK 4.1 is a minor update to the SDK and provides support for Alfresco 6.2.x.
The 4.0 release takes advantage of Semantic Versioning ([SEMVER](http://semver.org/)), which means that this new release is not directly compatible with the
previous releases of the SDK.
If you have existing projects that you wish to upgrade to SDK 4.0.x, the recommended approach is to generate a new project from our archetypes and move your
If you have existing projects that you wish to upgrade to SDK 4.1.x, the recommended approach is to generate a new project from our archetypes and move your
code into place.
## Documentation Content
* [What's new?](whats-new.md)
* [Getting started with Alfresco SDK 4.0](getting-started.md)
* [Getting started with Alfresco SDK 4.1](getting-started.md)
* [Alfresco SDK Maven archetypes](mvn-archetypes.md)
* [Working with generated projects](working-with-generated-projects/README.md)
* [All-In-One project structure](working-with-generated-projects/structure-aio.md)

View File

@@ -1,9 +1,9 @@
---
Title: Advanced topics
Added: v3.0.0
Last reviewed: 2019-01-17
Last reviewed: 2019-10-18
---
# Advanced topics
This information provides more advanced topics that you might come in contact with when you have been working with an SDK project for a while. We will have a
look at how you can work with AMPs, remote debugging, hot reloading, and more.
look at how you can work with AMPs, remote debugging, hot reloading, enable transformations and more.

View File

@@ -0,0 +1,96 @@
---
Title: How to set up Alfresco Transform Service (Community)
Added: v4.0.0
Last reviewed: 2019-10-18
---
# How to set up Alfresco Transform Service (Community)
By default, the _Alfresco Transform Service_ (from now ATS) is not included in the basic configuration of the projects generated making use of the Alfresco
SDK archetypes.
ATS is now supported in ACS Community and it is distributed as a composition of Docker containers. The docker images required for ATS are available in the
Alfresco account at [Docker Hub](https://hub.docker.com/u/alfresco/).
In order to properly configure ATS in a project generated using the Alfresco SDK archetypes it is required to execute 2 steps:
1. Add the containers that conform ATS to the Docker compose file.
2. Configure the properties that are required to properly set up ATS.
## Adding the new containers
* Locate the Docker compose file (usually at `PROJECT_ROOT_PATH/docker/docker-compose.yml`) and add the containers that conform ATS (`alfresco-pdf-renderer`,
`imagemagick`, `libreoffice`, `tika`, `transform-misc` and `activemq`):
```
services:
...
alfresco-pdf-renderer:
image: alfresco/alfresco-pdf-renderer:2.1.0-RC3
environment:
JAVA_OPTS: " -Xms256m -Xmx512m"
ports:
- 8090:8090
imagemagick:
image: alfresco/alfresco-imagemagick:2.1.0-RC3
environment:
JAVA_OPTS: " -Xms256m -Xmx512m"
ports:
- 8091:8090
libreoffice:
image: alfresco/alfresco-libreoffice:2.1.0-RC3
environment:
JAVA_OPTS: " -Xms256m -Xmx512m"
ports:
- 8092:8090
tika:
image: alfresco/alfresco-tika:2.1.0-RC3
environment:
JAVA_OPTS: " -Xms256m -Xmx512m"
ports:
- 8093:8090
transform-misc:
image: alfresco/alfresco-transform-misc:2.1.0-RC3
environment:
JAVA_OPTS: " -Xms256m -Xmx512m"
ports:
- 8094:8090
activemq:
image: alfresco/alfresco-activemq:5.15.8
ports:
- 8161:8161 # Web Console
- 5672:5672 # AMQP
- 61616:61616 # OpenWire
- 61613:61613 # STOMP
...
```
* Check that you haven't any port conflict with other services in the Docker compose file.
## Adding the required configuration
* Locate the _Alfresco global properties_ file for docker (usually at `PROJECT_ROOT_PATH/PROJECT_ARTIFACT_ID-platform-docker/src/main/docker/alfresco-global.properties`)
and add the ATS configuration properties:
```
# Alfresco Transform Service
local.transform.service.enabled=true
localTransform.pdfrenderer.url=http://alfresco-pdf-renderer:8090/
localTransform.imagemagick.url=http://imagemagick:8090/
localTransform.libreoffice.url=http://libreoffice:8090/
localTransform.tika.url=http://tika:8090/
localTransform.misc.url=http://transform-misc:8090/
legacy.transform.service.enabled=true
alfresco-pdf-renderer.url=http://alfresco-pdf-renderer:8090/
jodconverter.url=http://libreoffice:8090/
img.url=http://imagemagick:8090/
tika.url=http://tika:8090/
transform.misc.url=http://transform-misc:8090/
messaging.broker.url=failover:(nio://activemq:61616)?timeout=3000&jms.useCompression=true
```
* Remove the old value of the properties: `messaging.broker.url`, `transform.service.enabled`, `local.transform.service.enabled` and
`legacy.transform.service.enabled` in the same `alfresco-global.properties` file.
Once these 2 modifications are done, rebuild and restart all the services (`run.sh/run.bat build_start`) and ACS will use ATS to execute remote transformations
asynchronously whenever possible.

View File

@@ -1,11 +1,11 @@
---
Title: Working with AMPs
Added: v3.0.0
Last reviewed: 2019-01-14
Last reviewed: 2019-10-18
---
# Working with AMPs
Since the early days of the Alfresco SDK, the Alfresco Module Packages (AMP) have been the way customizations were packaged. In Alfresco SDK 4.0 everything
Since the early days of the Alfresco SDK, the Alfresco Module Packages (AMP) have been the way customizations were packaged. In Alfresco SDK 4.1 everything
is packaged as a JAR by default, while the AMPs are still available as an optional assembly. This gives you much more control over packaging, and simple
modules can easily be deployed as JARs.
@@ -55,7 +55,7 @@ to your needs.
## Installing AMPs with the SDK
The projects created from the Alfresco SDK 4.0 archetypes are configured to deploy either JARs or AMPs to the ACS / Share docker container. The only thing to
The projects created from the Alfresco SDK 4.1 archetypes are configured to deploy either JARs or AMPs to the ACS / Share docker container. The only thing to
do is modify the `pom.xml` file of the corresponding docker module / project in order to properly configure the dependencies and the Maven dependency plugin.
### All-In-One project
@@ -110,7 +110,7 @@ do is modify the `pom.xml` file of the corresponding docker module / project in
<resource>
<directory>target</directory>
<includes>
<include>${build.finalName}.amp</include>
<include>${project.build.finalName}.amp</include>
</includes>
<filtering>false</filtering>
</resource>
@@ -172,7 +172,7 @@ Here is an example of how to install Florian Maul's Javascript Console.
## Controlling the order AMPs are applied
Under some specific circumstances it is necessary to apply different AMPs in a development project in a precise order. The default configuration of the
projects generated using the Alfresco SDK 4.0 archetypes doesn't specify any concrete order applying the AMPs to the ACS/Share installation.
projects generated using the Alfresco SDK 4.1 archetypes doesn't specify any concrete order applying the AMPs to the ACS/Share installation.
Anyway, that order can be controlled modifying slightly the configuration of the custom Docker images in the project. For instance, let's say we have three
third party AMPs that we want to apply in the next order `third-party-amp-01.amp -> third-party-amp-02.amp -> third-party-amp-03.amp`. In this example, we're

View File

@@ -1,7 +1,7 @@
---
Title: Debugging
Added: v3.0.0
Last reviewed: 2019-01-17
Last reviewed: 2019-10-18
---
# Debugging
@@ -10,4 +10,4 @@ application server. This section outlines the steps needed to configure Alfresco
and to troubleshoot issues by stepping through the code line by line.
Here we assume you have already generated an Alfresco project using the Alfresco SDK. If you don't have a project already, follow the steps in
[Getting started with Alfresco SDK 4.0](../../getting-started.md) to learn how to generate it in a few easy steps.
[Getting started with Alfresco SDK 4.1](../../getting-started.md) to learn how to generate it in a few easy steps.

View File

@@ -1,11 +1,11 @@
---
Title: Remote debugging using Eclipse
Added: v3.0.0
Last reviewed: 2019-01-14
Last reviewed: 2019-10-18
---
# Remote debugging using Eclipse
All the projects generated using the Alfresco SDK 4.0 are pre-configured to listen for remote debug connections. Depending on the selected archetypes you'll
All the projects generated using the Alfresco SDK 4.1 are pre-configured to listen for remote debug connections. Depending on the selected archetypes you'll
have a port for remotely debugging ACS, share or both of them.
By default, the remote debug port for ACS is **8888** and for share is **9898**. This configuration can be changed through the maven properties `acs.debug.port`
@@ -79,7 +79,7 @@ application. In our case, we are going to test the behaviour of debugging by run
8. Open your browser and type `http://localhost:8080/alfresco/s/sample/helloworld`.
This is a sample webscript generated in every project created using SDK 4.0 and the platform artifact.
This is a sample webscript generated in every project created using SDK 4.1 and the platform artifact.
![Alt text](../../docassets/images/sdk-hellofromjava.png "Hello World webscript original result")

View File

@@ -1,11 +1,11 @@
---
Title: Remote debugging using IntelliJ
Added: v3.0.0
Last reviewed: 2019-01-14
Last reviewed: 2019-10-18
---
# Remote debugging using IntelliJ
All the projects generated using the Alfresco SDK 4.0 are pre-configured to listen for remote debug connections. Depending on the selected archetypes you'll
All the projects generated using the Alfresco SDK 4.1 are pre-configured to listen for remote debug connections. Depending on the selected archetypes you'll
have a port for remotely debugging ACS, share or both of them.
By default, the remote debug port for ACS is **8888** and for share is **9898**. This configuration can be changed through the maven properties `acs.debug.port`
@@ -77,7 +77,7 @@ application. In our case, we are going to test the behaviour of debugging by run
7. Open your browser and type `http://localhost:8080/alfresco/s/sample/helloworld`.
This is a sample webscript generated in every project created using SDK 4.0 and the platform artifact.
This is a sample webscript generated in every project created using SDK 4.1 and the platform artifact.
![Alt text](../../docassets/images/sdk-hellofromjava.png "Hello World webscript original result")

View File

@@ -1,7 +1,7 @@
---
Title: Hot reloading
Added: v3.0.0
Last reviewed: 2019-01-17
Last reviewed: 2019-10-18
---
# Hot reloading

View File

@@ -1,19 +1,19 @@
---
Title: How to configure and use Hotswap Agent
Added: v3.0.0
Last reviewed: 2019-01-14
Last reviewed: 2019-10-18
---
# How to configure and use Hotswap Agent
[HotSwapAgent](http://hotswapagent.org/index.html) is the agent that enables you to do hot reloading. This allows you to modify the application code, and
view the changes without having to restart Alfresco Tomcat (or the ACS Docker container).
A prerequisite for this tutorial is to have a project created with the Alfresco SDK 4.0, using the All-In-One archetype or the Platform JAR archetype. It's
A prerequisite for this tutorial is to have a project created with the Alfresco SDK 4.1, using the All-In-One archetype or the Platform JAR archetype. It's
worth noting that hot reloading is only supported on the platform, and not in Alfresco Share.
As an alternative to the HotSwapAgent you can also try out JRebel. It has more features but isn't free.
The way to configure HotSwapAgent in case of using Java 8 or Java 11 is pretty different. By default, ACS 6.0 uses Java 8 and ACS 6.1 uses Java 11.
The way to configure HotSwapAgent in case of using Java 8 or Java 11 is pretty different. By default, ACS 6.0 uses Java 8 and ACS 6.1+ uses Java 11.
## Issue with Docker Toolbox
@@ -112,7 +112,7 @@ For more information about HotSwapAgent configuration for Java 8, please check t
Using Java 11 and HotSwapAgent, it isn't necessary to configure the java agent and the alternative JVM as in previous versions. Instead, it is required
to use an alternative pre-built JDK distribution. That JDK is based on OpenJDK and includes all the required modifications to run the HotSwapAgent properly.
In the context of the Alfresco SDK 4.0, this change is an issue because the JDK installation is inherited from the [Alfresco java docker image](https://github.com/Alfresco/alfresco-docker-base-java).
In the context of the Alfresco SDK 4.1, this change is an issue because the JDK installation is inherited from the [Alfresco java docker image](https://github.com/Alfresco/alfresco-docker-base-java).
It is necessary to modify the project ACS docker image to change the default java installation of the container's OS to the one provided by HotSwapAgent.
A way to implement the required modifications would be:
@@ -250,7 +250,7 @@ You'll recognize HotSwapAgent is working when you see similar log messages:
2. Before making any changes, let's run the sample webscript by opening your browser and typing `http://localhost:8080/alfresco/s/sample/helloworld`.
This is a sample webscript generated in every project created using SDK 4.0 and the platform artifact.
This is a sample webscript generated in every project created using SDK 4.1 and the platform artifact.
![Alt text](../../docassets/images/sdk-hellofromjava.png "Hello World webscript original result")

View File

@@ -1,14 +1,14 @@
---
Title: How to configure and use JRebel
Added: v3.0.0
Last reviewed: 2019-01-14
Last reviewed: 2019-10-18
---
# How to configure and use JRebel
[JRebel](https://zeroturnaround.com/software/jrebel/) is the agent that enables you to do hot reloading. This allows you to modify the application code,
and view the changes without having to restart Alfresco Tomcat (or the ACS Docker container).
A prerequisite to this tutorial is having an Alfresco project created with Alfresco SDK 4.0, using the All-In-One archetype, or the Platform JAR archetype.
A prerequisite to this tutorial is having an Alfresco project created with Alfresco SDK 4.1, using the All-In-One archetype, or the Platform JAR archetype.
It's worth noting that hot reloading is only supported on the platform, and not in Alfresco Share.
An open source and free of charge alternative to JRebel is HotSwapAgent. For more details, see the [HotSwapAgent website](http://hotswapagent.org/index.html).

View File

@@ -1,7 +1,7 @@
---
Title: Integration testing
Added: v3.0.0
Last reviewed: 2019-01-16
Last reviewed: 2019-10-18
---
# Integration testing
@@ -11,11 +11,11 @@ in an integration test plan to those aggregates, and delivers as its output the
Even if the definition of integration testing is a general description, the concept is also valid for Alfresco projects.
The Alfresco SDK 4.0 keeps the same general idea of integration testing provided by SDK 3.0, but this new version reshapes it slightly to leverage on a
The Alfresco SDK 4.1 keeps the same general idea of integration testing provided by SDK 3.0, but this new version reshapes it slightly to leverage on a
Docker-oriented environment.
Here are the basics to understanding and using integration testing in the context of projects created with the SDK, from a technical perspective:
* SDK 4.0 develops integration tests for the platform only. Currently, the integration tests that the SDK is able to manage by default is related to
* SDK 4.1 develops integration tests for the platform only. Currently, the integration tests that the SDK is able to manage by default is related to
Alfresco Content Services (ACS) only.
* Integration tests require an ACS instance to be up and running. You will see that all the scripts and commands are designed to easily manage this
requirement, but the prerequisite for the SDK is that an ACS instance is available.

View File

@@ -1,11 +1,11 @@
---
Title: How to run SDK's integration tests
Added: v3.0.0
Last reviewed: 2019-01-16
Last reviewed: 2019-10-18
---
# How to run SDK's integration tests
Running the integration tests of a project generated from the Alfresco SDK 4.0 archetypes is pretty easy. Let's distinguish different cases of executing the
Running the integration tests of a project generated from the Alfresco SDK 4.1 archetypes is pretty easy. Let's distinguish different cases of executing the
integration tests.
## Command line

View File

@@ -1,7 +1,7 @@
---
Title: How SDK's integration tests work
Added: v3.0.0
Last reviewed: 2019-01-16
Last reviewed: 2019-10-18
---
# How SDK's integration tests work
@@ -36,7 +36,7 @@ or set the Java system property `acs.endpoint.path`.
## Integration tests configuration in the All-In-One project
So, taking into account the previous section, let's see how the integration tests are configured in a project generated from the SDK 4.0 All-In-One archetype.
So, taking into account the previous section, let's see how the integration tests are configured in a project generated from the SDK 4.1 All-In-One archetype.
* The maven dependencies required to execute the integration tests are deployed to the ACS Docker image in the `PROJECT_ARTEFACTID-platform-docker` maven
module using the `maven-dependency-plugin`. The configuration is done in the file `PROJECT_ARTEFACTID-platform-docker/pom.xml`:

View File

@@ -1,7 +1,7 @@
---
Title: Switching Alfresco Content Services database
Added: v4.0.0
Last reviewed: 2019-01-29
Last reviewed: 2019-10-18
---
# Switching Alfresco Content Services database

View File

@@ -1,14 +1,14 @@
---
Title: Switching Alfresco Content Services and Share versions
Added: v3.0.0
Last reviewed: 2019-01-16
Last reviewed: 2019-10-18
---
# Switching Alfresco Content Services and Share versions
The latest version of the Alfresco SDK supports different versions for Alfresco Content Services and Alfresco Share. Since each product is no longer
released under one common version number, ACS (i.e. alfresco.war) and the Share UI (share.war) are now released with individual version numbers.
By default, SDK 4.0 is configured to generate projects using the most recent version of ACS and Share. You can easily change one (or both) versions by
By default, SDK 4 is configured to generate projects using the most recent version of ACS and Share. You can easily change one (or both) versions by
simply updating the `pom.xml` file in your project. The compatibility of these versions is up to you, however you should check in advance the right versions
to use.
@@ -28,7 +28,7 @@ The supported versions are explained in the next sections of this article.
## Switch to Alfresco version 6.0.x
Starting from a newly created Alfresco SDK 4.0 project (All-In-One, Platform JAR, or Share JAR), lets replace the two properties with the following ones.
Starting from a newly created Alfresco SDK 4.1 project (All-In-One, Platform JAR, or Share JAR), lets replace the two properties with the following ones.
1. Open the pom.xml in your generated project.
@@ -54,6 +54,34 @@ $ ./run.sh purge
$ ./run.sh build_start
```
**IMPORTANT:** Alfresco 6.1 is ready to work with JDK 11, but Alfresco 6.0 needs to be compiled and run using JDK 8, so please take this into account when you
switch from version 6.1.x to 6.0.x. If you compile Alfresco 6.0.x with JDK 11 you'll experience the issue described in the [Troubleshooting page](../troubleshooting.md)
**IMPORTANT:** Alfresco 6.1+ is ready to work with JDK 11, but Alfresco 6.0 needs to be compiled and run using JDK 8, so please take this into account when you
switch from version 6.1+ to 6.0.x. If you compile Alfresco 6.0.x with JDK 11 you'll experience the issue described in the [Troubleshooting page](../troubleshooting.md)
about wrong JDK versions.
## Switch to Alfresco version 6.1.x
Starting from a newly created Alfresco SDK 4.1 project (All-In-One, Platform JAR, or Share JAR), lets replace the two properties with the following ones.
1. Open the pom.xml in your generated project.
2. Replace the properties with the following:
```
<alfresco.platform.version>6.1.2-ga</alfresco.platform.version>
<alfresco.share.version>6.1.0-RC3</alfresco.share.version>
```
In this example we have shown the switch to version 6.1.2-ga. Feel free to use the correct version for your project, paying attention to the compatible versions
of Alfresco Content Services and Alfresco Share.
3. After changing the versions, delete all the previous data of your development Docker environment:
```
$ ./run.sh purge
```
4. Rebuild and restart the project:
```
$ ./run.sh build_start
```

View File

@@ -3,15 +3,15 @@ Title: Upgrading
Added: v4.0.0
Last reviewed: 2019-01-29
---
# Upgrading an SDK 3.0 project to SDK 4.0
# Upgrading an SDK 3.0 project to SDK 4.1
In these instructions, "base" refers to a freshly instantiated SDK 4.0 and "target" refers to the SDK 3.0.1 project that is being upgraded.
In these instructions, "base" refers to a freshly instantiated SDK 4.1 and "target" refers to the SDK 3.0.1 project that is being upgraded.
## Download a base
Download or instantiate an SDK 4.0 project to use as a base for copying files.
Download or instantiate an SDK 4.1 project to use as a base for copying files.
For example, you might create a new project called "test-aio-400" to use as a base from which to copy files into the target project that is to be upgraded.
For example, you might create a new project called `test-aio-400` to use as a base from which to copy files into the target project that is to be upgraded.
## Remove unnecessary files
@@ -65,7 +65,7 @@ Similar to previous step, the directory should follow the same pattern as the ex
Need to smartly do this merge so that target project maintains its dependencies, name, version, description, etc.
1. Copy the entire `<properties>` element from the base 4.0 pom.xml into the target 3.0 pom.xml, replacing the existing one completely.
1. Copy the entire `<properties>` element from the base 4.1 pom.xml into the target 3.0 pom.xml, replacing the existing one completely.
2. Change the `acs.host` property to match the target project name.
@@ -220,7 +220,7 @@ Then that would need to be moved into the share docker module's pom.xml file in
## Changes to the integration-tests module
1. Completely replace the pom.xml file with the pom.xml file from the 4.0 pom.xml file under integration-tests.
1. Completely replace the pom.xml file with the pom.xml file from the 4.1 pom.xml file under integration-tests.
2. Edit the integration-tests pom.xml to replace references to the base project name with references to the target project name.
@@ -230,7 +230,7 @@ Then that would need to be moved into the share docker module's pom.xml file in
## Changes to the platform-jar module
Smartly merge the pom.xml file from the 4.0 platform-jar module into the existing platform-jar module pom.xml file.
Smartly merge the pom.xml file from the 4.1 platform-jar module into the existing platform-jar module pom.xml file.
Maintain the dependencies from the 3.0 platform-jar module pom.xml.
@@ -238,13 +238,13 @@ Any old "platformModule" dependencies, which are typically AMPs or JARs that nee
## Changes to the share-jar module
Smartly merge the pom.xml file from the 4.0 share-jar module into the existing share-jar module pom.xml file.
Smartly merge the pom.xml file from the 4.1 share-jar module into the existing share-jar module pom.xml file.
Maintain the dependencies from the 3.0 share-jar module pom.xml.
Any old "shareModule" dependencies, which are typically AMPs or JARs that need to be installed in the Share tier need to be copied into this pom.xml's depdencies.
Remove the spring-surf-api dependency from the 4.0 share-jar module. Remove:
Remove the spring-surf-api dependency from the 4.1 share-jar module. Remove:
```
<dependency>

View File

@@ -1,7 +1,7 @@
---
Title: Working with Enterprise
Added: v3.0.0
Last reviewed: 2019-01-15
Last reviewed: 2019-10-18
---
# Working with Enterprise
@@ -54,11 +54,11 @@ The configuration of the Enterprise version is straightforward when using the `p
You'll need to update the following settings in the `pom.xml` file:
```
<alfresco.platform.version>6.1.0</alfresco.platform.version>
<alfresco.share.version>6.1.0</alfresco.share.version>
<alfresco.platform.version>6.2.0</alfresco.platform.version>
<alfresco.share.version>6.2.0</alfresco.share.version>
```
Making use of the Alfresco SDK 4.0 it is no longer required the configuration of the Alfresco Surf versions. The inclusion of the BOM and the custom Docker
Making use of the Alfresco SDK 4 it is no longer required the configuration of the Alfresco Surf versions. The inclusion of the BOM and the custom Docker
images will take care of that task automatically for you.
## Purging the project data and running the project

View File

@@ -1,9 +1,9 @@
---
Title: How to set up Alfresco Transform Service
Title: How to set up Alfresco Transform Service (Enterprise)
Added: v4.0.0
Last reviewed: 2019-01-14
Last reviewed: 2019-10-18
---
# How to set up Alfresco Transform Service
# How to set up Alfresco Transform Service (Enterprise)
By default, the _Alfresco Transform Service_ (from now ATS) is not included in the basic configuration of the projects generated making use of the Alfresco
SDK archetypes.
@@ -18,53 +18,78 @@ In order to properly configure ATS in a project generated using the Alfresco SDK
## Adding the new containers
* Locate the Docker compose file (usually at `PROJECT_ROOT_PATH/docker/docker-compose.yml`) and add the containers that conform ATS (`transform-router`,
`alfresco-pdf-renderer`, `imagemagick`, `libreoffice`, `tika`, `shared-file-store` and `activemq`):
`alfresco-pdf-renderer`, `imagemagick`, `libreoffice`, `tika`, `transform-misc`, `shared-file-store` and `activemq`):
```
services:
...
transform-router:
image: quay.io/alfresco/alfresco-transform-router:0.5.0
image: quay.io/alfresco/alfresco-transform-router:1.1.0-RC3
environment:
JAVA_OPTS: " -Xms256m -Xmx512m"
ACTIVEMQ_URL: "nio://activemq:61616"
IMAGEMAGICK_URL: "http://imagemagick:8090"
PDF_RENDERER_URL: "http://alfresco-pdf-renderer:8090"
LIBREOFFICE_URL: "http://libreoffice:8090"
TIKA_URL: "http://tika:8090"
PDF_RENDERER_URL : "http://alfresco-pdf-renderer:8090"
LIBREOFFICE_URL : "http://libreoffice:8090"
TIKA_URL : "http://tika:8090"
TRANSFORM_MISC_URL : "http://transform-misc:8090"
FILE_STORE_URL: "http://shared-file-store:8099/alfresco/api/-default-/private/sfs/versions/1/file"
ports:
- 8095:8095
links:
- activemq
alfresco-pdf-renderer:
image: quay.io/alfresco/alfresco-pdf-renderer:2.0.8
image: alfresco/alfresco-pdf-renderer:2.1.0-RC2
environment:
JAVA_OPTS: " -Xms256m -Xmx512m"
ACTIVEMQ_URL: "nio://activemq:61616"
FILE_STORE_URL: "http://shared-file-store:8099/alfresco/api/-default-/private/sfs/versions/1/file"
ports:
- 8090:8090
links:
- activemq
imagemagick:
image: quay.io/alfresco/alfresco-imagemagick:2.0.8
image: alfresco/alfresco-imagemagick:2.1.0-RC2
environment:
JAVA_OPTS: " -Xms256m -Xmx512m"
ACTIVEMQ_URL: "nio://activemq:61616"
FILE_STORE_URL: "http://shared-file-store:8099/alfresco/api/-default-/private/sfs/versions/1/file"
ports:
- 8091:8090
links:
- activemq
libreoffice:
image: quay.io/alfresco/alfresco-libreoffice:2.0.8
image: alfresco/alfresco-libreoffice:2.1.0-RC2
environment:
JAVA_OPTS: " -Xms256m -Xmx512m"
ACTIVEMQ_URL: "nio://activemq:61616"
FILE_STORE_URL: "http://shared-file-store:8099/alfresco/api/-default-/private/sfs/versions/1/file"
ports:
- 8092:8090
links:
- activemq
tika:
image: quay.io/alfresco/alfresco-tika:2.0.8
image: alfresco/alfresco-tika:2.1.0-RC2
environment:
JAVA_OPTS: " -Xms256m -Xmx512m"
ACTIVEMQ_URL: "nio://activemq:61616"
FILE_STORE_URL: "http://shared-file-store:8099/alfresco/api/-default-/private/sfs/versions/1/file"
ports:
- 8093:8090
links:
- activemq
transform-misc:
image: alfresco/alfresco-transform-misc:2.1.0-RC2
environment:
JAVA_OPTS: " -Xms256m -Xmx512m"
ACTIVEMQ_URL: "nio://activemq:61616"
FILE_STORE_URL: "http://shared-file-store:8099/alfresco/api/-default-/private/sfs/versions/1/file"
ports:
- 8094:8090
links:
- activemq
shared-file-store:
image: alfresco/alfresco-shared-file-store:0.5.1
image: alfresco/alfresco-shared-file-store:0.5.3
environment:
JAVA_OPTS: " -Xms256m -Xmx512m"
scheduler.content.age.millis: 86400000
@@ -74,7 +99,7 @@ services:
volumes:
- shared-file-store-volume:/tmp/Alfresco/sfs
activemq:
image: alfresco/alfresco-activemq:5.15.6
image: alfresco/alfresco-activemq:5.15.8
ports:
- 8161:8161 # Web Console
- 5672:5672 # AMQP
@@ -102,13 +127,24 @@ and add the ATS configuration properties:
```
# Alfresco Transform Service
transform.service.enabled=true
transform.service.url=http://transform-router:8095
sfs.url=http://shared-file-store:8099/
local.transform.service.enabled=true
localTransform.pdfrenderer.url=http://alfresco-pdf-renderer:8090/
localTransform.imagemagick.url=http://imagemagick:8090/
localTransform.libreoffice.url=http://libreoffice:8090/
localTransform.tika.url=http://tika:8090/
localTransform.misc.url=http://transform-misc:8090/
legacy.transform.service.enabled=true
alfresco-pdf-renderer.url=http://alfresco-pdf-renderer:8090/
jodconverter.url=http://libreoffice:8090/
img.url=http://imagemagick:8090/
tika.url=http://tika:8090/
sfs.url=http://shared-file-store:8099/
local.transform.service.enabled=true
transform.service.enabled=true
transform.misc.url=http://transform-misc:8090/
messaging.broker.url=failover:(nio://activemq:61616)?timeout=3000&jms.useCompression=true
```

View File

@@ -1,7 +1,7 @@
---
Title: How to configure private Alfresco Docker registry
Added: v3.0.0
Last reviewed: 2019-01-15
Last reviewed: 2019-10-18
---
# How to configure private Alfresco Docker registry

View File

@@ -1,7 +1,7 @@
---
Title: How to configure private Alfresco Nexus repository
Added: v3.0.0
Last reviewed: 2019-01-15
Last reviewed: 2019-10-18
---
# How to configure private Alfresco Nexus repository

View File

@@ -1,15 +1,15 @@
---
Title: Getting started with Alfresco SDK 4.0
Title: Getting started with Alfresco SDK 4.1
Added: v2.1.1
Last reviewed: 2019-01-14
Last reviewed: 2019-10-18
---
# Getting started with Alfresco SDK 4.0
# Getting started with Alfresco SDK 4.1
Use these instructions to get started with using Alfresco SDK 4.0.
Use these instructions to get started with using Alfresco SDK 4.1.
## Prerequisites
There are a number of software requirements for using Alfresco SDK 4.0.
There are a number of software requirements for using Alfresco SDK 4.1.
* Java Development Kit (JDK) - Version 11
* Maven - Version 3.3
* Docker - Latest stable version
@@ -18,7 +18,7 @@ There are a number of software requirements for using Alfresco SDK 4.0.
### Java
ACS 6.0 is compiled and executed using Java 8, but it is highly recommended to work with ACS 6.1 which uses Java 11.
ACS 6.0 is compiled and executed using Java 8, but it is highly recommended to work with ACS 6.1+ which uses Java 11.
1. Download [JDK 11](https://jdk.java.net/11/), unzip it and configure it as the default Java installation.
@@ -46,7 +46,7 @@ JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home
Alfresco recommends that you keep up-to-date with all the Maven releases. Linux distributions and package managers tend to bundle older releases and this is
the most common pitfall.
Alfresco SDK 4.0 requires Maven 3.3.0+, but you are recommended to download the latest version.
Alfresco SDK 4.1 requires Maven 3.3.0+, but you are recommended to download the latest version.
1. Download and install [Apache Maven](https://maven.apache.org/download.cgi) and make sure it is configured correctly on your path.
@@ -95,7 +95,7 @@ mvn archetype:generate -Dfilter=org.alfresco:
```
You'll be prompted to select the archetype you want. The previously available archetypes, alfresco-amp-archetype and share-amp-archetype will still show up
as an option, however these archetypes are not part of Alfresco SDK 4.0.
as an option, however these archetypes are not part of Alfresco SDK 4.1.
Attention: You'll need double quotes around the filter part if you are using Windows Powershell: mvn archetype:generate "-Dfilter=org.alfresco:".
@@ -118,7 +118,7 @@ Choose archetype:
* `org.alfresco.maven.archetype:alfresco-platform-jar-archetype`
* `org.alfresco.maven.archetype:alfresco-share-jar-archetype`
3. Choose the latest version, such as 4.0.0.
3. Choose the latest version, such as 4.1.0.
```
Choose org.alfresco.maven.archetype:alfresco-allinone-archetype version:
@@ -133,6 +133,7 @@ Choose org.alfresco.maven.archetype:alfresco-allinone-archetype version:
9: 3.0.0
10: 3.0.1
11: 4.0.0
12: 4.1.0
```
4. Next you will be prompted for additional values, like groupId, artifactId, and package, as shown below:
@@ -161,7 +162,7 @@ If everything has been configured correctly, you should see something similar to
```
[INFO] ----------------------------------------------------------------------------
[INFO] Using following parameters for creating project from Archetype: alfresco-allinone-archetype:4.0.0-SNAPSHOT
[INFO] Using following parameters for creating project from Archetype: alfresco-allinone-archetype:4.1.0-SNAPSHOT
[INFO] ----------------------------------------------------------------------------
[INFO] Parameter: groupId, Value: com.acme
[INFO] Parameter: artifactId, Value: my-all-in-one
@@ -188,7 +189,7 @@ If everything has been configured correctly, you should see something similar to
[INFO] ------------------------------------------------------------------------
```
7. You have successfully generated your first SDK 4.0 project.
7. You have successfully generated your first SDK 4.1 project.
Inside the project, you will find the `run.bat` and `run.sh` scripts. These are convenience scripts for you to quickly compile / test / run your project.

View File

@@ -1,21 +1,21 @@
---
Title: Alfresco SDK Maven archetypes
Added: v2.1.1
Last reviewed: 2019-01-15
Last reviewed: 2019-10-18
---
# Alfresco SDK Maven archetypes
The Alfresco SDK 4.0 comes with a number of Maven archetypes that can be used to generate Alfresco extension projects.
The Alfresco SDK 4.1 comes with a number of Maven archetypes that can be used to generate Alfresco extension projects.
For more details, see [Getting started with Alfresco SDK 4.0](getting-started.md).
For more details, see [Getting started with Alfresco SDK 4.1](getting-started.md).
These archetypes are available during the creation of a brand new project. In short, a [Maven archetype](https://maven.apache.org/guides/introduction/introduction-to-archetypes.html)
is a project templating toolkit. It's defined as an original pattern or model from which all other things of the same kind are made. Using archetypes
provides a great way to enable developers to quickly follow best practice in a consistent way. This is valid for every project built with Apache Maven and
it's valid in particular when using Alfresco SDK 4.0.
it's valid in particular when using Alfresco SDK 4.1.
In this section we are going to introduce all the available archetypes in Alfresco SDK 4.0, with a brief description of their purpose and main use.
After reading this information, you should be able to understand the various possibilities that Alfresco SDK 4.0 can offer to developers, in terms of
In this section we are going to introduce all the available archetypes in Alfresco SDK 4.1, with a brief description of their purpose and main use.
After reading this information, you should be able to understand the various possibilities that Alfresco SDK 4.1 can offer to developers, in terms of
projects.
When generating your project, you'll be prompted to select the Maven archetype you want to use through an interactive menu, similar to what you can see below.
@@ -55,7 +55,7 @@ Please note that the numbering is not sequential and some numbers may be skipped
### org.alfresco.maven.archetype:alfresco-allinone-archetype
This archetype allows a developer to implement the All-In-One project on Alfresco Content Services. The All-In-One project (also called AIO) is provided in
this and previous versions of Alfresco SDK, but in SDK 4.0 it has been reshaped to leverage on Docker.
this and previous versions of Alfresco SDK, but in SDK 4.1 it has been reshaped to leverage on Docker.
The All-In-One archetype allows a developer to create a multi-module project on Alfresco Content Services. The All-In-One project mainly includes a module for
the core repository in ACS and a module for the Share client. This includes:
@@ -80,7 +80,7 @@ For more information about the All-In-One project, see [All-In-One project struc
### org.alfresco.maven.archetype:alfresco-platform-jar-archetype
This archetype allows a developer to implement the Platform JAR project on Alfresco Content Services. It has been reshaped in SDK 4.0 to leverage on Docker.
This archetype allows a developer to implement the Platform JAR project on Alfresco Content Services. It has been reshaped in SDK 4.1 to leverage on Docker.
The Platform JAR Maven archetype allows a developer to create a module on Alfresco Content Services, in particular on the Repository side, and includes:
@@ -99,7 +99,7 @@ For more information about the Platform JAR project, see [Platform JAR project s
### org.alfresco.maven.archetype:alfresco-share-jar-archetype
This archetype allows a developer to implement the Share JAR project on an Alfresco Share client. It has been reshaped in SDK 4.0 to leverage on Docker.
This archetype allows a developer to implement the Share JAR project on an Alfresco Share client. It has been reshaped in SDK 4.1 to leverage on Docker.
The Share JAR Maven archetype allows a developer to create a module on an Alfresco Share client, and includes:

View File

@@ -1,7 +1,7 @@
---
Title: Setting up your development environment
Added: v3.0.0
Last reviewed: 2019-01-17
Last reviewed: 2019-10-18
---
# Setting up your development environment

View File

@@ -1,7 +1,7 @@
---
Title: Setting up your development environment using Eclipse
Added: v3.0.0
Last reviewed: 2019-01-14
Last reviewed: 2019-10-18
---
# Setting up your development environment using Eclipse
@@ -9,7 +9,7 @@ The Maven Alfresco SDK is designed to work well with Eclipse. This support inclu
Alfresco SDK.
Here we assume you already have an Eclipse installation up and running, together with an available Alfresco project created using the Alfresco SDK. If you
don't have a project already, follow the steps in [Getting started with Alfresco SDK 4.0](../getting-started.md) to learn how to quickly generate it in a few
don't have a project already, follow the steps in [Getting started with Alfresco SDK 4.1](../getting-started.md) to learn how to quickly generate it in a few
easy steps.
## Importing the Alfresco project into Eclipse

View File

@@ -1,7 +1,7 @@
---
Title: Setting up your development environment using Intellij IDEA
Added: v3.0.0
Last reviewed: 2019-01-14
Last reviewed: 2019-10-18
---
# Setting up your development environment using Intellij IDEA
@@ -9,7 +9,7 @@ The Maven Alfresco SDK is designed to work well with Eclipse. This support inclu
Alfresco SDK.
Here we assume you already have an Eclipse installation up and running, together with an available Alfresco project created using the Alfresco SDK. If you
don't have a project already, follow the steps in [Getting started with Alfresco SDK 4.0](../getting-started.md) to learn how to quickly generate it in a few
don't have a project already, follow the steps in [Getting started with Alfresco SDK 4.1](../getting-started.md) to learn how to quickly generate it in a few
easy steps.
## Importing the Alfresco project into Intellij IDEA

View File

@@ -1,15 +1,16 @@
---
Title: Troubleshooting
Added: v3.0.0
Last reviewed: 2019-01-14
Last reviewed: 2019-10-18
---
# Troubleshooting
This article describes a list of common issues with the projects generated from the Alfresco SDK 4.0 archetypes and the way to troubleshoot them.
This article describes a list of common issues with the projects generated from the Alfresco SDK 4.1 archetypes and the way to troubleshoot them.
* [Incorrect JDK version](#incorrect-jdk-version)
* [Containers synchronization](#containers-synchronization)
* [Ports conflict](#ports-conflict)
* [Transformations not working](#transformations-not-working)
## Incorrect JDK version
@@ -146,3 +147,17 @@ That allows you to modify the number of the exposed ports through maven properti
```
That way, if you face a port conflict, you only need to change the port in the corresponding maven property and rebuilt and restart the project.
## Alfresco Share previews / Transformations not working
### Problem
Some files with different formats like _doc_, _docx_ or _xls_ can't be previewed in Alfresco Share. The source reason of this problem is that the Alfresco
Transformation Service (ATS) is not working. ATS is required to generate the content renditions that will be used by Alfresco Share to show the content preview.
### Solution
By default, ATS is not included in the basic configuration of the projects generated making use of the Alfresco SDK 4 archetypes.
To enable it, you simply need to follow the steps described in the article [How to set up Alfresco Transform Service](advanced-topics/alfresco-transform-service.md).
If you're working with Alfresco Enterprise you must follow [this guide](advanced-topics/working-with-enterprise/alfresco-transform-service.md).

View File

@@ -1,7 +1,7 @@
---
Title: What's new?
Added: v2.1.1
Last reviewed: 2019-01-17
Last reviewed: 2019-10-18
---
# What's new?
@@ -56,3 +56,7 @@ The integration tests and the mechanisms to execute them in an Alfresco Content
However, the inclusion of Docker and the utility scripts provides a different perspective about the environment on which the integration tests are executed.
In this version, the integration tests are run against the dockerised environment defined using Docker and Docker compose. By doing so, the integration test
environment can be more similar to a real one, including whatever other service is required for a full featured integration test execution.
## Support for Alfresco 6.2.x
Alfresco SDK 4.1 provides support for Alfresco 6.2.x.

View File

@@ -1,23 +1,27 @@
---
Title: Working with generated projects
Added: v3.0.0
Last reviewed: 2019-01-15
Last reviewed: 2019-10-18
---
# Working with generated projects
After generating a project using one of the Alfresco SDK 4.0 Maven archetypes, it is important to know how to build / run / test these projects.
After generating a project using one of the Alfresco SDK 4.1 Maven archetypes, it is important to know how to build / run / test these projects.
The Alfresco Platform 6 deployment architecture is highly based on container technologies, specifically in
[Docker](http://docs.alfresco.com/6.0/concepts/master-deploy.html). Due to that, the projects generated using the Alfresco SDK 4.0 archetypes set up their
local environment making an intensive use of Docker and Docker compose technologies.
The Alfresco Platform 6 deployment architecture is highly based on container technologies, specifically in [Docker](http://docs.alfresco.com/6.0/concepts/master-deploy.html).
Due to that, the projects generated using the Alfresco SDK 4.1 archetypes set up their local environment making an intensive use of Docker and Docker compose
technologies.
If you're not familiar with these technologies, it is highly recommended visiting the [Docker documentation website](https://docs.docker.com). This site offers
a great quantity of training resources about [Docker](https://docs.docker.com/get-started/) and [Docker compose](https://docs.docker.com/compose/gettingstarted/).
* [Working with an All-In-One project](working-with-aio.md)
* [Working with a Platform (Repository) JAR project](working-with-platform.md)
* [Working with a Share JAR project](working-with-share.md)
## Project structures
After generating your project, using one of the Maven archetypes, review the project structure. The directory structure and content of each folder and file
can help you to understand how to start developing with the Alfresco SDK 4.0. Before continuing, make sure that you have read and completed the tasks in the
can help you to understand how to start developing with the Alfresco SDK 4.1. Before continuing, make sure that you have read and completed the tasks in the
[Getting started](../getting-started.md) tutorial.
The structure of the project and the purpose of the files it contains vary according to the [Maven archetype](../mvn-archetypes.md) used to generate the project
@@ -29,7 +33,7 @@ itself. The following links provide detailed descriptions of the different proje
## Run script
All the projects generated using the Alfresco SDK 4.0 archetypes provide a utility script to work with the project. This script is `run.sh` for Unix systems
All the projects generated using the Alfresco SDK 4.1 archetypes provide a utility script to work with the project. This script is `run.sh` for Unix systems
and `run.bat` for Windows systems.
The execution of this script must be followed by a parameter that dictates the task to be executed in the project. The list of available tasks is:

View File

@@ -1,7 +1,7 @@
---
Title: All-In-One project structure
Added: v3.0.0
Last reviewed: 2019-01-15
Last reviewed: 2019-10-18
---
# All-In-One project structure
@@ -81,7 +81,8 @@ my-all-in-one-project
│ │ │ │ ├── service-context.xml
│ │ │ │ └── webscript-context.xml
│ │ │ ├── messages
│ │ │ │ ── content-model.properties
│ │ │ │ ── content-model.properties
│ │ │ │ └── workflow-messages.properties
│ │ │ ├── model
│ │ │ │ ├── content-model.xml
│ │ │ │ └── workflow-model.xml

View File

@@ -1,7 +1,7 @@
---
Title: Platform JAR project structure
Added: v3.0.0
Last reviewed: 2019-01-15
Last reviewed: 2019-10-18
---
# Platform JAR project structure
@@ -14,69 +14,74 @@ Below is an example directory structure of a Platform JAR created with `com.exam
```
my-platform-jar-project
├── pom.xml
├── README.md
├── docker
│   └── docker-compose.yml
├── pom.xml
├── run.bat
├── run.sh
├── docker
| └── docker-compose.yml
└── src
├── main
├── assembly
├── amp.xml
├── file-mapping.properties
└── web
└── README.md
├── docker
│ ├── alfresco-global.properties
│ ├── dev-log4j.properties
│ ├── disable-webscript-caching-context.xml
│ ├── Dockerfile
├── hotswap-agent.properties
└── license
└── README.md
├── java
└── com
└── example
└── platformsample
├── DemoComponent.java
├── Demo.java
└── HelloWorldWebScript.java
└── resources
├── alfresco
├── extension
└── templates
│ │ └── webscripts
│ └── alfresco
│ │ │ └── tutorials
│ │ ── helloworld.get.desc.xml
│ │ │ ├── helloworld.get.html.ftl
│ │ └── helloworld.get.js
│ │ └── module
│ │ └── my-platform-jar-project
│ │ ── alfresco-global.properties
── context
── bootstrap-context.xml
├── service-context.xml
│ └── webscript-context.xml
├── messages
└── content-model.properties
├── model
├── content-model.xml
── workflow-model.xml
├── module-context.xml
├── module.properties
── workflow
└── sample-process.bpmn20.xml
└── META-INF
── resources
── test.html
   ├── assembly
   │   ├── amp.xml
   │   ├── file-mapping.properties
   │   └── web
   │   └── README.md
   ├── docker
   │   ├── Dockerfile
   │   ├── alfresco-global.properties
   │   ├── dev-log4j.properties
   │   ├── disable-webscript-caching-context.xml
   │   ├── hotswap-agent.properties
   │   └── license
   │   └── README.md
   ├── java
   │   └── com
   │   └── example
   │   └── platformsample
   │   ├── Demo.java
   │   ├── DemoComponent.java
   │   └── HelloWorldWebScript.java
   └── resources
   ├── META-INF
     └── resources
     └── test.html
   └── alfresco
   ├── extension
      └── templates
      ── webscripts
      └── alfresco
      └── tutorials
      ├── helloworld.get.desc.xml
      ├── helloworld.get.html.ftl
      ── helloworld.get.js
   ── module
   ── my-platform-jar-project
   ├── alfresco-global.properties
   ├── context
   │   ├── bootstrap-context.xml
     ├── service-context.xml
   │   └── webscript-context.xml
   ├── log4j.properties
   ── messages
   │   ├── content-model.properties
   │   └── workflow-messages.properties
   ── model
   │   ├── content-model.xml
   │   └── workflow-model.xml
   ── module-context.xml
   ── module.properties
│   └── workflow
│   └── sample-process.bpmn20.xml
└── test
└── java
└── com
└── example
└── platformsample
── HelloWorldWebScriptControllerTest.java
── CustomContentModelIT.java
├── DemoComponentIT.java
├── HelloWorldWebScriptControllerTest.java
└── HelloWorldWebScriptIT.java
```
From a high level standpoint, we can describe the content of the project as follows:

View File

@@ -1,7 +1,7 @@
---
Title: Share JAR project structure
Added: v3.0.0
Last reviewed: 2019-01-15
Last reviewed: 2019-10-18
---
# Share JAR project structure

View File

@@ -0,0 +1,256 @@
---
Title: Working with an All-In-One project
Added: v4.0.0
Last reviewed: 2019-10-18
---
# Working with an All-In-One project
Before you continue make sure that you have read and completed the tasks in the
[Getting started](../getting-started.md) tutorial to generate an All-In-One (AIO) project,
which means selecting the `org.alfresco.maven.archetype:alfresco-allinone-archetype`
Maven archetype when generating the project. The following information assumes that
the AIO project was generated with the name `my-all-in-one-project`.
- [Introduction](#introduction)
- [Configuration properties](#configuration-properties)
- [Building and running the project](#building-and-running-the-project)
- [Trying out the sample code](#trying-out-the-sample-code)
- [Looking inside the containers](#looking-inside-the-containers)
- [Updating extension code](#updating-extension-code)
- [Stopping the project](#stopping-the-project)
## Introduction
An AIO SDK project is used to build extensions for both [Alfresco Content Services (ACS) Repository](https://docs.alfresco.com/6.1/concepts/dev-platform-extensions.html)
and [Alfresco Share UI](https://docs.alfresco.com/6.1/concepts/dev-extensions-share.html). The runtime environment
for ACS is Docker so not only is this project building the source code for your extensions but also the
custom Docker images for the Alfresco Repository and Alfresco Share. The custom Docker images includes the
JARs, or AMPs, with your extension code.
Looking into the generated AIO parent project we can see that we got a Docker Compose file (**my-all-in-one-project/docker/docker-compose.yml**)
that will be used to build custom Docker images and run the project, one sub-project called `my-all-in-one-project-platform` that will be
used to build Repository customizations, and one sub-project called `my-all-in-one-project-share` that can be used to build Alfresco Share UI customizations.
There are also the `my-all-in-one-project-platform-docker` and `my-all-in-one-project-share-docker` projects that are
used to assemble (aggregate) all the Repository and Share extensions
(there are usually more than one of each in a bigger project) and then build the custom Docker images with the
extension(s) applied.
The Repository and Share extensions that are aggregated can either be extensions that you develop locally or extensions
that are available in a Maven repository somewhere.
## Configuration properties
There are a number of properties that we can customise when we run the Alfresco SDK project.
These configuration properties are defined in the **my-all-in-one-project/pom.xml** project file.
The following table explains some of these properties:
| Name | Type | Default value | Description |
| ---- | ---- | ------------- | ----------- |
| alfresco.platform.version | `string` | 6.1.2-ga | The version of the ACS Repository (i.e. alfresco.war) that the Repository Extension should be applied to. This also specifies the version of the ACS Repository Docker Image that the custom built Repository image should be based on. See **my-all-in-one-project-platform-docker/src/main/docker/Dockerfile** |
| alfresco.share.version | `string` | 6.1.0-RC3 | The version of Alfresco Share (i.e. share.war) that the Share Extension should be applied to. This also specifies the version of the Alfresco Share Docker Image that the custom built Share image should be based on. See **my-all-in-one-project-share-docker/src/main/docker/Dockerfile**|
| docker.acs.image | `string` | alfresco/alfresco-content-repository-community | The name of the ACS Repository Docker image in Docker Hub. This changes if you switch to Enterprise Edition.|
| docker.share.image | `string` | alfresco/alfresco-share | The name of the Alfresco Share Docker image in Docker Hub. This changes if you switch to Enterprise Edition.|
| share.port | `number` | 8180 | The external port (i.e. outside container) for the Alfresco Share webapp.|
| share.debug.port | `number` | 9898 | The external port (i.e. outside container) for Alfresco Share remote debugging.|
| acs.host | `string` | my-all-in-one-project-acs | This is the name (host) that the ACS Repository is available at. This maps to the service name for the ACS Repository in the Docker Compose file **my-all-in-one-project/docker/docker-compose.yml**. The name is only useful for communication between containers on the default Docker network that is created. |
| acs.port | `number` | 8080 | The external port (i.e. outside container) for the ACS Repository.|
| acs.debug.port | `number` | 8888 | The external port (i.e. outside container) for ACS Repository remote debugging.|
| postgres.port | `number` | 5555 | The external port (i.e. outside container) for PostgreSQL database.|
When you first start out you don't need to change any of these properties, just use the defaults and try it out.
## Building and running the project
The first thing you need to do before you can run anything is to build the custom ACS Docker images with the custom extensions.
We can build images and extensions at the same time as we start (run) the project by using the `./run.sh build_start` script
(on Windows use the `run.bat build_start` script instead).
Note that if you have another Alfresco SDK project running, then you need to stop it first. Also, make sure that the
following ports are free: 8180 (Share), 8080 (Alfresco Repo), 9898 (Share Debug), 8888 (Alfresco Repo Debug), 5555 (Postgres).
If you want to change the ports see the properties section of **my-all-in-one-project/pom.xml**. This project file also
contains the versions of Alfresco Repository and Alfresco Share that will be used.
```
$ cd my-all-in-one-project
my-all-in-one-project mbergljung$ ./run.sh build_start
[INFO] Scanning for projects...
[WARNING] The project com.example:my-all-in-one-project:pom:1.0-SNAPSHOT uses prerequisites which is only intended for maven-plugin projects but not for non maven-plugin projects. For such purposes you should use the maven-enforcer-plugin. See https://maven.apache.org/enforcer/enforcer-rules/requireMavenVersion.html
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] AIO - SDK 4.1
[INFO] Alfresco Platform/Repository JAR Module
[INFO] Alfresco Share JAR Module
[INFO] Integration Tests Module
[INFO] Alfresco Platform/Repository Docker Module
[INFO] Alfresco Share Docker Module
...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] AIO - SDK 4.1 ...................................... SUCCESS [ 0.680 s]
[INFO] Alfresco Platform/Repository JAR Module ............ SUCCESS [ 5.461 s]
[INFO] Alfresco Share JAR Module .......................... SUCCESS [ 0.557 s]
[INFO] Integration Tests Module ........................... SUCCESS [ 0.900 s]
[INFO] Alfresco Platform/Repository Docker Module ......... SUCCESS [ 0.760 s]
[INFO] Alfresco Share Docker Module ....................... SUCCESS [ 0.139 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
...
my-all-in-one-project-acs-volume
my-all-in-one-project-db-volume
my-all-in-one-project-search-volume
...
Building my-all-in-one-project-share
Step 1/8 : FROM alfresco/alfresco-share:6.1.0-RC3
...
Successfully tagged alfresco-share-my-all-in-one-project:development
Building my-all-in-one-project-acs
Step 1/9 : FROM alfresco/alfresco-content-repository-community:6.1.2-ga
...
Successfully tagged alfresco-content-services-my-all-in-one-project:development
...
my-all-in-one-project-acs_1 | 27-Mar-2019 06:53:39.191 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
my-all-in-one-project-acs_1 | 27-Mar-2019 06:53:39.233 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
my-all-in-one-project-acs_1 | 27-Mar-2019 06:53:39.249 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 84022 ms
```
The `./run.sh build_start` script will do the following:
* Stop anything running already with this project's Docker Compose file: **my-all-in-one-project/docker/docker-compose.yml**
* Build the Repository and Share Extension JARs so we are sure to get the latest changes
* Assemble/Aggregate all Repository extension JARs into the **my-all-in-one-project/my-all-in-one-project-platform-docker/target/extensions** directory
* Assemble/Aggregate all Share extension JARs into the **my-all-in-one-project/my-all-in-one-project-share-docker/target/extensions** directory
* Create Docker Volumes for Repository (alf_data), Search index, and Database so data is persisted outside the containers
* Run the project via the Docker Compose file and instruct Docker Compose to build the custom Docker images first
* Tail the logs of all containers
This will build the following two Docker images:
```
$ docker image ls|more
REPOSITORY TAG IMAGE ID CREATED SIZE
alfresco-content-services-my-all-in-one-project development 48e61e882567 16 hours ago 2.07GB
alfresco-share-my-all-in-one-project development d6cbb6143578 16 hours ago 749MB
```
The different web applications should now be accessible:
* **ACS Repository**: http://localhost:8080/alfresco
* **ACS Share**: http://localhost:8180/share/ - login with admin/admin
## Trying out the sample code
The AIO project has some sample extension code that you can try out. There is a one Repository extension and one Share extension
that you can test to make sure the extension JARs have been applied properly.
The Repository extension is a Web Script that can be called with the following URL: `http://localhost:8080/alfresco/service/sample/helloworld`.
The source code for the Web Script is located here: **my-all-in-one-project/my-all-in-one-project-platform/src/main/resources/alfresco/extension/templates/webscripts/alfresco/tutorials**
and here: **my-all-in-one-project/my-all-in-one-project-platform/src/main/java/ com/example/platformsample/HelloWorldWebScript.java**.
The Share extension is a custom Aikau page with a custom widget, you reach it with the following URL: `http://localhost:8180/share/page/hdp/ws/simple-page`.
The source code for the Page and Widget is located here: **my-all-in-one-project/my-all-in-one-project-share/src/main/resources/alfresco/web-extension/site-webscripts/com/example/pages**
and here: **my-all-in-one-project/my-all-in-one-project-share/src/main/resources/META-INF/resources/my-all-in-one-project-share/js/tutorials/widgets**.
## Looking inside the containers
Sometimes it's good to be able to look at what has actually been deployed in the containers. For example, how do I
access the Repository container and list the custom Repository extension JARs that have been deployed?
You can do that as follows:
First **Ctrl-C** out of the log tailing:
```
my-all-in-one-project-acs_1 | 27-Mar-2019 07:26:23.893 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
my-all-in-one-project-acs_1 | 27-Mar-2019 07:26:23.914 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
my-all-in-one-project-acs_1 | 27-Mar-2019 07:26:23.940 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 83197 ms
my-all-in-one-project-acs_1 | 2019-03-27 07:26:24,304 INFO [management.subsystems.ChildApplicationContextFactory] [http-nio-8080-exec-3] Starting 'Search' subsystem, ID: [Search, managed, solr6]
my-all-in-one-project-acs_1 | 2019-03-27 07:26:25,555 INFO [management.subsystems.ChildApplicationContextFactory] [http-nio-8080-exec-3] Startup of 'Search' subsystem, ID: [Search, managed, solr6] complete
^CERROR: Aborting.
my-all-in-one-project mbergljung$
```
Then check the name of the ACS Repository container:
```
$ docker container ls
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
733867a70117 alfresco-content-services-my-all-in-one-project:development "catalina.sh run -se…" 5 minutes ago Up 5 minutes 0.0.0.0:8080->8080/tcp, 0.0.0.0:8888->8888/tcp docker_my-all-in-one-project-acs_1
1f197e52b4f2 alfresco/alfresco-search-services:1.2.0 "/bin/sh -c '$DIST_D…" 5 minutes ago Up 5 minutes 0.0.0.0:8983->8983/tcp docker_my-all-in-one-project-search_1
4eff0cc9cc25 alfresco-share-my-all-in-one-project:development "/usr/local/tomcat/s…" 5 minutes ago Up 5 minutes 8000/tcp, 0.0.0.0:8180->8080/tcp, 0.0.0.0:9898->8888/tcp docker_my-all-in-one-project-share_1
a7854ff16d72 postgres:9.6 "docker-entrypoint.s…" 5 minutes ago Up 5 minutes 0.0.0.0:5555->5432/tcp docker_my-all-in-one-project-postgres_1
```
Then open up a shell into the ACS Repository container:
```
my-all-in-one-project mbergljung$ docker exec -it docker_my-all-in-one-project-acs_1 /bin/bash
[root@733867a70117 tomcat]# pwd
/usr/local/tomcat
[root@733867a70117 tomcat]# ls -l webapps/alfresco/WEB-INF/lib | grep "my-all"
-rw-r--r-- 1 root root 17220 Mar 27 07:24 my-all-in-one-project-platform-1.0-SNAPSHOT.jar
[root@733867a70117 tomcat]# exit
exit
```
## Updating extension code
So now you probably want to write some new code, or update the existing code, and see how that works with the containers running.
What do you need to do, restart etc. First just update the code. For example, let's update the Repository Web Script
to return a different message. Open up the **my-all-in-one-project/my-all-in-one-project-platform/src/main/resources/alfresco/extension/templates/webscripts/alfresco/tutorials/helloworld.get.html.ftl**
file and change it to look as follows:
```
Message: '${fromJS}' '${fromJava}' UPDATED!
```
To get this code update deployed we just have to run the following command in another console then where we are tailing the logs,
and stand in the directory where the `run.sh` script is located:
```
my-all-in-one-project mbergljung$ ./run.sh reload_acs
```
What this will do is the following:
* Kill the `my-all-in-one-project-acs` container
* Remove the killed (stopped) `my-all-in-one-project-acs` container, so a new Docker image can be created with `development` tag
* Build the Repository extension JAR: **my-all-in-one-project/my-all-in-one-project-platform**
* Copy the newly built Repository extension JAR over to the **my-all-in-one-project/my-all-in-one-project-platform-docker/target/extensions** where it will be picked up when the new Docker image is built.
* Build a new `alfresco-content-services-my-all-in-one-project:development` image
* Start up the `my-all-in-one-project-acs` container based on new image
You will be left with the console tailing the logs, but you can **Ctrl-C** out of this as you are already tailing the logs
in the initial console where we started things up.
You can now check if the change took effect by accessing the `http://localhost:8080/alfresco/service/sample/helloworld` Web Script.
## Stopping the project
To stop the solution you need to first `Ctrl-C` out of the log tailing. This does not stop the containers
as they run in daemon mode in the background. Check this by executing the following command that lists running containers:
```
$ docker container ls
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
49015432f1b2 alfresco-content-services-my-all-in-one-project:development "catalina.sh run -se…" 20 minutes ago Up 20 minutes 0.0.0.0:8080->8080/tcp, 0.0.0.0:8888->8888/tcp docker_my-all-in-one-project-acs_1
edb9ea129a5d postgres:9.6 "docker-entrypoint.s…" 20 minutes ago Up 20 minutes 0.0.0.0:5555->5432/tcp docker_my-all-in-one-project-postgres_1
6992d183986f alfresco/alfresco-search-services:1.2.0 "/bin/sh -c '$DIST_D…" 20 minutes ago Up 20 minutes 0.0.0.0:8983->8983/tcp docker_my-all-in-one-project-search_1
107d00733efd alfresco-share-my-all-in-one-project:development "/usr/local/tomcat/s…" 20 minutes ago Up 20 minutes 8000/tcp, 0.0.0.0:8180->8080/tcp, 0.0.0.0:9898->8888/tcp docker_my-all-in-one-project-share_1
```
Now, standing in the directory where the `run.sh` script is located execute the following command to stop and remove the containers:
```
my-all-in-one-project mbergljung$ ./run.sh stop
Stopping docker_my-all-in-one-project-acs_1 ... done
Stopping docker_my-all-in-one-project-postgres_1 ... done
Stopping docker_my-all-in-one-project-search_1 ... done
Stopping docker_my-all-in-one-project-share_1 ... done
Removing docker_my-all-in-one-project-acs_1 ... done
Removing docker_my-all-in-one-project-postgres_1 ... done
Removing docker_my-all-in-one-project-search_1 ... done
Removing docker_my-all-in-one-project-share_1 ... done
Removing network docker_default
```

View File

@@ -0,0 +1,241 @@
---
Title: Working with a Platform (Repository) project
Added: v4.0.0
Last reviewed: 2019-10-18
---
# Working with a Platform (Repository) project
Before you continue make sure that you have read and completed the tasks in the
[Getting started](../getting-started.md) tutorial to generate a Platform project,
which means selecting the `org.alfresco.maven.archetype:alfresco-platform-jar-archetype`
Maven archetype when generating the project. The following information assumes that
the Platform project was generated with the name `my-platform-project`.
- [Introduction](#introduction)
- [Configuration properties](#configuration-properties)
- [Building and running the project](#building-and-running-the-project)
- [Trying out the sample code](#trying-out-the-sample-code)
- [Looking inside the containers](#looking-inside-the-containers)
- [Updating extension code](#updating-extension-code)
- [Stopping the project](#stopping-the-project)
## Introduction
A Platform project is used to build extensions for the [Alfresco Content Services (ACS) Repository](https://docs.alfresco.com/6.1/concepts/dev-platform-extensions.html).
The runtime environment for ACS is Docker so not only is this project building the source code for your extensions but also the
custom Docker image for the Alfresco Repository. The custom Docker images includes the JARs, or AMPs, with your extension code.
Looking into the generated Platform project we can see that we got a Docker Compose file (**my-platform-project/docker/docker-compose.yml**)
that will be used to build custom Docker images and run the project. We also got a directory for our extension source code:
**my-platform-project/src/main/java** and one directory with the Docker related stuff, such as the **Dockerfile** used to
build the custom ACS Repository Docker image: **my-platform-project/src/main/docker**.
## Configuration properties
There are a number of properties that we can customise when we run the Alfresco SDK project.
These configuration properties are defined in the **my-platform-project/pom.xml** project file.
The following table explains some of these properties:
| Name | Type | Default value | Description |
| ---- | ---- | ------------- | ----------- |
| alfresco.platform.version | `string` | 6.1.2-ga | The version of the ACS Repository (i.e. alfresco.war) that the Repository Extension should be applied to. This also specifies the version of the ACS Repository Docker Image that the custom built Repository image should be based on. See **my-platform-project-platform-docker/src/main/docker/Dockerfile** |
| alfresco.share.version | `string` | 6.1.0-RC3 | The version of Alfresco Share (i.e. share.war) that the Share Extension should be applied to. This also specifies the version of the Alfresco Share Docker Image that the custom built Share image should be based on. See **my-platform-project-share-docker/src/main/docker/Dockerfile**|
| docker.acs.image | `string` | alfresco/alfresco-content-repository-community | The name of the ACS Repository Docker image in Docker Hub. This changes if you switch to Enterprise Edition.|
| docker.share.image | `string` | alfresco/alfresco-share | The name of the Alfresco Share Docker image in Docker Hub. This changes if you switch to Enterprise Edition.|
| share.port | `number` | 8180 | The external port (i.e. outside container) for the Alfresco Share webapp.|
| share.debug.port | `number` | 9898 | The external port (i.e. outside container) for Alfresco Share remote debugging.|
| acs.host | `string` | my-platform-project-acs | This is the name (host) that the ACS Repository is available at. This maps to the service name for the ACS Repository in the Docker Compose file **my-platform-project/docker/docker-compose.yml**. The name is only useful for communication between containers on the default Docker network that is created. |
| acs.port | `number` | 8080 | The external port (i.e. outside container) for the ACS Repository.|
| acs.debug.port | `number` | 8888 | The external port (i.e. outside container) for ACS Repository remote debugging.|
| postgres.port | `number` | 5555 | The external port (i.e. outside container) for PostgreSQL database.|
There are some Alfresco Share related properties listed here, but they are not used unless you uncomment some code in the
Docker Compose file (**my-platform-project/docker/docker-compose.yml**) to run the Alfresco Share container.
When you first start out you don't need to change any of these properties, just use the defaults and try it out.
## Building and running the project
The first thing you need to do before you can run anything is to build the custom ACS Repository Docker image with the custom extensions.
We can build the image and extensions at the same time as we start (run) the project by using the `./run.sh build_start` script
(on Windows use the `run.bat build_start` script instead).
Note that if you have another Alfresco SDK project running, then you need to stop it first. Also, make sure that the
following ports are free: 8180 (Share - if enabled in Docker Compose), 8080 (Alfresco Repo), 9898 (Share Debug - if enabled in Docker Compose),
8888 (Alfresco Repo Debug), 5555 (Postgres).
If you want to change the ports see the properties section of **my-platform-project/pom.xml**. This project file also
contains the versions of Alfresco Repository and Alfresco Share (if enabled) that will be used.
```
$ cd my-platform-project/
MBP512-MBERGLJUNG-0917:my-platform-project mbergljung$ ./run.sh build_start
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building my-platform-project Platform/Repository JAR Module 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.323 s
[INFO] Finished at: 2019-03-27T09:23:28Z
[INFO] Final Memory: 62M/227M
[INFO] ------------------------------------------------------------------------
my-platform-project-acs-volume
my-platform-project-db-volume
my-platform-project-search-volume
Creating network "docker_default" with the default driver
Building my-platform-project-acs
...
Successfully tagged alfresco-content-services-my-platform-project:development
Creating docker_my-platform-project-postgres_1 ... done
Creating docker_my-platform-project-search_1 ... done
Creating docker_my-platform-project-acs_1 ... done
Attaching to docker_my-platform-project-acs_1, docker_my-platform-project-search_1, docker_my-platform-project-postgres_1
...
my-platform-project-acs_1 | 27-Mar-2019 09:25:12.923 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
my-platform-project-acs_1 | 27-Mar-2019 09:25:12.947 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
my-platform-project-acs_1 | 27-Mar-2019 09:25:12.955 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 91144 ms```
```
The `./run.sh build_start` script will do the following:
* Stop anything running already with this project's Docker Compose file: **my-platform-project/docker/docker-compose.yml**
* Build the Repository Extension JARs so we are sure to get the latest changes
* Assemble/Aggregate all Repository extension JARs into the **my-platform-project/target/extensions** directory
* Create Docker Volumes for Repository (alf_data), Search index, and Database so data is persisted outside the containers
* Run the project via the Docker Compose file and instruct Docker Compose to build the custom Docker images first
* Tail the logs of all containers
This will build the following Docker image:
```
$ docker image ls|more
REPOSITORY TAG IMAGE ID CREATED SIZE
alfresco-content-services-my-platform-project development b2b9a7b730f5 5 minutes ago 2.07GB
```
The different web applications should now be accessible:
* **ACS Repository**: http://localhost:8080/alfresco
* And optionally (if enabled in Docker Compose file) **ACS Share**: http://localhost:8180/share/ - login with admin/admin
## Trying out the sample code
The Platform project has some sample extension code that you can try out.
The Repository extension is a Web Script that can be called with the following URL: `http://localhost:8080/alfresco/service/sample/helloworld`.
The source code for the Web Script is located here: **my-platform-project/src/main/resources/alfresco/extension/templates/webscripts/alfresco/tutorials**
and here: **my-platform-project/src/main/java/ com/example/platformsample/HelloWorldWebScript.java**.
## Looking inside the containers
Sometimes it's good to be able to look at what has actually been deployed in the containers. For example, how do I
access the Repository container and list the custom Repository extension JARs that have been deployed?
You can do that as follows:
First **Ctrl-C** out of the log tailing:
```
my-platform-project-acs_1 | 27-Mar-2019 09:25:12.923 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
my-platform-project-acs_1 | 27-Mar-2019 09:25:12.947 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
my-platform-project-acs_1 | 27-Mar-2019 09:25:12.955 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 91144 ms
my-platform-project-acs_1 | 2019-03-27 09:25:40,406 INFO [management.subsystems.ChildApplicationContextFactory] [http-nio-8080-exec-6] Starting 'Transformers' subsystem, ID: [Transformers, default]
my-platform-project-acs_1 | 2019-03-27 09:25:40,948 INFO [management.subsystems.ChildApplicationContextFactory] [http-nio-8080-exec-6] Startup of 'Transformers' subsystem, ID: [Transformers, default] complete
^[[B^CERROR: Aborting.
my-platform-project mbergljung$
```
Then check the name of the ACS Repository container:
```
$ docker container ls
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
ba90b1648470 alfresco-content-services-my-platform-project:development "catalina.sh run -se…" 8 minutes ago Up 8 minutes 0.0.0.0:8080->8080/tcp, 0.0.0.0:8888->8888/tcp docker_my-platform-project-acs_1
0435b09e687c alfresco/alfresco-search-services:1.2.0 "/bin/sh -c '$DIST_D…" 8 minutes ago Up 8 minutes 0.0.0.0:8983->8983/tcp docker_my-platform-project-search_1
c9145e7cdb20 postgres:9.6 "docker-entrypoint.s…" 8 minutes ago Up 8 minutes 0.0.0.0:5555->5432/tcp docker_my-platform-project-postgres_1
```
Then open up a shell into the ACS Repository container:
```
my-platform-project mbergljung$ docker exec -it docker_my-platform-project-acs_1 /bin/bash
[root@ba90b1648470 tomcat]# pwd
/usr/local/tomcat
[root@ba90b1648470 tomcat]# ls -l webapps/alfresco/WEB-INF/lib | grep "my-plat"
-rw-r--r-- 1 root root 21180 Mar 27 09:23 my-platform-project-1.0-SNAPSHOT.jar
-rw-r--r-- 1 root root 13692 Mar 27 09:23 my-platform-project-1.0-SNAPSHOT-tests.jar
[root@ba90b1648470 tomcat]# exit
exit
```
## Updating extension code
So now you probably want to write some new code, or update the existing code, and see how that works with the containers running.
What do you need to do, restart etc. First just update the code. For example, let's update the Repository Web Script
to return a different message. Open up the **my-platform-project/src/main/resources/alfresco/extension/templates/webscripts/alfresco/tutorials/helloworld.get.html.ftl**
file and change it to look as follows:
```
Message: '${fromJS}' '${fromJava}' UPDATED!
```
To get this code update deployed we have to run the following commands:
First `Ctrl-C` out of the log tailing.
Then stop the project:
```
my-platform-project mbergljung$ ./run.sh stop
Stopping docker_my-platform-project-acs_1 ... done
Stopping docker_my-platform-project-search_1 ... done
Stopping docker_my-platform-project-postgres_1 ... done
Removing docker_my-platform-project-acs_1 ... done
Removing docker_my-platform-project-search_1 ... done
Removing docker_my-platform-project-postgres_1 ... done
Removing network docker_default
```
Now build and start again:
```
my-platform-project mbergljung$ ./run.sh build_start
...
```
What this will do is the following:
* Kill the `my-platform-project-acs` container
* Removed the killed (stopped) `my-platform-project-acs` container, so a new Docker image can be created with `development` tag
* Build the Repository extension JAR
* Copy the newly built Repository extension JAR over to the **my-platform-project/target/extensions** where it will be picked up when the new Docker image is built.
* Build a new `alfresco-content-services-my-platform-project:development` image
* Start up the `my-platform-project-acs` container based on new image
You can now check if the change took effect by accessing the `http://localhost:8080/alfresco/service/sample/helloworld` Web Script.
## Stopping the project
To stop the solution you need to first `Ctrl-C` out of the log tailing. This does not stop the containers
as they run in daemon mode in the background. Check this by executing the following command that lists running containers:
```
$ docker container ls
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
61de829092f3 alfresco-content-services-my-platform-project:development "catalina.sh run -se…" 3 minutes ago Up 3 minutes 0.0.0.0:8080->8080/tcp, 0.0.0.0:8888->8888/tcp docker_my-platform-project-acs_1
07300ddb6714 alfresco/alfresco-search-services:1.2.0 "/bin/sh -c '$DIST_D…" 3 minutes ago Up 3 minutes 0.0.0.0:8983->8983/tcp docker_my-platform-project-search_1
09922ce36d90 postgres:9.6 "docker-entrypoint.s…" 3 minutes ago Up 3 minutes 0.0.0.0:5555->5432/tcp docker_my-platform-project-postgres_1
```
Now, standing in the directory where the `run.sh` script is located execute the following command to stop and remove the containers:
```
my-platform-project mbergljung$ ./run.sh stop
Stopping docker_my-platform-project-acs_1 ... done
Stopping docker_my-platform-project-search_1 ... done
Stopping docker_my-platform-project-postgres_1 ... done
Removing docker_my-platform-project-acs_1 ... done
Removing docker_my-platform-project-search_1 ... done
Removing docker_my-platform-project-postgres_1 ... done
Removing network docker_default
```

View File

@@ -0,0 +1,259 @@
---
Title: Working with a Share project
Added: v4.0.0
Last reviewed: 2019-10-18
---
# Working with a Share project
Before you continue make sure that you have read and completed the tasks in the
[Getting started](../getting-started.md) tutorial to generate an Alfresco Share project,
which means selecting the `org.alfresco.maven.archetype:alfresco-share-jar-archetype`
Maven archetype when generating the project. The following information assumes that
the Share project was generated with the name `my-share-project`.
- [Introduction](#introduction)
- [Configuration properties](#configuration-properties)
- [Building and running the project](#building-and-running-the-project)
- [Trying out the sample code](#trying-out-the-sample-code)
- [Looking inside the containers](#looking-inside-the-containers)
- [Updating extension code](#updating-extension-code)
- [Stopping the project](#stopping-the-project)
## Introduction
An Alfresco Sharte project is used to build extensions for [Alfresco Share UI](https://docs.alfresco.com/6.1/concepts/dev-extensions-share.html).
The runtime environment for ACS is Docker so not only is this project building the source code for your extensions but also the
custom Docker image for Alfresco Share. The custom Docker images includes the
JARs, or AMPs, with your extension code.
Looking into the generated Share project we can see that we got a Docker Compose file (**my-share-project/docker/docker-compose.yml**)
that will be used to build custom Docker images and run the project. We also got a directory for our extension source code:
**my-share-project/src/main/java** and one directory with the Docker related stuff, such as the **Dockerfile** used to
build the custom Alfresco Share Docker image: **my-share-project/src/main/docker**.
## Configuration properties
There are a number of properties that we can customise when we run the Alfresco SDK project.
These configuration properties are defined in the **my-share-project/pom.xml** project file.
The following table explains some of these properties:
| Name | Type | Default value | Description |
| ---- | ---- | ------------- | ----------- |
| alfresco.platform.version | `string` | 6.1.2-ga | The version of the ACS Repository (i.e. alfresco.war) that the Repository Extension should be applied to. This also specifies the version of the ACS Repository Docker Image that the custom built Repository image should be based on. See **my-share-project-platform-docker/src/main/docker/Dockerfile** |
| alfresco.share.version | `string` | 6.1.0-RC3 | The version of Alfresco Share (i.e. share.war) that the Share Extension should be applied to. This also specifies the version of the Alfresco Share Docker Image that the custom built Share image should be based on. See **my-share-project-share-docker/src/main/docker/Dockerfile**|
| docker.acs.image | `string` | alfresco/alfresco-content-repository-community | The name of the ACS Repository Docker image in Docker Hub. This changes if you switch to Enterprise Edition.|
| docker.share.image | `string` | alfresco/alfresco-share | The name of the Alfresco Share Docker image in Docker Hub. This changes if you switch to Enterprise Edition.|
| share.port | `number` | 8180 | The external port (i.e. outside container) for the Alfresco Share webapp.|
| share.debug.port | `number` | 9898 | The external port (i.e. outside container) for Alfresco Share remote debugging.|
| acs.host | `string` | my-share-project-acs | This is the name (host) that the ACS Repository is available at. This maps to the service name for the ACS Repository in the Docker Compose file **my-share-project/docker/docker-compose.yml**. The name is only useful for communication between containers on the default Docker network that is created. |
| acs.port | `number` | 8080 | The external port (i.e. outside container) for the ACS Repository.|
| acs.debug.port | `number` | 8888 | The external port (i.e. outside container) for ACS Repository remote debugging.|
| postgres.port | `number` | 5555 | The external port (i.e. outside container) for PostgreSQL database.|
There are some ACS Repository related properties listed here, such as `acs.host` and `acs.port`. Alfresco Share will use those
to connect to the Alfresco Repository. This is however a bit tricky when we are running in a container environment. You cannot
just start the Repository and make it available on `localhost:8080`. It would not be accessible like that from inside the
Share container. For Share to be able to connect to the Repository both containers need to be attached to the same
Docker Network. This way you can just use the Docker Compose service name for the Repository, such as `my-share-project-acs`.
So the best way to test your Share extension is to uncomment the code in the Docker Compose file
(**my-share-project/docker/docker-compose.yml**) to also run the ACS Repository container, Search, and Postgres.
## Building and running the project
The first thing you need to do before you can run anything is to build the custom Share Docker image with the custom extensions.
We can build the image and extensions at the same time as we start (run) the project by using the `./run.sh build_start` script
(on Windows use the `run.bat build_start` script instead).
Note that if you have another Alfresco SDK project running, then you need to stop it first. Also, make sure that the
following ports are free: 8180 (Share), 8080 (Alfresco Repo - if enabled in Docker Compose), 9898 (Share Debug), 8888 (Alfresco Repo Debug - if enabled), 5555 (Postgres).
If you want to change the ports see the properties section of **my-share-project/pom.xml**. This project file also
contains the versions of Alfresco Repository (if enabled) and Alfresco Share that will be used.
When I run the project I have uncommented the code (make sure to also remove the "# Optional" line) that starts
the Repository, Search, and PostgresSQL in the (**my-share-project/docker/docker-compose.yml**) file, so I can test the Share extension:
```
$ cd my-share-project
my-share-project mbergljung$ ./run.sh build_start
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building my-share-project Share JAR Module 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.856 s
[INFO] Finished at: 2019-03-27T10:07:14Z
[INFO] Final Memory: 29M/104M
[INFO] ------------------------------------------------------------------------
my-share-project-acs-volume
my-share-project-db-volume
my-share-project-search-volume
Creating network "docker_default" with the default driver
Building my-share-project-share
...
Successfully tagged alfresco-share-my-share-project:development...
...
my-share-project-acs_1 | 27-Mar-2019 10:09:01.158 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
my-share-project-acs_1 | 27-Mar-2019 10:09:01.175 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
my-share-project-acs_1 | 27-Mar-2019 10:09:01.213 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 95189 ms
```
The `./run.sh build_start` script will do the following:
* Stop anything running already with this project's Docker Compose file: **my-share-project/docker/docker-compose.yml**
* Build the Share Extension JARs so we are sure to get the latest changes
* Assemble/Aggregate all Share extension JARs into the **my-share-project/target/extensions** directory
* Create Docker Volumes for Repository (alf_data), Search index, and Database so data is persisted outside the containers
* Run the project via the Docker Compose file and instruct Docker Compose to build the custom Docker images first
* Tail the logs of all containers
This will build the following Docker image:
```
$ docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
alfresco-share-my-share-project development b8b9acdb3425 About a minute ago 749MB
```
The different web applications should now be accessible:
* **ACS Repository**: http://localhost:8080/alfresco
* **ACS Share**: http://localhost:8180/share/ - login with admin/admin
## Trying out the sample code
The Share project has some sample extension code that you can try out.
The Share extension is a custom Aikau page with a custom widget, you reach it with the following URL: `http://localhost:8180/share/page/hdp/ws/simple-page`.
The source code for the Page and Widget is located here: **my-share-project/src/main/resources/alfresco/web-extension/site-webscripts/com/example/pages**
and here: **my-share-project/src/main/resources/META-INF/resources/my-share-project-share/js/tutorials/widgets**.
## Looking inside the containers
Sometimes it's good to be able to look at what has actually been deployed in the containers. For example, how do I
access the Share container and list the custom Share extension JARs that have been deployed?
You can do that as follows:
First **Ctrl-C** out of the log tailing:
```
my-share-project-acs_1 | 27-Mar-2019 10:09:01.213 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 95189 ms
my-share-project-acs_1 | 2019-03-27 10:09:30,278 INFO [management.subsystems.ChildApplicationContextFactory] [http-nio-8080-exec-5] Starting 'Transformers' subsystem, ID: [Transformers, default]
my-share-project-acs_1 | 2019-03-27 10:09:30,618 INFO [management.subsystems.ChildApplicationContextFactory] [http-nio-8080-exec-5] Startup of 'Transformers' subsystem, ID: [Transformers, default] complete
my-share-project-share_1 | 2019-03-27 10:11:50,150 INFO [web.site.EditionInterceptor] [http-nio-8080-exec-1] Successfully retrieved license information from Alfresco.
my-share-project-share_1 | 2019-03-27 10:12:11,652 INFO [web.scripts.ImapServerStatus] [http-nio-8080-exec-7] Successfully retrieved IMAP server status from Alfresco: disabled
^CERROR: Aborting.
my-share-project mbergljung$
```
Then check the name of the Alfresco Share container:
```
$ docker container ls
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
dda89172506c alfresco/alfresco-content-repository-community:6.1.2-ga "catalina.sh run -se…" 6 minutes ago Up 6 minutes 0.0.0.0:8080->8080/tcp docker_my-share-project-acs_1
2b4fa4b4a3f6 alfresco-share-my-share-project:development "/usr/local/tomcat/s…" 6 minutes ago Up 6 minutes 8000/tcp, 0.0.0.0:8180->8080/tcp, 0.0.0.0:9898->8888/tcp docker_my-share-project-share_1
ad8857f3574b postgres:9.6 "docker-entrypoint.s…" 6 minutes ago Up 6 minutes 0.0.0.0:5555->5432/tcp docker_my-share-project-postgres_1
92902d7ae624 alfresco/alfresco-search-services:1.2.0 "/bin/sh -c '$DIST_D…" 6 minutes ago Up 6 minutes 0.0.0.0:8983->8983/tcp docker_my-share-project-search_1
```
Then open up a shell into the Alfresco Share container:
```
my-share-project mbergljung$ docker exec -it docker_my-share-project-share_1 /bin/bash
[root@2b4fa4b4a3f6 tomcat]# pwd
/usr/local/tomcat
[root@2b4fa4b4a3f6 tomcat]# ls -l webapps/share/WEB-INF/lib/ | grep "my-sh"
-rw-r--r-- 1 root root 18920 Mar 27 10:07 my-share-project-1.0-SNAPSHOT.jar
[root@2b4fa4b4a3f6 tomcat]# exit
exit
```
## Updating extension code
So now you probably want to write some new code, or update the existing code, and see how that works with the containers running.
What do you need to do, restart etc. First just update the code. For example, let's update the Share Page title.
Open up the **my-share-project/src/main/resources/alfresco/web-extension/site-webscripts/com/example/pages/simple-page.get.js**
file and change it to look as follows:
```
model.jsonModel = {
widgets: [{
id: "SET_PAGE_TITLE",
name: "alfresco/header/SetTitle",
config: {
title: "This is an UPDATED PAGE Title"
}
},
{
id: "MY_HORIZONTAL_WIDGET_LAYOUT",
name: "alfresco/layout/HorizontalWidgets",
config: {
widgetWidth: 50,
widgets: [
{
id: "DEMO_SIMPLE_LOGO",
name: "alfresco/logo/Logo",
config: {
logoClasses: "alfresco-logo-only"
}
},
{
id: "DEMO_SIMPLE_MSG",
name: "tutorials/widgets/TemplateWidget"
}
]
}
}]
};
```
To get this code update deployed we just have to run the following command in another console then where we are tailing the logs,
and stand in the directory where the `run.sh` script is located:
```
my-share-project mbergljung$ ./run.sh reload_share
```
What this will do is the following:
* Kill the `my-share-project-acs` container
* Remove the killed (stopped) `my-share-project-acs` container, so a new Docker image can be created with `development` tag
* Build the Share extension JAR
* Copy the newly built Share extension JAR over to the **my-share-project/target/extensions** where it will be picked up when the new Docker image is built.
* Build a new `alfresco-share-my-share-project:development` image
* Start up the `my-share-project-acs` container based on new image
You will be left with the console tailing the logs, but you can **Ctrl-C** out of this as you are already tailing the logs
in the initial console where we started things up.
You can now check if the change took effect by accessing the `http://localhost:8180/share/page/hdp/ws/simple-page` Web Script.
## Stopping the project
To stop the solution you need to first `Ctrl-C` out of the log tailing. This does not stop the containers
as they run in daemon mode in the background. Check this by executing the following command that lists running containers:
```
$ docker container ls
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
59f02060955a alfresco-share-my-share-project:development "/usr/local/tomcat/s…" 4 minutes ago Up 4 minutes 8000/tcp, 0.0.0.0:8180->8080/tcp, 0.0.0.0:9898->8888/tcp docker_my-share-project-share_1
dda89172506c alfresco/alfresco-content-repository-community:6.1.2-ga "catalina.sh run -se…" 16 minutes ago Up 16 minutes 0.0.0.0:8080->8080/tcp docker_my-share-project-acs_1
ad8857f3574b postgres:9.6 "docker-entrypoint.s…" 16 minutes ago Up 16 minutes 0.0.0.0:5555->5432/tcp docker_my-share-project-postgres_1
92902d7ae624 alfresco/alfresco-search-services:1.2.0 "/bin/sh -c '$DIST_D…" 16 minutes ago Up 16 minutes 0.0.0.0:8983->8983/tcp docker_my-share-project-search_1
```
Now, standing in the directory where the `run.sh` script is located execute the following command to stop and remove the containers:
```
my-share-project mbergljung$ ./run.sh stop
Stopping docker_my-share-project-share_1 ... done
Stopping docker_my-share-project-acs_1 ... done
Stopping docker_my-share-project-postgres_1 ... done
Stopping docker_my-share-project-search_1 ... done
Removing docker_my-share-project-share_1 ... done
Removing docker_my-share-project-acs_1 ... done
Removing docker_my-share-project-postgres_1 ... done
Removing docker_my-share-project-search_1 ... done
Removing network docker_default
```

View File

@@ -10,7 +10,7 @@
<parent>
<groupId>org.alfresco.maven</groupId>
<artifactId>alfresco-sdk-aggregator</artifactId>
<version>4.0.0</version>
<version>4.2.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

View File

@@ -8,7 +8,7 @@
<parent>
<groupId>org.alfresco.maven</groupId>
<artifactId>alfresco-sdk-aggregator</artifactId>
<version>4.0.0</version>
<version>4.2.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

47
pom.xml
View File

@@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.alfresco.maven</groupId>
<artifactId>alfresco-sdk-aggregator</artifactId>
<version>4.0.0</version>
<version>4.1.0-SNAPSHOT</version>
<name>Alfresco SDK</name>
<description>This aggregator Project builds all modules required for the Alfresco SDK</description>
<packaging>pom</packaging>
@@ -30,8 +30,8 @@
<connection>scm:git:${scm.url.base}.git</connection>
<developerConnection>scm:git:${scm.url.base}</developerConnection>
<url>${scm.url.base}</url>
<tag>alfresco-sdk-aggregator-4.0.0</tag>
</scm>
<tag>alfresco-sdk-aggregator-4.1.0-SNAPSHOT</tag>
</scm>
<developers>
@@ -135,8 +135,8 @@
<alfresco.sdk.tests.exclude>*/*-enterprise*/*</alfresco.sdk.tests.exclude>
<alfresco.bomDependency.artifactId>acs-community-packaging</alfresco.bomDependency.artifactId>
<alfresco.platform.version>6.1.2-ga</alfresco.platform.version>
<alfresco.share.version>6.1.0-RC3</alfresco.share.version>
<alfresco.platform.version>6.2.0-ea</alfresco.platform.version>
<alfresco.share.version>6.2.0</alfresco.share.version>
<alfresco.platform.docker.image>alfresco/alfresco-content-repository-community</alfresco.platform.docker.image>
<alfresco.share.docker.image>alfresco/alfresco-share</alfresco.share.docker.image>
@@ -317,7 +317,18 @@
</profile>
<!-- 6.1 -->
<!-- This profile requires to be executed using Java 11 -->
<!-- This profiles requires to be executed using Java 11 -->
<profile>
<id>community-61-tests</id>
<properties>
<alfresco.bomDependency.artifactId>acs-community-packaging</alfresco.bomDependency.artifactId>
<alfresco.platform.version>6.1.2-ga</alfresco.platform.version>
<alfresco.share.version>6.1.0-RC3</alfresco.share.version>
<alfresco.platform.docker.image>alfresco/alfresco-content-repository-community</alfresco.platform.docker.image>
<alfresco.share.docker.image>alfresco/alfresco-share</alfresco.share.docker.image>
</properties>
</profile>
<profile>
<id>enterprise-61-tests</id>
<properties>
@@ -329,6 +340,30 @@
</properties>
</profile>
<!-- 6.2 -->
<!-- This profiles requires to be executed using Java 11 -->
<profile>
<id>community-62-tests</id>
<properties>
<alfresco.bomDependency.artifactId>acs-community-packaging</alfresco.bomDependency.artifactId>
<alfresco.platform.version>6.2.0-ea</alfresco.platform.version>
<alfresco.share.version>6.2.0</alfresco.share.version>
<alfresco.platform.docker.image>alfresco/alfresco-content-repository-community</alfresco.platform.docker.image>
<alfresco.share.docker.image>alfresco/alfresco-share</alfresco.share.docker.image>
</properties>
</profile>
<profile>
<id>enterprise-62-tests</id>
<properties>
<alfresco.bomDependency.artifactId>acs-packaging</alfresco.bomDependency.artifactId>
<alfresco.platform.version>6.2.0</alfresco.platform.version>
<alfresco.share.version>6.2.0</alfresco.share.version>
<alfresco.platform.docker.image>alfresco/alfresco-content-repository</alfresco.platform.docker.image>
<alfresco.share.docker.image>alfresco/alfresco-share</alfresco.share.docker.image>
</properties>
</profile>
<profile>
<id>sdk-release</id>
<properties>