[ADF-2679] Reviewed tutorials (#3254)

* [ADF_2679] Reviewed tutorial text

* [ADF-2679] Reviewed tutorials

* [ADF-2679] Fixed glitches in index page
This commit is contained in:
Andy Stark
2018-05-02 16:43:47 +01:00
committed by Eugenio Romano
parent ebfc40b1c8
commit 8037d4c76c
8 changed files with 681 additions and 470 deletions

View File

@@ -1,37 +1,42 @@
---
Level: Basic
---
# Creating your ADF application using Yeoman
In this tutorial you are going to see how to create an ADF application from scratch, using the [Yeoman scaffolding tool](http://yeoman.io/). This is a "getting started" task that should enable you to start developing your own ADF application.
Learn how to create an ADF application from scratch, using the [Yeoman scaffolding tool](http://yeoman.io/). This task is recommended to get started before developing your ADF application.
## Prerequisites
Before any further task, be sure you executed the optional section described in [the preparation of the development environment](./preparing-the-development-environment.html), dedicated to the installation of the ADF Yeoman generator. This is a requested prerequisite to complete this tutorial with success.
Before proceeding, make sure you have set up the Yeoman generator as described in
[Preparing the development environment](./preparing-the-development-environment.html). You will need
the generator to complete this tutorial successfully.
## Creating the ADF application
The creation of a brand new application is straightforward using the [Yeoman generator](http://yeoman.io/). Open a terminal and execute the following command.
Creating a new application is straightforward using the [Yeoman generator](http://yeoman.io/). Open a terminal and execute the following command.
yo alfresco-adf-app
After the execution, the generator asks few questions: mainly the name of your app (in this example we are going to use `myApp`) and which blueprint you want to use. below the picture showing how the wizard looks like.
The generator will ask you a few questions as it runs, mainly the name of your app (in this example we
are going to use "myApp") and which blueprint you want to use:
![yeoman_creation](../docassets/images/yeoman_creation.png)
You can select one of the three following blueprints.
The following blueprints are available:
**Process Services**
- **Process Services:** This will generate an application for Alfresco Process Services. The main
components it contains are Login, App List, Task List, Form and Start Process.
This will generate an application for Alfresco Process Services. It mainly contains the following components: Login, App List, Task List, Form and Start Process.
- **Content Services:** This will generate an application for Alfresco Content Services. The main
components it contains are Login, Document List, and Viewer.
**Content Services**
- **Process and Content Services:** This will generate an application for both Alfresco Process and
Content Services using a combination of the two blueprints above.
This will generate an application for Alfresco Content Services. It mainly contains the following components: Login, Document List, Viewer.
**Process and Content Services**
This will generate an application for both Alfresco Process and Content Services and will be a combination of the two blueprints above.
Select your preferred one and the generator asks if you want to install dependencies right away. Enter "`Y`" and hit enter. This can take a minute or two depending on your internet connection. You might see a few warnings at the end like this:
When you have made your selection, the generator will ask if you want to install dependencies right away.
Type "`Y`" and hit enter. This can take a minute or two depending on your internet connection. You might
see a few warnings at the end like this:
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN @mat-datetimepicker/core@1.0.4 requires a peer of @angular/core@^5.2.3 but none is installed. You must install peer dependencies yourself.
@@ -43,34 +48,44 @@ Select your preferred one and the generator asks if you want to install dependen
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
These warnings are normal. Unfortunately they happen within the Angular Flex Layout package that ADF depends on. You can safely ignore them.
These warnings are normal. Unfortunately they are not under the ADF team's control (they happen within the
Angular Flex Layout package that ADF depends on) but you can safely ignore them.
Once done, you will find a folder named `myApp` where you can find all the ADF application already created and completed.
Once done, you will find a folder named `myApp` containing the new ADF application ready for
development.
## Configuring the application
To configure the ADF application, you only need to point on the correct Alfresco Content Services and Alfresco Process Services, accordingly with the blueprint you decided to use during the creation.
To configure the ADF application, you only need to point to the correct Alfresco Content Services and/or
Alfresco Process Services, depending on which blueprint you used to create the project.
To setup the correct back-end services, change into the directory of your app (`myApp` in our case) and inspect the `proxy.conf.json` file. This file will tell Angular Webpack to create a proxy for your backend (Content or Process services). Change the URLs and ports to reflect where they are currently running. Below an example of how the `proxy.conf.json` file should look like.
To set up the back-end services correctly, `cd` into the directory of your app (`myApp` in our case)
and open the `proxy.conf.json` file. This file will tell Angular Webpack to create a proxy for your backend
services (Content or Process services). Change the URLs and ports to reflect where these services are
currently running. Below is an example of how the `proxy.conf.json` file should look:
{
"/alfresco": {
"target": "http://localhost:8080", // <-- Change this!
"secure": false,
"changeOrigin": true
},
"/activiti-app": {
"target": "http://localhost:9999", // <-- Change this!
"secure": false,
"changeOrigin": true
}
}
{
"/alfresco": {
"target": "http://localhost:8080", // <-- Change this!
"secure": false,
"changeOrigin": true
},
"/activiti-app": {
"target": "http://localhost:9999", // <-- Change this!
"secure": false,
"changeOrigin": true
}
## Using the application
Now that you ADF application is correctly configured, start it running the `npm start` command from a terminal, double checking you are located into the project folder (in our case `myApp`). The execution of the command takes a couple of seconds and a browser will automatically open at `http://localhost:4200/`.
Now that your ADF application is correctly configured, you can run it using the `npm start` command from
a terminal (check that you are in the project folder `myApp` before doing this). The execution of the
command takes a couple of seconds, after which the browser will automatically open at
`http://localhost:4200/`.
As you can see from the user interface, the Alfresco ADF application is really straightforward and basic. This is a precise requirement for this example, because it focuses the attention on the comprehension of the basis, instead of containing complex features that will be part of an intermediate/expert learning path. Below a screenshot of how the home page looks like.
As you can see from the user interface, the Alfresco ADF application is very basic to begin with. This is
exactly what we need for this example, because it emphasizes the basics rather than complex features that
will be covered in intermediate/expert tutorials to follow. Below is a screenshot of the home page:
![yeoman_start](../docassets/images/yeoman_start.png)