mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-09-17 14:21:29 +00:00
Renaming things...
This commit is contained in:
@@ -19,10 +19,9 @@
|
||||
|
||||
import { HttpClientModule, HttpClientXsrfModule, HTTP_INTERCEPTORS } from '@angular/common/http';
|
||||
import { APP_INITIALIZER, NgModule } from '@angular/core';
|
||||
import { AngularAlfrescoApi } from './services/angular-alfresco-api';
|
||||
import { AlfrescoApiV2Service } from './services/alfresco-api-v2.service';
|
||||
import { AlfrescoApiClientFactory } from './services/alfresco-api-client.factory';
|
||||
import { AngularAlfrescoApiLoaderService } from './services/angular-alfresco-api-loader.service';
|
||||
import { createAngularAlfrescoApiService } from './services/angular-alfresco-service.factory';
|
||||
import { AlfrescoApiV2LoaderService, createAlfrescoApiV2Service } from './services/alfresco-api-v2-loader.service';
|
||||
import { AuthBearerInterceptor } from './services/auth-bearer.interceptor';
|
||||
|
||||
@NgModule({
|
||||
@@ -34,14 +33,14 @@ import { AuthBearerInterceptor } from './services/auth-bearer.interceptor';
|
||||
})
|
||||
],
|
||||
providers: [
|
||||
AngularAlfrescoApi,
|
||||
AngularAlfrescoApiLoaderService,
|
||||
AlfrescoApiV2Service,
|
||||
AlfrescoApiV2LoaderService,
|
||||
AlfrescoApiClientFactory,
|
||||
{
|
||||
provide: APP_INITIALIZER,
|
||||
useFactory: createAngularAlfrescoApiService,
|
||||
useFactory: createAlfrescoApiV2Service,
|
||||
deps: [
|
||||
AngularAlfrescoApiLoaderService
|
||||
AlfrescoApiV2LoaderService
|
||||
],
|
||||
multi: true
|
||||
},
|
||||
|
@@ -16,5 +16,5 @@
|
||||
*/
|
||||
|
||||
export * from './alfresco-api.module';
|
||||
export * from './services/angular-alfresco-api';
|
||||
export * from './services/alfresco-api-v2.service';
|
||||
export * from './services/alfresco-api-client.factory';
|
||||
|
@@ -19,7 +19,7 @@
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { DiscoveryApi, NodesApi } from '@alfresco/js-api';
|
||||
import { AngularAlfrescoApi } from './angular-alfresco-api';
|
||||
import { AlfrescoApiV2Service } from './alfresco-api-v2.service';
|
||||
|
||||
@Injectable()
|
||||
export class AlfrescoApiClientFactory {
|
||||
@@ -28,7 +28,7 @@ export class AlfrescoApiClientFactory {
|
||||
private nodesApi: NodesApi = null;
|
||||
|
||||
constructor(
|
||||
private angularAlfrescoApi?: AngularAlfrescoApi) {
|
||||
private angularAlfrescoApi?: AlfrescoApiV2Service) {
|
||||
}
|
||||
|
||||
getDiscoveryApi() {
|
||||
|
@@ -15,26 +15,32 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/*tslint:disable*/ // => because of ADF file naming problems... Try to remove it, if you don't believe me :P
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { AlfrescoApi, AlfrescoApiConfig } from '@alfresco/js-api';
|
||||
import { AppConfigService, AppConfigValues } from '../../app-config/app-config.service';
|
||||
import { OauthConfigModel } from '../../models/oauth-config.model';
|
||||
import { StorageService } from '../../services/storage.service';
|
||||
import { AngularAlfrescoApi } from './angular-alfresco-api';
|
||||
import { AlfrescoApiV2Service } from './alfresco-api-v2.service';
|
||||
|
||||
export function createAlfrescoApiV2Service(angularAlfrescoApiService: AlfrescoApiV2LoaderService) {
|
||||
return () => angularAlfrescoApiService.load();
|
||||
}
|
||||
|
||||
@Injectable()
|
||||
export class AngularAlfrescoApiLoaderService {
|
||||
export class AlfrescoApiV2LoaderService {
|
||||
|
||||
protected alfrescoApi: AlfrescoApi;
|
||||
|
||||
constructor(
|
||||
protected appConfig: AppConfigService,
|
||||
protected storageService: StorageService,
|
||||
private angularAlfrescoApi?: AngularAlfrescoApi) {
|
||||
private alfrescoApiV2Service?: AlfrescoApiV2Service) {
|
||||
}
|
||||
|
||||
async load() {
|
||||
await this.appConfig.load().then(() => {
|
||||
load(): Promise<any> {
|
||||
return this.appConfig.load().then(() => {
|
||||
this.storageService.prefix = this.appConfig.get<string>(AppConfigValues.STORAGE_PREFIX, '');
|
||||
this.initAngularAlfrescoApi();
|
||||
});
|
||||
@@ -60,6 +66,6 @@ export class AngularAlfrescoApiLoaderService {
|
||||
oauth2: oauth
|
||||
});
|
||||
|
||||
this.angularAlfrescoApi.init(config);
|
||||
this.alfrescoApiV2Service.init(config);
|
||||
}
|
||||
}
|
@@ -15,6 +15,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/*tslint:disable*/ // => because of ADF file naming problems... Try to remove it, if you don't believe me :P
|
||||
|
||||
import { AlfrescoApiConfig } from '@alfresco/js-api';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { JsApiHttpClient } from '../js-api/js-api-http-client';
|
||||
@@ -22,7 +24,7 @@ import { JsApiAngularHttpClient } from './js-api-angular-http-client';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
|
||||
@Injectable()
|
||||
export class AngularAlfrescoApi {
|
||||
export class AlfrescoApiV2Service {
|
||||
public contentPrivateClient: JsApiHttpClient;
|
||||
public contentClient: JsApiHttpClient;
|
||||
public authClient: JsApiHttpClient;
|
@@ -1,23 +0,0 @@
|
||||
/*!
|
||||
* @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 { AngularAlfrescoApiLoaderService } from './angular-alfresco-api-loader.service';
|
||||
|
||||
// eslint-disable-next-line prefer-arrow/prefer-arrow-functions
|
||||
export function createAngularAlfrescoApiService(angularAlfrescoApiService: AngularAlfrescoApiLoaderService) {
|
||||
return () => angularAlfrescoApiService.load();
|
||||
}
|
Reference in New Issue
Block a user