@gsp-svc/formdoc-upload 0.2.2 → 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.
@@ -10,8 +10,9 @@ import { ProgressModule } from '@farris/ui-progress';
10
10
  import { FormsModule } from '@angular/forms';
11
11
  import { ComboListModule } from '@farris/ui-combo-list';
12
12
  import { FarrisFormsModule } from '@farris/ui-forms';
13
+ import { BasePathService, FarrisRTFModule } from '@farris/rtf';
13
14
  import { CacheService, HttpService, LanguageService, SessionService } from '@ecp-caf/caf-common';
14
- import { Injectable, Pipe, Inject, LOCALE_ID, Component, Injector, ComponentFactoryResolver, NgModule, Input, ViewChild, defineInjectable } from '@angular/core';
15
+ import { Injectable, Pipe, Inject, LOCALE_ID, Component, Injector, ComponentFactoryResolver, NgModule, ViewChild, Input, defineInjectable } from '@angular/core';
15
16
  import { BsModalService } from '@farris/ui-modal';
16
17
  import { of as of$1 } from 'rxjs';
17
18
  import { HttpClientModule, HttpClient } from '@angular/common/http';
@@ -277,7 +278,9 @@ class UploadService {
277
278
  /** @type {?} */
278
279
  let url = "/api/runtime/dfs/v1.0/formdoc/slice";
279
280
  //url = "/api/runtime/dfs/v1.0/formdoc/list";
280
- return this.httpclient.post(url, formdata).pipe(tap((/**
281
+ /** @type {?} */
282
+ const baseUrl = BasePathService.convertPath(url);
283
+ return this.httpclient.post(baseUrl, formdata).pipe(tap((/**
281
284
  * @param {?} res
282
285
  * @return {?}
283
286
  */
@@ -362,11 +365,13 @@ class UploadService {
362
365
  /** @type {?} */
363
366
  let url = "/api/runtime/dfs/v1.0/formdoc/copy";
364
367
  /** @type {?} */
368
+ const baseUrl = BasePathService.convertPath(url);
369
+ /** @type {?} */
365
370
  let request = new CopyFileRequest;
366
371
  request.metadataId = metadataId;
367
372
  request.rootId = rootId;
368
373
  request.path = path;
369
- return this.httpclient.post(url, request, { responseType: 'text' }).pipe(tap((/**
374
+ return this.httpclient.post(baseUrl, request, { responseType: 'text' }).pipe(tap((/**
370
375
  * @param {?} res
371
376
  * @return {?}
372
377
  */
@@ -490,7 +495,7 @@ const LANG_RESOURCES = {
490
495
  'uploading': '正在上传文件……',
491
496
  'selectedCount': '已选择文件数量:',
492
497
  'limitCount': '超出系统限制数量:',
493
- 'rechooseFile': ',重新选择上传文件。',
498
+ 'rechooseFile': ',请重新选择上传文件。',
494
499
  'save': '保存',
495
500
  'cancel': '取消',
496
501
  'haveSameName': '已上传过同名文件: ',
@@ -512,7 +517,13 @@ const LANG_RESOURCES = {
512
517
  'size': '大小',
513
518
  'close': '关闭',
514
519
  'loading': '拼命加载中',
515
- 'mismatchChunkSize': '文档分片上传部分丢失,请重新上传,如果多次上传失败,请联系管理员。'
520
+ 'mismatchChunkSize': '文档分片上传部分丢失,请重新上传,如果多次上传失败,请联系管理员。',
521
+ 'invalidCharacters': '文件名包含特殊字符',
522
+ 'invalidExtNames': '文档类型不允许上传',
523
+ 'whiteExtNames': '。允许上传的文件类型为:',
524
+ 'blackExtNames': '。不允许上传的文件类型为:',
525
+ 'UnrecognizedFileType': '无法确定文件类型',
526
+ 'fileNameOverSize': '文件名超出长度限制,最长允许'
516
527
  },
517
528
  'en-US': {
518
529
  'uploadFile': 'Upload File',
@@ -541,7 +552,13 @@ const LANG_RESOURCES = {
541
552
  'size': 'Size',
542
553
  'close': 'Close',
543
554
  'loading': 'Loading',
544
- 'mismatchChunkSize': 'The partial upload of document shards is missing. Please upload again. If multiple uploads fail, please contact the administrator.'
555
+ 'mismatchChunkSize': 'The partial upload of document shards is missing. Please upload again. If multiple uploads fail, please contact the administrator.',
556
+ 'invalidCharacters': 'The file name contains special characters',
557
+ 'invalidExtNames': 'Document type does not allow uploading',
558
+ 'whiteExtNames': '.The file types allowed for uploading are:',
559
+ 'blackExtNames': '.The file types that are not allowed to be uploaded are:',
560
+ 'UnrecognizedFileType': 'Unrecognized file type',
561
+ 'fileNameOverSize': 'fileName oversize,the lengthest is'
545
562
  },
546
563
  'en': {
547
564
  'uploadFile': 'Upload File',
@@ -570,7 +587,13 @@ const LANG_RESOURCES = {
570
587
  'size': 'Size',
571
588
  'close': 'Close',
572
589
  'loading': 'Loading',
573
- 'mismatchChunkSize': 'The partial upload of document shards is missing. Please upload again. If multiple uploads fail, please contact the administrator.'
590
+ 'mismatchChunkSize': 'The partial upload of document shards is missing. Please upload again. If multiple uploads fail, please contact the administrator.',
591
+ 'invalidCharacters': 'The file name contains special characters',
592
+ 'invalidExtNames': 'Document type does not allow uploading',
593
+ 'whiteExtNames': '.The file types allowed for uploading are:',
594
+ 'blackExtNames': '.The file types that are not allowed to be uploaded are:',
595
+ 'UnrecognizedFileType': 'Unrecognized file type',
596
+ 'fileNameOverSize': 'fileName oversize,the lengthest is'
574
597
  },
575
598
  'zh-CHT': {
576
599
  'uploadFile': '上傳文件',
@@ -599,7 +622,13 @@ const LANG_RESOURCES = {
599
622
  'size': '大小',
600
623
  'close': '關閉',
601
624
  'loading': '拼命加載中',
602
- 'mismatchChunkSize': '文檔分片上傳部分遺失,請重新上傳,如果多次上傳失敗,請聯系管理員。'
625
+ 'mismatchChunkSize': '文檔分片上傳部分遺失,請重新上傳,如果多次上傳失敗,請聯系管理員。',
626
+ 'invalidCharacters': '文件名包含特殊字符',
627
+ 'invalidExtNames': '文檔類型不允許上傳',
628
+ 'whiteExtNames': '。允許上傳的文件類型為:',
629
+ 'blackExtNames': '。不允許上傳的文件類型為:',
630
+ 'UnrecognizedFileType': '無法確定文件類型',
631
+ 'fileNameOverSize': '文件名超出长度限制,最长允许'
603
632
  },
604
633
  };
605
634
 
@@ -690,12 +719,19 @@ class FileUploadComponent {
690
719
  this.errTypeList = [];
691
720
  this.nullFileList = [];
692
721
  this.beyondFileList = [];
722
+ this.fileNameOversizeList = [];
723
+ this.invalidCharactersFileList = [];
724
+ this.invalidExtNamesFileList = [];
725
+ this.unrecognizedTypeFileList = [];
726
+ this.invalidCharacters = '';
727
+ this.invalidExtNames = '';
693
728
  this.showType = 0;
694
729
  this.mouseOn = false;
730
+ this.isWhiteList = false;
695
731
  this.bufferSize = 5 * 1024 * 1024;
696
732
  this.selectedFileCount = 0;
697
- this.uploadIconAddress = '/platform/runtime/dfs/images/upload.svg';
698
- this.uploadLittleIconAddress = '/platform/runtime/dfs/images/uploadIcon.svg';
733
+ this.uploadIconAddress = this.createBaseUrl('/platform/runtime/dfs/images/upload.svg');
734
+ this.uploadLittleIconAddress = this.createBaseUrl('/platform/runtime/dfs/images/uploadIcon.svg');
699
735
  this.hasSelectedFile = false;
700
736
  this.fileAllSelected = false;
701
737
  this.uploadProcess = { width: '0%' };
@@ -722,6 +758,7 @@ class FileUploadComponent {
722
758
  this.fileCount = 0;
723
759
  this.oldIdList = [];
724
760
  this.securityInfo = null;
761
+ this.fileNameLength = 0;
725
762
  this.totalLoad = null;
726
763
  this.exStorageFileList = [];
727
764
  if (this.injector) {
@@ -788,6 +825,9 @@ class FileUploadComponent {
788
825
  if (res != null && res.error == null) {
789
826
  this.sameNameAllowed = res.sameNameAllowed;
790
827
  this.maxFileSize = parseInt(JSON.parse(res.validateConfiguration).maxFileSize);
828
+ this.isWhiteList = JSON.parse(res.validateConfiguration).whiteList;
829
+ this.invalidCharacters = JSON.parse(res.validateConfiguration).invalidCharacters;
830
+ this.invalidExtNames = JSON.parse(res.validateConfiguration).invalidExtNames.toLowerCase();
791
831
  this.allowedMultiUpload = res.allowedMultiUpload;
792
832
  if (!this.sameNameAllowed) {
793
833
  this.uploadService.getUploadedFileInfoList(this.formId, this.rootId).subscribe((/**
@@ -816,6 +856,30 @@ class FileUploadComponent {
816
856
  // message: this.localepipe.transform('uploading')
817
857
  // });
818
858
  }
859
+ /**
860
+ * @param {?} name
861
+ * @return {?}
862
+ */
863
+ findInvalidCharacter(name) {
864
+ /** @type {?} */
865
+ let charList = [];
866
+ this.invalidCharacters.split('|').forEach((/**
867
+ * @param {?} element
868
+ * @return {?}
869
+ */
870
+ element => {
871
+ if (name.indexOf(element) >= 0)
872
+ charList.push(element);
873
+ }));
874
+ return charList;
875
+ }
876
+ /**
877
+ * @param {?} file
878
+ * @return {?}
879
+ */
880
+ hasFileType(file) {
881
+ return file.name.includes('.');
882
+ }
819
883
  /**
820
884
  * @param {?} $event
821
885
  * @return {?}
@@ -835,6 +899,7 @@ class FileUploadComponent {
835
899
  for (let i = 0; i < this.selectedFiles.files.length; i++) {
836
900
  /** @type {?} */
837
901
  let selectedFile = this.selectedFiles.files[i];
902
+ selectedFile.isAllowedUpload = true;
838
903
  //selectedFile.slice
839
904
  /** @type {?} */
840
905
  let uuid = UUID.UUID();
@@ -842,12 +907,86 @@ class FileUploadComponent {
842
907
  this.nullFileList.push(selectedFile.name);
843
908
  continue;
844
909
  }
910
+ if (this.fileNameLength > 0 && selectedFile.name.length > this.fileNameLength) {
911
+ this.fileNameOversizeList.push(selectedFile.name);
912
+ continue;
913
+ }
845
914
  if (this.maxFileSize != null && this.maxFileSize > 0) {
846
915
  if (selectedFile.size > this.maxFileSize * 1000) {
847
916
  this.beyondFileList.push(selectedFile.name);
848
917
  continue;
849
918
  }
850
919
  }
920
+ /** @type {?} */
921
+ let invalidCharList = this.findInvalidCharacter(selectedFile.name);
922
+ /** @type {?} */
923
+ let errorMessage = "";
924
+ if (invalidCharList.length > 0) {
925
+ invalidCharList.forEach((/**
926
+ * @param {?} element
927
+ * @param {?} index
928
+ * @return {?}
929
+ */
930
+ (element, index) => {
931
+ errorMessage += "\"";
932
+ errorMessage += element;
933
+ errorMessage += "\"";
934
+ errorMessage += (index === invalidCharList.length - 1) ? "" : ",";
935
+ }));
936
+ if (this.selectedFiles.files.length === 1) {
937
+ selectedFile.isAllowedUpload = false;
938
+ this.msgService.warning(this.localepipe.transform('invalidCharacters') + errorMessage + this.localepipe.transform('rechooseFile'));
939
+ return;
940
+ }
941
+ if (this.selectedFiles.files.length > 1) {
942
+ selectedFile.isAllowedUpload = false;
943
+ this.invalidCharactersFileList.push(selectedFile.name);
944
+ continue;
945
+ }
946
+ }
947
+ if (!this.hasFileType(selectedFile)) {
948
+ if (this.selectedFiles.files.length === 1) {
949
+ selectedFile.isAllowedUpload = false;
950
+ this.msgService.warning(selectedFile.name + this.localepipe.transform('UnrecognizedFileType') + this.localepipe.transform('rechooseFile'));
951
+ return;
952
+ }
953
+ if (this.selectedFiles.files.length > 1) {
954
+ selectedFile.isAllowedUpload = false;
955
+ this.unrecognizedTypeFileList.push(selectedFile.name);
956
+ continue;
957
+ }
958
+ }
959
+ // let curFileSuffix = selectedFile.name.split('.')[1];
960
+ /** @type {?} */
961
+ let curFileSuffix = selectedFile.name.substr(selectedFile.name.lastIndexOf('.') + 1).toLowerCase();
962
+ /** @type {?} */
963
+ const extNames = this.listToString(this.invalidExtNames.split('|'));
964
+ /** @type {?} */
965
+ const extNamesAry = this.invalidExtNames.split('|');
966
+ if (!this.isWhiteList && extNamesAry.includes(curFileSuffix)) {
967
+ if (this.selectedFiles.files.length === 1) {
968
+ selectedFile.isAllowedUpload = false;
969
+ this.msgService.warning(selectedFile.name + this.localepipe.transform('invalidExtNames') + this.localepipe.transform('blackExtNames') + extNames + this.localepipe.transform('rechooseFile'));
970
+ return;
971
+ }
972
+ if (this.selectedFiles.files.length > 1) {
973
+ selectedFile.isAllowedUpload = false;
974
+ this.invalidExtNamesFileList.push(selectedFile.name);
975
+ continue;
976
+ }
977
+ }
978
+ if (this.isWhiteList && !extNamesAry.includes(curFileSuffix)) {
979
+ if (this.selectedFiles.files.length === 1) {
980
+ selectedFile.isAllowedUpload = false;
981
+ this.msgService.warning(selectedFile.name + this.localepipe.transform('invalidExtNames') + this.localepipe.transform('whiteExtNames') + extNames + this.localepipe.transform('rechooseFile'));
982
+ return;
983
+ }
984
+ if (this.selectedFiles.files.length > 1) {
985
+ selectedFile.isAllowedUpload = false;
986
+ this.invalidExtNamesFileList.push(selectedFile.name);
987
+ continue;
988
+ }
989
+ }
851
990
  if (!this.sameNameAllowed) {
852
991
  if (this.uploadedFileInfoList.find((/**
853
992
  * @param {?} x
@@ -934,7 +1073,9 @@ class FileUploadComponent {
934
1073
  continue;
935
1074
  }
936
1075
  }
937
- this.uploadFile(uuid, selectedFile, selectedFile.name);
1076
+ if (selectedFile.isAllowedUpload === true) {
1077
+ this.uploadFile(uuid, selectedFile, selectedFile.name);
1078
+ }
938
1079
  }
939
1080
  if (this.errFileList.length > 0) {
940
1081
  /** @type {?} */
@@ -945,17 +1086,39 @@ class FileUploadComponent {
945
1086
  if (this.nullFileList.length > 0) {
946
1087
  /** @type {?} */
947
1088
  let name = this.listToString(this.nullFileList);
948
- name = name.substring(0, name.length - 1);
949
1089
  this.msgService.warning(name + this.localepipe.transform('sizeZero') + this.localepipe.transform('rechooseFile'));
950
1090
  this.nullFileList = [];
951
1091
  }
1092
+ if (this.fileNameOversizeList.length > 0) {
1093
+ /** @type {?} */
1094
+ let name = this.listToString(this.fileNameOversizeList);
1095
+ this.msgService.warning(name + this.localepipe.transform('fileNameOverSize') + this.fileNameLength + this.localepipe.transform('rechooseFile'));
1096
+ this.fileNameOversizeList = [];
1097
+ }
952
1098
  if (this.beyondFileList.length > 0) {
953
1099
  /** @type {?} */
954
1100
  let name = this.listToString(this.beyondFileList);
955
- name = name.substring(0, name.length - 1);
956
1101
  this.msgService.warning(name + this.localepipe.transform('sizeMax') + this.maxFileSize + "KB" + this.localepipe.transform('rechooseFile'));
957
1102
  this.beyondFileList = [];
958
1103
  }
1104
+ if (this.invalidCharactersFileList.length > 0) {
1105
+ /** @type {?} */
1106
+ let name = this.listToString(this.invalidCharactersFileList);
1107
+ this.msgService.warning(name + this.localepipe.transform('invalidCharacters') + this.localepipe.transform('rechooseFile'));
1108
+ this.invalidCharactersFileList = [];
1109
+ }
1110
+ if (this.invalidExtNamesFileList.length > 0) {
1111
+ /** @type {?} */
1112
+ let name = this.listToString(this.invalidExtNamesFileList);
1113
+ this.msgService.warning(name + this.localepipe.transform('invalidExtNames') + this.localepipe.transform('rechooseFile'));
1114
+ this.invalidExtNamesFileList = [];
1115
+ }
1116
+ if (this.unrecognizedTypeFileList.length > 0) {
1117
+ /** @type {?} */
1118
+ let name = this.listToString(this.unrecognizedTypeFileList);
1119
+ this.msgService.warning(name + this.localepipe.transform('UnrecognizedFileType') + this.localepipe.transform('rechooseFile'));
1120
+ this.unrecognizedTypeFileList = [];
1121
+ }
959
1122
  this.files = this.files.slice();
960
1123
  this.fileAllSelected = false;
961
1124
  $event.target.value = '';
@@ -1216,7 +1379,9 @@ class FileUploadComponent {
1216
1379
  uploadSingleFile(formdata) {
1217
1380
  /** @type {?} */
1218
1381
  let url = "/api/runtime/dfs/v1.0/formdoc/single";
1219
- return this.httpclient.post(url, formdata).pipe(tap((/**
1382
+ /** @type {?} */
1383
+ const baseUrl = BasePathService.convertPath(url);
1384
+ return this.httpclient.post(baseUrl, formdata).pipe(tap((/**
1220
1385
  * @param {?} res
1221
1386
  * @return {?}
1222
1387
  */
@@ -1235,7 +1400,9 @@ class FileUploadComponent {
1235
1400
  uploadSliceFile(formdata) {
1236
1401
  /** @type {?} */
1237
1402
  let url = "/api/runtime/dfs/v1.0/formdoc/slice";
1238
- return this.httpclient.post(url, formdata).pipe(tap((/**
1403
+ /** @type {?} */
1404
+ const baseUrl = BasePathService.convertPath(url);
1405
+ return this.httpclient.post(baseUrl, formdata).pipe(tap((/**
1239
1406
  * @param {?} res
1240
1407
  * @return {?}
1241
1408
  */
@@ -1254,7 +1421,9 @@ class FileUploadComponent {
1254
1421
  initMultiUpload(request) {
1255
1422
  /** @type {?} */
1256
1423
  let url = "/api/runtime/dfs/v1.0/formdoc/multi/init";
1257
- return this.httpclient.post(url, request).pipe(tap((/**
1424
+ /** @type {?} */
1425
+ const baseUrl = BasePathService.convertPath(url);
1426
+ return this.httpclient.post(baseUrl, request).pipe(tap((/**
1258
1427
  * @param {?} res
1259
1428
  * @return {?}
1260
1429
  */
@@ -1273,7 +1442,9 @@ class FileUploadComponent {
1273
1442
  multiUpload(formdata) {
1274
1443
  /** @type {?} */
1275
1444
  let url = "/api/runtime/dfs/v1.0/formdoc/multi/upload";
1276
- return this.httpclient.post(url, formdata).pipe(tap((/**
1445
+ /** @type {?} */
1446
+ const baseUrl = BasePathService.convertPath(url);
1447
+ return this.httpclient.post(baseUrl, formdata).pipe(tap((/**
1277
1448
  * @param {?} res
1278
1449
  * @return {?}
1279
1450
  */
@@ -1292,7 +1463,9 @@ class FileUploadComponent {
1292
1463
  completeMultiUpload(request) {
1293
1464
  /** @type {?} */
1294
1465
  let url = "/api/runtime/dfs/v1.0/formdoc/multi/complete";
1295
- return this.httpclient.post(url, request).pipe(tap((/**
1466
+ /** @type {?} */
1467
+ const baseUrl = BasePathService.convertPath(url);
1468
+ return this.httpclient.post(baseUrl, request).pipe(tap((/**
1296
1469
  * @param {?} res
1297
1470
  * @return {?}
1298
1471
  */
@@ -1458,32 +1631,32 @@ class FileUploadComponent {
1458
1631
  addDocInfo(selectdFile, fileInfo, docType) {
1459
1632
  switch (docType) {
1460
1633
  case DocType.Word: {
1461
- fileInfo.source = "/platform/runtime/dfs/images/word.png";
1634
+ fileInfo.source = this.createBaseUrl("/platform/runtime/dfs/images/word.png");
1462
1635
  this.files.push(fileInfo);
1463
1636
  break;
1464
1637
  }
1465
1638
  case DocType.Pdf: {
1466
- fileInfo.source = "/platform/runtime/dfs/images/pdf.png";
1639
+ fileInfo.source = this.createBaseUrl("/platform/runtime/dfs/images/pdf.png");
1467
1640
  this.files.push(fileInfo);
1468
1641
  break;
1469
1642
  }
1470
1643
  case DocType.Excel: {
1471
- fileInfo.source = "/platform/runtime/dfs/images/excel.png";
1644
+ fileInfo.source = this.createBaseUrl("/platform/runtime/dfs/images/excel.png");
1472
1645
  this.files.push(fileInfo);
1473
1646
  break;
1474
1647
  }
1475
1648
  case DocType.Txt: {
1476
- fileInfo.source = "/platform/runtime/dfs/images/txt.png";
1649
+ fileInfo.source = this.createBaseUrl("/platform/runtime/dfs/images/txt.png");
1477
1650
  this.files.push(fileInfo);
1478
1651
  break;
1479
1652
  }
1480
1653
  case DocType.Powerpoint: {
1481
- fileInfo.source = "/platform/runtime/dfs/images/ppt.png";
1654
+ fileInfo.source = this.createBaseUrl("/platform/runtime/dfs/images/ppt.png");
1482
1655
  this.files.push(fileInfo);
1483
1656
  break;
1484
1657
  }
1485
1658
  case DocType.Other: {
1486
- fileInfo.source = "/platform/runtime/dfs/images/file.png";
1659
+ fileInfo.source = this.createBaseUrl("/platform/runtime/dfs/images/file.png");
1487
1660
  this.files.push(fileInfo);
1488
1661
  break;
1489
1662
  }
@@ -1532,10 +1705,16 @@ class FileUploadComponent {
1532
1705
  * @return {?}
1533
1706
  */
1534
1707
  listToString(strList) {
1708
+ /** @type {?} */
1709
+ const result = strList.filter((/**
1710
+ * @param {?} item
1711
+ * @return {?}
1712
+ */
1713
+ item => item.trim() !== ''));
1535
1714
  /** @type {?} */
1536
1715
  let name = "";
1537
- for (let i = 0; i < strList.length; i++) {
1538
- name += strList[i] + ",";
1716
+ for (let i = 0; i < result.length; i++) {
1717
+ name += result[i] + (i === result.length - 1 ? "" : ",");
1539
1718
  }
1540
1719
  return name;
1541
1720
  }
@@ -1721,6 +1900,15 @@ class FileUploadComponent {
1721
1900
  mouseOut(file) {
1722
1901
  file.mouseOn = false;
1723
1902
  }
1903
+ /**
1904
+ * @param {?} oldUrl
1905
+ * @return {?}
1906
+ */
1907
+ createBaseUrl(oldUrl) {
1908
+ /** @type {?} */
1909
+ const baseUrl = BasePathService.convertPath(oldUrl);
1910
+ return baseUrl;
1911
+ }
1724
1912
  }
1725
1913
  FileUploadComponent.decorators = [
1726
1914
  { type: Component, args: [{
@@ -1743,6 +1931,7 @@ FileUploadComponent.propDecorators = {
1743
1931
  fileCount: [{ type: Input }],
1744
1932
  oldIdList: [{ type: Input }],
1745
1933
  securityInfo: [{ type: Input }],
1934
+ fileNameLength: [{ type: Input }],
1746
1935
  opCell: [{ type: ViewChild, args: ['opCell',] }]
1747
1936
  };
1748
1937
 
@@ -1758,7 +1947,11 @@ class DownloadService {
1758
1947
  * @return {?}
1759
1948
  */
1760
1949
  getDownloadUrl(metadataId, rootId) {
1761
- return "/api/runtime/dfs/v1.0/doc/filecontent?metadataid=" + metadataId + "&rootid=" + rootId + "&token=" + this.getToken(this.mergeString(metadataId, rootId));
1950
+ /** @type {?} */
1951
+ const url = "/api/runtime/dfs/v1.0/doc/filecontent?metadataid=" + metadataId + "&rootid=" + rootId + "&token=" + this.getToken(this.mergeString(metadataId, rootId));
1952
+ /** @type {?} */
1953
+ const baseUrl = BasePathService.convertPath(url);
1954
+ return baseUrl;
1762
1955
  }
1763
1956
  /**
1764
1957
  * @param {?} metadataId
@@ -1766,7 +1959,11 @@ class DownloadService {
1766
1959
  * @return {?}
1767
1960
  */
1768
1961
  getStreamDownloadUrl(metadataId, rootId) {
1769
- return "/api/runtime/dfs/v1.0/formdoc/stream?metadataid=" + metadataId + "&rootid=" + rootId + "&token=" + this.getToken(this.mergeString(metadataId, rootId));
1962
+ /** @type {?} */
1963
+ const url = "/api/runtime/dfs/v1.0/formdoc/stream?metadataid=" + metadataId + "&rootid=" + rootId + "&token=" + this.getToken(this.mergeString(metadataId, rootId));
1964
+ /** @type {?} */
1965
+ const baseUrl = BasePathService.convertPath(url);
1966
+ return baseUrl;
1770
1967
  }
1771
1968
  /**
1772
1969
  * @param {?} metadataIdList
@@ -1776,7 +1973,11 @@ class DownloadService {
1776
1973
  getMultipleDownloadUrl(metadataIdList, rootId) {
1777
1974
  /** @type {?} */
1778
1975
  let list = JSON.parse(metadataIdList);
1779
- return "/api/runtime/dfs/v1.0/doc/multiple/download?metadataidlist=" + metadataIdList + "&rootid=" + rootId + "&token=" + this.getToken(this.mergeString(list[0], rootId));
1976
+ /** @type {?} */
1977
+ const url = "/api/runtime/dfs/v1.0/doc/multiple/download?metadataidlist=" + metadataIdList + "&rootid=" + rootId + "&token=" + this.getToken(this.mergeString(list[0], rootId));
1978
+ /** @type {?} */
1979
+ const baseUrl = BasePathService.convertPath(url);
1980
+ return baseUrl;
1780
1981
  }
1781
1982
  /**
1782
1983
  * @param {?} metadataIdList
@@ -1791,7 +1992,11 @@ class DownloadService {
1791
1992
  zipName = 'unifile.zip';
1792
1993
  if (!zipName.endsWith(".zip"))
1793
1994
  zipName += '.zip';
1794
- return "/api/runtime/dfs/v1.0/doc/compress/download?metadataidlist=" + metadataIdList + "&rootid=" + rootId + "&token=" + this.getToken(this.mergeString(list[0], rootId)) + "&zipName=" + encodeURIComponent(zipName);
1995
+ /** @type {?} */
1996
+ const url = "/api/runtime/dfs/v1.0/doc/compress/download?metadataidlist=" + metadataIdList + "&rootid=" + rootId + "&token=" + this.getToken(this.mergeString(list[0], rootId)) + "&zipName=" + encodeURIComponent(zipName);
1997
+ /** @type {?} */
1998
+ const baseUrl = BasePathService.convertPath(url);
1999
+ return baseUrl;
1795
2000
  }
1796
2001
  /**
1797
2002
  * @param {?} metadataId
@@ -1801,7 +2006,11 @@ class DownloadService {
1801
2006
  */
1802
2007
  getHistoryDownloadUrl(metadataId, rootId, version) {
1803
2008
  //let list:string[]=JSON.parse(metadataIdList);
1804
- return "/api/runtime/dfs/v1.0/doc/historycontent?metadataid=" + metadataId + "&rootid=" + rootId + "&version=" + version + "&token=" + this.getToken(this.mergeString(metadataId, rootId));
2009
+ /** @type {?} */
2010
+ const url = "/api/runtime/dfs/v1.0/doc/historycontent?metadataid=" + metadataId + "&rootid=" + rootId + "&version=" + version + "&token=" + this.getToken(this.mergeString(metadataId, rootId));
2011
+ /** @type {?} */
2012
+ const baseUrl = BasePathService.convertPath(url);
2013
+ return baseUrl;
1805
2014
  }
1806
2015
  /**
1807
2016
  * @private
@@ -1889,6 +2098,7 @@ UploadModule.decorators = [
1889
2098
  declarations: [FileUploadComponent, LocalLangPipe],
1890
2099
  imports: [
1891
2100
  CommonModule,
2101
+ FarrisRTFModule,
1892
2102
  NotifyModule,
1893
2103
  MessagerModule.forRoot(),
1894
2104
  LoadingModule.forRoot(),
@@ -2087,6 +2297,7 @@ class UploadDialogService {
2087
2297
  if (limit != null) {
2088
2298
  uploadRef.instance.fileCount = limit.fileCount;
2089
2299
  uploadRef.instance.securityInfo = limit.securityInfo;
2300
+ uploadRef.instance.fileNameLength = limit.fileNameLength;
2090
2301
  if (limit.fileType != null && limit.fileType != "")
2091
2302
  uploadRef.instance.fileType = limit.fileType;
2092
2303
  }
@@ -2180,6 +2391,7 @@ class UploadLimit {
2180
2391
  this.fileType = "*";
2181
2392
  this.fileCount = 0;
2182
2393
  this.securityInfo = null;
2394
+ this.fileNameLength = 0;
2183
2395
  }
2184
2396
  }
2185
2397