Commit 29006d1e authored by Jose Luis Osorno's avatar Jose Luis Osorno
Browse files

Documentation - Some fixes after review

parent 301d0e81
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -72,7 +72,7 @@ You will be taken back to the project source code.

![Alt text](./imgs/sdk-debug-intellij-launch.png?raw=true "IntelliJ remote debug configuration launch")

The IDE connects the source code with the deployed one at the docker container. Once the code it's linked, you can open a browser and start using your 
The IDE connects the source code with the deployed one at the docker container. Once the code is linked, you can open a browser and start using your 
application. In our case, we are going to test the behaviour of debugging by running the sample webscript.

7. Open your browser and type `http://localhost:8080/alfresco/s/sample/helloworld`.
+1 −0
Original line number Diff line number Diff line
@@ -199,3 +199,4 @@ In the terminal window, use:
If this is the first time you are doing this, it will take a while for Maven to download all the required dependencies and for Docker to download all the
required images.

For more information about how to work with the projects, please visit [Working with generated projects](projects-usage.md).
+7 −7
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ and [Docker for Windows](https://docs.docker.com/docker-for-windows/).

This is due to an issue with the component used by HotSwapAgent to notify the changes in the compiled class files. HotSwapAgent uses the class 
[WatcherNIO2.java](https://github.com/HotswapProjects/HotswapAgent/blob/master/hotswap-agent-core/src/main/java/org/hotswap/agent/watch/nio/WatcherNIO2.java) to 
watch for the changes in the `extraClasspath` folder. That class is based in the Java class [WatchDir.java](https://docs.oracle.com/javase/tutorial/essential/io/examples/WatchDir.java) 
watch for the changes in the `extraClasspath` folder. That class is based on the Java class [WatchDir.java](https://docs.oracle.com/javase/tutorial/essential/io/examples/WatchDir.java) 
that, in Linux systems, is implemented using [inotify](http://man7.org/linux/man-pages/man7/inotify.7.html). It seems that inotify is not working properly
with mounted volumes over Docker Toolbox (which internally uses VirtualBox).
 
@@ -70,7 +70,7 @@ RUN cd /usr/local/tomcat \
```

4. Modify the file `docker/docker-compose.yml` to change the ACS container command to avoid the execution of Tomcat with the Security Manager enabled (it makes 
the hot reloading tools to fail):
the hot reloading tools fail):

```
  sample-project-acs:
@@ -109,13 +109,13 @@ For more information about HotSwapAgent configuration for Java 8, please check t

## Configuring HotSwapAgent in the project (Java 11)

Using Java 11 and HotSwapAgent, it isn't necessary to configure the java agent and the alternative JVM as in previous versions. Instead of that, it is required 
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). 
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 implements the required modifications would be:
A way to implement the required modifications would be:

1. Download the last release of the Trava OpenJDK (Linux distribution) from [here](https://github.com/TravaOpenJDK/trava-jdk-11-dcevm/releases) and save it 
into the folder `PROJECT_ARTIFACT_ID-platform-docker/src/main/docker`.
@@ -147,7 +147,7 @@ COPY hotswap-agent.properties $TOMCAT_DIR/webapps/alfresco/WEB-INF/classes
```

4. Modify the file `docker/docker-compose.yml` to change the ACS container command to avoid the execution of Tomcat with the Security Manager enabled (it makes 
the hot reloading tools to fail):
the hot reloading tools fail):

```
  sample-project-acs:
@@ -182,8 +182,8 @@ the hot reloading tools to fail):
...
```

Instead of downloading the Trava OpenJDK distribution file and copy it to the container, the Dockerfile script could include directly the download of the file 
(via `curl` for instance), but that would slow down the creation of the ACS image each time it is rebuilt.
Instead of downloading the Trava OpenJDK distribution file and copying it to the container, the Dockerfile script could include directly the download of the 
file (via `curl` for instance), but that would slow down the creation of the ACS image each time it is rebuilt.

### Creating a custom HotSwapAgent ACS docker image

+5 −5
Original line number Diff line number Diff line
@@ -5,19 +5,19 @@ Last reviewed: 2019-01-15
---
# Working with generated projects

After generating your 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.0 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.

If you're not familiar to these technologies, it is highly recommended visiting the [Docker documentation website](https://docs.docker.com). This site offers
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/).

## 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 have read and completed the tasks in the 
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 
[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 +29,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 an utility script to work with the project. This script is `run.sh` for Unix systems
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
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:
@@ -39,7 +39,7 @@ Task | Description
`build_start` | Build the whole project, recreate the ACS and Share docker images, start the dockerised environment composed by ACS, Share, ASS and PostgreSQL and tail the logs of all the containers.
`start` | Start the dockerised environment without building the project and tail the logs of all the containers.
`stop` | Stop the dockerised environment.
`purge` | Stop the dockerised container and delete all the persistent data (docker volumes).
`purge` | Stop the dockerised environment and delete all the persistent data (docker volumes).
`tail` | Tail the logs of all the containers.
`reload_share` | Build the Share module, recreate the Share docker image and restart the Share container (not available in the Alfresco Platform JAR archetype).
`reload_acs` | Build the ACS module, recreate the ACS docker image and restart the ACS container (only available in the All-In-One archetype).
+1 −1
Original line number Diff line number Diff line
@@ -177,7 +177,7 @@ Alfresco Share client.

After this brief introduction of the All-In-One project, let’s focus on the content of the folders.

## Project root
## Project root folder

Below is a description of the files in the root of the project (in this case, `my-all-in-one-project`).

Loading