Eduard Lebedyuk · Nov 25, 2021 go to post

I'm not really sure what is it that you want (please consider providing more information), but this project can be used to both read and write excel files.

Eduard Lebedyuk · Nov 24, 2021 go to post

Try it like this:

Class User.ResultsMessage Extends (%Persistent, %XML.Adaptor)
{

Property PersonIDs As list Of %String(XMLITEMNAME = "PersonID", XMLNAME = "PersonIDs", XMLPROJECTION = "WRAPPED");

XData Data
{
<Results>
  <PersonIDs>
    <PersonID>1000000</PersonID>
    <PersonID>1000001</PersonID>
    <PersonID>1000005</PersonID>
  </PersonIDs> 
</Results>
}

/// do ##class(User.ResultsMessage).Test()
ClassMethod Test()
{
	Set text = ##class(%Dictionary.XDataDefinition).IDKEYOpen($classname(), "Data").Data
	Set reader = ##class(%XML.Reader).%New()
	Set sc=reader.OpenStream(text)

	Do reader.Correlate("Results","User.ResultsMessage") 
	While reader.Next(.msg,.sc) {
		Write !,"Count(): "_msg.PersonIDs.Count(),!
	}
	Write:$$$ISERR(sc) $System.Status.GetErrorText(sc)
}
}

Docs.

Eduard Lebedyuk · Nov 14, 2021 go to post

You can use this syntax on calculated properties:

/// This property holds the document state. Serialization is JSON. 
Property JSON As %Library.DynamicAbstractObject;

/// This is an automatically calculated property "$.firstName"
Property firstName As %VarString [ SqlComputeCode = { set {*}=$$%EvaluatePathOne^%DocDB.Document({JSON},"$.firstName")}, SqlComputed, SqlComputeOnChange = %Doc ];

/// Index on firstName property
Index firstName On firstName;
Eduard Lebedyuk · Nov 11, 2021 go to post

Well, enjoy.

UPD: it was missing isc.util.dbf.Field.

Class isc.util.DBF.Field Extends %SerialObject [ ClassType = serial, ProcedureBlock ]
{

Property name As %String(TRUNCATE = 1);

Property type As %String(TRUNCATE = 1);

Property length As %Integer;

Property decimals As %Integer;

}
Eduard Lebedyuk · Nov 11, 2021 go to post

Are there really no other options (CSV, JSON, XML)?

I have some code for a DBF reader, if you're interested I can share it and you can create a DBF writer by analogue.

Eduard Lebedyuk · Nov 10, 2021 go to post

Check out my series of articles: Debugging Web.

Add this code to see call parameters:

set %response.ContentType = "html"
do ##class(%CSP.Utils).DisplayAllObjects()
return $$$OK
Eduard Lebedyuk · Nov 10, 2021 go to post

Like this:

Class ... Extends %CSP.REST
{

XData UrlMap [ XMLNamespace = "http://www.intersystems.com/urlmap" ]
{
<routes>
<route call="logout" method="GET" url="/logout">
</routes>
}

/// Logout user from current session
ClassMethod logout() As %Status
{
    #dim %session As %CSP.Session
    set sc = %session.Logout(1)
    set %session.EndSession = 1
    return sc
}
}
Eduard Lebedyuk · Nov 10, 2021 go to post

1. Implement %iFind.Transformation.Abstract interface with the custom transformation that would remove all property names (I assume you know property names beforehand).

After that set TRANSFORMATIONSPEC index parameter to your transformation implementation.

2. Maybe User Dictionaries could also be used.

3. Are you sure you need analytic queries? Simpler iFind indices (Minimal, Basic) can be advantageous in some situations.

Calling @Benjamin De Boe 
 

Eduard Lebedyuk · Nov 3, 2021 go to post

Install Docker inside WSL2  (not DD on Windows).

Alternatively you can just install IRIS in WSL2.

Eduard Lebedyuk · Nov 1, 2021 go to post

You can also use this call to expand database non-interactively (size is in mb):

set $namespace = "%SYS"
set sc = ##class(SYS.Database).ModifyDatabase("/path/to/db/folder", size)

It's useful for benchmarks and such.

Eduard Lebedyuk · Oct 27, 2021 go to post

I just like to add that SQL Gateway is an abstraction over both JDBC and ODBC connections.

Eduard Lebedyuk · Oct 23, 2021 go to post

I believe so, but it depends on how large the session is that you have in mind
 

Interoperability Visual Trace starts slowing down on sessions above 100 000 messages, and considerably slows down on 300  000 messages per session.

I'm interested in a tool that would allow me to see these large sessions graphically, currently I work with them via SQL.

Eduard Lebedyuk · Oct 18, 2021 go to post

You can't bypass the challenge.
Neither by $classmetho() nor any code generator as this is all static code frozen and inflexible a runtime.  

Why?

A case where user must be able to:

  • create a code snippet with a predetermined interface
  • choose it for execution among all the code snippets with the same interface

Can be solved in many ways, without indirection (aka executing code stored as a string).

I usually provide a base class, which a user must extend and populate with his own methods. After that in the source app, just call SubclassOf Query from %Dictionary.ClassDefinition to get all implementation and show them to a user to pick from.

Works good enough.

Eduard Lebedyuk · Oct 18, 2021 go to post

Might as well invoke the method directly:

<Invoke Class="%Library.EnsembleMgr" Method="SetAutoStart" CheckStatus="true" >
  <Arg Value="${MyNamespace}" />
  <Arg Value="myProd.Production" />
</Invoke>

Or is there a reason to use a proxy method?