go to post Danny Wijnschenk · Jan 31, 2022 Hi Kevin, Try 'Do ^%RFIND' to find out in what code these globals are referenced.
go to post Danny Wijnschenk · Jan 18, 2022 Ok, this is a test i wrote to add some basic source control (auto save of class and manually exporting the current project). It shows how you can add 2 menu items.Don't forget to activate the source control class for a namespace in the portal (admin-config-additional settings-source control) Class Studio.Extension Extends %Studio.Extension.Base{ XData Menu{<MenuBase><Menu Name="GIT" Type="0"><MenuItem Name="Directory Setting"/><MenuItem Name="Export Current Project"/></Menu></MenuBase>} /// Perform any login step here.Method Login(Name As %String, Password As %String) As %Status{Write "==============================================================================================",!Write "= Welcome ",$Get(Name),", this namespace is under source control by class Studio.Extension",!Write "= Source files are saved in ",$Get(^SourceControl(0,$UserName,"GIT_Dir")),!Write "==============================================================================================",!Set ^SourceControl($J,"currentProject")=""Quit $$$OK} Method UserAction(Type As %Integer, Name As %String, InternalName As %String, SelectedText As %String, ByRef Action As %String, ByRef Target As %String, ByRef Msg As %String, ByRef Reload As %Boolean) As %Status{If $Piece($Get(InternalName),".",*)="PRJ" {Set ^SourceControl($J,"currentProject")=$Piece(InternalName,".",1,*-1)};Write "StudioExtension: Loading ",$Get(InternalName)," (",$Get(Type),"-",$Get(Name),"), current project is ",$Get(^sourcecontrol($J,"currentProject")),!If Type=0 Do ..ExecuteMenu(Name, .Action, .Target, .Msg)Quit $$$OK} Method ExecuteMenu(Name As %String, ByRef Action As %String, ByRef Target As %String, ByRef Msg As %String){If Name="GIT,Directory Setting" {Set Target="Directory for GIT source control"Set Msg=$Get(^SourceControl(0,$UserName,"GIT_Dir"))Set Action=7} ElseIf Name="GIT,Export Current Project" {Set Target="Export Current Project"Set Msg=$Get(^SourceControl($J,"currentProject"))Set Action=7}} Method AfterUserAction(Type As %Integer, Name As %String, InternalName As %String, Answer As %Integer, Msg As %String = "", ByRef Reload As %Boolean) As %Status{#Dim project, dir as %String ;Write Type,Name,InternalName," : ";Write "You answered ",$Get(Answer) ;1=yes, 0=no, 2=cancel;Write "with message ",$Get(Msg),!If Answer=1,Type=0 {If Name="GIT,Export Current Project" {Set project = MsgSet objProject = ##class(%Studio.Project).%OpenId(project)If objProject'="" {Set dir = $Get(^SourceControl(0,$UserName,"GIT_Dir"))If dir="" {Write !,"StudioExtension: Please set GIT directory first"} else {If $E(dir,*)'="\" Set dir=dir_"\"Do objProject.Export(dir_project_$ZDate($H,8)_".xml")}} else {Write !,"StudioExtension: Project does not exist !"}Set objProject = ""} ElseIf Name="GIT,Directory Setting" {Set ^SourceControl(0,$UserName,"GIT_Dir") = MsgWrite !,"StudioExtension: GIT Directory Saved"}} Quit $$$OK} /// Called after the compile of the item is done.Method OnAfterCompile(InternalName As %String) As %Status{#Dim dir, separator, items, extension, fullFileName as %String Set dir = $Get(^SourceControl(0,$UserName,"GIT_Dir"))If dir="" {Write !,"StudioExtension: ","No directory setup to save source code"} else {Set separator = $Select($ZV["Windows":"\",1:"/")If dir'="", $E(dir,*)'=separator Set dir=dir_separatorSet extension=$Piece(InternalName,".",*)Set dir=dir_extension_separatorSet fullFileName=dir_$Replace($Piece(InternalName,".",1,*-1),".",separator)_".xml"Do ##class(%File).CreateDirectoryChain($Piece(fullFileName,separator,1,*-1)) If 0 { ;do not export as .xml file for Git :Set items(InternalName)=""Do $system.OBJ.Export(.items,fullFileName)Write !,"StudioExtension: ",InternalName_" saved as "_fullFileName} If $Piece(InternalName,".",*)="CLS" {Set $Piece(fullFileName,".",*) = "cls"If $system.OBJ.ExportUDL(InternalName,$Replace(fullFileName,".xml",".cls")) {Write !,"StudioExtension: ",$Piece(InternalName,".",1,*-1)," saved as ",fullFileName} else {Write !,"StudioExtension: ","Error while saving "_$Piece(InternalName,".",1,*-1)," as ",fullFileName}}}Quit $$$OK} }
go to post Danny Wijnschenk · Jan 18, 2022 I wrote a class to extend %Studio.Extension.Base, i don't see any other way to add items in Studio.If you want, i can post a skeleton class where you can start with.
go to post Danny Wijnschenk · Jan 7, 2022 Hi Matthew,This should not add a lot of extra trafic - especially if you only enable the events you need to monitor (e.g. only enable login failure).
go to post Danny Wijnschenk · Jan 7, 2022 Since the server version is Iris, it is better to use the latest ODBC driver from Iris ...
go to post Danny Wijnschenk · Jan 6, 2022 Hi Matthew,Can you enable auditing, enable the system event 'login failure' and check for login failures in the audit database ?Do you have enough license available?
go to post Danny Wijnschenk · Dec 23, 2021 If property altura would be of type %Integer, you could use parameter d :d - output Caché numeric properties that have value "" as null SET tSC = ##Class(%ZEN.Auxiliary.jsonProvider).%WriteJSONStreamFromObject(.tSteamJson,pObj,,,,"de") As string, i don't see any parameters in %WriteJSONStreamFromObject that would return null in stead of "". Personally, I am setting the json myself to have total control of JSON output like set obj = ##class(...).%OpenId(...)Set json = {"property1" : (obj.Property1), ... }If obj.Altura="" Do json.%Set("Altura","","null");;%Set allows to set the correct datatype like numeric, boolean,string or force nullWrite json.%ToJSON()
go to post Danny Wijnschenk · Sep 25, 2021 Hi Muhammad, Remove the 'Extends %Net.HttpRequest' : it is not needed to inherit from this class. Since the method Get is already defined in that class, it gives a compiler error when you overwrite a class with a different signature (classmethod).
go to post Danny Wijnschenk · Sep 24, 2021 And if you just want a function to return hijri dates, you van try following build-in $zdate function : Write $zdate($zdateh("2021-09-24",3),19),! 16 2 1443 You can also try ,18 which gives 16 Safar 1443
go to post Danny Wijnschenk · Sep 24, 2021 Hi Muhammad, Create following class : Class Test.Json { ClassMethod Get(date = "24-09-2021", debug = 0) As %String { #Dim status as %Status #Dim response as %Stream #Dim jsonResponse as %DynamicObject Set objHttp = ##class(%Net.HttpRequest).%New() Set objHttp.Server="api.aladhan.com" Set objHttp.Https=0 Do objHttp.SetParam("date",date) Set status = objHttp.Send("GET","v1/gToH") If status'=1 Do $SYSTEM.OBJ.DisplayError(status) Quit "" If objHttp.HttpResponse'="" Do Set response = objHttp.HttpResponse.Data Set jsonResponse = ..GetResponse(response) If debug Write jsonResponse.data.hijri.%ToJSON(),! Return jsonResponse.data.hijri.date } ClassMethod GetResponse(response As %Stream, del As %String = "") As %DynamicObject { #Dim jsonStr as %String = "" If response'="" { Do response.Rewind() While 'response.AtEnd { Set jsonStr = jsonStr _ response.ReadLine() _ del } } Quit {}.%FromJSON(jsonStr) } } and call it like : USER>set hijri=##class(Test.Json).Get() USER>write hijri 16-02-1443 USER>set hijri=##class(Test.Json).Get(,1) {"date":"16-02-1443","format":"DD-MM-YYYY","day":"16","weekday":{"en":"Al Juma'a","ar":"الجمعة"},"month":{"number":2,"en":"Ṣafar","ar":"صَفَر"},"year":"1443","designation":{"abbreviated":"AH","expanded":"Anno Hegirae"},"holidays":[]} USER>Write ##class(Test.Json).Get("01-08-2021") 22-12-1442 USER>
go to post Danny Wijnschenk · Sep 24, 2021 Hi Kevin, the variable statStr should be known inside your loop, e.g. following routine works fine in SAMPLES : test ; set statStr = "aa|bb|.." set sqlStatement = "Select * From Cinema.Film" set tState = ##class(%SQL.Statement).%New() set qStat = tState.%Prepare(sqlStatement) set rset = tState.%Execute() WHILE rset.%Next() { Write rset.%GetData(1), " ",$Piece(statStr,"|",1),! } Quit
go to post Danny Wijnschenk · Sep 19, 2021 Hi Brandon, There are some limitiation to the free Iris license : Total data: 10 GB Connections: 5 Cores: 8 More details on https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls...
go to post Danny Wijnschenk · Sep 13, 2021 Can you show the class definition ? Maybe it is better to try to find out why your iFilter is not taken as the best option for this query.
go to post Danny Wijnschenk · Sep 5, 2021 Hi Lutz, You have to assign your new %DB_Database1 & 2 resources to database1 & 2 (via System Admin -> Configuration->local databases-> click on database1 & 2 and change Resource Name to %DB_Database1 & 2
go to post Danny Wijnschenk · Aug 12, 2021 Can you try again with the slash (since it is windows, you have to use the slash) :iris start irishealth /EmergencyId=user,password
go to post Danny Wijnschenk · Aug 12, 2021 Can you show the output of 'iris all' ? Which is your OS ?
go to post Danny Wijnschenk · Aug 12, 2021 You have to include a slash before EmergencyId : iris start iris /EmergencyId=userA,pwB Also, make sure that 'iris' is indeed your instance name (use 'iris all' to show all instances)
go to post Danny Wijnschenk · Aug 10, 2021 Several companies in Belgium as well : https://www.datam.be/producten.html https://www.asci.be/customer-relationship-management/