go to post Danny Wijnschenk · Oct 14, 2022 Caché/Iris normally use a port like 57772 which goes to the Apache web server that was installed together with Caché/Iris. This web server is best used only for internal usage. In your example the localhost url uses this to acess the service locally when you try that on the server itself.Because you cannot configure that Apache server for security, you have to use an external webserver where you can completely configure the access (together with the firewall).An external webserver like IIS or the full blown Apache usually uses 80 as the default public port. In your example you mention the port 80 in with http://52.24.106.151:80/Csp/Upload/CreateRoute/Bmc.So that's why i think there was an external webserver installed, and you will have to start there if you want to set access rights. (You can also use the firewall to limit any unwanted ip addresses)Another thing : this class is for receiving REST calls, if you want to send a POST from Cache/Iris, you would have to use the %HtppRequest class.
go to post Danny Wijnschenk · Oct 13, 2022 There should be a web application defined in your Caché/Iris server that calls the class MSDS.BluMicello.InterfaceServices (in the field REST Dispatch class).The web application is probably called /Csp/Upload and will define the first part of the url after the domain (/Csp/Upload). (In theory you could have more that one web application that handle each part of the url part). Your customer should use the complete url : e.g. POST http://52.24.106.151:80/Csp/Upload/CreateRoute/BmcDev This url will call your classmethod cmCreateRouteBmcDev The :80 in your url implies you are using a separate webserver that internally will connect to your Caché/Iris server.
go to post Danny Wijnschenk · Jul 22, 2022 The iristray (or any other IRIS utilities like CStudio, ConnectionGUI, util) should get the captions from the c:\InterSystems\IRIS\bin\<utility><language>.DLL. Where <language> should be UKR in your case (according to windows local settings). Is iristrayUKR.DLL missing in your installation ?(Close and re-start the systray after you changed/renamed the language dll to see the new language)
go to post Danny Wijnschenk · Jul 19, 2022 Since you don't always know what a classmethod is doing, the option of setting the Active again is not valid, and the %Reload is the only way to correct.But my point is : be carefull when you have open instances (that could have changed properties that are not saved yet), and using calls that do SQL operations, you can end up with unforseen results.
go to post Danny Wijnschenk · Jun 13, 2022 Be carefull : the second parameter of $zdateh is =1 for US format (mm/dd/yyyy), =4 for European format (dd/mm/yyyy) and =8 for yyyymmdd format.Luckily, $zdateh is smart enough to know your date is really US and not yyymmdd, but the correct answer is to use $zdateh(x,1) > $zdateh(y,1), and not 8 as second parameter : write $zdateh("05/01/2022",1) 66230 -> the internal date for may 1st 2022 write $zdateh("05/01/2022",4) 66114 -> the internal date for 5 january 2022 write $zdateh("05/01/2022",8) 66230 -> $zdateh expects yyyymmdd, assumes this is US format (but this is wrong if European format was intended)
go to post Danny Wijnschenk · May 26, 2022 Set Attribute Mode <ESC>[{attr1};...;{attrn}m Sets multiple display attribute settings. The following lists standard attributes: 0 Reset all attributes 1 Bright 2 Dim 4 Underscore 5 Blink 7 Reverse 8 Hidden Foreground Colours 30 Black 31 Red 32 Green 33 Yellow 34 Blue 35 Magenta 36 Cyan 37 White Background Colours 40 Black 41 Red 42 Green 43 Yellow 44 Blue 45 Magenta 46 Cyan 47 White
go to post Danny Wijnschenk · May 26, 2022 Hi Eduard, This works in Caché, i guess it should also work on Iris (vt100 escape codes) :
go to post Danny Wijnschenk · Mar 4, 2022 or try this : if sr.%SQLCODE=0 do sr.%DisplayFormatted(100,"/tmp/testfile")
go to post Danny Wijnschenk · Mar 4, 2022 Can you try this : ... set mysqlstat="select * from file.Log where ConfigName='hhhhhhhhhhh" set sr=##class(%SQL.Statement).%ExecDirect(,mysqlstat) if sr.%SQLCODE=0 { set file="/tmp/temp.txt" ;or any existing directory path + file name open file:"wns":1 Else Write "could not open file",! If $Test { use file do sr.%Display() close file } } halt EOM You should preferably put all the code between znspace... and halt in a routine or class method, and just call it from the script.
go to post Danny Wijnschenk · Mar 4, 2022 If you are using %SQL.Statement, there are other methods that directly output to files :(https://docs.intersystems.com/iris20212/csp/documatic/%25CSP.Documatic.c...) method %Display(pDelimiter As %String = $Char(9)) Display the contents of this object on the current device • method %DisplayFormatted(pFormat As %String = -1, pFileName As %String(MAXLEN="")="", ByRef pMessages As %SQL.Manager.Messages = "", ByRef pFilesUsed As %String(MAXLEN="")=0, pTranslateTable As %String(MAXLEN="")="") Display the contents of the result object. If formatted display is available then format the results using the requested format and, if appropriate, open the formatted results using the host OS. The output is directed to one or more files and messages are placed in a result set object. All file names used are returned in an array. Parameters Name Description pFormat The format applied to the result content. This parameter is also used to determine the file name extension. Supported formats are: -1 %Display() format 0 XML 1 HTML 2 PDF (requires a renderer such as FOP) 99 TXT 100 CSV If pFormat is specified as any number not listed above then it will default to TXT. pFormat can also be specified as XML, HTML, PDF, TXT or CSV. pFileName The base file name to be used to generate actual file names used for output. If no value is specified then a file name will be generated, using the TEMP folder defined for the Cache instance. This value is not expected to include an extension. An extension is added to this value to form the actual file used. Also, if nested results exist then a number is appended to the file name specified to produce a unique name for each result. pMessages Instance of a system result set class. If no value is passed then the system message result class is instantiated. This parameter is passed by reference. It is up to the caller to process the result set oref that is returned. pMessages.Count() returns the number of messages contained in the result set. pMessages.%Display() will display the messages on the current device. pMessages.%DisplayFormatted() is also implemented and can be used to display the messages using the selected format. pFilesUsed This pass-by-reference parameter will contain the number of files used to display the result content and the name of each file. pFilesUsed is the number of files and pFilesUsed(file_number) is the name of the file. The sequence of the files is the same sequence as the results are processed. For simple result objects, there is a single file. For context objects that can contain result set sequences, the results are output in the order they are returned and the files used are present in pFilesUsed in that same order. pTranslateTable This is the translate table used for the output files when the format is CSV or TXT. This parameter is optional.
go to post Danny Wijnschenk · Mar 4, 2022 Hi Jonathan : old-school script is easiest : Set file = "/usr/tmp/somefilename" Open file:"WNS":1 Else Write "Could not open file",! Quit Use file ;;do your normal output statements Close file Nowadays, you can also use %File : Set file=##class(%File).%New("file.txt") Write file.Size Do file.Open("WSN") Do file.WriteLine("This is a line of text")
go to post Danny Wijnschenk · Mar 4, 2022 You can create a unix script like this : NAMESPACE='DEMO' irissession SERVER <<EOM znspace "${NAMESPACE}" Do ^RoutineWithSQL Halt EOM Where ^RoutineWithSQL will do all the stuff to produce the SQL results (using %ResultSet, or %SQL.Statement, ...).You can choose to capture the output in unix, or better, let the routine create a file and output the results to the file.
go to post Danny Wijnschenk · Feb 9, 2022 Can you show the class definition ? If you use standard string properties, it could be longer than the default maximum length (50).
go to post Danny Wijnschenk · Feb 7, 2022 Marco, you can enable Audit, enable LoginFailure warning, and look in the Audit messages for more info on the LoginFailures.
go to post Danny Wijnschenk · Feb 3, 2022 There are also other ways code can use globals :- routines that are stored in other namespaces- code in globals (yes, i admit very unlikely but possible) - indirection (also unlikely but possible)If journaling is enabled, you could also look in the journal file via management portal, and search for the global to see when it is used.
go to post Danny Wijnschenk · Feb 1, 2022 You can also start Caché in Emergency mode : https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY...