@@ -28,7 +28,8 @@ export class RootNode extends NodeBase {
28
28
const path = this instanceof PackageNode ? this . fullName + "/" : "" ;
29
29
return this . getItems ( path , this . _category ) ;
30
30
}
31
- public getItems ( path : string , category : string ) : Promise < NodeBase [ ] > {
31
+
32
+ public getList ( path : string , category : string , flat : boolean ) {
32
33
const sql = "CALL %Library.RoutineMgr_StudioOpenDialog(?,?,?,?,?,?,?)" ;
33
34
// const sql = "CALL %Library.RoutineMgr_StudioOpenDialog(?,,,,,,?)";
34
35
let spec = "" ;
@@ -42,12 +43,14 @@ export class RootNode extends NodeBase {
42
43
case "INC" :
43
44
spec = "*.inc" ;
44
45
break ;
46
+ case "ALL" :
47
+ spec = "*.cls,*.mac,*.int,*.inc" ;
48
+ break ;
45
49
default :
46
50
return ;
47
51
}
48
52
const direction = "1" ;
49
53
const orderBy = "1" ; // by Name
50
- const flat = "0" ;
51
54
const notStudio = "0" ;
52
55
const generated = this . options . generated ? "1" : "0" ;
53
56
@@ -58,29 +61,45 @@ export class RootNode extends NodeBase {
58
61
const api = new AtelierAPI ( this . workspaceFolder ) ;
59
62
api . setNamespace ( this . namespace ) ;
60
63
return api
61
- . actionQuery ( sql , [ spec , direction , orderBy , systemFiles , flat , notStudio , generated ] )
64
+ . actionQuery ( sql , [ spec , direction , orderBy , systemFiles , flat ? "1" : "0" , notStudio , generated ] )
62
65
. then ( data => {
63
66
const content = data . result . content ;
64
67
return content ;
65
68
} )
66
69
. then ( data =>
67
- data
68
- . map ( el => {
69
- const fullName = ( this instanceof PackageNode ? this . fullName + "." : "" ) + el . Name ;
70
- switch ( el . Type ) {
71
- case "9" :
72
- return new PackageNode ( el . Name , fullName , category , this . options ) ;
73
- case "4" :
74
- return new ClassNode ( el . Name , fullName , this . options ) ;
75
- case "0" :
76
- case "1" :
77
- case "2" :
78
- return new RoutineNode ( el . Name , fullName , this . options ) ;
79
- default :
80
- return null ;
81
- }
82
- } )
83
- . filter ( el => el !== null )
70
+ data . map ( el => {
71
+ const fullName = ( this instanceof PackageNode ? this . fullName + "." : "" ) + el . Name ;
72
+ return {
73
+ ...el ,
74
+ fullName,
75
+ } ;
76
+ } )
84
77
) ;
85
78
}
79
+
80
+ public getItems ( path : string , category : string ) : Promise < NodeBase [ ] > {
81
+ return this . getList ( path , category , false ) . then ( data =>
82
+ data
83
+ . map ( el => {
84
+ switch ( el . Type ) {
85
+ case "9" :
86
+ return new PackageNode ( el . Name , el . fullName , category , this . options ) ;
87
+ case "4" :
88
+ return new ClassNode ( el . Name , el . fullName , this . options ) ;
89
+ case "0" :
90
+ case "1" :
91
+ case "2" :
92
+ return new RoutineNode ( el . Name , el . fullName , this . options ) ;
93
+ default :
94
+ return null ;
95
+ }
96
+ } )
97
+ . filter ( el => el !== null )
98
+ ) ;
99
+ }
100
+
101
+ public getItems4Export ( ) : Promise < string [ ] > {
102
+ const path = this instanceof PackageNode ? this . fullName + "/" : "" ;
103
+ return this . getList ( path , "ALL" , true ) . then ( data => data . map ( el => el . Name ) ) ;
104
+ }
86
105
}
0 commit comments