One Liners - Useful ObjectScript Commands One Line Long
Folks!
Recently I found several one-line long ObjectScript commands on DC and think that it'd be great not to lose it and to collect more!
So I decided to gather a few first cases, put in one OEX project, and share them with you!
And here is how you can use them.
1. Create client SSL configuration.
set $namespace="%SYS", name="DefaultSSL" do:'##class(Security.SSLConfigs).Exists(name) ##class(Security.SSLConfigs).Create(name)
Useful if you need to read content from an URL.
Don't forget to return to a previous namespace. Or add
n $namespace
before the call. Once you go up in the stack the namespace will be switched to your current namespace automatically.
2. Install ZPM
set $namespace="%SYS" do ##class(Security.SSLConfigs).Create("ssl") set r=##class(%Net.HttpRequest).%New(),r.Server="pm.community.intersystems.com",r.SSLConfiguration="ssl" do r.Get("/packages/zpm/latest/installer"),$system.OBJ.LoadStream(r.HttpResponse.Data,"c")
Useful, if you don't have ZPM in your IRIS and can install with this one call in the terminal.
Courtesy of @Guillaume Rongier and @Sergei Shutov and @Sergey Mikhailenko
3. Create %All Namespace:
set $namespace="%SYS",P("Globals")="%DEFAULTDB",sc=##class(Config.Namespaces).Create("%All",.P)
Courtesy of @Eduard Lebedyuk and @Alexey Maslov
4. Enable IRIS BI in a current namespace:
do EnableDeepSee^%SYS.cspServer("/csp/"_$$$LOWER($namespace))
Courtesy of @Benjamin De Boe
Please add your useful lines :) Collaboration is very welcome!