dist folder for uploader component

This commit is contained in:
Mario Romano
2016-05-19 16:23:13 +01:00
parent 283e214e94
commit c771c0a205
9 changed files with 34 additions and 18 deletions

View File

@@ -180,7 +180,7 @@ export class UploadButtonComponent {
* @returns {any}
*/
private getSiteId(): string {
return this.currentFolderPath.replace('/Sites/','').split('/')[0];
return this.currentFolderPath.replace('/Sites/', '').split('/')[0];
}
/**
@@ -188,6 +188,6 @@ export class UploadButtonComponent {
* @returns {any}
*/
private getContainerId(): string {
return this.currentFolderPath.replace('/Sites/','').split('/')[1];
return this.currentFolderPath.replace('/Sites/', '').split('/')[1];
}
}

View File

@@ -131,9 +131,9 @@ export class UploadDragAreaComponent {
});
},
error => {
error;
console.log(error);
}
);
);
}
}
@@ -144,8 +144,8 @@ export class UploadDragAreaComponent {
*/
private _traverseFileTree(item: any): void {
if (item.isFile) {
let self = this;
self.onFilesEntityDropped(item);
let self = this;
self.onFilesEntityDropped(item);
} else {
if (item.isDirectory) {
let self = this;
@@ -166,7 +166,7 @@ export class UploadDragAreaComponent {
* @returns {string}
*/
private getSiteId(): string {
return this.currentFolderPath.replace('/Sites/','').split('/')[0];
return this.currentFolderPath.replace('/Sites/', '').split('/')[0];
}
/**
@@ -174,6 +174,6 @@ export class UploadDragAreaComponent {
* @returns {string}
*/
private getContainerId(): string {
return this.currentFolderPath.replace('/Sites/','').split('/')[1];
return this.currentFolderPath.replace('/Sites/', '').split('/')[1];
}
}

View File

@@ -21,6 +21,8 @@ import { EventEmitter } from 'angular2/core';
import { Observable } from 'rxjs/Observable';
import { Response } from 'angular2/http';
declare let AlfrescoApi: any;
/**
*
* UploadService keep the queue of the file to upload and uploads them.
@@ -195,7 +197,7 @@ export class UploadService {
let xmlHttpRequest = this.createXMLHttpRequestInstance(uploadingFileModel, elementEmit);
xmlHttpRequest.open(this._method, this._host + this._url, true);
let authToken = btoa(basicAuth.username +':'+ basicAuth.password);
let authToken = btoa(basicAuth.username + ':' + basicAuth.password);
if (authToken) {
xmlHttpRequest.setRequestHeader('Authorization', `${basicAuth.type} ${authToken}`);
}
@@ -230,14 +232,14 @@ export class UploadService {
let apiInstance = new AlfrescoApi.NodesApi(this._alfrescoClient);
let nodeId = '-root-';
let nodeBody = {
'name':name,
'nodeType':'cm:folder',
'relativePath':relativePath
'name': name,
'nodeType': 'cm:folder',
'relativePath': relativePath
};
return Observable.fromPromise(apiInstance.addNode(nodeId, nodeBody))
.map(res => {
console.log(res);
} )
})
.do(data => console.log('Node data', data)) // eyeball results in the console
.catch(this.handleError);
}