go to post Lorenzo Scalese · Nov 24, 2020 It's useless on your local dev, but depending your goal : You can try to dump zzDumpDoc(pkg, targetDir="c:\dev\testdumpdoc\") new (pkg, targetDir) Do:'##class(%File).DirectoryExists(targetDir) ##class(%File).CreateDirectoryChain(targetDir) Set pkgDot = pkg _ ".", class = pkgDot, restore = 0 If $Isobject($Get(%request)) { Set oldRequest = %request Set oldResponse = %response Set oldSession = %session Set restore = 1 } Set %request = ##class(%CSP.Request).%New() Set %response = ##class(%CSP.Response).%New() Set %session = ##class(%CSP.Session).%New("0123456789") Do %session.Unlock() Set %request.Data("PAGE",1) = "CLASS" For { Set class = $Order(^oddDEF(class)) Quit:$e(class,1,$l(pkgDot))'=pkgDot Set %request.Data("LIBRARY",1) = $namespace Set %request.Data("CLASSNAME",1) = class Set initialIO = $IO Set file = targetDir_class_".html" OPEN file:("NRW"):2 USE file Do ##class(%CSP.Documatic.PrintClass).OnPage() USE initialIO CLOSE file } If restore { Set %request = oldRequest Set %response = oldResponse Set %session = oldSession } quit There exits more elegant way to redirect the output (check the community).
go to post Lorenzo Scalese · Nov 17, 2020 Hi @Botai Zhang Take a look to this post : https://community.intersystems.com/post/running-management-portal-privat...
go to post Lorenzo Scalese · Mar 22, 2020 Hello @Evgeny Shvarov , I tested the following code in an Iris terminal to add %DB_%DEFAULT role, It seems to work : Write !,"Current user roles : ",$Roles Zn "%SYS" Set tSc = ##class(Security.Applications).Get("/csp/user",.p) Write !,"Get application : ",$SYSTEM.Status.GetOneErrorText(tSc) Set p("MatchRoles")=p("MatchRoles")_":%DB_%DEFAULT" Set tSc = ##class(Security.Applications).Modify("/csp/user",.p) Write !,"Modify application : ",$SYSTEM.Status.GetOneErrorText(tSc) Kill p
go to post Lorenzo Scalese · Mar 11, 2020 Hello @Dmitry Maslennikov , I've modified a 'legacy method' in order to implement a timeout. May be the following code could help you : /// Run a command line<BR/> /// Echos of command are stored in result argument <br/> /// Return 0 if a timeout occurs. ClassMethod runCmdWithTimeout( command As %String, ByRef result As %Binary, timeout As %Integer) As %Boolean { s end = $zh+timeout, timeout = 0 s a=$zu(69,40) n $et s $et="s a=$zu(68,40,"_a_")" o command:"qr" s a=$zu(68,40,1) u command f i=1:1 r line:1 s:line'="" result(i)=line s:$zh>end timeout=1 q:$zeof||timeout c command x $et q 'timeout }
go to post Lorenzo Scalese · Aug 23, 2019 Hello @Rodolfo Moreira,For retrieve the task ID, I wrote this : ClassMethod getTaskId( ByRef sc As %Status = {$$$OK}, className As %String = {..%ClassName(1)}) As %String { Set id = "" Set rs = ##class(%Library.ResultSet).%New("%SYS.Task:TaskListDetail") Set sc = rs.Execute() Quit:$$$ISERR(sc) "" While (rs.Next(.sc)) { Quit:$$$ISERR(sc) if (rs.Get("TaskClass")=className){ Set id = rs.Get("ID") Quit } } Quit id } Hope this help you. Regards. Edit : modify this code for your needs (ex : return a list of Id, namespace filter...)
go to post Lorenzo Scalese · May 18, 2019 Hello Eduard,For debug purpose , you can try this : Set obj = {Your test.ABC instance} Set res = ##class(%Studio.General).DumpObjectFunc(obj) While res.%Next() { Write !,"Property : ",res.%Get("Name"), !," Value : ",res.%Get("Value") } Or just perform a zw obj Regards. Lorenzo. EDIT : I tested with ##class(%Studio.General).DumpObjectFunc(obj). We can get value if "myProp" is not an object.
go to post Lorenzo Scalese · Mar 22, 2019 Hello,We are using this procedure in order to reduce the dowtime during software update. In short :Create a temp namespace. import and compile code.stopping application.switch DB code on target namespace.Execute a script for data update (if needed).starting application.It work fine for Caché.Coming soon, we will do that for production with HealthShare Health connect.It should be work fine also for a production, but I don't done a test yet.If you have a translate file, don't forget import your traductions because ^CacheMsg and ^CacheMsgNames are in CODE database.Regards.
go to post Lorenzo Scalese · Mar 9, 2019 Hello,I think, you should simply append your own error message like that : Set obj = ##class(User.tApplications).%OpenId(YourTApplicationId,"4",.errors) Set:$$$ISERR(errors) errors = $$$ADDSC(errors,$$$ERROR($$$GeneralError,$$$FormatText("%OpenId failed for User.tApplications with id %1",YourTApplicationId))) If an error occurs, variable "errors" will contain 2 errors. NS>d $System.Status.DecomposeStatus(error,.b) NS>zw b Your error is in the subscript b(2). Add #include %occStatus if you are in a routine (for macro usage). Regards.