清除过滤器
文章
Lele Yang · 三月 31, 2023
《WebGateway系列(4): 配置HTTPS访问IRIS的Web服务》中介绍了在Web服务器中配置SSL/TLS以实现从客户端浏览器到Web服务器之间的安全连接,从Web服务器到IRIS之间是否也可以通过配置SSL/TLS建立起安全连接呢?尤其是在Web服务器与IRIS没有安装在同一台Server上的情况下,这段连接的安全性也是需要考虑的。答案是肯定的,接下来我们就来介绍下配置Web Gateway使用SSL/TLS连接到IRIS的基本步骤。
1.首先,我们先准备一下所需要的证书。通讯的双方为Web Gateway 和 IRIS Super Server, 双方都需要准备好各自的证书和key。IRIS自带的Public Key Infrastructure(PKI)功能内置了OpenSSL,可以用来生成服务器端及客户端的证书和key。在使用此功能时,IRIS可以同时作为CA Server和CA Client,作为CA Server时可以生成自签名的证书,可以批准CA Client的证书申请并将证书下发给CA Client。
1)配置本地证书颁发机构服务器,生成sever端的证书和key。
2)配置本地证书颁发机构客户端,如下
3)将证书签名请求提交到证书颁发机构服务器
4)进程未决证书签名请求
发放证书。
至此,Client以及Server端证书和key都已准备完成。
以下证书和key将用于Web Gateway,
/intersystems/irishealth/mgr/cac.cer
/intersystems/irishealth/mgr/cac.key
以下证书和key将用于IRIS Super Server
/intersystems/irishealth/dev/CAcerts/cas.cer
/intersystems/irishealth/dev/CAcerts/cas.key
当然也可以去申请商用的证书,也可以不使用PKI直接使用OpenSSL自己去生成。
2. 配置SSL/TLS, 名为%SuperServer
3. Enable Superserver SSL/TLS Support,
4. 在Web Server中配置Web Gateway。
本示例中所使用的Web Server为Apache2.4.6,操作系统为Redhat7.9。注意以下Web Gateway管理页面打开端口为默认的80。另外,上面生成好的证书拷贝至了/tmp/下。
对应的CSP.ini中内容如下,
[IRISHEALTH]
Ip_Address=localhost
TCP_Port=1972
Username=CSPSystem
Password=]]]c3lz
Minimum_Server_Connections=3
Maximum_Session_Connections=6
Connection_Security_Level=10
Product=2
SSLCC_Protocol=8@
SSLCC_Key_Type=2
SSLCC_Cipher_Suites=ALL:!aNULL:!eNULL:!EXP:!SSLv2
Env_Parameters=EV6
SSLCC_Certificate_File=/tmp/cac.cer
SSLCC_Certificate_Key_File=/tmp/cac.key
SSLCC_CA_Certificate_File=/tmp/cas.cer
SSLCC_Private_Key_Password=]]]MTIz
SSLCC_Verify_Peer=1
5. Web Gateway中Test Connection, 报错Server Unavailable。
CSP.log报错如下,
>>> Time: Wed Mar 29 12:00:36 2023; RT Build: 2101.1776 (linux/apapi:srv=2.4.6/apr=1.4.8/apu=1.5.2/mpm=prefork); Log-Level: -1; Gateway-PID: 4315; Gateway-TID: 139634317305600; Connection-No: 0; Server: IRISHEALTH; InterSystems IRIS-PID: 0; Request-ID: 249b
IRISCONNECT : Error Connecting to InterSystems IRIS : Unable to read SSL configuration
Cannot read SSL certificate file: /tmp/cac.cer
>>> Time: Wed Mar 29 12:00:36 2023; RT Build: 2101.1776 (linux/apapi:srv=2.4.6/apr=1.4.8/apu=1.5.2/mpm=prefork); Log-Level: 0; Gateway-PID: 4315; Gateway-TID: 139634317305600
Information: Terminate Connection
Connection closed by Gateway: Connection-No=0:0; Server=IRISHEALTH; InterSystems IRIS PID=0; Context=205;
>>> Time: Wed Mar 29 12:00:36 2023; RT Build: 2101.1776 (linux/apapi:srv=2.4.6/apr=1.4.8/apu=1.5.2/mpm=prefork); Log-Level: 0; Gateway-PID: 4315; Gateway-TID: 139634317305600; Connection-No: ; Request-ID: 249b; Session-ID: uoyakptQAD; Remote-Addr: ; Page: GET /csp/bin/RunTime/Module.cxw
Diagnostic
Failed to connect to 'IRISHEALTH' - Reason: -201 (SSL Configuration error) (No Retry)
解决办法,
将证书和key文件放置在Web Gateway安装路径下之后问题解决。
SSLCC_Certificate_File=/opt/webgateway/cac.cer
SSLCC_Certificate_Key_File=/opt/webgateway/cac.key
SSLCC_CA_Certificate_File=/opt/webgateway/cas.cer
[root@BJSRHELSUP webgateway]# ll
total 16
drwxr-xr-x. 2 root root 23 Sep 17 2021 apache
drwxr-xr-x. 2 root root 4096 Sep 17 2021 bin
-rwxr-xr-x 1 root root 1233 Mar 29 14:48 cac.cer
-rwxr-xr-x 1 root root 1834 Mar 29 14:49 cac.key
-rwxr-xr-x 1 root root 1164 Mar 29 14:49 cas.cer
drwxrwxr-x. 2 apache root 56 Aug 30 2022 conf
drwxrwxr-x. 2 apache root 57 Nov 4 2021 logs
drwx------. 2 apache root 6 Mar 29 14:41 temp
drwxr-xr-x. 2 root root 20 Sep 17 2021 util
6. Web Gateway中再次Test Connection,成功。
参考文档,
InterSystems Public Key Infrastructure
Configuring the Web Gateway to Connect to InterSystems IRIS Using TLS
文章
jieliang liu · 九月 22, 2021
本文档介绍了如何使用 InterSystems JDBC 驱动程序连接到 InterSystems IRIS®数据平台实例,这样您就可以在 InterSystems IRIS 中使用 Java。
要浏览所有的技术概要(First Look),包括可以在 InterSystems IRIS 免费的评估实例上执行的那些,请参见 InterSystems First Looks(《InterSystems 技术概要》)。
JDBC:如何在 InterSystems IRIS 中使用它
InterSystems 提供了完全兼容的(JDBC 4.2)、纯 Java、type 4 JDBC 驱动程序,它是一个独立的 JAR 文件,没有任何依赖性。如果您已经熟悉 JDBC,并且安装了 JDK 1.8,那么您需要做的就是将 JDBC 驱动程序添加到本地 CLASSPATH 中(请参见 JDBC:Exploring It [《JDBC:探索它》] )。JDBC URL(连接字符串)是:
jdbc:IRIS://ipAddress:superserverPort/namespace
其中的变量表示 InterSystems IRIS 实例主机的 IP 地址、实例的超级服务器端口和实例上的命名空间。
如果您连接到本地计算机上的一个实例(使用主机名 localhost 或 IP 地址 127.0.0.1),该连接可以使用一种特殊的、高性能的本地连接,称为共享内存连接(shared memory connection)。有关共享内存连接(shared memory connection)的更多信息,请参见 "JDBC:What's Unique about Shared Memory Connections(《JDBC: 共享内存连接的独特之处》)"。
本文档的重点是让您体验一下在 InterSystems IRIS 中使用 JDBC,而不是让您陷入细节困境 ,所以我们保持了简单的探索。但是,当您把 InterSystems IRIS 引入您的生产系统时,您需要做很多不同的事情,例如(但不限于)安全性方面。所以请确保不要把这种对 InterSystems IRIS 的探索与真实的情况相混淆! 本文档末尾提供的参考资料将使您对在生产中使用 JDBC 与 InterSystems IRIS 的情况有一个很好的了解。
JDBC:InterSystems IRIS Java 连接选项的一部分
InterSystems IRIS JDBC 驱动程序是 InterSystems IRIS 的核心 Java 组件,支持传统的关系(SQL)访问。它还为使用 InterSystems IRIS Native API for Java 的 Java 调用提供连接机制,这些调用可以访问本机存储格式中的数据。对于基于对象的 Java 集成,InterSystems IRIS 还提供一个单独的功能------InterSystems IRIS XEP 组件(InterSystems IRIS XEP component)。
综上所述,InterSystems IRIS 提供了一组独特的功能,可以使用相同的物理连接和事务环境来使用多个范例(本机[native]、关系[relational]和面向对象[object-oriented])操作数据。对于更复杂的应用程序,InterSystems 完全支持 Hibernate。支持所有这些连接形式的------InterSystems IRIS XEP、Hibernate 以及 InterSystems IRIS Spark 连接器(Connector)------是 InterSystems IRIS JDBC 驱动程序。
技术概要: JDBC 和 InterSystems 数据库 1
JDBC:探索它
JDBC: 共享内存连接(Shared Memory Connections)的独特之处
与其他数据库平台一样,到远程 InterSystems IRIS 实例的 JDBC 连接是通过 TCP/IP 进行的。为了最大限度地提高性能,InterSystems IRIS 还提供了 Java 共享内存连接(shared memory connection)。与 InterSystems IRIS 实例在同一计算机上运行的许多 Java 应用程序都可以使用共享内存连接(shared memory connection)。
共享内存连接(shared memory connection)是一个临时设备,支持虚拟内存,由 JDBC 客户端和运行在同一物理计算机上的 InterSystems IRIS 实例共享。此外,这些连接不需要对内核网络堆栈进行潜在的昂贵调用。通过使用直接从 JDBC 客户端到 InterSystems IRIS 的通道,它们最终为 JDBC 操作提供了低延迟和高吞吐量。
有关共享内存(shared memory connection)的详细信息,请参见 Using Java with the InterSystems JDBC Driver(《在 InterSystems JDBC 驱动程序中使用 Java》)中的 "Shared Memory Connections(共享内存连接)"。
JDBC:探索它
我们开发了一个演示,向您展示如何使用 JDBC 和 InterSystems IRIS------以及这是多么地简单。
请注意,这段代码并没有演示 InterSystems Java 共享内存连接(shared memory connection)的性能提升,因为它无法处理共享内存连接(shared memory connection)可以高效处理的大量数据。
想试试 InterSystems IRIS Java 开发和互操作性功能的在线视频演示吗?请查看 Java QuickStart(Java 快速入门)!
用前须知
要使用该程序,您需要在一个系统上工作,安装 JDK 1.8 版本和您选择的 Java IDE,并连接一个正在运行的 InterSystems IRIS 实例。您对 InterSystems IRIS 的选择包括多种已授权的和免费的评估实例;实例不需要由您正在工作的系统托管(尽管它们必须相互具有网络访问权限)。有关如何部署每种类型的实例的信息(如果您还没有可使用的实例),请参见 InterSystems IRIS Basics: Connecting an IDE(《InterSystems IRIS 基础:连接一个 IDE》)中的 Deploying InterSystems IRIS(部署 InterSystems IRIS)。使用同一文档中的 InterSystems IRIS Connection Information(InterSystems IRIS 连接信息)和 Java IDE 中的信息,将 IDE 连接到您的 InterSystems IRIS 实例。对于这个演示,您可以连接到 USERnamespace,如下面的代码所示,或者您可以指定在已安装的实例中创建的另一个命名空间。
您还需要将 InterSystems IRIS JDBC 驱动程序 intersystems-jdbc-3.0.0.jar 添加到您的本地 CLASSPATH。您可以从 https://github.com/intersystems/quickstarts-java/tree/master/lib 下载这个文件。如果您已经在您的本地计算机或您能访问的另一台计算机上安装了 InterSystems IRIS,您可以在 install-dirdevjavalibJDK18 中找到该文件,其中 install-dir 是 InterSystems IRIS 的安装目录。
尝试示例代码
将示例代码剪切并粘贴到您的 IDE 中,使用 InterSystems IRIS Basics: Connecting an IDE(《InterSystems IRIS 基础:连接一个 IDE 》)中的connection settings described for your instance(为您的实例描述的连接设置)更新 url 和连接(connecttion)变量以及用户名和密码。 .
import java.sql.*;
public class JDBCSample {
public static void main(String[] str) throws Exception {
String url = "jdbc:IRIS://127.0.0.1:1972/USER";
Class.forName("com.intersystems.jdbc.IRISDriver");
Connection connection = DriverManager.getConnection(url,"_SYSTEM","SYS");
// Replace _SYSTEM and SYS with a username and password on your system
String createTable = "CREATE TABLE People(ID int, FirstName varchar(255), LastName varchar(255))"; String insert1 = "INSERT INTO People VALUES (1, 'John', 'Smith')";
String insert2 = "INSERT INTO People VALUES (2, 'Jane', 'Doe')"; String query = "SELECT * FROM People";
Statement statement = connection.createStatement(); statement.executeUpdate(createTable); statement.executeUpdate(insert1); statement.executeUpdate(insert2);
ResultSet resultSet = statement.executeQuery(query); System.out.println("Printing out contents of SELECT query: "); while (resultSet.next()) {
System.out.println(resultSet.getString(1) + ", " + resultSet.getString(2) + ", " + resultSet.getString(3));
}
resultSet.close(); statement.close(); connection.close();
}
}
如果连接和查询已经成功完成,您应该会看到一个控制台窗口(console window),其中包含 SELECT 查询的结果。
4 了解有关 JDBC 的更多信息
要了解有关 JDBC、InterSystems IRIS 中的其他 Java 互操作性技术和其他相关主题的更多信息,请参见:
Using Java JDBC with InterSystems IRIS(《在 InterSystems IRIS 中使用 Java JDBC》)中的 "InterSystems Java Connectivity Options(InterSystems Java 连接选项)"------对JDBC 驱动程序支持的所有 InterSystems IRIS Java 技术的概述。
Using Java with the InterSystems JDBC Driver(《在 InterSystems JDBC 驱动程序中使用 Java》)------InterSystems 文档:step-by-step instructions for using JDBC(《使用 JDBC 的详细说明》)。
First Look: XEP Object Persistence with InterSystems IRIS(《技术概要: 使用 InterSystems IRIS 持久化 XEP 对象》)------InterSystems 文档:Java XEP First Look(《Java XEP 技术概要》)
First Look:InterSystems IRIS Native API for Java(《技术概要: InterSystems IRIS Native API for Java》)------InterSystems 文档:InterSystems IRIS Native API First Look(《InterSystems IRIS Native API 技术概要》)
Java Overview(《Java 概述》)------InterSystems 在线学习:介绍视频
Persisting Java Objects with InterSystems XEP(《使用 InterSystems XEP 持久化 Java 对象》)------InterSystems 文档:step-by-step instructions for using XEP(《使用 XEP 的详细说明》)
InterSystems Implementation Reference for Java Third Party APIs (《Java 第三方 API 的 InterSystems 实施参考》)------InterSystems 文档:connecting to InterSystems IRIS using JDBC, Hibernate, and Spark(《使用 JDBC、Hibernate 和 Spark 连接 InterSystems IRIS》)。
Using the InterSystems Spark Connector(《使用 InterSystems Spark 连接器》)------InterSystems 文档:using InterSystems IRIS as an Apache data source(《使用 InterSystems IRIS 作为 Apache 数据源》)
Hibernate and JDBC compared(《Hibernate 和 JDBC 的比较》)------栈溢出(Stack Overflow)的文章
文章
姚 鑫 · 二月 5, 2022
# 第四十五章 SQL函数 DATEPART
日期/时间函数,返回表示日期/时间表达式指定部分的值的整数。
# 大纲
```
DATEPART(datepart,date-expression)
```
# 参数
- `datepart` - 要返回的日期/时间信息的类型。日期或时间部分的名称(或缩写)。这个名称可以用大写或小写来指定,有或没有引号。`datepart`可以指定为文字或主机变量。
- `date-expression` - 从中返回`datepart`值的日期、时间或时间戳表达式。日期表达式必须包含`datepart`类型的值。
# 描述
`DATEPORT`函数以整数数据类型返回关于指定日期/时间表达式的`DATEPORT`信息。唯一的例外是`sqltimestamp` (sts),它以数据类型`%Library.Timestamp`返回。要以字符串形式返回日期部分信息,请使用`DATENAME`。
`DATEPART`只返回日期表达式中一个元素的值;要返回包含多个日期部分的字符串,请使用`TO_DATE`。
也可以使用`DATEPART()`方法调用从ObjectScript调用此函数:
```sql
$SYSTEM.SQL.Functions.DATEPART(datepart,date-expression)
```
提供`DATEPART`是为了与Sybase和Microsoft SQL Server兼容。
# Datepart 参数
日期部分参数可以是下列日期/时间组件之一,可以是全名(日期部分列)或其缩写(缩写列)。这些`datepart`组件名称和缩写不区分大小写。
Date Part| Abbreviations| Return Values
---|---|---
year| yyyy, yy |0001-9999
quarter| qq, q| 1-4
month| mm, m| 1-12
week| wk, ww| 1-53
weekday |dw| 1-7 (Sunday,...,Saturday)
dayofyear| dy, y| 1-366
day |dd, d| 1-31
hour| hh| 0-23
minute |mi, n| 0-59
second| ss, s| 0-59
millisecond |ms |0-999 (with precision of 3)
microsecond| mcs |0–999999 (with precision of 6)
nanosecond |ns |0–999999999 (with precision of 9)
sqltimestamp |sts| SQL_TIMESTAMP: yyyy-mm-dd hh:mm:ss
上表显示了不同日期部分的默认返回值。可以使用带有各种时间和日期选项的“设置选项”命令来修改其中几个日期部分的返回值。
`week`:可以配置为使用默认算法或ISO 8601标准算法来确定给定日期的一年中的星期。
`weekday`:对`weekday`的默认设置是将星期日指定为一周的第一天(`weekday=1`)。但是,可以将一周的第一天配置为另一个值,或者可以应用ISO 8601标准,将星期一指定为一周的第一天。请注意,ObjectScript `$ZDATE`和`$ZDATETIME`函数计算的周天数是从0到6(而不是从1到7)。
`second`:如果日期表达式包含小数秒,将秒作为十进制数返回,整数秒作为整数部分,小数秒作为小数部分。精度不会被截断。
`millisecond`:返回三个小数位数的精度,去掉尾随零。如果日期表达式的精度超过三位数会将其截断为三位数。
`sqltimestamp`: 将输入数据转换为时间戳格式,并在必要时为时间元素提供零值。`sqltimestamp`(缩写为sts) `datepart`值仅用于`datepart`。不要试图在其他上下文中使用此值。
`datepart`可以指定为带引号的字符串,不带引号,或者在带引号的字符串周围加上括号。无论如何指定,都不会对`datepart`执行文字替换;对日期表达式执行文字替换。所有datepart值都返回一个数据类型`INTEGER`值,但`sqltimestamp`(或sts)除外,它以数据类型`timestamp`的字符串形式返回其值。
# 日期输入格式
日期表达式参数可以采用以下任何格式:
- %Date logical value (+$H)
- %PosixTime (%Library.PosixTime) logical value (an encoded 64-bit signed integer)
- %TimeStamp (%Library.TimeStamp) logical value (YYYY-MM-DD HH:MM:SS.FFF), also known as ODBC format.
- IRIS %String (or compatible) value
%String(或兼容)值可以是以下任何格式:
- 99999,99999 ($H format)
- Sybase/SQL-Server-date Sybase/SQL-Server-time
- Sybase/SQL-Server-time Sybase/SQL-Server-date
- Sybase/SQL-Server-date (default time is 00:00:00)
- Sybase/SQL-Server-time (default date is 01/01/1900)
Sybase/SQL-Server-date是这五种格式之一:
```
mmdelimiterdddelimiter[yy]yy dd Mmm[mm][,][yy]yy dd [yy]yy Mmm[mm] yyyy Mmm[mm] dd yyyy [dd] Mmm[mm]
```
其中分隔符是斜杠(`/`)、连字符(`-`)或句点(`.`)).
Sybase/SQL服务器时间代表这三种格式之一:
```
HH:MM[:SS:SSS][{AM|PM}] HH:MM[:SS.S] HH['']{AM|PM}
```
如果日期表达式指定了时间格式,但没有指定日期格式,则`DATENAME`默认为日期`1900–01–01`,该日期的工作日值为2(星期一)。
对于`sqltimestamp`,时间以24小时制返回。分数秒被截断。
# 无效的参数错误代码
如果指定无效的`datepart`选项,`DATEPART`将生成一个`SQLCODE -8`错误代码,并且以下`%msg: 'badopt' is not a recognized DATEPART option`.
如果指定了无效的日期表达式值(例如,字母文本字符串),`DATEPART`将生成`SQLCODE -400`错误代码和以下 `%msg: Invalid input to DATEPART() function: DATEPART('year','badval')`。如果指定的日期表达式未通过验证(如下所述),`datepart`将生成一个`SQLCODE -400`错误代码,并显示以下`%msg: Unexpected error occurred: datepart`.
# 范围和值检查
`DATEPART`对日期表达式值执行以下检查。如果值未通过检查,则返回空字符串。
- 有效的日期表达式可以由日期字符串(`yyyy-mm-dd`)、时间字符串(`hh:mm:ss`)或日期和时间字符串(`yyy-mm-dd hh:mm:ss`)组成。如果同时指定了日期和时间,则两者都必须有效。例如,如果未指定时间字符串,则可以返回年份值,但是如果指定了无效的时间字符串,则不能返回年份值。
- 日期字符串必须完整且格式正确,每个元素都有适当数量的元素和数字,以及适当的分隔符。例如,如果省略了“日”值,则不能返回“年”值。年份必须指定为四位数。
- 时间字符串必须用适当的分隔符正确格式化。因为时间值可以为零,所以可以省略一个或多个时间元素(保留或省略分隔符),这些元素将以零值返回。因此,`' hh:mm:ss '`,`' hh:mm '`,`' hh:mm '`,`' hh:ss '`,`' hh:'`,和`':::'`都是有效的。要省略`Hour`元素,日期表达式不能包含字符串的日期部分,并且必须至少保留一个分隔符(`:`)。
- 日期和时间值必须在有效范围内。年份:`0001`到`9999`。月份:`1`到`12`。天数:`1`到`31`天。小时:`0`到`23`。分钟:`0`到`59`。秒:`0`到`59`。
- 一个月中的天数必须与月和年相匹配。例如,日期`“02–29”`仅在指定年份为闰年时有效。
- 大多数小于`10`的日期和时间值可能包含或省略前导零。但是,如果小时值是日期时间字符串的一部分,则小于`10`的小时值必须包含前导零。不允许其他非规范整数值。因此,`“07”`或`“7”`的“日”值有效,但`“007”`、`“7.0”`或`“7a”`无效。
- 如果日期表达式指定了时间格式,但没有指定日期格式,则`DATEPART`不会对时间分量值执行范围验证。
# 示例
在下面的示例中,每个`DATEPART`将日期时间字符串的年份部分(在本例中为`2018`年)作为整数返回。请注意,日期表达式可以有多种格式,`datepart`可以指定为`datepart`名称或`datepart`缩写,带引号或不带引号:
```sql
SELECT DATEPART('yy','2018-02-22 12:00:00') AS YearDTS,
DATEPART('year','2018-02-22') AS YearDS,
DATEPART(YYYY,'02/22/2018') AS YearD,
DATEPART(YEAR,64701) AS YearHD,
DATEPART('Year','64701,23456') AS YearHDT
2018 2018 2018 2018 2018
```
以下示例基于`$HOROLOG`值返回当前年份和季度:
```sql
SELECT DATEPART('yyyy',$HOROLOG) AS Year,DATEPART('q',$HOROLOG) AS Quarter
2022 1
```
下面的嵌入式SQL示例使用主机变量来提供`DATEPART`参数值:
```sql
SET x="year"
SET datein="2018-02-22"
&sql(SELECT DATEPART(:x,:datein)
INTO :partout)
WRITE "the ",x," is ",partout
```
下面的示例返回`Sample.Person`表的出生日期(按星期几排序):
```sql
SELECT Name,DOB,DATEPART('weekday',DOB) AS bday
FROM Sample.Person
ORDER BY bday,DOB
```
在以下示例中,每个`DATEPART`返回20作为日期表达式字符串的分钟部分:
```sql
SELECT DATEPART('mi','2018-2-20 12:20:07') AS Minutes,
DATEPART('n','2018-02-20 10:20:') AS Minutes,
DATEPART(MINUTE,'2018-02-20 10:20') AS Minutes
20 20 20
```
在下面的示例中,每个`DATEPART`返回0作为日期表达式字符串的秒部分:
```sql
SELECT DATEPART('ss','2018-02-20 03:20:') AS Seconds,
DATEPART('S','2018-02-20 03:20') AS Seconds,
DATEPART('Second','2018-02-20') AS Seconds
0 0 0
```
以下示例以`TIMESTAMP`数据类型返回完整的SQL `TIMESTAMP`。`DATEPART`填充缺失的时间信息以返回时间戳`‘2018-02-25 00:00:00’`:
```sql
SELECT DATEPART(sqltimestamp,'2/25/2018') AS DTStamp
2018/2/25 0:00:00
```
以下示例以`$HOROLOG`格式提供日期和时间,并返回时间戳`‘2018-02-22 06:30:56’`:
```sql
SELECT DATEPART(sqltimestamp,'64701,23456') AS DTStamp
2018/2/22 6:30:56
```
下面的示例使用带有`DATEPART`的子查询来返回生日为闰年日(2月29日)的那些人:
```sql
SELECT Name,DOB
FROM (SELECT Name,DOB,DATEPART('dd',DOB) AS DayNum,DATEPART('mm',DOB) AS Month FROM Sample.Person)
WHERE Month=2 AND DayNum=29
```
公告
Claire Zheng · 十月 20, 2022
2022年9月5日-10月24日(北京时间),我们正在举办🏆InterSystems开发者社区中文版首届技术征文大赛🏆(←点击链接进入参赛页面,浏览所有参赛文章)!投票截止至10月23日,你的支持与喜爱,是优秀作品获得“开发者社区奖”的关键!我们先来看看目前作品排名情况吧!距离投票截止还有三天(截止至10月23日),我们暂时无法获得专家评审分数,以下根据作品“点赞”进行排名(排名截至10月21日10时)。
N
Author
标题
点赞⬇
1
Meng Cao
Caché数据库私有apache版本升级
42
2
Zhe Wang
IRIS如何进行CRUD操作
37
3
sun yao
前端操作自动生成BS、BP、BO
26
4
John Pan
论集成标准的选择对医院信息集成平台建设的影响
23
5
lizw lizw
关于%Dictionary.CompiledClass类在实际业务中的一些应用
23
6
聆严 周
使用Prometheus监控Cache集群
21
7
Chang Liu
在国产系统上安装Healthconnect2021
19
8
Zhe Wang
IRIS快速查询服务思路分享
18
9
Zhe Wang
使用Global进行数据可视化---商业智能(BI)
18
10
John Pan
如何调用Ensemble/IRIS内置的HL7 V2 webservice - Java,PB9,Delphi7样例
17
11
zhanglianzhu zhanglianzhu
Cache死循环检测和申明式事务
16
12
Zhe Wang
Rest实现Post、Get、Put、Delete几种操作方式
15
13
shaosheng shengshao
HEALTHSHARE2018版如何实现AES(CBC)的HEX输出,并可以实现加密和解密
15
14
姚 鑫
IRIS与Caché的23种设计模式
15
15
water huang
对 %XML.PropertyParameters类的探索
15
16
Zhe Wang
小工具:IRIS管理页打开显示查询功能
15
17
聆严 周
Cache / IRIS 操作数据的3种基本方式
14
18
he hf
10分钟快速开发一个连接到InterSystems IRIS数据库的C#应用
14
19
shaosheng shengshao
windows下处理IIS在未安装但Healthshare已安装的时候,部署IIS服务并代理Healthshare
11
20
water huang
Ens.Util.JSON类的启发
11
21
bai hongtao
第三方HA软件结合MIRROR使用方法探讨
11
22
li wang
HealthConnect访问HTTPS开头地址
10
23
Liu Tangh
在Cache系统中使用负载均衡服务的探讨
9
24
yaoguai wan
IRIS架构的浅显理解以及windows10、docker安装IRIS Health详解流程及部分问题浅析
7
25
li dong
实现Cache/IRIS中zip文件的下载、解压及读取
7
26
姚 鑫
CORS请求Request携带Cookie失败占用License解决方案
5
27
Zhe Wang
COS的基本语法
5
*奖励项目详见参赛规则:点击阅读
我们此次征文大赛计分规则如下:
🥇【专家提名奖】评选规则,由经验丰富的专家评审团进行评选打分,与其他加分项综合后进行排名。
🥇【开发者社区奖】评选规则,每个点赞计分为1分,与其他加分项综合后进行排名。
🥇【入围奖】评选规则,成功参赛的其余用户都将获得特别奖励。
每位作者只可以获得一个奖项(即:您只可以获得一次专家提名奖/开发者社区奖/入围奖);
当出现票数相当的平手情况时,将以专家评选投票数作为最终票数高低的判断标准。
那么,抓住最后五天的投票时间,为你喜欢的作品“点赞”投票吧!你的点赞是优秀作品获得【开发者社区奖】的关键!
10月24日晚19:30-20:30,我们将举办“InterSystems首届技术征文大赛线上分享会”,发布获奖名单,敬请留意后续参会信息!
欢迎关注InterSystems开发者社区中文版首届技术征文大赛
文章
姚 鑫 · 二月 2, 2023
# 第六十四章 使用 SNMP 监控 IRIS - 扩展 IRIS MIB
应用程序员可以添加托管对象定义并扩展 `IRIS` 子代理为其提供数据的 `MIB`。这不是一个完整的 `MIB` 编辑器或` SNMP` 工具包;相反,它是一种添加简单应用程序指标的方法,可以通过 `SNMP` 浏览或查询这些指标。
注意:对象必须遵循基本的 `IRIS SNMP` 结构,对 `SNMP` 表结构的支持有限(仅支持整数值索引),并且不会创建 `SNMP` 陷阱(请参阅新选项卡类中的 `%Monitor.AlertOpens`) 对管理信息的 `SNMP` 结构有一个基本的了解是很有帮助的。
要创建这些对象,请执行以下操作:
1. 在继承 `%Monitor.Adaptor` 的类中创建 `IRIS` 对象定义。
2. 执行 `SNMP` 类方法以在 `SNMP` 中启用这些被管理对象,并创建 `MIB` 定义文件供管理应用程序使用。实现此目的的方法是 `MonitorTools.SNMP.CreateMIB()`。
该方法为 `%Monitor` 数据库中定义的特定应用程序创建私有企业 `MIB` 树的一个分支。除了为应用程序创建实际的 `MIB` 文件之外,该方法还创建了 `MIB` 树的内部轮廓。 `IRIS` 子代理使用它来注册 `MIB` 子树,为 `GETNEXT` 请求遍历树,并引用特定对象方法以在 `GET` 请求中收集实例数据。
所有托管对象定义都使用与 `IRIS` 企业 `MIB` 树相同的通用组织,即:`application.objects.table.row.item.indices`。所有表格的第一个索引是 `IRIS` 应用程序 `ID`。所有应用程序都必须向 IANA 注册以获得自己的私有企业编号,这是 `CreateMIB()` 方法中的参数之一。
要禁用 `SNMP` 中的应用程序,请使用 `MonitorTools.SNMP.DeleteMIB()` 方法。这会删除应用程序 `MIB` 的内部轮廓,因此 `IRIS` 子代理不再注册或回答对该私有企业 MIB 子树的请求。
# `IRIS SNMP` 陷阱
除了通过 `SNMP` 查询提供的对象数据和指标外, `IRIS` 还可以发送异步警报或 `SNMP` 陷阱。下表描述了 `IRIS` 特定的 `SNMP` 陷阱。
### IRIS SNMP 通知对象(陷阱)
Trap Name (Number)| Description
---|---
irisStart (1) | IRIS 实例已启动。
irisStop (2)| IRIS 实例正在关闭。
irisDBExpand (3)| IRIS 数据库已成功扩展。
irisDBOutOfSpace (4)| IRIS 数据库的未来扩展可能会受到限制;文件系统上的可用空间不足,无法再扩展 10 次,或者可用空间不足 `50 MB`。
irisDBStatusChange (5)| IRIS 数据库的读/写状态已更改。
irisDBWriteFail (6) |写入 IRIS 数据库失败。它包括写入失败的 IRIS 错误代码。
irisWDStop (7)| IRIS 实例的写入守护进程已停止。
irisWDPanic (8) | IRIS 实例的写入守护进程已进入“恐慌panic”模式;也就是说,写入守护进程缓冲区不足,必须将数据库块直接写入磁盘,而无需先将它们提交到写入映像日志 (WIJ) 文件。
irisLockTableFull (9)| IRIS 实例的锁表已满,导致后续 `Locks` 失败。
irisProcessFail (10)|进程异常退出 IRIS(由于访问冲突)。
irisECPTroubleDSrv (11)| IRIS 数据库与此 `ECP` 数据服务器的连接遇到了严重的通信问题。
irisECPTroubleASrv (12)|从该 `ECP` 应用程序服务器到远程 IRIS 数据库的连接遇到了严重的通信问题。
irisAuditLost (13)| IRIS 未能记录审核事件。最可能的原因是审计数据库的空间有问题,这需要操作员的帮助。
irisLoggedError (14)|`messages.log` 文件中记录了一个“严重”错误。此陷阱包括在 `irisSysErrorMsg` 中定义的错误消息。
irisLicenseExceed (15)| 许可证请求已超出当前可用或允许的许可证数量。
irisEventLogPost (16)| 互操作性事件日志中发布的条目。
irisAppAlert (100)| 这是一个通用陷阱, IRIS 应用程序可以使用它通过 SNMP 生成警报。有关如何使用此陷阱的详细信息,请参阅 `%Monitor.Alert.External` 类方法。
下表描述了可以在上表中描述的陷阱中发送的 IRIS 特定辅助对象。
Auxiliary Object Name (Number) |Description
---|---
irisDBWriteError (1)| 数据库写入失败的 IRIS 特定错误代码。可能的值为:``、``、``、` `或 ``。
irisApp (2) |一个短文本字符串(最多 `20` 个字符),用于标识生成(或来源)`irisAppAlert` 陷阱的应用程序。
irisAppSeverity (3)|指示 `irisAppAlert` 陷阱问题严重性的代码。代码可以是 `0`(信息)、`1`(警告)、`2`(严重)或 `3`(严重)。
irisApptext (4) |导致 `irisAppAlert` 陷阱的问题、错误或事件的文本字符串描述(最多 `1024` 个字符)。
公告
jieliang liu · 四月 7, 2021
2021年4月18日,Caché 系统运维培训线上实操课,此次培训的主题包括, Intersystems Caché 架构,Intersystems Caché 备份与恢复,Intersystems Caché 高可用与数据库镜像,Intersystems Caché 安全,Intersystems Caché 监控和性能采集。 欢迎大家报名参加!
线上实操演练,机会难得,欢迎大家报名参会:) 名额有限,先到先得,速速报名啦!
文章
jieliang liu · 六月 30, 2021
嗨,开发者们!
在这篇文章中,我们想告诉你如何充分利用开发者社区,从InterSystems的技术专家那里学到尽可能多的东西!
请注意这些步骤,以成为我们社区的高级用户!
关注你感兴趣的社区成员
如果你喜欢他们发布的内容,你可以关注社区的任何成员。只需点击任何成员右侧边栏上的 "关注 "按钮,当该成员在社区上发表文章(文章/问题/公告等)时,你将收到电子邮件通知。
此外,在主页的顶部菜单中,你可以点击 "成员",搜索特定的人或有更多意见的成员,或更多的喜欢......并开始关注他们。
关注你感兴趣的标签
用于描述社区上的帖子的所有标签都可以在DC主页上的 "标签 "部分找到:
在DC标签树中, 您可以找到您感兴趣的主题并关注相关的 标签。只需选择一个标签并点击其旁边的 "关注 "按钮即可。当您关注任何标签时,您会收到一封包含所有使用该标签的帖子的电子邮件。
我们建议从以下标签开始: 最佳实践 | 技巧和窍门 | 初学者 | 教程
关注你所感兴趣的帖子
关注一个帖子,你将收到(通过电子邮件)该帖子的所有更新,如新的评论,或如果发表了第二部分,或任何其他与你关注的帖子有关的活动。
要关注一个帖子,你只需要点击每个帖子下面的铃铛图标。
-> 我如何知道我在关注哪些会员、标签和帖子?
要知道你所关注的会员、标签和帖子,你只需要进入你的账户,在右上角
然后进入左栏的 "订阅"。
在这个页面的底部,你可以在三个标签中看到并定制你的订阅--每个标签都显示你所关注的成员、标签和帖子。例如,下面的截图显示,用户正在关注一些标签和DC成员。
注意: 如果你想关注不同语言的会员或标签,你需要将你的订阅设置切换到你感兴趣的语言。
添加帖子到你的书
把你喜欢的帖子加入书签,这样你以后就可以快速而方便地访问该帖子。
如果你喜欢一个帖子(文章、问题或公告)并想把它保存起来,你可以把它添加到你的书签中。这样,你就可以快速和容易地访问该帖子,并在你想要时阅读它。
要将一个帖子添加到你的书签,你只需要点击每个帖子下面的星星图标。
要查看您的所有书签,请进入您的账户,然后在左栏中进入 "书签"。
所以,开发者们!
请使用我们所有的DC功能,这些功能可以帮助你成为InterSystems技术的专家!
而且非常欢迎你在下面的评论中提交关于如何在开发者社区学习InterSystems技术的其他方法和建议。
公告
Claire Zheng · 五月 12, 2021
亲爱的社区开发者们,大家好!
InterSystems开发者竞赛:FHIR加速器 已于5月10日开启! 我们邀请所有FHIR开发者们在AWS上使用InterSystems IRIS FHIR加速器服务 (FHIRaaS)上开发或测试您的应用。
现在,我们为您提供绝佳机会,您可以在AWS上免费访问FHIRaaS! 那么,掌握FHIRaaS的第一步,是使用URL的特殊code在ISC Dev FHIR Portal 门户注册,链接如下:👉🏼 https://portal.trial.isccloud.io/account/signup
点击上面的链接,遵循相应步骤,即可掌控InterSystems FHIRaaS!
关于此次竞赛的任何疑问,请随时跟帖提问,或在 discord-contests channel 中提问。
再次欢迎大家加入此次竞赛,成为InterSystems FHIRaaS 大师! ✌🏼
Happy coding! :) 原帖更新:
您可以在AWS上免费访问FHIRaaS! 那么,掌握FHIRaaS的第一步,是使用URL的特殊code在ISC Dev FHIR Portal 门户注册,链接如下:👉🏼 https://portal.trial.isccloud.io/account/signup
不要错过哦!
文章
Michael Lei · 七月 27, 2021
以下步骤展示如何显示 `/api/monitor` 服务提供的指标列表示例。
在上个帖子中,我概述了以 Prometheus 格式显示 IRIS 指标的服务。 该贴介绍了如何在容器中设置和运行 [IRIS 预览版 2019.4](https://community.intersystems.com/post/intersystems-iris-and-iris-health-20194-preview-published),然后列出了指标。
本帖假定您已安装 Docker。 如果未安装,现在就为您的平台安装吧 :)
### 步骤 1. 下载并运行 docker 形式的 IRIS 预览版
按照[预览发行版](https://wrc.intersystems.com/wrc/coDistPreview.csp "Preview Distributions")的下载说明下载**预览版许可证密钥**和 **IRIS Docker 映像**。 例如,我选择了 **InterSystems IRIS for Health 2019.4**。
按照 [Docker 容器中的 InterSystems 产品初见](https://docs.intersystems.com/irislatest/csp/docbook/Doc.View.cls?KEY=AFL_containers "Run IRIS in a container instructions")中的说明操作。 如果您熟悉容器,请跳转到标题为“**下载 InterSystems IRIS Docker 映像**”的部分。
以下终端输出说明了我用来加载 docker 映像的过程。 docker load 命令可能需要几分钟的时间才能运行;
$ pwd
/Users/myhome/Downloads/iris_2019.4
$ ls
InterSystems IRIS for Health (Container)_2019.4.0_Docker(Ubuntu)_12-31-2019.ISCkey irishealth-2019.4.0.379.0-docker.tar
$ docker load -i irishealth-2019.4.0.379.0-docker.tar
762d8e1a6054: Loading layer [==================================================>] 91.39MB/91.39MB
e45cfbc98a50: Loading layer [==================================================>] 15.87kB/15.87kB
d60e01b37e74: Loading layer [==================================================>] 12.29kB/12.29kB
b57c79f4a9f3: Loading layer [==================================================>] 3.072kB/3.072kB
b11f1f11664d: Loading layer [==================================================>] 73.73MB/73.73MB
22202f62822e: Loading layer [==================================================>] 2.656GB/2.656GB
50457c8fa41f: Loading layer [==================================================>] 14.5MB/14.5MB
bc4f7221d76a: Loading layer [==================================================>] 2.048kB/2.048kB
4db3eda3ff8f: Loading layer [==================================================>] 1.491MB/1.491MB
Loaded image: intersystems/irishealth:2019.4.0.379.0
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
intersystems/irishealth 2019.4.0.379.0 975a976ad1f4 3 weeks ago 2.83GB
为简单起见,将密钥文件复制将用于持久性存储的文件夹位置,并重命名为 `iris.key`;
$ mkdir -p /Users/myhome/iris/20194
$ cp 'InterSystems IRIS for Health (Container)_2019.4.0_Docker(Ubuntu)_12-31-2019.ISCkey' /Users/myhome/iris/20194/iris.key
$ cd /Users/myhome/iris/20194
$ ls
iris.key
使用为持久性存储创建的文件夹启动 IRIS;
$ docker run --name iris --init --detach --publish 52773:52773 --volume `pwd`:/external intersystems/irishealth:2019.4.0.379.0 --key /external/iris.key
$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
009e52c121f0 intersystems/irishealth:2019.4.0.379.0 "/iris-main --key /e…" About a minute ago Up About a minute (healthy) 0.0.0.0:52773->52773/tcp iris
很好! 您现在可以连接到正在运行的容器上的[系统管理门户](http://localhost:52773/csp/sys/%25CSP.Portal.Home.zen "Home SMP")。 我使用的登录名/密码是 _SuperUser/SYS_;您第一次登录时会被提示更改密码。
导航到 Web 应用程序。 `System > Security Management > Web Applications`
您将看到一个 Web 应用程序:`/api/monitor`,这是用于显示 IRIS 指标的服务。
> **您无需执行任何操作即可返回指标,它直接可用。**
### 步骤 2. 预览指标
在以后的帖子中,我们将使用 Prometheus 或 SAM _抓取_此端点,以设置的间隔收集指标。 但现在,让我们看一下为此实例返回的指标的完整列表。 例如,在 Linux 和 OSX 上,一个简单的方法是使用 `curl` 命令发出一个 HTTP GET。 例如,在我的(几乎不活动的)容器上,列表的开头为:
$ curl localhost:52773/api/monitor/metrics
:
:
iris_cpu_usage 0
iris_csp_activity{id="127.0.0.1:52773"} 56
iris_csp_actual_connections{id="127.0.0.1:52773"} 8
iris_csp_gateway_latency{id="127.0.0.1:52773"} .588
iris_csp_in_use_connections{id="127.0.0.1:52773"} 1
iris_csp_private_connections{id="127.0.0.1:52773"} 0
iris_csp_sessions 1
iris_cache_efficiency 35.565
:
:
等等。 在生产系统上,该列表可能非常长。 我在帖子末尾转储了完整列表。
另一个实用方法是使用 [Postman 应用程序](https://www.getpostman.com "POSTMAN"),但还有其他方法。 假定您已安装适合您的平台的 Postman,则可以发出 HTTP GET 并查看返回的指标。
## 总结
暂时就这么多内容。 在下个帖子中,我将从收集 _Prometheus_ 中的数据开始,并查看一个 _Grafana_ 仪表板示例。
### 预览容器中的完整列表
生产系统将提供更多指标。 从一些标签中可以看出,例如 `{id="IRISLOCALDATA"}` ,有一些指标与数据库有关,或者按进程类型对应于 CPU `{id="CSPDMN"}`。
iris_cpu_pct{id="CSPDMN"} 0
iris_cpu_pct{id="CSPSRV"} 0
iris_cpu_pct{id="ECPWorker"} 0
iris_cpu_pct{id="GARCOL"} 0
iris_cpu_pct{id="JRNDMN"} 0
iris_cpu_pct{id="LICENSESRV"} 0
iris_cpu_pct{id="WDSLAVE"} 0
iris_cpu_pct{id="WRTDMN"} 0
iris_cpu_usage 0
iris_csp_activity{id="127.0.0.1:52773"} 57
iris_csp_actual_connections{id="127.0.0.1:52773"} 8
iris_csp_gateway_latency{id="127.0.0.1:52773"} .574
iris_csp_in_use_connections{id="127.0.0.1:52773"} 1
iris_csp_private_connections{id="127.0.0.1:52773"} 0
iris_csp_sessions 1
iris_cache_efficiency 35.850
iris_db_expansion_size_mb{id="ENSLIB"} 0
iris_db_expansion_size_mb{id="HSCUSTOM"} 0
iris_db_expansion_size_mb{id="HSLIB"} 0
iris_db_expansion_size_mb{id="HSSYS"} 0
iris_db_expansion_size_mb{id="IRISAUDIT"} 0
iris_db_expansion_size_mb{id="IRISLOCALDATA"} 0
iris_db_expansion_size_mb{id="IRISSYS"} 0
iris_db_expansion_size_mb{id="IRISTEMP"} 0
iris_db_free_space{id="ENSLIB"} .055
iris_db_free_space{id="HSCUSTOM"} 2.3
iris_db_free_space{id="HSLIB"} 113
iris_db_free_space{id="HSSYS"} 9.2
iris_db_free_space{id="IRISAUDIT"} .094
iris_db_free_space{id="IRISLOCALDATA"} .34
iris_db_free_space{id="IRISSYS"} 6.2
iris_db_free_space{id="IRISTEMP"} 20
iris_db_latency{id="ENSLIB"} 0.030
iris_db_latency{id="HSCUSTOM"} 0.146
iris_db_latency{id="HSLIB"} 0.027
iris_db_latency{id="HSSYS"} 0.018
iris_db_latency{id="IRISAUDIT"} 0.017
iris_db_latency{id="IRISSYS"} 0.020
iris_db_latency{id="IRISTEMP"} 0.021
iris_db_max_size_mb{id="ENSLIB"} 0
iris_db_max_size_mb{id="HSCUSTOM"} 0
iris_db_max_size_mb{id="HSLIB"} 0
iris_db_max_size_mb{id="HSSYS"} 0
iris_db_max_size_mb{id="IRISAUDIT"} 0
iris_db_max_size_mb{id="IRISLOCALDATA"} 0
iris_db_max_size_mb{id="IRISSYS"} 0
iris_db_max_size_mb{id="IRISTEMP"} 0
iris_db_size_mb{id="HSLIB",dir="/usr/irissys/mgr/hslib/"} 1321
iris_db_size_mb{id="HSSYS",dir="/usr/irissys/mgr/hssys/"} 21
iris_db_size_mb{id="ENSLIB",dir="/usr/irissys/mgr/enslib/"} 209
iris_db_size_mb{id="IRISSYS",dir="/usr/irissys/mgr/"} 113
iris_db_size_mb{id="HSCUSTOM",dir="/usr/irissys/mgr/HSCUSTOM/"} 11
iris_db_size_mb{id="IRISTEMP",dir="/usr/irissys/mgr/iristemp/"} 21
iris_db_size_mb{id="IRISAUDIT",dir="/usr/irissys/mgr/irisaudit/"} 1
iris_db_size_mb{id="IRISLOCALDATA",dir="/usr/irissys/mgr/irislocaldata/"} 1
iris_directory_space{id="HSLIB",dir="/usr/irissys/mgr/hslib/"} 53818
iris_directory_space{id="HSSYS",dir="/usr/irissys/mgr/hssys/"} 53818
iris_directory_space{id="ENSLIB",dir="/usr/irissys/mgr/enslib/"} 53818
iris_directory_space{id="IRISSYS",dir="/usr/irissys/mgr/"} 53818
iris_directory_space{id="HSCUSTOM",dir="/usr/irissys/mgr/HSCUSTOM/"} 53818
iris_directory_space{id="IRISTEMP",dir="/usr/irissys/mgr/iristemp/"} 53818
iris_directory_space{id="IRISAUDIT",dir="/usr/irissys/mgr/irisaudit/"} 53818
iris_disk_percent_full{id="HSLIB",dir="/usr/irissys/mgr/hslib/"} 10.03
iris_disk_percent_full{id="HSSYS",dir="/usr/irissys/mgr/hssys/"} 10.03
iris_disk_percent_full{id="ENSLIB",dir="/usr/irissys/mgr/enslib/"} 10.03
iris_disk_percent_full{id="IRISSYS",dir="/usr/irissys/mgr/"} 10.03
iris_disk_percent_full{id="HSCUSTOM",dir="/usr/irissys/mgr/HSCUSTOM/"} 10.03
iris_disk_percent_full{id="IRISTEMP",dir="/usr/irissys/mgr/iristemp/"} 10.03
iris_disk_percent_full{id="IRISAUDIT",dir="/usr/irissys/mgr/irisaudit/"} 10.03
iris_ecp_conn 0
iris_ecp_conn_max 2
iris_ecp_connections 0
iris_ecp_latency 0
iris_ecps_conn 0
iris_ecps_conn_max 1
iris_glo_a_seize_per_sec 0
iris_glo_n_seize_per_sec 0
iris_glo_ref_per_sec 7
iris_glo_ref_rem_per_sec 0
iris_glo_seize_per_sec 0
iris_glo_update_per_sec 2
iris_glo_update_rem_per_sec 0
iris_journal_size 2496
iris_journal_space 50751.18
iris_jrn_block_per_sec 0
iris_jrn_entry_per_sec 0
iris_jrn_free_space{id="WIJ",dir="default"} 50751.18
iris_jrn_free_space{id="primary",dir="/usr/irissys/mgr/journal/"} 50751.18
iris_jrn_free_space{id="secondary",dir="/usr/irissys/mgr/journal/"} 50751.18
iris_jrn_size{id="WIJ"} 100
iris_jrn_size{id="primary"} 2
iris_jrn_size{id="secondary"} 0
iris_license_available 31
iris_license_consumed 1
iris_license_percent_used 3
iris_log_reads_per_sec 5
iris_obj_a_seize_per_sec 0
iris_obj_del_per_sec 0
iris_obj_hit_per_sec 2
iris_obj_load_per_sec 0
iris_obj_miss_per_sec 0
iris_obj_new_per_sec 0
iris_obj_seize_per_sec 0
iris_page_space_per_cent_used 0
iris_phys_mem_per_cent_used 95
iris_phys_reads_per_sec 0
iris_phys_writes_per_sec 0
iris_process_count 29
iris_rtn_a_seize_per_sec 0
iris_rtn_call_local_per_sec 10
iris_rtn_call_miss_per_sec 0
iris_rtn_call_remote_per_sec 0
iris_rtn_load_per_sec 0
iris_rtn_load_rem_per_sec 0
iris_rtn_seize_per_sec 0
iris_sam_get_db_sensors_seconds .000838
iris_sam_get_jrn_sensors_seconds .001024
iris_system_alerts 0
iris_system_alerts_new 0
iris_system_state 0
iris_trans_open_count 0
iris_trans_open_secs 0
iris_trans_open_secs_max 0
iris_wd_buffer_redirty 0
iris_wd_buffer_write 0
iris_wd_cycle_time 0
iris_wd_proc_in_global 0
iris_wd_size_write 0
iris_wd_sleep 10002
iris_wd_temp_queue 42
iris_wd_temp_write 0
iris_wdwij_time 0
iris_wd_write_time 0
iris_wij_writes_per_sec 0
公告
jieliang liu · 五月 23, 2021
InterSystems API Manager (IAM)的2.3版本的正式版本已经发布。
IAM的容器,包括从IAM早期版本升级的所有相关工件,可以从。WRC软件分发站点 的组件区下载.
这个版本的构建号是IAM 2.3.3.2-1。
这个版本是基于Kong企业版2.3.3.2。
InterSystems API Manager 2.3使其更容易以安全的方式和高可用性的场景进行部署 它有许多新的功能,包括:
引入了混合模式
更广泛地支持Docker Secrets
混合模式允许你在数据面和控制面部署IAM节点。当数据平面处理API流量时,控制平面用于配置数据平面节点并观察来自数据平面的遥测数据。这赋予了部署更多的灵活性,减轻了部署HA场景的工作量。关于混合模式的更多信息可以在[这里](https://docs.konghq.com/enterprise/2.3.x/deployment/hybrid-mode/)找到。在接下来的日子里,InterSystems开发者社区也将更详细地介绍这一功能。
IAM 2.3的文档可以在 这里找到。该文档只涉及IAM特有的元素。产品中的文档链接将用户直接带到Kong Enterprise的文档。
从IAM 1.5.0.9升级需要通过两个中间版本进行增量升级,这在文档中会有更详细的描述。
IAM仅以OCI(Open Container Initiative)又称Docker容器格式提供。容器镜像可用于Linux x86-64和Linux ARM64的OCI兼容运行时引擎,详见 支持平台文件。
Best Regards,
Stefan
公告
Michael Lei · 九月 29, 2021
亲爱的社区开发者们,大家好!
欢迎积极参与新一轮InterSystems系联开发者竞赛!
🏆 InterSystems 互操作性大赛 🏆
时间: 2021年10月4日--24日
总奖金池高达 9,450美金!
奖项设置
1. 专家提名奖(Experts Nomination) - 获奖者由我们特别挑选的专家团选出:
🥇 第1名 - $4,000
🥈 第2名 - $2,000
🥉 第3名 - $1,000
🌟 新设奖项: 第4到第10名 - $100
2. 社区提名奖(Community Nomination) -获得总投票数最多的应用:
🥇 第1名 - $1,000
🥈 第2名 - $500
🥉 第3名 - $250
如果同时多位参赛者获得同样的票数,均被视为优胜者,将平分奖金
谁可以参加?
任何开发者社区的成员均可参加,InterSystems内部员工除外(InterSystems contractor员工可以参加)。还没有账号?现在来建一个!
👥 开发者可以组团 创建一个协作应用程序,组团限定人数为2-5人。
请注意,要在您的README文件中标注您的团队成员——社区用户profile
参赛时间安排
🛠 10月 4日-17日: 应用开发、提交阶段
✅ 10月 18日 - 24日: 投票阶段
注意:在整个参赛期间(开发与投票期间,即10月4日-10月24日),开发者可持续编辑、完善其应用程序
主题
💡 InterSystems IRIS 与 IRIS 医疗版互操作性解决方案 💡
基于InterSystems IRIS 或 InterSystems IRIS 医疗版开发一个互操作性解决方案或者能够帮助开发或维护互操作性的方案;
参赛须知:
有效应用程序:100%全新的Open Exchange Apps或已有的应用程序(但有显著提升)。所有参赛者/团队提交的应用程序只有经过我们团队的审核之后才会被批准参赛。
该应用应该在 IRIS Community Edition or IRIS for Health Community Edition or IRIS Advanced Analytics Community Edition 上工作。
该应用需开源并在GitHub上发布。
该应用的README文件应为英文,包含安装步骤,并包含视频demo或/和应用程序如何运行的描述。
技术资源
1. IRIS初学者:
Build a Server-Side Application with InterSystems IRIS
Learning Path for beginners
2. 应用样例:
Ensemble/互操作性构成
IRIS-互操作性-模版
ETL-互操作性-适配器
InterSystems IRIS医疗版互操作性Demo ENSDEMO
HL7 和 SMS 互操作性 Demo
医疗行业 HL7 XML
RabbitMQ 适配器
基于Kafka的产品扩展 demo
3. 在线课程和视频:
企业中的互操作性
互操作性快速入门指南
互操作性资源 - 2019
智慧的互操作性
医疗互操作性概览
4. 如何将您的APP提交给大赛
如何在InterSystems Open Exchange上发布应用程序
如何把参赛APP提交给大赛
参赛评比
投票规则即将发布,敬请期待!
各就位,预备,跑!
期待您的精彩提交!加入我们的编程马拉松,赢取大奖
❗️ 点击此处,查看 官方竞赛条款解读❗️
文章
Jingwei Wang · 十月 28, 2021
html {overflow-x: initial !important;}:root { --bg-color: #ffffff; --text-color: #333333; --select-text-bg-color: #B5D6FC; --select-text-font-color: auto; --monospace: "Lucida Console",Consolas,"Courier",monospace; --title-bar-height: 20px; }
.mac-os-11 { --title-bar-height: 28px; }
html { font-size: 14px; background-color: var(--bg-color); color: var(--text-color); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
body { margin: 0px; padding: 0px; height: auto; inset: 0px; font-size: 1rem; line-height: 1.42857143; overflow-x: hidden; background-image: inherit; background-size: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: inherit; tab-size: 4; background-position: inherit; background-repeat: inherit; }
iframe { margin: auto; }
a.url { word-break: break-all; }
a:active, a:hover { outline: 0px; }
.in-text-selection, ::selection { text-shadow: none; background: var(--select-text-bg-color); color: var(--select-text-font-color); }
#write { margin: 0px auto; height: auto; width: inherit; word-break: normal; word-wrap: break-word; position: relative; white-space: normal; overflow-x: visible; padding-top: 36px; }
#write.first-line-indent p { text-indent: 2em; }
#write.first-line-indent li p, #write.first-line-indent p * { text-indent: 0px; }
#write.first-line-indent li { margin-left: 2em; }
.for-image #write { padding-left: 8px; padding-right: 8px; }
body.typora-export { padding-left: 30px; padding-right: 30px; }
.typora-export .footnote-line, .typora-export li, .typora-export p { white-space: pre-wrap; }
.typora-export .task-list-item input { pointer-events: none; }
@media screen and (max-width: 500px) {
body.typora-export { padding-left: 0px; padding-right: 0px; }
#write { padding-left: 20px; padding-right: 20px; }
.CodeMirror-sizer { margin-left: 0px !important; }
.CodeMirror-gutters { display: none !important; }
}
#write li > figure:last-child { margin-bottom: 0.5rem; }
#write ol, #write ul { position: relative; }
img { max-width: 100%; vertical-align: middle; image-orientation: from-image; }
button, input, select, textarea { color: inherit; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; }
input[type="checkbox"], input[type="radio"] { line-height: normal; padding: 0px; }
*, ::after, ::before { box-sizing: border-box; }
#write h1, #write h2, #write h3, #write h4, #write h5, #write h6, #write p, #write pre { width: inherit; }
#write h1, #write h2, #write h3, #write h4, #write h5, #write h6, #write p { position: relative; }
p { line-height: inherit; }
h1, h2, h3, h4, h5, h6 { break-after: avoid-page; break-inside: avoid; orphans: 4; }
p { orphans: 4; }
h1 { font-size: 2rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.6rem; }
h4 { font-size: 1.4rem; }
h5 { font-size: 1.2rem; }
h6 { font-size: 1rem; }
.md-math-block, .md-rawblock, h1, h2, h3, h4, h5, h6, p { margin-top: 1rem; margin-bottom: 1rem; }
.hidden { display: none; }
.md-blockmeta { color: rgb(204, 204, 204); font-weight: 700; font-style: italic; }
a { cursor: pointer; }
sup.md-footnote { padding: 2px 4px; background-color: rgba(238, 238, 238, 0.7); color: rgb(85, 85, 85); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; cursor: pointer; }
sup.md-footnote a, sup.md-footnote a:hover { color: inherit; text-transform: inherit; text-decoration: inherit; }
#write input[type="checkbox"] { cursor: pointer; width: inherit; height: inherit; }
figure { overflow-x: auto; margin: 1.2em 0px; max-width: calc(100% + 16px); padding: 0px; }
figure > table { margin: 0px; }
tr { break-inside: avoid; break-after: auto; }
thead { display: table-header-group; }
table { border-collapse: collapse; border-spacing: 0px; width: 100%; overflow: auto; break-inside: auto; text-align: left; }
table.md-table td { min-width: 32px; }
.CodeMirror-gutters { border-right-width: 0px; background-color: inherit; }
.CodeMirror-linenumber { }
.CodeMirror { text-align: left; }
.CodeMirror-placeholder { opacity: 0.3; }
.CodeMirror pre { padding: 0px 4px; }
.CodeMirror-lines { padding: 0px; }
div.hr:focus { cursor: none; }
#write pre { white-space: pre-wrap; }
#write.fences-no-line-wrapping pre { white-space: pre; }
#write pre.ty-contain-cm { white-space: normal; }
.CodeMirror-gutters { margin-right: 4px; }
.md-fences { font-size: 0.9rem; display: block; break-inside: avoid; text-align: left; overflow: visible; white-space: pre; background-image: inherit; background-size: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: inherit; position: relative !important; background-position: inherit; background-repeat: inherit; }
.md-fences-adv-panel { width: 100%; margin-top: 10px; text-align: center; padding-top: 0px; padding-bottom: 8px; overflow-x: auto; }
#write .md-fences.mock-cm { white-space: pre-wrap; }
.md-fences.md-fences-with-lineno { padding-left: 0px; }
#write.fences-no-line-wrapping .md-fences.mock-cm { white-space: pre; overflow-x: auto; }
.md-fences.mock-cm.md-fences-with-lineno { padding-left: 8px; }
.CodeMirror-line, twitterwidget { break-inside: avoid; }
.footnotes { opacity: 0.8; font-size: 0.9rem; margin-top: 1em; margin-bottom: 1em; }
.footnotes + .footnotes { margin-top: 0px; }
.md-reset { margin: 0px; padding: 0px; border: 0px; outline: 0px; vertical-align: top; text-decoration: none; text-shadow: none; float: none; position: static; width: auto; height: auto; white-space: nowrap; cursor: inherit; line-height: normal; font-weight: 400; text-align: left; box-sizing: content-box; direction: ltr; background-position: 0px 0px; }
li div { padding-top: 0px; }
blockquote { margin: 1rem 0px; }
li .mathjax-block, li p { margin: 0.5rem 0px; }
li blockquote { margin: 1rem 0px; }
li { margin: 0px; position: relative; }
blockquote > :last-child { margin-bottom: 0px; }
blockquote > :first-child, li > :first-child { margin-top: 0px; }
.footnotes-area { color: rgb(136, 136, 136); margin-top: 0.714rem; padding-bottom: 0.143rem; white-space: normal; }
#write .footnote-line { white-space: pre-wrap; }
@media print {
body, html { border: 1px solid transparent; height: 99%; break-after: avoid; break-before: avoid; font-variant-ligatures: no-common-ligatures; }
#write { margin-top: 0px; padding-top: 0px; border-color: transparent !important; }
.typora-export * { -webkit-print-color-adjust: exact; }
.typora-export #write { break-after: avoid; }
.typora-export #write::after { height: 0px; }
.is-mac table { break-inside: avoid; }
.typora-export-show-outline .typora-export-sidebar { display: none; }
}
.footnote-line { margin-top: 0.714em; font-size: 0.7em; }
a img, img a { cursor: pointer; }
pre.md-meta-block { font-size: 0.8rem; min-height: 0.8rem; white-space: pre-wrap; background-color: rgb(204, 204, 204); display: block; overflow-x: hidden; }
p > .md-image:only-child:not(.md-img-error) img, p > img:only-child { display: block; margin: auto; }
#write.first-line-indent p > .md-image:only-child:not(.md-img-error) img { left: -2em; position: relative; }
p > .md-image:only-child { display: inline-block; width: 100%; }
#write .MathJax_Display { margin: 0.8em 0px 0px; }
.md-math-block { width: 100%; }
.md-math-block:not(:empty)::after { display: none; }
.MathJax_ref { fill: currentcolor; }
[contenteditable="true"]:active, [contenteditable="true"]:focus, [contenteditable="false"]:active, [contenteditable="false"]:focus { outline: 0px; box-shadow: none; }
.md-task-list-item { position: relative; list-style-type: none; }
.task-list-item.md-task-list-item { padding-left: 0px; }
.md-task-list-item > input { position: absolute; top: 0px; left: 0px; margin-left: -1.2em; margin-top: calc(1em - 10px); border: none; }
.math { font-size: 1rem; }
.md-toc { min-height: 3.58rem; position: relative; font-size: 0.9rem; border-top-left-radius: 10px; border-top-right-radius: 10px; border-bottom-right-radius: 10px; border-bottom-left-radius: 10px; }
.md-toc-content { position: relative; margin-left: 0px; }
.md-toc-content::after, .md-toc::after { display: none; }
.md-toc-item { display: block; color: rgb(65, 131, 196); }
.md-toc-item a { text-decoration: none; }
.md-toc-inner:hover { text-decoration: underline; }
.md-toc-inner { display: inline-block; cursor: pointer; }
.md-toc-h1 .md-toc-inner { margin-left: 0px; font-weight: 700; }
.md-toc-h2 .md-toc-inner { margin-left: 2em; }
.md-toc-h3 .md-toc-inner { margin-left: 4em; }
.md-toc-h4 .md-toc-inner { margin-left: 6em; }
.md-toc-h5 .md-toc-inner { margin-left: 8em; }
.md-toc-h6 .md-toc-inner { margin-left: 10em; }
@media screen and (max-width: 48em) {
.md-toc-h3 .md-toc-inner { margin-left: 3.5em; }
.md-toc-h4 .md-toc-inner { margin-left: 5em; }
.md-toc-h5 .md-toc-inner { margin-left: 6.5em; }
.md-toc-h6 .md-toc-inner { margin-left: 8em; }
}
a.md-toc-inner { font-size: inherit; font-style: inherit; font-weight: inherit; line-height: inherit; }
.footnote-line a:not(.reversefootnote) { color: inherit; }
.md-attr { display: none; }
.md-fn-count::after { content: "."; }
code, pre, samp, tt { font-family: var(--monospace); }
kbd { margin: 0px 0.1em; padding: 0.1em 0.6em; font-size: 0.8em; color: rgb(36, 39, 41); background-color: rgb(255, 255, 255); border: 1px solid rgb(173, 179, 185); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; box-shadow: rgba(12, 13, 14, 0.2) 0px 1px 0px, rgb(255, 255, 255) 0px 0px 0px 2px inset; white-space: nowrap; vertical-align: middle; }
.md-comment { color: rgb(162, 127, 3); opacity: 0.8; font-family: var(--monospace); }
code { text-align: left; }
a.md-print-anchor { white-space: pre !important; border: none !important; display: inline-block !important; position: absolute !important; width: 1px !important; right: 0px !important; outline: 0px !important; text-shadow: initial !important; background-position: 0px 0px !important; }
.md-inline-math .MathJax_SVG .noError { display: none !important; }
.html-for-mac .inline-math-svg .MathJax_SVG { vertical-align: 0.2px; }
.md-fences-math .MathJax_SVG_Display, .md-math-block .MathJax_SVG_Display { text-align: center; margin: 0px; position: relative; text-indent: 0px; max-width: none; max-height: none; min-height: 0px; min-width: 100%; width: auto; overflow-y: visible; display: block !important; }
.MathJax_SVG_Display, .md-inline-math .MathJax_SVG_Display { width: auto; margin: inherit; display: inline-block !important; }
.MathJax_SVG .MJX-monospace { font-family: var(--monospace); }
.MathJax_SVG .MJX-sans-serif { font-family: sans-serif; }
.MathJax_SVG { display: inline; font-style: normal; font-weight: 400; line-height: normal; text-indent: 0px; text-align: left; text-transform: none; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; zoom: 90%; }
#math-inline-preview-content { zoom: 1.1; }
.MathJax_SVG * { transition: none; }
.MathJax_SVG_Display svg { vertical-align: middle !important; margin-bottom: 0px !important; margin-top: 0px !important; }
.os-windows.monocolor-emoji .md-emoji { font-family: "Segoe UI Symbol", sans-serif; }
.md-diagram-panel > svg { max-width: 100%; }
[lang="flow"] svg, [lang="mermaid"] svg { max-width: 100%; height: auto; }
[lang="mermaid"] .node text { font-size: 1rem; }
table tr th { border-bottom-width: 0px; }
video { max-width: 100%; display: block; margin: 0px auto; }
iframe { max-width: 100%; width: 100%; border: none; }
.highlight td, .highlight tr { border: 0px; }
mark { background-color: rgb(255, 255, 0); color: rgb(0, 0, 0); }
.md-html-inline .md-plain, .md-html-inline strong, mark .md-inline-math, mark strong { color: inherit; }
.md-expand mark .md-meta { opacity: 0.3 !important; }
mark .md-meta { color: rgb(0, 0, 0); }
@media print {
.typora-export h1, .typora-export h2, .typora-export h3, .typora-export h4, .typora-export h5, .typora-export h6 { break-inside: avoid; }
}
.md-diagram-panel .messageText { stroke: none !important; }
.md-diagram-panel .start-state { fill: var(--node-fill); }
.md-diagram-panel .edgeLabel rect { opacity: 1 !important; }
.md-require-zoom-fix foreignObject { font-size: var(--mermaid-font-zoom); }
.md-fences.md-fences-math { font-size: 1em; }
.md-fences-math .MathJax_SVG_Display { margin-top: 8px; cursor: default; }
.md-fences-advanced:not(.md-focus) { padding: 0px; white-space: nowrap; border: 0px; }
.md-fences-advanced:not(.md-focus) { background-image: inherit; background-size: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: inherit; background-position: inherit; background-repeat: inherit; }
.typora-export-show-outline .typora-export-content { max-width: 1440px; margin: auto; display: flex; flex-direction: row; }
.typora-export-sidebar { width: 300px; font-size: 0.8rem; margin-top: 80px; margin-right: 18px; }
.typora-export-show-outline #write { --webkit-flex: 2; flex: 2 1 0%; }
.typora-export-sidebar .outline-content { position: fixed; top: 0px; max-height: 100%; overflow: hidden auto; padding-bottom: 30px; padding-top: 60px; width: 300px; }
@media screen and (max-width: 1024px) {
.typora-export-sidebar, .typora-export-sidebar .outline-content { width: 240px; }
}
@media screen and (max-width: 800px) {
.typora-export-sidebar { display: none; }
}
.outline-content li, .outline-content ul { margin-left: 0px; margin-right: 0px; padding-left: 0px; padding-right: 0px; list-style: none; }
.outline-content ul { margin-top: 0px; margin-bottom: 0px; }
.outline-content strong { font-weight: 400; }
.outline-expander { width: 1rem; height: 1.428571429rem; position: relative; display: table-cell; vertical-align: middle; cursor: pointer; padding-left: 4px; }
.outline-expander::before { content: ''; position: relative; font-family: Ionicons; display: inline-block; font-size: 8px; vertical-align: middle; }
.outline-item { padding-top: 3px; padding-bottom: 3px; cursor: pointer; }
.outline-expander:hover::before { content: ''; }
.outline-h1 > .outline-item { padding-left: 0px; }
.outline-h2 > .outline-item { padding-left: 1em; }
.outline-h3 > .outline-item { padding-left: 2em; }
.outline-h4 > .outline-item { padding-left: 3em; }
.outline-h5 > .outline-item { padding-left: 4em; }
.outline-h6 > .outline-item { padding-left: 5em; }
.outline-label { cursor: pointer; display: table-cell; vertical-align: middle; text-decoration: none; color: inherit; }
.outline-label:hover { text-decoration: underline; }
.outline-item:hover { border-color: rgb(245, 245, 245); background-color: var(--item-hover-bg-color); }
.outline-item:hover { margin-left: -28px; margin-right: -28px; border-left-width: 28px; border-left-style: solid; border-left-color: transparent; border-right-width: 28px; border-right-style: solid; border-right-color: transparent; }
.outline-item-single .outline-expander::before, .outline-item-single .outline-expander:hover::before { display: none; }
.outline-item-open > .outline-item > .outline-expander::before { content: ''; }
.outline-children { display: none; }
.info-panel-tab-wrapper { display: none; }
.outline-item-open > .outline-children { display: block; }
.typora-export .outline-item { padding-top: 1px; padding-bottom: 1px; }
.typora-export .outline-item:hover { margin-right: -8px; border-right-width: 8px; border-right-style: solid; border-right-color: transparent; }
.typora-export .outline-expander::before { content: "+"; font-family: inherit; top: -1px; }
.typora-export .outline-expander:hover::before, .typora-export .outline-item-open > .outline-item > .outline-expander::before { content: '−'; }
.typora-export-collapse-outline .outline-children { display: none; }
.typora-export-collapse-outline .outline-item-open > .outline-children, .typora-export-no-collapse-outline .outline-children { display: block; }
.typora-export-no-collapse-outline .outline-expander::before { content: "" !important; }
.typora-export-show-outline .outline-item-active > .outline-item .outline-label { font-weight: 700; }
:root {
--side-bar-bg-color: #fafafa;
--control-text-color: #777;
}
@include-when-export url(https://fonts.loli.net/css?family=Open+Sans:400italic,700italic,700,400&subset=latin,latin-ext);
/* open-sans-regular - latin-ext_latin */
/* open-sans-italic - latin-ext_latin */
/* open-sans-700 - latin-ext_latin */
/* open-sans-700italic - latin-ext_latin */
html {
font-size: 16px;
}
body {
font-family: "Open Sans","Clear Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
color: rgb(51, 51, 51);
line-height: 1.6;
}
#write {
max-width: 860px;
margin: 0 auto;
padding: 30px;
padding-bottom: 100px;
}
@media only screen and (min-width: 1400px) {
#write {
max-width: 1024px;
}
}
@media only screen and (min-width: 1800px) {
#write {
max-width: 1200px;
}
}
#write > ul:first-child,
#write > ol:first-child{
margin-top: 30px;
}
a {
color: #4183C4;
}
h1,
h2,
h3,
h4,
h5,
h6 {
position: relative;
margin-top: 1rem;
margin-bottom: 1rem;
font-weight: bold;
line-height: 1.4;
cursor: text;
}
h1:hover a.anchor,
h2:hover a.anchor,
h3:hover a.anchor,
h4:hover a.anchor,
h5:hover a.anchor,
h6:hover a.anchor {
text-decoration: none;
}
h1 tt,
h1 code {
font-size: inherit;
}
h2 tt,
h2 code {
font-size: inherit;
}
h3 tt,
h3 code {
font-size: inherit;
}
h4 tt,
h4 code {
font-size: inherit;
}
h5 tt,
h5 code {
font-size: inherit;
}
h6 tt,
h6 code {
font-size: inherit;
}
h1 {
font-size: 2.25em;
line-height: 1.2;
border-bottom: 1px solid #eee;
}
h2 {
font-size: 1.75em;
line-height: 1.225;
border-bottom: 1px solid #eee;
}
/*@media print {
.typora-export h1,
.typora-export h2 {
border-bottom: none;
padding-bottom: initial;
}
.typora-export h1::after,
.typora-export h2::after {
content: "";
display: block;
height: 100px;
margin-top: -96px;
border-top: 1px solid #eee;
}
}*/
h3 {
font-size: 1.5em;
line-height: 1.43;
}
h4 {
font-size: 1.25em;
}
h5 {
font-size: 1em;
}
h6 {
font-size: 1em;
color: #777;
}
p,
blockquote,
ul,
ol,
dl,
table{
margin: 0.8em 0;
}
li>ol,
li>ul {
margin: 0 0;
}
hr {
height: 2px;
padding: 0;
margin: 16px 0;
background-color: #e7e7e7;
border: 0 none;
overflow: hidden;
box-sizing: content-box;
}
li p.first {
display: inline-block;
}
ul,
ol {
padding-left: 30px;
}
ul:first-child,
ol:first-child {
margin-top: 0;
}
ul:last-child,
ol:last-child {
margin-bottom: 0;
}
blockquote {
border-left: 4px solid #dfe2e5;
padding: 0 15px;
color: #777777;
}
blockquote blockquote {
padding-right: 0;
}
table {
padding: 0;
word-break: initial;
}
table tr {
border: 1px solid #dfe2e5;
margin: 0;
padding: 0;
}
table tr:nth-child(2n),
thead {
background-color: #f8f8f8;
}
table th {
font-weight: bold;
border: 1px solid #dfe2e5;
border-bottom: 0;
margin: 0;
padding: 6px 13px;
}
table td {
border: 1px solid #dfe2e5;
margin: 0;
padding: 6px 13px;
}
table th:first-child,
table td:first-child {
margin-top: 0;
}
table th:last-child,
table td:last-child {
margin-bottom: 0;
}
.CodeMirror-lines {
padding-left: 4px;
}
.code-tooltip {
box-shadow: 0 1px 1px 0 rgba(0,28,36,.3);
border-top: 1px solid #eef2f2;
}
.md-fences,
code,
tt {
border: 1px solid #e7eaed;
background-color: #f8f8f8;
border-radius: 3px;
padding: 0;
padding: 2px 4px 0px 4px;
font-size: 0.9em;
}
code {
background-color: #f3f4f4;
padding: 0 2px 0 2px;
}
.md-fences {
margin-bottom: 15px;
margin-top: 15px;
padding-top: 8px;
padding-bottom: 6px;
}
.md-task-list-item > input {
margin-left: -1.3em;
}
@media print {
html {
font-size: 13px;
}
table,
pre {
page-break-inside: avoid;
}
pre {
word-wrap: break-word;
}
}
.md-fences {
background-color: #f8f8f8;
}
#write pre.md-meta-block {
padding: 1rem;
font-size: 85%;
line-height: 1.45;
background-color: #f7f7f7;
border: 0;
border-radius: 3px;
color: #777777;
margin-top: 0 !important;
}
.mathjax-block>.code-tooltip {
bottom: .375rem;
}
.md-mathjax-midline {
background: #fafafa;
}
#write>h3.md-focus:before{
left: -1.5625rem;
top: .375rem;
}
#write>h4.md-focus:before{
left: -1.5625rem;
top: .285714286rem;
}
#write>h5.md-focus:before{
left: -1.5625rem;
top: .285714286rem;
}
#write>h6.md-focus:before{
left: -1.5625rem;
top: .285714286rem;
}
.md-image>.md-meta {
/*border: 1px solid #ddd;*/
border-radius: 3px;
padding: 2px 0px 0px 4px;
font-size: 0.9em;
color: inherit;
}
.md-tag {
color: #a7a7a7;
opacity: 1;
}
.md-toc {
margin-top:20px;
padding-bottom:20px;
}
.sidebar-tabs {
border-bottom: none;
}
#typora-quick-open {
border: 1px solid #ddd;
background-color: #f8f8f8;
}
#typora-quick-open-item {
background-color: #FAFAFA;
border-color: #FEFEFE #e5e5e5 #e5e5e5 #eee;
border-style: solid;
border-width: 1px;
}
/** focus mode */
.on-focus-mode blockquote {
border-left-color: rgba(85, 85, 85, 0.12);
}
header, .context-menu, .megamenu-content, footer{
font-family: "Segoe UI", "Arial", sans-serif;
}
.file-node-content:hover .file-node-icon,
.file-node-content:hover .file-node-open-state{
visibility: visible;
}
.mac-seamless-mode #typora-sidebar {
background-color: #fafafa;
background-color: var(--side-bar-bg-color);
}
.md-lang {
color: #b4654d;
}
/*.html-for-mac {
--item-hover-bg-color: #E6F0FE;
}*/
#md-notification .btn {
border: 0;
}
.dropdown-menu .divider {
border-color: #e5e5e5;
opacity: 0.4;
}
.ty-preferences .window-content {
background-color: #fafafa;
}
.ty-preferences .nav-group-item.active {
color: white;
background: #999;
}
.menu-item-container a.menu-style-btn {
background-color: #f5f8fa;
background-image: linear-gradient( 180deg , hsla(0, 0%, 100%, 0.8), hsla(0, 0%, 100%, 0));
}
:root {--mermaid-font-zoom:1em ;} @media print { @page {margin: 0 0 0 0;} body.typora-export {padding-left: 0; padding-right: 0;} #write {padding:0;}}
目录
技术概要:InterSystems API 管理器InterSystems API管理器是如何工作的?试一试!在 InterSystems IRIS 中设置 REST API 在 IAM 中为您的 REST API 创建服务在 IAM 中创建路由 从 REST 客户端调用您的 API添加速率限制插件添加您的 REST 规范到 IAM了解有关 InterSystems API Manager 的更多信息
技术概要:InterSystems API 管理器
本文档将向您介绍InterSystems API管理器(InterSystems API Manager ,IAM),解释了它的工作原理,并让您开始在自己的实例上探索它的功能。
InterSystems API管理器是如何工作的?
InterSystems API管理器是 InterSystems IRIS®数据平台的一个组件,它允许您利用由 InterSystems IRIS 应用程序暴露或消费的微服务和 API。作为 InterSystems IRIS的 服务器和应用程序之间的 API 网关(gateway),API 管理器使您能够更有效地监视和控制服务器端 API 和客户端应用程序之间的调用流量。 要了解有关 InterSystems API管理器的更多信息,您可以观看这个概述视频。
试一试!
InterSystems API管理器(InterSystems API Manager ,IAM)是与 InterSystems IRIS 实例分开安装的。要获得自己的 IAM 安装包,您可以从 InterSystems WRC 软件分发(Software Distribution)网站下载 ,或者联系您的 InterSystems 销售工程师。安装包包括一个脚本(iam-setup),用于设置 IAM 并将它与您的 InterSystems IRIS 实例连接。 这个练习假定您有 InterSystems IRIS 和 IAM 的实例,并且已经运行了安装脚本来连接它们。本练习使用 IAM 2.3 版本进行展示。
在 InterSystems IRIS 中设置 REST API
从位于 https://github.com/intersystems/FirstLook-IAM 的 GitHub 存储库中,将以下内容导入 InterSystems IRIS:
/cls/cmAPI 包括使用 API 管理服务生成的三个类文件,以及一个coffeemaker对象定义:
impl.cls
disp.cls
spec.cls
coffeemaker.cls
要导入,请打开 InterSystems IRIS 管理门户(Management Portal),并导航到 Classes 页面(System Explorer(系统资源管理器) > Classes(类));如果您不在 USER 命名空间中,请使用左边的选择器来更改为它,如下图所示:
选择上面列出的四个类并点击 Import(导入)。这将 REST API 导入 InterSystems IRIS,同时导入相应的类,应用程序将使用这些类访问存储在数据库中的coffermakers集合。
/gbl/coffeemakers.gof。
通过进入管理门户(Management Portal),并点击 System Explorer(系统资源管理器)> Globals > Import(导入)来导入。查找 coffeemakers.gof。导入到 User.cmAPI.coffeemaker 模式。
接下来,设置一个 Web 应用程序(Web Application),指向您刚刚导入的 REST 类。Web 应用程序层为自定义和安全提供了额外的机会。在管理门户(Management Portal)中,选择 System Administration(系统管理) > Security(安全) > Applications(应用程序)> Web Applications(Web 应用程序)。点击 Create New Web Application(新建Web 应用程序) 并填写以下设置:
Name(名称): /rest/coffeemakerapp
Namespace(命名空间): USER
Enable Application(启用应用程序):选中此复选框
Enable(启用):选择 REST
Dispatch Class(分派类): cmAPI.disp
安全设置 - Allowed Authentication Methods(允许的身份认证方法): Unauthenticated ,Password
在 IAM 中为您的 REST API 创建服务
正如您在 IAM 概述视频中所看到的,在 IAM 工作流中,有三个主要组件在发挥作用------消费者(Consumers)、路由(Route)和服务(Service)。IAM 中的服务是为您存在于 InterSystems IRIS 中的 API 创建的。在这种情况下,我们将为您的coffeemaker API 创建一个服务。
您从 WRC 下载的 IAM 包还包括一个脚本(iam-test),用于设置示例服务和路由。如果您运行了这个脚本,您将能够查看 test-iris 服务。
我们将取得类似的结果,使用 IAM 门户添加您的Coffeemakers服务。
iam-setup.sh是用来启动 IAM 的,可以通过输入iam-setup.sh 脚本中指定的门户的 URL 来启动 IAM 管理门户(management portal)。默认情况下,URL 是:
http://localhost:8002
选择 default Workspace(默认工作区)。如果默认工作区不可见,而且管理门户(Management Portal)似乎是空的,那么可能是您没有输入 iam-setup.sh 定义的确切 URL。
选择 API Gateway(API 网关) 中的 Services(服务),并选择 New Service(新的服务)。请按以下方式填写表格:
Name(名称): 咖啡机服务(CoffeemakerService)
选择 Add using Protocol, Host and Path(添加使用协议、主机和路径)
Protocol(协议): http
Host(主机):[插入您的 InterSystems IRIS 实例的 IP 地址。为避免 DNS 问题,使用 IP 地址的数字形式。]
Path(路径): /rest/coffeemakerapp
Port(端口): [插入您的实例的 webserver 端口,默认为 52773,或者如果实例是在容器中,您已经映射到 web 服务器(webserver) 端口的主机端口]
不要选择"查看 6 个高级字段(View 6 Advanced Fields)"。
选择 Create(创建)。
一旦创建了服务,您就可以查看服务,并需要创建路由。
在 IAM 中创建路由
当您在查看服务时,选择 "添加路由(Add a Route)"。请按以下方式填写表格:
Sevice(服务):此字段已正确地用服务的十六进制的 ID 初始化。
Name(名称): 可以留空
Protocols(协议):http
Hosts(主机): 可以留空
Methods(方法):GET、POST、PUT、DELETE
Paths(路径):select(选择) "+添加路径(Add Path)"并输入 /rest/coffeemakerapp
Headers(标题): 可以留空
HTTPS Redirect Status Code(HTTPS 重定向状态代码): 426(这是默认值)
Tags(标签): 可以留空
不要选择 "查看 4 个高级字段(View 4 Advanced Fields)"。
选择 Create(创建)。
一旦创建了路由,您将通过从 REST 客户端进行简单的 API 调用来测试您的路由和服务。
从 REST 客户端调用您的 API
使用 REST 客户端------可以使用Postman 或来自 Google Chrome 的高级 REST 客户端(Advanced REST Client)------在 InterSystems IRIS 中对您的咖啡机(Coffeemakers) API 进行一个简单的 API 调用。要做到这一点,创建一个请求 URL,其中包括您的 IAM 实例的 IP 地址和端口号,以及您的服务的路径和请求的端点。请务必使用用户名和密码授权您的请求。下面是一个示例;注意,默认情况下,IAM 处理 8000 端口上的代理请求。例如:
POST http://localhost:8000/rest/coffeemakerapp/coffeemakers
一旦您成功地进行了调用,您可以导航回您的 IAM 仪表板(Dashboard),查看来自所进行的调用的统计数据和其他信息。从这个仪表板上,您可以看到许多不同的信息集,这些信息将帮助您监控和控制客户端应用程序和 InterSystems IRIS 内的服务之间的流量。
添加速率限制插件
有效地监测您的 API 流量是有益的,但仅限于使用该信息适当地控制和优化流量。IAM 使您能够使用一些不同的插件来提高您控制客户端和 API 之间流量的能力。
在 IAM 管理门户(Management Portal)中,选择 API Gateway(API 网关) 中的 Plugins(插件) ,并选择 New Plugin(新的插件)。在 Traffic Control(流量控制) 类别中,找到 Rate Limiting(速率限制) 插件,并选择 Enable(启用)。
在这个插件的配置屏幕上:
选择 Scoped(范围)。
在 Service(服务) 中选择咖啡机服务(CoffeeMakerService)。
试一试!
其他大部分字段保留它们的默认值,但将 Config.Limit By 设置为服务(Service),将 Config.Minute 设置为 5。 这将限制所有消费者每分钟只能调用 5 次服务中所有路由。
选择 Create(创建)。
您可以通过返回 REST 客户端并进行示例调用来测试这个速率限制插件。客户端超过限制后,它将得到一个 429 返回错误,并带有"超过 API 速率限制"的信息
添加您的 REST 规范到 IAM
REST 开发的最佳实践方法是规范优先,因此很可能您已经有了自己的 REST 规范。对于这个练习,您可以使用您从 github 下载 FirstLook-IAM 存储库时,spec 目录下的 swagger_100419.json 文件。您也可以直接从 GitHub 存储库的 spec 文件夹中下载 JSON 规范。
https://github.com/intersystems/FirstLook-IAM/blob/master/spec/swagger_100419.json
注意: 有关记录和管理 REST API 规范的更多信息,请参见 Creating REST Services(《创建 REST 服务》)中的 Discovering and Documenting REST APIs(发现和记录 REST API)。
一旦下载,您就能将您的规范添加到 IAM 中:
从 IAM 管理门户(management portal),选择 Workspaces(工作区) 标签并选择默认工作区。
为咖啡机服务(CoffeemakerService)服务选择 View(查看)。
在 Documents(文档) 区域(面板的底部)选择 Add a document(添加一个文档)到这个服务。
点击下面的文件选择器文本框 Or upload a new spec instead...(或者上传一个新的规范代替...) ,然后选择您下载的 swagger_100419.json 文件。
您现在可以查看咖啡机服务(CoffeemakerService)的 OpenAPI 规范。外部开发者也可以访问这个规范,这允许他们开发对它的 REST 调用。由于 curl 命令没有指定正确的服务,所以 "试一试(Try it Out)"选项将无法工作。
了解有关 InterSystems API管理器 的更多信息
注意: 如果没有设置默认的开发门户(dev portal),选择 Set up Dev Portal(设置开发门户)。如果默认的开发门户(Dev Portal)被禁用,选择 Enable Developer Portal(启用开发门户)。它可能需要几分钟的时间来设置。
了解有关 InterSystems API Manager 的更多信息
InterSystems 提供了一些参考资料来了解有关 IAM 的更多信息:
API Manager Introduction(《API Manager 介绍》) (演示)
What is InterSystems API管理器?(《什么是 InterSystems API管理器?》)(视频)
IAM Guide(《IAM 指南》) (文档)
如果您想了解有关如何开发咖啡机服务(CoffeemakerService) REST 服务的更多详细信息,请参见 《技术概要:在 InterSystems 产品中开发 REST 接口》。
文章
Louis Lu · 九月 26, 2021
本技术概要( First Look)通过重点概述和一个基础的、实际操作的示例,向您介绍在 InterSystems IRIS®数据平台上使用 .NET 网关(Gateway)的基础知识。您将了解 InterSystems IRIS 如何与 .NET 程序集进行互操作,在这个示例中,您将创建一个 .NET 网关(Gateway),并从 InterSystems IRIS 中的代理类调用基础 DLL。
本文档设计简单;当您把 .NET 网关(Gateway)引入您的生产系统时,您可能需要做一些不同的事情。本文档末尾的参考资料,提供了有关在生产中使用 .NET 网关(Gateway)的详细和完整的信息。
要浏览所有的技术概要(First Look),包括其他可以在免费的云实例或 web 实例上执行的技术概要(First Look),请参见 InterSystems First Looks(InterSystems 技术概要)。
1. 为什么 .NET 网关(Gateway)很重要
InterSystems IRIS Object Gateway for .NET(也称为".NET 网关(Gateway)")为InterSystems IRIS 与 Microsoft .NET Framework 组件进行互操作提供了一种简便的方法。在使用网关(Gateway)导入 .NET DLL 后,您可以实例化一个外部 .NET 对象,InterSystems IRIS通过代理类将其作为的一个本地对象来操作。
每个代理对象(proxy object)都与相应的 .NET 对象通信,使您能够从 InterSystems IRIS 和 ObjectScript 中访问您的 .NET 类和方法。调用任何 InterSystems IRIS 代理方法都会将消息发送给 .NET 网关(Gateway) 工作线程,该线程会找到合适的方法或构造函数调用。调用的结果发送回代理对象,再将结果返回给 InterSystems IRIS 应用程序。
通常,使用 .NET 网关(Gateway)的最佳方法是在您的应用程序中为第三方 DLL 构建一个小型包装器类(a small wrapper class),然后为包装器生成代理类。包装器类只公开您想要的功能,而不是创建大量应用程序可能不需要的代理类。
2. 探索 .NET 网关(Gateway)
在这个实际操作的示例中,您将:
创建一个 DLL,其中包含要从 InterSystems IRIS 调用的示例类
定义一个 .NET 网关(Gateway),并启动服务器进程
创建一个 ObjectScript 类,从 DLL 生成代理类
创建另一个 ObjectScript 类,以连接到网关(Gateway)并通过代理对象操作 DLL
想试试 InterSystems IRIS .NET 开发和互操作性功能的在线视频演示吗?请看.NET QuickStart(.NET 快速入门)!
2.1 用前须知
要运行这个演示,您需要一个运行 Microsoft .NET Framework 4.5 版本 的 Windows 10 系统、Visual Studio,以及一个已安装的 InterSystems IRIS 实例。(有关安装 InterSystems IRIS 的说明,请参见 InterSystems IRIS Basics:Installation [《InterSystems IRIS 基础:安装》]。)
有关配置 Visual Studio 以连接到您的 InterSystems IRIS 实例的说明,请参见 InterSystems IRIS Basics:Connecting an IDE(《InterSystems IRIS 基础: 连接一个 IDE》)中的 InterSystems IRIS Connection Information(InterSystems IRIS 连接信息)和 .Net IDE。
您还将使用InterSystems 的 Studio IDE(一个在 Windows 系统上运行的客户端应用程序)来创建 ObjectScript 代码;更多信息,请参见InterSystems IRIS Basics: Connecting an IDE(《InterSystems IRIS 基础: 连接一个 IDE》)中的 Using Studio(使用 Studio) 和 Studio。 )
2.2 创建 DLL
使用 Visual Studio,创建一个名为 Person 的类并复制以下 C# 代码。在本例中使用 .NET 4.5。
public class Person {
public int age;
public String name;
//constructor
public Person (int startAge, String Name) {
age = startAge;
name = Name;
}
public void setAge(int newAge) {
age = newAge;
}
public String getName() {
return name;
}
public int getAge() {
return age;
}
public static void main(String []args) {
Person myPerson = new Person (5, "Tom");
Console.Out.WriteLine(myPerson.getName());
Console.Out.WriteLine(myPerson.getAge());
}
}
编译 Person 类,并生成一个 Person.dll 文件。注意 DLL 的位置,因为您稍后会需要它。
2.3 创建并启动 .NET 网关
使用 InterSystems IRIS Basics:Connecting an IDE(《InterSystems IRIS 基础: 连接一个 IDE》)中的 InterSystems IRIS Connection Information(InterSystems IRIS 连接信息)描述的 URL,在浏览器中打开您的实例的管理门户(Management Portal)。
导航至 System Administration(系统管理) > Configuration(配置) > Connectivity(连接) > External Language Servers(外部语言服务)。
选择 Create External Language Server(创建外部语言服务)。
输入 Server Name(网关名称)。
在 Server Type (服务类型)中选择 .Net
在 Port(端口)字段中,输入 55000。
对于 .NET Version(.NET 版本),请选择 4.5。
选择 Save(保存)。
在External Language Servers(外部语言服务)页面,找到您刚刚定义的网关(Gateway),并选择 Start(开始)
2.4 生成代理类
使用 Studio, 在实例的 USER 命名空间中创建一个名为 CreateProxyClasses.cls 的新 ObjectScript 类,并粘贴以下代码, 将您的实例的主机标识符替换为 gwyConn.%Connect 中的 server,并用双引号括起来的 Person.dll 文件的完整文件路径替换 YOUR FILEPATH HERE。
Class User.CreateProxyClasses Extends %Persistent
{
ClassMethod run()
{
// get a connection to the .NET Gateway
set gwyConn = ##class(%Net.Remote.Gateway).%New()
set status = gwyConn.%Connect("127.0.0.1", 55000, "USER")
if $$$ISERR(status) {
write !,"error: "_$system.OBJ.DisplayError(status)
quit
}
// add the DLL to the classpath
set classpath = ##class(%ListOfDataTypes).%New()
do classpath.Insert("YOUR FILEPATH HERE")
set status = gwyConn.%AddToCurrentClassPath(classpath)
if $$$ISERR(status) {
write !,"error: "_$system.OBJ.DisplayError(status)
quit
}
// create the proxy ObjectScript classes corresponding to the .NET classes in the DLL
set status = gwyConn.%Import("Person",,,,1)
if $$$ISERR(status) {
write !,"error: "_$system.OBJ.DisplayError(status)
quit
}
//close the connection to the .NET Gateway
set status = gwyConn.%Disconnect()
if $$$ISERR(status) {
write !,"error: "_$system.OBJ.DisplayError(status)
quit
}
}
}
编译并构建该类。然后使用 InterSystems IRIS Basics:Connecting an IDE(InterSystems IRIS 基础: 连接一个 IDE) 中的 instructions for your instance(对您的实例的说明),在 USER 命名空间中打开 InterSystems 终端(InterSystems Terminal), 并执行以下命令:
do ##class(User.CreateProxyClasses).run()
2.5 使用ObjectScript 操作 .NET Object
在 USER 命名空间中创建另一个名为 ManipulateObjects.cls 的 ObjectScript 类,并粘贴以下代码 (注意要将您的实例的主机标识符替换 gwyConn.%Connect 中的 第一个参数):
Class User.ManipulateObjects Extends %Persistent
{
ClassMethod run()
{
// get a connection to the .NET gateway
set gwyConn = ##class(%Net.Remote.Gateway).%New()
set status = gwyConn.%Connect("127.0.0.1", 55000, "USER")
if $$$ISERR(status) {
write !,"error: "_$system.OBJ.DisplayError(status)
quit
}
// manipulate some proxy objects
set person = ##class(User.Person).%New(gwyConn,5,"Tom")
write !,"Name: "_person.getName()
write !,"Age: "_person.getAge()
do person.setAge(100)
write !,"Age: "_person.getAge()
// close the connection to the .NET gateway
set status = gwyConn.%Disconnect()
if $$$ISERR(status) {
write !,"error: "_$system.OBJ.DisplayError(status)
quit
}
}
}
编译并构建该类,然后在终端(Terminal)中的 USER 命名空间中执行以下命令:
do ##class(User.ManipulateObjects).run()
您应该可以看到以下输出:
Name: Tom Age: 5
setting age to 100
Age: 100
现在您已经成功地完成了练习,停止您创建的 .NET 网关(Gateway)。返回到管理门户(Management Portal)中的 External Language Servers(外部语言服务)页面,找到网关(Gateway),并选择 Stop(停止)。
3. 了解更多有关 .NET 网关(Gateway)的信息
从这里,您可以继续探索 .NET 网关(Gateway)和 InterSystems IRIS。请参阅下面的文档和参考资料,了解 .NET、互操作性、应用程序开发等。
Using the Gateway for .NET(使用 .NET 网关) — 了解更多有关 InterSystems IRIS 和 Microsoft .NET Framework 组件之间互操作性的信息。
Skyrocket Your .NET Application Development(Skyrocket Your .NET 应用程序开发) — 这是 InterSystems 关于在 .NET 中作为对象建模和访问数据的演示。
.NET Documentation(.NET 文档) — Microsoft 在 .NET 上的文档,包括架构概念、教程和开发指南。
文章
Jingwei Wang · 十月 28, 2021
html {overflow-x: initial !important;}:root { --bg-color: #ffffff; --text-color: #333333; --select-text-bg-color: #B5D6FC; --select-text-font-color: auto; --monospace: "Lucida Console",Consolas,"Courier",monospace; --title-bar-height: 20px; }
.mac-os-11 { --title-bar-height: 28px; }
html { font-size: 14px; background-color: var(--bg-color); color: var(--text-color); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
body { margin: 0px; padding: 0px; height: auto; inset: 0px; font-size: 1rem; line-height: 1.42857143; overflow-x: hidden; background-image: inherit; background-size: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: inherit; tab-size: 4; background-position: inherit; background-repeat: inherit; }
iframe { margin: auto; }
a.url { word-break: break-all; }
a:active, a:hover { outline: 0px; }
.in-text-selection, ::selection { text-shadow: none; background: var(--select-text-bg-color); color: var(--select-text-font-color); }
#write { margin: 0px auto; height: auto; width: inherit; word-break: normal; word-wrap: break-word; position: relative; white-space: normal; overflow-x: visible; padding-top: 36px; }
#write.first-line-indent p { text-indent: 2em; }
#write.first-line-indent li p, #write.first-line-indent p * { text-indent: 0px; }
#write.first-line-indent li { margin-left: 2em; }
.for-image #write { padding-left: 8px; padding-right: 8px; }
body.typora-export { padding-left: 30px; padding-right: 30px; }
.typora-export .footnote-line, .typora-export li, .typora-export p { white-space: pre-wrap; }
.typora-export .task-list-item input { pointer-events: none; }
@media screen and (max-width: 500px) {
body.typora-export { padding-left: 0px; padding-right: 0px; }
#write { padding-left: 20px; padding-right: 20px; }
.CodeMirror-sizer { margin-left: 0px !important; }
.CodeMirror-gutters { display: none !important; }
}
#write li > figure:last-child { margin-bottom: 0.5rem; }
#write ol, #write ul { position: relative; }
img { max-width: 100%; vertical-align: middle; image-orientation: from-image; }
button, input, select, textarea { color: inherit; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; }
input[type="checkbox"], input[type="radio"] { line-height: normal; padding: 0px; }
*, ::after, ::before { box-sizing: border-box; }
#write h1, #write h2, #write h3, #write h4, #write h5, #write h6, #write p, #write pre { width: inherit; }
#write h1, #write h2, #write h3, #write h4, #write h5, #write h6, #write p { position: relative; }
p { line-height: inherit; }
h1, h2, h3, h4, h5, h6 { break-after: avoid-page; break-inside: avoid; orphans: 4; }
p { orphans: 4; }
h1 { font-size: 2rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.6rem; }
h4 { font-size: 1.4rem; }
h5 { font-size: 1.2rem; }
h6 { font-size: 1rem; }
.md-math-block, .md-rawblock, h1, h2, h3, h4, h5, h6, p { margin-top: 1rem; margin-bottom: 1rem; }
.hidden { display: none; }
.md-blockmeta { color: rgb(204, 204, 204); font-weight: 700; font-style: italic; }
a { cursor: pointer; }
sup.md-footnote { padding: 2px 4px; background-color: rgba(238, 238, 238, 0.7); color: rgb(85, 85, 85); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; cursor: pointer; }
sup.md-footnote a, sup.md-footnote a:hover { color: inherit; text-transform: inherit; text-decoration: inherit; }
#write input[type="checkbox"] { cursor: pointer; width: inherit; height: inherit; }
figure { overflow-x: auto; margin: 1.2em 0px; max-width: calc(100% + 16px); padding: 0px; }
figure > table { margin: 0px; }
tr { break-inside: avoid; break-after: auto; }
thead { display: table-header-group; }
table { border-collapse: collapse; border-spacing: 0px; width: 100%; overflow: auto; break-inside: auto; text-align: left; }
table.md-table td { min-width: 32px; }
.CodeMirror-gutters { border-right-width: 0px; background-color: inherit; }
.CodeMirror-linenumber { }
.CodeMirror { text-align: left; }
.CodeMirror-placeholder { opacity: 0.3; }
.CodeMirror pre { padding: 0px 4px; }
.CodeMirror-lines { padding: 0px; }
div.hr:focus { cursor: none; }
#write pre { white-space: pre-wrap; }
#write.fences-no-line-wrapping pre { white-space: pre; }
#write pre.ty-contain-cm { white-space: normal; }
.CodeMirror-gutters { margin-right: 4px; }
.md-fences { font-size: 0.9rem; display: block; break-inside: avoid; text-align: left; overflow: visible; white-space: pre; background-image: inherit; background-size: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: inherit; position: relative !important; background-position: inherit; background-repeat: inherit; }
.md-fences-adv-panel { width: 100%; margin-top: 10px; text-align: center; padding-top: 0px; padding-bottom: 8px; overflow-x: auto; }
#write .md-fences.mock-cm { white-space: pre-wrap; }
.md-fences.md-fences-with-lineno { padding-left: 0px; }
#write.fences-no-line-wrapping .md-fences.mock-cm { white-space: pre; overflow-x: auto; }
.md-fences.mock-cm.md-fences-with-lineno { padding-left: 8px; }
.CodeMirror-line, twitterwidget { break-inside: avoid; }
.footnotes { opacity: 0.8; font-size: 0.9rem; margin-top: 1em; margin-bottom: 1em; }
.footnotes + .footnotes { margin-top: 0px; }
.md-reset { margin: 0px; padding: 0px; border: 0px; outline: 0px; vertical-align: top; text-decoration: none; text-shadow: none; float: none; position: static; width: auto; height: auto; white-space: nowrap; cursor: inherit; line-height: normal; font-weight: 400; text-align: left; box-sizing: content-box; direction: ltr; background-position: 0px 0px; }
li div { padding-top: 0px; }
blockquote { margin: 1rem 0px; }
li .mathjax-block, li p { margin: 0.5rem 0px; }
li blockquote { margin: 1rem 0px; }
li { margin: 0px; position: relative; }
blockquote > :last-child { margin-bottom: 0px; }
blockquote > :first-child, li > :first-child { margin-top: 0px; }
.footnotes-area { color: rgb(136, 136, 136); margin-top: 0.714rem; padding-bottom: 0.143rem; white-space: normal; }
#write .footnote-line { white-space: pre-wrap; }
@media print {
body, html { border: 1px solid transparent; height: 99%; break-after: avoid; break-before: avoid; font-variant-ligatures: no-common-ligatures; }
#write { margin-top: 0px; padding-top: 0px; border-color: transparent !important; }
.typora-export * { -webkit-print-color-adjust: exact; }
.typora-export #write { break-after: avoid; }
.typora-export #write::after { height: 0px; }
.is-mac table { break-inside: avoid; }
.typora-export-show-outline .typora-export-sidebar { display: none; }
}
.footnote-line { margin-top: 0.714em; font-size: 0.7em; }
a img, img a { cursor: pointer; }
pre.md-meta-block { font-size: 0.8rem; min-height: 0.8rem; white-space: pre-wrap; background-color: rgb(204, 204, 204); display: block; overflow-x: hidden; }
p > .md-image:only-child:not(.md-img-error) img, p > img:only-child { display: block; margin: auto; }
#write.first-line-indent p > .md-image:only-child:not(.md-img-error) img { left: -2em; position: relative; }
p > .md-image:only-child { display: inline-block; width: 100%; }
#write .MathJax_Display { margin: 0.8em 0px 0px; }
.md-math-block { width: 100%; }
.md-math-block:not(:empty)::after { display: none; }
.MathJax_ref { fill: currentcolor; }
[contenteditable="true"]:active, [contenteditable="true"]:focus, [contenteditable="false"]:active, [contenteditable="false"]:focus { outline: 0px; box-shadow: none; }
.md-task-list-item { position: relative; list-style-type: none; }
.task-list-item.md-task-list-item { padding-left: 0px; }
.md-task-list-item > input { position: absolute; top: 0px; left: 0px; margin-left: -1.2em; margin-top: calc(1em - 10px); border: none; }
.math { font-size: 1rem; }
.md-toc { min-height: 3.58rem; position: relative; font-size: 0.9rem; border-top-left-radius: 10px; border-top-right-radius: 10px; border-bottom-right-radius: 10px; border-bottom-left-radius: 10px; }
.md-toc-content { position: relative; margin-left: 0px; }
.md-toc-content::after, .md-toc::after { display: none; }
.md-toc-item { display: block; color: rgb(65, 131, 196); }
.md-toc-item a { text-decoration: none; }
.md-toc-inner:hover { text-decoration: underline; }
.md-toc-inner { display: inline-block; cursor: pointer; }
.md-toc-h1 .md-toc-inner { margin-left: 0px; font-weight: 700; }
.md-toc-h2 .md-toc-inner { margin-left: 2em; }
.md-toc-h3 .md-toc-inner { margin-left: 4em; }
.md-toc-h4 .md-toc-inner { margin-left: 6em; }
.md-toc-h5 .md-toc-inner { margin-left: 8em; }
.md-toc-h6 .md-toc-inner { margin-left: 10em; }
@media screen and (max-width: 48em) {
.md-toc-h3 .md-toc-inner { margin-left: 3.5em; }
.md-toc-h4 .md-toc-inner { margin-left: 5em; }
.md-toc-h5 .md-toc-inner { margin-left: 6.5em; }
.md-toc-h6 .md-toc-inner { margin-left: 8em; }
}
a.md-toc-inner { font-size: inherit; font-style: inherit; font-weight: inherit; line-height: inherit; }
.footnote-line a:not(.reversefootnote) { color: inherit; }
.md-attr { display: none; }
.md-fn-count::after { content: "."; }
code, pre, samp, tt { font-family: var(--monospace); }
kbd { margin: 0px 0.1em; padding: 0.1em 0.6em; font-size: 0.8em; color: rgb(36, 39, 41); background-color: rgb(255, 255, 255); border: 1px solid rgb(173, 179, 185); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; box-shadow: rgba(12, 13, 14, 0.2) 0px 1px 0px, rgb(255, 255, 255) 0px 0px 0px 2px inset; white-space: nowrap; vertical-align: middle; }
.md-comment { color: rgb(162, 127, 3); opacity: 0.8; font-family: var(--monospace); }
code { text-align: left; }
a.md-print-anchor { white-space: pre !important; border: none !important; display: inline-block !important; position: absolute !important; width: 1px !important; right: 0px !important; outline: 0px !important; text-shadow: initial !important; background-position: 0px 0px !important; }
.md-inline-math .MathJax_SVG .noError { display: none !important; }
.html-for-mac .inline-math-svg .MathJax_SVG { vertical-align: 0.2px; }
.md-fences-math .MathJax_SVG_Display, .md-math-block .MathJax_SVG_Display { text-align: center; margin: 0px; position: relative; text-indent: 0px; max-width: none; max-height: none; min-height: 0px; min-width: 100%; width: auto; overflow-y: visible; display: block !important; }
.MathJax_SVG_Display, .md-inline-math .MathJax_SVG_Display { width: auto; margin: inherit; display: inline-block !important; }
.MathJax_SVG .MJX-monospace { font-family: var(--monospace); }
.MathJax_SVG .MJX-sans-serif { font-family: sans-serif; }
.MathJax_SVG { display: inline; font-style: normal; font-weight: 400; line-height: normal; text-indent: 0px; text-align: left; text-transform: none; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; zoom: 90%; }
#math-inline-preview-content { zoom: 1.1; }
.MathJax_SVG * { transition: none; }
.MathJax_SVG_Display svg { vertical-align: middle !important; margin-bottom: 0px !important; margin-top: 0px !important; }
.os-windows.monocolor-emoji .md-emoji { font-family: "Segoe UI Symbol", sans-serif; }
.md-diagram-panel > svg { max-width: 100%; }
[lang="flow"] svg, [lang="mermaid"] svg { max-width: 100%; height: auto; }
[lang="mermaid"] .node text { font-size: 1rem; }
table tr th { border-bottom-width: 0px; }
video { max-width: 100%; display: block; margin: 0px auto; }
iframe { max-width: 100%; width: 100%; border: none; }
.highlight td, .highlight tr { border: 0px; }
mark { background-color: rgb(255, 255, 0); color: rgb(0, 0, 0); }
.md-html-inline .md-plain, .md-html-inline strong, mark .md-inline-math, mark strong { color: inherit; }
.md-expand mark .md-meta { opacity: 0.3 !important; }
mark .md-meta { color: rgb(0, 0, 0); }
@media print {
.typora-export h1, .typora-export h2, .typora-export h3, .typora-export h4, .typora-export h5, .typora-export h6 { break-inside: avoid; }
}
.md-diagram-panel .messageText { stroke: none !important; }
.md-diagram-panel .start-state { fill: var(--node-fill); }
.md-diagram-panel .edgeLabel rect { opacity: 1 !important; }
.md-require-zoom-fix foreignObject { font-size: var(--mermaid-font-zoom); }
.md-fences.md-fences-math { font-size: 1em; }
.md-fences-math .MathJax_SVG_Display { margin-top: 8px; cursor: default; }
.md-fences-advanced:not(.md-focus) { padding: 0px; white-space: nowrap; border: 0px; }
.md-fences-advanced:not(.md-focus) { background-image: inherit; background-size: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: inherit; background-position: inherit; background-repeat: inherit; }
.typora-export-show-outline .typora-export-content { max-width: 1440px; margin: auto; display: flex; flex-direction: row; }
.typora-export-sidebar { width: 300px; font-size: 0.8rem; margin-top: 80px; margin-right: 18px; }
.typora-export-show-outline #write { --webkit-flex: 2; flex: 2 1 0%; }
.typora-export-sidebar .outline-content { position: fixed; top: 0px; max-height: 100%; overflow: hidden auto; padding-bottom: 30px; padding-top: 60px; width: 300px; }
@media screen and (max-width: 1024px) {
.typora-export-sidebar, .typora-export-sidebar .outline-content { width: 240px; }
}
@media screen and (max-width: 800px) {
.typora-export-sidebar { display: none; }
}
.outline-content li, .outline-content ul { margin-left: 0px; margin-right: 0px; padding-left: 0px; padding-right: 0px; list-style: none; }
.outline-content ul { margin-top: 0px; margin-bottom: 0px; }
.outline-content strong { font-weight: 400; }
.outline-expander { width: 1rem; height: 1.428571429rem; position: relative; display: table-cell; vertical-align: middle; cursor: pointer; padding-left: 4px; }
.outline-expander::before { content: ''; position: relative; font-family: Ionicons; display: inline-block; font-size: 8px; vertical-align: middle; }
.outline-item { padding-top: 3px; padding-bottom: 3px; cursor: pointer; }
.outline-expander:hover::before { content: ''; }
.outline-h1 > .outline-item { padding-left: 0px; }
.outline-h2 > .outline-item { padding-left: 1em; }
.outline-h3 > .outline-item { padding-left: 2em; }
.outline-h4 > .outline-item { padding-left: 3em; }
.outline-h5 > .outline-item { padding-left: 4em; }
.outline-h6 > .outline-item { padding-left: 5em; }
.outline-label { cursor: pointer; display: table-cell; vertical-align: middle; text-decoration: none; color: inherit; }
.outline-label:hover { text-decoration: underline; }
.outline-item:hover { border-color: rgb(245, 245, 245); background-color: var(--item-hover-bg-color); }
.outline-item:hover { margin-left: -28px; margin-right: -28px; border-left-width: 28px; border-left-style: solid; border-left-color: transparent; border-right-width: 28px; border-right-style: solid; border-right-color: transparent; }
.outline-item-single .outline-expander::before, .outline-item-single .outline-expander:hover::before { display: none; }
.outline-item-open > .outline-item > .outline-expander::before { content: ''; }
.outline-children { display: none; }
.info-panel-tab-wrapper { display: none; }
.outline-item-open > .outline-children { display: block; }
.typora-export .outline-item { padding-top: 1px; padding-bottom: 1px; }
.typora-export .outline-item:hover { margin-right: -8px; border-right-width: 8px; border-right-style: solid; border-right-color: transparent; }
.typora-export .outline-expander::before { content: "+"; font-family: inherit; top: -1px; }
.typora-export .outline-expander:hover::before, .typora-export .outline-item-open > .outline-item > .outline-expander::before { content: '−'; }
.typora-export-collapse-outline .outline-children { display: none; }
.typora-export-collapse-outline .outline-item-open > .outline-children, .typora-export-no-collapse-outline .outline-children { display: block; }
.typora-export-no-collapse-outline .outline-expander::before { content: "" !important; }
.typora-export-show-outline .outline-item-active > .outline-item .outline-label { font-weight: 700; }
.CodeMirror { height: auto; }
.CodeMirror.cm-s-inner { background-image: inherit; background-size: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: inherit; background-position: inherit; background-repeat: inherit; }
.CodeMirror-scroll { overflow: auto hidden; z-index: 3; }
.CodeMirror-gutter-filler, .CodeMirror-scrollbar-filler { background-color: rgb(255, 255, 255); }
.CodeMirror-gutters { border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); background-image: inherit; background-size: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: inherit; white-space: nowrap; background-position: inherit; background-repeat: inherit; }
.CodeMirror-linenumber { padding: 0px 3px 0px 5px; text-align: right; color: rgb(153, 153, 153); }
.cm-s-inner .cm-keyword { color: rgb(119, 0, 136); }
.cm-s-inner .cm-atom, .cm-s-inner.cm-atom { color: rgb(34, 17, 153); }
.cm-s-inner .cm-number { color: rgb(17, 102, 68); }
.cm-s-inner .cm-def { color: rgb(0, 0, 255); }
.cm-s-inner .cm-variable { color: rgb(0, 0, 0); }
.cm-s-inner .cm-variable-2 { color: rgb(0, 85, 170); }
.cm-s-inner .cm-variable-3 { color: rgb(0, 136, 85); }
.cm-s-inner .cm-string { color: rgb(170, 17, 17); }
.cm-s-inner .cm-property { color: rgb(0, 0, 0); }
.cm-s-inner .cm-operator { color: rgb(152, 26, 26); }
.cm-s-inner .cm-comment, .cm-s-inner.cm-comment { color: rgb(170, 85, 0); }
.cm-s-inner .cm-string-2 { color: rgb(255, 85, 0); }
.cm-s-inner .cm-meta { color: rgb(85, 85, 85); }
.cm-s-inner .cm-qualifier { color: rgb(85, 85, 85); }
.cm-s-inner .cm-builtin { color: rgb(51, 0, 170); }
.cm-s-inner .cm-bracket { color: rgb(153, 153, 119); }
.cm-s-inner .cm-tag { color: rgb(17, 119, 0); }
.cm-s-inner .cm-attribute { color: rgb(0, 0, 204); }
.cm-s-inner .cm-header, .cm-s-inner.cm-header { color: rgb(0, 0, 255); }
.cm-s-inner .cm-quote, .cm-s-inner.cm-quote { color: rgb(0, 153, 0); }
.cm-s-inner .cm-hr, .cm-s-inner.cm-hr { color: rgb(153, 153, 153); }
.cm-s-inner .cm-link, .cm-s-inner.cm-link { color: rgb(0, 0, 204); }
.cm-negative { color: rgb(221, 68, 68); }
.cm-positive { color: rgb(34, 153, 34); }
.cm-header, .cm-strong { font-weight: 700; }
.cm-del { text-decoration: line-through; }
.cm-em { font-style: italic; }
.cm-link { text-decoration: underline; }
.cm-error { color: red; }
.cm-invalidchar { color: red; }
.cm-constant { color: rgb(38, 139, 210); }
.cm-defined { color: rgb(181, 137, 0); }
div.CodeMirror span.CodeMirror-matchingbracket { color: rgb(0, 255, 0); }
div.CodeMirror span.CodeMirror-nonmatchingbracket { color: rgb(255, 34, 34); }
.cm-s-inner .CodeMirror-activeline-background { background-image: inherit; background-size: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: inherit; background-position: inherit; background-repeat: inherit; }
.CodeMirror { position: relative; overflow: hidden; }
.CodeMirror-scroll { height: 100%; outline: 0px; position: relative; box-sizing: content-box; background-image: inherit; background-size: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: inherit; background-position: inherit; background-repeat: inherit; }
.CodeMirror-sizer { position: relative; }
.CodeMirror-gutter-filler, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-vscrollbar { position: absolute; z-index: 6; display: none; }
.CodeMirror-vscrollbar { right: 0px; top: 0px; overflow: hidden; }
.CodeMirror-hscrollbar { bottom: 0px; left: 0px; overflow: hidden; }
.CodeMirror-scrollbar-filler { right: 0px; bottom: 0px; }
.CodeMirror-gutter-filler { left: 0px; bottom: 0px; }
.CodeMirror-gutters { position: absolute; left: 0px; top: 0px; padding-bottom: 30px; z-index: 3; }
.CodeMirror-gutter { white-space: normal; height: 100%; box-sizing: content-box; padding-bottom: 30px; margin-bottom: -32px; display: inline-block; }
.CodeMirror-gutter-wrapper { position: absolute; z-index: 4; border: none !important; background-position: 0px 0px !important; }
.CodeMirror-gutter-background { position: absolute; top: 0px; bottom: 0px; z-index: 4; }
.CodeMirror-gutter-elt { position: absolute; cursor: default; z-index: 4; }
.CodeMirror-lines { cursor: text; }
.CodeMirror pre { border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; border-width: 0px; font-family: inherit; font-size: inherit; margin: 0px; white-space: pre; word-wrap: normal; color: inherit; z-index: 2; position: relative; overflow: visible; background-position: 0px 0px; }
.CodeMirror-wrap pre { word-wrap: break-word; white-space: pre-wrap; word-break: normal; }
.CodeMirror-code pre { border-right-width: 30px; border-right-style: solid; border-right-color: transparent; width: fit-content; }
.CodeMirror-wrap .CodeMirror-code pre { border-right-style: none; width: auto; }
.CodeMirror-linebackground { position: absolute; inset: 0px; z-index: 0; }
.CodeMirror-linewidget { position: relative; z-index: 2; overflow: auto; }
.CodeMirror-wrap .CodeMirror-scroll { overflow-x: hidden; }
.CodeMirror-measure { position: absolute; width: 100%; height: 0px; overflow: hidden; visibility: hidden; }
.CodeMirror-measure pre { position: static; }
.CodeMirror div.CodeMirror-cursor { position: absolute; visibility: hidden; border-right-style: none; width: 0px; }
.CodeMirror div.CodeMirror-cursor { visibility: hidden; }
.CodeMirror-focused div.CodeMirror-cursor { visibility: inherit; }
.cm-searching { background-color: rgba(255, 255, 0, 0.4); }
span.cm-underlined { text-decoration: underline; }
span.cm-strikethrough { text-decoration: line-through; }
.cm-tw-syntaxerror { color: rgb(255, 255, 255); background-color: rgb(153, 0, 0); }
.cm-tw-deleted { text-decoration: line-through; }
.cm-tw-header5 { font-weight: 700; }
.cm-tw-listitem:first-child { padding-left: 10px; }
.cm-tw-box { border-style: solid; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-color: inherit; border-top-width: 0px !important; }
.cm-tw-underline { text-decoration: underline; }
@media print {
.CodeMirror div.CodeMirror-cursor { visibility: hidden; }
}
:root {
--side-bar-bg-color: #fafafa;
--control-text-color: #777;
}
@include-when-export url(https://fonts.loli.net/css?family=Open+Sans:400italic,700italic,700,400&subset=latin,latin-ext);
/* open-sans-regular - latin-ext_latin */
/* open-sans-italic - latin-ext_latin */
/* open-sans-700 - latin-ext_latin */
/* open-sans-700italic - latin-ext_latin */
html {
font-size: 16px;
}
body {
font-family: "Open Sans","Clear Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
color: rgb(51, 51, 51);
line-height: 1.6;
}
#write {
max-width: 860px;
margin: 0 auto;
padding: 30px;
padding-bottom: 100px;
}
@media only screen and (min-width: 1400px) {
#write {
max-width: 1024px;
}
}
@media only screen and (min-width: 1800px) {
#write {
max-width: 1200px;
}
}
#write > ul:first-child,
#write > ol:first-child{
margin-top: 30px;
}
a {
color: #4183C4;
}
h1,
h2,
h3,
h4,
h5,
h6 {
position: relative;
margin-top: 1rem;
margin-bottom: 1rem;
font-weight: bold;
line-height: 1.4;
cursor: text;
}
h1:hover a.anchor,
h2:hover a.anchor,
h3:hover a.anchor,
h4:hover a.anchor,
h5:hover a.anchor,
h6:hover a.anchor {
text-decoration: none;
}
h1 tt,
h1 code {
font-size: inherit;
}
h2 tt,
h2 code {
font-size: inherit;
}
h3 tt,
h3 code {
font-size: inherit;
}
h4 tt,
h4 code {
font-size: inherit;
}
h5 tt,
h5 code {
font-size: inherit;
}
h6 tt,
h6 code {
font-size: inherit;
}
h1 {
font-size: 2.25em;
line-height: 1.2;
border-bottom: 1px solid #eee;
}
h2 {
font-size: 1.75em;
line-height: 1.225;
border-bottom: 1px solid #eee;
}
/*@media print {
.typora-export h1,
.typora-export h2 {
border-bottom: none;
padding-bottom: initial;
}
.typora-export h1::after,
.typora-export h2::after {
content: "";
display: block;
height: 100px;
margin-top: -96px;
border-top: 1px solid #eee;
}
}*/
h3 {
font-size: 1.5em;
line-height: 1.43;
}
h4 {
font-size: 1.25em;
}
h5 {
font-size: 1em;
}
h6 {
font-size: 1em;
color: #777;
}
p,
blockquote,
ul,
ol,
dl,
table{
margin: 0.8em 0;
}
li>ol,
li>ul {
margin: 0 0;
}
hr {
height: 2px;
padding: 0;
margin: 16px 0;
background-color: #e7e7e7;
border: 0 none;
overflow: hidden;
box-sizing: content-box;
}
li p.first {
display: inline-block;
}
ul,
ol {
padding-left: 30px;
}
ul:first-child,
ol:first-child {
margin-top: 0;
}
ul:last-child,
ol:last-child {
margin-bottom: 0;
}
blockquote {
border-left: 4px solid #dfe2e5;
padding: 0 15px;
color: #777777;
}
blockquote blockquote {
padding-right: 0;
}
table {
padding: 0;
word-break: initial;
}
table tr {
border: 1px solid #dfe2e5;
margin: 0;
padding: 0;
}
table tr:nth-child(2n),
thead {
background-color: #f8f8f8;
}
table th {
font-weight: bold;
border: 1px solid #dfe2e5;
border-bottom: 0;
margin: 0;
padding: 6px 13px;
}
table td {
border: 1px solid #dfe2e5;
margin: 0;
padding: 6px 13px;
}
table th:first-child,
table td:first-child {
margin-top: 0;
}
table th:last-child,
table td:last-child {
margin-bottom: 0;
}
.CodeMirror-lines {
padding-left: 4px;
}
.code-tooltip {
box-shadow: 0 1px 1px 0 rgba(0,28,36,.3);
border-top: 1px solid #eef2f2;
}
.md-fences,
code,
tt {
border: 1px solid #e7eaed;
background-color: #f8f8f8;
border-radius: 3px;
padding: 0;
padding: 2px 4px 0px 4px;
font-size: 0.9em;
}
code {
background-color: #f3f4f4;
padding: 0 2px 0 2px;
}
.md-fences {
margin-bottom: 15px;
margin-top: 15px;
padding-top: 8px;
padding-bottom: 6px;
}
.md-task-list-item > input {
margin-left: -1.3em;
}
@media print {
html {
font-size: 13px;
}
table,
pre {
page-break-inside: avoid;
}
pre {
word-wrap: break-word;
}
}
.md-fences {
background-color: #f8f8f8;
}
#write pre.md-meta-block {
padding: 1rem;
font-size: 85%;
line-height: 1.45;
background-color: #f7f7f7;
border: 0;
border-radius: 3px;
color: #777777;
margin-top: 0 !important;
}
.mathjax-block>.code-tooltip {
bottom: .375rem;
}
.md-mathjax-midline {
background: #fafafa;
}
#write>h3.md-focus:before{
left: -1.5625rem;
top: .375rem;
}
#write>h4.md-focus:before{
left: -1.5625rem;
top: .285714286rem;
}
#write>h5.md-focus:before{
left: -1.5625rem;
top: .285714286rem;
}
#write>h6.md-focus:before{
left: -1.5625rem;
top: .285714286rem;
}
.md-image>.md-meta {
/*border: 1px solid #ddd;*/
border-radius: 3px;
padding: 2px 0px 0px 4px;
font-size: 0.9em;
color: inherit;
}
.md-tag {
color: #a7a7a7;
opacity: 1;
}
.md-toc {
margin-top:20px;
padding-bottom:20px;
}
.sidebar-tabs {
border-bottom: none;
}
#typora-quick-open {
border: 1px solid #ddd;
background-color: #f8f8f8;
}
#typora-quick-open-item {
background-color: #FAFAFA;
border-color: #FEFEFE #e5e5e5 #e5e5e5 #eee;
border-style: solid;
border-width: 1px;
}
/** focus mode */
.on-focus-mode blockquote {
border-left-color: rgba(85, 85, 85, 0.12);
}
header, .context-menu, .megamenu-content, footer{
font-family: "Segoe UI", "Arial", sans-serif;
}
.file-node-content:hover .file-node-icon,
.file-node-content:hover .file-node-open-state{
visibility: visible;
}
.mac-seamless-mode #typora-sidebar {
background-color: #fafafa;
background-color: var(--side-bar-bg-color);
}
.md-lang {
color: #b4654d;
}
/*.html-for-mac {
--item-hover-bg-color: #E6F0FE;
}*/
#md-notification .btn {
border: 0;
}
.dropdown-menu .divider {
border-color: #e5e5e5;
opacity: 0.4;
}
.ty-preferences .window-content {
background-color: #fafafa;
}
.ty-preferences .nav-group-item.active {
color: white;
background: #999;
}
.menu-item-container a.menu-style-btn {
background-color: #f5f8fa;
background-image: linear-gradient( 180deg , hsla(0, 0%, 100%, 0.8), hsla(0, 0%, 100%, 0));
}
:root {--mermaid-font-zoom:1em ;} @media print { @page {margin: 0 0 0 0;} body.typora-export {padding-left: 0; padding-right: 0;} #write {padding:0;}}
目录
技术概要:InterSystems IRIS 和 UIMA关于 UIMAInterSystems IRIS 如何补充 UIMA Annotation Store(注释存储) InterSystems IRIS NLP在 InterSystems IRIS 中体验 UIMA 用前须知 创建新的命名空间 运行Java Gateway(Java 网关) 体验 UIMA 分析管道 浏览 Annotation Store(注释存储) 通过分析管道发送新文本 向 Aviation.Event 表添加记录 查看Annotation Store(注释存储)中的新条目了解更多关于 UIMA的资料
技术概要:InterSystems IRIS 和 UIMA
本技术概要(First Look)快速介绍了 InterSystems IRIS® 数据平台如何实施和补充非结构化信息管理架构 (UIMA)。在简要概述 UIMA 以及 InterSystems IRIS 如何对其进行补充之后,您将有机会通过基本的动手练习来在实际应用中了解 InterSystems IRIS。 要浏览技术概要(First Look)的所有内容,包括可以在InterSystems IRIS的免费评估实例上执行的内容,请参阅InterSystems 技术概要。
关于 UIMA
UIMA 是管理分析非结构化信息(如文本和视频)的标准。对于非结构化信息,计算机通常需要几个步骤才能将信息转化为可操作的结构化数据。例如,扫描的文档将文本转变为机器可读版本之前需要OCR,即使这样,在应用额外的 NLP 策略之前,计算机也不能很好地处理自然语言文本。由于像这样的流程包括本质上非常不同的步骤,因此单个工具不太可能处理所有这些步骤。更可能的情况是,这个流程包括单独模块,这些模块由使用不同技术的不同主体执行,且需要协同工作。在 UIMA 中,这些模块被称为analysis engines(分析引擎)。 因为符合 UIMA 标准的分析引擎都遵循相同的标准,所以它们可以组合成一系列分析器(a UIMA analysis pipeline [UIMA 分析管道]),每个部分做自己最擅长的事情。源非结构化数据在通过此 UIMA 分析管道时不会发生改变,而是沿途生成annotations(注释)。UIMA 标准确保来自一个分析引擎的注释不会干扰来自不同分析引擎的注释。对于文本,这些注释基于文本中的字符位置。UIMA 的互操作性允许您将来自不同供应商和技术的分析引擎组合到一个管道中,而无需编写任何自定义代码,并且由于分析引擎引用原始源数据中的字符位置,因此它们的注释可以组合、比较和推理。UIMA 标准包括运行这些分析引擎中所执行的框架。 除了提供互操作性之外,UIMA 还提供了用于扩展和部署这些分析引擎的框架。这使供应商可以专注于开发分析引擎,而不必担心扩展和部署他们的解决方案。[]{#2_How_InterSystems_IRIS_Complements_UIMA .anchor}UIMA 标准还提供了在分布式架构中调用这些分析引擎的框架。 每个符合 UIMA 的分析引擎都必须附带一个 XML 描述符文件,该文件包含基本识别信息,例如分析引擎的名称和供应商。它还定义了对分析引擎生成的注释进行分类的注释类型。
InterSystems IRIS 如何补充 UIMA
InterSystems IRIS 在三个方面补充了 UIMA:
引入功能索引以创建 UIMA 分析管道(analysis pipeline),并在 InterSystems IRIS 表中插入或更新记录时自动为该分析管道提供新文本。
将 UIMA 分析管道生成的注释存储在 InterSystems IRIS 中清晰、可通过 SQL 访问的Annotation Store(注释存储)中。
在 InterSystems IRIS 中体验 UIMA
确保 InterSystems IRIS Natural Language Processing(InterSystems IRIS 自然语言处理, NLP )符合 UIMA 标准,并可用作 UIMA 分析管道中的分析引擎。
创建和调用 UIMA 分析管道
InterSystems IRIS 使用functional index(功能索引)以创建 UIMA 分析管道,该管道使用 InterSystems IRIS 概念,而无需担心实现 Java 接口。功能索引是 InterSystems IRIS 数据库的一项功能,它允许在表中插入或更新记录时执行功能。在这种情况下,功能索引是定义在表的列上,该列包含您希望由 UIMA 分析管道分析的非结构化数据。设置该管道就像将分析引擎描述文件的位置添加到功能索引定义一样简单。
一旦定义了功能索引,只要在索引表列中插入或更新最新数据,InterSystems IRIS 就会自动将非结构化数据输入 UIMA 分析管道。例如,如果在包含报表的列上定义了功能索引,那么将新报表添加到表中后立即对其进行分析。没有[]{#2.2_Annotation_Store .anchor} InterSystems IRIS 中的这一特殊功能,每次您想要分析数据时,都需要在 Java 中以编程方式通过管道发送非结构化数据。
Annotation Store(注释存储)
默认情况下,UIMA 分析管道的结果被存储在冗长繁琐的 XML 文件中。由于 UIMA 标准没有提供更复杂的注释存储方法,InterSystems IRIS 通过使用灵活的、基于 SQL 的存储,将注释放在统一、持久的表中以便后续检索,从而扩展了 UIMA 分析管道。这种存储系统称为Annotation Store(注释存储)。
在您第一次编译包含为创建 UIMA 分析管道定义的功能索引的类时,会自动创建此Annotation Store(注释存储)。它直接链接到包含非结构化数据的原始表的列。
在架构上,Annotation Store(注释存储) 是通过添加一个特殊的分析引擎作为 UIMA 分析管道的最后一个组件来生成的。当您将 UIMA 功能索引添加到 InterSystems IRIS 类时,将会自动生成Annotation Store(注释存储)。在 InterSystems IRIS 之外开发的 UIMA 分析管道也可以将此特殊分析引擎添加到管道末端,以创建Annotation Store(注释存储)。这种实现方式超出了本技术概要(First Look)的讨论范围。
[]{#2.3_InterSystems_IRIS_NLP .anchor}您还可以使用XData block在包含功能索引的类中自定义Annotation Store(注释存储)。例如,您可以为每个表定义额外的列和索引。您还可以筛选注释类型,以将它们排除在Annotation Store(注释存储)之外。
InterSystems IRIS NLP
InterSystems IRIS Natural Language Processing(InterSystems IRIS 自然语言处理, NLP )被内置到 InterSystems IRIS® 数据平台中,可以在预先不了解这些非结构化文本主题的情况下,对这些文本进行文本分析。它通过应用识别语义实体的特定语言规则来实现这项功能。由于这些规则是专门针对语言而非内容,因此 InterSystems IRIS NLP可以在不使用字典或本体的情况下提供对文本内容的深入分析
您可以使用 InterSystems IRIS NLP 作为 UIMA 分析引擎,为 NLP 概念和上下文生成 UIMA 注释。这些注释与其他 UIMA 分析引擎提供的 UIMA 注释完全兼容。
在 InterSystems IRIS 中体验 UIMA
现在您已经了解了有关 UIMA 的一些基本信息,可以动手体验以了解它在 InterSystems IRIS 中的工作原理。在体验之前,您需要设置环境。
在 InterSystems IRIS 中体验 UIMA
用前须知
首先,请执行以下初步设置任务:
安装 Java Runtime Environment(Java 运行时环境)。
安装 InterSystems IRIS。
创建一个新的 InterSystems IRIS 命名空间。
启动 Java Gateway(Java 网关)。
安装 Java Runtime Environment(Java 运行环境)
InterSystems IRIS 进行 UIMA 分析管道分析需要安装Java Runtime Environment(Java 运行时环境,JRE)。还需要一个指向 JRE 安装位置的环境变量。
如果您的机器上尚未安装 JRE,请从 Oracle® 下载并安装最新版本。
创建一个名为JAVA_HOME的环境变量,该变量指向 JRE 安装的位置。例如,在 Windows® 上,使用 Control Panel(控制面板)创建JAVA_HOME环境变量,并定义该变量到 JRE 安装位置的路径。
安装 InterSystems IRIS
要运行 UIMA 分析管道的演示,您需要一个运行中的 InterSystems IRIS 已授权的实例。
有关如何安装和授权 InterSystems IRIS 开发实例的说明,请参阅InterSystems IRIS Basics: Installation (《InterSystems IRIS 基础知识:安装》)。
创建新的命名空间
作为技术概要(First Look)体验的一部分,您将向 InterSystems IRIS 中的命名空间添加一个新类文件。为了使此示例数据与预定义的命名空间分开,请创建一个名为 SAMPLES 的新命名空间来保存与此技术概要(First Look)关联的代码和数据。创建一个新的命名空间:
在浏览器中打开 Management Portal (管理门户),使用 InterSystems IRIS Basics: Connecting an IDE(《INTERSYSTEMS IRIS 基础:连接一个IDE 》)的实例适用的URL。
选择 System Administration(系统管理) > Configuration(配置) > System Configuration(系统配置) > Namespaces(命名空间)。
在 Namespaces(命名空间)页面,选择 Create New Namespace(新建命名空间)。
在 New Namespace(新建命名空间)页面,输入SAMPLES作为新命名空间的名称。
点击 Create New Database(新建数据库),将显示 Database Wizard(数据库向导)。
在 Database Wizard(数据库向导)的第一页,在 Enter the name of your database(输入您的数据库名称)字段,输入您正在创建的数据库的名称,例如 Samplesdb。
输入数据库的目录,例如 C:\InterSystems\IRIS\mgr\Samplesdb 。
点击 Next(下一步)。
点击 Finish(完成)。
回到New Namespace(新命名空间)页面,在Select an existing database for Routines(为 Routine 选择一个现有数据库)下拉菜单,选择您刚刚创建的数据库Samplesdb。
点击靠近页面顶部的 Save(保存),然后在结果日志的末尾单击 Close(关闭)。
UIMA 分析管道
运行Java Gateway(Java 网关)
Java Gateway(Java 网关)可以实例化外部 Java object(Java 对象),就好像它是 InterSystems IRIS 中的本机对象一样,可以对其进行操作。InterSystems IRIS 的 UIMA 策略使用Java Gateway(Java 网关),可以从command line (命令行)启动Java Gateway(Java 网关)。例如,在 Windows 上:
打开 Run(运行)对话框。
输入以下命令:
%JAVA_HOME%\bin\java -classpath "C:\InterSystems\IRIS\dev\java\lib\JDK18\*;C:\InterSystems\IRIS\dev\java\lib\jackson\*;C:\InterSystems\IRIS \dev\java\lib\uima\*" com.intersystems.gateway.JavaGateway 5555
其中:
JAVA_HOME 是指向Java Runtime Environment(Java 运行环境,JRE)安装目录位置的环境变量。
C:\InterSystems\IRIS 是您安装的 InterSystems IRIS 的目录。
JDK18 对应您的 JRE 版本。
如果在UNIX®上运行 ,请记住 -classpath 的句法使用冒号作为分隔符。
体验 UIMA 分析管道
现在您已经完成了准备工作,并已准备好在实际应用中查看 UIMA 分析管道的运行情况。在这次体验中,您将:
添加包含 UIMA 功能索引的类文件
编译包含功能索引的类。
查看 Annotation Store (注释存储)的表。
将非结构化数据添加到示例数据库。
浏览 Annotation Store(注释存储) 以获取分析管道生成的新数据。
添加带有 UIMA 功能索引的类文件
您可以通过为包含非结构化文本的表定义功能索引,向 UIMA 分析管道添加分析引擎。在本次体验中,您将向该分析管道添加 InterSystems IRIS NLP 分析引擎。
在体验的这一部分中,您将创建一个新的类文件。可以在您喜欢的文本编辑器或 IDE(例如 InterSystems Studio 或带有 ObjectScript 扩展名的 Visual Studio Code)中创建类文件。
在 IDE 或文本编辑器中创建一个新文件。
将以下内容复制并粘贴到类文件中:
xxxxxxxxxx
Class Sample.MyData Extends %Persistent
{
Property MyText As %String;
Index MyIndex On (MyText) As %UIMA.Index(AEDESCRIPTOR = \"classpath:/com/intersystems/uima/annotator/iKnowEngine.xml\");
}
体验 UIMA 分析管道
其中:
MyText 是包含非结构化文本的 Sample.MyData 表中的列。
MyIndex 是 UIMA 功能索引。
iKnowEngine.xml是 InterSystems IRIS NLP 分析引擎的描述符文件。
将文件另存为sample.cls。
编译表类
要自动生成 Annotation Store (注释存储),您只需使用InterSystems Terminal(InterSystems 终端)或 IDE 提供的工具编译包含功能索引的类。
建议: 使用 InterSystems Terminal(InterSystems 终端)时,您可以使用 Shift+Insert 命令将剪贴板的内容粘贴到终端命令提示符中。从本指南复制命令并将它们粘贴到终端中以减少错误,这种方式很有用。
加载和编译类:
打开 InterSystems Terminal(InterSystems 终端)。有关为您的实例打开Terminal (终端)的信息,请参阅InterSystems IRIS Basics: Connecting an IDE(《INTERSYSTEMS IRIS 基础:连接一个IDE 》)中的InterSystems IRIS Connection Information (《InterSystems IRIS 连接信息》)。
切换到您为此演示创建的命名空间。例如: set $namespace="samples"
输入以下命令,将类文件加载到命名空间中: do $system.OBJ.Load("<sample-dir>\sample.cls")
其中 <sample-dir> 是您保存 samples.cls 类文件的位置。
输入以下命令,编译您粘贴到sample.cls 的Sample.MyData 类: do $system.OBJ.Compile("Sample.MyData")
浏览 Annotation Store(注释存储)
既然您已经使用 Annotation Store UIMA 功能索引编译了类,可以浏览为保留 InterSystems IRIS NLP 生成的注释而创建的(Annotation Store )注释存储。
在浏览器中使用 URL 为实例打开 Management Portal (管理门户),如InterSystems IRIS Basics: Connecting an IDE(《INTERSYSTEMS IRIS 基础:连接一个IDE 》)的InterSystems IRIS Connection Information(InterSystems IRIS 连接信息)所述。
使用标题中的链接切换到 Samples 命名空间。
参观 UIMA 分析管道
进入 System Explorer(系统资源管理器)> SQL 。
展开左侧窗格中的 Tables(表) 列表。
可以看到 Annotation Store (注释存储) 的三个表。这些表的命名规则对应包含所分析的非结构化文本的表 (Sample.MyData)。
Sample_MyData.Type------包含此存储中使用的Annotation Types (注释类型)的概述。
Sample_MyData.Sofa------包含 sofas,这是 UIMA 分析引擎分析的文本对象。
Sample_MyData.Annotation------包含该分析引擎生成的注释。
您可以修改功能索引定义以创建多个注释表,然后根据注释类型将结果输出到正确的表中。
通过分析管道发送新文本
InterSystems IRIS 中 UIMA 分析管道的强大之处在于,新的非结构化文本会自动通过管道发送以进行分析,并将结果添加到 Annotation Store (注释存储)中。由于您已经创建了 Annotation Store(注释存储),可以看到新纪录如何被添加到 Sample.MyData 表,并生成添加到 Annotation Store的新条目。
向 Aviation.Event 表添加记录
在本步骤中,您将使用 SQL 向示例数据库中的 Sample.MyData 表添加一些非结构化文本。请记住,该表包含MyText 列,您已在该列上定义功能索引。正如您将看到的,当进行此插入操作时,会自动生成注释。
在System Explorer (系统资源管理器 )> SQL页,展开左侧窗格中的 Tables(表) 列表。
选择 Sample.MyData,这是包含通过分析管道发送的非结构化文本的表。
在右侧窗格中,单击 Execute Query(执行查询)标签。
要将新条目插入示例数据库,请在文本框中输入以下查询
xxxxxxxxxx
INSERT INTO Sample.MyData (MyText) VALUES (\'First Look unstructured text\')
点击 Execute (执行)。
这会将短语"First Look unstructured text"放入 Sample.MyData 表的 MyText 列中。
了解更多关于 UIMA的资料
查看Annotation Store(注释存储)中的新条目
现在您已将新的非结构化文本添加到示例数据库中,可以查看 Annotation Store 以了解这些文本是如何通过分析管道自动发送的。您可以看到新的非结构化文本和来自 InterSystems IRIS NLP 的注释都添加到了Annotation Store(注释存储)中。
在 System Explorer (系统资源管理器 )> SQL页,展开左侧窗格中的 Tables(表) 列表。
选择 Sample_MyData.Sofa 表。
在右侧窗格中,单击 Open Table(打开表)。
您可以看到添加到 Annotation Store 的新记录。sofaString是由分析管道处理的一段非结构化文本。
点击 Close Window(关闭窗口)。
在左侧窗格中,选择 Sample_MyData.Annotation 表。
点击 Open Table(打开表)。
在coveredText列,您可以看到由 InterSystems IRIS NLP 分析引擎生成的注释。
了解更多关于 UIMA的资料
要了解有关 InterSystems IRIS 如何实施和补充 UIMA 的更多信息,请参阅 Using InterSystems UIMA(《使用 InterSystems UIMA》)。
有关 UIMA 标准的框架、基础设施和组件的详细概述,请参阅 Apache UIMA home page
文章
jieliang liu · 九月 22, 2021
技术概要:ADO.NET 和 InterSystems 产品
本技术概要(First Look)解释了如何通过 InterSystems ADO.NET Managed Provider 连接到 InterSystems IRIS®数据平台。一旦根据本指南完成操作,就意味着您已经配置了一个 Visual Studio 项目来使用 InterSystems.Data.IRISClient.dll 程序集,建立了到 InterSystems IRIS 的 ADO.NET 连接,从您的 .NET 应用程序运行多个 SQL 语句,并在 InterSystems IRIS 系统管理门户(InterSystems IRIS System Management Portal)中确认这些语句的效果。
为了让您体验一下 ADO.NET Managed Provider,而又不陷入细节的困境,我们会确保这一探索简洁可行。这些活动被设计成只使用默认设置和功能,这样您就可以熟悉功能的基本原理,而不必处理那些离题或过于复杂的细节。当您将 ADO.NET 引入您的生产系统时,您可能需要做一些不同的事情。请确保不要把这种对 ADO.NET 的探索与真实的东西混淆起来! 本文档末尾提供的参考资料将使您对在生产中使用 ADO.NET 所涉及的内容有一个很好的了解。
有关 ADO.NET 的更多文档,请参见结尾处的 Learn More About ADO.NET(了解更多有关 ADO.NET 的信息)。
要浏览所有的技术概要(First Look),包括可以在 InterSystems IRIS 免费的评估实例上执行的那些,请参见 InterSystems First Looks(《InterSystems 技术概要》)。
为什么 ADO.NET 很重要
ADO.NET 是来自 Microsoft .NET Framework 的数据访问技术,提供对数据源的访问。它用于建立数据库连接,并为 .NET Framework 程序员提供一种标准、可靠的方式,来连接到多种类型的数据源或使用 SQL 对它们进行操作。通过 ADO.NET Managed Provider 连接到 InterSystems IRIS 很简单,特别是如果您以前使用过 ADO.NET。从 .NET 应用程序建立到 InterSystems IRIS 的 ADO.NET 连接,允许您从 .NET 应用程序对 InterSystems IRIS 数据库运行 SQL 命令。
如果您是 InterSystems IRIS 的新手,但熟悉 .NET 和 SQL,您可以立即使用现有的专业知识来帮助您熟悉数据库平台。您可以在开发环境中测试 ADO.NET 连接和 SQL 命令,只需几行代码。
ADO.NET 和 InterSystems IRIS
InterSystems IRIS 是完全符合 ADO.NET 规范的实现。InterSystems ADO.NET Managed Provider 提供对数据的简单关系访问。它处理来自应用程序的 ADO.NET 方法调用,并向 InterSystems IRIS 提交 SQL 请求。然后将结果返回给调用的应用程序------在本例中,就是您的 .NET 应用程序。
通过 ADO.NET 连接到 InterSystems IRIS 是一个非常简单的过程。
为了使用 InterSystems IRIS ADO.NET 功能,您必须首先将 InterSystems.Data.IRISClient.dll 程序集作为依赖项添加到 Visual Studio 项目中。确认一些设置后,使用我们的示例代码建立到 InterSystems IRIS 的 ADO.NET
探索 ADO.NET
连接,并执行 SQL 查询。请注意,InterSystems.Data.IRISClient.dll 程序集自始至终都是使用 .NET 管理代码实现的,这使得在 .NET 环境中部署它很容易。它是线程安全(thread-safe)的 ,可以在多线程的 .NET 应用程序中使用。
探索 ADO.NET
我们开发了一个简短的演示,向您展示如何使用 ADO.NET 和 InterSystems IRIS。(想试试 InterSystems IRIS .NET 开发和互操作性功能的在线视频演示?请看.NET QuickStart(.NET 快速入门)!)
用前须知
要使用这个程序,您需要一个安装了 .NET 框架和 Visual Studio 的 Windows 系统,以及一个运行中的 InterSystems IRIS 实例来连接。您对 InterSystems IRIS 的选择包括多种类型的已授权的和免费的评估实例;实例不需要由您正在工作的系统托管(尽管它们必须相互具有网络访问权限)。有关如何部署每种类型的实例的信息(如果您还没有可使用的实例) ,请参见 InterSystems IRIS Basics:Connecting an IDE(《InterSystems IRIS 基础:连接一个 IDE》)中的 Deploying InterSystems IRIS(部署 InterSystems IRIS)。使用同一文档中的 InterSystems IRIS Connection Information(InterSystems IRIS 连接信息)和 .Net IDE 中的信息将 Visual Studio 连接到您的 InterSystems IRIS 实例。
配置 Visual Studio 项目
在 Visual Studio 主菜单中,通过选择 File(文件) > New (新的)> Project(项目)创建一个新项目。在出现的对话框中,点击 Visual C# 选项,并选择 Console App (.NET Framework)(控制台应用程序(.NET 框架))。对于 Name(名称) 字段,输入 ADONET。点击 OK(確定)。这将使用 .NET Framework 创建一个新的控制台(console)应用程序。
下一步,在 Visual Studio 主菜单中,选择 Project(项目) > ADONET Properties(ADONET 属性)。在 Target framework(目标框架)下,选择 .NET Framework 4.5(.NET 框架 4.5)。
添加程序集引用
InterSystems.Data.IRISClient.dll 程序集必须安装在您的本地系统上。您可以通过克隆 repo https://github.com/intersystems/quickstarts-dotnet/tree/master/EFPlay/bin/Debug 或从该 repo 下载文件来获取它。如果 InterSystems IRIS 安装在您的本地系统或您可以访问的另一个系统上,则该程序集已经安装在子目录 install-dirdevdotnetbinv4.5 中,其中 install-dir 是该实例的安装目录。
要将 InterSystems.Data.IRISClient.dll 的程序集引用添加到项目:
从 Visual Studio 主菜单中,选择 Project(项目) > Add Reference(添加引用)...
在出现的窗口中,点击 Browse(浏览)....
浏览到 InterSystems.Data.IRISClient.dll 文件的位置。
选择文件并点击 Add(添加)。
点击 OK(確定)。
在 Visual Studio Solution Explorer 中, InterSystems.Data.IRISClient.dll 程序集现在应该列在 Reference(引用)下。
探索 ADO.NET
通过 ADO.NET 连接
现在,您可以从 .NET 应用程序连接到 InterSystems IRIS 了。InterSystems ADO.NET Managed Provider 的连接字符串是由定义连接属性的键/值对组成的。连接字符串的语法是:
Server=host_IP; Port=superserverPort; Namespace=namespace; Password=password; User ID=username;
其中的变量表示 InterSystems IRIS 实例主机的 IP 地址、实例的超级服务器端口、实例上的命名空间和实例的凭据(credentials)。这与您在连接 Visual Studio 到您的实例时使用的信息相同,如用前须知中所述。
将其粘贴到 Visual Studio 后,在随后的代码中更新该信息。您可以将命名空间设置为预定义的命名空间 USER,如所示,或者设置为您在已安装的实例上创建的另一个命名空间。
using System;
using InterSystems.Data.IRISClient;
namespace ADONET
{
class Program
{
static void Main(string[] args)
{
String host = "<host>"; String port = "<port>";
String username = "<username>"; String password = "<password>"; String Namespace = "USER";
IRISConnection IRISConnect = new IRISConnection(); IRISConnect.ConnectionString = "Server = " + host
+ "; Port = " + port + "; Namespace = " + Namespace
+ "; Password = " + password + "; User ID = " + username;
IRISConnect.Open();
String sqlStatement1 = "CREATE TABLE People(ID int, FirstName varchar(255), LastName varchar(255))";
String sqlStatement2 = "INSERT INTO People VALUES (1, 'John', 'Smith')"; String sqlStatement3 = "INSERT INTO People VALUES (2, 'Jane', 'Doe')"; String queryString = "SELECT * FROM People";
IRISCommand cmd1 = new IRISCommand(sqlStatement1, IRISConnect); IRISCommand cmd2 = new IRISCommand(sqlStatement2, IRISConnect); IRISCommand cmd3 = new IRISCommand(sqlStatement3, IRISConnect); IRISCommand cmd4 = new IRISCommand(queryString, IRISConnect);
//ExecuteNonQuery() is used for CREATE, INSERT, UPDATE, and DELETE SQL Statements cmd1.ExecuteNonQuery();
cmd2.ExecuteNonQuery(); cmd3.ExecuteNonQuery();
//ExecuteReader() is used for SELECT IRISDataReader Reader = cmd4.ExecuteReader();
Console.WriteLine("Printing out contents of SELECT query: "); while (Reader.Read())
{
+ ", "
Console.WriteLine(Reader.GetValue(0).ToString() + ", " + Reader.GetValue(1).ToString()
+ Reader.GetValue(2).ToString());
}
Reader.Close(); cmd1.Dispose(); cmd2.Dispose(); cmd3.Dispose(); cmd4.Dispose(); IRISConnect.Close();
Console.WriteLine("Press any key to continue...");
Console.ReadKey();
}
}
}
通过点击 Start(开始)按钮,或按 F5 键来运行代码。
如果连接和查询已经成功完成,您应该会看到一个控制台(console)窗口,其中包含 SELECT 查询的结果。
确认管理门户(Management Portal)的变更
接下来,使用以下程序在管理门户(Management Portal)中确认您的结果:
使用 InterSystems IRIS Basics:Connecting an IDE(《InterSystems IRIS 基础:连接一个 IDE》)中为您的实例描述的 URL ,在浏览器中打开您的实例的管理门户(Management Portal)。
如果您不在代码指定的命名空间中,请切换到该命名空间(点击页面顶部 Namespace(命名空间):指示器旁边的 Switch(切换))。
导航到 SQL 页面(System Explorer(系统资源管理器) > SQL),然后点击 Execute Query(执行查询)标签,并粘贴以下 SQL 查询:
SELECT
ID, FirstName, LastName FROM SQLUser.People
点击 Execute(执行)。该页面应该显示在示例代码中创建的 People 表的内容。
了解更多有关 ADO.NET 的信息
要了解更多有关 ADO.NET、SQL 和 InterSystems IRIS 的信息请参见:
Using the InterSystems Managed Provider for .NET(《使用 .NET 的 InterSystems Managed Provider》)
Using InterSystems SQL(《使用 InterSystems SQL》)
ADO.NET Overview(《ADO.NET 概述》)