Addition to the preparation of the environment. (#3306)

* Added the working-with-nodes-api-service tutorial.

* Added the 'Alfresco Example Content Application' paragraph to the 'Preparing the development environment' tutorial.
This commit is contained in:
Francesco Corti
2018-05-11 11:40:51 +02:00
committed by Eugenio Romano
parent 309ac86d3a
commit 49b5b7f3d8

View File

@@ -1,63 +1,84 @@
---
Level: Beginner
---
# Preparing the development environment
This tutorial explains how to get set up to use ADF so you can tackle the other tutorials. It covers the basic development environment with suggested versions for each tool, library and module.
## Preparing the development environment
In this content is shared all the prerequisites valid for all the tutorials and descriptions of the entire documentation. This content contains the development environment description, along with the details of the suggested versions for each tools, library or module.
## Node.js
[Node.js](https://nodejs.org) is a JavaScript runtime built using an event-driven, non-blocking I/O model
that makes it lightweight and efficient. Node.js uses [npm](https://www.npmjs.com/) as its public registry
and package system.
[Node.js](https://nodejs.org) is a JavaScript runtime built using an event-driven, non-blocking I/O model that makes it lightweight and efficient. Node.js uses [npm](https://www.npmjs.com/) as public registry and a package system.
You need the latest `node.js` from either the `8.x` or `9.x` branch.
If you already have it installed then you can check the version with the following command in a terminal:
You need the latest `node.js` of either the `8.x` or `9.x` branch.
To check the version, run the following command in a terminal.
node -v
## Angular CLI
[Angular CLI](https://cli.angular.io/) is a tool to initialize, develop, scaffold and maintain [Angular](https://angular.io/) applications, including ADF applications.
The [Angular CLI](https://cli.angular.io/) is a tool to initialise, develop, scaffold and maintain [Angular](https://angular.io/) applications
Version 1.6.6 or Angular CLI seems to be the best choice currently, since earlier and later versions have
issues with `@angular/devkit-core`.
Earlier and later versions have issues around `@angular/devkit-core`. 1.6.6 seem to be the stable choice currently.
If you already have `Angular CLI` installed then you can check the version by running:
If you already have `Angular CLI` installed check the version by running:
ng --version
To install `Angular CLI` version 1.6.6 globally, run the following command:
To globally install `Angular CLI` version globally 1.6.6 run:
sudo npm install -g @angular/cli@1.6.6
## Code Editor
You can use any text editor to develop ADF apps but we recommend
[Visual Studio Code](http://code.visualstudio.com) from Microsoft. It's a free, lightweight and *very*
powerful tool that works well for Angular development.
We recommend [Visual Studio Code](http://code.visualstudio.com) - it's a free, lightweight and *very* powerful tool from Microsoft that works great with Angular development.
## Alfresco Content Services (optional)
If you want to develop on top of the [Alfresco Content Services](https://www.alfresco.com/platform/content-services-ecm), you might want to install it using the [Alfresco Content Services Community Deployment](https://github.com/Alfresco/acs-community-deployment.git) project on GitHub.
We suggest to follow the instructions related to the Docker deployment, considering that you are working on a development environment.
Please note that you might want to deploy and use Alfresco Content Services Enterprise Edition instead. In this case you can use the [Alfresco Content Services Deployment](https://github.com/Alfresco/acs-deployment.git) project on GitHub.
## Alfresco Process Services (optional)
If you want to develop on top of the [Alfresco Process Services](https://www.alfresco.com/platform/process-services-bpm), you might want to install it as described in the [official documentation](https://docs.alfresco.com/process-services1.8/topics/installing_process_services.html).
Please note that ADF applications are compliant with [Alfresco Process Services powered by Activiti](https://www.alfresco.com/platform/process-services-bpm) and not with [Activiti](https://www.activiti.org/) yet.
## ADF Yeoman generator (optional)
Check that you have `Yeoman` installed by running `yo --version`. If it is not present, you can install
it by running:
You might want to ensure that you have `Yeoman` installed by running `yo --version`. If this is not in your system make sure you run:
sudo npm install -g yo
You can install the latest version of the `generator-alfresco-adf-app` (the main scaffold generator)
using the following command:
If you have installed it previously, you might want to make sure you uninstall them before. In ADF 2.0 we renamed the generator packages and the update is highly suggested.
Uninstall previous versions with:
sudo npm uninstall generator-alfresco-adf-app
sudo npm uninstall generator-ng2-alfresco-app
Install the latest version of the `generator-alfresco-adf-app` using the following command.
sudo npm install -g generator-alfresco-adf-app
If you have installed an earlier version of the generator then you should uninstall it before installing
the latest one. In ADF 2.0 we renamed the generator packages, so updating is especially recommended from
pre-2.0 versions.
## Alfresco Example Content Application (optional)
Uninstall versions before 2.0 with:
In some tutorials your might be required to use the [Alfresco Example Content Application](https://github.com/Alfresco/alfresco-content-app) available into a public repository on GitHub named [`alfresco-content-app`](https://github.com/Alfresco/alfresco-content-app). The Alfresco Example Content Application is an example application and it is used in the tutorial as a starting point to customise the behaviour and show the development, avoiding to loose time in building apps from scratch.
sudo npm uninstall generator-ng2-alfresco-app
The Alfresco Example Content Application requires an instance of Alfresco Content Services up and running, to work properly. If you don't have it already, follow the instructions above in the `Alfresco Content Services (optional)` paragraph.
...and versions since 2.0 with:
To make the Alfresco Example Content Application works into your development environment, clone the [`alfresco-content-app` GitHub repository](https://github.com/Alfresco/alfresco-content-app) using the following command into a terminal.
sudo npm uninstall generator-alfresco-adf-app
git clone https://github.com/Alfresco/alfresco-content-app
Once completed, edit the `proxy.conf.js` file into the root of the project and change the `target` property according to the Alfresco Content Services instance. Below the setup if you are using the [Alfresco Content Services Community Deployment](https://github.com/Alfresco/acs-community-deployment.git) project on GitHub.
module.exports = {
"/alfresco": {
"target": "http://0.0.0.0:8082",
...
}
};
Once done, open a terminal and move into the `alfresco-content-app` folder and run `npm install`. Then run `npm start` and the application will be served on port `4200`, at the url `http://localhost:4200`.