From 60106239b7fce85d93c094b0df2a74727e850045 Mon Sep 17 00:00:00 2001 From: Eugenio Romano Date: Mon, 18 Jul 2016 17:27:12 +0100 Subject: [PATCH] integrate call in the demo shell and script demo shell --- demo-shell-ng2/app/app.component.html | 2 + demo-shell-ng2/app/app.component.ts | 4 +- .../webscript/webscript.component.ts | 62 +++++++++++++++++++ demo-shell-ng2/browser-sync-config.js | 5 +- demo-shell-ng2/package.json | 3 +- demo-shell-ng2/systemjs.config.js | 6 +- .../ng2-alfresco-webscript/demo/src/main.ts | 4 +- scripts/npm-clean.sh | 3 +- scripts/npm-link-demo-shell.sh | 13 +++- scripts/npm-publish.sh | 3 +- scripts/update-version.sh | 6 +- 11 files changed, 96 insertions(+), 15 deletions(-) create mode 100644 demo-shell-ng2/app/components/webscript/webscript.component.ts diff --git a/demo-shell-ng2/app/app.component.html b/demo-shell-ng2/app/app.component.html index 0447a85c1c..f473f1dac1 100644 --- a/demo-shell-ng2/app/app.component.html +++ b/demo-shell-ng2/app/app.component.html @@ -16,6 +16,7 @@ DataTable Uploader Tasks + Webscript Login @@ -44,6 +45,7 @@ Uploader Login Tasks + Webscript
diff --git a/demo-shell-ng2/app/app.component.ts b/demo-shell-ng2/app/app.component.ts index f39e2c25cf..3cdc27d4e5 100644 --- a/demo-shell-ng2/app/app.component.ts +++ b/demo-shell-ng2/app/app.component.ts @@ -32,6 +32,7 @@ import { SearchComponent } from './components/search/search.component'; import { SearchBarComponent } from './components/search/search-bar.component'; import { LoginDemoComponent } from './components/login/login-demo.component'; import { TasksDemoComponent } from './components/tasks/tasks-demo.component'; +import { WebscriptComponent } from './components/webscript/webscript.component'; declare var document: any; @@ -50,7 +51,8 @@ declare var document: any; {path: '/uploader', name: 'Uploader', component: UploadButtonComponent}, {path: '/login', name: 'Login', component: LoginDemoComponent}, {path: '/search', name: 'Search', component: SearchComponent}, - {path: '/tasks', name: 'Tasks', component: TasksDemoComponent} + {path: '/tasks', name: 'Tasks', component: TasksDemoComponent}, + {path: '/webscript', name: 'Webscript', component: WebscriptComponent} ]) export class AppComponent { translate: AlfrescoTranslationService; diff --git a/demo-shell-ng2/app/components/webscript/webscript.component.ts b/demo-shell-ng2/app/components/webscript/webscript.component.ts new file mode 100644 index 0000000000..839c42975f --- /dev/null +++ b/demo-shell-ng2/app/components/webscript/webscript.component.ts @@ -0,0 +1,62 @@ +/*! + * @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 { Component } from '@angular/core'; +import { + CONTEXT_MENU_DIRECTIVES +} from 'ng2-alfresco-core'; + +import { WEBSCRIPTCOMPONENT } from 'ng2-alfresco-webscript'; + +@Component({ + selector: 'alfresco-webscript-demo', + template: ` +
+
+
+
+
+
+ + `, + directives: [WEBSCRIPTCOMPONENT, CONTEXT_MENU_DIRECTIVES] +}) +export class WebscriptComponent { + + currentPath: string = '/'; + + authenticated: boolean; + + host: string = 'http://127.0.0.1:8080'; + + scriptPath: string = 'sample/folder/Company%20Home'; + + contextRoot: string = 'alfresco'; + + servicePath: string = 'service'; + + scriptArgs: string = ''; + + logData(data) { + console.log(data); + } +} diff --git a/demo-shell-ng2/browser-sync-config.js b/demo-shell-ng2/browser-sync-config.js index 2d1ab1d7db..af6440b202 100644 --- a/demo-shell-ng2/browser-sync-config.js +++ b/demo-shell-ng2/browser-sync-config.js @@ -18,7 +18,8 @@ browserSync.init({ 'node_modules/ng2-alfresco-login/dist/**/*.{html,htm,css,js}', 'node_modules/ng2-alfresco-search/dist/**/*.{html,htm,css,js}', 'node_modules/ng2-alfresco-upload/dist/**/*.{html,htm,css,js}', - 'node_modules/ng2-alfresco-viewer/dist/**/*.{html,htm,css,js}'], + 'node_modules/ng2-alfresco-viewer/dist/**/*.{html,htm,css,js}', + 'node_modules/ng2-alfresco-webscript/dist/**/*.{html,htm,css,js}'], - reloadDelay: 1000 +reloadDelay: 1000 }); diff --git a/demo-shell-ng2/package.json b/demo-shell-ng2/package.json index c73bab0da2..03942c0e8b 100644 --- a/demo-shell-ng2/package.json +++ b/demo-shell-ng2/package.json @@ -81,7 +81,8 @@ "ng2-alfresco-login": "0.2.0", "ng2-alfresco-search": "0.2.0", "ng2-alfresco-upload": "0.2.0", - "ng2-alfresco-viewer": "0.2.0" + "ng2-alfresco-viewer": "0.2.0", + "ng2-alfresco-webscript": "0.2.0" }, "devDependencies": { "browser-sync": "2.10.0", diff --git a/demo-shell-ng2/systemjs.config.js b/demo-shell-ng2/systemjs.config.js index 2e9336eec1..e08cab9f3e 100644 --- a/demo-shell-ng2/systemjs.config.js +++ b/demo-shell-ng2/systemjs.config.js @@ -17,7 +17,8 @@ 'ng2-alfresco-login': 'node_modules/ng2-alfresco-login/dist', 'ng2-alfresco-search': 'node_modules/ng2-alfresco-search/dist', 'ng2-alfresco-upload': 'node_modules/ng2-alfresco-upload/dist', - 'ng2-alfresco-viewer': 'node_modules/ng2-alfresco-viewer/dist' + 'ng2-alfresco-viewer': 'node_modules/ng2-alfresco-viewer/dist', + 'ng2-alfresco-webscript': 'node_modules/ng2-alfresco-webscript/dist' }; // packages tells the System loader how to load when no filename and/or no extension var packages = { @@ -33,7 +34,8 @@ 'ng2-alfresco-login': { main: 'index.js', defaultExtension: 'js'}, 'ng2-alfresco-search': { main: 'index.js', defaultExtension: 'js'}, 'ng2-alfresco-upload': { main: 'index.js', defaultExtension: 'js'}, - 'ng2-alfresco-viewer': { main: 'index.js', defaultExtension: 'js'} + 'ng2-alfresco-viewer': { main: 'index.js', defaultExtension: 'js'}, + 'ng2-alfresco-webscript': { main: 'index.js', defaultExtension: 'js'} }; var ngPackageNames = [ 'common', diff --git a/ng2-components/ng2-alfresco-webscript/demo/src/main.ts b/ng2-components/ng2-alfresco-webscript/demo/src/main.ts index fae84a5847..9a8fde946d 100644 --- a/ng2-components/ng2-alfresco-webscript/demo/src/main.ts +++ b/ng2-components/ng2-alfresco-webscript/demo/src/main.ts @@ -53,7 +53,7 @@ import { WEBSCRIPTCOMPONENT } from 'ng2-alfresco-webscript'; [servicePath]="servicePath" [contentType]="'HTML'" (onSuccess)= "logData($event)"> - {{prova}} + `, directives: [WEBSCRIPTCOMPONENT, CONTEXT_MENU_DIRECTIVES] }) @@ -75,8 +75,6 @@ class WebscriptDemo implements OnInit { token: string; - prova: string; - constructor(private authService: AlfrescoAuthenticationService, private alfrescoSettingsService: AlfrescoSettingsService) { diff --git a/scripts/npm-clean.sh b/scripts/npm-clean.sh index 7bfe5ff60e..59ca1b7635 100755 --- a/scripts/npm-clean.sh +++ b/scripts/npm-clean.sh @@ -9,7 +9,8 @@ for PACKAGE in \ ng2-alfresco-login \ ng2-alfresco-search \ ng2-alfresco-upload \ - ng2-alfresco-viewer + ng2-alfresco-viewer \ + ng2-alfresco-webscript do echo "====== clean component: ${PACKAGE} =====" cd "$DIR/../ng2-components/${PACKAGE}" diff --git a/scripts/npm-link-demo-shell.sh b/scripts/npm-link-demo-shell.sh index 300327b4ad..22da9d98be 100755 --- a/scripts/npm-link-demo-shell.sh +++ b/scripts/npm-link-demo-shell.sh @@ -20,12 +20,20 @@ npm link ng2-alfresco-core npm link ng2-alfresco-datatable npm link +#LINK WEBSCRIPT +echo "====== linking component: ng2-alfresco-webscript =====" +cd "$DIR/../ng2-components/ng2-alfresco-webscript" +npm link ng2-alfresco-core +npm link ng2-alfresco-datatable +npm link + #LINK ALL THE OTHERS COMPONENTS for PACKAGE in \ ng2-alfresco-login \ ng2-alfresco-search \ ng2-alfresco-upload \ - ng2-alfresco-viewer + ng2-alfresco-viewer \ + ng2-alfresco-webscript do DESTDIR="$DIR/../ng2-components/${PACKAGE}" echo "====== linking component: ${PACKAGE} =====" @@ -44,7 +52,8 @@ for PACKAGE in \ ng2-alfresco-login \ ng2-alfresco-search \ ng2-alfresco-upload \ - ng2-alfresco-viewer + ng2-alfresco-viewer \ + ng2-alfresco-webscript do DESTDIR="$DIR/../ng2-components/${PACKAGE}" echo "====== demo shell linking: ${PACKAGE} =====" diff --git a/scripts/npm-publish.sh b/scripts/npm-publish.sh index 42a263a6b2..9591b8ba48 100755 --- a/scripts/npm-publish.sh +++ b/scripts/npm-publish.sh @@ -11,7 +11,8 @@ for PACKAGE in \ ng2-alfresco-login \ ng2-alfresco-search \ ng2-alfresco-upload \ - ng2-alfresco-viewer + ng2-alfresco-viewer \ + ng2-alfresco-webscript do DESTDIR="$DIR/../ng2-components/${PACKAGE}" echo "====== PUBLISHING: ${DESTDIR} =====" diff --git a/scripts/update-version.sh b/scripts/update-version.sh index 168e5bf685..609350a64f 100755 --- a/scripts/update-version.sh +++ b/scripts/update-version.sh @@ -21,7 +21,8 @@ for PACKAGE in \ ng2-alfresco-login \ ng2-alfresco-search \ ng2-alfresco-upload \ - ng2-alfresco-viewer + ng2-alfresco-viewer \ + ng2-alfresco-webscript do DESTDIR="$DIR/../ng2-components/${PACKAGE}" echo "====== UPDATE VERSION of ${PACKAGE} to ${VERSION} version in all the package.json ======" @@ -35,7 +36,8 @@ for PACKAGE in \ ng2-alfresco-login \ ng2-alfresco-search \ ng2-alfresco-upload \ - ng2-alfresco-viewer + ng2-alfresco-viewer \ + ng2-alfresco-webscript do DESTDIR="$DIR/../ng2-components/${PACKAGE}" echo "====== UPDATE VERSION OF ${PACKAGE} to ${VERSION} version ======"