@gsp-svc/formdoc-upload 0.2.10 → 0.2.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@farris/ui-dialog'), require('@angular/common'), require('rxjs/observable/of'), require('rxjs/operators'), require('angular2-uuid'), require('@angular/platform-browser'), require('@farris/ui-messager'), require('@farris/ui-loading'), require('@farris/ui-progress'), require('@angular/forms'), require('@farris/ui-combo-list'), require('@farris/ui-forms'), require('@ecp-caf/caf-common'), require('@angular/core'), require('@farris/ui-modal'), require('rxjs'), require('@angular/common/http'), require('@farris/ui-notify')) :
3
- typeof define === 'function' && define.amd ? define('@gsp-svc/formdoc-upload', ['exports', '@farris/ui-dialog', '@angular/common', 'rxjs/observable/of', 'rxjs/operators', 'angular2-uuid', '@angular/platform-browser', '@farris/ui-messager', '@farris/ui-loading', '@farris/ui-progress', '@angular/forms', '@farris/ui-combo-list', '@farris/ui-forms', '@ecp-caf/caf-common', '@angular/core', '@farris/ui-modal', 'rxjs', '@angular/common/http', '@farris/ui-notify'], factory) :
4
- (factory((global['gsp-svc'] = global['gsp-svc'] || {}, global['gsp-svc']['formdoc-upload'] = {}),global.uiDialog,global.ng.common,global.rxjs['observable/of'],global.rxjs.operators,global.angular2Uuid,global.ng.platformBrowser,global.uiMessager,global.uiLoading,global.uiProgress,global.ng.forms,global.uiComboList,global.uiForms,global.cafCommon,global.ng.core,global.uiModal,global.rxjs,global.ng.common.http,global.uiNotify));
5
- }(this, (function (exports,uiDialog,common,of,operators,angular2Uuid,platformBrowser,uiMessager,uiLoading,uiProgress,forms,uiComboList,uiForms,cafCommon,i0,uiModal,rxjs,http,uiNotify) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@farris/ui-dialog'), require('@angular/common'), require('rxjs/observable/of'), require('rxjs/operators'), require('angular2-uuid'), require('@angular/platform-browser'), require('@farris/ui-messager'), require('@farris/ui-loading'), require('@farris/ui-progress'), require('@angular/forms'), require('@farris/ui-combo-list'), require('@farris/ui-forms'), require('@farris/rtf'), require('@ecp-caf/caf-common'), require('@angular/core'), require('@farris/ui-modal'), require('rxjs'), require('@angular/common/http'), require('@farris/ui-notify')) :
3
+ typeof define === 'function' && define.amd ? define('@gsp-svc/formdoc-upload', ['exports', '@farris/ui-dialog', '@angular/common', 'rxjs/observable/of', 'rxjs/operators', 'angular2-uuid', '@angular/platform-browser', '@farris/ui-messager', '@farris/ui-loading', '@farris/ui-progress', '@angular/forms', '@farris/ui-combo-list', '@farris/ui-forms', '@farris/rtf', '@ecp-caf/caf-common', '@angular/core', '@farris/ui-modal', 'rxjs', '@angular/common/http', '@farris/ui-notify'], factory) :
4
+ (factory((global['gsp-svc'] = global['gsp-svc'] || {}, global['gsp-svc']['formdoc-upload'] = {}),global.uiDialog,global.ng.common,global.rxjs['observable/of'],global.rxjs.operators,global.angular2Uuid,global.ng.platformBrowser,global.uiMessager,global.uiLoading,global.uiProgress,global.ng.forms,global.uiComboList,global.uiForms,global.rtf,global.cafCommon,global.ng.core,global.uiModal,global.rxjs,global.ng.common.http,global.uiNotify));
5
+ }(this, (function (exports,uiDialog,common,of,operators,angular2Uuid,platformBrowser,uiMessager,uiLoading,uiProgress,forms,uiComboList,uiForms,rtf,cafCommon,i0,uiModal,rxjs,http,uiNotify) { 'use strict';
6
6
 
7
7
  /**
8
8
  * @fileoverview added by tsickle
@@ -305,7 +305,9 @@
305
305
  /** @type {?} */
306
306
  var url = "/api/runtime/dfs/v1.0/formdoc/slice";
307
307
  //url = "/api/runtime/dfs/v1.0/formdoc/list";
308
- return this.httpclient.post(url, formdata).pipe(operators.tap(( /**
308
+ /** @type {?} */
309
+ var baseUrl = rtf.BasePathService.convertPath(url);
310
+ return this.httpclient.post(baseUrl, formdata).pipe(operators.tap(( /**
309
311
  * @param {?} res
310
312
  * @return {?}
311
313
  */function (res) { })), operators.catchError(( /**
@@ -400,11 +402,13 @@
400
402
  /** @type {?} */
401
403
  var url = "/api/runtime/dfs/v1.0/formdoc/copy";
402
404
  /** @type {?} */
405
+ var baseUrl = rtf.BasePathService.convertPath(url);
406
+ /** @type {?} */
403
407
  var request = new CopyFileRequest;
404
408
  request.metadataId = metadataId;
405
409
  request.rootId = rootId;
406
410
  request.path = path;
407
- return this.httpclient.post(url, request, { responseType: 'text' }).pipe(operators.tap(( /**
411
+ return this.httpclient.post(baseUrl, request, { responseType: 'text' }).pipe(operators.tap(( /**
408
412
  * @param {?} res
409
413
  * @return {?}
410
414
  */function (res) { })));
@@ -543,7 +547,7 @@
543
547
  'uploading': '正在上传文件……',
544
548
  'selectedCount': '已选择文件数量:',
545
549
  'limitCount': '超出系统限制数量:',
546
- 'rechooseFile': ',重新选择上传文件。',
550
+ 'rechooseFile': ',请重新选择上传文件。',
547
551
  'save': '保存',
548
552
  'cancel': '取消',
549
553
  'haveSameName': '已上传过同名文件: ',
@@ -565,7 +569,13 @@
565
569
  'size': '大小',
566
570
  'close': '关闭',
567
571
  'loading': '拼命加载中',
568
- 'mismatchChunkSize': '文档分片上传部分丢失,请重新上传,如果多次上传失败,请联系管理员。'
572
+ 'mismatchChunkSize': '文档分片上传部分丢失,请重新上传,如果多次上传失败,请联系管理员。',
573
+ 'invalidCharacters': '文件名包含特殊字符',
574
+ 'invalidExtNames': '文档类型不允许上传',
575
+ 'whiteExtNames': '。允许上传的文件类型为:',
576
+ 'blackExtNames': '。不允许上传的文件类型为:',
577
+ 'UnrecognizedFileType': '无法确定文件类型',
578
+ 'fileNameOverSize': '文件名超出长度限制,最长允许'
569
579
  },
570
580
  'en-US': {
571
581
  'uploadFile': 'Upload File',
@@ -594,7 +604,13 @@
594
604
  'size': 'Size',
595
605
  'close': 'Close',
596
606
  'loading': 'Loading',
597
- 'mismatchChunkSize': 'The partial upload of document shards is missing. Please upload again. If multiple uploads fail, please contact the administrator.'
607
+ 'mismatchChunkSize': 'The partial upload of document shards is missing. Please upload again. If multiple uploads fail, please contact the administrator.',
608
+ 'invalidCharacters': 'The file name contains special characters',
609
+ 'invalidExtNames': 'Document type does not allow uploading',
610
+ 'whiteExtNames': '.The file types allowed for uploading are:',
611
+ 'blackExtNames': '.The file types that are not allowed to be uploaded are:',
612
+ 'UnrecognizedFileType': 'Unrecognized file type',
613
+ 'fileNameOverSize': 'fileName oversize,the lengthest is'
598
614
  },
599
615
  'en': {
600
616
  'uploadFile': 'Upload File',
@@ -623,7 +639,13 @@
623
639
  'size': 'Size',
624
640
  'close': 'Close',
625
641
  'loading': 'Loading',
626
- 'mismatchChunkSize': 'The partial upload of document shards is missing. Please upload again. If multiple uploads fail, please contact the administrator.'
642
+ 'mismatchChunkSize': 'The partial upload of document shards is missing. Please upload again. If multiple uploads fail, please contact the administrator.',
643
+ 'invalidCharacters': 'The file name contains special characters',
644
+ 'invalidExtNames': 'Document type does not allow uploading',
645
+ 'whiteExtNames': '.The file types allowed for uploading are:',
646
+ 'blackExtNames': '.The file types that are not allowed to be uploaded are:',
647
+ 'UnrecognizedFileType': 'Unrecognized file type',
648
+ 'fileNameOverSize': 'fileName oversize,the lengthest is'
627
649
  },
628
650
  'zh-CHT': {
629
651
  'uploadFile': '上傳文件',
@@ -652,7 +674,13 @@
652
674
  'size': '大小',
653
675
  'close': '關閉',
654
676
  'loading': '拼命加載中',
655
- 'mismatchChunkSize': '文檔分片上傳部分遺失,請重新上傳,如果多次上傳失敗,請聯系管理員。'
677
+ 'mismatchChunkSize': '文檔分片上傳部分遺失,請重新上傳,如果多次上傳失敗,請聯系管理員。',
678
+ 'invalidCharacters': '文件名包含特殊字符',
679
+ 'invalidExtNames': '文檔類型不允許上傳',
680
+ 'whiteExtNames': '。允許上傳的文件類型為:',
681
+ 'blackExtNames': '。不允許上傳的文件類型為:',
682
+ 'UnrecognizedFileType': '無法確定文件類型',
683
+ 'fileNameOverSize': '文件名超出长度限制,最长允许'
656
684
  },
657
685
  };
658
686
 
@@ -746,12 +774,19 @@
746
774
  this.errTypeList = [];
747
775
  this.nullFileList = [];
748
776
  this.beyondFileList = [];
777
+ this.fileNameOversizeList = [];
778
+ this.invalidCharactersFileList = [];
779
+ this.invalidExtNamesFileList = [];
780
+ this.unrecognizedTypeFileList = [];
781
+ this.invalidCharacters = '';
782
+ this.invalidExtNames = '';
749
783
  this.showType = 0;
750
784
  this.mouseOn = false;
785
+ this.isWhiteList = false;
751
786
  this.bufferSize = 5 * 1024 * 1024;
752
787
  this.selectedFileCount = 0;
753
- this.uploadIconAddress = '/platform/runtime/dfs/images/upload.svg';
754
- this.uploadLittleIconAddress = '/platform/runtime/dfs/images/uploadIcon.svg';
788
+ this.uploadIconAddress = this.createBaseUrl('/platform/runtime/dfs/images/upload.svg');
789
+ this.uploadLittleIconAddress = this.createBaseUrl('/platform/runtime/dfs/images/uploadIcon.svg');
755
790
  this.hasSelectedFile = false;
756
791
  this.fileAllSelected = false;
757
792
  this.uploadProcess = { width: '0%' };
@@ -778,6 +813,7 @@
778
813
  this.fileCount = 0;
779
814
  this.oldIdList = [];
780
815
  this.securityInfo = null;
816
+ this.fileNameLength = 0;
781
817
  this.totalLoad = null;
782
818
  this.exStorageFileList = [];
783
819
  if (this.injector) {
@@ -842,6 +878,9 @@
842
878
  if (res != null && res.error == null) {
843
879
  _this.sameNameAllowed = res.sameNameAllowed;
844
880
  _this.maxFileSize = parseInt(JSON.parse(res.validateConfiguration).maxFileSize);
881
+ _this.isWhiteList = JSON.parse(res.validateConfiguration).whiteList;
882
+ _this.invalidCharacters = JSON.parse(res.validateConfiguration).invalidCharacters;
883
+ _this.invalidExtNames = JSON.parse(res.validateConfiguration).invalidExtNames.toLowerCase();
845
884
  _this.allowedMultiUpload = res.allowedMultiUpload;
846
885
  if (!_this.sameNameAllowed) {
847
886
  _this.uploadService.getUploadedFileInfoList(_this.formId, _this.rootId).subscribe(( /**
@@ -872,6 +911,37 @@
872
911
  // message: this.localepipe.transform('uploading')
873
912
  // });
874
913
  };
914
+ /**
915
+ * @param {?} name
916
+ * @return {?}
917
+ */
918
+ FileUploadComponent.prototype.findInvalidCharacter = /**
919
+ * @param {?} name
920
+ * @return {?}
921
+ */
922
+ function (name) {
923
+ /** @type {?} */
924
+ var charList = [];
925
+ this.invalidCharacters.split('|').forEach(( /**
926
+ * @param {?} element
927
+ * @return {?}
928
+ */function (element) {
929
+ if (name.indexOf(element) >= 0)
930
+ charList.push(element);
931
+ }));
932
+ return charList;
933
+ };
934
+ /**
935
+ * @param {?} file
936
+ * @return {?}
937
+ */
938
+ FileUploadComponent.prototype.hasFileType = /**
939
+ * @param {?} file
940
+ * @return {?}
941
+ */
942
+ function (file) {
943
+ return file.name.includes('.');
944
+ };
875
945
  /**
876
946
  * @param {?} $event
877
947
  * @return {?}
@@ -895,6 +965,7 @@
895
965
  var _loop_1 = function (i) {
896
966
  /** @type {?} */
897
967
  var selectedFile = this_1.selectedFiles.files[i];
968
+ selectedFile.isAllowedUpload = true;
898
969
  //selectedFile.slice
899
970
  /** @type {?} */
900
971
  var uuid = angular2Uuid.UUID.UUID();
@@ -902,12 +973,85 @@
902
973
  this_1.nullFileList.push(selectedFile.name);
903
974
  return "continue";
904
975
  }
976
+ if (this_1.fileNameLength > 0 && selectedFile.name.length > this_1.fileNameLength) {
977
+ this_1.fileNameOversizeList.push(selectedFile.name);
978
+ return "continue";
979
+ }
905
980
  if (this_1.maxFileSize != null && this_1.maxFileSize > 0) {
906
981
  if (selectedFile.size > this_1.maxFileSize * 1000) {
907
982
  this_1.beyondFileList.push(selectedFile.name);
908
983
  return "continue";
909
984
  }
910
985
  }
986
+ /** @type {?} */
987
+ var invalidCharList = this_1.findInvalidCharacter(selectedFile.name);
988
+ /** @type {?} */
989
+ var errorMessage = "";
990
+ if (invalidCharList.length > 0) {
991
+ invalidCharList.forEach(( /**
992
+ * @param {?} element
993
+ * @param {?} index
994
+ * @return {?}
995
+ */function (element, index) {
996
+ errorMessage += "\"";
997
+ errorMessage += element;
998
+ errorMessage += "\"";
999
+ errorMessage += (index === invalidCharList.length - 1) ? "" : ",";
1000
+ }));
1001
+ if (this_1.selectedFiles.files.length === 1) {
1002
+ selectedFile.isAllowedUpload = false;
1003
+ this_1.msgService.warning(this_1.localepipe.transform('invalidCharacters') + errorMessage + this_1.localepipe.transform('rechooseFile'));
1004
+ return { value: void 0 };
1005
+ }
1006
+ if (this_1.selectedFiles.files.length > 1) {
1007
+ selectedFile.isAllowedUpload = false;
1008
+ this_1.invalidCharactersFileList.push(selectedFile.name);
1009
+ return "continue";
1010
+ }
1011
+ }
1012
+ if (!this_1.hasFileType(selectedFile)) {
1013
+ if (this_1.selectedFiles.files.length === 1) {
1014
+ selectedFile.isAllowedUpload = false;
1015
+ this_1.msgService.warning(selectedFile.name + this_1.localepipe.transform('UnrecognizedFileType') + this_1.localepipe.transform('rechooseFile'));
1016
+ return { value: void 0 };
1017
+ }
1018
+ if (this_1.selectedFiles.files.length > 1) {
1019
+ selectedFile.isAllowedUpload = false;
1020
+ this_1.unrecognizedTypeFileList.push(selectedFile.name);
1021
+ return "continue";
1022
+ }
1023
+ }
1024
+ // let curFileSuffix = selectedFile.name.split('.')[1];
1025
+ /** @type {?} */
1026
+ var curFileSuffix = selectedFile.name.substr(selectedFile.name.lastIndexOf('.') + 1).toLowerCase();
1027
+ /** @type {?} */
1028
+ var extNames = this_1.listToString(this_1.invalidExtNames.split('|'));
1029
+ /** @type {?} */
1030
+ var extNamesAry = this_1.invalidExtNames.split('|');
1031
+ if (!this_1.isWhiteList && extNamesAry.includes(curFileSuffix)) {
1032
+ if (this_1.selectedFiles.files.length === 1) {
1033
+ selectedFile.isAllowedUpload = false;
1034
+ this_1.msgService.warning(selectedFile.name + this_1.localepipe.transform('invalidExtNames') + this_1.localepipe.transform('blackExtNames') + extNames + this_1.localepipe.transform('rechooseFile'));
1035
+ return { value: void 0 };
1036
+ }
1037
+ if (this_1.selectedFiles.files.length > 1) {
1038
+ selectedFile.isAllowedUpload = false;
1039
+ this_1.invalidExtNamesFileList.push(selectedFile.name);
1040
+ return "continue";
1041
+ }
1042
+ }
1043
+ if (this_1.isWhiteList && !extNamesAry.includes(curFileSuffix)) {
1044
+ if (this_1.selectedFiles.files.length === 1) {
1045
+ selectedFile.isAllowedUpload = false;
1046
+ this_1.msgService.warning(selectedFile.name + this_1.localepipe.transform('invalidExtNames') + this_1.localepipe.transform('whiteExtNames') + extNames + this_1.localepipe.transform('rechooseFile'));
1047
+ return { value: void 0 };
1048
+ }
1049
+ if (this_1.selectedFiles.files.length > 1) {
1050
+ selectedFile.isAllowedUpload = false;
1051
+ this_1.invalidExtNamesFileList.push(selectedFile.name);
1052
+ return "continue";
1053
+ }
1054
+ }
911
1055
  if (!this_1.sameNameAllowed) {
912
1056
  if (this_1.uploadedFileInfoList.find(( /**
913
1057
  * @param {?} x
@@ -986,12 +1130,16 @@
986
1130
  return "continue";
987
1131
  }
988
1132
  }
989
- this_1.uploadFile(uuid, selectedFile, selectedFile.name);
1133
+ if (selectedFile.isAllowedUpload === true) {
1134
+ this_1.uploadFile(uuid, selectedFile, selectedFile.name);
1135
+ }
990
1136
  };
991
1137
  var this_1 = this;
992
1138
  //this.flag = 0;
993
1139
  for (var i = 0; i < this.selectedFiles.files.length; i++) {
994
- _loop_1(i);
1140
+ var state_1 = _loop_1(i);
1141
+ if (typeof state_1 === "object")
1142
+ return state_1.value;
995
1143
  }
996
1144
  if (this.errFileList.length > 0) {
997
1145
  /** @type {?} */
@@ -1002,17 +1150,39 @@
1002
1150
  if (this.nullFileList.length > 0) {
1003
1151
  /** @type {?} */
1004
1152
  var name_2 = this.listToString(this.nullFileList);
1005
- name_2 = name_2.substring(0, name_2.length - 1);
1006
1153
  this.msgService.warning(name_2 + this.localepipe.transform('sizeZero') + this.localepipe.transform('rechooseFile'));
1007
1154
  this.nullFileList = [];
1008
1155
  }
1156
+ if (this.fileNameOversizeList.length > 0) {
1157
+ /** @type {?} */
1158
+ var name_3 = this.listToString(this.fileNameOversizeList);
1159
+ this.msgService.warning(name_3 + this.localepipe.transform('fileNameOverSize') + this.fileNameLength + this.localepipe.transform('rechooseFile'));
1160
+ this.fileNameOversizeList = [];
1161
+ }
1009
1162
  if (this.beyondFileList.length > 0) {
1010
1163
  /** @type {?} */
1011
- var name_3 = this.listToString(this.beyondFileList);
1012
- name_3 = name_3.substring(0, name_3.length - 1);
1013
- this.msgService.warning(name_3 + this.localepipe.transform('sizeMax') + this.maxFileSize + "KB" + this.localepipe.transform('rechooseFile'));
1164
+ var name_4 = this.listToString(this.beyondFileList);
1165
+ this.msgService.warning(name_4 + this.localepipe.transform('sizeMax') + this.maxFileSize + "KB" + this.localepipe.transform('rechooseFile'));
1014
1166
  this.beyondFileList = [];
1015
1167
  }
1168
+ if (this.invalidCharactersFileList.length > 0) {
1169
+ /** @type {?} */
1170
+ var name_5 = this.listToString(this.invalidCharactersFileList);
1171
+ this.msgService.warning(name_5 + this.localepipe.transform('invalidCharacters') + this.localepipe.transform('rechooseFile'));
1172
+ this.invalidCharactersFileList = [];
1173
+ }
1174
+ if (this.invalidExtNamesFileList.length > 0) {
1175
+ /** @type {?} */
1176
+ var name_6 = this.listToString(this.invalidExtNamesFileList);
1177
+ this.msgService.warning(name_6 + this.localepipe.transform('invalidExtNames') + this.localepipe.transform('rechooseFile'));
1178
+ this.invalidExtNamesFileList = [];
1179
+ }
1180
+ if (this.unrecognizedTypeFileList.length > 0) {
1181
+ /** @type {?} */
1182
+ var name_7 = this.listToString(this.unrecognizedTypeFileList);
1183
+ this.msgService.warning(name_7 + this.localepipe.transform('UnrecognizedFileType') + this.localepipe.transform('rechooseFile'));
1184
+ this.unrecognizedTypeFileList = [];
1185
+ }
1016
1186
  this.files = this.files.slice();
1017
1187
  this.fileAllSelected = false;
1018
1188
  $event.target.value = '';
@@ -1293,7 +1463,9 @@
1293
1463
  function (formdata) {
1294
1464
  /** @type {?} */
1295
1465
  var url = "/api/runtime/dfs/v1.0/formdoc/single";
1296
- return this.httpclient.post(url, formdata).pipe(operators.tap(( /**
1466
+ /** @type {?} */
1467
+ var baseUrl = rtf.BasePathService.convertPath(url);
1468
+ return this.httpclient.post(baseUrl, formdata).pipe(operators.tap(( /**
1297
1469
  * @param {?} res
1298
1470
  * @return {?}
1299
1471
  */function (res) { })), operators.catchError(( /**
@@ -1314,7 +1486,9 @@
1314
1486
  function (formdata) {
1315
1487
  /** @type {?} */
1316
1488
  var url = "/api/runtime/dfs/v1.0/formdoc/slice";
1317
- return this.httpclient.post(url, formdata).pipe(operators.tap(( /**
1489
+ /** @type {?} */
1490
+ var baseUrl = rtf.BasePathService.convertPath(url);
1491
+ return this.httpclient.post(baseUrl, formdata).pipe(operators.tap(( /**
1318
1492
  * @param {?} res
1319
1493
  * @return {?}
1320
1494
  */function (res) { })), operators.catchError(( /**
@@ -1335,7 +1509,9 @@
1335
1509
  function (request) {
1336
1510
  /** @type {?} */
1337
1511
  var url = "/api/runtime/dfs/v1.0/formdoc/multi/init";
1338
- return this.httpclient.post(url, request).pipe(operators.tap(( /**
1512
+ /** @type {?} */
1513
+ var baseUrl = rtf.BasePathService.convertPath(url);
1514
+ return this.httpclient.post(baseUrl, request).pipe(operators.tap(( /**
1339
1515
  * @param {?} res
1340
1516
  * @return {?}
1341
1517
  */function (res) { })), operators.catchError(( /**
@@ -1356,7 +1532,9 @@
1356
1532
  function (formdata) {
1357
1533
  /** @type {?} */
1358
1534
  var url = "/api/runtime/dfs/v1.0/formdoc/multi/upload";
1359
- return this.httpclient.post(url, formdata).pipe(operators.tap(( /**
1535
+ /** @type {?} */
1536
+ var baseUrl = rtf.BasePathService.convertPath(url);
1537
+ return this.httpclient.post(baseUrl, formdata).pipe(operators.tap(( /**
1360
1538
  * @param {?} res
1361
1539
  * @return {?}
1362
1540
  */function (res) { })), operators.catchError(( /**
@@ -1377,7 +1555,9 @@
1377
1555
  function (request) {
1378
1556
  /** @type {?} */
1379
1557
  var url = "/api/runtime/dfs/v1.0/formdoc/multi/complete";
1380
- return this.httpclient.post(url, request).pipe(operators.tap(( /**
1558
+ /** @type {?} */
1559
+ var baseUrl = rtf.BasePathService.convertPath(url);
1560
+ return this.httpclient.post(baseUrl, request).pipe(operators.tap(( /**
1381
1561
  * @param {?} res
1382
1562
  * @return {?}
1383
1563
  */function (res) { })), operators.catchError(( /**
@@ -1563,32 +1743,32 @@
1563
1743
  var _this = this;
1564
1744
  switch (docType) {
1565
1745
  case DocType.Word: {
1566
- fileInfo.source = "/platform/runtime/dfs/images/word.png";
1746
+ fileInfo.source = this.createBaseUrl("/platform/runtime/dfs/images/word.png");
1567
1747
  this.files.push(fileInfo);
1568
1748
  break;
1569
1749
  }
1570
1750
  case DocType.Pdf: {
1571
- fileInfo.source = "/platform/runtime/dfs/images/pdf.png";
1751
+ fileInfo.source = this.createBaseUrl("/platform/runtime/dfs/images/pdf.png");
1572
1752
  this.files.push(fileInfo);
1573
1753
  break;
1574
1754
  }
1575
1755
  case DocType.Excel: {
1576
- fileInfo.source = "/platform/runtime/dfs/images/excel.png";
1756
+ fileInfo.source = this.createBaseUrl("/platform/runtime/dfs/images/excel.png");
1577
1757
  this.files.push(fileInfo);
1578
1758
  break;
1579
1759
  }
1580
1760
  case DocType.Txt: {
1581
- fileInfo.source = "/platform/runtime/dfs/images/txt.png";
1761
+ fileInfo.source = this.createBaseUrl("/platform/runtime/dfs/images/txt.png");
1582
1762
  this.files.push(fileInfo);
1583
1763
  break;
1584
1764
  }
1585
1765
  case DocType.Powerpoint: {
1586
- fileInfo.source = "/platform/runtime/dfs/images/ppt.png";
1766
+ fileInfo.source = this.createBaseUrl("/platform/runtime/dfs/images/ppt.png");
1587
1767
  this.files.push(fileInfo);
1588
1768
  break;
1589
1769
  }
1590
1770
  case DocType.Other: {
1591
- fileInfo.source = "/platform/runtime/dfs/images/file.png";
1771
+ fileInfo.source = this.createBaseUrl("/platform/runtime/dfs/images/file.png");
1592
1772
  this.files.push(fileInfo);
1593
1773
  break;
1594
1774
  }
@@ -1640,9 +1820,14 @@
1640
1820
  */
1641
1821
  function (strList) {
1642
1822
  /** @type {?} */
1823
+ var result = strList.filter(( /**
1824
+ * @param {?} item
1825
+ * @return {?}
1826
+ */function (item) { return item.trim() !== ''; }));
1827
+ /** @type {?} */
1643
1828
  var name = "";
1644
- for (var i = 0; i < strList.length; i++) {
1645
- name += strList[i] + ",";
1829
+ for (var i = 0; i < result.length; i++) {
1830
+ name += result[i] + (i === result.length - 1 ? "" : ",");
1646
1831
  }
1647
1832
  return name;
1648
1833
  };
@@ -1861,6 +2046,19 @@
1861
2046
  function (file) {
1862
2047
  file.mouseOn = false;
1863
2048
  };
2049
+ /**
2050
+ * @param {?} oldUrl
2051
+ * @return {?}
2052
+ */
2053
+ FileUploadComponent.prototype.createBaseUrl = /**
2054
+ * @param {?} oldUrl
2055
+ * @return {?}
2056
+ */
2057
+ function (oldUrl) {
2058
+ /** @type {?} */
2059
+ var baseUrl = rtf.BasePathService.convertPath(oldUrl);
2060
+ return baseUrl;
2061
+ };
1864
2062
  FileUploadComponent.decorators = [
1865
2063
  { type: i0.Component, args: [{
1866
2064
  selector: 'app-file-upload',
@@ -1884,6 +2082,7 @@
1884
2082
  fileCount: [{ type: i0.Input }],
1885
2083
  oldIdList: [{ type: i0.Input }],
1886
2084
  securityInfo: [{ type: i0.Input }],
2085
+ fileNameLength: [{ type: i0.Input }],
1887
2086
  opCell: [{ type: i0.ViewChild, args: ['opCell',] }]
1888
2087
  };
1889
2088
  return FileUploadComponent;
@@ -1907,7 +2106,11 @@
1907
2106
  * @return {?}
1908
2107
  */
1909
2108
  function (metadataId, rootId) {
1910
- return "/api/runtime/dfs/v1.0/doc/filecontent?metadataid=" + metadataId + "&rootid=" + rootId + "&token=" + this.getToken(this.mergeString(metadataId, rootId));
2109
+ /** @type {?} */
2110
+ var url = "/api/runtime/dfs/v1.0/doc/filecontent?metadataid=" + metadataId + "&rootid=" + rootId + "&token=" + this.getToken(this.mergeString(metadataId, rootId));
2111
+ /** @type {?} */
2112
+ var baseUrl = rtf.BasePathService.convertPath(url);
2113
+ return baseUrl;
1911
2114
  };
1912
2115
  /**
1913
2116
  * @param {?} metadataId
@@ -1920,7 +2123,11 @@
1920
2123
  * @return {?}
1921
2124
  */
1922
2125
  function (metadataId, rootId) {
1923
- return "/api/runtime/dfs/v1.0/formdoc/stream?metadataid=" + metadataId + "&rootid=" + rootId + "&token=" + this.getToken(this.mergeString(metadataId, rootId));
2126
+ /** @type {?} */
2127
+ var url = "/api/runtime/dfs/v1.0/formdoc/stream?metadataid=" + metadataId + "&rootid=" + rootId + "&token=" + this.getToken(this.mergeString(metadataId, rootId));
2128
+ /** @type {?} */
2129
+ var baseUrl = rtf.BasePathService.convertPath(url);
2130
+ return baseUrl;
1924
2131
  };
1925
2132
  /**
1926
2133
  * @param {?} metadataIdList
@@ -1935,7 +2142,11 @@
1935
2142
  function (metadataIdList, rootId) {
1936
2143
  /** @type {?} */
1937
2144
  var list = JSON.parse(metadataIdList);
1938
- return "/api/runtime/dfs/v1.0/doc/multiple/download?metadataidlist=" + metadataIdList + "&rootid=" + rootId + "&token=" + this.getToken(this.mergeString(list[0], rootId));
2145
+ /** @type {?} */
2146
+ var url = "/api/runtime/dfs/v1.0/doc/multiple/download?metadataidlist=" + metadataIdList + "&rootid=" + rootId + "&token=" + this.getToken(this.mergeString(list[0], rootId));
2147
+ /** @type {?} */
2148
+ var baseUrl = rtf.BasePathService.convertPath(url);
2149
+ return baseUrl;
1939
2150
  };
1940
2151
  /**
1941
2152
  * @param {?} metadataIdList
@@ -1956,7 +2167,11 @@
1956
2167
  zipName = 'unifile.zip';
1957
2168
  if (!zipName.endsWith(".zip"))
1958
2169
  zipName += '.zip';
1959
- return "/api/runtime/dfs/v1.0/doc/compress/download?metadataidlist=" + metadataIdList + "&rootid=" + rootId + "&token=" + this.getToken(this.mergeString(list[0], rootId)) + "&zipName=" + encodeURIComponent(zipName);
2170
+ /** @type {?} */
2171
+ var url = "/api/runtime/dfs/v1.0/doc/compress/download?metadataidlist=" + metadataIdList + "&rootid=" + rootId + "&token=" + this.getToken(this.mergeString(list[0], rootId)) + "&zipName=" + encodeURIComponent(zipName);
2172
+ /** @type {?} */
2173
+ var baseUrl = rtf.BasePathService.convertPath(url);
2174
+ return baseUrl;
1960
2175
  };
1961
2176
  /**
1962
2177
  * @param {?} metadataId
@@ -1972,7 +2187,11 @@
1972
2187
  */
1973
2188
  function (metadataId, rootId, version) {
1974
2189
  //let list:string[]=JSON.parse(metadataIdList);
1975
- return "/api/runtime/dfs/v1.0/doc/historycontent?metadataid=" + metadataId + "&rootid=" + rootId + "&version=" + version + "&token=" + this.getToken(this.mergeString(metadataId, rootId));
2190
+ /** @type {?} */
2191
+ var url = "/api/runtime/dfs/v1.0/doc/historycontent?metadataid=" + metadataId + "&rootid=" + rootId + "&version=" + version + "&token=" + this.getToken(this.mergeString(metadataId, rootId));
2192
+ /** @type {?} */
2193
+ var baseUrl = rtf.BasePathService.convertPath(url);
2194
+ return baseUrl;
1976
2195
  };
1977
2196
  /**
1978
2197
  * @private
@@ -2081,6 +2300,7 @@
2081
2300
  declarations: [FileUploadComponent, LocalLangPipe],
2082
2301
  imports: [
2083
2302
  common.CommonModule,
2303
+ rtf.FarrisRTFModule,
2084
2304
  uiNotify.NotifyModule,
2085
2305
  uiMessager.MessagerModule.forRoot(),
2086
2306
  uiLoading.LoadingModule.forRoot(),
@@ -2301,6 +2521,7 @@
2301
2521
  if (limit != null) {
2302
2522
  uploadRef.instance.fileCount = limit.fileCount;
2303
2523
  uploadRef.instance.securityInfo = limit.securityInfo;
2524
+ uploadRef.instance.fileNameLength = limit.fileNameLength;
2304
2525
  if (limit.fileType != null && limit.fileType != "")
2305
2526
  uploadRef.instance.fileType = limit.fileType;
2306
2527
  }
@@ -2396,6 +2617,7 @@
2396
2617
  this.fileType = "*";
2397
2618
  this.fileCount = 0;
2398
2619
  this.securityInfo = null;
2620
+ this.fileNameLength = 0;
2399
2621
  }
2400
2622
  return UploadLimit;
2401
2623
  }());