New post

查找

Article
· Dec 18, 2024 1m read

Producing PDF class documentation using Doxygenerate

A benefit of using Doxygenerate is that Doxygen does more than just HTML output. Tweak the Doxyfile that tells Doxygen what to do and you can easily create a PDF. Our example MARINA application yielded a 524-page PDF. Here's what page 94 looks like:

You can browse the whole file here.

In the screenshot above, notice how we only get details of the superclass that is part of the app (AuditHistory). The primary superclass, %Library.SerialObject, is shown faded and with no details of what BankDetails inherits from it.

With another tweak to the Doxyfile we can show full inheritance detail in a 586-page PDF. Here's the same BankDetails page:

Of course these diagrams also appear in the HTML version.

Like what you see? There's still time to vote for Doxygenerate in the contest.

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

IRIS技術ガイド

Caché技術ガイドのいくつかをIRIS版に書き換えた文書を作成しましたので公開します。

IRISファーストステップガイド

IRISBasicTechnologyGuide

- ObjectScript操作ガイド

- オブジェクト操作ガイド

- 多次元データエンジンの概念およびアーキテクチャー

IRIS SQLガイド

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

既存のセキュリティ設定をプログラムで変更する方法

こちらの記事では、既存のユーザ設定をプログラムで変更する方法をご紹介します。

ユーザロールを追加/削除したい、有効期限設定を変更したい、等の場合にお役立てください。

なお、ユーザ設定をプログラムで新規作成する方法は こちら の記事で紹介しております。
 


1.ある特定ユーザの設定を参照+変更する方法

2.既存の全てのユーザの設定を参照する方法

3.おまけ(Webアプリケーション情報の参照+変更)



1.ある特定ユーザの設定を参照+変更する方法

// ユーザを指定してロールを確認する(以下の例は、test ユーザ)
USER>zn "%SYS"
%SYS>do ##class(Security.Users).Get("test",.prop)

; 全プロパティ確認 
%SYS>zwrite prop       
prop("AccountNeverExpires")=0
prop("AutheEnabled")=0
prop("ChangePassword")=0
:
prop("Roles")="%DB_USER,%Developer,testrole"
; もしくは以下で直接取得
$SYS>write prop("Roles")
%DB_USER,%Developer,testrole

; ロールの追加をしたいとき
%SYS>write ##class(Security.Users).AddRoles("test","%SQL")  
1
%SYS>kill
%SYS>do ##class(Security.Users).Get("test",.prop)
 
%SYS>write prop("Roles")
%DB_USER,%Developer,%SQL,testrole

; Modify() メソッドでロールを変更することも可能
%SYS>set prop("Roles")="%Developer,testrole"
%SYS>write ##class(Security.Users).Modify("test",.prop)
1
%SYS>kill
%SYS>do ##class(Security.Users).Get("test",.prop)
 
%SYS>w prop("Roles")
%Developer,testrole

; ロールの削除をしたいとき(複数の時はカンマ区切り)
%SYS>write ##class(Security.Users).RemoveRoles("test","testrole")
1
%SYS>kill
%SYS>do ##class(Security.Users).Get("test",.prop)
 
%SYS>write prop("Roles")
%Developer
; 指定されたロール (またはロールのリスト) に特定のSQL特権を付与する場合
; 以下の例は、testroleロールに スキーマ=Sampleの、Insert,Update,Select,Delete権限を付与する
; 権限を付与したいスキーマ・テーブルのあるネームスペースで実行する
%SYS>zn "user"
USER>write $SYSTEM.SQL.Security.GrantPrivilege("Insert,Update,Select,Delete","Sample","Schema","testrole")
1


2.既存の全てのユーザの設定を参照する方法(例:ロール)

%SYS>set stmt=##class(%SQL.Statement).%New()
 
%SYS>write stmt.%PrepareClassQuery("Security.Users","List")
1
%SYS>set rs=stmt.%Execute()
 
%SYS>while rs.%Next() { write !,rs.%Get("Name")," || ",rs.%Get("Roles") }
 
Admin || %EnsRole_Administrator,%EnsRole_Developer,%Manager
CSPSystem ||
IAM || %IAM_API
SuperUser || %All
UnknownUser || %All
_Ensemble || %All
_PUBLIC ||
_SYSTEM || %All
test ||

※Listクエリの詳細情報はこちら、さらに詳しい情報が必要な場合は Detailクエリ を使用してください。


3.おまけ

Webアプリケーション情報(Security.Applications)や、ロールの情報(Security.Roles)等の、セキュリティ情報についても、同様の手順で参照・変更することが可能です。

*「RESTのディスパッチクラス」を参照・変更したいとき

// 既存のWebアプリケーション設定のディスパッチクラスを編集する場合
%SYS>do ##class(Security.Applications).Get("/csp/user/rest",.prop)
 
%SYS>zwrite prop
prop("AutheEnabled")=64
prop("AutoCompile")=1
prop("CSPZENEnabled")=1
prop("CSRFToken")=0
prop("ChangePasswordPage")=""
prop("CookiePath")="/csp/user/rest/"
prop("DeepSeeEnabled")=0
prop("Description")=""
prop("DispatchClass")="User.REST"%SYS>set Properties("DispatchClass")="User.REST2"   // ディスパッチクラスを変更
%SYS>write ##class(Security.Applications).Modify("/csp/user/rest",.Properties)
1


*「許可された認証方法」を参照・変更したいとき(例:認証なし+パスワード ⇒ パスワード)

%SYS>do ##class(Security.Applications).Get("/csp/user",.prop)
 
%SYS>zwrite prop
prop("AutheEnabled")=96           // 96 : 0110 0000(Bit 5 + Bit 6)
prop("AutoCompile")=1
prop("CSPZENEnabled")=1%SYS>set prop("AutheEnabled")=32    // 32 : 0010 0000 (Bit 5)
%SYS>write ##class(Security.Applications).Modify("/csp/user",.prop)
1
// AutheEnabled
// Bit 2 = AutheK5API
// Bit 4 = AutheOS
// Bit 5 - AuthePassword
// Bit 6 = AutheUnauthenticated
// Bit 11 = AutheLDAP
// Bit 13 = AutheDelegated
// Bit 14 = LoginToken
// Bit 20 = TwoFactorSMS
// Bit 21 = TwoFactorPW


詳細はクラスリファレンスをご覧ください。

Securityパッケージ

Discussion (0)0
Log in or sign up to continue
Question
· Dec 17, 2024

Converting iris stream to python bytes is very slow

I'm trying to use embedded python code that receives an Iris %Stream.GlobalBinary and uses image manipulation library PIL.

Because PIL can't work with IRIS %Stream, I need to convert the image to python bytes.

This process seems to have very bad performance compared to writing to a file and then loading it from a file in python.

Is there a better way to send a stream into python? The conversion code I'm using is below.

Thanks.

def iris_stream_to_bytes(stream):
	stream.Rewind()
	s = ""
	while not stream.AtEnd:
		r = stream.Read(1024)
		s += r
	b = bytearray()
	b.extend(map(ord, s))
	return b
5 Comments
Discussion (5)1
Log in or sign up to continue