alfresco-ng2-components/docs/process-services/components/process-attachment-list.component.md
Andy Stark 31479cfaa4 [ADF-4152] Restructured remaining doc folders and fixed links (#4441)
* [ADF-4152] Moved proc services cloud docs to subfolders

* [ADF-4152] Fixed links in PS cloud docs

* [ADF-4152] Added subfolders and checked links for extensions and insights docs

* [ADF-4152] Moved proc services cloud docs to subfolders

* [ADF-4152] Fixed links in PS cloud docs

* [ADF-4152] Added subfolders and checked links for extensions and insights docs

* [ADF-4152] Fixed links in Proc cloud, Insights and Extensions docs

* [ADF-4152] Updated links in user guide

* [ADF-4152] Fixed broken links in tutorials

* [ADF-4152] Fixed remaining links in core docs

* [ADF-4152] Fixed remaining links in proc services docs

* [ADF-4152] Fixed remaining links in content services docs

* [ADF-4152] Fixed links in breaking changes docs

* [ADF-4152] Updated main README index page

* [ADF-4152] Fixed glitches with preview ext component docs
2019-03-14 22:01:55 +00:00

3.9 KiB

Title, Added, Status, Last reviewed
Title Added Status Last reviewed
Process Attachment List component v2.0.0 Active 2019-01-14

Process Attachment List component

Displays documents attached to a specified process instance.

process-attachment-list-sample

Basic Usage

<adf-process-attachment-list
    [processInstanceId]="YOUR_PROCESS_INSTANCE_ID"
    (attachmentClick)="YOUR_ATTACHMENT_CLICK_EMITTER_HANDLER">
</adf-process-attachment-list>

Make sure to override the UploadService with the ProcessUploadService

import { UploadService } from '@alfresco/adf-core';
import { ProcessUploadService } from '@alfresco/adf-process-services';

@Component({
    selector: 'my-custom-process-attachment',
    providers: [
        { provide: UploadService, useClass: ProcessUploadService }
    ]
})
export class MyCustomProcessAttachmentComponent {
    constructor() {}
}

Transclusions

Any content inside the <adf-process-attachment-list> element will be shown when the list is empty:

<adf-process-attachment-list ...>
    <div><!-- Custom empty list message goes here --></div>
</adf-process-attachment-list>

custom-no-content-drag-drop-template-sample

A default template will be used if you don't supply a custom one to override it:

default-no-content-template-sample

Class members

Properties

Name Type Default value Description
disabled boolean false Disable/Enable read-only mode for attachment list.
processInstanceId string (required) The ID of the process instance to display.

Events

Name Type Description
attachmentClick EventEmitter<Object> Emitted when the attachment is double-clicked or the view option is selected from the context menu by the user from within the component. Returns a Blob representing the object that was clicked.
error EventEmitter<any> Emitted when the attachment list is not able to fetch the attachments (eg, following a network error).
success EventEmitter<Object> Emitted when the attachment list has fetched all the attachments. Returns a list of attachments.

Details

How to Add Drag and Drop Functionality

You can wrap the attachment list with an Upload Drag Area component to let the user upload attachments to empty lists. When you do this, you can also supply a custom no content template (using <adf-empty-list>) to invite the user to add their attachments:

<adf-upload-drag-area
    [rootFolderId]="YOUR_PROCESS_ID"
    [showNotificationBar]="BOOLEAN">
    <adf-process-attachment-list  
        [processId]="YOUR_PROCESS_ID"
        (attachmentClick)="YOUR_HANDLER">
            <div adf-empty-list> //no content template
                <adf-empty-list>
                    <div adf-empty-list-header>{{This List is empty}}</div>
                    <div adf-empty-list-body>{{Drag and drop to upload}}</div>
                    <div adf-empty-list-footer>
                        <img [src]="Your custom image URL"></div> 
                </adf-empty-list>
            </div>
    </adf-process-attachment-list>
</adf-upload-drag-area>