diff --git a/demo-shell-ng2/app/components/home.view.ts b/demo-shell-ng2/app/components/home.view.ts index 289915ed48..04018f9e00 100644 --- a/demo-shell-ng2/app/components/home.view.ts +++ b/demo-shell-ng2/app/components/home.view.ts @@ -1,5 +1,5 @@ import {Component} from 'angular2/core'; -import {DocumentList} from "./document-list.component"; +import {DocumentList} from 'ng2-alfresco/components'; @Component({ selector: 'home-view', diff --git a/demo-shell-ng2/app/main.ts b/demo-shell-ng2/app/main.ts index 5c9bae7113..80ffa36797 100644 --- a/demo-shell-ng2/app/main.ts +++ b/demo-shell-ng2/app/main.ts @@ -3,9 +3,11 @@ import {AppComponent} from './app.component'; import {ROUTER_PROVIDERS} from "angular2/router"; import {HTTP_PROVIDERS} from 'angular2/http'; import {Authentication} from "./services/authentication"; +import {ALFRESCO_PROVIDERS} from "ng2-alfresco/components"; bootstrap(AppComponent, [ ROUTER_PROVIDERS, HTTP_PROVIDERS, - Authentication + Authentication, + ALFRESCO_PROVIDERS ]); diff --git a/demo-shell-ng2/ng2-alfresco/components.d.ts b/demo-shell-ng2/ng2-alfresco/components.d.ts index 842c42b89f..9b717241fb 100644 --- a/demo-shell-ng2/ng2-alfresco/components.d.ts +++ b/demo-shell-ng2/ng2-alfresco/components.d.ts @@ -1,6 +1,12 @@ import { HelloWorld } from './src/HelloWorld'; +import { DocumentList } from "./src/document-list.component"; +import { AlfrescoService } from "./src/alfresco.service"; export * from './src/HelloWorld'; +export * from './src/document-list.component'; declare var _default: { - directives: typeof HelloWorld[]; + directives: (typeof HelloWorld | typeof DocumentList)[]; + providers: typeof AlfrescoService[]; }; export default _default; +export declare const ALFRESCO_DIRECTIVES: [any]; +export declare const ALFRESCO_PROVIDERS: [any]; diff --git a/demo-shell-ng2/ng2-alfresco/components.ts b/demo-shell-ng2/ng2-alfresco/components.ts index 36a64a89e7..f1efbff6d4 100644 --- a/demo-shell-ng2/ng2-alfresco/components.ts +++ b/demo-shell-ng2/ng2-alfresco/components.ts @@ -1,7 +1,15 @@ import { HelloWorld } from './src/HelloWorld'; +import { DocumentList } from "./src/document-list.component"; +import { AlfrescoService } from "./src/alfresco.service"; + export * from './src/HelloWorld'; +export * from './src/document-list.component'; export default { - directives: [HelloWorld] + directives: [HelloWorld, DocumentList], + providers: [AlfrescoService] } +export const ALFRESCO_DIRECTIVES: [any] = [HelloWorld, DocumentList]; +export const ALFRESCO_PROVIDERS: [any] = [AlfrescoService]; + diff --git a/demo-shell-ng2/ng2-alfresco/src/alfresco.service.d.ts b/demo-shell-ng2/ng2-alfresco/src/alfresco.service.d.ts new file mode 100644 index 0000000000..d44122793b --- /dev/null +++ b/demo-shell-ng2/ng2-alfresco/src/alfresco.service.d.ts @@ -0,0 +1,14 @@ +import { Http } from 'angular2/http'; +import { Observable } from 'rxjs/Observable'; +import { FolderEntity } from "./core/entities/folder.entity"; +import { DocumentEntity } from "./core/entities/document.entity"; +export declare class AlfrescoService { + private http; + constructor(http: Http); + private _host; + private _baseUrl; + getFolder(folder: string): Observable; + getDocumentThumbnailUrl(document: DocumentEntity): string; + getContentUrl(document: DocumentEntity): string; + private handleError(error); +} diff --git a/demo-shell-ng2/app/components/alfresco.service.ts b/demo-shell-ng2/ng2-alfresco/src/alfresco.service.ts similarity index 100% rename from demo-shell-ng2/app/components/alfresco.service.ts rename to demo-shell-ng2/ng2-alfresco/src/alfresco.service.ts diff --git a/demo-shell-ng2/ng2-alfresco/src/core/entities/document.entity.d.ts b/demo-shell-ng2/ng2-alfresco/src/core/entities/document.entity.d.ts new file mode 100644 index 0000000000..c78176c687 --- /dev/null +++ b/demo-shell-ng2/ng2-alfresco/src/core/entities/document.entity.d.ts @@ -0,0 +1,31 @@ +import { LocationEntity } from "./location.entity"; +export declare class DocumentEntity { + nodeRef: string; + nodeType: string; + type: string; + mimetype: string; + isFolder: boolean; + isLink: boolean; + fileName: string; + displayName: string; + status: string; + title: string; + description: string; + author: string; + createdOn: string; + createdBy: string; + createdByUser: string; + modifiedOn: string; + modifiedBy: string; + modifiedByUser: string; + lockedBy: string; + lockedByUser: string; + size: number; + version: string; + contentUrl: string; + webdavUrl: string; + actionSet: string; + tags: string[]; + activeWorkflows: string; + location: LocationEntity; +} diff --git a/demo-shell-ng2/app/components/core/entities/document.entity.ts b/demo-shell-ng2/ng2-alfresco/src/core/entities/document.entity.ts similarity index 100% rename from demo-shell-ng2/app/components/core/entities/document.entity.ts rename to demo-shell-ng2/ng2-alfresco/src/core/entities/document.entity.ts diff --git a/demo-shell-ng2/ng2-alfresco/src/core/entities/folder.entity.d.ts b/demo-shell-ng2/ng2-alfresco/src/core/entities/folder.entity.d.ts new file mode 100644 index 0000000000..2ccbd8bceb --- /dev/null +++ b/demo-shell-ng2/ng2-alfresco/src/core/entities/folder.entity.d.ts @@ -0,0 +1,4 @@ +import { DocumentEntity } from "./document.entity"; +export declare class FolderEntity { + items: DocumentEntity[]; +} diff --git a/demo-shell-ng2/app/components/core/entities/folder.entity.ts b/demo-shell-ng2/ng2-alfresco/src/core/entities/folder.entity.ts similarity index 100% rename from demo-shell-ng2/app/components/core/entities/folder.entity.ts rename to demo-shell-ng2/ng2-alfresco/src/core/entities/folder.entity.ts diff --git a/demo-shell-ng2/ng2-alfresco/src/core/entities/location.entity.d.ts b/demo-shell-ng2/ng2-alfresco/src/core/entities/location.entity.d.ts new file mode 100644 index 0000000000..bbcb7d5229 --- /dev/null +++ b/demo-shell-ng2/ng2-alfresco/src/core/entities/location.entity.d.ts @@ -0,0 +1,12 @@ +export declare class LocationEntity { + repositoryId: string; + site: string; + siteTitle: string; + container: string; + path: string; + file: string; + parent: LocationParentEntity; +} +export declare class LocationParentEntity { + nodeRef: string; +} diff --git a/demo-shell-ng2/app/components/core/entities/location.entity.ts b/demo-shell-ng2/ng2-alfresco/src/core/entities/location.entity.ts similarity index 100% rename from demo-shell-ng2/app/components/core/entities/location.entity.ts rename to demo-shell-ng2/ng2-alfresco/src/core/entities/location.entity.ts diff --git a/demo-shell-ng2/ng2-alfresco/src/document-list.component.d.ts b/demo-shell-ng2/ng2-alfresco/src/document-list.component.d.ts new file mode 100644 index 0000000000..21704be29f --- /dev/null +++ b/demo-shell-ng2/ng2-alfresco/src/document-list.component.d.ts @@ -0,0 +1,32 @@ +import { OnInit, EventEmitter } from "angular2/core"; +import { AlfrescoService } from "./alfresco.service"; +import { FolderEntity } from "./core/entities/folder.entity"; +import { DocumentEntity } from "./core/entities/document.entity"; +export declare class DocumentList implements OnInit { + private _alfrescoService; + navigate: boolean; + breadcrumb: boolean; + folderIconClass: string; + thumbnails: boolean; + downloads: boolean; + itemClick: EventEmitter; + rootFolder: { + name: string; + path: string; + }; + currentFolderPath: string; + folder: FolderEntity; + errorMessage: any; + route: any[]; + canNavigateParent(): boolean; + constructor(_alfrescoService: AlfrescoService); + ngOnInit(): void; + private displayFolderContent(path); + onNavigateParentClick($event: any): void; + onDownloadClick(event: any): void; + onItemClick(item: DocumentEntity, $event: any): void; + goToRoute(r: any, $event: any): void; + private getItemPath(item); + getContentUrl(document: DocumentEntity): string; + getDocumentThumbnailUrl(document: DocumentEntity): string; +} diff --git a/demo-shell-ng2/app/components/document-list.component.ts b/demo-shell-ng2/ng2-alfresco/src/document-list.component.ts similarity index 99% rename from demo-shell-ng2/app/components/document-list.component.ts rename to demo-shell-ng2/ng2-alfresco/src/document-list.component.ts index 8ad9855e96..8a72e8bb95 100644 --- a/demo-shell-ng2/app/components/document-list.component.ts +++ b/demo-shell-ng2/ng2-alfresco/src/document-list.component.ts @@ -63,8 +63,8 @@ import {DocumentEntity} from "./core/entities/document.entity"; - `, - providers: [AlfrescoService] + `/*, + providers: [AlfrescoService]*/ }) export class DocumentList implements OnInit {