mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
rename two times service class just once
move responsability providers configurration in setting service refactoring
This commit is contained in:
@@ -17,15 +17,15 @@
|
||||
|
||||
import {it, describe} from '@angular/core/testing';
|
||||
import {ReflectiveInjector, provide} from '@angular/core';
|
||||
import {AlfrescoSettingsService} from './AlfrescoSettingsService.service';
|
||||
import {AlfrescoAuthenticationService} from './AlfrescoAuthenticationService.service';
|
||||
import {AlfrescoSettingsService} from './AlfrescoSettings.service';
|
||||
import {AlfrescoAuthenticationService} from './AlfrescoAuthentication.service';
|
||||
import {XHRBackend, HTTP_PROVIDERS} from '@angular/http';
|
||||
import {MockBackend} from '@angular/http/testing';
|
||||
|
||||
declare var AlfrescoApi: any;
|
||||
|
||||
describe('AlfrescoAuthentication', () => {
|
||||
let injector, fakePromiseECM, fakePromiseBPM, service, fakePromiseBPMECM;
|
||||
let injector, fakePromiseECM, fakePromiseBPM, authService, fakePromiseBPMECM;
|
||||
|
||||
fakePromiseECM = new Promise(function (resolve, reject) {
|
||||
resolve(
|
||||
@@ -90,16 +90,15 @@ describe('AlfrescoAuthentication', () => {
|
||||
describe('when the setting is ECM', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
this.providers = 'ECM';
|
||||
service = injector.get(AlfrescoAuthenticationService);
|
||||
authService = injector.get(AlfrescoAuthenticationService);
|
||||
});
|
||||
|
||||
it('should return an ECM ticket after the login done', (done) => {
|
||||
spyOn(AlfrescoAuthenticationService.prototype, 'callApiLogin').and.returnValue(fakePromiseECM);
|
||||
|
||||
service.login('fake-username', 'fake-password', this.providers).subscribe(() => {
|
||||
expect(service.isLoggedIn()).toBe(true);
|
||||
expect(service.getTicket()).toEqual('fake-post-ticket-ECM');
|
||||
authService.login('fake-username', 'fake-password').subscribe(() => {
|
||||
expect(authService.isLoggedIn()).toBe(true);
|
||||
expect(authService.getTicket()).toEqual('fake-post-ticket-ECM');
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -108,12 +107,12 @@ describe('AlfrescoAuthentication', () => {
|
||||
spyOn(AlfrescoAuthenticationService.prototype, 'callApiLogin')
|
||||
.and.returnValue(Promise.reject('fake invalid credentials'));
|
||||
|
||||
service.login('fake-wrong-username', 'fake-wrong-password', this.providers).subscribe(
|
||||
authService.login('fake-wrong-username', 'fake-wrong-password').subscribe(
|
||||
(res) => {
|
||||
},
|
||||
(err: any) => {
|
||||
expect(service.isLoggedIn()).toBe(false);
|
||||
expect(service.getTicket()).toBeUndefined();
|
||||
expect(authService.isLoggedIn()).toBe(false);
|
||||
expect(authService.getTicket()).toBeUndefined();
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -121,8 +120,7 @@ describe('AlfrescoAuthentication', () => {
|
||||
it('should login in the ECM if no provider are defined calling the login', (done) => {
|
||||
spyOn(AlfrescoAuthenticationService.prototype, 'callApiLogin').and.returnValue(fakePromiseECM);
|
||||
|
||||
service.login('fake-username', 'fake-password').subscribe(() => {
|
||||
service.TYPE = 'ECM';
|
||||
authService.login('fake-username', 'fake-password').subscribe(() => {
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -131,9 +129,9 @@ describe('AlfrescoAuthentication', () => {
|
||||
localStorage.setItem('ticket-ECM', 'fake-post-ticket-ECM');
|
||||
spyOn(AlfrescoAuthenticationService.prototype, 'callApiLogout').and.returnValue(fakePromiseECM);
|
||||
|
||||
service.logout().subscribe(() => {
|
||||
expect(service.isLoggedIn()).toBe(false);
|
||||
expect(service.getTicket()).toBeUndefined();
|
||||
authService.logout().subscribe(() => {
|
||||
expect(authService.isLoggedIn()).toBe(false);
|
||||
expect(authService.getTicket()).toBeUndefined();
|
||||
expect(localStorage.getItem('ticket-ECM')).toBeUndefined();
|
||||
done();
|
||||
});
|
||||
@@ -141,35 +139,38 @@ describe('AlfrescoAuthentication', () => {
|
||||
|
||||
it('should logout only if the provider is already logged in', (done) => {
|
||||
localStorage.setItem('ticket-ECM', 'fake-post-ticket-ECM');
|
||||
|
||||
spyOn(AlfrescoAuthenticationService.prototype, 'callApiLogout').and.returnValue(fakePromiseECM);
|
||||
service.saveTicket('fake-ticket-ECM');
|
||||
service.logout().subscribe(() => {
|
||||
expect(service.isLoggedIn()).toBe(false);
|
||||
expect(service.getTicket()).toBeUndefined();
|
||||
|
||||
authService.saveTicket('fake-ticket-ECM');
|
||||
|
||||
authService.logout().subscribe(() => {
|
||||
expect(authService.isLoggedIn()).toBe(false);
|
||||
expect(authService.getTicket()).toBeUndefined();
|
||||
expect(localStorage.getItem('ticket-ECM')).toBeUndefined();
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('should return false if the user is not logged in', () => {
|
||||
expect(service.isLoggedIn()).toBe(false);
|
||||
expect(authService.isLoggedIn()).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe('when the setting is BPM', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
this.providers = 'BPM';
|
||||
service = injector.get(AlfrescoAuthenticationService);
|
||||
authService = injector.get(AlfrescoAuthenticationService);
|
||||
authService.providers = 'BPM';
|
||||
});
|
||||
|
||||
|
||||
it('should return an BPM ticket after the login done', (done) => {
|
||||
spyOn(AlfrescoAuthenticationService.prototype, 'callApiLogin').and.returnValue(fakePromiseBPM);
|
||||
|
||||
service.login('fake-username', 'fake-password', this.providers).subscribe(() => {
|
||||
expect(service.isLoggedIn()).toBe(true);
|
||||
expect(service.getTicket()).toEqual('fake-post-ticket-BPM');
|
||||
authService.login('fake-username', 'fake-password').subscribe(() => {
|
||||
expect(authService.isLoggedIn()).toBe(true);
|
||||
expect(authService.getTicket()).toEqual('fake-post-ticket-BPM');
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -177,12 +178,12 @@ describe('AlfrescoAuthentication', () => {
|
||||
it('should return ticket undefined when the credentials are wrong', (done) => {
|
||||
spyOn(AlfrescoAuthenticationService.prototype, 'callApiLogin').and.returnValue(Promise.reject('fake invalid credentials'));
|
||||
|
||||
service.login('fake-wrong-username', 'fake-wrong-password', this.providers).subscribe(
|
||||
authService.login('fake-wrong-username', 'fake-wrong-password').subscribe(
|
||||
(res) => {
|
||||
},
|
||||
(err: any) => {
|
||||
expect(service.isLoggedIn()).toBe(false);
|
||||
expect(service.getTicket()).toBeUndefined();
|
||||
expect(authService.isLoggedIn()).toBe(false);
|
||||
expect(authService.getTicket()).toBeUndefined();
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -190,12 +191,12 @@ describe('AlfrescoAuthentication', () => {
|
||||
it('should return a ticket undefined after logout', (done) => {
|
||||
spyOn(AlfrescoAuthenticationService.prototype, 'callApiLogin').and.returnValue(fakePromiseBPM);
|
||||
|
||||
service.login('fake-username', 'fake-password', this.providers).subscribe(() => {
|
||||
authService.login('fake-username', 'fake-password').subscribe(() => {
|
||||
spyOn(AlfrescoAuthenticationService.prototype, 'callApiLogout').and.returnValue(fakePromiseBPM);
|
||||
|
||||
service.logout().subscribe(() => {
|
||||
expect(service.isLoggedIn()).toBe(false);
|
||||
expect(service.getTicket()).toBeUndefined();
|
||||
authService.logout().subscribe(() => {
|
||||
expect(authService.isLoggedIn()).toBe(false);
|
||||
expect(authService.getTicket()).toBeUndefined();
|
||||
expect(localStorage.getItem('ticket-BPM')).toBeUndefined();
|
||||
done();
|
||||
});
|
||||
@@ -206,7 +207,7 @@ describe('AlfrescoAuthentication', () => {
|
||||
localStorage.setItem('ticket-BPM', 'fake-post-ticket-BPM');
|
||||
spyOn(AlfrescoAuthenticationService.prototype, 'callApiLogout').and.returnValue(Promise.reject('fake logout error'));
|
||||
|
||||
service.logout().subscribe(
|
||||
authService.logout().subscribe(
|
||||
(res) => {
|
||||
},
|
||||
(err: any) => {
|
||||
@@ -220,26 +221,16 @@ describe('AlfrescoAuthentication', () => {
|
||||
describe('when the setting is both ECM and BPM ', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
this.providers = 'ALL';
|
||||
service = injector.get(AlfrescoAuthenticationService);
|
||||
});
|
||||
|
||||
it('should create both instances', (done) => {
|
||||
spyOn(AlfrescoAuthenticationService.prototype, 'callApiLogin').and.returnValue(fakePromiseBPMECM);
|
||||
|
||||
service.login('fake-username', 'fake-password', this.providers).subscribe(() => {
|
||||
expect(service.isLoggedIn()).toBe(true);
|
||||
expect(service.TYPE).toEqual(this.providers);
|
||||
done();
|
||||
});
|
||||
authService = injector.get(AlfrescoAuthenticationService);
|
||||
authService.providers = 'ALL';
|
||||
});
|
||||
|
||||
it('should return both ECM and BPM tickets after the login done', (done) => {
|
||||
spyOn(AlfrescoAuthenticationService.prototype, 'callApiLogin').and.returnValue(fakePromiseBPMECM);
|
||||
|
||||
service.login('fake-username', 'fake-password', this.providers).subscribe(() => {
|
||||
expect(service.isLoggedIn()).toBe(true);
|
||||
expect(service.getTicket()).toEqual('fake-post-ticket-ECM,fake-post-ticket-BPM');
|
||||
authService.login('fake-username', 'fake-password').subscribe(() => {
|
||||
expect(authService.isLoggedIn()).toBe(true);
|
||||
expect(authService.getTicket()).toEqual('fake-post-ticket-ECM,fake-post-ticket-BPM');
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -247,12 +238,12 @@ describe('AlfrescoAuthentication', () => {
|
||||
it('should return ticket undefined when the credentials are wrong', (done) => {
|
||||
spyOn(AlfrescoAuthenticationService.prototype, 'callApiLogin').and.returnValue(Promise.reject('fake invalid credentials'));
|
||||
|
||||
service.login('fake-username', 'fake-password', this.providers).subscribe(
|
||||
authService.login('fake-username', 'fake-password').subscribe(
|
||||
(res) => {
|
||||
},
|
||||
(err: any) => {
|
||||
expect(service.isLoggedIn()).toBe(false);
|
||||
expect(service.getTicket()).toBeUndefined();
|
||||
expect(authService.isLoggedIn()).toBe(false);
|
||||
expect(authService.getTicket()).toBeUndefined();
|
||||
done();
|
||||
});
|
||||
});
|
@@ -17,7 +17,7 @@
|
||||
|
||||
import {Injectable} from '@angular/core';
|
||||
import {Observable} from 'rxjs/Rx';
|
||||
import {AlfrescoSettingsService} from './AlfrescoSettingsService.service';
|
||||
import {AlfrescoSettingsService} from './AlfrescoSettings.service';
|
||||
|
||||
declare let AlfrescoApi: any;
|
||||
|
||||
@@ -29,26 +29,11 @@ export class AlfrescoAuthenticationService {
|
||||
|
||||
alfrescoApi: any;
|
||||
|
||||
TYPE: string = 'ECM';
|
||||
|
||||
/**A
|
||||
* Constructor
|
||||
* @param alfrescoSetting
|
||||
*/
|
||||
constructor(public alfrescoSetting: AlfrescoSettingsService) {
|
||||
|
||||
if (!this.isLoggedIn()) {
|
||||
this.alfrescoApi = new AlfrescoApi({
|
||||
host: alfrescoSetting.ecmHost,
|
||||
hostActiviti: alfrescoSetting.bpmHost
|
||||
});
|
||||
} else {
|
||||
this.alfrescoApi = new AlfrescoApi({
|
||||
ticket: this.getTicket(),
|
||||
host: alfrescoSetting.ecmHost,
|
||||
hostActiviti: alfrescoSetting.bpmHost
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -63,29 +48,43 @@ export class AlfrescoAuthenticationService {
|
||||
* Method to delegate to POST login
|
||||
* @param username
|
||||
* @param password
|
||||
* @param provider
|
||||
* @returns {Observable<R>|Observable<T>}
|
||||
*/
|
||||
login(username: string, password: string, provider: string) {
|
||||
login(username: string, password: string) {
|
||||
|
||||
this.TYPE = provider || this.TYPE;
|
||||
return Observable.fromPromise(this.callApiLogin(username, password, provider))
|
||||
.map((response: any) => {
|
||||
this.saveTicket(response);
|
||||
return {type: provider, ticket: response};
|
||||
})
|
||||
.catch(this.handleError);
|
||||
if (this.isLoggedIn()) {
|
||||
this.alfrescoApi = new AlfrescoApi({
|
||||
provider: this.alfrescoSetting.getProviders(),
|
||||
ticket: this.getTicket(),
|
||||
host: this.alfrescoSetting.ecmHost,
|
||||
hostActiviti: this.alfrescoSetting.bpmHost
|
||||
});
|
||||
|
||||
return Observable.create((observer) => {
|
||||
observer.next({type: this.alfrescoSetting.getProviders(), ticket: this.getTicket()});
|
||||
observer.complete();
|
||||
}).catch(this.handleError);
|
||||
|
||||
} else {
|
||||
return Observable.fromPromise(this.callApiLogin(username, password))
|
||||
.map((response: any) => {
|
||||
this.saveTicket(response);
|
||||
return {type: this.alfrescoSetting.getProviders(), ticket: response};
|
||||
})
|
||||
.catch(this.handleError);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize the alfresco Api with user and password end call the login method
|
||||
* @param username
|
||||
* @param password
|
||||
* @param provider
|
||||
* @returns {*|Observable<any>}
|
||||
*/
|
||||
private callApiLogin(username: string, password: string, provider: string) {
|
||||
private callApiLogin(username: string, password: string) {
|
||||
|
||||
this.alfrescoApi = new AlfrescoApi({
|
||||
provider: this.alfrescoSetting.getProviders(),
|
||||
username: username,
|
||||
password: password,
|
||||
host: this.alfrescoSetting.ecmHost,
|
||||
@@ -114,7 +113,7 @@ export class AlfrescoAuthenticationService {
|
||||
* Remove the login ticket from localStorage
|
||||
*/
|
||||
public removeTicket(): void {
|
||||
localStorage.removeItem(`ticket-${this.TYPE}`);
|
||||
localStorage.removeItem(`ticket-${this.alfrescoSetting.getProviders()}`);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -122,16 +121,17 @@ export class AlfrescoAuthenticationService {
|
||||
* @returns {*|Observable<string>|Observable<any>|Promise<T>}
|
||||
*/
|
||||
private callApiLogout(): Promise<any> {
|
||||
return this.alfrescoApi.logout();
|
||||
if (this.alfrescoApi) {
|
||||
return this.alfrescoApi.logout();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* The method return the ticket stored in the localStorage
|
||||
* @returns ticket
|
||||
*/
|
||||
public getTicket(): string {
|
||||
return localStorage.getItem(`ticket-${this.TYPE}`);
|
||||
return localStorage.getItem(`ticket-${this.alfrescoSetting.getProviders()}`);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -140,7 +140,7 @@ export class AlfrescoAuthenticationService {
|
||||
*/
|
||||
public saveTicket(ticket): void {
|
||||
if (ticket) {
|
||||
localStorage.setItem(`ticket-${this.TYPE}`, ticket);
|
||||
localStorage.setItem(`ticket-${this.alfrescoSetting.getProviders()}`, ticket);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -155,6 +155,6 @@ export class AlfrescoAuthenticationService {
|
||||
}
|
||||
|
||||
getAlfrescoApi(): any {
|
||||
return this.alfrescoApi;
|
||||
return this.alfrescoApi;
|
||||
}
|
||||
}
|
@@ -17,7 +17,7 @@
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
import { AlfrescoAuthenticationService } from './AlfrescoAuthenticationService.service';
|
||||
import { AlfrescoAuthenticationService } from './AlfrescoAuthentication.service';
|
||||
|
||||
@Injectable()
|
||||
export class AlfrescoContentService {
|
@@ -0,0 +1,63 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 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 {describe, it, beforeEach} from '@angular/core/testing';
|
||||
import {ReflectiveInjector} from '@angular/core';
|
||||
import {AlfrescoSettingsService} from './AlfrescoSettings.service';
|
||||
import {AlfrescoAuthenticationService} from './AlfrescoAuthentication.service';
|
||||
import {AlfrescoContentService} from './AlfrescoContent.service';
|
||||
import {HTTP_PROVIDERS} from '@angular/http';
|
||||
|
||||
describe('AlfrescoContentService', () => {
|
||||
|
||||
let injector, contentService: AlfrescoContentService, authService: AlfrescoAuthenticationService, node;
|
||||
|
||||
const nodeId = 'fake-node-id';
|
||||
|
||||
beforeEach(() => {
|
||||
injector = ReflectiveInjector.resolveAndCreate([
|
||||
HTTP_PROVIDERS,
|
||||
AlfrescoContentService,
|
||||
AlfrescoAuthenticationService,
|
||||
AlfrescoSettingsService
|
||||
]);
|
||||
spyOn(localStorage, 'getItem').and.callFake(function (key) {
|
||||
return 'myTicket';
|
||||
});
|
||||
|
||||
contentService = injector.get(AlfrescoContentService);
|
||||
authService = injector.get(AlfrescoAuthenticationService);
|
||||
authService.login('fake-username', 'fake-password');
|
||||
|
||||
node = {
|
||||
entry: {
|
||||
id: nodeId
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
it('should return a valid content URL', () => {
|
||||
expect(contentService.getContentUrl(node)).toBe('http://127.0.0.1:8080/alfresco/api/' +
|
||||
'-default-/public/alfresco/versions/1/nodes/fake-node-id/content?attachment=false&alf_ticket=myTicket');
|
||||
});
|
||||
|
||||
it('should return a valid thumbnail URL', () => {
|
||||
expect(contentService.getDocumentThumbnailUrl(node))
|
||||
.toBe('http://127.0.0.1:8080/alfresco/api/-default-/public/alfresco' +
|
||||
'/versions/1/nodes/fake-node-id/renditions/doclib/content?attachment=false&alf_ticket=myTicket');
|
||||
});
|
||||
});
|
@@ -1,69 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 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 { describe, it, beforeEach } from '@angular/core/testing';
|
||||
import { ReflectiveInjector } from '@angular/core';
|
||||
import { AlfrescoSettingsService } from './AlfrescoSettingsService.service';
|
||||
import { AlfrescoAuthenticationService } from './AlfrescoAuthenticationService.service';
|
||||
import { AlfrescoContentService } from './AlfrescoContentService.service';
|
||||
import { HTTP_PROVIDERS } from '@angular/http';
|
||||
|
||||
describe('AlfrescoContentService', () => {
|
||||
|
||||
let injector, service: AlfrescoContentService, authService: AlfrescoAuthenticationService;
|
||||
const nodeId = 'blah';
|
||||
let DEFAULT_CONTEXT_PATH: string = '/alfresco';
|
||||
let DEFAULT_BASE_API_PATH: string = '/api/-default-/public/alfresco/versions/1';
|
||||
|
||||
beforeEach(() => {
|
||||
injector = ReflectiveInjector.resolveAndCreate([
|
||||
HTTP_PROVIDERS,
|
||||
AlfrescoContentService,
|
||||
AlfrescoAuthenticationService,
|
||||
AlfrescoSettingsService
|
||||
]);
|
||||
spyOn(localStorage, 'getItem').and.callFake(function (key) {
|
||||
return 'myTicket';
|
||||
});
|
||||
service = injector.get(AlfrescoContentService);
|
||||
authService = injector.get(AlfrescoAuthenticationService);
|
||||
});
|
||||
|
||||
it('should return a valid content URL', () => {
|
||||
expect(service.getContentUrl({
|
||||
entry: {
|
||||
id: nodeId
|
||||
}
|
||||
})).toBe(
|
||||
AlfrescoSettingsService.DEFAULT_ECM_ADDRESS + DEFAULT_CONTEXT_PATH +
|
||||
DEFAULT_BASE_API_PATH + '/nodes/' + nodeId + '/content' +
|
||||
'?attachment=false&alf_ticket=' + authService.getTicket()
|
||||
);
|
||||
});
|
||||
|
||||
it('should return a valid thumbnail URL', () => {
|
||||
expect(service.getDocumentThumbnailUrl({
|
||||
entry: {
|
||||
id: nodeId
|
||||
}
|
||||
})).toBe(
|
||||
AlfrescoSettingsService.DEFAULT_ECM_ADDRESS + DEFAULT_CONTEXT_PATH +
|
||||
DEFAULT_BASE_API_PATH + '/nodes/' + nodeId + '/renditions/doclib/content' +
|
||||
'?attachment=false&alf_ticket=' + authService.getTicket()
|
||||
);
|
||||
});
|
||||
});
|
@@ -17,7 +17,7 @@
|
||||
|
||||
import { Injectable, ChangeDetectorRef, Pipe } from '@angular/core';
|
||||
import { TranslatePipe } from 'ng2-translate/ng2-translate';
|
||||
import { AlfrescoTranslationService } from './AlfrescoTranslationService.service';
|
||||
import { AlfrescoTranslationService } from './AlfrescoTranslation.service';
|
||||
|
||||
@Injectable()
|
||||
@Pipe({
|
||||
|
@@ -30,8 +30,8 @@ export class AlfrescoSettingsService {
|
||||
|
||||
private _bpmContextPath = AlfrescoSettingsService.DEFAULT_BPM_CONTEXT_PATH;
|
||||
|
||||
private providers: string[] = 'ALL';
|
||||
|
||||
private providers: string = 'ECM'; // ECM, BPM , ALL
|
||||
|
||||
public get ecmHost(): string {
|
||||
return this._ecmHost;
|
||||
}
|
||||
@@ -52,4 +52,12 @@ export class AlfrescoSettingsService {
|
||||
return this._bpmHost + this._bpmContextPath;
|
||||
}
|
||||
|
||||
public getProviders(): string {
|
||||
return this.providers;
|
||||
}
|
||||
|
||||
public setProviders(providers: string) {
|
||||
this.providers = providers;
|
||||
}
|
||||
|
||||
}
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { describe, it, beforeEach } from '@angular/core/testing';
|
||||
import { AlfrescoSettingsService } from './AlfrescoSettingsService.service';
|
||||
import { AlfrescoSettingsService } from './AlfrescoSettings.service';
|
||||
|
||||
describe('AlfrescoSettingsService', () => {
|
||||
|
@@ -15,9 +15,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export * from './AlfrescoSettingsService.service';
|
||||
export * from './AlfrescoSettings.service';
|
||||
export * from './AlfrescoTranslationLoader.service';
|
||||
export * from './AlfrescoTranslationService.service';
|
||||
export * from './AlfrescoTranslation.service';
|
||||
export * from './AlfrescoPipeTranslate.service';
|
||||
export * from './AlfrescoAuthenticationService.service';
|
||||
export * from './AlfrescoContentService.service';
|
||||
export * from './AlfrescoAuthentication.service';
|
||||
export * from './AlfrescoContent.service';
|
||||
|
Reference in New Issue
Block a user