You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

[ |../../index.htm#lansa/vlwebeng01_0505.htm]
現在地:

3.3.2 サーバー処理

データやサーバー側の処理へのアクセスは、サーバー・モジュール内にコーディングされたサーバー・ルーチン (SrvRoutine) を使用します。
以下に示すソース例は、テーブル xEmployee の全社員のリストをサムネイル画像とともに作成し、呼び出している Web ページまたは再利用可能パーツに完成されたリストを戻すサーバー・ルーチンです。データは JSON 形式で送信され、自動的にクライアント側の対応する LANSA フィールドやリストに変換されます。
Def_list Name(#employees) Fields(#xEmployeeIdentification #xEmployeeSurname #xEmployeeGivenNames #xEmployeeImageThumbnail …) Type(*working)
 
SrvRoutine Name(GetEmployees)
List_Map For(*Output) List(#Employees)
 

  • 全社員データ取得
    Select Fields(#Employees) From_File(xEmployee)
     
  • 社員のサムネイル画像取得。BLOBとして保存
    Fetch Fields(#Employees) From_File(xEmployeeImages)With_key(#xEmployeeIdentification)
     
    Add_Entry To_List(#Employees)
     
    Endselect
     
    Endroutine
     
    [ |../../index.htm#lansa/vlwebeng01_0505.htm]
  • No labels