The alfrescoSetting property is present twice

This commit is contained in:
mauriziovitale84 2016-08-11 17:19:02 +01:00
parent b6626e1c20
commit b15ea3c6d4
4 changed files with 19 additions and 21 deletions

View File

@ -25,13 +25,13 @@ export class AlfrescoAuthenticationBPM extends AlfrescoAuthenticationBase implem
TYPE: string = 'BPM'; TYPE: string = 'BPM';
constructor(private alfrescoSettingsService: AlfrescoSettingsService, constructor(alfrescoSetting: AlfrescoSettingsService,
private http: Http) { http: Http) {
super(alfrescoSettingsService, http); super(alfrescoSetting, http);
} }
getHost(): string { 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) { private apiActivitiLogin(username: string, password: string) {
let url = this.alfrescoSettingsService.getBPMApiBaseUrl() + '/app/authentication'; let url = this.alfrescoSetting.getBPMApiBaseUrl() + '/app/authentication';
let headers = new Headers({ let headers = new Headers({
'Content-Type': 'application/x-www-form-urlencoded' 'Content-Type': 'application/x-www-form-urlencoded'
}); });
@ -91,7 +91,7 @@ export class AlfrescoAuthenticationBPM extends AlfrescoAuthenticationBase implem
} }
private apiActivitiLogout() { private apiActivitiLogout() {
let url = this.alfrescoSettingsService.getBPMApiBaseUrl() + '/app/logout'; let url = this.alfrescoSetting.getBPMApiBaseUrl() + '/app/logout';
return this.http.get(url).toPromise(); return this.http.get(url).toPromise();
} }

View File

@ -25,15 +25,13 @@ export class AlfrescoAuthenticationBase {
alfrescoApi: any; alfrescoApi: any;
private alfrescoSetting: AlfrescoSettingsService;
/** /**
* Constructor * Constructor
* @param alfrescoSettingsService * @param alfrescoSettingsService
*/ */
constructor(alfrescoSettingsService: AlfrescoSettingsService, constructor(public alfrescoSetting: AlfrescoSettingsService,
http: Http) { public http: Http) {
this.alfrescoSetting = alfrescoSettingsService;
} }
/** /**

View File

@ -31,12 +31,12 @@ export class AlfrescoAuthenticationECM extends AlfrescoAuthenticationBase implem
/** /**
* Constructor * Constructor
* @param alfrescoSettingsService * @param alfrescoSetting
* @param http * @param http
*/ */
constructor(private alfrescoSettingsService: AlfrescoSettingsService, constructor(alfrescoSetting: AlfrescoSettingsService,
private http: Http) { http: Http) {
super(alfrescoSettingsService, http); super(alfrescoSetting, http);
if (!this.isLoggedIn) { if (!this.isLoggedIn) {
this.alfrescoApi = new AlfrescoApi({ this.alfrescoApi = new AlfrescoApi({
@ -51,7 +51,7 @@ export class AlfrescoAuthenticationECM extends AlfrescoAuthenticationBase implem
} }
getHost(): string { getHost(): string {
return this.alfrescoSettingsService.ecmHost; return this.alfrescoSetting.ecmHost;
} }
/** /**

View File

@ -35,13 +35,13 @@ export class AlfrescoAuthenticationService extends AlfrescoAuthenticationBase {
/** /**
* Constructor * Constructor
* @param alfrescoSettingsService * @param alfrescoSetting
* @param http * @param http
*/ */
constructor(private alfrescoSettingsService: AlfrescoSettingsService, constructor(alfrescoSetting: AlfrescoSettingsService,
private http: Http) { http: Http) {
super(alfrescoSettingsService, http); super(alfrescoSetting, http);
this.createProviderInstance(this.alfrescoSettingsService.getProviders()); this.createProviderInstance(alfrescoSetting.getProviders());
} }
/** /**
@ -175,7 +175,7 @@ export class AlfrescoAuthenticationService extends AlfrescoAuthenticationBase {
if (this.providersInstance.length === 0) { if (this.providersInstance.length === 0) {
providers.forEach((provider) => { providers.forEach((provider) => {
let authInstance: AbstractAuthentication = AuthenticationFactory.createAuth( let authInstance: AbstractAuthentication = AuthenticationFactory.createAuth(
this.alfrescoSettingsService, this.http, provider); this.alfrescoSetting, this.http, provider);
if (authInstance) { if (authInstance) {
this.providersInstance.push(authInstance); this.providersInstance.push(authInstance);
} }