Moved DocumentList to the ng2-alfresco package

This commit is contained in:
Denys Vuika 2016-04-18 20:51:50 +01:00
parent 4735bee08d
commit f39653bf6f
14 changed files with 115 additions and 6 deletions

View File

@ -1,5 +1,5 @@
import {Component} from 'angular2/core'; import {Component} from 'angular2/core';
import {DocumentList} from "./document-list.component"; import {DocumentList} from 'ng2-alfresco/components';
@Component({ @Component({
selector: 'home-view', selector: 'home-view',

View File

@ -3,9 +3,11 @@ import {AppComponent} from './app.component';
import {ROUTER_PROVIDERS} from "angular2/router"; import {ROUTER_PROVIDERS} from "angular2/router";
import {HTTP_PROVIDERS} from 'angular2/http'; import {HTTP_PROVIDERS} from 'angular2/http';
import {Authentication} from "./services/authentication"; import {Authentication} from "./services/authentication";
import {ALFRESCO_PROVIDERS} from "ng2-alfresco/components";
bootstrap(AppComponent, [ bootstrap(AppComponent, [
ROUTER_PROVIDERS, ROUTER_PROVIDERS,
HTTP_PROVIDERS, HTTP_PROVIDERS,
Authentication Authentication,
ALFRESCO_PROVIDERS
]); ]);

View File

@ -1,6 +1,12 @@
import { HelloWorld } from './src/HelloWorld'; 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/HelloWorld';
export * from './src/document-list.component';
declare var _default: { declare var _default: {
directives: typeof HelloWorld[]; directives: (typeof HelloWorld | typeof DocumentList)[];
providers: typeof AlfrescoService[];
}; };
export default _default; export default _default;
export declare const ALFRESCO_DIRECTIVES: [any];
export declare const ALFRESCO_PROVIDERS: [any];

View File

@ -1,7 +1,15 @@
import { HelloWorld } from './src/HelloWorld'; 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/HelloWorld';
export * from './src/document-list.component';
export default { export default {
directives: [HelloWorld] directives: [HelloWorld, DocumentList],
providers: [AlfrescoService]
} }
export const ALFRESCO_DIRECTIVES: [any] = [HelloWorld, DocumentList];
export const ALFRESCO_PROVIDERS: [any] = [AlfrescoService];

View File

@ -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<FolderEntity>;
getDocumentThumbnailUrl(document: DocumentEntity): string;
getContentUrl(document: DocumentEntity): string;
private handleError(error);
}

View File

@ -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;
}

View File

@ -0,0 +1,4 @@
import { DocumentEntity } from "./document.entity";
export declare class FolderEntity {
items: DocumentEntity[];
}

View File

@ -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;
}

View File

@ -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<any>;
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;
}

View File

@ -63,8 +63,8 @@ import {DocumentEntity} from "./core/entities/document.entity";
</small> </small>
</a> </a>
</div> </div>
`, `/*,
providers: [AlfrescoService] providers: [AlfrescoService]*/
}) })
export class DocumentList implements OnInit { export class DocumentList implements OnInit {