From b15ea3c6d4c4036b73f2f392bca30ff8cf7db81f Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Thu, 11 Aug 2016 17:19:02 +0100 Subject: [PATCH] The alfrescoSetting property is present twice --- .../services/AlfrescoAuthenticationBPM.service.ts | 12 ++++++------ .../services/AlfrescoAuthenticationBase.service.ts | 6 ++---- .../services/AlfrescoAuthenticationECM.service.ts | 10 +++++----- .../AlfrescoAuthenticationService.service.ts | 12 ++++++------ 4 files changed, 19 insertions(+), 21 deletions(-) diff --git a/ng2-components/ng2-alfresco-core/src/services/AlfrescoAuthenticationBPM.service.ts b/ng2-components/ng2-alfresco-core/src/services/AlfrescoAuthenticationBPM.service.ts index efce19319c..31d3013637 100644 --- a/ng2-components/ng2-alfresco-core/src/services/AlfrescoAuthenticationBPM.service.ts +++ b/ng2-components/ng2-alfresco-core/src/services/AlfrescoAuthenticationBPM.service.ts @@ -25,13 +25,13 @@ export class AlfrescoAuthenticationBPM extends AlfrescoAuthenticationBase implem TYPE: string = 'BPM'; - constructor(private alfrescoSettingsService: AlfrescoSettingsService, - private http: Http) { - super(alfrescoSettingsService, http); + constructor(alfrescoSetting: AlfrescoSettingsService, + http: Http) { + super(alfrescoSetting, http); } getHost(): string { - return this.alfrescoSettingsService.bpmHost; + return this.alfrescoSetting.bpmHost; } /** @@ -75,7 +75,7 @@ export class AlfrescoAuthenticationBPM extends AlfrescoAuthenticationBase implem } private apiActivitiLogin(username: string, password: string) { - let url = this.alfrescoSettingsService.getBPMApiBaseUrl() + '/app/authentication'; + let url = this.alfrescoSetting.getBPMApiBaseUrl() + '/app/authentication'; let headers = new Headers({ 'Content-Type': 'application/x-www-form-urlencoded' }); @@ -91,7 +91,7 @@ export class AlfrescoAuthenticationBPM extends AlfrescoAuthenticationBase implem } private apiActivitiLogout() { - let url = this.alfrescoSettingsService.getBPMApiBaseUrl() + '/app/logout'; + let url = this.alfrescoSetting.getBPMApiBaseUrl() + '/app/logout'; return this.http.get(url).toPromise(); } diff --git a/ng2-components/ng2-alfresco-core/src/services/AlfrescoAuthenticationBase.service.ts b/ng2-components/ng2-alfresco-core/src/services/AlfrescoAuthenticationBase.service.ts index ddd4e3aaa2..2aa3ffd7c5 100644 --- a/ng2-components/ng2-alfresco-core/src/services/AlfrescoAuthenticationBase.service.ts +++ b/ng2-components/ng2-alfresco-core/src/services/AlfrescoAuthenticationBase.service.ts @@ -25,15 +25,13 @@ export class AlfrescoAuthenticationBase { alfrescoApi: any; - private alfrescoSetting: AlfrescoSettingsService; /** * Constructor * @param alfrescoSettingsService */ - constructor(alfrescoSettingsService: AlfrescoSettingsService, - http: Http) { - this.alfrescoSetting = alfrescoSettingsService; + constructor(public alfrescoSetting: AlfrescoSettingsService, + public http: Http) { } /** diff --git a/ng2-components/ng2-alfresco-core/src/services/AlfrescoAuthenticationECM.service.ts b/ng2-components/ng2-alfresco-core/src/services/AlfrescoAuthenticationECM.service.ts index ab83f212af..df911aa1f5 100644 --- a/ng2-components/ng2-alfresco-core/src/services/AlfrescoAuthenticationECM.service.ts +++ b/ng2-components/ng2-alfresco-core/src/services/AlfrescoAuthenticationECM.service.ts @@ -31,12 +31,12 @@ export class AlfrescoAuthenticationECM extends AlfrescoAuthenticationBase implem /** * Constructor - * @param alfrescoSettingsService + * @param alfrescoSetting * @param http */ - constructor(private alfrescoSettingsService: AlfrescoSettingsService, - private http: Http) { - super(alfrescoSettingsService, http); + constructor(alfrescoSetting: AlfrescoSettingsService, + http: Http) { + super(alfrescoSetting, http); if (!this.isLoggedIn) { this.alfrescoApi = new AlfrescoApi({ @@ -51,7 +51,7 @@ export class AlfrescoAuthenticationECM extends AlfrescoAuthenticationBase implem } getHost(): string { - return this.alfrescoSettingsService.ecmHost; + return this.alfrescoSetting.ecmHost; } /** diff --git a/ng2-components/ng2-alfresco-core/src/services/AlfrescoAuthenticationService.service.ts b/ng2-components/ng2-alfresco-core/src/services/AlfrescoAuthenticationService.service.ts index c8eb0071bb..25cec2f692 100644 --- a/ng2-components/ng2-alfresco-core/src/services/AlfrescoAuthenticationService.service.ts +++ b/ng2-components/ng2-alfresco-core/src/services/AlfrescoAuthenticationService.service.ts @@ -35,13 +35,13 @@ export class AlfrescoAuthenticationService extends AlfrescoAuthenticationBase { /** * Constructor - * @param alfrescoSettingsService + * @param alfrescoSetting * @param http */ - constructor(private alfrescoSettingsService: AlfrescoSettingsService, - private http: Http) { - super(alfrescoSettingsService, http); - this.createProviderInstance(this.alfrescoSettingsService.getProviders()); + constructor(alfrescoSetting: AlfrescoSettingsService, + http: Http) { + super(alfrescoSetting, http); + this.createProviderInstance(alfrescoSetting.getProviders()); } /** @@ -175,7 +175,7 @@ export class AlfrescoAuthenticationService extends AlfrescoAuthenticationBase { if (this.providersInstance.length === 0) { providers.forEach((provider) => { let authInstance: AbstractAuthentication = AuthenticationFactory.createAuth( - this.alfrescoSettingsService, this.http, provider); + this.alfrescoSetting, this.http, provider); if (authInstance) { this.providersInstance.push(authInstance); }