#68 first simple integration filelist and viewer

This commit is contained in:
Eugenio Romano
2016-05-31 17:57:27 +01:00
parent f4e8f6ed65
commit 367f2cc4ca
5 changed files with 212 additions and 146 deletions

View File

@@ -24,6 +24,7 @@ import {
import { MDL } from 'ng2-alfresco-core/dist/ng2-alfresco-core';
import { ALFRESCO_ULPOAD_COMPONENTS } from 'ng2-alfresco-upload/dist/ng2-alfresco-upload';
import { AlfrescoPipeTranslate } from 'ng2-alfresco-core/dist/ng2-alfresco-core';
import { VIEWERCOMPONENT } from 'ng2-alfresco-viewer/dist/ng2-alfresco-viewer';
declare let __moduleName: string;
@@ -31,7 +32,7 @@ declare let __moduleName: string;
moduleId: __moduleName,
selector: 'files-component',
templateUrl: './files.component.html',
directives: [DOCUMENT_LIST_DIRECTIVES, MDL, ALFRESCO_ULPOAD_COMPONENTS],
directives: [DOCUMENT_LIST_DIRECTIVES, MDL, ALFRESCO_ULPOAD_COMPONENTS, VIEWERCOMPONENT],
providers: [DOCUMENT_LIST_PROVIDERS],
pipes: [AlfrescoPipeTranslate]
})
@@ -41,6 +42,9 @@ export class FilesComponent {
absolutePath: string = '/Sites/swsdp/documentLibrary';
relativePath: string = '';
urlFile: string;
fileShowed: boolean = false;
acceptedFilesType: string = '.jpg,.pdf,.js';
constructor(documentActions: DocumentActionsService) {
@@ -63,6 +67,20 @@ export class FilesComponent {
this.absolutePath += '/';
}
showFile(event) {
if (event.value.entry.isFile) {
let workSpace = 'workspace/SpacesStore/' + event.value.entry.id;
let nameFile = event.value.entry.name;
let host = 'http://192.168.99.100:8080/';
this.urlFile = host + 'alfresco/s/slingshot/node/content/' + workSpace + '/' + nameFile;
this.fileShowed = true;
} else {
this.fileShowed = false;
}
}
onFolderChanged(event?: any) {
if (event) {
this.absolutePath = event.absolutePath;