You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
write !, "Installing WebTerminal application to " _ $NAMESPACE
73
-
set ns = $NAMESPACE // ought to be package home namespace!
72
+
new $Namespace
73
+
set ns = $Namespace // ought to be package home namespace!
74
74
set ^WebTerminal("HomeNamespace") = ns
75
+
write !, "Installing WebTerminal application to " _ ns
75
76
set dbdir = $$$defdir
76
-
zn:ns'="%SYS" "%SYS"
77
-
do ##class(Security.System).GetInstallationSecuritySetting(.security)
78
-
set cspProperties("AutheEnabled") = 32 // password by default, 64 for no password
79
-
set cspProperties("NameSpace") = ns // terminal works only in %SYS namespace, only in % package
77
+
set $Namespace = "%SYS"
78
+
79
+
set cspProperties("AutheEnabled") = $$$AutheCache
80
+
set cspProperties("NameSpace") = ns
80
81
set cspProperties("Description") = "A WEB application for Cache WEB Terminal."
81
-
set cspProperties("IsNameSpaceDefault") = 0
82
+
set cspProperties("IsNameSpaceDefault") = $$$NO
82
83
set cspProperties("DispatchClass") = ..#DispatchClass
83
-
do ..RegisterWebApplication("/terminal", .cspProperties)
84
-
set cspProperties("AutheEnabled") = 64
84
+
set st = ..RegisterWebApplication("/terminal", .cspProperties)
85
+
quit:$$$ISERR(st) st
86
+
87
+
set cspProperties("AutheEnabled") = $$$AutheUnauthenticated
85
88
set cspProperties("Description") = "An application representing the open socket for /terminal application. Required since 2016.* Cache versions changed WebSocket behavior. PLEASE LEAVE THIS APPLICATION UNAUTHENTICATED, but do not worry: the socket won't accept anyone without the key."
86
89
set cspProperties("DispatchClass") = ""
87
90
set role = ..GetDBRole(dbdir)
88
91
set cspProperties("MatchRoles")=":%DB_CACHESYS" _ $case($get(role)'="", 1: ":"_role, :"")
89
-
do ..RegisterWebApplication("/terminalsocket", .cspProperties)
90
-
set status = ##Class(Config.Namespaces).Get("%All")
91
-
if ($$$ISERR(status)) { // no namespace %All
92
-
w !, "Creating %All namespace..."
93
-
set Properties("Globals") = "CACHETEMP"
94
-
set Properties("Library") = "CACHELIB"
95
-
set Properties("Routines") = "CACHETEMP"
96
-
set Properties("SysGlobals") = "CACHESYS"
97
-
set Properties("SysRoutines") = "CACHESYS"
98
-
set Properties("TempGlobals") = "CACHETEMP"
99
-
set status = ##Class(Config.Namespaces).Create("%All", .Properties)
100
-
if ($$$ISERR(status)) {
101
-
do $System.Status.DisplayError(status)
102
-
quit status
103
-
} else {
104
-
w !, "%All namespace is created."
105
-
}
92
+
set st = ..RegisterWebApplication("/terminalsocket", .cspProperties)
93
+
quit:$$$ISERR(st) st
94
+
95
+
set st = ..CreateAllNamespace()
96
+
if ($$$ISERR(st)) {
97
+
do $System.Status.DisplayError(st)
98
+
} else {
99
+
write !, "%All namespace is created."
106
100
}
107
-
w !, "Mapping %WebTerminal package into all namespaces:"
108
-
set mapTo = $LISTBUILD("%All", "SAMPLES", "DOCBOOK")
109
-
do ##Class(Config.Namespaces).Get("USER", .InstallNSProps)
110
-
set Properties("Database") = $get(InstallNSProps("Routines"))
111
-
set ptr = 0
112
-
while $LISTNEXT(mapTo, ptr, value) {
113
-
continue:(ns = value)
114
-
w " ", value
115
-
set status = ##Class(Config.MapPackages).Create(value, "WebTerminal", .Properties)
116
-
if ($$$ISERR(status)) { do $SYSTEM.Status.DisplayError(status) }
117
-
set status = ##Class(Config.MapGlobals).Create(value, "WebTerminal", .Properties)
118
-
if ($$$ISERR(status)) { do $SYSTEM.Status.DisplayError(status) }
101
+
102
+
write !, "Mapping %WebTerminal package into all namespaces:"
103
+
set st = ..Map(ns)
104
+
if ($$$ISERR(st)) {
105
+
do $System.Status.DisplayError(st)
106
+
} else {
107
+
write !, "WebTerminal package successfully mapped into all namespaces."
119
108
}
120
-
w ".", !, "Mapping complete."
121
-
w !, "WebTerminal package successfully mapped into all namespaces."
122
-
zn:ns'="%SYS" ns
123
-
quit $$$OK
109
+
110
+
quit st
124
111
]]></Implementation>
125
112
</Method>
126
113
@@ -131,34 +118,28 @@ This method is invoked when a class is 'uncompiled'.</Description>
0 commit comments