查找

記事
· 2025年2月25日 3m read

Importando oum objeto json com uma propriedade de string grande

Para um de nossos clientes, precisei integrar com o endpoint AFAS imageconnector/imageconnector/{imageId}?format={format}.
Esse endpoint retorna uma mensagem JSON com a imagem como uma propriedade de string codificada em base64, além do mimetype da imagem.

ディスカッション (0)1
続けるにはログインするか新規登録を行ってください
お知らせ
· 2025年2月25日

[Video] Coding InterSystems ObjectScript with Copilot

Hi Community,

Watch this short exercise in writing basic code snippets in InterSystems ObjectScript using Copilot in VSCode and the GPT-4.0 engine. This screencast covers "Hello, World," global manipulation, class creation, and building a simple REST API application.

>> Coding InterSystems ObjectScript with Copilot <<

🗣 Presenter: @Evgeny Shvarov, Senior Manager of Developer and Startup Programs, InterSystems

📌 The related code can be found here: objectscript-copilot-demo.

Feel free to share your thoughts or questions in the comments to this post. Enjoy! 

ディスカッション (0)2
続けるにはログインするか新規登録を行ってください
質問
· 2025年2月25日

Is the argument to $$$TRACE() always computed, or only when tracing is on?

We have some ObjectScript code in a custom business process:

When Log Trace Events is ticked on the business process in the Production view in the management portal, the argument is obviously computed.

Our question is whether the argument is computed when Log Trace Events is not ticked? Don't want to accidentally include something in a $$$TRACE() statement that takes enough computation to make a performance difference when released to production, even though the final output is not written to the event log.

A more general question is whether its possible to check the Log Trace Events status from ObjectScript, so you could do something like:

(Which is presumably what the $$$TRACE macro is doing under the surface...)

3 Comments
ディスカッション (3)3
続けるにはログインするか新規登録を行ってください
質問
· 2025年2月25日

Management portal not working

Hi,

Just installed IRIS on the top of ensemble 2018  as  conversion and I can access Studio & terminal with no issues but management portal is giving  page not found error 404 ?

 

Thanks 

3 Comments
ディスカッション (3)1
続けるにはログインするか新規登録を行ってください
記事
· 2025年2月25日 2m read

クライアントからPOSTされた ファイルを受け取るRESTサービスを作成する方法

これは InterSystems FAQ サイトの記事です。
 

以下の様なCurl コマンドで送信したファイルを受け取るRESTサービスを作成する方法を紹介します。

curl -X POST "http://localhost/api/upload/csv?a=123&b=999" -F file=@"C:/temp/a.csv"

クライアントからPOSTされたファイルを受け取ってサーバーに保存するRESTサービスは以下の様に作成します。 

(このサンプルでは、1000文字以下の小さいサイズおよび文字コードはutf-8のファイルを想定しています。)

Class User.MyREST Extends %CSP.REST
{

Parameter HandleCorsRequest = 1;
XData UrlMap
{
<Routes>
  <Route Url="/csv" Method="POST" Call="readMimeData" />
  </Routes>
}

ClassMethod readMimeData() As %Status
{
   set upload=$g(%request.MimeData("csvfile", 1))
   set fname=%request.MimeData("csvfile",1).FileName
   set file=##class(%Stream.FileCharacter).%New()
   set file.Filename = "c:¥temp¥"_fname
   set file.TranslateTable = "UTF8"
   set updata = upload.Read(1000)
   set sc = file.Write($zcvt(updata,"I","UTF8"))
   If $$$ISERR(sc) Do $system.OBJ.DisplayError(sc) Quit sc
   set st = file.%Save()
   if st {
     write fname_" アップロード完了!!"
   } else {
     write fname_" アップロード失敗"
   }
   quit $$$OK
}

}

このRESTサービスをクライアントから呼び出すために、以下の様な設定を行います。

管理ポータル>システム管理>セキュリティ>アプリケーション>ウェブ・アプリケーション>新しいウェブ・アプリケーションを作成の所で上で作成したRESTディスパッチクラスを登録します。 

名前: /api/upload

ネームスペース:  そのクラスを保存したネームスペース

RESTを有効にして、ディスパッチクラスにUser.MyRESTを設定する 

この設定はAPIを呼び出して実行することもできます。

zn "%SYS"
set sec = ##class("Security.Applications").%New()
set sec.Name = "/api/upload"
set sec.NameSpace = "USER"
set sec.DispatchClass ="User.MyREST"
set sec.AutheEnabled = 96
set status = sec.%Save()
ディスカッション (0)1
続けるにはログインするか新規登録を行ってください