mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-09-17 14:21:29 +00:00
feat: replace api usage for ContentApi
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable, from, throwError } from 'rxjs';
|
||||
import { AlfrescoApiService, LogService } from '@alfresco/adf-core';
|
||||
import { AlfrescoApiService, ApiClientsService, LogService } from '@alfresco/adf-core';
|
||||
import {
|
||||
AuditApi,
|
||||
AuditAppPaging,
|
||||
@@ -34,14 +34,11 @@ import { catchError } from 'rxjs/operators';
|
||||
})
|
||||
export class AuditService {
|
||||
|
||||
_auditApi: AuditApi;
|
||||
get auditApi(): AuditApi {
|
||||
this._auditApi = this._auditApi ?? new AuditApi(this.apiService.getInstance());
|
||||
return this._auditApi;
|
||||
get auditApi() {
|
||||
return this.apiClientsService.get('ContentClient.audit');
|
||||
}
|
||||
|
||||
constructor(private apiService: AlfrescoApiService, private logService: LogService) {
|
||||
}
|
||||
constructor(private apiClientsService: ApiClientsService, private logService: LogService) { }
|
||||
|
||||
getAuditApps(opts?: any): Observable<AuditAppPaging> {
|
||||
const defaultOptions = {
|
||||
|
@@ -17,11 +17,11 @@
|
||||
|
||||
import { Directive, Input, HostListener, OnChanges, NgZone, OnDestroy } from '@angular/core';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { NodeEntry, NodesApi } from '@alfresco/js-api';
|
||||
import { NodeEntry } from '@alfresco/js-api';
|
||||
|
||||
import { ShareDialogComponent } from './content-node-share.dialog';
|
||||
import { Observable, from, Subject } from 'rxjs';
|
||||
import { AlfrescoApiService } from '@alfresco/adf-core';
|
||||
import { ApiClientsService } from '@alfresco/adf-core';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
|
||||
@Directive({
|
||||
@@ -34,7 +34,7 @@ export class NodeSharedDirective implements OnChanges, OnDestroy {
|
||||
isShared: boolean = false;
|
||||
|
||||
/** Node to share. */
|
||||
// eslint-disable-next-line @angular-eslint/no-input-rename
|
||||
// eslint-disable-next-line @angular-eslint/no-input-rename
|
||||
@Input('adf-share')
|
||||
node: NodeEntry;
|
||||
|
||||
@@ -44,17 +44,15 @@ export class NodeSharedDirective implements OnChanges, OnDestroy {
|
||||
|
||||
private onDestroy$ = new Subject<boolean>();
|
||||
|
||||
_nodesApi: NodesApi;
|
||||
get nodesApi(): NodesApi {
|
||||
this._nodesApi = this._nodesApi ?? new NodesApi(this.alfrescoApiService.getInstance());
|
||||
return this._nodesApi;
|
||||
get nodesApi() {
|
||||
return this.apiClientsService.get('ContentClient.nodes');
|
||||
}
|
||||
|
||||
constructor(
|
||||
private dialog: MatDialog,
|
||||
private zone: NgZone,
|
||||
private alfrescoApiService: AlfrescoApiService) {
|
||||
}
|
||||
private apiClientsService: ApiClientsService
|
||||
) { }
|
||||
|
||||
ngOnDestroy() {
|
||||
this.onDestroy$.next(true);
|
||||
|
@@ -32,8 +32,8 @@ import {
|
||||
AbstractControl
|
||||
} from '@angular/forms';
|
||||
import { MatDialogRef } from '@angular/material/dialog';
|
||||
import { QueriesApi, SiteBodyCreate, SiteEntry, SitePaging } from '@alfresco/js-api';
|
||||
import { AlfrescoApiService, SitesService } from '@alfresco/adf-core';
|
||||
import { SiteBodyCreate, SiteEntry, SitePaging } from '@alfresco/js-api';
|
||||
import { ApiClientsService, SitesService } from '@alfresco/adf-core';
|
||||
import { debounceTime, finalize, mergeMap, takeUntil } from 'rxjs/operators';
|
||||
|
||||
@Component({
|
||||
@@ -72,14 +72,12 @@ export class LibraryDialogComponent implements OnInit, OnDestroy {
|
||||
];
|
||||
disableCreateButton = false;
|
||||
|
||||
_queriesApi: QueriesApi;
|
||||
get queriesApi(): QueriesApi {
|
||||
this._queriesApi = this._queriesApi ?? new QueriesApi(this.alfrescoApiService.getInstance());
|
||||
return this._queriesApi;
|
||||
get queriesApi() {
|
||||
return this.apiClientsService.get('ContentClient.queries');
|
||||
}
|
||||
|
||||
constructor(
|
||||
private alfrescoApiService: AlfrescoApiService,
|
||||
private apiClientsService: ApiClientsService,
|
||||
private sitesService: SitesService,
|
||||
private formBuilder: FormBuilder,
|
||||
private dialog: MatDialogRef<LibraryDialogComponent>
|
||||
@@ -230,9 +228,9 @@ export class LibraryDialogComponent implements OnInit, OnDestroy {
|
||||
|
||||
private findLibraryByTitle(libraryTitle: string): Promise<SitePaging> {
|
||||
return this.queriesApi.findSites(libraryTitle, {
|
||||
maxItems: 1,
|
||||
fields: ['title']
|
||||
});
|
||||
maxItems: 1,
|
||||
fields: ['title']
|
||||
});
|
||||
}
|
||||
|
||||
private forbidSpecialCharacters({ value }: FormControl) {
|
||||
|
@@ -21,8 +21,8 @@ import { Component, Inject, OnInit, Optional, ViewEncapsulation } from '@angular
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
import { FormBuilder, FormGroup } from '@angular/forms';
|
||||
|
||||
import { NodeBodyLock, Node, NodeEntry, NodesApi } from '@alfresco/js-api';
|
||||
import { AlfrescoApiService } from '@alfresco/adf-core';
|
||||
import { NodeBodyLock, Node, NodeEntry } from '@alfresco/js-api';
|
||||
import { ApiClientsService } from '@alfresco/adf-core';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-node-lock',
|
||||
@@ -35,21 +35,18 @@ export class NodeLockDialogComponent implements OnInit {
|
||||
node: Node = null;
|
||||
nodeName: string;
|
||||
|
||||
_nodesApi: NodesApi;
|
||||
get nodesApi(): NodesApi {
|
||||
this._nodesApi = this._nodesApi ?? new NodesApi(this.alfrescoApi.getInstance());
|
||||
return this._nodesApi;
|
||||
get nodesApi() {
|
||||
return this.apiClientsService.get('ContentClient.nodes');
|
||||
}
|
||||
|
||||
constructor(
|
||||
private formBuilder: FormBuilder,
|
||||
public dialog: MatDialogRef<NodeLockDialogComponent>,
|
||||
private alfrescoApi: AlfrescoApiService,
|
||||
private apiClientsService: ApiClientsService,
|
||||
@Optional()
|
||||
@Inject(MAT_DIALOG_DATA)
|
||||
public data: any
|
||||
) {
|
||||
}
|
||||
) { }
|
||||
|
||||
ngOnInit() {
|
||||
const { node } = this.data;
|
||||
|
@@ -43,13 +43,13 @@ import {
|
||||
CustomNoPermissionTemplateDirective,
|
||||
CustomEmptyContentTemplateDirective,
|
||||
RequestPaginationModel,
|
||||
AlfrescoApiService,
|
||||
UserPreferenceValues,
|
||||
LockService,
|
||||
DataRow
|
||||
DataRow,
|
||||
ApiClientsService
|
||||
} from '@alfresco/adf-core';
|
||||
|
||||
import { Node, NodeEntry, NodePaging, NodesApi, Pagination } from '@alfresco/js-api';
|
||||
import { Node, NodeEntry, NodePaging, Pagination } from '@alfresco/js-api';
|
||||
import { Subject, BehaviorSubject, of } from 'rxjs';
|
||||
import { ShareDataRow } from './../data/share-data-row.model';
|
||||
import { ShareDataTableAdapter } from './../data/share-datatable-adapter';
|
||||
@@ -345,21 +345,19 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
|
||||
private loadingTimeout;
|
||||
private onDestroy$ = new Subject<boolean>();
|
||||
|
||||
_nodesApi: NodesApi;
|
||||
get nodesApi(): NodesApi {
|
||||
this._nodesApi = this._nodesApi ?? new NodesApi(this.alfrescoApiService.getInstance());
|
||||
return this._nodesApi;
|
||||
get nodesApi() {
|
||||
return this.apiClientsService.get('ContentClient.nodes');
|
||||
}
|
||||
|
||||
constructor(private documentListService: DocumentListService,
|
||||
private ngZone: NgZone,
|
||||
private elementRef: ElementRef,
|
||||
private appConfig: AppConfigService,
|
||||
private userPreferencesService: UserPreferencesService,
|
||||
private contentService: ContentService,
|
||||
private thumbnailService: ThumbnailService,
|
||||
private alfrescoApiService: AlfrescoApiService,
|
||||
private lockService: LockService) {
|
||||
private ngZone: NgZone,
|
||||
private elementRef: ElementRef,
|
||||
private appConfig: AppConfigService,
|
||||
private userPreferencesService: UserPreferencesService,
|
||||
private contentService: ContentService,
|
||||
private thumbnailService: ThumbnailService,
|
||||
private apiClientsService: ApiClientsService,
|
||||
private lockService: LockService) {
|
||||
this.userPreferencesService
|
||||
.select(UserPreferenceValues.PaginationSize)
|
||||
.pipe(takeUntil(this.onDestroy$))
|
||||
|
@@ -16,11 +16,11 @@
|
||||
*/
|
||||
|
||||
import {
|
||||
AlfrescoApiService, ContentService, LogService, PaginationModel
|
||||
ApiClientsService, ContentService, LogService, PaginationModel
|
||||
} from '@alfresco/adf-core';
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { NodeEntry, NodePaging, NodesApi } from '@alfresco/js-api';
|
||||
import { NodeEntry, NodePaging } from '@alfresco/js-api';
|
||||
import { DocumentLoaderNode } from '../models/document-folder.model';
|
||||
import { Observable, from, throwError, forkJoin } from 'rxjs';
|
||||
import { catchError, map } from 'rxjs/operators';
|
||||
@@ -34,17 +34,16 @@ const ROOT_ID = '-root-';
|
||||
})
|
||||
export class DocumentListService implements DocumentListLoader {
|
||||
|
||||
private _nodesApi: NodesApi;
|
||||
get nodes(): NodesApi {
|
||||
this._nodesApi = this._nodesApi ?? new NodesApi(this.apiService.getInstance());
|
||||
return this._nodesApi;
|
||||
get nodesApi() {
|
||||
return this.apiClientsService.get('ContentClient.nodes');
|
||||
}
|
||||
|
||||
constructor(private contentService: ContentService,
|
||||
private apiService: AlfrescoApiService,
|
||||
private logService: LogService,
|
||||
private customResourcesService: CustomResourcesService) {
|
||||
}
|
||||
constructor(
|
||||
private contentService: ContentService,
|
||||
private apiClientsService: ApiClientsService,
|
||||
private logService: LogService,
|
||||
private customResourcesService: CustomResourcesService
|
||||
) { }
|
||||
|
||||
/**
|
||||
* Deletes a node.
|
||||
|
@@ -16,24 +16,19 @@
|
||||
*/
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { GroupEntry, GroupsApi } from '@alfresco/js-api';
|
||||
import { AlfrescoApiService } from '@alfresco/adf-core';
|
||||
import { GroupEntry } from '@alfresco/js-api';
|
||||
import { ApiClientsService } from '@alfresco/adf-core';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class GroupService {
|
||||
|
||||
_groupsApi: GroupsApi;
|
||||
get groupsApi(): GroupsApi {
|
||||
this._groupsApi = this._groupsApi ?? new GroupsApi(this.alfrescoApiService.getInstance());
|
||||
return this._groupsApi;
|
||||
get groupsApi() {
|
||||
return this.apiClientsService.get('ContentClient.groups');
|
||||
}
|
||||
|
||||
constructor(
|
||||
private alfrescoApiService: AlfrescoApiService
|
||||
) {
|
||||
}
|
||||
constructor(private apiClientsService: ApiClientsService) { }
|
||||
|
||||
async listAllGroupMembershipsForPerson(personId: string, opts?: any, accumulator = []): Promise<GroupEntry[]> {
|
||||
const groupsPaginated = await this.groupsApi.listGroupMembershipsForPerson(personId, opts);
|
||||
|
@@ -16,16 +16,16 @@
|
||||
*/
|
||||
|
||||
import {
|
||||
AlfrescoApiService,
|
||||
NodesApiService,
|
||||
SearchService,
|
||||
TranslationService,
|
||||
EcmUserModel
|
||||
EcmUserModel,
|
||||
ApiClientsService
|
||||
} from '@alfresco/adf-core';
|
||||
import {
|
||||
Group,
|
||||
GroupMemberEntry,
|
||||
GroupMemberPaging, GroupsApi,
|
||||
GroupMemberPaging,
|
||||
Node,
|
||||
PathElement,
|
||||
PermissionElement,
|
||||
@@ -42,17 +42,16 @@ import { RoleModel } from '../models/role.model';
|
||||
})
|
||||
export class NodePermissionService {
|
||||
|
||||
_groupsApi: GroupsApi;
|
||||
get groupsApi(): GroupsApi {
|
||||
this._groupsApi = this._groupsApi ?? new GroupsApi(this.apiService.getInstance());
|
||||
return this._groupsApi;
|
||||
get groupsApi() {
|
||||
return this.apiClientsService.get('ContentClient.groups');
|
||||
}
|
||||
|
||||
constructor(private apiService: AlfrescoApiService,
|
||||
private searchApiService: SearchService,
|
||||
private nodeService: NodesApiService,
|
||||
private translation: TranslationService) {
|
||||
}
|
||||
constructor(
|
||||
private apiClientsService: ApiClientsService,
|
||||
private searchApiService: SearchService,
|
||||
private nodeService: NodesApiService,
|
||||
private translation: TranslationService
|
||||
) { }
|
||||
|
||||
/**
|
||||
* Gets a list of roles for the current node.
|
||||
|
@@ -15,9 +15,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { AlfrescoApiService, LogService } from '@alfresco/adf-core';
|
||||
import { ApiClientsService, LogService } from '@alfresco/adf-core';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { RatingEntry, RatingBody, RatingsApi } from '@alfresco/js-api';
|
||||
import { RatingEntry, RatingBody } from '@alfresco/js-api';
|
||||
import { from, throwError, Observable } from 'rxjs';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
import { RatingServiceInterface } from './rating.service.interface';
|
||||
@@ -27,13 +27,11 @@ import { RatingServiceInterface } from './rating.service.interface';
|
||||
})
|
||||
export class RatingService implements RatingServiceInterface {
|
||||
|
||||
_ratingsApi: RatingsApi;
|
||||
get ratingsApi(): RatingsApi {
|
||||
this._ratingsApi = this._ratingsApi ?? new RatingsApi(this.apiService.getInstance());
|
||||
return this._ratingsApi;
|
||||
get ratingsApi() {
|
||||
return this.apiClientsService.get('ContentClient.ratings');
|
||||
}
|
||||
|
||||
constructor(private apiService: AlfrescoApiService, private logService: LogService) {
|
||||
constructor(private apiClientsService: ApiClientsService, private logService: LogService) {
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -15,11 +15,11 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { AlfrescoApiService, LogService } from '@alfresco/adf-core';
|
||||
import { ApiClientsService, LogService } from '@alfresco/adf-core';
|
||||
import { EventEmitter, Injectable, Output } from '@angular/core';
|
||||
import { Observable, from, throwError } from 'rxjs';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
import { TagBody, TagPaging, TagEntry, TagsApi } from '@alfresco/js-api';
|
||||
import { TagBody, TagPaging, TagEntry } from '@alfresco/js-api';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -27,19 +27,18 @@ import { TagBody, TagPaging, TagEntry, TagsApi } from '@alfresco/js-api';
|
||||
// eslint-disable-next-line @angular-eslint/directive-class-suffix
|
||||
export class TagService {
|
||||
|
||||
_tagsApi: TagsApi;
|
||||
get tagsApi(): TagsApi {
|
||||
this._tagsApi = this._tagsApi ?? new TagsApi(this.apiService.getInstance());
|
||||
return this._tagsApi;
|
||||
get tagsApi() {
|
||||
return this.apiClientsService.get('ContentClient.tags');
|
||||
}
|
||||
|
||||
/** Emitted when tag information is updated. */
|
||||
@Output()
|
||||
refresh = new EventEmitter();
|
||||
|
||||
constructor(private apiService: AlfrescoApiService,
|
||||
private logService: LogService) {
|
||||
}
|
||||
constructor(
|
||||
private apiClientsService: ApiClientsService,
|
||||
private logService: LogService
|
||||
) { }
|
||||
|
||||
/**
|
||||
* Gets a list of tags added to a node.
|
||||
|
@@ -15,9 +15,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { AlfrescoApiService, ContentService } from '@alfresco/adf-core';
|
||||
import { AlfrescoApiService, ApiClientsService, ContentService } from '@alfresco/adf-core';
|
||||
import { Component, Input, OnChanges, ViewEncapsulation, EventEmitter, Output } from '@angular/core';
|
||||
import { VersionsApi, Node, VersionEntry, VersionPaging, NodesApi, NodeEntry, ContentApi } from '@alfresco/js-api';
|
||||
import { Node, VersionEntry, VersionPaging, NodesApi, NodeEntry, ContentApi } from '@alfresco/js-api';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { ConfirmDialogComponent } from '../dialogs/confirm.dialog';
|
||||
import { ContentVersionService } from './content-version.service';
|
||||
@@ -37,16 +37,12 @@ export class VersionListComponent implements OnChanges {
|
||||
return this._contentApi;
|
||||
}
|
||||
|
||||
_versionsApi: VersionsApi;
|
||||
get versionsApi(): VersionsApi {
|
||||
this._versionsApi = this._versionsApi ?? new VersionsApi(this.alfrescoApi.getInstance());
|
||||
return this._versionsApi;
|
||||
get versionsApi() {
|
||||
return this.apiClientsService.get('ContentClient.versions');
|
||||
}
|
||||
|
||||
_nodesApi: NodesApi;
|
||||
get nodesApi(): NodesApi {
|
||||
this._nodesApi = this._nodesApi ?? new NodesApi(this.alfrescoApi.getInstance());
|
||||
return this._nodesApi;
|
||||
get nodesApi() {
|
||||
return this.apiClientsService.get('ContentClient.nodes');
|
||||
}
|
||||
|
||||
versions: VersionEntry[] = [];
|
||||
@@ -84,11 +80,13 @@ export class VersionListComponent implements OnChanges {
|
||||
@Output()
|
||||
viewVersion = new EventEmitter<string>();
|
||||
|
||||
constructor(private alfrescoApi: AlfrescoApiService,
|
||||
private contentService: ContentService,
|
||||
private contentVersionService: ContentVersionService,
|
||||
private dialog: MatDialog) {
|
||||
}
|
||||
constructor(
|
||||
private apiClientsService: ApiClientsService,
|
||||
private alfrescoApi: AlfrescoApiService,
|
||||
private contentService: ContentService,
|
||||
private contentVersionService: ContentVersionService,
|
||||
private dialog: MatDialog
|
||||
) { }
|
||||
|
||||
ngOnChanges() {
|
||||
this.loadVersionHistory();
|
||||
|
@@ -17,6 +17,7 @@
|
||||
|
||||
import { NgModule } from '@angular/core';
|
||||
import { ActivitiClientModule } from './activiti/activiti-client.module';
|
||||
import { ContentClientModule } from './content/content-client.module';
|
||||
import { DiscoveryClientModule } from './discovery/discovery-client.module';
|
||||
import { SearchClientModule } from './search/search-client.module';
|
||||
|
||||
@@ -24,7 +25,8 @@ import { SearchClientModule } from './search/search-client.module';
|
||||
imports: [
|
||||
ActivitiClientModule,
|
||||
DiscoveryClientModule,
|
||||
SearchClientModule
|
||||
SearchClientModule,
|
||||
ContentClientModule
|
||||
]
|
||||
})
|
||||
export class AlfrescoJsClientsModule { }
|
||||
|
80
lib/core/api/clients/content/content-client.module.ts
Normal file
80
lib/core/api/clients/content/content-client.module.ts
Normal file
@@ -0,0 +1,80 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* 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 {
|
||||
AuditApi,
|
||||
CommentsApi,
|
||||
DownloadsApi,
|
||||
FavoritesApi,
|
||||
GroupsApi,
|
||||
NodesApi,
|
||||
PeopleApi,
|
||||
QueriesApi,
|
||||
RatingsApi,
|
||||
RenditionsApi,
|
||||
SharedlinksApi,
|
||||
SitesApi,
|
||||
TagsApi,
|
||||
TrashcanApi,
|
||||
VersionsApi
|
||||
} from '@alfresco/js-api';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { ApiClientsService } from '../../api-clients.service';
|
||||
|
||||
declare global {
|
||||
// eslint-disable-next-line @typescript-eslint/no-namespace
|
||||
namespace Api {
|
||||
interface ApiRegistry {
|
||||
['ContentClient.versions']: VersionsApi;
|
||||
['ContentClient.audit']: AuditApi;
|
||||
['ContentClient.comments']: CommentsApi;
|
||||
['ContentClient.downloads']: DownloadsApi;
|
||||
['ContentClient.favorites']: FavoritesApi;
|
||||
['ContentClient.groups']: GroupsApi;
|
||||
['ContentClient.nodes']: NodesApi;
|
||||
['ContentClient.people']: PeopleApi;
|
||||
['ContentClient.queries']: QueriesApi;
|
||||
['ContentClient.ratings']: RatingsApi;
|
||||
['ContentClient.renditions']: RenditionsApi;
|
||||
['ContentClient.sites']: SitesApi;
|
||||
['ContentClient.sharedlinks']: SharedlinksApi;
|
||||
['ContentClient.tags']: TagsApi;
|
||||
['ContentClient.trashcan']: TrashcanApi;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@NgModule()
|
||||
export class ContentClientModule {
|
||||
constructor(private apiClientsService: ApiClientsService) {
|
||||
this.apiClientsService.register('ContentClient.versions', VersionsApi);
|
||||
this.apiClientsService.register('ContentClient.audit', AuditApi);
|
||||
this.apiClientsService.register('ContentClient.comments', CommentsApi);
|
||||
this.apiClientsService.register('ContentClient.downloads', DownloadsApi);
|
||||
this.apiClientsService.register('ContentClient.favorites', FavoritesApi);
|
||||
this.apiClientsService.register('ContentClient.groups', GroupsApi);
|
||||
this.apiClientsService.register('ContentClient.nodes', NodesApi);
|
||||
this.apiClientsService.register('ContentClient.people', PeopleApi);
|
||||
this.apiClientsService.register('ContentClient.queries', QueriesApi);
|
||||
this.apiClientsService.register('ContentClient.ratings', RatingsApi);
|
||||
this.apiClientsService.register('ContentClient.renditions', RenditionsApi);
|
||||
this.apiClientsService.register('ContentClient.sites', SitesApi);
|
||||
this.apiClientsService.register('ContentClient.sharedlinks', SharedlinksApi);
|
||||
this.apiClientsService.register('ContentClient.tags', TagsApi);
|
||||
this.apiClientsService.register('ContentClient.trashcan', TrashcanApi);
|
||||
}
|
||||
}
|
@@ -16,8 +16,8 @@
|
||||
*/
|
||||
|
||||
import { Directive, HostListener, Input, OnChanges, Output, EventEmitter } from '@angular/core';
|
||||
import { SiteBody, FavoriteBody, FavoriteEntry, Site, FavoritesApi } from '@alfresco/js-api';
|
||||
import { AlfrescoApiService } from '../services/alfresco-api.service';
|
||||
import { SiteBody, FavoriteBody, FavoriteEntry, Site } from '@alfresco/js-api';
|
||||
import { ApiClientsService } from '../api/api-clients.service';
|
||||
|
||||
export interface LibraryEntity {
|
||||
entry: Site;
|
||||
@@ -39,10 +39,8 @@ export class LibraryFavoriteDirective implements OnChanges {
|
||||
|
||||
private targetLibrary = null;
|
||||
|
||||
_favoritesApi: FavoritesApi;
|
||||
get favoritesApi(): FavoritesApi {
|
||||
this._favoritesApi = this._favoritesApi ?? new FavoritesApi(this.alfrescoApiService.getInstance());
|
||||
return this._favoritesApi;
|
||||
get favoritesApi() {
|
||||
return this.apiClientsService.get('ContentClient.favorites');
|
||||
}
|
||||
|
||||
@HostListener('click')
|
||||
@@ -62,8 +60,7 @@ export class LibraryFavoriteDirective implements OnChanges {
|
||||
}
|
||||
}
|
||||
|
||||
constructor(private alfrescoApiService: AlfrescoApiService) {
|
||||
}
|
||||
constructor(private apiClientsService: ApiClientsService) { }
|
||||
|
||||
ngOnChanges(changes) {
|
||||
if (!changes.library.currentValue) {
|
||||
|
@@ -20,13 +20,12 @@ import {
|
||||
SiteEntry,
|
||||
SiteMembershipRequestBody,
|
||||
SiteMemberEntry,
|
||||
SiteMembershipRequestEntry,
|
||||
SitesApi
|
||||
SiteMembershipRequestEntry
|
||||
} from '@alfresco/js-api';
|
||||
import { BehaviorSubject, from, Observable } from 'rxjs';
|
||||
import { AlfrescoApiService } from '../services/alfresco-api.service';
|
||||
import { SitesService } from '../services/sites.service';
|
||||
import { VersionCompatibilityService } from '../services/version-compatibility.service';
|
||||
import { ApiClientsService } from '../api/api-clients.service';
|
||||
|
||||
export interface LibraryMembershipToggleEvent {
|
||||
updatedEntry?: any;
|
||||
@@ -48,10 +47,8 @@ export class LibraryMembershipDirective implements OnChanges {
|
||||
|
||||
isJoinRequested: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);
|
||||
|
||||
_sitesApi: SitesApi;
|
||||
get sitesApi(): SitesApi {
|
||||
this._sitesApi = this._sitesApi ?? new SitesApi(this.alfrescoApiService.getInstance());
|
||||
return this._sitesApi;
|
||||
get sitesApi() {
|
||||
return this.apiClientsService.get('ContentClient.sites');
|
||||
}
|
||||
|
||||
/** Site for which to toggle the membership request. */
|
||||
@@ -75,7 +72,7 @@ export class LibraryMembershipDirective implements OnChanges {
|
||||
}
|
||||
|
||||
constructor(
|
||||
private alfrescoApiService: AlfrescoApiService,
|
||||
private apiClientsService: ApiClientsService,
|
||||
private sitesService: SitesService,
|
||||
private versionCompatibilityService: VersionCompatibilityService
|
||||
) {
|
||||
|
@@ -18,11 +18,11 @@
|
||||
/* eslint-disable @angular-eslint/no-input-rename */
|
||||
|
||||
import { Directive, ElementRef, EventEmitter, HostListener, Input, OnChanges, Output } from '@angular/core';
|
||||
import { NodeEntry, Node, DeletedNodeEntity, DeletedNode, TrashcanApi, NodesApi } from '@alfresco/js-api';
|
||||
import { NodeEntry, Node, DeletedNodeEntity, DeletedNode } from '@alfresco/js-api';
|
||||
import { Observable, forkJoin, from, of } from 'rxjs';
|
||||
import { AlfrescoApiService } from '../services/alfresco-api.service';
|
||||
import { TranslationService } from '../services/translation.service';
|
||||
import { map, catchError, retry } from 'rxjs/operators';
|
||||
import { ApiClientsService } from '../api/api-clients.service';
|
||||
|
||||
interface ProcessedNodeData {
|
||||
entry: Node | DeletedNode;
|
||||
@@ -62,16 +62,12 @@ export class NodeDeleteDirective implements OnChanges {
|
||||
@Output()
|
||||
delete: EventEmitter<any> = new EventEmitter();
|
||||
|
||||
_trashcanApi: TrashcanApi;
|
||||
get trashcanApi(): TrashcanApi {
|
||||
this._trashcanApi = this._trashcanApi ?? new TrashcanApi(this.alfrescoApiService.getInstance());
|
||||
return this._trashcanApi;
|
||||
get trashcanApi() {
|
||||
return this.apiClientsService.get('ContentClient.trashcan');
|
||||
}
|
||||
|
||||
_nodesApi: NodesApi;
|
||||
get nodesApi(): NodesApi {
|
||||
this._nodesApi = this._nodesApi ?? new NodesApi(this.alfrescoApiService.getInstance());
|
||||
return this._nodesApi;
|
||||
get nodesApi() {
|
||||
return this.apiClientsService.get('ContentClient.nodes');
|
||||
}
|
||||
|
||||
@HostListener('click')
|
||||
@@ -79,10 +75,11 @@ export class NodeDeleteDirective implements OnChanges {
|
||||
this.process(this.selection);
|
||||
}
|
||||
|
||||
constructor(private alfrescoApiService: AlfrescoApiService,
|
||||
private translation: TranslationService,
|
||||
private elementRef: ElementRef) {
|
||||
}
|
||||
constructor(
|
||||
private apiClientsService: ApiClientsService,
|
||||
private translation: TranslationService,
|
||||
private elementRef: ElementRef
|
||||
) { }
|
||||
|
||||
ngOnChanges() {
|
||||
if (!this.selection || (this.selection && this.selection.length === 0)) {
|
||||
|
@@ -18,10 +18,10 @@
|
||||
/* eslint-disable @angular-eslint/no-input-rename */
|
||||
|
||||
import { Directive, EventEmitter, HostListener, Input, OnChanges, Output } from '@angular/core';
|
||||
import { FavoriteBody, NodeEntry, SharedLinkEntry, Node, SharedLink, FavoritesApi } from '@alfresco/js-api';
|
||||
import { FavoriteBody, NodeEntry, SharedLinkEntry, Node, SharedLink } from '@alfresco/js-api';
|
||||
import { Observable, from, forkJoin, of } from 'rxjs';
|
||||
import { AlfrescoApiService } from '../services/alfresco-api.service';
|
||||
import { catchError, map } from 'rxjs/operators';
|
||||
import { ApiClientsService } from '../api/api-clients.service';
|
||||
|
||||
@Directive({
|
||||
selector: '[adf-node-favorite]',
|
||||
@@ -30,10 +30,8 @@ import { catchError, map } from 'rxjs/operators';
|
||||
export class NodeFavoriteDirective implements OnChanges {
|
||||
favorites: any[] = [];
|
||||
|
||||
_favoritesApi: FavoritesApi;
|
||||
get favoritesApi(): FavoritesApi {
|
||||
this._favoritesApi = this._favoritesApi ?? new FavoritesApi(this.alfrescoApiService.getInstance());
|
||||
return this._favoritesApi;
|
||||
get favoritesApi() {
|
||||
return this.apiClientsService.get('ContentClient.favorites');
|
||||
}
|
||||
|
||||
/** Array of nodes to toggle as favorites. */
|
||||
@@ -51,8 +49,7 @@ export class NodeFavoriteDirective implements OnChanges {
|
||||
this.toggleFavorite();
|
||||
}
|
||||
|
||||
constructor(private alfrescoApiService: AlfrescoApiService) {
|
||||
}
|
||||
constructor(private apiClientsService: ApiClientsService) { }
|
||||
|
||||
ngOnChanges(changes) {
|
||||
if (!changes.selection.currentValue.length) {
|
||||
|
@@ -18,11 +18,11 @@
|
||||
/* eslint-disable @angular-eslint/component-selector, @angular-eslint/no-input-rename */
|
||||
|
||||
import { Directive, EventEmitter, HostListener, Input, Output } from '@angular/core';
|
||||
import { TrashcanApi, DeletedNodeEntry, DeletedNodesPaging, PathInfoEntity } from '@alfresco/js-api';
|
||||
import { DeletedNodeEntry, DeletedNodesPaging, PathInfoEntity } from '@alfresco/js-api';
|
||||
import { Observable, forkJoin, from, of } from 'rxjs';
|
||||
import { AlfrescoApiService } from '../services/alfresco-api.service';
|
||||
import { TranslationService } from '../services/translation.service';
|
||||
import { tap, mergeMap, map, catchError } from 'rxjs/operators';
|
||||
import { ApiClientsService } from '../api/api-clients.service';
|
||||
|
||||
export class RestoreMessageModel {
|
||||
message: string;
|
||||
@@ -36,10 +36,8 @@ export class RestoreMessageModel {
|
||||
export class NodeRestoreDirective {
|
||||
private readonly restoreProcessStatus;
|
||||
|
||||
_trashcanApi: TrashcanApi;
|
||||
get trashcanApi(): TrashcanApi {
|
||||
this._trashcanApi = this._trashcanApi ?? new TrashcanApi(this.alfrescoApiService.getInstance());
|
||||
return this._trashcanApi;
|
||||
get trashcanApi() {
|
||||
return this.apiClientsService.get('ContentClient.trashcan');
|
||||
}
|
||||
|
||||
/** Array of deleted nodes to restore. */
|
||||
@@ -55,8 +53,10 @@ export class NodeRestoreDirective {
|
||||
this.recover(this.selection);
|
||||
}
|
||||
|
||||
constructor(private alfrescoApiService: AlfrescoApiService,
|
||||
private translation: TranslationService) {
|
||||
constructor(
|
||||
private apiClientsService: ApiClientsService,
|
||||
private translation: TranslationService
|
||||
) {
|
||||
this.restoreProcessStatus = this.processStatus();
|
||||
}
|
||||
|
||||
@@ -78,18 +78,18 @@ export class NodeRestoreDirective {
|
||||
}),
|
||||
mergeMap(() => this.getDeletedNodes())
|
||||
)
|
||||
.subscribe((deletedNodesList) => {
|
||||
const { entries: nodeList } = deletedNodesList.list;
|
||||
const { fail: restoreErrorNodes } = this.restoreProcessStatus;
|
||||
const selectedNodes = this.diff(restoreErrorNodes, selection, false);
|
||||
const remainingNodes = this.diff(selectedNodes, nodeList);
|
||||
.subscribe((deletedNodesList) => {
|
||||
const { entries: nodeList } = deletedNodesList.list;
|
||||
const { fail: restoreErrorNodes } = this.restoreProcessStatus;
|
||||
const selectedNodes = this.diff(restoreErrorNodes, selection, false);
|
||||
const remainingNodes = this.diff(selectedNodes, nodeList);
|
||||
|
||||
if (!remainingNodes.length) {
|
||||
this.notification();
|
||||
} else {
|
||||
this.recover(remainingNodes);
|
||||
}
|
||||
});
|
||||
if (!remainingNodes.length) {
|
||||
this.notification();
|
||||
} else {
|
||||
this.recover(remainingNodes);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.restoreProcessStatus.fail.push(...selection);
|
||||
this.notification();
|
||||
|
@@ -22,11 +22,12 @@ import { CookieService } from './cookie.service';
|
||||
import { LogService } from './log.service';
|
||||
import { RedirectionModel } from '../models/redirection.model';
|
||||
import { AppConfigService, AppConfigValues } from '../app-config/app-config.service';
|
||||
import { PeopleApi, UserProfileApi, UserRepresentation } from '@alfresco/js-api';
|
||||
import { UserProfileApi, UserRepresentation } from '@alfresco/js-api';
|
||||
import { map, catchError, tap } from 'rxjs/operators';
|
||||
import { HttpHeaders } from '@angular/common/http';
|
||||
import { JwtHelperService } from './jwt-helper.service';
|
||||
import { StorageService } from './storage.service';
|
||||
import { ApiClientsService } from '../api/api-clients.service';
|
||||
|
||||
const REMEMBER_ME_COOKIE_KEY = 'ALFRESCO_REMEMBER_ME';
|
||||
const REMEMBER_ME_UNTIL = 1000 * 60 * 60 * 24 * 30;
|
||||
@@ -48,10 +49,8 @@ export class AuthenticationService {
|
||||
*/
|
||||
onLogout: ReplaySubject<any> = new ReplaySubject<any>(1);
|
||||
|
||||
_peopleApi: PeopleApi;
|
||||
get peopleApi(): PeopleApi {
|
||||
this._peopleApi = this._peopleApi ?? new PeopleApi(this.alfrescoApi.getInstance());
|
||||
return this._peopleApi;
|
||||
get peopleApi() {
|
||||
return this.apiClientsService.get('ContentClient.people');
|
||||
}
|
||||
|
||||
_profileApi: UserProfileApi;
|
||||
@@ -65,7 +64,9 @@ export class AuthenticationService {
|
||||
private storageService: StorageService,
|
||||
private alfrescoApi: AlfrescoApiService,
|
||||
private cookie: CookieService,
|
||||
private logService: LogService) {
|
||||
private logService: LogService,
|
||||
private apiClientsService: ApiClientsService
|
||||
) {
|
||||
this.alfrescoApi.alfrescoApiInitialized.subscribe(() => {
|
||||
this.alfrescoApi.getInstance().reply('logged-in', () => {
|
||||
this.onLogin.next();
|
||||
|
@@ -18,25 +18,21 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable, from, throwError } from 'rxjs';
|
||||
import { CommentModel } from '../models/comment.model';
|
||||
import { AlfrescoApiService } from '../services/alfresco-api.service';
|
||||
import { LogService } from '../services/log.service';
|
||||
import { map, catchError } from 'rxjs/operators';
|
||||
import { CommentEntry, CommentsApi } from '@alfresco/js-api';
|
||||
import { CommentEntry } from '@alfresco/js-api';
|
||||
import { ApiClientsService } from '../api/api-clients.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class CommentContentService {
|
||||
|
||||
_commentsApi: CommentsApi;
|
||||
get commentsApi(): CommentsApi {
|
||||
this._commentsApi = this._commentsApi ?? new CommentsApi(this.apiService.getInstance());
|
||||
return this._commentsApi;
|
||||
get commentsApi() {
|
||||
return this.apiClientsService.get('ContentClient.comments');
|
||||
}
|
||||
|
||||
constructor(private apiService: AlfrescoApiService,
|
||||
private logService: LogService) {
|
||||
}
|
||||
constructor(private apiClientsService: ApiClientsService, private logService: LogService) { }
|
||||
|
||||
/**
|
||||
* Adds a comment to a node.
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { DomSanitizer } from '@angular/platform-browser';
|
||||
import { ContentApi, MinimalNode, Node, NodeEntry, NodesApi } from '@alfresco/js-api';
|
||||
import { ContentApi, MinimalNode, Node, NodeEntry } from '@alfresco/js-api';
|
||||
import { Observable, Subject, from, throwError } from 'rxjs';
|
||||
import { FolderCreatedEvent } from '../events/folder-created.event';
|
||||
import { AlfrescoApiService } from './alfresco-api.service';
|
||||
@@ -28,6 +28,7 @@ import { PermissionsEnum } from '../models/permissions.enum';
|
||||
import { AllowableOperationsEnum } from '../models/allowable-operations.enum';
|
||||
import { DownloadService } from './download.service';
|
||||
import { ThumbnailService } from './thumbnail.service';
|
||||
import { ApiClientsService } from '../api/api-clients.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -44,19 +45,19 @@ export class ContentService {
|
||||
return this._contentApi;
|
||||
}
|
||||
|
||||
_nodesApi: NodesApi;
|
||||
get nodesApi(): NodesApi {
|
||||
this._nodesApi = this._nodesApi ?? new NodesApi(this.apiService.getInstance());
|
||||
return this._nodesApi;
|
||||
get nodesApi() {
|
||||
return this.apiClientsService.get('ContentClient.nodes');
|
||||
}
|
||||
|
||||
constructor(public authService: AuthenticationService,
|
||||
public apiService: AlfrescoApiService,
|
||||
private logService: LogService,
|
||||
private sanitizer: DomSanitizer,
|
||||
private downloadService: DownloadService,
|
||||
private thumbnailService: ThumbnailService) {
|
||||
}
|
||||
constructor(
|
||||
public authService: AuthenticationService,
|
||||
public apiService: AlfrescoApiService,
|
||||
private logService: LogService,
|
||||
private sanitizer: DomSanitizer,
|
||||
private downloadService: DownloadService,
|
||||
private thumbnailService: ThumbnailService,
|
||||
private apiClientsService: ApiClientsService
|
||||
) { }
|
||||
|
||||
/**
|
||||
* @deprecated in 3.2.0, use DownloadService instead.
|
||||
|
@@ -18,33 +18,28 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable, from, of } from 'rxjs';
|
||||
|
||||
import { NodePaging, NodesApi, TrashcanApi } from '@alfresco/js-api';
|
||||
import { AlfrescoApiService } from './alfresco-api.service';
|
||||
import { NodePaging } from '@alfresco/js-api';
|
||||
import { UserPreferencesService } from './user-preferences.service';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
import { ApiClientsService } from '../api/api-clients.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class DeletedNodesApiService {
|
||||
|
||||
_nodesApi: NodesApi;
|
||||
get nodesApi(): NodesApi {
|
||||
this._nodesApi = this._nodesApi ?? new NodesApi(this.apiService.getInstance());
|
||||
return this._nodesApi;
|
||||
get nodesApi() {
|
||||
return this.apiClientsService.get('ContentClient.nodes');
|
||||
}
|
||||
|
||||
_trashcanApi: TrashcanApi;
|
||||
get trashcanApi(): TrashcanApi {
|
||||
this._trashcanApi = this._trashcanApi ?? new TrashcanApi(this.apiService.getInstance());
|
||||
return this._trashcanApi;
|
||||
get trashcanApi() {
|
||||
return this.apiClientsService.get('ContentClient.trashcan');
|
||||
}
|
||||
|
||||
constructor(
|
||||
private apiService: AlfrescoApiService,
|
||||
private preferences: UserPreferencesService
|
||||
) {
|
||||
}
|
||||
private preferences: UserPreferencesService,
|
||||
private apiClientsService: ApiClientsService
|
||||
) { }
|
||||
|
||||
/**
|
||||
* Gets a list of nodes in the trash.
|
||||
@@ -54,7 +49,7 @@ export class DeletedNodesApiService {
|
||||
*/
|
||||
getDeletedNodes(options?: any): Observable<NodePaging> {
|
||||
const defaultOptions = {
|
||||
include: [ 'path', 'properties' ],
|
||||
include: ['path', 'properties'],
|
||||
maxItems: this.preferences.paginationSize,
|
||||
skipCount: 0
|
||||
};
|
||||
|
@@ -19,23 +19,19 @@ import { DownloadEntry, DownloadBodyCreate, DownloadsApi } from '@alfresco/js-ap
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable, from, throwError } from 'rxjs';
|
||||
import { LogService } from './log.service';
|
||||
import { AlfrescoApiService } from './alfresco-api.service';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
import { ApiClientsService } from '../api/api-clients.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class DownloadZipService {
|
||||
|
||||
private _downloadsApi: DownloadsApi;
|
||||
get downloadsApi(): DownloadsApi {
|
||||
this._downloadsApi = this._downloadsApi ?? new DownloadsApi(this.apiService.getInstance());
|
||||
return this._downloadsApi;
|
||||
return this.apiClientsService.get('ContentClient.downloads');
|
||||
}
|
||||
|
||||
constructor(private apiService: AlfrescoApiService,
|
||||
private logService: LogService) {
|
||||
}
|
||||
constructor(private apiClientsService: ApiClientsService, private logService: LogService) { }
|
||||
|
||||
/**
|
||||
* Creates a new download.
|
||||
|
@@ -19,24 +19,22 @@ import { Injectable } from '@angular/core';
|
||||
import { Observable, from } from 'rxjs';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { ContentService } from './content.service';
|
||||
import { AlfrescoApiService } from './alfresco-api.service';
|
||||
import { EcmUserModel } from '../models/ecm-user.model';
|
||||
import { PeopleApi } from '@alfresco/js-api';
|
||||
import { ApiClientsService } from '../api/api-clients.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class EcmUserService {
|
||||
|
||||
_peopleApi: PeopleApi;
|
||||
get peopleApi(): PeopleApi {
|
||||
this._peopleApi = this._peopleApi ?? new PeopleApi(this.apiService.getInstance());
|
||||
return this._peopleApi;
|
||||
get peopleApi() {
|
||||
return this.apiClientsService.get('ContentClient.people');
|
||||
}
|
||||
|
||||
constructor(private apiService: AlfrescoApiService,
|
||||
private contentService: ContentService) {
|
||||
}
|
||||
constructor(
|
||||
private apiClientsService: ApiClientsService,
|
||||
private contentService: ContentService
|
||||
) { }
|
||||
|
||||
/**
|
||||
* Gets information about a user identified by their username.
|
||||
|
@@ -19,9 +19,10 @@ import { Injectable } from '@angular/core';
|
||||
import {
|
||||
AlfrescoApiCompatibility,
|
||||
ContentApi,
|
||||
Node, NodesApi
|
||||
Node
|
||||
} from '@alfresco/js-api';
|
||||
import { ReplaySubject, Subject } from 'rxjs';
|
||||
import { ApiClientsService } from '../api/api-clients.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -36,7 +37,6 @@ export class ExternalAlfrescoApiService {
|
||||
alfrescoApiInitialized: ReplaySubject<boolean> = new ReplaySubject(1);
|
||||
|
||||
protected alfrescoApi: AlfrescoApiCompatibility;
|
||||
_nodesApi: NodesApi;
|
||||
|
||||
getInstance(): AlfrescoApiCompatibility {
|
||||
return this.alfrescoApi;
|
||||
@@ -46,11 +46,12 @@ export class ExternalAlfrescoApiService {
|
||||
return this.getInstance().content;
|
||||
}
|
||||
|
||||
get nodesApi(): NodesApi {
|
||||
this._nodesApi = this._nodesApi ?? new NodesApi(this.getInstance());
|
||||
return this._nodesApi;
|
||||
get nodesApi() {
|
||||
return this.apiClientsService.get('ContentClient.nodes');
|
||||
}
|
||||
|
||||
constructor(private apiClientsService: ApiClientsService) { }
|
||||
|
||||
init(ecmHost: string, contextRoot: string) {
|
||||
|
||||
const domainPrefix = this.createPrefixFromHost(ecmHost);
|
||||
|
@@ -16,21 +16,19 @@
|
||||
*/
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { FavoritesApi, NodePaging, FavoritePaging } from '@alfresco/js-api';
|
||||
import { NodePaging, FavoritePaging } from '@alfresco/js-api';
|
||||
import { Observable, from, of } from 'rxjs';
|
||||
import { AlfrescoApiService } from './alfresco-api.service';
|
||||
import { UserPreferencesService } from './user-preferences.service';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
import { ApiClientsService } from '../api/api-clients.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class FavoritesApiService {
|
||||
|
||||
_favoritesApi: FavoritesApi;
|
||||
get favoritesApi(): FavoritesApi {
|
||||
this._favoritesApi = this._favoritesApi ?? new FavoritesApi(this.apiService.getInstance());
|
||||
return this._favoritesApi;
|
||||
get favoritesApi() {
|
||||
return this.apiClientsService.get('ContentClient.favorites');
|
||||
}
|
||||
|
||||
static remapEntry({ entry }: any): any {
|
||||
@@ -43,10 +41,9 @@ export class FavoritesApiService {
|
||||
}
|
||||
|
||||
constructor(
|
||||
private apiService: AlfrescoApiService,
|
||||
private apiClientsService: ApiClientsService,
|
||||
private preferences: UserPreferencesService
|
||||
) {
|
||||
}
|
||||
) { }
|
||||
|
||||
remapFavoritesData(data: FavoritePaging = {}): NodePaging {
|
||||
const pagination = (data?.list?.pagination || {});
|
||||
|
@@ -16,33 +16,30 @@
|
||||
*/
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { MinimalNode, NodeEntry, NodePaging, NodesApi, TrashcanApi } from '@alfresco/js-api';
|
||||
import { MinimalNode, NodeEntry, NodePaging } from '@alfresco/js-api';
|
||||
import { from, Observable, throwError } from 'rxjs';
|
||||
import { AlfrescoApiService } from './alfresco-api.service';
|
||||
import { UserPreferencesService } from './user-preferences.service';
|
||||
import { catchError, map } from 'rxjs/operators';
|
||||
import { NodeMetadata } from '../models/node-metadata.model';
|
||||
import { ApiClientsService } from '../api/api-clients.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class NodesApiService {
|
||||
|
||||
_trashcanApi: TrashcanApi;
|
||||
get trashcanApi(): TrashcanApi {
|
||||
this._trashcanApi = this._trashcanApi ?? new TrashcanApi(this.apiService.getInstance());
|
||||
return this._trashcanApi;
|
||||
get trashcanApi() {
|
||||
return this.apiClientsService.get('ContentClient.trashcan');
|
||||
}
|
||||
|
||||
_nodesApi: NodesApi;
|
||||
get nodesApi(): NodesApi {
|
||||
this._nodesApi = this._nodesApi ?? new NodesApi(this.apiService.getInstance());
|
||||
return this._nodesApi;
|
||||
get nodesApi() {
|
||||
return this.apiClientsService.get('ContentClient.nodes');
|
||||
}
|
||||
|
||||
constructor(private apiService: AlfrescoApiService,
|
||||
private preferences: UserPreferencesService) {
|
||||
}
|
||||
constructor(
|
||||
private preferences: UserPreferencesService,
|
||||
private apiClientsService: ApiClientsService
|
||||
) { }
|
||||
|
||||
private getEntryFromEntity(entity: NodeEntry) {
|
||||
return entity.entry;
|
||||
@@ -227,9 +224,9 @@ export class NodesApiService {
|
||||
for (const key in nodeEntry.entry.properties) {
|
||||
if (key) {
|
||||
if (key.indexOf(':') !== -1) {
|
||||
metadata [key.split(':')[1]] = nodeEntry.entry.properties[key];
|
||||
metadata[key.split(':')[1]] = nodeEntry.entry.properties[key];
|
||||
} else {
|
||||
metadata [key] = nodeEntry.entry.properties[key];
|
||||
metadata[key] = nodeEntry.entry.properties[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -17,12 +17,12 @@
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable, from, throwError } from 'rxjs';
|
||||
import { AlfrescoApiService } from './alfresco-api.service';
|
||||
import { catchError, map } from 'rxjs/operators';
|
||||
import { PersonEntry, PeopleApi, PersonBodyCreate, Pagination, PersonBodyUpdate } from '@alfresco/js-api';
|
||||
import { PersonEntry, PersonBodyCreate, Pagination, PersonBodyUpdate } from '@alfresco/js-api';
|
||||
import { EcmUserModel } from '../models/ecm-user.model';
|
||||
import { LogService } from './log.service';
|
||||
import { AuthenticationService } from './authentication.service';
|
||||
import { ApiClientsService } from '../api/api-clients.service';
|
||||
|
||||
// eslint-disable-next-line no-shadow
|
||||
export enum ContentGroups {
|
||||
@@ -52,14 +52,12 @@ export class PeopleContentService {
|
||||
private hasContentAdminRole: boolean = false;
|
||||
hasCheckedIsContentAdmin: boolean = false;
|
||||
|
||||
private _peopleApi: PeopleApi;
|
||||
get peopleApi(): PeopleApi {
|
||||
this._peopleApi = this._peopleApi ?? new PeopleApi(this.apiService.getInstance());
|
||||
return this._peopleApi;
|
||||
get peopleApi() {
|
||||
return this.apiClientsService.get('ContentClient.people');
|
||||
}
|
||||
|
||||
constructor(
|
||||
private apiService: AlfrescoApiService,
|
||||
private apiClientsService: ApiClientsService,
|
||||
authenticationService: AuthenticationService,
|
||||
private logService: LogService
|
||||
) {
|
||||
|
@@ -16,20 +16,19 @@
|
||||
*/
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { RenditionEntry, RenditionPaging, RenditionsApi, ContentApi } from '@alfresco/js-api';
|
||||
import { RenditionEntry, RenditionPaging, ContentApi } from '@alfresco/js-api';
|
||||
import { Observable, from, interval, empty } from 'rxjs';
|
||||
import { AlfrescoApiService } from './alfresco-api.service';
|
||||
import { concatMap, switchMap, takeWhile, map } from 'rxjs/operators';
|
||||
import { ApiClientsService } from '../api/api-clients.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class RenditionsService {
|
||||
|
||||
private _renditionsApi: RenditionsApi;
|
||||
get renditionsApi(): RenditionsApi {
|
||||
this._renditionsApi = this._renditionsApi ?? new RenditionsApi(this.apiService.getInstance());
|
||||
return this._renditionsApi;
|
||||
get renditionsApi() {
|
||||
return this.apiClientsService.get('ContentClient.renditions');
|
||||
}
|
||||
|
||||
private _contentApi: ContentApi;
|
||||
@@ -38,7 +37,7 @@ export class RenditionsService {
|
||||
return this._contentApi;
|
||||
}
|
||||
|
||||
constructor(private apiService: AlfrescoApiService) {
|
||||
constructor(private apiClientsService: ApiClientsService, private apiService: AlfrescoApiService) {
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -16,11 +16,11 @@
|
||||
*/
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { NodePaging, SharedLinkEntry, SharedlinksApi } from '@alfresco/js-api';
|
||||
import { NodePaging, SharedLinkEntry } from '@alfresco/js-api';
|
||||
import { Observable, from, of, Subject } from 'rxjs';
|
||||
import { AlfrescoApiService } from './alfresco-api.service';
|
||||
import { UserPreferencesService } from './user-preferences.service';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
import { ApiClientsService } from '../api/api-clients.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -29,15 +29,14 @@ export class SharedLinksApiService {
|
||||
|
||||
error = new Subject<{ statusCode: number; message: string }>();
|
||||
|
||||
private _sharedLinksApi: SharedlinksApi;
|
||||
get sharedLinksApi(): SharedlinksApi {
|
||||
this._sharedLinksApi = this._sharedLinksApi ?? new SharedlinksApi(this.apiService.getInstance());
|
||||
return this._sharedLinksApi;
|
||||
get sharedLinksApi() {
|
||||
return this.apiClientsService.get('ContentClient.sharedlinks');
|
||||
}
|
||||
|
||||
constructor(private apiService: AlfrescoApiService,
|
||||
private preferences: UserPreferencesService) {
|
||||
}
|
||||
constructor(
|
||||
private apiClientsService: ApiClientsService,
|
||||
private preferences: UserPreferencesService
|
||||
) { }
|
||||
|
||||
/**
|
||||
* Gets shared links available to the current user.
|
||||
|
@@ -29,25 +29,26 @@ import {
|
||||
SiteMembershipBodyCreate,
|
||||
SiteMembershipBodyUpdate,
|
||||
SiteMembershipRequestWithPersonPaging,
|
||||
SitePaging,
|
||||
SitesApi
|
||||
SitePaging
|
||||
} from '@alfresco/js-api';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
import { LogService } from './log.service';
|
||||
import { ApiClientsService } from '../api/api-clients.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class SitesService {
|
||||
|
||||
private _sitesApi: SitesApi;
|
||||
get sitesApi(): SitesApi {
|
||||
this._sitesApi = this._sitesApi ?? new SitesApi(this.apiService.getInstance());
|
||||
return this._sitesApi;
|
||||
get sitesApi() {
|
||||
return this.apiClientsService.get('ContentClient.sites');
|
||||
}
|
||||
|
||||
constructor(private apiService: AlfrescoApiService, private logService: LogService) {
|
||||
}
|
||||
constructor(
|
||||
private apiService: AlfrescoApiService,
|
||||
private logService: LogService,
|
||||
private apiClientsService: ApiClientsService
|
||||
) { }
|
||||
|
||||
/**
|
||||
* Create a site
|
||||
|
@@ -29,7 +29,8 @@ import { FileModel, FileUploadProgress, FileUploadStatus } from '../models/file.
|
||||
import { AlfrescoApiService } from './alfresco-api.service';
|
||||
import { DiscoveryApiService } from './discovery-api.service';
|
||||
import { filter } from 'rxjs/operators';
|
||||
import { NodesApi, UploadApi, VersionsApi } from '@alfresco/js-api';
|
||||
import { NodesApi, UploadApi } from '@alfresco/js-api';
|
||||
import { ApiClientsService } from '../api/api-clients.service';
|
||||
|
||||
const MIN_CANCELLABLE_FILE_SIZE = 1000000;
|
||||
const MAX_CANCELLABLE_FILE_PERCENTAGE = 50;
|
||||
@@ -67,19 +68,16 @@ export class UploadService {
|
||||
return this._uploadApi;
|
||||
}
|
||||
|
||||
private _nodesApi: NodesApi;
|
||||
get nodesApi(): NodesApi {
|
||||
this._nodesApi = this._nodesApi ?? new NodesApi(this.apiService.getInstance());
|
||||
return this._nodesApi;
|
||||
get nodesApi() {
|
||||
return this.apiClientsService.get('ContentClient.nodes');
|
||||
}
|
||||
|
||||
private _versionsApi: VersionsApi;
|
||||
get versionsApi(): VersionsApi {
|
||||
this._versionsApi = this._versionsApi ?? new VersionsApi(this.apiService.getInstance());
|
||||
return this._versionsApi;
|
||||
get versionsApi() {
|
||||
return this.apiClientsService.get('ContentClient.versions');
|
||||
}
|
||||
|
||||
constructor(
|
||||
private apiClientsService: ApiClientsService,
|
||||
protected apiService: AlfrescoApiService,
|
||||
private appConfigService: AppConfigService,
|
||||
private discoveryApiService: DiscoveryApiService) {
|
||||
@@ -237,7 +235,7 @@ export class UploadService {
|
||||
if (file.id) {
|
||||
return this.nodesApi.updateNodeContent(file.id, file.file as any, opts);
|
||||
} else {
|
||||
const nodeBody = { ... file.options };
|
||||
const nodeBody = { ...file.options };
|
||||
delete nodeBody['versioningEnabled'];
|
||||
|
||||
return this.uploadApi.uploadFile(
|
||||
|
@@ -27,7 +27,9 @@ import {
|
||||
RenditionEntry,
|
||||
NodeEntry,
|
||||
VersionEntry,
|
||||
SharedlinksApi, VersionsApi, NodesApi, ContentApi
|
||||
SharedlinksApi,
|
||||
NodesApi,
|
||||
ContentApi
|
||||
} from '@alfresco/js-api';
|
||||
import { BaseEvent } from '../../events';
|
||||
import { AlfrescoApiService } from '../../services/alfresco-api.service';
|
||||
@@ -44,6 +46,7 @@ import { MatDialog } from '@angular/material/dialog';
|
||||
import { ContentService } from '../../services/content.service';
|
||||
import { UploadService } from '../../services/upload.service';
|
||||
import { FileModel } from '../../models';
|
||||
import { ApiClientsService } from '../../api/api-clients.service';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-viewer',
|
||||
@@ -279,22 +282,16 @@ export class ViewerComponent implements OnChanges, OnInit, OnDestroy {
|
||||
private shouldCloseViewer = true;
|
||||
private keyDown$ = fromEvent<KeyboardEvent>(document, 'keydown');
|
||||
|
||||
_sharedLinksApi: SharedlinksApi;
|
||||
get sharedLinksApi(): SharedlinksApi {
|
||||
this._sharedLinksApi = this._sharedLinksApi ?? new SharedlinksApi(this.apiService.getInstance());
|
||||
return this._sharedLinksApi;
|
||||
get sharedLinksApi() {
|
||||
return this.apiClientsService.get('ContentClient.sharedlinks');
|
||||
}
|
||||
|
||||
_versionsApi: VersionsApi;
|
||||
get versionsApi(): VersionsApi {
|
||||
this._versionsApi = this._versionsApi ?? new VersionsApi(this.apiService.getInstance());
|
||||
return this._versionsApi;
|
||||
get versionsApi() {
|
||||
return this.apiClientsService.get('ContentClient.versions');
|
||||
}
|
||||
|
||||
_nodesApi: NodesApi;
|
||||
get nodesApi(): NodesApi {
|
||||
this._nodesApi = this._nodesApi ?? new NodesApi(this.apiService.getInstance());
|
||||
return this._nodesApi;
|
||||
get nodesApi() {
|
||||
return this.apiClientsService.get('ContentClient.nodes');
|
||||
}
|
||||
|
||||
_contentApi: ContentApi;
|
||||
@@ -303,15 +300,18 @@ export class ViewerComponent implements OnChanges, OnInit, OnDestroy {
|
||||
return this._contentApi;
|
||||
}
|
||||
|
||||
constructor(private apiService: AlfrescoApiService,
|
||||
private viewUtilService: ViewUtilService,
|
||||
private logService: LogService,
|
||||
private extensionService: AppExtensionService,
|
||||
private contentService: ContentService,
|
||||
private uploadService: UploadService,
|
||||
private el: ElementRef,
|
||||
public dialog: MatDialog,
|
||||
private cdr: ChangeDetectorRef) {
|
||||
constructor(
|
||||
private apiClientsService: ApiClientsService,
|
||||
private apiService: AlfrescoApiService,
|
||||
private viewUtilService: ViewUtilService,
|
||||
private logService: LogService,
|
||||
private extensionService: AppExtensionService,
|
||||
private contentService: ContentService,
|
||||
private uploadService: UploadService,
|
||||
private el: ElementRef,
|
||||
public dialog: MatDialog,
|
||||
private cdr: ChangeDetectorRef
|
||||
) {
|
||||
viewUtilService.maxRetries = this.maxRetries;
|
||||
}
|
||||
|
||||
@@ -322,8 +322,8 @@ export class ViewerComponent implements OnChanges, OnInit, OnDestroy {
|
||||
ngOnInit() {
|
||||
this.apiService.nodeUpdated.pipe(
|
||||
filter((node) => node && node.id === this.nodeId &&
|
||||
(node.name !== this.fileName ||
|
||||
this.getNodeVersionProperty(this.nodeEntry.entry) !== this.getNodeVersionProperty(node))),
|
||||
(node.name !== this.fileName ||
|
||||
this.getNodeVersionProperty(this.nodeEntry.entry) !== this.getNodeVersionProperty(node))),
|
||||
takeUntil(this.onDestroy$)
|
||||
).subscribe((node) => this.onNodeUpdated(node));
|
||||
|
||||
|
@@ -16,12 +16,13 @@
|
||||
*/
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ContentApi, RenditionEntry, RenditionPaging, RenditionsApi, VersionsApi } from '@alfresco/js-api';
|
||||
import { ContentApi, RenditionEntry, RenditionPaging, RenditionsApi } from '@alfresco/js-api';
|
||||
import { AlfrescoApiService } from '../../services/alfresco-api.service';
|
||||
import { LogService } from '../../services/log.service';
|
||||
import { Subject } from 'rxjs';
|
||||
import { Track } from '../models/viewer.model';
|
||||
import { TranslationService } from '../../services/translation.service';
|
||||
import { ApiClientsService } from '../../api/api-clients.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -33,7 +34,7 @@ export class ViewUtilService {
|
||||
* Content groups based on categorization of files that can be viewed in the web browser. This
|
||||
* implementation or grouping is tied to the definition the ng component: ViewerComponent
|
||||
*/
|
||||
// tslint:disable-next-line:variable-name
|
||||
// tslint:disable-next-line:variable-name
|
||||
static ContentGroup = {
|
||||
IMAGE: 'image',
|
||||
MEDIA: 'media',
|
||||
@@ -74,10 +75,8 @@ export class ViewUtilService {
|
||||
viewerTypeChange: Subject<string> = new Subject<string>();
|
||||
urlFileContentChange: Subject<string> = new Subject<string>();
|
||||
|
||||
_renditionsApi: RenditionsApi;
|
||||
get renditionsApi(): RenditionsApi {
|
||||
this._renditionsApi = this._renditionsApi ?? new RenditionsApi(this.apiService.getInstance());
|
||||
return this._renditionsApi;
|
||||
get renditionsApi() {
|
||||
return this.apiClientsService.get('ContentClient.renditions');
|
||||
}
|
||||
|
||||
_contentApi: ContentApi;
|
||||
@@ -86,16 +85,16 @@ export class ViewUtilService {
|
||||
return this._contentApi;
|
||||
}
|
||||
|
||||
_versionsApi: VersionsApi;
|
||||
get versionsApi(): VersionsApi {
|
||||
this._versionsApi = this._versionsApi ?? new VersionsApi(this.apiService.getInstance());
|
||||
return this._versionsApi;
|
||||
get versionsApi() {
|
||||
return this.apiClientsService.get('ContentClient.versions');
|
||||
}
|
||||
|
||||
constructor(private apiService: AlfrescoApiService,
|
||||
private logService: LogService,
|
||||
private translateService: TranslationService) {
|
||||
}
|
||||
constructor(
|
||||
private apiClientsService: ApiClientsService,
|
||||
private apiService: AlfrescoApiService,
|
||||
private logService: LogService,
|
||||
private translateService: TranslationService
|
||||
) { }
|
||||
|
||||
/**
|
||||
* This method takes a url to trigger the print dialog against, and the type of artifact that it
|
||||
|
@@ -28,7 +28,8 @@ import {
|
||||
AppConfigService,
|
||||
AlfrescoApiService,
|
||||
UploadWidgetContentLinkModel,
|
||||
DestinationFolderPath
|
||||
DestinationFolderPath,
|
||||
ApiClientsService
|
||||
} from '@alfresco/adf-core';
|
||||
import { Node, NodesApi, RelatedContentRepresentation } from '@alfresco/js-api';
|
||||
import { ContentCloudNodeSelectorService } from '../../../services/content-cloud-node-selector.service';
|
||||
@@ -41,7 +42,7 @@ export const RETRIEVE_METADATA_OPTION = 'retrieveMetadata';
|
||||
export const ALIAS_ROOT_FOLDER = '-root-';
|
||||
export const ALIAS_USER_FOLDER = '-my-';
|
||||
export const APP_NAME = '-appname-';
|
||||
export const VALID_ALIAS = [ ALIAS_ROOT_FOLDER, ALIAS_USER_FOLDER, '-shared-' ];
|
||||
export const VALID_ALIAS = [ALIAS_ROOT_FOLDER, ALIAS_USER_FOLDER, '-shared-'];
|
||||
|
||||
@Component({
|
||||
selector: 'adf-cloud-attach-file-cloud-widget',
|
||||
@@ -65,10 +66,8 @@ export class AttachFileCloudWidgetComponent extends UploadCloudWidgetComponent i
|
||||
rootNodeId = ALIAS_USER_FOLDER;
|
||||
selectedNode: Node;
|
||||
|
||||
_nodesApi: NodesApi;
|
||||
get nodesApi(): NodesApi {
|
||||
this._nodesApi = this._nodesApi ?? new NodesApi(this.apiService.getInstance());
|
||||
return this._nodesApi;
|
||||
get nodesApi() {
|
||||
return this.apiClientsService.get('ContentClient.nodes');
|
||||
}
|
||||
displayedColumns = ['icon', 'fileName', 'action'];
|
||||
|
||||
@@ -80,7 +79,7 @@ export class AttachFileCloudWidgetComponent extends UploadCloudWidgetComponent i
|
||||
notificationService: NotificationService,
|
||||
private contentNodeSelectorService: ContentCloudNodeSelectorService,
|
||||
private appConfigService: AppConfigService,
|
||||
private apiService: AlfrescoApiService,
|
||||
private apiClientsService: ApiClientsService,
|
||||
private contentNodeSelectorPanelService: ContentNodeSelectorPanelService
|
||||
) {
|
||||
super(formService, thumbnails, processCloudContentService, notificationService, logger);
|
||||
@@ -163,9 +162,9 @@ export class AttachFileCloudWidgetComponent extends UploadCloudWidgetComponent i
|
||||
return rootNodeId;
|
||||
}
|
||||
|
||||
async getNodeIdFromPath(destinationFolderPath: DestinationFolderPath): Promise<string> {
|
||||
async getNodeIdFromPath(destinationFolderPath: DestinationFolderPath): Promise<string> {
|
||||
let nodeId: string;
|
||||
const destinationPath = this.getAliasAndRelativePathFromDestinationFolderPath(destinationFolderPath.value);
|
||||
const destinationPath = this.getAliasAndRelativePathFromDestinationFolderPath(destinationFolderPath.value);
|
||||
destinationPath.path = this.replaceAppNameAliasWithValue(destinationPath.path);
|
||||
try {
|
||||
nodeId = await this.contentNodeSelectorService.getNodeIdFromPath(destinationPath);
|
||||
|
@@ -16,14 +16,14 @@
|
||||
*/
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { AlfrescoApiService, LogService, NotificationService } from '@alfresco/adf-core';
|
||||
import { ApiClientsService, LogService, NotificationService } from '@alfresco/adf-core';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import {
|
||||
ContentNodeSelectorComponent,
|
||||
ContentNodeSelectorComponentData,
|
||||
NodeAction
|
||||
} from '@alfresco/adf-content-services';
|
||||
import { Node, NodeEntry, NodesApi } from '@alfresco/js-api';
|
||||
import { Node, NodeEntry } from '@alfresco/js-api';
|
||||
import { from, Observable, Subject, throwError } from 'rxjs';
|
||||
import { catchError, map, mapTo } from 'rxjs/operators';
|
||||
import { DestinationFolderPathModel } from '../models/form-cloud-representation.model';
|
||||
@@ -33,20 +33,18 @@ import { DestinationFolderPathModel } from '../models/form-cloud-representation.
|
||||
})
|
||||
export class ContentCloudNodeSelectorService {
|
||||
|
||||
private _nodesApi: NodesApi;
|
||||
get nodesApi(): NodesApi {
|
||||
this._nodesApi = this._nodesApi ?? new NodesApi(this.apiService.getInstance());
|
||||
return this._nodesApi;
|
||||
get nodesApi() {
|
||||
return this.apiClientsService.get('ContentClient.nodes');
|
||||
}
|
||||
|
||||
sourceNodeNotFound = false;
|
||||
|
||||
constructor(
|
||||
private apiService: AlfrescoApiService,
|
||||
private apiClientsService: ApiClientsService,
|
||||
private notificationService: NotificationService,
|
||||
private logService: LogService,
|
||||
private dialog: MatDialog) {
|
||||
}
|
||||
private dialog: MatDialog
|
||||
) { }
|
||||
|
||||
openUploadFileDialog(currentFolderId?: string, selectionMode?: string, isAllFileSources?: boolean, restrictRootToCurrentFolderId?: boolean): Observable<Node[]> {
|
||||
const select = new Subject<Node[]>();
|
||||
|
Reference in New Issue
Block a user