#46 Upload files in a folder

This commit is contained in:
mauriziovitale84
2016-05-12 12:55:35 +01:00
parent 4898a2e63e
commit 3c2167273f
17 changed files with 85 additions and 27 deletions

View File

@@ -1,5 +1,5 @@
<alfresco-upload-drag-area [showUploadDialog]="true">
<alfresco-document-list>
<alfresco-upload-drag-area [showUploadDialog]="true" uploaddirectory="{{relativePath}}" >
<alfresco-document-list (folderClick)="refreshDirectyory($event)">
<content-columns>
<content-column source="$thumbnail"></content-column>
<content-column

View File

@@ -39,6 +39,8 @@ export class FilesComponent {
breadcrumb: boolean = false;
navigation: boolean = true;
events: any[] = [];
absolutePath: string = '';
relativePath: string = '';
constructor(documentActions: DocumentActionsService) {
documentActions.setHandler('my-handler', this.myDocumentActionHandler.bind(this));
@@ -55,4 +57,17 @@ export class FilesComponent {
myFolderAction1(event) {
alert('Custom folder action for ' + event.value.displayName);
}
refreshDirectyory(event: Object) {
this.absolutePath = event.value;
this.relativePath = this.getRelativeDirectory(this.absolutePath);
}
getRelativeDirectory(currentFolderPath: string): string {
if(currentFolderPath.indexOf('swsdp/documentLibrary/') !=-1) {
return currentFolderPath.replace('swsdp/documentLibrary/', '')
} else {
return currentFolderPath.replace('swsdp/documentLibrary', '')
}
}
}