mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-06-30 18:15:11 +00:00
refactor core
This commit is contained in:
parent
b8e7e79b26
commit
b04308deaa
@ -38,7 +38,10 @@ export class LibraryFavoriteDirective implements OnChanges {
|
|||||||
@Output() error = new EventEmitter<any>();
|
@Output() error = new EventEmitter<any>();
|
||||||
|
|
||||||
private targetLibrary = null;
|
private targetLibrary = null;
|
||||||
private favoritesApi: FavoritesApi;
|
|
||||||
|
get favoritesApi(): FavoritesApi {
|
||||||
|
return new FavoritesApi(this.alfrescoApiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
@HostListener('click')
|
@HostListener('click')
|
||||||
onClick() {
|
onClick() {
|
||||||
@ -58,7 +61,6 @@ export class LibraryFavoriteDirective implements OnChanges {
|
|||||||
}
|
}
|
||||||
|
|
||||||
constructor(private alfrescoApiService: AlfrescoApiService) {
|
constructor(private alfrescoApiService: AlfrescoApiService) {
|
||||||
this.favoritesApi = new FavoritesApi(this.alfrescoApiService.getInstance());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnChanges(changes) {
|
ngOnChanges(changes) {
|
||||||
|
@ -48,7 +48,9 @@ export class LibraryMembershipDirective implements OnChanges {
|
|||||||
|
|
||||||
isJoinRequested: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);
|
isJoinRequested: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);
|
||||||
|
|
||||||
private sitesApi: SitesApi;
|
get sitesApi(): SitesApi {
|
||||||
|
return new SitesApi(this.alfrescoApiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
/** Site for which to toggle the membership request. */
|
/** Site for which to toggle the membership request. */
|
||||||
@Input('adf-library-membership')
|
@Input('adf-library-membership')
|
||||||
@ -75,7 +77,6 @@ export class LibraryMembershipDirective implements OnChanges {
|
|||||||
private sitesService: SitesService,
|
private sitesService: SitesService,
|
||||||
private versionCompatibilityService: VersionCompatibilityService
|
private versionCompatibilityService: VersionCompatibilityService
|
||||||
) {
|
) {
|
||||||
this.sitesApi = new SitesApi(this.alfrescoApiService.getInstance());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnChanges(changes: SimpleChanges) {
|
ngOnChanges(changes: SimpleChanges) {
|
||||||
|
@ -62,8 +62,13 @@ export class NodeDeleteDirective implements OnChanges {
|
|||||||
@Output()
|
@Output()
|
||||||
delete: EventEmitter<any> = new EventEmitter();
|
delete: EventEmitter<any> = new EventEmitter();
|
||||||
|
|
||||||
private trashcanApi: TrashcanApi;
|
get trashcanApi(): TrashcanApi {
|
||||||
private nodesApi: NodesApi;
|
return new TrashcanApi(this.alfrescoApiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
|
get nodesApi(): NodesApi {
|
||||||
|
return new NodesApi(this.alfrescoApiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
@HostListener('click')
|
@HostListener('click')
|
||||||
onClick() {
|
onClick() {
|
||||||
@ -73,8 +78,6 @@ export class NodeDeleteDirective implements OnChanges {
|
|||||||
constructor(private alfrescoApiService: AlfrescoApiService,
|
constructor(private alfrescoApiService: AlfrescoApiService,
|
||||||
private translation: TranslationService,
|
private translation: TranslationService,
|
||||||
private elementRef: ElementRef) {
|
private elementRef: ElementRef) {
|
||||||
this.trashcanApi = new TrashcanApi(this.alfrescoApiService.getInstance());
|
|
||||||
this.nodesApi = new NodesApi(this.alfrescoApiService.getInstance());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnChanges() {
|
ngOnChanges() {
|
||||||
|
@ -31,7 +31,9 @@ import { DownloadService } from '../services/download.service';
|
|||||||
})
|
})
|
||||||
export class NodeDownloadDirective {
|
export class NodeDownloadDirective {
|
||||||
|
|
||||||
private contentApi: ContentApi;
|
get contentApi(): ContentApi {
|
||||||
|
return new ContentApi(this.apiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
/** Nodes to download. */
|
/** Nodes to download. */
|
||||||
@Input('adfNodeDownload')
|
@Input('adfNodeDownload')
|
||||||
@ -50,7 +52,6 @@ export class NodeDownloadDirective {
|
|||||||
private apiService: AlfrescoApiService,
|
private apiService: AlfrescoApiService,
|
||||||
private downloadService: DownloadService,
|
private downloadService: DownloadService,
|
||||||
private dialog: MatDialog) {
|
private dialog: MatDialog) {
|
||||||
this.contentApi = new ContentApi(this.apiService.getInstance());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -30,7 +30,9 @@ import { catchError, map } from 'rxjs/operators';
|
|||||||
export class NodeFavoriteDirective implements OnChanges {
|
export class NodeFavoriteDirective implements OnChanges {
|
||||||
favorites: any[] = [];
|
favorites: any[] = [];
|
||||||
|
|
||||||
private favoritesApi: FavoritesApi;
|
get favoritesApi(): FavoritesApi {
|
||||||
|
return new FavoritesApi(this.alfrescoApiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
/** Array of nodes to toggle as favorites. */
|
/** Array of nodes to toggle as favorites. */
|
||||||
@Input('adf-node-favorite')
|
@Input('adf-node-favorite')
|
||||||
@ -48,7 +50,6 @@ export class NodeFavoriteDirective implements OnChanges {
|
|||||||
}
|
}
|
||||||
|
|
||||||
constructor(private alfrescoApiService: AlfrescoApiService) {
|
constructor(private alfrescoApiService: AlfrescoApiService) {
|
||||||
this.favoritesApi = new FavoritesApi(this.alfrescoApiService.getInstance());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnChanges(changes) {
|
ngOnChanges(changes) {
|
||||||
|
@ -35,7 +35,10 @@ export class RestoreMessageModel {
|
|||||||
})
|
})
|
||||||
export class NodeRestoreDirective {
|
export class NodeRestoreDirective {
|
||||||
private readonly restoreProcessStatus;
|
private readonly restoreProcessStatus;
|
||||||
private trashcanApi: TrashcanApi;
|
|
||||||
|
get trashcanApi(): TrashcanApi {
|
||||||
|
return new TrashcanApi(this.alfrescoApiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
/** Array of deleted nodes to restore. */
|
/** Array of deleted nodes to restore. */
|
||||||
@Input('adf-restore')
|
@Input('adf-restore')
|
||||||
@ -53,7 +56,6 @@ export class NodeRestoreDirective {
|
|||||||
constructor(private alfrescoApiService: AlfrescoApiService,
|
constructor(private alfrescoApiService: AlfrescoApiService,
|
||||||
private translation: TranslationService) {
|
private translation: TranslationService) {
|
||||||
this.restoreProcessStatus = this.processStatus();
|
this.restoreProcessStatus = this.processStatus();
|
||||||
this.trashcanApi = new TrashcanApi(this.alfrescoApiService.getInstance());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private recover(selection: any) {
|
private recover(selection: any) {
|
||||||
|
@ -32,11 +32,12 @@ export class EcmModelService {
|
|||||||
public static MODEL_NAME: string = 'activitiFormsModel';
|
public static MODEL_NAME: string = 'activitiFormsModel';
|
||||||
public static TYPE_MODEL: string = 'cm:folder';
|
public static TYPE_MODEL: string = 'cm:folder';
|
||||||
|
|
||||||
private customModelApi: CustomModelApi;
|
get customModelApi(): CustomModelApi {
|
||||||
|
return new CustomModelApi(this.apiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
constructor(private apiService: AlfrescoApiService,
|
constructor(private apiService: AlfrescoApiService,
|
||||||
private logService: LogService) {
|
private logService: LogService) {
|
||||||
this.customModelApi = new CustomModelApi(this.apiService.getInstance());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public createEcmTypeForActivitiForm(formName: string, form: FormModel): Observable<any> {
|
public createEcmTypeForActivitiForm(formName: string, form: FormModel): Observable<any> {
|
||||||
|
@ -52,15 +52,41 @@ export class FormService {
|
|||||||
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';
|
||||||
|
|
||||||
taskApi: TasksApi;
|
get taskApi(): TasksApi {
|
||||||
taskFormsApi: TaskFormsApi;
|
return new TasksApi(this.apiService.getInstance());
|
||||||
modelsApi: ModelsApi;
|
}
|
||||||
editorApi: FormModelsApi;
|
|
||||||
processDefinitionsApi: ProcessDefinitionsApi;
|
get taskFormsApi(): TaskFormsApi {
|
||||||
processInstancesApi: ProcessInstancesApi;
|
return new TaskFormsApi(this.apiService.getInstance());
|
||||||
processInstanceVariablesApi: ProcessInstanceVariablesApi;
|
}
|
||||||
groupsApi: ActivitiGroupsApi;
|
|
||||||
usersApi: UsersApi;
|
get modelsApi(): ModelsApi {
|
||||||
|
return new ModelsApi(this.apiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
|
get editorApi(): FormModelsApi {
|
||||||
|
return new FormModelsApi(this.apiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
|
get processDefinitionsApi(): ProcessDefinitionsApi {
|
||||||
|
return new ProcessDefinitionsApi(this.apiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
|
get processInstanceVariablesApi(): ProcessInstanceVariablesApi {
|
||||||
|
return new ProcessInstanceVariablesApi(this.apiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
|
get processInstancesApi(): ProcessInstancesApi {
|
||||||
|
return new ProcessInstancesApi(this.apiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
|
get groupsApi(): ActivitiGroupsApi {
|
||||||
|
return new ActivitiGroupsApi(this.apiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
|
get usersApi(): UsersApi {
|
||||||
|
return new UsersApi(this.apiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
formLoaded = new Subject<FormEvent>();
|
formLoaded = new Subject<FormEvent>();
|
||||||
formDataRefreshed = new Subject<FormEvent>();
|
formDataRefreshed = new Subject<FormEvent>();
|
||||||
@ -83,16 +109,6 @@ export class FormService {
|
|||||||
constructor(private ecmModelService: EcmModelService,
|
constructor(private ecmModelService: EcmModelService,
|
||||||
private apiService: AlfrescoApiService,
|
private apiService: AlfrescoApiService,
|
||||||
protected logService: LogService) {
|
protected logService: LogService) {
|
||||||
|
|
||||||
this.taskApi = new TasksApi(this.apiService.getInstance());
|
|
||||||
this.modelsApi = new ModelsApi(this.apiService.getInstance());
|
|
||||||
this.editorApi = new FormModelsApi(this.apiService.getInstance());
|
|
||||||
this.processDefinitionsApi = new ProcessDefinitionsApi(this.apiService.getInstance());
|
|
||||||
this.processInstanceVariablesApi = new ProcessInstanceVariablesApi(this.apiService.getInstance());
|
|
||||||
this.processInstancesApi = new ProcessInstancesApi(this.apiService.getInstance());
|
|
||||||
this.usersApi = new UsersApi(this.apiService.getInstance());
|
|
||||||
this.groupsApi = new ActivitiGroupsApi(this.apiService.getInstance());
|
|
||||||
this.taskFormsApi = new TaskFormsApi(this.apiService.getInstance());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -30,11 +30,12 @@ export class ProcessContentService {
|
|||||||
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';
|
||||||
|
|
||||||
private contentApi: ActivitiContentApi;
|
get contentApi(): ActivitiContentApi {
|
||||||
|
return new ActivitiContentApi(this.apiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
constructor(private apiService: AlfrescoApiService,
|
constructor(private apiService: AlfrescoApiService,
|
||||||
private logService: LogService) {
|
private logService: LogService) {
|
||||||
this.contentApi = new ActivitiContentApi(this.apiService.getInstance());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -27,11 +27,12 @@ import { map, catchError } from 'rxjs/operators';
|
|||||||
})
|
})
|
||||||
export class AppsProcessService {
|
export class AppsProcessService {
|
||||||
|
|
||||||
appsApi: RuntimeAppDefinitionsApi;
|
get appsApi(): RuntimeAppDefinitionsApi {
|
||||||
|
return new RuntimeAppDefinitionsApi(this.apiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
constructor(private apiService: AlfrescoApiService,
|
constructor(private apiService: AlfrescoApiService,
|
||||||
private logService: LogService) {
|
private logService: LogService) {
|
||||||
this.appsApi = new RuntimeAppDefinitionsApi(this.apiService.getInstance());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -48,7 +48,9 @@ export class AuthenticationService {
|
|||||||
*/
|
*/
|
||||||
onLogout: ReplaySubject<any> = new ReplaySubject<any>(1);
|
onLogout: ReplaySubject<any> = new ReplaySubject<any>(1);
|
||||||
|
|
||||||
private profileApi: UserProfileApi;
|
get profileApi(): UserProfileApi {
|
||||||
|
return new UserProfileApi(this.alfrescoApi.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private appConfig: AppConfigService,
|
private appConfig: AppConfigService,
|
||||||
@ -58,7 +60,6 @@ export class AuthenticationService {
|
|||||||
private logService: LogService) {
|
private logService: LogService) {
|
||||||
this.alfrescoApi.alfrescoApiInitialized.subscribe(() => {
|
this.alfrescoApi.alfrescoApiInitialized.subscribe(() => {
|
||||||
this.alfrescoApi.getInstance().reply('logged-in', () => {
|
this.alfrescoApi.getInstance().reply('logged-in', () => {
|
||||||
this.profileApi = new UserProfileApi(alfrescoApi.getInstance());
|
|
||||||
this.onLogin.next();
|
this.onLogin.next();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -33,11 +33,12 @@ import { UserProfileApi, UserRepresentation } from '@alfresco/js-api';
|
|||||||
})
|
})
|
||||||
export class BpmUserService {
|
export class BpmUserService {
|
||||||
|
|
||||||
private profileApi: UserProfileApi;
|
get profileApi(): UserProfileApi {
|
||||||
|
return new UserProfileApi(this.apiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
constructor(private apiService: AlfrescoApiService,
|
constructor(private apiService: AlfrescoApiService,
|
||||||
private logService: LogService) {
|
private logService: LogService) {
|
||||||
this.profileApi = new UserProfileApi(this.apiService.getInstance());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -28,11 +28,12 @@ import { CommentEntry, CommentsApi } from '@alfresco/js-api';
|
|||||||
})
|
})
|
||||||
export class CommentContentService {
|
export class CommentContentService {
|
||||||
|
|
||||||
private commentsApi: CommentsApi;
|
get commentsApi(): CommentsApi {
|
||||||
|
return new CommentsApi(this.apiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
constructor(private apiService: AlfrescoApiService,
|
constructor(private apiService: AlfrescoApiService,
|
||||||
private logService: LogService) {
|
private logService: LogService) {
|
||||||
this.commentsApi = new CommentsApi(this.apiService.getInstance());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -42,7 +43,7 @@ export class CommentContentService {
|
|||||||
* @returns Details of the comment added
|
* @returns Details of the comment added
|
||||||
*/
|
*/
|
||||||
addNodeComment(nodeId: string, message: string): Observable<CommentModel> {
|
addNodeComment(nodeId: string, message: string): Observable<CommentModel> {
|
||||||
return from(this.commentsApi.createComment(nodeId, {content: message}))
|
return from(this.commentsApi.createComment(nodeId, { content: message }))
|
||||||
.pipe(
|
.pipe(
|
||||||
map((response: CommentEntry) => {
|
map((response: CommentEntry) => {
|
||||||
return new CommentModel({
|
return new CommentModel({
|
||||||
|
@ -29,11 +29,12 @@ import { ActivitiCommentsApi } from '@alfresco/js-api';
|
|||||||
})
|
})
|
||||||
export class CommentProcessService {
|
export class CommentProcessService {
|
||||||
|
|
||||||
private commentsApi: ActivitiCommentsApi;
|
get commentsApi(): ActivitiCommentsApi {
|
||||||
|
return new ActivitiCommentsApi(this.apiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
constructor(private apiService: AlfrescoApiService,
|
constructor(private apiService: AlfrescoApiService,
|
||||||
private logService: LogService) {
|
private logService: LogService) {
|
||||||
this.commentsApi = new ActivitiCommentsApi(this.apiService.getInstance());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -38,8 +38,13 @@ export class ContentService {
|
|||||||
folderCreate: Subject<MinimalNode> = new Subject<MinimalNode>();
|
folderCreate: Subject<MinimalNode> = new Subject<MinimalNode>();
|
||||||
folderEdit: Subject<MinimalNode> = new Subject<MinimalNode>();
|
folderEdit: Subject<MinimalNode> = new Subject<MinimalNode>();
|
||||||
|
|
||||||
private contentApi: ContentApi;
|
get contentApi(): ContentApi {
|
||||||
private nodesApi: NodesApi;
|
return new ContentApi(this.apiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
|
get nodesApi(): NodesApi {
|
||||||
|
return new NodesApi(this.apiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
constructor(public authService: AuthenticationService,
|
constructor(public authService: AuthenticationService,
|
||||||
public apiService: AlfrescoApiService,
|
public apiService: AlfrescoApiService,
|
||||||
@ -47,8 +52,6 @@ export class ContentService {
|
|||||||
private sanitizer: DomSanitizer,
|
private sanitizer: DomSanitizer,
|
||||||
private downloadService: DownloadService,
|
private downloadService: DownloadService,
|
||||||
private thumbnailService: ThumbnailService) {
|
private thumbnailService: ThumbnailService) {
|
||||||
this.contentApi = new ContentApi(apiService.getInstance());
|
|
||||||
this.nodesApi = new NodesApi(apiService.getInstance());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -28,15 +28,18 @@ import { catchError } from 'rxjs/operators';
|
|||||||
})
|
})
|
||||||
export class DeletedNodesApiService {
|
export class DeletedNodesApiService {
|
||||||
|
|
||||||
nodesApi: NodesApi;
|
get nodesApi(): NodesApi {
|
||||||
trashcanApi: TrashcanApi;
|
return new NodesApi(this.apiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
|
get trashcanApi(): TrashcanApi {
|
||||||
|
return new TrashcanApi(this.apiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private apiService: AlfrescoApiService,
|
private apiService: AlfrescoApiService,
|
||||||
private preferences: UserPreferencesService
|
private preferences: UserPreferencesService
|
||||||
) {
|
) {
|
||||||
this.nodesApi = new NodesApi(this.apiService.getInstance());
|
|
||||||
this.trashcanApi = new TrashcanApi(this.apiService.getInstance());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -27,11 +27,12 @@ import { catchError } from 'rxjs/operators';
|
|||||||
})
|
})
|
||||||
export class DownloadZipService {
|
export class DownloadZipService {
|
||||||
|
|
||||||
downloadsApi: DownloadsApi;
|
get downloadsApi(): DownloadsApi {
|
||||||
|
return new DownloadsApi(this.apiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
constructor(private apiService: AlfrescoApiService,
|
constructor(private apiService: AlfrescoApiService,
|
||||||
private logService: LogService) {
|
private logService: LogService) {
|
||||||
this.downloadsApi = new DownloadsApi(this.apiService.getInstance());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -27,7 +27,9 @@ import { catchError } from 'rxjs/operators';
|
|||||||
})
|
})
|
||||||
export class FavoritesApiService {
|
export class FavoritesApiService {
|
||||||
|
|
||||||
private favoritesApi: FavoritesApi;
|
get favoritesApi(): FavoritesApi {
|
||||||
|
return new FavoritesApi(this.apiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
static remapEntry({ entry }: any): any {
|
static remapEntry({ entry }: any): any {
|
||||||
entry.properties = {
|
entry.properties = {
|
||||||
@ -42,7 +44,6 @@ export class FavoritesApiService {
|
|||||||
private apiService: AlfrescoApiService,
|
private apiService: AlfrescoApiService,
|
||||||
private preferences: UserPreferencesService
|
private preferences: UserPreferencesService
|
||||||
) {
|
) {
|
||||||
this.favoritesApi = new FavoritesApi(this.apiService.getInstance());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
remapFavoritesData(data: FavoritePaging = {}): NodePaging {
|
remapFavoritesData(data: FavoritePaging = {}): NodePaging {
|
||||||
|
@ -28,13 +28,16 @@ import { NodeMetadata } from '../models/node-metadata.model';
|
|||||||
})
|
})
|
||||||
export class NodesApiService {
|
export class NodesApiService {
|
||||||
|
|
||||||
private nodesApi: NodesApi;
|
get trashcanApi(): TrashcanApi {
|
||||||
private trashcanApi: TrashcanApi;
|
return new TrashcanApi(this.apiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
|
get nodesApi(): NodesApi {
|
||||||
|
return new NodesApi(this.apiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
constructor(private apiService: AlfrescoApiService,
|
constructor(private apiService: AlfrescoApiService,
|
||||||
private preferences: UserPreferencesService) {
|
private preferences: UserPreferencesService) {
|
||||||
this.nodesApi = new NodesApi(this.apiService.getInstance());
|
|
||||||
this.trashcanApi = new TrashcanApi(this.apiService.getInstance());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private getEntryFromEntity(entity: NodeEntry) {
|
private getEntryFromEntity(entity: NodeEntry) {
|
||||||
|
@ -50,10 +50,11 @@ export class PeopleContentService {
|
|||||||
private hasContentAdminRole: boolean = false;
|
private hasContentAdminRole: boolean = false;
|
||||||
hasCheckedIsContentAdmin: boolean = false;
|
hasCheckedIsContentAdmin: boolean = false;
|
||||||
|
|
||||||
private peopleApi: PeopleApi;
|
get peopleApi(): PeopleApi {
|
||||||
|
return new PeopleApi(this.apiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
constructor(private apiService: AlfrescoApiService, private logService: LogService) {
|
constructor(private apiService: AlfrescoApiService, private logService: LogService) {
|
||||||
this.peopleApi = new PeopleApi(this.apiService.getInstance());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -124,7 +125,7 @@ export class PeopleContentService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private buildOrderArray(sorting: PeopleContentSortingModel): string[] {
|
private buildOrderArray(sorting: PeopleContentSortingModel): string[] {
|
||||||
return sorting?.orderBy && sorting?.direction ? [ `${sorting.orderBy} ${sorting.direction.toUpperCase()}` ] : [];
|
return sorting?.orderBy && sorting?.direction ? [`${sorting.orderBy} ${sorting.direction.toUpperCase()}`] : [];
|
||||||
}
|
}
|
||||||
|
|
||||||
private handleError(error: any) {
|
private handleError(error: any) {
|
||||||
|
@ -21,20 +21,27 @@ import { UserProcessModel } from '../models/user-process.model';
|
|||||||
import { AlfrescoApiService } from './alfresco-api.service';
|
import { AlfrescoApiService } from './alfresco-api.service';
|
||||||
import { LogService } from './log.service';
|
import { LogService } from './log.service';
|
||||||
import { catchError, map } from 'rxjs/operators';
|
import { catchError, map } from 'rxjs/operators';
|
||||||
import { TaskActionsApi, UsersApi, ResultListDataRepresentationLightUserRepresentation } from '@alfresco/js-api';
|
import {
|
||||||
|
TaskActionsApi,
|
||||||
|
UsersApi,
|
||||||
|
ResultListDataRepresentationLightUserRepresentation
|
||||||
|
} from '@alfresco/js-api';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
})
|
})
|
||||||
export class PeopleProcessService {
|
export class PeopleProcessService {
|
||||||
|
|
||||||
private taskActionsApi: TaskActionsApi;
|
get taskActionsApi(): TaskActionsApi {
|
||||||
private userApi: UsersApi;
|
return new TaskActionsApi(this.apiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
|
get userApi(): UsersApi {
|
||||||
|
return new UsersApi(this.apiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
constructor(private apiService: AlfrescoApiService,
|
constructor(private apiService: AlfrescoApiService,
|
||||||
private logService: LogService) {
|
private logService: LogService) {
|
||||||
this.taskActionsApi = new TaskActionsApi(this.apiService.getInstance());
|
|
||||||
this.userApi = new UsersApi(this.apiService.getInstance());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -26,12 +26,15 @@ import { concatMap, switchMap, takeWhile, map } from 'rxjs/operators';
|
|||||||
})
|
})
|
||||||
export class RenditionsService {
|
export class RenditionsService {
|
||||||
|
|
||||||
private renditionsApi: RenditionsApi;
|
get renditionsApi(): RenditionsApi {
|
||||||
private contentApi: ContentApi;
|
return new RenditionsApi(this.apiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
|
get contentApi(): ContentApi {
|
||||||
|
return new ContentApi(this.apiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
constructor(private apiService: AlfrescoApiService) {
|
constructor(private apiService: AlfrescoApiService) {
|
||||||
this.renditionsApi = new RenditionsApi(this.apiService.getInstance());
|
|
||||||
this.contentApi = new ContentApi(this.apiService.getInstance());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -27,13 +27,17 @@ import { SearchConfigurationService } from './search-configuration.service';
|
|||||||
export class SearchService {
|
export class SearchService {
|
||||||
|
|
||||||
dataLoaded: Subject<ResultSetPaging> = new Subject();
|
dataLoaded: Subject<ResultSetPaging> = new Subject();
|
||||||
queriesApi: QueriesApi;
|
|
||||||
searchApi: SearchApi;
|
get queriesApi(): QueriesApi {
|
||||||
|
return new QueriesApi(this.apiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
|
get searchApi(): SearchApi {
|
||||||
|
return new SearchApi(this.apiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
constructor(private apiService: AlfrescoApiService,
|
constructor(private apiService: AlfrescoApiService,
|
||||||
private searchConfigurationService: SearchConfigurationService) {
|
private searchConfigurationService: SearchConfigurationService) {
|
||||||
this.queriesApi = new QueriesApi(this.apiService.getInstance());
|
|
||||||
this.searchApi = new SearchApi(this.apiService.getInstance());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -28,11 +28,13 @@ import { catchError } from 'rxjs/operators';
|
|||||||
export class SharedLinksApiService {
|
export class SharedLinksApiService {
|
||||||
|
|
||||||
error = new Subject<{ statusCode: number, message: string }>();
|
error = new Subject<{ statusCode: number, message: string }>();
|
||||||
private sharedLinksApi: SharedlinksApi;
|
|
||||||
|
get sharedLinksApi(): SharedlinksApi {
|
||||||
|
return new SharedlinksApi(this.apiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
constructor(private apiService: AlfrescoApiService,
|
constructor(private apiService: AlfrescoApiService,
|
||||||
private preferences: UserPreferencesService) {
|
private preferences: UserPreferencesService) {
|
||||||
this.sharedLinksApi = new SharedlinksApi(this.apiService.getInstance());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -40,10 +40,11 @@ import { LogService } from './log.service';
|
|||||||
})
|
})
|
||||||
export class SitesService {
|
export class SitesService {
|
||||||
|
|
||||||
private sitesApi: SitesApi;
|
get sitesApi(): SitesApi {
|
||||||
|
return new SitesApi(this.apiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
constructor(private apiService: AlfrescoApiService, private logService: LogService) {
|
constructor(private apiService: AlfrescoApiService, private logService: LogService) {
|
||||||
this.sitesApi = new SitesApi(this.apiService.getInstance());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -164,10 +164,11 @@ export class ThumbnailService {
|
|||||||
'task': './assets/images/task.svg'
|
'task': './assets/images/task.svg'
|
||||||
};
|
};
|
||||||
|
|
||||||
private contentApi: ContentApi;
|
get contentApi(): ContentApi {
|
||||||
|
return new ContentApi(this.apiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
constructor(protected apiService: AlfrescoApiService, matIconRegistry: MatIconRegistry, sanitizer: DomSanitizer) {
|
constructor(protected apiService: AlfrescoApiService, matIconRegistry: MatIconRegistry, sanitizer: DomSanitizer) {
|
||||||
this.contentApi = new ContentApi(apiService.getInstance());
|
|
||||||
Object.keys(this.mimeTypeIcons).forEach((key) => {
|
Object.keys(this.mimeTypeIcons).forEach((key) => {
|
||||||
const url = sanitizer.bypassSecurityTrustResourceUrl(this.mimeTypeIcons[key]);
|
const url = sanitizer.bypassSecurityTrustResourceUrl(this.mimeTypeIcons[key]);
|
||||||
|
|
||||||
|
@ -63,9 +63,17 @@ export class UploadService {
|
|||||||
fileUploadDeleted: Subject<FileUploadDeleteEvent> = new Subject<FileUploadDeleteEvent>();
|
fileUploadDeleted: Subject<FileUploadDeleteEvent> = new Subject<FileUploadDeleteEvent>();
|
||||||
fileDeleted: Subject<string> = new Subject<string>();
|
fileDeleted: Subject<string> = new Subject<string>();
|
||||||
|
|
||||||
private uploadApi: UploadApi;
|
get uploadApi(): UploadApi {
|
||||||
private nodesApi: NodesApi;
|
return new UploadApi(this.apiService.getInstance());
|
||||||
private versionsApi: VersionsApi;
|
}
|
||||||
|
|
||||||
|
get nodesApi(): NodesApi {
|
||||||
|
return new NodesApi(this.apiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
|
get versionsApi(): VersionsApi {
|
||||||
|
return new VersionsApi(this.apiService.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
protected apiService: AlfrescoApiService,
|
protected apiService: AlfrescoApiService,
|
||||||
@ -76,10 +84,6 @@ export class UploadService {
|
|||||||
.subscribe(({ status }) => {
|
.subscribe(({ status }) => {
|
||||||
this.isThumbnailGenerationEnabled = status.isThumbnailGenerationEnabled;
|
this.isThumbnailGenerationEnabled = status.isThumbnailGenerationEnabled;
|
||||||
});
|
});
|
||||||
|
|
||||||
this.uploadApi = new UploadApi(apiService.getInstance());
|
|
||||||
this.nodesApi = new NodesApi(apiService.getInstance());
|
|
||||||
this.versionsApi = new VersionsApi(apiService.getInstance());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user