Eduard Lebedyuk · Dec 2, 2019 go to post

That's for Docker. GCP, while it uses containers, has a setup where all container's ports could possibly be available, but firewall prevents all access except specified firewall allow rules.

Adding firewall access, as specified by @Dmitry Maslennikov should help.

Eduard Lebedyuk · Dec 2, 2019 go to post

You can use any ODBC/JDBC database management software. I use DataGrip. It has code completion for table/field names and standard SQL syntax.

Here's my URL template

jdbc:Cache://{host}[:{port}]/{database}

Eduard Lebedyuk · Dec 2, 2019 go to post

First of all I encourage you to update to 2016.2 or a later version, because JSON syntax differs considerably on 2016.1. Since 2016.2 we have a syntax-stable JSON API.

Anyway, on 2016.1 you can do this:

write obj.$toJSON()
Eduard Lebedyuk · Nov 29, 2019 go to post

Note that instead of:

do ##class(isc.py.util.Shell).Shell()

Python Shell can be entered by simply typing

zpy

In there you can just directly type python code:

exec(open('disk:/path/to/your/folder/testfile.py').read())

Or don't open the shell and call:

set sc=##class(isc.py.Main).SimpleString("exec(open('disk:/path/to/your/folder/testfile.py').read())",,,.sc)
Eduard Lebedyuk · Nov 29, 2019 go to post
set enMsg = "hello"
set esMsg = "hola"
set obj = {"language1":(enMsg),"language2":(esMsg)}
write obj.%ToJSON()

Outputs:

{"language1":"hello","language2":"hola"}
Eduard Lebedyuk · Nov 29, 2019 go to post

This should work for Python Gateway:

set filename = "/path/to/code.py"
set file = ##class(%Stream.FileCharacter).%New()
set sc = file.LinkToFile(filename)
set sc = ##class(isc.py.Main).ExecuteCode(file)
Eduard Lebedyuk · Nov 28, 2019 go to post

1. Underscored properties are extracted. Get them by quoting property name (case is important too):

set centro.codCias = objeto.GetAt(i)."cod_cias"

2. You don't need to init json provider as you're calling a classmethod, replace:

set claseAux = ##class(%ZEN.Auxiliary.jsonProvider).%New()
set tSC= claseAux.%ConvertJSONToObject(.linea,"EsquemasDatos.miSCS.GestionFavoritos.tns.infoCentro",.objeto,1)

with:

set tSC= ##class(%ZEN.Auxiliary.jsonProvider).%ConvertJSONToObject(.linea,"EsquemasDatos.miSCS.GestionFavoritos.tns.infoCentro",.objeto,1)

or even better:


set class = ##class(EsquemasDatos.miSCS.GestionFavoritos.tns.infoCentro).%ClassName(1)
set tSC= ##class(%ZEN.Auxiliary.jsonProvider).%ConvertJSONToObject(.linea,class,.objeto,1)

3. Iterators for JSON. Recommended approach is upgrading to 2016.2+ as  it contains way better json handling (dynamic objects) with iterators.

For %ZEN.proxy object you can call %CopyToArray and iterate over it.

set tSC = ##class(%ZEN.Auxiliary.jsonProvider).%ConvertJSONToObject("{""prop_a"":1,""prop_b"":2}",,.obj)
do obj.%CopyToArray(.array)
for {
    set key=$order(array(key),1,val)
    quit:key=""
    write key," = ",val,!
}

4. Iterators for classes. Use a method generator to write the code iterating over properties. Relevant discussion.

Eduard Lebedyuk · Nov 28, 2019 go to post

Call this sqlproc passing class and prop names:

ClassMethod Params(class, prop) As %String [SQLProc]
{
    set result = ""
    set param = ""
    for {
        set param = $$$defparamMemberNext(class,$$$cCLASSproperty,prop,$$$cPROPparameter,param)
        quit:(param ="")
        set value = $$$defMemberArrayGet(class,$$$cCLASSproperty,prop,$$$cPROPparameter,param)
        set result = result _ param _ "=" _ value _ ","
    }
    quit result
}
Eduard Lebedyuk · Nov 28, 2019 go to post

Property parameters stored as an array of strings.

Since parameters are N:1 to property, your theoretical query isn't possible due to cardinality mismatch.

What do you want to get?

Eduard Lebedyuk · Nov 27, 2019 go to post

You need two task objects one of %SYS.Task class and another of your concrete implementation class. Call AssignSettings
 to merge settings. Example:

