@alfresco/adf-content-services
Version:
Alfresco ADF content services
159 lines (158 loc) • 8.6 kB
TypeScript
/*!
* @license
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { ChangeDetectorRef, EventEmitter, OnChanges, OnInit, SimpleChanges, TemplateRef } from '@angular/core';
import { CloseButtonPosition, Track, ViewerComponent, ViewerMoreActionsComponent, ViewerOpenWithComponent, ViewerSidebarComponent, ViewerToolbarActionsComponent, ViewerToolbarComponent, ViewUtilService } from '@alfresco/adf-core';
import { AlfrescoApiService } from '../../services/alfresco-api.service';
import { ContentApi, Node, NodeEntry, NodesApi, SharedlinksApi, VersionEntry, VersionsApi } from '@alfresco/js-api';
import { RenditionService } from '../../common/services/rendition.service';
import { MatDialog } from '@angular/material/dialog';
import { ContentService } from '../../common/services/content.service';
import { NodesApiService } from '../../common/services/nodes-api.service';
import { UploadService } from '../../common/services/upload.service';
import { NodeActionsService } from '../../document-list';
import * as i0 from "@angular/core";
export declare class AlfrescoViewerComponent implements OnChanges, OnInit {
private apiService;
private nodesApiService;
private renditionService;
private viewUtilService;
private contentService;
private uploadService;
dialog: MatDialog;
private cdr;
private nodeActionsService;
adfViewer: ViewerComponent<{
node: Node;
}>;
toolbar: ViewerToolbarComponent;
sidebar: ViewerSidebarComponent;
toolbarActions: ViewerToolbarActionsComponent;
moreActions: ViewerMoreActionsComponent;
openWith: ViewerOpenWithComponent;
viewerExtensions: TemplateRef<any>;
/** Node Id of the file to load. */
nodeId: string;
/** Version Id of the file to load. */
versionId: string;
/** Shared link id (to display shared file). */
sharedLinkId: string;
/** Hide or show the viewer */
showViewer: boolean;
/**
* Number of times the Viewer will retry fetching content Rendition.
* There is a delay of at least one second between attempts.
*/
maxRetries: number;
/** Allows `back` navigation */
allowGoBack: boolean;
/** Hide or show the toolbar */
showToolbar: boolean;
/**
* If `true` then show the Viewer as a full page over the current content.
* Otherwise, fit inside the parent div.
*/
overlayMode: boolean;
/**
* Toggles before/next navigation. You can use the arrow buttons to navigate
* between documents in the collection.
*/
allowNavigate: boolean;
/** Toggles the "before" ("<") button. Requires `allowNavigate` to be enabled. */
canNavigateBefore: boolean;
/** Toggles the next (">") button. Requires `allowNavigate` to be enabled. */
canNavigateNext: boolean;
/** Allow the left the sidebar. */
allowLeftSidebar: boolean;
/** Allow the right sidebar. */
allowRightSidebar: boolean;
/** Toggles right sidebar visibility. Requires `allowRightSidebar` to be set to `true`. */
showRightSidebar: boolean;
/** Toggles left sidebar visibility. Requires `allowLeftSidebar` to be set to `true`. */
showLeftSidebar: boolean;
/** Toggles downloading. */
allowDownload: boolean;
/** Toggles printing. */
allowPrint: boolean;
/** Toggles the 'Full Screen' feature. */
allowFullScreen: boolean;
/** Toggles the 'Info Button' */
hideInfoButton: boolean;
/** Change the close button position Right/Left */
closeButtonPosition: CloseButtonPosition;
/** The template for the right sidebar. The template context contains the loaded node data. */
sidebarRightTemplate: TemplateRef<any>;
/** The template for the left sidebar. The template context contains the loaded node data. */
sidebarLeftTemplate: TemplateRef<any>;
/** Emitted when the shared link used is not valid. */
invalidSharedLink: EventEmitter<void>;
/** Emitted when user clicks 'Navigate Before' ("<") button. */
navigateBefore: EventEmitter<KeyboardEvent | MouseEvent>;
/** Emitted when user clicks 'Navigate Next' (">") button. */
navigateNext: EventEmitter<KeyboardEvent | MouseEvent>;
/** Emitted when the viewer close */
showViewerChange: EventEmitter<boolean>;
private cacheBusterNumber;
versionEntry: VersionEntry;
urlFileContent: string;
fileName: string;
mimeType: string;
nodeMimeType: string;
nodeEntry: NodeEntry;
tracks: Track[];
readOnly: boolean;
allowedEditActions: {
[key: string]: boolean;
};
sidebarRightTemplateContext: {
node: Node;
};
sidebarLeftTemplateContext: {
node: Node;
};
private _sharedLinksApi;
get sharedLinksApi(): SharedlinksApi;
private _versionsApi;
get versionsApi(): VersionsApi;
private _nodesApi;
get nodesApi(): NodesApi;
private _contentApi;
get contentApi(): ContentApi;
private readonly destroyRef;
constructor(apiService: AlfrescoApiService, nodesApiService: NodesApiService, renditionService: RenditionService, viewUtilService: ViewUtilService, contentService: ContentService, uploadService: UploadService, dialog: MatDialog, cdr: ChangeDetectorRef, nodeActionsService: NodeActionsService);
ngOnInit(): void;
private onNodeUpdated;
private getNodeVersionProperty;
private setupSharedLink;
private setupNode;
private setUpNodeFile;
private setUpSharedLinkFile;
private getSharedLinkRendition;
private generateCacheBusterNumber;
/**
* close the viewer
*/
onClose(): void;
onPrintContent(event: MouseEvent): void;
onSubmitFile(newImageBlob: Blob): void;
onNavigateBeforeClick(event: MouseEvent | KeyboardEvent): void;
onNavigateNextClick(event: MouseEvent | KeyboardEvent): void;
isSourceDefined(): boolean;
ngOnChanges(changes: SimpleChanges): void;
onDownloadFile(): void;
static ɵfac: i0.ɵɵFactoryDeclaration<AlfrescoViewerComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<AlfrescoViewerComponent, "adf-alfresco-viewer", never, { "nodeId": { "alias": "nodeId"; "required": false; }; "versionId": { "alias": "versionId"; "required": false; }; "sharedLinkId": { "alias": "sharedLinkId"; "required": false; }; "showViewer": { "alias": "showViewer"; "required": false; }; "maxRetries": { "alias": "maxRetries"; "required": false; }; "allowGoBack": { "alias": "allowGoBack"; "required": false; }; "showToolbar": { "alias": "showToolbar"; "required": false; }; "overlayMode": { "alias": "overlayMode"; "required": false; }; "allowNavigate": { "alias": "allowNavigate"; "required": false; }; "canNavigateBefore": { "alias": "canNavigateBefore"; "required": false; }; "canNavigateNext": { "alias": "canNavigateNext"; "required": false; }; "allowLeftSidebar": { "alias": "allowLeftSidebar"; "required": false; }; "allowRightSidebar": { "alias": "allowRightSidebar"; "required": false; }; "showRightSidebar": { "alias": "showRightSidebar"; "required": false; }; "showLeftSidebar": { "alias": "showLeftSidebar"; "required": false; }; "allowDownload": { "alias": "allowDownload"; "required": false; }; "allowPrint": { "alias": "allowPrint"; "required": false; }; "allowFullScreen": { "alias": "allowFullScreen"; "required": false; }; "hideInfoButton": { "alias": "hideInfoButton"; "required": false; }; "closeButtonPosition": { "alias": "closeButtonPosition"; "required": false; }; "sidebarRightTemplate": { "alias": "sidebarRightTemplate"; "required": false; }; "sidebarLeftTemplate": { "alias": "sidebarLeftTemplate"; "required": false; }; }, { "invalidSharedLink": "invalidSharedLink"; "navigateBefore": "navigateBefore"; "navigateNext": "navigateNext"; "showViewerChange": "showViewerChange"; }, ["toolbar", "sidebar", "toolbarActions", "moreActions", "openWith", "viewerExtensions"], ["adf-viewer-toolbar", "adf-viewer-toolbar-actions", "adf-viewer-more-actions", "adf-viewer-open-with", "adf-viewer-sidebar"], true, never>;
}