mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-19 17:14:57 +00:00
refactor content
This commit is contained in:
parent
8c8e388fa0
commit
b8e7e79b26
@ -22,20 +22,21 @@ import { from, Observable, of, Subject, zip } from 'rxjs';
|
|||||||
import { AspectListDialogComponentData } from './aspect-list-dialog-data.interface';
|
import { AspectListDialogComponentData } from './aspect-list-dialog-data.interface';
|
||||||
import { AspectListDialogComponent } from './aspect-list-dialog.component';
|
import { AspectListDialogComponent } from './aspect-list-dialog.component';
|
||||||
import { catchError, map } from 'rxjs/operators';
|
import { catchError, map } from 'rxjs/operators';
|
||||||
import { AspectEntry, AspectPaging, AspectsApi } from '@alfresco/js-api';
|
import { AspectEntry, AspectPaging, AspectsApi, NodesApi } from '@alfresco/js-api';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
})
|
})
|
||||||
export class AspectListService {
|
export class AspectListService {
|
||||||
|
|
||||||
private aspectsApi: AspectsApi;
|
get aspectsApi(): AspectsApi {
|
||||||
|
return new AspectsApi(this.alfrescoApiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
constructor(private alfrescoApiService: AlfrescoApiService,
|
constructor(private alfrescoApiService: AlfrescoApiService,
|
||||||
private appConfigService: AppConfigService,
|
private appConfigService: AppConfigService,
|
||||||
private dialog: MatDialog,
|
private dialog: MatDialog,
|
||||||
private logService: LogService) {
|
private logService: LogService) {
|
||||||
this.aspectsApi = new AspectsApi(this.alfrescoApiService.getInstance());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getAspects(): Observable<AspectEntry[]> {
|
getAspects(): Observable<AspectEntry[]> {
|
||||||
|
@ -18,7 +18,16 @@
|
|||||||
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, LogService } from '@alfresco/adf-core';
|
||||||
import { AuditApi, AuditAppPaging, AuditAppEntry, AuditApp, AuditBodyUpdate, AuditEntryPaging, AuditEntryEntry } from '@alfresco/js-api';
|
import {
|
||||||
|
AuditApi,
|
||||||
|
AuditAppPaging,
|
||||||
|
AuditAppEntry,
|
||||||
|
AuditApp,
|
||||||
|
AuditBodyUpdate,
|
||||||
|
AuditEntryPaging,
|
||||||
|
AuditEntryEntry,
|
||||||
|
AspectsApi
|
||||||
|
} from '@alfresco/js-api';
|
||||||
import { catchError } from 'rxjs/operators';
|
import { catchError } from 'rxjs/operators';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
@ -26,10 +35,11 @@ import { catchError } from 'rxjs/operators';
|
|||||||
})
|
})
|
||||||
export class AuditService {
|
export class AuditService {
|
||||||
|
|
||||||
auditApi: AuditApi;
|
get auditApi(): AuditApi {
|
||||||
|
return new AuditApi(this.apiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
constructor(private apiService: AlfrescoApiService, private logService: LogService) {
|
constructor(private apiService: AlfrescoApiService, private logService: LogService) {
|
||||||
this.auditApi = new AuditApi(this.apiService.getInstance());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getAuditApps(opts?: any): Observable<AuditAppPaging> {
|
getAuditApps(opts?: any): Observable<AuditAppPaging> {
|
||||||
|
@ -26,10 +26,12 @@ import { ClassesApi } from '@alfresco/js-api';
|
|||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
})
|
})
|
||||||
export class PropertyDescriptorsService {
|
export class PropertyDescriptorsService {
|
||||||
private classesApi: ClassesApi;
|
|
||||||
|
get classesApi(): ClassesApi {
|
||||||
|
return new ClassesApi(this.alfrescoApiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
constructor(private alfrescoApiService: AlfrescoApiService) {
|
constructor(private alfrescoApiService: AlfrescoApiService) {
|
||||||
this.classesApi = new ClassesApi(this.alfrescoApiService.getInstance());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
load(groupNames: string[]): Observable<PropertyGroupContainer> {
|
load(groupNames: string[]): Observable<PropertyGroupContainer> {
|
||||||
|
@ -43,13 +43,15 @@ export class NodeSharedDirective implements OnChanges, OnDestroy {
|
|||||||
baseShareUrl: string;
|
baseShareUrl: string;
|
||||||
|
|
||||||
private onDestroy$ = new Subject<boolean>();
|
private onDestroy$ = new Subject<boolean>();
|
||||||
private nodesApi = new NodesApi();
|
|
||||||
|
get nodes(): NodesApi {
|
||||||
|
return new NodesApi(this.alfrescoApiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private dialog: MatDialog,
|
private dialog: MatDialog,
|
||||||
private zone: NgZone,
|
private zone: NgZone,
|
||||||
private alfrescoApiService: AlfrescoApiService) {
|
private alfrescoApiService: AlfrescoApiService) {
|
||||||
this.nodesApi = new NodesApi(this.alfrescoApiService.getInstance());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnDestroy() {
|
ngOnDestroy() {
|
||||||
|
@ -25,10 +25,11 @@ import { map } from 'rxjs/operators';
|
|||||||
})
|
})
|
||||||
export class ContentTypeService {
|
export class ContentTypeService {
|
||||||
|
|
||||||
private typesApi: TypesApi;
|
get typesApi(): TypesApi {
|
||||||
|
return new TypesApi(this.alfrescoApiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
constructor(private alfrescoApiService: AlfrescoApiService) {
|
constructor(private alfrescoApiService: AlfrescoApiService) {
|
||||||
this.typesApi = new TypesApi(this.alfrescoApiService.getInstance());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getContentTypeByPrefix(prefixedType: string): Observable<TypeEntry> {
|
getContentTypeByPrefix(prefixedType: string): Observable<TypeEntry> {
|
||||||
|
@ -72,7 +72,9 @@ export class LibraryDialogComponent implements OnInit, OnDestroy {
|
|||||||
];
|
];
|
||||||
disableCreateButton = false;
|
disableCreateButton = false;
|
||||||
|
|
||||||
queriesApi: QueriesApi;
|
get queriesApi(): QueriesApi {
|
||||||
|
return new QueriesApi(this.alfrescoApiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private alfrescoApiService: AlfrescoApiService,
|
private alfrescoApiService: AlfrescoApiService,
|
||||||
@ -80,7 +82,6 @@ export class LibraryDialogComponent implements OnInit, OnDestroy {
|
|||||||
private formBuilder: FormBuilder,
|
private formBuilder: FormBuilder,
|
||||||
private dialog: MatDialogRef<LibraryDialogComponent>
|
private dialog: MatDialogRef<LibraryDialogComponent>
|
||||||
) {
|
) {
|
||||||
this.queriesApi = new QueriesApi(this.alfrescoApiService.getInstance());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
@ -35,7 +35,9 @@ export class NodeLockDialogComponent implements OnInit {
|
|||||||
node: Node = null;
|
node: Node = null;
|
||||||
nodeName: string;
|
nodeName: string;
|
||||||
|
|
||||||
private nodesApi: NodesApi;
|
get nodesApi(): NodesApi {
|
||||||
|
return new NodesApi(this.alfrescoApi.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private formBuilder: FormBuilder,
|
private formBuilder: FormBuilder,
|
||||||
@ -45,7 +47,6 @@ export class NodeLockDialogComponent implements OnInit {
|
|||||||
@Inject(MAT_DIALOG_DATA)
|
@Inject(MAT_DIALOG_DATA)
|
||||||
public data: any
|
public data: any
|
||||||
) {
|
) {
|
||||||
this.nodesApi = new NodesApi(this.alfrescoApi.getInstance());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
@ -342,7 +342,10 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
|
|||||||
private rowMenuCache: { [key: string]: ContentActionModel[] } = {};
|
private rowMenuCache: { [key: string]: ContentActionModel[] } = {};
|
||||||
private loadingTimeout;
|
private loadingTimeout;
|
||||||
private onDestroy$ = new Subject<boolean>();
|
private onDestroy$ = new Subject<boolean>();
|
||||||
private nodesApi: NodesApi;
|
|
||||||
|
get nodes(): NodesApi {
|
||||||
|
return new NodesApi(this.alfrescoApiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
constructor(private documentListService: DocumentListService,
|
constructor(private documentListService: DocumentListService,
|
||||||
private ngZone: NgZone,
|
private ngZone: NgZone,
|
||||||
@ -353,7 +356,6 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
|
|||||||
private thumbnailService: ThumbnailService,
|
private thumbnailService: ThumbnailService,
|
||||||
private alfrescoApiService: AlfrescoApiService,
|
private alfrescoApiService: AlfrescoApiService,
|
||||||
private lockService: LockService) {
|
private lockService: LockService) {
|
||||||
this.nodesApi = new NodesApi(this.alfrescoApiService.getInstance());
|
|
||||||
this.userPreferencesService
|
this.userPreferencesService
|
||||||
.select(UserPreferenceValues.PaginationSize)
|
.select(UserPreferenceValues.PaginationSize)
|
||||||
.pipe(takeUntil(this.onDestroy$))
|
.pipe(takeUntil(this.onDestroy$))
|
||||||
|
@ -41,22 +41,35 @@ export class CustomResourcesService {
|
|||||||
|
|
||||||
private CREATE_PERMISSION = 'create';
|
private CREATE_PERMISSION = 'create';
|
||||||
|
|
||||||
peopleApi: PeopleApi;
|
get peopleApi(): PeopleApi {
|
||||||
sitesApi: SitesApi;
|
return new PeopleApi(this.apiService.getInstance());
|
||||||
trashcanApi: TrashcanApi;
|
}
|
||||||
searchApi: SearchApi;
|
|
||||||
sharedLinksApi: SharedlinksApi;
|
get sitesApi(): SitesApi {
|
||||||
favoritesApi: FavoritesApi;
|
return new SitesApi(this.apiService.getInstance());
|
||||||
nodesApi: NodesApi;
|
}
|
||||||
|
|
||||||
|
get trashcanApi(): TrashcanApi {
|
||||||
|
return new TrashcanApi(this.apiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
|
get searchApi(): SearchApi {
|
||||||
|
return new SearchApi(this.apiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
|
get sharedLinksApi(): SharedlinksApi {
|
||||||
|
return new SharedlinksApi(this.apiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
|
get favoritesApi(): FavoritesApi {
|
||||||
|
return new FavoritesApi(this.apiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
|
get nodes(): NodesApi {
|
||||||
|
return new NodesApi(this.apiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
constructor(private apiService: AlfrescoApiService, private logService: LogService) {
|
constructor(private apiService: AlfrescoApiService, private logService: LogService) {
|
||||||
this.peopleApi = new PeopleApi(this.apiService.getInstance());
|
|
||||||
this.sitesApi = new SitesApi(this.apiService.getInstance());
|
|
||||||
this.favoritesApi = new FavoritesApi(this.apiService.getInstance());
|
|
||||||
this.searchApi = new SearchApi(this.apiService.getInstance());
|
|
||||||
this.sharedLinksApi = new SharedlinksApi(this.apiService.getInstance());
|
|
||||||
this.trashcanApi = new TrashcanApi(this.apiService.getInstance());
|
|
||||||
this.nodesApi = new NodesApi(this.apiService.getInstance());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -34,13 +34,14 @@ export class DocumentListService implements DocumentListLoader {
|
|||||||
|
|
||||||
static ROOT_ID = '-root-';
|
static ROOT_ID = '-root-';
|
||||||
|
|
||||||
nodes: NodesApi;
|
get nodes(): NodesApi {
|
||||||
|
return new NodesApi(this.apiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
constructor(private contentService: ContentService,
|
constructor(private contentService: ContentService,
|
||||||
private apiService: AlfrescoApiService,
|
private apiService: AlfrescoApiService,
|
||||||
private logService: LogService,
|
private logService: LogService,
|
||||||
private customResourcesService: CustomResourcesService) {
|
private customResourcesService: CustomResourcesService) {
|
||||||
this.nodes = new NodesApi(this.apiService.getInstance());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -24,12 +24,13 @@ import { AlfrescoApiService } from '@alfresco/adf-core';
|
|||||||
})
|
})
|
||||||
export class GroupService {
|
export class GroupService {
|
||||||
|
|
||||||
groupsApi: GroupsApi;
|
get groupsApi(): GroupsApi {
|
||||||
|
return new GroupsApi(this.alfrescoApiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private alfrescoApiService: AlfrescoApiService
|
private alfrescoApiService: AlfrescoApiService
|
||||||
) {
|
) {
|
||||||
this.groupsApi = new GroupsApi(this.alfrescoApiService.getInstance());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async listAllGroupMembershipsForPerson(personId: string, opts?: any, accumulator = []): Promise<GroupEntry[]> {
|
async listAllGroupMembershipsForPerson(personId: string, opts?: any, accumulator = []): Promise<GroupEntry[]> {
|
||||||
|
@ -42,13 +42,14 @@ import { RoleModel } from '../models/role.model';
|
|||||||
})
|
})
|
||||||
export class NodePermissionService {
|
export class NodePermissionService {
|
||||||
|
|
||||||
groupsApi: GroupsApi;
|
get groupsApi(): GroupsApi {
|
||||||
|
return new GroupsApi(this.apiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
constructor(private apiService: AlfrescoApiService,
|
constructor(private apiService: AlfrescoApiService,
|
||||||
private searchApiService: SearchService,
|
private searchApiService: SearchService,
|
||||||
private nodeService: NodesApiService,
|
private nodeService: NodesApiService,
|
||||||
private translation: TranslationService) {
|
private translation: TranslationService) {
|
||||||
this.groupsApi = new GroupsApi(this.apiService.getInstance());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -42,7 +42,10 @@ import { SearchForm } from '../models/search-form.interface';
|
|||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
})
|
})
|
||||||
export abstract class BaseQueryBuilderService {
|
export abstract class BaseQueryBuilderService {
|
||||||
private searchApi: SearchApi;
|
|
||||||
|
get searchApi(): SearchApi {
|
||||||
|
return new SearchApi(this.alfrescoApiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
/* Stream that emits the search configuration whenever the user change the search forms */
|
/* Stream that emits the search configuration whenever the user change the search forms */
|
||||||
configUpdated = new Subject<SearchConfiguration>();
|
configUpdated = new Subject<SearchConfiguration>();
|
||||||
@ -88,7 +91,6 @@ export abstract class BaseQueryBuilderService {
|
|||||||
ranges: { [id: string]: SearchRange } = {};
|
ranges: { [id: string]: SearchRange } = {};
|
||||||
|
|
||||||
constructor(protected appConfig: AppConfigService, protected alfrescoApiService: AlfrescoApiService) {
|
constructor(protected appConfig: AppConfigService, protected alfrescoApiService: AlfrescoApiService) {
|
||||||
this.searchApi = new SearchApi(this.alfrescoApiService.getInstance());
|
|
||||||
this.resetToDefaults();
|
this.resetToDefaults();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,10 +26,11 @@ import { catchError } from 'rxjs/operators';
|
|||||||
})
|
})
|
||||||
export class RatingService {
|
export class RatingService {
|
||||||
|
|
||||||
ratingsApi: RatingsApi;
|
get ratingsApi(): RatingsApi {
|
||||||
|
return new RatingsApi(this.apiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
constructor(private apiService: AlfrescoApiService, private logService: LogService) {
|
constructor(private apiService: AlfrescoApiService, private logService: LogService) {
|
||||||
this.ratingsApi = new RatingsApi(this.apiService.getInstance());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -27,7 +27,9 @@ import { TagBody, TagPaging, TagEntry, TagsApi } from '@alfresco/js-api';
|
|||||||
// tslint:disable-next-line: directive-class-suffix
|
// tslint:disable-next-line: directive-class-suffix
|
||||||
export class TagService {
|
export class TagService {
|
||||||
|
|
||||||
private tagsApi: TagsApi;
|
get tagsApi(): TagsApi {
|
||||||
|
return new TagsApi(this.apiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
/** Emitted when tag information is updated. */
|
/** Emitted when tag information is updated. */
|
||||||
@Output()
|
@Output()
|
||||||
@ -35,7 +37,6 @@ export class TagService {
|
|||||||
|
|
||||||
constructor(private apiService: AlfrescoApiService,
|
constructor(private apiService: AlfrescoApiService,
|
||||||
private logService: LogService) {
|
private logService: LogService) {
|
||||||
this.tagsApi = new TagsApi(this.apiService.getInstance());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -32,9 +32,18 @@ import { ConfirmDialogComponent } from '../dialogs/confirm.dialog';
|
|||||||
})
|
})
|
||||||
export class VersionListComponent implements OnChanges {
|
export class VersionListComponent implements OnChanges {
|
||||||
|
|
||||||
private versionsApi: VersionsApi;
|
get contentApi(): ContentApi {
|
||||||
private nodesApi: NodesApi;
|
return new ContentApi(this.alfrescoApi.getInstance());
|
||||||
private contentApi: ContentApi;
|
}
|
||||||
|
|
||||||
|
get versionsApi(): VersionsApi {
|
||||||
|
return new VersionsApi(this.alfrescoApi.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
|
get nodesApi(): NodesApi {
|
||||||
|
return new NodesApi(this.alfrescoApi.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
versions: VersionEntry[] = [];
|
versions: VersionEntry[] = [];
|
||||||
isLoading = true;
|
isLoading = true;
|
||||||
|
|
||||||
@ -73,9 +82,6 @@ export class VersionListComponent implements OnChanges {
|
|||||||
constructor(private alfrescoApi: AlfrescoApiService,
|
constructor(private alfrescoApi: AlfrescoApiService,
|
||||||
private contentService: ContentService,
|
private contentService: ContentService,
|
||||||
private dialog: MatDialog) {
|
private dialog: MatDialog) {
|
||||||
this.versionsApi = new VersionsApi(this.alfrescoApi.getInstance());
|
|
||||||
this.nodesApi = new NodesApi(this.alfrescoApi.getInstance());
|
|
||||||
this.contentApi = new ContentApi(this.alfrescoApi.getInstance());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnChanges() {
|
ngOnChanges() {
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
import { ObjectDataTableAdapter, AlfrescoApiService, LogService } from '@alfresco/adf-core';
|
import { ObjectDataTableAdapter, AlfrescoApiService, LogService } from '@alfresco/adf-core';
|
||||||
import { Component, EventEmitter, Input, OnChanges, Output } from '@angular/core';
|
import { Component, EventEmitter, Input, OnChanges, Output } from '@angular/core';
|
||||||
import { WebscriptApi } from '@alfresco/js-api';
|
import { TaskFormsApi, WebscriptApi } from '@alfresco/js-api';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <adf-webscript-get [scriptPath]="string"
|
* <adf-webscript-get [scriptPath]="string"
|
||||||
@ -45,6 +45,10 @@ import { WebscriptApi } from '@alfresco/js-api';
|
|||||||
})
|
})
|
||||||
export class WebscriptComponent implements OnChanges {
|
export class WebscriptComponent implements OnChanges {
|
||||||
|
|
||||||
|
get webscriptApi(): WebscriptApi {
|
||||||
|
return new WebscriptApi(this.apiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
/** (required) Path to the webscript (as defined by webscript). */
|
/** (required) Path to the webscript (as defined by webscript). */
|
||||||
@Input()
|
@Input()
|
||||||
scriptPath: string;
|
scriptPath: string;
|
||||||
@ -81,11 +85,8 @@ export class WebscriptComponent implements OnChanges {
|
|||||||
data: any = undefined;
|
data: any = undefined;
|
||||||
showError: boolean = false;
|
showError: boolean = false;
|
||||||
|
|
||||||
webscriptApi: WebscriptApi;
|
|
||||||
|
|
||||||
constructor(private apiService: AlfrescoApiService,
|
constructor(private apiService: AlfrescoApiService,
|
||||||
private logService: LogService) {
|
private logService: LogService) {
|
||||||
this.webscriptApi = new WebscriptApi(this.apiService.getInstance());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnChanges() {
|
ngOnChanges() {
|
||||||
|
@ -35,18 +35,19 @@ import { map, catchError } from 'rxjs/operators';
|
|||||||
})
|
})
|
||||||
export class ActivitiContentService {
|
export class ActivitiContentService {
|
||||||
|
|
||||||
|
get integrationAlfrescoOnPremiseApi(): IntegrationAlfrescoOnPremiseApi {
|
||||||
|
return new IntegrationAlfrescoOnPremiseApi(this.apiService.getInstance());
|
||||||
|
}
|
||||||
|
get contentApi(): ActivitiContentApi {
|
||||||
|
return new ActivitiContentApi(this.apiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
static UNKNOWN_ERROR_MESSAGE: string = 'Unknown error';
|
static UNKNOWN_ERROR_MESSAGE: string = 'Unknown error';
|
||||||
static GENERIC_ERROR_MESSAGE: string = 'Server error';
|
static GENERIC_ERROR_MESSAGE: string = 'Server error';
|
||||||
|
|
||||||
integrationAlfrescoOnPremiseApi: IntegrationAlfrescoOnPremiseApi;
|
|
||||||
contentApi: ActivitiContentApi;
|
|
||||||
|
|
||||||
constructor(private apiService: AlfrescoApiService,
|
constructor(private apiService: AlfrescoApiService,
|
||||||
private logService: LogService,
|
private logService: LogService,
|
||||||
private sitesService: SitesService) {
|
private sitesService: SitesService) {
|
||||||
|
|
||||||
this.integrationAlfrescoOnPremiseApi = new IntegrationAlfrescoOnPremiseApi(this.apiService.getInstance());
|
|
||||||
this.contentApi = new ActivitiContentApi(this.apiService.getInstance());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -30,20 +30,22 @@ import {
|
|||||||
import { TaskProcessVariableModel } from '../models/task-process-variable.model';
|
import { TaskProcessVariableModel } from '../models/task-process-variable.model';
|
||||||
import { WidgetVisibilityModel, WidgetTypeEnum } from '../models/widget-visibility.model';
|
import { WidgetVisibilityModel, WidgetTypeEnum } from '../models/widget-visibility.model';
|
||||||
import { map, catchError } from 'rxjs/operators';
|
import { map, catchError } from 'rxjs/operators';
|
||||||
import { TaskFormsApi } from '@alfresco/js-api';
|
import { RuntimeAppDefinitionsApi, TaskFormsApi } from '@alfresco/js-api';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
})
|
})
|
||||||
export class WidgetVisibilityService {
|
export class WidgetVisibilityService {
|
||||||
|
|
||||||
private taskFormsApi: TaskFormsApi;
|
get taskFormsApi(): TaskFormsApi {
|
||||||
|
return new TaskFormsApi(this.apiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
private processVarList: TaskProcessVariableModel[];
|
private processVarList: TaskProcessVariableModel[];
|
||||||
private form: FormModel;
|
private form: FormModel;
|
||||||
|
|
||||||
constructor(private apiService: AlfrescoApiService,
|
constructor(private apiService: AlfrescoApiService,
|
||||||
private logService: LogService) {
|
private logService: LogService) {
|
||||||
this.taskFormsApi = new TaskFormsApi(this.apiService.getInstance());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public refreshVisibility(form: FormModel, processVarList?: TaskProcessVariableModel[]) {
|
public refreshVisibility(form: FormModel, processVarList?: TaskProcessVariableModel[]) {
|
||||||
|
@ -257,10 +257,21 @@ 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');
|
||||||
|
|
||||||
private sharedLinksApi: SharedlinksApi;
|
get sharedLinksApi(): SharedlinksApi {
|
||||||
private versionsApi: VersionsApi;
|
return new SharedlinksApi(this.apiService.getInstance());
|
||||||
private nodesApi: NodesApi;
|
}
|
||||||
private contentApi: ContentApi;
|
|
||||||
|
get versionsApi(): VersionsApi {
|
||||||
|
return new VersionsApi(this.apiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
|
get nodesApi(): NodesApi {
|
||||||
|
return new NodesApi(this.apiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
|
get contentApi(): ContentApi {
|
||||||
|
return new ContentApi(this.apiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
constructor(private apiService: AlfrescoApiService,
|
constructor(private apiService: AlfrescoApiService,
|
||||||
private viewUtilService: ViewUtilService,
|
private viewUtilService: ViewUtilService,
|
||||||
@ -270,10 +281,6 @@ 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) {
|
||||||
this.sharedLinksApi = new SharedlinksApi(this.apiService.getInstance());
|
|
||||||
this.versionsApi = new VersionsApi(this.apiService.getInstance());
|
|
||||||
this.nodesApi = new NodesApi(this.apiService.getInstance());
|
|
||||||
this.contentApi = new ContentApi(this.apiService.getInstance());
|
|
||||||
viewUtilService.maxRetries = this.maxRetries;
|
viewUtilService.maxRetries = this.maxRetries;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -74,16 +74,21 @@ 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(): RenditionsApi {
|
||||||
contentApi: ContentApi;
|
return new RenditionsApi(this.apiService.getInstance());
|
||||||
versionsApi: VersionsApi;
|
}
|
||||||
|
|
||||||
|
get contentApi(): ContentApi {
|
||||||
|
return new ContentApi(this.apiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
|
get versionsApi(): VersionsApi {
|
||||||
|
return new VersionsApi(this.apiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
constructor(private apiService: AlfrescoApiService,
|
constructor(private apiService: AlfrescoApiService,
|
||||||
private logService: LogService,
|
private logService: LogService,
|
||||||
private translateService: TranslationService) {
|
private translateService: TranslationService) {
|
||||||
this.renditionsApi = new RenditionsApi(this.apiService.getInstance());
|
|
||||||
this.contentApi = new ContentApi(this.apiService.getInstance());
|
|
||||||
this.versionsApi = new VersionsApi(this.apiService.getInstance());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -28,18 +28,21 @@ import { MultiBarChart } from '../../diagram/models/chart/multi-bar-chart.model'
|
|||||||
import { PieChart } from '../../diagram/models/chart/pie-chart.model';
|
import { PieChart } from '../../diagram/models/chart/pie-chart.model';
|
||||||
import { TableChart } from '../../diagram/models/chart/table-chart.model';
|
import { TableChart } from '../../diagram/models/chart/table-chart.model';
|
||||||
import { map, catchError } from 'rxjs/operators';
|
import { map, catchError } from 'rxjs/operators';
|
||||||
import { ProcessDefinitionsApi, ReportApi } from '@alfresco/js-api';
|
import { ActivitiContentApi, ProcessDefinitionsApi, ReportApi } from '@alfresco/js-api';
|
||||||
|
|
||||||
@Injectable({ providedIn: 'root' })
|
@Injectable({ providedIn: 'root' })
|
||||||
export class AnalyticsService {
|
export class AnalyticsService {
|
||||||
|
|
||||||
reportApi: ReportApi;
|
get reportApi(): ReportApi {
|
||||||
processDefinitionsApi: ProcessDefinitionsApi;
|
return new ReportApi(this.apiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
|
get reportApi(): ProcessDefinitionsApi {
|
||||||
|
return new ProcessDefinitionsApi(this.apiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
constructor(private apiService: AlfrescoApiService,
|
constructor(private apiService: AlfrescoApiService,
|
||||||
private logService: LogService) {
|
private logService: LogService) {
|
||||||
this.reportApi = new ReportApi(this.apiService.getInstance());
|
|
||||||
this.processDefinitionsApi = new ProcessDefinitionsApi(this.apiService.getInstance());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user