Displays and manages dialogs for selecting content to open, copy or upload.

Class members

Methods

  • getTitleTranslation(action: string, name: string): string
    Gets the translation of the dialog title.
    • action: string - Name of the action to display in the dialog title
    • name: string - Name of the item on which the action is being performed
    • Returns string - Translated version of the title
  • openCopyMoveDialog(action: NodeAction, contentEntry: Node, permission?: string, excludeSiteContent?: string[]): Observable<Node[]>
    Opens a dialog to copy or move an item to a new location.
    • action: NodeAction - Name of the action (eg, "Copy" or "Move") to show in the title
    • contentEntry: Node - Item to be copied or moved
    • permission: string - (Optional) Permission for the operation
    • excludeSiteContent: string[] - (Optional) The site content that should be filtered out
    • Returns Observable<Node[]> - Information about files that were copied/moved
  • openFileBrowseDialogByDefaultLocation(): Observable<Node[]>
    Opens a file browser at a default myFile location. shows files and folders in the dialog search result.
    • Returns Observable<Node[]> - Information about the selected file(s)
  • openFileBrowseDialogByFolderId(folderNodeId: string): Observable<Node[]>
    Opens a file browser at a chosen folder location. shows files and folders in the dialog search result.
    • folderNodeId: string - ID of the folder to use
    • Returns Observable<Node[]> - Information about the selected file(s)
  • openFileBrowseDialogBySite(): Observable<Node[]>
    Opens a file browser at a chosen site location. shows files and folders in the dialog search result.
    • Returns Observable<Node[]> - Information about the selected file(s)
  • openFolderBrowseDialogByFolderId(folderNodeId: string): Observable<Node[]>
    Opens a folder browser at a chosen folder location.
    • folderNodeId: string - ID of the folder to use
    • Returns Observable<Node[]> - Information about the selected folder(s)
  • openFolderBrowseDialogBySite(): Observable<Node[]>
    Opens a folder browser at a chosen site location.
    • Returns Observable<Node[]> - Information about the selected folder(s)
  • openLockNodeDialog(contentEntry: Node): Subject<string>
    Opens a lock node dialog.
    • contentEntry: Node - Node to lock
    • Returns Subject<string> - Error/status message (if any)
  • openUploadFileDialog(action: NodeAction, contentEntry: Node, showFilesInResult: boolean = false): Observable<Node[]>
    Opens a dialog to choose a file to upload.
    • action: NodeAction - Name of the action to show in the title
    • contentEntry: Node - Item to upload
    • showFilesInResult: boolean - Show files in dialog search result
    • Returns Observable<Node[]> - Information about the chosen file(s)
  • openUploadFolderDialog(action: NodeAction, contentEntry: Node): Observable<Node[]>
    Opens a dialog to choose folders to upload.
    • action: NodeAction - Name of the action to show in the title
    • contentEntry: Node - Item to upload
    • Returns Observable<Node[]> - Information about the chosen folder(s)

Details

The openXXX methods return an Observable that you can subscribe to in order to get the information from the result:

import { ContentNodeDialogService } from '@adf/content-services'


constructor(private contentDialogService: ContentNodeDialogService){}

yourFunctionOnCopyOrMove(){
        this.contentDialogService
            .openCopyMoveDialog(actionName, targetNode, neededPermissionForAction)
            .subscribe((selections: MinimalNode[]) => {
                // place your action here on operation success!
            });
}

The openXXXByFolderId methods let you set the initial folder location of the browser using a folder ID string. This can be obtained from the id property of a MinimalNode object (returned from a previous dialog operation, say) or be set to one of the well-known names "-my-" , "-shared-" or "-root-".

See Also

© 2023 Alfresco Software, Inc. All Rights Reserved.