From 44060243301de3cb3b712067331f5d2e694f24bd Mon Sep 17 00:00:00 2001 From: Eugenio Romano Date: Thu, 25 Aug 2016 11:47:49 +0100 Subject: [PATCH] fix demo index --- .../demo/src/main.ts | 35 ++++++++--------- .../ng2-alfresco-login/demo/src/main.ts | 6 +-- .../ng2-alfresco-search/demo/src/main.ts | 19 +++++----- .../ng2-alfresco-upload/demo/src/main.ts | 27 ++++++------- .../ng2-alfresco-viewer/demo/src/main.ts | 26 ++++++------- .../ng2-alfresco-webscript/demo/src/main.ts | 38 +++++++++---------- 6 files changed, 77 insertions(+), 74 deletions(-) diff --git a/ng2-components/ng2-alfresco-documentlist/demo/src/main.ts b/ng2-components/ng2-alfresco-documentlist/demo/src/main.ts index 1cdf4bdd0d..c93d7e8c63 100644 --- a/ng2-components/ng2-alfresco-documentlist/demo/src/main.ts +++ b/ng2-components/ng2-alfresco-documentlist/demo/src/main.ts @@ -37,12 +37,12 @@ import { @Component({ selector: 'alfresco-documentlist-demo', template: ` -
-
-
-

+
+
+
+

- Authentication failed to ip {{ host }} with user: admin, admin, you can still try to add a valid token to perform + Authentication failed to ip {{ host }} with user: admin, admin, you can still try to add a valid ticket to perform operations.

@@ -145,24 +145,25 @@ class DocumentListDemo implements OnInit { ecmHost: string = 'http://devproducts-platform.alfresco.me'; - token: string; + ticket: string; constructor( - private authService: AlfrescoAuthenticationService, - private settingsService: AlfrescoSettingsService, - translation: AlfrescoTranslationService, - private documentActions: DocumentActionsService) { + private authService: AlfrescoAuthenticationService, private settingsService: AlfrescoSettingsService, + translation: AlfrescoTranslationService, private documentActions: DocumentActionsService) { settingsService.ecmHost = this.ecmHost; - if (this.authService.getTicket()) { - this.token = this.authService.getTicket(); + settingsService.setProviders('ECM'); + + if (this.authService.getTicketEcm()) { + this.ticket = this.authService.getTicketEcm(); } + translation.addTranslationFolder(); documentActions.setHandler('my-handler', this.myDocumentActionHandler.bind(this)); } - public updateToken(): void { - localStorage.setItem('token', this.token); + public updateTicket(): void { + localStorage.setItem('ticket-ECM', this.ticket); } public updateHost(): void { @@ -190,9 +191,9 @@ class DocumentListDemo implements OnInit { login() { this.authService.login('admin', 'admin').subscribe( - token => { - console.log(token); - this.token = token; + ticket => { + console.log(ticket); + this.ticket = this.authService.getTicketEcm(); this.authenticated = true; }, error => { diff --git a/ng2-components/ng2-alfresco-login/demo/src/main.ts b/ng2-components/ng2-alfresco-login/demo/src/main.ts index 318d25a2f3..078fe1842d 100644 --- a/ng2-components/ng2-alfresco-login/demo/src/main.ts +++ b/ng2-components/ng2-alfresco-login/demo/src/main.ts @@ -29,8 +29,8 @@ import { @Component({ selector: 'my-app', template: ` -
-

+
+

- Authentication failed to ip {{ host }} with user: admin, admin, you can still try to add a valid token to perform + Authentication failed to ip {{ host }} with user: admin, admin, you can still try to add a valid ticket to perform operations.

@@ -60,13 +60,14 @@ class SearchDemo implements OnInit { public ecmHost: string = 'http://devproducts-platform.alfresco.me'; - token: string; + ticket: string; constructor(private authService: AlfrescoAuthenticationService, private settingsService: AlfrescoSettingsService, translation: AlfrescoTranslationService) { settingsService.ecmHost = this.ecmHost; + settingsService.setProviders('ECM'); translation.addTranslationFolder(); } @@ -82,9 +83,9 @@ class SearchDemo implements OnInit { login() { this.authService.login('admin', 'admin').subscribe( - token => { - console.log(token); - this.token = token; + ticket => { + console.log(ticket); + this.ticket = this.authService.getTicketEcm(); this.authenticated = true; }, error => { diff --git a/ng2-components/ng2-alfresco-upload/demo/src/main.ts b/ng2-components/ng2-alfresco-upload/demo/src/main.ts index 6f75c98ffe..aa95d8c9c7 100644 --- a/ng2-components/ng2-alfresco-upload/demo/src/main.ts +++ b/ng2-components/ng2-alfresco-upload/demo/src/main.ts @@ -28,12 +28,12 @@ import { ALFRESCO_ULPOAD_COMPONENTS, UploadService } from 'ng2-alfresco-upload'; @Component({ selector: 'my-app', - template: `
-
-
-

+ template: `
+
+
+

- Authentication failed to ip {{ host }} with user: admin, admin, you can still try to add a valid token to perform + Authentication failed to ip {{ host }} with user: admin, admin, you can still try to add a valid ticket to perform operations.

@@ -78,18 +78,19 @@ export class MyDemoApp implements OnInit { public ecmHost: string = 'http://devproducts-platform.alfresco.me'; - token: string; + ticket: string; constructor(private authService: AlfrescoAuthenticationService, private settingsService: AlfrescoSettingsService) { settingsService.ecmHost = this.ecmHost; + settingsService.setProviders('ECM'); - if (this.authService.getTicket()) { - this.token = this.authService.getTicket(); + if (this.authService.getTicketEcm()) { + this.ticket = this.authService.getTicketEcm(); } } - public updateToken(): void { - localStorage.setItem('token', this.token); + public updateTicket(): void { + localStorage.setItem('ticket-ECM', this.ticket); } public updateHost(): void { @@ -107,9 +108,9 @@ export class MyDemoApp implements OnInit { login() { this.authService.login('admin', 'admin').subscribe( - token => { - console.log(token); - this.token = token; + ticket => { + console.log(ticket); + this.ticket = this.authService.getTicketEcm(); this.authenticated = true; }, error => { diff --git a/ng2-components/ng2-alfresco-viewer/demo/src/main.ts b/ng2-components/ng2-alfresco-viewer/demo/src/main.ts index 6515dec983..6f62b9efa0 100644 --- a/ng2-components/ng2-alfresco-viewer/demo/src/main.ts +++ b/ng2-components/ng2-alfresco-viewer/demo/src/main.ts @@ -30,12 +30,12 @@ import { @Component({ selector: 'my-app', template: ` -
-
-
-

+
+
+
+

- Authentication failed to ip {{ ecmHost }} with user: admin, admin, you can still try to add a valid token to perform + Authentication failed to ip {{ ecmHost }} with user: admin, admin, you can still try to add a valid ticket to perform operations.

@@ -54,19 +54,19 @@ class MyDemoApp { ecmHost: string = 'http://127.0.0.1:8080'; - token: string; + ticket: string; constructor(private authService: AlfrescoAuthenticationService, private settingsService: AlfrescoSettingsService) { settingsService.ecmHost = this.ecmHost; - if (this.authService.getTicket()) { - this.token = this.authService.getTicket(); + if (this.authService.getTicketEcm()) { + this.ticket = this.authService.getTicketEcm(); } } - public updateToken(): void { - localStorage.setItem('token', this.token); + public updateTicket(): void { + localStorage.setItem('ticket-ECM', this.ticket); } public updateHost(): void { @@ -80,9 +80,9 @@ class MyDemoApp { login() { this.authService.login('admin', 'admin').subscribe( - token => { - console.log(token); - this.token = token; + ticket => { + console.log(ticket); + this.ticket = this.authService.getTicketEcm(); this.authenticated = true; }, error => { diff --git a/ng2-components/ng2-alfresco-webscript/demo/src/main.ts b/ng2-components/ng2-alfresco-webscript/demo/src/main.ts index 1d554e2da7..011020bee5 100644 --- a/ng2-components/ng2-alfresco-webscript/demo/src/main.ts +++ b/ng2-components/ng2-alfresco-webscript/demo/src/main.ts @@ -31,21 +31,21 @@ import { WEBSCRIPTCOMPONENT } from 'ng2-alfresco-webscript'; @Component({ selector: 'alfresco-webscript-demo', template: ` -
-
-
-

+
+
+
+

- Authentication failed to ip {{ ecmHost }} with user: admin, admin, you can still try to add a valid token to perform + Authentication failed to ip {{ ecmHost }} with user: admin, admin, you can still try to add a valid ticket to perform operations.

-
-
-
-
-
-
+
+
+
+
+
+
{ - console.log(token); - this.token = token; + ticket => { + console.log(ticket); + this.ticket = this.authService.getTicketEcm(); this.authenticated = true; }, error => {