--- title: Getting Started --- # Getting Started ## Prerequisites This application uses the latest releases from Alfresco: - [Alfresco ADF (2.5.0)](https://community.alfresco.com/community/application-development-framework/pages/get-started) - [Alfresco Content Services (6.0)](https://www.alfresco.com/platform/content-services-ecm) or [Alfresco Community Edition (6.0 - General Release: 201806)](https://www.alfresco.com/products/community/download)
You also need node.js (LTS) installed to build it locally from source code.
The latest version of the Alfresco Content platform is required due to the application using the latest [REST APIs](https://docs.alfresco.com/5.2/pra/1/topics/pra-welcome.html) developments. ## Building from source The Content App is based on [Angular CLI](https://cli.angular.io), and you can use all the commands, generators and blueprints supported by the CLI. ### Prerequisites for building - [Node.js](https://nodejs.org/en/) LTS - [Angular CLI](https://cli.angular.io/) 1.7.3 ### Cloning and running Use the following commands to clone the project, install dependencies and run it. ```sh git clone https://github.com/Alfresco/alfresco-content-app.git cd alfresco-content-app npm install npm start ``` The application runs at port `4200` by default, and should automatically open in the default browser once project compilation finishes. ### Proxy settings The Content App provides a proxy configuration for local development server that allows you to address specific scenarios with CORS and native authentication dialog. You can find settings in the "proxy.conf.js" file in the project root directory.The proxy settings get automatically applied every time you run the application with "npm start" script. You must restart the application every time you change the settings values.
### Running unit tests Run `npm test` to execute the unit tests via [Karma](https://karma-runner.github.io). ## Internationalization (i18n) The Content Application provides support for the following languages: - German (`de`) - English (`en`) - Spanish (`es`) - French (`fr`) - Italian (`it`) - Japanese (`ja`) - Norwegian (`nb`) - Dutch (`nl`) - Brazilian Portuguese (`pt-BR`) - Russian (`ru`) - Simplified Chinese (`zh-CN`) The fallback locale is the English one, however current browser language is taken as the default one automatically when the application starts. ### User-defined language You can allow users to set custom language that gets saved to user preferences. The main application menu already has the [ADF Language Menu](https://github.com/Alfresco/alfresco-ng2-components/blob/master/docs/core/language-menu.component.md) component integrated and pre-filled with the supported items. To change the default language set edit the `app.config.json` file and add or remove items: ```json { ..., "languages": [ { "key": "de", "label": "German" }, { "key": "en", "label": "English" }, { "key": "es", "label": "Spanish" }, ... ] } ``` The file is located at the following path: `/src/app.config.json`. ### Custom languages To add a custom language, add a new "JSON" file to the "/src/assets/i18n" folder with the name of the target locale, for instance, a "de.json" for the "German". Translate the resource strings based on the default "en.json" file. You can copy the content over to your newly created file and replace English values with translated text. ```json { "APP": { "SIGN_IN": "Anmelden", "SIGN_OUT": "Abmelden", "NEW_MENU": { "LABEL": "Neu", "MENU_ITEMS": { "CREATE_FOLDER": "Ordner erstellen", "UPLOAD_FILE": "Datei hochladen", "UPLOAD_FOLDER": "Ordner hochladen" }, ... } }, ... } ``` The Content Application automatically bundles your file upon project build. You can test your locale by changing the browser language settings and reloading the page. Optionally, you can extend the [ADF Language Menu](https://github.com/Alfresco/alfresco-ng2-components/blob/master/docs/core/language-menu.component.md) component with the newly added language by updating the `app.config.json` file. ### Customizing ADF translations In addition to creating a custom language file for the Content Application, you can also provide translations for the ADF resources. Your `/src/assets/i18n/You can get more details on the supported rules in the following article: Upload Service.
#### Pagination settings You can change the default settings of the pagination that gets applied to all the document lists in the application. ```json { ..., "pagination": { "supportedPageSizes": [ 25, 50, 100 ] }, ... } ``` ### Your custom settings You can store any information in the application configuration file, and access it at runtime by using the `AppConfigService` service provided by ADF.Please refer to the AppConfigService documentation to get more details on Application Configuration features and API available.
## Navigation The Alfresco Content Application provides the following navigation links: - Personal Files - File Libraries - Shared - Recent Files - Favorites - Trash The side navigation provides support to customize the appearance of the links by editing the `app.config.json`. ### Customization Navigation configuration supports array and object like schema. Defining an object helps navigation to render visual delimiters between different groups of links. ```json { "navigation": { "main": [ ... ], "secondary": [ ... ] } } ```  ```json { "navigation": [ { ... }, { ... }, ... ] } ```  #### Customize icons and text `icon` - supported value can be anything from [Material Design](https://material.io/icons) icons library. If not defined, the link will render just the label value. `title` - instructs the link to render a native browser tooltip with the given value. It can be a string or a i18n defined reference. If not defined, the link will not show a tooltip. `label` - represents the visual name of the link. It can be a string or a i18n defined reference.Changing ` "route": { "url": "/..." } ` value will affect the navigation since these are mapped to application routing system.
#### Custom text (i18n) To change the `title` and `label` of navigation links edit the values under `BROWSE` entry found at `/src/assets/i18n/en.json` ```json "APP" : { ... "BROWSE": { "PERSONAL": { "TITLE": "Personal Files", "SIDENAV_LINK": { "LABEL": "Personal Files", "TOOLTIP": "View your Personal Files" } }, ... } } ``` For more information about internationalization see [Internationalization (i18n)](#internationalization-i18n) section. ### User-defined navigation To add custom navigation link for the application, first we need to create a component. `src/app/components/custom-page/custom-page.component.ts` ```js import { Component } from '@angular/core'; @Component({ template: `With this mode, you do not need building application from source code or installing dependencies.
To run the latest published container go to the `docker-compose` folder and start docker compose from there: ```sh cd docker-compose docker-compose up ``` The application is available at the `http://localhost:3000` address.