Implements the document menu actions for the Document List component.

Class members


  • canExecuteAction(nodeEntry: NodeEntry): boolean
    Checks if actions can be executed for an item.
    • nodeEntry: NodeEntry - Item to receive an action
    • Returns boolean - True if the action can be executed on this item, false otherwise
  • getHandler(key: string): ContentActionHandler
    Gets the handler for an action.
  • setHandler(key: string, handler: ContentActionHandler): boolean
    Sets a new handler for an action.
    • key: string - Identifier of the action
    • handler: ContentActionHandler - Handler for the action
    • Returns boolean - False if the key was an empty/null string, true otherwise


This service implements the built-in actions that can be applied to a document shown in a Document List component: delete, download, copy and move (see the Content Action component for further details and examples of these menu items). However, you can also use the service to add extra actions or replace the built-in ones with your own implementation.

Registering an action

In the example below, a custom handler called my-handler is registered with the service. This action will invoke the myDocumentActionHandler function each time it is selected from the Document List menu.

import { DocumentActionsService } from '@alfresco/adf-content-services';

class MyView {

    constructor(documentActions: DocumentActionsService) {

    myDocumentActionHandler(obj: any) {
        window.alert('my custom action handler');

The action can then be used from the component in the usual way:

<adf-document-list ...>

            title="My action"


You can also override a built-in handler (eg, 'download') with your own function:

export class MyView {

    constructor(documentActions: DocumentActionsService) {

    customDownloadBehavior(obj: any) {
        window.alert('my custom download behavior');

You will probably want to set up all your custom actions at the application root level or with a custom application service.

See also

© 2023 Alfresco Software, Inc. All Rights Reserved.