SystemDocumentVersion:スコープ対象、グローバル

  • リリースバージョン: Yokohama
  • 更新日 2025年01月30日
  • 所要時間:8分
  • SystemDocumentVersion API は、バージョン [ds_document_version] テーブルでドキュメントのソースバージョンの値を設定するためのメソッドを提供します。

    この API は ドキュメント管理 プラグイン (com.snc.platform_document_management) を必要とし、 sn_doc_services 名前空間内で提供されます。詳細については、「 ドキュメント サービス」を参照してください。

    ドキュメントバージョンを作成するには、 DocumentVersionService API を使用します。

    SystemDocumentVersion:SystemDocumentVersion(文字列 docSysId)

    SystemDocumentVersion オブジェクトをインスタンス化します。

    表 : 1. パラメーター
    名前 タイプ 説明
    docSysID 文字列 ドキュメント [ds_document] テーブル内のドキュメントレコードのSys_id。
    表 : 2. 戻り値
    タイプ 説明
    なし

    次の例は、 SystemDocumentVersion オブジェクトをインスタンス化し、ドキュメントバージョンを作成する方法を示しています。「 DocumentVersionService」も参照してください。

    var versionDefinition = new sn_doc_services.SystemDocumentVersion('491efbee24187410f877a6fed1c2b0a9');
    
    versionDefinition.type('url');
    versionDefinition.url('http://one/1.0');
    
    var versionSvc = new sn_doc_services.DocumentVersionService();
    gs.info(JSON.stringify(versionSvc.createDocumentVersion(versionDefinition), null, 2));

    出力:

    {
      "message": "Adding an entry to DocumentVersion for the given docId : 491efbee24187410f877a6fed1c2b0a9, sysId : d5a340d9242cf810f877a6fed1c2b069 is successful.",
      "request_id": "d5a340d9242cf810f877a6fed1c2b069",
      "status": "success"
    }

    SystemDocumentVersion:document(文字列 docSysId)

    このバージョンのドキュメントレコードを指定します。

    注:
    代わりに、 SystemDocumentVersion() コンストラクターで名前をパラメーターとして設定することもできます。
    表 : 3. パラメーター
    名前 タイプ 説明
    docSysID 文字列 ドキュメント [ds_document] テーブル内のドキュメントレコードのSys_id。
    表 : 4. 戻り値
    タイプ 説明
    なし

    次の例は、ドキュメントバージョンの名前フィールドを設定する方法を示しています。DocumentVersionServicecreateDocumentVersion() も参照してください。

    var versionDefinition = new sn_doc_services.SystemDocumentVersion();
    
    versionDefinition.document('491efbee24187410f877a6fed1c2b0a9');
    
    var versionSvc = new sn_doc_services.DocumentVersionService();
    gs.info(JSON.stringify(versionSvc.createDocumentVersion(versionDefinition), null, 2));
    出力:
    {
      "message": "Adding an entry to DocumentVersion for the given docId : 491efbee24187410f877a6fed1c2b0a9, sysId : 1c504c91242cf810f877a6fed1c2b08b is successful.",
      "request_id": "1c504c91242cf810f877a6fed1c2b08b",
      "status": "success"
    }

    SystemDocumentVersion:type(文字列 docType)

    ドキュメントバージョンの [タイプ] フィールドを設定します。

    表 : 5. パラメーター
    名前 タイプ 説明
    docType 文字列 ドキュメントソースタイプ。
    有効な値:
    • URL
    • 添付ファイル
    デフォルト:添付ファイル
    注:
    添付ファイルは現在、ドキュメントバージョン [ds_document_version] テーブルの UI でのみ追加でき、API では追加できません。
    表 : 6. 戻り値
    タイプ 説明
    なし

    次の例は、タイプフィールドを設定し、ドキュメントバージョンを作成する方法を示しています。「 DocumentVersionService」も参照してください。

    var versionDefinition = new sn_doc_services.SystemDocumentVersion('491efbee24187410f877a6fed1c2b0a9');
    
    versionDefinition.type('url');
    versionDefinition.url('http://one/1.0');
    
    var versionSvc = new sn_doc_services.DocumentVersionService();
    gs.info(JSON.stringify(versionSvc.createDocumentVersion(versionDefinition), null, 2));
    {
      "message": "Adding an entry to DocumentVersion for the given docId : 491efbee24187410f877a6fed1c2b0a9, sysId : d5a340d9242cf810f877a6fed1c2b069 is successful.",
      "request_id": "d5a340d9242cf810f877a6fed1c2b069",
      "status": "success"
    }

    SystemDocumentVersion:url(文字列 url)

    ドキュメントバージョンの URL を設定します。

    表 : 7. パラメーター
    名前 タイプ 説明
    URL 文字列 このバージョンのソースドキュメントの URL。
    表 : 8. 戻り値
    タイプ 説明
    なし

    次の例は、[URL] フィールドをドキュメントバージョンのソースとして設定する方法を示しています。「 DocumentVersionService」も参照してください。

    var versionDefinition = new sn_doc_services.SystemDocumentVersion('491efbee24187410f877a6fed1c2b0a9');
    
    versionDefinition.type('url');
    versionDefinition.url('http://one/1.0');
    
    var versionSvc = new sn_doc_services.DocumentVersionService();
    gs.info(JSON.stringify(versionSvc.createDocumentVersion(versionDefinition), null, 2));
    {
      "message": "Adding an entry to DocumentVersion for the given docId : 491efbee24187410f877a6fed1c2b0a9, sysId : d5a340d9242cf810f877a6fed1c2b069 is successful.",
      "request_id": "d5a340d9242cf810f877a6fed1c2b069",
      "status": "success"
    }

    SystemDocumentVersion:versionNumber(数値 versionNumber)

    ドキュメントバージョンの番号を設定します。

    表 : 9. パラメーター
    名前 タイプ 説明
    バージョン番号 番号 このドキュメントのバージョン番号。
    表 : 10. 戻り値
    タイプ 説明
    なし

    次の例は、バージョン番号を設定してドキュメントバージョンを作成する方法を示しています。「 DocumentVersionService」も参照してください。

    var versionDefinition = new sn_doc_services.SystemDocumentVersion('491efbee24187410f877a6fed1c2b0a9');
    
    versionDefinition.type('url');
    versionDefinition.url('http://one/1.0');
    versionDefinition.versionNumber(5);
    
    var versionSvc = new sn_doc_services.DocumentVersionService();
    gs.info(JSON.stringify(versionSvc.createDocumentVersion(versionDefinition), null, 2));
    出力:
    {
      "message": "Adding an entry to DocumentVersion for the given docId : 491efbee24187410f877a6fed1c2b0a9, sysId : ff47449d242cf810f877a6fed1c2b06c is successful.",
      "request_id": "ff47449d242cf810f877a6fed1c2b06c",
      "status": "success"
    }