#1370 Removed deprecated AlfrescoAuthenticationService

This commit is contained in:
mauriziovitale84 2017-01-04 14:30:01 +00:00
parent 58af422d62
commit 896c57fa53
25 changed files with 56 additions and 56 deletions

View File

@ -20,7 +20,7 @@ import { Router } from '@angular/router';
import {
AlfrescoTranslationService,
AlfrescoAuthenticationService,
AuthService,
SettingsService,
StorageService
} from 'ng2-alfresco-core';
@ -38,7 +38,7 @@ export class AppComponent {
ecmHost: string = 'http://' + window.location.hostname + ':8080';
bpmHost: string = 'http://' + window.location.hostname + ':9999';
constructor(public auth: AlfrescoAuthenticationService,
constructor(public authService: AuthService,
public router: Router,
public settingsService: SettingsService,
private translate: AlfrescoTranslationService,
@ -60,11 +60,11 @@ export class AppComponent {
isLoggedIn(): boolean {
this.redirectToLoginPageIfNotLoggedIn();
return this.auth.isLoggedIn();
return this.authService.isLoggedIn();
}
redirectToLoginPageIfNotLoggedIn(): void {
if (!this.isLoginPage() && !this.auth.isLoggedIn()) {
if (!this.isLoginPage() && !this.authService.isLoggedIn()) {
this.router.navigate(['/login']);
}
}
@ -75,7 +75,7 @@ export class AppComponent {
onLogout(event) {
event.preventDefault();
this.auth.logout()
this.authService.logout()
.subscribe(
() => {
this.navigateToLogin();

View File

@ -17,7 +17,7 @@
import { Component, OnInit, Optional, ViewChild } from '@angular/core';
import { ActivatedRoute, Params, Router } from '@angular/router';
import { AlfrescoAuthenticationService } from 'ng2-alfresco-core';
import { AuthService } from 'ng2-alfresco-core';
import {
DocumentActionsService,
DocumentList,
@ -49,7 +49,7 @@ export class FilesComponent implements OnInit {
documentList: DocumentList;
constructor(private documentActions: DocumentActionsService,
public auth: AlfrescoAuthenticationService,
public authService: AuthService,
private formService: FormService,
private router: Router,
@Optional() private route: ActivatedRoute) {
@ -106,7 +106,7 @@ export class FilesComponent implements OnInit {
}
});
}
if (this.auth.isBpmLoggedIn()) {
if (this.authService.isBpmLoggedIn()) {
this.formService.getProcessDefinitions().subscribe(
defs => this.setupBpmActions(defs || []),
err => console.log(err)

View File

@ -17,7 +17,7 @@
import { Component, EventEmitter, Output } from '@angular/core';
import { Router } from '@angular/router';
import { AlfrescoAuthenticationService } from 'ng2-alfresco-core';
import { AuthService } from 'ng2-alfresco-core';
import { MinimalNodeEntity } from 'alfresco-js-api';
@Component({
@ -34,11 +34,11 @@ export class SearchBarComponent {
expand = new EventEmitter();
constructor(public router: Router,
public auth: AlfrescoAuthenticationService) {
public authService: AuthService) {
}
isLoggedIn(): boolean {
return this.auth.isLoggedIn();
return this.authService.isLoggedIn();
}
/**

View File

@ -18,7 +18,7 @@
import { NgModule, Component, OnInit } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { CoreModule, SettingsService, AlfrescoAuthenticationService, StorageService } from 'ng2-alfresco-core';
import { CoreModule, SettingsService, AuthService, StorageService } from 'ng2-alfresco-core';
import { AnalyticsModule } from 'ng2-activiti-analytics';
@Component({
@ -60,7 +60,7 @@ export class AnalyticsDemoComponent implements OnInit {
ticket: string;
constructor(private authService: AlfrescoAuthenticationService,
constructor(private authService: AuthService,
private settingsService: SettingsService,
private storage: StorageService) {
settingsService.bpmHost = this.host;

View File

@ -19,7 +19,7 @@ import { NgModule, Component } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { CoreModule, SettingsService, AlfrescoAuthenticationService, StorageService } from 'ng2-alfresco-core';
import { CoreModule, SettingsService, AuthService, StorageService } from 'ng2-alfresco-core';
import { DiagramsModule } from 'ng2-activiti-diagrams';
@Component({
@ -50,7 +50,7 @@ export class DiagramDemoComponent {
ticket: string;
constructor(private authService: AlfrescoAuthenticationService,
constructor(private authService: AuthService,
private settingsService: SettingsService,
private storage: StorageService) {
settingsService.bpmHost = this.host;

View File

@ -18,7 +18,7 @@
import { NgModule, Component, OnInit } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { CoreModule, SettingsService, AlfrescoAuthenticationService, StorageService } from 'ng2-alfresco-core';
import { CoreModule, SettingsService, AuthService, StorageService } from 'ng2-alfresco-core';
import { ActivitiFormModule } from 'ng2-activiti-form';
@Component({
@ -49,7 +49,7 @@ export class FormDemoComponent implements OnInit {
ticket: string;
constructor(private authService: AlfrescoAuthenticationService,
constructor(private authService: AuthService,
private settingsService: SettingsService,
private storage: StorageService) {
settingsService.bpmHost = this.host;

View File

@ -28,7 +28,7 @@ import {
ActivitiStartProcessInstance,
ProcessInstance
} from 'ng2-activiti-processlist';
import { AlfrescoAuthenticationService, SettingsService, StorageService } from 'ng2-alfresco-core';
import { AuthService, SettingsService, StorageService } from 'ng2-alfresco-core';
import { ObjectDataTableAdapter } from 'ng2-alfresco-datatable';
const currentProcessIdNew = '__NEW__';
@ -160,7 +160,7 @@ class MyDemoApp implements OnInit {
dataProcesses: ObjectDataTableAdapter;
constructor(private authService: AlfrescoAuthenticationService,
constructor(private authService: AuthService,
private settingsService: SettingsService,
private storage: StorageService) {
settingsService.bpmHost = this.host;

View File

@ -21,7 +21,7 @@ import { By } from '@angular/platform-browser';
import {
AlfrescoTranslationService,
CoreModule,
AlfrescoAuthenticationService,
AuthService,
SettingsService,
AlfrescoApiService } from 'ng2-alfresco-core';
@ -49,7 +49,7 @@ describe('ActivitiProcessInstanceHeader', () => {
],
providers: [
SettingsService,
AlfrescoAuthenticationService,
AuthService,
AlfrescoApiService,
ActivitiProcessService,
{provide: AlfrescoTranslationService, useClass: TranslationMock}

View File

@ -26,7 +26,7 @@ import {
ActivitiTaskList
} from 'ng2-activiti-tasklist';
import { CoreModule } from 'ng2-alfresco-core';
import { AlfrescoAuthenticationService, SettingsService, StorageService } from 'ng2-alfresco-core';
import { AuthService, SettingsService, StorageService } from 'ng2-alfresco-core';
import { ObjectDataTableAdapter } from 'ng2-alfresco-datatable';
@Component({
@ -144,7 +144,7 @@ class MyDemoApp implements OnInit {
dataTasks: ObjectDataTableAdapter;
constructor(private authService: AlfrescoAuthenticationService,
constructor(private authService: AuthService,
private settingsService: SettingsService,
private storage: StorageService) {
settingsService.bpmHost = this.host;

View File

@ -21,7 +21,7 @@ import { PageNode } from './document-library.model.mock';
import { DocumentListService } from './../services/document-list.service';
import {
SettingsService,
AlfrescoAuthenticationService,
AuthService,
AlfrescoContentService,
AlfrescoApiService
} from 'ng2-alfresco-core';
@ -34,7 +34,7 @@ export class DocumentListServiceMock extends DocumentListService {
constructor(
settings?: SettingsService,
authService?: AlfrescoAuthenticationService,
authService?: AuthService,
contentService?: AlfrescoContentService,
apiService?: AlfrescoApiService
) {

View File

@ -19,7 +19,7 @@ import { NgModule, Component } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { CoreModule, SettingsService, AlfrescoAuthenticationService, StorageService } from 'ng2-alfresco-core';
import { CoreModule, SettingsService, AuthService, StorageService } from 'ng2-alfresco-core';
import { LoginModule } from 'ng2-alfresco-login';
@Component({
@ -73,7 +73,7 @@ export class AppComponent {
public disableCsrf: boolean = false;
constructor(public auth: AlfrescoAuthenticationService,
constructor(public authService: AuthService,
private settingsService: SettingsService,
private storage: StorageService) {

View File

@ -18,7 +18,7 @@
import { ComponentFixture, TestBed, async } from '@angular/core/testing';
import { DebugElement } from '@angular/core';
import {
AlfrescoAuthenticationService,
AuthService,
SettingsService,
AlfrescoApiService,
CoreModule
@ -44,9 +44,9 @@ describe('AlfrescoLogin', () => {
declarations: [AlfrescoLoginComponent],
providers: [
SettingsService,
AlfrescoAuthenticationService,
AuthService,
AlfrescoApiService,
{provide: AlfrescoAuthenticationService, useClass: AuthenticationMock},
{provide: AuthService, useClass: AuthenticationMock},
{provide: AlfrescoTranslationService, useClass: TranslationMock}
]
}).compileComponents();

View File

@ -19,7 +19,7 @@ import { Component, Input, Output, EventEmitter, OnInit } from '@angular/core';
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
import {
AlfrescoTranslationService,
AlfrescoAuthenticationService,
AuthService,
SettingsService
} from 'ng2-alfresco-core';
import { FormSubmitEvent } from '../models/form-submit-event.model';
@ -79,7 +79,7 @@ export class AlfrescoLoginComponent implements OnInit {
* @param translate
*/
constructor(private _fb: FormBuilder,
public authService: AlfrescoAuthenticationService,
public authService: AuthService,
public settingsService: SettingsService,
private translate: AlfrescoTranslationService) {

View File

@ -24,7 +24,7 @@ import { SearchModule } from 'ng2-alfresco-search';
import {
SettingsService,
AlfrescoAuthenticationService,
AuthService,
AlfrescoTranslationService
} from 'ng2-alfresco-core';
@ -57,7 +57,7 @@ class SearchDemo implements OnInit {
ticket: string;
constructor(private authService: AlfrescoAuthenticationService,
constructor(private authService: AuthService,
private settingsService: SettingsService,
translation: AlfrescoTranslationService) {

View File

@ -19,7 +19,7 @@ import { NgModule, Component, Input, OnInit } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { CoreModule, SettingsService, AlfrescoAuthenticationService, StorageService } from 'ng2-alfresco-core';
import { CoreModule, SettingsService, AuthService, StorageService } from 'ng2-alfresco-core';
import { TagModule } from 'ng2-alfresco-tag';
@Component({
@ -59,7 +59,7 @@ class TagDemo implements OnInit {
ticket: string;
constructor(private authService: AlfrescoAuthenticationService,
constructor(private authService: AuthService,
private settingsService: SettingsService,
private storage: StorageService) {

View File

@ -17,7 +17,7 @@
import { ReflectiveInjector } from '@angular/core';
import {
AlfrescoAuthenticationService,
AuthService,
SettingsService,
AlfrescoApiService,
StorageService
@ -34,7 +34,7 @@ describe('Tag service', () => {
injector = ReflectiveInjector.resolveAndCreate([
SettingsService,
AlfrescoApiService,
AlfrescoAuthenticationService,
AuthService,
TagService,
StorageService
]);

View File

@ -19,7 +19,7 @@ import { NgModule, Component, OnInit } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { CoreModule, SettingsService, AlfrescoAuthenticationService, StorageService } from 'ng2-alfresco-core';
import { CoreModule, SettingsService, AuthService, StorageService } from 'ng2-alfresco-core';
import { UploadModule } from 'ng2-alfresco-upload';
@Component({
@ -113,7 +113,7 @@ export class MyDemoApp implements OnInit {
ticket: string;
constructor(private authService: AlfrescoAuthenticationService,
constructor(private authService: AuthService,
private settingsService: SettingsService,
private storage: StorageService) {
settingsService.ecmHost = this.ecmHost;

View File

@ -21,7 +21,7 @@ import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { UserInfoComponentModule } from 'ng2-alfresco-userinfo';
import { CoreModule } from 'ng2-alfresco-core';
import { LoginModule } from 'ng2-alfresco-login';
import { AlfrescoAuthenticationService, SettingsService } from 'ng2-alfresco-core';
import { AuthService, SettingsService } from 'ng2-alfresco-core';
@Component({
selector: 'alfresco-app-demo',
@ -92,7 +92,7 @@ class UserInfoDemo implements OnInit {
public disableCsrf: boolean = false;
constructor(private authService: AlfrescoAuthenticationService,
constructor(private authService: AuthService,
private settingsService: SettingsService) {
settingsService.ecmHost = this.ecmHost;
settingsService.bpmHost = this.bpmHost;

View File

@ -18,7 +18,7 @@
import { NgModule, Component } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { CoreModule, SettingsService, AlfrescoAuthenticationService, StorageService } from 'ng2-alfresco-core';
import { CoreModule, SettingsService, AuthService, StorageService } from 'ng2-alfresco-core';
import { ViewerModule } from 'ng2-alfresco-viewer';
@Component({
@ -54,7 +54,7 @@ class MyDemoApp {
ticket: string;
constructor(private authService: AlfrescoAuthenticationService,
constructor(private authService: AuthService,
private settingsService: SettingsService,
private storage: StorageService) {
settingsService.ecmHost = this.ecmHost;

View File

@ -19,7 +19,7 @@ import { ComponentFixture, TestBed, async } from '@angular/core/testing';
import { ImgViewerComponent } from './imgViewer.component';
import { DebugElement } from '@angular/core';
import {
AlfrescoAuthenticationService,
AuthService,
SettingsService,
AlfrescoApiService,
CoreModule
@ -40,7 +40,7 @@ describe('Test ng2-alfresco-viewer Img viewer component ', () => {
declarations: [ImgViewerComponent],
providers: [
SettingsService,
AlfrescoAuthenticationService,
AuthService,
AlfrescoApiService
]
}).compileComponents();

View File

@ -19,7 +19,7 @@ import { ComponentFixture, TestBed, async } from '@angular/core/testing';
import { MediaPlayerComponent } from './mediaPlayer.component';
import { DebugElement } from '@angular/core';
import {
AlfrescoAuthenticationService,
AuthService,
SettingsService,
AlfrescoApiService,
CoreModule
@ -40,7 +40,7 @@ describe('Test ng2-alfresco-viewer Media player component ', () => {
declarations: [MediaPlayerComponent],
providers: [
SettingsService,
AlfrescoAuthenticationService,
AuthService,
AlfrescoApiService
]
}).compileComponents();

View File

@ -19,7 +19,7 @@ import { ComponentFixture, TestBed, async } from '@angular/core/testing';
import { NotSupportedFormat } from './notSupportedFormat.component';
import { DebugElement } from '@angular/core';
import {
AlfrescoAuthenticationService,
AuthService,
SettingsService,
AlfrescoApiService,
CoreModule
@ -40,7 +40,7 @@ describe('Test ng2-alfresco-viewer Not Supported Format View component', () => {
declarations: [NotSupportedFormat],
providers: [
SettingsService,
AlfrescoAuthenticationService,
AuthService,
AlfrescoApiService
]
}).compileComponents();

View File

@ -21,7 +21,7 @@ import { PdfViewerComponent } from './pdfViewer.component';
import { EventMock } from '../assets/event.mock';
import { DebugElement } from '@angular/core';
import {
AlfrescoAuthenticationService,
AuthService,
SettingsService,
AlfrescoApiService,
CoreModule
@ -42,7 +42,7 @@ describe('Test ng2-alfresco-viewer PdfViewer component', () => {
declarations: [PdfViewerComponent],
providers: [
SettingsService,
AlfrescoAuthenticationService,
AuthService,
AlfrescoApiService,
RenderingQueueServices
]

View File

@ -25,7 +25,7 @@ import { ViewerComponent } from './viewer.component';
import { EventMock } from '../assets/event.mock';
import { DebugElement } from '@angular/core';
import {
AlfrescoAuthenticationService,
AuthService,
SettingsService,
AlfrescoApiService,
CoreModule
@ -54,7 +54,7 @@ describe('Test ng2-alfresco-viewer ViewerComponent', () => {
],
providers: [
SettingsService,
AlfrescoAuthenticationService,
AuthService,
AlfrescoApiService,
RenderingQueueServices
]

View File

@ -19,7 +19,7 @@ import { NgModule, Component, OnInit } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { CoreModule, SettingsService, AlfrescoAuthenticationService, StorageService } from 'ng2-alfresco-core';
import { CoreModule, SettingsService, AuthService, StorageService } from 'ng2-alfresco-core';
import { DataTableModule } from 'ng2-alfresco-datatable';
import { WebScriptModule } from 'ng2-alfresco-webscript';
@ -62,7 +62,7 @@ class WebscriptDemo implements OnInit {
scriptArgs: string = '';
ticket: string;
constructor(private authService: AlfrescoAuthenticationService,
constructor(private authService: AuthService,
private settingsService: SettingsService,
private storage: StorageService) {