@@ -262,7 +262,7 @@ ClassMethod AfterUserAction(Type As %Integer, Name As %String, InternalName As %
262
262
263
263
ClassMethod Revert (InternalName As %String ) As %Status
264
264
{
265
- set filename = ..FullExternalName (InternalName )
265
+ set filename = ..FullExternalName (. InternalName )
266
266
do ..RunGitCommand (" checkout" , .errStream , .outStream , " --" , filename )
267
267
$$$QuitOnError(##class (SourceControl.Git.Change ).RemoveUncommitted (filename ,0 ,1 ))
268
268
$$$QuitOnError(##class (SourceControl.Git.Change ).RefreshUncommitted (0 ,1 ))
@@ -272,7 +272,7 @@ ClassMethod Revert(InternalName As %String) As %Status
272
272
273
273
ClassMethod Commit (InternalName As %String , Message As %String = " example commit message" ) As %Status
274
274
{
275
- set filename = ..FullExternalName (InternalName )
275
+ set filename = ..FullExternalName (. InternalName )
276
276
set username = ..GitUserName ()
277
277
set email = ..GitUserEmail ()
278
278
set author = username _" <" _email _" >"
@@ -430,7 +430,7 @@ ClassMethod NormalizeFolder(folder As %String) As %String
430
430
431
431
ClassMethod ExternalName (InternalName As %String , ByRef MappingExists As %Boolean ) As %String
432
432
{
433
- quit ..Name (InternalName ,.MappingExists )
433
+ quit ..Name (. InternalName ,.MappingExists )
434
434
}
435
435
436
436
ClassMethod AddToServerSideSourceControl (InternalName As %String ) As %Status
@@ -454,7 +454,7 @@ ClassMethod AddToSourceControl(InternalName As %String) As %Status
454
454
#dim ec as %Status = $$$OK
455
455
for i = 1 :1 :$length (InternalName , " ," ) {
456
456
#dim item as %String = ..NormalizeExtension ($piece (InternalName , " ," , i ))
457
- #dim type as %String = ..Type (item )
457
+ #dim type as %String = ..Type (. item )
458
458
459
459
#dim sc as %Status = ..ExportItem (item ,,1 ,.filenames )
460
460
if 'sc {
@@ -465,7 +465,7 @@ ClassMethod AddToSourceControl(InternalName As %String) As %Status
465
465
if (FileInternalName = " " ) {
466
466
continue
467
467
}
468
- set FileType = ##class (SourceControl.Git.Utils ).Type (FileInternalName )
468
+ set FileType = ##class (SourceControl.Git.Utils ).Type (. FileInternalName )
469
469
470
470
set @..#Storage@(" items" , FileInternalName ) = " "
471
471
do ..RunGitCommand (" add" ,.errStream ,.outStream ,filenames (i ))
@@ -491,7 +491,7 @@ ClassMethod RemoveFromGit(InternalName)
491
491
492
492
ClassMethod DeleteExternalsForItem (InternalName As %String ) As %Status
493
493
{
494
- #dim type as %String = ..Type (InternalName )
494
+ #dim type as %String = ..Type (. InternalName )
495
495
#dim ec as %Status = $$$OK
496
496
if (type = " prj" ) || (type = " pkg" ) || (type = " csp" && ..IsCspFolder (InternalName )) {
497
497
// we delete complex items
@@ -588,7 +588,7 @@ ClassMethod FindTrackedFilesInCSPFolders(InternalName As %String, ByRef trackedF
588
588
ClassMethod FindTrackedFiles (InternalName As %String , ByRef trackedFiles As %String ) As %Status
589
589
{
590
590
591
- #dim type as %String = ..Type (InternalName )
591
+ #dim type as %String = ..Type (. InternalName )
592
592
set InternalName = ..NameWithoutExtension (InternalName )
593
593
594
594
if (type = " pkg" ) {
@@ -604,7 +604,7 @@ ClassMethod FindTrackedFiles(InternalName As %String, ByRef trackedFiles As %Str
604
604
/// Description
605
605
ClassMethod FindTrackedParent (InternalName As %String , ByRef parentElement As %String ) As %Status
606
606
{
607
- #dim type as %String = ..Type (InternalName )
607
+ #dim type as %String = ..Type (. InternalName )
608
608
set isInSourceControl = 0
609
609
if type = " cls" {
610
610
#define StripExtension (%s ) $Piece (%s ," ." ,1 ,$Length (%s , " ." ) - 1 )
@@ -638,7 +638,7 @@ ClassMethod RemoveFromServerSideSourceControl(InternalName As %String) As %Statu
638
638
for i = 1 :1 :$length (InternalName , " ," ) {
639
639
#dim item as %String = ..NormalizeExtension ($piece (InternalName , " ," , i ))
640
640
#dim tsc as %Status = $$$OK
641
- #dim type as %String = ..Type (InternalName )
641
+ #dim type as %String = ..Type (. InternalName )
642
642
643
643
if $data (@..#Storage@(" items" , item )) {
644
644
kill @..#Storage@(" items" , item )
@@ -661,7 +661,7 @@ ClassMethod RemoveFromSourceControl(InternalName As %String, cascadeDelete As %B
661
661
}
662
662
for i = 1 :1 :$length (InternalName , " ," ) {
663
663
#dim tsc as %Status = $$$OK
664
- #dim type as %String = ..Type (InternalName )
664
+ #dim type as %String = ..Type (. InternalName )
665
665
666
666
set item = $piece (InternalName , " ," , i )
667
667
if $data (@..#Storage@(" items" , ..NormalizeExtension (item ))) {
@@ -726,6 +726,20 @@ ClassMethod Type(InternalName As %String) As %String
726
726
}
727
727
}
728
728
729
+ // For an abstract document, use the GetOther() method to try to determine its "real" class
730
+ If ##class (%RoutineMgr ).UserType (InternalName ,.docclass ,.doctype ) {
731
+ // Check for a real abstract document subclass (or GetOther() may not work)
732
+ If $classmethod (docclass ," %IsA" ," %Studio.AbstractDocument" ) {
733
+ // Grab the actual name
734
+ Set actualName = $classmethod (docclass ," GetOther" ,InternalName )
735
+ // The actualName is only valid if we get a single .cls as a result
736
+ If actualName '[" ," ,$ZCVT ($P (actualName ," ." ,$L (actualName ," ." ))," U" )=" CLS" {
737
+ // We use what GetOther() gives us, thus Demo.Loan.FindRateProcess.bpl becomes Demo.Loan.FindRateProcess.cls
738
+ Set InternalName = actualName
739
+ }
740
+ }
741
+ }
742
+
729
743
quit type
730
744
}
731
745
@@ -746,7 +760,7 @@ ClassMethod IsItemInProject(InternalName As %String, projectName As %String) As
746
760
// we should check two cases
747
761
// direct inclusion
748
762
// inclusion in package or csp-folder that contained in project
749
- #dim type as %String = ..Type (InternalName )
763
+ #dim type as %String = ..Type (. InternalName )
750
764
#dim name as %String = $case (type , " cls" : ..NameWithoutExtension (InternalName ),
751
765
" pkg" : $translate (..NameWithoutExtension (InternalName ), " /" , " ." ),
752
766
" csp" : $extract (InternalName , 2 , *),
@@ -874,7 +888,7 @@ ClassMethod IsInSourceControl(InternalName As %String, ByRef sourceControlItem A
874
888
// projects for everything
875
889
// csp-folders for csp and static files
876
890
877
- #dim type as %String = ..Type (InternalName )
891
+ #dim type as %String = ..Type (. InternalName )
878
892
if type = " cls" {
879
893
#define StripExtension (%s ) $Piece (%s ," ." ,1 ,$Length (%s , " ." ) - 1 )
880
894
set className = $$$StripExtension(InternalName )
@@ -898,12 +912,12 @@ ClassMethod IsInSourceControl(InternalName As %String, ByRef sourceControlItem A
898
912
quit isInSourceControl
899
913
}
900
914
901
- ClassMethod FullExternalName (InternalName As %String , ByRef MappingExists As %Boolean ) As %String [ CodeMode = expression ]
915
+ ClassMethod FullExternalName (ByRef InternalName As %String , ByRef MappingExists As %Boolean ) As %String [ CodeMode = expression ]
902
916
{
903
- ##class (%File ).NormalizeFilename (..TempFolder ()_..ExternalName (InternalName , .MappingExists ))
917
+ ##class (%File ).NormalizeFilename (..TempFolder ()_..ExternalName (. InternalName , .MappingExists ))
904
918
}
905
919
906
- ClassMethod NormalizeInternalName (name As %String ) As %String
920
+ ClassMethod NormalizeInternalName (ByRef name As %String ) As %String
907
921
{
908
922
//Studio passes name of routine with dots as it is in folders
909
923
//e.g. Package.SubPackage.Routine.mac has InternalName = /Package/SubPackage/Routine.mac
@@ -914,12 +928,12 @@ ClassMethod NormalizeInternalName(name As %String) As %String
914
928
quit " "
915
929
}
916
930
931
+ set type = ..Type (.name )
932
+
917
933
if $extract (name ) '= " /" {
918
934
quit $piece (name ," ." ,1 ,*-1 )_" ." _$zconvert ($piece (name ," ." ,*)," U" )
919
935
}
920
936
921
- set type = ..Type (name )
922
-
923
937
if (type = " inc" ) || (type = " mac" ) || (type = " int" ) {
924
938
set name = $extract ($translate (name , " /" , " ." ), 2 , *)
925
939
}
@@ -966,7 +980,7 @@ ClassMethod RemoveRoutineTSH(InternalName As %String) As %Status
966
980
967
981
ClassMethod DeleteExternalFile (InternalName As %String ) As %Status
968
982
{
969
- #dim fullName = ##class (Utils ).FullExternalName (InternalName )
983
+ #dim fullName = ##class (Utils ).FullExternalName (. InternalName )
970
984
#dim ec as %Status = $$$OK
971
985
if ##class (%File ).Exists (fullName ) {
972
986
set ec = ##class (%File ).Delete (fullName )
@@ -979,7 +993,7 @@ ClassMethod DeleteExternalFile(InternalName As %String) As %Status
979
993
/// if temp file for InternalName not found return "0,0" in tempFileTSH
980
994
ClassMethod GetTempFileAndRoutineTS (InternalName As %String , ByRef tempFileTSH As %String , ByRef routineTSH As %String )
981
995
{
982
- #dim filename as %String = ..FullExternalName (InternalName )
996
+ #dim filename as %String = ..FullExternalName (. InternalName )
983
997
set tempFileTSH = ##class (%File ).GetFileDateModified (filename )
984
998
set routineTSH = ..RoutineTSH (InternalName )
985
999
//file not found or path not found or some other error
@@ -1031,7 +1045,7 @@ ClassMethod FixProjectCspReferences(projectName As %String) As %Status
1031
1045
/// if <var>force</var> = 1 then imports in any case.
1032
1046
ClassMethod ImportItem (InternalName As %String , force As %Boolean = 0 , verbose As %Boolean = 1 ) As %Status
1033
1047
{
1034
- #dim filename as %String = ..FullExternalName (InternalName )
1048
+ #dim filename as %String = ..FullExternalName (. InternalName )
1035
1049
#dim fileTSH = ##class (%File ).GetFileDateModified (filename )
1036
1050
#dim sc as %Status = $$$OK
1037
1051
@@ -1261,7 +1275,7 @@ ClassMethod ExportRoutinesAux(path As %String, sep As %String = "", level As %In
1261
1275
1262
1276
ClassMethod ExportItem (InternalName As %String , expand As %Boolean = 1 , force As %Boolean = 0 , ByRef filenames ) As %Status
1263
1277
{
1264
- #dim type = ..Type (InternalName )
1278
+ #dim type = ..Type (. InternalName )
1265
1279
if type = " pkg" {
1266
1280
$$$QuitOnError(..ExportRoutinesAux (..NameWithoutExtension (InternalName ), " ." , 0 , force , .filenames ))
1267
1281
}elseif type = " prj" && expand {
@@ -1454,7 +1468,6 @@ ClassMethod GitStatus(ByRef files, IncludeAllFiles = 0)
1454
1468
*/
1455
1469
ClassMethod Name (InternalName As %String , ByRef MappingExists As %Boolean ) As %String
1456
1470
{
1457
-
1458
1471
set MappingExists = -1
1459
1472
set InternalName =##class (%Studio.SourceControl.Interface ).normalizeName (InternalName )
1460
1473
set context = ##class (SourceControl.Git.PackageManagerContext ).%Get ()
0 commit comments