Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

ExternalFileServices という名前の再利用可能パーツを作成します。

Image Modified






この再利用可能パーツを変更して、以前定義した ExternalServiceBase を継承するようにします。

Image Modified






SetupUrlBuilder メソッドを再定義して、ファイル・サービスのパス・コンポーネントを追加します。

...

ファイル・サービスのパスに対するベース URL には追加のパス・コンポーネント'files' があります。ですから、ExternalFileServicesSetupUrlBuilder メソッドでは、URL に 'files' を付ける必要があります。

Mthroutine Name(SetupUrlBuilder) Options(*REDEFINE)
      * 最初に祖先の SetupUrlBuilder を起動
   #COM   #COM_ANCESTOR.SetupUrlBuilder UrlBuilder(#UrlBuilder)
      * 次にこのクラスを実装
   #UrlBuilder   #UrlBuilder.AddPathComponent( 'files' )
Endroutine

次に RDMLX 再利用可能パーツに copy メソッドを実装してみましょう。

     Mthroutine Name(Copy)
        * パラメータ

...

        Define_Map For(*INPUT) Class(#PRIM_DC.UnicodeString) Name(#SourcePath)

...

        Define_Map For(*INPUT) Class(#PRIM_DC.UnicodeString) Name(#TargetPath)
        * 変数

...

        Define_Com Class(#XPRIM_UriBuilder) Name(#Url)

...

        Define_Com Class(#XPRIM_HttpRequest) Name(#Request)
        * URL のベース・プロパティ設定

...

        #COM_SELF.SetupUrlBuilder Urlbuilder(#Url)
        * 'copy' パス・コンポーネント追加

...

        #Url.AddPathComponent Pathcomponent('copy')
        * フォームのパラメータ追加

...

        #Request.Content.AddUrlEncodedFormValue Name('sourcePath') Value(#SourcePath)

...

        #Request.Content.AddUrlEncodedFormValue Name('targetPath') Value(#TargetPath)
        * HTTP 要求の実行

...

        #Request.DoPost Url(#Url)
     Endroutine


次は: サービス呼び出し後のエラー・メッセージを取得