Set tTaskDefClass = "User.Task.MessageArchive"

Set tTaskObj = ##class(%SYS.Task).%New()
Set tTaskObj.NameSpace = "<NameSpace>"
Set tTaskObj.Name = "<tTaskName>"
Set tTaskObj.TaskClass = tTaskDefClass
Set tTaskObj.Description = "<tTaskDesc>"

Set tTaskDefObj = $System.OBJ.New(tTaskDefClass)
Set tTaskDefObj.BaseDir = "your value"
Set tStatus = tTaskObj.AssignSettings(tTaskDefObj)
Quit:$$$ISERR(tStatus) tStatus
Kill tTaskDefObj

Set tStatus = tTaskObj.%Save()
Eduard Lebedyuk · Nov 23, 2019 go to post

I'm not really sure why do you want to have a cube with 0 facts? Can you elaborate why you need this?

But yes, clearing the datasource and rebuilding would get you cube with 0 rows.

Eduard Lebedyuk · Nov 23, 2019 go to post

Cube rebuild clears all old data. This is enough:

Do ##class(%DeepSee.Utils).%BuildCube("MyCube.Cube")
Eduard Lebedyuk · Nov 22, 2019 go to post

Can any Target Object be non-IRIS base?

Absolutely. The services you offer via IAM can be sourced anywhere. Both from InterSystems IRIS and not.

How can IAM help with non-IRIS services?

All the benefits you get from using IAM (ease of administration, control, analytics) are available for both InterSystems IRIS-based and non InterSystems  IRIS-based services

Eduard Lebedyuk · Nov 21, 2019 go to post

Use EnableConfigItem method of Ens.Director class to enable/disable business hosts programmatically.

If you want to enable/disable/modify several ensemble hosts, it's better to update them without updating production first and after that
update production. Also add longer timeout on production update.

set sc = ##class(Ens.Director).EnableConfigItem("Item1", 1, 0)
write:'sc $System.Status.GetErrorText(sc)
set sc = ##class(Ens.Director).EnableConfigItem("Item2", 1, 0)
write:'sc $System.Status.GetErrorText(sc)
set sc = ##class(Ens.Director).UpdateProduction(600)
write:'sc $System.Status.GetErrorText(sc)

 

Eduard Lebedyuk · Nov 19, 2019 go to post

Is there any interest in English Webinar?

Please reply in comments if you would like a rerun of this or similar webinar but in English!

Eduard Lebedyuk · Nov 17, 2019 go to post

You are trying to change % routines, which are available in all namespaces.

Most system routines start with %, so they would be available everywhere.

User routines should not start with % (they may start with %Z).

Eduard Lebedyuk · Nov 16, 2019 go to post

Are you sure you want to change system routine?

Is there any particular reason why you want to replace Cache for IRIS in code?

Anyway, is IRISLIB database writable?

Here's how you can make database writable.

  • Open System Management Portal
  • Go To: Menu (upper right corner) -> Databases
  • Choose database you want to modify
  • Set/remove ReadOnly flag
  • Saave

It's really not recommended for IRISLIB.

Eduard Lebedyuk · Nov 16, 2019 go to post

I think virtual PDF printer can help in this situation.

From a cursory search LibreOffice does not seem to be ported to AIX. You can try to compile it from source with AIX Toolbox for Linux Applications.

Eduard Lebedyuk · Nov 16, 2019 go to post

Third parameter is expire:

d %response.SetCookie("XXXXX",%session.SessionId,"expirationdate")

For example:

d %response.SetCookie("XXXXX",%session.SessionId,"Wed, 31 Oct 2020 00:00:00 GMT")
Eduard Lebedyuk · Nov 15, 2019 go to post

Are you able to open and login into System Management Portal?

http://ip:52773/csp/sys/UtilHome.csp
Eduard Lebedyuk · Nov 15, 2019 go to post

Have you specified Address? Looks empty.

If it's GCP do you have a static public IP address/hostname you can connect to?

Can you open management portal?

Eduard Lebedyuk · Nov 14, 2019 go to post

You need to use the IDE to edit routines.

For WRC access/Studio write to your InterSystems contact.

Have you tried installing Atelier or VS Code? They are available without registration.

Eduard Lebedyuk · Nov 14, 2019 go to post

You need to create a Web Application pointing to the directory you want to serve. Here's how.

By default "root" directory (C:/InterSystems/Cache/CSP/ in your case) is not served, rather each folder there is a separate Web Application.