diff --git a/ng2-components/README.md b/ng2-components/README.md index 6da5fea421..05e2b010b8 100644 --- a/ng2-components/README.md +++ b/ng2-components/README.md @@ -26,60 +26,18 @@ ### Components - -- [adf-card-view](ng2-alfresco-core/README.md) -- [adf-card-view-textitem](ng2-alfresco-core/README.md) -- [adf-card-view-mapitem](ng2-alfresco-core/README.md) -- [adf-card-view-item-dispatcher](ng2-alfresco-core/README.md) -- [adf-card-view-dateitem](ng2-alfresco-core/README.md) -- [adf-toolbar](ng2-alfresco-core/README.md) -- [adf-toolbar-title](ng2-alfresco-core/README.md) -- [adf-context-menu-holder](ng2-alfresco-core/README.md) -- [adf-accordion](ng2-alfresco-core/README.md) -- [adf-accordion-group](ng2-alfresco-core/README.md) + ### Directives - -- [adf-card-view-content-proxy](ng2-alfresco-core/README.md) -- [adf-context-menu](ng2-alfresco-core/README.md) -- [adf-mdl-textfield](ng2-alfresco-core/README.md) -- [adf-mdl-menu](ng2-alfresco-core/README.md) -- [adf-upload](ng2-alfresco-core/README.md) + ## Content service ### Components - -- [adf-search-control](ng2-alfresco-search/README.md) -- [adf-search](ng2-alfresco-search/README.md) -- [adf-search-autocomplete](ng2-alfresco-search/README.md) -- [adf-upload-button](ng2-alfresco-upload/README.md) -- [adf-upload-drag-area](ng2-alfresco-upload/README.md) -- [adf-file-uploading-list](ng2-alfresco-upload/README.md) -- [adf-file-uploading-dialog](ng2-alfresco-upload/README.md) -- [adf-file-uploading-list-row](ng2-alfresco-upload/README.md) -- [adf-sites-dropdown](ng2-alfresco-documentlist/README.md) -- [adf-content-node-selector](ng2-alfresco-documentlist/README.md) -- [adf-document-menu-action](ng2-alfresco-documentlist/README.md) -- [adf-dropdown-breadcrumb](ng2-alfresco-documentlist/README.md) -- [adf-breadcrumb](ng2-alfresco-documentlist/README.md) -- [adf-document-list](ng2-alfresco-documentlist/README.md) -- [adf-pagination](ng2-alfresco-core/src/components/pagination/pagination.md) -- [adf-empty-list](ng2-alfresco-datatable/README.md) -- [adf-datatable](ng2-alfresco-datatable/README.md) -- [adf-datatable-cell](ng2-alfresco-datatable/README.md) -- [adf-viewer](ng2-alfresco-viewer/README.md) -- [adf-userinfo](ng2-alfresco-userinfo/README.md) -- [adf-rating](ng2-alfresco-social/README.md) -- [adf-like](ng2-alfresco-social/README.md) -- [adf-tag-node-list](ng2-alfresco-tag/README.md) -- [adf-tag-list](ng2-alfresco-tag/README.md) -- [adf-tag-node-actions-list](ng2-alfresco-tag/README.md) -- [adf-login](ng2-alfresco-login/README.md) -- [adf-webscript-get](ng2-alfresco-webscript/README.md) + @@ -88,103 +46,14 @@ ### components - -- [adf-diagram-publish-task](ng2-activiti-diagrams/README.md) -- [adf-start-process](ng2-activiti-processlist/README.md) -- [adf-process-instance-list](ng2-activiti-processlist/README.md) -- [adf-process-instance-variables](ng2-activiti-processlist/README.md) -- [adf-process-instance-tasks](ng2-activiti-processlist/README.md) -- [adf-process-instance-header](ng2-activiti-processlist/README.md) -- [adf-process-instance-details](ng2-activiti-processlist/README.md) -- [adf-process-instance-filters](ng2-activiti-processlist/README.md) -- [adf-process-instance-comments](ng2-activiti-processlist/README.md) -- [adf-process-attachment-list](ng2-activiti-processlist/README.md) -- [adf-create-process-attachment](ng2-activiti-processlist/README.md) -- [adf-form-field](ng2-activiti-form/README.md) -- [adf-start-form](ng2-activiti-form/README.md) -- [adf-content](ng2-activiti-form/README.md) -- [adf-form](ng2-activiti-form/README.md) -- [adf-form-list](ng2-activiti-form/README.md) -- [adf-diagram](ng2-activiti-diagrams/README.md) -- [adf-diagram-sequence-flow](ng2-activiti-diagrams/README.md) -- [adf-tasklist](ng2-activiti-tasklist/README.md) -- [adf-filters](ng2-activiti-tasklist/README.md) -- [adf-task-details](ng2-activiti-tasklist/README.md) -- [adf-start-task](ng2-activiti-tasklist/README.md) -- [adf-task-header](ng2-activiti-tasklist/README.md) -- [adf-people-list](ng2-activiti-tasklist/README.md) -- [adf-task-attachment-list](ng2-activiti-tasklist/README.md) -- [adf-people-search](ng2-activiti-tasklist/README.md) -- [adf-people](ng2-activiti-tasklist/README.md) -- [adf-comments](ng2-activiti-tasklist/README.md) -- [adf-create-task-attachment](ng2-activiti-tasklist/README.md) -- [adf-comment-list](ng2-activiti-tasklist/README.md) -- [adf-checklist](ng2-activiti-tasklist/README.md) -- [adf-apps](ng2-activiti-tasklist/README.md) -- [adf-analytics-report-parameters](ng2-activiti-analytics/README.md) -- [adf-analytics](ng2-activiti-analytics/README.md) -- [adf-analytics-report-list](ng2-activiti-analytics/README.md) -- [adf-analytics-report-heat-map](ng2-activiti-analytics/README.md) -- [adf-analytics-generator](ng2-activiti-analytics/README.md) + ## Services - -- [ContextMenuService](ng2-alfresco-core/src/components/context-menu/context-menu.service.ts) -- [FileUploadService](ng2-alfresco-upload/src/services/file-uploading.service.ts) -- [DocumentListService](ng2-alfresco-documentlist/src/services/document-list.service.ts) -- [NodeActionsService](ng2-alfresco-documentlist/src/services/node-actions.service.ts) -- [FolderActionsService](ng2-alfresco-documentlist/src/services/folder-actions.service.ts) -- [DocumentActionsService](ng2-alfresco-documentlist/src/services/document-actions.service.ts) -- [ProcessService](ng2-activiti-processlist/src/services/process.service.ts) -- [ProcessUploadService](ng2-activiti-processlist/src/services/process-upload.service.ts) -- [WidgetVisibilityService](ng2-activiti-form/src/services/widget-visibility.service.ts) -- [NodeService](ng2-activiti-form/src/services/node.service.ts) -- [FormService](ng2-activiti-form/src/services/form.service.ts) -- [FormRenderingService](ng2-activiti-form/src/services/form-rendering.service.ts) -- [EcmModelService](ng2-activiti-form/src/services/ecm-model.service.ts) -- [ActivitiContentService](ng2-activiti-form/src/services/activiti-content-service.ts) -- [ActivitiAlfrescoContentService](ng2-activiti-form/src/services/activiti-alfresco.service.ts) -- [CardViewUpdateService](ng2-alfresco-core/src/services/card-view-update.service.ts) -- [SearchService](ng2-alfresco-core/src/services/search.service.ts) -- [SitesApiService](ng2-alfresco-core/src/services/sites-api.service.ts) -- [SharedLinksApiService](ng2-alfresco-core/src/services/shared-links-api.service.ts) -- [SearchApiService](ng2-alfresco-core/src/services/search-api.service.ts) -- [NodesApiService](ng2-alfresco-core/src/services/nodes-api.service.ts) -- [PeopleApiService](ng2-alfresco-core/src/services/people-api.service.ts) -- [FavoritesApiService](ng2-alfresco-core/src/services/favorites-api.service.ts) -- [DiscoveryApiService](ng2-alfresco-core/src/services/discovery-api.service.ts) -- [DeletedNodesApiService](ng2-alfresco-core/src/services/deleted-nodes-api.service.ts) -- [UserPreferencesService](ng2-alfresco-core/src/services/user-preferences.service.ts) -- [UploadService](ng2-alfresco-core/src/services/upload.service.ts) -- [TranslationService](ng2-alfresco-core/src/services/translation.service.ts) -- [ThumbnailService](ng2-alfresco-core/src/services/thumbnail.service.ts) -- [StorageService](ng2-alfresco-core/src/services/storage.service.ts) -- [AlfrescoApiService](ng2-alfresco-core/src/services/alfresco-api.service.ts) -- [RenditionsService](ng2-alfresco-core/src/services/renditions.service.ts) -- [LogService](ng2-alfresco-core/src/services/log.service.ts) -- [NotificationService](ng2-alfresco-core/src/services/notification.service.ts) -- [CookieService](ng2-alfresco-core/src/services/cookie.service.ts) -- [ContentService](ng2-alfresco-core/src/services/content.service.ts) -- [AuthenticationService](ng2-alfresco-core/src/services/authentication.service.ts) -- [AlfrescoSettingsService](ng2-alfresco-core/src/services/alfresco-settings.service.ts) -- [AlfrescoContentService](ng2-alfresco-core/src/services/alfresco-content.service.ts) -- [AppConfigService](ng2-alfresco-core/src/services/app-config.service.ts) -- [DiagramsService](ng2-activiti-diagrams/src/services/diagrams.service.ts) -- [DiagramColorService](ng2-activiti-diagrams/src/services/diagram-color.service.ts) -- [RaphaelService](ng2-activiti-diagrams/src/components/raphael/raphael.service.ts) -- [BpmUserService](ng2-alfresco-userinfo/src/services/bpm-user.service.ts) -- [EcmUserService](ng2-alfresco-userinfo/src/services/ecm-user.service.ts) -- [RenderingQueueService](ng2-alfresco-viewer/src/services/rendering-queue.services.ts) -- [RatingService](ng2-alfresco-social/src/services/rating.service.ts) -- [TagService](ng2-alfresco-tag/src/services/tag.service.ts) -- [TaskListService](ng2-activiti-tasklist/src/services/tasklist.service.ts) -- [ProcessUploadService](ng2-activiti-tasklist/src/services/process-upload.service.ts) -- [PeopleService](ng2-activiti-tasklist/src/services/people.service.ts) -- [AnalyticsService](ng2-activiti-analytics/src/services/analytics.service.ts) + You can browse all the components at the following address: diff --git a/ng2-components/ng2-activiti-analytics/README.md b/ng2-components/ng2-activiti-analytics/README.md index e6e2bfa8c8..fee1c5fa05 100644 --- a/ng2-components/ng2-activiti-analytics/README.md +++ b/ng2-components/ng2-activiti-analytics/README.md @@ -1,72 +1,41 @@ -# Activiti Analytics Components +# Activiti Analytics library + +Contains the Activiti Analytics component and other related components. -- [Prerequisites](#prerequisites) -- [Install](#install) -- [Activiti Analytics List Component](#activiti-analytics-list-component) - * [Properties](#properties) - * [Events](#events) - [Activiti Analytics Component](#activiti-analytics-component) - * [Properties](#properties-1) - * [Events](#events-1) + * [Basic Usage](#basic-usage) + + [Properties](#properties) + + [Events](#events) +- [Activiti Analytics List Component](#activiti-analytics-list-component) + * [Basic Usage](#basic-usage-1) + + [Properties](#properties-1) + + [Events](#events-1) - [Analytics Generator Component](#analytics-generator-component) - * [Properties](#properties-2) - * [Events](#events-2) -- [Build from sources](#build-from-sources) -- [NPM scripts](#npm-scripts) -- [Demo](#demo) -- [License](#license) + * [Basic Usage](#basic-usage-2) + + [Properties](#properties-2) + + [Events](#events-2) +- [Project Information](#project-information) + * [Prerequisites](#prerequisites) + * [Install](#install) + * [Build from sources](#build-from-sources) + * [NPM scripts](#npm-scripts) + * [Demo](#demo) + * [License](#license) -## Prerequisites - -Before you start using this development framework, make sure you have installed all required software and done all the -necessary configurations, see this [page](https://github.com/Alfresco/alfresco-ng2-components/blob/master/PREREQUISITES.md). - -> If you plan to use this component with projects generated by Angular CLI, you can read more in [Using ADF with Angular CLI](https://github.com/Alfresco/alfresco-ng2-components/wiki/Angular-CLI) - -## Install - -```sh -npm install ng2-activiti-analytics -``` - -## Activiti Analytics List Component - -The component shows the list of all the available reports - -```html - - -``` - -### Properties - -| Name | Type | Required | Default | Description | -| --- | --- | --- | --- | --- | -| appId | string | optional | | The application id | -| layoutType | string | required | | Define the layout of the apps. There are two possible values: GRID or LIST. LIST is the default value| -| selectFirst | boolean | optional | false | Change the value to true if you want to select the first item in the list as default| - -### Events - -| Name | Description | -| --- | --- | -| onSuccess | The event is emitted when the report list is loaded | -| onError | The event is emitted when an error occurs during the loading | -| reportClick | The event is emitted when the report in the list is selected | - ## Activiti Analytics Component The component shows the charts related to the reportId passed as input +### Basic Usage + ```html ``` -### Properties +#### Properties | Name | Type | Description | | --- | --- | --- | @@ -94,7 +63,7 @@ You can also hide chart parameters UI by setting the `hideParameters` to `true`: ![Analytics-without-parameters](docs/assets/analytics-without-parameters.png) -### Events +#### Events | Name | Description | | --- | --- | @@ -103,10 +72,40 @@ You can also hide chart parameters UI by setting the `hideParameters` to `true`: | reportSaved | The event is emitted when a report is saved | | reportDeleted | The event is emitted when a report is deleted | +## Activiti Analytics List Component + +The component shows the list of all the available reports + +### Basic Usage + +```html + + +``` + +#### Properties + +| Name | Type | Required | Default | Description | +| --- | --- | --- | --- | --- | +| appId | string | optional | | The application id | +| layoutType | string | required | | Define the layout of the apps. There are two possible values: GRID or LIST. LIST is the default value| +| selectFirst | boolean | optional | false | Change the value to true if you want to select the first item in the list as default| + +#### Events + +| Name | Description | +| --- | --- | +| onSuccess | The event is emitted when the report list is loaded | +| onError | The event is emitted when an error occurs during the loading | +| reportClick | The event is emitted when the report in the list is selected | + ## Analytics Generator Component The component generates and shows the charts +### Basic Usage + ```html ``` -### Properties +#### Properties | Name | Type | Description | | --- | --- | -- | | reportId | string | The report id | | reportParamQuery | ReportQuery | The object contains all the parameters that the report needs | -### Events +#### Events | Name | Description | | --- | --- | | onSuccess | Raised when the charts are loaded | | onError | Raised when an error occurs during the loading | -## Build from sources +## Project Information + +### Prerequisites + +Before you start using this development framework, make sure you have installed all required software and done all the +necessary configurations, see this [page](https://github.com/Alfresco/alfresco-ng2-components/blob/master/PREREQUISITES.md). + +> If you plan to use this component with projects generated by Angular CLI, you can read more in [Using ADF with Angular CLI](https://github.com/Alfresco/alfresco-ng2-components/wiki/Angular-CLI) + +### Install + +```sh +npm install ng2-activiti-analytics +``` + +### Build from sources You can build the component from sources with the following commands: @@ -140,7 +154,7 @@ npm run build > The `build` task rebuilds all the code, runs tslint, license checks > and other quality check tools before performing unit testing. -## NPM scripts +### NPM scripts | Command | Description | | --- | --- | @@ -149,7 +163,7 @@ npm run build | npm run test-browser | Run unit tests in the browser | npm run coverage | Run unit tests and display code coverage report | -## Demo +### Demo Please check the demo folder for a demo project @@ -159,6 +173,6 @@ npm install npm start ``` -## License +### License [Apache Version 2.0](https://github.com/Alfresco/alfresco-ng2-components/blob/master/LICENSE) diff --git a/ng2-components/ng2-activiti-diagrams/README.md b/ng2-components/ng2-activiti-diagrams/README.md index 4876506240..99ec59b036 100644 --- a/ng2-components/ng2-activiti-diagrams/README.md +++ b/ng2-components/ng2-activiti-diagrams/README.md @@ -1,38 +1,31 @@ -# Activiti Diagrams Component +# Activiti Diagrams library + +Contains the Activiti Diagram component. -- [Prerequisites](#prerequisites) -- [Install](#install) - [Activiti Diagram Component](#activiti-diagram-component) - * [Properties](#properties) - * [Events](#events) -- [Build from sources](#build-from-sources) -- [NPM scripts](#npm-scripts) -- [Demo](#demo) -- [License](#license) + * [Basic Usage](#basic-usage) + + [Properties](#properties) + + [Events](#events) +- [Project Information](#project-information) + * [Prerequisites](#prerequisites) + * [Install](#install) + * [Build from sources](#build-from-sources) + * [NPM scripts](#npm-scripts) + * [Demo](#demo) + * [License](#license) -## Prerequisites - -Before you start using this development framework, make sure you have installed all required software and done all the -necessary configurations, see this [page](https://github.com/Alfresco/alfresco-ng2-components/blob/master/PREREQUISITES.md). - -> If you plan to use this component with projects generated by Angular CLI, you can read more in [Using ADF with Angular CLI](https://github.com/Alfresco/alfresco-ng2-components/wiki/Angular-CLI) - -## Install - -```sh -npm install ng2-activiti-diagrams -``` - ## Activiti Diagram Component +### Basic Usage + This component shows the diagram of a process. ```html @@ -49,7 +42,7 @@ The below component shows the diagram of a running process instance with the act ``` -### Properties +#### Properties | Name | Type | Description | | --- | --- | -- | @@ -60,14 +53,29 @@ The below component shows the diagram of a running process instance with the act | width | number | | | height | number | | -### Events +#### Events | Name | Description | | --- | --- | | onSuccess | Raised when the diagrams elements are loaded | | onError | Raised when an error occurs during loading | -## Build from sources +## Project Information + +### Prerequisites + +Before you start using this development framework, make sure you have installed all required software and done all the +necessary configurations, see this [page](https://github.com/Alfresco/alfresco-ng2-components/blob/master/PREREQUISITES.md). + +> If you plan to use this component with projects generated by Angular CLI, you can read more in [Using ADF with Angular CLI](https://github.com/Alfresco/alfresco-ng2-components/wiki/Angular-CLI) + +### Install + +```sh +npm install ng2-activiti-diagrams +``` + +### Build from sources You can build the component from sources with the following commands: @@ -79,7 +87,7 @@ npm run build > The `build` task rebuilds all the code, runs tslint, license checks > and other quality check tools before performing unit testing. -## NPM scripts +### NPM scripts | Command | Description | | --- | --- | @@ -88,7 +96,7 @@ npm run build | npm run test-browser | Run unit tests in the browser | npm run coverage | Run unit tests and display code coverage report | -## Demo +### Demo Please check the demo folder for a demo project @@ -98,6 +106,6 @@ npm install npm start ``` -## License +### License [Apache Version 2.0](https://github.com/Alfresco/alfresco-ng2-components/blob/master/LICENSE) diff --git a/ng2-components/ng2-activiti-form/README.md b/ng2-components/ng2-activiti-form/README.md index ab6aa26ef0..5018f424e1 100644 --- a/ng2-components/ng2-activiti-form/README.md +++ b/ng2-components/ng2-activiti-form/README.md @@ -1,4 +1,6 @@ -# APS Form Component +# APS Form library + +Contains the Activiti Form component and other related components and services. @@ -7,40 +9,45 @@ - [Library Contents](#library-contents) * [Components](#components) * [Services](#services) -- [Prerequisites](#prerequisites) -- [Install](#install) -- [Form Component](#form-component) - * [Properties](#properties) +- [Activiti Form component](#activiti-form-component) + * [Basic Usage](#basic-usage) + + [Properties](#properties) + + [Advanced properties](#advanced-properties) + + [Events](#events) + * [Details](#details) + + [Custom empty form template](#custom-empty-form-template) + + [Controlling outcome execution behaviour](#controlling-outcome-execution-behaviour) + [Form Field Validators](#form-field-validators) - [Custom set of validators](#custom-set-of-validators) - [Custom validator example](#custom-validator-example) - * [Advanced properties](#advanced-properties) - * [Events](#events) - * [Custom empty form template](#custom-empty-form-template) - * [Controlling outcome execution behaviour](#controlling-outcome-execution-behaviour) - [Activiti Content Component](#activiti-content-component) - * [Properties](#properties-1) - * [Events](#events-1) + * [Basic Usage](#basic-usage-1) + + [Properties](#properties-1) + + [Events](#events-1) - [ADF Form List Component](#adf-form-list-component) - * [Properties](#properties-2) + * [Basic Usage](#basic-usage-2) + + [Properties](#properties-2) - [FormService Service](#formservice-service) - * [Events](#events-2) - * [Methods](#methods) -- [Common scenarios](#common-scenarios) - * [Changing field value based on another field](#changing-field-value-based-on-another-field) - * [Listen all form Events](#listen-all-form-events) + * [Basic Usage](#basic-usage-3) + + [Events](#events-2) + + [Methods](#methods) +- [Other documentation](#other-documentation) + * [Common scenarios](#common-scenarios) + + [Changing field value based on another field](#changing-field-value-based-on-another-field) + + [Listen all form Events](#listen-all-form-events) - [See also](#see-also) -- [Build from sources](#build-from-sources) -- [NPM scripts](#npm-scripts) -- [Demo](#demo) -- [License](#license) +- [Project Information](#project-information) + * [Prerequisites](#prerequisites) + * [Install](#install) + * [Build from sources](#build-from-sources) + * [NPM scripts](#npm-scripts) + * [Demo](#demo) + * [License](#license) -See it live: [Form Quickstart](https://embed.plnkr.co/YSLXTqb3DtMhVJSqXKkE/) - ## Library Contents ### Components @@ -57,22 +64,11 @@ See it live: [Form Quickstart](https://embed.plnkr.co/YSLXTqb3DtMhVJSqXKkE/) - NodeService - WidgetVisibilityService -## Prerequisites +## Activiti Form component -Before you start using this development framework, make sure you have installed all required software and done all the -necessary configuration, see this [page](https://github.com/Alfresco/alfresco-ng2-components/blob/master/PREREQUISITES.md). +The component shows a Form from Activiti (see it live: [Form Quickstart](https://embed.plnkr.co/YSLXTqb3DtMhVJSqXKkE/)) -> If you plan to use this component with projects generated by Angular CLI, you can read more in [Using ADF with Angular CLI](https://github.com/Alfresco/alfresco-ng2-components/wiki/Angular-CLI) - -## Install - -```sh -npm install ng2-activiti-form -``` - -## Form Component - -The component shows a Form from Activiti +### Basic Usage ```html ``` -### Properties - -The recommended set of properties can be found in the following table: +#### Properties | Name | Type | Default | Description | | --- | --- | --- | --- | @@ -169,7 +163,116 @@ The recommended set of properties can be found in the following table: | saveMetadata | boolean | false | Store the value of the form as metadata. | | path | string | | Path of the folder where to store the metadata. | | nameNode | string | true | Name to assign to the new node where the metadata are stored. | -| fieldValidators | FormFieldValidator[] | *see below* | Contains a list of form field validator instances. | +| fieldValidators | FormFieldValidator[] | See [Form Field Validators](#form-field-validators) section below | Contains a list of form field validator instances. | + +#### Advanced properties + + The following properties are for complex customisation purposes: + +| Name | Type | Default | Description | +| --- | --- | --- | --- | +| form | FormModel | | Underlying form model instance. | +| showDebugButton | boolean | false | Toggle debug options. | +| debugMode | boolean | false | Toggle debug mode, allows displaying additional data for development and debugging purposes. | + +#### Events + +| Name | Return Type | Description | +| --- | --- | --- | +| formLoaded | [FormModel](https://github.com/Alfresco/alfresco-ng2-components/blob/master/ng2-components/ng2-activiti-form/src/components/widgets/core/form.model.ts) | Invoked when form is loaded or reloaded. | +| formSaved | [FormModel](https://github.com/Alfresco/alfresco-ng2-components/blob/master/ng2-components/ng2-activiti-form/src/components/widgets/core/form.model.ts) | Invoked when form is submitted with `Save` or custom outcomes. | +| formCompleted | [FormModel](https://github.com/Alfresco/alfresco-ng2-components/blob/master/ng2-components/ng2-activiti-form/src/components/widgets/core/form.model.ts) | Invoked when form is submitted with `Complete` outcome. | +| formDataRefreshed | [FormModel](https://github.com/Alfresco/alfresco-ng2-components/blob/master/ng2-components/ng2-activiti-form/src/components/widgets/core/form.model.ts) | Invoked when form values are refreshed due to a data property change | +| executeOutcome | [FormOutcomeEvent](https://github.com/Alfresco/alfresco-ng2-components/blob/master/ng2-components/ng2-activiti-form/src/components/widgets/core/form-outcome-event.model.ts) | Invoked when any outcome is executed, default behaviour can be prevented via `event.preventDefault()` | +| onError | any | Invoked at any error | + +### Details + +All `form*` events receive an instance of the `FormModel` as event argument for ease of development: + +**MyView.component.html** + +```html + + +``` + +**MyView.component.ts** + +```ts +onFormSaved(form: FormModel) { + console.log(form); +} +``` + +#### Custom empty form template + +You can add a template that will be show if no form definition has been found + +```html + + +
+

