New post

検索

Digest
· Dec 23, 2024

【週間ダイジェスト】 12/16 ~ 12/22 の開発者コミュニティへの投稿

12/16 ~ 12/22Week at a GlanceInterSystems Developer Community
Digest
· Dec 23, 2024

InterSystems 开发者出版物,十二月 16 - 22, 2024,摘要

Article
· Dec 22, 2024 2m read

VSCodeでクラスをXMLにてエクスポートする方法


UDL形式でのインポート・エクスポートが出来ない古いCahceバージョンのソースを保守していたり、古くからのバージョン管理下においてXMLでのバージョン管理を行っている環境であったりと、未だにXMLでのエクスポート・インポートが必要になる場面はまれにあるかと思います。
今回、そういった環境下でもわざわざ管理ポータルを開かずとも、VSCodeでXML形式でエクスポートする拡張機能をリリースしましたので、共有させて頂きます。

機能について

編集画面、あるいは、VSCodeのエクスプローラータブ内からクラスを選択し、コンテキストメニューの「XML形式でエクスポート」を実行します。

image

XMLファイルは所定の場所に保存されます。保存先は設定で指定が出来ます。

Discussion (0)1
Log in or sign up to continue
Article
· Dec 22, 2024 2m read

第五十五章 File 输入 输出 - 与非 InterSystems IRIS 软件的交互

第五十五章 File 输入 输出 - 与非 InterSystems IRIS 软件的交互

与非 InterSystems IRIS 软件的交互

Windows 系统上,在 IRIS 中打开顺序文件以进行 “WL” 写入访问通常会阻止非 IRIS 应用程序打开顺序文件进行写入访问。同样,非 IRIS 应用程序打开顺序文件进行写入访问通常会阻止 IRIS 进程并发 “WL” 写入访问。

Discussion (0)1
Log in or sign up to continue
Article
· Dec 22, 2024 3m read

Get your code over ODBC/JDBC

I recently met an ages old issue related to code maintenance:

  • You have access to your IRIS server just over ODBC/JDBC
  • no VSCode access, no Studio access
  • no (Web-)Terminal access

But you need to take a look on Classes or Routines or Globals !!
Anyhow SQL is your friend.

  • First you need a simple table as temporary text store.
CREATE GLOBAL TEMPORARY TABLE  arcc.txt (line VARCHAR(32000))

Not a thrilling action.

  • Next you export your code to local file and import it to your table
CREATE PROCEDURE arcc.show (IN code VARCHAR()) 
  RETURNS INTEGER
  LANGUAGE OBJECTSCRIPT 
 {
	set file="code.tmp"
	do $system.OBJ.ExportUDL($g(code),file) 
	open file:"R":0 else  quit 0
	kill ^||arcc.txtD 
	use file
	try { 
		for i=1:1 read line set ^||arcc.txtD($i(^||arcc.txtD))=$lb(line) 
	} 
	catch (e) { 
	   close file:"D"
	}
	quit 1
}

How to use it:

select * from arcc.txt where 1=arcc.show('arcc.txt.cls')

And you get:

Class arcc.txt Extends %Persistent [ ClassType = persistent, DdlAllowed, Final, Owner = {_PUBLIC}, ProcedureBlock, SqlRowIdPrivate, SqlTableName = txt ]
{
Property line As %Library.String(MAXLEN = 32000) [ SqlColumnNumber = 2 ];
Parameter SQLTABLETYPE = "GLOBAL TEMPORARY";
Storage Default
{
<Data name="txtDefaultData">
<Value name="1">
<Value>line</Value>
</Value>
</Data>
<DataLocation>^||arcc.txtD</DataLocation>
<DefaultData>txtDefaultData</DefaultData>
<IdLocation>^||arcc.txtD</IdLocation>
<IndexLocation>^||arcc.txt</IndexLocation>
<StreamLocation>^||arcc.txt</StreamLocation>
<Type>%Storage.Persistent</Type>
}
}
 
  • Or traditional if you prefer XML output over UDL use 
  • $system.OBJ.Export() as export method.
<?xml version="1.0" encoding="UTF-8"?>
<Export generator="IRIS" version="26" zv="IRIS for Windows (x86-64) 2024.2.0L (Build 213U)" ts="2024-12-22 20:40:09">
<Class name="arcc.txt">
<Description>
</Description>
<Final>1</Final>
<ClassType>persistent</ClassType>
<DdlAllowed>1</DdlAllowed>
<Owner>_PUBLIC</Owner>
<ProcedureBlock>1</ProcedureBlock>
<SqlRowIdPrivate>1</SqlRowIdPrivate>
<SqlTableName>txt</SqlTableName>
<Super>%Persistent</Super>
<TimeChanged>67196,63061.387736</TimeChanged>
<TimeCreated>67196,63061.3543687</TimeCreated>
 
<Property name="line">
<Type>%Library.String</Type>
<Collection/>
<Required>0</Required>
<SqlColumnNumber>2</SqlColumnNumber>
<Parameter name="MAXLEN" value="32000"/>
</Property>
 
<Parameter name="SQLTABLETYPE">
<Default>GLOBAL TEMPORARY</Default>
</Parameter>
 
<Storage name="Default">
<Type>%Storage.Persistent</Type>
<DataLocation>^||arcc.txtD</DataLocation>
<DefaultData>txtDefaultData</DefaultData>
<IdLocation>^||arcc.txtD</IdLocation>
<IndexLocation>^||arcc.txt</IndexLocation>
<StreamLocation>^||arcc.txt</StreamLocation>
<Data name="txtDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>line</Value>
</Value>
</Data>
</Storage>
</Class>
</Export>

XML might be useful for Global Exports if required

select * from arcc.txt where 1=arcc.showxml('%ZPM.Client.ServerDefD.GBL')
<?xml version="1.0" encoding="UTF-8"?>
<Export generator="IRIS" version="26" zv="IRIS for Windows (x86-64) 2024.2.0L (Build 213U)" ts="2024-12-22 20:50:01">
<Global>
<Node><Sub>^%ZPM.Client.ServerDefD</Sub>
<Data>1</Data>
<Node><Sub>1</Sub>
<DataBase64>NQF+JVpQTS5QYWNrYWdlTWFuYWdlci5DbGllbnQuUmVtb3RlU2VydmVyRGVmaW5pdGlvbn4KAXJl
Z2lzdHJ5AQEBAQMEAQEnAWh0dHBzOi8vcG0uY29tbXVuaXR5LmludGVyc3lzdGVtcy5jb20DBAED
BAECBA==
</DataBase64>
<Node><Sub>RemoteServerDefinition</Sub>
<DataBase64>AQIBAgEnAWh0dHBzOi8vcG0uY29tbXVuaXR5LmludGVyc3lzdGVtcy5jb20CAQIB
</DataBase64>
</Node>
</Node>
</Node>
</Global>
</Export>

And all this is just running over ODBC/JDBC

7 Comments
Discussion (7)2
Log in or sign up to continue