SystemDocument - スコープ指定、グローバル
SystemDocument API は、ドキュメント [ds_document] テーブル内のレコードのフィールドを設定するためのメソッドを提供します。
この API は、ドキュメント管理 プラグイン (com.snc.platform_document_management) を必要とし、sn_doc_services 名前空間内で提供されます。詳細については、「 ドキュメント サービス」を参照してください。
ドキュメントを作成するには、DocumentService API を使用します。
SystemDocument - SystemDocument(文字列 docName)
SystemDocument オブジェクトをインスタンス化します。
| 名前 | タイプ | 説明 |
|---|---|---|
| docName | 文字列 | ドキュメントの名前。 |
| タイプ | 説明 |
|---|---|
| なし |
次の例は、SystemDocument オブジェクトをインスタンス化し、ドキュメントレコードに複数のフィールドを設定する方法を示しています。「DocumentService API」も参照してください。
var d = new sn_doc_services.SystemDocument('My document');
// Define the document fields
var reviewers = '62826bf03710200044e0bfc8bcbe5df1,a8f98bb0eb32010045e1a5115206fe3a';
d.description('description');
d.classification('restricted');
d.state('review');
d.department('93b25282c0a8000b0b55c8ab34e2f1e6');
d.template(false);
d.type('policy');
d.reviewers(reviewers);
d.audience('external');
var s = new sn_doc_services.DocumentService();
gs.info(JSON.stringify(s.createDocument(d), null, 2));
{
"message": "Create document sysId : 1040420224503410f877a6fed1c2b031 is successful.",
"request_id": "1040420224503410f877a6fed1c2b031",
"status": "success"
}SystemDocument - audience(文字列 audience)
ドキュメントレコードの [対象者] フィールドを設定して、外部または内部の可用性を指定します。ドキュメント管理 フォームの [対象者] フィールドを示します。
| 名前 | タイプ | 説明 |
|---|---|---|
| audience | 文字列 | ドキュメントの対象者を表す文字列。 可能な値:
|
| タイプ | 説明 |
|---|---|
| なし |
次の例では、新しいドキュメントレコード内で [対象者] フィールドを設定する方法を示します。「DocumentService - スコープ付き、グローバル」も参照してください。
var d = new sn_doc_services.SystemDocument('My document');
var s = new sn_doc_services.DocumentService();
d.audience('external');
gs.info(JSON.stringify(s.createDocument(d), null, 2));
{
"message": "Create document sysId : 1193fd4624103410f877a6fed1c2b016 is successful.",
"request_id": "1193fd4624103410f877a6fed1c2b016",
"status": "success"
}SystemDocument - classification(文字列 classification)
情報の機密性のレベルを識別するために、ドキュメントレコードの [分類] フィールドを設定します。ドキュメント管理 フォームの [分類] フィールドを示します。
| 名前 | タイプ | 説明 |
|---|---|---|
| classification | 文字列 | ドキュメントの分類。 可能な値:
|
| タイプ | 説明 |
|---|---|
| 文字列 | SystemDocument オブジェクトの分類プロパティの値。 |
次の例では、新しいドキュメントレコード内の [分類] フィールドを設定する方法を示します。「DocumentService API」も参照してください。
var d = new sn_doc_services.SystemDocument('My restricted document');
var s = new sn_doc_services.DocumentService();
d.classification('restricted');
gs.info(JSON.stringify(s.createDocument(d), null, 2));
{
"message": "Create document sysId : d80435c624103410f877a6fed1c2b0d0 is successful.",
"request_id": "d80435c624103410f877a6fed1c2b0d0",
"status": "success"
}SystemDocument - createdFromTemplate(文字列 docTemplate)
ドキュメントを生成する際に使用するテンプレートを設定します。ドキュメントが生成されると、指定したテンプレートがドキュメント [ds_document_list] テーブルの [テンプレートから作成] フィールドのリストに表示されます。
| 名前 | タイプ | 説明 |
|---|---|---|
| docTemplate | 文字列 | ドキュメント [ds_document_lists] テーブルのリストにあるドキュメントの sys_id。ドキュメントで [テンプレート] チェックボックスがオンになっている (true) 必要があります。「DocumentVersionService API」も参照してください。 |
| タイプ | 説明 |
|---|---|
| なし |
次の例は、既存のテンプレートから新しいドキュメントレコードを作成する方法を示しています。「DocumentService API」も参照してください。
var d = new sn_doc_services.SystemDocument('New doc from template');
var s = new sn_doc_services.DocumentService();
d.createdFromTemplate('<doc_template_sys_id>');
gs.info(JSON.stringify(s.createDocument(d), null, 2));
{
"message": "Create document sysId : deaef1ce24103410f877a6fed1c2b085 is successful.",
"request_id": "deaef1ce24103410f877a6fed1c2b085",
"status": "success"
}SystemDocument - department(文字列 docDept)
ドキュメントレコードの [部門] フィールドを設定します。
| 名前 | タイプ | 説明 |
|---|---|---|
| docDept | 文字列 | 部門 [cmn_department] テーブルのリストにある部門の sys_id。 |
| タイプ | 説明 |
|---|---|
| なし |
次の例では、新しいドキュメントレコード内の [部門] フィールドを設定する方法を示します。「DocumentService API」も参照してください。
var d = new sn_doc_services.SystemDocument('My document');
// Assign the doc to the human resources department
d.department('<dept_sys_id>');
var s = new sn_doc_services.DocumentService();
gs.info(JSON.stringify(s.createDocument(d), null, 2));
{
"message": "Create document sysId : 491efbee24187410f877a6fed1c2b0a9 is successful.",
"request_id": "491efbee24187410f877a6fed1c2b0a9",
"status": "success"
}SystemDocument - description(文字列 description)
ドキュメントレコードの [説明] フィールドを設定します。
| 名前 | タイプ | 説明 |
|---|---|---|
| 説明 | 文字列 | ドキュメントの説明。 |
| タイプ | 説明 |
|---|---|
| なし |
次の例では、ドキュメントレコード内の [説明] フィールドを設定する方法を示します。「DocumentService API」も参照してください。
var d = new sn_doc_services.SystemDocument('My document');
d.description('Information describing the doc.');
var s = new sn_doc_services.DocumentService();
gs.info(JSON.stringify(s.createDocument(d), null, 2));
{
"message": "Create document sysId : 9acd7fea24587410f877a6fed1c2b060 is successful.",
"request_id": "9acd7fea24587410f877a6fed1c2b060",
"status": "success"
}SystemDocument - name(文字列 docName)
ドキュメントレコードの [名前] フィールドを設定します。
| 名前 | タイプ | 説明 |
|---|---|---|
| docName | 文字列 | ドキュメントの名前。 |
| タイプ | 説明 |
|---|---|
| なし |
次の例では、新しいドキュメントレコード内で [名前] フィールドを設定する方法を示します。「DocumentService API」も参照してください。
var d = new sn_doc_services.SystemDocument();
d.name('Document named using method instead of constructor');
var s = new sn_doc_services.DocumentService();
gs.info(JSON.stringify(s.createDocument(d), null, 2));
{
"message": "Create document sysId : c19d7f2624587410f877a6fed1c2b0eb is successful.",
"request_id": "c19d7f2624587410f877a6fed1c2b0eb",
"status": "success"
}SystemDocument - owner(文字列 owner)
ドキュメントレコードの [所有者] フィールドを設定します。
| 名前 | タイプ | 説明 |
|---|---|---|
| owner | 文字列 | ユーザー [sys_user] テーブルのリストにあるユーザーの sys_id。 必要なロール:admin デフォルト:現在のユーザー |
| タイプ | 説明 |
|---|---|
| なし |
次の例では、新しいドキュメントレコード内で [所有者] フィールドを設定する方法を示します。「DocumentService API」も参照してください。
var d = new sn_doc_services.SystemDocument('My document');
var s = new sn_doc_services.DocumentService();
d.owner('aa826bf03710200044e0bfc8bcbe5dd6');
gs.info(JSON.stringify(s.createDocument(d), null, 2));
{
"message": "Create document sysId : 4235318a24103410f877a6fed1c2b0ff is successful.",
"request_id": "4235318a24103410f877a6fed1c2b0ff",
"status": "success"
}SystemDocument - reviewers(文字列 reviewers)
ドキュメントレコードの [レビュー担当者] フィールドを設定します。
| 名前 | タイプ | 説明 |
|---|---|---|
| reviewers | 文字列 | 1 人以上のドキュメントレビュー担当者 (sys_id ごと) のリスト。レビュー担当者はユーザー [sys_user] テーブルのリスト内のユーザーである必要があります。 |
| タイプ | 説明 |
|---|---|
| なし |
次の例では、新しいドキュメントレコード内で [レビュー担当者] フィールドを設定する方法を示します。「DocumentService API」も参照してください。
var d = new sn_doc_services.SystemDocument('My document');
var reviewers = '62826bf03710200044e0bfc8bcbe5df1,a8f98bb0eb32010045e1a5115206fe3a';
d.reviewers(reviewers);
var s = new sn_doc_services.DocumentService();
gs.info(JSON.stringify(s.createDocument(d), null, 2));
{
"message": "Create document sysId : 8d19f9ca24103410f877a6fed1c2b0aa is successful.",
"request_id": "8d19f9ca24103410f877a6fed1c2b0aa",
"status": "success"
}SystemDocument - state(文字列 state)
ドキュメントレコードの [ステータス] フィールドを設定します。
| 名前 | タイプ | 説明 |
|---|---|---|
| state | 文字列 | ドキュメントがワークフロー内のどこにあるかを示すドキュメントのステータス。 有効な値:
|
| タイプ | 説明 |
|---|---|
| なし |
次の例では、新しいドキュメントレコード内で [ステータス] フィールドを設定する方法を示します。「DocumentService API」も参照してください。
var d = new sn_doc_services.SystemDocument('My document');
var s = new sn_doc_services.DocumentService();
d.state('submit');
gs.info(JSON.stringify(s.createDocument(d), null, 2));
{
"message": "Create document sysId : 19aab54e24103410f877a6fed1c2b03d is successful.",
"request_id": "19aab54e24103410f877a6fed1c2b03d",
"status": "success"
}SystemDocument - template(ブーリアン template)
ドキュメントレコードがテンプレートかどうかを指定します。
| 名前 | タイプ | 説明 |
|---|---|---|
| template | ブーリアン | ドキュメントレコードがテンプレートかどうかを指定するフラグ。 有効な値:
デフォルト値:false |
| タイプ | 説明 |
|---|---|
| なし |
次の例は、ドキュメントレコードがテンプレートであることを示す方法を示しています。「DocumentService API」も参照してください。
var d = new sn_doc_services.SystemDocument('My document');
d.template(true);
var s = new sn_doc_services.DocumentService();
gs.info(JSON.stringify(s.createDocument(d), null, 2));
{
"message": "Create document sysId : f7f006ce24103410f877a6fed1c2b053 is successful.",
"request_id": "f7f006ce24103410f877a6fed1c2b053",
"status": "success"
}SystemDocument - type(文字列 docType)
ドキュメントレコードの [タイプ] フィールドを設定します。
| 名前 | タイプ | 説明 |
|---|---|---|
| docType | 文字列 | ドキュメントのタイプ。 有効な値:
|
| タイプ | 説明 |
|---|---|
| なし |
次の例では、新しいドキュメントレコード内で [タイプ] フィールドを設定する方法を示します。「DocumentService API」も参照してください。
var d = new sn_doc_services.SystemDocument('How to use the document mgmt API');
var s = new sn_doc_services.DocumentService();
d.type('guideline');
gs.info(JSON.stringify(s.createDocument(d), null, 2));
{
"message": "Create document sysId : 8adfb10224503410f877a6fed1c2b0e4 is successful.",
"request_id": "8adfb10224503410f877a6fed1c2b0e4",
"status": "success"
}