Upgrade demo-shell

This commit is contained in:
Denys Vuika
2016-09-21 12:09:14 +01:00
parent 54debc47a6
commit 3fcc84cd02
19 changed files with 183 additions and 262 deletions

View File

@@ -16,24 +16,20 @@
*/ */
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { ROUTER_DIRECTIVES, Router } from '@angular/router'; import { Router } from '@angular/router';
import { import {
MDL,
AlfrescoSettingsService, AlfrescoSettingsService,
AlfrescoTranslationService, AlfrescoTranslationService,
AlfrescoAuthenticationService AlfrescoAuthenticationService
} from 'ng2-alfresco-core'; } from 'ng2-alfresco-core';
import { SearchBarComponent } from './components/index';
declare var document: any; declare var document: any;
@Component({ @Component({
selector: 'alfresco-app', selector: 'alfresco-app',
templateUrl: 'app/app.component.html', templateUrl: 'app/app.component.html',
styleUrls: ['app/app.component.css'], styleUrls: ['app/app.component.css']
directives: [SearchBarComponent, ROUTER_DIRECTIVES, MDL]
}) })
export class AppComponent { export class AppComponent {
translate: AlfrescoTranslationService; translate: AlfrescoTranslationService;

View File

@@ -0,0 +1,72 @@
/*!
* @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 { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import { routing } from './app.routes';
import { SearchBarComponent } from './components/index';
import { MDL, ALFRESCO_CORE_PROVIDERS, CONTEXT_MENU_DIRECTIVES, AlfrescoPipeTranslate } from 'ng2-alfresco-core';
import { ALFRESCO_LOGIN_DIRECTIVES } from 'ng2-alfresco-login';
import { ALFRESCO_DATATABLE_DIRECTIVES, PaginationComponent } from 'ng2-alfresco-datatable';
import { ALFRESCO_TASKLIST_DIRECTIVES } from 'ng2-activiti-tasklist';
import { ACTIVITI_PROCESSLIST_DIRECTIVES } from 'ng2-activiti-processlist';
import { ActivitiForm, ATIVITI_FORM_PROVIDERS } from 'ng2-activiti-form';
import { DOCUMENT_LIST_DIRECTIVES, DOCUMENT_LIST_PROVIDERS } from 'ng2-alfresco-documentlist';
import { ALFRESCO_ULPOAD_COMPONENTS, UploadService } from 'ng2-alfresco-upload';
import { VIEWERCOMPONENT } from 'ng2-alfresco-viewer';
import { ALFRESCO_SEARCH_DIRECTIVES, ALFRESCO_SEARCH_PROVIDERS } from 'ng2-alfresco-search';
import { TAGCOMPONENT, TAGSERVICES } from 'ng2-alfresco-tag';
import { WEBSCRIPTCOMPONENT } from 'ng2-alfresco-webscript';
@NgModule({
imports: [
BrowserModule,
routing
],
declarations: [
AppComponent,
SearchBarComponent,
MDL,
...ALFRESCO_LOGIN_DIRECTIVES,
...ALFRESCO_DATATABLE_DIRECTIVES, PaginationComponent,
...ALFRESCO_TASKLIST_DIRECTIVES,
...ACTIVITI_PROCESSLIST_DIRECTIVES,
ActivitiForm,
...DOCUMENT_LIST_DIRECTIVES,
...CONTEXT_MENU_DIRECTIVES,
...ALFRESCO_ULPOAD_COMPONENTS,
...VIEWERCOMPONENT,
...ALFRESCO_SEARCH_DIRECTIVES,
...TAGCOMPONENT,
...WEBSCRIPTCOMPONENT,
AlfrescoPipeTranslate
],
providers: [
...ALFRESCO_CORE_PROVIDERS,
...DOCUMENT_LIST_PROVIDERS,
...ATIVITI_FORM_PROVIDERS,
...ALFRESCO_SEARCH_PROVIDERS,
...TAGSERVICES,
UploadService
],
bootstrap: [ AppComponent ]
})
export class AppModule { }

View File

@@ -15,7 +15,8 @@
* limitations under the License. * limitations under the License.
*/ */
import { provideRouter, RouterConfig } from '@angular/router'; import { ModuleWithProviders } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { import {
FilesComponent, FilesComponent,
@@ -27,11 +28,11 @@ import {
WebscriptComponent, WebscriptComponent,
TagComponent, TagComponent,
AboutComponent, AboutComponent,
FormViewer FormViewer,
FormNodeViewer
} from './components/index'; } from './components/index';
import { FormNodeViewer } from './components/activiti/form-node-viewer.component';
export const routes: RouterConfig = [ export const appRoutes: Routes = [
{ path: 'home', component: FilesComponent }, { path: 'home', component: FilesComponent },
{ path: 'files', component: FilesComponent }, { path: 'files', component: FilesComponent },
{ path: 'datatable', component: DataTableDemoComponent }, { path: 'datatable', component: DataTableDemoComponent },
@@ -48,6 +49,4 @@ export const routes: RouterConfig = [
{ path: 'about', component: AboutComponent } { path: 'about', component: AboutComponent }
]; ];
export const appRouterProviders = [ export const routing: ModuleWithProviders = RouterModule.forRoot(appRoutes);
provideRouter(routes)
];

View File

@@ -17,21 +17,14 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { Http } from '@angular/http'; import { Http } from '@angular/http';
import { import { ObjectDataTableAdapter } from 'ng2-alfresco-datatable';
ALFRESCO_DATATABLE_DIRECTIVES,
ObjectDataTableAdapter /*,
DataSorting,
ObjectDataRow,
ObjectDataColumn*/
} from 'ng2-alfresco-datatable';
declare let __moduleName: string; declare let __moduleName: string;
@Component({ @Component({
moduleId: __moduleName, moduleId: __moduleName,
selector: 'about-page', selector: 'about-page',
templateUrl: './about.component.html', templateUrl: './about.component.html'
directives: [ALFRESCO_DATATABLE_DIRECTIVES]
}) })
export class AboutComponent implements OnInit { export class AboutComponent implements OnInit {

View File

@@ -16,14 +16,12 @@
*/ */
import { Component, AfterViewChecked, ViewChild, Input } from '@angular/core'; import { Component, AfterViewChecked, ViewChild, Input } from '@angular/core';
import { ALFRESCO_TASKLIST_DIRECTIVES, import {
AppDefinitionRepresentationModel, AppDefinitionRepresentationModel,
FilterRepresentationModel, FilterRepresentationModel,
UserTaskFilterRepresentationModel, UserTaskFilterRepresentationModel,
ActivitiApps ActivitiApps
} from 'ng2-activiti-tasklist'; } from 'ng2-activiti-tasklist';
import { ACTIVITI_PROCESSLIST_DIRECTIVES } from 'ng2-activiti-processlist';
import { ActivitiForm } from 'ng2-activiti-form';
import { ActivatedRoute } from '@angular/router'; import { ActivatedRoute } from '@angular/router';
import { Subscription } from 'rxjs/Rx'; import { Subscription } from 'rxjs/Rx';
import { import {
@@ -38,8 +36,7 @@ declare var componentHandler;
moduleId: __moduleName, moduleId: __moduleName,
selector: 'activiti-demo', selector: 'activiti-demo',
templateUrl: './activiti-demo.component.html', templateUrl: './activiti-demo.component.html',
styleUrls: ['./activiti-demo.component.css'], styleUrls: ['./activiti-demo.component.css']
directives: [ALFRESCO_TASKLIST_DIRECTIVES, ACTIVITI_PROCESSLIST_DIRECTIVES, ActivitiForm]
}) })
export class ActivitiDemoComponent implements AfterViewChecked { export class ActivitiDemoComponent implements AfterViewChecked {

View File

@@ -16,8 +16,7 @@
*/ */
import { Component, OnInit, OnDestroy, AfterViewChecked } from '@angular/core'; import { Component, OnInit, OnDestroy, AfterViewChecked } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router'; import { ActivatedRoute } from '@angular/router';
import { ActivitiForm, FormService, EcmModelService, NodeService } from 'ng2-activiti-form';
import { Subscription } from 'rxjs/Rx'; import { Subscription } from 'rxjs/Rx';
declare let __moduleName: string; declare let __moduleName: string;
@@ -27,9 +26,7 @@ declare var componentHandler;
moduleId: __moduleName, moduleId: __moduleName,
selector: 'form-node-viewer', selector: 'form-node-viewer',
templateUrl: './form-node-viewer.component.html', templateUrl: './form-node-viewer.component.html',
styleUrls: ['./form-node-viewer.component.css'], styleUrls: ['./form-node-viewer.component.css']
directives: [ActivitiForm],
providers: [FormService, EcmModelService, NodeService]
}) })
export class FormNodeViewer implements OnInit, OnDestroy, AfterViewChecked { export class FormNodeViewer implements OnInit, OnDestroy, AfterViewChecked {
@@ -37,9 +34,7 @@ export class FormNodeViewer implements OnInit, OnDestroy, AfterViewChecked {
private sub: Subscription; private sub: Subscription;
constructor(private formService: FormService, constructor(private route: ActivatedRoute) {
private route: ActivatedRoute,
private router: Router) {
} }
ngOnInit() { ngOnInit() {

View File

@@ -16,8 +16,7 @@
*/ */
import { Component, OnInit, OnDestroy, AfterViewChecked } from '@angular/core'; import { Component, OnInit, OnDestroy, AfterViewChecked } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router'; import { ActivatedRoute } from '@angular/router';
import { ActivitiForm, FormService, EcmModelService, NodeService } from 'ng2-activiti-form';
import { Subscription } from 'rxjs/Rx'; import { Subscription } from 'rxjs/Rx';
declare let __moduleName: string; declare let __moduleName: string;
@@ -27,9 +26,7 @@ declare var componentHandler;
moduleId: __moduleName, moduleId: __moduleName,
selector: 'form-viewer', selector: 'form-viewer',
templateUrl: './form-viewer.component.html', templateUrl: './form-viewer.component.html',
styleUrls: ['./form-viewer.component.css'], styleUrls: ['./form-viewer.component.css']
directives: [ActivitiForm],
providers: [FormService, EcmModelService, NodeService]
}) })
export class FormViewer implements OnInit, OnDestroy, AfterViewChecked { export class FormViewer implements OnInit, OnDestroy, AfterViewChecked {
@@ -37,9 +34,7 @@ export class FormViewer implements OnInit, OnDestroy, AfterViewChecked {
private sub: Subscription; private sub: Subscription;
constructor(private formService: FormService, constructor(private route: ActivatedRoute) {
private route: ActivatedRoute,
private router: Router) {
} }
ngOnInit() { ngOnInit() {

View File

@@ -17,7 +17,6 @@
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { import {
ALFRESCO_DATATABLE_DIRECTIVES,
ObjectDataTableAdapter, ObjectDataTableAdapter,
DataSorting, DataSorting,
ObjectDataRow, ObjectDataRow,
@@ -29,8 +28,7 @@ declare let __moduleName: string;
@Component({ @Component({
moduleId: __moduleName, moduleId: __moduleName,
selector: 'datatable-demo', selector: 'datatable-demo',
templateUrl: './datatable-demo.component.html', templateUrl: './datatable-demo.component.html'
directives: [ALFRESCO_DATATABLE_DIRECTIVES]
}) })
export class DataTableDemoComponent { export class DataTableDemoComponent {

View File

@@ -18,22 +18,12 @@
import { Component, OnInit, ViewChild } from '@angular/core'; import { Component, OnInit, ViewChild } from '@angular/core';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
import { import {
DOCUMENT_LIST_DIRECTIVES,
DOCUMENT_LIST_PROVIDERS,
DocumentActionsService, DocumentActionsService,
DocumentList, DocumentList,
ContentActionHandler, ContentActionHandler,
DocumentActionModel, DocumentActionModel,
FolderActionModel FolderActionModel
} from 'ng2-alfresco-documentlist'; } from 'ng2-alfresco-documentlist';
import {
MDL,
AlfrescoContentService,
CONTEXT_MENU_DIRECTIVES
} from 'ng2-alfresco-core';
import { PaginationComponent } from 'ng2-alfresco-datatable';
import { ALFRESCO_ULPOAD_COMPONENTS } from 'ng2-alfresco-upload';
import { VIEWERCOMPONENT } from 'ng2-alfresco-viewer';
import { FormService } from 'ng2-activiti-form'; import { FormService } from 'ng2-activiti-form';
declare let __moduleName: string; declare let __moduleName: string;
@@ -42,16 +32,7 @@ declare let __moduleName: string;
moduleId: __moduleName, moduleId: __moduleName,
selector: 'files-component', selector: 'files-component',
templateUrl: './files.component.html', templateUrl: './files.component.html',
styleUrls: ['./files.component.css'], styleUrls: ['./files.component.css']
directives: [
DOCUMENT_LIST_DIRECTIVES,
MDL,
ALFRESCO_ULPOAD_COMPONENTS,
VIEWERCOMPONENT,
CONTEXT_MENU_DIRECTIVES,
PaginationComponent
],
providers: [DOCUMENT_LIST_PROVIDERS, FormService]
}) })
export class FilesComponent implements OnInit { export class FilesComponent implements OnInit {
currentPath: string = '/Sites/swsdp/documentLibrary'; currentPath: string = '/Sites/swsdp/documentLibrary';
@@ -68,8 +49,7 @@ export class FilesComponent implements OnInit {
@ViewChild(DocumentList) @ViewChild(DocumentList)
documentList: DocumentList; documentList: DocumentList;
constructor(private contentService: AlfrescoContentService, constructor(private documentActions: DocumentActionsService,
private documentActions: DocumentActionsService,
private formService: FormService, private formService: FormService,
private router: Router) { private router: Router) {
documentActions.setHandler('my-handler', this.myDocumentActionHandler.bind(this)); documentActions.setHandler('my-handler', this.myDocumentActionHandler.bind(this));

View File

@@ -26,3 +26,4 @@ export { WebscriptComponent } from './webscript/webscript.component';
export { TagComponent } from './tag/tag.component'; export { TagComponent } from './tag/tag.component';
export { AboutComponent } from './about/about.component'; export { AboutComponent } from './about/about.component';
export { FilesComponent } from './files/files.component'; export { FilesComponent } from './files/files.component';
export { FormNodeViewer } from './activiti/form-node-viewer.component';

View File

@@ -15,10 +15,9 @@
* limitations under the License. * limitations under the License.
*/ */
import {Component, ViewChild, OnInit} from '@angular/core'; import { Component, ViewChild, OnInit } from '@angular/core';
import {AlfrescoLoginComponent} from 'ng2-alfresco-login'; import { Router } from '@angular/router';
import {ROUTER_DIRECTIVES, Router} from '@angular/router'; import { Validators } from '@angular/forms';
import {Validators} from '@angular/common';
declare let __moduleName: string; declare let __moduleName: string;
@@ -26,9 +25,7 @@ declare let __moduleName: string;
moduleId: __moduleName, moduleId: __moduleName,
selector: 'login-demo', selector: 'login-demo',
templateUrl: './login-demo.component.html', templateUrl: './login-demo.component.html',
styleUrls: ['./login-demo.component.css'], styleUrls: ['./login-demo.component.css']
directives: [ROUTER_DIRECTIVES, AlfrescoLoginComponent],
pipes: []
}) })
export class LoginDemoComponent implements OnInit { export class LoginDemoComponent implements OnInit {

View File

@@ -1,53 +0,0 @@
/*!
* @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 { ElementRef, DynamicComponentLoader, Directive, Attribute } from '@angular/core';
import { Router, RouterOutlet, ComponentInstruction } from '@angular/router-deprecated';
import { AlfrescoAuthenticationService } from 'ng2-alfresco-core/dist/ng2-alfresco-core';
@Directive({selector: 'auth-router-outlet'})
export class AuthRouterOutlet extends RouterOutlet {
publicRoutes: Array<string>;
private router: Router;
constructor(_elementRef: ElementRef, _loader: DynamicComponentLoader,
_parentRouter: Router, @Attribute('name') nameAttr: string,
private authentication: AlfrescoAuthenticationService) {
super(_elementRef, _loader, _parentRouter, nameAttr);
this.router = _parentRouter;
this.publicRoutes = [
'', 'login', 'signup'
];
}
activate(instruction: ComponentInstruction) {
if (this._canActivate(instruction.urlPath)) {
return super.activate(instruction);
}
this.router.navigate(['Login']);
}
_canActivate(url) {
return this.publicRoutes.indexOf(url) !== -1
|| this.authentication.isLoggedIn();
}
}
*/

View File

@@ -16,8 +16,6 @@
*/ */
import { Component, EventEmitter, Output } from '@angular/core'; import { Component, EventEmitter, Output } from '@angular/core';
import { ALFRESCO_SEARCH_DIRECTIVES } from 'ng2-alfresco-search';
import { VIEWERCOMPONENT } from 'ng2-alfresco-viewer';
import { AlfrescoAuthenticationService } from 'ng2-alfresco-core'; import { AlfrescoAuthenticationService } from 'ng2-alfresco-core';
declare let __moduleName: string; declare let __moduleName: string;
@@ -25,8 +23,7 @@ declare let __moduleName: string;
@Component({ @Component({
moduleId: __moduleName, moduleId: __moduleName,
selector: 'search-bar', selector: 'search-bar',
templateUrl: './search-bar.component.html', templateUrl: './search-bar.component.html'
directives: [ALFRESCO_SEARCH_DIRECTIVES, VIEWERCOMPONENT]
}) })
export class SearchBarComponent { export class SearchBarComponent {

View File

@@ -16,9 +16,6 @@
*/ */
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { AlfrescoContentService } from 'ng2-alfresco-core';
import { ALFRESCO_SEARCH_DIRECTIVES } from 'ng2-alfresco-search';
import { VIEWERCOMPONENT } from 'ng2-alfresco-viewer';
declare let __moduleName: string; declare let __moduleName: string;
@@ -47,17 +44,13 @@ declare let __moduleName: string;
width: 100%; width: 100%;
} }
} }
`], `]
directives: [ ALFRESCO_SEARCH_DIRECTIVES, VIEWERCOMPONENT ]
}) })
export class SearchComponent { export class SearchComponent {
fileShowed: boolean = false; fileShowed: boolean = false;
fileNodeId: string; fileNodeId: string;
constructor(public contentService: AlfrescoContentService) {
}
onFileClicked(event) { onFileClicked(event) {
if (event.value.entry.isFile) { if (event.value.entry.isFile) {
this.fileNodeId = event.value.entry.id; this.fileNodeId = event.value.entry.id;

View File

@@ -16,7 +16,6 @@
*/ */
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { TAGCOMPONENT, TAGSERVICES } from 'ng2-alfresco-tag';
@Component({ @Component({
selector: 'alfresco-tag-demo', selector: 'alfresco-tag-demo',
@@ -31,9 +30,7 @@ import { TAGCOMPONENT, TAGSERVICES } from 'ng2-alfresco-tag';
<alfresco-tag-node-list [nodeId]="nodeId"></alfresco-tag-node-list> <alfresco-tag-node-list [nodeId]="nodeId"></alfresco-tag-node-list>
</div> </div>
</div> </div>
`, `
directives: [TAGCOMPONENT],
providers: [TAGSERVICES]
}) })
export class TagComponent { export class TagComponent {

View File

@@ -16,11 +16,6 @@
*/ */
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import {
CONTEXT_MENU_DIRECTIVES
} from 'ng2-alfresco-core';
import { WEBSCRIPTCOMPONENT } from 'ng2-alfresco-webscript';
@Component({ @Component({
selector: 'alfresco-webscript-demo', selector: 'alfresco-webscript-demo',
@@ -37,8 +32,7 @@ import { WEBSCRIPTCOMPONENT } from 'ng2-alfresco-webscript';
[servicePath]="servicePath" [servicePath]="servicePath"
[contentType]="'HTML'" [contentType]="'HTML'"
(onSuccess)= "logData($event)"></alfresco-webscript-get> (onSuccess)= "logData($event)"></alfresco-webscript-get>
`, `
directives: [WEBSCRIPTCOMPONENT, CONTEXT_MENU_DIRECTIVES]
}) })
export class WebscriptComponent { export class WebscriptComponent {

View File

@@ -15,22 +15,8 @@
* limitations under the License. * limitations under the License.
*/ */
import { bootstrap } from '@angular/platform-browser-dynamic'; import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { PLATFORM_PIPES } from '@angular/core'; import { AppModule } from './app.module';
import { HTTP_PROVIDERS } from '@angular/http';
import { ALFRESCO_SEARCH_PROVIDERS } from 'ng2-alfresco-search';
import { ALFRESCO_CORE_PROVIDERS, AlfrescoPipeTranslate } from 'ng2-alfresco-core';
import { ATIVITI_FORM_PROVIDERS } from 'ng2-activiti-form';
import { UploadService } from 'ng2-alfresco-upload';
import { AppComponent } from './app.component';
import { appRouterProviders } from './app.routes';
bootstrap(AppComponent, [ const platform = platformBrowserDynamic();
appRouterProviders, platform.bootstrapModule(AppModule);
HTTP_PROVIDERS,
ALFRESCO_CORE_PROVIDERS,
{ provide: PLATFORM_PIPES, useValue: AlfrescoPipeTranslate, multi: true },
ALFRESCO_SEARCH_PROVIDERS,
UploadService,
ATIVITI_FORM_PROVIDERS
]).catch(err => console.error(err));

View File

@@ -51,29 +51,29 @@
"alfresco" "alfresco"
], ],
"dependencies": { "dependencies": {
"@angular/common": "2.0.0-rc.3", "@angular/common": "2.0.0",
"@angular/compiler": "2.0.0-rc.3", "@angular/compiler": "2.0.0",
"@angular/core": "2.0.0-rc.3", "@angular/core": "2.0.0",
"@angular/forms": "0.1.1", "@angular/forms": "2.0.0",
"@angular/http": "2.0.0-rc.3", "@angular/http": "2.0.0",
"@angular/platform-browser": "2.0.0-rc.3", "@angular/platform-browser": "2.0.0",
"@angular/platform-browser-dynamic": "2.0.0-rc.3", "@angular/platform-browser-dynamic": "2.0.0",
"@angular/router": "3.0.0-alpha.7", "@angular/router": "3.0.0",
"@angular/router-deprecated": "2.0.0-rc.2", "@angular/upgrade": "2.0.0",
"@angular/upgrade": "2.0.0-rc.3", "core-js": "^2.4.1",
"alfresco-js-api": "^0.3.0", "reflect-metadata": "^0.1.3",
"rxjs": "5.0.0-beta.12",
"systemjs": "0.19.27", "systemjs": "0.19.27",
"core-js": "2.4.0", "zone.js": "^0.6.23",
"reflect-metadata": "0.1.3",
"rxjs": "5.0.0-beta.6",
"zone.js": "0.6.12",
"rimraf": "2.5.2", "rimraf": "2.5.2",
"material-design-icons": "2.2.3", "material-design-icons": "2.2.3",
"material-design-lite": "1.2.1", "material-design-lite": "1.2.1",
"ng2-translate": "2.2.0", "ng2-translate": "2.5.0",
"pdfjs-dist": "1.5.404", "pdfjs-dist": "1.5.404",
"flag-icon-css": "2.3.0", "flag-icon-css": "2.3.0",
"intl": "1.2.4", "intl": "1.2.4",
"alfresco-js-api": "^0.3.0",
"ng2-alfresco-core": "0.3.2", "ng2-alfresco-core": "0.3.2",
"ng2-alfresco-datatable": "0.3.2", "ng2-alfresco-datatable": "0.3.2",
"ng2-alfresco-documentlist": "0.3.2", "ng2-alfresco-documentlist": "0.3.2",

View File

@@ -2,82 +2,66 @@
* System configuration for Angular 2 samples * System configuration for Angular 2 samples
* Adjust as necessary for your application needs. * Adjust as necessary for your application needs.
*/ */
(function(global) { (function (global) {
System.config({
paths: {
// paths serve as alias
'npm:': 'node_modules/'
},
// map tells the System loader where to look for things // map tells the System loader where to look for things
var map = { map: {
'app': 'app', // 'dist', // our app is within the app folder
'@angular': 'node_modules/@angular', app: 'app',
'angular2-in-memory-web-api': 'node_modules/angular2-in-memory-web-api', // angular bundles
'rxjs': 'node_modules/rxjs', '@angular/core': 'npm:@angular/core/bundles/core.umd.js',
'@angular/common': 'npm:@angular/common/bundles/common.umd.js',
'ng2-translate': 'node_modules/ng2-translate', '@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js',
'ng2-alfresco-core': 'node_modules/ng2-alfresco-core/dist', '@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js',
'ng2-alfresco-datatable': 'node_modules/ng2-alfresco-datatable/dist', '@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
'ng2-alfresco-documentlist': 'node_modules/ng2-alfresco-documentlist/dist', '@angular/http': 'npm:@angular/http/bundles/http.umd.js',
'ng2-alfresco-login': 'node_modules/ng2-alfresco-login/dist', '@angular/router': 'npm:@angular/router/bundles/router.umd.js',
'ng2-alfresco-search': 'node_modules/ng2-alfresco-search/dist', '@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js',
'ng2-alfresco-upload': 'node_modules/ng2-alfresco-upload/dist', // other libraries
'ng2-activiti-form': 'node_modules/ng2-activiti-form/dist', 'rxjs': 'npm:rxjs',
'ng2-alfresco-viewer': 'node_modules/ng2-alfresco-viewer/dist', 'ng2-translate': 'npm:ng2-translate',
'ng2-alfresco-webscript': 'node_modules/ng2-alfresco-webscript/dist', 'ng2-alfresco-core': 'npm:ng2-alfresco-core/dist',
'ng2-alfresco-tag': 'node_modules/ng2-alfresco-tag/dist', 'ng2-alfresco-datatable': 'npm:ng2-alfresco-datatable/dist',
'ng2-activiti-tasklist': 'node_modules/ng2-activiti-tasklist/dist', 'ng2-alfresco-documentlist': 'npm:ng2-alfresco-documentlist/dist',
'alfresco-js-api': 'node_modules/alfresco-js-api/dist', 'ng2-alfresco-login': 'npm:ng2-alfresco-login/dist',
'ng2-activiti-processlist': 'node_modules/ng2-activiti-processlist/dist' 'ng2-alfresco-search': 'npm:ng2-alfresco-search/dist',
}; 'ng2-alfresco-upload': 'npm:ng2-alfresco-upload/dist',
'ng2-activiti-form': 'npm:ng2-activiti-form/dist',
'ng2-alfresco-viewer': 'npm:ng2-alfresco-viewer/dist',
'ng2-alfresco-webscript': 'npm:ng2-alfresco-webscript/dist',
'ng2-alfresco-tag': 'npm:ng2-alfresco-tag/dist',
'ng2-activiti-tasklist': 'npm:ng2-activiti-tasklist/dist',
'alfresco-js-api': 'npm:alfresco-js-api/dist',
'ng2-activiti-processlist': 'npm:ng2-activiti-processlist/dist'
},
// packages tells the System loader how to load when no filename and/or no extension // packages tells the System loader how to load when no filename and/or no extension
var packages = { packages: {
'app': { main: 'main.js', defaultExtension: 'js' }, app: {
'rxjs': { defaultExtension: 'js' }, main: './main.js',
'angular2-in-memory-web-api': { main: 'index.js', defaultExtension: 'js' }, defaultExtension: 'js'
},
rxjs: {
defaultExtension: 'js'
},
'ng2-translate': { defaultExtension: 'js' }, 'ng2-translate': { defaultExtension: 'js' },
'ng2-alfresco-core': { main: 'index.js', defaultExtension: 'js'}, 'ng2-alfresco-core': { main: './index.js', defaultExtension: 'js'},
'ng2-alfresco-datatable': { main: 'index.js', defaultExtension: 'js'}, 'ng2-alfresco-datatable': { main: './index.js', defaultExtension: 'js'},
'ng2-alfresco-documentlist': { main: 'index.js', defaultExtension: 'js'}, 'ng2-alfresco-documentlist': { main: './index.js', defaultExtension: 'js'},
'ng2-alfresco-login': { main: 'index.js', defaultExtension: 'js'}, 'ng2-alfresco-login': { main: './index.js', defaultExtension: 'js'},
'ng2-alfresco-search': { main: 'index.js', defaultExtension: 'js'}, 'ng2-alfresco-search': { main: './index.js', defaultExtension: 'js'},
'ng2-alfresco-upload': { 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-activiti-form': { main: 'index.js', defaultExtension: 'js'}, 'ng2-activiti-form': { main: './index.js', defaultExtension: 'js'},
'ng2-activiti-processlist': { main: 'index.js', defaultExtension: 'js'}, 'ng2-activiti-processlist': { main: './index.js', defaultExtension: 'js'},
'ng2-activiti-tasklist': { main: 'index.js', defaultExtension: 'js'}, 'ng2-activiti-tasklist': { main: './index.js', defaultExtension: 'js'},
'ng2-alfresco-webscript': { main: 'index.js', defaultExtension: 'js'}, 'ng2-alfresco-webscript': { main: './index.js', defaultExtension: 'js'},
'ng2-alfresco-tag': { main: 'index.js', defaultExtension: 'js'}, 'ng2-alfresco-tag': { main: './index.js', defaultExtension: 'js'},
'alfresco-js-api': { main: 'alfresco-js-api.js', defaultExtension: 'js'} 'alfresco-js-api': { main: './alfresco-js-api.js', defaultExtension: 'js'}
};
var ngPackageNames = [
'common',
'compiler',
'core',
'http',
'platform-browser',
'platform-browser-dynamic',
'router',
'router-deprecated',
'upgrade'
];
// Individual files (~300 requests):
function packIndex(pkgName) {
packages['@angular/'+pkgName] = { main: 'index.js', defaultExtension: 'js' };
} }
// Bundled (~40 requests): });
function packUmd(pkgName) {
packages['@angular/'+pkgName] = { main: '/bundles/' + pkgName + '.umd.js', defaultExtension: 'js' };
}
// Most environments should use UMD; some (Karma) need the individual index files
var setPackageConfig = System.packageWithIndex ? packIndex : packUmd;
// Add package entries for angular packages
ngPackageNames.forEach(setPackageConfig);
// No umd for router yet
packages['@angular/router'] = { main: 'index.js', defaultExtension: 'js' };
var config = {
map: map,
packages: packages
};
System.config(config);
})(this); })(this);