database.anubis 1.45 KB
/*
 * Created by PyramIDE.
 * User: フランスのトトロ aka (David RENÉ) 
 * Date: 13/02/2016
 * Time: 10:38
 * © David RENÉ
 */

transmit app.anubis

transmit tools/basis.anubis
transmit system/muscle.anubis
transmit xlib/message_constants.anubis
transmit xlib/web/json.anubis
transmit hayamiki_lib/model/types/hk_database.anubis




  _HK_DATABASE message format:
  ============================
  
  +-----------+---------------+--------------------------
  |  name     |  type         |      description
  +-----------+---------------+--------------------------------
  | "name"    | String        | Name of the database
  | "apps"    | List(Message) | List of Application of the database the application Message id is _HK_APP
  


  _HK_DATABASE JSON format:
  =========================
  
  {
    "obj_type": "_HK_DATABASE", //_HK_DATABASE object type describe a database
    "name": "XXXX",             //name of database
    "apps":                     //list of applications
    [
      { "obj_type": "_HK_APP",  //_HK_APP object type describe an application
        "name" : "app_name"     //name of the current application
      },
      ... //anothers applications
    ]
  }

public define JsonValue
  to_JSON
  (
    HK_Database hk_db
  )=
  json_object(
  [ json_member("obj_type", json_string("_HK_DATABASE")),
    json_member("name",     json_string(hk_db.name)),
    json_member("apps",     json_array(map((HK_App app) |-> to_JSON(app), hk_db.apps)))
  ]).