@@ -1316,6 +1316,24 @@ ClassMethod ImportCSPFile(InternalName As %String) As %Status
1316
1316
Quit sc
1317
1317
}
1318
1318
1319
+ ClassMethod ListItemsRecursively (type , fileSpec , directory , ByRef itemList ) [ Private ]
1320
+ {
1321
+ set files = ##class (%Library.File ).FileSetFunc (directory ,fileSpec ,,1 )
1322
+ throw :files .%SQLCODE <0 ##class (%Exception.SQL ).CreateFromSQLCODE (files .%SQLCODE ,files .%Message )
1323
+ while files .%Next () {
1324
+ if (files .Type =" D" ) {
1325
+ do ..ListItemsRecursively (type , fileSpec , files .Name , .itemList )
1326
+ } else {
1327
+ set internalName = files .ItemName
1328
+ if ($zconvert (type ," l" ) = " ptd" ) && $$$comClassDefined(" %Studio.SourceControl.Production" ) {
1329
+ do ##class (%Studio.SourceControl.Production ).ParseExternalName ($translate (files .Name ," \" ," /" ), .internalName )
1330
+ }
1331
+ set itemList (internalName ) = " "
1332
+ }
1333
+ }
1334
+ }
1335
+
1336
+ /// Returns an array of internal names of all items in the local source control repository.
1319
1337
ClassMethod ListItemsInFiles (ByRef itemList , ByRef err ) As %Status
1320
1338
{
1321
1339
#define DoNotLoad 1
@@ -1332,13 +1350,11 @@ ClassMethod ListItemsInFiles(ByRef itemList, ByRef err) As %Status
1332
1350
set mappedFilePath = ##class (%File ).NormalizeFilename (mappedRelativePath , ..TempFolder ())
1333
1351
1334
1352
if (##class (%File ).DirectoryExists (mappedFilePath )){
1335
- if ..UserTypeCached (" foo." _mappingFileType ) {
1336
- set fileSpec = " *." _$zcvt (mappingFileType ," L" )_" ;*." _$zconvert (mappingFileType ," U" )
1337
- set files = ##class (%Library.File ).FileSetFunc (mappedFilePath ,fileSpec )
1338
- while files .%Next () {
1339
- // Assumes flat file structure
1340
- set itemList (files .ItemName ) = " "
1341
- }
1353
+ if ..UserTypeCached (" foo." _mappingFileType , .userTypeClass ) {
1354
+ set fileSpec = $select (
1355
+ userTypeClass =" Ens.Util.ProjectTextDocument" : " *.xml;*.XML" ,
1356
+ 1 : " *." _$zcvt (mappingFileType ," L" )_" ;*." _$zconvert (mappingFileType ," U" ))
1357
+ do ..ListItemsRecursively (mappingFileType , fileSpec , mappedFilePath , .itemList )
1342
1358
} else {
1343
1359
set res = $system .OBJ .ImportDir (mappedFilePath ,," -d" ,.err ,1 , .tempItemList , $$$DoNotLoad)
1344
1360
merge itemList = tempItemList
0 commit comments