Added new version for component

This commit is contained in:
Vito Albano
2016-09-29 02:55:39 +01:00
parent 0d7f32a649
commit d946532f14
57 changed files with 2375 additions and 336 deletions

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
import { AlfrescoAuthenticationService, AlfrescoSettingsService } from 'ng2-alfresco-core';
import { AlfrescoAuthenticationService } from 'ng2-alfresco-core';
import { Injectable } from '@angular/core';
import { Response } from '@angular/http';
import { Observable } from 'rxjs/Rx';
@@ -29,12 +29,11 @@ import { BpmUserModel } from '../models/bpm-user.model';
@Injectable()
export class BpmUserService {
constructor(private authService: AlfrescoAuthenticationService,
private settingService: AlfrescoSettingsService) {
constructor(private authService: AlfrescoAuthenticationService) {
}
/**
* get User Information via ECM
* get Current User information for BPM
* @param userName - the user name
*/
getCurrentUserInfo(): Observable<BpmUserModel> {
@@ -47,19 +46,31 @@ export class BpmUserService {
}
}
/**
* get User Information via ECM
* @param userName - the user name
*/
getCurrentUserProfileImage(): string {
getCurrentUserProfileImage(): any {
if ( this.authService.getAlfrescoApi().bpmAuth.isLoggedIn() ) {
return this.settingService.getBPMApiBaseUrl() + '/api/enterprise/profile-picture';
return Observable.fromPromise(this.callApiGetProfilePicture())
.map(
(data) => data
)
.catch(this.handleError);
}
}
/**
* Call js api to get current user profile picture
*/
private callApiGetProfilePicture() {
return this.authService.getAlfrescoApi().activiti.profileApi.getProfile();
}
/**
* Call js api to get current user information
*/
private callApiGetProfile() {
return this.authService.getAlfrescoApi().activiti.profileApi.getProfile();
}
/**
* Throw the error
* @param error