@@ -13,85 +13,85 @@ export class Edt {
1313 }
1414
1515 createTreeElements ( root : TreeItem ) {
16- vscode . workspace . fs . readFile ( this . xmlPath )
17- . then ( configXml => {
18- const arrayPaths = [
19- 'mdclass:Configuration.subsystems' ,
20- 'mdclass:Configuration.commonModules' ,
21- 'mdclass:Configuration.sessionParameters' ,
22- 'mdclass:Configuration.roles' ,
23- 'mdclass:Configuration.commonAttributes' ,
24- 'mdclass:Configuration.exchangePlans' ,
25- 'mdclass:Configuration.filterCriteria' ,
26- 'mdclass:Configuration.eventSubscriptions' ,
27- 'mdclass:Configuration.scheduledJobs' ,
28- 'mdclass:Configuration.functionalOptions' ,
29- 'mdclass:Configuration.functionalOptionsParameters' ,
30- 'mdclass:Configuration.definedTypes' ,
31- 'mdclass:Configuration.settingsStorages' ,
32- 'mdclass:Configuration.commonCommands' ,
33- 'mdclass:Configuration.commandGroups' ,
34- 'mdclass:Configuration.commonForms' ,
35- 'mdclass:Configuration.commonTemplates' ,
36- 'mdclass:Configuration.commonPictures' ,
37- 'mdclass:Configuration.xdtoPackages' ,
38- 'mdclass:Configuration.webServices' ,
39- 'mdclass:Configuration.httpServices' ,
40- 'mdclass:Configuration.wsReferences' ,
41- 'mdclass:Configuration.styleItems' ,
42- 'mdclass:Configuration.styles' ,
43- //'mdclass:Configuration.languages',
44- 'mdclass:Configuration.constants' ,
45- 'mdclass:Configuration.catalogs' ,
46- 'mdclass:Configuration.documents' ,
47- 'mdclass:Configuration.documentNumerators' ,
48- 'mdclass:Configuration.sequences' ,
49- 'mdclass:Configuration.documentJournals' ,
50- 'mdclass:Configuration.enums' ,
51- 'mdclass:Configuration.reports' ,
52- 'mdclass:Configuration.dataProcessors' ,
53- 'mdclass:Configuration.chartsOfCharacteristicTypes' ,
54- 'mdclass:Configuration.chartsOfAccounts' ,
55- 'mdclass:Configuration.chartsOfCalculationTypes' ,
56- 'mdclass:Configuration.informationRegisters' ,
57- 'mdclass:Configuration.accomulationRegisters' ,
58- 'mdclass:Configuration.accountingRegisters' ,
59- 'mdclass:Configuration.calculationRegisters' ,
60- 'mdclass:Configuration.businessProcesses' ,
61- 'mdclass:Configuration.tasks' ,
62- 'mdclass:Configuration.externalDataSources' ,
63- ] ;
64- const parser = new XMLParser ( {
65- ignoreAttributes : false ,
66- attributeNamePrefix : '$_' ,
67- isArray : ( name , jpath , isLeafNode , isAttribute ) => {
68- if ( arrayPaths . indexOf ( jpath ) !== - 1 ) return true ;
69-
70- return false ;
71- }
72- } ) ;
73- const configuration = parser . parse ( Buffer . from ( configXml ) ) [ 'mdclass:Configuration' ] ;
16+ vscode . workspace . fs . readFile ( this . xmlPath )
17+ . then ( configXml => {
18+ const arrayPaths = [
19+ 'mdclass:Configuration.subsystems' ,
20+ 'mdclass:Configuration.commonModules' ,
21+ 'mdclass:Configuration.sessionParameters' ,
22+ 'mdclass:Configuration.roles' ,
23+ 'mdclass:Configuration.commonAttributes' ,
24+ 'mdclass:Configuration.exchangePlans' ,
25+ 'mdclass:Configuration.filterCriteria' ,
26+ 'mdclass:Configuration.eventSubscriptions' ,
27+ 'mdclass:Configuration.scheduledJobs' ,
28+ 'mdclass:Configuration.functionalOptions' ,
29+ 'mdclass:Configuration.functionalOptionsParameters' ,
30+ 'mdclass:Configuration.definedTypes' ,
31+ 'mdclass:Configuration.settingsStorages' ,
32+ 'mdclass:Configuration.commonCommands' ,
33+ 'mdclass:Configuration.commandGroups' ,
34+ 'mdclass:Configuration.commonForms' ,
35+ 'mdclass:Configuration.commonTemplates' ,
36+ 'mdclass:Configuration.commonPictures' ,
37+ 'mdclass:Configuration.xdtoPackages' ,
38+ 'mdclass:Configuration.webServices' ,
39+ 'mdclass:Configuration.httpServices' ,
40+ 'mdclass:Configuration.wsReferences' ,
41+ 'mdclass:Configuration.styleItems' ,
42+ 'mdclass:Configuration.styles' ,
43+ //'mdclass:Configuration.languages',
44+ 'mdclass:Configuration.constants' ,
45+ 'mdclass:Configuration.catalogs' ,
46+ 'mdclass:Configuration.documents' ,
47+ 'mdclass:Configuration.documentNumerators' ,
48+ 'mdclass:Configuration.sequences' ,
49+ 'mdclass:Configuration.documentJournals' ,
50+ 'mdclass:Configuration.enums' ,
51+ 'mdclass:Configuration.reports' ,
52+ 'mdclass:Configuration.dataProcessors' ,
53+ 'mdclass:Configuration.chartsOfCharacteristicTypes' ,
54+ 'mdclass:Configuration.chartsOfAccounts' ,
55+ 'mdclass:Configuration.chartsOfCalculationTypes' ,
56+ 'mdclass:Configuration.informationRegisters' ,
57+ 'mdclass:Configuration.accomulationRegisters' ,
58+ 'mdclass:Configuration.accountingRegisters' ,
59+ 'mdclass:Configuration.calculationRegisters' ,
60+ 'mdclass:Configuration.businessProcesses' ,
61+ 'mdclass:Configuration.tasks' ,
62+ 'mdclass:Configuration.externalDataSources' ,
63+ ] ;
64+ const parser = new XMLParser ( {
65+ ignoreAttributes : false ,
66+ attributeNamePrefix : '$_' ,
67+ isArray : ( name , jpath , isLeafNode , isAttribute ) => {
68+ if ( arrayPaths . indexOf ( jpath ) !== - 1 ) return true ;
69+
70+ return false ;
71+ }
72+ } ) ;
73+ const configuration = parser . parse ( Buffer . from ( configXml ) ) [ 'mdclass:Configuration' ] ;
7474
75- console . time ( 'edtDownload' ) ;
76- if ( configuration ) {
77- arrayPaths . forEach ( ( path ) => {
78- const objectsName = path . split ( '.' ) [ 1 ] ;
79- const objects = configuration [ objectsName ] ;
75+ console . time ( 'edtDownload' ) ;
76+ if ( configuration ) {
77+ arrayPaths . forEach ( ( path ) => {
78+ const objectsName = path . split ( '.' ) [ 1 ] ;
79+ const objects = configuration [ objectsName ] ;
8080
81- if ( objects && objects . length ) {
82- const treeItem = this . searchTree ( root , root . id + '/' + objectsName ) ;
83- const subTree : TreeItem [ ] = [ ...treeItem ?. children ?? [ ] ] ;
81+ if ( objects && objects . length ) {
82+ const treeItem = this . searchTree ( root , root . id + '/' + objectsName ) ;
83+ const subTree : TreeItem [ ] = [ ...treeItem ?. children ?? [ ] ] ;
8484
85- objects . forEach ( ( obj : any ) => {
86- this . createElement ( subTree , root . id , obj ) ;
87- } ) ;
85+ objects . forEach ( ( obj : any ) => {
86+ this . createElement ( subTree , root . id , obj ) ;
87+ } ) ;
8888
89- treeItem ! . children = subTree ;
90- }
91- } ) ;
92- }
93- console . timeEnd ( 'edtDownload' ) ;
94- } ) ;
89+ treeItem ! . children = subTree ;
90+ }
91+ } ) ;
92+ }
93+ console . timeEnd ( 'edtDownload' ) ;
94+ } ) ;
9595 }
9696
9797 createElement ( subTree : TreeItem [ ] , rootPath : string , objName : string ) {
0 commit comments