发布新帖

查找

文章
· 八月 10, 2023 阅读大约需 3 分钟

Remote Global Listing using NativeAPI for ObjectScript #1

This question originally appeared in the comments of the post: Download globals from a particular server
 

This article was inspired by a recent question from @Evgeny Shvarov 
Download globals from a particular server

It is not a click-and-run code but a draft that requires adjustments for your special needs
you have  to add 

  • your credentials for server access
  • your level of error handling
  • Global name
  • the first set of subscripts as  %LB() block default=""
  • the last set of subscripts as  %LB() block default=""
  • a new global name if required default="" >> name not changed

If nothing than the global name is provided the result is a pure copy.

Warning: 
This code runs rather slowly and creates a lot of network traffic
Background As $QUERY is not supported by Native API  it is a rather
long and boring workaround with IsDefined (aka $DATA) and GetNext (aka $ORDER)

Advantage:
With this approach, there is NO need for any other code or adjustment on the remote server.
And that's my only reason to publish this example

An improvement is a "work in progress". Stay tuned for #2

Class nacl.GVC
{

ClassMethod Connect(
  serverIP = "192.168.0.9",
  serverPORT = 1972,
  namespace = "USER",
  username = "_SYSTEM",
  password = "SYS") As %Net.DB.Iris
{
  try {
    set %rccon=##class(%Net.DB.DataSource).CreateConnection(serverIP
                           ,serverPORT,namespace,username,password)
    set %rccdb=%rccon.CreateIris()
    }
  catch { zw  b  }  ;; do some error handling
  quit %rccdb
}

/// tosubscript stops loop
ClassMethod View(
  global As %String = "",
  fromsubscript As %List = "",
  tosubscript As %List = "")
{
  quit ..Copy(global,fromsubscript,tosubscript,"")
}

/// rename also works to local variable array
ClassMethod Copy(
  global As %String = "",
  fromsubscript As %List = "",
  tosubscript As %List = "",
  rename As %String = "*")
{
#dim %rccdb as %Net.DB.Iris
 set subs=..Args(fromsubscript)
 set stop=..Args(tosubscript)
 set:rename="*" rename="^"_global 
loop
 if $l(subs),$l(stop),$p(subs,stop)="" quit 1
 set gx=""""_global_""""
#; write !?20,gx_subs   just for debug
 set x1="quit %rccdb.IsDefined("_gx_subs_")"
   , dd=$xecute(x1)
 if $l(stop),subs]]stop quit 1
 if dd#10 { 
   set x2="quit %rccdb.Get("_gx_subs_")"
     , val=$xecute(x2)
     , tx=rename_$s($l(subs):"("_$e(subs,2,*)_")",1:"")
     , tv=##class(%Utility).FormatString(val)
     , x3="(val) set "_tx_"=val q 1 "
   if $l(rename),$xecute(x3,val) write tx," = ",tv,!    
   else  write "^",global,tx," = ",tv,!  
   }
up
 set down=$s(dd\10:",""""",1:"")
 set x4="quit %rccdb.GetNext(1,0,0,"_gx_subs_down_")"
   , nxsub=$xecute(x4)
 if nxsub="" {
   set dd=0
   if down="" set subs=$p(subs,",",1,*-1)
   goto up
   } 
 if '$isvalidnum(nxsub) set nxsub=""""_nxsub_""""
 set $p(subs,",",*+(dd\10))=nxsub   
 if $l(subs,",")<2 quit 1
 goto loop
}

ClassMethod Args(list As %List = "") As %String
{
  if '$listvalid(list) set list=$lb(list)
  set ll=$ll(list),subs=""
  for i=1:1:ll {
    set sub=$li(list,i)
      , subs=subs_","_$s($isvalidnum(sub):sub,1:""""_sub_"""")
  }
  quit subs
}
}
讨论 (1)1
登录或注册以继续
问题
· 八月 9, 2023

VS Code : unable to save file to server

When I open a class in VS Code and I want to save it I'm getting the following error : Non-JSON response to /api/atelier/v7/DEV/doc/API.Mollie.Execute.cls?ignoreConflict=0 request. Is the web server suppressing detailed errors?

Also I always get a popup when I open VS Code "The extension wants to sign in using InterSystems Server Credentials."

3 Comments
讨论 (3)4
登录或注册以继续
问题
· 八月 4, 2023

Azure Databricks JDBC connection to Intersystems

We encountered difficulties while attempting to establish a JDBC connection to Intersystems using AZURE Databricks, resulting in an inability to retrieve data. The JDBC version utilized was intersystems-jdbc-3.3.1.jar. If anyone has successfully employed Databricks for establishing a connection, we would appreciate information regarding the libraries you used

 

Error Message:
org.apache.spark.SparkException: Job aborted due to stage failure: Task 0 in stage 0.0 failed 4 times, most recent failure: Lost task 0.3 in stage 0.0 (TID 3) (10.140.70.71 executor driver): java.sql.SQLException: [SQLCODE: <-25>:<Input encountered after end of query>]

7 Comments
讨论 (7)3
登录或注册以继续
问题
· 七月 27, 2023

Is it possible to get a list all active open TCP/IP connections made by IRIS ?

There is several classes that allow to create TCP/IP connections (eg: to connect to a service).

Example : %Net.FtpSession (port 21), %Net.HttpRequest (usually port 80 or 443)

AFAIK connection will stay open unless closed explicitly or if variable that hold the instance is garbage collected.

Is there a way to get a list of all active (open) TCP/IP connections IRIS is maintaining so far ?

I took a look at Portal (eg: in dashboard, "System Resource Statistics") but couldn't find anything. Web Gateway panel provide information about connections but this is incoming connections for CSP pages. I am look for external connections (the other way around).

If it's not available in Portal, some API / classes will be fine too.

I could of course run TCPView , netstat or something like that but I am looking for something built-in in IRIS.

6 Comments
讨论 (6)2
登录或注册以继续
公告
· 七月 20, 2023

GitLab is Now Supported on Open Exchange

Exciting news for developers using GitLab for their InterSystems applications repositories! Open Exchange has expanded its support to include GitLab, allowing you to submit your projects just as easily as you would do with GitHub repos. 

Submitting Your GitLab Repo app on Open Exchange:

  1. Start by navigating to Open Exchange and log in to your account.
  2. Head to the "Submit Application" 
  3. In the "GitHub/GitLab URL" field, include the link to your open GitLab repository.
  4. Make sure to check the "Use GitHub/GitLab README as long description" checkbox. This ensures that your project's README file serves as a a long description for the app.

Fetching App Data from GitLab

 

With the integration of GitLab on Open Exchange, the platform fetches application data from your GitLab repository, much like it does with GitHub:. This means you can take advantage of Open Exchange's wide range of features and services regardless of the repository hosting platform.
 

Please don't hesitate to share your feedback on this feature here in comments or DM me.

1 Comment
讨论 (1)3
登录或注册以继续