[ADF-4249] Started doc review for 3.1 (#4448)

* [ADF-4249] Reviewed new proc cloud component docs

* [ADF-4249] Reviewed Preview extension component docs
This commit is contained in:
Andy Stark
2019-03-15 17:48:20 +00:00
committed by Eugenio Romano
parent 48b685fe25
commit 74738f1f8b
4 changed files with 30 additions and 14 deletions

View File

@@ -2,12 +2,12 @@
Title: Preview Extension Component Title: Preview Extension Component
Added: v3.1.0 Added: v3.1.0
Status: Experimental Status: Experimental
Last reviewed: 2018-04-12 Last reviewed: 2019-03-15
--- ---
# [Preview Extension component](../../../lib/extensions/src/lib/components/viewer/preview-extension.component.ts "Defined in preview-extension.component.ts") # [Preview Extension component](../../../lib/extensions/src/lib/components/viewer/preview-extension.component.ts "Defined in preview-extension.component.ts")
Displays dynamically-loaded extension components. Supports dynamically-loaded viewer preview extensions.
See the [ACA monaco extension](https://github.com/eromano/aca-monaco-extension) for See the [ACA monaco extension](https://github.com/eromano/aca-monaco-extension) for
an example of a real working viewer extension project. an example of a real working viewer extension project.
@@ -18,16 +18,16 @@ an example of a real working viewer extension project.
| Name | Type | Default value | Description | | Name | Type | Default value | Description |
| ---- | ---- | ------------- | ----------- | | ---- | ---- | ------------- | ----------- |
| extension | `string` | | | | extension | `string` | | File extension (.jpg, .png, etc) for the viewer. |
| id | `string` | | | | id | `string` | | ID string of the component to preview. |
| node | [`Node`](https://github.com/Alfresco/alfresco-js-api/blob/development/src/api/content-rest-api/docs/Node.md) | | of the content to display | | node | [`Node`](https://github.com/Alfresco/alfresco-js-api/blob/development/src/api/content-rest-api/docs/Node.md) | | [Node](https://github.com/Alfresco/alfresco-js-api/blob/development/src/api/content-rest-api/docs/Node.md) containing the content to display. |
| url | `string` | | URL Of the content in the repository | | url | `string` | | URL of the content in the repository. |
## Details ## Details
If you want create your custom extension viewer you need to create the following files in a separate project: To create your custom extension viewer you need to create the following files in a separate project:
The Module needs to know which is the Id of your extension: The Module needs to declare the ID of your extension:
```ts ```ts
export class YourExtensionViewerModule { export class YourExtensionViewerModule {
@@ -39,7 +39,8 @@ export class YourExtensionViewerModule {
} }
``` ```
Your [viewer component](../../core/components/viewer.component.md) extension business logic: Your [viewer component](../../core/components/viewer.component.md) extension contains
the business logic:
```ts ```ts
import { Node } from '@alfresco/js-api'; import { Node } from '@alfresco/js-api';
@@ -66,13 +67,15 @@ export class YourExtensionViewerComponent implements ViewerExtensionInterface {
} }
``` ```
Your [viewer component](../../core/components/viewer.component.md) template: The [viewer component](../../core/components/viewer.component.md)
also needs an HTML template (which is referenced by the `templateUrl` property
in the `@Component` decorator of the component class above):
```HTML ```HTML
<div> This is your custom extension viewer template</div> <div> This is your custom extension viewer template</div>
``` ```
Your [viewer component](../../core/components/viewer.component.md) extension.json: You also need to provide a [viewer component](../../core/components/viewer.component.md)`extension.json` file containing its details:
```JSON ```JSON
{ {
@@ -93,6 +96,10 @@ Your [viewer component](../../core/components/viewer.component.md) extension.jso
} }
``` ```
See the [App extensions](../../user-guide/app-extensions.md) page for
further details of how to develop extensions.
## See also ## See also
- [Extension service](../services/extension.service.md) - [Extension service](../services/extension.service.md)
- [App extensions](../../user-guide/app-extensions.md)

View File

@@ -2,7 +2,7 @@
Title: Process Header Cloud Component Title: Process Header Cloud Component
Added: v3.0.0 Added: v3.0.0
Status: Experimental Status: Experimental
Last reviewed: 2019-03-08 Last reviewed: 2019-03-15
--- ---
# [Process Header Cloud Component](../../../lib/process-services-cloud/src/lib/process/process-header/components/process-header-cloud.component.ts "Defined in process-header-cloud.component.ts") # [Process Header Cloud Component](../../../lib/process-services-cloud/src/lib/process/process-header/components/process-header-cloud.component.ts "Defined in process-header-cloud.component.ts")
@@ -32,7 +32,7 @@ Shows all the information related to a process instance.
## Details ## Details
The component populates an internal array of The component populates an internal array of
[`CardViewModel`](../../core/components/card-view.component.md) with the information that we want to display. [`CardViewModel`](../../core/components/card-view.component.md) with the information to display.
By default all properties are displayed: By default all properties are displayed:
@@ -49,3 +49,7 @@ However, you can also choose which properties to show using a configuration in `
``` ```
With this configuration, only the four listed properties will be shown. With this configuration, only the four listed properties will be shown.
## See also
- [Process header cloud service](../../process-services-cloud/services/process-header-cloud.service.md)

View File

@@ -2,7 +2,7 @@
Title: Process Header Cloud Service Title: Process Header Cloud Service
Added: v3.0.0 Added: v3.0.0
Status: Experimental Status: Experimental
Last reviewed: 2019-03-08 Last reviewed: 2019-03-15
--- ---
# [Process Header Cloud Service](../../../lib/process-services-cloud/src/lib/process/process-header/services/process-header-cloud.service.ts "Defined in process-header-cloud.service.ts") # [Process Header Cloud Service](../../../lib/process-services-cloud/src/lib/process/process-header/services/process-header-cloud.service.ts "Defined in process-header-cloud.service.ts")
@@ -29,3 +29,4 @@ but they use the cloud variants of the classes for return values. See the
## See also ## See also
- [Process list Cloud Service](process-list-cloud.service.md) - [Process list Cloud Service](process-list-cloud.service.md)
- [Process header cloud component](../../process-services-cloud/components/process-header-cloud.component.md)

View File

@@ -39,15 +39,19 @@ export class PreviewExtensionComponent implements OnInit, OnChanges, OnDestroy {
@ViewChild('content', { read: ViewContainerRef }) @ViewChild('content', { read: ViewContainerRef })
content: ViewContainerRef; content: ViewContainerRef;
/** ID string of the component to preview. */
@Input() @Input()
id: string; id: string;
/** URL of the content in the repository. */
@Input() @Input()
url: string; url: string;
/** File extension (.jpg, .png, etc) for the viewer. */
@Input() @Input()
extension: string; extension: string;
/** Node containing the content to display. */
@Input() @Input()
node: Node; node: Node;