mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
@@ -28,9 +28,11 @@ export class AlfrescoAuthenticationECM extends AlfrescoAuthenticationBase implem
|
||||
TYPE: string = 'ECM';
|
||||
|
||||
alfrescoApi: any;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param alfrescoSettingsService
|
||||
* @param http
|
||||
*/
|
||||
constructor(private alfrescoSettingsService: AlfrescoSettingsService,
|
||||
private http: Http) {
|
||||
|
@@ -36,6 +36,7 @@ export class AlfrescoAuthenticationService extends AlfrescoAuthenticationBase {
|
||||
/**
|
||||
* Constructor
|
||||
* @param alfrescoSettingsService
|
||||
* @param http
|
||||
*/
|
||||
constructor(private alfrescoSettingsService: AlfrescoSettingsService,
|
||||
private http: Http) {
|
||||
@@ -47,6 +48,7 @@ export class AlfrescoAuthenticationService extends AlfrescoAuthenticationBase {
|
||||
* Method to delegate to POST login
|
||||
* @param username
|
||||
* @param password
|
||||
* @param providers
|
||||
* @returns {Observable<R>|Observable<T>}
|
||||
*/
|
||||
login(username: string, password: string, providers: string []): Observable<string> {
|
||||
@@ -63,6 +65,7 @@ export class AlfrescoAuthenticationService extends AlfrescoAuthenticationBase {
|
||||
*
|
||||
* @param username
|
||||
* @param password
|
||||
* @param providers
|
||||
* @returns {Observable<R>|Observable<T>}
|
||||
*/
|
||||
private performeLogin(username: string, password: string, providers: string []): Observable<any> {
|
||||
@@ -104,7 +107,7 @@ export class AlfrescoAuthenticationService extends AlfrescoAuthenticationBase {
|
||||
|
||||
/**
|
||||
* Return the ticket stored in the localStorage of the specific provider type
|
||||
* @param ticket
|
||||
* @param type
|
||||
*/
|
||||
public getTicket(type: string = 'ECM'): string {
|
||||
let auth: AbstractAuthentication = this.findProviderInstance(type);
|
||||
@@ -122,18 +125,16 @@ export class AlfrescoAuthenticationService extends AlfrescoAuthenticationBase {
|
||||
if (this.providersInstance.length === 0) {
|
||||
return Observable.throw('No providers defined');
|
||||
} else {
|
||||
return this.performeLogout();
|
||||
return this.performLogout();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a logout on behalf of the user for the different provider instance
|
||||
*
|
||||
* @param username
|
||||
* @param password
|
||||
* @returns {Observable<R>|Observable<T>}
|
||||
*/
|
||||
private performeLogout(): Observable<any> {
|
||||
private performLogout(): Observable<any> {
|
||||
let observableBatch = [];
|
||||
this.providersInstance.forEach((authInstance) => {
|
||||
observableBatch.push(authInstance.logout());
|
||||
|
@@ -31,7 +31,7 @@ export class AlfrescoContentService {
|
||||
* @returns {string} URL address.
|
||||
*/
|
||||
getDocumentThumbnailUrl(document: any): string {
|
||||
return this.authService.alfrescoApi.content.getDocumentThumbnailUrl(document.entry.id);
|
||||
return this.authService.getAlfrescoApi().content.getDocumentThumbnailUrl(document.entry.id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -40,6 +40,6 @@ export class AlfrescoContentService {
|
||||
* @returns {string} URL address.
|
||||
*/
|
||||
getContentUrl(document: any): string {
|
||||
return this.authService.alfrescoApi.content.getContentUrl(document.entry.id);
|
||||
return this.authService.getAlfrescoApi().content.getContentUrl(document.entry.id);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user