Hi Mark.

I don't know where "undefined" word comes from on the trace, but when %XML.Reader reads empty element it reads it as character with code 0 -- $char(0), that corresponds to empty string in SQL:

Class Community.Test Extends (%RegisteredObject, %XML.Adaptor)
{

Property StatusLastChecked As %String(XMLPROJECTION = "element");

ClassMethod test()
{
        set xml = "<root><Test><StatusLastChecked></StatusLastChecked></Test></root>"
        set reader = ##class(%XML.Reader).%New()
        do reader.OpenString(xml)
        do reader.Correlate("Test","Community.Test")
        do reader.Next(.obj)
        zw obj
}

}

USER>do ##class(Community.Test).test()
obj=3@Community.Test  ; <OREF>
+----------------- general information ---------------
|      oref value: 3
|      class name: Community.Test
| reference count: 2
+----------------- attribute values ------------------
|  StatusLastChecked = $c(0)
+-----------------------------------------------------

So in your code you can compare with $C(0).

Also for details on handling empty strings, see following section in documentation:

Handling Empty Strings and Null Values

Hi David.

Source code for EnsLib.FTP.InboundAdapter is available in the installation.

EnsLib.FTP.InboundAdapter calls method %Net.FtpSession:List to get files. And that method uses "LIST" command.

EnsLib.FTP.InboundAdapter:OnTask executes following resultSet to get files:

Set tSC=..%CurrResultSet.Execute($this,..FilePath,..FileSpec,..SubdirectoryLevels,$S(..%isSFTP:"FileListSSH",1:"FileList"),..SemaphoreSpec)  Quit:$$$ISERR(tSC)

And in OnInit, ..%CurrResultSet is initialized as follows:

Set ..%CurrResultSet=##class(%ResultSet).%New($$$CurrentClass_":DeepList")

Query DeepList is defined in EnsLib.File.Common, and it's just a proxy for the query that is passed as 5th parameter to the Execute -- FileList in this case.

And EnsLib.FTP.Common:FileList calls %Net.FtpSession:List.

What Caché version do you have?

On my 2018.1.3 instance code is following:

// Look for pattern : version "1.8.0.1
// where the double quote may optionally be replaced with a single quote or ommitted
Set regex = "version\s['""]?(\d+(\.\d+)+)"
Set pos = $Locate(pOutput,regex,1,,versionWithPrefix)

// Get just the number from the previous pattern : 1.8.0.1
Set regex = "(\d+(\.\d+)+)"
Set pos = $Locate($Get(versionWithPrefix),regex,1,,version)

Notice -- $Get around versionWithPrefix.

Most likely Caché cannot find java home dir. Specify Java Home Directory in JDBC Gateway Server settings.

Hi Rubens.

Works fine for me on IRIS 2020.1 with rusw locale, see below.

Perhaps you can try to export directly to file, instead of using stream.

USER>!type ..\..\csp\user\test.json

{
"a":"русский текст"
}
USER>set stream=##class(%Stream.FileCharacter).%New()   

USER>set stream.Filename = "c:\temp\qq.xml"                                      

USER>do $System.OBJ.ExportToStream("/csp/user/test.json", .stream,,,"UTF8")      
Exporting to XML started on 04/16/2020 12:13:33
Exporting CSP/CSR or file: /csp/user/test.json
Export finished successfully.

USER>w stream.%Save()
1

USER>!type c:\temp\qq.xml

<?xml version="1.0" encoding="UTF8"?>
<Export generator="IRIS" version="26" zv="IRIS for Windows (x86-64) 2020.1 (Build 215U)" ts="2020-04-16 12:13:33">
<CSP name="test.json" application="/csp/user/" default="1"><![CDATA[
{
"a":"русский текст"
}]]></CSP>
</Export>

There are two preferred ways to limit facts that go into cube.

A) Build restriction option in cube. Change of build restriction requires recompilation of cube. Though you can call stored procedure there.
B) %OnProcessFact callback in the cube class.

For details please see "Restricting the Records Used in the Cube" in the documentation [1]

Disadvantage of using data connectors is that cube synchronization is not possible for cubes based on them: [2].

[1] https://docs.intersystems.com/iris20201/csp/docbook/Doc.View.cls?KEY=D2M...

[2] https://docs.intersystems.com/iris20201/csp/docbook/Doc.View.cls?KEY=D2I...

%XML.TextReader traverses XML nodes. Each node can have different type. NACS is node of type Element. It does not have any value. Node 111111 is of type Chars. However it does not have any name. Thus the output that you see.

Hint: change line in your code as follows to see types of nodes :

set practices = practices_textreader.Name_"("_textreader.NodeType_"):"

Take a look here for data model of XML: https://www.w3.org/XML/Datamodel.html

See also class reference for %XML.TextReader. Particularly for Value property. It explains what this property holds depending on type of node.

Hi Laura.

First question -- what algorithm does openssl_public_encrypt use?

PHP reference [1] and source code [2] says that this is RSA.

So in Ensemble you can use $system.Encryption.RSAEncrypt() [3]

Important thing to note about RSA encryption, is that length of the plaintext can not be greater than the length of the modulus of the RSA public key contained in the certificate minus 42 bytes.

[1] https://www.php.net/manual/en/function.openssl-public-encrypt.php
[2] https://github.com/php/php-src/blob/master/ext/openssl/openssl.c#L5549
[3] https://cedocs.intersystems.com/latest/csp/documatic/%25CSP.Documatic.cl...