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