Empty form

+
+ +
+ +``` + +#### Controlling outcome execution behaviour + +If absolutely needed it is possible taking full control over form outcome execution by means of `executeOutcome` event. +This event is fired upon each outcome execution, both system and custom ones. + +You can prevent default behaviour by calling `event.preventDefault()`. +This allows for example having custom form validation scenarios and/or additional validation summary presentation. + +Alternatively you may want just running additional code on outcome execution without suppressing default one. + +**MyView.component.html** + +```html + + +``` + +**MyView.component.ts** + +```ts +import { FormOutcomeEvent } from 'ng2-activiti-form'; + +export class MyView { + + validateForm(event: FormOutcomeEvent) { + let outcome = event.outcome; + + // you can also get additional properties of outcomes + // if you defined them within outcome definition + + if (outcome) { + let form = outcome.form; + if (form) { + // check/update the form here + event.preventDefault(); + } + } + } + +} +``` + +There are two additional functions that can be of a great value when controlling outcomes: + +- `saveTaskForm()` - saves current form +- `completeTaskForm(outcome?: string)` - save and complete form with a given outcome name + +**Please note that if `event.preventDefault()` is not called then default outcome behaviour +will also be executed after your custom code.** #### Form Field Validators @@ -301,124 +404,19 @@ Now if you run the application and try to enter "admin" in one of the text field ![](docs/assets/demo-validator.png) -### Advanced properties - - The following properties are for complex customisation purposes: - -| Name | Type | Default | Description | -| --- | --- | --- | --- | -| form | FormModel | | Underlying form model instance. | -| showDebugButton | boolean | false | Toggle debug options. | -| debugMode | boolean | false | Toggle debug mode, allows displaying additional data for development and debugging purposes. | - -### Events - -| Name | Return Type | Description | -| --- | --- | --- | -| formLoaded | [FormModel](https://github.com/Alfresco/alfresco-ng2-components/blob/master/ng2-components/ng2-activiti-form/src/components/widgets/core/form.model.ts) | Invoked when form is loaded or reloaded. | -| formSaved | [FormModel](https://github.com/Alfresco/alfresco-ng2-components/blob/master/ng2-components/ng2-activiti-form/src/components/widgets/core/form.model.ts) | Invoked when form is submitted with `Save` or custom outcomes. | -| formCompleted | [FormModel](https://github.com/Alfresco/alfresco-ng2-components/blob/master/ng2-components/ng2-activiti-form/src/components/widgets/core/form.model.ts) | Invoked when form is submitted with `Complete` outcome. | -| formDataRefreshed | [FormModel](https://github.com/Alfresco/alfresco-ng2-components/blob/master/ng2-components/ng2-activiti-form/src/components/widgets/core/form.model.ts) | Invoked when form values are refreshed due to a data property change | -| executeOutcome | [FormOutcomeEvent](https://github.com/Alfresco/alfresco-ng2-components/blob/master/ng2-components/ng2-activiti-form/src/components/widgets/core/form-outcome-event.model.ts) | Invoked when any outcome is executed, default behaviour can be prevented via `event.preventDefault()` | -| onError | any | Invoked at any error | - -All `form*` events receive an instance of the `FormModel` as event argument for ease of development: - -**MyView.component.html** - -```html - - -``` - -**MyView.component.ts** - -```ts -onFormSaved(form: FormModel) { - console.log(form); -} -``` - -### Custom empty form template - -You can add a template that will be show if no form definition has been found - -```html - - -
-

Empty form

-
- -
- -``` - -### Controlling outcome execution behaviour - -If absolutely needed it is possible taking full control over form outcome execution by means of `executeOutcome` event. -This event is fired upon each outcome execution, both system and custom ones. - -You can prevent default behaviour by calling `event.preventDefault()`. -This allows for example having custom form validation scenarios and/or additional validation summary presentation. - -Alternatively you may want just running additional code on outcome execution without suppressing default one. - -**MyView.component.html** - -```html - - -``` - -**MyView.component.ts** - -```ts -import { FormOutcomeEvent } from 'ng2-activiti-form'; - -export class MyView { - - validateForm(event: FormOutcomeEvent) { - let outcome = event.outcome; - - // you can also get additional properties of outcomes - // if you defined them within outcome definition - - if (outcome) { - let form = outcome.form; - if (form) { - // check/update the form here - event.preventDefault(); - } - } - } - -} -``` - -There are two additional functions that can be of a great value when controlling outcomes: - -- `saveTaskForm()` - saves current form -- `completeTaskForm(outcome?: string)` - save and complete form with a given outcome name - -**Please note that if `event.preventDefault()` is not called then default outcome behaviour -will also be executed after your custom code.** - ## Activiti Content Component The component shows the content preview. +### Basic Usage + ```html - ``` -### Properties +#### Properties The recommended set of properties can be found in the following table: @@ -426,7 +424,7 @@ The recommended set of properties can be found in the following table: | --- | --- | --- | --- | | contentId | string | | The content id to show. | -### Events +#### Events | Name | Description | | --- | --- | @@ -436,13 +434,15 @@ The recommended set of properties can be found in the following table: The component shows the activiti forms as a list. +### Basic Usage + ```html ``` -### Properties +#### Properties The recommended set of properties can be found in the following table: @@ -452,6 +452,8 @@ The recommended set of properties can be found in the following table: ## FormService Service +### Basic Usage + ```ts import { FormService, FormEvent, FormFieldEvent } from 'ng2-activiti-form'; @@ -477,7 +479,7 @@ class MyComponent { } ``` -### Events +#### Events | Name | Args Type | Description | | --- | --- | --- | @@ -492,7 +494,7 @@ class MyComponent { | validateForm | ValidateFormEvent | Raised each time a form is validated. You can use it to provide custom validation or prevent default behaviour. | | validateFormField | ValidateFormFieldEvent | Raised each time a form field is validated. You can use it to provide custom validation or prevent default behaviour.| -### Methods +#### Methods | Name | Params | Returns | Description | | --- | --- | --- | --- | @@ -519,9 +521,11 @@ class MyComponent { | getWorkflowGroups\ | (filter: string, groupId?: string) | Observable\ | | | getWorkflowUsers\ | (filter: string, groupId?: string) | Observable\ | | -## Common scenarios +## Other documentation -### Changing field value based on another field +### Common scenarios + +#### Changing field value based on another field Create a simple Form with a dropdown widget (id: `type`), and a multiline text (id: `description`). @@ -544,7 +548,7 @@ The result should be as following: ![](docs/assets/form-service-sample-01.png) -### Listen all form Events +#### Listen all form Events If you want to listen all the events fired in the form you can subscribe to this Subject : @@ -560,7 +564,22 @@ formService.formEvents.subscribe((event: Event) => { - [Form Stencils with Angular 2](docs/stencils.md) - [Form Extensibility and Customisation](docs/extensibility.md). -## Build from sources +## Project Information + +### Prerequisites + +Before you start using this development framework, make sure you have installed all required software and done all the +necessary configuration, see this [page](https://github.com/Alfresco/alfresco-ng2-components/blob/master/PREREQUISITES.md). + +> If you plan to use this component with projects generated by Angular CLI, you can read more in [Using ADF with Angular CLI](https://github.com/Alfresco/alfresco-ng2-components/wiki/Angular-CLI) + +### Install + +```sh +npm install ng2-activiti-form +``` + +### Build from sources You can build the component from sources with the following commands: @@ -572,7 +591,7 @@ npm run build > The `build` task rebuilds all the code, runs tslint, license checks > and other quality check tools before performing unit testing. -## NPM scripts +### NPM scripts | Command | Description | | --- | --- | @@ -581,7 +600,7 @@ npm run build | npm run test-browser | Run unit tests in the browser | npm run coverage | Run unit tests and display code coverage report | -## Demo +### Demo Please check the demo folder for a demo project @@ -591,6 +610,6 @@ npm install npm start ``` -## License +### License [Apache Version 2.0](https://github.com/Alfresco/alfresco-ng2-components/blob/master/LICENSE) \ No newline at end of file diff --git a/ng2-components/ng2-activiti-processlist/README.md b/ng2-components/ng2-activiti-processlist/README.md index 0a9d1ab98a..2441e92bdd 100644 --- a/ng2-components/ng2-activiti-processlist/README.md +++ b/ng2-components/ng2-activiti-processlist/README.md @@ -1,71 +1,75 @@ -# Activiti Process List Component +# Activiti Process List library + +Contains the Activiti Process Instance List component and other related components and classes. -- [Prerequisites](#prerequisites) -- [Install](#install) - [Activiti Process Instance List](#activiti-process-instance-list) - * [Properties](#properties) - * [Events](#events) + * [Basic Usage](#basic-usage) + + [Properties](#properties) + + [Events](#events) + * [Details](#details) - [Process Filters Component](#process-filters-component) - * [Properties](#properties-1) - * [Events](#events-1) - * [How filter the activiti process filters](#how-filter-the-activiti-process-filters) -- [FilterParamsModel](#filterparamsmodel) - * [How to create an accordion menu with the processes filter](#how-to-create-an-accordion-menu-with-the-processes-filter) + * [Basic Usage](#basic-usage-1) + + [Properties](#properties-1) + + [Events](#events-1) + * [Details](#details-1) + + [How filter the activiti process filters](#how-filter-the-activiti-process-filters) + + [FilterParamsModel](#filterparamsmodel) + + [How to create an accordion menu with the processes filter](#how-to-create-an-accordion-menu-with-the-processes-filter) - [Start Process component](#start-process-component) - * [Properties](#properties-2) - * [Events](#events-2) + * [Basic Usage](#basic-usage-2) + + [Properties](#properties-2) + + [Events](#events-2) - [Process Details component](#process-details-component) - * [Properties](#properties-3) - * [Events](#events-3) + * [Basic Usage](#basic-usage-3) + + [Properties](#properties-3) + + [Events](#events-3) - [Process Instance Details Header component](#process-instance-details-header-component) - * [Properties](#properties-4) - * [Events](#events-4) + * [Basic Usage](#basic-usage-4) + + [Properties](#properties-4) + + [Events](#events-4) - [Process Instance Tasks component](#process-instance-tasks-component) - * [Properties](#properties-5) - * [Events](#events-5) + * [Basic Usage](#basic-usage-5) + + [Properties](#properties-5) + + [Events](#events-5) - [Process Instance Comments component](#process-instance-comments-component) - * [Properties](#properties-6) + * [Basic Usage](#basic-usage-6) + + [Properties](#properties-6) - [Process Attachment List component](#process-attachment-list-component) - * [Properties](#properties-7) - * [Events](#events-6) + * [Basic Usage](#basic-usage-7) + + [Properties](#properties-7) + + [Events](#events-6) - [Create Process Attachment component](#create-process-attachment-component) - * [Properties](#properties-8) - * [Events](#events-7) + * [Basic Usage](#basic-usage-8) + + [Properties](#properties-8) + + [Events](#events-7) - [Process Audit Directive](#process-audit-directive) - * [Properties](#properties-9) + * [Basic Usage](#basic-usage-9) + + [Properties](#properties-9) + [Events](#events-8) -- [Build from sources](#build-from-sources) -- [NPM scripts](#npm-scripts) -- [Demo](#demo) -- [License](#license) +- [Project Information](#project-information) + * [Prerequisites](#prerequisites) + * [Install](#install) + * [Build from sources](#build-from-sources) + * [NPM scripts](#npm-scripts) + * [Demo](#demo) + * [License](#license) -Displays lists of process instances both active and completed, using any defined process filter, and renders details for any chosen instance. - -## Prerequisites - -Before you start using this development framework, make sure you have installed all required software and done all the -necessary configuration [prerequisites](https://github.com/Alfresco/alfresco-ng2-components/blob/master/PREREQUISITES.md). - -> If you plan using this component with projects generated by Angular CLI, please refer to the following article: [Using ADF with Angular CLI](https://github.com/Alfresco/alfresco-ng2-components/wiki/Angular-CLI) - -## Install - -```sh -npm install ng2-activiti-processlist -``` + ## Activiti Process Instance List This component renders a list containing all the process instances matched by the parameters specified. +### Basic Usage + **app.component.html** ```html @@ -75,7 +79,7 @@ This component renders a list containing all the process instances matched by th ``` -### Properties +#### Properties | Name | Description | | --- | --- | @@ -83,9 +87,17 @@ This component renders a list containing all the process instances matched by th | processDefinitionKey | The processDefinitionKey of the process. | | state | Define state of the processes. Possible values are `running`, `completed` and `all` | | sort | Define sort of the processes. Possible values are `created-desc`, `created-asc`, `ended-desc`, `ended-asc` | -| schemaColumn | List of columns to display in the process instances datatable | +| schemaColumn | List of columns to display in the process instances datatable (see the [Details](#details) section below) | -Example: +#### Events + +- **rowClick**: Emitted when a row in the process list is clicked +- **onSuccess**: Emitted when the list of process instances has been loaded successfully from the server +- **onError**: Emitted when an error is encountered loading the list of process instances from the server + +### Details + +Example value for the schemaColumn property (see [Properties](#properties) section above): ```json [ @@ -96,20 +108,11 @@ Example: ] ``` -### Events - -- **rowClick**: Emitted when a row in the process list is clicked -- **onSuccess**: Emitted when the list of process instances has been loaded successfully from the server -- **onError**: Emitted when an error is encountered loading the list of process instances from the server - ## Process Filters Component -Process filters are a collection of criteria used to filter process instances, which may be customized -by users. This component displays a list of available filters and allows the user to select any given -filter as the active filter. +Collection of criteria used to filter process instances, which may be customized by users. -The most common usage is in driving a process instance list to allow the user to choose which -process instances are displayed in the list. +### Basic Usage ```html ``` -### Properties +#### Properties | Name | Type | Description | -| --- | --- | --- | --- | +| --- | --- | --- | | filterParam | [FilterParamsModel](#filterparamsmodel) | The params to filter the task filter. If there is no match the default one (first filter of the list) is selected | | appId | string | Display filters available to the current user for the application with the specified ID. | | appName | string | Display filters available to the current user for the application with the specified name. | @@ -128,7 +131,7 @@ process instances are displayed in the list. If both `appId` and `appName` are specified then `appName` will take precedence and `appId` will be ignored. -### Events +#### Events | Name | Description | | --- | --- | @@ -136,7 +139,15 @@ If both `appId` and `appName` are specified then `appName` will take precedence | onError | Raised when an error occurs | | filterClick | Raised when the user selects a filter from the list | -### How filter the activiti process filters +### Details + +This component displays a list of available filters and allows the user to select any given +filter as the active filter. + +The most common usage is in driving a process instance list to allow the user to choose which +process instances are displayed in the list. + +#### How filter the activiti process filters ```html ``` -You can use inside the filterParam one of the following property. +You can use inside the filterParam one of the properties defined by [FilterParamsModel](#filterparamsmodel) (see below). -## FilterParamsModel +#### FilterParamsModel ```json { @@ -162,7 +173,7 @@ You can use inside the filterParam one of the following property. | name | string | The name of the task filter, lowercase is checked. | | index | number | Zero-based position of the filter in the array. | -### How to create an accordion menu with the processes filter +#### How to create an accordion menu with the processes filter You can create an accordion menu using the AccordionComponent that wrap the activiti task filter. The AccordionComponent is exposed by the alfresco-core. @@ -188,6 +199,8 @@ The AccordionComponent is exposed by the alfresco-core. Displays Start Process, allowing the user to specify some basic details needed to start a new process instance. +### Basic Usage + ```html @@ -195,14 +208,14 @@ Displays Start Process, allowing the user to specify some basic details needed t ``` ![adf-start-process ](docs/assets/start-process.png) -### Properties +#### Properties | Name | Description | | --- | --- | | appId | (required): Limit the list of processes which can be started to those contained in the specified app | | variables | Variables in input to the process [RestVariable](https://github.com/Alfresco/alfresco-js-api/tree/master/src/alfresco-activiti-rest-api/docs/RestVariable.md)| -### Events +#### Events | Name | Description | | --- | --- | @@ -212,7 +225,9 @@ Displays Start Process, allowing the user to specify some basic details needed t ## Process Details component -This component displays detailed information on a specified process instance +Displays detailed information on a specified process instance + +### Basic Usage ```html ``` -### Properties +#### Properties | Name | Type | Description | | --- | --- | --- | | processInstanceId | string | (required): The numeric ID of the process instance to display | -### Events +#### Events | Name | Description | | --- | --- | @@ -236,7 +251,9 @@ This component displays detailed information on a specified process instance ## Process Instance Details Header component -This is a sub-component of the process details component, which renders some general information about the selected process. +Sub-component of the process details component, which renders some general information about the selected process. + +### Basic Usage ```html ``` -### Properties +#### Properties | Name | Type | Description | | --- | --- | --- | | processInstanceId | string | (**required**): The ID of the process instance to display tasks for | | showRefreshButton | boolean | (default: `true`): Whether to show a refresh button next to the list of tasks to allow this to be updated from the server | -### Events +#### Events | Name | Description | | --- | --- | @@ -283,13 +302,15 @@ Lists both the active and completed tasks associated with a particular process i Displays comments associated with a particular process instance and allows the user to add new comments +### Basic Usage + ```html ``` -### Properties +#### Properties | Name | Type | Description | | --- | --- | --- | @@ -297,7 +318,9 @@ Displays comments associated with a particular process instance and allows the u ## Process Attachment List component -This component displays attached documents on a specified process instance +Displays attached documents on a specified process instance + +### Basic Usage ```html If you plan using this component with projects generated by Angular CLI, please refer to the following article: [Using ADF with Angular CLI](https://github.com/Alfresco/alfresco-ng2-components/wiki/Angular-CLI) + +### Install + +```sh +npm install ng2-activiti-processlist +``` + +### Build from sources You can build component from sources with the following commands: @@ -394,7 +436,7 @@ npm run build > The `build` task rebuilds all the code, runs tslint, license checks > and other quality check tools before performing unit testing. -## NPM scripts +### NPM scripts | Command | Description | | --- | --- | @@ -403,7 +445,7 @@ npm run build | npm run test-browser | Run unit tests in the browser | npm run coverage | Run unit tests and display code coverage report | -## Demo +### Demo Please check the demo folder for a demo project @@ -413,6 +455,6 @@ npm install npm start ``` -## License +### License [Apache Version 2.0](https://github.com/Alfresco/alfresco-ng2-components/blob/master/LICENSE) diff --git a/ng2-components/ng2-activiti-tasklist/README.md b/ng2-components/ng2-activiti-tasklist/README.md index 53aeb2a54e..53b8494545 100644 --- a/ng2-components/ng2-activiti-tasklist/README.md +++ b/ng2-components/ng2-activiti-tasklist/README.md @@ -1,90 +1,99 @@ -# APS Task List Component +# Activiti Task List library + +Contains the Activiti Task List component and other related components and classes. -- [Prerequisites](#prerequisites) -- [Install](#install) -- [Activiti Task List](#activiti-task-list) - * [DataColumn Properties](#datacolumn-properties) - * [Events](#events) - * [Properties](#properties) -- [Activiti Task Details](#activiti-task-details) - * [Properties](#properties-1) - * [Events](#events-1) - * [Custom 'empty Activiti Task Details' template](#custom-empty-activiti-task-details-template) +- [Activiti Task List component](#activiti-task-list-component) + * [Basic Usage](#basic-usage) + + [Properties](#properties) + + [Events](#events) + * [Details](#details) + + [DataTableAdapter example](#datatableadapter-example) + + [DataColumn Properties](#datacolumn-properties) +- [Activiti Task Details component](#activiti-task-details-component) + * [Basic Usage](#basic-usage-1) + + [Properties](#properties-1) + + [Events](#events-1) + * [Details](#details-1) + + [Custom 'empty Activiti Task Details' template](#custom-empty-activiti-task-details-template) - [Activiti Apps Component](#activiti-apps-component) - * [Properties](#properties-2) - * [Events](#events-2) - * [How filter the activiti apps](#how-filter-the-activiti-apps) -- [Activiti Filter](#activiti-filter) - * [Properties](#properties-3) - * [Events](#events-3) - * [How filter the activiti task filters](#how-filter-the-activiti-task-filters) - * [FilterParamsModel](#filterparamsmodel) - * [How to create an accordion menu with the task filter](#how-to-create-an-accordion-menu-with-the-task-filter) + * [Basic Usage](#basic-usage-2) + + [Properties](#properties-2) + + [Events](#events-2) + * [Details](#details-2) + + [How filter the activiti apps](#how-filter-the-activiti-apps) +- [Activiti Filter component](#activiti-filter-component) + * [Basic Usage](#basic-usage-3) + + [Properties](#properties-3) + + [Events](#events-3) + * [Details](#details-3) + + [How filter the activiti task filters](#how-filter-the-activiti-task-filters) + + [FilterParamsModel](#filterparamsmodel) + + [How to create an accordion menu with the task filter](#how-to-create-an-accordion-menu-with-the-task-filter) - [Activiti Checklist Component](#activiti-checklist-component) - * [Properties](#properties-4) + * [Basic Usage](#basic-usage-4) + + [Properties](#properties-4) - [Task Attachment List Component](#task-attachment-list-component) - * [Properties](#properties-5) - * [Events](#events-4) + * [Basic Usage](#basic-usage-5) + + [Properties](#properties-5) + + [Events](#events-4) - [Create Task Attachment Component](#create-task-attachment-component) - * [Properties](#properties-6) + * [Basic Usage](#basic-usage-6) + + [Properties](#properties-6) + [Events](#events-5) -- [Activiti Task Header](#activiti-task-header) - * [Properties](#properties-7) - * [Events](#events-6) -- [TaskDetailsModel](#taskdetailsmodel) +- [Activiti Task Header component](#activiti-task-header-component) + * [Basic Usage](#basic-usage-7) + + [Properties](#properties-7) + + [Events](#events-6) + * [Details](#details-4) + + [TaskDetailsModel](#taskdetailsmodel) - [Task People Component](#task-people-component) - * [Properties](#properties-8) + * [Basic Usage](#basic-usage-8) + + [Properties](#properties-8) + [Events](#events-7) + * [Details](#details-5) + [How to customize the people component behavior](#how-to-customize-the-people-component-behavior) + [Involve People single click and close search](#involve-people-single-click-and-close-search) + [Involve People single click without close search](#involve-people-single-click-without-close-search) + [Involve People double click and close search](#involve-people-double-click-and-close-search) + [Involve People double double without close search](#involve-people-double-double-without-close-search) - [ADF Comments Component](#adf-comments-component) - * [Properties](#properties-9) + * [Basic Usage](#basic-usage-9) + + [Properties](#properties-9) + [Events](#events-8) - [Start Task Component](#start-task-component) - * [Properties](#properties-10) + * [Basic Usage](#basic-usage-10) + + [Properties](#properties-10) + [Events](#events-9) -- [Task Audit Directive](#task-audit-directive) - * [Properties](#properties-11) +- [People Search component](#people-search-component) + * [Basic Usage](#basic-usage-11) + + [Properties](#properties-11) + [Events](#events-10) -- [People Search](#people-search) - * [Properties](#properties-12) - * [Events](#events-11) - * [How to use](#how-to-use) -- [Build from sources](#build-from-sources) -- [NPM scripts](#npm-scripts) -- [Demo](#demo) -- [License](#license) + * [Details](#details-6) +- [Task Audit Directive](#task-audit-directive) + * [Basic Usage](#basic-usage-12) + + [Properties](#properties-12) + + [Events](#events-11) +- [Project Information](#project-information) + * [Prerequisites](#prerequisites) + * [Install](#install) + * [Build from sources](#build-from-sources) + * [NPM scripts](#npm-scripts) + * [Demo](#demo) + * [License](#license) -Displays lists of process instances both active and completed, using any defined process filter, and -render details of any chosen instance. +## Activiti Task List component -## Prerequisites +Renders a list containing all the tasks matched by the parameters specified. -Before you start using this development framework, make sure you have installed all required software and done all the -necessary configuration [prerequisites](https://github.com/Alfresco/alfresco-ng2-components/blob/master/PREREQUISITES.md). - -> If you plan using this component with projects generated by Angular CLI, please refer to the following article: [Using ADF with Angular CLI](https://github.com/Alfresco/alfresco-ng2-components/wiki/Angular-CLI) - -## Install - -```sh -npm install ng2-activiti-tasklist -``` - -## Activiti Task List - -This component renders a list containing all the tasks matched by the parameters specified. +### Basic Usage ```html ``` -### DataColumn Properties +#### Properties + +| Name | Type | Default | Description | +| --- | --- | --- | --- | +| appId | string || The id of the app. | +| processDefinitionKey | string || The processDefinitionKey of the process. | +| processInstanceId | string || The processInstanceId of the process. | +| assignment | string || The assignment of the process.
    Possible values are:
  • assignee : where the current user is the assignee
  • candidate: where the current user is a task candidate
  • group_x: where the task is assigned to a group where the current user is a member of.
  • no value: where the current user is involved
| +| state | string || Define state of the processes. Possible values are: `completed`, `active` | +| hasIcon | boolean | true | Toggle the icon on the left . | +| landingTaskId | string | | Define which task id should be selected after the reloading. If the task id doesn't exist or nothing is passed it will select the first task | +| sort | string | | Define the sort of the processes. Possible values are : `created-desc`, `created-asc`, `due-desc`, `due-asc` | +| data | DataTableAdapter | | JSON object that represent the number and the type of the columns that you want show (see the [example](#datatableadapter-example) section below) | + +#### Events + +| Name | Description | +| --- | --- | +| onSuccess | Raised when the task list is loaded | +| rowClick | Raised when the task in the list is clicked | + +### Details + +This component displays lists of process instances both active and completed, using any defined process filter, and +render details of any chosen instance. + +#### DataTableAdapter example + +```json +[ + {"type": "text", "key": "id", "title": "Id"}, + {"type": "text", "key": "name", "title": "Name", "cssClass": "full-width name-column", "sortable": true}, + {"type": "text", "key": "formKey", "title": "Form Key", "sortable": true}, + {"type": "text", "key": "created", "title": "Created", "sortable": true} +] +``` + +#### DataColumn Properties Here's the list of available properties you can define for a Data Column definition. @@ -120,41 +166,11 @@ Here's the list of available properties you can define for a Data Column definit | sr-title | string | | Screen reader title, used for accessibility purposes | | class | string | | Additional CSS class to be applied to column (header and cells) | -### Events +## Activiti Task Details component -| Name | Description | -| --- | --- | -| onSuccess | Raised when the task list is loaded | -| rowClick | Raised when the task in the list is clicked | +Shows the details of the task id passed in input -### Properties - -| Name | Type | Default | Description | -| --- | --- | --- | --- | -| appId | string || The id of the app. | -| processDefinitionKey | string || The processDefinitionKey of the process. | -| processInstanceId | string || The processInstanceId of the process. | -| assignment | string || The assignment of the process.
    Possible values are:
  • assignee : where the current user is the assignee
  • candidate: where the current user is a task candidate
  • group_x: where the task is assigned to a group where the current user is a member of.
  • no value: where the current user is involved
| -| state | string || Define state of the processes. Possible values are: `completed`, `active` | -| hasIcon | boolean | true | Toggle the icon on the left . | -| landingTaskId | string | | Define which task id should be selected after the reloading. If the task id doesn't exist or nothing is passed it will select the first task | -| sort | string | | Define the sort of the processes. Possible values are : `created-desc`, `created-asc`, `due-desc`, `due-asc` | -| data | DataTableAdapter | | JSON object that represent the number and the type of the columns that you want show | - -Example: - -```json -[ - {"type": "text", "key": "id", "title": "Id"}, - {"type": "text", "key": "name", "title": "Name", "cssClass": "full-width name-column", "sortable": true}, - {"type": "text", "key": "formKey", "title": "Form Key", "sortable": true}, - {"type": "text", "key": "created", "title": "Created", "sortable": true} -] -``` - -## Activiti Task Details - -The component shows the details of the task id passed in input +### Basic Usage ```html ``` -### Properties +#### Properties | Name | Type | Default | Description | | --- | --- | --- | --- | @@ -181,7 +197,7 @@ The component shows the details of the task id passed in input | showChecklist | boolean | true | Toggle `Checklist` feature for Header component | | fieldValidators | FormFieldValidator[] | [] | Field validators for use with the form. | -### Events +#### Events | Name | Description | | --- | --- | @@ -192,7 +208,9 @@ The component shows the details of the task id passed in input | executeOutcome | Raised when any outcome is executed, default behaviour can be prevented via `event.preventDefault()` | | onError | Raised at any error | -### Custom 'empty Activiti Task Details' template +### Details + +#### Custom 'empty Activiti Task Details' template By default the Activiti Task Details provides the following message for the empty task details: @@ -217,7 +235,9 @@ Note that can put any HTML content as part of the template, including other Angu ## Activiti Apps Component -The component shows all the available apps. +Shows all available apps. + +### Basic Usage ```html ``` -### Properties +#### Properties | Name | Type | Description | | --- | --- | --- | | layoutType | string | (**required**) Define the layout of the apps. There are two possible values: GRID or LIST. | | filtersAppId | Object | Provide a way to filter the apps to show. | -### Events +#### Events | Name | Description | | --- | --- | | appClick | Raised when an app entry is clicked | -### How filter the activiti apps +### Details + +#### How filter the activiti apps If you want to show some specific apps you can specify them through the filtersAppId parameters @@ -267,15 +289,17 @@ You can use inside the filter one of the following property } ``` -## Activiti Filter +## Activiti Filter component -The component shows all the available filters. +Shows all available filters. + +### Basic Usage ```html ``` -### Properties +#### Properties | Name | Type | Description | | --- | --- | --- | @@ -286,7 +310,7 @@ The component shows all the available filters. If both `appId` and `appName` are specified then `appName` will take precedence and `appId` will be ignored. -### Events +#### Events | Name | Description | | --- | --- | @@ -294,7 +318,9 @@ If both `appId` and `appName` are specified then `appName` will take precedence | onSuccess | Raised when the list is loaded | | onError | Raised if there is an error during the loading | -### How filter the activiti task filters +### Details + +#### How filter the activiti task filters ```html ``` -### Properties +#### Properties | Name | Type | Description | | --- | --- | --- | @@ -363,9 +391,12 @@ The component shows the checklist task functionality. | readOnlyForm | boolean | Toggle readonly state of the form. Enforces all form widgets render readonly if enabled. | | assignee | string | (**required**) The assignee id where the subtasks are assigned to. | + ## Task Attachment List Component -This component displays attached documents on a specified task +Displays attached documents on a specified task + +### Basic Usage ```html ``` -### Properties +#### Properties | Name | Type | Default | Description | | --- | --- | --- | --- | @@ -437,13 +471,18 @@ The purpose of the component is to populate the local variable called `propertie ![adf-task-header](docs/assets/adf-task-header.png) -### Events +#### Events | Name | Description | | --- | --- | | claim | Raised when the task is claimed. | -## TaskDetailsModel +### Details + +The purpose of the component is to populate the local variable called `properties` (array of CardViewModel), with all the information that we want to display. + + +#### TaskDetailsModel ```json { @@ -457,7 +496,9 @@ The purpose of the component is to populate the local variable called `propertie ## Task People Component -This component displays involved users to a specified task +Displays involved users to a specified task + +### Basic Usage ```html +``` + +#### Properties + +| Name | Type | Description | +| --- | --- | --- | +| results | Observable | The params to show people list | + +#### Events + +| Name | Description | +| --- | --- | +| searchPeople | Raised when the search people with new keyword | +| success | Raised when select the user and click action button | +| closeSearch | Raised when click the clse button | + +### Details + + ```html + + {{ 'TASK_DETAILS.LABELS.ADD_PEOPLE' | translate }} + {{ 'PEOPLE.ADD_USER' | translate }} + + +``` + ## Task Audit Directive -This directive provide a way to fetch the Task Audit information in the pdf or json format. +Provides a way to fetch the Task Audit information in the pdf or json format. + +### Basic Usage ```html + + + + +``` + +#### Dropdown menu + +You can use the following example to create a dropdown menu: + +```html + + ... + + + + + + + + +``` + +The code above is based on the `` component from the `@angular/material` library. You can use any custom menu component as well. + +![](docs/adf-toolbar-03.png) + +Once you click the menu button you should see the following menu items as defined earlier: + +![](docs/adf-toolbar-04.png) + +#### Custom color + +Besides the default color you can use 'primary', 'accent', or 'warn' values: + +Depending on the overall application theme the colors of the toolbar should change. + +For example: + +![](docs/adf-toolbar-05.png) + +![](docs/adf-toolbar-06.png) + +![](docs/adf-toolbar-07.png) + +## Accordion Component + +Creates an accordion menu, optionally with a custom header and icon. + +### Basic Usage + +```html + + + + + +``` + +```ts +@Component({ + selector: 'my-component' +}) +export class MyComponent implements OnInit { + + titleHeading: string; + + constructor() { + this.titleHeading = 'My Group'; + } + +} +``` + +#### Properties + +| Name | Type | Description | | --- | --- | --- | -| toolbar | toolbar component | [Docs](src/components/toolbar/toolbar.md) | -| node-permission | disable elements based on node permissions | [Docs](src/directives/node-permission.md) +| heading | string | The header title. | +| isSelected | boolean | Define if the accordion group is selected or not. | +| headingIcon | string | The material design icon. | +| hasAccordionIcon | boolean | Define if the accordion (expand) icon needs to be shown or not, the default value is true | + +## Card View component + +Displays a configurable property list renderer. + +![adf-custom-view](docs/assets/adf-custom-view.png) + +### Basic Usage + +```html + + + +``` + +#### Properties + +| Name | Type | Description | +| --- | --- | --- | +| properties | [CardViewItem](#cardviewitem)[] | (**required**) The custom view to render | +| editable | boolean | If the component editable or not | + +### Details + +You define the property list, the CardViewComponent does the rest. Each property represents a card view item (a row) in the card view component. At the time of writing two different kind of card view item (property type) is supported out of the box ([text](#card-text-item) item and [date](#card-date-item) item) but you can define your own custom types as well. + +#### Editing + +The card view can optionally allow its properties to be edited. You can control the editing of the properties in two level. +- **global level** - *via the editable parameter of the card-view.component* +- **property level** - *in each property via the editable attribute* + +If you set the global editable parameter to false, no properties can be edited regardless of what is set inside the property. + +#### Defining properties + +Properties is an array of models which one by one implements the CardViewItem interface. + +```js +export interface CardViewItem { + label: string; + value: any; + key: string; + default?: any; + type: string; + displayValue: string; + editable?: boolean; +} +``` + +At the moment three models are defined out of the box: + +- **[CardViewTextItemModel](#card-text-item)** - *for text items* +- **[CardViewMapItemModel](#card-map-item)** - *for map items* +- **[CardViewDateItemModel](#card-date-item)** - *for date items* + +Each of them are extending the abstract CardViewBaseItemModel class, and each of them are adding some custom functionality to the basic behaviour. + +```js + this.properties = [ + new CardViewTextItemModel({ + label: 'Name', + value: 'Spock', + key: 'name', + default: 'default bar' , + multiline: false + }), + new CardViewMapItemModel({ + label: 'My map', + value: new Map([['999', 'My Value']]), + key: 'map', + default: 'default map value' , + clickable: true + }), + new CardViewDateItemModel({ + label: 'Birth of date', + value: someDate, + key: 'birth-of-date', + default: new Date(), + format: '', + editable: true + }), + ... +] +``` + +##### Card Text Item + +CardViewTextItemModel is a property type for text properties. + +```js +const textItemProperty = new CardViewTextItemModel(options); +``` + +| Name | Type | Default | Description | +| --- | --- | --- | --- | +| label* | string | --- | The label to render | +| value* | any | --- | The original value | +| key* | string | --- | the key of the property. Have an important role when editing the property. | +| default | any | --- | The default value to render in case the value is empty | +| displayValue* | string | --- | The value to render | +| editable | boolean | false | Whether the property editable or not | +| clickable | boolean | false | Whether the property clickable or not | +| multiline | string | false | Single or multiline text | + +##### Card Map Item + +CardViewMapItemModel is a property type for map properties. + +```js +const mapItemProperty = new CardViewMapItemModel(options); +``` + +| Name | Type | Default | Description | +| --- | --- | --- | --- | +| label* | string | --- | The label to render | +| value* | Map | --- | A map that contains the key value pairs | +| key* | string | --- | the key of the property. Have an important role when editing the property. | +| default | any | --- | The default value to render in case the value is empty | +| displayValue* | string | --- | The value to render | +| clickable | boolean | false | Whether the property clickable or not | + +##### Card Date Item + +CardViewDateItemModel is a property type for date properties. + +```js +const dateItemProperty = new CardViewDateItemModel(options); +``` + +| Name | Type | Default | Description | +| --- | --- | --- | --- | +| label* | string | --- | The label to render | +| value* | any | --- | The original value | +| key* | string | --- | the key of the property. Have an important role when editing the property. | +| default | any | --- | The default value to render in case the value is empty | +| displayValue* | string | --- | The value to render | +| editable | boolean | false | Whether the property editable or not | +| format | boolean | "MMM DD YYYY" | any format that momentjs accepts | + +#### Defining your custom card Item + +Card item components are loaded dynamically, which makes you able to define your own custom component for the custom card item type. + +Let's consider you want to have a **stardate** type to display Captain Picard's birthday (47457.1). For this, you need to do the following steps. + +##### 1. Define the model for the custom type + +Your model has to extend the CardViewBaseItemModel and implement the CardViewItem interface. +*(You can check how the CardViewTextItemModel is implemented for further guidance.)* + +```js +export class CardViewStarDateItemModel extends CardViewBaseItemModel implements CardViewItem { + type: string = 'star-date'; + + get displayValue() { + return this.convertToStarDate(this.value) || this.default; + } + + private convertToStarDate(starTimeStamp: number): string { + // Do the magic + } +} +``` + +The most important part of this model is the value of the **type** attribute. This is how the Card View component will be able to recognise which component is needed to render it dynamically. + +The type is a **hyphen-separated-lowercase-words** string (just like how I wrote it). This will be converted to a PascalCase (or UpperCamelCase) string to find the right component. In our case the Card View component will look for the CardView**StarDate**ItemComponent. + +##### 2. Define the component for the custom type + +As discussed in the previous step the only important thing here is the naming of your component class ( **CardViewStarDateItemComponent**). Since the selector is not used in this case, you can give any selector name to it, but it makes sense to follow the angular standards. + +```js +@Component({ + selector: 'card-view-stardateitem' // For example + ... +}) +export class CardViewStarDateItemComponent { + @Input() + property: CardViewStarDateItemModel; + + @Input() + editable: boolean; + + constructor(private cardViewUpdateService: CardViewUpdateService) {} + + isEditble() { + return this.editable && this.property.editable; + } + + showStarDatePicker() { + ... + } +} + +``` +To make your component editable, you can have a look on either the CardViewTextItemComponent' or on the CardViewDateItemComponent's source. + +##### 3. Add you custom component to your module's entryComponents list + +For Angular to be able to load your custom component dynamically, you have to register your component in your modules entryComponents. + +```js +@NgModule({ + imports: [...], + declarations: [ + CardViewStarDateItemComponent + ], + entryComponents: [ + CardViewStarDateItemComponent + ], + exports: [...] +}) +export class MyModule {} +``` + +## Node Permission directive + +Selectively disables an HTML element or Angular component + +### Basic Usage + +#### Properties + +| Name | Type | Default | Description | +| --- | --- | --- | --- | +| adf-node-permission | [Permissions](https://github.com/Alfresco/alfresco-ng2-components/blob/master/ng2-components/ng2-alfresco-core/src/models/permissions.enum.ts) | null | Node permission to check (create, delete, update, updatePermissions, !create, !delete, !update, !updatePermissions)| +| adf-nodes | MinimalNodeEntity[] | [] | Nodes to check permission for | + +### Details + +The `NodePermissionDirective` allows you to disable an HTML element or Angular component +by taking a collection of the `MinimalNodeEntity` instances and checking the particular permission. + +The decorated element will be disabled if: + +- there are no nodes in the collection +- at least one of the nodes has no expected permission + +#### HTML element example + +The best example to show `NodePermissionDirective` in action is by binding DocumentList selection property to a toolbar button. + +For example the "Delete" button should be disabled if no selection is present or if user has no rights to delete at least one node in the selection. + +```html + + + + + + ... + +``` + +The button will become disabled by default, and is going to change its state once user selects/unselects one or multiple documents that current user has permission to delete. + +#### Angular component example + +You can apply the directive on any angular component which implements the NodePermissionSubject interface. The upload drag area component can be a good candidate, since this one implements that interface. Applying the directive on an angular component is pretty much the same as applying it on an html element. + +```html + + ... + +``` + +When designing a component you want to work this directive with, you have two important things to care about. + +#### Implementing the NodePermissionSubject interface + +The component has to implement the NodePermissionSubject interface which basically means it has to have a boolean **disabled** property. This is the property which will be set by the directive. + +```js +import { NodePermissionSubject } from 'ng2-alfresco-core'; + +@Component({...}) +export class UploadDragAreaComponent implements NodePermissionSubject { + public disabled: boolean = false; +} +``` + +#### Defining your components as an EXTENDIBLE_COMPONENT parent component + +The directive will look up the component in the dependency injection tree, up to at most one step above the current DI level (@Host). Because of this, you have to provide your component with forward referencing as the EXTENDIBLE_COMPONENT. + +```js +import { EXTENDIBLE_COMPONENT } from 'ng2-alfresco-core'; + +@Component({ + ... + providers: [ + { provide: EXTENDIBLE_COMPONENT, useExisting: forwardRef(() => UploadDragAreaComponent)} + ] +}) +export class UploadDragAreaComponent implements NodePermissionSubject { ... } +``` ## Upload Directive Allows your components or common HTML elements reacting on File drag and drop in order to upload content. -Used by attaching to an element or component. ### Basic usage @@ -131,7 +569,11 @@ You can decorate any element including buttons, for example: ``` -### Modes +### Details + +Used by attaching to an element or component. + +#### Modes Directive supports several modes: @@ -146,7 +588,7 @@ It is also possible combining modes together.
...
``` -#### Click mode +##### Click mode For the click mode you can provide additional attributes for the File Dialog: @@ -168,12 +610,12 @@ For the click mode you can provide additional attributes for the File Dialog: ``` -#### Drop mode +##### Drop mode For the moment upload directive supports only Files (single or multiple). Support for Folders and `accept` filters is subject to implement. -### Events +#### Events Once a single or multiple files are dropped on the decorated element the `upload-files` [CustomEvent](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent) is raised. The DOM event is configured to have `bubbling` enabled, so any component up the component tree can handle, process or prevent it: @@ -227,7 +669,7 @@ detail: { } ``` -### Styling +#### Styling The decorated element gets `adf-upload__dragging` CSS class name in the class list every time files are dragged over it. This allows changing look and feel of your components in case additional visual indication is required, @@ -256,10 +698,52 @@ for example you may want drawing a dashed border around the table row on drag: } ``` +## Context Menu directive + +### Basic Usage + +```html + + +``` + +```ts +@Component({ + selector: 'my-component' +}) +export class MyComponent implements OnInit { + + menuItems: any[]; + + constructor() { + this.menuItems = [ + { title: 'Item 1', subject: new Subject() }, + { title: 'Item 2', subject: new Subject() }, + { title: 'Item 3', subject: new Subject() } + ]; + } + + ngOnInit() { + this.menuItems.forEach(l => l.subject.subscribe(item => this.commandCallback(item))); + } + + commandCallback(item) { + alert(`Executing ${item.title} command.`); + } + +} +``` + +### Details + +See **Demo Shell** or **DocumentList** implementation for more details and use cases. + ## Alfresco Api Service Provides access to initialized **AlfrescoJSApi** instance. +### Basic Usage + ```ts export class MyComponent implements OnInit { @@ -276,6 +760,8 @@ export class MyComponent implements OnInit { } ``` +### Details + **Note for developers**: _the TypeScript declaration files for Alfresco JS API are still under development and some Alfresco APIs may not be accessed via your favourite IDE's intellisense or TypeScript compiler. @@ -289,11 +775,17 @@ api.nodes.addNode('-root-', body, {}); ## AppConfigService +Supports app configuration settings, stored server side. + +### Details + The `AppConfigService` service provides support for loading and accessing global application configuration settings that you store on the server side in the form of a JSON file. -> You may need this service when deploying your ADF-based application to production servers. -> There can be more than one server running web apps with different settings, like different addresses for Alfresco Content/Process services. -> Or there is a need to change global settings for all the clients. +You may need this service when deploying your ADF-based application to production servers. + +There can be more than one server running web apps with different settings, like different addresses for Alfresco Content/Process services. + +Or there is a need to change global settings for all the clients. The service is already pre-configured to look for the "app.config.json" file in the application root address. @@ -357,7 +849,7 @@ export class AppComponent { Your custom components can also benefit from the `AppConfigService`, you can put an unlimited number of settings and optionally a nested JSON hierarchy. -### Different configurations based on environment settings +#### Different configurations based on environment settings The CoreModule allows you to provide custom application configuration path. That means you can evaluate the final file name based on conditions, for example environment settings: @@ -379,9 +871,9 @@ if (process.env.ENV === 'production') { }) ``` -### Variable substitution in configuration strings +#### Variable substitution in configuration strings -The `AppConfigService` also supports a limited set of variable substitutions to greatly simplify certain scenarios. +The `AppConfigService` also supports a limited set of variable substitutions to greatly simplify certain scenarios. ```json { @@ -400,9 +892,9 @@ The supported variables are: | hostname | `location.hostname` | | port | `location.port` | -### Unit testing +#### Unit testing -You can also provide custom values for the entire service. +You can also provide custom values for the entire service. This might become handy when creating unit tests. ```ts @@ -423,11 +915,14 @@ describe('MyTest', () => { ``` In the example above custom values are applied on the top of all the values the `AppConfigService` has previously loaded. -If there is an 'app.config.json' file loaded at unit test run time then your custom values will overwrite exiting values with the same keys if present. +If there is an 'app.config.json' file loaded at unit test run time then your custom values will overwrite exiting values with the same keys if present. ## User Preferences Service -The `UserPreferencesService` allows you to store preferences for the components. +Stores preferences for components. + +### Details + The preferences are bound to a particular `prefix` so the application can switch between different profiles on demand. For example upon login you can set the `prefix` as current username: @@ -476,6 +971,10 @@ Known properties: ## Notification Service +Shows a notification message with optional feedback. + +### Details + The Notification Service is implemented on top of the Angular 2 Material Design snackbar. Use this service to show a notification message, and optionally get feedback from it. @@ -484,13 +983,13 @@ import { NotificationService } from 'ng2-alfresco-core'; export class MyComponent implements OnInit { - constructor(private notificationService: NotificationService) { + constructor(private notificationService: NotificationService) { } ngOnInit() { this.notificationService.openSnackMessage('test', 200000).afterDismissed().subscribe(() => { console.log('The snack-bar was dismissed'); - }); + }); } } ``` @@ -500,7 +999,7 @@ import { NotificationService } from 'ng2-alfresco-core'; export class MyComponent implements OnInit { - constructor(private notificationService: NotificationService) { + constructor(private notificationService: NotificationService) { } ngOnInit() { @@ -511,88 +1010,11 @@ export class MyComponent implements OnInit { } ``` -## Context Menu directive - -_See **Demo Shell** or **DocumentList** implementation for more details and use cases._ - -```html - - -``` - -```ts -@Component({ - selector: 'my-component' -}) -export class MyComponent implements OnInit { - - menuItems: any[]; - - constructor() { - this.menuItems = [ - { title: 'Item 1', subject: new Subject() }, - { title: 'Item 2', subject: new Subject() }, - { title: 'Item 3', subject: new Subject() } - ]; - } - - ngOnInit() { - this.menuItems.forEach(l => l.subject.subscribe(item => this.commandCallback(item))); - } - - commandCallback(item) { - alert(`Executing ${item.title} command.`); - } - -} -``` - -## Accordion Component - -The component provides a way to easily create an accordion menu. You can customize the header and the icon. - -```html - - - - - -``` - -```ts -@Component({ - selector: 'my-component' -}) -export class MyComponent implements OnInit { - - titleHeading: string; - - constructor() { - this.titleHeading = 'My Group'; - } - -} -``` - -### Properties - -| Name | Type | Description | -| --- | --- | --- | -| heading | string | The header title. | -| isSelected | boolean | Define if the accordion group is selected or not. | -| headingIcon | string | The material design icon. | -| hasAccordionIcon | boolean | Define if the accordion (expand) icon needs to be shown or not, the default value is true | - ## Authentication Service -The authentication service is used inside the [login component](../ng2-alfresco-login) and is possible to find there an example of how to use it. +Provides authentication for use with the Login component. -### Events - -| Name | Description | -| --- | --- | -| onLogin | Raised when user logs in | -| onLogout | Raised when user logs out | +### Basic Usage **app.component.ts** @@ -614,227 +1036,24 @@ export class AppComponent { } ``` -## ADF Card View +#### Events -The CardViewComponent is a configurable property list renderer. You define the property list, the CardViewComponent does the rest. Each property represents a card view item (a row) in the card view component. At the time of writing two different kind of card view item (property type) is supported out of the box ([text](#card-text-item) item and [date](#card-date-item) item) but you can define your own custom types as well. +| Name | Description | +| --- | --- | +| onLogin | Raised when user logs in | +| onLogout | Raised when user logs out | -```html - - +### Details -``` +The authentication service is used inside the [login component](../ng2-alfresco-login) and is possible to find there an example of how to use it. -![adf-custom-view](docs/assets/adf-custom-view.png) +## Translation service -### Properties +Supports localisation. -| Name | Type | Description | -| --- | --- | --- | -| properties | [CardViewItem](#cardviewitem)[] | (**required**) The custom view to render | -| editable | boolean | If the component editable or not | +### Details -### Editing - -The card view can optionally allow its properties to be edited. You can control the editing of the properties in two level. -- **global level** - *via the editable parameter of the card-view.component* -- **property level** - *in each property via the editable attribute* - -If you set the global editable parameter to false, no properties can be edited regardless of what is set inside the property. - -### Defining properties - -Properties is an array of models which one by one implements the CardViewItem interface. - -```js -export interface CardViewItem { - label: string; - value: any; - key: string; - default?: any; - type: string; - displayValue: string; - editable?: boolean; -} -``` - -At the moment three models are defined out of the box: - -- **[CardViewTextItemModel](#card-text-item)** - *for text items* -- **[CardViewMapItemModel](#card-map-item)** - *for map items* -- **[CardViewDateItemModel](#card-date-item)** - *for date items* - -Each of them are extending the abstract CardViewBaseItemModel class, and each of them are adding some custom functionality to the basic behaviour. - -```js - this.properties = [ - new CardViewTextItemModel({ - label: 'Name', - value: 'Spock', - key: 'name', - default: 'default bar' , - multiline: false - }), - new CardViewMapItemModel({ - label: 'My map', - value: new Map([['999', 'My Value']]), - key: 'map', - default: 'default map value' , - clickable: true - }), - new CardViewDateItemModel({ - label: 'Birth of date', - value: someDate, - key: 'birth-of-date', - default: new Date(), - format: '', - editable: true - }), - ... -] -``` - -### Card Text Item - -CardViewTextItemModel is a property type for text properties. - -```js -const textItemProperty = new CardViewTextItemModel(options); -``` - -#### Options - -| Name | Type | Default | Description | -| --- | --- | --- | --- | -| label* | string | --- | The label to render | -| value* | any | --- | The original value | -| key* | string | --- | the key of the property. Have an important role when editing the property. | -| default | any | --- | The default value to render in case the value is empty | -| displayValue* | string | --- | The value to render | -| editable | boolean | false | Whether the property editable or not | -| clickable | boolean | false | Whether the property clickable or not | -| multiline | string | false | Single or multiline text | - -### Card Map Item - -CardViewMapItemModel is a property type for map properties. - -```js -const mapItemProperty = new CardViewMapItemModel(options); -``` - -#### Options - -| Name | Type | Default | Description | -| --- | --- | --- | --- | -| label* | string | --- | The label to render | -| value* | Map | --- | A map that contains the key value pairs | -| key* | string | --- | the key of the property. Have an important role when editing the property. | -| default | any | --- | The default value to render in case the value is empty | -| displayValue* | string | --- | The value to render | -| clickable | boolean | false | Whether the property clickable or not | - -### Card Date Item - -CardViewDateItemModel is a property type for date properties. - -```js -const dateItemProperty = new CardViewDateItemModel(options); -``` - -#### Options - -| Name | Type | Default | Description | -| --- | --- | --- | --- | -| label* | string | --- | The label to render | -| value* | any | --- | The original value | -| key* | string | --- | the key of the property. Have an important role when editing the property. | -| default | any | --- | The default value to render in case the value is empty | -| displayValue* | string | --- | The value to render | -| editable | boolean | false | Whether the property editable or not | -| format | boolean | "MMM DD YYYY" | any format that momentjs accepts | - -### Defining your custom card Item - -Card item components are loaded dynamically, which makes you able to define your own custom component for the custom card item type. - -Let's consider you want to have a **stardate** type to display Captain Picard's birthday (47457.1). For this, you need to do the following steps. - -#### 1. Define the model for the custom type - -Your model has to extend the CardViewBaseItemModel and implement the CardViewItem interface. -*(You can check how the CardViewTextItemModel is implemented for further guidance.)* - -```js -export class CardViewStarDateItemModel extends CardViewBaseItemModel implements CardViewItem { - type: string = 'star-date'; - - get displayValue() { - return this.convertToStarDate(this.value) || this.default; - } - - private convertToStarDate(starTimeStamp: number): string { - // Do the magic - } -} -``` - -The most important part of this model is the value of the **type** attribute. This is how the Card View component will be able to recognise which component is needed to render it dynamically. - -The type is a **hyphen-separated-lowercase-words** string (just like how I wrote it). This will be converted to a PascalCase (or UpperCamelCase) string to find the right component. In our case the Card View component will look for the CardView**StarDate**ItemComponent. - -#### 2. Define the component for the custom type - -As discussed in the previous step the only important thing here is the naming of your component class ( **CardViewStarDateItemComponent**). Since the selector is not used in this case, you can give any selector name to it, but it makes sense to follow the angular standards. - -```js -@Component({ - selector: 'card-view-stardateitem' // For example - ... -}) -export class CardViewStarDateItemComponent { - @Input() - property: CardViewStarDateItemModel; - - @Input() - editable: boolean; - - constructor(private cardViewUpdateService: CardViewUpdateService) {} - - isEditble() { - return this.editable && this.property.editable; - } - - showStarDatePicker() { - ... - } -} - -``` -To make your component editable, you can have a look on either the CardViewTextItemComponent' or on the CardViewDateItemComponent's source. - -#### 3. Add you custom component to your module's entryComponents list - -For Angular to be able to load your custom component dynamically, you have to register your component in your modules entryComponents. - -```js -@NgModule({ - imports: [...], - declarations: [ - CardViewStarDateItemComponent - ], - entryComponents: [ - CardViewStarDateItemComponent - ], - exports: [...] -}) -export class MyModule {} -``` - -## TranslationService - -### Registering translation sources +#### Registering translation sources In order to enable localisation support you will need to create a `/resources/i18n/en.json` file and register its parent `i18n` folder with your component or application module. @@ -870,7 +1089,7 @@ assets/ng2-alfresco-core/i18n/en.json You can register as many entries as you would like. -### Switching languages +#### Switching languages Depending on your application, you may want to have buttons or dropdown menus to allow language selection for the end users. @@ -894,7 +1113,22 @@ class MyComponent { * getRendition(nodeId: string, encoding: string) * isRenditionAvailable(nodeId: string, encoding: string) -## Build from sources +## Project Information + +### Prerequisites + +Before you start using this development framework, make sure you have installed all required software and done all the +necessary configuration, see this [page](https://github.com/Alfresco/alfresco-ng2-components/blob/master/PREREQUISITES.md). + +> If you plan using this component with projects generated by Angular CLI, please refer to the following article: [Using ADF with Angular CLI](https://github.com/Alfresco/alfresco-ng2-components/wiki/Angular-CLI) + +### Install + +```sh +npm install ng2-alfresco-core +``` + +### Build from sources You can build component from sources with the following commands: @@ -906,7 +1140,7 @@ npm run build > The `build` task rebuilds all the code, runs tslint, license checks > and other quality check tools before performing unit testing. -## NPM scripts +### NPM scripts | Command | Description | | --- | --- | @@ -915,7 +1149,7 @@ npm run build | npm run test-browser | Run unit tests in the browser | npm run coverage | Run unit tests and display code coverage report | -## Demo +### Demo Please check the demo folder for a demo project @@ -925,6 +1159,6 @@ npm install npm start ``` -## License +### License [Apache Version 2.0](https://github.com/Alfresco/alfresco-ng2-components/blob/master/LICENSE) diff --git a/ng2-components/ng2-alfresco-core/docs/adf-toolbar-01.png b/ng2-components/ng2-alfresco-core/docs/adf-toolbar-01.png new file mode 100644 index 0000000000..ca81330cd2 Binary files /dev/null and b/ng2-components/ng2-alfresco-core/docs/adf-toolbar-01.png differ diff --git a/ng2-components/ng2-alfresco-core/docs/adf-toolbar-02.png b/ng2-components/ng2-alfresco-core/docs/adf-toolbar-02.png new file mode 100644 index 0000000000..1e81967f3e Binary files /dev/null and b/ng2-components/ng2-alfresco-core/docs/adf-toolbar-02.png differ diff --git a/ng2-components/ng2-alfresco-core/docs/adf-toolbar-03.png b/ng2-components/ng2-alfresco-core/docs/adf-toolbar-03.png new file mode 100644 index 0000000000..97c19d094e Binary files /dev/null and b/ng2-components/ng2-alfresco-core/docs/adf-toolbar-03.png differ diff --git a/ng2-components/ng2-alfresco-core/docs/adf-toolbar-04.png b/ng2-components/ng2-alfresco-core/docs/adf-toolbar-04.png new file mode 100644 index 0000000000..526349285e Binary files /dev/null and b/ng2-components/ng2-alfresco-core/docs/adf-toolbar-04.png differ diff --git a/ng2-components/ng2-alfresco-core/docs/adf-toolbar-05.png b/ng2-components/ng2-alfresco-core/docs/adf-toolbar-05.png new file mode 100644 index 0000000000..98a00a8984 Binary files /dev/null and b/ng2-components/ng2-alfresco-core/docs/adf-toolbar-05.png differ diff --git a/ng2-components/ng2-alfresco-core/docs/adf-toolbar-06.png b/ng2-components/ng2-alfresco-core/docs/adf-toolbar-06.png new file mode 100644 index 0000000000..6b57d21e13 Binary files /dev/null and b/ng2-components/ng2-alfresco-core/docs/adf-toolbar-06.png differ diff --git a/ng2-components/ng2-alfresco-core/docs/adf-toolbar-07.png b/ng2-components/ng2-alfresco-core/docs/adf-toolbar-07.png new file mode 100644 index 0000000000..25034ab23e Binary files /dev/null and b/ng2-components/ng2-alfresco-core/docs/adf-toolbar-07.png differ diff --git a/ng2-components/ng2-alfresco-datatable/README.md b/ng2-components/ng2-alfresco-datatable/README.md index 931ab619f1..45aed6c134 100644 --- a/ng2-components/ng2-alfresco-datatable/README.md +++ b/ng2-components/ng2-alfresco-datatable/README.md @@ -1,58 +1,57 @@ -# DataTable Component +# DataTable library + +Contains the DataTable component and other related components and classes. -- [Prerequisites](#prerequisites) -- [Install](#install) -- [Basic usage](#basic-usage) - * [DataTable Properties](#datatable-properties) - * [DataColumn Properties](#datacolumn-properties) - * [DataTable Events](#datatable-events) - * [DataTable DOM Events](#datatable-dom-events) - * [Automatic column header translation](#automatic-column-header-translation) - * [Custom tooltips](#custom-tooltips) - * [Custom Empty content template](#custom-empty-content-template) - * [Custom Empty content template](#custom-empty-content-template-1) - * [Loading content template](#loading-content-template) - * [Column Templates](#column-templates) - * [Events](#events) - + [rowClick event](#rowclick-event) - + [rowDblClick event](#rowdblclick-event) - + [showRowContextMenu event](#showrowcontextmenu-event) - + [showRowActionsMenu event](#showrowactionsmenu-event) - + [executeRowAction event](#executerowaction-event) -- [Data sources](#data-sources) -- [Generate schema](#generate-schema) +- [DataTable component](#datatable-component) + * [Basic usage](#basic-usage) + + [Properties](#properties) + + [Events](#events) + * [Details](#details) + + [DataColumn Properties](#datacolumn-properties) + + [DataTable DOM Events](#datatable-dom-events) + + [Automatic column header translation](#automatic-column-header-translation) + + [Custom tooltips](#custom-tooltips) + + [Custom Empty content template](#custom-empty-content-template) + + [Loading content template](#loading-content-template) + + [Column Templates](#column-templates) + + [Events](#events-1) + - [rowClick event](#rowclick-event) + - [rowDblClick event](#rowdblclick-event) + - [showRowContextMenu event](#showrowcontextmenu-event) + - [showRowActionsMenu event](#showrowactionsmenu-event) + - [executeRowAction event](#executerowaction-event) + + [Data sources](#data-sources) + + [Generate schema](#generate-schema) - [Pagination Component](#pagination-component) - * [Properties](#properties) - * [Events](#events-1) -- [Build from sources](#build-from-sources) -- [NPM scripts](#npm-scripts) -- [Demo](#demo) -- [License](#license) + * [Basic Usage](#basic-usage) + + [Properties](#properties-1) + + [Events](#events-2) + * [Details](#details-1) +- [Project Information](#project-information) + * [Prerequisites](#prerequisites) + * [Install](#install) + * [Build from sources](#build-from-sources) + * [NPM scripts](#npm-scripts) + * [Demo](#demo) + * [License](#license) +## DataTable component + +Displays data as a table with customizable columns and presentation. + +![DataTable demo](docs/assets/datatable-demo.png) + See it live: [DataTable Quickstart](https://embed.plnkr.co/80qr4YFBeHjLMdAV0F6l/) -## Prerequisites - -Before you start using this development framework, make sure you have installed all required software and done all the -necessary configuration, see this [page](https://github.com/Alfresco/alfresco-ng2-components/blob/master/PREREQUISITES.md). - -> If you plan using this component with projects generated by Angular CLI, please refer to the following article: [Using ADF with Angular CLI](https://github.com/Alfresco/alfresco-ng2-components/wiki/Angular-CLI) - -## Install - -```sh -npm install ng2-alfresco-datatable -``` - -## Basic usage +### Basic usage **app.component.html** @@ -99,8 +98,6 @@ export class DataTableDemo { } ``` -![DataTable demo](docs/assets/datatable-demo.png) - You can also use HTML-based schema declaration like shown below: ```html @@ -146,7 +143,7 @@ export class DataTableDemo { } ``` -### DataTable Properties +#### Properties | Name | Type | Default | Description | | --- | --- | --- | --- | @@ -165,9 +162,19 @@ export class DataTableDemo { | showHeader | boolean | true | Toggles header visibility | | selection | DataRow[] | [] | Contains selected rows | -### DataColumn Properties +#### Events -Here's the list of available properties you can define for a Data Column definition. +| Name | Description +| --- | --- | +| [rowClick](#rowclick-event) | Emitted when user clicks the row | +| [rowDblClick](#rowdblclick-event) | Emitted when user double-clicks the row | +| [showRowContextMenu](#showrowcontextmenu-event) | Emitted before context menu is displayed for a row | +| [showRowActionsMenu](#showrowactionsmenu-event) | Emitted before actions menu is displayed for a row | +| [executeRowAction](#executerowaction-event) | Emitted when row action is executed by user | + +### Details + +#### DataColumn Properties | Name | Type | Default | Description | | --- | --- | --- | --- | @@ -181,17 +188,7 @@ Here's the list of available properties you can define for a Data Column definit | class | string | | Additional CSS class to be applied to column (header and cells) | | formatTooltip | Function | | Custom tooltip formatter function. | -### DataTable Events - -| Name | Description -| --- | --- | -| [rowClick](#rowclick-event) | Emitted when user clicks the row | -| [rowDblClick](#rowdblclick-event) | Emitted when user double-clicks the row | -| [showRowContextMenu](#showrowcontextmenu-event) | Emitted before context menu is displayed for a row | -| [showRowActionsMenu](#showrowactionsmenu-event) | Emitted before actions menu is displayed for a row | -| [executeRowAction](#executerowaction-event) | Emitted when row action is executed by user | - -### DataTable DOM Events +#### DataTable DOM Events Below are the DOM events raised by DataTable component. These events bubble up the component tree and can be handled by any parent component. @@ -221,7 +218,7 @@ onRowClick(event) { ![](docs/assets/datatable-dom-events.png) -### Automatic column header translation +#### Automatic column header translation You can also use i18n resource keys with DataColumn `title` property. The component will automatically check the corresponding i18n resources and fetch corresponding value. @@ -235,7 +232,7 @@ The component will automatically check the corresponding i18n resources and fetc This feature is optional. Regular text either plain or converted via the `translate` pipe will still be working as it was before. -### Custom tooltips +#### Custom tooltips You can create custom tooltips for the table cells by providing a `formatTooltip` property with a tooltip formatter function when declaring a data column. @@ -268,7 +265,7 @@ export class MyComponent { To disable the tooltip your function can return `null` or an empty string. -### Custom Empty content template +#### Custom Empty content template You can add a template that will be shown when there are no results in your datatable: @@ -294,9 +291,7 @@ You can add a template that will be shown when there are no results in your data ``` -### Custom Empty content template - -You can use the empty list component if you want to show the default ADF empty template: +You can use the empty list component if you want to show the default ADF empty template. You can use any HTML layout or Angular component as a content of the empty template section by using the special `, , ` elements: @@ -330,7 +325,7 @@ You can use any HTML layout or Angular component as a content of the empty templ ![](docs/assets/adf-empty-list.png) -### Loading content template +#### Loading content template You can add a template that will be shown during the loading of your data: @@ -368,7 +363,7 @@ You can add a template that will be shown during the loading of your data: Note: the `` and `` can be used together -### Column Templates +#### Column Templates It is possible to assign a custom column template like the following: @@ -414,11 +409,11 @@ In the second case `entry` variable is holding a reference to the following data } ``` -### Events +#### Events -#### rowClick event +##### rowClick event -_This event is emitted when user clicks the row._ +Emitted when user clicks a row. Event properties: @@ -436,11 +431,11 @@ onRowClicked(event: DataRowEvent) { } ``` -_This event is cancellable, you can use `event.preventDefault()` to prevent default behaviour._ +This event is cancellable, you can use `event.preventDefault()` to prevent default behaviour. -#### rowDblClick event +##### rowDblClick event -_This event is emitted when user double-clicks the row._ +Emitted when user double-clicks a row. Event properties: @@ -458,11 +453,11 @@ onRowDblClicked(event: DataRowEvent) { } ``` -_This event is cancellable, you can use `event.preventDefault()` to prevent default behaviour._ +This event is cancellable, you can use `event.preventDefault()` to prevent default behaviour. -#### showRowContextMenu event +##### showRowContextMenu event -_Emitted before context menu is displayed for a row._ +Emitted before context menu is displayed for a row. Note that DataTable itself does not populate context menu items, you can provide all necessary content via handler. @@ -488,17 +483,17 @@ onShowRowContextMenu(event: DataCellEvent) { } ``` -_This event is cancellable, you can use `event.preventDefault()` to prevent default behaviour._ +This event is cancellable, you can use `event.preventDefault()` to prevent default behaviour. DataTable will automatically render provided menu items. -_Please refer to [ContextMenu](https://www.npmjs.com/package/ng2-alfresco-core) -documentation for more details on context actions format and behaviour._ +See the [ContextMenu](https://www.npmjs.com/package/ng2-alfresco-core) +documentation for more details on context actions format and behaviour. -#### showRowActionsMenu event +##### showRowActionsMenu event -_Emitted before actions menu is displayed for a row. -Requires `actions` property to be set to `true`._ +Emitted before actions menu is displayed for a row. +Requires `actions` property to be set to `true`. Event properties: @@ -512,11 +507,11 @@ value: { Note that DataTable itself does not populate action menu items, you can provide all necessary content via handler. -_This event is cancellable, you can use `event.preventDefault()` to prevent default behaviour._ +This event is cancellable, you can use `event.preventDefault()` to prevent default behaviour. -#### executeRowAction event +##### executeRowAction event -_Emitted when row action is executed by user._ +Emitted when a row action is executed by the user. Usually accompanies `showRowActionsMenu` event. DataTable itself does not execute actions but provides support for external @@ -566,7 +561,7 @@ Once corresponding action is clicked in the dropdown menu DataTable invokes `exe where you can handle the process, inspect the action payload and all custom properties defined earlier, and do corresponding actions. -## Data sources +#### Data sources DataTable component gets data by means of data adapter. It is possible having data retrieved from different kinds of sources by implementing @@ -634,7 +629,7 @@ let data = new ObjectDataTableAdapter( ); ``` -## Generate schema +#### Generate schema It is possible to auto generate your schema if you have only the data row @@ -667,29 +662,67 @@ let schema = ObjectDataTableAdapter.generateSchema(data); ## Pagination Component +Adds pagination to the component it is used with. + +![](docs/assets/basic.png) + +### Basic Usage + +```html + + +``` + +#### Properties + +| Name | Type | Default | Description | +| --- | --- | --- | --- | +| pagination | Pagination | | Pagination object | +| supportedPageSizes | Array<number> | [ 25, 50, 100 ] | An array of page sizes | + +#### Events + +| Name | Type | Description | +| --- | --- | --- | +| change | EventEmitter<PaginationQueryParams> | Triggered for any action in pagination | +| nextPage | EventEmitter<Pagination> | Triggered on next page action | +| prevPage | EventEmitter<Pagination> | Triggered on previous page action | +| changePageSize | EventEmitter<Pagination> | Triggered on page size change action | +| changePageNumber | EventEmitter<Pagination> | Triggered on page change action | + +### Details + The pagination object is a generic component to paginate component. The Alfresco API are paginated and return a Pagination object. You can use the pagination object to feed the pagination component and then listen to the event which returns the current pagination and query again the API with the options chosen by the user. -![DataTable demo](docs/assets/pagination-demo.png) +Each event helps to detect the certain action that user have made using the component. -### Properties +For `change` event, a [PaginationQueryParams](https://github.com/Alfresco/alfresco-ng2-components/tree/master/ng2-components/ng2-alfresco-core/src/components/pagination/pagination-query-params.ts) (including the query params supported by the REST API, `skipCount` and `maxItems`) is returned. -| Name | Type | Default | Description -| --- | --- | --- | --- | -| supportedPageSizes | numer[] | [5, 10, 20, 50, 100] | This array describes the set of options shown in the pick list | -| maxItems | boolean | false | Max number of elements shown per page. If you pick another size from the pick list this option will be overwritten | -| pagination | Pagination | {count: 0, totalItems: 0, skipCount: 0, maxItems: 20 , hasMoreItems: true} | The Alfresco Api returns a pagination object, you can use it to feed the pagination component, or create your own. | +For all events other than `change`, a new [Pagination object](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-core-rest-api/docs/Pagination.md) is returned as in the folowing example, with updated properties to be used to query further. -### Events +## Project Information -| Name | Description -| --- | --- | -| changePageSize | Emitted when user picks one of the options from the pick list | -| nextPage | Emitted when user clicks next page button | -| prevPage | Emitted when user clicks previous page button | +### Prerequisites -All the events carry with them the current pagination object. +Before you start using this development framework, make sure you have installed all required software and done all the +necessary configuration, see this [page](https://github.com/Alfresco/alfresco-ng2-components/blob/master/PREREQUISITES.md). -## Build from sources +> If you plan using this component with projects generated by Angular CLI, please refer to the following article: [Using ADF with Angular CLI](https://github.com/Alfresco/alfresco-ng2-components/wiki/Angular-CLI) + +### Install + +```sh +npm install ng2-alfresco-datatable +``` + +### Build from sources You can build component from sources with the following commands: @@ -701,7 +734,7 @@ npm run build > The `build` task rebuilds all the code, runs tslint, license checks > and other quality check tools before performing unit testing. -## NPM scripts +### NPM scripts | Command | Description | | --- | --- | @@ -710,7 +743,7 @@ npm run build | npm run test-browser | Run unit tests in the browser | npm run coverage | Run unit tests and display code coverage report | -## Demo +### Demo Please check the demo folder for a demo project @@ -720,6 +753,6 @@ npm install npm start ``` -## License +### License [Apache Version 2.0](https://github.com/Alfresco/alfresco-ng2-components/blob/master/LICENSE) diff --git a/ng2-components/ng2-alfresco-datatable/docs/assets/basic.png b/ng2-components/ng2-alfresco-datatable/docs/assets/basic.png new file mode 100644 index 0000000000..9ceb4da7ab Binary files /dev/null and b/ng2-components/ng2-alfresco-datatable/docs/assets/basic.png differ diff --git a/ng2-components/ng2-alfresco-documentlist/README.md b/ng2-components/ng2-alfresco-documentlist/README.md index abe9c0c7b8..369e7bed35 100644 --- a/ng2-components/ng2-alfresco-documentlist/README.md +++ b/ng2-components/ng2-alfresco-documentlist/README.md @@ -1,42 +1,32 @@ -# DocumentList Component +# DocumentList library + +Contains the Document List component and other related components and classes. -- [Prerequisites](#prerequisites) -- [See also](#see-also) -- [Install](#install) -- [Document List](#document-list) - * [Properties](#properties) - * [Events](#events) - * [DOM Events](#dom-events) - * [Handling DOM events](#handling-dom-events) - * [Data Sources](#data-sources) - + [Node ID](#node-id) - + [Repository aliases](#repository-aliases) - + [DocumentList aliases](#documentlist-aliases) - * [Trashcan](#trashcan) - * [Shared Links](#shared-links) - * [Sites](#sites) - * [Favorites](#favorites) - * [Recent Files](#recent-files) - * [Setting default folder](#setting-default-folder) -- [Custom icons for selected rows](#custom-icons-for-selected-rows) -- [Calling DocumentList api directly](#calling-documentlist-api-directly) -- [Breadcrumb Component](#breadcrumb-component) - * [Properties](#properties-1) - * [Events](#events-1) -- [Dropdown Site Component](#dropdown-site-component) - * [Events](#events-2) -- [Custom columns](#custom-columns) - * [DataColumn Properties](#datacolumn-properties) - * [Column Types](#column-types) - * [Underlying node object](#underlying-node-object) - * [Date Column](#date-column) - * [Location Column](#location-column) - * [Column Template](#column-template) - * [Actions](#actions) +- [Document List component](#document-list-component) + * [Basic Usage](#basic-usage) + + [Properties](#properties) + + [Events](#events) + * [Details](#details) + + [DOM Events](#dom-events) + + [Data Sources](#data-sources) + - [Node ID](#node-id) + - [Repository aliases](#repository-aliases) + - [DocumentList aliases](#documentlist-aliases) + + [Setting default folder](#setting-default-folder) + + [Custom icons for selected rows](#custom-icons-for-selected-rows) + + [Calling DocumentList api directly](#calling-documentlist-api-directly) + + [Custom columns](#custom-columns) + + [DataColumn Properties](#datacolumn-properties) + + [Column Types](#column-types) + + [Underlying node object](#underlying-node-object) + + [Date Column](#date-column) + + [Location Column](#location-column) + + [Column Template](#column-template) + + [Actions](#actions) + [Menu actions](#menu-actions) + [Default action handlers](#default-action-handlers) - [Delete - System handler combined with custom handler](#delete---system-handler-combined-with-custom-handler) @@ -44,11 +34,17 @@ - [Delete - Disable button checking the permission](#delete---disable-button-checking-the-permission) - [Download](#download) - [Copy and move](#copy-and-move) - * [Error, Permission and success callback](#error-permission-and-success-callback) + - [Error, Permission and success callback](#error-permission-and-success-callback) + [Folder actions](#folder-actions) - * [Context Menu](#context-menu) - * [Navigation mode](#navigation-mode) - * [Events](#events-3) + + [Context Menu](#context-menu) + + [Navigation mode](#navigation-mode) +- [Breadcrumb Component](#breadcrumb-component) + * [Basic Usage](#basic-usage-1) + + [Properties](#properties-1) + + [Events](#events-1) +- [Dropdown Site Component](#dropdown-site-component) + * [Basic Usage](#basic-usage-2) + + [Events](#events-2) - [Advanced usage and customization](#advanced-usage-and-customization) * [Custom tooltips](#custom-tooltips) * [Custom row filter](#custom-row-filter) @@ -58,33 +54,23 @@ + [Examples](#examples) * [Custom 'empty folder' template](#custom-empty-folder-template) * [Customizing default actions](#customizing-default-actions) -- [Build from sources](#build-from-sources) -- [NPM scripts](#npm-scripts) -- [Demo](#demo) -- [License](#license) +- [See also](#see-also) +- [Project Information](#project-information) + * [Prerequisites](#prerequisites) + * [Install](#install) + * [NPM scripts](#npm-scripts) + * [Demo](#demo) + * [License](#license) -## Prerequisites +## Document List component -Before you start using this development framework, make sure you have installed all required software and done all the -necessary configuration [prerequisites](https://github.com/Alfresco/alfresco-ng2-components/blob/master/PREREQUISITES.md). +Displays the documents from a repository. -> If you plan using this component with projects generated by Angular CLI, please refer to the following article: [Using ADF with Angular CLI](https://github.com/Alfresco/alfresco-ng2-components/wiki/Angular-CLI) - -## See also - -- [Walkthrough: adding indicators to clearly highlight information about a node](docs/metadata-indicators.md) - -## Install - -```sh -npm install ng2-alfresco-documentlist -``` - -## Document List +### Basic Usage ```html ``` -### Properties +#### Properties The properties currentFolderId, folderNode and node are the entry initialization properties of the document list. They cannot be used together, choose the one that suites more your use case. @@ -124,20 +110,24 @@ The properties currentFolderId, folderNode and node are the entry initialization | sorting | string[] | | Defines default sorting. The format is an array of 2 strings `[key, direction]` i.e. `['name', 'desc']` or `['name', 'asc']`. Set this value only if you want to override default sorting detected by the component based on columns. | | locationFormat | string | '/' | The default route for all the location-based columns (if declared). | -### Events +#### Events | Name | Description | | --- | --- | -| `nodeClick` | Emitted when user clicks the node | -| `nodeDblClick` | Emitted when user double-clicks the node | -| `folderChange` | Emitted upon display folder changed | -| `preview` | Emitted when document preview is requested either with single or double click | +| nodeClick | emitted when user clicks a list node | +| nodeDblClick | emitted when user double-clicks list node | +| folderChange | emitted once current display folder has changed | +| preview | emitted when user acts upon files with either single or double click (depends on `navigation-mode`), recommended for Viewer components integration | +| permissionError | emitted when user is attempting to create a folder via action menu without having the permission to do it | +| ready | emitted when the documentList is ready and loads all the elements| -_For a complete example source code please refer to +### Details + +For a complete example source code, refer to the [DocumentList Demo](https://github.com/Alfresco/alfresco-ng2-components/tree/master/ng2-components/ng2-alfresco-documentlist/demo) -repository._ +repository. -### DOM Events +#### DOM Events Below are the DOM events the DocumentList component emits. All of them are `bubbling`, meaning you can handle them in any component up the parent hierarchy, even if DocumentList is wrapped by another component(s). @@ -160,13 +150,11 @@ Every event is represented by a [CustomEvent](https://developer.mozilla.org/en/d Please refer to the DataTable documentation to find details about additional DOM events the DocumentList component bubbles up from the DataTable. -### Handling DOM events - -Here's a basic example on handling DOM events in the parent elements: +Below is a basic example of handling DOM events in the parent elements. ```html
+(node-dblclick)="onNodeDblClicked($event)">
@@ -177,15 +165,15 @@ Here's a basic example on handling DOM events in the parent elements:
``` -### Data Sources +#### Data Sources For the Document List data sources you can use one of the following options: -#### Node ID +##### Node ID The unique identifier of the Node. Gets automatically updated when you perform navigation to other folders. -#### Repository aliases +##### Repository aliases You can use one of the well-known reserved aliases: @@ -193,7 +181,7 @@ You can use one of the well-known reserved aliases: - `-shared-` - `-my-` -#### DocumentList aliases +##### DocumentList aliases The DocumentList component also provides support for the following reserved aliases you can use: @@ -222,7 +210,7 @@ The default column layout for non-reserved views is: - Modified (date) - Modified by -### Trashcan +__Trashcan__ ```html - -``` - -***Note:*** the `` and `` are the same component you can still use the old tag name - -![Breadcrumb](docs/assets/breadcrumb.png) - -### Properties - -| Name | Type | Description | -| --- | --- | --- | -| target | DocumentListComponent | (optional) DocumentList component to operate with. Upon clicks will instruct the given component to update. | -| folderNode | [MinimalNodeEntryEntity](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-core-rest-api/docs/NodeMinimalEntry.md) | Active node, builds UI based on `folderNode.path.elements` collection. | -| root | String | (optional) Name of the root element of the breadcrumb. You can use this property to rename "Company Home" to "Personal Files" for example. | - -### Events - -| Name | Returned Type | Description | -| --- | --- | --- | -| navigate | [PathElementEntity](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-core-rest-api/docs/PathElementEntity.md) | emitted when user clicks on a breadcrumb | - -## Dropdown Site Component - -DocumentList now provides a simple dropdown component to show and interact with the sites of the current user. - -```html - - -``` -![Dropdown sites](docs/assets/document-list-dropdown-list.png) - -### Events - -| Name | Returned Type | Description | -| --- | --- | --- | -| change | [SiteModel](https://github.com/Alfresco/alfresco-ng2-components/blob/development/ng2-components/ng2-alfresco-documentlist/src/models/site.model.ts) | emitted when user selects a site. When default option is selected an empty model is emitted | - -## Custom columns +#### Custom columns It is possible to reorder, extend or completely redefine data columns displayed by the component. By default special `$thumbnail` and `displayName` columns are rendered. @@ -576,7 +518,7 @@ You can also use HTML-based schema declaration used by DataTable, TaskList and o ``` -### DataColumn Properties +#### DataColumn Properties Here's the list of available properties you can define for a Data Column definition. @@ -592,7 +534,7 @@ Here's the list of available properties you can define for a Data Column definit | class | string | | Additional CSS class to be applied to column (header and cells) | | formatTooltip | Function | | Custom tooltip formatter function. | -### Column Types +#### Column Types The DataColumn `type` property can take one of the following values: @@ -602,7 +544,7 @@ The DataColumn `type` property can take one of the following values: - fileSize - location -### Underlying node object +#### Underlying node object DocumentList component assigns an instance of `MinimalNode` type (`alfresco-js-api`) as a data context of each row. @@ -647,7 +589,7 @@ Here's a short example: ``` -### Date Column +#### Date Column For `date` column type the [DatePipe](https://angular.io/docs/ts/latest/api/common/DatePipe-class.html) formatting is used. For a full list of available `format` values please refer to [DatePipe](https://angular.io/docs/ts/latest/api/common/DatePipe-class.html) documentation. @@ -655,7 +597,7 @@ For a full list of available `format` values please refer to [DatePipe](https:// ADF also supports additional `timeAgo` value for the `format` property. That triggers the date values to be rendered using popular ["Time from now"](https://momentjs.com/docs/#/displaying/fromnow/) format. -### Location Column +#### Location Column This column is used to display a clickable location link pointing to the parent path of the node. @@ -695,7 +637,7 @@ All links rendered in the column above will have an address mapped to `/files`: ... ``` -### Column Template +#### Column Template It is possible to provide custom column/cell template that may contain other Angular components or HTML elements: @@ -770,7 +712,7 @@ In the Example below we will add the [ng2-alfresco-tag](https://www.npmjs.com/pa ![Tag component in document List](docs/assets/document-list-tag-template.png) -### Actions +#### Actions Properties: @@ -982,7 +924,7 @@ Shows the destination chooser dialog for copy and move actions. By default the d ``` -###### Error, Permission and success callback +##### Error, Permission and success callback Defining error, permission and success callbacks are pretty much the same as doing it for the delete permission handling. @@ -1044,7 +986,7 @@ export class MyView { ![Folder Actions](docs/assets/folder-actions.png) -### Context Menu +#### Context Menu DocumentList also provides integration for 'Context Menu Service' from the [ng2-alfresco-core](https://www.npmjs.com/package/ng2-alfresco-core) library. @@ -1070,7 +1012,7 @@ export class MyView { This enables context menu items for documents and folders. -### Navigation mode +#### Navigation mode By default DocumentList component uses 'double-click' mode for navigation. That means user will see the contents of the folder by double-clicking its name @@ -1090,18 +1032,56 @@ The following example switches navigation to single clicks: ``` -### Events +## Breadcrumb Component -DocumentList emits the following events: +Indicates the current position within a navigation hierarchy. -| Name | Description | -| --- | --- | -| nodeClick | emitted when user clicks a list node | -| nodeDblClick | emitted when user double-clicks list node | -| folderChange | emitted once current display folder has changed | -| preview | emitted when user acts upon files with either single or double click (depends on `navigation-mode`), recommended for Viewer components integration | -| permissionError | emitted when user is attempting to create a folder via action menu without having the permission to do it | -| ready | emitted when the documentList is ready and loads all the elements| +![Breadcrumb](docs/assets/breadcrumb.png) + +### Basic Usage + +```html + + +``` + +***Note:*** the `` and `` are the same component - you can still use the old tag name. + +#### Properties + +| Name | Type | Description | +| --- | --- | --- | +| target | DocumentListComponent | (optional) DocumentList component to operate with. Upon clicks will instruct the given component to update. | +| folderNode | [MinimalNodeEntryEntity](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-core-rest-api/docs/NodeMinimalEntry.md) | Active node, builds UI based on `folderNode.path.elements` collection. | +| root | String | (optional) Name of the root element of the breadcrumb. You can use this property to rename "Company Home" to "Personal Files" for example. | + +#### Events + +| Name | Returned Type | Description | +| --- | --- | --- | +| navigate | [PathElementEntity](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-core-rest-api/docs/PathElementEntity.md) | emitted when user clicks on a breadcrumb | + +## Dropdown Site Component + +Displays a dropdown menu to show and interact with the sites of the current user. + +![Dropdown sites](docs/assets/document-list-dropdown-list.png) + +### Basic Usage + +```html + + +``` + +#### Events + +| Name | Returned Type | Description | +| --- | --- | --- | +| change | [SiteModel](https://github.com/Alfresco/alfresco-ng2-components/blob/development/ng2-components/ng2-alfresco-documentlist/src/models/site.model.ts) | emitted when user selects a site. When default option is selected an empty model is emitted | ## Advanced usage and customization @@ -1456,7 +1436,25 @@ export class MyView { Typically you may want populating all your custom actions at the application root level or by means of custom application service. -## Build from sources +## See also + +- [Walkthrough: adding indicators to clearly highlight information about a node](docs/metadata-indicators.md) + +## Project Information + +### Prerequisites + +Before you start using this development framework, make sure you have installed all required software and done all the +necessary configuration [prerequisites](https://github.com/Alfresco/alfresco-ng2-components/blob/master/PREREQUISITES.md). + +> If you plan using this component with projects generated by Angular CLI, please refer to the following article: [Using ADF with Angular CLI](https://github.com/Alfresco/alfresco-ng2-components/wiki/Angular-CLI) + +### Install + +```sh +npm install ng2-alfresco-documentlist + +### Build from sources You can build component from sources with the following commands: @@ -1468,7 +1466,7 @@ npm run build > The `build` task rebuilds all the code, runs tslint, license checks > and other quality check tools before performing unit testing. -## NPM scripts +### NPM scripts | Command | Description | | --- | --- | @@ -1477,7 +1475,7 @@ npm run build | npm run test-browser | Run unit tests in the browser | npm run coverage | Run unit tests and display code coverage report | -## Demo +### Demo Please check the demo folder for a demo project @@ -1487,6 +1485,6 @@ npm install npm start ``` -## License +### License [Apache Version 2.0](https://github.com/Alfresco/alfresco-ng2-components/blob/master/LICENSE) diff --git a/ng2-components/ng2-alfresco-login/README.md b/ng2-components/ng2-alfresco-login/README.md index a03852dc64..bf16091d02 100644 --- a/ng2-components/ng2-alfresco-login/README.md +++ b/ng2-components/ng2-alfresco-login/README.md @@ -1,47 +1,39 @@ -# Login Component +# Login library + +Contains the Login component. -- [Prerequisites](#prerequisites) -- [Install](#install) -- [Basic usage](#basic-usage) -- [Properties](#properties) -- [Events](#events) -- [Change footer content](#change-footer-content) -- [Change header content](#change-header-content) -- [Extra content](#extra-content) -- [Custom logo and background](#custom-logo-and-background) -- [Customize Validation rules](#customize-validation-rules) -- [Controlling form submit execution behaviour](#controlling-form-submit-execution-behaviour) -- [Build from sources](#build-from-sources) -- [NPM scripts](#npm-scripts) -- [Demo](#demo) -- [License](#license) +- [Login component](#login-component) + * [Basic usage](#basic-usage) + + [Properties](#properties) + + [Events](#events) + * [Details](#details) + + [Change footer content](#change-footer-content) + + [Change header content](#change-header-content) + + [Extra content](#extra-content) + + [Custom logo and background](#custom-logo-and-background) + + [Customize Validation rules](#customize-validation-rules) + + [Controlling form submit execution behaviour](#controlling-form-submit-execution-behaviour) +- [Project Information](#project-information) + * [Prerequisites](#prerequisites) + * [Install](#install) + * [Build from sources](#build-from-sources) + * [NPM scripts](#npm-scripts) + * [Demo](#demo) + * [License](#license) -## Prerequisites +## Login component -Before you start using this development framework, make sure you have installed all required software and done all the -necessary configuration, see this [page](https://github.com/Alfresco/alfresco-ng2-components/blob/master/PREREQUISITES.md). +Authenticates to Alfresco Content Services and Alfresco Process Services. -> If you plan using this component with projects generated by Angular CLI, please refer to the following article: [Using ADF with Angular CLI](https://github.com/Alfresco/alfresco-ng2-components/wiki/Angular-CLI) - -See it live: [Login Quickstart](http://embed.plnkr.co/PfZytJyHcl3xIsa8pdMo/) - -## Install - -```sh -npm install ng2-alfresco-login -``` - -## Basic usage - -This component allows to authenticate to Alfresco Content Services and Alfresco Process Services. +### Basic usage **app.component.html** @@ -68,7 +60,7 @@ export class AppComponent { } ``` -## Properties +#### Properties | Name | Type | Default Value | Description | | --- | --- | --- | --- | @@ -83,7 +75,7 @@ export class AppComponent { | showRememberMe | boolean | false | Toggle `Remember me` checkbox visibility | | showLoginActions | boolean | false | Toggle extra actions visibility (`Need Help`, `Register`, etc.) | -## Events +#### Events | Name | Description | | --- | --- | @@ -91,7 +83,9 @@ export class AppComponent { | onError | Raised when the login fails | | executeSubmit | Raised when the form is submitted | -## Change footer content +### Details + +#### Change footer content @@ -103,7 +97,7 @@ You can replace the entire content in the footer of the login component with you ` ``` -## Change header content +#### Change header content @@ -115,7 +109,7 @@ You can replace the entire content in the header of the login component with you ` ``` -## Extra content +#### Extra content You can put additional html content between `alfresco-login` tags to get it rendered as part of the login dialog. This becomes handy in case you need to extend it with custom input fields handled by your application or parent component: @@ -132,7 +126,7 @@ Here's an example of custom content: -## Custom logo and background +#### Custom logo and background It is possible changing logo and background images to custom values. @@ -156,7 +150,7 @@ Alternatively you can bind to your component properties and provide values dynam ``` -## Customize Validation rules +#### Customize Validation rules If needed it is possible to customise the validation rules of the login form. You can add/modify the default rules of the login form. @@ -194,7 +188,7 @@ export class MyCustomLogin { } ``` -## Controlling form submit execution behaviour +#### Controlling form submit execution behaviour If absolutely needed it is possible taking full control over form submit execution by means of `executeSubmit` event. @@ -236,7 +230,24 @@ export class MyCustomLogin { **Please note that if `event.preventDefault()` is not called then default behaviour will also be executed after your custom code.** -## Build from sources +## Project Information + +### Prerequisites + +Before you start using this development framework, make sure you have installed all required software and done all the +necessary configuration, see this [page](https://github.com/Alfresco/alfresco-ng2-components/blob/master/PREREQUISITES.md). + +> If you plan using this component with projects generated by Angular CLI, please refer to the following article: [Using ADF with Angular CLI](https://github.com/Alfresco/alfresco-ng2-components/wiki/Angular-CLI) + +See it live: [Login Quickstart](http://embed.plnkr.co/PfZytJyHcl3xIsa8pdMo/) + +### Install + +```sh +npm install ng2-alfresco-login +``` + +### Build from sources You can build component from sources with the following commands: @@ -248,7 +259,7 @@ npm run build > The `build` task rebuilds all the code, runs tslint, license checks > and other quality check tools before performing unit testing. -## NPM scripts +### NPM scripts | Command | Description | | --- | --- | @@ -257,7 +268,7 @@ npm run build | npm run test-browser | Run unit tests in the browser | npm run coverage | Run unit tests and display code coverage report | -## Demo +### Demo Please check the demo folder for a demo project @@ -267,6 +278,6 @@ npm install npm start ``` -## License +### License [Apache Version 2.0](https://github.com/Alfresco/alfresco-ng2-components/blob/master/LICENSE) diff --git a/ng2-components/ng2-alfresco-search/README.md b/ng2-components/ng2-alfresco-search/README.md index 3070403dd4..77df2b6c11 100644 --- a/ng2-components/ng2-alfresco-search/README.md +++ b/ng2-components/ng2-alfresco-search/README.md @@ -1,40 +1,36 @@ -# Search Component +# Search library + +Contains the Search and Search Results components. -- [Prerequisites](#prerequisites) -- [Install](#install) -- [Basic usage](#basic-usage) -- [Properties](#properties) -- [Events](#events) -- [Basic usage Search results](#basic-usage-search-results) - * [Properties](#properties-1) - * [Events](#events-1) -- [Build from sources](#build-from-sources) -- [NPM scripts](#npm-scripts) -- [Demo](#demo) -- [License](#license) +- [Search component](#search-component) + * [Basic usage](#basic-usage) + + [Properties](#properties) + + [Events](#events) + * [Details](#details) +- [Search Results component](#search-results-component) + * [Basic usage](#basic-usage-1) + + [Properties](#properties-1) + + [Events](#events-1) + * [Details](#details-1) +- [Project Information](#project-information) + * [Prerequisites](#prerequisites) + * [Install](#install) + * [Build from sources](#build-from-sources) + * [NPM scripts](#npm-scripts) + * [Demo](#demo) + * [License](#license) -## Prerequisites +## Search component -Before you start using this development framework, make sure you have installed all required software and done all the -necessary configuration, see this [page](https://github.com/Alfresco/alfresco-ng2-components/blob/master/PREREQUISITES.md). - -> If you plan using this component with projects generated by Angular CLI, please refer to the following article: [Using ADF with Angular CLI](https://github.com/Alfresco/alfresco-ng2-components/wiki/Angular-CLI) - -## Install - -```sh -npm install ng2-alfresco-search -``` - -## Basic usage +### Basic usage ```html ``` -Example of a component that uses the search control. In this example the search term is simply logged to the console -but instead the component could emit an event to be consumed upstream, or it could trigger a change inside a search -results component embedded inside the same component. - -## Properties +#### Properties | Name | Type | Default | Description | | --- | --- | --- | --- | @@ -65,7 +57,7 @@ results component embedded inside the same component. | liveSearchMaxResults | number | 5 | Maximum number of results to show in the live search. | | liveSearchResultSort | string | | Criteria to sort live search results by, must be one of "name" , "modifiedAt" or "createdAt" | -## Events +#### Events | Name | Description | | --- | --- | @@ -74,7 +66,25 @@ results component embedded inside the same component. | fileSelect | Emitted when a file item from the list of find-as-you-type results is selected | | expand | Emitted when the expanded state of the control changes based on focus events and the content of the input control | -## Basic usage Search results +### Details + +```html + + +``` + +Example of a component that uses the search control. In this example the search term is simply logged to the console +but instead the component could emit an event to be consumed upstream, or it could trigger a change inside a search +results component embedded inside the same component. + +## Search Results component + +### Basic usage ```html ``` -Example of a component that displays search results, using the Angular2 router to supply a 'q' parameter containing the -search term. If no router is present on the page or if the router does not provide such parameter then an empty -results page will be shown. - -### Properties +#### Properties | Name | Type | Default | Description | | --- | --- | --- | --- | @@ -98,7 +104,7 @@ results page will be shown. | navigationMode | string | "dblclick" | Event used to initiate a navigation action to a specific result, one of "click" or "dblclick" | | navigate | boolean | true | Allow documentlist to navigate or not. For more information see documentlist component's documentation | -### Events +#### Events | Name | Description | | --- | --- | @@ -106,7 +112,34 @@ results page will be shown. | nodeDbClick | Emitted when user acts upon files or folders with double click **only when `navigation-mode` is set to false**, giving more freedom then just simply previewing the file | | resultsLoad | Emitted when search results have fully loaded | -## Build from sources +### Details + +```html + + +``` + +Example of a component that displays search results, using the Angular2 router to supply a 'q' parameter containing the +search term. If no router is present on the page or if the router does not provide such parameter then an empty +results page will be shown. + +## Project Information + +### Prerequisites + +Before you start using this development framework, make sure you have installed all required software and done all the +necessary configuration, see this [page](https://github.com/Alfresco/alfresco-ng2-components/blob/master/PREREQUISITES.md). + +> If you plan using this component with projects generated by Angular CLI, please refer to the following article: [Using ADF with Angular CLI](https://github.com/Alfresco/alfresco-ng2-components/wiki/Angular-CLI) + +### Install + +```sh +npm install ng2-alfresco-search +``` + +### Build from sources You can build component from sources with the following commands: @@ -118,7 +151,7 @@ npm run build > The `build` task rebuilds all the code, runs tslint, license checks > and other quality check tools before performing unit testing. -## NPM scripts +### NPM scripts | Command | Description | | --- | --- | @@ -127,7 +160,7 @@ npm run build | npm run test-browser | Run unit tests in the browser | npm run coverage | Run unit tests and display code coverage report | -## Demo +### Demo Please check the demo folder for a demo project @@ -137,6 +170,6 @@ npm install npm start ``` -## License +### License [Apache Version 2.0](https://github.com/Alfresco/alfresco-ng2-components/blob/master/LICENSE) diff --git a/ng2-components/ng2-alfresco-social/README.md b/ng2-components/ng2-alfresco-social/README.md index 1ea0e855b6..52ca2d68df 100644 --- a/ng2-components/ng2-alfresco-social/README.md +++ b/ng2-components/ng2-alfresco-social/README.md @@ -1,68 +1,58 @@ -# Alfresco Social Component +# Alfresco Social library + +Contains the ADF Like and ADF Rating components. -- [Prerequisites](#prerequisites) -- [Install](#install) -- [Basic usage](#basic-usage) -- [adf-like](#adf-like) - * [Properties](#properties) - * [Events](#events) -- [adf-rating](#adf-rating) - * [Properties](#properties-1) - * [Events](#events-1) -- [Build from sources](#build-from-sources) -- [NPM scripts](#npm-scripts) -- [Demo](#demo) -- [License](#license) +- [ADF Like component](#adf-like-component) + * [Basic Usage](#basic-usage) + + [Properties](#properties) + + [Events](#events) +- [ADF Rating component](#adf-rating-component) + * [Basic Usage](#basic-usage-1) + + [Properties](#properties-1) + + [Events](#events-1) +- [Project Information](#project-information) + * [Prerequisites](#prerequisites) + * [Install](#install) + * [Build from sources](#build-from-sources) + * [NPM scripts](#npm-scripts) + * [Demo](#demo) + * [License](#license) -## Prerequisites +## ADF Like component -Before you start using this development framework, make sure you have installed all required software and done all the -necessary configuration [prerequisites](https://github.com/Alfresco/alfresco-ng2-components/blob/master/PREREQUISITES.md). +![Custom columns](docs/assets/social1.png) -> If you plan using this component with projects generated by Angular CLI, please refer to the following article: [Using ADF with Angular CLI](https://github.com/Alfresco/alfresco-ng2-components/wiki/Angular-CLI) - -## Install - -```sh -npm install ng2-alfresco-social -``` - -## Basic usage - -In this component there are two different components: - -* adf-like -* adf-rating - -## adf-like +### Basic Usage ```html ``` -### Properties +#### Properties | Attribute | Type | Default | Description | | --- | --- | --- | --- | | nodeId | string | | The identifier of a node.| -### Events +#### Events | Name | Description | | --- | --- | | changeVote | Raised when vote gets changed | -![Custom columns](docs/assets/social1.png) +## ADF Rating component -## adf-rating +![Custom columns](docs/assets/social2.png) + +### Basic Usage ```html ``` -### Properties +#### Properties | Attribute | Type | Default | Description | | --- | --- | --- | --- | | nodeId | string | | The identifier of a node | -### Events +#### Events | Name | Description | | --- | --- | | changeVote | Raised when vote gets changed | -![Custom columns](docs/assets/social2.png) +## Project Information -## Build from sources +### Prerequisites + +Before you start using this development framework, make sure you have installed all required software and done all the +necessary configuration [prerequisites](https://github.com/Alfresco/alfresco-ng2-components/blob/master/PREREQUISITES.md). + +> If you plan using this component with projects generated by Angular CLI, please refer to the following article: [Using ADF with Angular CLI](https://github.com/Alfresco/alfresco-ng2-components/wiki/Angular-CLI) + +### Install + +```sh +npm install ng2-alfresco-social +``` + +### Build from sources You can build component from sources with the following commands: @@ -96,7 +99,7 @@ npm run build > The `build` task rebuilds all the code, runs tslint, license checks > and other quality check tools before performing unit testing. -## NPM scripts +### NPM scripts | Command | Description | | --- | --- | @@ -105,7 +108,7 @@ npm run build | npm run test-browser | Run unit tests in the browser | npm run coverage | Run unit tests and display code coverage report | -## Demo +### Demo Please check the demo folder for a demo project @@ -115,6 +118,6 @@ npm install npm start ``` -## License +### License [Apache Version 2.0](https://github.com/Alfresco/alfresco-ng2-components/blob/master/LICENSE) diff --git a/ng2-components/ng2-alfresco-tag/README.md b/ng2-components/ng2-alfresco-tag/README.md index 6a7a12e3b0..c5227a5de0 100644 --- a/ng2-components/ng2-alfresco-tag/README.md +++ b/ng2-components/ng2-alfresco-tag/README.md @@ -1,48 +1,35 @@ # Alfresco Tag Component +Contains the Alfresco Tag Node Actions list, Tag List and Node List components. + -- [Prerequisites](#prerequisites) -- [Install](#install) -- [Basic usage](#basic-usage) -- [alfresco-tag-node-actions-list](#alfresco-tag-node-actions-list) - * [Properties](#properties) -- [alfresco-tag-node-list](#alfresco-tag-node-list) - * [Properties](#properties-1) -- [alfresco-tag-list](#alfresco-tag-list) -- [Build from sources](#build-from-sources) -- [NPM scripts](#npm-scripts) -- [Demo](#demo) -- [License](#license) +- [Alfresco Tag Node Actions List component](#alfresco-tag-node-actions-list-component) + * [Basic Usage](#basic-usage) + + [Properties](#properties) +- [Alfresco Tag Node List component](#alfresco-tag-node-list-component) + * [Basic Usage](#basic-usage-1) + + [Properties](#properties-1) +- [Alfresco Tag List component](#alfresco-tag-list-component) +- [Project Information](#project-information) + * [Prerequisites](#prerequisites) + * [Install](#install) + * [Build from sources](#build-from-sources) + * [NPM scripts](#npm-scripts) + * [Demo](#demo) + * [License](#license) -## Prerequisites +## Alfresco Tag Node Actions List component -Before you start using this development framework, make sure you have installed all required software and done all the -necessary configuration [prerequisites](https://github.com/Alfresco/alfresco-ng2-components/blob/master/PREREQUISITES.md). +![Custom columns](docs/assets/tag3.png) -> If you plan using this component with projects generated by Angular CLI, please refer to the following article: [Using ADF with Angular CLI](https://github.com/Alfresco/alfresco-ng2-components/wiki/Angular-CLI) - -## Install - -```sh -npm install ng2-alfresco-tag -``` - -## Basic usage - -In this component there are three different tags: - -* alfresco-tag-node-actions-list -* alfresco-tag-list -* alfresco-tag-node-list - -## alfresco-tag-node-actions-list +### Basic Usage ```html ``` -### Properties +#### Properties | Attribute | Type | Default | Description | | --- | --- | --- | --- | | nodeId | string | | The identifier of a node | -![Custom columns](docs/assets/tag3.png) +## Alfresco Tag Node List component -## alfresco-tag-node-list +### Basic Usage ```html ``` -### Properties +#### Properties | Attribute | Type | Default | Description | | --- | --- | --- | --- | @@ -74,11 +61,26 @@ In this component there are three different tags: ![Custom columns](docs/assets/tag1.png) -## alfresco-tag-list +## Alfresco Tag List component ![Custom columns](docs/assets/tag2.png) - -## Build from sources + +## Project Information + +### Prerequisites + +Before you start using this development framework, make sure you have installed all required software and done all the +necessary configuration [prerequisites](https://github.com/Alfresco/alfresco-ng2-components/blob/master/PREREQUISITES.md). + +> If you plan using this component with projects generated by Angular CLI, please refer to the following article: [Using ADF with Angular CLI](https://github.com/Alfresco/alfresco-ng2-components/wiki/Angular-CLI) + +### Install + +```sh +npm install ng2-alfresco-tag +``` + +### Build from sources You can build component from sources with the following commands: @@ -90,7 +92,7 @@ npm run build > The `build` task rebuilds all the code, runs tslint, license checks > and other quality check tools before performing unit testing. -## NPM scripts +### NPM scripts | Command | Description | | --- | --- | @@ -99,7 +101,7 @@ npm run build | npm run test-browser | Run unit tests in the browser | npm run coverage | Run unit tests and display code coverage report | -## Demo +### Demo Please check the demo folder for a demo project @@ -109,6 +111,6 @@ npm install npm start ``` -## License +### License [Apache Version 2.0](https://github.com/Alfresco/alfresco-ng2-components/blob/master/LICENSE) diff --git a/ng2-components/ng2-alfresco-upload/README.md b/ng2-components/ng2-alfresco-upload/README.md index 0034a6283c..09f4f444c0 100644 --- a/ng2-components/ng2-alfresco-upload/README.md +++ b/ng2-components/ng2-alfresco-upload/README.md @@ -1,69 +1,46 @@ -# Alfresco Upload Component +# Alfresco Upload library + +Contains components for handling uploads to Content Services. -- [Content](#content) - * [Components](#components) - * [Services](#services) - * [Directives](#directives) -- [Prerequisites](#prerequisites) -- [Install](#install) -- [UploadButtonComponent](#uploadbuttoncomponent) - * [Properties](#properties) - * [Events](#events) - * [Advanced usage](#advanced-usage) +- [Upload Button Component](#upload-button-component) + * [Basic Usage](#basic-usage) + + [Properties](#properties) + + [Events](#events) + * [Details](#details) + [How to show notification message with no permission](#how-to-show-notification-message-with-no-permission) + [How to disable the button when the delete permission is missing](#how-to-disable-the-button-when-the-delete-permission-is-missing) -- [UploadDragAreaComponent](#uploaddragareacomponent) - * [Properties](#properties-1) - * [Events](#events-1) -- [FileUploadingDialogComponent](#fileuploadingdialogcomponent) - * [Properties](#properties-2) -- [UploadService](#uploadservice) - * [Ignore list configuration](#ignore-list-configuration) - * [Events](#events-2) -- [Build from sources](#build-from-sources) -- [NPM scripts](#npm-scripts) -- [Demo](#demo) -- [License](#license) +- [Upload Drag Area Component](#upload-drag-area-component) + * [Basic Usage](#basic-usage-1) + + [Properties](#properties-1) + + [Events](#events-1) +- [File Uploading Dialog Component](#file-uploading-dialog-component) + * [Basic Usage](#basic-usage-2) + + [Properties](#properties-2) + * [Details](#details-1) +- [Upload Service](#upload-service) + * [Basic Usage](#basic-usage-3) + + [Events](#events-2) + * [Details](#details-2) + + [Ignore list configuration](#ignore-list-configuration) +- [Project Information](#project-information) + * [Prerequisites](#prerequisites) + * [Install](#install) + * [Build from sources](#build-from-sources) + * [NPM scripts](#npm-scripts) + * [Demo](#demo) + * [License](#license) -## Content +## Upload Button Component -### Components - -- [FileUploadingDialogComponent](#fileuploadingdialogcomponent) -- FileUploadingListComponent -- [UploadButtonComponent](#uploadbuttoncomponent) -- [UploadDragAreaComponent](#uploaddragareacomponent) - -### Services - -- [UploadService](#uploadservice) - -### Directives - -- FileDraggableDirective - -## Prerequisites - -Before you start using this development framework, make sure you have installed all required software and done all the -necessary configuration [prerequisites](https://github.com/Alfresco/alfresco-ng2-components/blob/master/PREREQUISITES.md). - -> If you plan using this component with projects generated by Angular CLI, please refer to the following article: [Using ADF with Angular CLI](https://github.com/Alfresco/alfresco-ng2-components/wiki/Angular-CLI) - -## Install - -```sh -npm install ng2-alfresco-upload -``` - -## UploadButtonComponent +### Basic Usage ```html ``` -### Properties +#### Properties | Name | Type | Default | Description | | --- | --- | --- | --- | @@ -87,21 +64,20 @@ npm install ng2-alfresco-upload | multipleFiles | boolean | false | Allow/disallow multiple files | | acceptedFilesType | string | * | array of allowed file extensions , example: ".jpg,.gif,.png,.svg" | | **(deprecated)** currentFolderPath | string | '/Sites/swsdp/documentLibrary' | define the path where the files are uploaded. **Deprecated in 1.6.0: use rootFolderId instead.** | -| **(deprecated)** rootFolderId | string | '-root-' | The ID of the root folder node. -**Deprecated in 1.6.2: use parentId instead.** | +| **(deprecated)** rootFolderId | string | '-root-' | The ID of the root folder node. **Deprecated in 1.6.2: use parentId instead.** | | parentId | string | empty | The ID of the root. It can be the nodeId if you are using the upload for the Content Service or taskId/processId for the Process Service. | | versioning | boolean | false | Versioning false is the default uploader behaviour and it renames the file using an integer suffix if there is a name clash. Versioning true to indicate that a major version should be created | | staticTitle | string | (predefined) | define the text of the upload button | | **(deprecated)** disableWithNoPermission ***use node permission directive from core instead*** | boolean | false | If the value is true and the user doesn't have the permission to delete the node the button will be disabled | | tooltip | string | | Custom tooltip | -### Events +#### Events | Name | Description | | --- | --- | | onSuccess | Raised when the file is uploaded | -### Advanced usage +### Details #### How to show notification message with no permission @@ -144,9 +120,11 @@ The UploadButtonComponent provides the property disableWithNoPermission that can ![Upload disable button](docs/assets/upload-disable-button.png) -## UploadDragAreaComponent +## Upload Drag Area Component -This component provides a drag and drop area to upload files to Alfresco. +Adds a drag and drop area to upload files to Alfresco. + +### Basic Usage ```html @@ -167,7 +145,7 @@ export class AppComponent { } ``` -### Properties +#### Properties | Name | Type | Default | Description | | --- | --- | --- | --- | @@ -178,32 +156,55 @@ export class AppComponent { | **(deprecated)** currentFolderPath | string | '/' | define the path where the files are uploaded. **Deprecated in 1.6.0: use rootFolderId instead.** | | versioning | boolean | false | Versioning false is the default uploader behaviour and it renames the file using an integer suffix if there is a name clash. Versioning true to indicate that a major version should be created | -### Events +#### Events | Name | Description | | --- | --- | | onSuccess | Raised when the file is uploaded | -## FileUploadingDialogComponent +## File Uploading Dialog Component -This component provides a dialog that shows all the files uploaded with upload button or drag & drop area components. -This component should be used in combination with upload button or drag & drop area. +Shows a dialog listing all the files uploaded with the Upload Button or Drag Area components. + +### Basic Usage ```html ``` -### Properties +#### Properties | Name | Type | Default | Description | | --- | --- | --- | --- | | position | string | 'right' | Dialog position. Accepted values are 'left' or 'right' | -## UploadService +### Details + +This component should be used in combination with upload button or drag & drop area. + +## Upload Service Provides access to various APIs related to file upload features. -### Ignore list configuration +### Basic Usage + +#### Events + +| Name | Type | Description | +| --- | --- | --- | +| queueChanged | FileModel[] | Raised every time the file queue changes. | +| fileUpload | FileUploadEvent | Raised every time a File model changes its state. | +| fileUploadStarting | FileUploadEvent | Raised when upload starts. | +| fileUploadCancelled | FileUploadEvent | Raised when upload gets cancelled by user. | +| fileUploadProgress | FileUploadEvent | Raised during file upload process and contains the current progress for the particular File model. | +| fileUploadAborted | FileUploadEvent | Raised when file upload gets aborted by the server. | +| fileUploadError | FileUploadEvent | Raised when an error occurs to file upload. | +| fileUploadComplete | FileUploadCompleteEvent | Raised when file upload is complete. | +| fileUploadDelete | FileUploadDeleteEvent | Raised when uploaded file is removed from server. | + +### Details + +#### Ignore list configuration Is possible add an ignore list for files that you don't want to allow upload on your CS. The configuration of this service is saved in the ***app.config.json file***.If you want more details about the configuration service follow this [link](https://github.com/Alfresco/alfresco-ng2-components/tree/master/ng2-components/ng2-alfresco-core#appconfigservice). @@ -228,21 +229,22 @@ Note: - Standard glob patterns work. - You can end patterns with a forward slash / to specify a directory. -### Events +## Project Information -| Name | Type | Description | -| --- | --- | --- | -| queueChanged | FileModel[] | Raised every time the file queue changes. | -| fileUpload | FileUploadEvent | Raised every time a File model changes its state. | -| fileUploadStarting | FileUploadEvent | Raised when upload starts. | -| fileUploadCancelled | FileUploadEvent | Raised when upload gets cancelled by user. | -| fileUploadProgress | FileUploadEvent | Raised during file upload process and contains the current progress for the particular File model. | -| fileUploadAborted | FileUploadEvent | Raised when file upload gets aborted by the server. | -| fileUploadError | FileUploadEvent | Raised when an error occurs to file upload. | -| fileUploadComplete | FileUploadCompleteEvent | Raised when file upload is complete. | -| fileUploadDelete | FileUploadDeleteEvent | Raised when uploaded file is removed from server. | +### Prerequisites -## Build from sources +Before you start using this development framework, make sure you have installed all required software and done all the +necessary configuration [prerequisites](https://github.com/Alfresco/alfresco-ng2-components/blob/master/PREREQUISITES.md). + +> If you plan using this component with projects generated by Angular CLI, please refer to the following article: [Using ADF with Angular CLI](https://github.com/Alfresco/alfresco-ng2-components/wiki/Angular-CLI) + +### Install + +```sh +npm install ng2-alfresco-upload +``` + +### Build from sources You can build component from sources with the following commands: @@ -254,7 +256,7 @@ npm run build > The `build` task rebuilds all the code, runs tslint, license checks > and other quality check tools before performing unit testing. -## NPM scripts +### NPM scripts | Command | Description | | --- | --- | @@ -263,7 +265,7 @@ npm run build | npm run test-browser | Run unit tests in the browser | npm run coverage | Run unit tests and display code coverage report | -## Demo +### Demo Please check the demo folder for a demo project @@ -273,6 +275,6 @@ npm install npm start ``` -## License +### License [Apache Version 2.0](https://github.com/Alfresco/alfresco-ng2-components/blob/master/LICENSE) diff --git a/ng2-components/ng2-alfresco-userinfo/README.md b/ng2-components/ng2-alfresco-userinfo/README.md index 21d3c9c42b..66288c22f2 100644 --- a/ng2-components/ng2-alfresco-userinfo/README.md +++ b/ng2-components/ng2-alfresco-userinfo/README.md @@ -1,42 +1,36 @@ -# Alfresco User Info Component +# Alfresco User Info library + +Contains the Alfresco User Info component. -- [Prerequisites](#prerequisites) -- [Install](#install) -- [Basic usage](#basic-usage) - * [Properties](#properties) -- [Build from sources](#build-from-sources) -- [NPM scripts](#npm-scripts) -- [Demo](#demo) -- [License](#license) +- [Alfresco User Info component](#alfresco-user-info-component) + * [Basic usage](#basic-usage) + + [Properties](#properties) + * [Details](#details) +- [Project Information](#project-information) + * [Prerequisites](#prerequisites) + * [Install](#install) + * [Build from sources](#build-from-sources) + * [NPM scripts](#npm-scripts) + * [Demo](#demo) + * [License](#license) -## Prerequisites +## Alfresco User Info component -Before you start using this development framework, make sure you have installed all required software and done all the -necessary configuration [prerequisites](https://github.com/Alfresco/alfresco-ng2-components/blob/master/PREREQUISITES.md). - -> If you plan using this component with projects generated by Angular CLI, please refer to the following article: [Using ADF with Angular CLI](https://github.com/Alfresco/alfresco-ng2-components/wiki/Angular-CLI) - -## Install - -```sh -npm install ng2-alfresco-userinfo -``` - -## Basic usage +### Basic usage ```html ``` -### Properties +#### Properties | Name | Type | Default | Description | | --- | --- | --- | --- | @@ -46,10 +40,27 @@ npm install ng2-alfresco-userinfo | menuPositionY | string | | Custom choice for opening the menu bottom : `above` or `below` | | fallBackThumbnailImage | string | (alfresco image) | Fallback image for profile when thumbnail is missing| +### Details + This will show a round icon with user and on click some user information. If user is logged in with ECM and BPM the ECM image will be shown. -## Build from sources +## Project Information + +### Prerequisites + +Before you start using this development framework, make sure you have installed all required software and done all the +necessary configuration [prerequisites](https://github.com/Alfresco/alfresco-ng2-components/blob/master/PREREQUISITES.md). + +> If you plan using this component with projects generated by Angular CLI, please refer to the following article: [Using ADF with Angular CLI](https://github.com/Alfresco/alfresco-ng2-components/wiki/Angular-CLI) + +### Install + +```sh +npm install ng2-alfresco-userinfo +``` + +### Build from sources You can build component from sources with the following commands: @@ -61,7 +72,7 @@ npm run build > The `build` task rebuilds all the code, runs tslint, license checks > and other quality check tools before performing unit testing. -## NPM scripts +### NPM scripts | Command | Description | | --- | --- | @@ -70,7 +81,7 @@ npm run build | npm run test-browser | Run unit tests in the browser | npm run coverage | Run unit tests and display code coverage report | -## Demo +### Demo Please check the demo folder for a demo project @@ -80,6 +91,6 @@ npm install npm start ``` -## License +### License [Apache Version 2.0](https://github.com/Alfresco/alfresco-ng2-components/blob/master/LICENSE) diff --git a/ng2-components/ng2-alfresco-viewer/README.md b/ng2-components/ng2-alfresco-viewer/README.md index 40ba246616..4243c22bab 100644 --- a/ng2-components/ng2-alfresco-viewer/README.md +++ b/ng2-components/ng2-alfresco-viewer/README.md @@ -1,42 +1,85 @@ -# Alfresco File Viewer Component +# Alfresco File Viewer library + +Contains the Alfresco Viewer component. -- [Prerequisites](#prerequisites) -- [Install](#install) - * [Configuring PDF.js library](#configuring-pdfjs-library) -- [Basic usage](#basic-usage) -- [Properties](#properties) -- [Supported file formats](#supported-file-formats) -- [PDF Conversion](#pdf-conversion) -- [Custom extension handler](#custom-extension-handler) -- [Build from sources](#build-from-sources) -- [NPM scripts](#npm-scripts) -- [Demo](#demo) -- [License](#license) +- [Alfresco Viewer component](#alfresco-viewer-component) + * [Basic usage](#basic-usage) + + [Properties](#properties) + * [Details](#details) + + [Supported file formats](#supported-file-formats) + + [PDF Conversion](#pdf-conversion) + + [Configuring PDF.js library](#configuring-pdfjs-library) + + [Custom extension handler](#custom-extension-handler) +- [Project Information](#project-information) + * [Prerequisites](#prerequisites) + * [Install](#install) + * [Build from sources](#build-from-sources) + * [NPM scripts](#npm-scripts) + * [Demo](#demo) + * [License](#license) +## Alfresco Viewer component + See it live: [Viewer Quickstart](https://embed.plnkr.co/iTuG1lFIXfsP95l6bDW6/) -## Prerequisites +### Basic usage -Before you start using this development framework, make sure you have installed all required software and done all the -necessary configuration [prerequisites](https://github.com/Alfresco/alfresco-ng2-components/blob/master/PREREQUISITES.md). +Using with node id: -> If you plan using this component with projects generated by Angular CLI, please refer to the following article: [Using ADF with Angular CLI](https://github.com/Alfresco/alfresco-ng2-components/wiki/Angular-CLI) - -## Install - -```sh -npm install ng2-alfresco-viewer +```html + + ``` -### Configuring PDF.js library +Using with file url: + +```html + + +``` + +#### Properties + +| Attribute | Options | Default | Description | +| --- | --- | --- | --- | +| fileNodeId | string | | Node Id of the file to load | +| urlFile | string | | If you want to load an external file that does not come from ECM you can use this Url where to load the file | +| urlBlob | Blob | | If you want to load a Blob File | +| overlayMode | boolean | false | If `true` show the Viewer full page over the present content otherwise will fit the parent div | +| showViewer | boolean | true | Hide or show the viewer | +| showToolbar | boolean | true | Hide or show the toolbars | +| displayName | string | | You can specify the name of the file | + +### Details + +#### Supported file formats + +| Type | Extension | +| --- | --- | +| Media | wav, Mp3, Mp4, WebM, Ogv | +| Images | png, jpg, jpeg, gif, bmp | +| Text | pdf, txt | + +#### PDF Conversion + +![Rendition](docs/assets/renditions.png) + +Note for unsupported extensions the viewer will offer the possibility to convert to PDF if that kind of extension is supported by the [content service renditions service](https://community.alfresco.com/docs/DOC-5879-rendition-service) + +#### Configuring PDF.js library In order to configure your webpack-enabled application with the PDF.js library please follow the next steps. @@ -73,54 +116,7 @@ new CopyWebpackPlugin([ The Viewer component now should be able displaying PDF files. -## Basic usage - -Using with node id: - -```html - - -``` - -Using with file url: - -```html - - -``` - -## Properties - -| Attribute | Options | Default | Description | -| --- | --- | --- | --- | -| fileNodeId | string | | Node Id of the file to load | -| urlFile | string | | If you want to load an external file that does not come from ECM you can use this Url where to load the file | -| urlBlob | Blob | | If you want to load a Blob File | -| overlayMode | boolean | false | If `true` show the Viewer full page over the present content otherwise will fit the parent div | -| showViewer | boolean | true | Hide or show the viewer | -| showToolbar | boolean | true | Hide or show the toolbars | -| displayName | string | | You can specify the name of the file | - -## Supported file formats - -| Type | Extension | -| --- | --- | -| Media | wav, Mp3, Mp4, WebM, Ogv | -| Images | png, jpg, jpeg, gif, bmp | -| Text | pdf, txt | - -## PDF Conversion - -![Rendition](docs/assets/renditions.png) - -Note for unsupported extensions the viewer will offer the possibility to convert to PDF if that kind of extension is supported by the [content service renditions service](https://community.alfresco.com/docs/DOC-5879-rendition-service) - -## Custom extension handler +#### Custom extension handler If you want to handle other file formats that are not yet supported by the ng2-alfresco-viewer you can define your own custom handler. @@ -172,7 +168,22 @@ It is possible to define multiple `extension-viewer` templates: ``` -## Build from sources +## Project Information + +### Prerequisites + +Before you start using this development framework, make sure you have installed all required software and done all the +necessary configuration [prerequisites](https://github.com/Alfresco/alfresco-ng2-components/blob/master/PREREQUISITES.md). + +> If you plan using this component with projects generated by Angular CLI, please refer to the following article: [Using ADF with Angular CLI](https://github.com/Alfresco/alfresco-ng2-components/wiki/Angular-CLI) + +### Install + +```sh +npm install ng2-alfresco-viewer +``` + +### Build from sources You can build component from sources with the following commands: @@ -184,7 +195,7 @@ npm run build > The `build` task rebuilds all the code, runs tslint, license checks > and other quality check tools before performing unit testing. -## NPM scripts +### NPM scripts | Command | Description | | --- | --- | @@ -193,7 +204,7 @@ npm run build | npm run test-browser | Run unit tests in the browser | npm run coverage | Run unit tests and display code coverage report | -## Demo +### Demo Please check the demo folder for a demo project @@ -203,6 +214,6 @@ npm install npm start ``` -## License +### License [Apache Version 2.0](https://github.com/Alfresco/alfresco-ng2-components/blob/master/LICENSE) diff --git a/ng2-components/ng2-alfresco-webscript/README.md b/ng2-components/ng2-alfresco-webscript/README.md index d543b7bfb3..9f2a2d7dee 100644 --- a/ng2-components/ng2-alfresco-webscript/README.md +++ b/ng2-components/ng2-alfresco-webscript/README.md @@ -1,39 +1,33 @@ -# Alfresco Webscript Component +# Alfresco Webscript library + +Contains the Alfresco Webscript Get component. -- [Prerequisites](#prerequisites) -- [Install](#install) -- [Basic usage](#basic-usage) -- [Properties](#properties) -- [Webscript View HTML example](#webscript-view-html-example) -- [Webscript View DATATABLE example](#webscript-view-datatable-example) -- [Webscript View JSON example](#webscript-view-json-example) -- [Build from sources](#build-from-sources) -- [NPM scripts](#npm-scripts) -- [Demo](#demo) -- [License](#license) +- [Alfresco Webscript Get component](#alfresco-webscript-get-component) + * [Basic usage](#basic-usage) + + [Properties](#properties) + * [Details](#details) + + [Webscript View HTML example](#webscript-view-html-example) + + [Webscript View DATATABLE example](#webscript-view-datatable-example) + + [Webscript View JSON example](#webscript-view-json-example) +- [Project Information](#project-information) + * [Prerequisites](#prerequisites) + * [Install](#install) + * [Build from sources](#build-from-sources) + * [NPM scripts](#npm-scripts) + * [Demo](#demo) + * [License](#license) -## Prerequisites +## Alfresco Webscript Get component -Before you start using this development framework, make sure you have installed all required software and done all the -necessary configuration [prerequisites](https://github.com/Alfresco/alfresco-ng2-components/blob/master/PREREQUISITES.md). - -> If you plan using this component with projects generated by Angular CLI, please refer to the following article: [Using ADF with Angular CLI](https://github.com/Alfresco/alfresco-ng2-components/wiki/Angular-CLI) - -## Install - -```sh -npm install ng2-alfresco-webscript -``` - -## Basic usage +### Basic usage ```html If you plan using this component with projects generated by Angular CLI, please refer to the following article: [Using ADF with Angular CLI](https://github.com/Alfresco/alfresco-ng2-components/wiki/Angular-CLI) + +### Install + +```sh +npm install ng2-alfresco-webscript +``` + +### Build from sources You can build component from sources with the following commands: @@ -202,7 +213,7 @@ npm run build > The `build` task rebuilds all the code, runs tslint, license checks > and other quality check tools before performing unit testing. -## NPM scripts +### NPM scripts | Command | Description | | --- | --- | @@ -211,7 +222,7 @@ npm run build | npm run test-browser | Run unit tests in the browser | npm run coverage | Run unit tests and display code coverage report | -## Demo +### Demo Please check the demo folder for a demo project @@ -221,6 +232,6 @@ npm install npm start ``` -## License +### License [Apache Version 2.0](https://github.com/Alfresco/alfresco-ng2-components/blob/master/LICENSE)