Skip to content

Commit

Permalink
Merge pull request #594 from intersystems/master-deprecate-cspapp
Browse files Browse the repository at this point in the history
fix: make CSPApplication deprecated & forward compatible
  • Loading branch information
isc-shuliu authored Oct 24, 2024
2 parents 45b4512 + cc9bbf1 commit 0084ce2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/%ZPM/PackageManager.cls
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,7 @@ ClassMethod GetVersion(ModuleName, ByRef out, list)
/// For use in unit tests that need to test if a command threw any exceptions.
ClassMethod ShellInternal(pCommand As %String, Output pException As %Exception.AbstractException) [ Internal ]
{
New $$$DeprecationWarned
Set pException = $$$NULLOREF
Set tOneCommand = 0
Set tCommand = $Get(pCommand)
Expand All @@ -509,6 +510,7 @@ ClassMethod ShellInternal(pCommand As %String, Output pException As %Exception.A
)
Set tInShell = 0
For {
Kill $$$DeprecationWarned
Try {

// Have intro message just for first entrance to shell
Expand Down
3 changes: 3 additions & 0 deletions src/%ZPM/PackageManager/Common.inc
Original file line number Diff line number Diff line change
Expand Up @@ -141,3 +141,6 @@ ROUTINE %ZPM.PackageManager.Common [Type=INC]

/// OS corresponding slash
#define SLASH $Select($$$isWINDOWS: "\", 1: "/")

#; Variable to mark deprecation warning has been shown in the current process
#define DeprecationWarned %ZPMModuleDeprecatedResource
12 changes: 9 additions & 3 deletions src/%ZPM/PackageManager/Developer/Processor/CSPApplication.cls
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Include (%sySecurity, %occErrors)
Include (%sySecurity, %occErrors, %ZPM.PackageManager.Common, %ZPM.Formatting)

Class %ZPM.PackageManager.Developer.Processor.CSPApplication Extends (%ZPM.PackageManager.Developer.Processor.Abstract, %XML.Adaptor, %Installer.CSPApplication) [ PropertyClass = %ZPM.PackageManager.Developer.Processor.PropertyParameters ]
{
Expand Down Expand Up @@ -31,10 +31,10 @@ Parameter XMLTYPE = "ZPMCSPApplication";
Property Enabled As %Boolean [ InitialExpression = 1 ];

/// DeepSee Enabled
Property DeepSeeEnabled As %Boolean [ InitialExpression = 0 ];
Property DeepSeeEnabled As %Installer.Boolean [ InitialExpression = 0 ];

/// iKnow Enabled
Property iKnowEnabled As %Boolean [ InitialExpression = 0 ];
Property iKnowEnabled As %Installer.Boolean [ InitialExpression = 0 ];

/// Password authentication enabled
Property PasswordAuthEnabled As %Boolean [ InitialExpression = 0 ];
Expand Down Expand Up @@ -65,6 +65,12 @@ Property Directory As %String(ATTRIBUTEREQUIRED = 0, MAXLEN = 1024) [ Required ]

Method %OnNew(pResourceReference As %ZPM.PackageManager.Developer.ResourceReference) As %Status [ Private, ServerOnly = 1 ]
{
Set packageName = pResourceReference.Module.Name
If ($Get(packageName) '= "") && '$Data($$$DeprecationWarned(packageName)) {
Set $$$DeprecationWarned(packageName) = 1
Write !, $$$FormattedLine($$$Red, "WARNING: The <CSPApplication></CSPApplication> resource tag is deprecated and may be removed in a future release of ZPM (IPM).")
Write !, $$$FormattedLine($$$Red, $$$FormatText(" Please contact the package developer of %1 to use <WebApplication></WebApplication> instead", packageName))
}
Set tSC = ##super(pResourceReference)
Set ..Url = $ZConvert(..Url,"L")
Quit tSC
Expand Down

0 comments on commit 0084ce2

Please sign in to comment.