Suggest what?
- Log in to post comments
Suggest what?
What do you like or dislike about using Studio or Atelier today?
Like: Studio is fast. My REPL cycle is very short.
Dislike:
What external tools (source control, testing, etc.) do you wish you could integrate more tightly with InterSystems IRIS?
We should offer APIs, so any tool can be integrated.
Have you tried ObjectScript development with 3rd party VS Code extensions (Serenji or vscode-objectscript)?
I use VSCode extension. With direct server edit it's good. Subjectively slower that Studio but now it's comparable.
Like: The interface is way more modern. Crossplatform.
Dislike: XDatas are unformatted. Only one server connection. No BPL editor.
Do you expect to be writing code in a web-based editor five years from now?
Not really. Our IDEs don't take that much space. And REPL timings would go up.
The easiest way to do that is to create a separate table which refers to Unit Test as a property and set additional fields there.
%UnitTest.Result.* classes are marked as final.
What do you want to achieve?
Is it possible to add another test suite and use that?
For dropdowns I think the only option is to use Apache POI to generate XLSX. Here's Apache POI JGW wrapper and ObjectScript API but you'll need to extend it.
@Danny Wijnschenk linked the post with some discussion on different options, check it out.
How do you access terminal?
I don't think there is a way to do that.
If you check generated code for this procedure it would be something like this:
try {
new err, result
set result=##class(Test.Obj).MyProc()
return result
} catch err {
set SQLCODE=-149
set %msg="SQL Function TEST.OBJ_MYPROC failed with error: SQLCODE="_err.AsSQLCODE()_",%msg="_err.AsSQLMessage()
ztrap "SQER"
}Maybe @Dan Pasco knows?
You need to throw an exception. Sample proc:
Class Test.Obj
{
/// do ##class(Test.Obj).TestFunc().%Display()
Query Test() As %SQLQuery
{
SELECT Test.Obj_MyProc()
}
ClassMethod MyProc() As %String [ SqlProc ]
{
Set tSC = $$$ERROR($$$GeneralError, "MyMsg")
If $$$ISERR(tSC)
{
Throw ##class(%Exception.SQL).CreateFromSQLCODE(-400, $System.Status.GetErrorText(tSC))
Quit ""
}
Quit "OK"
}
}And after I call the procedure, this message is returned:
do ##class(Test.Obj).TestFunc().%Display()
Expression_1
[SQLCODE: <-149>:<SQL Function encountered an error>]
[%msg: <SQL Function TEST.OBJ_MYPROC failed with error: SQLCODE=-400,%msg=ERROR #5001: MyMsg>]
0 Rows(s) AffectedEither Enter or Ctrl-C would exit from the current loop. In your case Ctrl-C seems to work.
Do you need to get answers back?
Or is it more init and forgot kind of thing?
Try to call your API via Postman or a similar REST Client.
Set user/pass in a Basic Auth bloc of Postman request.
That would be if the property was defined as:
Property Test As list Of %String;But in this case it's %Collection.ListOfDataTypes and not %ListOfDataTypes, which can save strings of arbitrary length by default.
Property Test As %ListOfDataTypes;Simple test case:
Class Test.Col Extends %Persistent
{
Property Test As list Of %String;
Property Test2 As %ListOfDataTypes;
/// do ##class(Test.Col).Test()
ClassMethod Test(test2)
{
set p = ..%New()
set val = $tr($j("",100)," ", "a")
if test2 {
do p.Test2.Insert(val)
} else {
do p.Test.Insert(val)
}
set sc = p.%Save()
zw sc
}
}Show the relevant part of your XSD.
To connect you'll need a create a new Cache connection (as the driver seems to be installed) and specify these params:
Can you explain the issue you're having?
To determine contents of %request, %response and %session objects you can add this to the beginning of your code
set %response.ContentType = "html"
do ##class(%CSP.Utils).DisplayAllObjects()
quit $$$OK
It would return detailed information about the request as an html page.
You need to tell Springboot to fetch data in display mode or use %EXTERNAL function on column value. That's Java side.
Alternatively, on InterSystems side you can create a calculated property and access it in Java (replace !!! with full class name):
Property PetNameDisplay As %String [ SqlComputeCode = {##class(!!!).PetNameLogicalToDisplay(##class(!!!).PetNameGetStored({%%ID}))}, SqlComputed, SqlComputeOnChange = (%%INSERT, %%UPDATE) ];Remove SqlComputeOnChange and add Calculated if you want it always computed instead of trigger-computed and stored.
I agree with general approach offered by @Julius Kavay, just wanted to add some notes:
1. Use $zf(-100) as a more secure alternative to $zf(-1) if it's available.
2. I'd go straight for imagemagick as it's crossplatform.
3. If speed is an issue you can consider using high-level MagickWand API (here's resize example) or low-level MagickCore API (here's resize functions) via Callout functionality. CoreAPI would be faster as there's in-memory image initializers so you can skip input/output file creation/consumption and work with inmemory streams.
Enable ODBC log. What statement throws an error?
Are you using custom email adapter? I'm unable to find PutStream method in EnsLib.EMail.OutboundAdapter.
Is there any node.js used to fetch the data???
No, RESTForms is used to fetch the data. It's a REST API.
Is any bootstrap involved too to beautify it??
Probably.
The server part is explained in the linked articles. I can answer additional questions if ou have any.
For client part, @Sergei Sarkisian can weight in?
Show us %GSIZE report?
This code will output arbitrary query to CSV.
/// w $System.Status.GetErrorText(##class(!!!).ToCSV())
ClassMethod ToCSV(file = {##class(%File).NormalizeDirectory(##class(%SYS.System).TempDirectory())_ "out"}, query As %String = "SELECT 1,2,'a'", args...) As %Status
{
#dim sc As %Status = $$$OK
// Cant't do $zcvt($e(file,*-4,*), "l") as it can bring unexpected effect on case-sensitive fs
// Possible solution is to make file byref but it should be done in application code
set:$e(file,*-4,*)=".csv" file = $e(file, 1, *-4)
set dir = ##class(%File).GetDirectory(file)
set exists = ##class(%File).DirectoryExists(dir)
if (exists=$$$NO) {
set success = ##class(%File).CreateDirectoryChain(dir, .code)
set:success=$$$NO sc = $$$ERROR($$$GeneralError, "Unable to create directory: '" _ dir _ "', reason: " _ code)
}
quit:$$$ISERR(sc) sc
#dim rs As %SQL.StatementResult
set rs = ##class(%SQL.Statement).%ExecDirect(,query, args...)
if rs.%SQLCODE=0 {
do rs.%DisplayFormatted("CSV", file)
} else {
set sc = $$$ERROR($$$SQLError, rs.%SQLCODE, rs.%Message)
}
quit sc
}Show examples of the row variable. What condition do you want to check?